@redocly/openapi-docs 3.19.0-next.9 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10902,7 +10902,7 @@ ${a}`).join(`\r
10902
10902
  `)[0]),this.originalError=t,this.source=a,Object.setPrototypeOf(this,kk.prototype);const[,r,n]=this.message.match(Nnt)||[];this.line=parseInt(r,10),this.col=parseInt(n,10)}}function na(e,t={}){return{name:`${e}List`,properties:{},items:e,...t}}function Qt(e,t={}){return{name:`${e}Map`,properties:{},additionalProperties:()=>e,...t}}const xg={name:"SpecExtension",properties:{},additionalProperties:{resolvable:!0}};function qE(e,t={}){const a={};for(const i of Object.keys(e))a[i]={...e[i],name:i};for(const i of Object.values(a))r(i);return a.SpecExtension=xg,a;function r(i){if(i.additionalProperties&&(i.additionalProperties=n(i.additionalProperties)),i.items&&(i.items=n(i.items)),i.properties){const o={};for(const[s,l]of Object.entries(i.properties))o[s]=n(l),t.doNotResolveExamples&&l&&l.isExample&&(o[s]={...l,resolvable:!1});i.properties=o}}function n(i){if(typeof i=="string"){if(!a[i])throw new Error(`Unknown type name found: ${i}`);return a[i]}else return typeof i=="function"?(o,s)=>n(i(o,s)):i&&i.name?(i={...i},r(i),i):i&&i.directResolveAs?{...i,directResolveAs:n(i.directResolveAs)}:i}}function wg(e){return typeof e?.name=="string"}function Ih(e,t){return e.hasOwnProperty(t)?e[t]:void 0}function C0(e,t){return e+"::"+t}function Dnt(){return new Promise(e=>{setTimeout(e)})}var Fne={},QE,qne;function gC(){if(qne)return QE;qne=1;const e="\\\\/",t=`[^${e}]`,a="\\.",r="\\+",n="\\?",i="\\/",o="(?=.)",s="[^/]",l=`(?:${i}|$)`,c=`(?:^|${i})`,u=`${a}{1,2}${l}`,d=`(?!${a})`,h=`(?!${c}${u})`,m=`(?!${a}{0,1}${l})`,v=`(?!${u})`,f=`[^.${i}]`,b=`${s}*?`,k={DOT_LITERAL:a,PLUS_LITERAL:r,QMARK_LITERAL:n,SLASH_LITERAL:i,ONE_CHAR:o,QMARK:s,END_ANCHOR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:h,NO_DOT_SLASH:m,NO_DOTS_SLASH:v,QMARK_NO_DOT:f,STAR:b,START_ANCHOR:c,SEP:"/"},x={...k,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${a}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${e}])${a}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"},w={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return QE={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:w,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(z){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${z.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(z){return z===!0?x:k}},QE}var Qne;function fC(){return Qne||(Qne=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:a,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:n}=gC();e.isObject=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),e.hasRegexChars=i=>r.test(i),e.isRegexChar=i=>i.length===1&&e.hasRegexChars(i),e.escapeRegex=i=>i.replace(n,"\\$1"),e.toPosixSlashes=i=>i.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const i=navigator.platform.toLowerCase();return i==="win32"||i==="windows"}return!1},e.removeBackslashes=i=>i.replace(a,o=>o==="\\"?"":o),e.escapeLast=(i,o,s)=>{const l=i.lastIndexOf(o,s);return l===-1?i:i[l-1]==="\\"?e.escapeLast(i,o,l-1):`${i.slice(0,l)}\\${i.slice(l)}`},e.removePrefix=(i,o={})=>{let s=i;return s.startsWith("./")&&(s=s.slice(2),o.prefix="./"),s},e.wrapOutput=(i,o={},s={})=>{const l=s.contains?"":"^",c=s.contains?"":"$";let u=`${l}(?:${i})${c}`;return o.negated===!0&&(u=`(?:^(?!${u}).*$)`),u},e.basename=(i,{windows:o}={})=>{const s=i.split(o?/[\\/]/:"/"),l=s[s.length-1];return l===""?s[s.length-2]:l}})(Fne)),Fne}var UE,Une;function $nt(){if(Une)return UE;Une=1;const e=fC(),{CHAR_ASTERISK:t,CHAR_AT:a,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:n,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:s,CHAR_LEFT_CURLY_BRACE:l,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_PLUS:d,CHAR_QUESTION_MARK:h,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:f}=gC(),b=x=>x===s||x===r,k=x=>{x.isPrefix!==!0&&(x.depth=x.isGlobstar?1/0:1)};return UE=(x,w)=>{const z=w||{},S=x.length-1,C=z.parts===!0||z.scanToEnd===!0,P=[],M=[],E=[];let D=x,I=-1,L=0,H=0,N=!1,Y=!1,te=!1,ne=!1,ee=!1,ce=!1,Z=!1,G=!1,J=!1,Q=!1,_=0,K,W,oe={value:"",depth:0,isGlob:!1};const le=()=>I>=S,be=()=>D.charCodeAt(I+1),Oe=()=>(K=W,D.charCodeAt(++I));for(;I<S;){W=Oe();let he;if(W===r){Z=oe.backslashes=!0,W=Oe(),W===l&&(ce=!0);continue}if(ce===!0||W===l){for(_++;le()!==!0&&(W=Oe());){if(W===r){Z=oe.backslashes=!0,Oe();continue}if(W===l){_++;continue}if(ce!==!0&&W===i&&(W=Oe())===i){if(N=oe.isBrace=!0,te=oe.isGlob=!0,Q=!0,C===!0)continue;break}if(ce!==!0&&W===n){if(N=oe.isBrace=!0,te=oe.isGlob=!0,Q=!0,C===!0)continue;break}if(W===m&&(_--,_===0)){ce=!1,N=oe.isBrace=!0,Q=!0;break}}if(C===!0)continue;break}if(W===s){if(P.push(I),M.push(oe),oe={value:"",depth:0,isGlob:!1},Q===!0)continue;if(K===i&&I===L+1){L+=2;continue}H=I+1;continue}if(z.noext!==!0&&(W===d||W===a||W===t||W===h||W===o)&&be()===c){if(te=oe.isGlob=!0,ne=oe.isExtglob=!0,Q=!0,W===o&&I===L&&(J=!0),C===!0){for(;le()!==!0&&(W=Oe());){if(W===r){Z=oe.backslashes=!0,W=Oe();continue}if(W===v){te=oe.isGlob=!0,Q=!0;break}}continue}break}if(W===t){if(K===t&&(ee=oe.isGlobstar=!0),te=oe.isGlob=!0,Q=!0,C===!0)continue;break}if(W===h){if(te=oe.isGlob=!0,Q=!0,C===!0)continue;break}if(W===u){for(;le()!==!0&&(he=Oe());){if(he===r){Z=oe.backslashes=!0,Oe();continue}if(he===f){Y=oe.isBracket=!0,te=oe.isGlob=!0,Q=!0;break}}if(C===!0)continue;break}if(z.nonegate!==!0&&W===o&&I===L){G=oe.negated=!0,L++;continue}if(z.noparen!==!0&&W===c){if(te=oe.isGlob=!0,C===!0){for(;le()!==!0&&(W=Oe());){if(W===c){Z=oe.backslashes=!0,W=Oe();continue}if(W===v){Q=!0;break}}continue}break}if(te===!0){if(Q=!0,C===!0)continue;break}}z.noext===!0&&(ne=!1,te=!1);let B=D,V="",de="";L>0&&(V=D.slice(0,L),D=D.slice(L),H-=L),B&&te===!0&&H>0?(B=D.slice(0,H),de=D.slice(H)):te===!0?(B="",de=D):B=D,B&&B!==""&&B!=="/"&&B!==D&&b(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),z.unescape===!0&&(de&&(de=e.removeBackslashes(de)),B&&Z===!0&&(B=e.removeBackslashes(B)));const q={prefix:V,input:x,start:L,base:B,glob:de,isBrace:N,isBracket:Y,isGlob:te,isExtglob:ne,isGlobstar:ee,negated:G,negatedExtglob:J};if(z.tokens===!0&&(q.maxDepth=0,b(W)||M.push(oe),q.tokens=M),z.parts===!0||z.tokens===!0){let he;for(let pe=0;pe<P.length;pe++){const U=he?he+1:L,ae=P[pe],ie=x.slice(U,ae);z.tokens&&(pe===0&&L!==0?(M[pe].isPrefix=!0,M[pe].value=V):M[pe].value=ie,k(M[pe]),q.maxDepth+=M[pe].depth),(pe!==0||ie!=="")&&E.push(ie),he=ae}if(he&&he+1<x.length){const pe=x.slice(he+1);E.push(pe),z.tokens&&(M[M.length-1].value=pe,k(M[M.length-1]),q.maxDepth+=M[M.length-1].depth)}q.slashes=P,q.parts=E}return q},UE}var WE,Wne;function Int(){if(Wne)return WE;Wne=1;const e=gC(),t=fC(),{MAX_LENGTH:a,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,s=(u,d)=>typeof d.expandRange=="function"?d.expandRange(...u,d):(u.sort(),`[${u.join("-")}]`),l=(u,d)=>`Missing ${u}: "${d}" - use "\\\\${d}" to match literal characters`,c=(u,d)=>{if(typeof u!="string")throw new TypeError("Expected a string");u=o[u]||u;const h={...d},m=typeof h.maxLength=="number"?Math.min(a,h.maxLength):a;let v=u.length;if(v>m)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${m}`);const f={type:"bos",value:"",output:h.prepend||""},b=[f],k=h.capture?"":"?:",x=e.globChars(h.windows),w=e.extglobChars(x),{DOT_LITERAL:z,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:P,DOTS_SLASH:M,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:I,QMARK:L,QMARK_NO_DOT:H,STAR:N,START_ANCHOR:Y}=x,te=ae=>`(${k}(?:(?!${Y}${ae.dot?M:z}).)*?)`,ne=h.dot?"":E,ee=h.dot?L:H;let ce=h.bash===!0?te(h):N;h.capture&&(ce=`(${ce})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const Z={input:u,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};u=t.removePrefix(u,Z),v=u.length;const G=[],J=[],Q=[];let _=f,K;const W=()=>Z.index===v-1,oe=Z.peek=(ae=1)=>u[Z.index+ae],le=Z.advance=()=>u[++Z.index]||"",be=()=>u.slice(Z.index+1),Oe=(ae="",ie=0)=>{Z.consumed+=ae,Z.index+=ie},B=ae=>{Z.output+=ae.output!=null?ae.output:ae.value,Oe(ae.value)},V=()=>{let ae=1;for(;oe()==="!"&&(oe(2)!=="("||oe(3)==="?");)le(),Z.start++,ae++;return ae%2===0?!1:(Z.negated=!0,Z.start++,!0)},de=ae=>{Z[ae]++,Q.push(ae)},q=ae=>{Z[ae]--,Q.pop()},he=ae=>{if(_.type==="globstar"){const ie=Z.braces>0&&(ae.type==="comma"||ae.type==="brace"),ve=ae.extglob===!0||G.length&&(ae.type==="pipe"||ae.type==="paren");ae.type!=="slash"&&ae.type!=="paren"&&!ie&&!ve&&(Z.output=Z.output.slice(0,-_.output.length),_.type="star",_.value="*",_.output=ce,Z.output+=_.output)}if(G.length&&ae.type!=="paren"&&(G[G.length-1].inner+=ae.value),(ae.value||ae.output)&&B(ae),_&&_.type==="text"&&ae.type==="text"){_.output=(_.output||_.value)+ae.value,_.value+=ae.value;return}ae.prev=_,b.push(ae),_=ae},pe=(ae,ie)=>{const ve={...w[ie],conditions:1,inner:""};ve.prev=_,ve.parens=Z.parens,ve.output=Z.output;const ge=(h.capture?"(":"")+ve.open;de("parens"),he({type:ae,value:ie,output:Z.output?"":P}),he({type:"paren",extglob:!0,value:le(),output:ge}),G.push(ve)},U=ae=>{let ie=ae.close+(h.capture?")":""),ve;if(ae.type==="negate"){let ge=ce;if(ae.inner&&ae.inner.length>1&&ae.inner.includes("/")&&(ge=te(h)),(ge!==ce||W()||/^\)+$/.test(be()))&&(ie=ae.close=`)$))${ge}`),ae.inner.includes("*")&&(ve=be())&&/^\.[^\\/.]+$/.test(ve)){const fe=c(ve,{...d,fastpaths:!1}).output;ie=ae.close=`)${fe})${ge})`}ae.prev.type==="bos"&&(Z.negatedExtglob=!0)}he({type:"paren",extglob:!0,value:K,output:ie}),q("parens")};if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(u)){let ae=!1,ie=u.replace(i,(ve,ge,fe,je,Ce,_e)=>je==="\\"?(ae=!0,ve):je==="?"?ge?ge+je+(Ce?L.repeat(Ce.length):""):_e===0?ee+(Ce?L.repeat(Ce.length):""):L.repeat(fe.length):je==="."?z.repeat(fe.length):je==="*"?ge?ge+je+(Ce?ce:""):ce:ge?ve:`\\${ve}`);return ae===!0&&(h.unescape===!0?ie=ie.replace(/\\/g,""):ie=ie.replace(/\\+/g,ve=>ve.length%2===0?"\\\\":ve?"\\":"")),ie===u&&h.contains===!0?(Z.output=u,Z):(Z.output=t.wrapOutput(ie,Z,d),Z)}for(;!W();){if(K=le(),K==="\0")continue;if(K==="\\"){const ve=oe();if(ve==="/"&&h.bash!==!0||ve==="."||ve===";")continue;if(!ve){K+="\\",he({type:"text",value:K});continue}const ge=/^\\+/.exec(be());let fe=0;if(ge&&ge[0].length>2&&(fe=ge[0].length,Z.index+=fe,fe%2!==0&&(K+="\\")),h.unescape===!0?K=le():K+=le(),Z.brackets===0){he({type:"text",value:K});continue}}if(Z.brackets>0&&(K!=="]"||_.value==="["||_.value==="[^")){if(h.posix!==!1&&K===":"){const ve=_.value.slice(1);if(ve.includes("[")&&(_.posix=!0,ve.includes(":"))){const ge=_.value.lastIndexOf("["),fe=_.value.slice(0,ge),je=_.value.slice(ge+2),Ce=r[je];if(Ce){_.value=fe+Ce,Z.backtrack=!0,le(),!f.output&&b.indexOf(_)===1&&(f.output=P);continue}}}(K==="["&&oe()!==":"||K==="-"&&oe()==="]")&&(K=`\\${K}`),K==="]"&&(_.value==="["||_.value==="[^")&&(K=`\\${K}`),h.posix===!0&&K==="!"&&_.value==="["&&(K="^"),_.value+=K,B({value:K});continue}if(Z.quotes===1&&K!=='"'){K=t.escapeRegex(K),_.value+=K,B({value:K});continue}if(K==='"'){Z.quotes=Z.quotes===1?0:1,h.keepQuotes===!0&&he({type:"text",value:K});continue}if(K==="("){de("parens"),he({type:"paren",value:K});continue}if(K===")"){if(Z.parens===0&&h.strictBrackets===!0)throw new SyntaxError(l("opening","("));const ve=G[G.length-1];if(ve&&Z.parens===ve.parens+1){U(G.pop());continue}he({type:"paren",value:K,output:Z.parens?")":"\\)"}),q("parens");continue}if(K==="["){if(h.nobracket===!0||!be().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(l("closing","]"));K=`\\${K}`}else de("brackets");he({type:"bracket",value:K});continue}if(K==="]"){if(h.nobracket===!0||_&&_.type==="bracket"&&_.value.length===1){he({type:"text",value:K,output:`\\${K}`});continue}if(Z.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(l("opening","["));he({type:"text",value:K,output:`\\${K}`});continue}q("brackets");const ve=_.value.slice(1);if(_.posix!==!0&&ve[0]==="^"&&!ve.includes("/")&&(K=`/${K}`),_.value+=K,B({value:K}),h.literalBrackets===!1||t.hasRegexChars(ve))continue;const ge=t.escapeRegex(_.value);if(Z.output=Z.output.slice(0,-_.value.length),h.literalBrackets===!0){Z.output+=ge,_.value=ge;continue}_.value=`(${k}${ge}|${_.value})`,Z.output+=_.value;continue}if(K==="{"&&h.nobrace!==!0){de("braces");const ve={type:"brace",value:K,output:"(",outputIndex:Z.output.length,tokensIndex:Z.tokens.length};J.push(ve),he(ve);continue}if(K==="}"){const ve=J[J.length-1];if(h.nobrace===!0||!ve){he({type:"text",value:K,output:K});continue}let ge=")";if(ve.dots===!0){const fe=b.slice(),je=[];for(let Ce=fe.length-1;Ce>=0&&(b.pop(),fe[Ce].type!=="brace");Ce--)fe[Ce].type!=="dots"&&je.unshift(fe[Ce].value);ge=s(je,h),Z.backtrack=!0}if(ve.comma!==!0&&ve.dots!==!0){const fe=Z.output.slice(0,ve.outputIndex),je=Z.tokens.slice(ve.tokensIndex);ve.value=ve.output="\\{",K=ge="\\}",Z.output=fe;for(const Ce of je)Z.output+=Ce.output||Ce.value}he({type:"brace",value:K,output:ge}),q("braces"),J.pop();continue}if(K==="|"){G.length>0&&G[G.length-1].conditions++,he({type:"text",value:K});continue}if(K===","){let ve=K;const ge=J[J.length-1];ge&&Q[Q.length-1]==="braces"&&(ge.comma=!0,ve="|"),he({type:"comma",value:K,output:ve});continue}if(K==="/"){if(_.type==="dot"&&Z.index===Z.start+1){Z.start=Z.index+1,Z.consumed="",Z.output="",b.pop(),_=f;continue}he({type:"slash",value:K,output:C});continue}if(K==="."){if(Z.braces>0&&_.type==="dot"){_.value==="."&&(_.output=z);const ve=J[J.length-1];_.type="dots",_.output+=K,_.value+=K,ve.dots=!0;continue}if(Z.braces+Z.parens===0&&_.type!=="bos"&&_.type!=="slash"){he({type:"text",value:K,output:z});continue}he({type:"dot",value:K,output:z});continue}if(K==="?"){if(!(_&&_.value==="(")&&h.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){pe("qmark",K);continue}if(_&&_.type==="paren"){const ve=oe();let ge=K;(_.value==="("&&!/[!=<:]/.test(ve)||ve==="<"&&!/<([!=]|\w+>)/.test(be()))&&(ge=`\\${K}`),he({type:"text",value:K,output:ge});continue}if(h.dot!==!0&&(_.type==="slash"||_.type==="bos")){he({type:"qmark",value:K,output:H});continue}he({type:"qmark",value:K,output:L});continue}if(K==="!"){if(h.noextglob!==!0&&oe()==="("&&(oe(2)!=="?"||!/[!=<:]/.test(oe(3)))){pe("negate",K);continue}if(h.nonegate!==!0&&Z.index===0){V();continue}}if(K==="+"){if(h.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){pe("plus",K);continue}if(_&&_.value==="("||h.regex===!1){he({type:"plus",value:K,output:S});continue}if(_&&(_.type==="bracket"||_.type==="paren"||_.type==="brace")||Z.parens>0){he({type:"plus",value:K});continue}he({type:"plus",value:S});continue}if(K==="@"){if(h.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){he({type:"at",extglob:!0,value:K,output:""});continue}he({type:"text",value:K});continue}if(K!=="*"){(K==="$"||K==="^")&&(K=`\\${K}`);const ve=n.exec(be());ve&&(K+=ve[0],Z.index+=ve[0].length),he({type:"text",value:K});continue}if(_&&(_.type==="globstar"||_.star===!0)){_.type="star",_.star=!0,_.value+=K,_.output=ce,Z.backtrack=!0,Z.globstar=!0,Oe(K);continue}let ae=be();if(h.noextglob!==!0&&/^\([^?]/.test(ae)){pe("star",K);continue}if(_.type==="star"){if(h.noglobstar===!0){Oe(K);continue}const ve=_.prev,ge=ve.prev,fe=ve.type==="slash"||ve.type==="bos",je=ge&&(ge.type==="star"||ge.type==="globstar");if(h.bash===!0&&(!fe||ae[0]&&ae[0]!=="/")){he({type:"star",value:K,output:""});continue}const Ce=Z.braces>0&&(ve.type==="comma"||ve.type==="brace"),_e=G.length&&(ve.type==="pipe"||ve.type==="paren");if(!fe&&ve.type!=="paren"&&!Ce&&!_e){he({type:"star",value:K,output:""});continue}for(;ae.slice(0,3)==="/**";){const rt=u[Z.index+4];if(rt&&rt!=="/")break;ae=ae.slice(3),Oe("/**",3)}if(ve.type==="bos"&&W()){_.type="globstar",_.value+=K,_.output=te(h),Z.output=_.output,Z.globstar=!0,Oe(K);continue}if(ve.type==="slash"&&ve.prev.type!=="bos"&&!je&&W()){Z.output=Z.output.slice(0,-(ve.output+_.output).length),ve.output=`(?:${ve.output}`,_.type="globstar",_.output=te(h)+(h.strictSlashes?")":"|$)"),_.value+=K,Z.globstar=!0,Z.output+=ve.output+_.output,Oe(K);continue}if(ve.type==="slash"&&ve.prev.type!=="bos"&&ae[0]==="/"){const rt=ae[1]!==void 0?"|$":"";Z.output=Z.output.slice(0,-(ve.output+_.output).length),ve.output=`(?:${ve.output}`,_.type="globstar",_.output=`${te(h)}${C}|${C}${rt})`,_.value+=K,Z.output+=ve.output+_.output,Z.globstar=!0,Oe(K+le()),he({type:"slash",value:"/",output:""});continue}if(ve.type==="bos"&&ae[0]==="/"){_.type="globstar",_.value+=K,_.output=`(?:^|${C}|${te(h)}${C})`,Z.output=_.output,Z.globstar=!0,Oe(K+le()),he({type:"slash",value:"/",output:""});continue}Z.output=Z.output.slice(0,-_.output.length),_.type="globstar",_.output=te(h),_.value+=K,Z.output+=_.output,Z.globstar=!0,Oe(K);continue}const ie={type:"star",value:K,output:ce};if(h.bash===!0){ie.output=".*?",(_.type==="bos"||_.type==="slash")&&(ie.output=ne+ie.output),he(ie);continue}if(_&&(_.type==="bracket"||_.type==="paren")&&h.regex===!0){ie.output=K,he(ie);continue}(Z.index===Z.start||_.type==="slash"||_.type==="dot")&&(_.type==="dot"?(Z.output+=D,_.output+=D):h.dot===!0?(Z.output+=I,_.output+=I):(Z.output+=ne,_.output+=ne),oe()!=="*"&&(Z.output+=P,_.output+=P)),he(ie)}for(;Z.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(l("closing","]"));Z.output=t.escapeLast(Z.output,"["),q("brackets")}for(;Z.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(l("closing",")"));Z.output=t.escapeLast(Z.output,"("),q("parens")}for(;Z.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(l("closing","}"));Z.output=t.escapeLast(Z.output,"{"),q("braces")}if(h.strictSlashes!==!0&&(_.type==="star"||_.type==="bracket")&&he({type:"maybe_slash",value:"",output:`${C}?`}),Z.backtrack===!0){Z.output="";for(const ae of Z.tokens)Z.output+=ae.output!=null?ae.output:ae.value,ae.suffix&&(Z.output+=ae.suffix)}return Z};return c.fastpaths=(u,d)=>{const h={...d},m=typeof h.maxLength=="number"?Math.min(a,h.maxLength):a,v=u.length;if(v>m)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${m}`);u=o[u]||u;const{DOT_LITERAL:f,SLASH_LITERAL:b,ONE_CHAR:k,DOTS_SLASH:x,NO_DOT:w,NO_DOTS:z,NO_DOTS_SLASH:S,STAR:C,START_ANCHOR:P}=e.globChars(h.windows),M=h.dot?z:w,E=h.dot?S:w,D=h.capture?"":"?:",I={negated:!1,prefix:""};let L=h.bash===!0?".*?":C;h.capture&&(L=`(${L})`);const H=ne=>ne.noglobstar===!0?L:`(${D}(?:(?!${P}${ne.dot?x:f}).)*?)`,N=ne=>{switch(ne){case"*":return`${M}${k}${L}`;case".*":return`${f}${k}${L}`;case"*.*":return`${M}${L}${f}${k}${L}`;case"*/*":return`${M}${L}${b}${k}${E}${L}`;case"**":return M+H(h);case"**/*":return`(?:${M}${H(h)}${b})?${E}${k}${L}`;case"**/*.*":return`(?:${M}${H(h)}${b})?${E}${L}${f}${k}${L}`;case"**/.*":return`(?:${M}${H(h)}${b})?${f}${k}${L}`;default:{const ee=/^(.*?)\.(\w+)$/.exec(ne);if(!ee)return;const ce=N(ee[1]);return ce?ce+f+ee[2]:void 0}}},Y=t.removePrefix(u,I);let te=N(Y);return te&&h.strictSlashes!==!0&&(te+=`${b}?`),te},WE=c,WE}var ZE,Zne;function Vnt(){if(Zne)return ZE;Zne=1;const e=$nt(),t=Int(),a=fC(),r=gC(),n=o=>o&&typeof o=="object"&&!Array.isArray(o),i=(o,s,l=!1)=>{if(Array.isArray(o)){const b=o.map(k=>i(k,s,l));return k=>{for(const x of b){const w=x(k);if(w)return w}return!1}}const c=n(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const u=s||{},d=u.windows,h=c?i.compileRe(o,s):i.makeRe(o,s,!1,!0),m=h.state;delete h.state;let v=()=>!1;if(u.ignore){const b={...s,ignore:null,onMatch:null,onResult:null};v=i(u.ignore,b,l)}const f=(b,k=!1)=>{const{isMatch:x,match:w,output:z}=i.test(b,h,s,{glob:o,posix:d}),S={glob:o,state:m,regex:h,posix:d,input:b,output:z,match:w,isMatch:x};return typeof u.onResult=="function"&&u.onResult(S),x===!1?(S.isMatch=!1,k?S:!1):v(b)?(typeof u.onIgnore=="function"&&u.onIgnore(S),S.isMatch=!1,k?S:!1):(typeof u.onMatch=="function"&&u.onMatch(S),k?S:!0)};return l&&(f.state=m),f};return i.test=(o,s,l,{glob:c,posix:u}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const d=l||{},h=d.format||(u?a.toPosixSlashes:null);let m=o===c,v=m&&h?h(o):o;return m===!1&&(v=h?h(o):o,m=v===c),(m===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?m=i.matchBase(o,s,l,u):m=s.exec(v)),{isMatch:!!m,match:m,output:v}},i.matchBase=(o,s,l)=>(s instanceof RegExp?s:i.makeRe(s,l)).test(a.basename(o)),i.isMatch=(o,s,l)=>i(s,l)(o),i.parse=(o,s)=>Array.isArray(o)?o.map(l=>i.parse(l,s)):t(o,{...s,fastpaths:!1}),i.scan=(o,s)=>e(o,s),i.compileRe=(o,s,l=!1,c=!1)=>{if(l===!0)return o.output;const u=s||{},d=u.contains?"":"^",h=u.contains?"":"$";let m=`${d}(?:${o.output})${h}`;o&&o.negated===!0&&(m=`^(?!${m}).*$`);const v=i.toRegex(m,s);return c===!0&&(v.state=o),v},i.makeRe=(o,s={},l=!1,c=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let u={negated:!1,fastpaths:!0};return s.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(u.output=t.fastpaths(o,s)),u.output||(u=t(o,s)),i.compileRe(u,s,l,c)},i.toRegex=(o,s)=>{try{const l=s||{};return new RegExp(o,l.flags||(l.nocase?"i":""))}catch(l){if(s&&s.debug===!0)throw l;return/$^/}},i.constants=r,ZE=i,ZE}var JE,Jne;function Knt(){if(Jne)return JE;Jne=1;const e=Vnt(),t=fC();function a(r,n,i=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:t.isWindows()}),e(r,n,i)}return Object.assign(a,e),JE=a,JE}var Hnt=Knt();const Gnt=Hr(Hnt),XE={};async function Xne(e,t){const a={};for(const n of t.headers)Fnt(e,n.matches)&&(a[n.name]=n.envVariable!==void 0?XE[n.envVariable]||"":n.value);const r=await(t.customFetch||fetch)(e,{headers:a});if(!r.ok)throw new Error(`Failed to load ${e}: ${r.status} ${r.statusText}`);return{body:await r.text(),mimeType:r.headers.get("content-type")}}function Fnt(e,t){return t.match(/^https?:\/\//)||(e=e.replace(/^https?:\/\//,"")),Gnt.isMatch(e,t)}class ub{constructor(t,a,r){this.absoluteRef=t,this.body=a,this.mimeType=r}getAst(t){return this._ast===void 0&&(this._ast=t(this.body,{filename:this.absoluteRef})??void 0,this._ast&&this._ast.kind===0&&this._ast.value===""&&this._ast.startPosition!==1&&(this._ast.startPosition=1,this._ast.endPosition=1)),this._ast}getLines(){return this._lines===void 0&&(this._lines=this.body.split(/\r\n|[\n\r]/g)),this._lines}}class hG extends Error{constructor(t){super(t.message),this.originalError=t,Object.setPrototypeOf(this,hG.prototype)}}function qnt(e,t){const a=new ub(t,e);try{return{source:a,parsed:GE(e,{filename:t})}}catch(r){throw new kk(r,a)}}class j0{constructor(t={http:{headers:[]}}){this.config=t,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(t,a){return so(a)?a:t&&so(t)?new URL(a,t).href:sr.resolve(t?sr.dirname(t):process.cwd(),a)}async loadExternalRef(t){try{if(so(t)){const{body:a,mimeType:r}=await Xne(t,this.config.http);return new ub(t,a,r)}else{if((void 0)(t).isDirectory())throw new Error(`Expected a file but received a folder at ${t}.`);const a=await(void 0).readFile(t,"utf-8");return new ub(t,a.replace(/\r\n/g,`
10903
10903
  `))}}catch(a){throw a.message=a.message.replace(", lstat",""),new hG(a)}}parseDocument(t,a=!1){const r=t.absoluteRef.substr(t.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(r)&&!t.mimeType?.match(/(json|yaml|openapi)/)&&!a)return{source:t,parsed:t.body};try{return{source:t,parsed:GE(t.body,{filename:t.absoluteRef})}}catch(n){throw new kk(n,t)}}async resolveDocument(t,a,r=!1){const n=this.resolveExternalRef(t,a),i=this.cache.get(n);if(i)return i;const o=this.loadExternalRef(n).then(s=>this.parseDocument(s,r));return this.cache.set(n,o),o}}function Yne(e,t){return{prev:e,node:t}}function Qnt(e,t){for(;e;){if(e.node===t)return!0;e=e.prev}return!1}const P0={name:"unknown",properties:{}},Unt={name:"scalar",properties:{}};async function A0(e){const{rootDocument:t,externalRefResolver:a,rootType:r}=e,n=new Map,i=new Set,o=[];l(t.parsed,t,"#/",r);let s;do s=await Promise.all(o);while(o.length!==s.length);return n;function l(c,u,d,h){const m=u.source.absoluteRef,v=new Map;f(c,h,m+d);function f(k,x,w){if(typeof k!="object"||k===null)return;const z=`${x.name}::${w}`;if(i.has(z))return;i.add(z);const[S,C]=Object.entries(k).find(([P])=>P==="$anchor")||[];if(C&&v.set(`#${C}`,k),Array.isArray(k)){const P=x.items;if(P===void 0&&x!==P0&&x!==xg)return;const M=typeof P=="function";for(let E=0;E<k.length;E++){let D=M?P(k[E],cb(w,E)):P;if(D===void 0&&x!==P0&&x!==xg)continue;const I=D?.directResolveAs?{$ref:k[E]}:k[E];D=D?.directResolveAs||D,f(I,wg(D)?D:P0,cb(w,E))}return}for(const P of Object.keys(k)){let M=k[P],E=Ih(x.properties,P);E===void 0&&(E=x.additionalProperties),typeof E=="function"&&(E=E(M,P)),E===void 0&&(E=P0),x.extensionsPrefix&&P.startsWith(x.extensionsPrefix)&&E===P0&&(E=xg),!wg(E)&&E?.directResolveAs&&(E=E.directResolveAs,M={$ref:M}),E&&E.name===void 0&&E.resolvable!==!1&&(E=Unt),!(!wg(E)||typeof M!="object")&&f(M,E,cb(w,z0(P)))}if(ni(k)){const P=b(u,k,{prev:null,node:k}).then(M=>{M.resolved&&l(M.node,M.document,M.nodePointer,x)});o.push(P)}if($ne(k)){const P=b(u,{$ref:k.externalValue},{prev:null,node:k}).then(M=>{M.resolved&&l(M.node,M.document,M.nodePointer,x)});o.push(P)}}async function b(k,x,w){if(Qnt(w.prev,x))throw new Error("Self-referencing circular pointer");if(Cnt(x.$ref)){await Dnt();const L={resolved:!0,isRemote:!1,node:v.get(x.$ref),document:k,nodePointer:x.$ref},H=C0(k.source.absoluteRef,x.$ref);return n.set(H,L),L}const{uri:z,pointer:S}=Snt(x.$ref),C=z!==null&&a.resolveExternalRef(k.source.absoluteRef,z)!==k.source.absoluteRef;let P;try{P=C?await a.resolveDocument(k.source.absoluteRef,z):k}catch(L){const H={resolved:!1,isRemote:C,document:void 0,error:L},N=C0(k.source.absoluteRef,x.$ref);return n.set(N,H),H}let M={resolved:!0,document:P,isRemote:C,node:k.parsed,nodePointer:"#/"},E=P.parsed;const D=S;for(const L of D)if(typeof E!="object"){E=void 0;break}else if(E[L]!==void 0)E=E[L],M.nodePointer=cb(M.nodePointer,z0(L));else if(ni(E)){if(M=await b(P,E,Yne(w,E)),P=M.document||P,typeof M.node!="object"){E=void 0;break}E=M.node[L],M.nodePointer=cb(M.nodePointer,z0(L))}else{E=void 0;break}M.node=E,M.document=P;const I=C0(k.source.absoluteRef,x.$ref);return M.document&&ni(E)&&(M=await b(M.document,E,Yne(w,E))),n.set(I,M),{...M}}}}const Wnt=/^[0-9][0-9Xx]{2}$/,Znt={properties:{swagger:{type:"string"},info:"Info",host:{type:"string"},basePath:{type:"string"},schemes:{type:"array",items:{type:"string"}},consumes:{type:"array",items:{type:"string"}},produces:{type:"array",items:{type:"string"}},paths:"Paths",definitions:"NamedSchemas",parameters:"NamedParameters",responses:"NamedResponses",securityDefinitions:"NamedSecuritySchemes",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs","x-servers":"XServerList","x-tagGroups":"TagGroups","x-ignoredHeaderParameters":{type:"array",items:{type:"string"}}},required:["swagger","paths","info"],extensionsPrefix:"x-"},Jnt={properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License",version:{type:"string"},"x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Xnt={properties:{url:{type:"string"},altText:{type:"string"},backgroundColor:{type:"string"},href:{type:"string"}},extensionsPrefix:"x-"},Ynt={properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},extensionsPrefix:"x-"},eit={properties:{name:{type:"string"},url:{type:"string"}},required:["name"],extensionsPrefix:"x-"},tit={properties:{},additionalProperties:(e,t)=>t.startsWith("/")?"PathItem":void 0},ait={properties:{$ref:{type:"string"},parameters:"ParameterList",get:"Operation",put:"Operation",post:"Operation",delete:"Operation",options:"Operation",head:"Operation",patch:"Operation"},extensionsPrefix:"x-"},rit={properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},consumes:{type:"array",items:{type:"string"}},produces:{type:"array",items:{type:"string"}},parameters:"ParameterList",responses:"Responses",schemes:{type:"array",items:{type:"string"}},deprecated:{type:"boolean"},security:"SecurityRequirementList","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},required:["responses"],extensionsPrefix:"x-"},nit={properties:{lang:{type:"string"},label:{type:"string"},source:{type:"string"}}},iit={properties:{url:{type:"string"},description:{type:"string"}},required:["url"]},oit={properties:{description:{type:"string"},url:{type:"string"}},required:["url"],extensionsPrefix:"x-"},sit={properties:{name:{type:"string"},in:{type:"string",enum:["query","header","path","formData","body"]},description:{type:"string"},required:{type:"boolean"},schema:"Schema",type:{type:"string",enum:["string","number","integer","boolean","array","file"]},format:{type:"string"},allowEmptyValue:{type:"boolean"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"},"x-example":{},"x-examples":"ExamplesMap"},required(e){return!e||!e.in?["name","in"]:e.in==="body"?["name","in","schema"]:e.type==="array"?["name","in","type","items"]:["name","in","type"]},extensionsPrefix:"x-"},lit={properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"}},required(e){return e&&e.type==="array"?["type","items"]:["type"]},extensionsPrefix:"x-"},cit={properties:{default:"Response"},additionalProperties:(e,t)=>Wnt.test(t)?"Response":void 0},uit={properties:{description:{type:"string"},schema:"Schema",headers:Qt("Header"),examples:"Examples","x-summary":{type:"string"}},required:["description"],extensionsPrefix:"x-"},dit={properties:{},additionalProperties:{isExample:!0}},pit={properties:{description:{type:"string"},type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"}},required(e){return e&&e.type==="array"?["type","items"]:["type"]},extensionsPrefix:"x-"},hit={properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs","x-traitTag":{type:"boolean"},"x-displayName":{type:"string"}},required:["name"],extensionsPrefix:"x-"},mit={properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}}}},git={properties:{format:{type:"string"},title:{type:"string"},description:{type:"string"},default:null,multipleOf:{type:"number"},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"boolean"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"number"},minLength:{type:"number"},pattern:{type:"string"},maxItems:{type:"number"},minItems:{type:"number"},uniqueItems:{type:"boolean"},maxProperties:{type:"number"},minProperties:{type:"number"},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:{type:"string",enum:["object","array","string","number","integer","boolean","null"]},items:e=>Array.isArray(e)?na("Schema"):"Schema",allOf:na("Schema"),properties:"SchemaProperties",additionalProperties:e=>typeof e=="boolean"?{type:"boolean"}:"Schema",discriminator:{type:"string"},readOnly:{type:"boolean"},xml:"Xml",externalDocs:"ExternalDocs",example:{isExample:!0},"x-tags":{type:"array",items:{type:"string"}},"x-nullable":{type:"boolean"},"x-extendedDiscriminator":{type:"string"},"x-additionalPropertiesName":{type:"string"},"x-explicitMappingOnly":{type:"boolean"},"x-enumDescriptions":"EnumDescriptions"},extensionsPrefix:"x-"},fit={properties:{},additionalProperties:{type:"string"}},vit={properties:{},additionalProperties:"Schema"},bit={properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean"},wrapped:{type:"boolean"}},extensionsPrefix:"x-"},yit={properties:{type:{enum:["basic","apiKey","oauth2"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header"]},flow:{enum:["implicit","password","application","accessCode"]},authorizationUrl:{type:"string"},tokenUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},"x-defaultClientId":{type:"string"}},required(e){switch(e?.type){case"apiKey":return["type","name","in"];case"oauth2":switch(e?.flow){case"implicit":return["type","flow","authorizationUrl","scopes"];case"accessCode":return["type","flow","authorizationUrl","tokenUrl","scopes"];case"application":case"password":return["type","flow","tokenUrl","scopes"];default:return["type","flow","scopes"]}default:return["type"]}},allowed(e){switch(e?.type){case"basic":return["type","description"];case"apiKey":return["type","name","in","description"];case"oauth2":switch(e?.flow){case"implicit":return["type","flow","authorizationUrl","description","scopes"];case"accessCode":return["type","flow","authorizationUrl","tokenUrl","description","scopes"];case"application":case"password":return["type","flow","tokenUrl","description","scopes"];default:return["type","flow","tokenUrl","authorizationUrl","description","scopes"]}default:return["type","description"]}},extensionsPrefix:"x-"},kit={properties:{},additionalProperties:{type:"array",items:{type:"string"}}},xit={properties:{value:{isExample:!0},summary:{type:"string"},description:{type:"string"},externalValue:{type:"string"}},extensionsPrefix:"x-"},eie={Root:Znt,Tag:hit,TagList:na("Tag"),TagGroups:na("TagGroup"),TagGroup:mit,ExternalDocs:oit,Example:xit,ExamplesMap:Qt("Example"),EnumDescriptions:fit,SecurityRequirement:kit,SecurityRequirementList:na("SecurityRequirement"),Info:Jnt,Contact:Ynt,License:eit,Logo:Xnt,Paths:tit,PathItem:ait,Parameter:sit,ParameterItems:lit,ParameterList:na("Parameter"),Operation:rit,Examples:dit,Header:pit,Responses:cit,Response:uit,Schema:git,Xml:bit,SchemaProperties:vit,NamedSchemas:Qt("Schema"),NamedResponses:Qt("Response"),NamedParameters:Qt("Parameter"),NamedSecuritySchemes:Qt("SecurityScheme"),SecurityScheme:yit,XCodeSample:nit,XCodeSampleList:na("XCodeSample"),XServerList:na("XServer"),XServer:iit},wit=/^[0-9][0-9Xx]{2}$/,Oit={properties:{openapi:null,info:"Info",servers:"ServerList",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs",paths:"Paths",components:"Components","x-webhooks":"WebhooksMap","x-tagGroups":"TagGroups","x-ignoredHeaderParameters":{type:"array",items:{type:"string"}}},required:["openapi","paths","info"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/openapi#openapi",description:"REQUIRED. This string MUST be the semantic version number of the OpenAPI Specification version that the OpenAPI document uses. The openapi field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is not related to the API info.version string."},Sit={properties:{name:{type:"string",description:"REQUIRED. The name of the tag."},description:{type:"string",description:"A description for the tag."},externalDocs:"ExternalDocs","x-traitTag":{type:"boolean"},"x-displayName":{type:"string"}},required:["name"],extensionsPrefix:"x-",description:"The Tag Object represents a tag used by the OAS. It is not mandatory to have a tag object per tag used by the OAS but each tag object can contain additional metadata."},zit={properties:{name:{type:"string",description:"The display name for the tag, used in the navigation bar and as a section heading."},tags:{type:"array",description:"List of tags to include in this group.",items:{type:"string"}}},extensionsPrefix:"x-",description:"The x-tagGroups extension is used at the top level of an OpenAPI description.",documentationLink:"https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-tag-groups#taggroup-object"},Cit={properties:{description:{type:"string",description:"A description of the target documentation. Used as the link anchor text in Redocly. If not provided, the url is used as the link anchor text."},url:{type:"string",description:"REQUIRED. The URL for the target documentation."}},required:["url"],extensionsPrefix:"x-",description:"Additional external documentation for this operation.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/external-docs"},jit={properties:{url:{type:"string",description:"REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions are made when a variable is named in { curly braces }."},description:{type:"string",description:"An optional string describing the host designated by the URL."},variables:"ServerVariablesMap"},required:["url"],extensionsPrefix:"x-",description:"A server object to be used by the target operation."},Pit={properties:{enum:{type:"array",items:{type:"string"},description:"An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. If defined, the array MUST contain the default value."},default:{type:"string",description:"REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied. Note this behavior is different than the Schema Object's treatment of default values, because in those cases parameter values are optional. If the enum is defined, the value MUST exist in the enum's values."},description:{type:"string",description:"An optional description for the server variable."}},required:["default"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/server-variables#server-variables",description:"Server variables are used when you need to make a substitution into the server URL such as when the subdomain is unique per tenant."},Ait={properties:{},additionalProperties:{type:"array",items:{type:"string"}},documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/security#security-requirement-object",description:"A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement ({}) can be included in the array."},Mit={properties:{title:{type:"string",description:"REQUIRED. The title of the API."},version:{type:"string",description:"REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version)."},description:{type:"string",description:"RECOMMENDED. A description of the API (Markdown may be used)."},termsOfService:{type:"string",description:"A URL to the Terms of Service for the API."},contact:"Contact",license:"License","x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-",description:"REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/info#info"},Tit={properties:{url:{type:"string"},altText:{type:"string"},backgroundColor:{type:"string"},href:{type:"string"}},documentationLink:"https://redocly.com/docs-legacy/api-reference-docs/specification-extensions/x-logo#x-logo",description:"A commonly used specification extension containing the information about the API logo."},Bit={properties:{name:{type:"string",description:"The identifying name of the contact person or organization."},url:{type:"string",description:"The URL pointing to the contact information."},email:{type:"string",description:"The email address of the contact person or organization."}},extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/contact",description:"The contact information for the exposed API."},Eit={properties:{name:{type:"string",description:"REQUIRED. The license name used for the API."},url:{type:"string",description:"The URL pointing to the contact information."}},required:["name"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/license#license",description:"The license information for the exposed API."},Rit={properties:{},additionalProperties:(e,t)=>t.startsWith("/")?"PathItem":void 0,description:"The Paths Object is a map of a paths to the path item object. A path starts with a /.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/paths#paths-object"},_it={properties:{},additionalProperties:()=>"PathItem",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/webhooks#types"},Lit={properties:{$ref:{type:"string",description:"Allows for a referenced definition of this path item. The referenced structure MUST be in the form of a Path Item Object. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving Relative References.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/reference"},servers:"ServerList",parameters:"ParameterList",summary:{type:"string",description:"An optional, string summary, intended to apply to all operations in this path."},description:{type:"string",description:"An optional, string description, intended to apply to all operations in this path."},get:"Operation",put:"Operation",post:"Operation",delete:"Operation",options:"Operation",head:"Operation",patch:"Operation",trace:"Operation","x-query":"Operation"},extensionsPrefix:"x-",description:"Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/path-item#path-item-object"},Nit={properties:{name:{type:"string",description:"REQUIRED. The name of the parameter. Parameter names are case sensitive."},in:{enum:["query","header","path","cookie"],description:'REQUIRED. The location of the parameter. Possible values are "query", "header", "path", or "cookie".'},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use."},required:{type:"boolean",description:'Determines whether this parameter is mandatory. If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false.'},deprecated:{type:"boolean",description:"Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false."},allowEmptyValue:{type:"boolean",description:"Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false. If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision."},style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"],description:"Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form."},explode:{type:"boolean",description:"When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false."},allowReserved:{type:"boolean",description:"Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding. This property only applies to parameters with an in value of query. The default value is false."},schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",content:"MediaTypesMap"},required:["name","in"],requiredOneOf:["schema","content"],extensionsPrefix:"x-",description:"Describes a request parameter, which excludes the request body. A unique parameter is defined by a unique combination of the name and in values.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/parameter"},Dit={properties:{tags:{type:"array",items:{type:"string"},description:"A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier."},summary:{type:"string",description:"A short summary of what the operation does.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation#summary"},description:{type:"string",description:"A verbose explanation of the operation behavior.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation#description"},externalDocs:"ExternalDocs",operationId:{type:"string",description:"The operationId is path segment or path fragment in deep links to a specific operation.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation#operationid"},parameters:"ParameterList",security:"SecurityRequirementList",servers:"ServerList",requestBody:"RequestBody",responses:"Responses",deprecated:{type:"boolean"},callbacks:"CallbacksMap","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},required:["responses"],extensionsPrefix:"x-",description:"The Operation Object describes a single API operation on a path, including its parameters, responses, and request body (if applicable). Each path can support more than one operation, but those operations must be unique. A unique operation is a combination of a path and an HTTP method, so two GET or two POST methods for the same path are not allowed.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation"},$it={properties:{lang:{type:"string"},label:{type:"string"},source:{type:"string"}},documentationLink:"https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-code-samples",description:"Code samples are snippets of code shown alongside API operations in reference documentation, giving users a quick way to start to interact with an API from their own code. The x-codeSamples addition to OpenAPI allows you to add or override any existing code samples for a particular language or endpoint."},Iit={properties:{description:{type:"string",description:"A brief description of the request body. This could contain examples of use."},required:{type:"boolean",description:"Determines if the request body is required in the request. Defaults to false."},content:"MediaTypesMap"},required:["content"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/request-body",description:"The request body is defined inside of operations (including paths and webhooks). The request body can also be defined inside of the named requestBodies object in components."},Vit={properties:{},additionalProperties:"MediaType",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/media-type#types"},Kit={properties:{schema:"Schema",example:{isExample:!0,description:"Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema."},examples:"ExamplesMap",encoding:"EncodingMap"},extensionsPrefix:"x-",description:"The Media Type Object is one of the important building blocks of OpenAPI.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/media-type"},Hit={properties:{value:{resolvable:!1,description:"Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary."},summary:{type:"string"},description:{type:"string",description:"Long description for the example."},externalValue:{type:"string",description:"A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive."}},extensionsPrefix:"x-",description:"Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/example"},Git={properties:{contentType:{type:"string",description:"The Content-Type for encoding a specific property. Default value depends on the property type: for string with format being binary \u2013 application/octet-stream; for other primitive types \u2013 text/plain; for object - application/json; for array \u2013 the default is defined based on the inner type. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types."},headers:"HeadersMap",style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"],description:"Describes how a specific property value will be serialized depending on its type. See Parameter Object for details on the style property. The behavior follows the same values as query parameters, including default values. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded."},explode:{type:"boolean",description:"When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded."},allowReserved:{type:"boolean",description:"Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] Section 2.2 :/?#[]@!$&'()*+,;= to be included without percent-encoding. The default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded."}},extensionsPrefix:"x-",description:"A single encoding definition applied to a single schema property.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/encoding#types"},Fit={properties:{},additionalProperties:{type:"string"},description:'The enum (short for "enumeration") fields in OpenAPI allow you to restrict the value of a field to a list of allowed values. These values need to be short and machine-readable, but that can make them harder for humans to parse and work with.',documentationLink:"https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-enum-descriptions"},qit={properties:{description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation."},required:{type:"boolean",description:"Determines whether this parameter is mandatory. Its default value is false."},deprecated:{type:"boolean"},allowEmptyValue:{type:"boolean",description:"Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false."},style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"},schema:"Schema",example:{isExample:!0,description:"Example of the header's potential value. The example SHOULD match the specified schema and encoding properties if present. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema that contains an example, the example value SHALL override the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary."},examples:"ExamplesMap",content:"MediaTypesMap"},requiredOneOf:["schema","content"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/header#header-object",description:"The header object is used to describe a response header in the headers map."},Qit={properties:{default:"Response"},additionalProperties:(e,t)=>wit.test(t)?"Response":void 0,description:"The list of possible responses as they are returned from executing this operation.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/named-responses"},Uit={properties:{description:{type:"string"},headers:"HeadersMap",content:"MediaTypesMap",links:"LinksMap","x-summary":{type:"string",documentationLink:"https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-summary#openapi-extension-x-summary",description:"Use x-summary to add a short custom text to describe the response in the API documentation."}},required:["description"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/response",description:"The response object describes a single response in the Responses Map."},Wit={properties:{operationRef:{type:"string",description:"A relative or absolute reference to an OAS operation. This field is mutually exclusive of the operationId field, and MUST point to an Operation Object. Relative operationRef values MAY be used to locate an existing Operation Object in the OpenAPI definition."},operationId:{type:"string",description:"The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive of the operationRef field."},parameters:null,requestBody:null,description:{type:"string",description:"A description of the link."},server:"Server"},extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/links",description:"The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller\u2019s ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations."},Zit={properties:{externalDocs:"ExternalDocs",discriminator:"Discriminator",title:{type:"string",description:"Value MUST be a string. Multiple types via an array are not supported."},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"boolean"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string",description:"(This string SHOULD be a valid regular expression, according to the Ecma-262 Edition 5.1 regular expression dialect)"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:{enum:["object","array","string","number","integer","boolean"],description:"Value MUST be a string. Multiple types via an array are not supported."},allOf:na("Schema",{description:"Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema."}),anyOf:na("Schema",{description:"Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema."}),oneOf:na("Schema",{description:"Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema."}),not:"Schema",properties:"SchemaProperties",items:e=>Array.isArray(e)?na("Schema"):"Schema",additionalProperties:e=>typeof e=="boolean"?{type:"boolean"}:"Schema",description:{type:"string",description:"CommonMark syntax MAY be used for rich text representation."},format:{type:"string",description:"See Data Type Formats for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats."},default:null,nullable:{type:"boolean"},readOnly:{type:"boolean"},writeOnly:{type:"boolean"},xml:"Xml",example:{isExample:!0},deprecated:{type:"boolean"},"x-tags":{type:"array",items:{type:"string"}},"x-additionalPropertiesName":{type:"string"},"x-explicitMappingOnly":{type:"boolean"}},extensionsPrefix:"x-",description:"The schema defining the content of the request, response, or parameter.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/schemas"},Jit={properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean"},wrapped:{type:"boolean"}},extensionsPrefix:"x-",description:"This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property."},Xit={properties:{},additionalProperties:"Schema"},Yit={properties:{},additionalProperties:e=>Vne(e)?{type:"string",directResolveAs:"Schema"}:{type:"string"},documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/discriminator#types"},eot={properties:{propertyName:{type:"string",description:"REQUIRED. The name of the property in the payload that will hold the discriminator value."},mapping:"DiscriminatorMapping"},required:["propertyName"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/discriminator#discriminator-object",description:"When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it."},tot={properties:{parameters:"NamedParameters",schemas:"NamedSchemas",responses:"NamedResponses",examples:"NamedExamples",requestBodies:"NamedRequestBodies",headers:"NamedHeaders",securitySchemes:"NamedSecuritySchemes",links:"NamedLinks",callbacks:"NamedCallbacks"},extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/components#components"},aot={properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},authorizationUrl:{type:"string"}},required:["authorizationUrl","scopes"],extensionsPrefix:"x-",description:"Configuration for the OAuth Implicit flow."},rot={properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"],extensionsPrefix:"x-",description:"Object Configuration for the OAuth Resource Owner Password flow."},not={properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"],extensionsPrefix:"x-",description:"Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0."},iot={properties:{refreshUrl:{type:"string"},authorizationUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"},"x-usePkce":e=>typeof e=="boolean"?{type:"boolean"}:"XUsePkce"},required:["authorizationUrl","tokenUrl","scopes"],extensionsPrefix:"x-",description:"Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0."},oot={properties:{implicit:"ImplicitFlow",password:"PasswordFlow",clientCredentials:"ClientCredentials",authorizationCode:"AuthorizationCode"},extensionsPrefix:"x-",description:"Configuration details for a supported OAuth Flow."},sot={properties:{type:{enum:["apiKey","http","oauth2","openIdConnect"],description:'REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "oauth2", "openIdConnect".'},description:{type:"string",description:"A short description for security scheme."},name:{type:"string",description:"REQUIRED. The name of the header, query or cookie parameter to be used."},in:{type:"string",enum:["query","header","cookie"],description:'REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie".'},scheme:{type:"string",description:"A short description for security scheme."},bearerFormat:{type:"string",description:"A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes."},flows:"OAuth2Flows",openIdConnectUrl:{type:"string",description:"REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL."},"x-defaultClientId":{type:"string"}},required(e){switch(e?.type){case"apiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(e?.type){case"apiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":return["type","flows","description"];case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"},lot={properties:{disableManualConfiguration:{type:"boolean"},hideClientSecretInput:{type:"boolean"}},description:"The x-usePkce allows you to enable Proof Key for Code Exchange (PKCE) for the Oauth2 or OpenID Connect authorization code flow in the Replay.",documentationLink:"https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-use-pkce#openapi-extension-x-usepkce"},au={Root:Oit,Tag:Sit,TagList:na("Tag",{documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/tags",description:"A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique."}),TagGroups:na("TagGroup"),TagGroup:zit,ExternalDocs:Cit,Server:jit,ServerList:na("Server",{description:"A list of servers available to the API.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/servers#servers"}),ServerVariable:Pit,ServerVariablesMap:Qt("ServerVariable",{description:"A map between a variable name and its value. The value is used for substitution in the server's URL template."}),SecurityRequirement:Ait,SecurityRequirementList:na("SecurityRequirement"),Info:Mit,Contact:Bit,License:Eit,Paths:Rit,PathItem:Lit,Parameter:Nit,ParameterList:na("Parameter",{description:"A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object\u2019s components/parameters."}),Operation:Dit,Callback:Qt("PathItem",{description:"https://redocly.com/learn/openapi/openapi-visual-reference/callbacks#callback-object"}),CallbacksMap:Qt("Callback"),RequestBody:Iit,MediaTypesMap:Vit,MediaType:Kit,Example:Hit,ExamplesMap:Qt("Example"),Encoding:Git,EncodingMap:Qt("Encoding"),EnumDescriptions:Fit,Header:qit,HeadersMap:Qt("Header"),Responses:Qit,Response:Uit,Link:Wit,Logo:Tit,Schema:Zit,Xml:Jit,SchemaProperties:Xit,DiscriminatorMapping:Yit,Discriminator:eot,Components:tot,LinksMap:Qt("Link"),NamedSchemas:Qt("Schema"),NamedResponses:Qt("Response"),NamedParameters:Qt("Parameter"),NamedExamples:Qt("Example"),NamedRequestBodies:Qt("RequestBody"),NamedHeaders:Qt("Header"),NamedSecuritySchemes:Qt("SecurityScheme"),NamedLinks:Qt("Link"),NamedCallbacks:Qt("Callback"),ImplicitFlow:aot,PasswordFlow:rot,ClientCredentials:not,AuthorizationCode:iot,OAuth2Flows:oot,SecurityScheme:sot,XCodeSample:$it,XCodeSampleList:na("XCodeSample"),XUsePkce:lot,WebhooksMap:_it},cot={properties:{openapi:null,info:"Info",servers:"ServerList",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs",paths:"Paths",webhooks:"WebhooksMap",components:"Components",jsonSchemaDialect:{type:"string",description:"The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI."}},required:["openapi","info"],requiredOneOf:["paths","components","webhooks"],extensionsPrefix:"x-",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/openapi#openapi",description:"REQUIRED. This string MUST be the semantic version number of the OpenAPI Specification version that the OpenAPI document uses. The openapi field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is not related to the API info.version string."},uot={...au.License,properties:{...au.License.properties,identifier:{type:"string",description:"An [SPDX-Licenses] expression for the API. The identifier field is mutually exclusive of the url field."}}},dot={...au.Info,properties:{...au.Info.properties,summary:{type:"string",description:"A short summary of the API. This field MAY be used by tooling as required."}}},pot={...au.Components,properties:{...au.Components.properties,pathItems:"NamedPathItems"}},hot={properties:{tags:{type:"array",items:{type:"string"},description:"A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier."},summary:{type:"string",description:"A short summary of what the operation does.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation#summary"},description:{type:"string",description:"A verbose explanation of the operation behavior.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation#description"},externalDocs:"ExternalDocs",operationId:{type:"string",description:"The operationId is path segment or path fragment in deep links to a specific operation.",documentationLink:"https://redocly.com/learn/openapi/openapi-visual-reference/operation#operationid"},parameters:"ParameterList",security:"SecurityRequirementList",servers:"ServerList",requestBody:"RequestBody",responses:"Responses",deprecated:{type:"boolean"},callbacks:"CallbacksMap","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},extensionsPrefix:"x-",description:"The Operation Object describes a single API operation on a path, including its parameters, responses, and request body (if applicable). Each path can support more than one operation, but those operations must be unique. A unique operation is a combination of a path and an HTTP method, so two GET or two POST methods for the same path are not allowed."},mot={properties:{$id:{type:"string"},$anchor:{type:"string"},id:{type:"string"},$schema:{type:"string"},definitions:"NamedSchemas",$defs:"NamedSchemas",$vocabulary:{type:"string"},externalDocs:"ExternalDocs",discriminator:"Discriminator",title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:e=>Array.isArray(e)?{type:"array",items:{enum:["object","array","string","number","integer","boolean","null"]}}:{enum:["object","array","string","number","integer","boolean","null"]},allOf:na("Schema"),anyOf:na("Schema"),oneOf:na("Schema"),not:"Schema",if:"Schema",then:"Schema",else:"Schema",dependentSchemas:Qt("Schema"),dependentRequired:"DependentRequired",prefixItems:na("Schema"),contains:"Schema",minContains:{type:"integer",minimum:0},maxContains:{type:"integer",minimum:0},patternProperties:"PatternProperties",propertyNames:"Schema",unevaluatedItems:e=>typeof e=="boolean"?{type:"boolean"}:"Schema",unevaluatedProperties:e=>typeof e=="boolean"?{type:"boolean"}:"Schema",summary:{type:"string"},properties:"SchemaProperties",items:e=>typeof e=="boolean"?{type:"boolean"}:"Schema",additionalProperties:e=>typeof e=="boolean"?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:"Schema",default:null,readOnly:{type:"boolean"},writeOnly:{type:"boolean"},xml:"Xml",examples:{type:"array"},example:{isExample:!0},deprecated:{type:"boolean"},const:null,$comment:{type:"string"},"x-tags":{type:"array",items:{type:"string"}},$dynamicAnchor:{type:"string"},$dynamicRef:{type:"string"}},extensionsPrefix:"x-"},tie={properties:{},additionalProperties:e=>typeof e=="boolean"?{type:"boolean"}:"Schema"},got={properties:{type:{enum:["apiKey","http","oauth2","openIdConnect","mutualTLS"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"OAuth2Flows",openIdConnectUrl:{type:"string"}},required(e){switch(e?.type){case"apiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(e?.type){case"apiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":switch(e?.flows){case"implicit":return["type","flows","authorizationUrl","refreshUrl","description","scopes"];case"password":case"clientCredentials":return["type","flows","tokenUrl","refreshUrl","description","scopes"];case"authorizationCode":return["type","flows","authorizationUrl","refreshUrl","tokenUrl","description","scopes"];default:return["type","flows","authorizationUrl","refreshUrl","tokenUrl","description","scopes"]}case"openIdConnect":return["type","openIdConnectUrl","description"];case"mutualTLS":return["type","description"];default:return["type","description"]}},extensionsPrefix:"x-"},fot={properties:{},additionalProperties:{type:"array",items:{type:"string"}}},fn={...au,Info:dot,Root:cot,Schema:mot,SchemaProperties:tie,PatternProperties:tie,License:uot,Components:pot,NamedPathItems:Qt("PathItem"),SecurityScheme:got,Operation:hot,DependentRequired:fot},vot={...fn.Root,properties:{...fn.Root.properties,$self:{type:"string",description:"This string MUST be in the form of a URI reference as defined by [RFC3986] Section 4.1. The $self field provides the self-assigned URI of this document, which also serves as its base URI in accordance with [RFC3986] Section 5.1.1. Implementations MUST support identifying the targets of API description URIs using the URI defined by this field when it is present. See Establishing the Base URI for the base URI behavior when $self is absent or relative, and see Appendix F for examples of using $self to resolve references."}}},bot={...fn.Tag,properties:{...fn.Tag.properties,kind:{type:"string",description:"A machine-readable string to categorize what sort of tag it is. Any string value can be used; common uses are nav for Navigation, badge for visible badges, audience for APIs used by different groups. A registry of the most commonly used values is available."},parent:{type:"string",description:"The name of a tag that this tag is nested under. The named tag MUST exist in the API description, and circular references between parent and child tags MUST NOT be used."},summary:{type:"string",description:"A short summary of the tag, used for display purposes."}},description:"Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances."},yot={...fn.Server,properties:{...fn.Server.properties,name:{type:"string",description:"An optional unique string to refer to the host designated by the URL."}},description:"An object representing a Server."},kot={...fn.SecurityScheme,properties:{...fn.SecurityScheme.properties,deprecated:{type:"boolean",description:"Declares this security scheme to be deprecated. Consumers SHOULD refrain from usage of the declared scheme. Default value is false."},oauth2MetadataUrl:{type:"string",description:"URL to the OAuth2 authorization server metadata [RFC8414]. TLS is required."}},allowed(e){switch(e?.type){case"apiKey":return["type","name","in","description","deprecated"];case"http":return["type","scheme","bearerFormat","description","deprecated"];case"oauth2":switch(e?.flows){case"implicit":return["type","flows","authorizationUrl","refreshUrl","description","scopes","oauth2MetadataUrl","deprecated"];case"password":case"clientCredentials":return["type","flows","tokenUrl","refreshUrl","description","scopes","oauth2MetadataUrl","deprecated"];case"authorizationCode":return["type","flows","authorizationUrl","refreshUrl","tokenUrl","description","scopes","oauth2MetadataUrl","deprecated"];case"deviceAuthorization":return["type","flows","deviceAuthorizationUrl","tokenUrl"];default:return["type","flows","authorizationUrl","refreshUrl","tokenUrl","description","scopes","oauth2MetadataUrl","deprecated"]}case"openIdConnect":return["type","openIdConnectUrl","description","deprecated"];case"mutualTLS":return["type","description","deprecated"];default:return["type","description","deprecated"]}},description:"Defines a security scheme that can be used by the operations."},xot={...fn.OAuth2Flows,properties:{...fn.OAuth2Flows.properties,deviceAuthorization:"DeviceAuthorization"}},wot={properties:{deviceAuthorizationUrl:{type:"string",description:"REQUIRED. The device authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."},tokenUrl:{type:"string",description:"REQUIRED. The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."},refreshUrl:{type:"string",description:"The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."},scopes:Qt("string",{description:"REQUIRED. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty."})},required:["deviceAuthorizationUrl","tokenUrl","scopes"],extensionsPrefix:"x-",description:"Configuration for the OAuth Device Authorization flow."},Oot={...au.PathItem,properties:{...au.PathItem.properties,query:"Operation",additionalOperations:Qt("Operation")}},Sot={...fn.Parameter,properties:{...fn.Parameter.properties,in:{description:'REQUIRED. The location of the parameter. Possible values are "query", "querystring", "header", "path" or "cookie".',enum:["query","header","path","cookie","querystring"]}}},zot={...fn.Response,properties:{...fn.Response.properties,summary:{type:"string",description:"A short summary of the meaning of the response."}}},Cot={...fn.MediaType,properties:{...fn.MediaType.properties,itemSchema:"Schema",prefixEncoding:na("Encoding",{description:"A map between a property name and its encoding information, as defined under Encoding By Name. The encoding field SHALL only apply when the media type is multipart or application/x-www-form-urlencoded. If no Encoding Object is provided for a property, the behavior is determined by the default values documented for the Encoding Object. This field MUST NOT be present if prefixEncoding or itemEncoding are present."}),itemEncoding:"Encoding"}},jot={...fn.Discriminator,properties:{...fn.Discriminator.properties,defaultMapping:{type:"string",description:"The schema name or URI reference to a schema that is expected to validate the structure of the model when the discriminating property is not present in the payload or contains a value for which there is no explicit or implicit mapping."}}},Pot={properties:{...fn.Components.properties,mediaTypes:"NamedMediaTypes"}},Aot={...fn.Example,properties:{...fn.Example.properties,dataValue:{resolvable:!1,description:"An example of the data structure that MUST be valid according to the relevant Schema Object. If this field is present, value MUST be absent."},serializedValue:{type:"string",description:"An example of the serialized form of the value, including encoding and escaping as described under Validating Examples. If dataValue is present, then this field SHOULD contain the serialization of the given data. Otherwise, it SHOULD be the valid serialization of a data value that itself MUST be valid as described for dataValue. This field SHOULD NOT be used if the serialization format is JSON, as the data form is easier to work with. If this field is present, value, and externalValue MUST be absent."}}},Mot={properties:{nodeType:{type:"string",enum:["element","attribute","text","cdata","none"],description:'One of element, attribute, text, cdata, or none, as explained under XML Node Types. The default value is none if $ref, $dynamicRef, or type: "array" is present in the Schema Object containing the XML Object, and element otherwise.'},name:{type:"string",description:"Sets the name of the element/attribute corresponding to the schema, replacing the name that was inferred as described under XML Node Names. This field SHALL be ignored if the nodeType is text, cdata, or none."},namespace:{type:"string",description:"The IRI ([RFC3987]) of the namespace definition. Value MUST be in the form of a non-relative IRI."},prefix:{type:"string",description:"The prefix to be used for the name."},attribute:{type:"boolean",description:'Declares whether the property definition translates to an attribute instead of an element. Default value is false. If nodeType is present, this field MUST NOT be present.Deprecated: Use nodeType: "attribute" instead of attribute: true.'},wrapped:{type:"boolean",description:'MAY be used only for an array definition. Signifies whether the array is wrapped (for example, <books><book/><book/></books>) or unwrapped (<book/><book/>). Default value is false. The definition takes effect only when defined alongside type being "array" (outside the items). If nodeType is present, this field MUST NOT be present. Deprecated: Use nodeType: "element" instead of wrapped: true.'}},extensionsPrefix:"x-",description:"A metadata object that allows for more fine-tuned XML model definitions. When using a Schema Object with XML, if no XML Object is present, the behavior is determined by the XML Object\u2019s default field values."},Tot={...fn.Schema,properties:{...fn.Schema.properties,xml:"Xml"}},Po={...fn,Root:vot,Tag:bot,Server:yot,SecurityScheme:kot,OAuth2Flows:xot,DeviceAuthorization:wot,PathItem:Oot,Parameter:Sot,Response:zot,MediaType:Cot,Discriminator:jot,Example:Aot,Xml:Mot,Schema:Tot,Components:Pot,NamedMediaTypes:Qt("MediaTypesMap")},Og=()=>({ref:{leave(e,{report:t,location:a},r){r.node===void 0&&M0(r,t,a)}},DiscriminatorMapping(e,{report:t,resolve:a,location:r}){for(const n of Object.keys(e)){const i=a({$ref:e[n]});if(i.node!==void 0)return;M0(i,t,r.child(n))}}});function M0(e,t,a){const r=e.error;r instanceof kk&&t({message:"Failed to parse: "+r.message,location:{source:r.source,pointer:void 0,start:{col:r.col,line:r.line}}});const n=e.error?.message;t({location:a,message:`Can't resolve $ref${n?": "+n:""}`})}function YE(e,t){let a,r;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((r=e.length)===t.length)for(;r--&&YE(e[r],t[r]););return r===-1}if(!a||typeof e=="object"){r=0;for(a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&++r&&!Object.prototype.hasOwnProperty.call(t,a)||!(a in t)||!YE(e[a],t[a]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function aie(e,t){switch(t){case"oas3":switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";case"MediaTypesMap":return"mediaTypes";default:return null}case"oas2":switch(e){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case"async2":switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"async3":switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"arazzo1":switch(e){case"Root.workflows_items.parameters_items":case"Root.workflows_items.steps_items.parameters_items":return"parameters";default:return null}case"overlay1":return null;case"openrpc1":switch(e){case"ContentDescriptor":return"contentDescriptors";case"Schema":return"schemas";case"Example":return"examples";case"Link":return"links";case"ErrorObject":return"errors";case"ExamplePairing":return"examplePairingObjects";case"Tag":return"tags";default:return null}}}function Bot({version:e,dereference:t,rootDocument:a,resolvedRefMap:r,keepUrlRefs:n,componentRenamingConflicts:i="warn"}){let o,s;const l={ref:{leave(m,v,f){if(!f.location||f.node===void 0){M0(f,v.report,v.location);return}if(f.location.source===a.source&&f.location.source===v.location.source&&v.type.name!=="scalar"&&!t){m.$ref!==f.location.pointer&&(m.$ref=f.location.pointer);return}if(n&&so(m.$ref))return;const b=aie(v.type.name,e);b?t?(u(b,f,v),FE(m,f,v)):(m.$ref=u(b,f,v),c(m,f,v)):FE(m,f,v)}},Example:{leave(m,v){if($ne(m)&&m.value===void 0){const f=v.resolve({$ref:m.externalValue});if(!f.location||f.node===void 0){M0(f,v.report,v.location);return}if(n&&so(m.externalValue))return;m.value=v.resolve({$ref:m.externalValue}).node,delete m.externalValue}}},Root:{enter(m,v){s=v.location,e==="oas3"?o=m.components=m.components||{}:e==="oas2"?o=m:e==="async2"?o=m.components=m.components||{}:e==="async3"?o=m.components=m.components||{}:e==="arazzo1"?o=m.components=m.components||{}:e==="openrpc1"&&(o=m.components=m.components||{})}}};e==="oas3"&&(l.DiscriminatorMapping={leave(m,v){for(const f of Object.keys(m)){const b=m[f],k=v.resolve({$ref:b});if(!k.location||k.node===void 0){M0(k,v.report,v.location.child(f));return}const x=aie("Schema",e);m[f]=u(x,k,v)}}});function c(m,v,f){const b=C0(f.location.source.absoluteRef,m.$ref);r.set(b,{document:a,isRemote:!1,node:v.node,nodePointer:m.$ref,resolved:!0})}function u(m,v,f){o[m]=o[m]||{};const b=h(v,m,f);return o[m][b]=v.node,e==="oas3"||e==="async2"||e==="async3"||e==="openrpc1"?`#/components/${m}/${b}`:`#/${m}/${b}`}function d(m,v,f){return ni(m)&&f.resolve(m,s.absolutePointer).location?.absolutePointer===v.location.absolutePointer?!0:YE(m,v.node)}function h(m,v,f){const[b,k]=[m.location.source.absoluteRef,m.location.pointer],x=o[v];let w="";const z=k.slice(2).split("/").filter(gc);for(;z.length>0;)if(w=z.pop()+(w?`-${w}`:""),!x||!x[w]||d(x[w],m,f))return w;if(w=znt(b)+(w?`_${w}`:""),!x[w]||d(x[w],m,f))return w;const S=w;let C=2;for(;x[w]&&!d(x[w],m,f);)w=`${S}-${C}`,C++;return x[w]||f.report({message:`Two schemas are referenced with the same name but different content. Renamed ${S} to ${w}.`,location:f.location,forceSeverity:i}),w}return l}function T0(e){return e!==void 0}function vC(e,t,a,r){return e.flatMap(n=>Object.keys(n).map(i=>{const o=n[i],s=a==="rules"?t.getRuleSettings(i,r):a==="preprocessors"?t.getPreprocessorSettings(i,r):t.getDecoratorSettings(i,r);if(s.severity==="off")return;const l=s.severity,c=s.message,u=o(s);return Array.isArray(u)?u.map(d=>({severity:l,ruleId:i,message:c,visitor:d})):{severity:l,message:c,ruleId:i,visitor:u}})).flatMap(n=>n).filter(T0)}function B0(e){return Rt(e)&&Object.keys(e).length===0}const rie=()=>{const e=new Map;function t(r,n,i){e.set(r.absolutePointer,{usedIn:e.get(r.absolutePointer)?.usedIn??[],componentType:n,name:i})}function a(r,n){const i=n.length;for(const[o,{usedIn:s,name:l,componentType:c}]of e)!s.some(u=>!n.some(d=>u.absolutePointer.startsWith(d)&&(u.absolutePointer.length===d.length||u.absolutePointer[d.length]==="/")))&&c&&(n.push(o),delete r[c][l],e.delete(o),B0(r[c])&&delete r[c]);return n.length>i?a(r,n):n.length}return{ref:{leave(r,{location:n,type:i,resolve:o,key:s}){if(["Schema","Parameter","Response","SecurityScheme"].includes(i.name)){const l=o(r);if(!l.location)return;const[c,u]=l.location.absolutePointer.split("#",2);if(!u)return;const d=u.split("/").slice(0,3).join("/"),h=`${c}#${d}`,m=e.get(h);m?m.usedIn.push(n):e.set(h,{usedIn:[n],name:s.toString()})}}},Root:{leave(r,n){const i=n.getVisitorData();i.removedCount=a(r,[])}},NamedSchemas:{Schema(r,{location:n,key:i}){r.allOf||t(n,"definitions",i.toString())}},NamedParameters:{Parameter(r,{location:n,key:i}){t(n,"parameters",i.toString())}},NamedResponses:{Response(r,{location:n,key:i}){t(n,"responses",i.toString())}},NamedSecuritySchemes:{SecurityScheme(r,{location:n,key:i}){t(n,"securityDefinitions",i.toString())}}}};function Eot(e,t){return t in e}const nie=()=>{const e=new Map;function t(r,n,i){e.set(r.absolutePointer,{usedIn:e.get(r.absolutePointer)?.usedIn??[],componentType:n,name:i})}function a(r,n){const i=n.length;for(const[o,{usedIn:s,name:l,componentType:c}]of e)if(!s.some(u=>!n.some(d=>u.absolutePointer.startsWith(d)&&(u.absolutePointer.length===d.length||u.absolutePointer[d.length]==="/")))&&c&&r.components&&Eot(r.components,c)){n.push(o);const u=r.components[c];delete u[l],e.delete(o),B0(u)&&delete r.components[c]}return n.length>i?a(r,n):n.length}return{ref:{leave(r,{location:n,type:i,resolve:o,key:s}){if(["Schema","Header","Parameter","Response","Example","RequestBody","MediaTypesMap"].includes(i.name)){const l=o(r);if(!l.location)return;const[c,u]=l.location.absolutePointer.split("#",2);if(!u)return;const d=u.split("/").slice(0,4).join("/"),h=`${c}#${d}`,m=e.get(h);m?m.usedIn.push(n):e.set(h,{usedIn:[n],name:s.toString()})}}},Root:{leave(r,n){const i=n.getVisitorData();i.removedCount=a(r,[]),B0(r.components)&&delete r.components}},NamedSchemas:{Schema(r,{location:n,key:i}){r.allOf||t(n,"schemas",i.toString())}},NamedParameters:{Parameter(r,{location:n,key:i}){t(n,"parameters",i.toString())}},NamedResponses:{Response(r,{location:n,key:i}){t(n,"responses",i.toString())}},NamedExamples:{Example(r,{location:n,key:i}){t(n,"examples",i.toString())}},NamedRequestBodies:{RequestBody(r,{location:n,key:i}){t(n,"requestBodies",i.toString())}},NamedHeaders:{Header(r,{location:n,key:i}){t(n,"headers",i.toString())}},NamedMediaTypes:{MediaTypesMap(r,{location:n,key:i}){t(n,"mediaTypes",i.toString())}}}},Rot={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function db(e,t){const a={};a.any={enter:[],leave:[]};for(const o of Object.keys(t))a[o]={enter:[],leave:[]};a.ref={enter:[],leave:[]};for(const{ruleId:o,severity:s,message:l,visitor:c}of e)i({ruleId:o,severity:s,message:l},c,null);for(const o of Object.keys(a))a[o].enter.sort((s,l)=>l.depth-s.depth),a[o].leave.sort((s,l)=>s.depth-l.depth);return a;function r(o,s,l,c,u=[]){if(u.includes(s))return;u=[...u,s];const d=new Set;for(const m of Object.values(s.properties)){if(m===l){h(o,u);continue}Rt(m)&&m.name!==void 0&&d.add(m)}s.additionalProperties&&typeof s.additionalProperties!="function"&&(s.additionalProperties===l?h(o,u):s.additionalProperties.name!==void 0&&d.add(s.additionalProperties)),s.items&&typeof s.items!="function"&&(s.items===l?h(o,u):s.items.name!==void 0&&d.add(s.items)),s.extensionsPrefix&&d.add(xg);for(const m of Array.from(d.values()))r(o,m,l,c,u);function h(m,v){for(const f of v.slice(1))a[f.name]=a[f.name]||{enter:[],leave:[]},a[f.name].enter.push({...m,visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:c}})}}function n(o,s){if(Array.isArray(s)){const l=s.find(c=>o[c])||void 0;return l&&o[l]}return o[s]}function i(o,s,l,c=0){const u=Object.keys(t);if(c===0)u.push("any"),u.push("ref");else{if(s.any)throw new Error("any() is allowed only on top level");if(s.ref)throw new Error("ref() is allowed only on top level")}for(const d of u){const h=s[d]||n(s,Rot[d]),m=a[d];if(!h)continue;let v,f,b;const k=Rt(h);if(d==="ref"&&k&&h.skip)throw new Error("ref() visitor does not support skip");typeof h=="function"?v=h:k&&(v=h.enter,f=h.leave,b=h.skip);const x=(v?1:0)+(f?1:0)+(b?1:0),w=k&&Object.keys(h).length>x,z={activatedOn:null,type:t[d],parent:l,isSkippedLevel:!1};if(w&&i(o,h,z,c+1),l&&r(o,l.type,t[d],l),v||k){if(v&&typeof v!="function")throw new Error("DEV: should be function");m.enter.push({...o,visit:v||(()=>{}),skip:b,depth:c,context:z})}if(f){if(typeof f!="function")throw new Error("DEV: should be function");m.leave.push({...o,visit:f,depth:c,context:z})}}}}function iie(e,t){return{prev:e,value:t}}function oie(e){return e?.prev??null}function _ot(e){const t={};for(;e.parent;)t[e.parent.type.name]=e.parent.activatedOn?.value.node,e=e.parent;return t}function Lot(e){const t={};for(;e.parent;)e.parent.activatedOn?.value.location&&(t[e.parent.type.name]=e.parent.activatedOn?.value.location),e=e.parent;return t}function E0(e){const{document:t,rootType:a,normalizedVisitors:r,resolvedRefMap:n,ctx:i}=e,o={},s=new Set;l(t.parsed,a,new dC(t.source,"#/"),void 0,"");function l(c,u,d,h,m){const v=(M,E=b.source.absoluteRef)=>{if(!ni(M))return{location:d,node:M};const D=C0(E,M.$ref),I=n.get(D);if(!I)return{location:void 0,node:void 0};const{resolved:L,node:H,document:N,nodePointer:Y,error:te}=I;return{location:L?new dC(N.source,Y):te instanceof kk?new dC(te.source,""):void 0,node:H,error:te}},f=d;let b=d;const{node:k,location:x,error:w}=v(c),z=new Set;if(ni(c)){const M=r.ref.enter;for(const{visit:E,ruleId:D,severity:I,message:L,context:H}of M){z.add(H);const N=C.bind(void 0,D,I,L);E(c,{report:N,resolve:v,rawNode:c,rawLocation:f,location:d,type:u,parent:h,key:m,parentLocations:{},specVersion:i.specVersion,config:i.config,getVisitorData:P.bind(void 0,D)},{node:k,location:x,error:w}),x?.source.absoluteRef&&i.refTypes&&i.refTypes.set(x?.source.absoluteRef,u)}}if(k!==void 0&&x&&u.name!=="scalar"){b=x;const M=o[u.name]?.has?.(k);let E=!1;const D=r.any.enter.concat(r[u.name]?.enter||[]),I=[];for(const{context:N,visit:Y,skip:te,ruleId:ne,severity:ee,message:ce}of D){if(s.has(`${b.absolutePointer}${b.pointer}`))break;if(N.isSkippedLevel)N.parent.activatedOn&&!N.parent.activatedOn.value.nextLevelTypeActivated&&!N.seen.has(c)&&(N.seen.add(c),E=!0,I.push(N));else if(N.parent&&N.parent.activatedOn&&N.activatedOn?.value.withParentNode!==N.parent.activatedOn.value.node&&N.parent.activatedOn.value.nextLevelTypeActivated?.value!==u||!N.parent&&!M){I.push(N);const Z={node:k,location:x,nextLevelTypeActivated:null,withParentNode:N.parent?.activatedOn?.value.node,skipped:(N.parent?.activatedOn?.value.skipped||te?.(k,m,{location:d,rawLocation:f,resolve:v,rawNode:c}))??!1};N.activatedOn=iie(N.activatedOn,Z);let G=N.parent;for(;G;)G.activatedOn.value.nextLevelTypeActivated=iie(G.activatedOn.value.nextLevelTypeActivated,u),G=G.parent;Z.skipped||(E=!0,z.add(N),S(Y,k,c,N,ne,ee,ce))}}if(E||!M){if(o[u.name]=o[u.name]||new Set,o[u.name].add(k),Array.isArray(k)){const N=u.items;if(N!==void 0){const Y=typeof N=="function";for(let te=0;te<k.length;te++){let ne=Y?N(k[te],x.child([te]).absolutePointer):N,ee=k[te];ne?.directResolveAs&&(ne=ne.directResolveAs,ee={$ref:ee}),wg(ne)&&l(ee,ne,x.child([te]),k,te)}}}else if(Rt(k)){const N=Object.keys(u.properties);u.additionalProperties?N.push(...Object.keys(k).filter(Y=>!N.includes(Y))):u.extensionsPrefix&&N.push(...Object.keys(k).filter(Y=>Y.startsWith(u.extensionsPrefix))),ni(c)&&N.push(...Object.keys(c).filter(Y=>Y!=="$ref"&&!N.includes(Y)));for(const Y of N){let te=k[Y],ne=x;te===void 0&&(te=c[Y],ne=d);let ee=Ih(u.properties,Y);if(ee===void 0&&(ee=u.additionalProperties),typeof ee=="function"&&(ee=ee(te,Y)),ee===void 0&&u.extensionsPrefix&&Y.startsWith(u.extensionsPrefix)&&(ee=xg),!wg(ee)&&ee?.directResolveAs&&(ee=ee.directResolveAs,te={$ref:te}),ee&&ee.name===void 0&&ee.resolvable!==!1&&(ee={name:"scalar",properties:{}}),ni(c[Y])&&ee?.name==="scalar"){l(c[Y],ee,d.child([Y]),c,Y);continue}!wg(ee)||ee.name==="scalar"&&!ni(te)||l(te,ee,ne.child([Y]),k,Y)}}}const L=r.any.leave,H=(r[u.name]?.leave||[]).concat(L);for(const N of I.reverse())if(N.isSkippedLevel)N.seen.delete(k);else if(N.activatedOn=oie(N.activatedOn),N.parent){let Y=N.parent;for(;Y;)Y.activatedOn.value.nextLevelTypeActivated=oie(Y.activatedOn.value.nextLevelTypeActivated),Y=Y.parent}for(const{context:N,visit:Y,ruleId:te,severity:ne,message:ee}of H)!N.isSkippedLevel&&z.has(N)&&S(Y,k,c,N,te,ne,ee)}if(b=d,ni(c)){const M=r.ref.leave;for(const{visit:E,ruleId:D,severity:I,context:L,message:H}of M)if(z.has(L)){const N=C.bind(void 0,D,I,H);E(c,{report:N,resolve:v,rawNode:c,rawLocation:f,location:d,type:u,parent:h,key:m,parentLocations:{},specVersion:i.specVersion,config:i.config,getVisitorData:P.bind(void 0,D)},{node:k,location:x,error:w})}}function S(M,E,D,I,L,H,N){const Y=C.bind(void 0,L,H,N);M(E,{report:Y,resolve:v,rawNode:D,location:b,rawLocation:f,type:u,parent:h,key:m,parentLocations:Lot(I),specVersion:i.specVersion,config:i.config,ignoreNextVisitorsOnNode:()=>{s.add(`${b.absolutePointer}${b.pointer}`)},getVisitorData:P.bind(void 0,L)},_ot(I),I)}function C(M,E,D,I){const L=(I.location?Array.isArray(I.location)?I.location:[I.location]:[{...b,reportOnKey:!1}]).map(N=>({...b,reportOnKey:!1,...N})),H=I.forceSeverity||E;H!=="off"&&i.problems.push({ruleId:I.ruleId||M,severity:H,...I,message:D?D.replace("{{message}}",I.message):I.message,suggest:I.suggest||[],location:L})}function P(M){return i.visitorsData[M]=i.visitorsData[M]||{},i.visitorsData[M]}}}async function sie(e){const{document:t,config:a,types:r,externalRefResolver:n,dereference:i=!1,removeUnusedComponents:o=!1,keepUrlRefs:s=!1,componentRenamingConflicts:l}=e,c=y0(t.parsed),u=Bre(c),d=a.getRulesForSpecVersion(u),h=qE(a.extendTypes(r,c),a),m=vC(d,a,"preprocessors",c),v=vC(d,a,"decorators",c),f={problems:[],specVersion:c,config:a,refTypes:new Map,visitorsData:{}};o&&!v.some(x=>x.ruleId==="remove-unused-components")&&v.push({severity:"error",ruleId:"remove-unused-components",visitor:u==="oas2"?rie():nie()});let b=await A0({rootDocument:t,rootType:h.Root,externalRefResolver:n});m.length>0&&(E0({document:t,rootType:h.Root,normalizedVisitors:db(m,h),resolvedRefMap:b,ctx:f}),b=await A0({rootDocument:t,rootType:h.Root,externalRefResolver:n}));const k=db([{severity:"error",ruleId:"bundler",visitor:Bot({version:u,dereference:i,rootDocument:t,resolvedRefMap:b,keepUrlRefs:s,componentRenamingConflicts:l})},...v],h);return E0({document:t,rootType:h.Root,normalizedVisitors:k,resolvedRefMap:b,ctx:f}),{bundle:t,problems:f.problems.map(x=>a.addProblemToIgnore(x)),fileDependencies:n.getFiles(),rootType:h.Root,refTypes:f.refTypes,visitorsData:f.visitorsData}}async function Not(e){const{ref:t,doc:a,externalRefResolver:r=new j0(e.config.resolve),base:n=null}=e;if(!(t||a))throw new Error(`Document or reference is required.
10904
10904
  `);const i=a===void 0?await r.resolveDocument(n,t,!0):a;if(i instanceof Error)throw i;const o=y0(i.parsed);let s;switch(o){case"oas2":s=eie;break;case"oas3_0":s=au;break;case"oas3_1":s=fn;break;case"oas3_2":s=Po;break;default:throw new Error(`Unsupported OpenAPI version: ${o}`)}return sie({document:i,...e,externalRefResolver:r,types:s})}function lie(e={}){return new DO({rules:{},preprocessors:{},decorators:{},plugins:[]},{configPath:e.configPath})}const Dot={isatty:()=>{},createRequire:()=>{}},cie=Object.freeze(Object.defineProperty({__proto__:null,default:Dot},Symbol.toStringTag,{value:"Module"})),pb=LQ(cie);var Sg={},bC={exports:{}},$ot=bC.exports,uie;function Iot(){return uie||(uie=1,(function(e,t){(function(a){var r=t&&!t.nodeType&&t,n=e&&!e.nodeType&&e,i=typeof globalThis=="object"&&globalThis;(i.global===i||i.window===i||i.self===i)&&(a=i);var o,s=2147483647,l=36,c=1,u=26,d=38,h=700,m=72,v=128,f="-",b=/^xn--/,k=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=l-c,S=Math.floor,C=String.fromCharCode,P;function M(Z){throw RangeError(w[Z])}function E(Z,G){for(var J=Z.length,Q=[];J--;)Q[J]=G(Z[J]);return Q}function D(Z,G){var J=Z.split("@"),Q="";J.length>1&&(Q=J[0]+"@",Z=J[1]),Z=Z.replace(x,".");var _=Z.split("."),K=E(_,G).join(".");return Q+K}function I(Z){for(var G=[],J=0,Q=Z.length,_,K;J<Q;)_=Z.charCodeAt(J++),_>=55296&&_<=56319&&J<Q?(K=Z.charCodeAt(J++),(K&64512)==56320?G.push(((_&1023)<<10)+(K&1023)+65536):(G.push(_),J--)):G.push(_);return G}function L(Z){return E(Z,function(G){var J="";return G>65535&&(G-=65536,J+=C(G>>>10&1023|55296),G=56320|G&1023),J+=C(G),J}).join("")}function H(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:l}function N(Z,G){return Z+22+75*(Z<26)-((G!=0)<<5)}function Y(Z,G,J){var Q=0;for(Z=J?S(Z/h):Z>>1,Z+=S(Z/G);Z>z*u>>1;Q+=l)Z=S(Z/z);return S(Q+(z+1)*Z/(Z+d))}function te(Z){var G=[],J=Z.length,Q,_=0,K=v,W=m,oe,le,be,Oe,B,V,de,q,he;for(oe=Z.lastIndexOf(f),oe<0&&(oe=0),le=0;le<oe;++le)Z.charCodeAt(le)>=128&&M("not-basic"),G.push(Z.charCodeAt(le));for(be=oe>0?oe+1:0;be<J;){for(Oe=_,B=1,V=l;be>=J&&M("invalid-input"),de=H(Z.charCodeAt(be++)),(de>=l||de>S((s-_)/B))&&M("overflow"),_+=de*B,q=V<=W?c:V>=W+u?u:V-W,!(de<q);V+=l)he=l-q,B>S(s/he)&&M("overflow"),B*=he;Q=G.length+1,W=Y(_-Oe,Q,Oe==0),S(_/Q)>s-K&&M("overflow"),K+=S(_/Q),_%=Q,G.splice(_++,0,K)}return L(G)}function ne(Z){var G,J,Q,_,K,W,oe,le,be,Oe,B,V=[],de,q,he,pe;for(Z=I(Z),de=Z.length,G=v,J=0,K=m,W=0;W<de;++W)B=Z[W],B<128&&V.push(C(B));for(Q=_=V.length,_&&V.push(f);Q<de;){for(oe=s,W=0;W<de;++W)B=Z[W],B>=G&&B<oe&&(oe=B);for(q=Q+1,oe-G>S((s-J)/q)&&M("overflow"),J+=(oe-G)*q,G=oe,W=0;W<de;++W)if(B=Z[W],B<G&&++J>s&&M("overflow"),B==G){for(le=J,be=l;Oe=be<=K?c:be>=K+u?u:be-K,!(le<Oe);be+=l)pe=le-Oe,he=l-Oe,V.push(C(N(Oe+pe%he,0))),le=S(pe/he);V.push(C(N(le,0))),K=Y(J,q,Q==_),J=0,++Q}++J,++G}return V.join("")}function ee(Z){return D(Z,function(G){return b.test(G)?te(G.slice(4).toLowerCase()):G})}function ce(Z){return D(Z,function(G){return k.test(G)?"xn--"+ne(G):G})}if(o={version:"1.3.2",ucs2:{decode:I,encode:L},decode:te,encode:ne,toASCII:ce,toUnicode:ee},r&&n)if(e.exports==r)n.exports=o;else for(P in o)o.hasOwnProperty(P)&&(r[P]=o[P]);else a.punycode=o})($ot)})(bC,bC.exports)),bC.exports}var die,pie;function Vot(){return pie||(pie=1,die={isString:function(e){return typeof e=="string"},isObject:function(e){return typeof e=="object"&&e!==null},isNull:function(e){return e===null},isNullOrUndefined:function(e){return e==null}}),die}var R0={},eR,hie;function Kot(){if(hie)return eR;hie=1;function e(t,a){return Object.prototype.hasOwnProperty.call(t,a)}return eR=function(t,a,r,n){a=a||"&",r=r||"=";var i={};if(typeof t!="string"||t.length===0)return i;var o=/\+/g;t=t.split(a);var s=1e3;n&&typeof n.maxKeys=="number"&&(s=n.maxKeys);var l=t.length;s>0&&l>s&&(l=s);for(var c=0;c<l;++c){var u=t[c].replace(o,"%20"),d=u.indexOf(r),h,m,v,f;d>=0?(h=u.substr(0,d),m=u.substr(d+1)):(h=u,m=""),v=decodeURIComponent(h),f=decodeURIComponent(m),e(i,v)?Array.isArray(i[v])?i[v].push(f):i[v]=[i[v],f]:i[v]=f}return i},eR}var tR,mie;function Hot(){if(mie)return tR;mie=1;var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};return tR=function(t,a,r,n){return a=a||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(i){var o=encodeURIComponent(e(i))+r;return Array.isArray(t[i])?t[i].map(function(s){return o+encodeURIComponent(e(s))}).join(a):o+encodeURIComponent(e(t[i]))}).join(a):n?encodeURIComponent(e(n))+r+encodeURIComponent(e(t)):""},tR}var gie;function Got(){return gie||(gie=1,R0.decode=R0.parse=Kot(),R0.encode=R0.stringify=Hot()),R0}var fie;function aR(){if(fie)return Sg;fie=1;var e=Iot(),t=Vot();Sg.parse=x,Sg.resolve=z,Sg.resolveObject=S,Sg.format=w,Sg.Url=a;function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
10905
- `," "],s=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(s),c=["%","/","?",";","#"].concat(l),u=["/","?","#"],d=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=Got();function x(C,P,M){if(C&&t.isObject(C)&&C instanceof a)return C;var E=new a;return E.parse(C,P,M),E}a.prototype.parse=function(C,P,M){if(!t.isString(C))throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var E=C.indexOf("?"),D=E!==-1&&E<C.indexOf("#")?"?":"#",I=C.split(D),L=/\\/g;I[0]=I[0].replace(L,"/"),C=I.join(D);var H=C;if(H=H.trim(),!M&&C.split("#").length===1){var N=i.exec(H);if(N)return this.path=H,this.href=H,this.pathname=N[1],N[2]?(this.search=N[2],P?this.query=k.parse(this.search.substr(1)):this.query=this.search.substr(1)):P&&(this.search="",this.query={}),this}var Y=r.exec(H);if(Y){Y=Y[0];var te=Y.toLowerCase();this.protocol=te,H=H.substr(Y.length)}if(M||Y||H.match(/^\/\/[^@\/]+@[^@\/]+/)){var ne=H.substr(0,2)==="//";ne&&!(Y&&f[Y])&&(H=H.substr(2),this.slashes=!0)}if(!f[Y]&&(ne||Y&&!b[Y])){for(var ee=-1,ce=0;ce<u.length;ce++){var Z=H.indexOf(u[ce]);Z!==-1&&(ee===-1||Z<ee)&&(ee=Z)}var G,J;ee===-1?J=H.lastIndexOf("@"):J=H.lastIndexOf("@",ee),J!==-1&&(G=H.slice(0,J),H=H.slice(J+1),this.auth=decodeURIComponent(G)),ee=-1;for(var ce=0;ce<c.length;ce++){var Z=H.indexOf(c[ce]);Z!==-1&&(ee===-1||Z<ee)&&(ee=Z)}ee===-1&&(ee=H.length),this.host=H.slice(0,ee),H=H.slice(ee),this.parseHost(),this.hostname=this.hostname||"";var Q=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Q)for(var _=this.hostname.split(/\./),ce=0,K=_.length;ce<K;ce++){var W=_[ce];if(W&&!W.match(h)){for(var oe="",le=0,be=W.length;le<be;le++)W.charCodeAt(le)>127?oe+="x":oe+=W[le];if(!oe.match(h)){var Oe=_.slice(0,ce),B=_.slice(ce+1),V=W.match(m);V&&(Oe.push(V[1]),B.unshift(V[2])),B.length&&(H="/"+B.join(".")+H),this.hostname=Oe.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),Q||(this.hostname=e.toASCII(this.hostname));var de=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+de,this.href+=this.host,Q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),H[0]!=="/"&&(H="/"+H))}if(!v[te])for(var ce=0,K=l.length;ce<K;ce++){var he=l[ce];if(H.indexOf(he)!==-1){var pe=encodeURIComponent(he);pe===he&&(pe=escape(he)),H=H.split(he).join(pe)}}var U=H.indexOf("#");U!==-1&&(this.hash=H.substr(U),H=H.slice(0,U));var ae=H.indexOf("?");if(ae!==-1?(this.search=H.substr(ae),this.query=H.substr(ae+1),P&&(this.query=k.parse(this.query)),H=H.slice(0,ae)):P&&(this.search="",this.query={}),H&&(this.pathname=H),b[te]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var de=this.pathname||"",ie=this.search||"";this.path=de+ie}return this.href=this.format(),this};function w(C){return t.isString(C)&&(C=x(C)),C instanceof a?C.format():a.prototype.format.call(C)}a.prototype.format=function(){var C=this.auth||"";C&&(C=encodeURIComponent(C),C=C.replace(/%3A/i,":"),C+="@");var P=this.protocol||"",M=this.pathname||"",E=this.hash||"",D=!1,I="";this.host?D=C+this.host:this.hostname&&(D=C+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&t.isObject(this.query)&&Object.keys(this.query).length&&(I=k.stringify(this.query));var L=this.search||I&&"?"+I||"";return P&&P.substr(-1)!==":"&&(P+=":"),this.slashes||(!P||b[P])&&D!==!1?(D="//"+(D||""),M&&M.charAt(0)!=="/"&&(M="/"+M)):D||(D=""),E&&E.charAt(0)!=="#"&&(E="#"+E),L&&L.charAt(0)!=="?"&&(L="?"+L),M=M.replace(/[?#]/g,function(H){return encodeURIComponent(H)}),L=L.replace("#","%23"),P+D+M+L+E};function z(C,P){return x(C,!1,!0).resolve(P)}a.prototype.resolve=function(C){return this.resolveObject(x(C,!1,!0)).format()};function S(C,P){return C?x(C,!1,!0).resolveObject(P):P}return a.prototype.resolveObject=function(C){if(t.isString(C)){var P=new a;P.parse(C,!1,!0),C=P}for(var M=new a,E=Object.keys(this),D=0;D<E.length;D++){var I=E[D];M[I]=this[I]}if(M.hash=C.hash,C.href==="")return M.href=M.format(),M;if(C.slashes&&!C.protocol){for(var L=Object.keys(C),H=0;H<L.length;H++){var N=L[H];N!=="protocol"&&(M[N]=C[N])}return b[M.protocol]&&M.hostname&&!M.pathname&&(M.path=M.pathname="/"),M.href=M.format(),M}if(C.protocol&&C.protocol!==M.protocol){if(!b[C.protocol]){for(var Y=Object.keys(C),te=0;te<Y.length;te++){var ne=Y[te];M[ne]=C[ne]}return M.href=M.format(),M}if(M.protocol=C.protocol,!C.host&&!f[C.protocol]){for(var K=(C.pathname||"").split("/");K.length&&!(C.host=K.shift()););C.host||(C.host=""),C.hostname||(C.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),M.pathname=K.join("/")}else M.pathname=C.pathname;if(M.search=C.search,M.query=C.query,M.host=C.host||"",M.auth=C.auth,M.hostname=C.hostname||C.host,M.port=C.port,M.pathname||M.search){var ee=M.pathname||"",ce=M.search||"";M.path=ee+ce}return M.slashes=M.slashes||C.slashes,M.href=M.format(),M}var Z=M.pathname&&M.pathname.charAt(0)==="/",G=C.host||C.pathname&&C.pathname.charAt(0)==="/",J=G||Z||M.host&&C.pathname,Q=J,_=M.pathname&&M.pathname.split("/")||[],K=C.pathname&&C.pathname.split("/")||[],W=M.protocol&&!b[M.protocol];if(W&&(M.hostname="",M.port=null,M.host&&(_[0]===""?_[0]=M.host:_.unshift(M.host)),M.host="",C.protocol&&(C.hostname=null,C.port=null,C.host&&(K[0]===""?K[0]=C.host:K.unshift(C.host)),C.host=null),J=J&&(K[0]===""||_[0]==="")),G)M.host=C.host||C.host===""?C.host:M.host,M.hostname=C.hostname||C.hostname===""?C.hostname:M.hostname,M.search=C.search,M.query=C.query,_=K;else if(K.length)_||(_=[]),_.pop(),_=_.concat(K),M.search=C.search,M.query=C.query;else if(!t.isNullOrUndefined(C.search)){if(W){M.hostname=M.host=_.shift();var oe=M.host&&M.host.indexOf("@")>0?M.host.split("@"):!1;oe&&(M.auth=oe.shift(),M.host=M.hostname=oe.shift())}return M.search=C.search,M.query=C.query,(!t.isNull(M.pathname)||!t.isNull(M.search))&&(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.href=M.format(),M}if(!_.length)return M.pathname=null,M.search?M.path="/"+M.search:M.path=null,M.href=M.format(),M;for(var le=_.slice(-1)[0],be=(M.host||C.host||_.length>1)&&(le==="."||le==="..")||le==="",Oe=0,B=_.length;B>=0;B--)le=_[B],le==="."?_.splice(B,1):le===".."?(_.splice(B,1),Oe++):Oe&&(_.splice(B,1),Oe--);if(!J&&!Q)for(;Oe--;Oe)_.unshift("..");J&&_[0]!==""&&(!_[0]||_[0].charAt(0)!=="/")&&_.unshift(""),be&&_.join("/").substr(-1)!=="/"&&_.push("");var V=_[0]===""||_[0]&&_[0].charAt(0)==="/";if(W){M.hostname=M.host=V?"":_.length?_.shift():"";var oe=M.host&&M.host.indexOf("@")>0?M.host.split("@"):!1;oe&&(M.auth=oe.shift(),M.host=M.hostname=oe.shift())}return J=J||M.host&&_.length,J&&!V&&_.unshift(""),_.length?M.pathname=_.join("/"):(M.pathname=null,M.path=null),(!t.isNull(M.pathname)||!t.isNull(M.search))&&(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.auth=C.auth||M.auth,M.slashes=M.slashes||C.slashes,M.href=M.format(),M},a.prototype.parseHost=function(){var C=this.host,P=n.exec(C);P&&(P=P[0],P!==":"&&(this.port=P.substr(1)),C=C.substr(0,C.length-P.length)),C&&(this.hostname=C)},Sg}var rR,vie;function Fot(){if(vie)return rR;vie=1;function e(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(t){setTimeout(t,0)}}return rR=e(),rR}var nR,bie;function qot(){if(bie)return nR;bie=1;var e=Fot();return nR=function(t,a){if(t){a.then(function(r){e(function(){t(null,r)})},function(r){e(function(){t(r)})});return}else return a},nR}var iR,yie;function yC(){if(yie)return iR;yie=1;function e(r){return r.replace(/\~/g,"~0").replace(/\//g,"~1")}function t(r){return r.replace(/\~1/g,"/").replace(/~0/g,"~")}function a(r,n,i){if(typeof r>"u")return!1;if(!n||typeof n!="string"||n==="#")return typeof i<"u"?i:r;if(n.indexOf("#")>=0){let s=n.split("#");if(s[0])return!1;n=s[1],n=decodeURIComponent(n.slice(1).split("+").join(" "))}n.startsWith("/")&&(n=n.slice(1));let o=n.split("/");for(let s=0;s<o.length;s++){o[s]=t(o[s]);let l=typeof i<"u"&&s==o.length-1,c=parseInt(o[s],10);if(!Array.isArray(r)||isNaN(c)||c.toString()!==o[s]?c=Array.isArray(r)&&o[s]==="-"?-2:-1:o[s]=s>0?o[s-1]:"",c!=-1||r&&r.hasOwnProperty(o[s]))if(c>=0)l&&(r[c]=i),r=r[c];else{if(c===-2)return l?(Array.isArray(r)&&r.push(i),i):void 0;l&&(r[o[s]]=i),r=r[o[s]]}else if(typeof i<"u"&&typeof r=="object"&&!Array.isArray(r))r[o[s]]=l?i:o[s+1]==="0"||o[s+1]==="-"?[]:{},r=r[o[s]];else return!1}return r}return iR={jptr:a,jpescape:e,jpunescape:t},iR}var oR,kie;function sR(){if(kie)return oR;kie=1;function e(t,a){return a==="$ref"&&!!t&&typeof t[a]=="string"}return oR={isRef:e},oR}var lR,xie;function kC(){if(xie)return lR;xie=1;function e(o){return o}function t(o){return JSON.parse(JSON.stringify(o))}function a(o){let s={};for(let l in o)o.hasOwnProperty(l)&&(s[l]=o[l]);return s}function r(o){let s=Array.isArray(o)?[]:{};for(let l in o)(o.hasOwnProperty(l)||Array.isArray(o))&&(s[l]=typeof o[l]=="object"?r(o[l]):o[l]);return s}function n(o){return Object.assign({},o)}function i(o,s){if(s||(s=new WeakMap),Object(o)!==o||o instanceof Function)return o;if(s.has(o))return s.get(o);try{var l=new o.constructor}catch{l=Object.create(Object.getPrototypeOf(o))}return s.set(o,l),Object.assign(l,...Object.keys(o).map(c=>({[c]:i(o[c],s)})))}return lR={nop:e,clone:t,shallowClone:a,deepClone:r,fastClone:n,circularClone:i},lR}var cR,wie;function uR(){if(wie)return cR;wie=1;const e=yC().jpescape;function t(){return{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1}}function a(r,n,i){if(n||(n={depth:0}),n.depth||(n=Object.assign({},t(),n)),typeof r!="object")return;let o=n.path;for(let s in r){if(n.key=s,n.path=n.path+"/"+encodeURIComponent(e(s)),n.identityPath=n.seen.get(r[s]),n.identity=typeof n.identityPath<"u",r.hasOwnProperty(s)&&i(r,s,n),typeof r[s]=="object"&&!n.identity){n.identityDetection&&!Array.isArray(r[s])&&r[s]!==null&&n.seen.set(r[s],n.path);let l={};l.parent=r,l.path=n.path,l.depth=n.depth?n.depth+1:1,l.pkey=s,l.payload=n.payload,l.seen=n.seen,l.identity=!1,l.identityDetection=n.identityDetection,a(r[s],l,i)}n.path=o}}return cR={recurse:a},cR}var dR,Oie;function Qot(){if(Oie)return dR;Oie=1;const e=uR().recurse,t=kC().shallowClone,a=yC().jptr,r=sR().isRef;var n=function(o){return o&&o.verbose?{warn:function(){var s=Array.prototype.slice.call(arguments);console.warn.apply(console,s)}}:{warn:function(){}}};function i(o,s,l){l||(l={}),l.cache||(l.cache={}),l.state||(l.state={}),l.state.identityDetection=!0,l.depth=l.depth?l.depth+1:1;let c=l.depth>1?o:t(o),u={data:c},d=l.depth>1?s:t(s);l.master||(l.master=c);let h=n(l),m=1;for(;m>0;)m=0,e(u,l.state,function(v,f,b){if(r(v,f)){let k=v[f];if(m++,l.cache[k]){let x=l.cache[k];if(x.resolved)h.warn("Patching %s for %s",k,x.path),b.parent[b.pkey]=x.data,l.$ref&&typeof b.parent[b.pkey]=="object"&&b.parent[b.pkey]!==null&&(b.parent[b.pkey][l.$ref]=k);else{if(k===x.path)throw new Error(`Tight circle at ${x.path}`);h.warn("Unresolved ref"),b.parent[b.pkey]=a(x.source,x.path),b.parent[b.pkey]===!1&&(b.parent[b.pkey]=a(x.source,x.key)),l.$ref&&typeof b.parent[b.pkey]=="object"&&b.parent[b.pkey]!==null&&(b.parent[l.$ref]=k)}}else{let x={};x.path=b.path.split("/$ref")[0],x.key=k,h.warn("Dereffing %s at %s",k,x.path),x.source=d,x.data=a(x.source,x.key),x.data===!1&&(x.data=a(l.master,x.key),x.source=l.master),x.data===!1&&h.warn("Missing $ref target",x.key),l.cache[k]=x,x.data=b.parent[b.pkey]=i(a(x.source,x.key),x.source,l),l.$ref&&typeof b.parent[b.pkey]=="object"&&b.parent[b.pkey]!==null&&(b.parent[b.pkey][l.$ref]=k),x.resolved=!0}}});return u.data}return dR={dereference:i},dR}var pR,Sie;function Uot(){if(Sie)return pR;Sie=1,pR=i,i.default=i,i.stable=c,i.stableStringify=c;var e="[...]",t="[Circular]",a=[],r=[];function n(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(h,m,v,f){typeof f>"u"&&(f=n()),s(h,"",0,[],void 0,0,f);var b;try{r.length===0?b=JSON.stringify(h,m,v):b=JSON.stringify(h,d(m),v)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;a.length!==0;){var k=a.pop();k.length===4?Object.defineProperty(k[0],k[1],k[3]):k[0][k[1]]=k[2]}}return b}function o(h,m,v,f){var b=Object.getOwnPropertyDescriptor(f,v);b.get!==void 0?b.configurable?(Object.defineProperty(f,v,{value:h}),a.push([f,v,m,b])):r.push([m,v,h]):(f[v]=h,a.push([f,v,m]))}function s(h,m,v,f,b,k,x){k+=1;var w;if(typeof h=="object"&&h!==null){for(w=0;w<f.length;w++)if(f[w]===h){o(t,h,m,b);return}if(typeof x.depthLimit<"u"&&k>x.depthLimit){o(e,h,m,b);return}if(typeof x.edgesLimit<"u"&&v+1>x.edgesLimit){o(e,h,m,b);return}if(f.push(h),Array.isArray(h))for(w=0;w<h.length;w++)s(h[w],w,w,f,h,k,x);else{var z=Object.keys(h);for(w=0;w<z.length;w++){var S=z[w];s(h[S],S,w,f,h,k,x)}}f.pop()}}function l(h,m){return h<m?-1:h>m?1:0}function c(h,m,v,f){typeof f>"u"&&(f=n());var b=u(h,"",0,[],void 0,0,f)||h,k;try{r.length===0?k=JSON.stringify(b,m,v):k=JSON.stringify(b,d(m),v)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;a.length!==0;){var x=a.pop();x.length===4?Object.defineProperty(x[0],x[1],x[3]):x[0][x[1]]=x[2]}}return k}function u(h,m,v,f,b,k,x){k+=1;var w;if(typeof h=="object"&&h!==null){for(w=0;w<f.length;w++)if(f[w]===h){o(t,h,m,b);return}try{if(typeof h.toJSON=="function")return}catch{return}if(typeof x.depthLimit<"u"&&k>x.depthLimit){o(e,h,m,b);return}if(typeof x.edgesLimit<"u"&&v+1>x.edgesLimit){o(e,h,m,b);return}if(f.push(h),Array.isArray(h))for(w=0;w<h.length;w++)u(h[w],w,w,f,h,k,x);else{var z={},S=Object.keys(h).sort(l);for(w=0;w<S.length;w++){var C=S[w];u(h[C],C,w,f,h,k,x),z[C]=h[C]}if(typeof b<"u")a.push([b,m,h]),b[m]=z;else return z}f.pop()}}function d(h){return h=typeof h<"u"?h:function(m,v){return v},function(m,v){if(r.length>0)for(var f=0;f<r.length;f++){var b=r[f];if(b[1]===m&&b[0]===v){v=b[2],r.splice(f,1);break}}return h.call(this,m,v)}}return pR}var hR,zie;function Cie(){if(zie)return hR;zie=1;var e={};const t=Uot(),a=e.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"\x1B[31m",yellow:"\x1B[33;1m",green:"\x1B[32m",normal:"\x1B[0m"};function r(b,k,x){return x.indexOf(b)===k}function n(b){return new Set(b).size!==b.length}function i(b){return new Set(b).size<=1}function o(b,k){function x(w,z){return t.stringify(w)===t.stringify(Object.assign({},w,z))}return x(b,k)&&x(k,b)}function s(b){let k=[];for(let x of b)k.find(function(w,z,S){return o(w,x)})||k.push(x);return k}function l(b){return b.length===s(b).length}function c(b){return b.find(function(k,x,w){return b.indexOf(k)<x})}function u(b){let k=0,x;if(b.length===0)return k;for(let w=0;w<b.length;w++)x=b.charCodeAt(w),k=(k<<5)-k+x,k|=0;return k}String.prototype.toCamelCase=function(){return this.toLowerCase().replace(/[-_ \/\.](.)/g,function(b,k){return k.toUpperCase()})};const d=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],h=["items","minItems","maxItems","uniqueItems"],m=["get","post","put","delete","patch","head","options","trace"];function v(b){b=b.replace("[]","Array");let k=b.split("/");return k[0]=k[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),k.join("/")}function f(b){return v(b.split("/").join("_"))}return hR={colour:a,uniqueOnly:r,hasDuplicates:n,allSame:i,distinctArray:l,firstDupe:c,hash:u,parameterTypeProperties:d,arrayProperties:h,httpMethods:m,sanitise:v,sanitiseAll:f},hR}var mR,jie;function Wot(){if(jie)return mR;jie=1;const e=pb,t=HZ(),a=aR(),r=pb,n=pb,i=yC().jptr,o=uR().recurse,s=kC().clone,l=Qot().dereference,c=sR().isRef,u=Cie();function d(M){return[...new Set(M)]}function h(M,E,D,I,L){return new Promise(function(H,N){e.readFile(M,E,function(Y,te){Y?D.ignoreIOErrors&&L?(D.verbose&&console.warn("FAILED",I),D.externalRefs[I].failed=!0,H(L)):N(Y):H(te)})})}function m(M,E,D,I,L,H){let N=H.externalRefs[D+I].paths[0],Y=a.parse(L),te={},ne=1;for(;ne;)ne=0,o(M,{identityDetection:!0},function(ee,ce,Z){if(c(ee,ce)){if(ee[ce].startsWith("#")){if(!te[ee[ce]]&&!ee.$fixed){let G=s(i(E,ee[ce]));if(H.verbose>1&&console.warn((G===!1?u.colour.red:u.colour.green)+"Fragment resolution",ee[ce],u.colour.normal),G===!1){if(Z.parent[Z.pkey]={},H.fatal){let J=new Error("Fragment $ref resolution failed "+ee[ce]);if(H.promise)H.promise.reject(J);else throw J}}else ne++,Z.parent[Z.pkey]=G,te[ee[ce]]=Z.path.replace("/%24ref","")}else if(!ee.$fixed){let G=(N+"/"+te[ee[ce]]).split("/#/").join("/");Z.parent[Z.pkey]={$ref:G,"x-miro":ee[ce],$fixed:!0},H.verbose>1&&console.warn("Replacing with",G),ne++}}else if(Y.protocol){let G=a.resolve(L,ee[ce]).toString();H.verbose>1&&console.warn(u.colour.yellow+"Rewriting external url ref",ee[ce],"as",G,u.colour.normal),ee["x-miro"]=ee[ce],H.externalRefs[ee[ce]]&&(H.externalRefs[G]||(H.externalRefs[G]=H.externalRefs[ee[ce]]),H.externalRefs[G].failed=H.externalRefs[ee[ce]].failed),ee[ce]=G}else if(!ee["x-miro"]){let G=a.resolve(L,ee[ce]).toString(),J=!1;H.externalRefs[ee[ce]]&&(J=H.externalRefs[ee[ce]].failed),J||(H.verbose>1&&console.warn(u.colour.yellow+"Rewriting external ref",ee[ce],"as",G,u.colour.normal),ee["x-miro"]=ee[ce],ee[ce]=G)}}});return o(M,{},function(ee,ce,Z){c(ee,ce)&&typeof ee.$fixed<"u"&&delete ee.$fixed}),H.verbose>1&&console.warn("Finished fragment resolution"),M}function v(M,E){if(!E.filters||!E.filters.length)return M;for(let D of E.filters)M=D(M,E);return M}function f(M,E){return M&&M.length>2?M:E&&E.length>2?E:"file:"}function b(M,E,D,I){var L=a.parse(D.source),H=D.source.split("\\").join("/").split("/");H.pop()||H.pop();let N="",Y=E.split("#");Y.length>1&&(N="#"+Y[1],E=Y[0]),H=H.join("/");let te=a.parse(E),ne=f(te.protocol,L.protocol),ee;if(ne==="file:"?ee=t.resolve(H?H+"/":"",E):ee=a.resolve(H?H+"/":"",E),D.cache[ee]){D.verbose&&console.warn("CACHED",ee,N);let ce=s(D.cache[ee]),Z=D.externalRef=ce;if(N&&(Z=i(Z,N),Z===!1&&(Z={},D.fatal))){let G=new Error("Cached $ref resolution failed "+ee+N);if(D.promise)D.promise.reject(G);else throw G}return Z=m(Z,ce,E,N,ee,D),Z=v(Z,D),I(s(Z),ee,D),Promise.resolve(Z)}if(D.verbose&&console.warn("GET",ee,N),D.handlers&&D.handlers[ne])return D.handlers[ne](H,E,N,D).then(function(ce){return D.externalRef=ce,ce=v(ce,D),D.cache[ee]=ce,I(ce,ee,D),ce}).catch(function(ce){throw D.verbose&&console.warn(ce),ce});if(ne&&ne.startsWith("http")){const ce=Object.assign({},D.fetchOptions,{agent:D.agent});return D.fetch(ee,ce).then(function(Z){if(Z.status!==200){if(D.ignoreIOErrors)return D.verbose&&console.warn("FAILED",E),D.externalRefs[E].failed=!0,'{"$ref":"'+E+'"}';throw new Error(`Received status code ${Z.status}: ${ee}`)}return Z.text()}).then(function(Z){try{let G=n.parse(Z,{schema:"core",prettyErrors:!0});if(Z=D.externalRef=G,D.cache[ee]=s(Z),N&&(Z=i(Z,N),Z===!1&&(Z={},D.fatal))){let J=new Error("Remote $ref resolution failed "+ee+N);if(D.promise)D.promise.reject(J);else throw J}Z=m(Z,G,E,N,ee,D),Z=v(Z,D)}catch(G){if(D.verbose&&console.warn(G),D.promise&&D.fatal)D.promise.reject(G);else throw G}return I(Z,ee,D),Z}).catch(function(Z){if(D.verbose&&console.warn(Z),D.cache[ee]={},D.promise&&D.fatal)D.promise.reject(Z);else throw Z})}else{const ce='{"$ref":"'+E+'"}';return h(ee,D.encoding||"utf8",D,E,ce).then(function(Z){try{let G=n.parse(Z,{schema:"core",prettyErrors:!0});if(Z=D.externalRef=G,D.cache[ee]=s(Z),N&&(Z=i(Z,N),Z===!1&&(Z={},D.fatal))){let J=new Error("File $ref resolution failed "+ee+N);if(D.promise)D.promise.reject(J);else throw J}Z=m(Z,G,E,N,ee,D),Z=v(Z,D)}catch(G){if(D.verbose&&console.warn(G),D.promise&&D.fatal)D.promise.reject(G);else throw G}return I(Z,ee,D),Z}).catch(function(Z){if(D.verbose&&console.warn(Z),D.promise&&D.fatal)D.promise.reject(Z);else throw Z})}}function k(M){return new Promise(function(E,D){function I(H,N,Y){if(H[N]&&c(H[N],"$ref")){let te=H[N].$ref;if(!te.startsWith("#")){let ne="";if(!L[te]){let ee=Object.keys(L).find(function(ce,Z,G){return te.startsWith(ce+"/")});ee&&(M.verbose&&console.warn("Found potential subschema at",ee),ne="/"+(te.split("#")[1]||"").replace(ee.split("#")[1]||""),ne=ne.split("/undefined").join(""),te=ee)}if(L[te]||(L[te]={resolved:!1,paths:[],extras:{},description:H[N].description}),L[te].resolved){if(!L[te].failed)if(M.rewriteRefs){let ee=L[te].resolvedAt;M.verbose>1&&console.warn("Rewriting ref",te,ee),H[N]["x-miro"]=te,H[N].$ref=ee+ne}else H[N]=s(L[te].data)}else L[te].paths.push(Y.path),L[te].extras[Y.path]=ne}}}let L=M.externalRefs;if(M.resolver.depth>0&&M.source===M.resolver.base)return E(L);o(M.openapi.definitions,{identityDetection:!0,path:"#/definitions"},I),o(M.openapi.components,{identityDetection:!0,path:"#/components"},I),o(M.openapi,{identityDetection:!0},I),E(L)})}function x(M){return new Promise(function(E,D){k(M).then(function(L){for(let H in L)if(!L[H].resolved){let N=M.resolver.depth;N>0&&N++,M.resolver.actions[N].push(function(){return b(M.openapi,H,M,function(Y,te,ne){if(!L[H].resolved){let Z={};Z.context=L[H],Z.$ref=H,Z.original=s(Y),Z.updated=Y,Z.source=te,ne.externals.push(Z),L[H].resolved=!0}let ee=Object.assign({},ne,{source:"",resolver:{actions:ne.resolver.actions,depth:ne.resolver.actions.length-1,base:ne.resolver.base}});ne.patch&&L[H].description&&!Y.description&&typeof Y=="object"&&(Y.description=L[H].description),L[H].data=Y;let ce=d(L[H].paths);ce=ce.sort(function(Z,G){const J=Z.startsWith("#/components/")||Z.startsWith("#/definitions/"),Q=G.startsWith("#/components/")||G.startsWith("#/definitions/");return J&&!Q?-1:Q&&!J?1:0});for(let Z of ce)if(L[H].resolvedAt&&Z!==L[H].resolvedAt&&Z.indexOf("x-ms-examples/")<0)ne.verbose>1&&console.warn("Creating pointer to data at",Z),i(ne.openapi,Z,{$ref:L[H].resolvedAt+L[H].extras[Z],"x-miro":H+L[H].extras[Z]});else{L[H].resolvedAt?ne.verbose>1&&console.warn("Avoiding circular reference"):(L[H].resolvedAt=Z,ne.verbose>1&&console.warn("Creating initial clone of data at",Z));let G=s(Y);i(ne.openapi,Z,G)}ne.resolver.actions[ee.resolver.depth].length===0&&ne.resolver.actions[ee.resolver.depth].push(function(){return x(ee)})})})}}).catch(function(L){M.verbose&&console.warn(L),D(L)});let I={options:M};I.actions=M.resolver.actions[M.resolver.depth],E(I)})}const w=M=>M.reduce((E,D)=>E.then(I=>D().then(Array.prototype.concat.bind(I))),Promise.resolve([]));function z(M,E,D){M.resolver.actions.push([]),x(M).then(function(I){w(I.actions).then(function(){if(M.resolver.depth>=M.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),E(!0);M.resolver.depth++,M.resolver.actions[M.resolver.depth].length?setTimeout(function(){z(I.options,E,D)},0):(M.verbose>1&&console.warn(u.colour.yellow+"Finished external resolution!",u.colour.normal),M.resolveInternal&&(M.verbose>1&&console.warn(u.colour.yellow+"Starting internal resolution!",u.colour.normal),M.openapi=l(M.openapi,M.original,{verbose:M.verbose-1}),M.verbose>1&&console.warn(u.colour.yellow+"Finished internal resolution!",u.colour.normal)),o(M.openapi,{},function(L,H,N){c(L,H)&&(M.preserveMiro||delete L["x-miro"])}),E(M))}).catch(function(L){M.verbose&&console.warn(L),D(L)})}).catch(function(I){M.verbose&&console.warn(I),D(I)})}function S(M){if(M.cache||(M.cache={}),M.fetch||(M.fetch=r),M.source){let E=a.parse(M.source);(!E.protocol||E.protocol.length<=2)&&(M.source=t.resolve(M.source))}M.externals=[],M.externalRefs={},M.rewriteRefs=!0,M.resolver={},M.resolver.depth=0,M.resolver.base=M.source,M.resolver.actions=[[]]}function C(M){return S(M),new Promise(function(E,D){M.resolve?z(M,E,D):E(M)})}function P(M,E,D){return D||(D={}),D.openapi=M,D.source=E,D.resolve=!0,S(D),new Promise(function(I,L){z(D,I,L)})}return mR={optionalResolve:C,resolve:P},mR}var gR,Pie;function Zot(){if(Pie)return gR;Pie=1;function e(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}function t(a,r,n,i){if(typeof n.depth>"u"&&(n=e()),a===null||typeof a>"u")return a;if(typeof a.$ref<"u"){let o={$ref:a.$ref};return n.allowRefSiblings&&a.description&&(o.description=a.description),i(o,r,n),o}if(n.combine&&(a.allOf&&Array.isArray(a.allOf)&&a.allOf.length===1&&(a=Object.assign({},a.allOf[0],a),delete a.allOf),a.anyOf&&Array.isArray(a.anyOf)&&a.anyOf.length===1&&(a=Object.assign({},a.anyOf[0],a),delete a.anyOf),a.oneOf&&Array.isArray(a.oneOf)&&a.oneOf.length===1&&(a=Object.assign({},a.oneOf[0],a),delete a.oneOf)),i(a,r,n),n.seen.has(a))return a;if(typeof a=="object"&&a!==null&&n.seen.set(a,!0),n.top=!1,n.depth++,typeof a.items<"u"&&(n.property="items",t(a.items,a,n,i)),a.additionalItems&&typeof a.additionalItems=="object"&&(n.property="additionalItems",t(a.additionalItems,a,n,i)),a.additionalProperties&&typeof a.additionalProperties=="object"&&(n.property="additionalProperties",t(a.additionalProperties,a,n,i)),a.properties)for(let o in a.properties){let s=a.properties[o];n.property="properties/"+o,t(s,a,n,i)}if(a.patternProperties)for(let o in a.patternProperties){let s=a.patternProperties[o];n.property="patternProperties/"+o,t(s,a,n,i)}if(a.allOf)for(let o in a.allOf){let s=a.allOf[o];n.property="allOf/"+o,t(s,a,n,i)}if(a.anyOf)for(let o in a.anyOf){let s=a.anyOf[o];n.property="anyOf/"+o,t(s,a,n,i)}if(a.oneOf)for(let o in a.oneOf){let s=a.oneOf[o];n.property="oneOf/"+o,t(s,a,n,i)}return a.not&&(n.property="not",t(a.not,a,n,i)),n.depth--,a}return gR={getDefaultState:e,walkSchema:t},gR}var Aie={},fR={exports:{}},Mie={},Tie;function Bie(){return Tie||(Tie=1,(function(e){e.fetch=n(globalThis.fetch)&&n(globalThis.ReadableStream),e.writableStream=n(globalThis.WritableStream),e.abortController=n(globalThis.AbortController);var t;function a(){if(t!==void 0)return t;if(globalThis.XMLHttpRequest){t=new globalThis.XMLHttpRequest;try{t.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var o=a();if(!o)return!1;try{return o.responseType=i,o.responseType===i}catch{}return!1}e.arraybuffer=e.fetch||r("arraybuffer"),e.msstream=!e.fetch&&r("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&r("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||(a()?n(a().overrideMimeType):!1);function n(i){return typeof i=="function"}t=null})(Mie)),Mie}var xC={},vR={exports:{}},wC={exports:{}},Eie;function Jot(){if(Eie)return wC.exports;Eie=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(z,S,C){return Function.prototype.apply.call(z,S,C)},a;e&&typeof e.ownKeys=="function"?a=e.ownKeys:Object.getOwnPropertySymbols?a=function(z){return Object.getOwnPropertyNames(z).concat(Object.getOwnPropertySymbols(z))}:a=function(z){return Object.getOwnPropertyNames(z)};function r(z){console&&console.warn&&console.warn(z)}var n=Number.isNaN||function(z){return z!==z};function i(){i.init.call(this)}wC.exports=i,wC.exports.once=k,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(z){if(typeof z!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof z)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(z){if(typeof z!="number"||z<0||n(z))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+z+".");o=z}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(z){if(typeof z!="number"||z<0||n(z))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+z+".");return this._maxListeners=z,this};function l(z){return z._maxListeners===void 0?i.defaultMaxListeners:z._maxListeners}i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(z){for(var S=[],C=1;C<arguments.length;C++)S.push(arguments[C]);var P=z==="error",M=this._events;if(M!==void 0)P=P&&M.error===void 0;else if(!P)return!1;if(P){var E;if(S.length>0&&(E=S[0]),E instanceof Error)throw E;var D=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw D.context=E,D}var I=M[z];if(I===void 0)return!1;if(typeof I=="function")t(I,this,S);else for(var L=I.length,H=v(I,L),C=0;C<L;++C)t(H[C],this,S);return!0};function c(z,S,C,P){var M,E,D;if(s(C),E=z._events,E===void 0?(E=z._events=Object.create(null),z._eventsCount=0):(E.newListener!==void 0&&(z.emit("newListener",S,C.listener?C.listener:C),E=z._events),D=E[S]),D===void 0)D=E[S]=C,++z._eventsCount;else if(typeof D=="function"?D=E[S]=P?[C,D]:[D,C]:P?D.unshift(C):D.push(C),M=l(z),M>0&&D.length>M&&!D.warned){D.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=z,I.type=S,I.count=D.length,r(I)}return z}i.prototype.addListener=function(z,S){return c(this,z,S,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(z,S){return c(this,z,S,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(z,S,C){var P={fired:!1,wrapFn:void 0,target:z,type:S,listener:C},M=u.bind(P);return M.listener=C,P.wrapFn=M,M}i.prototype.once=function(z,S){return s(S),this.on(z,d(this,z,S)),this},i.prototype.prependOnceListener=function(z,S){return s(S),this.prependListener(z,d(this,z,S)),this},i.prototype.removeListener=function(z,S){var C,P,M,E,D;if(s(S),P=this._events,P===void 0)return this;if(C=P[z],C===void 0)return this;if(C===S||C.listener===S)--this._eventsCount===0?this._events=Object.create(null):(delete P[z],P.removeListener&&this.emit("removeListener",z,C.listener||S));else if(typeof C!="function"){for(M=-1,E=C.length-1;E>=0;E--)if(C[E]===S||C[E].listener===S){D=C[E].listener,M=E;break}if(M<0)return this;M===0?C.shift():f(C,M),C.length===1&&(P[z]=C[0]),P.removeListener!==void 0&&this.emit("removeListener",z,D||S)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(z){var S,C,P;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[z]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[z]),this;if(arguments.length===0){var M=Object.keys(C),E;for(P=0;P<M.length;++P)E=M[P],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(S=C[z],typeof S=="function")this.removeListener(z,S);else if(S!==void 0)for(P=S.length-1;P>=0;P--)this.removeListener(z,S[P]);return this};function h(z,S,C){var P=z._events;if(P===void 0)return[];var M=P[S];return M===void 0?[]:typeof M=="function"?C?[M.listener||M]:[M]:C?b(M):v(M,M.length)}i.prototype.listeners=function(z){return h(this,z,!0)},i.prototype.rawListeners=function(z){return h(this,z,!1)},i.listenerCount=function(z,S){return typeof z.listenerCount=="function"?z.listenerCount(S):m.call(z,S)},i.prototype.listenerCount=m;function m(z){var S=this._events;if(S!==void 0){var C=S[z];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function v(z,S){for(var C=new Array(S),P=0;P<S;++P)C[P]=z[P];return C}function f(z,S){for(;S+1<z.length;S++)z[S]=z[S+1];z.pop()}function b(z){for(var S=new Array(z.length),C=0;C<S.length;++C)S[C]=z[C].listener||z[C];return S}function k(z,S){return new Promise(function(C,P){function M(D){z.removeListener(S,E),P(D)}function E(){typeof z.removeListener=="function"&&z.removeListener("error",M),C([].slice.call(arguments))}w(z,S,E,{once:!0}),S!=="error"&&x(z,M,{once:!0})})}function x(z,S,C){typeof z.on=="function"&&w(z,"error",S,C)}function w(z,S,C,P){if(typeof z.on=="function")P.once?z.once(S,C):z.on(S,C);else if(typeof z.addEventListener=="function")z.addEventListener(S,function M(E){P.once&&z.removeEventListener(S,M),C(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof z)}return wC.exports}var Rie,_ie;function Lie(){return _ie||(_ie=1,Rie=Jot().EventEmitter),Rie}var Nie={},_0={},Die;function Xot(){if(Die)return _0;Die=1,_0.byteLength=s,_0.toByteArray=c,_0.fromByteArray=h;for(var e=[],t=[],a=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,i=r.length;n<i;++n)e[n]=r[n],t[r.charCodeAt(n)]=n;t[45]=62,t[95]=63;function o(m){var v=m.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=m.indexOf("=");f===-1&&(f=v);var b=f===v?0:4-f%4;return[f,b]}function s(m){var v=o(m),f=v[0],b=v[1];return(f+b)*3/4-b}function l(m,v,f){return(v+f)*3/4-f}function c(m){var v,f=o(m),b=f[0],k=f[1],x=new a(l(m,b,k)),w=0,z=k>0?b-4:b,S;for(S=0;S<z;S+=4)v=t[m.charCodeAt(S)]<<18|t[m.charCodeAt(S+1)]<<12|t[m.charCodeAt(S+2)]<<6|t[m.charCodeAt(S+3)],x[w++]=v>>16&255,x[w++]=v>>8&255,x[w++]=v&255;return k===2&&(v=t[m.charCodeAt(S)]<<2|t[m.charCodeAt(S+1)]>>4,x[w++]=v&255),k===1&&(v=t[m.charCodeAt(S)]<<10|t[m.charCodeAt(S+1)]<<4|t[m.charCodeAt(S+2)]>>2,x[w++]=v>>8&255,x[w++]=v&255),x}function u(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function d(m,v,f){for(var b,k=[],x=v;x<f;x+=3)b=(m[x]<<16&16711680)+(m[x+1]<<8&65280)+(m[x+2]&255),k.push(u(b));return k.join("")}function h(m){for(var v,f=m.length,b=f%3,k=[],x=16383,w=0,z=f-b;w<z;w+=x)k.push(d(m,w,w+x>z?z:w+x));return b===1?(v=m[f-1],k.push(e[v>>2]+e[v<<4&63]+"==")):b===2&&(v=(m[f-2]<<8)+m[f-1],k.push(e[v>>10]+e[v>>4&63]+e[v<<2&63]+"=")),k.join("")}return _0}var bR={},$ie;function Yot(){return $ie||($ie=1,bR.read=function(e,t,a,r,n){var i,o,s=n*8-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=a?n-1:0,h=a?-1:1,m=e[t+d];for(d+=h,i=m&(1<<-u)-1,m>>=-u,u+=s;u>0;i=i*256+e[t+d],d+=h,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=h,u-=8);if(i===0)i=1-c;else{if(i===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-c}return(m?-1:1)*o*Math.pow(2,i-r)},bR.write=function(e,t,a,r,n,i){var o,s,l,c=i*8-n-1,u=(1<<c)-1,d=u>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,v=r?1:-1,f=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=h/l:t+=h*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*l-1)*Math.pow(2,n),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;e[a+m]=s&255,m+=v,s/=256,n-=8);for(o=o<<n|s,c+=n;c>0;e[a+m]=o&255,m+=v,o/=256,c-=8);e[a+m-v]|=f*128}),bR}var Iie;function L0(){return Iie||(Iie=1,(function(e){const t=Xot(),a=Yot(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;const n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.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 i(){try{const T=new Uint8Array(1),X={foo:function(){return 42}};return Object.setPrototypeOf(X,Uint8Array.prototype),Object.setPrototypeOf(T,X),T.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(T){if(T>n)throw new RangeError('The value "'+T+'" is invalid for option "size"');const X=new Uint8Array(T);return Object.setPrototypeOf(X,s.prototype),X}function s(T,X,se){if(typeof T=="number"){if(typeof X=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(T)}return l(T,X,se)}s.poolSize=8192;function l(T,X,se){if(typeof T=="string")return h(T,X);if(ArrayBuffer.isView(T))return v(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(fe(T,ArrayBuffer)||T&&fe(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(T,SharedArrayBuffer)||T&&fe(T.buffer,SharedArrayBuffer)))return f(T,X,se);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Se=T.valueOf&&T.valueOf();if(Se!=null&&Se!==T)return s.from(Se,X,se);const Me=b(T);if(Me)return Me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),X,se);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}s.from=function(T,X,se){return l(T,X,se)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function u(T,X,se){return c(T),T<=0?o(T):X!==void 0?typeof se=="string"?o(T).fill(X,se):o(T).fill(X):o(T)}s.alloc=function(T,X,se){return u(T,X,se)};function d(T){return c(T),o(T<0?0:k(T)|0)}s.allocUnsafe=function(T){return d(T)},s.allocUnsafeSlow=function(T){return d(T)};function h(T,X){if((typeof X!="string"||X==="")&&(X="utf8"),!s.isEncoding(X))throw new TypeError("Unknown encoding: "+X);const se=w(T,X)|0;let Se=o(se);const Me=Se.write(T,X);return Me!==se&&(Se=Se.slice(0,Me)),Se}function m(T){const X=T.length<0?0:k(T.length)|0,se=o(X);for(let Se=0;Se<X;Se+=1)se[Se]=T[Se]&255;return se}function v(T){if(fe(T,Uint8Array)){const X=new Uint8Array(T);return f(X.buffer,X.byteOffset,X.byteLength)}return m(T)}function f(T,X,se){if(X<0||T.byteLength<X)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<X+(se||0))throw new RangeError('"length" is outside of buffer bounds');let Se;return X===void 0&&se===void 0?Se=new Uint8Array(T):se===void 0?Se=new Uint8Array(T,X):Se=new Uint8Array(T,X,se),Object.setPrototypeOf(Se,s.prototype),Se}function b(T){if(s.isBuffer(T)){const X=k(T.length)|0,se=o(X);return se.length===0||T.copy(se,0,0,X),se}if(T.length!==void 0)return typeof T.length!="number"||je(T.length)?o(0):m(T);if(T.type==="Buffer"&&Array.isArray(T.data))return m(T.data)}function k(T){if(T>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return T|0}function x(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==s.prototype},s.compare=function(T,X){if(fe(T,Uint8Array)&&(T=s.from(T,T.offset,T.byteLength)),fe(X,Uint8Array)&&(X=s.from(X,X.offset,X.byteLength)),!s.isBuffer(T)||!s.isBuffer(X))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===X)return 0;let se=T.length,Se=X.length;for(let Me=0,Be=Math.min(se,Se);Me<Be;++Me)if(T[Me]!==X[Me]){se=T[Me],Se=X[Me];break}return se<Se?-1:Se<se?1:0},s.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(T,X){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return s.alloc(0);let se;if(X===void 0)for(X=0,se=0;se<T.length;++se)X+=T[se].length;const Se=s.allocUnsafe(X);let Me=0;for(se=0;se<T.length;++se){let Be=T[se];if(fe(Be,Uint8Array))Me+Be.length>Se.length?(s.isBuffer(Be)||(Be=s.from(Be)),Be.copy(Se,Me)):Uint8Array.prototype.set.call(Se,Be,Me);else if(s.isBuffer(Be))Be.copy(Se,Me);else throw new TypeError('"list" argument must be an Array of Buffers');Me+=Be.length}return Se};function w(T,X){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||fe(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);const se=T.length,Se=arguments.length>2&&arguments[2]===!0;if(!Se&&se===0)return 0;let Me=!1;for(;;)switch(X){case"ascii":case"latin1":case"binary":return se;case"utf8":case"utf-8":return U(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se*2;case"hex":return se>>>1;case"base64":return ve(T).length;default:if(Me)return Se?-1:U(T).length;X=(""+X).toLowerCase(),Me=!0}}s.byteLength=w;function z(T,X,se){let Se=!1;if((X===void 0||X<0)&&(X=0),X>this.length||((se===void 0||se>this.length)&&(se=this.length),se<=0)||(se>>>=0,X>>>=0,se<=X))return"";for(T||(T="utf8");;)switch(T){case"hex":return ce(this,X,se);case"utf8":case"utf-8":return N(this,X,se);case"ascii":return ne(this,X,se);case"latin1":case"binary":return ee(this,X,se);case"base64":return H(this,X,se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,X,se);default:if(Se)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),Se=!0}}s.prototype._isBuffer=!0;function S(T,X,se){const Se=T[X];T[X]=T[se],T[se]=Se}s.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let X=0;X<T;X+=2)S(this,X,X+1);return this},s.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let X=0;X<T;X+=4)S(this,X,X+3),S(this,X+1,X+2);return this},s.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let X=0;X<T;X+=8)S(this,X,X+7),S(this,X+1,X+6),S(this,X+2,X+5),S(this,X+3,X+4);return this},s.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?N(this,0,T):z.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(T){if(!s.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:s.compare(this,T)===0},s.prototype.inspect=function(){let T="";const X=e.INSPECT_MAX_BYTES;return T=this.toString("hex",0,X).replace(/(.{2})/g,"$1 ").trim(),this.length>X&&(T+=" ... "),"<Buffer "+T+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(T,X,se,Se,Me){if(fe(T,Uint8Array)&&(T=s.from(T,T.offset,T.byteLength)),!s.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(X===void 0&&(X=0),se===void 0&&(se=T?T.length:0),Se===void 0&&(Se=0),Me===void 0&&(Me=this.length),X<0||se>T.length||Se<0||Me>this.length)throw new RangeError("out of range index");if(Se>=Me&&X>=se)return 0;if(Se>=Me)return-1;if(X>=se)return 1;if(X>>>=0,se>>>=0,Se>>>=0,Me>>>=0,this===T)return 0;let Be=Me-Se,De=se-X;const nt=Math.min(Be,De),at=this.slice(Se,Me),pt=T.slice(X,se);for(let lt=0;lt<nt;++lt)if(at[lt]!==pt[lt]){Be=at[lt],De=pt[lt];break}return Be<De?-1:De<Be?1:0};function C(T,X,se,Se,Me){if(T.length===0)return-1;if(typeof se=="string"?(Se=se,se=0):se>2147483647?se=2147483647:se<-2147483648&&(se=-2147483648),se=+se,je(se)&&(se=Me?0:T.length-1),se<0&&(se=T.length+se),se>=T.length){if(Me)return-1;se=T.length-1}else if(se<0)if(Me)se=0;else return-1;if(typeof X=="string"&&(X=s.from(X,Se)),s.isBuffer(X))return X.length===0?-1:P(T,X,se,Se,Me);if(typeof X=="number")return X=X&255,typeof Uint8Array.prototype.indexOf=="function"?Me?Uint8Array.prototype.indexOf.call(T,X,se):Uint8Array.prototype.lastIndexOf.call(T,X,se):P(T,[X],se,Se,Me);throw new TypeError("val must be string, number or Buffer")}function P(T,X,se,Se,Me){let Be=1,De=T.length,nt=X.length;if(Se!==void 0&&(Se=String(Se).toLowerCase(),Se==="ucs2"||Se==="ucs-2"||Se==="utf16le"||Se==="utf-16le")){if(T.length<2||X.length<2)return-1;Be=2,De/=2,nt/=2,se/=2}function at(lt,Ct){return Be===1?lt[Ct]:lt.readUInt16BE(Ct*Be)}let pt;if(Me){let lt=-1;for(pt=se;pt<De;pt++)if(at(T,pt)===at(X,lt===-1?0:pt-lt)){if(lt===-1&&(lt=pt),pt-lt+1===nt)return lt*Be}else lt!==-1&&(pt-=pt-lt),lt=-1}else for(se+nt>De&&(se=De-nt),pt=se;pt>=0;pt--){let lt=!0;for(let Ct=0;Ct<nt;Ct++)if(at(T,pt+Ct)!==at(X,Ct)){lt=!1;break}if(lt)return pt}return-1}s.prototype.includes=function(T,X,se){return this.indexOf(T,X,se)!==-1},s.prototype.indexOf=function(T,X,se){return C(this,T,X,se,!0)},s.prototype.lastIndexOf=function(T,X,se){return C(this,T,X,se,!1)};function M(T,X,se,Se){se=Number(se)||0;const Me=T.length-se;Se?(Se=Number(Se),Se>Me&&(Se=Me)):Se=Me;const Be=X.length;Se>Be/2&&(Se=Be/2);let De;for(De=0;De<Se;++De){const nt=parseInt(X.substr(De*2,2),16);if(je(nt))return De;T[se+De]=nt}return De}function E(T,X,se,Se){return ge(U(X,T.length-se),T,se,Se)}function D(T,X,se,Se){return ge(ae(X),T,se,Se)}function I(T,X,se,Se){return ge(ve(X),T,se,Se)}function L(T,X,se,Se){return ge(ie(X,T.length-se),T,se,Se)}s.prototype.write=function(T,X,se,Se){if(X===void 0)Se="utf8",se=this.length,X=0;else if(se===void 0&&typeof X=="string")Se=X,se=this.length,X=0;else if(isFinite(X))X=X>>>0,isFinite(se)?(se=se>>>0,Se===void 0&&(Se="utf8")):(Se=se,se=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Me=this.length-X;if((se===void 0||se>Me)&&(se=Me),T.length>0&&(se<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");Se||(Se="utf8");let Be=!1;for(;;)switch(Se){case"hex":return M(this,T,X,se);case"utf8":case"utf-8":return E(this,T,X,se);case"ascii":case"latin1":case"binary":return D(this,T,X,se);case"base64":return I(this,T,X,se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,T,X,se);default:if(Be)throw new TypeError("Unknown encoding: "+Se);Se=(""+Se).toLowerCase(),Be=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(T,X,se){return X===0&&se===T.length?t.fromByteArray(T):t.fromByteArray(T.slice(X,se))}function N(T,X,se){se=Math.min(T.length,se);const Se=[];let Me=X;for(;Me<se;){const Be=T[Me];let De=null,nt=Be>239?4:Be>223?3:Be>191?2:1;if(Me+nt<=se){let at,pt,lt,Ct;switch(nt){case 1:Be<128&&(De=Be);break;case 2:at=T[Me+1],(at&192)===128&&(Ct=(Be&31)<<6|at&63,Ct>127&&(De=Ct));break;case 3:at=T[Me+1],pt=T[Me+2],(at&192)===128&&(pt&192)===128&&(Ct=(Be&15)<<12|(at&63)<<6|pt&63,Ct>2047&&(Ct<55296||Ct>57343)&&(De=Ct));break;case 4:at=T[Me+1],pt=T[Me+2],lt=T[Me+3],(at&192)===128&&(pt&192)===128&&(lt&192)===128&&(Ct=(Be&15)<<18|(at&63)<<12|(pt&63)<<6|lt&63,Ct>65535&&Ct<1114112&&(De=Ct))}}De===null?(De=65533,nt=1):De>65535&&(De-=65536,Se.push(De>>>10&1023|55296),De=56320|De&1023),Se.push(De),Me+=nt}return te(Se)}const Y=4096;function te(T){const X=T.length;if(X<=Y)return String.fromCharCode.apply(String,T);let se="",Se=0;for(;Se<X;)se+=String.fromCharCode.apply(String,T.slice(Se,Se+=Y));return se}function ne(T,X,se){let Se="";se=Math.min(T.length,se);for(let Me=X;Me<se;++Me)Se+=String.fromCharCode(T[Me]&127);return Se}function ee(T,X,se){let Se="";se=Math.min(T.length,se);for(let Me=X;Me<se;++Me)Se+=String.fromCharCode(T[Me]);return Se}function ce(T,X,se){const Se=T.length;(!X||X<0)&&(X=0),(!se||se<0||se>Se)&&(se=Se);let Me="";for(let Be=X;Be<se;++Be)Me+=Ce[T[Be]];return Me}function Z(T,X,se){const Se=T.slice(X,se);let Me="";for(let Be=0;Be<Se.length-1;Be+=2)Me+=String.fromCharCode(Se[Be]+Se[Be+1]*256);return Me}s.prototype.slice=function(T,X){const se=this.length;T=~~T,X=X===void 0?se:~~X,T<0?(T+=se,T<0&&(T=0)):T>se&&(T=se),X<0?(X+=se,X<0&&(X=0)):X>se&&(X=se),X<T&&(X=T);const Se=this.subarray(T,X);return Object.setPrototypeOf(Se,s.prototype),Se};function G(T,X,se){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+X>se)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=this[T],Me=1,Be=0;for(;++Be<X&&(Me*=256);)Se+=this[T+Be]*Me;return Se},s.prototype.readUintBE=s.prototype.readUIntBE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=this[T+--X],Me=1;for(;X>0&&(Me*=256);)Se+=this[T+--X]*Me;return Se},s.prototype.readUint8=s.prototype.readUInt8=function(T,X){return T=T>>>0,X||G(T,1,this.length),this[T]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(T,X){return T=T>>>0,X||G(T,2,this.length),this[T]|this[T+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(T,X){return T=T>>>0,X||G(T,2,this.length),this[T]<<8|this[T+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(T,X){return T=T>>>0,X||G(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(T,X){return T=T>>>0,X||G(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},s.prototype.readBigUInt64LE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=X+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,Me=this[++T]+this[++T]*2**8+this[++T]*2**16+se*2**24;return BigInt(Se)+(BigInt(Me)<<BigInt(32))}),s.prototype.readBigUInt64BE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=X*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],Me=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+se;return(BigInt(Se)<<BigInt(32))+BigInt(Me)}),s.prototype.readIntLE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=this[T],Me=1,Be=0;for(;++Be<X&&(Me*=256);)Se+=this[T+Be]*Me;return Me*=128,Se>=Me&&(Se-=Math.pow(2,8*X)),Se},s.prototype.readIntBE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=X,Me=1,Be=this[T+--Se];for(;Se>0&&(Me*=256);)Be+=this[T+--Se]*Me;return Me*=128,Be>=Me&&(Be-=Math.pow(2,8*X)),Be},s.prototype.readInt8=function(T,X){return T=T>>>0,X||G(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},s.prototype.readInt16LE=function(T,X){T=T>>>0,X||G(T,2,this.length);const se=this[T]|this[T+1]<<8;return se&32768?se|4294901760:se},s.prototype.readInt16BE=function(T,X){T=T>>>0,X||G(T,2,this.length);const se=this[T+1]|this[T]<<8;return se&32768?se|4294901760:se},s.prototype.readInt32LE=function(T,X){return T=T>>>0,X||G(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},s.prototype.readInt32BE=function(T,X){return T=T>>>0,X||G(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},s.prototype.readBigInt64LE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(se<<24);return(BigInt(Se)<<BigInt(32))+BigInt(X+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),s.prototype.readBigInt64BE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=(X<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(Se)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+se)}),s.prototype.readFloatLE=function(T,X){return T=T>>>0,X||G(T,4,this.length),a.read(this,T,!0,23,4)},s.prototype.readFloatBE=function(T,X){return T=T>>>0,X||G(T,4,this.length),a.read(this,T,!1,23,4)},s.prototype.readDoubleLE=function(T,X){return T=T>>>0,X||G(T,8,this.length),a.read(this,T,!0,52,8)},s.prototype.readDoubleBE=function(T,X){return T=T>>>0,X||G(T,8,this.length),a.read(this,T,!1,52,8)};function J(T,X,se,Se,Me,Be){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(X>Me||X<Be)throw new RangeError('"value" argument is out of bounds');if(se+Se>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(T,X,se,Se){if(T=+T,X=X>>>0,se=se>>>0,!Se){const De=Math.pow(2,8*se)-1;J(this,T,X,se,De,0)}let Me=1,Be=0;for(this[X]=T&255;++Be<se&&(Me*=256);)this[X+Be]=T/Me&255;return X+se},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(T,X,se,Se){if(T=+T,X=X>>>0,se=se>>>0,!Se){const De=Math.pow(2,8*se)-1;J(this,T,X,se,De,0)}let Me=se-1,Be=1;for(this[X+Me]=T&255;--Me>=0&&(Be*=256);)this[X+Me]=T/Be&255;return X+se},s.prototype.writeUint8=s.prototype.writeUInt8=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,1,255,0),this[X]=T&255,X+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,65535,0),this[X]=T&255,this[X+1]=T>>>8,X+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,65535,0),this[X]=T>>>8,this[X+1]=T&255,X+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,4294967295,0),this[X+3]=T>>>24,this[X+2]=T>>>16,this[X+1]=T>>>8,this[X]=T&255,X+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,4294967295,0),this[X]=T>>>24,this[X+1]=T>>>16,this[X+2]=T>>>8,this[X+3]=T&255,X+4};function Q(T,X,se,Se,Me){V(X,Se,Me,T,se,7);let Be=Number(X&BigInt(4294967295));T[se++]=Be,Be=Be>>8,T[se++]=Be,Be=Be>>8,T[se++]=Be,Be=Be>>8,T[se++]=Be;let De=Number(X>>BigInt(32)&BigInt(4294967295));return T[se++]=De,De=De>>8,T[se++]=De,De=De>>8,T[se++]=De,De=De>>8,T[se++]=De,se}function _(T,X,se,Se,Me){V(X,Se,Me,T,se,7);let Be=Number(X&BigInt(4294967295));T[se+7]=Be,Be=Be>>8,T[se+6]=Be,Be=Be>>8,T[se+5]=Be,Be=Be>>8,T[se+4]=Be;let De=Number(X>>BigInt(32)&BigInt(4294967295));return T[se+3]=De,De=De>>8,T[se+2]=De,De=De>>8,T[se+1]=De,De=De>>8,T[se]=De,se+8}s.prototype.writeBigUInt64LE=_e(function(T,X=0){return Q(this,T,X,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=_e(function(T,X=0){return _(this,T,X,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(T,X,se,Se){if(T=+T,X=X>>>0,!Se){const nt=Math.pow(2,8*se-1);J(this,T,X,se,nt-1,-nt)}let Me=0,Be=1,De=0;for(this[X]=T&255;++Me<se&&(Be*=256);)T<0&&De===0&&this[X+Me-1]!==0&&(De=1),this[X+Me]=(T/Be>>0)-De&255;return X+se},s.prototype.writeIntBE=function(T,X,se,Se){if(T=+T,X=X>>>0,!Se){const nt=Math.pow(2,8*se-1);J(this,T,X,se,nt-1,-nt)}let Me=se-1,Be=1,De=0;for(this[X+Me]=T&255;--Me>=0&&(Be*=256);)T<0&&De===0&&this[X+Me+1]!==0&&(De=1),this[X+Me]=(T/Be>>0)-De&255;return X+se},s.prototype.writeInt8=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,1,127,-128),T<0&&(T=255+T+1),this[X]=T&255,X+1},s.prototype.writeInt16LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,32767,-32768),this[X]=T&255,this[X+1]=T>>>8,X+2},s.prototype.writeInt16BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,32767,-32768),this[X]=T>>>8,this[X+1]=T&255,X+2},s.prototype.writeInt32LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,2147483647,-2147483648),this[X]=T&255,this[X+1]=T>>>8,this[X+2]=T>>>16,this[X+3]=T>>>24,X+4},s.prototype.writeInt32BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[X]=T>>>24,this[X+1]=T>>>16,this[X+2]=T>>>8,this[X+3]=T&255,X+4},s.prototype.writeBigInt64LE=_e(function(T,X=0){return Q(this,T,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=_e(function(T,X=0){return _(this,T,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function K(T,X,se,Se,Me,Be){if(se+Se>T.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("Index out of range")}function W(T,X,se,Se,Me){return X=+X,se=se>>>0,Me||K(T,X,se,4),a.write(T,X,se,Se,23,4),se+4}s.prototype.writeFloatLE=function(T,X,se){return W(this,T,X,!0,se)},s.prototype.writeFloatBE=function(T,X,se){return W(this,T,X,!1,se)};function oe(T,X,se,Se,Me){return X=+X,se=se>>>0,Me||K(T,X,se,8),a.write(T,X,se,Se,52,8),se+8}s.prototype.writeDoubleLE=function(T,X,se){return oe(this,T,X,!0,se)},s.prototype.writeDoubleBE=function(T,X,se){return oe(this,T,X,!1,se)},s.prototype.copy=function(T,X,se,Se){if(!s.isBuffer(T))throw new TypeError("argument should be a Buffer");if(se||(se=0),!Se&&Se!==0&&(Se=this.length),X>=T.length&&(X=T.length),X||(X=0),Se>0&&Se<se&&(Se=se),Se===se||T.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(se<0||se>=this.length)throw new RangeError("Index out of range");if(Se<0)throw new RangeError("sourceEnd out of bounds");Se>this.length&&(Se=this.length),T.length-X<Se-se&&(Se=T.length-X+se);const Me=Se-se;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(X,se,Se):Uint8Array.prototype.set.call(T,this.subarray(se,Se),X),Me},s.prototype.fill=function(T,X,se,Se){if(typeof T=="string"){if(typeof X=="string"?(Se=X,X=0,se=this.length):typeof se=="string"&&(Se=se,se=this.length),Se!==void 0&&typeof Se!="string")throw new TypeError("encoding must be a string");if(typeof Se=="string"&&!s.isEncoding(Se))throw new TypeError("Unknown encoding: "+Se);if(T.length===1){const Be=T.charCodeAt(0);(Se==="utf8"&&Be<128||Se==="latin1")&&(T=Be)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(X<0||this.length<X||this.length<se)throw new RangeError("Out of range index");if(se<=X)return this;X=X>>>0,se=se===void 0?this.length:se>>>0,T||(T=0);let Me;if(typeof T=="number")for(Me=X;Me<se;++Me)this[Me]=T;else{const Be=s.isBuffer(T)?T:s.from(T,Se),De=Be.length;if(De===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(Me=0;Me<se-X;++Me)this[Me+X]=Be[Me%De]}return this};const le={};function be(T,X,se){le[T]=class extends se{constructor(){super(),Object.defineProperty(this,"message",{value:X.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,delete this.name}get code(){return T}set code(Se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Se,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}be("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),be("ERR_INVALID_ARG_TYPE",function(T,X){return`The "${T}" argument must be of type number. Received type ${typeof X}`},TypeError),be("ERR_OUT_OF_RANGE",function(T,X,se){let Se=`The value of "${T}" is out of range.`,Me=se;return Number.isInteger(se)&&Math.abs(se)>2**32?Me=Oe(String(se)):typeof se=="bigint"&&(Me=String(se),(se>BigInt(2)**BigInt(32)||se<-(BigInt(2)**BigInt(32)))&&(Me=Oe(Me)),Me+="n"),Se+=` It must be ${X}. Received ${Me}`,Se},RangeError);function Oe(T){let X="",se=T.length;const Se=T[0]==="-"?1:0;for(;se>=Se+4;se-=3)X=`_${T.slice(se-3,se)}${X}`;return`${T.slice(0,se)}${X}`}function B(T,X,se){de(X,"offset"),(T[X]===void 0||T[X+se]===void 0)&&q(X,T.length-(se+1))}function V(T,X,se,Se,Me,Be){if(T>se||T<X){const De=typeof X=="bigint"?"n":"";let nt;throw X===0||X===BigInt(0)?nt=`>= 0${De} and < 2${De} ** ${(Be+1)*8}${De}`:nt=`>= -(2${De} ** ${(Be+1)*8-1}${De}) and < 2 ** ${(Be+1)*8-1}${De}`,new le.ERR_OUT_OF_RANGE("value",nt,T)}B(Se,Me,Be)}function de(T,X){if(typeof T!="number")throw new le.ERR_INVALID_ARG_TYPE(X,"number",T)}function q(T,X,se){throw Math.floor(T)!==T?(de(T,se),new le.ERR_OUT_OF_RANGE("offset","an integer",T)):X<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${X}`,T)}const he=/[^+/0-9A-Za-z-_]/g;function pe(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function U(T,X){X=X||1/0;let se;const Se=T.length;let Me=null;const Be=[];for(let De=0;De<Se;++De){if(se=T.charCodeAt(De),se>55295&&se<57344){if(!Me){if(se>56319){(X-=3)>-1&&Be.push(239,191,189);continue}else if(De+1===Se){(X-=3)>-1&&Be.push(239,191,189);continue}Me=se;continue}if(se<56320){(X-=3)>-1&&Be.push(239,191,189),Me=se;continue}se=(Me-55296<<10|se-56320)+65536}else Me&&(X-=3)>-1&&Be.push(239,191,189);if(Me=null,se<128){if((X-=1)<0)break;Be.push(se)}else if(se<2048){if((X-=2)<0)break;Be.push(se>>6|192,se&63|128)}else if(se<65536){if((X-=3)<0)break;Be.push(se>>12|224,se>>6&63|128,se&63|128)}else if(se<1114112){if((X-=4)<0)break;Be.push(se>>18|240,se>>12&63|128,se>>6&63|128,se&63|128)}else throw new Error("Invalid code point")}return Be}function ae(T){const X=[];for(let se=0;se<T.length;++se)X.push(T.charCodeAt(se)&255);return X}function ie(T,X){let se,Se,Me;const Be=[];for(let De=0;De<T.length&&!((X-=2)<0);++De)se=T.charCodeAt(De),Se=se>>8,Me=se%256,Be.push(Me),Be.push(Se);return Be}function ve(T){return t.toByteArray(pe(T))}function ge(T,X,se,Se){let Me;for(Me=0;Me<Se&&!(Me+se>=X.length||Me>=T.length);++Me)X[Me+se]=T[Me];return Me}function fe(T,X){return T instanceof X||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===X.name}function je(T){return T!==T}const Ce=(function(){const T="0123456789abcdef",X=new Array(256);for(let se=0;se<16;++se){const Se=se*16;for(let Me=0;Me<16;++Me)X[Se+Me]=T[se]+T[Me]}return X})();function _e(T){return typeof BigInt>"u"?rt:T}function rt(){throw new Error("BigInt not supported")}})(Nie)),Nie}const Vie=LQ(Mre);var yR,Kie;function est(){if(Kie)return yR;Kie=1;function e(v,f){var b=Object.keys(v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);f&&(k=k.filter(function(x){return Object.getOwnPropertyDescriptor(v,x).enumerable})),b.push.apply(b,k)}return b}function t(v){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?e(Object(b),!0).forEach(function(k){a(v,k,b[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(k){Object.defineProperty(v,k,Object.getOwnPropertyDescriptor(b,k))})}return v}function a(v,f,b){return f=o(f),f in v?Object.defineProperty(v,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):v[f]=b,v}function r(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function n(v,f){for(var b=0;b<f.length;b++){var k=f[b];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(v,o(k.key),k)}}function i(v,f,b){return f&&n(v.prototype,f),Object.defineProperty(v,"prototype",{writable:!1}),v}function o(v){var f=s(v,"string");return typeof f=="symbol"?f:String(f)}function s(v,f){if(typeof v!="object"||v===null)return v;var b=v[Symbol.toPrimitive];if(b!==void 0){var k=b.call(v,f);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}var l=L0(),c=l.Buffer,u=Vie,d=u.inspect,h=d&&d.custom||"inspect";function m(v,f,b){c.prototype.copy.call(v,f,b)}return yR=(function(){function v(){r(this,v),this.head=null,this.tail=null,this.length=0}return i(v,[{key:"push",value:function(f){var b={data:f,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(f){var b={data:f,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var b=this.head,k=""+b.data;b=b.next;)k+=f+b.data;return k}},{key:"concat",value:function(f){if(this.length===0)return c.alloc(0);for(var b=c.allocUnsafe(f>>>0),k=this.head,x=0;k;)m(k.data,b,x),x+=k.data.length,k=k.next;return b}},{key:"consume",value:function(f,b){var k;return f<this.head.data.length?(k=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):f===this.head.data.length?k=this.shift():k=b?this._getString(f):this._getBuffer(f),k}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var b=this.head,k=1,x=b.data;for(f-=x.length;b=b.next;){var w=b.data,z=f>w.length?w.length:f;if(z===w.length?x+=w:x+=w.slice(0,f),f-=z,f===0){z===w.length?(++k,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=w.slice(z));break}++k}return this.length-=k,x}},{key:"_getBuffer",value:function(f){var b=c.allocUnsafe(f),k=this.head,x=1;for(k.data.copy(b),f-=k.data.length;k=k.next;){var w=k.data,z=f>w.length?w.length:f;if(w.copy(b,b.length-f,0,z),f-=z,f===0){z===w.length?(++x,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=w.slice(z));break}++x}return this.length-=x,b}},{key:h,value:function(f,b){return d(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),v})(),yR}var kR,Hie;function Gie(){if(Hie)return kR;Hie=1;function e(o,s){var l=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(s?s(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,o)):process.nextTick(n,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(d){!s&&d?l._writableState?l._writableState.errorEmitted?process.nextTick(a,l):(l._writableState.errorEmitted=!0,process.nextTick(t,l,d)):process.nextTick(t,l,d):s?(process.nextTick(a,l),s(d)):process.nextTick(a,l)}),this)}function t(o,s){n(o,s),a(o)}function a(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function n(o,s){o.emit("error",s)}function i(o,s){var l=o._readableState,c=o._writableState;l&&l.autoDestroy||c&&c.autoDestroy?o.destroy(s):o.emit("error",s)}return kR={destroy:e,undestroy:r,errorOrDestroy:i},kR}var xR={},Fie;function hb(){if(Fie)return xR;Fie=1;function e(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,s.__proto__=l}var t={};function a(s,l,c){c||(c=Error);function u(h,m,v){return typeof l=="string"?l:l(h,m,v)}var d=(function(h){e(m,h);function m(v,f,b){return h.call(this,u(v,f,b))||this}return m})(c);d.prototype.name=c.name,d.prototype.code=s,t[s]=d}function r(s,l){if(Array.isArray(s)){var c=s.length;return s=s.map(function(u){return String(u)}),c>2?"one of ".concat(l," ").concat(s.slice(0,c-1).join(", "),", or ")+s[c-1]:c===2?"one of ".concat(l," ").concat(s[0]," or ").concat(s[1]):"of ".concat(l," ").concat(s[0])}else return"of ".concat(l," ").concat(String(s))}function n(s,l,c){return s.substr(0,l.length)===l}function i(s,l,c){return(c===void 0||c>s.length)&&(c=s.length),s.substring(c-l.length,c)===l}function o(s,l,c){return typeof c!="number"&&(c=0),c+l.length>s.length?!1:s.indexOf(l,c)!==-1}return a("ERR_INVALID_OPT_VALUE",function(s,l){return'The value "'+l+'" is invalid for option "'+s+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(s,l,c){var u;typeof l=="string"&&n(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var d;if(i(s," argument"))d="The ".concat(s," ").concat(u," ").concat(r(l,"type"));else{var h=o(s,".")?"property":"argument";d='The "'.concat(s,'" ').concat(h," ").concat(u," ").concat(r(l,"type"))}return d+=". Received type ".concat(typeof c),d},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),xR.codes=t,xR}var wR,qie;function Qie(){if(qie)return wR;qie=1;var e=hb().codes.ERR_INVALID_OPT_VALUE;function t(r,n,i){return r.highWaterMark!=null?r.highWaterMark:n?r[i]:null}function a(r,n,i,o){var s=t(n,o,i);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var l=o?i:"highWaterMark";throw new e(l,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return wR={getHighWaterMark:a},wR}var OR,Uie;function tst(){if(Uie)return OR;Uie=1,OR=e;function e(a,r){if(t("noDeprecation"))return a;var n=!1;function i(){if(!n){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return a.apply(this,arguments)}return i}function t(a){try{if(!globalThis.localStorage)return!1}catch{return!1}var r=globalThis.localStorage[a];return r==null?!1:String(r).toLowerCase()==="true"}return OR}var SR,Wie;function Zie(){if(Wie)return SR;Wie=1,SR=M;function e(W){var oe=this;this.next=null,this.entry=null,this.finish=function(){K(oe,W)}}var t;M.WritableState=C;var a={deprecate:tst()},r=Lie(),n=L0().Buffer,i=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(W){return n.from(W)}function s(W){return n.isBuffer(W)||W instanceof i}var l=Gie(),c=Qie(),u=c.getHighWaterMark,d=hb().codes,h=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,v=d.ERR_MULTIPLE_CALLBACK,f=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,k=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,z=l.errorOrDestroy;function S(){}function C(W,oe,le){t=t||mb(),W=W||{},typeof le!="boolean"&&(le=oe instanceof t),this.objectMode=!!W.objectMode,le&&(this.objectMode=this.objectMode||!!W.writableObjectMode),this.highWaterMark=u(this,W,"writableHighWaterMark",le),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var be=W.decodeStrings===!1;this.decodeStrings=!be,this.defaultEncoding=W.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Oe){te(oe,Oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=W.emitClose!==!1,this.autoDestroy=!!W.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}C.prototype.getBuffer=function(){for(var W=this.bufferedRequest,oe=[];W;)oe.push(W),W=W.next;return oe},(function(){try{Object.defineProperty(C.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var P;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(P=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(W){return P.call(this,W)?!0:this!==M?!1:W&&W._writableState instanceof C}})):P=function(W){return W instanceof this};function M(W){t=t||mb();var oe=this instanceof t;if(!oe&&!P.call(M,this))return new M(W);this._writableState=new C(W,this,oe),this.writable=!0,W&&(typeof W.write=="function"&&(this._write=W.write),typeof W.writev=="function"&&(this._writev=W.writev),typeof W.destroy=="function"&&(this._destroy=W.destroy),typeof W.final=="function"&&(this._final=W.final)),r.call(this)}M.prototype.pipe=function(){z(this,new f)};function E(W,oe){var le=new x;z(W,le),process.nextTick(oe,le)}function D(W,oe,le,be){var Oe;return le===null?Oe=new k:typeof le!="string"&&!oe.objectMode&&(Oe=new h("chunk",["string","Buffer"],le)),Oe?(z(W,Oe),process.nextTick(be,Oe),!1):!0}M.prototype.write=function(W,oe,le){var be=this._writableState,Oe=!1,B=!be.objectMode&&s(W);return B&&!n.isBuffer(W)&&(W=o(W)),typeof oe=="function"&&(le=oe,oe=null),B?oe="buffer":oe||(oe=be.defaultEncoding),typeof le!="function"&&(le=S),be.ending?E(this,le):(B||D(this,be,W,le))&&(be.pendingcb++,Oe=L(this,be,B,W,oe,le)),Oe},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var W=this._writableState;W.corked&&(W.corked--,!W.writing&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&ce(this,W))},M.prototype.setDefaultEncoding=function(W){if(typeof W=="string"&&(W=W.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((W+"").toLowerCase())>-1))throw new w(W);return this._writableState.defaultEncoding=W,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function I(W,oe,le){return!W.objectMode&&W.decodeStrings!==!1&&typeof oe=="string"&&(oe=n.from(oe,le)),oe}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(W,oe,le,be,Oe,B){if(!le){var V=I(oe,be,Oe);be!==V&&(le=!0,Oe="buffer",be=V)}var de=oe.objectMode?1:be.length;oe.length+=de;var q=oe.length<oe.highWaterMark;if(q||(oe.needDrain=!0),oe.writing||oe.corked){var he=oe.lastBufferedRequest;oe.lastBufferedRequest={chunk:be,encoding:Oe,isBuf:le,callback:B,next:null},he?he.next=oe.lastBufferedRequest:oe.bufferedRequest=oe.lastBufferedRequest,oe.bufferedRequestCount+=1}else H(W,oe,!1,de,be,Oe,B);return q}function H(W,oe,le,be,Oe,B,V){oe.writelen=be,oe.writecb=V,oe.writing=!0,oe.sync=!0,oe.destroyed?oe.onwrite(new b("write")):le?W._writev(Oe,oe.onwrite):W._write(Oe,B,oe.onwrite),oe.sync=!1}function N(W,oe,le,be,Oe){--oe.pendingcb,le?(process.nextTick(Oe,be),process.nextTick(Q,W,oe),W._writableState.errorEmitted=!0,z(W,be)):(Oe(be),W._writableState.errorEmitted=!0,z(W,be),Q(W,oe))}function Y(W){W.writing=!1,W.writecb=null,W.length-=W.writelen,W.writelen=0}function te(W,oe){var le=W._writableState,be=le.sync,Oe=le.writecb;if(typeof Oe!="function")throw new v;if(Y(le),oe)N(W,le,be,oe,Oe);else{var B=Z(le)||W.destroyed;!B&&!le.corked&&!le.bufferProcessing&&le.bufferedRequest&&ce(W,le),be?process.nextTick(ne,W,le,B,Oe):ne(W,le,B,Oe)}}function ne(W,oe,le,be){le||ee(W,oe),oe.pendingcb--,be(),Q(W,oe)}function ee(W,oe){oe.length===0&&oe.needDrain&&(oe.needDrain=!1,W.emit("drain"))}function ce(W,oe){oe.bufferProcessing=!0;var le=oe.bufferedRequest;if(W._writev&&le&&le.next){var be=oe.bufferedRequestCount,Oe=new Array(be),B=oe.corkedRequestsFree;B.entry=le;for(var V=0,de=!0;le;)Oe[V]=le,le.isBuf||(de=!1),le=le.next,V+=1;Oe.allBuffers=de,H(W,oe,!0,oe.length,Oe,"",B.finish),oe.pendingcb++,oe.lastBufferedRequest=null,B.next?(oe.corkedRequestsFree=B.next,B.next=null):oe.corkedRequestsFree=new e(oe),oe.bufferedRequestCount=0}else{for(;le;){var q=le.chunk,he=le.encoding,pe=le.callback,U=oe.objectMode?1:q.length;if(H(W,oe,!1,U,q,he,pe),le=le.next,oe.bufferedRequestCount--,oe.writing)break}le===null&&(oe.lastBufferedRequest=null)}oe.bufferedRequest=le,oe.bufferProcessing=!1}M.prototype._write=function(W,oe,le){le(new m("_write()"))},M.prototype._writev=null,M.prototype.end=function(W,oe,le){var be=this._writableState;return typeof W=="function"?(le=W,W=null,oe=null):typeof oe=="function"&&(le=oe,oe=null),W!=null&&this.write(W,oe),be.corked&&(be.corked=1,this.uncork()),be.ending||_(this,be,le),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Z(W){return W.ending&&W.length===0&&W.bufferedRequest===null&&!W.finished&&!W.writing}function G(W,oe){W._final(function(le){oe.pendingcb--,le&&z(W,le),oe.prefinished=!0,W.emit("prefinish"),Q(W,oe)})}function J(W,oe){!oe.prefinished&&!oe.finalCalled&&(typeof W._final=="function"&&!oe.destroyed?(oe.pendingcb++,oe.finalCalled=!0,process.nextTick(G,W,oe)):(oe.prefinished=!0,W.emit("prefinish")))}function Q(W,oe){var le=Z(oe);if(le&&(J(W,oe),oe.pendingcb===0&&(oe.finished=!0,W.emit("finish"),oe.autoDestroy))){var be=W._readableState;(!be||be.autoDestroy&&be.endEmitted)&&W.destroy()}return le}function _(W,oe,le){oe.ending=!0,Q(W,oe),le&&(oe.finished?process.nextTick(le):W.once("finish",le)),oe.ended=!0,W.writable=!1}function K(W,oe,le){var be=W.entry;for(W.entry=null;be;){var Oe=be.callback;oe.pendingcb--,Oe(le),be=be.next}oe.corkedRequestsFree.next=W}return Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(W){this._writableState&&(this._writableState.destroyed=W)}}),M.prototype.destroy=l.destroy,M.prototype._undestroy=l.undestroy,M.prototype._destroy=function(W,oe){oe(W)},SR}var zR,Jie;function mb(){if(Jie)return zR;Jie=1;var e=Object.keys||function(c){var u=[];for(var d in c)u.push(d);return u};zR=o;for(var t=ooe(),a=Zie(),r=e(a.prototype),n=0;n<r.length;n++){var i=r[n];o.prototype[i]||(o.prototype[i]=a.prototype[i])}function o(c){if(!(this instanceof o))return new o(c);t.call(this,c),a.call(this,c),this.allowHalfOpen=!0,c&&(c.readable===!1&&(this.readable=!1),c.writable===!1&&(this.writable=!1),c.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function s(){this._writableState.ended||process.nextTick(l,this)}function l(c){c.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),zR}var CR={},jR={exports:{}},Xie;function ast(){return Xie||(Xie=1,(function(e,t){var a=L0(),r=a.Buffer;function n(o,s){for(var l in o)s[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i);function i(o,s,l){return r(o,s,l)}i.prototype=Object.create(r.prototype),n(r,i),i.from=function(o,s,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,s,l)},i.alloc=function(o,s,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var c=r(o);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return a.SlowBuffer(o)}})(jR,jR.exports)),jR.exports}var Yie;function eoe(){if(Yie)return CR;Yie=1;var e=ast().Buffer,t=e.isEncoding||function(k){switch(k=""+k,k&&k.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 a(k){if(!k)return"utf8";for(var x;;)switch(k){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 k;default:if(x)return;k=(""+k).toLowerCase(),x=!0}}function r(k){var x=a(k);if(typeof x!="string"&&(e.isEncoding===t||!t(k)))throw new Error("Unknown encoding: "+k);return x||k}CR.StringDecoder=n;function n(k){this.encoding=r(k);var x;switch(this.encoding){case"utf16le":this.text=d,this.end=h,x=4;break;case"utf8":this.fillLast=l,x=4;break;case"base64":this.text=m,this.end=v,x=3;break;default:this.write=f,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(x)}n.prototype.write=function(k){if(k.length===0)return"";var x,w;if(this.lastNeed){if(x=this.fillLast(k),x===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w<k.length?x?x+this.text(k,w):this.text(k,w):x||""},n.prototype.end=u,n.prototype.text=c,n.prototype.fillLast=function(k){if(this.lastNeed<=k.length)return k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,k.length),this.lastNeed-=k.length};function i(k){return k<=127?0:k>>5===6?2:k>>4===14?3:k>>3===30?4:k>>6===2?-1:-2}function o(k,x,w){var z=x.length-1;if(z<w)return 0;var S=i(x[z]);return S>=0?(S>0&&(k.lastNeed=S-1),S):--z<w||S===-2?0:(S=i(x[z]),S>=0?(S>0&&(k.lastNeed=S-2),S):--z<w||S===-2?0:(S=i(x[z]),S>=0?(S>0&&(S===2?S=0:k.lastNeed=S-3),S):0))}function s(k,x,w){if((x[0]&192)!==128)return k.lastNeed=0,"\uFFFD";if(k.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return k.lastNeed=1,"\uFFFD";if(k.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return k.lastNeed=2,"\uFFFD"}}function l(k){var x=this.lastTotal-this.lastNeed,w=s(this,k);if(w!==void 0)return w;if(this.lastNeed<=k.length)return k.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,x,0,k.length),this.lastNeed-=k.length}function c(k,x){var w=o(this,k,x);if(!this.lastNeed)return k.toString("utf8",x);this.lastTotal=w;var z=k.length-(w-this.lastNeed);return k.copy(this.lastChar,0,z),k.toString("utf8",x,z)}function u(k){var x=k&&k.length?this.write(k):"";return this.lastNeed?x+"\uFFFD":x}function d(k,x){if((k.length-x)%2===0){var w=k.toString("utf16le",x);if(w){var z=w.charCodeAt(w.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=k[k.length-1],k.toString("utf16le",x,k.length-1)}function h(k){var x=k&&k.length?this.write(k):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,w)}return x}function m(k,x){var w=(k.length-x)%3;return w===0?k.toString("base64",x):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=k[k.length-1]:(this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1]),k.toString("base64",x,k.length-w))}function v(k){var x=k&&k.length?this.write(k):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function f(k){return k.toString(this.encoding)}function b(k){return k&&k.length?this.write(k):""}return CR}var PR,toe;function AR(){if(toe)return PR;toe=1;var e=hb().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var o=!1;return function(){if(!o){o=!0;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];i.apply(this,l)}}}function a(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function n(i,o,s){if(typeof o=="function")return n(i,null,o);o||(o={}),s=t(s||a);var l=o.readable||o.readable!==!1&&i.readable,c=o.writable||o.writable!==!1&&i.writable,u=function(){i.writable||h()},d=i._writableState&&i._writableState.finished,h=function(){c=!1,d=!0,l||s.call(i)},m=i._readableState&&i._readableState.endEmitted,v=function(){l=!1,m=!0,c||s.call(i)},f=function(x){s.call(i,x)},b=function(){var x;if(l&&!m)return(!i._readableState||!i._readableState.ended)&&(x=new e),s.call(i,x);if(c&&!d)return(!i._writableState||!i._writableState.ended)&&(x=new e),s.call(i,x)},k=function(){i.req.on("finish",h)};return r(i)?(i.on("complete",h),i.on("abort",b),i.req?k():i.on("request",k)):c&&!i._writableState&&(i.on("end",u),i.on("close",u)),i.on("end",v),i.on("finish",h),o.error!==!1&&i.on("error",f),i.on("close",b),function(){i.removeListener("complete",h),i.removeListener("abort",b),i.removeListener("request",k),i.req&&i.req.removeListener("finish",h),i.removeListener("end",u),i.removeListener("close",u),i.removeListener("finish",h),i.removeListener("end",v),i.removeListener("error",f),i.removeListener("close",b)}}return PR=n,PR}var MR,aoe;function rst(){if(aoe)return MR;aoe=1;var e;function t(w,z,S){return z=a(z),z in w?Object.defineProperty(w,z,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[z]=S,w}function a(w){var z=r(w,"string");return typeof z=="symbol"?z:String(z)}function r(w,z){if(typeof w!="object"||w===null)return w;var S=w[Symbol.toPrimitive];if(S!==void 0){var C=S.call(w,z);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(w)}var n=AR(),i=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function h(w,z){return{value:w,done:z}}function m(w){var z=w[i];if(z!==null){var S=w[d].read();S!==null&&(w[c]=null,w[i]=null,w[o]=null,z(h(S,!1)))}}function v(w){process.nextTick(m,w)}function f(w,z){return function(S,C){w.then(function(){if(z[l]){S(h(void 0,!0));return}z[u](S,C)},C)}}var b=Object.getPrototypeOf(function(){}),k=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var w=this,z=this[s];if(z!==null)return Promise.reject(z);if(this[l])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(M,E){process.nextTick(function(){w[s]?E(w[s]):M(h(void 0,!0))})});var S=this[c],C;if(S)C=new Promise(f(S,this));else{var P=this[d].read();if(P!==null)return Promise.resolve(h(P,!1));C=new Promise(this[u])}return this[c]=C,C}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var w=this;return new Promise(function(z,S){w[d].destroy(null,function(C){if(C){S(C);return}z(h(void 0,!0))})})}),e),b),x=function(w){var z,S=Object.create(k,(z={},t(z,d,{value:w,writable:!0}),t(z,i,{value:null,writable:!0}),t(z,o,{value:null,writable:!0}),t(z,s,{value:null,writable:!0}),t(z,l,{value:w._readableState.endEmitted,writable:!0}),t(z,u,{value:function(C,P){var M=S[d].read();M?(S[c]=null,S[i]=null,S[o]=null,C(h(M,!1))):(S[i]=C,S[o]=P)},writable:!0}),z));return S[c]=null,n(w,function(C){if(C&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"){var P=S[o];P!==null&&(S[c]=null,S[i]=null,S[o]=null,P(C)),S[s]=C;return}var M=S[i];M!==null&&(S[c]=null,S[i]=null,S[o]=null,M(h(void 0,!0))),S[l]=!0}),w.on("readable",v.bind(null,S)),S};return MR=x,MR}var roe,noe;function nst(){return noe||(noe=1,roe=function(){throw new Error("Readable.from is not available in the browser")}),roe}var TR,ioe;function ooe(){if(ioe)return TR;ioe=1,TR=E;var e;E.ReadableState=M;var t=function(B,V){return B.listeners(V).length},a=Lie(),r=L0().Buffer,n=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(B){return r.from(B)}function o(B){return r.isBuffer(B)||B instanceof n}var s=Vie,l;s&&s.debuglog?l=s.debuglog("stream"):l=function(){};var c=est(),u=Gie(),d=Qie(),h=d.getHighWaterMark,m=hb().codes,v=m.ERR_INVALID_ARG_TYPE,f=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,k=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,w,z,S=u.errorOrDestroy,C=["error","close","destroy","pause","resume"];function P(B,V,de){if(typeof B.prependListener=="function")return B.prependListener(V,de);!B._events||!B._events[V]?B.on(V,de):Array.isArray(B._events[V])?B._events[V].unshift(de):B._events[V]=[de,B._events[V]]}function M(B,V,de){e=e||mb(),B=B||{},typeof de!="boolean"&&(de=V instanceof e),this.objectMode=!!B.objectMode,de&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=h(this,B,"readableHighWaterMark",de),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(x||(x=eoe().StringDecoder),this.decoder=new x(B.encoding),this.encoding=B.encoding)}function E(B){if(e=e||mb(),!(this instanceof E))return new E(B);var V=this instanceof e;this._readableState=new M(B,this,V),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.destroy)),a.call(this)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(B){this._readableState&&(this._readableState.destroyed=B)}}),E.prototype.destroy=u.destroy,E.prototype._undestroy=u.undestroy,E.prototype._destroy=function(B,V){V(B)},E.prototype.push=function(B,V){var de=this._readableState,q;return de.objectMode?q=!0:typeof B=="string"&&(V=V||de.defaultEncoding,V!==de.encoding&&(B=r.from(B,V),V=""),q=!0),D(this,B,V,!1,q)},E.prototype.unshift=function(B){return D(this,B,null,!0,!1)};function D(B,V,de,q,he){l("readableAddChunk",V);var pe=B._readableState;if(V===null)pe.reading=!1,te(B,pe);else{var U;if(he||(U=L(pe,V)),U)S(B,U);else if(pe.objectMode||V&&V.length>0)if(typeof V!="string"&&!pe.objectMode&&Object.getPrototypeOf(V)!==r.prototype&&(V=i(V)),q)pe.endEmitted?S(B,new k):I(B,pe,V,!0);else if(pe.ended)S(B,new f);else{if(pe.destroyed)return!1;pe.reading=!1,pe.decoder&&!de?(V=pe.decoder.write(V),pe.objectMode||V.length!==0?I(B,pe,V,!1):ce(B,pe)):I(B,pe,V,!1)}else q||(pe.reading=!1,ce(B,pe))}return!pe.ended&&(pe.length<pe.highWaterMark||pe.length===0)}function I(B,V,de,q){V.flowing&&V.length===0&&!V.sync?(V.awaitDrain=0,B.emit("data",de)):(V.length+=V.objectMode?1:de.length,q?V.buffer.unshift(de):V.buffer.push(de),V.needReadable&&ne(B)),ce(B,V)}function L(B,V){var de;return!o(V)&&typeof V!="string"&&V!==void 0&&!B.objectMode&&(de=new v("chunk",["string","Buffer","Uint8Array"],V)),de}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(B){x||(x=eoe().StringDecoder);var V=new x(B);this._readableState.decoder=V,this._readableState.encoding=this._readableState.decoder.encoding;for(var de=this._readableState.buffer.head,q="";de!==null;)q+=V.write(de.data),de=de.next;return this._readableState.buffer.clear(),q!==""&&this._readableState.buffer.push(q),this._readableState.length=q.length,this};var H=1073741824;function N(B){return B>=H?B=H:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function Y(B,V){return B<=0||V.length===0&&V.ended?0:V.objectMode?1:B!==B?V.flowing&&V.length?V.buffer.head.data.length:V.length:(B>V.highWaterMark&&(V.highWaterMark=N(B)),B<=V.length?B:V.ended?V.length:(V.needReadable=!0,0))}E.prototype.read=function(B){l("read",B),B=parseInt(B,10);var V=this._readableState,de=B;if(B!==0&&(V.emittedReadable=!1),B===0&&V.needReadable&&((V.highWaterMark!==0?V.length>=V.highWaterMark:V.length>0)||V.ended))return l("read: emitReadable",V.length,V.ended),V.length===0&&V.ended?le(this):ne(this),null;if(B=Y(B,V),B===0&&V.ended)return V.length===0&&le(this),null;var q=V.needReadable;l("need readable",q),(V.length===0||V.length-B<V.highWaterMark)&&(q=!0,l("length less than watermark",q)),V.ended||V.reading?(q=!1,l("reading or ended",q)):q&&(l("do read"),V.reading=!0,V.sync=!0,V.length===0&&(V.needReadable=!0),this._read(V.highWaterMark),V.sync=!1,V.reading||(B=Y(de,V)));var he;return B>0?he=oe(B,V):he=null,he===null?(V.needReadable=V.length<=V.highWaterMark,B=0):(V.length-=B,V.awaitDrain=0),V.length===0&&(V.ended||(V.needReadable=!0),de!==B&&V.ended&&le(this)),he!==null&&this.emit("data",he),he};function te(B,V){if(l("onEofChunk"),!V.ended){if(V.decoder){var de=V.decoder.end();de&&de.length&&(V.buffer.push(de),V.length+=V.objectMode?1:de.length)}V.ended=!0,V.sync?ne(B):(V.needReadable=!1,V.emittedReadable||(V.emittedReadable=!0,ee(B)))}}function ne(B){var V=B._readableState;l("emitReadable",V.needReadable,V.emittedReadable),V.needReadable=!1,V.emittedReadable||(l("emitReadable",V.flowing),V.emittedReadable=!0,process.nextTick(ee,B))}function ee(B){var V=B._readableState;l("emitReadable_",V.destroyed,V.length,V.ended),!V.destroyed&&(V.length||V.ended)&&(B.emit("readable"),V.emittedReadable=!1),V.needReadable=!V.flowing&&!V.ended&&V.length<=V.highWaterMark,W(B)}function ce(B,V){V.readingMore||(V.readingMore=!0,process.nextTick(Z,B,V))}function Z(B,V){for(;!V.reading&&!V.ended&&(V.length<V.highWaterMark||V.flowing&&V.length===0);){var de=V.length;if(l("maybeReadMore read 0"),B.read(0),de===V.length)break}V.readingMore=!1}E.prototype._read=function(B){S(this,new b("_read()"))},E.prototype.pipe=function(B,V){var de=this,q=this._readableState;switch(q.pipesCount){case 0:q.pipes=B;break;case 1:q.pipes=[q.pipes,B];break;default:q.pipes.push(B);break}q.pipesCount+=1,l("pipe count=%d opts=%j",q.pipesCount,V);var he=(!V||V.end!==!1)&&B!==null&&B!==process.stderr,pe=he?ae:rt;q.endEmitted?process.nextTick(pe):de.once("end",pe),B.on("unpipe",U);function U(T,X){l("onunpipe"),T===de&&X&&X.hasUnpiped===!1&&(X.hasUnpiped=!0,ge())}function ae(){l("onend"),B.end()}var ie=G(de);B.on("drain",ie);var ve=!1;function ge(){l("cleanup"),B.removeListener("close",Ce),B.removeListener("finish",_e),B.removeListener("drain",ie),B.removeListener("error",je),B.removeListener("unpipe",U),de.removeListener("end",ae),de.removeListener("end",rt),de.removeListener("data",fe),ve=!0,q.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&ie()}de.on("data",fe);function fe(T){l("ondata");var X=B.write(T);l("dest.write",X),X===!1&&((q.pipesCount===1&&q.pipes===B||q.pipesCount>1&&Oe(q.pipes,B)!==-1)&&!ve&&(l("false write response, pause",q.awaitDrain),q.awaitDrain++),de.pause())}function je(T){l("onerror",T),rt(),B.removeListener("error",je),t(B,"error")===0&&S(B,T)}P(B,"error",je);function Ce(){B.removeListener("finish",_e),rt()}B.once("close",Ce);function _e(){l("onfinish"),B.removeListener("close",Ce),rt()}B.once("finish",_e);function rt(){l("unpipe"),de.unpipe(B)}return B.emit("pipe",de),q.flowing||(l("pipe resume"),de.resume()),B};function G(B){return function(){var V=B._readableState;l("pipeOnDrain",V.awaitDrain),V.awaitDrain&&V.awaitDrain--,V.awaitDrain===0&&t(B,"data")&&(V.flowing=!0,W(B))}}E.prototype.unpipe=function(B){var V=this._readableState,de={hasUnpiped:!1};if(V.pipesCount===0)return this;if(V.pipesCount===1)return B&&B!==V.pipes?this:(B||(B=V.pipes),V.pipes=null,V.pipesCount=0,V.flowing=!1,B&&B.emit("unpipe",this,de),this);if(!B){var q=V.pipes,he=V.pipesCount;V.pipes=null,V.pipesCount=0,V.flowing=!1;for(var pe=0;pe<he;pe++)q[pe].emit("unpipe",this,{hasUnpiped:!1});return this}var U=Oe(V.pipes,B);return U===-1?this:(V.pipes.splice(U,1),V.pipesCount-=1,V.pipesCount===1&&(V.pipes=V.pipes[0]),B.emit("unpipe",this,de),this)},E.prototype.on=function(B,V){var de=a.prototype.on.call(this,B,V),q=this._readableState;return B==="data"?(q.readableListening=this.listenerCount("readable")>0,q.flowing!==!1&&this.resume()):B==="readable"&&!q.endEmitted&&!q.readableListening&&(q.readableListening=q.needReadable=!0,q.flowing=!1,q.emittedReadable=!1,l("on readable",q.length,q.reading),q.length?ne(this):q.reading||process.nextTick(Q,this)),de},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(B,V){var de=a.prototype.removeListener.call(this,B,V);return B==="readable"&&process.nextTick(J,this),de},E.prototype.removeAllListeners=function(B){var V=a.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&process.nextTick(J,this),V};function J(B){var V=B._readableState;V.readableListening=B.listenerCount("readable")>0,V.resumeScheduled&&!V.paused?V.flowing=!0:B.listenerCount("data")>0&&B.resume()}function Q(B){l("readable nexttick read 0"),B.read(0)}E.prototype.resume=function(){var B=this._readableState;return B.flowing||(l("resume"),B.flowing=!B.readableListening,_(this,B)),B.paused=!1,this};function _(B,V){V.resumeScheduled||(V.resumeScheduled=!0,process.nextTick(K,B,V))}function K(B,V){l("resume",V.reading),V.reading||B.read(0),V.resumeScheduled=!1,B.emit("resume"),W(B),V.flowing&&!V.reading&&B.read(0)}E.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function W(B){var V=B._readableState;for(l("flow",V.flowing);V.flowing&&B.read()!==null;);}E.prototype.wrap=function(B){var V=this,de=this._readableState,q=!1;B.on("end",function(){if(l("wrapped end"),de.decoder&&!de.ended){var U=de.decoder.end();U&&U.length&&V.push(U)}V.push(null)}),B.on("data",function(U){if(l("wrapped data"),de.decoder&&(U=de.decoder.write(U)),!(de.objectMode&&U==null)&&!(!de.objectMode&&(!U||!U.length))){var ae=V.push(U);ae||(q=!0,B.pause())}});for(var he in B)this[he]===void 0&&typeof B[he]=="function"&&(this[he]=(function(U){return function(){return B[U].apply(B,arguments)}})(he));for(var pe=0;pe<C.length;pe++)B.on(C[pe],this.emit.bind(this,C[pe]));return this._read=function(U){l("wrapped _read",U),q&&(q=!1,B.resume())},this},typeof Symbol=="function"&&(E.prototype[Symbol.asyncIterator]=function(){return w===void 0&&(w=rst()),w(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(B){this._readableState&&(this._readableState.flowing=B)}}),E._fromList=oe,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function oe(B,V){if(V.length===0)return null;var de;return V.objectMode?de=V.buffer.shift():!B||B>=V.length?(V.decoder?de=V.buffer.join(""):V.buffer.length===1?de=V.buffer.first():de=V.buffer.concat(V.length),V.buffer.clear()):de=V.buffer.consume(B,V.decoder),de}function le(B){var V=B._readableState;l("endReadable",V.endEmitted),V.endEmitted||(V.ended=!0,process.nextTick(be,V,B))}function be(B,V){if(l("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,V.readable=!1,V.emit("end"),B.autoDestroy)){var de=V._writableState;(!de||de.autoDestroy&&de.finished)&&V.destroy()}}typeof Symbol=="function"&&(E.from=function(B,V){return z===void 0&&(z=nst()),z(E,B,V)});function Oe(B,V){for(var de=0,q=B.length;de<q;de++)if(B[de]===V)return de;return-1}return TR}var BR,soe;function loe(){if(soe)return BR;soe=1,BR=s;var e=hb().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,a=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=e.ERR_TRANSFORM_WITH_LENGTH_0,i=mb();function o(u,d){var h=this._transformState;h.transforming=!1;var m=h.writecb;if(m===null)return this.emit("error",new a);h.writechunk=null,h.writecb=null,d!=null&&this.push(d),m(u);var v=this._readableState;v.reading=!1,(v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}function s(u){if(!(this instanceof s))return new s(u);i.call(this,u),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",l)}function l(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,h){c(u,d,h)}):c(this,null,null)}s.prototype.push=function(u,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,u,d)},s.prototype._transform=function(u,d,h){h(new t("_transform()"))},s.prototype._write=function(u,d,h){var m=this._transformState;if(m.writecb=h,m.writechunk=u,m.writeencoding=d,!m.transforming){var v=this._readableState;(m.needTransform||v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}},s.prototype._read=function(u){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},s.prototype._destroy=function(u,d){i.prototype._destroy.call(this,u,function(h){d(h)})};function c(u,d,h){if(d)return u.emit("error",d);if(h!=null&&u.push(h),u._writableState.length)throw new n;if(u._transformState.transforming)throw new r;return u.push(null)}return BR}var ER,coe;function ist(){if(coe)return ER;coe=1,ER=t;var e=loe();function t(a){if(!(this instanceof t))return new t(a);e.call(this,a)}return t.prototype._transform=function(a,r,n){n(null,a)},ER}var RR,uoe;function ost(){if(uoe)return RR;uoe=1;var e;function t(h){var m=!1;return function(){m||(m=!0,h.apply(void 0,arguments))}}var a=hb().codes,r=a.ERR_MISSING_ARGS,n=a.ERR_STREAM_DESTROYED;function i(h){if(h)throw h}function o(h){return h.setHeader&&typeof h.abort=="function"}function s(h,m,v,f){f=t(f);var b=!1;h.on("close",function(){b=!0}),e===void 0&&(e=AR()),e(h,{readable:m,writable:v},function(x){if(x)return f(x);b=!0,f()});var k=!1;return function(x){if(!b&&!k){if(k=!0,o(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();f(x||new n("pipe"))}}}function l(h){h()}function c(h,m){return h.pipe(m)}function u(h){return!h.length||typeof h[h.length-1]!="function"?i:h.pop()}function d(){for(var h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];var f=u(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var b,k=m.map(function(x,w){var z=w<m.length-1,S=w>0;return s(x,z,S,function(C){b||(b=C),C&&k.forEach(l),!z&&(k.forEach(l),f(b))})});return m.reduce(c)}return RR=d,RR}var doe;function poe(){return doe||(doe=1,(function(e,t){t=e.exports=ooe(),t.Stream=t,t.Readable=t,t.Writable=Zie(),t.Duplex=mb(),t.Transform=loe(),t.PassThrough=ist(),t.finished=AR(),t.pipeline=ost()})(vR,vR.exports)),vR.exports}var hoe;function moe(){if(hoe)return xC;hoe=1;var e=Bie(),t=cB(),a=poe(),r=xC.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},n=xC.IncomingMessage=function(i,o,s,l){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){process.nextTick(function(){c.emit("close")})}),s==="fetch"){let f=function(){d.read().then(function(b){if(!c._destroyed){if(l(b.done),b.done){c.push(null);return}c.push(Buffer.from(b.value)),f()}}).catch(function(b){l(!0),c._destroyed||c.emit("error",b)})};if(c._fetchResponse=o,c.url=o.url,c.statusCode=o.status,c.statusMessage=o.statusText,o.headers.forEach(function(b,k){c.headers[k.toLowerCase()]=b,c.rawHeaders.push(k,b)}),e.writableStream){var u=new WritableStream({write:function(b){return l(!1),new Promise(function(k,x){c._destroyed?x():c.push(Buffer.from(b))?k():c._resumeFetch=k})},close:function(){l(!0),c._destroyed||c.push(null)},abort:function(b){l(!0),c._destroyed||c.emit("error",b)}});try{o.body.pipeTo(u).catch(function(b){l(!0),c._destroyed||c.emit("error",b)});return}catch{}}var d=o.body.getReader();f()}else{c._xhr=i,c._pos=0,c.url=i.responseURL,c.statusCode=i.status,c.statusMessage=i.statusText;var h=i.getAllResponseHeaders().split(/\r?\n/);if(h.forEach(function(f){var b=f.match(/^([^:]+):\s*(.*)/);if(b){var k=b[1].toLowerCase();k==="set-cookie"?(c.headers[k]===void 0&&(c.headers[k]=[]),c.headers[k].push(b[2])):c.headers[k]!==void 0?c.headers[k]+=", "+b[2]:c.headers[k]=b[2],c.rawHeaders.push(b[1],b[2])}}),c._charset="x-user-defined",!e.overrideMimeType){var m=c.rawHeaders["mime-type"];if(m){var v=m.match(/;\s*charset=([^;])(;|$)/);v&&(c._charset=v[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};return t(n,a.Readable),n.prototype._read=function(){var i=this,o=i._resumeFetch;o&&(i._resumeFetch=null,o())},n.prototype._onXHRProgress=function(i){var o=this,s=o._xhr,l=null;switch(o._mode){case"text":if(l=s.responseText,l.length>o._pos){var c=l.substr(o._pos);if(o._charset==="x-user-defined"){for(var u=Buffer.alloc(c.length),d=0;d<c.length;d++)u[d]=c.charCodeAt(d)&255;o.push(u)}else o.push(c,o._charset);o._pos=l.length}break;case"arraybuffer":if(s.readyState!==r.DONE||!s.response)break;l=s.response,o.push(Buffer.from(new Uint8Array(l)));break;case"moz-chunked-arraybuffer":if(l=s.response,s.readyState!==r.LOADING||!l)break;o.push(Buffer.from(new Uint8Array(l)));break;case"ms-stream":if(l=s.response,s.readyState!==r.LOADING)break;var h=new globalThis.MSStreamReader;h.onprogress=function(){h.result.byteLength>o._pos&&(o.push(Buffer.from(new Uint8Array(h.result.slice(o._pos)))),o._pos=h.result.byteLength)},h.onload=function(){i(!0),o.push(null)},h.readAsArrayBuffer(l);break}o._xhr.readyState===r.DONE&&o._mode!=="ms-stream"&&(i(!0),o.push(null))},xC}var goe;function sst(){if(goe)return fR.exports;goe=1;var e=Bie(),t=cB(),a=moe(),r=poe(),n=a.IncomingMessage,i=a.readyStates;function o(u,d){return e.fetch&&d?"fetch":e.mozchunkedarraybuffer?"moz-chunked-arraybuffer":e.msstream?"ms-stream":e.arraybuffer&&u?"arraybuffer":"text"}var s=fR.exports=function(u){var d=this;r.Writable.call(d),d._opts=u,d._body=[],d._headers={},u.auth&&d.setHeader("Authorization","Basic "+Buffer.from(u.auth).toString("base64")),Object.keys(u.headers).forEach(function(v){d.setHeader(v,u.headers[v])});var h,m=!0;if(u.mode==="disable-fetch"||"requestTimeout"in u&&!e.abortController)m=!1,h=!0;else if(u.mode==="prefer-streaming")h=!1;else if(u.mode==="allow-wrong-content-type")h=!e.overrideMimeType;else if(!u.mode||u.mode==="default"||u.mode==="prefer-fast")h=!0;else throw new Error("Invalid value for opts.mode");d._mode=o(h,m),d._fetchTimer=null,d._socketTimeout=null,d._socketTimer=null,d.on("finish",function(){d._onFinish()})};t(s,r.Writable),s.prototype.setHeader=function(u,d){var h=this,m=u.toLowerCase();c.indexOf(m)===-1&&(h._headers[m]={name:u,value:d})},s.prototype.getHeader=function(u){var d=this._headers[u.toLowerCase()];return d?d.value:null},s.prototype.removeHeader=function(u){var d=this;delete d._headers[u.toLowerCase()]},s.prototype._onFinish=function(){var u=this;if(!u._destroyed){var d=u._opts;"timeout"in d&&d.timeout!==0&&u.setTimeout(d.timeout);var h=u._headers,m=null;d.method!=="GET"&&d.method!=="HEAD"&&(m=new Blob(u._body,{type:(h["content-type"]||{}).value||""}));var v=[];if(Object.keys(h).forEach(function(x){var w=h[x].name,z=h[x].value;Array.isArray(z)?z.forEach(function(S){v.push([w,S])}):v.push([w,z])}),u._mode==="fetch"){var f=null;if(e.abortController){var b=new AbortController;f=b.signal,u._fetchAbortController=b,"requestTimeout"in d&&d.requestTimeout!==0&&(u._fetchTimer=globalThis.setTimeout(function(){u.emit("requestTimeout"),u._fetchAbortController&&u._fetchAbortController.abort()},d.requestTimeout))}globalThis.fetch(u._opts.url,{method:u._opts.method,headers:v,body:m||void 0,mode:"cors",credentials:d.withCredentials?"include":"same-origin",signal:f}).then(function(x){u._fetchResponse=x,u._resetTimers(!1),u._connect()},function(x){u._resetTimers(!0),u._destroyed||u.emit("error",x)})}else{var k=u._xhr=new globalThis.XMLHttpRequest;try{k.open(u._opts.method,u._opts.url,!0)}catch(x){process.nextTick(function(){u.emit("error",x)});return}"responseType"in k&&(k.responseType=u._mode),"withCredentials"in k&&(k.withCredentials=!!d.withCredentials),u._mode==="text"&&"overrideMimeType"in k&&k.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in d&&(k.timeout=d.requestTimeout,k.ontimeout=function(){u.emit("requestTimeout")}),v.forEach(function(x){k.setRequestHeader(x[0],x[1])}),u._response=null,k.onreadystatechange=function(){switch(k.readyState){case i.LOADING:case i.DONE:u._onXHRProgress();break}},u._mode==="moz-chunked-arraybuffer"&&(k.onprogress=function(){u._onXHRProgress()}),k.onerror=function(){u._destroyed||(u._resetTimers(!0),u.emit("error",new Error("XHR error")))};try{k.send(m)}catch(x){process.nextTick(function(){u.emit("error",x)});return}}}};function l(u){try{var d=u.status;return d!==null&&d!==0}catch{return!1}}s.prototype._onXHRProgress=function(){var u=this;u._resetTimers(!1),!(!l(u._xhr)||u._destroyed)&&(u._response||u._connect(),u._response._onXHRProgress(u._resetTimers.bind(u)))},s.prototype._connect=function(){var u=this;u._destroyed||(u._response=new n(u._xhr,u._fetchResponse,u._mode,u._resetTimers.bind(u)),u._response.on("error",function(d){u.emit("error",d)}),u.emit("response",u._response))},s.prototype._write=function(u,d,h){var m=this;m._body.push(u),h()},s.prototype._resetTimers=function(u){var d=this;globalThis.clearTimeout(d._socketTimer),d._socketTimer=null,u?(globalThis.clearTimeout(d._fetchTimer),d._fetchTimer=null):d._socketTimeout&&(d._socketTimer=globalThis.setTimeout(function(){d.emit("timeout")},d._socketTimeout))},s.prototype.abort=s.prototype.destroy=function(u){var d=this;d._destroyed=!0,d._resetTimers(!0),d._response&&(d._response._destroyed=!0),d._xhr?d._xhr.abort():d._fetchAbortController&&d._fetchAbortController.abort(),u&&d.emit("error",u)},s.prototype.end=function(u,d,h){var m=this;typeof u=="function"&&(h=u,u=void 0),r.Writable.prototype.end.call(m,u,d,h)},s.prototype.setTimeout=function(u,d){var h=this;d&&h.once("timeout",d),h._socketTimeout=u,h._resetTimers(!1)},s.prototype.flushHeaders=function(){},s.prototype.setNoDelay=function(){},s.prototype.setSocketKeepAlive=function(){};var c=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return fR.exports}var _R,foe;function lst(){if(foe)return _R;foe=1,_R=t;var e=Object.prototype.hasOwnProperty;function t(){for(var a={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)e.call(n,i)&&(a[i]=n[i])}return a}return _R}var voe,boe;function cst(){return boe||(boe=1,voe={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),voe}var yoe;function ust(){return yoe||(yoe=1,(function(e){var t=sst(),a=moe(),r=lst(),n=cst(),i=aR(),o=e;o.request=function(s,l){typeof s=="string"?s=i.parse(s):s=r(s);var c=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",u=s.protocol||c,d=s.hostname||s.host,h=s.port,m=s.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),s.url=(d?u+"//"+d:"")+(h?":"+h:"")+m,s.method=(s.method||"GET").toUpperCase(),s.headers=s.headers||{};var v=new t(s);return l&&v.on("response",l),v},o.get=function(s,l){var c=o.request(s,l);return c.end(),c},o.ClientRequest=t,o.IncomingMessage=a.IncomingMessage,o.Agent=function(){},o.Agent.defaultMaxSockets=4,o.globalAgent=new o.Agent,o.STATUS_CODES=n,o.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})(Aie)),Aie}var koe,xoe;function dst(){return xoe||(xoe=1,koe={statusCodes:Object.assign({},{default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"},ust().STATUS_CODES)}),koe}const pst="7.0.8",hst={version:pst};var LR,woe;function mst(){if(woe)return LR;woe=1;const e=pb,t=aR(),a=qot(),r=pb,n=pb,i=yC(),o=i.jptr,s=sR().isRef,l=kC().clone,c=kC().circularClone,u=uR().recurse,d=Wot(),h=Zot(),m=Cie(),v=dst().statusCodes,f=hst.version,b="3.0.0";let k;class x extends Error{constructor(V){super(V),this.name="S2OError"}}function w(B,V){let de=new x(B);if(de.options=V,V.promise)V.promise.reject(de);else throw de}function z(B,V,de){de.warnOnly?V[de.warnProperty||"x-s2o-warning"]=B:w(B,de)}function S(B,V,de){if(B.nullable&&de.patches++,B.discriminator&&typeof B.discriminator=="string"&&(B.discriminator={propertyName:B.discriminator}),B.items&&Array.isArray(B.items)&&(B.items.length===0?B.items={}:B.items.length===1?B.items=B.items[0]:B.items={anyOf:B.items}),B.type&&Array.isArray(B.type))if(de.patch){if(de.patches++,B.type.length===0)delete B.type;else{B.oneOf||(B.oneOf=[]);for(let q of B.type){let he={};if(q==="null")B.nullable=!0;else{he.type=q;for(let pe of m.arrayProperties)typeof B.prop<"u"&&(he[pe]=B[pe],delete B[pe])}he.type&&B.oneOf.push(he)}delete B.type,B.oneOf.length===0?delete B.oneOf:B.oneOf.length<2&&(B.type=B.oneOf[0].type,Object.keys(B.oneOf[0]).length>1&&z("Lost properties from oneOf",B,de),delete B.oneOf)}B.type&&Array.isArray(B.type)&&B.type.length===1&&(B.type=B.type[0])}else w("(Patchable) schema type must not be an array",de);B.type&&B.type==="null"&&(delete B.type,B.nullable=!0),B.type==="array"&&!B.items&&(B.items={}),B.type==="file"&&(B.type="string",B.format="binary"),typeof B.required=="boolean"&&(B.required&&B.name&&(typeof V.required>"u"&&(V.required=[]),Array.isArray(V.required)&&V.required.push(B.name)),delete B.required),B.xml&&typeof B.xml.namespace=="string"&&(B.xml.namespace||delete B.xml.namespace),typeof B.allowEmptyValue<"u"&&(de.patches++,delete B.allowEmptyValue)}function C(B,V){if(B["x-required"]&&Array.isArray(B["x-required"])&&(B.required||(B.required=[]),B.required=B.required.concat(B["x-required"]),delete B["x-required"]),B["x-anyOf"]&&(B.anyOf=B["x-anyOf"],delete B["x-anyOf"]),B["x-oneOf"]&&(B.oneOf=B["x-oneOf"],delete B["x-oneOf"]),B["x-not"]&&(B.not=B["x-not"],delete B["x-not"]),typeof B["x-nullable"]=="boolean"&&(B.nullable=B["x-nullable"],delete B["x-nullable"]),typeof B["x-discriminator"]=="object"&&typeof B["x-discriminator"].propertyName=="string"){B.discriminator=B["x-discriminator"],delete B["x-discriminator"];for(let de in B.discriminator.mapping){let q=B.discriminator.mapping[de];q.startsWith("#/definitions/")&&(B.discriminator.mapping[de]=q.replace("#/definitions/","#/components/schemas/"))}}}function P(B,V){h.walkSchema(B,{},{},function(de,q,he){C(de),S(de,q,V)})}function M(B){return B.indexOf("#")>=0?B=B.split("#")[1].split("/").pop():B=B.split("/").pop().split(".")[0],encodeURIComponent(m.sanitise(B))}function E(B,V,de){let q=de.payload.options;if(s(B,V)){if(!B[V].startsWith("#/components/")){if(B[V]==="#/consumes")delete B[V],de.parent[de.pkey]=l(q.openapi.consumes);else if(B[V]==="#/produces")delete B[V],de.parent[de.pkey]=l(q.openapi.produces);else if(B[V].startsWith("#/definitions/")){let he=B[V].replace("#/definitions/","").split("/");const pe=i.jpunescape(he[0]);let U=k.schemas[decodeURIComponent(pe)];U?he[0]=U:z("Could not resolve reference "+B[V],B,q),B[V]="#/components/schemas/"+he.join("/")}else if(B[V].startsWith("#/parameters/"))B[V]="#/components/parameters/"+m.sanitise(B[V].replace("#/parameters/",""));else if(B[V].startsWith("#/responses/"))B[V]="#/components/responses/"+m.sanitise(B[V].replace("#/responses/",""));else if(B[V].startsWith("#")){let he=l(i.jptr(q.openapi,B[V]));if(he===!1)z("direct $ref not found "+B[V],B,q);else if(q.refmap[B[V]])B[V]=q.refmap[B[V]];else{let pe=B[V];pe=pe.replace("/properties/headers/",""),pe=pe.replace("/properties/responses/",""),pe=pe.replace("/properties/parameters/",""),pe=pe.replace("/properties/schemas/","");let U="schemas",ae=pe.lastIndexOf("/schema");if(U=pe.indexOf("/headers/")>ae?"headers":pe.indexOf("/responses/")>ae?"responses":pe.indexOf("/example")>ae?"examples":pe.indexOf("/x-")>ae?"extensions":pe.indexOf("/parameters/")>ae?"parameters":"schemas",U==="schemas"&&P(he,q),U!=="responses"&&U!=="extensions"){let ie=U.substr(0,U.length-1);ie==="parameter"&&he.name&&he.name===m.sanitise(he.name)&&(ie=encodeURIComponent(he.name));let ve=1;for(B["x-miro"]&&(ie=M(B["x-miro"]),ve="");i.jptr(q.openapi,"#/components/"+U+"/"+ie+ve);)ve=ve===""?2:++ve;let ge="#/components/"+U+"/"+ie+ve,fe="";U==="examples"&&(he={value:he},fe="/value"),i.jptr(q.openapi,ge,he),q.refmap[B[V]]=ge+fe,B[V]=ge+fe}}}}if(delete B["x-miro"],Object.keys(B).length>1){const he=B[V],pe=de.path.indexOf("/schema")>=0;q.refSiblings==="preserve"||(pe&&q.refSiblings==="allOf"?(delete B.$ref,de.parent[de.pkey]={allOf:[{$ref:he},B]}):de.parent[de.pkey]={$ref:he})}}if(V==="x-ms-odata"&&typeof B[V]=="string"&&B[V].startsWith("#/")){let he=B[V].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),pe=k.schemas[decodeURIComponent(he[0])];pe?he[0]=pe:z("Could not resolve reference "+B[V],B,q),B[V]="#/components/schemas/"+he.join("/")}}function D(B,V){for(let de in V.refmap)i.jptr(B,de,{$ref:V.refmap[de]})}function I(B){for(let V in B)for(let de in B[V]){let q=m.sanitise(de);de!==q&&(B[V][q]=B[V][de],delete B[V][de])}}function L(B,V){if(B.type==="basic"&&(B.type="http",B.scheme="basic"),B.type==="oauth2"){let de={},q=B.flow;B.flow==="application"&&(q="clientCredentials"),B.flow==="accessCode"&&(q="authorizationCode"),typeof B.authorizationUrl<"u"&&(de.authorizationUrl=B.authorizationUrl.split("?")[0].trim()||"/"),typeof B.tokenUrl=="string"&&(de.tokenUrl=B.tokenUrl.split("?")[0].trim()||"/"),de.scopes=B.scopes||{},B.flows={},B.flows[q]=de,delete B.flow,delete B.authorizationUrl,delete B.tokenUrl,delete B.scopes,typeof B.name<"u"&&(V.patch?(V.patches++,delete B.name):w("(Patchable) oauth2 securitySchemes should not have name property",V))}}function H(B){return B&&!B["x-s2o-delete"]}function N(B,V){if(B.$ref)B.$ref=B.$ref.replace("#/responses/","#/components/responses/");else{B.type&&!B.schema&&(B.schema={}),B.type&&(B.schema.type=B.type),B.items&&B.items.type!=="array"&&(B.items.collectionFormat!==B.collectionFormat&&z("Nested collectionFormats are not supported",B,V),delete B.items.collectionFormat),B.type==="array"?(B.collectionFormat==="ssv"?z("collectionFormat:ssv is no longer supported for headers",B,V):B.collectionFormat==="pipes"?z("collectionFormat:pipes is no longer supported for headers",B,V):B.collectionFormat==="multi"?B.explode=!0:B.collectionFormat==="tsv"?(z("collectionFormat:tsv is no longer supported",B,V),B["x-collectionFormat"]="tsv"):B.style="simple",delete B.collectionFormat):B.collectionFormat&&(V.patch?(V.patches++,delete B.collectionFormat):w("(Patchable) collectionFormat is only applicable to header.type array",V)),delete B.type;for(let de of m.parameterTypeProperties)typeof B[de]<"u"&&(B.schema[de]=B[de],delete B[de]);for(let de of m.arrayProperties)typeof B[de]<"u"&&(B.schema[de]=B[de],delete B[de])}}function Y(B,V){if(B.$ref.indexOf("#/parameters/")>=0){let de=B.$ref.split("#/parameters/");B.$ref=de[0]+"#/components/parameters/"+m.sanitise(de[1])}B.$ref.indexOf("#/definitions/")>=0&&z("Definition used as parameter",B,V)}function te(B,V){let de={};for(let q of Object.keys(B))de[q]=B[q],q==="parameters"&&(de.requestBody={},V.rbname&&(de[V.rbname]=""));return de.requestBody={},de}function ne(B,V,de,q,he,pe,U){let ae={},ie=!0,ve;if(V&&V.consumes&&typeof V.consumes=="string")if(U.patch)U.patches++,V.consumes=[V.consumes];else return w("(Patchable) operation.consumes must be an array",U);Array.isArray(pe.consumes)||delete pe.consumes;let ge=((V?V.consumes:null)||pe.consumes||[]).filter(m.uniqueOnly);if(B&&B.$ref&&typeof B.$ref=="string"){Y(B,U);let fe=decodeURIComponent(B.$ref.replace("#/components/parameters/","")),je=!1,Ce=pe.components.parameters[fe];if((!Ce||Ce["x-s2o-delete"])&&B.$ref.startsWith("#/")&&(B["x-s2o-delete"]=!0,je=!0),je){let _e=B.$ref,rt=o(pe,B.$ref);!rt&&_e.startsWith("#/")?z("Could not resolve reference "+_e,B,U):rt&&(B=rt)}}if(B&&(B.name||B.in)){typeof B["x-deprecated"]=="boolean"&&(B.deprecated=B["x-deprecated"],delete B["x-deprecated"]),typeof B["x-example"]<"u"&&(B.example=B["x-example"],delete B["x-example"]),B.in!=="body"&&!B.type&&(U.patch?(U.patches++,B.type="string"):w("(Patchable) parameter.type is mandatory for non-body parameters",U)),B.type&&typeof B.type=="object"&&B.type.$ref&&(B.type=o(pe,B.type.$ref)),B.type==="file"&&(B["x-s2o-originalType"]=B.type,ve=B.type),B.description&&typeof B.description=="object"&&B.description.$ref&&(B.description=o(pe,B.description.$ref)),B.description===null&&delete B.description;let fe=B.collectionFormat;if(B.type==="array"&&!fe&&(fe="csv"),fe&&(B.type!=="array"&&(U.patch?(U.patches++,delete B.collectionFormat):w("(Patchable) collectionFormat is only applicable to param.type array",U)),fe==="csv"&&(B.in==="query"||B.in==="cookie")&&(B.style="form",B.explode=!1),fe==="csv"&&(B.in==="path"||B.in==="header")&&(B.style="simple"),fe==="ssv"&&(B.in==="query"?B.style="spaceDelimited":z("collectionFormat:ssv is no longer supported except for in:query parameters",B,U)),fe==="pipes"&&(B.in==="query"?B.style="pipeDelimited":z("collectionFormat:pipes is no longer supported except for in:query parameters",B,U)),fe==="multi"&&(B.explode=!0),fe==="tsv"&&(z("collectionFormat:tsv is no longer supported",B,U),B["x-collectionFormat"]="tsv"),delete B.collectionFormat),B.type&&B.type!=="body"&&B.in!=="formData")if(B.items&&B.schema)z("parameter has array,items and schema",B,U);else{B.schema&&U.patches++,(!B.schema||typeof B.schema!="object")&&(B.schema={}),B.schema.type=B.type,B.items&&(B.schema.items=B.items,delete B.items,u(B.schema.items,null,function(je,Ce,_e){Ce==="collectionFormat"&&typeof je[Ce]=="string"&&(fe&&je[Ce]!==fe&&z("Nested collectionFormats are not supported",B,U),delete je[Ce])}));for(let je of m.parameterTypeProperties)typeof B[je]<"u"&&(B.schema[je]=B[je]),delete B[je]}B.schema&&P(B.schema,U),B["x-ms-skip-url-encoding"]&&B.in==="query"&&(B.allowReserved=!0,delete B["x-ms-skip-url-encoding"])}if(B&&B.in==="formData"){ie=!1,ae.content={};let fe="application/x-www-form-urlencoded";if(ge.length&&ge.indexOf("multipart/form-data")>=0&&(fe="multipart/form-data"),ae.content[fe]={},B.schema)ae.content[fe].schema=B.schema,B.schema.$ref&&(ae["x-s2o-name"]=decodeURIComponent(B.schema.$ref.replace("#/components/schemas/","")));else{ae.content[fe].schema={},ae.content[fe].schema.type="object",ae.content[fe].schema.properties={},ae.content[fe].schema.properties[B.name]={};let je=ae.content[fe].schema,Ce=ae.content[fe].schema.properties[B.name];B.description&&(Ce.description=B.description),B.example&&(Ce.example=B.example),B.type&&(Ce.type=B.type);for(let _e of m.parameterTypeProperties)typeof B[_e]<"u"&&(Ce[_e]=B[_e]);B.required===!0&&(je.required||(je.required=[]),je.required.push(B.name),ae.required=!0),typeof B.default<"u"&&(Ce.default=B.default),Ce.properties&&(Ce.properties=B.properties),B.allOf&&(Ce.allOf=B.allOf),B.type==="array"&&B.items&&(Ce.items=B.items,Ce.items.collectionFormat&&delete Ce.items.collectionFormat),(ve==="file"||B["x-s2o-originalType"]==="file")&&(Ce.type="string",Ce.format="binary"),ee(B,Ce)}}else B&&B.type==="file"&&(B.required&&(ae.required=B.required),ae.content={},ae.content["application/octet-stream"]={},ae.content["application/octet-stream"].schema={},ae.content["application/octet-stream"].schema.type="string",ae.content["application/octet-stream"].schema.format="binary",ee(B,ae));if(B&&B.in==="body"){ae.content={},B.name&&(ae["x-s2o-name"]=(V&&V.operationId?m.sanitiseAll(V.operationId):"")+("_"+B.name).toCamelCase()),B.description&&(ae.description=B.description),B.required&&(ae.required=B.required),V&&U.rbname&&B.name&&(V[U.rbname]=B.name),B.schema&&B.schema.$ref?ae["x-s2o-name"]=decodeURIComponent(B.schema.$ref.replace("#/components/schemas/","")):B.schema&&B.schema.type==="array"&&B.schema.items&&B.schema.items.$ref&&(ae["x-s2o-name"]=decodeURIComponent(B.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),ge.length||ge.push("application/json");for(let fe of ge)ae.content[fe]={},ae.content[fe].schema=l(B.schema||{}),P(ae.content[fe].schema,U);ee(B,ae)}if(Object.keys(ae).length>0&&(B["x-s2o-delete"]=!0,V))if(V.requestBody&&ie){V.requestBody["x-s2o-overloaded"]=!0;let fe=V.operationId||he;z("Operation "+fe+" has multiple requestBodies",V,U)}else V.requestBody||(V=de[q]=te(V,U)),V.requestBody.content&&V.requestBody.content["multipart/form-data"]&&V.requestBody.content["multipart/form-data"].schema&&V.requestBody.content["multipart/form-data"].schema.properties&&ae.content["multipart/form-data"]&&ae.content["multipart/form-data"].schema&&ae.content["multipart/form-data"].schema.properties?(V.requestBody.content["multipart/form-data"].schema.properties=Object.assign(V.requestBody.content["multipart/form-data"].schema.properties,ae.content["multipart/form-data"].schema.properties),V.requestBody.content["multipart/form-data"].schema.required=(V.requestBody.content["multipart/form-data"].schema.required||[]).concat(ae.content["multipart/form-data"].schema.required||[]),V.requestBody.content["multipart/form-data"].schema.required.length||delete V.requestBody.content["multipart/form-data"].schema.required):V.requestBody.content&&V.requestBody.content["application/x-www-form-urlencoded"]&&V.requestBody.content["application/x-www-form-urlencoded"].schema&&V.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&ae.content["application/x-www-form-urlencoded"]&&ae.content["application/x-www-form-urlencoded"].schema&&ae.content["application/x-www-form-urlencoded"].schema.properties?(V.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(V.requestBody.content["application/x-www-form-urlencoded"].schema.properties,ae.content["application/x-www-form-urlencoded"].schema.properties),V.requestBody.content["application/x-www-form-urlencoded"].schema.required=(V.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(ae.content["application/x-www-form-urlencoded"].schema.required||[]),V.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete V.requestBody.content["application/x-www-form-urlencoded"].schema.required):(V.requestBody=Object.assign(V.requestBody,ae),V.requestBody["x-s2o-name"]||(V.requestBody.schema&&V.requestBody.schema.$ref?V.requestBody["x-s2o-name"]=decodeURIComponent(V.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):V.operationId&&(V.requestBody["x-s2o-name"]=m.sanitiseAll(V.operationId))));if(B&&!B["x-s2o-delete"]){delete B.type;for(let fe of m.parameterTypeProperties)delete B[fe];B.in==="path"&&(typeof B.required>"u"||B.required!==!0)&&(U.patch?(U.patches++,B.required=!0):w("(Patchable) path parameters must be required:true ["+B.name+" in "+he+"]",U))}return V}function ee(B,V){for(let de in B)de.startsWith("x-")&&!de.startsWith("x-s2o")&&(V[de]=B[de])}function ce(B,V,de,q,he){if(!B)return!1;if(B.$ref&&typeof B.$ref=="string")B.$ref.indexOf("#/definitions/")>=0?z("definition used as response: "+B.$ref,B,he):B.$ref.startsWith("#/responses/")&&(B.$ref="#/components/responses/"+m.sanitise(decodeURIComponent(B.$ref.replace("#/responses/",""))));else{if((typeof B.description>"u"||B.description===null||B.description===""&&he.patch)&&(he.patch?typeof B=="object"&&!Array.isArray(B)&&(he.patches++,B.description=v[B]||""):w("(Patchable) response.description is mandatory",he)),typeof B.schema<"u"){if(P(B.schema,he),B.schema.$ref&&typeof B.schema.$ref=="string"&&B.schema.$ref.startsWith("#/responses/")&&(B.schema.$ref="#/components/responses/"+m.sanitise(decodeURIComponent(B.schema.$ref.replace("#/responses/","")))),de&&de.produces&&typeof de.produces=="string")if(he.patch)he.patches++,de.produces=[de.produces];else return w("(Patchable) operation.produces must be an array",he);q.produces&&!Array.isArray(q.produces)&&delete q.produces;let pe=((de?de.produces:null)||q.produces||[]).filter(m.uniqueOnly);pe.length||pe.push("*/*"),B.content={};for(let U of pe){if(B.content[U]={},B.content[U].schema=l(B.schema),B.examples&&B.examples[U]){let ae={};ae.value=B.examples[U],B.content[U].examples={},B.content[U].examples.response=ae,delete B.examples[U]}B.content[U].schema.type==="file"&&(B.content[U].schema={type:"string",format:"binary"})}delete B.schema}for(let pe in B.examples)B.content||(B.content={}),B.content[pe]||(B.content[pe]={}),B.content[pe].examples={},B.content[pe].examples.response={},B.content[pe].examples.response.value=B.examples[pe];if(delete B.examples,B.headers)for(let pe in B.headers)pe.toLowerCase()==="status code"?he.patch?(he.patches++,delete B.headers[pe]):w('(Patchable) "Status Code" is not a valid header',he):N(B.headers[pe],he)}}function Z(B,V,de,q,he){for(let pe in B){let U=B[pe];U&&U["x-trace"]&&typeof U["x-trace"]=="object"&&(U.trace=U["x-trace"],delete U["x-trace"]),U&&U["x-summary"]&&typeof U["x-summary"]=="string"&&(U.summary=U["x-summary"],delete U["x-summary"]),U&&U["x-description"]&&typeof U["x-description"]=="string"&&(U.description=U["x-description"],delete U["x-description"]),U&&U["x-servers"]&&Array.isArray(U["x-servers"])&&(U.servers=U["x-servers"],delete U["x-servers"]);for(let ae in U)if(m.httpMethods.indexOf(ae)>=0||ae==="x-amazon-apigateway-any-method"){let ie=U[ae];if(ie&&ie.parameters&&Array.isArray(ie.parameters)){if(U.parameters)for(let ve of U.parameters)typeof ve.$ref=="string"&&(Y(ve,de),ve=o(he,ve.$ref)),!ie.parameters.find(function(ge,fe,je){return ge.name===ve.name&&ge.in===ve.in})&&(ve.in==="formData"||ve.in==="body"||ve.type==="file")&&(ie=ne(ve,ie,U,ae,pe,he,de),de.rbname&&ie[de.rbname]===""&&delete ie[de.rbname]);for(let ve of ie.parameters)ie=ne(ve,ie,U,ae,ae+":"+pe,he,de);de.rbname&&ie[de.rbname]===""&&delete ie[de.rbname],de.debug||ie.parameters&&(ie.parameters=ie.parameters.filter(H))}if(ie&&ie.security&&I(ie.security),typeof ie=="object"){if(!ie.responses){let ve={};ve.description="Default response",ie.responses={default:ve}}for(let ve in ie.responses){let ge=ie.responses[ve];ce(ge,ve,ie,he,de)}}if(ie&&ie["x-servers"]&&Array.isArray(ie["x-servers"]))ie.servers=ie["x-servers"],delete ie["x-servers"];else if(ie&&ie.schemes&&ie.schemes.length){for(let ve of ie.schemes)if((!he.schemes||he.schemes.indexOf(ve)<0)&&(ie.servers||(ie.servers=[]),Array.isArray(he.servers)))for(let ge of he.servers){let fe=l(ge),je=t.parse(fe.url);je.protocol=ve,fe.url=je.format(),ie.servers.push(fe)}}if(de.debug&&(ie["x-s2o-consumes"]=ie.consumes||[],ie["x-s2o-produces"]=ie.produces||[]),ie){if(delete ie.consumes,delete ie.produces,delete ie.schemes,ie["x-ms-examples"]){for(let ve in ie["x-ms-examples"]){let ge=ie["x-ms-examples"][ve],fe=m.sanitiseAll(ve);if(ge.parameters)for(let je in ge.parameters){let Ce=ge.parameters[je];for(let _e of(ie.parameters||[]).concat(U.parameters||[]))_e.$ref&&(_e=i.jptr(he,_e.$ref)),_e.name===je&&!_e.example&&(_e.examples||(_e.examples={}),_e.examples[ve]={value:Ce})}if(ge.responses)for(let je in ge.responses){if(ge.responses[je].headers)for(let Ce in ge.responses[je].headers){let _e=ge.responses[je].headers[Ce];for(let rt in ie.responses[je].headers)if(rt===Ce){let T=ie.responses[je].headers[rt];T.example=_e}}if(ge.responses[je].body&&(he.components.examples[fe]={value:l(ge.responses[je].body)},ie.responses[je]&&ie.responses[je].content))for(let Ce in ie.responses[je].content){let _e=ie.responses[je].content[Ce];_e.examples||(_e.examples={}),_e.examples[ve]={$ref:"#/components/examples/"+fe}}}}delete ie["x-ms-examples"]}if(ie.parameters&&ie.parameters.length===0&&delete ie.parameters,ie.requestBody){let ve=ie.operationId?m.sanitiseAll(ie.operationId):m.sanitiseAll(ae+pe).toCamelCase(),ge=m.sanitise(ie.requestBody["x-s2o-name"]||ve||"");delete ie.requestBody["x-s2o-name"];let fe=JSON.stringify(ie.requestBody),je=m.hash(fe);if(!q[je]){let _e={};_e.name=ge,_e.body=ie.requestBody,_e.refs=[],q[je]=_e}let Ce="#/"+V+"/"+encodeURIComponent(i.jpescape(pe))+"/"+ae+"/requestBody";q[je].refs.push(Ce)}}}if(U&&U.parameters){for(let ae in U.parameters){let ie=U.parameters[ae];ne(ie,null,U,null,pe,he,de)}!de.debug&&Array.isArray(U.parameters)&&(U.parameters=U.parameters.filter(H))}}}function G(B,V){let de={};k={schemas:{}},B.security&&I(B.security);for(let he in B.components.securitySchemes){let pe=m.sanitise(he);he!==pe&&(B.components.securitySchemes[pe]&&w("Duplicate sanitised securityScheme name "+pe,V),B.components.securitySchemes[pe]=B.components.securitySchemes[he],delete B.components.securitySchemes[he]),L(B.components.securitySchemes[pe],V)}for(let he in B.components.schemas){let pe=m.sanitiseAll(he),U="";if(he!==pe){for(;B.components.schemas[pe+U];)U=U?++U:2;B.components.schemas[pe+U]=B.components.schemas[he],delete B.components.schemas[he]}k.schemas[he]=pe+U,P(B.components.schemas[pe+U],V)}V.refmap={},u(B,{payload:{options:V}},E),D(B,V);for(let he in B.components.parameters){let pe=m.sanitise(he);he!==pe&&(B.components.parameters[pe]&&w("Duplicate sanitised parameter name "+pe,V),B.components.parameters[pe]=B.components.parameters[he],delete B.components.parameters[he]);let U=B.components.parameters[pe];ne(U,null,null,null,pe,B,V)}for(let he in B.components.responses){let pe=m.sanitise(he);he!==pe&&(B.components.responses[pe]&&w("Duplicate sanitised response name "+pe,V),B.components.responses[pe]=B.components.responses[he],delete B.components.responses[he]);let U=B.components.responses[pe];if(ce(U,pe,null,B,V),U.headers)for(let ae in U.headers)ae.toLowerCase()==="status code"?V.patch?(V.patches++,delete U.headers[ae]):w('(Patchable) "Status Code" is not a valid header',V):N(U.headers[ae],V)}for(let he in B.components.requestBodies){let pe=B.components.requestBodies[he],U=JSON.stringify(pe),ae=m.hash(U),ie={};ie.name=he,ie.body=pe,ie.refs=[],de[ae]=ie}if(Z(B.paths,"paths",V,de,B),B["x-ms-paths"]&&Z(B["x-ms-paths"],"x-ms-paths",V,de,B),!V.debug)for(let he in B.components.parameters)B.components.parameters[he]["x-s2o-delete"]&&delete B.components.parameters[he];V.debug&&(B["x-s2o-consumes"]=B.consumes||[],B["x-s2o-produces"]=B.produces||[]),delete B.consumes,delete B.produces,delete B.schemes;let q=[];if(B.components.requestBodies={},!V.resolveInternal){let he=1;for(let pe in de){let U=de[pe];if(U.refs.length>1){let ae="";for(U.name||(U.name="requestBody",ae=he++);q.indexOf(U.name+ae)>=0;)ae=ae?++ae:2;U.name=U.name+ae,q.push(U.name),B.components.requestBodies[U.name]=l(U.body);for(let ie in U.refs){let ve={};ve.$ref="#/components/requestBodies/"+U.name,i.jptr(B,U.refs[ie],ve)}}}}return B.components.responses&&Object.keys(B.components.responses).length===0&&delete B.components.responses,B.components.parameters&&Object.keys(B.components.parameters).length===0&&delete B.components.parameters,B.components.examples&&Object.keys(B.components.examples).length===0&&delete B.components.examples,B.components.requestBodies&&Object.keys(B.components.requestBodies).length===0&&delete B.components.requestBodies,B.components.securitySchemes&&Object.keys(B.components.securitySchemes).length===0&&delete B.components.securitySchemes,B.components.headers&&Object.keys(B.components.headers).length===0&&delete B.components.headers,B.components.schemas&&Object.keys(B.components.schemas).length===0&&delete B.components.schemas,B.components&&Object.keys(B.components).length===0&&delete B.components,B}function J(B){return!B||!B.url||typeof B.url!="string"||(B.url=B.url.split("{{").join("{"),B.url=B.url.split("}}").join("}"),B.url.replace(/\{(.+?)\}/g,function(V,de){B.variables||(B.variables={}),B.variables[de]={default:"unknown"}})),B}function Q(B,V,de){if(typeof B.info>"u"||B.info===null)if(V.patch)V.patches++,B.info={version:"",title:""};else return de(new x("(Patchable) info object is mandatory"));if(typeof B.info!="object"||Array.isArray(B.info))return de(new x("info must be an object"));if(typeof B.info.title>"u"||B.info.title===null)if(V.patch)V.patches++,B.info.title="";else return de(new x("(Patchable) info.title cannot be null"));if(typeof B.info.version>"u"||B.info.version===null)if(V.patch)V.patches++,B.info.version="";else return de(new x("(Patchable) info.version cannot be null"));if(typeof B.info.version!="string")if(V.patch)V.patches++,B.info.version=B.info.version.toString();else return de(new x("(Patchable) info.version must be a string"));if(typeof B.info.logo<"u")if(V.patch)V.patches++,B.info["x-logo"]=B.info.logo,delete B.info.logo;else return de(new x("(Patchable) info should not have logo property"));if(typeof B.info.termsOfService<"u"){if(B.info.termsOfService===null)if(V.patch)V.patches++,B.info.termsOfService="";else return de(new x("(Patchable) info.termsOfService cannot be null"));try{new URL(B.info.termsOfService)}catch{if(V.patch)V.patches++,delete B.info.termsOfService;else return de(new x("(Patchable) info.termsOfService must be a URL"))}}}function _(B,V,de){if(typeof B.paths>"u")if(V.patch)V.patches++,B.paths={};else return de(new x("(Patchable) paths object is mandatory"))}function K(B,V){const de=new WeakSet;u(B,{identityDetection:!0},function(q,he,pe){typeof q[he]=="object"&&q[he]!==null&&(de.has(q[he])?V.anchors?q[he]=l(q[he]):w("YAML anchor or merge key at "+pe.path,V):de.add(q[he]))})}function W(B,V,de){return a(de,new Promise(function(q,he){if(B||(B={}),V.original=B,V.text||(V.text=n.stringify(B)),V.externals=[],V.externalRefs={},V.rewriteRefs=!0,V.preserveMiro=!0,V.promise={},V.promise.resolve=q,V.promise.reject=he,V.patches=0,V.cache||(V.cache={}),V.source&&(V.cache[V.source]=V.original),K(B,V),B.openapi&&typeof B.openapi=="string"&&B.openapi.startsWith("3.")){V.openapi=c(B),Q(V.openapi,V,he),_(V.openapi,V,he),d.optionalResolve(V).then(function(){return V.direct?q(V.openapi):q(V)}).catch(function(U){console.warn(U),he(U)});return}if(!B.swagger||B.swagger!="2.0")return he(new x("Unsupported swagger/OpenAPI version: "+(B.openapi?B.openapi:B.swagger)));let pe=V.openapi={};if(pe.openapi=typeof V.targetVersion=="string"&&V.targetVersion.startsWith("3.")?V.targetVersion:b,V.origin){pe["x-origin"]||(pe["x-origin"]=[]);let U={};U.url=V.source||V.origin,U.format="swagger",U.version=B.swagger,U.converter={},U.converter.url="https://github.com/mermade/oas-kit",U.converter.version=f,pe["x-origin"].push(U)}if(pe=Object.assign(pe,c(B)),delete pe.swagger,u(pe,{},function(U,ae,ie){U[ae]===null&&!ae.startsWith("x-")&&ae!=="default"&&ie.path.indexOf("/example")<0&&delete U[ae]}),B.host)for(let U of Array.isArray(B.schemes)?B.schemes:[""]){let ae={},ie=(B.basePath||"").replace(/\/$/,"");ae.url=(U?U+":":"")+"//"+B.host+ie,J(ae),pe.servers||(pe.servers=[]),pe.servers.push(ae)}else if(B.basePath){let U={};U.url=B.basePath,J(U),pe.servers||(pe.servers=[]),pe.servers.push(U)}if(delete pe.host,delete pe.basePath,pe["x-servers"]&&Array.isArray(pe["x-servers"])&&(pe.servers=pe["x-servers"],delete pe["x-servers"]),B["x-ms-parameterized-host"]){let U=B["x-ms-parameterized-host"],ae={};ae.url=U.hostTemplate+(B.basePath?B.basePath:""),ae.variables={};const ie=ae.url.match(/\{\w+\}/g);for(let ve in U.parameters){let ge=U.parameters[ve];ge.$ref&&(ge=l(o(pe,ge.$ref))),ve.startsWith("x-")||(delete ge.required,delete ge.type,delete ge.in,typeof ge.default>"u"&&(ge.enum?ge.default=ge.enum[0]:ge.default="none"),ge.name||(ge.name=ie[ve].replace("{","").replace("}","")),ae.variables[ge.name]=ge,delete ge.name)}pe.servers||(pe.servers=[]),U.useSchemePrefix===!1?pe.servers.push(ae):B.schemes.forEach(ve=>{pe.servers.push(Object.assign({},ae,{url:ve+"://"+ae.url}))}),delete pe["x-ms-parameterized-host"]}Q(pe,V,he),_(pe,V,he),typeof pe.consumes=="string"&&(pe.consumes=[pe.consumes]),typeof pe.produces=="string"&&(pe.produces=[pe.produces]),pe.components={},pe["x-callbacks"]&&(pe.components.callbacks=pe["x-callbacks"],delete pe["x-callbacks"]),pe.components.examples={},pe.components.headers={},pe["x-links"]&&(pe.components.links=pe["x-links"],delete pe["x-links"]),pe.components.parameters=pe.parameters||{},pe.components.responses=pe.responses||{},pe.components.requestBodies={},pe.components.securitySchemes=pe.securityDefinitions||{},pe.components.schemas=pe.definitions||{},delete pe.definitions,delete pe.responses,delete pe.parameters,delete pe.securityDefinitions,d.optionalResolve(V).then(function(){G(V.openapi,V),V.direct?q(V.openapi):q(V)}).catch(function(U){console.warn(U),he(U)})}))}function oe(B,V,de){return a(de,new Promise(function(q,he){let pe=null,U=null;try{pe=JSON.parse(B),V.text=JSON.stringify(pe,null,2)}catch(ae){U=ae;try{pe=n.parse(B,{schema:"core",prettyErrors:!0}),V.sourceYaml=!0,V.text=B}catch(ie){U=ie}}pe?W(pe,V).then(ae=>q(ae)).catch(ae=>he(ae)):he(new x(U?U.message:"Could not parse string"))}))}function le(B,V,de){return a(de,new Promise(function(q,he){V.origin=!0,V.source||(V.source=B),V.verbose&&console.warn("GET "+B),V.fetch||(V.fetch=r);const pe=Object.assign({},V.fetchOptions,{agent:V.agent});V.fetch(B,pe).then(function(U){if(U.status!==200)throw new x(`Received status code ${U.status}: ${B}`);return U.text()}).then(function(U){oe(U,V).then(ae=>q(ae)).catch(ae=>he(ae))}).catch(function(U){he(U)})}))}function be(B,V,de){return a(de,new Promise(function(q,he){e.readFile(B,V.encoding||"utf8",function(pe,U){pe?he(pe):(V.sourceFile=B,oe(U,V).then(ae=>q(ae)).catch(ae=>he(ae)))})}))}function Oe(B,V,de){return a(de,new Promise(function(q,he){let pe="";B.on("data",function(U){pe+=U}).on("end",function(){oe(pe,V).then(U=>q(U)).catch(U=>he(U))})}))}return LR={S2OError:x,targetVersion:b,convert:W,convertObj:W,convertUrl:le,convertStr:oe,convertFile:be,convertStream:Oe},LR}var gst=mst();const fst=Hr(gst);function vst(e){return e.paths||(e.paths={}),new Promise((t,a)=>fst.convertObj(e,{patch:!0,warnOnly:!0,text:"{}",anchors:!0},(r,n)=>{if(r)return a(r);t(n?.openapi)}))}async function bst(){try{return(await lie())?.resolvedConfig.openapi||{}}catch{return{}}}async function yst(e){const t=await lie(),a={config:t,base:_u?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};_u&&(t.resolve.http.customFetch=globalThis.fetch),typeof e=="object"&&e!==null?a.doc=kst(e):a.ref=e;const{bundle:{parsed:r}}=await Not(a);return r.swagger!==void 0?vst(r):r}function kst(e){return{source:{absoluteRef:""},parsed:e}}async function xst(e,t,a){let r;if(a?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');r=e}else r=await yst(e||t);try{NWe(r)}catch{}return r}const wst=({options:e,definitionUrl:t,definition:a,activeSampleLanguage:r,children:n})=>{const[i,o]=j.useState(),[s,l]=j.useState(!0),[c,u]=j.useState(null),[d,h]=j.useState(e||{});j.useEffect(()=>{async function v(){l(!0);try{const f=await bst();h({...e,...f}),u(await xst(a,t,e))}catch(f){o(f.message)}}v()},[a,t,e]);const m=j.useMemo(()=>{if(c)return{definition:c,options:d,definitionUrl:t,activeSampleLanguage:r}},DWe([c,t,d]));return j.useEffect(()=>{m&&l(!1)},[m]),i||!m?null:s?Bl(e?.hideLoading,!1)?null:p.jsx(iat,{color:"--loading-spinner-color"}):j.isValidElement(n)?j.cloneElement(n,{store:m}):null};function Ost({definition:e,definitionUrl:t,options:a={},activeItemId:r,activeSampleLanguage:n,activeDeepLink:i,router:o}){return p.jsx(wst,{definition:e,definitionUrl:t,options:a,activeItemId:r,activeSampleLanguage:n,activeDeepLink:i,children:p.jsx(Pre,{withCommonStyles:!0,router:o||"hash"})})}function Sst(e){const t={},a=e.attributes;for(let r=0;r<a.length;r++){const n=a[r];t[n.name]=n.value}return t}function zst(e){const t=Sst(e),a={};for(const r in t){const n=r.replace(/-(.)/g,(i,o)=>o.toUpperCase());a[n]=t[r]}return a}function Cst(e,t=document.querySelector("redoc")){D6.hydrateRoot(t,p.jsx(Pre,{store:e}),{onRecoverableError:(a,r)=>{a.message.includes("Minified React error #418")||console.error(a.message,r)}})}function Ooe(e,t={},a=$6("redoc")){if(a===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}={...t,...zst(a)};let i,o;typeof e=="string"?i=e:typeof e=="object"&&(o=e),D6.createRoot(a).render(j.createElement(Ost,{definition:o,definitionUrl:i,options:n,router:r??"hash"},["Loading..."]))}const jst="3.19.0-next.9",Pst="d969b2891b";function Ast(){const e=$6("redoc");if(!e)return;const t=e.getAttribute("spec-url");t&&Ooe(t,{},e)}Ast();function N0(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Soe={exports:{}},zoe;function Mst(){return zoe||(zoe=1,(function(e,t){(function(a){e.exports=a()})(function(){return(function a(r,n,i){function o(c,u){if(!n[c]){if(!r[c]){var d=typeof N0=="function"&&N0;if(!u&&d)return d(c,!0);if(s)return s(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=n[c]={exports:{}};r[c][0].call(m.exports,function(v){var f=r[c][1][v];return o(f||v)},m,m.exports,a,r,n,i)}return n[c].exports}for(var s=typeof N0=="function"&&N0,l=0;l<i.length;l++)o(i[l]);return o})({1:[function(a,r,n){var i=a("./utils"),o=a("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(l){for(var c,u,d,h,m,v,f,b=[],k=0,x=l.length,w=x,z=i.getTypeOf(l)!=="string";k<l.length;)w=x-k,d=z?(c=l[k++],u=k<x?l[k++]:0,k<x?l[k++]:0):(c=l.charCodeAt(k++),u=k<x?l.charCodeAt(k++):0,k<x?l.charCodeAt(k++):0),h=c>>2,m=(3&c)<<4|u>>4,v=1<w?(15&u)<<2|d>>6:64,f=2<w?63&d:64,b.push(s.charAt(h)+s.charAt(m)+s.charAt(v)+s.charAt(f));return b.join("")},n.decode=function(l){var c,u,d,h,m,v,f=0,b=0,k="data:";if(l.substr(0,k.length)===k)throw new Error("Invalid base64 input, it looks like a data url.");var x,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===s.charAt(64)&&w--,l.charAt(l.length-2)===s.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(x=o.uint8array?new Uint8Array(0|w):new Array(0|w);f<l.length;)c=s.indexOf(l.charAt(f++))<<2|(h=s.indexOf(l.charAt(f++)))>>4,u=(15&h)<<4|(m=s.indexOf(l.charAt(f++)))>>2,d=(3&m)<<6|(v=s.indexOf(l.charAt(f++))),x[b++]=c,m!==64&&(x[b++]=u),v!==64&&(x[b++]=d);return x}},{"./support":30,"./utils":32}],2:[function(a,r,n){var i=a("./external"),o=a("./stream/DataWorker"),s=a("./stream/Crc32Probe"),l=a("./stream/DataLengthProbe");function c(u,d,h,m,v){this.compressedSize=u,this.uncompressedSize=d,this.crc32=h,this.compression=m,this.compressedContent=v}c.prototype={getContentWorker:function(){var u=new o(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,h){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(d.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,r,n){var i=a("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,r,n){var i=a("./utils"),o=(function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l})();r.exports=function(s,l){return s!==void 0&&s.length?i.getTypeOf(s)!=="string"?(function(c,u,d,h){var m=o,v=h+d;c^=-1;for(var f=h;f<v;f++)c=c>>>8^m[255&(c^u[f])];return-1^c})(0|l,s,s.length,0):(function(c,u,d,h){var m=o,v=h+d;c^=-1;for(var f=h;f<v;f++)c=c>>>8^m[255&(c^u.charCodeAt(f))];return-1^c})(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(a,r,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(a,r,n){var i=null;i=typeof Promise<"u"?Promise:a("lie"),r.exports={Promise:i}},{lie:37}],7:[function(a,r,n){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=a("pako"),s=a("./utils"),l=a("./stream/GenericWorker"),c=i?"uint8array":"array";function u(d,h){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=h,this.meta={}}n.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,d.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(h){d.push({data:h,meta:d.meta})}},n.compressWorker=function(d){return new u("Deflate",d)},n.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(a,r,n){function i(m,v){var f,b="";for(f=0;f<v;f++)b+=String.fromCharCode(255&m),m>>>=8;return b}function o(m,v,f,b,k,x){var w,z,S=m.file,C=m.compression,P=x!==c.utf8encode,M=s.transformTo("string",x(S.name)),E=s.transformTo("string",c.utf8encode(S.name)),D=S.comment,I=s.transformTo("string",x(D)),L=s.transformTo("string",c.utf8encode(D)),H=E.length!==S.name.length,N=L.length!==D.length,Y="",te="",ne="",ee=S.dir,ce=S.date,Z={crc32:0,compressedSize:0,uncompressedSize:0};v&&!f||(Z.crc32=m.crc32,Z.compressedSize=m.compressedSize,Z.uncompressedSize=m.uncompressedSize);var G=0;v&&(G|=8),P||!H&&!N||(G|=2048);var J=0,Q=0;ee&&(J|=16),k==="UNIX"?(Q=798,J|=(function(K,W){var oe=K;return K||(oe=W?16893:33204),(65535&oe)<<16})(S.unixPermissions,ee)):(Q=20,J|=(function(K){return 63&(K||0)})(S.dosPermissions)),w=ce.getUTCHours(),w<<=6,w|=ce.getUTCMinutes(),w<<=5,w|=ce.getUTCSeconds()/2,z=ce.getUTCFullYear()-1980,z<<=4,z|=ce.getUTCMonth()+1,z<<=5,z|=ce.getUTCDate(),H&&(te=i(1,1)+i(u(M),4)+E,Y+="up"+i(te.length,2)+te),N&&(ne=i(1,1)+i(u(I),4)+L,Y+="uc"+i(ne.length,2)+ne);var _="";return _+=`
10905
+ `," "],s=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(s),c=["%","/","?",";","#"].concat(l),u=["/","?","#"],d=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=Got();function x(C,P,M){if(C&&t.isObject(C)&&C instanceof a)return C;var E=new a;return E.parse(C,P,M),E}a.prototype.parse=function(C,P,M){if(!t.isString(C))throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var E=C.indexOf("?"),D=E!==-1&&E<C.indexOf("#")?"?":"#",I=C.split(D),L=/\\/g;I[0]=I[0].replace(L,"/"),C=I.join(D);var H=C;if(H=H.trim(),!M&&C.split("#").length===1){var N=i.exec(H);if(N)return this.path=H,this.href=H,this.pathname=N[1],N[2]?(this.search=N[2],P?this.query=k.parse(this.search.substr(1)):this.query=this.search.substr(1)):P&&(this.search="",this.query={}),this}var Y=r.exec(H);if(Y){Y=Y[0];var te=Y.toLowerCase();this.protocol=te,H=H.substr(Y.length)}if(M||Y||H.match(/^\/\/[^@\/]+@[^@\/]+/)){var ne=H.substr(0,2)==="//";ne&&!(Y&&f[Y])&&(H=H.substr(2),this.slashes=!0)}if(!f[Y]&&(ne||Y&&!b[Y])){for(var ee=-1,ce=0;ce<u.length;ce++){var Z=H.indexOf(u[ce]);Z!==-1&&(ee===-1||Z<ee)&&(ee=Z)}var G,J;ee===-1?J=H.lastIndexOf("@"):J=H.lastIndexOf("@",ee),J!==-1&&(G=H.slice(0,J),H=H.slice(J+1),this.auth=decodeURIComponent(G)),ee=-1;for(var ce=0;ce<c.length;ce++){var Z=H.indexOf(c[ce]);Z!==-1&&(ee===-1||Z<ee)&&(ee=Z)}ee===-1&&(ee=H.length),this.host=H.slice(0,ee),H=H.slice(ee),this.parseHost(),this.hostname=this.hostname||"";var Q=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Q)for(var _=this.hostname.split(/\./),ce=0,K=_.length;ce<K;ce++){var W=_[ce];if(W&&!W.match(h)){for(var oe="",le=0,be=W.length;le<be;le++)W.charCodeAt(le)>127?oe+="x":oe+=W[le];if(!oe.match(h)){var Oe=_.slice(0,ce),B=_.slice(ce+1),V=W.match(m);V&&(Oe.push(V[1]),B.unshift(V[2])),B.length&&(H="/"+B.join(".")+H),this.hostname=Oe.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),Q||(this.hostname=e.toASCII(this.hostname));var de=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+de,this.href+=this.host,Q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),H[0]!=="/"&&(H="/"+H))}if(!v[te])for(var ce=0,K=l.length;ce<K;ce++){var he=l[ce];if(H.indexOf(he)!==-1){var pe=encodeURIComponent(he);pe===he&&(pe=escape(he)),H=H.split(he).join(pe)}}var U=H.indexOf("#");U!==-1&&(this.hash=H.substr(U),H=H.slice(0,U));var ae=H.indexOf("?");if(ae!==-1?(this.search=H.substr(ae),this.query=H.substr(ae+1),P&&(this.query=k.parse(this.query)),H=H.slice(0,ae)):P&&(this.search="",this.query={}),H&&(this.pathname=H),b[te]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var de=this.pathname||"",ie=this.search||"";this.path=de+ie}return this.href=this.format(),this};function w(C){return t.isString(C)&&(C=x(C)),C instanceof a?C.format():a.prototype.format.call(C)}a.prototype.format=function(){var C=this.auth||"";C&&(C=encodeURIComponent(C),C=C.replace(/%3A/i,":"),C+="@");var P=this.protocol||"",M=this.pathname||"",E=this.hash||"",D=!1,I="";this.host?D=C+this.host:this.hostname&&(D=C+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&t.isObject(this.query)&&Object.keys(this.query).length&&(I=k.stringify(this.query));var L=this.search||I&&"?"+I||"";return P&&P.substr(-1)!==":"&&(P+=":"),this.slashes||(!P||b[P])&&D!==!1?(D="//"+(D||""),M&&M.charAt(0)!=="/"&&(M="/"+M)):D||(D=""),E&&E.charAt(0)!=="#"&&(E="#"+E),L&&L.charAt(0)!=="?"&&(L="?"+L),M=M.replace(/[?#]/g,function(H){return encodeURIComponent(H)}),L=L.replace("#","%23"),P+D+M+L+E};function z(C,P){return x(C,!1,!0).resolve(P)}a.prototype.resolve=function(C){return this.resolveObject(x(C,!1,!0)).format()};function S(C,P){return C?x(C,!1,!0).resolveObject(P):P}return a.prototype.resolveObject=function(C){if(t.isString(C)){var P=new a;P.parse(C,!1,!0),C=P}for(var M=new a,E=Object.keys(this),D=0;D<E.length;D++){var I=E[D];M[I]=this[I]}if(M.hash=C.hash,C.href==="")return M.href=M.format(),M;if(C.slashes&&!C.protocol){for(var L=Object.keys(C),H=0;H<L.length;H++){var N=L[H];N!=="protocol"&&(M[N]=C[N])}return b[M.protocol]&&M.hostname&&!M.pathname&&(M.path=M.pathname="/"),M.href=M.format(),M}if(C.protocol&&C.protocol!==M.protocol){if(!b[C.protocol]){for(var Y=Object.keys(C),te=0;te<Y.length;te++){var ne=Y[te];M[ne]=C[ne]}return M.href=M.format(),M}if(M.protocol=C.protocol,!C.host&&!f[C.protocol]){for(var K=(C.pathname||"").split("/");K.length&&!(C.host=K.shift()););C.host||(C.host=""),C.hostname||(C.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),M.pathname=K.join("/")}else M.pathname=C.pathname;if(M.search=C.search,M.query=C.query,M.host=C.host||"",M.auth=C.auth,M.hostname=C.hostname||C.host,M.port=C.port,M.pathname||M.search){var ee=M.pathname||"",ce=M.search||"";M.path=ee+ce}return M.slashes=M.slashes||C.slashes,M.href=M.format(),M}var Z=M.pathname&&M.pathname.charAt(0)==="/",G=C.host||C.pathname&&C.pathname.charAt(0)==="/",J=G||Z||M.host&&C.pathname,Q=J,_=M.pathname&&M.pathname.split("/")||[],K=C.pathname&&C.pathname.split("/")||[],W=M.protocol&&!b[M.protocol];if(W&&(M.hostname="",M.port=null,M.host&&(_[0]===""?_[0]=M.host:_.unshift(M.host)),M.host="",C.protocol&&(C.hostname=null,C.port=null,C.host&&(K[0]===""?K[0]=C.host:K.unshift(C.host)),C.host=null),J=J&&(K[0]===""||_[0]==="")),G)M.host=C.host||C.host===""?C.host:M.host,M.hostname=C.hostname||C.hostname===""?C.hostname:M.hostname,M.search=C.search,M.query=C.query,_=K;else if(K.length)_||(_=[]),_.pop(),_=_.concat(K),M.search=C.search,M.query=C.query;else if(!t.isNullOrUndefined(C.search)){if(W){M.hostname=M.host=_.shift();var oe=M.host&&M.host.indexOf("@")>0?M.host.split("@"):!1;oe&&(M.auth=oe.shift(),M.host=M.hostname=oe.shift())}return M.search=C.search,M.query=C.query,(!t.isNull(M.pathname)||!t.isNull(M.search))&&(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.href=M.format(),M}if(!_.length)return M.pathname=null,M.search?M.path="/"+M.search:M.path=null,M.href=M.format(),M;for(var le=_.slice(-1)[0],be=(M.host||C.host||_.length>1)&&(le==="."||le==="..")||le==="",Oe=0,B=_.length;B>=0;B--)le=_[B],le==="."?_.splice(B,1):le===".."?(_.splice(B,1),Oe++):Oe&&(_.splice(B,1),Oe--);if(!J&&!Q)for(;Oe--;Oe)_.unshift("..");J&&_[0]!==""&&(!_[0]||_[0].charAt(0)!=="/")&&_.unshift(""),be&&_.join("/").substr(-1)!=="/"&&_.push("");var V=_[0]===""||_[0]&&_[0].charAt(0)==="/";if(W){M.hostname=M.host=V?"":_.length?_.shift():"";var oe=M.host&&M.host.indexOf("@")>0?M.host.split("@"):!1;oe&&(M.auth=oe.shift(),M.host=M.hostname=oe.shift())}return J=J||M.host&&_.length,J&&!V&&_.unshift(""),_.length?M.pathname=_.join("/"):(M.pathname=null,M.path=null),(!t.isNull(M.pathname)||!t.isNull(M.search))&&(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.auth=C.auth||M.auth,M.slashes=M.slashes||C.slashes,M.href=M.format(),M},a.prototype.parseHost=function(){var C=this.host,P=n.exec(C);P&&(P=P[0],P!==":"&&(this.port=P.substr(1)),C=C.substr(0,C.length-P.length)),C&&(this.hostname=C)},Sg}var rR,vie;function Fot(){if(vie)return rR;vie=1;function e(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(t){setTimeout(t,0)}}return rR=e(),rR}var nR,bie;function qot(){if(bie)return nR;bie=1;var e=Fot();return nR=function(t,a){if(t){a.then(function(r){e(function(){t(null,r)})},function(r){e(function(){t(r)})});return}else return a},nR}var iR,yie;function yC(){if(yie)return iR;yie=1;function e(r){return r.replace(/\~/g,"~0").replace(/\//g,"~1")}function t(r){return r.replace(/\~1/g,"/").replace(/~0/g,"~")}function a(r,n,i){if(typeof r>"u")return!1;if(!n||typeof n!="string"||n==="#")return typeof i<"u"?i:r;if(n.indexOf("#")>=0){let s=n.split("#");if(s[0])return!1;n=s[1],n=decodeURIComponent(n.slice(1).split("+").join(" "))}n.startsWith("/")&&(n=n.slice(1));let o=n.split("/");for(let s=0;s<o.length;s++){o[s]=t(o[s]);let l=typeof i<"u"&&s==o.length-1,c=parseInt(o[s],10);if(!Array.isArray(r)||isNaN(c)||c.toString()!==o[s]?c=Array.isArray(r)&&o[s]==="-"?-2:-1:o[s]=s>0?o[s-1]:"",c!=-1||r&&r.hasOwnProperty(o[s]))if(c>=0)l&&(r[c]=i),r=r[c];else{if(c===-2)return l?(Array.isArray(r)&&r.push(i),i):void 0;l&&(r[o[s]]=i),r=r[o[s]]}else if(typeof i<"u"&&typeof r=="object"&&!Array.isArray(r))r[o[s]]=l?i:o[s+1]==="0"||o[s+1]==="-"?[]:{},r=r[o[s]];else return!1}return r}return iR={jptr:a,jpescape:e,jpunescape:t},iR}var oR,kie;function sR(){if(kie)return oR;kie=1;function e(t,a){return a==="$ref"&&!!t&&typeof t[a]=="string"}return oR={isRef:e},oR}var lR,xie;function kC(){if(xie)return lR;xie=1;function e(o){return o}function t(o){return JSON.parse(JSON.stringify(o))}function a(o){let s={};for(let l in o)o.hasOwnProperty(l)&&(s[l]=o[l]);return s}function r(o){let s=Array.isArray(o)?[]:{};for(let l in o)(o.hasOwnProperty(l)||Array.isArray(o))&&(s[l]=typeof o[l]=="object"?r(o[l]):o[l]);return s}function n(o){return Object.assign({},o)}function i(o,s){if(s||(s=new WeakMap),Object(o)!==o||o instanceof Function)return o;if(s.has(o))return s.get(o);try{var l=new o.constructor}catch{l=Object.create(Object.getPrototypeOf(o))}return s.set(o,l),Object.assign(l,...Object.keys(o).map(c=>({[c]:i(o[c],s)})))}return lR={nop:e,clone:t,shallowClone:a,deepClone:r,fastClone:n,circularClone:i},lR}var cR,wie;function uR(){if(wie)return cR;wie=1;const e=yC().jpescape;function t(){return{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1}}function a(r,n,i){if(n||(n={depth:0}),n.depth||(n=Object.assign({},t(),n)),typeof r!="object")return;let o=n.path;for(let s in r){if(n.key=s,n.path=n.path+"/"+encodeURIComponent(e(s)),n.identityPath=n.seen.get(r[s]),n.identity=typeof n.identityPath<"u",r.hasOwnProperty(s)&&i(r,s,n),typeof r[s]=="object"&&!n.identity){n.identityDetection&&!Array.isArray(r[s])&&r[s]!==null&&n.seen.set(r[s],n.path);let l={};l.parent=r,l.path=n.path,l.depth=n.depth?n.depth+1:1,l.pkey=s,l.payload=n.payload,l.seen=n.seen,l.identity=!1,l.identityDetection=n.identityDetection,a(r[s],l,i)}n.path=o}}return cR={recurse:a},cR}var dR,Oie;function Qot(){if(Oie)return dR;Oie=1;const e=uR().recurse,t=kC().shallowClone,a=yC().jptr,r=sR().isRef;var n=function(o){return o&&o.verbose?{warn:function(){var s=Array.prototype.slice.call(arguments);console.warn.apply(console,s)}}:{warn:function(){}}};function i(o,s,l){l||(l={}),l.cache||(l.cache={}),l.state||(l.state={}),l.state.identityDetection=!0,l.depth=l.depth?l.depth+1:1;let c=l.depth>1?o:t(o),u={data:c},d=l.depth>1?s:t(s);l.master||(l.master=c);let h=n(l),m=1;for(;m>0;)m=0,e(u,l.state,function(v,f,b){if(r(v,f)){let k=v[f];if(m++,l.cache[k]){let x=l.cache[k];if(x.resolved)h.warn("Patching %s for %s",k,x.path),b.parent[b.pkey]=x.data,l.$ref&&typeof b.parent[b.pkey]=="object"&&b.parent[b.pkey]!==null&&(b.parent[b.pkey][l.$ref]=k);else{if(k===x.path)throw new Error(`Tight circle at ${x.path}`);h.warn("Unresolved ref"),b.parent[b.pkey]=a(x.source,x.path),b.parent[b.pkey]===!1&&(b.parent[b.pkey]=a(x.source,x.key)),l.$ref&&typeof b.parent[b.pkey]=="object"&&b.parent[b.pkey]!==null&&(b.parent[l.$ref]=k)}}else{let x={};x.path=b.path.split("/$ref")[0],x.key=k,h.warn("Dereffing %s at %s",k,x.path),x.source=d,x.data=a(x.source,x.key),x.data===!1&&(x.data=a(l.master,x.key),x.source=l.master),x.data===!1&&h.warn("Missing $ref target",x.key),l.cache[k]=x,x.data=b.parent[b.pkey]=i(a(x.source,x.key),x.source,l),l.$ref&&typeof b.parent[b.pkey]=="object"&&b.parent[b.pkey]!==null&&(b.parent[b.pkey][l.$ref]=k),x.resolved=!0}}});return u.data}return dR={dereference:i},dR}var pR,Sie;function Uot(){if(Sie)return pR;Sie=1,pR=i,i.default=i,i.stable=c,i.stableStringify=c;var e="[...]",t="[Circular]",a=[],r=[];function n(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(h,m,v,f){typeof f>"u"&&(f=n()),s(h,"",0,[],void 0,0,f);var b;try{r.length===0?b=JSON.stringify(h,m,v):b=JSON.stringify(h,d(m),v)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;a.length!==0;){var k=a.pop();k.length===4?Object.defineProperty(k[0],k[1],k[3]):k[0][k[1]]=k[2]}}return b}function o(h,m,v,f){var b=Object.getOwnPropertyDescriptor(f,v);b.get!==void 0?b.configurable?(Object.defineProperty(f,v,{value:h}),a.push([f,v,m,b])):r.push([m,v,h]):(f[v]=h,a.push([f,v,m]))}function s(h,m,v,f,b,k,x){k+=1;var w;if(typeof h=="object"&&h!==null){for(w=0;w<f.length;w++)if(f[w]===h){o(t,h,m,b);return}if(typeof x.depthLimit<"u"&&k>x.depthLimit){o(e,h,m,b);return}if(typeof x.edgesLimit<"u"&&v+1>x.edgesLimit){o(e,h,m,b);return}if(f.push(h),Array.isArray(h))for(w=0;w<h.length;w++)s(h[w],w,w,f,h,k,x);else{var z=Object.keys(h);for(w=0;w<z.length;w++){var S=z[w];s(h[S],S,w,f,h,k,x)}}f.pop()}}function l(h,m){return h<m?-1:h>m?1:0}function c(h,m,v,f){typeof f>"u"&&(f=n());var b=u(h,"",0,[],void 0,0,f)||h,k;try{r.length===0?k=JSON.stringify(b,m,v):k=JSON.stringify(b,d(m),v)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;a.length!==0;){var x=a.pop();x.length===4?Object.defineProperty(x[0],x[1],x[3]):x[0][x[1]]=x[2]}}return k}function u(h,m,v,f,b,k,x){k+=1;var w;if(typeof h=="object"&&h!==null){for(w=0;w<f.length;w++)if(f[w]===h){o(t,h,m,b);return}try{if(typeof h.toJSON=="function")return}catch{return}if(typeof x.depthLimit<"u"&&k>x.depthLimit){o(e,h,m,b);return}if(typeof x.edgesLimit<"u"&&v+1>x.edgesLimit){o(e,h,m,b);return}if(f.push(h),Array.isArray(h))for(w=0;w<h.length;w++)u(h[w],w,w,f,h,k,x);else{var z={},S=Object.keys(h).sort(l);for(w=0;w<S.length;w++){var C=S[w];u(h[C],C,w,f,h,k,x),z[C]=h[C]}if(typeof b<"u")a.push([b,m,h]),b[m]=z;else return z}f.pop()}}function d(h){return h=typeof h<"u"?h:function(m,v){return v},function(m,v){if(r.length>0)for(var f=0;f<r.length;f++){var b=r[f];if(b[1]===m&&b[0]===v){v=b[2],r.splice(f,1);break}}return h.call(this,m,v)}}return pR}var hR,zie;function Cie(){if(zie)return hR;zie=1;var e={};const t=Uot(),a=e.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"\x1B[31m",yellow:"\x1B[33;1m",green:"\x1B[32m",normal:"\x1B[0m"};function r(b,k,x){return x.indexOf(b)===k}function n(b){return new Set(b).size!==b.length}function i(b){return new Set(b).size<=1}function o(b,k){function x(w,z){return t.stringify(w)===t.stringify(Object.assign({},w,z))}return x(b,k)&&x(k,b)}function s(b){let k=[];for(let x of b)k.find(function(w,z,S){return o(w,x)})||k.push(x);return k}function l(b){return b.length===s(b).length}function c(b){return b.find(function(k,x,w){return b.indexOf(k)<x})}function u(b){let k=0,x;if(b.length===0)return k;for(let w=0;w<b.length;w++)x=b.charCodeAt(w),k=(k<<5)-k+x,k|=0;return k}String.prototype.toCamelCase=function(){return this.toLowerCase().replace(/[-_ \/\.](.)/g,function(b,k){return k.toUpperCase()})};const d=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],h=["items","minItems","maxItems","uniqueItems"],m=["get","post","put","delete","patch","head","options","trace"];function v(b){b=b.replace("[]","Array");let k=b.split("/");return k[0]=k[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),k.join("/")}function f(b){return v(b.split("/").join("_"))}return hR={colour:a,uniqueOnly:r,hasDuplicates:n,allSame:i,distinctArray:l,firstDupe:c,hash:u,parameterTypeProperties:d,arrayProperties:h,httpMethods:m,sanitise:v,sanitiseAll:f},hR}var mR,jie;function Wot(){if(jie)return mR;jie=1;const e=pb,t=HZ(),a=aR(),r=pb,n=pb,i=yC().jptr,o=uR().recurse,s=kC().clone,l=Qot().dereference,c=sR().isRef,u=Cie();function d(M){return[...new Set(M)]}function h(M,E,D,I,L){return new Promise(function(H,N){e.readFile(M,E,function(Y,te){Y?D.ignoreIOErrors&&L?(D.verbose&&console.warn("FAILED",I),D.externalRefs[I].failed=!0,H(L)):N(Y):H(te)})})}function m(M,E,D,I,L,H){let N=H.externalRefs[D+I].paths[0],Y=a.parse(L),te={},ne=1;for(;ne;)ne=0,o(M,{identityDetection:!0},function(ee,ce,Z){if(c(ee,ce)){if(ee[ce].startsWith("#")){if(!te[ee[ce]]&&!ee.$fixed){let G=s(i(E,ee[ce]));if(H.verbose>1&&console.warn((G===!1?u.colour.red:u.colour.green)+"Fragment resolution",ee[ce],u.colour.normal),G===!1){if(Z.parent[Z.pkey]={},H.fatal){let J=new Error("Fragment $ref resolution failed "+ee[ce]);if(H.promise)H.promise.reject(J);else throw J}}else ne++,Z.parent[Z.pkey]=G,te[ee[ce]]=Z.path.replace("/%24ref","")}else if(!ee.$fixed){let G=(N+"/"+te[ee[ce]]).split("/#/").join("/");Z.parent[Z.pkey]={$ref:G,"x-miro":ee[ce],$fixed:!0},H.verbose>1&&console.warn("Replacing with",G),ne++}}else if(Y.protocol){let G=a.resolve(L,ee[ce]).toString();H.verbose>1&&console.warn(u.colour.yellow+"Rewriting external url ref",ee[ce],"as",G,u.colour.normal),ee["x-miro"]=ee[ce],H.externalRefs[ee[ce]]&&(H.externalRefs[G]||(H.externalRefs[G]=H.externalRefs[ee[ce]]),H.externalRefs[G].failed=H.externalRefs[ee[ce]].failed),ee[ce]=G}else if(!ee["x-miro"]){let G=a.resolve(L,ee[ce]).toString(),J=!1;H.externalRefs[ee[ce]]&&(J=H.externalRefs[ee[ce]].failed),J||(H.verbose>1&&console.warn(u.colour.yellow+"Rewriting external ref",ee[ce],"as",G,u.colour.normal),ee["x-miro"]=ee[ce],ee[ce]=G)}}});return o(M,{},function(ee,ce,Z){c(ee,ce)&&typeof ee.$fixed<"u"&&delete ee.$fixed}),H.verbose>1&&console.warn("Finished fragment resolution"),M}function v(M,E){if(!E.filters||!E.filters.length)return M;for(let D of E.filters)M=D(M,E);return M}function f(M,E){return M&&M.length>2?M:E&&E.length>2?E:"file:"}function b(M,E,D,I){var L=a.parse(D.source),H=D.source.split("\\").join("/").split("/");H.pop()||H.pop();let N="",Y=E.split("#");Y.length>1&&(N="#"+Y[1],E=Y[0]),H=H.join("/");let te=a.parse(E),ne=f(te.protocol,L.protocol),ee;if(ne==="file:"?ee=t.resolve(H?H+"/":"",E):ee=a.resolve(H?H+"/":"",E),D.cache[ee]){D.verbose&&console.warn("CACHED",ee,N);let ce=s(D.cache[ee]),Z=D.externalRef=ce;if(N&&(Z=i(Z,N),Z===!1&&(Z={},D.fatal))){let G=new Error("Cached $ref resolution failed "+ee+N);if(D.promise)D.promise.reject(G);else throw G}return Z=m(Z,ce,E,N,ee,D),Z=v(Z,D),I(s(Z),ee,D),Promise.resolve(Z)}if(D.verbose&&console.warn("GET",ee,N),D.handlers&&D.handlers[ne])return D.handlers[ne](H,E,N,D).then(function(ce){return D.externalRef=ce,ce=v(ce,D),D.cache[ee]=ce,I(ce,ee,D),ce}).catch(function(ce){throw D.verbose&&console.warn(ce),ce});if(ne&&ne.startsWith("http")){const ce=Object.assign({},D.fetchOptions,{agent:D.agent});return D.fetch(ee,ce).then(function(Z){if(Z.status!==200){if(D.ignoreIOErrors)return D.verbose&&console.warn("FAILED",E),D.externalRefs[E].failed=!0,'{"$ref":"'+E+'"}';throw new Error(`Received status code ${Z.status}: ${ee}`)}return Z.text()}).then(function(Z){try{let G=n.parse(Z,{schema:"core",prettyErrors:!0});if(Z=D.externalRef=G,D.cache[ee]=s(Z),N&&(Z=i(Z,N),Z===!1&&(Z={},D.fatal))){let J=new Error("Remote $ref resolution failed "+ee+N);if(D.promise)D.promise.reject(J);else throw J}Z=m(Z,G,E,N,ee,D),Z=v(Z,D)}catch(G){if(D.verbose&&console.warn(G),D.promise&&D.fatal)D.promise.reject(G);else throw G}return I(Z,ee,D),Z}).catch(function(Z){if(D.verbose&&console.warn(Z),D.cache[ee]={},D.promise&&D.fatal)D.promise.reject(Z);else throw Z})}else{const ce='{"$ref":"'+E+'"}';return h(ee,D.encoding||"utf8",D,E,ce).then(function(Z){try{let G=n.parse(Z,{schema:"core",prettyErrors:!0});if(Z=D.externalRef=G,D.cache[ee]=s(Z),N&&(Z=i(Z,N),Z===!1&&(Z={},D.fatal))){let J=new Error("File $ref resolution failed "+ee+N);if(D.promise)D.promise.reject(J);else throw J}Z=m(Z,G,E,N,ee,D),Z=v(Z,D)}catch(G){if(D.verbose&&console.warn(G),D.promise&&D.fatal)D.promise.reject(G);else throw G}return I(Z,ee,D),Z}).catch(function(Z){if(D.verbose&&console.warn(Z),D.promise&&D.fatal)D.promise.reject(Z);else throw Z})}}function k(M){return new Promise(function(E,D){function I(H,N,Y){if(H[N]&&c(H[N],"$ref")){let te=H[N].$ref;if(!te.startsWith("#")){let ne="";if(!L[te]){let ee=Object.keys(L).find(function(ce,Z,G){return te.startsWith(ce+"/")});ee&&(M.verbose&&console.warn("Found potential subschema at",ee),ne="/"+(te.split("#")[1]||"").replace(ee.split("#")[1]||""),ne=ne.split("/undefined").join(""),te=ee)}if(L[te]||(L[te]={resolved:!1,paths:[],extras:{},description:H[N].description}),L[te].resolved){if(!L[te].failed)if(M.rewriteRefs){let ee=L[te].resolvedAt;M.verbose>1&&console.warn("Rewriting ref",te,ee),H[N]["x-miro"]=te,H[N].$ref=ee+ne}else H[N]=s(L[te].data)}else L[te].paths.push(Y.path),L[te].extras[Y.path]=ne}}}let L=M.externalRefs;if(M.resolver.depth>0&&M.source===M.resolver.base)return E(L);o(M.openapi.definitions,{identityDetection:!0,path:"#/definitions"},I),o(M.openapi.components,{identityDetection:!0,path:"#/components"},I),o(M.openapi,{identityDetection:!0},I),E(L)})}function x(M){return new Promise(function(E,D){k(M).then(function(L){for(let H in L)if(!L[H].resolved){let N=M.resolver.depth;N>0&&N++,M.resolver.actions[N].push(function(){return b(M.openapi,H,M,function(Y,te,ne){if(!L[H].resolved){let Z={};Z.context=L[H],Z.$ref=H,Z.original=s(Y),Z.updated=Y,Z.source=te,ne.externals.push(Z),L[H].resolved=!0}let ee=Object.assign({},ne,{source:"",resolver:{actions:ne.resolver.actions,depth:ne.resolver.actions.length-1,base:ne.resolver.base}});ne.patch&&L[H].description&&!Y.description&&typeof Y=="object"&&(Y.description=L[H].description),L[H].data=Y;let ce=d(L[H].paths);ce=ce.sort(function(Z,G){const J=Z.startsWith("#/components/")||Z.startsWith("#/definitions/"),Q=G.startsWith("#/components/")||G.startsWith("#/definitions/");return J&&!Q?-1:Q&&!J?1:0});for(let Z of ce)if(L[H].resolvedAt&&Z!==L[H].resolvedAt&&Z.indexOf("x-ms-examples/")<0)ne.verbose>1&&console.warn("Creating pointer to data at",Z),i(ne.openapi,Z,{$ref:L[H].resolvedAt+L[H].extras[Z],"x-miro":H+L[H].extras[Z]});else{L[H].resolvedAt?ne.verbose>1&&console.warn("Avoiding circular reference"):(L[H].resolvedAt=Z,ne.verbose>1&&console.warn("Creating initial clone of data at",Z));let G=s(Y);i(ne.openapi,Z,G)}ne.resolver.actions[ee.resolver.depth].length===0&&ne.resolver.actions[ee.resolver.depth].push(function(){return x(ee)})})})}}).catch(function(L){M.verbose&&console.warn(L),D(L)});let I={options:M};I.actions=M.resolver.actions[M.resolver.depth],E(I)})}const w=M=>M.reduce((E,D)=>E.then(I=>D().then(Array.prototype.concat.bind(I))),Promise.resolve([]));function z(M,E,D){M.resolver.actions.push([]),x(M).then(function(I){w(I.actions).then(function(){if(M.resolver.depth>=M.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),E(!0);M.resolver.depth++,M.resolver.actions[M.resolver.depth].length?setTimeout(function(){z(I.options,E,D)},0):(M.verbose>1&&console.warn(u.colour.yellow+"Finished external resolution!",u.colour.normal),M.resolveInternal&&(M.verbose>1&&console.warn(u.colour.yellow+"Starting internal resolution!",u.colour.normal),M.openapi=l(M.openapi,M.original,{verbose:M.verbose-1}),M.verbose>1&&console.warn(u.colour.yellow+"Finished internal resolution!",u.colour.normal)),o(M.openapi,{},function(L,H,N){c(L,H)&&(M.preserveMiro||delete L["x-miro"])}),E(M))}).catch(function(L){M.verbose&&console.warn(L),D(L)})}).catch(function(I){M.verbose&&console.warn(I),D(I)})}function S(M){if(M.cache||(M.cache={}),M.fetch||(M.fetch=r),M.source){let E=a.parse(M.source);(!E.protocol||E.protocol.length<=2)&&(M.source=t.resolve(M.source))}M.externals=[],M.externalRefs={},M.rewriteRefs=!0,M.resolver={},M.resolver.depth=0,M.resolver.base=M.source,M.resolver.actions=[[]]}function C(M){return S(M),new Promise(function(E,D){M.resolve?z(M,E,D):E(M)})}function P(M,E,D){return D||(D={}),D.openapi=M,D.source=E,D.resolve=!0,S(D),new Promise(function(I,L){z(D,I,L)})}return mR={optionalResolve:C,resolve:P},mR}var gR,Pie;function Zot(){if(Pie)return gR;Pie=1;function e(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}function t(a,r,n,i){if(typeof n.depth>"u"&&(n=e()),a===null||typeof a>"u")return a;if(typeof a.$ref<"u"){let o={$ref:a.$ref};return n.allowRefSiblings&&a.description&&(o.description=a.description),i(o,r,n),o}if(n.combine&&(a.allOf&&Array.isArray(a.allOf)&&a.allOf.length===1&&(a=Object.assign({},a.allOf[0],a),delete a.allOf),a.anyOf&&Array.isArray(a.anyOf)&&a.anyOf.length===1&&(a=Object.assign({},a.anyOf[0],a),delete a.anyOf),a.oneOf&&Array.isArray(a.oneOf)&&a.oneOf.length===1&&(a=Object.assign({},a.oneOf[0],a),delete a.oneOf)),i(a,r,n),n.seen.has(a))return a;if(typeof a=="object"&&a!==null&&n.seen.set(a,!0),n.top=!1,n.depth++,typeof a.items<"u"&&(n.property="items",t(a.items,a,n,i)),a.additionalItems&&typeof a.additionalItems=="object"&&(n.property="additionalItems",t(a.additionalItems,a,n,i)),a.additionalProperties&&typeof a.additionalProperties=="object"&&(n.property="additionalProperties",t(a.additionalProperties,a,n,i)),a.properties)for(let o in a.properties){let s=a.properties[o];n.property="properties/"+o,t(s,a,n,i)}if(a.patternProperties)for(let o in a.patternProperties){let s=a.patternProperties[o];n.property="patternProperties/"+o,t(s,a,n,i)}if(a.allOf)for(let o in a.allOf){let s=a.allOf[o];n.property="allOf/"+o,t(s,a,n,i)}if(a.anyOf)for(let o in a.anyOf){let s=a.anyOf[o];n.property="anyOf/"+o,t(s,a,n,i)}if(a.oneOf)for(let o in a.oneOf){let s=a.oneOf[o];n.property="oneOf/"+o,t(s,a,n,i)}return a.not&&(n.property="not",t(a.not,a,n,i)),n.depth--,a}return gR={getDefaultState:e,walkSchema:t},gR}var Aie={},fR={exports:{}},Mie={},Tie;function Bie(){return Tie||(Tie=1,(function(e){e.fetch=n(globalThis.fetch)&&n(globalThis.ReadableStream),e.writableStream=n(globalThis.WritableStream),e.abortController=n(globalThis.AbortController);var t;function a(){if(t!==void 0)return t;if(globalThis.XMLHttpRequest){t=new globalThis.XMLHttpRequest;try{t.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var o=a();if(!o)return!1;try{return o.responseType=i,o.responseType===i}catch{}return!1}e.arraybuffer=e.fetch||r("arraybuffer"),e.msstream=!e.fetch&&r("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&r("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||(a()?n(a().overrideMimeType):!1);function n(i){return typeof i=="function"}t=null})(Mie)),Mie}var xC={},vR={exports:{}},wC={exports:{}},Eie;function Jot(){if(Eie)return wC.exports;Eie=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(z,S,C){return Function.prototype.apply.call(z,S,C)},a;e&&typeof e.ownKeys=="function"?a=e.ownKeys:Object.getOwnPropertySymbols?a=function(z){return Object.getOwnPropertyNames(z).concat(Object.getOwnPropertySymbols(z))}:a=function(z){return Object.getOwnPropertyNames(z)};function r(z){console&&console.warn&&console.warn(z)}var n=Number.isNaN||function(z){return z!==z};function i(){i.init.call(this)}wC.exports=i,wC.exports.once=k,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(z){if(typeof z!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof z)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(z){if(typeof z!="number"||z<0||n(z))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+z+".");o=z}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(z){if(typeof z!="number"||z<0||n(z))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+z+".");return this._maxListeners=z,this};function l(z){return z._maxListeners===void 0?i.defaultMaxListeners:z._maxListeners}i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(z){for(var S=[],C=1;C<arguments.length;C++)S.push(arguments[C]);var P=z==="error",M=this._events;if(M!==void 0)P=P&&M.error===void 0;else if(!P)return!1;if(P){var E;if(S.length>0&&(E=S[0]),E instanceof Error)throw E;var D=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw D.context=E,D}var I=M[z];if(I===void 0)return!1;if(typeof I=="function")t(I,this,S);else for(var L=I.length,H=v(I,L),C=0;C<L;++C)t(H[C],this,S);return!0};function c(z,S,C,P){var M,E,D;if(s(C),E=z._events,E===void 0?(E=z._events=Object.create(null),z._eventsCount=0):(E.newListener!==void 0&&(z.emit("newListener",S,C.listener?C.listener:C),E=z._events),D=E[S]),D===void 0)D=E[S]=C,++z._eventsCount;else if(typeof D=="function"?D=E[S]=P?[C,D]:[D,C]:P?D.unshift(C):D.push(C),M=l(z),M>0&&D.length>M&&!D.warned){D.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=z,I.type=S,I.count=D.length,r(I)}return z}i.prototype.addListener=function(z,S){return c(this,z,S,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(z,S){return c(this,z,S,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(z,S,C){var P={fired:!1,wrapFn:void 0,target:z,type:S,listener:C},M=u.bind(P);return M.listener=C,P.wrapFn=M,M}i.prototype.once=function(z,S){return s(S),this.on(z,d(this,z,S)),this},i.prototype.prependOnceListener=function(z,S){return s(S),this.prependListener(z,d(this,z,S)),this},i.prototype.removeListener=function(z,S){var C,P,M,E,D;if(s(S),P=this._events,P===void 0)return this;if(C=P[z],C===void 0)return this;if(C===S||C.listener===S)--this._eventsCount===0?this._events=Object.create(null):(delete P[z],P.removeListener&&this.emit("removeListener",z,C.listener||S));else if(typeof C!="function"){for(M=-1,E=C.length-1;E>=0;E--)if(C[E]===S||C[E].listener===S){D=C[E].listener,M=E;break}if(M<0)return this;M===0?C.shift():f(C,M),C.length===1&&(P[z]=C[0]),P.removeListener!==void 0&&this.emit("removeListener",z,D||S)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(z){var S,C,P;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[z]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[z]),this;if(arguments.length===0){var M=Object.keys(C),E;for(P=0;P<M.length;++P)E=M[P],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(S=C[z],typeof S=="function")this.removeListener(z,S);else if(S!==void 0)for(P=S.length-1;P>=0;P--)this.removeListener(z,S[P]);return this};function h(z,S,C){var P=z._events;if(P===void 0)return[];var M=P[S];return M===void 0?[]:typeof M=="function"?C?[M.listener||M]:[M]:C?b(M):v(M,M.length)}i.prototype.listeners=function(z){return h(this,z,!0)},i.prototype.rawListeners=function(z){return h(this,z,!1)},i.listenerCount=function(z,S){return typeof z.listenerCount=="function"?z.listenerCount(S):m.call(z,S)},i.prototype.listenerCount=m;function m(z){var S=this._events;if(S!==void 0){var C=S[z];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function v(z,S){for(var C=new Array(S),P=0;P<S;++P)C[P]=z[P];return C}function f(z,S){for(;S+1<z.length;S++)z[S]=z[S+1];z.pop()}function b(z){for(var S=new Array(z.length),C=0;C<S.length;++C)S[C]=z[C].listener||z[C];return S}function k(z,S){return new Promise(function(C,P){function M(D){z.removeListener(S,E),P(D)}function E(){typeof z.removeListener=="function"&&z.removeListener("error",M),C([].slice.call(arguments))}w(z,S,E,{once:!0}),S!=="error"&&x(z,M,{once:!0})})}function x(z,S,C){typeof z.on=="function"&&w(z,"error",S,C)}function w(z,S,C,P){if(typeof z.on=="function")P.once?z.once(S,C):z.on(S,C);else if(typeof z.addEventListener=="function")z.addEventListener(S,function M(E){P.once&&z.removeEventListener(S,M),C(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof z)}return wC.exports}var Rie,_ie;function Lie(){return _ie||(_ie=1,Rie=Jot().EventEmitter),Rie}var Nie={},_0={},Die;function Xot(){if(Die)return _0;Die=1,_0.byteLength=s,_0.toByteArray=c,_0.fromByteArray=h;for(var e=[],t=[],a=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,i=r.length;n<i;++n)e[n]=r[n],t[r.charCodeAt(n)]=n;t[45]=62,t[95]=63;function o(m){var v=m.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=m.indexOf("=");f===-1&&(f=v);var b=f===v?0:4-f%4;return[f,b]}function s(m){var v=o(m),f=v[0],b=v[1];return(f+b)*3/4-b}function l(m,v,f){return(v+f)*3/4-f}function c(m){var v,f=o(m),b=f[0],k=f[1],x=new a(l(m,b,k)),w=0,z=k>0?b-4:b,S;for(S=0;S<z;S+=4)v=t[m.charCodeAt(S)]<<18|t[m.charCodeAt(S+1)]<<12|t[m.charCodeAt(S+2)]<<6|t[m.charCodeAt(S+3)],x[w++]=v>>16&255,x[w++]=v>>8&255,x[w++]=v&255;return k===2&&(v=t[m.charCodeAt(S)]<<2|t[m.charCodeAt(S+1)]>>4,x[w++]=v&255),k===1&&(v=t[m.charCodeAt(S)]<<10|t[m.charCodeAt(S+1)]<<4|t[m.charCodeAt(S+2)]>>2,x[w++]=v>>8&255,x[w++]=v&255),x}function u(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function d(m,v,f){for(var b,k=[],x=v;x<f;x+=3)b=(m[x]<<16&16711680)+(m[x+1]<<8&65280)+(m[x+2]&255),k.push(u(b));return k.join("")}function h(m){for(var v,f=m.length,b=f%3,k=[],x=16383,w=0,z=f-b;w<z;w+=x)k.push(d(m,w,w+x>z?z:w+x));return b===1?(v=m[f-1],k.push(e[v>>2]+e[v<<4&63]+"==")):b===2&&(v=(m[f-2]<<8)+m[f-1],k.push(e[v>>10]+e[v>>4&63]+e[v<<2&63]+"=")),k.join("")}return _0}var bR={},$ie;function Yot(){return $ie||($ie=1,bR.read=function(e,t,a,r,n){var i,o,s=n*8-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=a?n-1:0,h=a?-1:1,m=e[t+d];for(d+=h,i=m&(1<<-u)-1,m>>=-u,u+=s;u>0;i=i*256+e[t+d],d+=h,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=h,u-=8);if(i===0)i=1-c;else{if(i===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-c}return(m?-1:1)*o*Math.pow(2,i-r)},bR.write=function(e,t,a,r,n,i){var o,s,l,c=i*8-n-1,u=(1<<c)-1,d=u>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,v=r?1:-1,f=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=h/l:t+=h*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*l-1)*Math.pow(2,n),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;e[a+m]=s&255,m+=v,s/=256,n-=8);for(o=o<<n|s,c+=n;c>0;e[a+m]=o&255,m+=v,o/=256,c-=8);e[a+m-v]|=f*128}),bR}var Iie;function L0(){return Iie||(Iie=1,(function(e){const t=Xot(),a=Yot(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;const n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.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 i(){try{const T=new Uint8Array(1),X={foo:function(){return 42}};return Object.setPrototypeOf(X,Uint8Array.prototype),Object.setPrototypeOf(T,X),T.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(T){if(T>n)throw new RangeError('The value "'+T+'" is invalid for option "size"');const X=new Uint8Array(T);return Object.setPrototypeOf(X,s.prototype),X}function s(T,X,se){if(typeof T=="number"){if(typeof X=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(T)}return l(T,X,se)}s.poolSize=8192;function l(T,X,se){if(typeof T=="string")return h(T,X);if(ArrayBuffer.isView(T))return v(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(fe(T,ArrayBuffer)||T&&fe(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(T,SharedArrayBuffer)||T&&fe(T.buffer,SharedArrayBuffer)))return f(T,X,se);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Se=T.valueOf&&T.valueOf();if(Se!=null&&Se!==T)return s.from(Se,X,se);const Me=b(T);if(Me)return Me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),X,se);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}s.from=function(T,X,se){return l(T,X,se)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function u(T,X,se){return c(T),T<=0?o(T):X!==void 0?typeof se=="string"?o(T).fill(X,se):o(T).fill(X):o(T)}s.alloc=function(T,X,se){return u(T,X,se)};function d(T){return c(T),o(T<0?0:k(T)|0)}s.allocUnsafe=function(T){return d(T)},s.allocUnsafeSlow=function(T){return d(T)};function h(T,X){if((typeof X!="string"||X==="")&&(X="utf8"),!s.isEncoding(X))throw new TypeError("Unknown encoding: "+X);const se=w(T,X)|0;let Se=o(se);const Me=Se.write(T,X);return Me!==se&&(Se=Se.slice(0,Me)),Se}function m(T){const X=T.length<0?0:k(T.length)|0,se=o(X);for(let Se=0;Se<X;Se+=1)se[Se]=T[Se]&255;return se}function v(T){if(fe(T,Uint8Array)){const X=new Uint8Array(T);return f(X.buffer,X.byteOffset,X.byteLength)}return m(T)}function f(T,X,se){if(X<0||T.byteLength<X)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<X+(se||0))throw new RangeError('"length" is outside of buffer bounds');let Se;return X===void 0&&se===void 0?Se=new Uint8Array(T):se===void 0?Se=new Uint8Array(T,X):Se=new Uint8Array(T,X,se),Object.setPrototypeOf(Se,s.prototype),Se}function b(T){if(s.isBuffer(T)){const X=k(T.length)|0,se=o(X);return se.length===0||T.copy(se,0,0,X),se}if(T.length!==void 0)return typeof T.length!="number"||je(T.length)?o(0):m(T);if(T.type==="Buffer"&&Array.isArray(T.data))return m(T.data)}function k(T){if(T>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return T|0}function x(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==s.prototype},s.compare=function(T,X){if(fe(T,Uint8Array)&&(T=s.from(T,T.offset,T.byteLength)),fe(X,Uint8Array)&&(X=s.from(X,X.offset,X.byteLength)),!s.isBuffer(T)||!s.isBuffer(X))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===X)return 0;let se=T.length,Se=X.length;for(let Me=0,Be=Math.min(se,Se);Me<Be;++Me)if(T[Me]!==X[Me]){se=T[Me],Se=X[Me];break}return se<Se?-1:Se<se?1:0},s.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(T,X){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return s.alloc(0);let se;if(X===void 0)for(X=0,se=0;se<T.length;++se)X+=T[se].length;const Se=s.allocUnsafe(X);let Me=0;for(se=0;se<T.length;++se){let Be=T[se];if(fe(Be,Uint8Array))Me+Be.length>Se.length?(s.isBuffer(Be)||(Be=s.from(Be)),Be.copy(Se,Me)):Uint8Array.prototype.set.call(Se,Be,Me);else if(s.isBuffer(Be))Be.copy(Se,Me);else throw new TypeError('"list" argument must be an Array of Buffers');Me+=Be.length}return Se};function w(T,X){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||fe(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);const se=T.length,Se=arguments.length>2&&arguments[2]===!0;if(!Se&&se===0)return 0;let Me=!1;for(;;)switch(X){case"ascii":case"latin1":case"binary":return se;case"utf8":case"utf-8":return U(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se*2;case"hex":return se>>>1;case"base64":return ve(T).length;default:if(Me)return Se?-1:U(T).length;X=(""+X).toLowerCase(),Me=!0}}s.byteLength=w;function z(T,X,se){let Se=!1;if((X===void 0||X<0)&&(X=0),X>this.length||((se===void 0||se>this.length)&&(se=this.length),se<=0)||(se>>>=0,X>>>=0,se<=X))return"";for(T||(T="utf8");;)switch(T){case"hex":return ce(this,X,se);case"utf8":case"utf-8":return N(this,X,se);case"ascii":return ne(this,X,se);case"latin1":case"binary":return ee(this,X,se);case"base64":return H(this,X,se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,X,se);default:if(Se)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),Se=!0}}s.prototype._isBuffer=!0;function S(T,X,se){const Se=T[X];T[X]=T[se],T[se]=Se}s.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let X=0;X<T;X+=2)S(this,X,X+1);return this},s.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let X=0;X<T;X+=4)S(this,X,X+3),S(this,X+1,X+2);return this},s.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let X=0;X<T;X+=8)S(this,X,X+7),S(this,X+1,X+6),S(this,X+2,X+5),S(this,X+3,X+4);return this},s.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?N(this,0,T):z.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(T){if(!s.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:s.compare(this,T)===0},s.prototype.inspect=function(){let T="";const X=e.INSPECT_MAX_BYTES;return T=this.toString("hex",0,X).replace(/(.{2})/g,"$1 ").trim(),this.length>X&&(T+=" ... "),"<Buffer "+T+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(T,X,se,Se,Me){if(fe(T,Uint8Array)&&(T=s.from(T,T.offset,T.byteLength)),!s.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(X===void 0&&(X=0),se===void 0&&(se=T?T.length:0),Se===void 0&&(Se=0),Me===void 0&&(Me=this.length),X<0||se>T.length||Se<0||Me>this.length)throw new RangeError("out of range index");if(Se>=Me&&X>=se)return 0;if(Se>=Me)return-1;if(X>=se)return 1;if(X>>>=0,se>>>=0,Se>>>=0,Me>>>=0,this===T)return 0;let Be=Me-Se,De=se-X;const nt=Math.min(Be,De),at=this.slice(Se,Me),pt=T.slice(X,se);for(let lt=0;lt<nt;++lt)if(at[lt]!==pt[lt]){Be=at[lt],De=pt[lt];break}return Be<De?-1:De<Be?1:0};function C(T,X,se,Se,Me){if(T.length===0)return-1;if(typeof se=="string"?(Se=se,se=0):se>2147483647?se=2147483647:se<-2147483648&&(se=-2147483648),se=+se,je(se)&&(se=Me?0:T.length-1),se<0&&(se=T.length+se),se>=T.length){if(Me)return-1;se=T.length-1}else if(se<0)if(Me)se=0;else return-1;if(typeof X=="string"&&(X=s.from(X,Se)),s.isBuffer(X))return X.length===0?-1:P(T,X,se,Se,Me);if(typeof X=="number")return X=X&255,typeof Uint8Array.prototype.indexOf=="function"?Me?Uint8Array.prototype.indexOf.call(T,X,se):Uint8Array.prototype.lastIndexOf.call(T,X,se):P(T,[X],se,Se,Me);throw new TypeError("val must be string, number or Buffer")}function P(T,X,se,Se,Me){let Be=1,De=T.length,nt=X.length;if(Se!==void 0&&(Se=String(Se).toLowerCase(),Se==="ucs2"||Se==="ucs-2"||Se==="utf16le"||Se==="utf-16le")){if(T.length<2||X.length<2)return-1;Be=2,De/=2,nt/=2,se/=2}function at(lt,Ct){return Be===1?lt[Ct]:lt.readUInt16BE(Ct*Be)}let pt;if(Me){let lt=-1;for(pt=se;pt<De;pt++)if(at(T,pt)===at(X,lt===-1?0:pt-lt)){if(lt===-1&&(lt=pt),pt-lt+1===nt)return lt*Be}else lt!==-1&&(pt-=pt-lt),lt=-1}else for(se+nt>De&&(se=De-nt),pt=se;pt>=0;pt--){let lt=!0;for(let Ct=0;Ct<nt;Ct++)if(at(T,pt+Ct)!==at(X,Ct)){lt=!1;break}if(lt)return pt}return-1}s.prototype.includes=function(T,X,se){return this.indexOf(T,X,se)!==-1},s.prototype.indexOf=function(T,X,se){return C(this,T,X,se,!0)},s.prototype.lastIndexOf=function(T,X,se){return C(this,T,X,se,!1)};function M(T,X,se,Se){se=Number(se)||0;const Me=T.length-se;Se?(Se=Number(Se),Se>Me&&(Se=Me)):Se=Me;const Be=X.length;Se>Be/2&&(Se=Be/2);let De;for(De=0;De<Se;++De){const nt=parseInt(X.substr(De*2,2),16);if(je(nt))return De;T[se+De]=nt}return De}function E(T,X,se,Se){return ge(U(X,T.length-se),T,se,Se)}function D(T,X,se,Se){return ge(ae(X),T,se,Se)}function I(T,X,se,Se){return ge(ve(X),T,se,Se)}function L(T,X,se,Se){return ge(ie(X,T.length-se),T,se,Se)}s.prototype.write=function(T,X,se,Se){if(X===void 0)Se="utf8",se=this.length,X=0;else if(se===void 0&&typeof X=="string")Se=X,se=this.length,X=0;else if(isFinite(X))X=X>>>0,isFinite(se)?(se=se>>>0,Se===void 0&&(Se="utf8")):(Se=se,se=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Me=this.length-X;if((se===void 0||se>Me)&&(se=Me),T.length>0&&(se<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");Se||(Se="utf8");let Be=!1;for(;;)switch(Se){case"hex":return M(this,T,X,se);case"utf8":case"utf-8":return E(this,T,X,se);case"ascii":case"latin1":case"binary":return D(this,T,X,se);case"base64":return I(this,T,X,se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,T,X,se);default:if(Be)throw new TypeError("Unknown encoding: "+Se);Se=(""+Se).toLowerCase(),Be=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(T,X,se){return X===0&&se===T.length?t.fromByteArray(T):t.fromByteArray(T.slice(X,se))}function N(T,X,se){se=Math.min(T.length,se);const Se=[];let Me=X;for(;Me<se;){const Be=T[Me];let De=null,nt=Be>239?4:Be>223?3:Be>191?2:1;if(Me+nt<=se){let at,pt,lt,Ct;switch(nt){case 1:Be<128&&(De=Be);break;case 2:at=T[Me+1],(at&192)===128&&(Ct=(Be&31)<<6|at&63,Ct>127&&(De=Ct));break;case 3:at=T[Me+1],pt=T[Me+2],(at&192)===128&&(pt&192)===128&&(Ct=(Be&15)<<12|(at&63)<<6|pt&63,Ct>2047&&(Ct<55296||Ct>57343)&&(De=Ct));break;case 4:at=T[Me+1],pt=T[Me+2],lt=T[Me+3],(at&192)===128&&(pt&192)===128&&(lt&192)===128&&(Ct=(Be&15)<<18|(at&63)<<12|(pt&63)<<6|lt&63,Ct>65535&&Ct<1114112&&(De=Ct))}}De===null?(De=65533,nt=1):De>65535&&(De-=65536,Se.push(De>>>10&1023|55296),De=56320|De&1023),Se.push(De),Me+=nt}return te(Se)}const Y=4096;function te(T){const X=T.length;if(X<=Y)return String.fromCharCode.apply(String,T);let se="",Se=0;for(;Se<X;)se+=String.fromCharCode.apply(String,T.slice(Se,Se+=Y));return se}function ne(T,X,se){let Se="";se=Math.min(T.length,se);for(let Me=X;Me<se;++Me)Se+=String.fromCharCode(T[Me]&127);return Se}function ee(T,X,se){let Se="";se=Math.min(T.length,se);for(let Me=X;Me<se;++Me)Se+=String.fromCharCode(T[Me]);return Se}function ce(T,X,se){const Se=T.length;(!X||X<0)&&(X=0),(!se||se<0||se>Se)&&(se=Se);let Me="";for(let Be=X;Be<se;++Be)Me+=Ce[T[Be]];return Me}function Z(T,X,se){const Se=T.slice(X,se);let Me="";for(let Be=0;Be<Se.length-1;Be+=2)Me+=String.fromCharCode(Se[Be]+Se[Be+1]*256);return Me}s.prototype.slice=function(T,X){const se=this.length;T=~~T,X=X===void 0?se:~~X,T<0?(T+=se,T<0&&(T=0)):T>se&&(T=se),X<0?(X+=se,X<0&&(X=0)):X>se&&(X=se),X<T&&(X=T);const Se=this.subarray(T,X);return Object.setPrototypeOf(Se,s.prototype),Se};function G(T,X,se){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+X>se)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=this[T],Me=1,Be=0;for(;++Be<X&&(Me*=256);)Se+=this[T+Be]*Me;return Se},s.prototype.readUintBE=s.prototype.readUIntBE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=this[T+--X],Me=1;for(;X>0&&(Me*=256);)Se+=this[T+--X]*Me;return Se},s.prototype.readUint8=s.prototype.readUInt8=function(T,X){return T=T>>>0,X||G(T,1,this.length),this[T]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(T,X){return T=T>>>0,X||G(T,2,this.length),this[T]|this[T+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(T,X){return T=T>>>0,X||G(T,2,this.length),this[T]<<8|this[T+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(T,X){return T=T>>>0,X||G(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(T,X){return T=T>>>0,X||G(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},s.prototype.readBigUInt64LE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=X+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,Me=this[++T]+this[++T]*2**8+this[++T]*2**16+se*2**24;return BigInt(Se)+(BigInt(Me)<<BigInt(32))}),s.prototype.readBigUInt64BE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=X*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],Me=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+se;return(BigInt(Se)<<BigInt(32))+BigInt(Me)}),s.prototype.readIntLE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=this[T],Me=1,Be=0;for(;++Be<X&&(Me*=256);)Se+=this[T+Be]*Me;return Me*=128,Se>=Me&&(Se-=Math.pow(2,8*X)),Se},s.prototype.readIntBE=function(T,X,se){T=T>>>0,X=X>>>0,se||G(T,X,this.length);let Se=X,Me=1,Be=this[T+--Se];for(;Se>0&&(Me*=256);)Be+=this[T+--Se]*Me;return Me*=128,Be>=Me&&(Be-=Math.pow(2,8*X)),Be},s.prototype.readInt8=function(T,X){return T=T>>>0,X||G(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},s.prototype.readInt16LE=function(T,X){T=T>>>0,X||G(T,2,this.length);const se=this[T]|this[T+1]<<8;return se&32768?se|4294901760:se},s.prototype.readInt16BE=function(T,X){T=T>>>0,X||G(T,2,this.length);const se=this[T+1]|this[T]<<8;return se&32768?se|4294901760:se},s.prototype.readInt32LE=function(T,X){return T=T>>>0,X||G(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},s.prototype.readInt32BE=function(T,X){return T=T>>>0,X||G(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},s.prototype.readBigInt64LE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(se<<24);return(BigInt(Se)<<BigInt(32))+BigInt(X+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),s.prototype.readBigInt64BE=_e(function(T){T=T>>>0,de(T,"offset");const X=this[T],se=this[T+7];(X===void 0||se===void 0)&&q(T,this.length-8);const Se=(X<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(Se)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+se)}),s.prototype.readFloatLE=function(T,X){return T=T>>>0,X||G(T,4,this.length),a.read(this,T,!0,23,4)},s.prototype.readFloatBE=function(T,X){return T=T>>>0,X||G(T,4,this.length),a.read(this,T,!1,23,4)},s.prototype.readDoubleLE=function(T,X){return T=T>>>0,X||G(T,8,this.length),a.read(this,T,!0,52,8)},s.prototype.readDoubleBE=function(T,X){return T=T>>>0,X||G(T,8,this.length),a.read(this,T,!1,52,8)};function J(T,X,se,Se,Me,Be){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(X>Me||X<Be)throw new RangeError('"value" argument is out of bounds');if(se+Se>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(T,X,se,Se){if(T=+T,X=X>>>0,se=se>>>0,!Se){const De=Math.pow(2,8*se)-1;J(this,T,X,se,De,0)}let Me=1,Be=0;for(this[X]=T&255;++Be<se&&(Me*=256);)this[X+Be]=T/Me&255;return X+se},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(T,X,se,Se){if(T=+T,X=X>>>0,se=se>>>0,!Se){const De=Math.pow(2,8*se)-1;J(this,T,X,se,De,0)}let Me=se-1,Be=1;for(this[X+Me]=T&255;--Me>=0&&(Be*=256);)this[X+Me]=T/Be&255;return X+se},s.prototype.writeUint8=s.prototype.writeUInt8=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,1,255,0),this[X]=T&255,X+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,65535,0),this[X]=T&255,this[X+1]=T>>>8,X+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,65535,0),this[X]=T>>>8,this[X+1]=T&255,X+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,4294967295,0),this[X+3]=T>>>24,this[X+2]=T>>>16,this[X+1]=T>>>8,this[X]=T&255,X+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,4294967295,0),this[X]=T>>>24,this[X+1]=T>>>16,this[X+2]=T>>>8,this[X+3]=T&255,X+4};function Q(T,X,se,Se,Me){V(X,Se,Me,T,se,7);let Be=Number(X&BigInt(4294967295));T[se++]=Be,Be=Be>>8,T[se++]=Be,Be=Be>>8,T[se++]=Be,Be=Be>>8,T[se++]=Be;let De=Number(X>>BigInt(32)&BigInt(4294967295));return T[se++]=De,De=De>>8,T[se++]=De,De=De>>8,T[se++]=De,De=De>>8,T[se++]=De,se}function _(T,X,se,Se,Me){V(X,Se,Me,T,se,7);let Be=Number(X&BigInt(4294967295));T[se+7]=Be,Be=Be>>8,T[se+6]=Be,Be=Be>>8,T[se+5]=Be,Be=Be>>8,T[se+4]=Be;let De=Number(X>>BigInt(32)&BigInt(4294967295));return T[se+3]=De,De=De>>8,T[se+2]=De,De=De>>8,T[se+1]=De,De=De>>8,T[se]=De,se+8}s.prototype.writeBigUInt64LE=_e(function(T,X=0){return Q(this,T,X,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=_e(function(T,X=0){return _(this,T,X,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(T,X,se,Se){if(T=+T,X=X>>>0,!Se){const nt=Math.pow(2,8*se-1);J(this,T,X,se,nt-1,-nt)}let Me=0,Be=1,De=0;for(this[X]=T&255;++Me<se&&(Be*=256);)T<0&&De===0&&this[X+Me-1]!==0&&(De=1),this[X+Me]=(T/Be>>0)-De&255;return X+se},s.prototype.writeIntBE=function(T,X,se,Se){if(T=+T,X=X>>>0,!Se){const nt=Math.pow(2,8*se-1);J(this,T,X,se,nt-1,-nt)}let Me=se-1,Be=1,De=0;for(this[X+Me]=T&255;--Me>=0&&(Be*=256);)T<0&&De===0&&this[X+Me+1]!==0&&(De=1),this[X+Me]=(T/Be>>0)-De&255;return X+se},s.prototype.writeInt8=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,1,127,-128),T<0&&(T=255+T+1),this[X]=T&255,X+1},s.prototype.writeInt16LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,32767,-32768),this[X]=T&255,this[X+1]=T>>>8,X+2},s.prototype.writeInt16BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,2,32767,-32768),this[X]=T>>>8,this[X+1]=T&255,X+2},s.prototype.writeInt32LE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,2147483647,-2147483648),this[X]=T&255,this[X+1]=T>>>8,this[X+2]=T>>>16,this[X+3]=T>>>24,X+4},s.prototype.writeInt32BE=function(T,X,se){return T=+T,X=X>>>0,se||J(this,T,X,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[X]=T>>>24,this[X+1]=T>>>16,this[X+2]=T>>>8,this[X+3]=T&255,X+4},s.prototype.writeBigInt64LE=_e(function(T,X=0){return Q(this,T,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=_e(function(T,X=0){return _(this,T,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function K(T,X,se,Se,Me,Be){if(se+Se>T.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("Index out of range")}function W(T,X,se,Se,Me){return X=+X,se=se>>>0,Me||K(T,X,se,4),a.write(T,X,se,Se,23,4),se+4}s.prototype.writeFloatLE=function(T,X,se){return W(this,T,X,!0,se)},s.prototype.writeFloatBE=function(T,X,se){return W(this,T,X,!1,se)};function oe(T,X,se,Se,Me){return X=+X,se=se>>>0,Me||K(T,X,se,8),a.write(T,X,se,Se,52,8),se+8}s.prototype.writeDoubleLE=function(T,X,se){return oe(this,T,X,!0,se)},s.prototype.writeDoubleBE=function(T,X,se){return oe(this,T,X,!1,se)},s.prototype.copy=function(T,X,se,Se){if(!s.isBuffer(T))throw new TypeError("argument should be a Buffer");if(se||(se=0),!Se&&Se!==0&&(Se=this.length),X>=T.length&&(X=T.length),X||(X=0),Se>0&&Se<se&&(Se=se),Se===se||T.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(se<0||se>=this.length)throw new RangeError("Index out of range");if(Se<0)throw new RangeError("sourceEnd out of bounds");Se>this.length&&(Se=this.length),T.length-X<Se-se&&(Se=T.length-X+se);const Me=Se-se;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(X,se,Se):Uint8Array.prototype.set.call(T,this.subarray(se,Se),X),Me},s.prototype.fill=function(T,X,se,Se){if(typeof T=="string"){if(typeof X=="string"?(Se=X,X=0,se=this.length):typeof se=="string"&&(Se=se,se=this.length),Se!==void 0&&typeof Se!="string")throw new TypeError("encoding must be a string");if(typeof Se=="string"&&!s.isEncoding(Se))throw new TypeError("Unknown encoding: "+Se);if(T.length===1){const Be=T.charCodeAt(0);(Se==="utf8"&&Be<128||Se==="latin1")&&(T=Be)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(X<0||this.length<X||this.length<se)throw new RangeError("Out of range index");if(se<=X)return this;X=X>>>0,se=se===void 0?this.length:se>>>0,T||(T=0);let Me;if(typeof T=="number")for(Me=X;Me<se;++Me)this[Me]=T;else{const Be=s.isBuffer(T)?T:s.from(T,Se),De=Be.length;if(De===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(Me=0;Me<se-X;++Me)this[Me+X]=Be[Me%De]}return this};const le={};function be(T,X,se){le[T]=class extends se{constructor(){super(),Object.defineProperty(this,"message",{value:X.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,delete this.name}get code(){return T}set code(Se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Se,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}be("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),be("ERR_INVALID_ARG_TYPE",function(T,X){return`The "${T}" argument must be of type number. Received type ${typeof X}`},TypeError),be("ERR_OUT_OF_RANGE",function(T,X,se){let Se=`The value of "${T}" is out of range.`,Me=se;return Number.isInteger(se)&&Math.abs(se)>2**32?Me=Oe(String(se)):typeof se=="bigint"&&(Me=String(se),(se>BigInt(2)**BigInt(32)||se<-(BigInt(2)**BigInt(32)))&&(Me=Oe(Me)),Me+="n"),Se+=` It must be ${X}. Received ${Me}`,Se},RangeError);function Oe(T){let X="",se=T.length;const Se=T[0]==="-"?1:0;for(;se>=Se+4;se-=3)X=`_${T.slice(se-3,se)}${X}`;return`${T.slice(0,se)}${X}`}function B(T,X,se){de(X,"offset"),(T[X]===void 0||T[X+se]===void 0)&&q(X,T.length-(se+1))}function V(T,X,se,Se,Me,Be){if(T>se||T<X){const De=typeof X=="bigint"?"n":"";let nt;throw X===0||X===BigInt(0)?nt=`>= 0${De} and < 2${De} ** ${(Be+1)*8}${De}`:nt=`>= -(2${De} ** ${(Be+1)*8-1}${De}) and < 2 ** ${(Be+1)*8-1}${De}`,new le.ERR_OUT_OF_RANGE("value",nt,T)}B(Se,Me,Be)}function de(T,X){if(typeof T!="number")throw new le.ERR_INVALID_ARG_TYPE(X,"number",T)}function q(T,X,se){throw Math.floor(T)!==T?(de(T,se),new le.ERR_OUT_OF_RANGE("offset","an integer",T)):X<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${X}`,T)}const he=/[^+/0-9A-Za-z-_]/g;function pe(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function U(T,X){X=X||1/0;let se;const Se=T.length;let Me=null;const Be=[];for(let De=0;De<Se;++De){if(se=T.charCodeAt(De),se>55295&&se<57344){if(!Me){if(se>56319){(X-=3)>-1&&Be.push(239,191,189);continue}else if(De+1===Se){(X-=3)>-1&&Be.push(239,191,189);continue}Me=se;continue}if(se<56320){(X-=3)>-1&&Be.push(239,191,189),Me=se;continue}se=(Me-55296<<10|se-56320)+65536}else Me&&(X-=3)>-1&&Be.push(239,191,189);if(Me=null,se<128){if((X-=1)<0)break;Be.push(se)}else if(se<2048){if((X-=2)<0)break;Be.push(se>>6|192,se&63|128)}else if(se<65536){if((X-=3)<0)break;Be.push(se>>12|224,se>>6&63|128,se&63|128)}else if(se<1114112){if((X-=4)<0)break;Be.push(se>>18|240,se>>12&63|128,se>>6&63|128,se&63|128)}else throw new Error("Invalid code point")}return Be}function ae(T){const X=[];for(let se=0;se<T.length;++se)X.push(T.charCodeAt(se)&255);return X}function ie(T,X){let se,Se,Me;const Be=[];for(let De=0;De<T.length&&!((X-=2)<0);++De)se=T.charCodeAt(De),Se=se>>8,Me=se%256,Be.push(Me),Be.push(Se);return Be}function ve(T){return t.toByteArray(pe(T))}function ge(T,X,se,Se){let Me;for(Me=0;Me<Se&&!(Me+se>=X.length||Me>=T.length);++Me)X[Me+se]=T[Me];return Me}function fe(T,X){return T instanceof X||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===X.name}function je(T){return T!==T}const Ce=(function(){const T="0123456789abcdef",X=new Array(256);for(let se=0;se<16;++se){const Se=se*16;for(let Me=0;Me<16;++Me)X[Se+Me]=T[se]+T[Me]}return X})();function _e(T){return typeof BigInt>"u"?rt:T}function rt(){throw new Error("BigInt not supported")}})(Nie)),Nie}const Vie=LQ(Mre);var yR,Kie;function est(){if(Kie)return yR;Kie=1;function e(v,f){var b=Object.keys(v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);f&&(k=k.filter(function(x){return Object.getOwnPropertyDescriptor(v,x).enumerable})),b.push.apply(b,k)}return b}function t(v){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?e(Object(b),!0).forEach(function(k){a(v,k,b[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(k){Object.defineProperty(v,k,Object.getOwnPropertyDescriptor(b,k))})}return v}function a(v,f,b){return f=o(f),f in v?Object.defineProperty(v,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):v[f]=b,v}function r(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function n(v,f){for(var b=0;b<f.length;b++){var k=f[b];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(v,o(k.key),k)}}function i(v,f,b){return f&&n(v.prototype,f),Object.defineProperty(v,"prototype",{writable:!1}),v}function o(v){var f=s(v,"string");return typeof f=="symbol"?f:String(f)}function s(v,f){if(typeof v!="object"||v===null)return v;var b=v[Symbol.toPrimitive];if(b!==void 0){var k=b.call(v,f);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}var l=L0(),c=l.Buffer,u=Vie,d=u.inspect,h=d&&d.custom||"inspect";function m(v,f,b){c.prototype.copy.call(v,f,b)}return yR=(function(){function v(){r(this,v),this.head=null,this.tail=null,this.length=0}return i(v,[{key:"push",value:function(f){var b={data:f,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(f){var b={data:f,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var b=this.head,k=""+b.data;b=b.next;)k+=f+b.data;return k}},{key:"concat",value:function(f){if(this.length===0)return c.alloc(0);for(var b=c.allocUnsafe(f>>>0),k=this.head,x=0;k;)m(k.data,b,x),x+=k.data.length,k=k.next;return b}},{key:"consume",value:function(f,b){var k;return f<this.head.data.length?(k=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):f===this.head.data.length?k=this.shift():k=b?this._getString(f):this._getBuffer(f),k}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var b=this.head,k=1,x=b.data;for(f-=x.length;b=b.next;){var w=b.data,z=f>w.length?w.length:f;if(z===w.length?x+=w:x+=w.slice(0,f),f-=z,f===0){z===w.length?(++k,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=w.slice(z));break}++k}return this.length-=k,x}},{key:"_getBuffer",value:function(f){var b=c.allocUnsafe(f),k=this.head,x=1;for(k.data.copy(b),f-=k.data.length;k=k.next;){var w=k.data,z=f>w.length?w.length:f;if(w.copy(b,b.length-f,0,z),f-=z,f===0){z===w.length?(++x,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=w.slice(z));break}++x}return this.length-=x,b}},{key:h,value:function(f,b){return d(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),v})(),yR}var kR,Hie;function Gie(){if(Hie)return kR;Hie=1;function e(o,s){var l=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(s?s(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,o)):process.nextTick(n,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(d){!s&&d?l._writableState?l._writableState.errorEmitted?process.nextTick(a,l):(l._writableState.errorEmitted=!0,process.nextTick(t,l,d)):process.nextTick(t,l,d):s?(process.nextTick(a,l),s(d)):process.nextTick(a,l)}),this)}function t(o,s){n(o,s),a(o)}function a(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function n(o,s){o.emit("error",s)}function i(o,s){var l=o._readableState,c=o._writableState;l&&l.autoDestroy||c&&c.autoDestroy?o.destroy(s):o.emit("error",s)}return kR={destroy:e,undestroy:r,errorOrDestroy:i},kR}var xR={},Fie;function hb(){if(Fie)return xR;Fie=1;function e(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,s.__proto__=l}var t={};function a(s,l,c){c||(c=Error);function u(h,m,v){return typeof l=="string"?l:l(h,m,v)}var d=(function(h){e(m,h);function m(v,f,b){return h.call(this,u(v,f,b))||this}return m})(c);d.prototype.name=c.name,d.prototype.code=s,t[s]=d}function r(s,l){if(Array.isArray(s)){var c=s.length;return s=s.map(function(u){return String(u)}),c>2?"one of ".concat(l," ").concat(s.slice(0,c-1).join(", "),", or ")+s[c-1]:c===2?"one of ".concat(l," ").concat(s[0]," or ").concat(s[1]):"of ".concat(l," ").concat(s[0])}else return"of ".concat(l," ").concat(String(s))}function n(s,l,c){return s.substr(0,l.length)===l}function i(s,l,c){return(c===void 0||c>s.length)&&(c=s.length),s.substring(c-l.length,c)===l}function o(s,l,c){return typeof c!="number"&&(c=0),c+l.length>s.length?!1:s.indexOf(l,c)!==-1}return a("ERR_INVALID_OPT_VALUE",function(s,l){return'The value "'+l+'" is invalid for option "'+s+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(s,l,c){var u;typeof l=="string"&&n(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var d;if(i(s," argument"))d="The ".concat(s," ").concat(u," ").concat(r(l,"type"));else{var h=o(s,".")?"property":"argument";d='The "'.concat(s,'" ').concat(h," ").concat(u," ").concat(r(l,"type"))}return d+=". Received type ".concat(typeof c),d},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),xR.codes=t,xR}var wR,qie;function Qie(){if(qie)return wR;qie=1;var e=hb().codes.ERR_INVALID_OPT_VALUE;function t(r,n,i){return r.highWaterMark!=null?r.highWaterMark:n?r[i]:null}function a(r,n,i,o){var s=t(n,o,i);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var l=o?i:"highWaterMark";throw new e(l,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return wR={getHighWaterMark:a},wR}var OR,Uie;function tst(){if(Uie)return OR;Uie=1,OR=e;function e(a,r){if(t("noDeprecation"))return a;var n=!1;function i(){if(!n){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return a.apply(this,arguments)}return i}function t(a){try{if(!globalThis.localStorage)return!1}catch{return!1}var r=globalThis.localStorage[a];return r==null?!1:String(r).toLowerCase()==="true"}return OR}var SR,Wie;function Zie(){if(Wie)return SR;Wie=1,SR=M;function e(W){var oe=this;this.next=null,this.entry=null,this.finish=function(){K(oe,W)}}var t;M.WritableState=C;var a={deprecate:tst()},r=Lie(),n=L0().Buffer,i=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(W){return n.from(W)}function s(W){return n.isBuffer(W)||W instanceof i}var l=Gie(),c=Qie(),u=c.getHighWaterMark,d=hb().codes,h=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,v=d.ERR_MULTIPLE_CALLBACK,f=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,k=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,z=l.errorOrDestroy;function S(){}function C(W,oe,le){t=t||mb(),W=W||{},typeof le!="boolean"&&(le=oe instanceof t),this.objectMode=!!W.objectMode,le&&(this.objectMode=this.objectMode||!!W.writableObjectMode),this.highWaterMark=u(this,W,"writableHighWaterMark",le),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var be=W.decodeStrings===!1;this.decodeStrings=!be,this.defaultEncoding=W.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Oe){te(oe,Oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=W.emitClose!==!1,this.autoDestroy=!!W.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}C.prototype.getBuffer=function(){for(var W=this.bufferedRequest,oe=[];W;)oe.push(W),W=W.next;return oe},(function(){try{Object.defineProperty(C.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var P;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(P=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(W){return P.call(this,W)?!0:this!==M?!1:W&&W._writableState instanceof C}})):P=function(W){return W instanceof this};function M(W){t=t||mb();var oe=this instanceof t;if(!oe&&!P.call(M,this))return new M(W);this._writableState=new C(W,this,oe),this.writable=!0,W&&(typeof W.write=="function"&&(this._write=W.write),typeof W.writev=="function"&&(this._writev=W.writev),typeof W.destroy=="function"&&(this._destroy=W.destroy),typeof W.final=="function"&&(this._final=W.final)),r.call(this)}M.prototype.pipe=function(){z(this,new f)};function E(W,oe){var le=new x;z(W,le),process.nextTick(oe,le)}function D(W,oe,le,be){var Oe;return le===null?Oe=new k:typeof le!="string"&&!oe.objectMode&&(Oe=new h("chunk",["string","Buffer"],le)),Oe?(z(W,Oe),process.nextTick(be,Oe),!1):!0}M.prototype.write=function(W,oe,le){var be=this._writableState,Oe=!1,B=!be.objectMode&&s(W);return B&&!n.isBuffer(W)&&(W=o(W)),typeof oe=="function"&&(le=oe,oe=null),B?oe="buffer":oe||(oe=be.defaultEncoding),typeof le!="function"&&(le=S),be.ending?E(this,le):(B||D(this,be,W,le))&&(be.pendingcb++,Oe=L(this,be,B,W,oe,le)),Oe},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var W=this._writableState;W.corked&&(W.corked--,!W.writing&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&ce(this,W))},M.prototype.setDefaultEncoding=function(W){if(typeof W=="string"&&(W=W.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((W+"").toLowerCase())>-1))throw new w(W);return this._writableState.defaultEncoding=W,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function I(W,oe,le){return!W.objectMode&&W.decodeStrings!==!1&&typeof oe=="string"&&(oe=n.from(oe,le)),oe}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(W,oe,le,be,Oe,B){if(!le){var V=I(oe,be,Oe);be!==V&&(le=!0,Oe="buffer",be=V)}var de=oe.objectMode?1:be.length;oe.length+=de;var q=oe.length<oe.highWaterMark;if(q||(oe.needDrain=!0),oe.writing||oe.corked){var he=oe.lastBufferedRequest;oe.lastBufferedRequest={chunk:be,encoding:Oe,isBuf:le,callback:B,next:null},he?he.next=oe.lastBufferedRequest:oe.bufferedRequest=oe.lastBufferedRequest,oe.bufferedRequestCount+=1}else H(W,oe,!1,de,be,Oe,B);return q}function H(W,oe,le,be,Oe,B,V){oe.writelen=be,oe.writecb=V,oe.writing=!0,oe.sync=!0,oe.destroyed?oe.onwrite(new b("write")):le?W._writev(Oe,oe.onwrite):W._write(Oe,B,oe.onwrite),oe.sync=!1}function N(W,oe,le,be,Oe){--oe.pendingcb,le?(process.nextTick(Oe,be),process.nextTick(Q,W,oe),W._writableState.errorEmitted=!0,z(W,be)):(Oe(be),W._writableState.errorEmitted=!0,z(W,be),Q(W,oe))}function Y(W){W.writing=!1,W.writecb=null,W.length-=W.writelen,W.writelen=0}function te(W,oe){var le=W._writableState,be=le.sync,Oe=le.writecb;if(typeof Oe!="function")throw new v;if(Y(le),oe)N(W,le,be,oe,Oe);else{var B=Z(le)||W.destroyed;!B&&!le.corked&&!le.bufferProcessing&&le.bufferedRequest&&ce(W,le),be?process.nextTick(ne,W,le,B,Oe):ne(W,le,B,Oe)}}function ne(W,oe,le,be){le||ee(W,oe),oe.pendingcb--,be(),Q(W,oe)}function ee(W,oe){oe.length===0&&oe.needDrain&&(oe.needDrain=!1,W.emit("drain"))}function ce(W,oe){oe.bufferProcessing=!0;var le=oe.bufferedRequest;if(W._writev&&le&&le.next){var be=oe.bufferedRequestCount,Oe=new Array(be),B=oe.corkedRequestsFree;B.entry=le;for(var V=0,de=!0;le;)Oe[V]=le,le.isBuf||(de=!1),le=le.next,V+=1;Oe.allBuffers=de,H(W,oe,!0,oe.length,Oe,"",B.finish),oe.pendingcb++,oe.lastBufferedRequest=null,B.next?(oe.corkedRequestsFree=B.next,B.next=null):oe.corkedRequestsFree=new e(oe),oe.bufferedRequestCount=0}else{for(;le;){var q=le.chunk,he=le.encoding,pe=le.callback,U=oe.objectMode?1:q.length;if(H(W,oe,!1,U,q,he,pe),le=le.next,oe.bufferedRequestCount--,oe.writing)break}le===null&&(oe.lastBufferedRequest=null)}oe.bufferedRequest=le,oe.bufferProcessing=!1}M.prototype._write=function(W,oe,le){le(new m("_write()"))},M.prototype._writev=null,M.prototype.end=function(W,oe,le){var be=this._writableState;return typeof W=="function"?(le=W,W=null,oe=null):typeof oe=="function"&&(le=oe,oe=null),W!=null&&this.write(W,oe),be.corked&&(be.corked=1,this.uncork()),be.ending||_(this,be,le),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Z(W){return W.ending&&W.length===0&&W.bufferedRequest===null&&!W.finished&&!W.writing}function G(W,oe){W._final(function(le){oe.pendingcb--,le&&z(W,le),oe.prefinished=!0,W.emit("prefinish"),Q(W,oe)})}function J(W,oe){!oe.prefinished&&!oe.finalCalled&&(typeof W._final=="function"&&!oe.destroyed?(oe.pendingcb++,oe.finalCalled=!0,process.nextTick(G,W,oe)):(oe.prefinished=!0,W.emit("prefinish")))}function Q(W,oe){var le=Z(oe);if(le&&(J(W,oe),oe.pendingcb===0&&(oe.finished=!0,W.emit("finish"),oe.autoDestroy))){var be=W._readableState;(!be||be.autoDestroy&&be.endEmitted)&&W.destroy()}return le}function _(W,oe,le){oe.ending=!0,Q(W,oe),le&&(oe.finished?process.nextTick(le):W.once("finish",le)),oe.ended=!0,W.writable=!1}function K(W,oe,le){var be=W.entry;for(W.entry=null;be;){var Oe=be.callback;oe.pendingcb--,Oe(le),be=be.next}oe.corkedRequestsFree.next=W}return Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(W){this._writableState&&(this._writableState.destroyed=W)}}),M.prototype.destroy=l.destroy,M.prototype._undestroy=l.undestroy,M.prototype._destroy=function(W,oe){oe(W)},SR}var zR,Jie;function mb(){if(Jie)return zR;Jie=1;var e=Object.keys||function(c){var u=[];for(var d in c)u.push(d);return u};zR=o;for(var t=ooe(),a=Zie(),r=e(a.prototype),n=0;n<r.length;n++){var i=r[n];o.prototype[i]||(o.prototype[i]=a.prototype[i])}function o(c){if(!(this instanceof o))return new o(c);t.call(this,c),a.call(this,c),this.allowHalfOpen=!0,c&&(c.readable===!1&&(this.readable=!1),c.writable===!1&&(this.writable=!1),c.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function s(){this._writableState.ended||process.nextTick(l,this)}function l(c){c.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),zR}var CR={},jR={exports:{}},Xie;function ast(){return Xie||(Xie=1,(function(e,t){var a=L0(),r=a.Buffer;function n(o,s){for(var l in o)s[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i);function i(o,s,l){return r(o,s,l)}i.prototype=Object.create(r.prototype),n(r,i),i.from=function(o,s,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,s,l)},i.alloc=function(o,s,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var c=r(o);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return a.SlowBuffer(o)}})(jR,jR.exports)),jR.exports}var Yie;function eoe(){if(Yie)return CR;Yie=1;var e=ast().Buffer,t=e.isEncoding||function(k){switch(k=""+k,k&&k.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 a(k){if(!k)return"utf8";for(var x;;)switch(k){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 k;default:if(x)return;k=(""+k).toLowerCase(),x=!0}}function r(k){var x=a(k);if(typeof x!="string"&&(e.isEncoding===t||!t(k)))throw new Error("Unknown encoding: "+k);return x||k}CR.StringDecoder=n;function n(k){this.encoding=r(k);var x;switch(this.encoding){case"utf16le":this.text=d,this.end=h,x=4;break;case"utf8":this.fillLast=l,x=4;break;case"base64":this.text=m,this.end=v,x=3;break;default:this.write=f,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(x)}n.prototype.write=function(k){if(k.length===0)return"";var x,w;if(this.lastNeed){if(x=this.fillLast(k),x===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w<k.length?x?x+this.text(k,w):this.text(k,w):x||""},n.prototype.end=u,n.prototype.text=c,n.prototype.fillLast=function(k){if(this.lastNeed<=k.length)return k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,k.length),this.lastNeed-=k.length};function i(k){return k<=127?0:k>>5===6?2:k>>4===14?3:k>>3===30?4:k>>6===2?-1:-2}function o(k,x,w){var z=x.length-1;if(z<w)return 0;var S=i(x[z]);return S>=0?(S>0&&(k.lastNeed=S-1),S):--z<w||S===-2?0:(S=i(x[z]),S>=0?(S>0&&(k.lastNeed=S-2),S):--z<w||S===-2?0:(S=i(x[z]),S>=0?(S>0&&(S===2?S=0:k.lastNeed=S-3),S):0))}function s(k,x,w){if((x[0]&192)!==128)return k.lastNeed=0,"\uFFFD";if(k.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return k.lastNeed=1,"\uFFFD";if(k.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return k.lastNeed=2,"\uFFFD"}}function l(k){var x=this.lastTotal-this.lastNeed,w=s(this,k);if(w!==void 0)return w;if(this.lastNeed<=k.length)return k.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,x,0,k.length),this.lastNeed-=k.length}function c(k,x){var w=o(this,k,x);if(!this.lastNeed)return k.toString("utf8",x);this.lastTotal=w;var z=k.length-(w-this.lastNeed);return k.copy(this.lastChar,0,z),k.toString("utf8",x,z)}function u(k){var x=k&&k.length?this.write(k):"";return this.lastNeed?x+"\uFFFD":x}function d(k,x){if((k.length-x)%2===0){var w=k.toString("utf16le",x);if(w){var z=w.charCodeAt(w.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=k[k.length-1],k.toString("utf16le",x,k.length-1)}function h(k){var x=k&&k.length?this.write(k):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,w)}return x}function m(k,x){var w=(k.length-x)%3;return w===0?k.toString("base64",x):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=k[k.length-1]:(this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1]),k.toString("base64",x,k.length-w))}function v(k){var x=k&&k.length?this.write(k):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function f(k){return k.toString(this.encoding)}function b(k){return k&&k.length?this.write(k):""}return CR}var PR,toe;function AR(){if(toe)return PR;toe=1;var e=hb().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var o=!1;return function(){if(!o){o=!0;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];i.apply(this,l)}}}function a(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function n(i,o,s){if(typeof o=="function")return n(i,null,o);o||(o={}),s=t(s||a);var l=o.readable||o.readable!==!1&&i.readable,c=o.writable||o.writable!==!1&&i.writable,u=function(){i.writable||h()},d=i._writableState&&i._writableState.finished,h=function(){c=!1,d=!0,l||s.call(i)},m=i._readableState&&i._readableState.endEmitted,v=function(){l=!1,m=!0,c||s.call(i)},f=function(x){s.call(i,x)},b=function(){var x;if(l&&!m)return(!i._readableState||!i._readableState.ended)&&(x=new e),s.call(i,x);if(c&&!d)return(!i._writableState||!i._writableState.ended)&&(x=new e),s.call(i,x)},k=function(){i.req.on("finish",h)};return r(i)?(i.on("complete",h),i.on("abort",b),i.req?k():i.on("request",k)):c&&!i._writableState&&(i.on("end",u),i.on("close",u)),i.on("end",v),i.on("finish",h),o.error!==!1&&i.on("error",f),i.on("close",b),function(){i.removeListener("complete",h),i.removeListener("abort",b),i.removeListener("request",k),i.req&&i.req.removeListener("finish",h),i.removeListener("end",u),i.removeListener("close",u),i.removeListener("finish",h),i.removeListener("end",v),i.removeListener("error",f),i.removeListener("close",b)}}return PR=n,PR}var MR,aoe;function rst(){if(aoe)return MR;aoe=1;var e;function t(w,z,S){return z=a(z),z in w?Object.defineProperty(w,z,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[z]=S,w}function a(w){var z=r(w,"string");return typeof z=="symbol"?z:String(z)}function r(w,z){if(typeof w!="object"||w===null)return w;var S=w[Symbol.toPrimitive];if(S!==void 0){var C=S.call(w,z);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(w)}var n=AR(),i=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function h(w,z){return{value:w,done:z}}function m(w){var z=w[i];if(z!==null){var S=w[d].read();S!==null&&(w[c]=null,w[i]=null,w[o]=null,z(h(S,!1)))}}function v(w){process.nextTick(m,w)}function f(w,z){return function(S,C){w.then(function(){if(z[l]){S(h(void 0,!0));return}z[u](S,C)},C)}}var b=Object.getPrototypeOf(function(){}),k=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var w=this,z=this[s];if(z!==null)return Promise.reject(z);if(this[l])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(M,E){process.nextTick(function(){w[s]?E(w[s]):M(h(void 0,!0))})});var S=this[c],C;if(S)C=new Promise(f(S,this));else{var P=this[d].read();if(P!==null)return Promise.resolve(h(P,!1));C=new Promise(this[u])}return this[c]=C,C}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var w=this;return new Promise(function(z,S){w[d].destroy(null,function(C){if(C){S(C);return}z(h(void 0,!0))})})}),e),b),x=function(w){var z,S=Object.create(k,(z={},t(z,d,{value:w,writable:!0}),t(z,i,{value:null,writable:!0}),t(z,o,{value:null,writable:!0}),t(z,s,{value:null,writable:!0}),t(z,l,{value:w._readableState.endEmitted,writable:!0}),t(z,u,{value:function(C,P){var M=S[d].read();M?(S[c]=null,S[i]=null,S[o]=null,C(h(M,!1))):(S[i]=C,S[o]=P)},writable:!0}),z));return S[c]=null,n(w,function(C){if(C&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"){var P=S[o];P!==null&&(S[c]=null,S[i]=null,S[o]=null,P(C)),S[s]=C;return}var M=S[i];M!==null&&(S[c]=null,S[i]=null,S[o]=null,M(h(void 0,!0))),S[l]=!0}),w.on("readable",v.bind(null,S)),S};return MR=x,MR}var roe,noe;function nst(){return noe||(noe=1,roe=function(){throw new Error("Readable.from is not available in the browser")}),roe}var TR,ioe;function ooe(){if(ioe)return TR;ioe=1,TR=E;var e;E.ReadableState=M;var t=function(B,V){return B.listeners(V).length},a=Lie(),r=L0().Buffer,n=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(B){return r.from(B)}function o(B){return r.isBuffer(B)||B instanceof n}var s=Vie,l;s&&s.debuglog?l=s.debuglog("stream"):l=function(){};var c=est(),u=Gie(),d=Qie(),h=d.getHighWaterMark,m=hb().codes,v=m.ERR_INVALID_ARG_TYPE,f=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,k=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,w,z,S=u.errorOrDestroy,C=["error","close","destroy","pause","resume"];function P(B,V,de){if(typeof B.prependListener=="function")return B.prependListener(V,de);!B._events||!B._events[V]?B.on(V,de):Array.isArray(B._events[V])?B._events[V].unshift(de):B._events[V]=[de,B._events[V]]}function M(B,V,de){e=e||mb(),B=B||{},typeof de!="boolean"&&(de=V instanceof e),this.objectMode=!!B.objectMode,de&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=h(this,B,"readableHighWaterMark",de),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(x||(x=eoe().StringDecoder),this.decoder=new x(B.encoding),this.encoding=B.encoding)}function E(B){if(e=e||mb(),!(this instanceof E))return new E(B);var V=this instanceof e;this._readableState=new M(B,this,V),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.destroy)),a.call(this)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(B){this._readableState&&(this._readableState.destroyed=B)}}),E.prototype.destroy=u.destroy,E.prototype._undestroy=u.undestroy,E.prototype._destroy=function(B,V){V(B)},E.prototype.push=function(B,V){var de=this._readableState,q;return de.objectMode?q=!0:typeof B=="string"&&(V=V||de.defaultEncoding,V!==de.encoding&&(B=r.from(B,V),V=""),q=!0),D(this,B,V,!1,q)},E.prototype.unshift=function(B){return D(this,B,null,!0,!1)};function D(B,V,de,q,he){l("readableAddChunk",V);var pe=B._readableState;if(V===null)pe.reading=!1,te(B,pe);else{var U;if(he||(U=L(pe,V)),U)S(B,U);else if(pe.objectMode||V&&V.length>0)if(typeof V!="string"&&!pe.objectMode&&Object.getPrototypeOf(V)!==r.prototype&&(V=i(V)),q)pe.endEmitted?S(B,new k):I(B,pe,V,!0);else if(pe.ended)S(B,new f);else{if(pe.destroyed)return!1;pe.reading=!1,pe.decoder&&!de?(V=pe.decoder.write(V),pe.objectMode||V.length!==0?I(B,pe,V,!1):ce(B,pe)):I(B,pe,V,!1)}else q||(pe.reading=!1,ce(B,pe))}return!pe.ended&&(pe.length<pe.highWaterMark||pe.length===0)}function I(B,V,de,q){V.flowing&&V.length===0&&!V.sync?(V.awaitDrain=0,B.emit("data",de)):(V.length+=V.objectMode?1:de.length,q?V.buffer.unshift(de):V.buffer.push(de),V.needReadable&&ne(B)),ce(B,V)}function L(B,V){var de;return!o(V)&&typeof V!="string"&&V!==void 0&&!B.objectMode&&(de=new v("chunk",["string","Buffer","Uint8Array"],V)),de}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(B){x||(x=eoe().StringDecoder);var V=new x(B);this._readableState.decoder=V,this._readableState.encoding=this._readableState.decoder.encoding;for(var de=this._readableState.buffer.head,q="";de!==null;)q+=V.write(de.data),de=de.next;return this._readableState.buffer.clear(),q!==""&&this._readableState.buffer.push(q),this._readableState.length=q.length,this};var H=1073741824;function N(B){return B>=H?B=H:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function Y(B,V){return B<=0||V.length===0&&V.ended?0:V.objectMode?1:B!==B?V.flowing&&V.length?V.buffer.head.data.length:V.length:(B>V.highWaterMark&&(V.highWaterMark=N(B)),B<=V.length?B:V.ended?V.length:(V.needReadable=!0,0))}E.prototype.read=function(B){l("read",B),B=parseInt(B,10);var V=this._readableState,de=B;if(B!==0&&(V.emittedReadable=!1),B===0&&V.needReadable&&((V.highWaterMark!==0?V.length>=V.highWaterMark:V.length>0)||V.ended))return l("read: emitReadable",V.length,V.ended),V.length===0&&V.ended?le(this):ne(this),null;if(B=Y(B,V),B===0&&V.ended)return V.length===0&&le(this),null;var q=V.needReadable;l("need readable",q),(V.length===0||V.length-B<V.highWaterMark)&&(q=!0,l("length less than watermark",q)),V.ended||V.reading?(q=!1,l("reading or ended",q)):q&&(l("do read"),V.reading=!0,V.sync=!0,V.length===0&&(V.needReadable=!0),this._read(V.highWaterMark),V.sync=!1,V.reading||(B=Y(de,V)));var he;return B>0?he=oe(B,V):he=null,he===null?(V.needReadable=V.length<=V.highWaterMark,B=0):(V.length-=B,V.awaitDrain=0),V.length===0&&(V.ended||(V.needReadable=!0),de!==B&&V.ended&&le(this)),he!==null&&this.emit("data",he),he};function te(B,V){if(l("onEofChunk"),!V.ended){if(V.decoder){var de=V.decoder.end();de&&de.length&&(V.buffer.push(de),V.length+=V.objectMode?1:de.length)}V.ended=!0,V.sync?ne(B):(V.needReadable=!1,V.emittedReadable||(V.emittedReadable=!0,ee(B)))}}function ne(B){var V=B._readableState;l("emitReadable",V.needReadable,V.emittedReadable),V.needReadable=!1,V.emittedReadable||(l("emitReadable",V.flowing),V.emittedReadable=!0,process.nextTick(ee,B))}function ee(B){var V=B._readableState;l("emitReadable_",V.destroyed,V.length,V.ended),!V.destroyed&&(V.length||V.ended)&&(B.emit("readable"),V.emittedReadable=!1),V.needReadable=!V.flowing&&!V.ended&&V.length<=V.highWaterMark,W(B)}function ce(B,V){V.readingMore||(V.readingMore=!0,process.nextTick(Z,B,V))}function Z(B,V){for(;!V.reading&&!V.ended&&(V.length<V.highWaterMark||V.flowing&&V.length===0);){var de=V.length;if(l("maybeReadMore read 0"),B.read(0),de===V.length)break}V.readingMore=!1}E.prototype._read=function(B){S(this,new b("_read()"))},E.prototype.pipe=function(B,V){var de=this,q=this._readableState;switch(q.pipesCount){case 0:q.pipes=B;break;case 1:q.pipes=[q.pipes,B];break;default:q.pipes.push(B);break}q.pipesCount+=1,l("pipe count=%d opts=%j",q.pipesCount,V);var he=(!V||V.end!==!1)&&B!==null&&B!==process.stderr,pe=he?ae:rt;q.endEmitted?process.nextTick(pe):de.once("end",pe),B.on("unpipe",U);function U(T,X){l("onunpipe"),T===de&&X&&X.hasUnpiped===!1&&(X.hasUnpiped=!0,ge())}function ae(){l("onend"),B.end()}var ie=G(de);B.on("drain",ie);var ve=!1;function ge(){l("cleanup"),B.removeListener("close",Ce),B.removeListener("finish",_e),B.removeListener("drain",ie),B.removeListener("error",je),B.removeListener("unpipe",U),de.removeListener("end",ae),de.removeListener("end",rt),de.removeListener("data",fe),ve=!0,q.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&ie()}de.on("data",fe);function fe(T){l("ondata");var X=B.write(T);l("dest.write",X),X===!1&&((q.pipesCount===1&&q.pipes===B||q.pipesCount>1&&Oe(q.pipes,B)!==-1)&&!ve&&(l("false write response, pause",q.awaitDrain),q.awaitDrain++),de.pause())}function je(T){l("onerror",T),rt(),B.removeListener("error",je),t(B,"error")===0&&S(B,T)}P(B,"error",je);function Ce(){B.removeListener("finish",_e),rt()}B.once("close",Ce);function _e(){l("onfinish"),B.removeListener("close",Ce),rt()}B.once("finish",_e);function rt(){l("unpipe"),de.unpipe(B)}return B.emit("pipe",de),q.flowing||(l("pipe resume"),de.resume()),B};function G(B){return function(){var V=B._readableState;l("pipeOnDrain",V.awaitDrain),V.awaitDrain&&V.awaitDrain--,V.awaitDrain===0&&t(B,"data")&&(V.flowing=!0,W(B))}}E.prototype.unpipe=function(B){var V=this._readableState,de={hasUnpiped:!1};if(V.pipesCount===0)return this;if(V.pipesCount===1)return B&&B!==V.pipes?this:(B||(B=V.pipes),V.pipes=null,V.pipesCount=0,V.flowing=!1,B&&B.emit("unpipe",this,de),this);if(!B){var q=V.pipes,he=V.pipesCount;V.pipes=null,V.pipesCount=0,V.flowing=!1;for(var pe=0;pe<he;pe++)q[pe].emit("unpipe",this,{hasUnpiped:!1});return this}var U=Oe(V.pipes,B);return U===-1?this:(V.pipes.splice(U,1),V.pipesCount-=1,V.pipesCount===1&&(V.pipes=V.pipes[0]),B.emit("unpipe",this,de),this)},E.prototype.on=function(B,V){var de=a.prototype.on.call(this,B,V),q=this._readableState;return B==="data"?(q.readableListening=this.listenerCount("readable")>0,q.flowing!==!1&&this.resume()):B==="readable"&&!q.endEmitted&&!q.readableListening&&(q.readableListening=q.needReadable=!0,q.flowing=!1,q.emittedReadable=!1,l("on readable",q.length,q.reading),q.length?ne(this):q.reading||process.nextTick(Q,this)),de},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(B,V){var de=a.prototype.removeListener.call(this,B,V);return B==="readable"&&process.nextTick(J,this),de},E.prototype.removeAllListeners=function(B){var V=a.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&process.nextTick(J,this),V};function J(B){var V=B._readableState;V.readableListening=B.listenerCount("readable")>0,V.resumeScheduled&&!V.paused?V.flowing=!0:B.listenerCount("data")>0&&B.resume()}function Q(B){l("readable nexttick read 0"),B.read(0)}E.prototype.resume=function(){var B=this._readableState;return B.flowing||(l("resume"),B.flowing=!B.readableListening,_(this,B)),B.paused=!1,this};function _(B,V){V.resumeScheduled||(V.resumeScheduled=!0,process.nextTick(K,B,V))}function K(B,V){l("resume",V.reading),V.reading||B.read(0),V.resumeScheduled=!1,B.emit("resume"),W(B),V.flowing&&!V.reading&&B.read(0)}E.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function W(B){var V=B._readableState;for(l("flow",V.flowing);V.flowing&&B.read()!==null;);}E.prototype.wrap=function(B){var V=this,de=this._readableState,q=!1;B.on("end",function(){if(l("wrapped end"),de.decoder&&!de.ended){var U=de.decoder.end();U&&U.length&&V.push(U)}V.push(null)}),B.on("data",function(U){if(l("wrapped data"),de.decoder&&(U=de.decoder.write(U)),!(de.objectMode&&U==null)&&!(!de.objectMode&&(!U||!U.length))){var ae=V.push(U);ae||(q=!0,B.pause())}});for(var he in B)this[he]===void 0&&typeof B[he]=="function"&&(this[he]=(function(U){return function(){return B[U].apply(B,arguments)}})(he));for(var pe=0;pe<C.length;pe++)B.on(C[pe],this.emit.bind(this,C[pe]));return this._read=function(U){l("wrapped _read",U),q&&(q=!1,B.resume())},this},typeof Symbol=="function"&&(E.prototype[Symbol.asyncIterator]=function(){return w===void 0&&(w=rst()),w(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(B){this._readableState&&(this._readableState.flowing=B)}}),E._fromList=oe,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function oe(B,V){if(V.length===0)return null;var de;return V.objectMode?de=V.buffer.shift():!B||B>=V.length?(V.decoder?de=V.buffer.join(""):V.buffer.length===1?de=V.buffer.first():de=V.buffer.concat(V.length),V.buffer.clear()):de=V.buffer.consume(B,V.decoder),de}function le(B){var V=B._readableState;l("endReadable",V.endEmitted),V.endEmitted||(V.ended=!0,process.nextTick(be,V,B))}function be(B,V){if(l("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,V.readable=!1,V.emit("end"),B.autoDestroy)){var de=V._writableState;(!de||de.autoDestroy&&de.finished)&&V.destroy()}}typeof Symbol=="function"&&(E.from=function(B,V){return z===void 0&&(z=nst()),z(E,B,V)});function Oe(B,V){for(var de=0,q=B.length;de<q;de++)if(B[de]===V)return de;return-1}return TR}var BR,soe;function loe(){if(soe)return BR;soe=1,BR=s;var e=hb().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,a=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=e.ERR_TRANSFORM_WITH_LENGTH_0,i=mb();function o(u,d){var h=this._transformState;h.transforming=!1;var m=h.writecb;if(m===null)return this.emit("error",new a);h.writechunk=null,h.writecb=null,d!=null&&this.push(d),m(u);var v=this._readableState;v.reading=!1,(v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}function s(u){if(!(this instanceof s))return new s(u);i.call(this,u),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",l)}function l(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,h){c(u,d,h)}):c(this,null,null)}s.prototype.push=function(u,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,u,d)},s.prototype._transform=function(u,d,h){h(new t("_transform()"))},s.prototype._write=function(u,d,h){var m=this._transformState;if(m.writecb=h,m.writechunk=u,m.writeencoding=d,!m.transforming){var v=this._readableState;(m.needTransform||v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}},s.prototype._read=function(u){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},s.prototype._destroy=function(u,d){i.prototype._destroy.call(this,u,function(h){d(h)})};function c(u,d,h){if(d)return u.emit("error",d);if(h!=null&&u.push(h),u._writableState.length)throw new n;if(u._transformState.transforming)throw new r;return u.push(null)}return BR}var ER,coe;function ist(){if(coe)return ER;coe=1,ER=t;var e=loe();function t(a){if(!(this instanceof t))return new t(a);e.call(this,a)}return t.prototype._transform=function(a,r,n){n(null,a)},ER}var RR,uoe;function ost(){if(uoe)return RR;uoe=1;var e;function t(h){var m=!1;return function(){m||(m=!0,h.apply(void 0,arguments))}}var a=hb().codes,r=a.ERR_MISSING_ARGS,n=a.ERR_STREAM_DESTROYED;function i(h){if(h)throw h}function o(h){return h.setHeader&&typeof h.abort=="function"}function s(h,m,v,f){f=t(f);var b=!1;h.on("close",function(){b=!0}),e===void 0&&(e=AR()),e(h,{readable:m,writable:v},function(x){if(x)return f(x);b=!0,f()});var k=!1;return function(x){if(!b&&!k){if(k=!0,o(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();f(x||new n("pipe"))}}}function l(h){h()}function c(h,m){return h.pipe(m)}function u(h){return!h.length||typeof h[h.length-1]!="function"?i:h.pop()}function d(){for(var h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];var f=u(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var b,k=m.map(function(x,w){var z=w<m.length-1,S=w>0;return s(x,z,S,function(C){b||(b=C),C&&k.forEach(l),!z&&(k.forEach(l),f(b))})});return m.reduce(c)}return RR=d,RR}var doe;function poe(){return doe||(doe=1,(function(e,t){t=e.exports=ooe(),t.Stream=t,t.Readable=t,t.Writable=Zie(),t.Duplex=mb(),t.Transform=loe(),t.PassThrough=ist(),t.finished=AR(),t.pipeline=ost()})(vR,vR.exports)),vR.exports}var hoe;function moe(){if(hoe)return xC;hoe=1;var e=Bie(),t=cB(),a=poe(),r=xC.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},n=xC.IncomingMessage=function(i,o,s,l){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){process.nextTick(function(){c.emit("close")})}),s==="fetch"){let f=function(){d.read().then(function(b){if(!c._destroyed){if(l(b.done),b.done){c.push(null);return}c.push(Buffer.from(b.value)),f()}}).catch(function(b){l(!0),c._destroyed||c.emit("error",b)})};if(c._fetchResponse=o,c.url=o.url,c.statusCode=o.status,c.statusMessage=o.statusText,o.headers.forEach(function(b,k){c.headers[k.toLowerCase()]=b,c.rawHeaders.push(k,b)}),e.writableStream){var u=new WritableStream({write:function(b){return l(!1),new Promise(function(k,x){c._destroyed?x():c.push(Buffer.from(b))?k():c._resumeFetch=k})},close:function(){l(!0),c._destroyed||c.push(null)},abort:function(b){l(!0),c._destroyed||c.emit("error",b)}});try{o.body.pipeTo(u).catch(function(b){l(!0),c._destroyed||c.emit("error",b)});return}catch{}}var d=o.body.getReader();f()}else{c._xhr=i,c._pos=0,c.url=i.responseURL,c.statusCode=i.status,c.statusMessage=i.statusText;var h=i.getAllResponseHeaders().split(/\r?\n/);if(h.forEach(function(f){var b=f.match(/^([^:]+):\s*(.*)/);if(b){var k=b[1].toLowerCase();k==="set-cookie"?(c.headers[k]===void 0&&(c.headers[k]=[]),c.headers[k].push(b[2])):c.headers[k]!==void 0?c.headers[k]+=", "+b[2]:c.headers[k]=b[2],c.rawHeaders.push(b[1],b[2])}}),c._charset="x-user-defined",!e.overrideMimeType){var m=c.rawHeaders["mime-type"];if(m){var v=m.match(/;\s*charset=([^;])(;|$)/);v&&(c._charset=v[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};return t(n,a.Readable),n.prototype._read=function(){var i=this,o=i._resumeFetch;o&&(i._resumeFetch=null,o())},n.prototype._onXHRProgress=function(i){var o=this,s=o._xhr,l=null;switch(o._mode){case"text":if(l=s.responseText,l.length>o._pos){var c=l.substr(o._pos);if(o._charset==="x-user-defined"){for(var u=Buffer.alloc(c.length),d=0;d<c.length;d++)u[d]=c.charCodeAt(d)&255;o.push(u)}else o.push(c,o._charset);o._pos=l.length}break;case"arraybuffer":if(s.readyState!==r.DONE||!s.response)break;l=s.response,o.push(Buffer.from(new Uint8Array(l)));break;case"moz-chunked-arraybuffer":if(l=s.response,s.readyState!==r.LOADING||!l)break;o.push(Buffer.from(new Uint8Array(l)));break;case"ms-stream":if(l=s.response,s.readyState!==r.LOADING)break;var h=new globalThis.MSStreamReader;h.onprogress=function(){h.result.byteLength>o._pos&&(o.push(Buffer.from(new Uint8Array(h.result.slice(o._pos)))),o._pos=h.result.byteLength)},h.onload=function(){i(!0),o.push(null)},h.readAsArrayBuffer(l);break}o._xhr.readyState===r.DONE&&o._mode!=="ms-stream"&&(i(!0),o.push(null))},xC}var goe;function sst(){if(goe)return fR.exports;goe=1;var e=Bie(),t=cB(),a=moe(),r=poe(),n=a.IncomingMessage,i=a.readyStates;function o(u,d){return e.fetch&&d?"fetch":e.mozchunkedarraybuffer?"moz-chunked-arraybuffer":e.msstream?"ms-stream":e.arraybuffer&&u?"arraybuffer":"text"}var s=fR.exports=function(u){var d=this;r.Writable.call(d),d._opts=u,d._body=[],d._headers={},u.auth&&d.setHeader("Authorization","Basic "+Buffer.from(u.auth).toString("base64")),Object.keys(u.headers).forEach(function(v){d.setHeader(v,u.headers[v])});var h,m=!0;if(u.mode==="disable-fetch"||"requestTimeout"in u&&!e.abortController)m=!1,h=!0;else if(u.mode==="prefer-streaming")h=!1;else if(u.mode==="allow-wrong-content-type")h=!e.overrideMimeType;else if(!u.mode||u.mode==="default"||u.mode==="prefer-fast")h=!0;else throw new Error("Invalid value for opts.mode");d._mode=o(h,m),d._fetchTimer=null,d._socketTimeout=null,d._socketTimer=null,d.on("finish",function(){d._onFinish()})};t(s,r.Writable),s.prototype.setHeader=function(u,d){var h=this,m=u.toLowerCase();c.indexOf(m)===-1&&(h._headers[m]={name:u,value:d})},s.prototype.getHeader=function(u){var d=this._headers[u.toLowerCase()];return d?d.value:null},s.prototype.removeHeader=function(u){var d=this;delete d._headers[u.toLowerCase()]},s.prototype._onFinish=function(){var u=this;if(!u._destroyed){var d=u._opts;"timeout"in d&&d.timeout!==0&&u.setTimeout(d.timeout);var h=u._headers,m=null;d.method!=="GET"&&d.method!=="HEAD"&&(m=new Blob(u._body,{type:(h["content-type"]||{}).value||""}));var v=[];if(Object.keys(h).forEach(function(x){var w=h[x].name,z=h[x].value;Array.isArray(z)?z.forEach(function(S){v.push([w,S])}):v.push([w,z])}),u._mode==="fetch"){var f=null;if(e.abortController){var b=new AbortController;f=b.signal,u._fetchAbortController=b,"requestTimeout"in d&&d.requestTimeout!==0&&(u._fetchTimer=globalThis.setTimeout(function(){u.emit("requestTimeout"),u._fetchAbortController&&u._fetchAbortController.abort()},d.requestTimeout))}globalThis.fetch(u._opts.url,{method:u._opts.method,headers:v,body:m||void 0,mode:"cors",credentials:d.withCredentials?"include":"same-origin",signal:f}).then(function(x){u._fetchResponse=x,u._resetTimers(!1),u._connect()},function(x){u._resetTimers(!0),u._destroyed||u.emit("error",x)})}else{var k=u._xhr=new globalThis.XMLHttpRequest;try{k.open(u._opts.method,u._opts.url,!0)}catch(x){process.nextTick(function(){u.emit("error",x)});return}"responseType"in k&&(k.responseType=u._mode),"withCredentials"in k&&(k.withCredentials=!!d.withCredentials),u._mode==="text"&&"overrideMimeType"in k&&k.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in d&&(k.timeout=d.requestTimeout,k.ontimeout=function(){u.emit("requestTimeout")}),v.forEach(function(x){k.setRequestHeader(x[0],x[1])}),u._response=null,k.onreadystatechange=function(){switch(k.readyState){case i.LOADING:case i.DONE:u._onXHRProgress();break}},u._mode==="moz-chunked-arraybuffer"&&(k.onprogress=function(){u._onXHRProgress()}),k.onerror=function(){u._destroyed||(u._resetTimers(!0),u.emit("error",new Error("XHR error")))};try{k.send(m)}catch(x){process.nextTick(function(){u.emit("error",x)});return}}}};function l(u){try{var d=u.status;return d!==null&&d!==0}catch{return!1}}s.prototype._onXHRProgress=function(){var u=this;u._resetTimers(!1),!(!l(u._xhr)||u._destroyed)&&(u._response||u._connect(),u._response._onXHRProgress(u._resetTimers.bind(u)))},s.prototype._connect=function(){var u=this;u._destroyed||(u._response=new n(u._xhr,u._fetchResponse,u._mode,u._resetTimers.bind(u)),u._response.on("error",function(d){u.emit("error",d)}),u.emit("response",u._response))},s.prototype._write=function(u,d,h){var m=this;m._body.push(u),h()},s.prototype._resetTimers=function(u){var d=this;globalThis.clearTimeout(d._socketTimer),d._socketTimer=null,u?(globalThis.clearTimeout(d._fetchTimer),d._fetchTimer=null):d._socketTimeout&&(d._socketTimer=globalThis.setTimeout(function(){d.emit("timeout")},d._socketTimeout))},s.prototype.abort=s.prototype.destroy=function(u){var d=this;d._destroyed=!0,d._resetTimers(!0),d._response&&(d._response._destroyed=!0),d._xhr?d._xhr.abort():d._fetchAbortController&&d._fetchAbortController.abort(),u&&d.emit("error",u)},s.prototype.end=function(u,d,h){var m=this;typeof u=="function"&&(h=u,u=void 0),r.Writable.prototype.end.call(m,u,d,h)},s.prototype.setTimeout=function(u,d){var h=this;d&&h.once("timeout",d),h._socketTimeout=u,h._resetTimers(!1)},s.prototype.flushHeaders=function(){},s.prototype.setNoDelay=function(){},s.prototype.setSocketKeepAlive=function(){};var c=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return fR.exports}var _R,foe;function lst(){if(foe)return _R;foe=1,_R=t;var e=Object.prototype.hasOwnProperty;function t(){for(var a={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)e.call(n,i)&&(a[i]=n[i])}return a}return _R}var voe,boe;function cst(){return boe||(boe=1,voe={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),voe}var yoe;function ust(){return yoe||(yoe=1,(function(e){var t=sst(),a=moe(),r=lst(),n=cst(),i=aR(),o=e;o.request=function(s,l){typeof s=="string"?s=i.parse(s):s=r(s);var c=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",u=s.protocol||c,d=s.hostname||s.host,h=s.port,m=s.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),s.url=(d?u+"//"+d:"")+(h?":"+h:"")+m,s.method=(s.method||"GET").toUpperCase(),s.headers=s.headers||{};var v=new t(s);return l&&v.on("response",l),v},o.get=function(s,l){var c=o.request(s,l);return c.end(),c},o.ClientRequest=t,o.IncomingMessage=a.IncomingMessage,o.Agent=function(){},o.Agent.defaultMaxSockets=4,o.globalAgent=new o.Agent,o.STATUS_CODES=n,o.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})(Aie)),Aie}var koe,xoe;function dst(){return xoe||(xoe=1,koe={statusCodes:Object.assign({},{default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"},ust().STATUS_CODES)}),koe}const pst="7.0.8",hst={version:pst};var LR,woe;function mst(){if(woe)return LR;woe=1;const e=pb,t=aR(),a=qot(),r=pb,n=pb,i=yC(),o=i.jptr,s=sR().isRef,l=kC().clone,c=kC().circularClone,u=uR().recurse,d=Wot(),h=Zot(),m=Cie(),v=dst().statusCodes,f=hst.version,b="3.0.0";let k;class x extends Error{constructor(V){super(V),this.name="S2OError"}}function w(B,V){let de=new x(B);if(de.options=V,V.promise)V.promise.reject(de);else throw de}function z(B,V,de){de.warnOnly?V[de.warnProperty||"x-s2o-warning"]=B:w(B,de)}function S(B,V,de){if(B.nullable&&de.patches++,B.discriminator&&typeof B.discriminator=="string"&&(B.discriminator={propertyName:B.discriminator}),B.items&&Array.isArray(B.items)&&(B.items.length===0?B.items={}:B.items.length===1?B.items=B.items[0]:B.items={anyOf:B.items}),B.type&&Array.isArray(B.type))if(de.patch){if(de.patches++,B.type.length===0)delete B.type;else{B.oneOf||(B.oneOf=[]);for(let q of B.type){let he={};if(q==="null")B.nullable=!0;else{he.type=q;for(let pe of m.arrayProperties)typeof B.prop<"u"&&(he[pe]=B[pe],delete B[pe])}he.type&&B.oneOf.push(he)}delete B.type,B.oneOf.length===0?delete B.oneOf:B.oneOf.length<2&&(B.type=B.oneOf[0].type,Object.keys(B.oneOf[0]).length>1&&z("Lost properties from oneOf",B,de),delete B.oneOf)}B.type&&Array.isArray(B.type)&&B.type.length===1&&(B.type=B.type[0])}else w("(Patchable) schema type must not be an array",de);B.type&&B.type==="null"&&(delete B.type,B.nullable=!0),B.type==="array"&&!B.items&&(B.items={}),B.type==="file"&&(B.type="string",B.format="binary"),typeof B.required=="boolean"&&(B.required&&B.name&&(typeof V.required>"u"&&(V.required=[]),Array.isArray(V.required)&&V.required.push(B.name)),delete B.required),B.xml&&typeof B.xml.namespace=="string"&&(B.xml.namespace||delete B.xml.namespace),typeof B.allowEmptyValue<"u"&&(de.patches++,delete B.allowEmptyValue)}function C(B,V){if(B["x-required"]&&Array.isArray(B["x-required"])&&(B.required||(B.required=[]),B.required=B.required.concat(B["x-required"]),delete B["x-required"]),B["x-anyOf"]&&(B.anyOf=B["x-anyOf"],delete B["x-anyOf"]),B["x-oneOf"]&&(B.oneOf=B["x-oneOf"],delete B["x-oneOf"]),B["x-not"]&&(B.not=B["x-not"],delete B["x-not"]),typeof B["x-nullable"]=="boolean"&&(B.nullable=B["x-nullable"],delete B["x-nullable"]),typeof B["x-discriminator"]=="object"&&typeof B["x-discriminator"].propertyName=="string"){B.discriminator=B["x-discriminator"],delete B["x-discriminator"];for(let de in B.discriminator.mapping){let q=B.discriminator.mapping[de];q.startsWith("#/definitions/")&&(B.discriminator.mapping[de]=q.replace("#/definitions/","#/components/schemas/"))}}}function P(B,V){h.walkSchema(B,{},{},function(de,q,he){C(de),S(de,q,V)})}function M(B){return B.indexOf("#")>=0?B=B.split("#")[1].split("/").pop():B=B.split("/").pop().split(".")[0],encodeURIComponent(m.sanitise(B))}function E(B,V,de){let q=de.payload.options;if(s(B,V)){if(!B[V].startsWith("#/components/")){if(B[V]==="#/consumes")delete B[V],de.parent[de.pkey]=l(q.openapi.consumes);else if(B[V]==="#/produces")delete B[V],de.parent[de.pkey]=l(q.openapi.produces);else if(B[V].startsWith("#/definitions/")){let he=B[V].replace("#/definitions/","").split("/");const pe=i.jpunescape(he[0]);let U=k.schemas[decodeURIComponent(pe)];U?he[0]=U:z("Could not resolve reference "+B[V],B,q),B[V]="#/components/schemas/"+he.join("/")}else if(B[V].startsWith("#/parameters/"))B[V]="#/components/parameters/"+m.sanitise(B[V].replace("#/parameters/",""));else if(B[V].startsWith("#/responses/"))B[V]="#/components/responses/"+m.sanitise(B[V].replace("#/responses/",""));else if(B[V].startsWith("#")){let he=l(i.jptr(q.openapi,B[V]));if(he===!1)z("direct $ref not found "+B[V],B,q);else if(q.refmap[B[V]])B[V]=q.refmap[B[V]];else{let pe=B[V];pe=pe.replace("/properties/headers/",""),pe=pe.replace("/properties/responses/",""),pe=pe.replace("/properties/parameters/",""),pe=pe.replace("/properties/schemas/","");let U="schemas",ae=pe.lastIndexOf("/schema");if(U=pe.indexOf("/headers/")>ae?"headers":pe.indexOf("/responses/")>ae?"responses":pe.indexOf("/example")>ae?"examples":pe.indexOf("/x-")>ae?"extensions":pe.indexOf("/parameters/")>ae?"parameters":"schemas",U==="schemas"&&P(he,q),U!=="responses"&&U!=="extensions"){let ie=U.substr(0,U.length-1);ie==="parameter"&&he.name&&he.name===m.sanitise(he.name)&&(ie=encodeURIComponent(he.name));let ve=1;for(B["x-miro"]&&(ie=M(B["x-miro"]),ve="");i.jptr(q.openapi,"#/components/"+U+"/"+ie+ve);)ve=ve===""?2:++ve;let ge="#/components/"+U+"/"+ie+ve,fe="";U==="examples"&&(he={value:he},fe="/value"),i.jptr(q.openapi,ge,he),q.refmap[B[V]]=ge+fe,B[V]=ge+fe}}}}if(delete B["x-miro"],Object.keys(B).length>1){const he=B[V],pe=de.path.indexOf("/schema")>=0;q.refSiblings==="preserve"||(pe&&q.refSiblings==="allOf"?(delete B.$ref,de.parent[de.pkey]={allOf:[{$ref:he},B]}):de.parent[de.pkey]={$ref:he})}}if(V==="x-ms-odata"&&typeof B[V]=="string"&&B[V].startsWith("#/")){let he=B[V].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),pe=k.schemas[decodeURIComponent(he[0])];pe?he[0]=pe:z("Could not resolve reference "+B[V],B,q),B[V]="#/components/schemas/"+he.join("/")}}function D(B,V){for(let de in V.refmap)i.jptr(B,de,{$ref:V.refmap[de]})}function I(B){for(let V in B)for(let de in B[V]){let q=m.sanitise(de);de!==q&&(B[V][q]=B[V][de],delete B[V][de])}}function L(B,V){if(B.type==="basic"&&(B.type="http",B.scheme="basic"),B.type==="oauth2"){let de={},q=B.flow;B.flow==="application"&&(q="clientCredentials"),B.flow==="accessCode"&&(q="authorizationCode"),typeof B.authorizationUrl<"u"&&(de.authorizationUrl=B.authorizationUrl.split("?")[0].trim()||"/"),typeof B.tokenUrl=="string"&&(de.tokenUrl=B.tokenUrl.split("?")[0].trim()||"/"),de.scopes=B.scopes||{},B.flows={},B.flows[q]=de,delete B.flow,delete B.authorizationUrl,delete B.tokenUrl,delete B.scopes,typeof B.name<"u"&&(V.patch?(V.patches++,delete B.name):w("(Patchable) oauth2 securitySchemes should not have name property",V))}}function H(B){return B&&!B["x-s2o-delete"]}function N(B,V){if(B.$ref)B.$ref=B.$ref.replace("#/responses/","#/components/responses/");else{B.type&&!B.schema&&(B.schema={}),B.type&&(B.schema.type=B.type),B.items&&B.items.type!=="array"&&(B.items.collectionFormat!==B.collectionFormat&&z("Nested collectionFormats are not supported",B,V),delete B.items.collectionFormat),B.type==="array"?(B.collectionFormat==="ssv"?z("collectionFormat:ssv is no longer supported for headers",B,V):B.collectionFormat==="pipes"?z("collectionFormat:pipes is no longer supported for headers",B,V):B.collectionFormat==="multi"?B.explode=!0:B.collectionFormat==="tsv"?(z("collectionFormat:tsv is no longer supported",B,V),B["x-collectionFormat"]="tsv"):B.style="simple",delete B.collectionFormat):B.collectionFormat&&(V.patch?(V.patches++,delete B.collectionFormat):w("(Patchable) collectionFormat is only applicable to header.type array",V)),delete B.type;for(let de of m.parameterTypeProperties)typeof B[de]<"u"&&(B.schema[de]=B[de],delete B[de]);for(let de of m.arrayProperties)typeof B[de]<"u"&&(B.schema[de]=B[de],delete B[de])}}function Y(B,V){if(B.$ref.indexOf("#/parameters/")>=0){let de=B.$ref.split("#/parameters/");B.$ref=de[0]+"#/components/parameters/"+m.sanitise(de[1])}B.$ref.indexOf("#/definitions/")>=0&&z("Definition used as parameter",B,V)}function te(B,V){let de={};for(let q of Object.keys(B))de[q]=B[q],q==="parameters"&&(de.requestBody={},V.rbname&&(de[V.rbname]=""));return de.requestBody={},de}function ne(B,V,de,q,he,pe,U){let ae={},ie=!0,ve;if(V&&V.consumes&&typeof V.consumes=="string")if(U.patch)U.patches++,V.consumes=[V.consumes];else return w("(Patchable) operation.consumes must be an array",U);Array.isArray(pe.consumes)||delete pe.consumes;let ge=((V?V.consumes:null)||pe.consumes||[]).filter(m.uniqueOnly);if(B&&B.$ref&&typeof B.$ref=="string"){Y(B,U);let fe=decodeURIComponent(B.$ref.replace("#/components/parameters/","")),je=!1,Ce=pe.components.parameters[fe];if((!Ce||Ce["x-s2o-delete"])&&B.$ref.startsWith("#/")&&(B["x-s2o-delete"]=!0,je=!0),je){let _e=B.$ref,rt=o(pe,B.$ref);!rt&&_e.startsWith("#/")?z("Could not resolve reference "+_e,B,U):rt&&(B=rt)}}if(B&&(B.name||B.in)){typeof B["x-deprecated"]=="boolean"&&(B.deprecated=B["x-deprecated"],delete B["x-deprecated"]),typeof B["x-example"]<"u"&&(B.example=B["x-example"],delete B["x-example"]),B.in!=="body"&&!B.type&&(U.patch?(U.patches++,B.type="string"):w("(Patchable) parameter.type is mandatory for non-body parameters",U)),B.type&&typeof B.type=="object"&&B.type.$ref&&(B.type=o(pe,B.type.$ref)),B.type==="file"&&(B["x-s2o-originalType"]=B.type,ve=B.type),B.description&&typeof B.description=="object"&&B.description.$ref&&(B.description=o(pe,B.description.$ref)),B.description===null&&delete B.description;let fe=B.collectionFormat;if(B.type==="array"&&!fe&&(fe="csv"),fe&&(B.type!=="array"&&(U.patch?(U.patches++,delete B.collectionFormat):w("(Patchable) collectionFormat is only applicable to param.type array",U)),fe==="csv"&&(B.in==="query"||B.in==="cookie")&&(B.style="form",B.explode=!1),fe==="csv"&&(B.in==="path"||B.in==="header")&&(B.style="simple"),fe==="ssv"&&(B.in==="query"?B.style="spaceDelimited":z("collectionFormat:ssv is no longer supported except for in:query parameters",B,U)),fe==="pipes"&&(B.in==="query"?B.style="pipeDelimited":z("collectionFormat:pipes is no longer supported except for in:query parameters",B,U)),fe==="multi"&&(B.explode=!0),fe==="tsv"&&(z("collectionFormat:tsv is no longer supported",B,U),B["x-collectionFormat"]="tsv"),delete B.collectionFormat),B.type&&B.type!=="body"&&B.in!=="formData")if(B.items&&B.schema)z("parameter has array,items and schema",B,U);else{B.schema&&U.patches++,(!B.schema||typeof B.schema!="object")&&(B.schema={}),B.schema.type=B.type,B.items&&(B.schema.items=B.items,delete B.items,u(B.schema.items,null,function(je,Ce,_e){Ce==="collectionFormat"&&typeof je[Ce]=="string"&&(fe&&je[Ce]!==fe&&z("Nested collectionFormats are not supported",B,U),delete je[Ce])}));for(let je of m.parameterTypeProperties)typeof B[je]<"u"&&(B.schema[je]=B[je]),delete B[je]}B.schema&&P(B.schema,U),B["x-ms-skip-url-encoding"]&&B.in==="query"&&(B.allowReserved=!0,delete B["x-ms-skip-url-encoding"])}if(B&&B.in==="formData"){ie=!1,ae.content={};let fe="application/x-www-form-urlencoded";if(ge.length&&ge.indexOf("multipart/form-data")>=0&&(fe="multipart/form-data"),ae.content[fe]={},B.schema)ae.content[fe].schema=B.schema,B.schema.$ref&&(ae["x-s2o-name"]=decodeURIComponent(B.schema.$ref.replace("#/components/schemas/","")));else{ae.content[fe].schema={},ae.content[fe].schema.type="object",ae.content[fe].schema.properties={},ae.content[fe].schema.properties[B.name]={};let je=ae.content[fe].schema,Ce=ae.content[fe].schema.properties[B.name];B.description&&(Ce.description=B.description),B.example&&(Ce.example=B.example),B.type&&(Ce.type=B.type);for(let _e of m.parameterTypeProperties)typeof B[_e]<"u"&&(Ce[_e]=B[_e]);B.required===!0&&(je.required||(je.required=[]),je.required.push(B.name),ae.required=!0),typeof B.default<"u"&&(Ce.default=B.default),Ce.properties&&(Ce.properties=B.properties),B.allOf&&(Ce.allOf=B.allOf),B.type==="array"&&B.items&&(Ce.items=B.items,Ce.items.collectionFormat&&delete Ce.items.collectionFormat),(ve==="file"||B["x-s2o-originalType"]==="file")&&(Ce.type="string",Ce.format="binary"),ee(B,Ce)}}else B&&B.type==="file"&&(B.required&&(ae.required=B.required),ae.content={},ae.content["application/octet-stream"]={},ae.content["application/octet-stream"].schema={},ae.content["application/octet-stream"].schema.type="string",ae.content["application/octet-stream"].schema.format="binary",ee(B,ae));if(B&&B.in==="body"){ae.content={},B.name&&(ae["x-s2o-name"]=(V&&V.operationId?m.sanitiseAll(V.operationId):"")+("_"+B.name).toCamelCase()),B.description&&(ae.description=B.description),B.required&&(ae.required=B.required),V&&U.rbname&&B.name&&(V[U.rbname]=B.name),B.schema&&B.schema.$ref?ae["x-s2o-name"]=decodeURIComponent(B.schema.$ref.replace("#/components/schemas/","")):B.schema&&B.schema.type==="array"&&B.schema.items&&B.schema.items.$ref&&(ae["x-s2o-name"]=decodeURIComponent(B.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),ge.length||ge.push("application/json");for(let fe of ge)ae.content[fe]={},ae.content[fe].schema=l(B.schema||{}),P(ae.content[fe].schema,U);ee(B,ae)}if(Object.keys(ae).length>0&&(B["x-s2o-delete"]=!0,V))if(V.requestBody&&ie){V.requestBody["x-s2o-overloaded"]=!0;let fe=V.operationId||he;z("Operation "+fe+" has multiple requestBodies",V,U)}else V.requestBody||(V=de[q]=te(V,U)),V.requestBody.content&&V.requestBody.content["multipart/form-data"]&&V.requestBody.content["multipart/form-data"].schema&&V.requestBody.content["multipart/form-data"].schema.properties&&ae.content["multipart/form-data"]&&ae.content["multipart/form-data"].schema&&ae.content["multipart/form-data"].schema.properties?(V.requestBody.content["multipart/form-data"].schema.properties=Object.assign(V.requestBody.content["multipart/form-data"].schema.properties,ae.content["multipart/form-data"].schema.properties),V.requestBody.content["multipart/form-data"].schema.required=(V.requestBody.content["multipart/form-data"].schema.required||[]).concat(ae.content["multipart/form-data"].schema.required||[]),V.requestBody.content["multipart/form-data"].schema.required.length||delete V.requestBody.content["multipart/form-data"].schema.required):V.requestBody.content&&V.requestBody.content["application/x-www-form-urlencoded"]&&V.requestBody.content["application/x-www-form-urlencoded"].schema&&V.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&ae.content["application/x-www-form-urlencoded"]&&ae.content["application/x-www-form-urlencoded"].schema&&ae.content["application/x-www-form-urlencoded"].schema.properties?(V.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(V.requestBody.content["application/x-www-form-urlencoded"].schema.properties,ae.content["application/x-www-form-urlencoded"].schema.properties),V.requestBody.content["application/x-www-form-urlencoded"].schema.required=(V.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(ae.content["application/x-www-form-urlencoded"].schema.required||[]),V.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete V.requestBody.content["application/x-www-form-urlencoded"].schema.required):(V.requestBody=Object.assign(V.requestBody,ae),V.requestBody["x-s2o-name"]||(V.requestBody.schema&&V.requestBody.schema.$ref?V.requestBody["x-s2o-name"]=decodeURIComponent(V.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):V.operationId&&(V.requestBody["x-s2o-name"]=m.sanitiseAll(V.operationId))));if(B&&!B["x-s2o-delete"]){delete B.type;for(let fe of m.parameterTypeProperties)delete B[fe];B.in==="path"&&(typeof B.required>"u"||B.required!==!0)&&(U.patch?(U.patches++,B.required=!0):w("(Patchable) path parameters must be required:true ["+B.name+" in "+he+"]",U))}return V}function ee(B,V){for(let de in B)de.startsWith("x-")&&!de.startsWith("x-s2o")&&(V[de]=B[de])}function ce(B,V,de,q,he){if(!B)return!1;if(B.$ref&&typeof B.$ref=="string")B.$ref.indexOf("#/definitions/")>=0?z("definition used as response: "+B.$ref,B,he):B.$ref.startsWith("#/responses/")&&(B.$ref="#/components/responses/"+m.sanitise(decodeURIComponent(B.$ref.replace("#/responses/",""))));else{if((typeof B.description>"u"||B.description===null||B.description===""&&he.patch)&&(he.patch?typeof B=="object"&&!Array.isArray(B)&&(he.patches++,B.description=v[B]||""):w("(Patchable) response.description is mandatory",he)),typeof B.schema<"u"){if(P(B.schema,he),B.schema.$ref&&typeof B.schema.$ref=="string"&&B.schema.$ref.startsWith("#/responses/")&&(B.schema.$ref="#/components/responses/"+m.sanitise(decodeURIComponent(B.schema.$ref.replace("#/responses/","")))),de&&de.produces&&typeof de.produces=="string")if(he.patch)he.patches++,de.produces=[de.produces];else return w("(Patchable) operation.produces must be an array",he);q.produces&&!Array.isArray(q.produces)&&delete q.produces;let pe=((de?de.produces:null)||q.produces||[]).filter(m.uniqueOnly);pe.length||pe.push("*/*"),B.content={};for(let U of pe){if(B.content[U]={},B.content[U].schema=l(B.schema),B.examples&&B.examples[U]){let ae={};ae.value=B.examples[U],B.content[U].examples={},B.content[U].examples.response=ae,delete B.examples[U]}B.content[U].schema.type==="file"&&(B.content[U].schema={type:"string",format:"binary"})}delete B.schema}for(let pe in B.examples)B.content||(B.content={}),B.content[pe]||(B.content[pe]={}),B.content[pe].examples={},B.content[pe].examples.response={},B.content[pe].examples.response.value=B.examples[pe];if(delete B.examples,B.headers)for(let pe in B.headers)pe.toLowerCase()==="status code"?he.patch?(he.patches++,delete B.headers[pe]):w('(Patchable) "Status Code" is not a valid header',he):N(B.headers[pe],he)}}function Z(B,V,de,q,he){for(let pe in B){let U=B[pe];U&&U["x-trace"]&&typeof U["x-trace"]=="object"&&(U.trace=U["x-trace"],delete U["x-trace"]),U&&U["x-summary"]&&typeof U["x-summary"]=="string"&&(U.summary=U["x-summary"],delete U["x-summary"]),U&&U["x-description"]&&typeof U["x-description"]=="string"&&(U.description=U["x-description"],delete U["x-description"]),U&&U["x-servers"]&&Array.isArray(U["x-servers"])&&(U.servers=U["x-servers"],delete U["x-servers"]);for(let ae in U)if(m.httpMethods.indexOf(ae)>=0||ae==="x-amazon-apigateway-any-method"){let ie=U[ae];if(ie&&ie.parameters&&Array.isArray(ie.parameters)){if(U.parameters)for(let ve of U.parameters)typeof ve.$ref=="string"&&(Y(ve,de),ve=o(he,ve.$ref)),!ie.parameters.find(function(ge,fe,je){return ge.name===ve.name&&ge.in===ve.in})&&(ve.in==="formData"||ve.in==="body"||ve.type==="file")&&(ie=ne(ve,ie,U,ae,pe,he,de),de.rbname&&ie[de.rbname]===""&&delete ie[de.rbname]);for(let ve of ie.parameters)ie=ne(ve,ie,U,ae,ae+":"+pe,he,de);de.rbname&&ie[de.rbname]===""&&delete ie[de.rbname],de.debug||ie.parameters&&(ie.parameters=ie.parameters.filter(H))}if(ie&&ie.security&&I(ie.security),typeof ie=="object"){if(!ie.responses){let ve={};ve.description="Default response",ie.responses={default:ve}}for(let ve in ie.responses){let ge=ie.responses[ve];ce(ge,ve,ie,he,de)}}if(ie&&ie["x-servers"]&&Array.isArray(ie["x-servers"]))ie.servers=ie["x-servers"],delete ie["x-servers"];else if(ie&&ie.schemes&&ie.schemes.length){for(let ve of ie.schemes)if((!he.schemes||he.schemes.indexOf(ve)<0)&&(ie.servers||(ie.servers=[]),Array.isArray(he.servers)))for(let ge of he.servers){let fe=l(ge),je=t.parse(fe.url);je.protocol=ve,fe.url=je.format(),ie.servers.push(fe)}}if(de.debug&&(ie["x-s2o-consumes"]=ie.consumes||[],ie["x-s2o-produces"]=ie.produces||[]),ie){if(delete ie.consumes,delete ie.produces,delete ie.schemes,ie["x-ms-examples"]){for(let ve in ie["x-ms-examples"]){let ge=ie["x-ms-examples"][ve],fe=m.sanitiseAll(ve);if(ge.parameters)for(let je in ge.parameters){let Ce=ge.parameters[je];for(let _e of(ie.parameters||[]).concat(U.parameters||[]))_e.$ref&&(_e=i.jptr(he,_e.$ref)),_e.name===je&&!_e.example&&(_e.examples||(_e.examples={}),_e.examples[ve]={value:Ce})}if(ge.responses)for(let je in ge.responses){if(ge.responses[je].headers)for(let Ce in ge.responses[je].headers){let _e=ge.responses[je].headers[Ce];for(let rt in ie.responses[je].headers)if(rt===Ce){let T=ie.responses[je].headers[rt];T.example=_e}}if(ge.responses[je].body&&(he.components.examples[fe]={value:l(ge.responses[je].body)},ie.responses[je]&&ie.responses[je].content))for(let Ce in ie.responses[je].content){let _e=ie.responses[je].content[Ce];_e.examples||(_e.examples={}),_e.examples[ve]={$ref:"#/components/examples/"+fe}}}}delete ie["x-ms-examples"]}if(ie.parameters&&ie.parameters.length===0&&delete ie.parameters,ie.requestBody){let ve=ie.operationId?m.sanitiseAll(ie.operationId):m.sanitiseAll(ae+pe).toCamelCase(),ge=m.sanitise(ie.requestBody["x-s2o-name"]||ve||"");delete ie.requestBody["x-s2o-name"];let fe=JSON.stringify(ie.requestBody),je=m.hash(fe);if(!q[je]){let _e={};_e.name=ge,_e.body=ie.requestBody,_e.refs=[],q[je]=_e}let Ce="#/"+V+"/"+encodeURIComponent(i.jpescape(pe))+"/"+ae+"/requestBody";q[je].refs.push(Ce)}}}if(U&&U.parameters){for(let ae in U.parameters){let ie=U.parameters[ae];ne(ie,null,U,null,pe,he,de)}!de.debug&&Array.isArray(U.parameters)&&(U.parameters=U.parameters.filter(H))}}}function G(B,V){let de={};k={schemas:{}},B.security&&I(B.security);for(let he in B.components.securitySchemes){let pe=m.sanitise(he);he!==pe&&(B.components.securitySchemes[pe]&&w("Duplicate sanitised securityScheme name "+pe,V),B.components.securitySchemes[pe]=B.components.securitySchemes[he],delete B.components.securitySchemes[he]),L(B.components.securitySchemes[pe],V)}for(let he in B.components.schemas){let pe=m.sanitiseAll(he),U="";if(he!==pe){for(;B.components.schemas[pe+U];)U=U?++U:2;B.components.schemas[pe+U]=B.components.schemas[he],delete B.components.schemas[he]}k.schemas[he]=pe+U,P(B.components.schemas[pe+U],V)}V.refmap={},u(B,{payload:{options:V}},E),D(B,V);for(let he in B.components.parameters){let pe=m.sanitise(he);he!==pe&&(B.components.parameters[pe]&&w("Duplicate sanitised parameter name "+pe,V),B.components.parameters[pe]=B.components.parameters[he],delete B.components.parameters[he]);let U=B.components.parameters[pe];ne(U,null,null,null,pe,B,V)}for(let he in B.components.responses){let pe=m.sanitise(he);he!==pe&&(B.components.responses[pe]&&w("Duplicate sanitised response name "+pe,V),B.components.responses[pe]=B.components.responses[he],delete B.components.responses[he]);let U=B.components.responses[pe];if(ce(U,pe,null,B,V),U.headers)for(let ae in U.headers)ae.toLowerCase()==="status code"?V.patch?(V.patches++,delete U.headers[ae]):w('(Patchable) "Status Code" is not a valid header',V):N(U.headers[ae],V)}for(let he in B.components.requestBodies){let pe=B.components.requestBodies[he],U=JSON.stringify(pe),ae=m.hash(U),ie={};ie.name=he,ie.body=pe,ie.refs=[],de[ae]=ie}if(Z(B.paths,"paths",V,de,B),B["x-ms-paths"]&&Z(B["x-ms-paths"],"x-ms-paths",V,de,B),!V.debug)for(let he in B.components.parameters)B.components.parameters[he]["x-s2o-delete"]&&delete B.components.parameters[he];V.debug&&(B["x-s2o-consumes"]=B.consumes||[],B["x-s2o-produces"]=B.produces||[]),delete B.consumes,delete B.produces,delete B.schemes;let q=[];if(B.components.requestBodies={},!V.resolveInternal){let he=1;for(let pe in de){let U=de[pe];if(U.refs.length>1){let ae="";for(U.name||(U.name="requestBody",ae=he++);q.indexOf(U.name+ae)>=0;)ae=ae?++ae:2;U.name=U.name+ae,q.push(U.name),B.components.requestBodies[U.name]=l(U.body);for(let ie in U.refs){let ve={};ve.$ref="#/components/requestBodies/"+U.name,i.jptr(B,U.refs[ie],ve)}}}}return B.components.responses&&Object.keys(B.components.responses).length===0&&delete B.components.responses,B.components.parameters&&Object.keys(B.components.parameters).length===0&&delete B.components.parameters,B.components.examples&&Object.keys(B.components.examples).length===0&&delete B.components.examples,B.components.requestBodies&&Object.keys(B.components.requestBodies).length===0&&delete B.components.requestBodies,B.components.securitySchemes&&Object.keys(B.components.securitySchemes).length===0&&delete B.components.securitySchemes,B.components.headers&&Object.keys(B.components.headers).length===0&&delete B.components.headers,B.components.schemas&&Object.keys(B.components.schemas).length===0&&delete B.components.schemas,B.components&&Object.keys(B.components).length===0&&delete B.components,B}function J(B){return!B||!B.url||typeof B.url!="string"||(B.url=B.url.split("{{").join("{"),B.url=B.url.split("}}").join("}"),B.url.replace(/\{(.+?)\}/g,function(V,de){B.variables||(B.variables={}),B.variables[de]={default:"unknown"}})),B}function Q(B,V,de){if(typeof B.info>"u"||B.info===null)if(V.patch)V.patches++,B.info={version:"",title:""};else return de(new x("(Patchable) info object is mandatory"));if(typeof B.info!="object"||Array.isArray(B.info))return de(new x("info must be an object"));if(typeof B.info.title>"u"||B.info.title===null)if(V.patch)V.patches++,B.info.title="";else return de(new x("(Patchable) info.title cannot be null"));if(typeof B.info.version>"u"||B.info.version===null)if(V.patch)V.patches++,B.info.version="";else return de(new x("(Patchable) info.version cannot be null"));if(typeof B.info.version!="string")if(V.patch)V.patches++,B.info.version=B.info.version.toString();else return de(new x("(Patchable) info.version must be a string"));if(typeof B.info.logo<"u")if(V.patch)V.patches++,B.info["x-logo"]=B.info.logo,delete B.info.logo;else return de(new x("(Patchable) info should not have logo property"));if(typeof B.info.termsOfService<"u"){if(B.info.termsOfService===null)if(V.patch)V.patches++,B.info.termsOfService="";else return de(new x("(Patchable) info.termsOfService cannot be null"));try{new URL(B.info.termsOfService)}catch{if(V.patch)V.patches++,delete B.info.termsOfService;else return de(new x("(Patchable) info.termsOfService must be a URL"))}}}function _(B,V,de){if(typeof B.paths>"u")if(V.patch)V.patches++,B.paths={};else return de(new x("(Patchable) paths object is mandatory"))}function K(B,V){const de=new WeakSet;u(B,{identityDetection:!0},function(q,he,pe){typeof q[he]=="object"&&q[he]!==null&&(de.has(q[he])?V.anchors?q[he]=l(q[he]):w("YAML anchor or merge key at "+pe.path,V):de.add(q[he]))})}function W(B,V,de){return a(de,new Promise(function(q,he){if(B||(B={}),V.original=B,V.text||(V.text=n.stringify(B)),V.externals=[],V.externalRefs={},V.rewriteRefs=!0,V.preserveMiro=!0,V.promise={},V.promise.resolve=q,V.promise.reject=he,V.patches=0,V.cache||(V.cache={}),V.source&&(V.cache[V.source]=V.original),K(B,V),B.openapi&&typeof B.openapi=="string"&&B.openapi.startsWith("3.")){V.openapi=c(B),Q(V.openapi,V,he),_(V.openapi,V,he),d.optionalResolve(V).then(function(){return V.direct?q(V.openapi):q(V)}).catch(function(U){console.warn(U),he(U)});return}if(!B.swagger||B.swagger!="2.0")return he(new x("Unsupported swagger/OpenAPI version: "+(B.openapi?B.openapi:B.swagger)));let pe=V.openapi={};if(pe.openapi=typeof V.targetVersion=="string"&&V.targetVersion.startsWith("3.")?V.targetVersion:b,V.origin){pe["x-origin"]||(pe["x-origin"]=[]);let U={};U.url=V.source||V.origin,U.format="swagger",U.version=B.swagger,U.converter={},U.converter.url="https://github.com/mermade/oas-kit",U.converter.version=f,pe["x-origin"].push(U)}if(pe=Object.assign(pe,c(B)),delete pe.swagger,u(pe,{},function(U,ae,ie){U[ae]===null&&!ae.startsWith("x-")&&ae!=="default"&&ie.path.indexOf("/example")<0&&delete U[ae]}),B.host)for(let U of Array.isArray(B.schemes)?B.schemes:[""]){let ae={},ie=(B.basePath||"").replace(/\/$/,"");ae.url=(U?U+":":"")+"//"+B.host+ie,J(ae),pe.servers||(pe.servers=[]),pe.servers.push(ae)}else if(B.basePath){let U={};U.url=B.basePath,J(U),pe.servers||(pe.servers=[]),pe.servers.push(U)}if(delete pe.host,delete pe.basePath,pe["x-servers"]&&Array.isArray(pe["x-servers"])&&(pe.servers=pe["x-servers"],delete pe["x-servers"]),B["x-ms-parameterized-host"]){let U=B["x-ms-parameterized-host"],ae={};ae.url=U.hostTemplate+(B.basePath?B.basePath:""),ae.variables={};const ie=ae.url.match(/\{\w+\}/g);for(let ve in U.parameters){let ge=U.parameters[ve];ge.$ref&&(ge=l(o(pe,ge.$ref))),ve.startsWith("x-")||(delete ge.required,delete ge.type,delete ge.in,typeof ge.default>"u"&&(ge.enum?ge.default=ge.enum[0]:ge.default="none"),ge.name||(ge.name=ie[ve].replace("{","").replace("}","")),ae.variables[ge.name]=ge,delete ge.name)}pe.servers||(pe.servers=[]),U.useSchemePrefix===!1?pe.servers.push(ae):B.schemes.forEach(ve=>{pe.servers.push(Object.assign({},ae,{url:ve+"://"+ae.url}))}),delete pe["x-ms-parameterized-host"]}Q(pe,V,he),_(pe,V,he),typeof pe.consumes=="string"&&(pe.consumes=[pe.consumes]),typeof pe.produces=="string"&&(pe.produces=[pe.produces]),pe.components={},pe["x-callbacks"]&&(pe.components.callbacks=pe["x-callbacks"],delete pe["x-callbacks"]),pe.components.examples={},pe.components.headers={},pe["x-links"]&&(pe.components.links=pe["x-links"],delete pe["x-links"]),pe.components.parameters=pe.parameters||{},pe.components.responses=pe.responses||{},pe.components.requestBodies={},pe.components.securitySchemes=pe.securityDefinitions||{},pe.components.schemas=pe.definitions||{},delete pe.definitions,delete pe.responses,delete pe.parameters,delete pe.securityDefinitions,d.optionalResolve(V).then(function(){G(V.openapi,V),V.direct?q(V.openapi):q(V)}).catch(function(U){console.warn(U),he(U)})}))}function oe(B,V,de){return a(de,new Promise(function(q,he){let pe=null,U=null;try{pe=JSON.parse(B),V.text=JSON.stringify(pe,null,2)}catch(ae){U=ae;try{pe=n.parse(B,{schema:"core",prettyErrors:!0}),V.sourceYaml=!0,V.text=B}catch(ie){U=ie}}pe?W(pe,V).then(ae=>q(ae)).catch(ae=>he(ae)):he(new x(U?U.message:"Could not parse string"))}))}function le(B,V,de){return a(de,new Promise(function(q,he){V.origin=!0,V.source||(V.source=B),V.verbose&&console.warn("GET "+B),V.fetch||(V.fetch=r);const pe=Object.assign({},V.fetchOptions,{agent:V.agent});V.fetch(B,pe).then(function(U){if(U.status!==200)throw new x(`Received status code ${U.status}: ${B}`);return U.text()}).then(function(U){oe(U,V).then(ae=>q(ae)).catch(ae=>he(ae))}).catch(function(U){he(U)})}))}function be(B,V,de){return a(de,new Promise(function(q,he){e.readFile(B,V.encoding||"utf8",function(pe,U){pe?he(pe):(V.sourceFile=B,oe(U,V).then(ae=>q(ae)).catch(ae=>he(ae)))})}))}function Oe(B,V,de){return a(de,new Promise(function(q,he){let pe="";B.on("data",function(U){pe+=U}).on("end",function(){oe(pe,V).then(U=>q(U)).catch(U=>he(U))})}))}return LR={S2OError:x,targetVersion:b,convert:W,convertObj:W,convertUrl:le,convertStr:oe,convertFile:be,convertStream:Oe},LR}var gst=mst();const fst=Hr(gst);function vst(e){return e.paths||(e.paths={}),new Promise((t,a)=>fst.convertObj(e,{patch:!0,warnOnly:!0,text:"{}",anchors:!0},(r,n)=>{if(r)return a(r);t(n?.openapi)}))}async function bst(){try{return(await lie())?.resolvedConfig.openapi||{}}catch{return{}}}async function yst(e){const t=await lie(),a={config:t,base:_u?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};_u&&(t.resolve.http.customFetch=globalThis.fetch),typeof e=="object"&&e!==null?a.doc=kst(e):a.ref=e;const{bundle:{parsed:r}}=await Not(a);return r.swagger!==void 0?vst(r):r}function kst(e){return{source:{absoluteRef:""},parsed:e}}async function xst(e,t,a){let r;if(a?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');r=e}else r=await yst(e||t);try{NWe(r)}catch{}return r}const wst=({options:e,definitionUrl:t,definition:a,activeSampleLanguage:r,children:n})=>{const[i,o]=j.useState(),[s,l]=j.useState(!0),[c,u]=j.useState(null),[d,h]=j.useState(e||{});j.useEffect(()=>{async function v(){l(!0);try{const f=await bst();h({...e,...f}),u(await xst(a,t,e))}catch(f){o(f.message)}}v()},[a,t,e]);const m=j.useMemo(()=>{if(c)return{definition:c,options:d,definitionUrl:t,activeSampleLanguage:r}},DWe([c,t,d]));return j.useEffect(()=>{m&&l(!1)},[m]),i||!m?null:s?Bl(e?.hideLoading,!1)?null:p.jsx(iat,{color:"--loading-spinner-color"}):j.isValidElement(n)?j.cloneElement(n,{store:m}):null};function Ost({definition:e,definitionUrl:t,options:a={},activeItemId:r,activeSampleLanguage:n,activeDeepLink:i,router:o}){return p.jsx(wst,{definition:e,definitionUrl:t,options:a,activeItemId:r,activeSampleLanguage:n,activeDeepLink:i,children:p.jsx(Pre,{withCommonStyles:!0,router:o||"hash"})})}function Sst(e){const t={},a=e.attributes;for(let r=0;r<a.length;r++){const n=a[r];t[n.name]=n.value}return t}function zst(e){const t=Sst(e),a={};for(const r in t){const n=r.replace(/-(.)/g,(i,o)=>o.toUpperCase());a[n]=t[r]}return a}function Cst(e,t=document.querySelector("redoc")){D6.hydrateRoot(t,p.jsx(Pre,{store:e}),{onRecoverableError:(a,r)=>{a.message.includes("Minified React error #418")||console.error(a.message,r)}})}function Ooe(e,t={},a=$6("redoc")){if(a===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}={...t,...zst(a)};let i,o;typeof e=="string"?i=e:typeof e=="object"&&(o=e),D6.createRoot(a).render(j.createElement(Ost,{definition:o,definitionUrl:i,options:n,router:r??"hash"},["Loading..."]))}const jst="3.19.0",Pst="27b4a2779a";function Ast(){const e=$6("redoc");if(!e)return;const t=e.getAttribute("spec-url");t&&Ooe(t,{},e)}Ast();function N0(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Soe={exports:{}},zoe;function Mst(){return zoe||(zoe=1,(function(e,t){(function(a){e.exports=a()})(function(){return(function a(r,n,i){function o(c,u){if(!n[c]){if(!r[c]){var d=typeof N0=="function"&&N0;if(!u&&d)return d(c,!0);if(s)return s(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=n[c]={exports:{}};r[c][0].call(m.exports,function(v){var f=r[c][1][v];return o(f||v)},m,m.exports,a,r,n,i)}return n[c].exports}for(var s=typeof N0=="function"&&N0,l=0;l<i.length;l++)o(i[l]);return o})({1:[function(a,r,n){var i=a("./utils"),o=a("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(l){for(var c,u,d,h,m,v,f,b=[],k=0,x=l.length,w=x,z=i.getTypeOf(l)!=="string";k<l.length;)w=x-k,d=z?(c=l[k++],u=k<x?l[k++]:0,k<x?l[k++]:0):(c=l.charCodeAt(k++),u=k<x?l.charCodeAt(k++):0,k<x?l.charCodeAt(k++):0),h=c>>2,m=(3&c)<<4|u>>4,v=1<w?(15&u)<<2|d>>6:64,f=2<w?63&d:64,b.push(s.charAt(h)+s.charAt(m)+s.charAt(v)+s.charAt(f));return b.join("")},n.decode=function(l){var c,u,d,h,m,v,f=0,b=0,k="data:";if(l.substr(0,k.length)===k)throw new Error("Invalid base64 input, it looks like a data url.");var x,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===s.charAt(64)&&w--,l.charAt(l.length-2)===s.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(x=o.uint8array?new Uint8Array(0|w):new Array(0|w);f<l.length;)c=s.indexOf(l.charAt(f++))<<2|(h=s.indexOf(l.charAt(f++)))>>4,u=(15&h)<<4|(m=s.indexOf(l.charAt(f++)))>>2,d=(3&m)<<6|(v=s.indexOf(l.charAt(f++))),x[b++]=c,m!==64&&(x[b++]=u),v!==64&&(x[b++]=d);return x}},{"./support":30,"./utils":32}],2:[function(a,r,n){var i=a("./external"),o=a("./stream/DataWorker"),s=a("./stream/Crc32Probe"),l=a("./stream/DataLengthProbe");function c(u,d,h,m,v){this.compressedSize=u,this.uncompressedSize=d,this.crc32=h,this.compression=m,this.compressedContent=v}c.prototype={getContentWorker:function(){var u=new o(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,h){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(d.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,r,n){var i=a("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,r,n){var i=a("./utils"),o=(function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l})();r.exports=function(s,l){return s!==void 0&&s.length?i.getTypeOf(s)!=="string"?(function(c,u,d,h){var m=o,v=h+d;c^=-1;for(var f=h;f<v;f++)c=c>>>8^m[255&(c^u[f])];return-1^c})(0|l,s,s.length,0):(function(c,u,d,h){var m=o,v=h+d;c^=-1;for(var f=h;f<v;f++)c=c>>>8^m[255&(c^u.charCodeAt(f))];return-1^c})(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(a,r,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(a,r,n){var i=null;i=typeof Promise<"u"?Promise:a("lie"),r.exports={Promise:i}},{lie:37}],7:[function(a,r,n){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=a("pako"),s=a("./utils"),l=a("./stream/GenericWorker"),c=i?"uint8array":"array";function u(d,h){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=h,this.meta={}}n.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,d.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(h){d.push({data:h,meta:d.meta})}},n.compressWorker=function(d){return new u("Deflate",d)},n.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(a,r,n){function i(m,v){var f,b="";for(f=0;f<v;f++)b+=String.fromCharCode(255&m),m>>>=8;return b}function o(m,v,f,b,k,x){var w,z,S=m.file,C=m.compression,P=x!==c.utf8encode,M=s.transformTo("string",x(S.name)),E=s.transformTo("string",c.utf8encode(S.name)),D=S.comment,I=s.transformTo("string",x(D)),L=s.transformTo("string",c.utf8encode(D)),H=E.length!==S.name.length,N=L.length!==D.length,Y="",te="",ne="",ee=S.dir,ce=S.date,Z={crc32:0,compressedSize:0,uncompressedSize:0};v&&!f||(Z.crc32=m.crc32,Z.compressedSize=m.compressedSize,Z.uncompressedSize=m.uncompressedSize);var G=0;v&&(G|=8),P||!H&&!N||(G|=2048);var J=0,Q=0;ee&&(J|=16),k==="UNIX"?(Q=798,J|=(function(K,W){var oe=K;return K||(oe=W?16893:33204),(65535&oe)<<16})(S.unixPermissions,ee)):(Q=20,J|=(function(K){return 63&(K||0)})(S.dosPermissions)),w=ce.getUTCHours(),w<<=6,w|=ce.getUTCMinutes(),w<<=5,w|=ce.getUTCSeconds()/2,z=ce.getUTCFullYear()-1980,z<<=4,z|=ce.getUTCMonth()+1,z<<=5,z|=ce.getUTCDate(),H&&(te=i(1,1)+i(u(M),4)+E,Y+="up"+i(te.length,2)+te),N&&(ne=i(1,1)+i(u(I),4)+L,Y+="uc"+i(ne.length,2)+ne);var _="";return _+=`
10906
10906
  \0`,_+=i(G,2),_+=C.magic,_+=i(w,2),_+=i(z,2),_+=i(Z.crc32,4),_+=i(Z.compressedSize,4),_+=i(Z.uncompressedSize,4),_+=i(M.length,2),_+=i(Y.length,2),{fileRecord:d.LOCAL_FILE_HEADER+_+M+Y,dirRecord:d.CENTRAL_FILE_HEADER+i(Q,2)+_+i(I.length,2)+"\0\0\0\0"+i(J,4)+i(b,4)+M+Y+I}}var s=a("../utils"),l=a("../stream/GenericWorker"),c=a("../utf8"),u=a("../crc32"),d=a("../signature");function h(m,v,f,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,this.zipPlatform=f,this.encodeFileName=b,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,l),h.prototype.push=function(m){var v=m.meta.percent||0,f=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,l.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:f?(v+100*(f-b-1))/f:100}}))},h.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var v=this.streamFiles&&!m.file.dir;if(v){var f=o(m,v,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:f.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(m){this.accumulate=!1;var v=this.streamFiles&&!m.file.dir,f=o(m,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(f.dirRecord),v)this.push({data:(function(b){return d.DATA_DESCRIPTOR+i(b.crc32,4)+i(b.compressedSize,4)+i(b.uncompressedSize,4)})(m),meta:{percent:100}});else for(this.push({data:f.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var m=this.bytesWritten,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var f=this.bytesWritten-m,b=(function(k,x,w,z,S){var C=s.transformTo("string",S(z));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(k,2)+i(k,2)+i(x,4)+i(w,4)+i(C.length,2)+C})(this.dirRecords.length,f,m,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(m){this._sources.push(m);var v=this;return m.on("data",function(f){v.processChunk(f)}),m.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),m.on("error",function(f){v.error(f)}),this},h.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(m){var v=this._sources;if(!l.prototype.error.call(this,m))return!1;for(var f=0;f<v.length;f++)try{v[f].error(m)}catch{}return!0},h.prototype.lock=function(){l.prototype.lock.call(this);for(var m=this._sources,v=0;v<m.length;v++)m[v].lock()},r.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(a,r,n){var i=a("../compressions"),o=a("./ZipFileWorker");n.generateWorker=function(s,l,c){var u=new o(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{s.forEach(function(h,m){d++;var v=(function(x,w){var z=x||w,S=i[z];if(!S)throw new Error(z+" is not a valid compression method !");return S})(m.options.compression,l.compression),f=m.options.compressionOptions||l.compressionOptions||{},b=m.dir,k=m.date;m._compressWorker(v,f).withStreamInfo("file",{name:h,dir:b,date:k,comment:m.comment||"",unixPermissions:m.unixPermissions,dosPermissions:m.dosPermissions}).pipe(u)}),u.entriesCount=d}catch(h){u.error(h)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(a,r,n){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new i;for(var s in this)typeof this[s]!="function"&&(o[s]=this[s]);return o}}(i.prototype=a("./object")).loadAsync=a("./load"),i.support=a("./support"),i.defaults=a("./defaults"),i.version="3.10.1",i.loadAsync=function(o,s){return new i().loadAsync(o,s)},i.external=a("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(a,r,n){var i=a("./utils"),o=a("./external"),s=a("./utf8"),l=a("./zipEntries"),c=a("./stream/Crc32Probe"),u=a("./nodejsUtils");function d(h){return new o.Promise(function(m,v){var f=h.decompressed.getContentWorker().pipe(new c);f.on("error",function(b){v(b)}).on("end",function(){f.streamInfo.crc32!==h.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):m()}).resume()})}r.exports=function(h,m){var v=this;return m=i.extend(m||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),u.isNode&&u.isStream(h)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",h,!0,m.optimizedBinaryString,m.base64).then(function(f){var b=new l(m);return b.load(f),b}).then(function(f){var b=[o.Promise.resolve(f)],k=f.files;if(m.checkCRC32)for(var x=0;x<k.length;x++)b.push(d(k[x]));return o.Promise.all(b)}).then(function(f){for(var b=f.shift(),k=b.files,x=0;x<k.length;x++){var w=k[x],z=w.fileNameStr,S=i.resolve(w.fileNameStr);v.file(S,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:m.createFolders}),w.dir||(v.file(S).unsafeOriginalName=z)}return b.zipComment.length&&(v.comment=b.zipComment),v})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(a,r,n){var i=a("../utils"),o=a("../stream/GenericWorker");function s(l,c){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(s,o),s.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},s.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(a,r,n){var i=a("readable-stream").Readable;function o(s,l,c){i.call(this,l),this._helper=s;var u=this;s.on("data",function(d,h){u.push(d)||u._helper.pause(),c&&c(h)}).on("error",function(d){u.emit("error",d)}).on("end",function(){u.push(null)})}a("../utils").inherits(o,i),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(a,r,n){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,o);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,o)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var o=new Buffer(i);return o.fill(0),o},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(a,r,n){function i(S,C,P){var M,E=s.getTypeOf(C),D=s.extend(P||{},u);D.date=D.date||new Date,D.compression!==null&&(D.compression=D.compression.toUpperCase()),typeof D.unixPermissions=="string"&&(D.unixPermissions=parseInt(D.unixPermissions,8)),D.unixPermissions&&16384&D.unixPermissions&&(D.dir=!0),D.dosPermissions&&16&D.dosPermissions&&(D.dir=!0),D.dir&&(S=k(S)),D.createFolders&&(M=b(S))&&x.call(this,M,!0);var I=E==="string"&&D.binary===!1&&D.base64===!1;P&&P.binary!==void 0||(D.binary=!I),(C instanceof d&&C.uncompressedSize===0||D.dir||!C||C.length===0)&&(D.base64=!1,D.binary=!0,C="",D.compression="STORE",E="string");var L=null;L=C instanceof d||C instanceof l?C:v.isNode&&v.isStream(C)?new f(S,C):s.prepareContent(S,C,D.binary,D.optimizedBinaryString,D.base64);var H=new h(S,L,D);this.files[S]=H}var o=a("./utf8"),s=a("./utils"),l=a("./stream/GenericWorker"),c=a("./stream/StreamHelper"),u=a("./defaults"),d=a("./compressedObject"),h=a("./zipObject"),m=a("./generate"),v=a("./nodejsUtils"),f=a("./nodejs/NodejsStreamInputAdapter"),b=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var C=S.lastIndexOf("/");return 0<C?S.substring(0,C):""},k=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},x=function(S,C){return C=C!==void 0?C:u.createFolders,S=k(S),this.files[S]||i.call(this,S,null,{dir:!0,createFolders:C}),this.files[S]};function w(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var z={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var C,P,M;for(C in this.files)M=this.files[C],(P=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&S(P,M)},filter:function(S){var C=[];return this.forEach(function(P,M){S(P,M)&&C.push(M)}),C},file:function(S,C,P){if(arguments.length!==1)return S=this.root+S,i.call(this,S,C,P),this;if(w(S)){var M=S;return this.filter(function(D,I){return!I.dir&&M.test(D)})}var E=this.files[this.root+S];return E&&!E.dir?E:null},folder:function(S){if(!S)return this;if(w(S))return this.filter(function(E,D){return D.dir&&S.test(E)});var C=this.root+S,P=x.call(this,C),M=this.clone();return M.root=P.name,M},remove:function(S){S=this.root+S;var C=this.files[S];if(C||(S.slice(-1)!=="/"&&(S+="/"),C=this.files[S]),C&&!C.dir)delete this.files[S];else for(var P=this.filter(function(E,D){return D.name.slice(0,S.length)===S}),M=0;M<P.length;M++)delete this.files[P[M].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var C,P={};try{if((P=s.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=P.type.toLowerCase(),P.compression=P.compression.toUpperCase(),P.type==="binarystring"&&(P.type="string"),!P.type)throw new Error("No output type specified.");s.checkSupport(P.type),P.platform!=="darwin"&&P.platform!=="freebsd"&&P.platform!=="linux"&&P.platform!=="sunos"||(P.platform="UNIX"),P.platform==="win32"&&(P.platform="DOS");var M=P.comment||this.comment||"";C=m.generateWorker(this,P,M)}catch(E){(C=new l("error")).error(E)}return new c(C,P.type||"string",P.mimeType)},generateAsync:function(S,C){return this.generateInternalStream(S).accumulate(C)},generateNodeStream:function(S,C){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(C)}};r.exports=z},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(a,r,n){r.exports=a("stream")},{stream:void 0}],17:[function(a,r,n){var i=a("./DataReader");function o(s){i.call(this,s);for(var l=0;l<this.data.length;l++)s[l]=255&s[l]}a("../utils").inherits(o,i),o.prototype.byteAt=function(s){return this.data[this.zero+s]},o.prototype.lastIndexOfSignature=function(s){for(var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),d=s.charCodeAt(3),h=this.length-4;0<=h;--h)if(this.data[h]===l&&this.data[h+1]===c&&this.data[h+2]===u&&this.data[h+3]===d)return h-this.zero;return-1},o.prototype.readAndCheckSignature=function(s){var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),d=s.charCodeAt(3),h=this.readData(4);return l===h[0]&&c===h[1]&&u===h[2]&&d===h[3]},o.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(a,r,n){var i=a("../utils");function o(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var l,c=0;for(this.checkOffset(s),l=this.index+s-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return i.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=o},{"../utils":32}],19:[function(a,r,n){var i=a("./Uint8ArrayReader");function o(s){i.call(this,s)}a("../utils").inherits(o,i),o.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(a,r,n){var i=a("./DataReader");function o(s){i.call(this,s)}a("../utils").inherits(o,i),o.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},o.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},o.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},o.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(a,r,n){var i=a("./ArrayReader");function o(s){i.call(this,s)}a("../utils").inherits(o,i),o.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(a,r,n){var i=a("../utils"),o=a("../support"),s=a("./ArrayReader"),l=a("./StringReader"),c=a("./NodeBufferReader"),u=a("./Uint8ArrayReader");r.exports=function(d){var h=i.getTypeOf(d);return i.checkSupport(h),h!=="string"||o.uint8array?h==="nodebuffer"?new c(d):o.uint8array?new u(i.transformTo("uint8array",d)):new s(i.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(a,r,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(a,r,n){var i=a("./GenericWorker"),o=a("../utils");function s(l){i.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(s,i),s.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(a,r,n){var i=a("./GenericWorker"),o=a("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}a("../utils").inherits(s,i),s.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(a,r,n){var i=a("../utils"),o=a("./GenericWorker");function s(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(s,o),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}o.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(a,r,n){var i=a("../utils"),o=a("./GenericWorker");function s(l){o.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(s,o),s.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(a,r,n){function i(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,s){return this._listeners[o].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,s){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,s)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var s=this;return o.on("data",function(l){s.processChunk(l)}),o.on("end",function(){s.end()}),o.on("error",function(l){s.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,s){return this.extraStreamInfo[o]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=i},{}],29:[function(a,r,n){var i=a("../utils"),o=a("./ConvertWorker"),s=a("./GenericWorker"),l=a("../base64"),c=a("../support"),u=a("../external"),d=null;if(c.nodestream)try{d=a("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(v,f){return new u.Promise(function(b,k){var x=[],w=v._internalType,z=v._outputType,S=v._mimeType;v.on("data",function(C,P){x.push(C),f&&f(P)}).on("error",function(C){x=[],k(C)}).on("end",function(){try{var C=(function(P,M,E){switch(P){case"blob":return i.newBlob(i.transformTo("arraybuffer",M),E);case"base64":return l.encode(M);default:return i.transformTo(P,M)}})(z,(function(P,M){var E,D=0,I=null,L=0;for(E=0;E<M.length;E++)L+=M[E].length;switch(P){case"string":return M.join("");case"array":return Array.prototype.concat.apply([],M);case"uint8array":for(I=new Uint8Array(L),E=0;E<M.length;E++)I.set(M[E],D),D+=M[E].length;return I;case"nodebuffer":return Buffer.concat(M);default:throw new Error("concat : unsupported type '"+P+"'")}})(w,x),S);b(C)}catch(P){k(P)}x=[]}).resume()})}function m(v,f,b){var k=f;switch(f){case"blob":case"arraybuffer":k="uint8array";break;case"base64":k="string"}try{this._internalType=k,this._outputType=f,this._mimeType=b,i.checkSupport(k),this._worker=v.pipe(new o(k)),v.lock()}catch(x){this._worker=new s("error"),this._worker.error(x)}}m.prototype={accumulate:function(v){return h(this,v)},on:function(v,f){var b=this;return v==="data"?this._worker.on(v,function(k){f.call(b,k.data,k.meta)}):this._worker.on(v,function(){i.delay(f,arguments,b)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(v){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},v)}},r.exports=m},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(a,r,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",n.nodebuffer=typeof Buffer<"u",n.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),n.blob=o.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!a("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(a,r,n){for(var i=a("./utils"),o=a("./support"),s=a("./nodejsUtils"),l=a("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}n.utf8encode=function(m){return o.nodebuffer?s.newBufferFrom(m,"utf-8"):(function(v){var f,b,k,x,w,z=v.length,S=0;for(x=0;x<z;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<z&&(64512&(k=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(k-56320),x++),S+=b<128?1:b<2048?2:b<65536?3:4;for(f=o.uint8array?new Uint8Array(S):new Array(S),x=w=0;w<S;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<z&&(64512&(k=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(k-56320),x++),b<128?f[w++]=b:(b<2048?f[w++]=192|b>>>6:(b<65536?f[w++]=224|b>>>12:(f[w++]=240|b>>>18,f[w++]=128|b>>>12&63),f[w++]=128|b>>>6&63),f[w++]=128|63&b);return f})(m)},n.utf8decode=function(m){return o.nodebuffer?i.transformTo("nodebuffer",m).toString("utf-8"):(function(v){var f,b,k,x,w=v.length,z=new Array(2*w);for(f=b=0;f<w;)if((k=v[f++])<128)z[b++]=k;else if(4<(x=c[k]))z[b++]=65533,f+=x-1;else{for(k&=x===2?31:x===3?15:7;1<x&&f<w;)k=k<<6|63&v[f++],x--;1<x?z[b++]=65533:k<65536?z[b++]=k:(k-=65536,z[b++]=55296|k>>10&1023,z[b++]=56320|1023&k)}return z.length!==b&&(z.subarray?z=z.subarray(0,b):z.length=b),i.applyFromCharCode(z)})(m=i.transformTo(o.uint8array?"uint8array":"array",m))},i.inherits(d,l),d.prototype.processChunk=function(m){var v=i.transformTo(o.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var f=v;(v=new Uint8Array(f.length+this.leftOver.length)).set(this.leftOver,0),v.set(f,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var b=(function(x,w){var z;for((w=w||x.length)>x.length&&(w=x.length),z=w-1;0<=z&&(192&x[z])==128;)z--;return z<0||z===0?w:z+c[x[z]]>w?z:w})(v),k=v;b!==v.length&&(o.uint8array?(k=v.subarray(0,b),this.leftOver=v.subarray(b,v.length)):(k=v.slice(0,b),this.leftOver=v.slice(b,v.length))),this.push({data:n.utf8decode(k),meta:m.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=d,i.inherits(h,l),h.prototype.processChunk=function(m){this.push({data:n.utf8encode(m.data),meta:m.meta})},n.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(a,r,n){var i=a("./support"),o=a("./base64"),s=a("./nodejsUtils"),l=a("./external");function c(f){return f}function u(f,b){for(var k=0;k<f.length;++k)b[k]=255&f.charCodeAt(k);return b}a("setimmediate"),n.newBlob=function(f,b){n.checkSupport("blob");try{return new Blob([f],{type:b})}catch{try{var k=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return k.append(f),k.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(f,b,k){var x=[],w=0,z=f.length;if(z<=k)return String.fromCharCode.apply(null,f);for(;w<z;)b==="array"||b==="nodebuffer"?x.push(String.fromCharCode.apply(null,f.slice(w,Math.min(w+k,z)))):x.push(String.fromCharCode.apply(null,f.subarray(w,Math.min(w+k,z)))),w+=k;return x.join("")},stringifyByChar:function(f){for(var b="",k=0;k<f.length;k++)b+=String.fromCharCode(f[k]);return b},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}})()}};function h(f){var b=65536,k=n.getTypeOf(f),x=!0;if(k==="uint8array"?x=d.applyCanBeUsed.uint8array:k==="nodebuffer"&&(x=d.applyCanBeUsed.nodebuffer),x)for(;1<b;)try{return d.stringifyByChunk(f,k,b)}catch{b=Math.floor(b/2)}return d.stringifyByChar(f)}function m(f,b){for(var k=0;k<f.length;k++)b[k]=f[k];return b}n.applyFromCharCode=h;var v={};v.string={string:c,array:function(f){return u(f,new Array(f.length))},arraybuffer:function(f){return v.string.uint8array(f).buffer},uint8array:function(f){return u(f,new Uint8Array(f.length))},nodebuffer:function(f){return u(f,s.allocBuffer(f.length))}},v.array={string:h,array:c,arraybuffer:function(f){return new Uint8Array(f).buffer},uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return s.newBufferFrom(f)}},v.arraybuffer={string:function(f){return h(new Uint8Array(f))},array:function(f){return m(new Uint8Array(f),new Array(f.byteLength))},arraybuffer:c,uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return s.newBufferFrom(new Uint8Array(f))}},v.uint8array={string:h,array:function(f){return m(f,new Array(f.length))},arraybuffer:function(f){return f.buffer},uint8array:c,nodebuffer:function(f){return s.newBufferFrom(f)}},v.nodebuffer={string:h,array:function(f){return m(f,new Array(f.length))},arraybuffer:function(f){return v.nodebuffer.uint8array(f).buffer},uint8array:function(f){return m(f,new Uint8Array(f.length))},nodebuffer:c},n.transformTo=function(f,b){if(b=b||"",!f)return b;n.checkSupport(f);var k=n.getTypeOf(b);return v[k][f](b)},n.resolve=function(f){for(var b=f.split("/"),k=[],x=0;x<b.length;x++){var w=b[x];w==="."||w===""&&x!==0&&x!==b.length-1||(w===".."?k.pop():k.push(w))}return k.join("/")},n.getTypeOf=function(f){return typeof f=="string"?"string":Object.prototype.toString.call(f)==="[object Array]"?"array":i.nodebuffer&&s.isBuffer(f)?"nodebuffer":i.uint8array&&f instanceof Uint8Array?"uint8array":i.arraybuffer&&f instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(f){if(!i[f.toLowerCase()])throw new Error(f+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(f){var b,k,x="";for(k=0;k<(f||"").length;k++)x+="\\x"+((b=f.charCodeAt(k))<16?"0":"")+b.toString(16).toUpperCase();return x},n.delay=function(f,b,k){setImmediate(function(){f.apply(k||null,b||[])})},n.inherits=function(f,b){function k(){}k.prototype=b.prototype,f.prototype=new k},n.extend=function(){var f,b,k={};for(f=0;f<arguments.length;f++)for(b in arguments[f])Object.prototype.hasOwnProperty.call(arguments[f],b)&&k[b]===void 0&&(k[b]=arguments[f][b]);return k},n.prepareContent=function(f,b,k,x,w){return l.Promise.resolve(b).then(function(z){return i.blob&&(z instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(z))!==-1)&&typeof FileReader<"u"?new l.Promise(function(S,C){var P=new FileReader;P.onload=function(M){S(M.target.result)},P.onerror=function(M){C(M.target.error)},P.readAsArrayBuffer(z)}):z}).then(function(z){var S=n.getTypeOf(z);return S?(S==="arraybuffer"?z=n.transformTo("uint8array",z):S==="string"&&(w?z=o.decode(z):k&&x!==!0&&(z=(function(C){return u(C,i.uint8array?new Uint8Array(C.length):new Array(C.length))})(z))),z):l.Promise.reject(new Error("Can't read the data of '"+f+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(a,r,n){var i=a("./reader/readerFor"),o=a("./utils"),s=a("./signature"),l=a("./zipEntry"),c=a("./support");function u(d){this.files=[],this.loadOptions=d}u.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var h=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(h)+", expected "+o.pretty(d)+")")}},isSignature:function(d,h){var m=this.reader.index;this.reader.setIndex(d);var v=this.reader.readString(4)===h;return this.reader.setIndex(m),v},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),h=c.uint8array?"uint8array":"array",m=o.transformTo(h,d);this.zipComment=this.loadOptions.decodeFileName(m)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,h,m,v=this.zip64EndOfCentralSize-44;0<v;)d=this.reader.readInt(2),h=this.reader.readInt(4),m=this.reader.readData(h),this.zip64ExtensibleData[d]={id:d,length:h,value:m}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,h;for(d=0;d<this.files.length;d++)h=this.files[d],this.reader.setIndex(h.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),h.readLocalPart(this.reader),h.handleUTF8(),h.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var h=d;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var m=this.centralDirOffset+this.centralDirSize;this.zip64&&(m+=20,m+=12+this.zip64EndOfCentralSize);var v=h-m;if(0<v)this.isSignature(h,s.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" bytes.")},prepareReader:function(d){this.reader=i(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(a,r,n){var i=a("./reader/readerFor"),o=a("./utils"),s=a("./compressedObject"),l=a("./crc32"),c=a("./utf8"),u=a("./compressions"),d=a("./support");function h(m,v){this.options=m,this.loadOptions=v}h.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(m){var v,f;if(m.skip(22),this.fileNameLength=m.readInt(2),f=m.readInt(2),this.fileName=m.readData(this.fileNameLength),m.skip(f),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((v=(function(b){for(var k in u)if(Object.prototype.hasOwnProperty.call(u,k)&&u[k].magic===b)return u[k];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,v,m.readData(this.compressedSize))},readCentralPart:function(m){this.versionMadeBy=m.readInt(2),m.skip(2),this.bitFlag=m.readInt(2),this.compressionMethod=m.readString(2),this.date=m.readDate(),this.crc32=m.readInt(4),this.compressedSize=m.readInt(4),this.uncompressedSize=m.readInt(4);var v=m.readInt(2);if(this.extraFieldsLength=m.readInt(2),this.fileCommentLength=m.readInt(2),this.diskNumberStart=m.readInt(2),this.internalFileAttributes=m.readInt(2),this.externalFileAttributes=m.readInt(4),this.localHeaderOffset=m.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");m.skip(v),this.readExtraFields(m),this.parseZIP64ExtraField(m),this.fileComment=m.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var m=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=i(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var v,f,b,k=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4<k;)v=m.readInt(2),f=m.readInt(2),b=m.readData(f),this.extraFields[v]={id:v,length:f,value:b};m.setIndex(k)},handleUTF8:function(){var m=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;else{var f=o.transformTo(m,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(f)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var k=o.transformTo(m,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(k)}}},findExtraFieldUnicodePath:function(){var m=this.extraFields[28789];if(m){var v=i(m.value);return v.readInt(1)!==1||l(this.fileName)!==v.readInt(4)?null:c.utf8decode(v.readData(m.length-5))}return null},findExtraFieldUnicodeComment:function(){var m=this.extraFields[25461];if(m){var v=i(m.value);return v.readInt(1)!==1||l(this.fileComment)!==v.readInt(4)?null:c.utf8decode(v.readData(m.length-5))}return null}},r.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(a,r,n){function i(v,f,b){this.name=v,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=f,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var o=a("./stream/StreamHelper"),s=a("./stream/DataWorker"),l=a("./utf8"),c=a("./compressedObject"),u=a("./stream/GenericWorker");i.prototype={internalStream:function(v){var f=null,b="string";try{if(!v)throw new Error("No output type specified.");var k=(b=v.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),f=this._decompressWorker();var x=!this._dataBinary;x&&!k&&(f=f.pipe(new l.Utf8EncodeWorker)),!x&&k&&(f=f.pipe(new l.Utf8DecodeWorker))}catch(w){(f=new u("error")).error(w)}return new o(f,b,"")},async:function(v,f){return this.internalStream(v).accumulate(f)},nodeStream:function(v,f){return this.internalStream(v||"nodebuffer").toNodejsStream(f)},_compressWorker:function(v,f){if(this._data instanceof c&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,v,f)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new s(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},m=0;m<d.length;m++)i.prototype[d[m]]=h;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(a,r,n){(function(i){var o,s,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(v),d=i.document.createTextNode("");u.observe(d,{characterData:!0}),o=function(){d.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)o="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var f=i.document.createElement("script");f.onreadystatechange=function(){v(),f.onreadystatechange=null,f.parentNode.removeChild(f),f=null},i.document.documentElement.appendChild(f)}:function(){setTimeout(v,0)};else{var h=new i.MessageChannel;h.port1.onmessage=v,o=function(){h.port2.postMessage(0)}}var m=[];function v(){var f,b;s=!0;for(var k=m.length;k;){for(b=m,m=[],f=-1;++f<k;)b[f]();k=m.length}s=!1}r.exports=function(f){m.push(f)!==1||s||o()}}).call(this,typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(a,r,n){var i=a("immediate");function o(){}var s={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function d(k){if(typeof k!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,k!==o&&f(this,k)}function h(k,x,w){this.promise=k,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function m(k,x,w){i(function(){var z;try{z=x(w)}catch(S){return s.reject(k,S)}z===k?s.reject(k,new TypeError("Cannot resolve promise with itself")):s.resolve(k,z)})}function v(k){var x=k&&k.then;if(k&&(typeof k=="object"||typeof k=="function")&&typeof x=="function")return function(){x.apply(k,arguments)}}function f(k,x){var w=!1;function z(P){w||(w=!0,s.reject(k,P))}function S(P){w||(w=!0,s.resolve(k,P))}var C=b(function(){x(S,z)});C.status==="error"&&z(C.value)}function b(k,x){var w={};try{w.value=k(x),w.status="success"}catch(z){w.status="error",w.value=z}return w}(r.exports=d).prototype.finally=function(k){if(typeof k!="function")return this;var x=this.constructor;return this.then(function(w){return x.resolve(k()).then(function(){return w})},function(w){return x.resolve(k()).then(function(){throw w})})},d.prototype.catch=function(k){return this.then(null,k)},d.prototype.then=function(k,x){if(typeof k!="function"&&this.state===c||typeof x!="function"&&this.state===l)return this;var w=new this.constructor(o);return this.state!==u?m(w,this.state===c?k:x,this.outcome):this.queue.push(new h(w,k,x)),w},h.prototype.callFulfilled=function(k){s.resolve(this.promise,k)},h.prototype.otherCallFulfilled=function(k){m(this.promise,this.onFulfilled,k)},h.prototype.callRejected=function(k){s.reject(this.promise,k)},h.prototype.otherCallRejected=function(k){m(this.promise,this.onRejected,k)},s.resolve=function(k,x){var w=b(v,x);if(w.status==="error")return s.reject(k,w.value);var z=w.value;if(z)f(k,z);else{k.state=c,k.outcome=x;for(var S=-1,C=k.queue.length;++S<C;)k.queue[S].callFulfilled(x)}return k},s.reject=function(k,x){k.state=l,k.outcome=x;for(var w=-1,z=k.queue.length;++w<z;)k.queue[w].callRejected(x);return k},d.resolve=function(k){return k instanceof this?k:s.resolve(new this(o),k)},d.reject=function(k){var x=new this(o);return s.reject(x,k)},d.all=function(k){var x=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=k.length,z=!1;if(!w)return this.resolve([]);for(var S=new Array(w),C=0,P=-1,M=new this(o);++P<w;)E(k[P],P);return M;function E(D,I){x.resolve(D).then(function(L){S[I]=L,++C!==w||z||(z=!0,s.resolve(M,S))},function(L){z||(z=!0,s.reject(M,L))})}},d.race=function(k){var x=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=k.length,z=!1;if(!w)return this.resolve([]);for(var S=-1,C=new this(o);++S<w;)P=k[S],x.resolve(P).then(function(M){z||(z=!0,s.resolve(C,M))},function(M){z||(z=!0,s.reject(C,M))});var P;return C}},{immediate:36}],38:[function(a,r,n){var i={};(0,a("./lib/utils/common").assign)(i,a("./lib/deflate"),a("./lib/inflate"),a("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(a,r,n){var i=a("./zlib/deflate"),o=a("./utils/common"),s=a("./utils/strings"),l=a("./zlib/messages"),c=a("./zlib/zstream"),u=Object.prototype.toString,d=0,h=-1,m=0,v=8;function f(k){if(!(this instanceof f))return new f(k);this.options=o.assign({level:h,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},k||{});var x=this.options;x.raw&&0<x.windowBits?x.windowBits=-x.windowBits:x.gzip&&0<x.windowBits&&x.windowBits<16&&(x.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var w=i.deflateInit2(this.strm,x.level,x.method,x.windowBits,x.memLevel,x.strategy);if(w!==d)throw new Error(l[w]);if(x.header&&i.deflateSetHeader(this.strm,x.header),x.dictionary){var z;if(z=typeof x.dictionary=="string"?s.string2buf(x.dictionary):u.call(x.dictionary)==="[object ArrayBuffer]"?new Uint8Array(x.dictionary):x.dictionary,(w=i.deflateSetDictionary(this.strm,z))!==d)throw new Error(l[w]);this._dict_set=!0}}function b(k,x){var w=new f(x);if(w.push(k,!0),w.err)throw w.msg||l[w.err];return w.result}f.prototype.push=function(k,x){var w,z,S=this.strm,C=this.options.chunkSize;if(this.ended)return!1;z=x===~~x?x:x===!0?4:0,typeof k=="string"?S.input=s.string2buf(k):u.call(k)==="[object ArrayBuffer]"?S.input=new Uint8Array(k):S.input=k,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new o.Buf8(C),S.next_out=0,S.avail_out=C),(w=i.deflate(S,z))!==1&&w!==d)return this.onEnd(w),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(o.shrinkBuf(S.output,S.next_out))):this.onData(o.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&w!==1);return z===4?(w=i.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===d):z!==2||(this.onEnd(d),!(S.avail_out=0))},f.prototype.onData=function(k){this.chunks.push(k)},f.prototype.onEnd=function(k){k===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=k,this.msg=this.strm.msg},n.Deflate=f,n.deflate=b,n.deflateRaw=function(k,x){return(x=x||{}).raw=!0,b(k,x)},n.gzip=function(k,x){return(x=x||{}).gzip=!0,b(k,x)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(a,r,n){var i=a("./zlib/inflate"),o=a("./utils/common"),s=a("./utils/strings"),l=a("./zlib/constants"),c=a("./zlib/messages"),u=a("./zlib/zstream"),d=a("./zlib/gzheader"),h=Object.prototype.toString;function m(f){if(!(this instanceof m))return new m(f);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},f||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||f&&f.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&(15&b.windowBits)==0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var k=i.inflateInit2(this.strm,b.windowBits);if(k!==l.Z_OK)throw new Error(c[k]);this.header=new d,i.inflateGetHeader(this.strm,this.header)}function v(f,b){var k=new m(b);if(k.push(f,!0),k.err)throw k.msg||c[k.err];return k.result}m.prototype.push=function(f,b){var k,x,w,z,S,C,P=this.strm,M=this.options.chunkSize,E=this.options.dictionary,D=!1;if(this.ended)return!1;x=b===~~b?b:b===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof f=="string"?P.input=s.binstring2buf(f):h.call(f)==="[object ArrayBuffer]"?P.input=new Uint8Array(f):P.input=f,P.next_in=0,P.avail_in=P.input.length;do{if(P.avail_out===0&&(P.output=new o.Buf8(M),P.next_out=0,P.avail_out=M),(k=i.inflate(P,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&E&&(C=typeof E=="string"?s.string2buf(E):h.call(E)==="[object ArrayBuffer]"?new Uint8Array(E):E,k=i.inflateSetDictionary(this.strm,C)),k===l.Z_BUF_ERROR&&D===!0&&(k=l.Z_OK,D=!1),k!==l.Z_STREAM_END&&k!==l.Z_OK)return this.onEnd(k),!(this.ended=!0);P.next_out&&(P.avail_out!==0&&k!==l.Z_STREAM_END&&(P.avail_in!==0||x!==l.Z_FINISH&&x!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=s.utf8border(P.output,P.next_out),z=P.next_out-w,S=s.buf2string(P.output,w),P.next_out=z,P.avail_out=M-z,z&&o.arraySet(P.output,P.output,w,z,0),this.onData(S)):this.onData(o.shrinkBuf(P.output,P.next_out)))),P.avail_in===0&&P.avail_out===0&&(D=!0)}while((0<P.avail_in||P.avail_out===0)&&k!==l.Z_STREAM_END);return k===l.Z_STREAM_END&&(x=l.Z_FINISH),x===l.Z_FINISH?(k=i.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===l.Z_OK):x!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(P.avail_out=0))},m.prototype.onData=function(f){this.chunks.push(f)},m.prototype.onEnd=function(f){f===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg},n.Inflate=m,n.inflate=v,n.inflateRaw=function(f,b){return(b=b||{}).raw=!0,v(f,b)},n.ungzip=v},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(a,r,n){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";n.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var d in u)u.hasOwnProperty(d)&&(l[d]=u[d])}}return l},n.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var o={arraySet:function(l,c,u,d,h){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+d),h);else for(var m=0;m<d;m++)l[h+m]=c[u+m]},flattenChunks:function(l){var c,u,d,h,m,v;for(c=d=0,u=l.length;c<u;c++)d+=l[c].length;for(v=new Uint8Array(d),c=h=0,u=l.length;c<u;c++)m=l[c],v.set(m,h),h+=m.length;return v}},s={arraySet:function(l,c,u,d,h){for(var m=0;m<d;m++)l[h+m]=c[u+m]},flattenChunks:function(l){return[].concat.apply([],l)}};n.setTyped=function(l){l?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,s))},n.setTyped(i)},{}],42:[function(a,r,n){var i=a("./common"),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(d,h){if(h<65537&&(d.subarray&&s||!d.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(d,h));for(var m="",v=0;v<h;v++)m+=String.fromCharCode(d[v]);return m}l[254]=l[254]=1,n.string2buf=function(d){var h,m,v,f,b,k=d.length,x=0;for(f=0;f<k;f++)(64512&(m=d.charCodeAt(f)))==55296&&f+1<k&&(64512&(v=d.charCodeAt(f+1)))==56320&&(m=65536+(m-55296<<10)+(v-56320),f++),x+=m<128?1:m<2048?2:m<65536?3:4;for(h=new i.Buf8(x),f=b=0;b<x;f++)(64512&(m=d.charCodeAt(f)))==55296&&f+1<k&&(64512&(v=d.charCodeAt(f+1)))==56320&&(m=65536+(m-55296<<10)+(v-56320),f++),m<128?h[b++]=m:(m<2048?h[b++]=192|m>>>6:(m<65536?h[b++]=224|m>>>12:(h[b++]=240|m>>>18,h[b++]=128|m>>>12&63),h[b++]=128|m>>>6&63),h[b++]=128|63&m);return h},n.buf2binstring=function(d){return u(d,d.length)},n.binstring2buf=function(d){for(var h=new i.Buf8(d.length),m=0,v=h.length;m<v;m++)h[m]=d.charCodeAt(m);return h},n.buf2string=function(d,h){var m,v,f,b,k=h||d.length,x=new Array(2*k);for(m=v=0;m<k;)if((f=d[m++])<128)x[v++]=f;else if(4<(b=l[f]))x[v++]=65533,m+=b-1;else{for(f&=b===2?31:b===3?15:7;1<b&&m<k;)f=f<<6|63&d[m++],b--;1<b?x[v++]=65533:f<65536?x[v++]=f:(f-=65536,x[v++]=55296|f>>10&1023,x[v++]=56320|1023&f)}return u(x,v)},n.utf8border=function(d,h){var m;for((h=h||d.length)>d.length&&(h=d.length),m=h-1;0<=m&&(192&d[m])==128;)m--;return m<0||m===0?h:m+l[d[m]]>h?m:h}},{"./common":41}],43:[function(a,r,n){r.exports=function(i,o,s,l){for(var c=65535&i|0,u=i>>>16&65535|0,d=0;s!==0;){for(s-=d=2e3<s?2e3:s;u=u+(c=c+o[l++]|0)|0,--d;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(a,r,n){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(a,r,n){var i=(function(){for(var o,s=[],l=0;l<256;l++){o=l;for(var c=0;c<8;c++)o=1&o?3988292384^o>>>1:o>>>1;s[l]=o}return s})();r.exports=function(o,s,l,c){var u=i,d=c+l;o^=-1;for(var h=c;h<d;h++)o=o>>>8^u[255&(o^s[h])];return-1^o}},{}],46:[function(a,r,n){var i,o=a("../utils/common"),s=a("./trees"),l=a("./adler32"),c=a("./crc32"),u=a("./messages"),d=0,h=4,m=0,v=-2,f=-1,b=4,k=2,x=8,w=9,z=286,S=30,C=19,P=2*z+1,M=15,E=3,D=258,I=D+E+1,L=42,H=113,N=1,Y=2,te=3,ne=4;function ee(q,he){return q.msg=u[he],he}function ce(q){return(q<<1)-(4<q?9:0)}function Z(q){for(var he=q.length;0<=--he;)q[he]=0}function G(q){var he=q.state,pe=he.pending;pe>q.avail_out&&(pe=q.avail_out),pe!==0&&(o.arraySet(q.output,he.pending_buf,he.pending_out,pe,q.next_out),q.next_out+=pe,he.pending_out+=pe,q.total_out+=pe,q.avail_out-=pe,he.pending-=pe,he.pending===0&&(he.pending_out=0))}function J(q,he){s._tr_flush_block(q,0<=q.block_start?q.block_start:-1,q.strstart-q.block_start,he),q.block_start=q.strstart,G(q.strm)}function Q(q,he){q.pending_buf[q.pending++]=he}function _(q,he){q.pending_buf[q.pending++]=he>>>8&255,q.pending_buf[q.pending++]=255&he}function K(q,he){var pe,U,ae=q.max_chain_length,ie=q.strstart,ve=q.prev_length,ge=q.nice_match,fe=q.strstart>q.w_size-I?q.strstart-(q.w_size-I):0,je=q.window,Ce=q.w_mask,_e=q.prev,rt=q.strstart+D,T=je[ie+ve-1],X=je[ie+ve];q.prev_length>=q.good_match&&(ae>>=2),ge>q.lookahead&&(ge=q.lookahead);do if(je[(pe=he)+ve]===X&&je[pe+ve-1]===T&&je[pe]===je[ie]&&je[++pe]===je[ie+1]){ie+=2,pe++;do;while(je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&je[++ie]===je[++pe]&&ie<rt);if(U=D-(rt-ie),ie=rt-D,ve<U){if(q.match_start=he,ge<=(ve=U))break;T=je[ie+ve-1],X=je[ie+ve]}}while((he=_e[he&Ce])>fe&&--ae!=0);return ve<=q.lookahead?ve:q.lookahead}function W(q){var he,pe,U,ae,ie,ve,ge,fe,je,Ce,_e=q.w_size;do{if(ae=q.window_size-q.lookahead-q.strstart,q.strstart>=_e+(_e-I)){for(o.arraySet(q.window,q.window,_e,_e,0),q.match_start-=_e,q.strstart-=_e,q.block_start-=_e,he=pe=q.hash_size;U=q.head[--he],q.head[he]=_e<=U?U-_e:0,--pe;);for(he=pe=_e;U=q.prev[--he],q.prev[he]=_e<=U?U-_e:0,--pe;);ae+=_e}if(q.strm.avail_in===0)break;if(ve=q.strm,ge=q.window,fe=q.strstart+q.lookahead,je=ae,Ce=void 0,Ce=ve.avail_in,je<Ce&&(Ce=je),pe=Ce===0?0:(ve.avail_in-=Ce,o.arraySet(ge,ve.input,ve.next_in,Ce,fe),ve.state.wrap===1?ve.adler=l(ve.adler,ge,Ce,fe):ve.state.wrap===2&&(ve.adler=c(ve.adler,ge,Ce,fe)),ve.next_in+=Ce,ve.total_in+=Ce,Ce),q.lookahead+=pe,q.lookahead+q.insert>=E)for(ie=q.strstart-q.insert,q.ins_h=q.window[ie],q.ins_h=(q.ins_h<<q.hash_shift^q.window[ie+1])&q.hash_mask;q.insert&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[ie+E-1])&q.hash_mask,q.prev[ie&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=ie,ie++,q.insert--,!(q.lookahead+q.insert<E)););}while(q.lookahead<I&&q.strm.avail_in!==0)}function oe(q,he){for(var pe,U;;){if(q.lookahead<I){if(W(q),q.lookahead<I&&he===d)return N;if(q.lookahead===0)break}if(pe=0,q.lookahead>=E&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+E-1])&q.hash_mask,pe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),pe!==0&&q.strstart-pe<=q.w_size-I&&(q.match_length=K(q,pe)),q.match_length>=E)if(U=s._tr_tally(q,q.strstart-q.match_start,q.match_length-E),q.lookahead-=q.match_length,q.match_length<=q.max_lazy_match&&q.lookahead>=E){for(q.match_length--;q.strstart++,q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+E-1])&q.hash_mask,pe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart,--q.match_length!=0;);q.strstart++}else q.strstart+=q.match_length,q.match_length=0,q.ins_h=q.window[q.strstart],q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+1])&q.hash_mask;else U=s._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++;if(U&&(J(q,!1),q.strm.avail_out===0))return N}return q.insert=q.strstart<E-1?q.strstart:E-1,he===h?(J(q,!0),q.strm.avail_out===0?te:ne):q.last_lit&&(J(q,!1),q.strm.avail_out===0)?N:Y}function le(q,he){for(var pe,U,ae;;){if(q.lookahead<I){if(W(q),q.lookahead<I&&he===d)return N;if(q.lookahead===0)break}if(pe=0,q.lookahead>=E&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+E-1])&q.hash_mask,pe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),q.prev_length=q.match_length,q.prev_match=q.match_start,q.match_length=E-1,pe!==0&&q.prev_length<q.max_lazy_match&&q.strstart-pe<=q.w_size-I&&(q.match_length=K(q,pe),q.match_length<=5&&(q.strategy===1||q.match_length===E&&4096<q.strstart-q.match_start)&&(q.match_length=E-1)),q.prev_length>=E&&q.match_length<=q.prev_length){for(ae=q.strstart+q.lookahead-E,U=s._tr_tally(q,q.strstart-1-q.prev_match,q.prev_length-E),q.lookahead-=q.prev_length-1,q.prev_length-=2;++q.strstart<=ae&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+E-1])&q.hash_mask,pe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),--q.prev_length!=0;);if(q.match_available=0,q.match_length=E-1,q.strstart++,U&&(J(q,!1),q.strm.avail_out===0))return N}else if(q.match_available){if((U=s._tr_tally(q,0,q.window[q.strstart-1]))&&J(q,!1),q.strstart++,q.lookahead--,q.strm.avail_out===0)return N}else q.match_available=1,q.strstart++,q.lookahead--}return q.match_available&&(U=s._tr_tally(q,0,q.window[q.strstart-1]),q.match_available=0),q.insert=q.strstart<E-1?q.strstart:E-1,he===h?(J(q,!0),q.strm.avail_out===0?te:ne):q.last_lit&&(J(q,!1),q.strm.avail_out===0)?N:Y}function be(q,he,pe,U,ae){this.good_length=q,this.max_lazy=he,this.nice_length=pe,this.max_chain=U,this.func=ae}function Oe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*P),this.dyn_dtree=new o.Buf16(2*(2*S+1)),this.bl_tree=new o.Buf16(2*(2*C+1)),Z(this.dyn_ltree),Z(this.dyn_dtree),Z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(M+1),this.heap=new o.Buf16(2*z+1),Z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*z+1),Z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function B(q){var he;return q&&q.state?(q.total_in=q.total_out=0,q.data_type=k,(he=q.state).pending=0,he.pending_out=0,he.wrap<0&&(he.wrap=-he.wrap),he.status=he.wrap?L:H,q.adler=he.wrap===2?0:1,he.last_flush=d,s._tr_init(he),m):ee(q,v)}function V(q){var he=B(q);return he===m&&(function(pe){pe.window_size=2*pe.w_size,Z(pe.head),pe.max_lazy_match=i[pe.level].max_lazy,pe.good_match=i[pe.level].good_length,pe.nice_match=i[pe.level].nice_length,pe.max_chain_length=i[pe.level].max_chain,pe.strstart=0,pe.block_start=0,pe.lookahead=0,pe.insert=0,pe.match_length=pe.prev_length=E-1,pe.match_available=0,pe.ins_h=0})(q.state),he}function de(q,he,pe,U,ae,ie){if(!q)return v;var ve=1;if(he===f&&(he=6),U<0?(ve=0,U=-U):15<U&&(ve=2,U-=16),ae<1||w<ae||pe!==x||U<8||15<U||he<0||9<he||ie<0||b<ie)return ee(q,v);U===8&&(U=9);var ge=new Oe;return(q.state=ge).strm=q,ge.wrap=ve,ge.gzhead=null,ge.w_bits=U,ge.w_size=1<<ge.w_bits,ge.w_mask=ge.w_size-1,ge.hash_bits=ae+7,ge.hash_size=1<<ge.hash_bits,ge.hash_mask=ge.hash_size-1,ge.hash_shift=~~((ge.hash_bits+E-1)/E),ge.window=new o.Buf8(2*ge.w_size),ge.head=new o.Buf16(ge.hash_size),ge.prev=new o.Buf16(ge.w_size),ge.lit_bufsize=1<<ae+6,ge.pending_buf_size=4*ge.lit_bufsize,ge.pending_buf=new o.Buf8(ge.pending_buf_size),ge.d_buf=1*ge.lit_bufsize,ge.l_buf=3*ge.lit_bufsize,ge.level=he,ge.strategy=ie,ge.method=pe,V(q)}i=[new be(0,0,0,0,function(q,he){var pe=65535;for(pe>q.pending_buf_size-5&&(pe=q.pending_buf_size-5);;){if(q.lookahead<=1){if(W(q),q.lookahead===0&&he===d)return N;if(q.lookahead===0)break}q.strstart+=q.lookahead,q.lookahead=0;var U=q.block_start+pe;if((q.strstart===0||q.strstart>=U)&&(q.lookahead=q.strstart-U,q.strstart=U,J(q,!1),q.strm.avail_out===0)||q.strstart-q.block_start>=q.w_size-I&&(J(q,!1),q.strm.avail_out===0))return N}return q.insert=0,he===h?(J(q,!0),q.strm.avail_out===0?te:ne):(q.strstart>q.block_start&&(J(q,!1),q.strm.avail_out),N)}),new be(4,4,8,4,oe),new be(4,5,16,8,oe),new be(4,6,32,32,oe),new be(4,4,16,16,le),new be(8,16,32,32,le),new be(8,16,128,128,le),new be(8,32,128,256,le),new be(32,128,258,1024,le),new be(32,258,258,4096,le)],n.deflateInit=function(q,he){return de(q,he,x,15,8,0)},n.deflateInit2=de,n.deflateReset=V,n.deflateResetKeep=B,n.deflateSetHeader=function(q,he){return q&&q.state?q.state.wrap!==2?v:(q.state.gzhead=he,m):v},n.deflate=function(q,he){var pe,U,ae,ie;if(!q||!q.state||5<he||he<0)return q?ee(q,v):v;if(U=q.state,!q.output||!q.input&&q.avail_in!==0||U.status===666&&he!==h)return ee(q,q.avail_out===0?-5:v);if(U.strm=q,pe=U.last_flush,U.last_flush=he,U.status===L)if(U.wrap===2)q.adler=0,Q(U,31),Q(U,139),Q(U,8),U.gzhead?(Q(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),Q(U,255&U.gzhead.time),Q(U,U.gzhead.time>>8&255),Q(U,U.gzhead.time>>16&255),Q(U,U.gzhead.time>>24&255),Q(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),Q(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(Q(U,255&U.gzhead.extra.length),Q(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(q.adler=c(q.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=69):(Q(U,0),Q(U,0),Q(U,0),Q(U,0),Q(U,0),Q(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),Q(U,3),U.status=H);else{var ve=x+(U.w_bits-8<<4)<<8;ve|=(2<=U.strategy||U.level<2?0:U.level<6?1:U.level===6?2:3)<<6,U.strstart!==0&&(ve|=32),ve+=31-ve%31,U.status=H,_(U,ve),U.strstart!==0&&(_(U,q.adler>>>16),_(U,65535&q.adler)),q.adler=1}if(U.status===69)if(U.gzhead.extra){for(ae=U.pending;U.gzindex<(65535&U.gzhead.extra.length)&&(U.pending!==U.pending_buf_size||(U.gzhead.hcrc&&U.pending>ae&&(q.adler=c(q.adler,U.pending_buf,U.pending-ae,ae)),G(q),ae=U.pending,U.pending!==U.pending_buf_size));)Q(U,255&U.gzhead.extra[U.gzindex]),U.gzindex++;U.gzhead.hcrc&&U.pending>ae&&(q.adler=c(q.adler,U.pending_buf,U.pending-ae,ae)),U.gzindex===U.gzhead.extra.length&&(U.gzindex=0,U.status=73)}else U.status=73;if(U.status===73)if(U.gzhead.name){ae=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>ae&&(q.adler=c(q.adler,U.pending_buf,U.pending-ae,ae)),G(q),ae=U.pending,U.pending===U.pending_buf_size)){ie=1;break}ie=U.gzindex<U.gzhead.name.length?255&U.gzhead.name.charCodeAt(U.gzindex++):0,Q(U,ie)}while(ie!==0);U.gzhead.hcrc&&U.pending>ae&&(q.adler=c(q.adler,U.pending_buf,U.pending-ae,ae)),ie===0&&(U.gzindex=0,U.status=91)}else U.status=91;if(U.status===91)if(U.gzhead.comment){ae=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>ae&&(q.adler=c(q.adler,U.pending_buf,U.pending-ae,ae)),G(q),ae=U.pending,U.pending===U.pending_buf_size)){ie=1;break}ie=U.gzindex<U.gzhead.comment.length?255&U.gzhead.comment.charCodeAt(U.gzindex++):0,Q(U,ie)}while(ie!==0);U.gzhead.hcrc&&U.pending>ae&&(q.adler=c(q.adler,U.pending_buf,U.pending-ae,ae)),ie===0&&(U.status=103)}else U.status=103;if(U.status===103&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&G(q),U.pending+2<=U.pending_buf_size&&(Q(U,255&q.adler),Q(U,q.adler>>8&255),q.adler=0,U.status=H)):U.status=H),U.pending!==0){if(G(q),q.avail_out===0)return U.last_flush=-1,m}else if(q.avail_in===0&&ce(he)<=ce(pe)&&he!==h)return ee(q,-5);if(U.status===666&&q.avail_in!==0)return ee(q,-5);if(q.avail_in!==0||U.lookahead!==0||he!==d&&U.status!==666){var ge=U.strategy===2?(function(fe,je){for(var Ce;;){if(fe.lookahead===0&&(W(fe),fe.lookahead===0)){if(je===d)return N;break}if(fe.match_length=0,Ce=s._tr_tally(fe,0,fe.window[fe.strstart]),fe.lookahead--,fe.strstart++,Ce&&(J(fe,!1),fe.strm.avail_out===0))return N}return fe.insert=0,je===h?(J(fe,!0),fe.strm.avail_out===0?te:ne):fe.last_lit&&(J(fe,!1),fe.strm.avail_out===0)?N:Y})(U,he):U.strategy===3?(function(fe,je){for(var Ce,_e,rt,T,X=fe.window;;){if(fe.lookahead<=D){if(W(fe),fe.lookahead<=D&&je===d)return N;if(fe.lookahead===0)break}if(fe.match_length=0,fe.lookahead>=E&&0<fe.strstart&&(_e=X[rt=fe.strstart-1])===X[++rt]&&_e===X[++rt]&&_e===X[++rt]){T=fe.strstart+D;do;while(_e===X[++rt]&&_e===X[++rt]&&_e===X[++rt]&&_e===X[++rt]&&_e===X[++rt]&&_e===X[++rt]&&_e===X[++rt]&&_e===X[++rt]&&rt<T);fe.match_length=D-(T-rt),fe.match_length>fe.lookahead&&(fe.match_length=fe.lookahead)}if(fe.match_length>=E?(Ce=s._tr_tally(fe,1,fe.match_length-E),fe.lookahead-=fe.match_length,fe.strstart+=fe.match_length,fe.match_length=0):(Ce=s._tr_tally(fe,0,fe.window[fe.strstart]),fe.lookahead--,fe.strstart++),Ce&&(J(fe,!1),fe.strm.avail_out===0))return N}return fe.insert=0,je===h?(J(fe,!0),fe.strm.avail_out===0?te:ne):fe.last_lit&&(J(fe,!1),fe.strm.avail_out===0)?N:Y})(U,he):i[U.level].func(U,he);if(ge!==te&&ge!==ne||(U.status=666),ge===N||ge===te)return q.avail_out===0&&(U.last_flush=-1),m;if(ge===Y&&(he===1?s._tr_align(U):he!==5&&(s._tr_stored_block(U,0,0,!1),he===3&&(Z(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),G(q),q.avail_out===0))return U.last_flush=-1,m}return he!==h?m:U.wrap<=0?1:(U.wrap===2?(Q(U,255&q.adler),Q(U,q.adler>>8&255),Q(U,q.adler>>16&255),Q(U,q.adler>>24&255),Q(U,255&q.total_in),Q(U,q.total_in>>8&255),Q(U,q.total_in>>16&255),Q(U,q.total_in>>24&255)):(_(U,q.adler>>>16),_(U,65535&q.adler)),G(q),0<U.wrap&&(U.wrap=-U.wrap),U.pending!==0?m:1)},n.deflateEnd=function(q){var he;return q&&q.state?(he=q.state.status)!==L&&he!==69&&he!==73&&he!==91&&he!==103&&he!==H&&he!==666?ee(q,v):(q.state=null,he===H?ee(q,-3):m):v},n.deflateSetDictionary=function(q,he){var pe,U,ae,ie,ve,ge,fe,je,Ce=he.length;if(!q||!q.state||(ie=(pe=q.state).wrap)===2||ie===1&&pe.status!==L||pe.lookahead)return v;for(ie===1&&(q.adler=l(q.adler,he,Ce,0)),pe.wrap=0,Ce>=pe.w_size&&(ie===0&&(Z(pe.head),pe.strstart=0,pe.block_start=0,pe.insert=0),je=new o.Buf8(pe.w_size),o.arraySet(je,he,Ce-pe.w_size,pe.w_size,0),he=je,Ce=pe.w_size),ve=q.avail_in,ge=q.next_in,fe=q.input,q.avail_in=Ce,q.next_in=0,q.input=he,W(pe);pe.lookahead>=E;){for(U=pe.strstart,ae=pe.lookahead-(E-1);pe.ins_h=(pe.ins_h<<pe.hash_shift^pe.window[U+E-1])&pe.hash_mask,pe.prev[U&pe.w_mask]=pe.head[pe.ins_h],pe.head[pe.ins_h]=U,U++,--ae;);pe.strstart=U,pe.lookahead=E-1,W(pe)}return pe.strstart+=pe.lookahead,pe.block_start=pe.strstart,pe.insert=pe.lookahead,pe.lookahead=0,pe.match_length=pe.prev_length=E-1,pe.match_available=0,q.next_in=ge,q.input=fe,q.avail_in=ve,pe.wrap=ie,m},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(a,r,n){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(a,r,n){r.exports=function(i,o){var s,l,c,u,d,h,m,v,f,b,k,x,w,z,S,C,P,M,E,D,I,L,H,N,Y;s=i.state,l=i.next_in,N=i.input,c=l+(i.avail_in-5),u=i.next_out,Y=i.output,d=u-(o-i.avail_out),h=u+(i.avail_out-257),m=s.dmax,v=s.wsize,f=s.whave,b=s.wnext,k=s.window,x=s.hold,w=s.bits,z=s.lencode,S=s.distcode,C=(1<<s.lenbits)-1,P=(1<<s.distbits)-1;e:do{w<15&&(x+=N[l++]<<w,w+=8,x+=N[l++]<<w,w+=8),M=z[x&C];t:for(;;){if(x>>>=E=M>>>24,w-=E,(E=M>>>16&255)===0)Y[u++]=65535&M;else{if(!(16&E)){if((64&E)==0){M=z[(65535&M)+(x&(1<<E)-1)];continue t}if(32&E){s.mode=12;break e}i.msg="invalid literal/length code",s.mode=30;break e}D=65535&M,(E&=15)&&(w<E&&(x+=N[l++]<<w,w+=8),D+=x&(1<<E)-1,x>>>=E,w-=E),w<15&&(x+=N[l++]<<w,w+=8,x+=N[l++]<<w,w+=8),M=S[x&P];a:for(;;){if(x>>>=E=M>>>24,w-=E,!(16&(E=M>>>16&255))){if((64&E)==0){M=S[(65535&M)+(x&(1<<E)-1)];continue a}i.msg="invalid distance code",s.mode=30;break e}if(I=65535&M,w<(E&=15)&&(x+=N[l++]<<w,(w+=8)<E&&(x+=N[l++]<<w,w+=8)),m<(I+=x&(1<<E)-1)){i.msg="invalid distance too far back",s.mode=30;break e}if(x>>>=E,w-=E,(E=u-d)<I){if(f<(E=I-E)&&s.sane){i.msg="invalid distance too far back",s.mode=30;break e}if(H=k,(L=0)===b){if(L+=v-E,E<D){for(D-=E;Y[u++]=k[L++],--E;);L=u-I,H=Y}}else if(b<E){if(L+=v+b-E,(E-=b)<D){for(D-=E;Y[u++]=k[L++],--E;);if(L=0,b<D){for(D-=E=b;Y[u++]=k[L++],--E;);L=u-I,H=Y}}}else if(L+=b-E,E<D){for(D-=E;Y[u++]=k[L++],--E;);L=u-I,H=Y}for(;2<D;)Y[u++]=H[L++],Y[u++]=H[L++],Y[u++]=H[L++],D-=3;D&&(Y[u++]=H[L++],1<D&&(Y[u++]=H[L++]))}else{for(L=u-I;Y[u++]=Y[L++],Y[u++]=Y[L++],Y[u++]=Y[L++],2<(D-=3););D&&(Y[u++]=Y[L++],1<D&&(Y[u++]=Y[L++]))}break}}break}}while(l<c&&u<h);l-=D=w>>3,x&=(1<<(w-=D<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<h?h-u+257:257-(u-h),s.hold=x,s.bits=w}},{}],49:[function(a,r,n){var i=a("../utils/common"),o=a("./adler32"),s=a("./crc32"),l=a("./inffast"),c=a("./inftrees"),u=1,d=2,h=0,m=-2,v=1,f=852,b=592;function k(L){return(L>>>24&255)+(L>>>8&65280)+((65280&L)<<8)+((255&L)<<24)}function x(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(L){var H;return L&&L.state?(H=L.state,L.total_in=L.total_out=H.total=0,L.msg="",H.wrap&&(L.adler=1&H.wrap),H.mode=v,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new i.Buf32(f),H.distcode=H.distdyn=new i.Buf32(b),H.sane=1,H.back=-1,h):m}function z(L){var H;return L&&L.state?((H=L.state).wsize=0,H.whave=0,H.wnext=0,w(L)):m}function S(L,H){var N,Y;return L&&L.state?(Y=L.state,H<0?(N=0,H=-H):(N=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?m:(Y.window!==null&&Y.wbits!==H&&(Y.window=null),Y.wrap=N,Y.wbits=H,z(L))):m}function C(L,H){var N,Y;return L?(Y=new x,(L.state=Y).window=null,(N=S(L,H))!==h&&(L.state=null),N):m}var P,M,E=!0;function D(L){if(E){var H;for(P=new i.Buf32(512),M=new i.Buf32(32),H=0;H<144;)L.lens[H++]=8;for(;H<256;)L.lens[H++]=9;for(;H<280;)L.lens[H++]=7;for(;H<288;)L.lens[H++]=8;for(c(u,L.lens,0,288,P,0,L.work,{bits:9}),H=0;H<32;)L.lens[H++]=5;c(d,L.lens,0,32,M,0,L.work,{bits:5}),E=!1}L.lencode=P,L.lenbits=9,L.distcode=M,L.distbits=5}function I(L,H,N,Y){var te,ne=L.state;return ne.window===null&&(ne.wsize=1<<ne.wbits,ne.wnext=0,ne.whave=0,ne.window=new i.Buf8(ne.wsize)),Y>=ne.wsize?(i.arraySet(ne.window,H,N-ne.wsize,ne.wsize,0),ne.wnext=0,ne.whave=ne.wsize):(Y<(te=ne.wsize-ne.wnext)&&(te=Y),i.arraySet(ne.window,H,N-Y,te,ne.wnext),(Y-=te)?(i.arraySet(ne.window,H,N-Y,Y,0),ne.wnext=Y,ne.whave=ne.wsize):(ne.wnext+=te,ne.wnext===ne.wsize&&(ne.wnext=0),ne.whave<ne.wsize&&(ne.whave+=te))),0}n.inflateReset=z,n.inflateReset2=S,n.inflateResetKeep=w,n.inflateInit=function(L){return C(L,15)},n.inflateInit2=C,n.inflate=function(L,H){var N,Y,te,ne,ee,ce,Z,G,J,Q,_,K,W,oe,le,be,Oe,B,V,de,q,he,pe,U,ae=0,ie=new i.Buf8(4),ve=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!L||!L.state||!L.output||!L.input&&L.avail_in!==0)return m;(N=L.state).mode===12&&(N.mode=13),ee=L.next_out,te=L.output,Z=L.avail_out,ne=L.next_in,Y=L.input,ce=L.avail_in,G=N.hold,J=N.bits,Q=ce,_=Z,he=h;e:for(;;)switch(N.mode){case v:if(N.wrap===0){N.mode=13;break}for(;J<16;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(2&N.wrap&&G===35615){ie[N.check=0]=255&G,ie[1]=G>>>8&255,N.check=s(N.check,ie,2,0),J=G=0,N.mode=2;break}if(N.flags=0,N.head&&(N.head.done=!1),!(1&N.wrap)||(((255&G)<<8)+(G>>8))%31){L.msg="incorrect header check",N.mode=30;break}if((15&G)!=8){L.msg="unknown compression method",N.mode=30;break}if(J-=4,q=8+(15&(G>>>=4)),N.wbits===0)N.wbits=q;else if(q>N.wbits){L.msg="invalid window size",N.mode=30;break}N.dmax=1<<q,L.adler=N.check=1,N.mode=512&G?10:12,J=G=0;break;case 2:for(;J<16;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(N.flags=G,(255&N.flags)!=8){L.msg="unknown compression method",N.mode=30;break}if(57344&N.flags){L.msg="unknown header flags set",N.mode=30;break}N.head&&(N.head.text=G>>8&1),512&N.flags&&(ie[0]=255&G,ie[1]=G>>>8&255,N.check=s(N.check,ie,2,0)),J=G=0,N.mode=3;case 3:for(;J<32;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}N.head&&(N.head.time=G),512&N.flags&&(ie[0]=255&G,ie[1]=G>>>8&255,ie[2]=G>>>16&255,ie[3]=G>>>24&255,N.check=s(N.check,ie,4,0)),J=G=0,N.mode=4;case 4:for(;J<16;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}N.head&&(N.head.xflags=255&G,N.head.os=G>>8),512&N.flags&&(ie[0]=255&G,ie[1]=G>>>8&255,N.check=s(N.check,ie,2,0)),J=G=0,N.mode=5;case 5:if(1024&N.flags){for(;J<16;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}N.length=G,N.head&&(N.head.extra_len=G),512&N.flags&&(ie[0]=255&G,ie[1]=G>>>8&255,N.check=s(N.check,ie,2,0)),J=G=0}else N.head&&(N.head.extra=null);N.mode=6;case 6:if(1024&N.flags&&(ce<(K=N.length)&&(K=ce),K&&(N.head&&(q=N.head.extra_len-N.length,N.head.extra||(N.head.extra=new Array(N.head.extra_len)),i.arraySet(N.head.extra,Y,ne,K,q)),512&N.flags&&(N.check=s(N.check,Y,K,ne)),ce-=K,ne+=K,N.length-=K),N.length))break e;N.length=0,N.mode=7;case 7:if(2048&N.flags){if(ce===0)break e;for(K=0;q=Y[ne+K++],N.head&&q&&N.length<65536&&(N.head.name+=String.fromCharCode(q)),q&&K<ce;);if(512&N.flags&&(N.check=s(N.check,Y,K,ne)),ce-=K,ne+=K,q)break e}else N.head&&(N.head.name=null);N.length=0,N.mode=8;case 8:if(4096&N.flags){if(ce===0)break e;for(K=0;q=Y[ne+K++],N.head&&q&&N.length<65536&&(N.head.comment+=String.fromCharCode(q)),q&&K<ce;);if(512&N.flags&&(N.check=s(N.check,Y,K,ne)),ce-=K,ne+=K,q)break e}else N.head&&(N.head.comment=null);N.mode=9;case 9:if(512&N.flags){for(;J<16;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(G!==(65535&N.check)){L.msg="header crc mismatch",N.mode=30;break}J=G=0}N.head&&(N.head.hcrc=N.flags>>9&1,N.head.done=!0),L.adler=N.check=0,N.mode=12;break;case 10:for(;J<32;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}L.adler=N.check=k(G),J=G=0,N.mode=11;case 11:if(N.havedict===0)return L.next_out=ee,L.avail_out=Z,L.next_in=ne,L.avail_in=ce,N.hold=G,N.bits=J,2;L.adler=N.check=1,N.mode=12;case 12:if(H===5||H===6)break e;case 13:if(N.last){G>>>=7&J,J-=7&J,N.mode=27;break}for(;J<3;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}switch(N.last=1&G,J-=1,3&(G>>>=1)){case 0:N.mode=14;break;case 1:if(D(N),N.mode=20,H!==6)break;G>>>=2,J-=2;break e;case 2:N.mode=17;break;case 3:L.msg="invalid block type",N.mode=30}G>>>=2,J-=2;break;case 14:for(G>>>=7&J,J-=7&J;J<32;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if((65535&G)!=(G>>>16^65535)){L.msg="invalid stored block lengths",N.mode=30;break}if(N.length=65535&G,J=G=0,N.mode=15,H===6)break e;case 15:N.mode=16;case 16:if(K=N.length){if(ce<K&&(K=ce),Z<K&&(K=Z),K===0)break e;i.arraySet(te,Y,ne,K,ee),ce-=K,ne+=K,Z-=K,ee+=K,N.length-=K;break}N.mode=12;break;case 17:for(;J<14;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(N.nlen=257+(31&G),G>>>=5,J-=5,N.ndist=1+(31&G),G>>>=5,J-=5,N.ncode=4+(15&G),G>>>=4,J-=4,286<N.nlen||30<N.ndist){L.msg="too many length or distance symbols",N.mode=30;break}N.have=0,N.mode=18;case 18:for(;N.have<N.ncode;){for(;J<3;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}N.lens[ve[N.have++]]=7&G,G>>>=3,J-=3}for(;N.have<19;)N.lens[ve[N.have++]]=0;if(N.lencode=N.lendyn,N.lenbits=7,pe={bits:N.lenbits},he=c(0,N.lens,0,19,N.lencode,0,N.work,pe),N.lenbits=pe.bits,he){L.msg="invalid code lengths set",N.mode=30;break}N.have=0,N.mode=19;case 19:for(;N.have<N.nlen+N.ndist;){for(;be=(ae=N.lencode[G&(1<<N.lenbits)-1])>>>16&255,Oe=65535&ae,!((le=ae>>>24)<=J);){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(Oe<16)G>>>=le,J-=le,N.lens[N.have++]=Oe;else{if(Oe===16){for(U=le+2;J<U;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(G>>>=le,J-=le,N.have===0){L.msg="invalid bit length repeat",N.mode=30;break}q=N.lens[N.have-1],K=3+(3&G),G>>>=2,J-=2}else if(Oe===17){for(U=le+3;J<U;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}J-=le,q=0,K=3+(7&(G>>>=le)),G>>>=3,J-=3}else{for(U=le+7;J<U;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}J-=le,q=0,K=11+(127&(G>>>=le)),G>>>=7,J-=7}if(N.have+K>N.nlen+N.ndist){L.msg="invalid bit length repeat",N.mode=30;break}for(;K--;)N.lens[N.have++]=q}}if(N.mode===30)break;if(N.lens[256]===0){L.msg="invalid code -- missing end-of-block",N.mode=30;break}if(N.lenbits=9,pe={bits:N.lenbits},he=c(u,N.lens,0,N.nlen,N.lencode,0,N.work,pe),N.lenbits=pe.bits,he){L.msg="invalid literal/lengths set",N.mode=30;break}if(N.distbits=6,N.distcode=N.distdyn,pe={bits:N.distbits},he=c(d,N.lens,N.nlen,N.ndist,N.distcode,0,N.work,pe),N.distbits=pe.bits,he){L.msg="invalid distances set",N.mode=30;break}if(N.mode=20,H===6)break e;case 20:N.mode=21;case 21:if(6<=ce&&258<=Z){L.next_out=ee,L.avail_out=Z,L.next_in=ne,L.avail_in=ce,N.hold=G,N.bits=J,l(L,_),ee=L.next_out,te=L.output,Z=L.avail_out,ne=L.next_in,Y=L.input,ce=L.avail_in,G=N.hold,J=N.bits,N.mode===12&&(N.back=-1);break}for(N.back=0;be=(ae=N.lencode[G&(1<<N.lenbits)-1])>>>16&255,Oe=65535&ae,!((le=ae>>>24)<=J);){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(be&&(240&be)==0){for(B=le,V=be,de=Oe;be=(ae=N.lencode[de+((G&(1<<B+V)-1)>>B)])>>>16&255,Oe=65535&ae,!(B+(le=ae>>>24)<=J);){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}G>>>=B,J-=B,N.back+=B}if(G>>>=le,J-=le,N.back+=le,N.length=Oe,be===0){N.mode=26;break}if(32&be){N.back=-1,N.mode=12;break}if(64&be){L.msg="invalid literal/length code",N.mode=30;break}N.extra=15&be,N.mode=22;case 22:if(N.extra){for(U=N.extra;J<U;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}N.length+=G&(1<<N.extra)-1,G>>>=N.extra,J-=N.extra,N.back+=N.extra}N.was=N.length,N.mode=23;case 23:for(;be=(ae=N.distcode[G&(1<<N.distbits)-1])>>>16&255,Oe=65535&ae,!((le=ae>>>24)<=J);){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if((240&be)==0){for(B=le,V=be,de=Oe;be=(ae=N.distcode[de+((G&(1<<B+V)-1)>>B)])>>>16&255,Oe=65535&ae,!(B+(le=ae>>>24)<=J);){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}G>>>=B,J-=B,N.back+=B}if(G>>>=le,J-=le,N.back+=le,64&be){L.msg="invalid distance code",N.mode=30;break}N.offset=Oe,N.extra=15&be,N.mode=24;case 24:if(N.extra){for(U=N.extra;J<U;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}N.offset+=G&(1<<N.extra)-1,G>>>=N.extra,J-=N.extra,N.back+=N.extra}if(N.offset>N.dmax){L.msg="invalid distance too far back",N.mode=30;break}N.mode=25;case 25:if(Z===0)break e;if(K=_-Z,N.offset>K){if((K=N.offset-K)>N.whave&&N.sane){L.msg="invalid distance too far back",N.mode=30;break}W=K>N.wnext?(K-=N.wnext,N.wsize-K):N.wnext-K,K>N.length&&(K=N.length),oe=N.window}else oe=te,W=ee-N.offset,K=N.length;for(Z<K&&(K=Z),Z-=K,N.length-=K;te[ee++]=oe[W++],--K;);N.length===0&&(N.mode=21);break;case 26:if(Z===0)break e;te[ee++]=N.length,Z--,N.mode=21;break;case 27:if(N.wrap){for(;J<32;){if(ce===0)break e;ce--,G|=Y[ne++]<<J,J+=8}if(_-=Z,L.total_out+=_,N.total+=_,_&&(L.adler=N.check=N.flags?s(N.check,te,_,ee-_):o(N.check,te,_,ee-_)),_=Z,(N.flags?G:k(G))!==N.check){L.msg="incorrect data check",N.mode=30;break}J=G=0}N.mode=28;case 28:if(N.wrap&&N.flags){for(;J<32;){if(ce===0)break e;ce--,G+=Y[ne++]<<J,J+=8}if(G!==(4294967295&N.total)){L.msg="incorrect length check",N.mode=30;break}J=G=0}N.mode=29;case 29:he=1;break e;case 30:he=-3;break e;case 31:return-4;case 32:default:return m}return L.next_out=ee,L.avail_out=Z,L.next_in=ne,L.avail_in=ce,N.hold=G,N.bits=J,(N.wsize||_!==L.avail_out&&N.mode<30&&(N.mode<27||H!==4))&&I(L,L.output,L.next_out,_-L.avail_out)?(N.mode=31,-4):(Q-=L.avail_in,_-=L.avail_out,L.total_in+=Q,L.total_out+=_,N.total+=_,N.wrap&&_&&(L.adler=N.check=N.flags?s(N.check,te,_,L.next_out-_):o(N.check,te,_,L.next_out-_)),L.data_type=N.bits+(N.last?64:0)+(N.mode===12?128:0)+(N.mode===20||N.mode===15?256:0),(Q==0&&_===0||H===4)&&he===h&&(he=-5),he)},n.inflateEnd=function(L){if(!L||!L.state)return m;var H=L.state;return H.window&&(H.window=null),L.state=null,h},n.inflateGetHeader=function(L,H){var N;return L&&L.state?(2&(N=L.state).wrap)==0?m:((N.head=H).done=!1,h):m},n.inflateSetDictionary=function(L,H){var N,Y=H.length;return L&&L.state?(N=L.state).wrap!==0&&N.mode!==11?m:N.mode===11&&o(1,H,Y,0)!==N.check?-3:I(L,H,Y,Y)?(N.mode=31,-4):(N.havedict=1,h):m},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(a,r,n){var i=a("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,d,h,m,v,f,b,k){var x,w,z,S,C,P,M,E,D,I=k.bits,L=0,H=0,N=0,Y=0,te=0,ne=0,ee=0,ce=0,Z=0,G=0,J=null,Q=0,_=new i.Buf16(16),K=new i.Buf16(16),W=null,oe=0;for(L=0;L<=15;L++)_[L]=0;for(H=0;H<m;H++)_[d[h+H]]++;for(te=I,Y=15;1<=Y&&_[Y]===0;Y--);if(Y<te&&(te=Y),Y===0)return v[f++]=20971520,v[f++]=20971520,k.bits=1,0;for(N=1;N<Y&&_[N]===0;N++);for(te<N&&(te=N),L=ce=1;L<=15;L++)if(ce<<=1,(ce-=_[L])<0)return-1;if(0<ce&&(u===0||Y!==1))return-1;for(K[1]=0,L=1;L<15;L++)K[L+1]=K[L]+_[L];for(H=0;H<m;H++)d[h+H]!==0&&(b[K[d[h+H]]++]=H);if(P=u===0?(J=W=b,19):u===1?(J=o,Q-=257,W=s,oe-=257,256):(J=l,W=c,-1),L=N,C=f,ee=H=G=0,z=-1,S=(Z=1<<(ne=te))-1,u===1&&852<Z||u===2&&592<Z)return 1;for(;;){for(M=L-ee,D=b[H]<P?(E=0,b[H]):b[H]>P?(E=W[oe+b[H]],J[Q+b[H]]):(E=96,0),x=1<<L-ee,N=w=1<<ne;v[C+(G>>ee)+(w-=x)]=M<<24|E<<16|D|0,w!==0;);for(x=1<<L-1;G&x;)x>>=1;if(x!==0?(G&=x-1,G+=x):G=0,H++,--_[L]==0){if(L===Y)break;L=d[h+b[H]]}if(te<L&&(G&S)!==z){for(ee===0&&(ee=te),C+=N,ce=1<<(ne=L-ee);ne+ee<Y&&!((ce-=_[ne+ee])<=0);)ne++,ce<<=1;if(Z+=1<<ne,u===1&&852<Z||u===2&&592<Z)return 1;v[z=G&S]=te<<24|ne<<16|C-f|0}}return G!==0&&(v[C+G]=L-ee<<24|64<<16|0),k.bits=te,0}},{"../utils/common":41}],51:[function(a,r,n){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(a,r,n){var i=a("../utils/common"),o=0,s=1;function l(ae){for(var ie=ae.length;0<=--ie;)ae[ie]=0}var c=0,u=29,d=256,h=d+1+u,m=30,v=19,f=2*h+1,b=15,k=16,x=7,w=256,z=16,S=17,C=18,P=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],M=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(h+2));l(I);var L=new Array(2*m);l(L);var H=new Array(512);l(H);var N=new Array(256);l(N);var Y=new Array(u);l(Y);var te,ne,ee,ce=new Array(m);function Z(ae,ie,ve,ge,fe){this.static_tree=ae,this.extra_bits=ie,this.extra_base=ve,this.elems=ge,this.max_length=fe,this.has_stree=ae&&ae.length}function G(ae,ie){this.dyn_tree=ae,this.max_code=0,this.stat_desc=ie}function J(ae){return ae<256?H[ae]:H[256+(ae>>>7)]}function Q(ae,ie){ae.pending_buf[ae.pending++]=255&ie,ae.pending_buf[ae.pending++]=ie>>>8&255}function _(ae,ie,ve){ae.bi_valid>k-ve?(ae.bi_buf|=ie<<ae.bi_valid&65535,Q(ae,ae.bi_buf),ae.bi_buf=ie>>k-ae.bi_valid,ae.bi_valid+=ve-k):(ae.bi_buf|=ie<<ae.bi_valid&65535,ae.bi_valid+=ve)}function K(ae,ie,ve){_(ae,ve[2*ie],ve[2*ie+1])}function W(ae,ie){for(var ve=0;ve|=1&ae,ae>>>=1,ve<<=1,0<--ie;);return ve>>>1}function oe(ae,ie,ve){var ge,fe,je=new Array(b+1),Ce=0;for(ge=1;ge<=b;ge++)je[ge]=Ce=Ce+ve[ge-1]<<1;for(fe=0;fe<=ie;fe++){var _e=ae[2*fe+1];_e!==0&&(ae[2*fe]=W(je[_e]++,_e))}}function le(ae){var ie;for(ie=0;ie<h;ie++)ae.dyn_ltree[2*ie]=0;for(ie=0;ie<m;ie++)ae.dyn_dtree[2*ie]=0;for(ie=0;ie<v;ie++)ae.bl_tree[2*ie]=0;ae.dyn_ltree[2*w]=1,ae.opt_len=ae.static_len=0,ae.last_lit=ae.matches=0}function be(ae){8<ae.bi_valid?Q(ae,ae.bi_buf):0<ae.bi_valid&&(ae.pending_buf[ae.pending++]=ae.bi_buf),ae.bi_buf=0,ae.bi_valid=0}function Oe(ae,ie,ve,ge){var fe=2*ie,je=2*ve;return ae[fe]<ae[je]||ae[fe]===ae[je]&&ge[ie]<=ge[ve]}function B(ae,ie,ve){for(var ge=ae.heap[ve],fe=ve<<1;fe<=ae.heap_len&&(fe<ae.heap_len&&Oe(ie,ae.heap[fe+1],ae.heap[fe],ae.depth)&&fe++,!Oe(ie,ge,ae.heap[fe],ae.depth));)ae.heap[ve]=ae.heap[fe],ve=fe,fe<<=1;ae.heap[ve]=ge}function V(ae,ie,ve){var ge,fe,je,Ce,_e=0;if(ae.last_lit!==0)for(;ge=ae.pending_buf[ae.d_buf+2*_e]<<8|ae.pending_buf[ae.d_buf+2*_e+1],fe=ae.pending_buf[ae.l_buf+_e],_e++,ge===0?K(ae,fe,ie):(K(ae,(je=N[fe])+d+1,ie),(Ce=P[je])!==0&&_(ae,fe-=Y[je],Ce),K(ae,je=J(--ge),ve),(Ce=M[je])!==0&&_(ae,ge-=ce[je],Ce)),_e<ae.last_lit;);K(ae,w,ie)}function de(ae,ie){var ve,ge,fe,je=ie.dyn_tree,Ce=ie.stat_desc.static_tree,_e=ie.stat_desc.has_stree,rt=ie.stat_desc.elems,T=-1;for(ae.heap_len=0,ae.heap_max=f,ve=0;ve<rt;ve++)je[2*ve]!==0?(ae.heap[++ae.heap_len]=T=ve,ae.depth[ve]=0):je[2*ve+1]=0;for(;ae.heap_len<2;)je[2*(fe=ae.heap[++ae.heap_len]=T<2?++T:0)]=1,ae.depth[fe]=0,ae.opt_len--,_e&&(ae.static_len-=Ce[2*fe+1]);for(ie.max_code=T,ve=ae.heap_len>>1;1<=ve;ve--)B(ae,je,ve);for(fe=rt;ve=ae.heap[1],ae.heap[1]=ae.heap[ae.heap_len--],B(ae,je,1),ge=ae.heap[1],ae.heap[--ae.heap_max]=ve,ae.heap[--ae.heap_max]=ge,je[2*fe]=je[2*ve]+je[2*ge],ae.depth[fe]=(ae.depth[ve]>=ae.depth[ge]?ae.depth[ve]:ae.depth[ge])+1,je[2*ve+1]=je[2*ge+1]=fe,ae.heap[1]=fe++,B(ae,je,1),2<=ae.heap_len;);ae.heap[--ae.heap_max]=ae.heap[1],(function(X,se){var Se,Me,Be,De,nt,at,pt=se.dyn_tree,lt=se.max_code,Ct=se.stat_desc.static_tree,da=se.stat_desc.has_stree,Ot=se.stat_desc.extra_bits,Lt=se.stat_desc.extra_base,Zt=se.stat_desc.max_length,Ba=0;for(De=0;De<=b;De++)X.bl_count[De]=0;for(pt[2*X.heap[X.heap_max]+1]=0,Se=X.heap_max+1;Se<f;Se++)Zt<(De=pt[2*pt[2*(Me=X.heap[Se])+1]+1]+1)&&(De=Zt,Ba++),pt[2*Me+1]=De,lt<Me||(X.bl_count[De]++,nt=0,Lt<=Me&&(nt=Ot[Me-Lt]),at=pt[2*Me],X.opt_len+=at*(De+nt),da&&(X.static_len+=at*(Ct[2*Me+1]+nt)));if(Ba!==0){do{for(De=Zt-1;X.bl_count[De]===0;)De--;X.bl_count[De]--,X.bl_count[De+1]+=2,X.bl_count[Zt]--,Ba-=2}while(0<Ba);for(De=Zt;De!==0;De--)for(Me=X.bl_count[De];Me!==0;)lt<(Be=X.heap[--Se])||(pt[2*Be+1]!==De&&(X.opt_len+=(De-pt[2*Be+1])*pt[2*Be],pt[2*Be+1]=De),Me--)}})(ae,ie),oe(je,T,ae.bl_count)}function q(ae,ie,ve){var ge,fe,je=-1,Ce=ie[1],_e=0,rt=7,T=4;for(Ce===0&&(rt=138,T=3),ie[2*(ve+1)+1]=65535,ge=0;ge<=ve;ge++)fe=Ce,Ce=ie[2*(ge+1)+1],++_e<rt&&fe===Ce||(_e<T?ae.bl_tree[2*fe]+=_e:fe!==0?(fe!==je&&ae.bl_tree[2*fe]++,ae.bl_tree[2*z]++):_e<=10?ae.bl_tree[2*S]++:ae.bl_tree[2*C]++,je=fe,T=(_e=0)===Ce?(rt=138,3):fe===Ce?(rt=6,3):(rt=7,4))}function he(ae,ie,ve){var ge,fe,je=-1,Ce=ie[1],_e=0,rt=7,T=4;for(Ce===0&&(rt=138,T=3),ge=0;ge<=ve;ge++)if(fe=Ce,Ce=ie[2*(ge+1)+1],!(++_e<rt&&fe===Ce)){if(_e<T)for(;K(ae,fe,ae.bl_tree),--_e!=0;);else fe!==0?(fe!==je&&(K(ae,fe,ae.bl_tree),_e--),K(ae,z,ae.bl_tree),_(ae,_e-3,2)):_e<=10?(K(ae,S,ae.bl_tree),_(ae,_e-3,3)):(K(ae,C,ae.bl_tree),_(ae,_e-11,7));je=fe,T=(_e=0)===Ce?(rt=138,3):fe===Ce?(rt=6,3):(rt=7,4)}}l(ce);var pe=!1;function U(ae,ie,ve,ge){_(ae,(c<<1)+(ge?1:0),3),(function(fe,je,Ce,_e){be(fe),Q(fe,Ce),Q(fe,~Ce),i.arraySet(fe.pending_buf,fe.window,je,Ce,fe.pending),fe.pending+=Ce})(ae,ie,ve)}n._tr_init=function(ae){pe||((function(){var ie,ve,ge,fe,je,Ce=new Array(b+1);for(fe=ge=0;fe<u-1;fe++)for(Y[fe]=ge,ie=0;ie<1<<P[fe];ie++)N[ge++]=fe;for(N[ge-1]=fe,fe=je=0;fe<16;fe++)for(ce[fe]=je,ie=0;ie<1<<M[fe];ie++)H[je++]=fe;for(je>>=7;fe<m;fe++)for(ce[fe]=je<<7,ie=0;ie<1<<M[fe]-7;ie++)H[256+je++]=fe;for(ve=0;ve<=b;ve++)Ce[ve]=0;for(ie=0;ie<=143;)I[2*ie+1]=8,ie++,Ce[8]++;for(;ie<=255;)I[2*ie+1]=9,ie++,Ce[9]++;for(;ie<=279;)I[2*ie+1]=7,ie++,Ce[7]++;for(;ie<=287;)I[2*ie+1]=8,ie++,Ce[8]++;for(oe(I,h+1,Ce),ie=0;ie<m;ie++)L[2*ie+1]=5,L[2*ie]=W(ie,5);te=new Z(I,P,d+1,h,b),ne=new Z(L,M,0,m,b),ee=new Z(new Array(0),E,0,v,x)})(),pe=!0),ae.l_desc=new G(ae.dyn_ltree,te),ae.d_desc=new G(ae.dyn_dtree,ne),ae.bl_desc=new G(ae.bl_tree,ee),ae.bi_buf=0,ae.bi_valid=0,le(ae)},n._tr_stored_block=U,n._tr_flush_block=function(ae,ie,ve,ge){var fe,je,Ce=0;0<ae.level?(ae.strm.data_type===2&&(ae.strm.data_type=(function(_e){var rt,T=4093624447;for(rt=0;rt<=31;rt++,T>>>=1)if(1&T&&_e.dyn_ltree[2*rt]!==0)return o;if(_e.dyn_ltree[18]!==0||_e.dyn_ltree[20]!==0||_e.dyn_ltree[26]!==0)return s;for(rt=32;rt<d;rt++)if(_e.dyn_ltree[2*rt]!==0)return s;return o})(ae)),de(ae,ae.l_desc),de(ae,ae.d_desc),Ce=(function(_e){var rt;for(q(_e,_e.dyn_ltree,_e.l_desc.max_code),q(_e,_e.dyn_dtree,_e.d_desc.max_code),de(_e,_e.bl_desc),rt=v-1;3<=rt&&_e.bl_tree[2*D[rt]+1]===0;rt--);return _e.opt_len+=3*(rt+1)+5+5+4,rt})(ae),fe=ae.opt_len+3+7>>>3,(je=ae.static_len+3+7>>>3)<=fe&&(fe=je)):fe=je=ve+5,ve+4<=fe&&ie!==-1?U(ae,ie,ve,ge):ae.strategy===4||je===fe?(_(ae,2+(ge?1:0),3),V(ae,I,L)):(_(ae,4+(ge?1:0),3),(function(_e,rt,T,X){var se;for(_(_e,rt-257,5),_(_e,T-1,5),_(_e,X-4,4),se=0;se<X;se++)_(_e,_e.bl_tree[2*D[se]+1],3);he(_e,_e.dyn_ltree,rt-1),he(_e,_e.dyn_dtree,T-1)})(ae,ae.l_desc.max_code+1,ae.d_desc.max_code+1,Ce+1),V(ae,ae.dyn_ltree,ae.dyn_dtree)),le(ae),ge&&be(ae)},n._tr_tally=function(ae,ie,ve){return ae.pending_buf[ae.d_buf+2*ae.last_lit]=ie>>>8&255,ae.pending_buf[ae.d_buf+2*ae.last_lit+1]=255&ie,ae.pending_buf[ae.l_buf+ae.last_lit]=255&ve,ae.last_lit++,ie===0?ae.dyn_ltree[2*ve]++:(ae.matches++,ie--,ae.dyn_ltree[2*(N[ve]+d+1)]++,ae.dyn_dtree[2*J(ie)]++),ae.last_lit===ae.lit_bufsize-1},n._tr_align=function(ae){_(ae,2,3),K(ae,w,I),(function(ie){ie.bi_valid===16?(Q(ie,ie.bi_buf),ie.bi_buf=0,ie.bi_valid=0):8<=ie.bi_valid&&(ie.pending_buf[ie.pending++]=255&ie.bi_buf,ie.bi_buf>>=8,ie.bi_valid-=8)})(ae)}},{"../utils/common":41}],53:[function(a,r,n){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(a,r,n){(function(i){(function(o,s){if(!o.setImmediate){var l,c,u,d,h=1,m={},v=!1,f=o.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(o);b=b&&b.setTimeout?b:o,l={}.toString.call(o.process)==="[object process]"?function(z){process.nextTick(function(){x(z)})}:(function(){if(o.postMessage&&!o.importScripts){var z=!0,S=o.onmessage;return o.onmessage=function(){z=!1},o.postMessage("","*"),o.onmessage=S,z}})()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(z){o.postMessage(d+z,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(z){x(z.data)},function(z){u.port2.postMessage(z)}):f&&"onreadystatechange"in f.createElement("script")?(c=f.documentElement,function(z){var S=f.createElement("script");S.onreadystatechange=function(){x(z),S.onreadystatechange=null,c.removeChild(S),S=null},c.appendChild(S)}):function(z){setTimeout(x,0,z)},b.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var S=new Array(arguments.length-1),C=0;C<S.length;C++)S[C]=arguments[C+1];var P={callback:z,args:S};return m[h]=P,l(h),h++},b.clearImmediate=k}function k(z){delete m[z]}function x(z){if(v)setTimeout(x,0,z);else{var S=m[z];if(S){v=!0;try{(function(C){var P=C.callback,M=C.args;switch(M.length){case 0:P();break;case 1:P(M[0]);break;case 2:P(M[0],M[1]);break;case 3:P(M[0],M[1],M[2]);break;default:P.apply(s,M)}})(S)}finally{k(z),v=!1}}}}function w(z){z.source===o&&typeof z.data=="string"&&z.data.indexOf(d)===0&&x(+z.data.slice(d.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Soe)),Soe.exports}var Tst=Mst();const Bst=Hr(Tst),Est=Object.freeze(Object.defineProperty({__proto__:null,default:Bst},Symbol.toStringTag,{value:"Module"}));function Coe({value:e=!1,disabled:t=!1,onChange:a,onFocus:r,stopPropagation:n=!1,className:i}){const o=l=>{t||(n&&l.stopPropagation(),a(!e))},s=l=>{n&&l.stopPropagation(),r?.()};return p.jsx(Rst,{tabIndex:t?-1:0,onFocus:s,onClick:o,role:"switch","aria-checked":e,"aria-disabled":t,selected:e,disabled:t,className:i,children:p.jsx(_st,{selected:e,disabled:t})})}const Rst=R.div`
10907
10907
  width: var(--switch-width);
10908
10908
  height: var(--switch-height);
@@ -12536,7 +12536,7 @@ $3`);return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function h7t(e){return e.
12536
12536
  `];let k=-1,x=0;for(const w of b){const z=e.indexOf(w,u);if(z!==-1&&z<l.start){k=z,x=w.length;break}}if(k!==-1)d=k+x;else{const w=[`
12537
12537
  `,`\r
12538
12538
  `];for(const z of w){const S=e.indexOf(z,u);if(S!==-1&&S<l.start){d=S+z.length;break}}}}const f=l.start;t.push({boundaryStart:s.start,boundaryEnd:s.end,headersStart:c,headersEnd:u,bodyStart:d,bodyEnd:f,contentType:h})}return t}const J7t=()=>br.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){const t=e.state.doc.toString(),a=[],r=jt.mark({attributes:{style:"color: var(--color-carrot-8); font-weight: var(--font-weight-semibold);"}}),n=jt.mark({attributes:{style:"color: var(--color-blue-8);"}}),i=jt.mark({attributes:{style:"color: var(--color-purple-8);"}}),o=Z7t(t),s=/^--[a-zA-Z0-9_\-\.]+(?:--)?(?:\r?\n|$)/gm,l=[];let c;for(;(c=s.exec(t))!==null;)l.push({start:c.index,end:c.index+c[0].length});for(const v of l)e.visibleRanges.some(f=>Math.max(f.from,v.start)<Math.min(f.to,v.end))&&a.push({from:v.start,to:v.end,value:r});const u=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;for(const v of o){u.lastIndex=v.headersStart;let f;for(;(f=u.exec(t))!==null&&f.index<v.headersEnd;){const b=f.index+f[1].length+1+(f[2].match(/^\s*/)?.[0]?.length||0),k=f.index+f[0].length-(f[0].match(/\r?\n$/)?.[0]?.length||0);e.visibleRanges.some(x=>Math.max(x.from,b)<Math.min(x.to,k))&&k>b&&a.push({from:b,to:k,value:n})}}const d=/\[Binary\s+Data\]/gi;let h;for(;(h=d.exec(t))!==null;){const v=h.index,f=h[0].length;e.visibleRanges.some(b=>Math.max(b.from,v)<Math.min(b.to,v+f))&&a.push({from:v,to:v+f,value:i})}const m=jt.mark({attributes:{style:"color: var(--color-blue-8);"}});for(const v of o)if(v.contentType?.includes("json")){const f=t.slice(v.bodyStart,v.bodyEnd),b=f.trim();if(!b)continue;const k=f.length-f.trimStart().length,x=v.bodyStart+k;let w;try{const S=Py.create("inmemory://model.json","json",0,b),C=Q7t.parseJSONDocument(S)?.root;w=U7t(C)?C:void 0}catch{w=void 0}if(!w)continue;const z=W7t(w);for(const S of z){const C=x+S.from,P=x+S.to;if(!e.visibleRanges.some(D=>Math.max(D.from,C)<Math.min(D.to,P))||!(t[C]==='"'&&t[P-1]==='"'))continue;const M=C+1,E=P-1;E<=M||a.push({from:M,to:E,value:m})}}return jt.set(a,!0)}},{decorations:e=>e.decorations}),X7t=()=>br.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){const t=e.state.doc.toString(),a=[],r=jt.mark({attributes:{style:"color: var(--color-blue-8);"}}),n=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;let i;for(;(i=n.exec(t))!==null;){let o=i.index+i[1].length+1;for(;o<t.length&&/\s/.test(t[o]);)o++;const s=i.index+i[0].length-(i[0].match(/\r?\n$/)?.[0]?.length||0);s<=o||!e.visibleRanges.some(l=>Math.max(l.from,o)<Math.min(l.to,s))||a.push({from:o,to:s,value:r})}return jt.set(a,!0)}},{decorations:e=>e.decorations}),Y7t=Y5({});function e_t(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.type=="string"&&typeof t.offset=="number"&&typeof t.length=="number"}function t_t(e){const t=[];if(!e)return t;const a=[e];for(;a.length>0;){const r=a.pop();if(r.type==="property"){r.valueNode&&a.push(r.valueNode);continue}if(r.type==="string"){const n=r.offset,i=r.offset+r.length;i>n&&t.push({from:n,to:i})}if(r.children&&r.children.length)for(const n of r.children)a.push(n)}return t}const pI=()=>br.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){const t=e.state.doc.toString(),a=[],r=jt.mark({attributes:{style:"color: var(--color-blue-8);"}}),n=jt.mark({attributes:{style:"color: var(--code-block-tokens-keyword-color); font-weight: var(--font-weight-bold);"}}),i=t.split(/\r?\n/);let o=0;for(let s=0;s<i.length;s++){const l=i[s],c=o,u=o+l.length;if(!l.trim()){o=u+(t[o+l.length]==="\r"?2:1);continue}let d=c,h=l;l.startsWith("0x1E")?(d=c+4,h=l.substring(4),a.push({from:c,to:c+4,value:n})):l.charCodeAt(0)===30&&(d=c+1,h=l.substring(1),a.push({from:c,to:c+1,value:n})),l.endsWith("0x0A")?(h=h.substring(0,h.length-4),a.push({from:u-4,to:u,value:n})):l.charCodeAt(l.length-1)===10&&(h=h.substring(0,h.length-1),a.push({from:u-1,to:u,value:n}));let m;try{const f=Py.create("inmemory://model.json","json",0,h),b=Y7t.parseJSONDocument(f)?.root;m=e_t(b)?b:void 0}catch{m=void 0}if(!m){o=u+(t[o+l.length]==="\r"?2:1);continue}const v=t_t(m);for(const f of v){const b=d+f.from,k=d+f.to;if(!e.visibleRanges.some(z=>Math.max(z.from,b)<Math.min(z.to,k))||!(t[b]==='"'&&t[k-1]==='"'))continue;const x=b+1,w=k-1;w<=x||a.push({from:x,to:w,value:r})}o=u+(t[o+l.length]==="\r"?2:1)}return jt.set(a,!0)}},{decorations:e=>e.decorations}),By={[oi.Text]:{name:"Text",extensions:[yt.lineWrapping],stateExtensions:[dI]},[oi.JSON]:{name:"JSON",extensions:[f1e(),jBt(D7t(),{delay:0,needsRefresh:e=>e.transactions.some(t=>t.effects.some(a=>a.is(POe)))}),g1e.data.of({autocomplete:I7t()}),$7t],stateExtensions:[N7t,q7t]},[oi.XML]:{name:"XML",extensions:[gBt()],stateExtensions:[dI]}},AOe={[oi.MultipartMixed]:{name:"Multipart Mixed",extensions:[yt.lineWrapping],stateExtensions:[J7t]},[oi.JSONL]:{name:"JSON Lines",extensions:[yt.lineWrapping],stateExtensions:[pI]},[oi.NDJSON]:{name:"NDJSON",extensions:[f1e(),yt.lineWrapping],stateExtensions:[pI]},[oi.JSONSeq]:{name:"JSON Sequence",extensions:[yt.lineWrapping],stateExtensions:[pI]},[oi.TextStream]:{name:"SSE",extensions:[yt.lineWrapping],stateExtensions:[X7t]}},MOe={[oi.Image]:{name:"Image",extensions:[],stateExtensions:[]}},TOe={[oi.HTML]:{name:"HTML",extensions:[F9t()],stateExtensions:[dI]}},Lw={...By,...MOe,...TOe,...AOe},hI={...By,...MOe,...TOe},sf={...By,...AOe},BOe={[oi.FormData]:{name:"form-data",extensions:void 0},[oi["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},EOe={[oi.Binary]:{name:"Binary",extensions:void 0}},lf={...By,...BOe,...EOe},a_t=Object.keys(By),tM=Object.keys(BOe),ROe=Object.keys(EOe);function _Oe(e=[],t){const a={};return e.forEach(r=>{const n=String(r[t]);a[n]||(a[n]=[]),a[n].push(r)}),a}const Nw={active:!0,key:"",value:""};function cf(e,t){return[...e.map(a=>({id:crypto.randomUUID(),key:a.name,value:t.initializeWithInputs?`$inputs.${a.name}`:a.example?String(a.example):"",active:t.initializeWithInputs?!0:!!a.example,in:a.in,...a.allowReserved&&{allowReserved:a.allowReserved}})),pn(t.in)]}function Dw(e,t){const[a]=e.split("?"),r=t.slice(0,-1).filter(n=>n.active).map(n=>`${n.key}=${n.value}`).join("&");return`${a}${r?`?${r}`:""}`}function Pc(){return{id:crypto.randomUUID(),...Nw}}function fl(){return{id:crypto.randomUUID(),...Nw,description:""}}function pn(e){return{...Nw,id:crypto.randomUUID(),in:e}}function Mp(){return{id:crypto.randomUUID(),...Nw,type:"text",files:null}}function mI(){return{id:crypto.randomUUID(),...Nw,sendIn:as.URL}}function gI(e){return e.map(t=>({id:crypto.randomUUID(),key:"",value:t,active:!0}))}function aM(e,t){return e.filter(a=>a.active&&a.value).map(({value:a})=>(t?Dr(a,t):a).trim())}function gm(e,t){const a=t.filter(r=>!!r).flatMap(r=>r).filter(r=>r.key&&r.active);return["path","header"].includes(e)?Array.from(new Map(a.map(r=>[r.key,r])).values()):a}function r_t(e,t){return e.map(({value:a,...r})=>({...r,value:Dr(a,t)}))}function n_t(e,t){if(!e.startsWith("$components.parameters."))return null;const a=e.replace("$components.parameters.","");return a&&t[a]||null}function Hn(e=[],t={}){const a=[];for(const r of e)if(Hh(r)){const n=n_t(r.reference,t);n&&a.push({...n,active:r.active,value:r.value||n.value})}else a.push(r);return a}function fm(e){return Object.entries(e).map(([t,a])=>({id:crypto.randomUUID(),key:"",value:t,active:!0,description:a}))}function i_t(e,t){return[...e.flatMap(a=>{const r=a.schema,n=r?.fields||[];return n.length>0?n.flatMap(i=>LOe(i.name,i.example,a.allowReserved)):LOe(a.name,r?.example??a.example,a.allowReserved)}),pn("query")]}function LOe(e,t,a){if(t===void 0)return[vI(e,"",!1,a)];const r=fI(t,e);return r.length===0?[vI(e,"",!1,a)]:r.map(n=>vI(n.key,n.value,!0,a))}function fI(e,t){return e===void 0?[]:e===null?[{key:t,value:""}]:Array.isArray(e)?e.flatMap((a,r)=>a!==null&&typeof a=="object"?fI(a,`${t}[${r}]`):[{key:t,value:String(a)}]):o_t(e)?Object.entries(e).flatMap(([a,r])=>fI(r,`${t}[${a}]`)):[{key:t,value:String(e)}]}function o_t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vI(e,t,a,r){return{id:crypto.randomUUID(),key:e,value:t,active:a,in:"query",...r&&{allowReserved:r}}}function s_t(e){return e.replace(/{/g,"{{").replace(/}/g,"}}")}const NOe={documentedOAuth2Types:[],grantType:Ze.ClientCredentials,authRequestExtraParams:[Pc()],tokenRequestExtraParams:[mI()],[Ze.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[fl()],accessToken:""},[Ze.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[fl()],accessToken:""},[Ze.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[fl()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ze.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[fl()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ze.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[fl()],accessToken:""},[Ze.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[fl()]}},l_t={securityType:qe.NoAuth,securitySchemeId:null,[qe.BasicAuth]:{username:"",password:""},[qe.JWT]:{token:""},[qe.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[qe.APIKey]:{location:Rl.Header,name:"",key:""},[qe.OAuth2]:NOe,[qe.OpenIDConnect]:{...NOe,openIdConnectUrl:"",userInfoUrl:""}},bI="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",c_t={[ls.SIMPLE]:{condition:"",type:ls.SIMPLE},[ls.REGEX]:{condition:"",type:ls.REGEX,context:""},[ls.JSONPATH]:{condition:"",type:ls.JSONPATH,context:""},[ls.XPATH]:{condition:"",type:ls.XPATH,context:""}};function rM(){return structuredClone({type:Ui.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[Mp()],"application/x-www-form-urlencoded":[Mp()]},binary:null})}const u_t={method:"GET",url:"",security:[mu()],body:rM(),queryParameters:[Pc()],headers:[Pc()],cookies:[Pc()],pathParameters:[Pc()]};function DOe(){return structuredClone(u_t)}function mu(){return pd(l_t)}function d_t(e){return pd({id:crypto.randomUUID(),...c_t[e]})}function $Oe(e,t,a){for(const r of a){const n=IOe(e,r),i=IOe(t,r);if(typeof n=="object"&&typeof i=="object"){if(!$Oe(n,i,a))return!1}else if(n!==i)return!1}return!0}function IOe(e,t){const a=t.split("/");let r=e;for(const n of a)if(r&&typeof r=="object"&&n in r)r=r[n];else return;return r}function p_t(e,t){return e.length===t.length&&e.sort().join()===t.sort().join()}function h_t(e,t){return e.every(a=>t.includes(a))}function m_t(e){switch(e){case"query":return Rl.Query;case"cookie":return Rl.Cookie;case"header":return Rl.Header;default:return}}function g_t(e,t,a){const{security:r}=t,n=nCt(e);if(!a)return!1;const i=yI(a),o=i.map(c=>c.securityType),s=r.map(c=>c.securityType);if(!p_t(o,s))return!0;let l=[];return r.forEach(c=>{const u=c.securityType,d=c[qe.OAuth2]?.grantType,h=o.includes(u),m=i.find(k=>k.securityType===u),v=!m||$Oe(c,m,v_t(u,d)),f=f_t(c,u,c[qe.OAuth2]?.grantType,n),b=!!(h&&m&&v&&f);l.push(!a.security?.length||b)}),l.includes(!1)}function f_t(e,t,a,r){if(t===qe.OAuth2&&(a===Ze.AuthorizationCode||a===Ze.AuthorizationCodeWithPkce||a===Ze.Implicit)){const n=e[qe.OAuth2][a]?.availableScopes,i=aM(e[qe.OAuth2][a]?.scopes,r);return h_t(i,n)}return!0}function v_t(e,t){return e===qe.APIKey?[`${qe.APIKey}/name`,`${qe.APIKey}/location`]:e===qe.OAuth2?[`${qe.OAuth2}/grantType`,...b_t(t)]:e===qe.OpenIDConnect?[`${qe.OpenIDConnect}/openIdConnectUrl`]:[]}function b_t(e){return e===Ze.ClientCredentials?[`${qe.OAuth2}/${Ze.ClientCredentials}/tokenUrl`]:e===Ze.Password?[`${qe.OAuth2}/${Ze.Password}/tokenUrl`]:e===Ze.Implicit?[`${qe.OAuth2}/${Ze.Implicit}/authorizationUrl`]:e===Ze.AuthorizationCode?[`${qe.OAuth2}/${Ze.AuthorizationCode}/tokenUrl`,`${qe.OAuth2}/${Ze.AuthorizationCode}/authorizationUrl`]:e===Ze.AuthorizationCodeWithPkce?[`${qe.OAuth2}/${Ze.AuthorizationCodeWithPkce}/tokenUrl`,`${qe.OAuth2}/${Ze.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function y_t(e){return e.map(t=>{const a=t.map(r=>r.id).join("_");return t.map(r=>({...r,schemeId:a}))})}function k_t(e){const t=e.security||[],a=t.map(r=>{let n="";const i=[];return r.forEach((o,s)=>{n=s===0?`${o.id}`:`${n}_${o.id}`,i.push(kI(o))}),{id:n,security:i}});return t.length?a:[]}function x_t(e,t){const a=e.security||[];return a?.length?qOe(a).map((r,n)=>kI(r)):[]}function yI(e){const t=(e.security||[])[0];return t?t.map(a=>kI(a)):[mu()]}function kI(e,t){const a={...mu(),securitySchemeId:e.id},r=nM(e);a.securityType=r;const n=e.id;if(e.id&&r!==qe.NoAuth&&(a[r].schemeName=e.id),r===qe.BasicAuth&&(a[qe.BasicAuth].username||(a[qe.BasicAuth].username=Bn(n+ga.Username)),a[qe.BasicAuth].password||(a[qe.BasicAuth].password=Bn(n+ga.Password))),r===qe.DigestAuth&&(a[qe.DigestAuth].username||(a[qe.DigestAuth].username=Bn(n+ga.Username)),a[qe.DigestAuth].password||(a[qe.DigestAuth].password=Bn(n+ga.Password))),r===qe.JWT&&!a[qe.JWT].token&&(a[qe.JWT].token=Bn(n+ga.JWTToken)),r===qe.APIKey&&!a[qe.APIKey].key){a[qe.APIKey].name=e.name||"",a[qe.APIKey].key=Bn(n+ga.APIKey);const i=m_t(e.in);i&&(a[qe.APIKey].location=i)}if(r===qe.OAuth2){const i=OI(e),o=Bn(n+ga.Token),s=a[qe.OAuth2];s.grantType=i[0],i.forEach(l=>{l===Ze.AuthorizationCode&&!s[Ze.AuthorizationCode].accessToken&&(s[Ze.AuthorizationCode].accessToken=o,s[Ze.AuthorizationCode].clientId=Bn(n+ga.ClientId),s[Ze.AuthorizationCode].authorizationUrl=e.flows?.authorizationCode?.authorizationUrl||"",s[Ze.AuthorizationCode].tokenUrl=e.flows?.authorizationCode?.tokenUrl||"",s[Ze.AuthorizationCode].clientSecret=Bn(n+ga.ClientSecret),s[Ze.AuthorizationCode].availableScopes=Object.keys(e.flows?.authorizationCode?.scopes||{})||[],s[Ze.AuthorizationCode].scopes=[...fm(e.flows?.authorizationCode?.scopes||{})||[],fl()]),l===Ze.AuthorizationCodeWithPkce&&!s[Ze.AuthorizationCodeWithPkce].accessToken&&(s[Ze.AuthorizationCodeWithPkce].accessToken=o,s[Ze.AuthorizationCodeWithPkce].clientId=Bn(n+ga.ClientId),s[Ze.AuthorizationCodeWithPkce].authorizationUrl=e.flows?.authorizationCode?.authorizationUrl||"",s[Ze.AuthorizationCodeWithPkce].tokenUrl=e.flows?.authorizationCode?.tokenUrl||"",s[Ze.AuthorizationCodeWithPkce].clientSecret=Bn(n+ga.ClientSecret),s[Ze.AuthorizationCodeWithPkce].availableScopes=Object.keys(e.flows?.authorizationCode?.scopes||{})||[],s[Ze.AuthorizationCodeWithPkce].scopes=[...fm(e.flows?.authorizationCode?.scopes||{}),fl()]),l===Ze.ClientCredentials&&!s[Ze.ClientCredentials].accessToken&&(s[Ze.ClientCredentials].accessToken=o,s[Ze.ClientCredentials].clientId=Bn(n+ga.ClientId),s[Ze.ClientCredentials].clientSecret=Bn(n+ga.ClientSecret),s[Ze.ClientCredentials].tokenUrl=e.flows?.clientCredentials?.tokenUrl||"",s[Ze.ClientCredentials].scopes=[...fm(e.flows?.clientCredentials?.scopes||{}),fl()]),l===Ze.ClientCredentialsWithJwtAssertion&&!s[Ze.ClientCredentialsWithJwtAssertion].accessToken&&(s[Ze.ClientCredentialsWithJwtAssertion].accessToken=o,s[Ze.ClientCredentialsWithJwtAssertion].clientId=Bn(n+ga.ClientId),s[Ze.ClientCredentialsWithJwtAssertion].clientAssertion=Bn(n+ga.ClientAssertion),s[Ze.ClientCredentialsWithJwtAssertion].scopes=[...fm(e.flows?.clientCredentials?.scopes||{}),fl()]),l===Ze.Implicit&&!s[Ze.Implicit].accessToken&&(s[Ze.Implicit].accessToken=o,s[Ze.Implicit].clientId=Bn(n+ga.ClientId),s[Ze.Implicit].authorizationUrl=e.flows?.implicit?.authorizationUrl||"",s[Ze.Implicit].availableScopes=Object.keys(e.flows?.implicit?.scopes||{})||[],s[Ze.Implicit].scopes=[...fm(e.flows?.implicit?.scopes||{}),fl()]),l===Ze.Password&&!s[Ze.Password].accessToken&&(s[Ze.Password].accessToken=o,s[Ze.Password].clientId=Bn(n+ga.ClientId),s[Ze.Password].clientSecret=Bn(n+ga.ClientSecret),s[Ze.Password].tokenUrl=e.flows?.password?.tokenUrl||"",s[Ze.Password].scopes=[...fm(e.flows?.password?.scopes||{}),fl()])})}if(r===qe.OpenIDConnect){const i=Bn(n+ga.Token),o=a[qe.OpenIDConnect];o[Ze.AuthorizationCode].accessToken||(o[Ze.AuthorizationCode].accessToken=i,o[Ze.AuthorizationCode].clientId=Bn(n+ga.ClientId),o[Ze.AuthorizationCode].clientSecret=Bn(n+ga.ClientSecret),o[Ze.AuthorizationCode].tokenUrl=e.flows?.authorizationCode?.tokenUrl||""),o[Ze.AuthorizationCodeWithPkce].accessToken||(o[Ze.AuthorizationCodeWithPkce].accessToken=i,o[Ze.AuthorizationCodeWithPkce].clientId=Bn(n+ga.ClientId),o[Ze.AuthorizationCodeWithPkce].clientSecret=Bn(n+ga.ClientSecret),o[Ze.AuthorizationCodeWithPkce].tokenUrl=e.flows?.authorizationCode?.tokenUrl||""),o[Ze.Implicit].accessToken||(o[Ze.Implicit].accessToken=i,o[Ze.Implicit].clientId=Bn(n+ga.ClientId))}return a}function VOe(e){try{const t=JSON.parse(e);return JSON.stringify(t,null,2)}catch(t){return console.error({error:t}),e}}function KOe(e,t){return t&&t.length>0?i_t(t):cf(e||[],{in:"query"})}function w_t(e,t=!1,a="",r){const n=_Oe(e.parameters,"in"),i=HOe(e),o=yI(e),s=KOe(n.query,n.querystring);return{id:crypto.randomUUID(),name:e.name,operationId:e.operationId,collectionPath:r,apiPath:{path:e.path,method:e.method},apiId:a,isAdditionalOperation:t,request:{pathParameters:cf(n.path||[],{in:"path"}),method:e.method.toLowerCase()==="x-query"?"QUERY":e.method.toLocaleUpperCase(),url:Dw(s_t(e.path),s),headers:cf(n.header||[],{in:"header"}),queryParameters:s,cookies:cf(n.cookie||[],{in:"cookie"}),body:i,security:o},response:null}}function xI(e){const t=_Oe(e.parameters,"in"),a=HOe(e),r=yI(e);return{parameters:{queryParameters:KOe(t.query,t.querystring),headers:cf(t.header||[],{in:"header"}),cookies:cf(t.cookie||[],{in:"cookie"}),pathParameters:cf(t.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:r}}function O_t(e,t){const a=new op({format:!0});if(typeof e=="string")return t?.includes("json")?VOe(e):e;if(typeof e=="object"&&e!==null&&t?.includes("xml")){const r=Array.isArray(e)?e:{root:e};return a.build(r)}return JSON.stringify(e,null,2)}function HOe(e){const t=e.body?.mediaTypes;if(!t||!Object.keys(t).length)return rM();const a=S_t(t,e),r=a?.name||"",n=!tM.includes(r)&&!ROe.includes(r),i=wI(a),o=i.find(({key:l})=>l===e.body?.activeExampleName)?.value??i[0]?.value,s=n&&o?O_t(o,r):"";return{...rM(),activeExampleName:e.body?.activeExampleName||i[0]?.key||"",...a&&{type:a.name},content:s,formData:{"multipart/form-data":FOe(t[oi.FormData]),"application/x-www-form-urlencoded":FOe(t[oi["application/x-www-form-urlencoded"]])}}}function GOe(e){return e?{...(Object.keys(e?.body?.mediaTypes||{})||[]).reduce((t,a)=>(t[a]={name:a,extensions:void 0},t),{}),...lf}:lf}function FOe(e){if(!e)return[Mp()];if(!e.parameters)return[Mp()];const t=e.parameters.map(a=>({id:crypto.randomUUID(),key:a.name,value:String(a.example)||"",active:!0,type:a.inputType,files:null}));return t.push(Mp()),t}function wI(e){const t=e?.examples;return Object.keys(t||{}).map(a=>{const r=t?.[a];return{name:tg(r?.summary)?r?.summary:r?.summary?.raw||a,key:a,value:t?.[a].value}})}function S_t(e,t){const a=GOe(t),r=Object.keys(e).find(n=>!!a[n]);return r?e[r]:null}function z_t(e){return!e?.security?.length||!e?[]:x_t(e)}function qOe(e){const t=new Set;return e.flat().filter(a=>t.has(a.id)?!1:(t.add(a.id),!0))}function nM(e){if(e.type==="http"){if(e.scheme==="bearer")return qe.JWT;if(e.scheme==="basic")return qe.BasicAuth;if(e.scheme==="digest")return qe.DigestAuth}else{if(e.type==="apiKey")return qe.APIKey;if(e.type==="oauth2")return qe.OAuth2;if(e.type==="openIdConnect")return qe.OpenIDConnect}return qe.NoAuth}function C_t(e,t){if(e==="clientCredentials"&&t&&"x-assertionType"in t&&t["x-assertionType"]===bI)return Ze.ClientCredentialsWithJwtAssertion;if(e==="authorizationCode"&&t&&"x-usePkce"in t&&t["x-usePkce"])return Ze.AuthorizationCodeWithPkce;switch(e){case"implicit":return Ze.Implicit;case"password":return Ze.Password;case"clientCredentials":return Ze.ClientCredentials;case"authorizationCode":return Ze.AuthorizationCode;default:return Ze.AuthorizationCode}}function j_t(e,t){const a=e?.security;if(!a?.length)return[];const r=y_t(a).flat().filter(n=>n.schemeId===t).find(n=>nM(n)===qe.OAuth2);return OI(r)}function OI(e){return Object.entries(e?.flows||{}).map(([t,a])=>C_t(t,a)).filter(Boolean)}async function $w(e){try{const t=await _ve(e),a=await rN(e);return{absolutePath:e,file:new File([t],a)}}catch(t){return console.error("Failed to init replay file",t),null}}async function QOe(e){return(await Promise.allSettled(e.map(t=>$w(t)))).map(t=>t.status==="fulfilled"?t.value:null).filter(t=>t!==null)}function iM(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function SI(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function P_t(e){try{const t=new URL(e);return t.search="",t.hash="",t.toString()}catch{return e}}function Ac(e){try{return new URL(e),!0}catch{return!1}}function A_t(e,t){let a;if(t.startsWith("//")){const{protocol:r}=new URL(e);a=`${r||"https:"}${t}`}else if(iM(t))a=t;else if(!t.startsWith("/"))a=SI(e)+"/"+t;else{const r=new URL(e);r.pathname=t,a=r.toString()}return SI(a)}function UOe(e,t){let a=e;return t.forEach(({key:r,value:n,active:i})=>{n&&i&&(a=a.replaceAll(`{${r}}`,n))}),a}function WOe(e,t){let a=e;return t.forEach(({name:r,value:n})=>{n&&(a=a.replaceAll(`{${r}}`,n))}),a}function M_t(e){return e.startsWith("http://")||e.startsWith("https://")}function oM({url:e,serverUrl:t,corsProxyUrl:a}){let r;if(M_t(e)||!t)r=e;else{const n=new URL(t);n.pathname=e,n.search="",n.hash="",r=n.toString()}return a?`${a}${r}`:r}async function T_t(e,t,a,r,n,i){const o=await Promise.all(e.sourceDescriptions?.map(async l=>({...l,apiId:await ZOe({projectPath:r,apiUrl:l.url,collectionId:t})}))),s={inputs:e.components?.inputs||{},parameters:Object.fromEntries(Object.entries(e.components?.parameters||{}).map(([l,c])=>[l,{...c,key:c.name,value:c.value,id:crypto.randomUUID(),active:!0}]))};return{...e,id:t,srcType:a,state:fr.Normal,sourceDescriptions:o,components:s,workflows:await Promise.all(e.workflows.map(async l=>({...l,state:fr.Normal,parameters:sSe(l.parameters,l["x-replay-disabled-parameters"],e.components?.parameters),outputs:iSe(l.outputs),security:aSe(l["x-security"]),steps:await Promise.all(l.steps.map(async c=>{const u=sSe(c.parameters,c["x-replay-disabled-parameters"],e.components?.parameters),d=c["x-operation"]??null;d&&(d.url=Dw(d.url,u.queryParameters.filter(Ase)));const h=B_t(c,o,n);let m;if(h&&i){const f=n?.find(b=>b.id===h.apiId);try{m=i(h.path,h.method,f)}catch(b){console.error("Failed to convert operation to replay value",b),m=void 0}}delete c.operationId,delete c["x-operation"];const v=await D_t(c.requestBody,r);return{...c,state:fr.Normal,parameters:u,outputs:iSe(c.outputs),successCriteria:c.successCriteria?.map(f=>({...f,type:f.type??ls.SIMPLE}))||[],requestBody:v,xOperation:d,security:aSe(c["x-security"],m),operation:h}}))})))}}async function ZOe({projectPath:e,apiUrl:t,collectionId:a}){if(Ac(t))return t;if(await zr.isAbsolute(t))return await zr.relative(e,t);const r=await zr.resolve(await zr.join(e,a,"..",t));return await zr.relative(e,r)}function B_t(e,t,a){if(e["x-operation"])return null;const{path:r,method:n,apiId:i,isAdditionalOperation:o,sourceDescriptionName:s}=XOe({operationPath:e.operationPath,parsedSourceDescriptions:t}),{operationId:l,apiId:c,sourceDescriptionName:u}=E_t({operationId:e.operationId,parsedSourceDescriptions:t}),d=c||i||t[0]?.apiId||"",h=a?.find(v=>v.id===d),m=u??s??void 0;if(l&&h&&!r&&!n){const v=I_t(l,h);return{apiId:d,path:v?.path??"",method:v?.method??"",operationId:l,isAdditionalOperation:v?.isAdditionalOperation??!1,sourceDescriptionName:m}}return{apiId:d,path:r??"",method:n??"",operationId:l,isAdditionalOperation:o,sourceDescriptionName:m}}function E_t({operationId:e,parsedSourceDescriptions:t}){if(!e)return{operationId:"",apiId:null,sourceDescriptionName:null};const a=e.split(".");if(a.length===1)return{operationId:e,apiId:t[0]?.apiId??"",sourceDescriptionName:null};const r=a[1],n=a.slice(2).join("."),i=t.find(({name:o})=>o===r);return{operationId:n,apiId:i?.apiId??"",sourceDescriptionName:r}}function JOe(e){return"reference"in e&&typeof e.reference=="string"}function XOe({operationPath:e,parsedSourceDescriptions:t}){if(!e)return{apiId:null,path:"",method:"",isAdditionalOperation:!1,sourceDescriptionName:null};try{const a=e.split("#"),r=a.length>1?a[1]:a[0],n=a.length>1?a[0]:"";if(!r)return{path:"",method:"",apiId:null,isAdditionalOperation:!1,sourceDescriptionName:null};let i=null,o=null;const s=/\$sourceDescriptions\.(.+)\.url/,l=n.match(s);if(l&&(i=l[1]),i){const h=t.find(({name:m})=>m===i);h&&(o=h.apiId)}const c=r.split("/"),u=c.pop()||"",d=c[c.length-1]==="additionalOperations";return d&&c.pop(),{path:$i.unescape(c.pop()||""),method:u.toLowerCase(),apiId:o,isAdditionalOperation:d,sourceDescriptionName:i}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1,sourceDescriptionName:null}}}function R_t(e){switch(e.type){case"apiKey":return qe.APIKey;case"oauth2":return qe.OAuth2;case"openIdConnect":return qe.OpenIDConnect;case"http":return e.scheme==="basic"?qe.BasicAuth:e.scheme==="digest"?qe.DigestAuth:e.scheme==="bearer"?qe.JWT:qe.NoAuth;default:return qe.NoAuth}}function YOe(e,t){const a={clientCredentials:Ze.ClientCredentials,authorizationCode:Ze.AuthorizationCode,implicit:Ze.Implicit,password:Ze.Password,clientCredentialsWithJwtAssertion:Ze.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Ze.AuthorizationCodeWithPkce};return e==="clientCredentials"&&t["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Ze.ClientCredentialsWithJwtAssertion:e==="authorizationCode"&&t["x-usePkce"]?Ze.AuthorizationCodeWithPkce:a[e]??null}function __t(e){return{query:Rl.Query,header:Rl.Header,cookie:Rl.Cookie}[e.toLowerCase()]||Rl.Header}function L_t(e){return{body:as.Body,header:as.Header,url:as.URL}[e.toLowerCase()]||as.URL}function eSe(e,t,a){return Object.keys(e).reduce((r,n)=>{const i=YOe(n,e[n]);if(!i)return r;switch(i){case Ze.ClientCredentials:r[i]={...a[i],clientId:t.clientId??"",clientSecret:t.clientSecret??"",clientAssertion:t.clientAssertion??"",tokenUrl:e[n].tokenUrl??"",scopes:uf(e[n].scopes,e[n]["x-replay-disabled-scopes"]),accessToken:t.accessToken??""};break;case Ze.AuthorizationCode:r[i]={...a[i],clientId:t.clientId??"",clientSecret:t.clientSecret??"",tokenUrl:e[n].tokenUrl??"",authorizationUrl:e[n].authorizationUrl??"",callbackUrl:t.callbackUrl??"",availableScopes:e[n].availableScopes??[],scopes:uf(e[n].scopes,e[n]["x-replay-disabled-scopes"]),accessToken:t.accessToken??""};break;case Ze.Implicit:r[i]={...a[i],clientId:t.clientId??"",authorizationUrl:e[n].authorizationUrl??"",callbackUrl:t.callbackUrl??"",availableScopes:uf(e[n].availableScopes),scopes:uf(e[n].scopes,e[n]["x-replay-disabled-scopes"]),accessToken:t.accessToken??""};break;case Ze.Password:r[i]={...a[i],tokenUrl:e[n].tokenUrl??"",username:t.username??"",password:t.password??"",clientId:t.clientId??"",clientSecret:t.clientSecret??"",accessToken:t.accessToken??""};break;case Ze.ClientCredentialsWithJwtAssertion:r[i]={...a[i],clientAssertion:t.clientAssertion??"",tokenUrl:e[n].tokenUrl??"",scopes:uf(e[n].scopes,e[n]["x-replay-disabled-scopes"]),clientId:t.clientId??"",clientSecret:t.clientSecret??"",accessToken:t.accessToken??""};break;case Ze.AuthorizationCodeWithPkce:r[i]={...a[i],tokenUrl:e[n].tokenUrl??"",authorizationUrl:e[n].authorizationUrl??"",callbackUrl:t.callbackUrl??"",availableScopes:uf(e[n].availableScopes),scopes:uf(e[n].scopes,e[n]["x-replay-disabled-scopes"]),codeVerifier:t.codeVerifier??"",codeChallenge:t.codeChallenge??"",clientId:t.clientId??"",clientSecret:t.clientSecret??"",accessToken:t.accessToken??""};break}return r},a)}function tSe(e,t,a){const r={...mu(),securityType:e},n=Object.keys(t.flows||{})[0],i=YOe(n,t.flows?.[n])??Ze.ClientCredentials;switch(e){case qe.BasicAuth:return{...r,[qe.BasicAuth]:{username:a.username,password:a.password,schemeName:t.id}};case qe.JWT:return{...r,[qe.JWT]:{token:a.token,schemeName:t.id}};case qe.DigestAuth:return{...r,[qe.DigestAuth]:{...r[qe.DigestAuth],username:a.username,password:a.password,schemeName:t.id}};case qe.APIKey:return{...r,[qe.APIKey]:{location:__t(t.in),name:t.name,key:a.apiKey,schemeName:t.id}};case qe.OAuth2:return{...r,[qe.OAuth2]:{...r[qe.OAuth2],...eSe(t.flows||{},a||{},r[qe.OAuth2]),authRequestExtraParams:rSe(a.authRequestExtraParams),tokenRequestExtraParams:nSe(a.tokenRequestExtraParams),grantType:i,schemeName:t.id}};case qe.OpenIDConnect:return{...r,[qe.OpenIDConnect]:{...r[qe.OpenIDConnect],...eSe(a.flows||{},a||{},r[qe.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:rSe(a.authRequestExtraParams),tokenRequestExtraParams:nSe(a.tokenRequestExtraParams),grantType:i,schemeName:t.id}};default:return r}}function N_t(e,t){return[...e.map(a=>{if("scheme"in a){const n=R_t(a.scheme);return tSe(n,a.scheme,a.values)}const r=t.find(n=>n.id===a.schemeName);if(r){const n=nM(r),i=tSe(n,r,a.values);return i.securitySchemeId=r.id,i}return mu()})]}function aSe(e=[],t){const a=qOe(t?.security||[]);return e.length?N_t(e,a):[mu()]}function uf(e,t){const a=fm(e||{}),r=fm(t||{});return[...a,...r,fl()]}function rSe(e){return(e||[]).map(t=>({id:crypto.randomUUID(),key:t.key??"",value:t.value??"",active:t.active??!0})).concat(Pc())}function nSe(e){return(e||[]).map(t=>({id:crypto.randomUUID(),key:t.key??"",value:t.value??"",active:t.active??!0,sendIn:L_t(t.in)})).concat(mI())}function iSe(e){if(!e)return[Pc()];const t=[];for(const a in e)t.push({id:crypto.randomUUID(),key:a,value:e[a],active:!0});return t.push(Pc()),t}const Ey={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function oSe(e,t){const a="$components.parameters.";if(e.reference.startsWith(a)){const r=e.reference.replace(a,"");return t?.[r]}}function sSe(e,t,a){if(!e&&!t)return{pathParameters:[pn("path")],queryParameters:[pn("query")],headers:[pn("header")],cookies:[pn("cookie")]};const r={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(e)for(const n of e)if(JOe(n)){const i=oSe(n,a),o=Ey[i?.in];o&&r[o].push({reference:n.reference,active:!0,value:n.value})}else Ey[n.in]&&r[Ey[n.in]].push({id:crypto.randomUUID(),key:n.name,value:n.value,active:!0,in:n.in});if(t)for(const n of t)if(JOe(n)){const i=oSe(n,a),o=Ey[i?.in];o&&r[o].push({reference:n.reference,active:!1,value:n.value})}else Ey[n.in]&&r[Ey[n.in]].push({id:crypto.randomUUID(),key:n.name,value:n.value,active:!1,in:n.in});return r.pathParameters.push(pn("path")),r.queryParameters.push(pn("query")),r.headers.push(pn("header")),r.cookies.push(pn("cookie")),r}async function D_t(e,t){const a=DOe().body;if(!e)return a;switch(e.contentType){case"application/x-www-form-urlencoded":case"multipart/form-data":return{...a,type:e.contentType,formData:await $_t(e,t)};case"application/octet-stream":const r=e.payload?await uSe(e.payload,t):[],n=r.length>0?await $w(r[0]):null;return{...a,type:e.contentType,binary:n};case"application/json":case"application/ld+json":return{...a,type:e.contentType,content:cSe(e.payload)};default:{const i=typeof e.payload=="string",o=e.contentType||(i?"text/plain":"application/json");return{...a,type:o,content:i?e.payload:cSe(e.payload)}}}}async function lSe(e,t,a,r){const n=await uSe(t,r),i=n.length>0||Array.isArray(t),o=i?await QOe(n):void 0;return{id:crypto.randomUUID(),key:e,value:i?"":t,type:i?"file":"text",active:a,files:o}}async function $_t(e,t){const a=DOe().body.formData,r=e.contentType,n=e.payload?await Promise.all(Object.entries(e.payload).map(([o,s])=>lSe(o,s,!0,t))):[],i=e["x-replay-disabled-payload"]?await Promise.all(Object.entries(e["x-replay-disabled-payload"]||{}).map(([o,s])=>lSe(o,s,!1,t))):[];return{...a,[r]:[...n,...i,Mp()]}}function cSe(e){return e?JSON.stringify(e,null,2):""}function I_t(e,t){for(const a of Object.keys(t.paths)){const r=t.paths[a];for(const n of Object.keys(r)){const i=n.toLowerCase();if(["get","put","post","delete","options","head","patch","trace"].includes(i)&&r[i]?.operationId===e)return{method:i,path:a,isAdditionalOperation:!1}}if(r.additionalOperations){for(const[n,i]of Object.entries(r.additionalOperations))if(i?.operationId===e)return{method:n.toLowerCase(),path:a,isAdditionalOperation:!0}}}return null}async function uSe(e,t){return Array.isArray(e)?(await Promise.all(e.map(a=>dSe(a,t)))).flat():typeof e=="string"?await dSe(e,t):[]}async function dSe(e,t){const a=/\$file\(['"](.+?)['"]\)/g,r=Array.from(e.matchAll(a));return Promise.all(r.map(n=>V_t(n[1],t)))}async function V_t(e,t){return await zr.isAbsolute(e)?e:await zr.resolve(await zr.join(t,e))}const Ns=e=>!e||typeof e=="boolean"?{type:"object",properties:{}}:e.type?e:{...e,type:"object"},pSe=(e,t,a)=>{if(!e.properties)return e;const r=e.properties[t],n=Ns(r);return{...e,properties:{...e.properties,[t]:{...n,...a}}}},K_t=(e,t,a)=>{if(!e.properties||t===a||!a.trim())return null;const r={...e.properties};return r[a]?null:(r[a]=r[t],delete r[t],{...e,properties:r})},H_t=(e,t)=>{if(!e.properties)return e;const a={...e.properties};return delete a[t],{...e,properties:a}},G_t=(e,t,a={type:"string"})=>{const r=e.properties||{};return{...e,type:"object",properties:{...r,[t]:a}}};function hSe(e){const t=Object.assign({},...(e||[]).filter(({key:a,active:r})=>a&&r).map(a=>({[a.key]:a.value})));if(Object.keys(t).length!==0)return t}function mSe(e){if(!e)return{};const t={queryParameters:"query",headers:"header",cookies:"cookie",pathParameters:"path"},a=[],r=[];return Object.keys(t).forEach(n=>{const i=n;e[i].forEach(o=>{if(Hh(o)){const s={reference:o.reference,value:o.value||void 0};o.active?a.push(s):r.push(s)}else{if(!o.key)return;const s={name:o.key,in:t[i],value:o.value};o.active?a.push(s):r.push(s)}})}),{parameters:a.length>0?a:void 0,"x-replay-disabled-parameters":r.length>0?r:void 0}}function F_t(e){const t=e?.map(a=>({condition:a.condition,context:a.context,type:a.type==ls.SIMPLE?void 0:a.type}));if(t?.length!==0)return t}function q_t(e){if(!(!e||e.length===0))return[...e]}async function gSe(e,t){return e.absolutePath?`$file('${await zr.relative(t,e.absolutePath)}')`:null}async function Q_t(e,t){const{type:a,value:r,files:n}=e;switch(a){case"text":return r;case"file":let i=[];return n&&(i=(await Promise.all(Object.values(n).map(o=>gSe(o,t)))).filter(o=>o!==null)),i.length===0?"":i.length===1?i[0]:i}}async function U_t(e,t){const a=e.type,r=e.formData[a],n={},i={};return await Promise.all(r.map(async o=>{const{key:s,active:l}=o;if(!s)return;const c=await Q_t(o,t);l?n[s]=c:i[s]=c})),{payload:Object.keys(n).length>0?n:void 0,"x-replay-disabled-payload":Object.keys(i).length>0?i:void 0}}function W_t(e){if(!e)return e;try{const t=JSON.parse(e);return typeof t=="object"?t:e}catch{return e}}async function Z_t(e,t){if(e)switch(e.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:e.type,...await U_t(e,t)};case"application/octet-stream":return{contentType:e.type,payload:e.binary?await gSe(e.binary,t):null};case"application/json":case"application/ld+json":return e.content?{contentType:e.type,payload:W_t(e.content)}:void 0;default:return e.content?{contentType:e.type,payload:e.content}:void 0}}function J_t(e){return{...e.schemeName?{schemeName:e.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:e.username,password:e.password}}}function X_t(e){return{...e.schemeName?{schemeName:e.schemeName}:{scheme:{type:"apiKey",name:e.name,in:e.location.toLowerCase()}},values:{apiKey:e.key}}}function Y_t(e){return{...e.schemeName?{schemeName:e.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:e.token}}}function eLt(e){return{...e.schemeName?{schemeName:e.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:e.username,password:e.password}}}function tLt(e){const{flows:t,values:a}=bSe(e);return{...e.schemeName?{schemeName:e.schemeName}:{scheme:{type:"openIdConnect",flows:t}},values:{...a,openIdConnectUrl:e.openIdConnectUrl,userInfoUrl:e.userInfoUrl,authRequestExtraParams:fSe(e.authRequestExtraParams),tokenRequestExtraParams:vSe(e.tokenRequestExtraParams)}}}function aLt(e){const{flows:t,values:a}=bSe(e);return{...e.schemeName?{schemeName:e.schemeName}:{scheme:{type:"oauth2",flows:t}},values:{...a,authRequestExtraParams:fSe(e.authRequestExtraParams),tokenRequestExtraParams:vSe(e.tokenRequestExtraParams)}}}function Ry(e){const t={},a={};return e.forEach(r=>{r.value&&(r.active?t[r.value]=r.description:a[r.value]=r.description)}),{scopes:t,"x-replay-disabled-scopes":Object.keys(a).length>0?a:void 0}}function fSe(e){return e.filter(t=>t.value||t.key).map(t=>({key:t.key,value:t.value,active:t.active}))}function vSe(e){return e.filter(t=>t.value||t.key).map(t=>({key:t.key,value:t.value,active:t.active,in:t.sendIn.toLowerCase()}))}function bSe(e){let t;switch(e.grantType){case Ze.ClientCredentials:return t=e[Ze.ClientCredentials],{flows:{clientCredentials:{tokenUrl:t.tokenUrl,...Ry(t.scopes)}},values:{clientId:t.clientId,clientSecret:t.clientSecret,accessToken:t.accessToken}};case Ze.Implicit:return t=e[Ze.Implicit],{flows:{implicit:{authorizationUrl:t.authorizationUrl,...Ry(t.scopes)}},values:{clientId:t.clientId,accessToken:t.accessToken,callbackUrl:t.callbackUrl}};case Ze.Password:return t=e[Ze.Password],{flows:{password:{tokenUrl:t.tokenUrl,...Ry(t.scopes)}},values:{clientId:t.clientId,clientSecret:t.clientSecret,username:t.username,password:t.password,accessToken:t.accessToken}};case Ze.AuthorizationCode:return t=e[Ze.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:t.tokenUrl,authorizationUrl:t.authorizationUrl,...Ry(t.scopes)}},values:{accessToken:t.accessToken,clientId:t.clientId,callbackUrl:t.callbackUrl}};case Ze.ClientCredentialsWithJwtAssertion:return t=e[Ze.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:t.tokenUrl,...Ry(t.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:t.clientId,clientAssertion:t.clientAssertion,accessToken:t.accessToken}};case Ze.AuthorizationCodeWithPkce:return t=e[Ze.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:t.tokenUrl,authorizationUrl:t.authorizationUrl,...Ry(t.scopes),"x-usePkce":!0}},values:{clientId:t.clientId,clientSecret:t.clientSecret,accessToken:t.accessToken,codeVerifier:t.codeVerifier,codeChallenge:t.codeChallenge,callbackUrl:t.callbackUrl}}}}function ySe(e){const t=e.map(a=>{switch(a.securityType){case qe.OpenIDConnect:{const r=a[qe.OpenIDConnect];return tLt(r)}case qe.OAuth2:{const r=a[qe.OAuth2];return aLt(r)}case qe.APIKey:{const r=a[qe.APIKey];return X_t(r)}case qe.BasicAuth:{const r=a[qe.BasicAuth];return J_t(r)}case qe.DigestAuth:{const r=a[qe.DigestAuth];return eLt(r)}case qe.JWT:{const r=a[qe.JWT];return Y_t(r)}default:return null}}).filter(a=>a!==null);return{"x-security":t.length?t:void 0}}function rLt(e){const{inputs:t,parameters:a,...r}=e;let n=r;return Object.keys(t).length&&(n.inputs=t),Object.keys(a).length&&(n.parameters=Object.fromEntries(Object.entries(a).map(([i,{id:o,active:s,key:l,...c}])=>[i,{...c,name:l}]))),Object.keys(n).length||(n=void 0),n}async function nLt(e,t){const{id:a,state:r,srcType:n,fileDependencies:i,sourceDescriptions:o,workflows:s,components:l,...c}=e;return{arazzoObject:{...c,sourceDescriptions:o.map(u=>({...u,name:u.name,url:u.url,type:u.type||"openapi",apiId:void 0})),components:rLt(l),workflows:await Promise.all(s.map(async({parameters:u,security:d,dependsOn:h,outputs:m,state:v,steps:f,inputs:b,...k})=>({...k,dependsOn:q_t(h),outputs:hSe(m),inputs:b?Ns(b):void 0,...ySe(d),...mSe(u),steps:await Promise.all(f.map(async({parameters:x,security:w,operation:z,requestBody:S,successCriteria:C,outputs:P,state:M,xOperation:E,...D})=>{const I={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(z){const L=(z.sourceDescriptionName?e.sourceDescriptions.find(({name:H})=>H===z.sourceDescriptionName):null)||e.sourceDescriptions.find(({apiId:H})=>H===z.apiId)||e.sourceDescriptions[0];if(z.operationId){const H=e.sourceDescriptions.length<=1;I.operationId=H?z.operationId:`$sourceDescriptions.${L.name}.${z.operationId}`}else I.operationPath=z.isAdditionalOperation?`{$sourceDescriptions.${L.name}.url}#/paths/${$i.escape(z.path)}/additionalOperations/${z.method}`:`{$sourceDescriptions.${L.name}.url}#/paths/${$i.escape(z.path)}/${z.method}`}else E&&(I["x-operation"]={...E,url:E.url.split("?")[0]});return{...D,...I,...ySe(w),...mSe(x),requestBody:await Z_t(S,t),successCriteria:F_t(C),outputs:hSe(P)}}))})))}}}class iLt extends $ve{constructor(t,a){super(t),this.convertOperationToReplayValue=a}async parse(t,a){return{...await T_t(t.content,t.uri,t.type,this.storage.baseDir,a,this.convertOperationToReplayValue),fileDependencies:t.fileDependencies}}async stringify(t){const{arazzoObject:a}=await nLt(t,this.storage.baseDir);return await zr.extname(t.id)===".json"?JSON.stringify(a,null,2):lp.dump(a)}}class oLt{constructor(t,a){this.storage=t,this.localStorageSecretsProvider=a}default=[];async read(){const t=await this.storage.get("replay-environments.yaml"),a=await this.localStorageSecretsProvider.get();let r=null,n=null;if(!t)return this.default;try{r=lp.load(t),n=a?JSON.parse(a):null}catch(i){return console.error("Failed to parse environments file",i),this.default}return r?Object.keys(r).filter(i=>i!=="version").map(i=>({name:i,inputs:Object.entries(r[i].inputs).map(([o,s])=>{if(typeof s=="string")return{name:o,value:s,isSecret:!1};const l=n?.[i]?.[o]??"";return{name:o,value:l,isSecret:!0}}),servers:Object.entries(r[i].servers).map(([o,s])=>({apiId:o,value:s.value,variables:Object.entries(s.variables||{}).map(([l,c])=>({name:l,value:c}))})),state:fr.Normal})):this.default}async write(t){const a=await this.localStorageSecretsProvider.get(),r=a?JSON.parse(a):{},n=t.reduce((i,o)=>(o.name&&(i[o.name]={inputs:o.inputs.reduce((s,l)=>(l.isSecret&&r?(r[o.name]||(r[o.name]={}),r[o.name][l.name]=l.value,s[l.name]={provider:"local"}):s[l.name]=l.value,s),{}),servers:o.servers.reduce((s,l)=>(s[l.apiId]={value:l.value,variables:Object.fromEntries(l.variables.map(c=>[c.name,c.value]))},s),{})}),i),{});this.localStorageSecretsProvider.set(JSON.stringify(r)),n&&this.storage.set("replay-environments.yaml",lp.dump(n))}}class sLt{constructor(t,a,r){this.storage=t,this.filePath=a,this.defaultValue=r}async parse(t){return JSON.parse(t)}stringify(t){return JSON.stringify(t)}async read(){const t=await this.storage.get(this.filePath);return t?await this.parse(t):this.defaultValue}async write(t){return this.storage.set(this.filePath,this.stringify(t))}}const kSe=(e,t)=>({data:e,version:t});class xSe extends sLt{constructor(t,a,r,n){super(t,a,r),this.version=n}migrationMap={};migrate(t){if(!this.migrationMap[t.version])return this.defaultValue;const a=this.migrationMap[t.version](t);return a.version===this.version?a:this.migrate(a)}async parse(t){const a=JSON.parse(t);if(a.version!==this.version){const r=this.migrate(a);return await this.write(r.data),r.data}return a.data}stringify(t){return JSON.stringify(kSe(t,this.version))}}function lLt(e){return{data:{...e.data,tabs:e.data.tabs.map(t=>t.data.type===Yt.Step?{...t,data:{...t.data,draftStep:{...t.data.step,security:t.data.step.security.securities},step:void 0,hasUnsavedChanges:void 0,showUnsavedChangesModal:void 0}}:t)},version:2}}const zI=2,cLt="tabs.json";class uLt extends xSe{migrationMap={1:lLt};constructor(t){super(t,cLt,pd(eN),zI)}async parse(t){let a=null;try{a=JSON.parse(t)}catch(n){console.error("Failed to parse tabs state",n)}a||(a=kSe(pd(eN),zI)),a.version!==zI&&(a=this.migrate(a));const r=await Promise.all(a.data.tabs.map(async n=>{if(n.data.type===Yt.Step&&n.data.draftStep){const i=n.data.draftStep.requestBody.formData;i["multipart/form-data"]=await wSe(i["multipart/form-data"]),i["application/x-www-form-urlencoded"]=await wSe(i["application/x-www-form-urlencoded"]),n.data.draftStep.requestBody.binary&&n.data.draftStep.requestBody.binary.absolutePath&&(n.data.draftStep.requestBody.binary=await $w(n.data.draftStep.requestBody.binary.absolutePath))}return n}));return{...a.data,tabs:r}}stringify(t){return super.stringify({...t,tabs:t.tabs.map(a=>a.data.type===Yt.Step?{...a,data:{...a.data,response:null}}:a.data.type===Yt.WorkflowRun?{...a,data:{...a.data,result:null}}:a)})}}async function wSe(e){return Promise.all(e.map(async t=>{const a={...t};if(t.files){const r=t.files.map(n=>n.absolutePath).filter(n=>n!==null);a.files=await QOe(r)}return a}))}const dLt=1;class OSe{constructor(t,a,r,n,i,o){this.systemFilesStorage=t,this.userFilesStorage=a,this.project=r,this.isApiPersisted=n,this.convertOperationToReplayValue=i,this.telemetry=o,this.localStorageSecretsProvider=new P5t(this.project.id);const s=new j5t;this.activeEnvironmentIdStorage=new xSe(this.systemFilesStorage,"active_environment_id.json",Vx,dLt),this.tabsStateStorage=new uLt(this.systemFilesStorage),this.environmentsStorage=new oLt(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new iLt(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new A5t(this.isApiPersisted?this.userFilesStorage:s)}activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;localStorageSecretsProvider;persistExcludedIds=new Set;watchExcludedIds=new Set;addPersistExcludedId(t){this.persistExcludedIds.add(t),this.userFilesStorage.setWriteExcludedKeys(new Set([...this.persistExcludedIds]))}removePersistExcludedId(t){this.persistExcludedIds.delete(t),this.userFilesStorage.setWriteExcludedKeys(new Set([...this.persistExcludedIds]))}addWatchExcludedId(t){this.watchExcludedIds.add(t)}removeWatchExcludedId(t){this.watchExcludedIds.delete(t)}isWatchExcluded(t){return this.watchExcludedIds.has(t)}async update(t,a){switch(t.path[0]){case"activeEnvironmentId":this.activeEnvironmentIdStorage.write(a.activeEnvironmentId.get());break;case"tabsState":this.tabsStateStorage.write(a.tabsState.get());break;case"environments":this.environmentsStorage.write(a.environments.get());break;case"apis":this.isApiPersisted&&await this.apisStorage.update(t,a.apis.get());break;case"collections":await this.collectionsStorage.update(t,a.collections.get());break}}}var SSe={exports:{}},zSe;function pLt(){return zSe||(zSe=1,(function(e){var t=Object.prototype.hasOwnProperty,a="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(a=!1));function n(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function i(l,c,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new n(u,d||l,h),v=a?a+c:c;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],m]:l._events[v].push(m):(l._events[v]=m,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(a?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},s.prototype.listeners=function(l){var c=a?a+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,h=u.length,m=new Array(h);d<h;d++)m[d]=u[d].fn;return m},s.prototype.listenerCount=function(l){var c=a?a+l:l,u=this._events[c];return u?u.fn?1:u.length:0},s.prototype.emit=function(l,c,u,d,h,m){var v=a?a+l:l;if(!this._events[v])return!1;var f=this._events[v],b=arguments.length,k,x;if(f.fn){switch(f.once&&this.removeListener(l,f.fn,void 0,!0),b){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,c),!0;case 3:return f.fn.call(f.context,c,u),!0;case 4:return f.fn.call(f.context,c,u,d),!0;case 5:return f.fn.call(f.context,c,u,d,h),!0;case 6:return f.fn.call(f.context,c,u,d,h,m),!0}for(x=1,k=new Array(b-1);x<b;x++)k[x-1]=arguments[x];f.fn.apply(f.context,k)}else{var w=f.length,z;for(x=0;x<w;x++)switch(f[x].once&&this.removeListener(l,f[x].fn,void 0,!0),b){case 1:f[x].fn.call(f[x].context);break;case 2:f[x].fn.call(f[x].context,c);break;case 3:f[x].fn.call(f[x].context,c,u);break;case 4:f[x].fn.call(f[x].context,c,u,d);break;default:if(!k)for(z=1,k=new Array(b-1);z<b;z++)k[z-1]=arguments[z];f[x].fn.apply(f[x].context,k)}}return!0},s.prototype.on=function(l,c,u){return i(this,l,c,u,!1)},s.prototype.once=function(l,c,u){return i(this,l,c,u,!0)},s.prototype.removeListener=function(l,c,u,d){var h=a?a+l:l;if(!this._events[h])return this;if(!c)return o(this,h),this;var m=this._events[h];if(m.fn)m.fn===c&&(!d||m.once)&&(!u||m.context===u)&&o(this,h);else{for(var v=0,f=[],b=m.length;v<b;v++)(m[v].fn!==c||d&&!m[v].once||u&&m[v].context!==u)&&f.push(m[v]);f.length?this._events[h]=f.length===1?f[0]:f:o(this,h)}return this},s.prototype.removeAllListeners=function(l){var c;return l?(c=a?a+l:l,this._events[c]&&o(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=a,s.EventEmitter=s,e.exports=s})(SSe)),SSe.exports}var hLt=pLt();const mLt=Hr(hLt);class CSe extends Error{constructor(t){super(t),this.name="TimeoutError"}}let gLt=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const jSe=e=>globalThis.DOMException===void 0?new gLt(e):new DOMException(e),PSe=e=>{const t=e.reason===void 0?jSe("This operation was aborted."):e.reason;return t instanceof Error?t:jSe(t)};function fLt(e,t,a,r){let n;const i=new Promise((o,s)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===Number.POSITIVE_INFINITY){o(e);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){const{signal:l}=r;l.aborted&&s(PSe(l)),l.addEventListener("abort",()=>{s(PSe(l))})}n=r.customTimers.setTimeout.call(void 0,()=>{const l=`Promise timed out after ${t} milliseconds`,c=a instanceof Error?a:new CSe(l);typeof e.cancel=="function"&&e.cancel(),s(c)},t),(async()=>{try{o(await e)}catch(l){s(l)}finally{r.customTimers.clearTimeout.call(void 0,n)}})()});return i.clear=()=>{clearTimeout(n),n=void 0},i}function vLt(e,t,a){let r=0,n=e.length;for(;n>0;){const i=Math.trunc(n/2);let o=r+i;a(e[o],t)<=0?(r=++o,n-=i+1):n=i}return r}var df=function(e,t,a,r){if(a==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?r:a==="a"?r.call(e):r?r.value:t.get(e)},Tp;class bLt{constructor(){Tp.set(this,[])}enqueue(t,a){a={priority:0,...a};const r={priority:a.priority,run:t};if(this.size&&df(this,Tp,"f")[this.size-1].priority>=a.priority){df(this,Tp,"f").push(r);return}const n=vLt(df(this,Tp,"f"),r,(i,o)=>o.priority-i.priority);df(this,Tp,"f").splice(n,0,r)}dequeue(){return df(this,Tp,"f").shift()?.run}filter(t){return df(this,Tp,"f").filter(a=>a.priority===t.priority).map(a=>a.run)}get size(){return df(this,Tp,"f").length}}Tp=new WeakMap;var Gn=function(e,t,a,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(e,a):n?n.value=a:t.set(e,a),a},Ut=function(e,t,a,r){if(a==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?r:a==="a"?r.call(e):r?r.value:t.get(e)},ci,Iw,Vw,vm,sM,Kw,lM,gu,Hw,Zl,cM,Jl,Gw,bm,uM,ASe,MSe,TSe,BSe,ESe,dM,CI,jI,pM,RSe,hM;class _Se extends Error{}class yLt extends mLt{constructor(t){var a,r,n,i;if(super(),ci.add(this),Iw.set(this,void 0),Vw.set(this,void 0),vm.set(this,0),sM.set(this,void 0),Kw.set(this,void 0),lM.set(this,0),gu.set(this,void 0),Hw.set(this,void 0),Zl.set(this,void 0),cM.set(this,void 0),Jl.set(this,0),Gw.set(this,void 0),bm.set(this,void 0),uM.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:bLt,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(r=(a=t.intervalCap)===null||a===void 0?void 0:a.toString())!==null&&r!==void 0?r:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(i=(n=t.interval)===null||n===void 0?void 0:n.toString())!==null&&i!==void 0?i:""}\` (${typeof t.interval})`);Gn(this,Iw,t.carryoverConcurrencyCount,"f"),Gn(this,Vw,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,"f"),Gn(this,sM,t.intervalCap,"f"),Gn(this,Kw,t.interval,"f"),Gn(this,Zl,new t.queueClass,"f"),Gn(this,cM,t.queueClass,"f"),this.concurrency=t.concurrency,this.timeout=t.timeout,Gn(this,uM,t.throwOnTimeout===!0,"f"),Gn(this,bm,t.autoStart===!1,"f")}get concurrency(){return Ut(this,Gw,"f")}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);Gn(this,Gw,t,"f"),Ut(this,ci,"m",pM).call(this)}async add(t,a={}){return a={timeout:this.timeout,throwOnTimeout:Ut(this,uM,"f"),...a},new Promise((r,n)=>{Ut(this,Zl,"f").enqueue(async()=>{var i,o,s;Gn(this,Jl,(o=Ut(this,Jl,"f"),o++,o),"f"),Gn(this,vm,(s=Ut(this,vm,"f"),s++,s),"f");try{if(!((i=a.signal)===null||i===void 0)&&i.aborted)throw new _Se("The task was aborted.");let l=t({signal:a.signal});a.timeout&&(l=fLt(Promise.resolve(l),a.timeout)),a.signal&&(l=Promise.race([l,Ut(this,ci,"m",RSe).call(this,a.signal)]));const c=await l;r(c),this.emit("completed",c)}catch(l){if(l instanceof CSe&&!a.throwOnTimeout){r();return}n(l),this.emit("error",l)}finally{Ut(this,ci,"m",TSe).call(this)}},a),this.emit("add"),Ut(this,ci,"m",dM).call(this)})}async addAll(t,a){return Promise.all(t.map(async r=>this.add(r,a)))}start(){return Ut(this,bm,"f")?(Gn(this,bm,!1,"f"),Ut(this,ci,"m",pM).call(this),this):this}pause(){Gn(this,bm,!0,"f")}clear(){Gn(this,Zl,new(Ut(this,cM,"f")),"f")}async onEmpty(){Ut(this,Zl,"f").size!==0&&await Ut(this,ci,"m",hM).call(this,"empty")}async onSizeLessThan(t){Ut(this,Zl,"f").size<t||await Ut(this,ci,"m",hM).call(this,"next",()=>Ut(this,Zl,"f").size<t)}async onIdle(){Ut(this,Jl,"f")===0&&Ut(this,Zl,"f").size===0||await Ut(this,ci,"m",hM).call(this,"idle")}get size(){return Ut(this,Zl,"f").size}sizeBy(t){return Ut(this,Zl,"f").filter(t).length}get pending(){return Ut(this,Jl,"f")}get isPaused(){return Ut(this,bm,"f")}}Iw=new WeakMap,Vw=new WeakMap,vm=new WeakMap,sM=new WeakMap,Kw=new WeakMap,lM=new WeakMap,gu=new WeakMap,Hw=new WeakMap,Zl=new WeakMap,cM=new WeakMap,Jl=new WeakMap,Gw=new WeakMap,bm=new WeakMap,uM=new WeakMap,ci=new WeakSet,ASe=function(){return Ut(this,Vw,"f")||Ut(this,vm,"f")<Ut(this,sM,"f")},MSe=function(){return Ut(this,Jl,"f")<Ut(this,Gw,"f")},TSe=function(){var e;Gn(this,Jl,(e=Ut(this,Jl,"f"),e--,e),"f"),Ut(this,ci,"m",dM).call(this),this.emit("next")},BSe=function(){Ut(this,ci,"m",jI).call(this),Ut(this,ci,"m",CI).call(this),Gn(this,Hw,void 0,"f")},ESe=function(){const e=Date.now();if(Ut(this,gu,"f")===void 0){const t=Ut(this,lM,"f")-e;if(t<0)Gn(this,vm,Ut(this,Iw,"f")?Ut(this,Jl,"f"):0,"f");else return Ut(this,Hw,"f")===void 0&&Gn(this,Hw,setTimeout(()=>{Ut(this,ci,"m",BSe).call(this)},t),"f"),!0}return!1},dM=function(){if(Ut(this,Zl,"f").size===0)return Ut(this,gu,"f")&&clearInterval(Ut(this,gu,"f")),Gn(this,gu,void 0,"f"),this.emit("empty"),Ut(this,Jl,"f")===0&&this.emit("idle"),!1;if(!Ut(this,bm,"f")){const e=!Ut(this,ci,"a",ESe);if(Ut(this,ci,"a",ASe)&&Ut(this,ci,"a",MSe)){const t=Ut(this,Zl,"f").dequeue();return t?(this.emit("active"),t(),e&&Ut(this,ci,"m",CI).call(this),!0):!1}}return!1},CI=function(){Ut(this,Vw,"f")||Ut(this,gu,"f")!==void 0||(Gn(this,gu,setInterval(()=>{Ut(this,ci,"m",jI).call(this)},Ut(this,Kw,"f")),"f"),Gn(this,lM,Date.now()+Ut(this,Kw,"f"),"f"))},jI=function(){Ut(this,vm,"f")===0&&Ut(this,Jl,"f")===0&&Ut(this,gu,"f")&&(clearInterval(Ut(this,gu,"f")),Gn(this,gu,void 0,"f")),Gn(this,vm,Ut(this,Iw,"f")?Ut(this,Jl,"f"):0,"f"),Ut(this,ci,"m",pM).call(this)},pM=function(){for(;Ut(this,ci,"m",dM).call(this););},RSe=async function(e){return new Promise((t,a)=>{e.addEventListener("abort",()=>{a(new _Se("The task was aborted."))},{once:!0})})},hM=async function(e,t){return new Promise(a=>{const r=()=>{t&&!t()||(this.off(e,r),a())};this.on(e,r)})};const Pd=window.__TAURI__?.http.fetch??globalThis.fetch;class LSe extends j0{constructor(){super()}resolveExternalRef(t,a){return iM(a)?a:t&&iM(t)?new URL(a,t).href:t?lg.resolve(lg.dirname(t),a):a}async loadExternalRef(t){if(iM(t)){const{body:a,mimeType:r}=await Xne(t,{...this.config.http,customFetch:Pd});return new ub(t,a,r)}else{if(!await jA(t))throw new Error(`File not found at ${t}.`);try{throw await oN(t),new Error(`Expected a file but received a folder at ${t}.`)}catch(r){if(r instanceof Error&&r.message.includes("Expected a file but received a folder"))throw r}const a=await CA(t);return new ub(t,a.replace(/\r\n/g,`
12539
- `))}}}async function mM(e,t){const a=new DO({});a.getRulesForSpecVersion=()=>[];const r=await zr.dirname(e),n={config:a,base:r,externalRefResolver:new LSe,dereference:!0};t?n.doc={source:{absoluteRef:e},parsed:t}:n.ref=e;const{bundle:{parsed:i},fileDependencies:o}=await i_(n);return{definition:i,fileDependencies:o}}class kLt{constructor(t){this.apisStorage=t}data=new Map;loading=new Set;pQueue=new yLt({concurrency:20});async get(t){return this.data.has(t)?this.data.get(t)??null:(await this.loadAndParse(t),this.data.get(t)??null)}async load(t,a=!1){this.data.has(t)&&!a||await this.loadAndParse(t,a)}async loadAndParse(t,a=!1){if(this.loading.has(t)){await this.pQueue.add(()=>this.get(t));return}a&&this.data.delete(t),this.loading.add(t),await this.pQueue.add(async()=>{const r=Ac(t)?Eo.WEB:Eo.FS,n=r===Eo.WEB?t:await this.apisStorage.getAbsolutePath(t);try{const{definition:i,fileDependencies:o}=await mM(n);if(!i){this.data.set(t,null);return}const s=this.apisStorage.parse({uri:t,type:r,content:i});this.data.set(t,{...s,fileDependencies:o})}catch(i){if(this.data.set(t,null),i instanceof Error&&(i.message.includes("Unsupported specification")||i.message.includes("File not found")))return;console.error("Error loading api "+t,i);return}}),this.loading.delete(t)}get size(){return this.data.size}delete(t){this.data.delete(t)}getAll(){return Array.from(this.data.values()).filter(t=>t!==null)}clear(){this.data.clear(),this.loading.clear()}}class xLt extends OSe{apiLoader;constructor(t,a,r){const n=new sN(t.systemFilesDir),i=new sN(t.userFilesDir);super(n,i,t,!0,a,r),this.apiLoader=new kLt(this.apisStorage),this.setupWriteListeners(i)}setupWriteListeners(t){t.on("write-start",a=>{this.addWatchExcludedId(a)}),t.on("write-end",a=>{this.removeWatchExcludedId(a)})}async read(){const t=this.telemetry?.startSpan("storage.read",void 0,void 0),a=this.telemetry?.startSpan("storage.loadUserState",{},t?.parentCtx),[r,n,i]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);a?.setAttribute("status","completed"),a?.setAttribute("environmentCount",i.length),a?.setStatus(Bo.OK),a?.end();const{apiFiles:o,collectionFiles:s}=await this.detectProjectFiles(t);await this.loadAndParseApis(o,t);const l=(await this.loadAndParseCollections(s,t)).filter(u=>u!==null);this.collectionsStorage.setItemIds(l.map(u=>u.id));const c=this.apiLoader.getAll();return this.apisStorage.setItemIds(c.map(u=>u.id)),t?.setAttribute("status","completed"),t?.setStatus(Bo.OK),t?.end(),{project:this.project,activeEnvironmentId:r,tabsState:n,environments:i,apis:c,collections:l}}async detectProjectFiles(t){const a=this.telemetry?.startSpan("storage.detectFiles",{},t?.parentCtx),{api_files:r,collection_files:n}=await Cn("fs_scan",{dir:this.project.userFilesDir});return a?.setAttribute("status","completed"),a?.setAttribute("filesCount",r.length+n.length),a?.setAttribute("apiFilesCount",r.length),a?.setAttribute("collectionFilesCount",n.length),a?.setStatus(Bo.OK),a?.end(),{apiFiles:r,collectionFiles:n}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(t){this.apiLoader.delete(t)}async loadAndParseApis(t,a,r=!1){const n=this.telemetry?.startSpan("storage.parseApis",{apisCount:t.length},a?.parentCtx),i=await Ave(t,20,async o=>{try{return await this.apiLoader.load(o.relative_path,r),this.apiLoader.get(o.relative_path)}catch(s){return console.error(`Error parsing YAML/JSON file ${o.absolute_path}:`,s),null}});return n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",this.apiLoader.size),n?.setStatus(Bo.OK),n?.end(),i}async loadAndParseCollections(t,a){const r=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:t.length},a?.parentCtx),n=await Ave(t,20,async i=>{try{const o=await this.userFilesStorage.get(i.relative_path);if(!o)return null;const s=lp.load(o);if(typeof s!="object"||s===null||typeof s.arazzo!="string")return null;const l=[];await Promise.all(s.sourceDescriptions?.map(async u=>{const d=u.type,h=u.url,m=!d||d==="openapi",v=await ZOe({projectPath:this.project.userFilesDir,apiUrl:h,collectionId:i.relative_path});if(m){const f=await this.apiLoader.get(v);f&&l.push(f)}}));const c=await zr.join(this.project.userFilesDir,i.relative_path);return await this.collectionsStorage.parse({uri:i.relative_path,type:Eo.FS,content:s,fileDependencies:new Set([c])},l)}catch(o){return console.error(`Error parsing Arazzo file ${i.relative_path}:`,o),null}});return r?.setAttribute("status","completed"),r?.setAttribute("parsedCollectionsCount",n.length),r?.setStatus(Bo.OK),r?.end(),n}}class PI{constructor(t){this.baseDir=t}writeExcludedKeys=new Set;setWriteExcludedKeys(t){this.writeExcludedKeys=t}async ls(t=""){const a=this.makeKey(t);return Object.keys(localStorage).filter(r=>r.startsWith(a)).map(r=>r.replace(a,""))}async get(t){const a=this.makeKey(t);return localStorage.getItem(a)??null}async has(t){const a=this.makeKey(t);return localStorage.getItem(a)!==null}async set(t,a){if(this.writeExcludedKeys.has(t))return;const r=this.makeKey(t);localStorage.setItem(r,a)}async remove(t){if(this.writeExcludedKeys.has(t))return;const a=this.makeKey(t);localStorage.removeItem(a)}async rename(t,a){const r=this.makeKey(t),n=this.makeKey(a),i=localStorage.getItem(r);i!==null&&(localStorage.setItem(n,i),localStorage.removeItem(r))}makeKey(t){return`replay:fs:${this.baseDir}/${t}`}on(t,a){}off(t,a){}}class wLt extends OSe{constructor(t,a,r){const n=new PI(t.systemFilesDir),i=new PI(t.userFilesDir);super(n,i,t,!1,a,r)}async detectProjectFiles(t){const a=this.telemetry?.startSpan("storage.detectFiles",{},t?.parentCtx),r=(await this.userFilesStorage.ls()).filter(s=>/\.(ya?ml|json)$/.test(s)),n=[],i=[],o=new Set;return await Promise.all(r.map(async s=>{const l=await this.userFilesStorage.get(s);if(l)try{const c=lp.load(l);if(typeof c=="object"&&c!==null)if(typeof c.openapi=="string"){const u=await zr.resolve(await zr.join(this.userFilesStorage.baseDir,s)),{definition:d}=await mM(u,c);n.push({uri:s,type:Eo.FS,content:d})}else typeof c.arazzo=="string"&&(i.push({uri:s,type:Eo.FS,content:c}),c.sourceDescriptions?.forEach(u=>{const d=u.type,h=u.url,m=!d||d==="openapi",v=typeof h=="string"&&Ac(h);m&&v&&o.add(h)}))}catch(c){console.error(`Error parsing YAML/JSON file ${s}:`,c)}})),a?.setAttribute("status","completed"),a?.setAttribute("filesCount",r.length),a?.setAttribute("apiFilesCount",n.length),a?.setAttribute("collectionFilesCount",i.length),a?.setAttribute("apiUrlsCount",o.size),a?.setStatus(Bo.OK),a?.end(),{apiFiles:n,collectionFiles:i,apiUrls:o}}async loadApis(t,a){const r=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:t.size},a?.parentCtx),n=[];return await Promise.all(Array.from(t).map(async i=>{try{const{definition:o}=await mM(i);n.push({uri:i,type:Eo.WEB,content:o})}catch(o){console.error(`Error parsing YAML from ${i}:`,o)}})),r?.setAttribute("status","completed"),r?.setStatus(Bo.OK),r?.end(),n}async parseApis(t,a){const r=this.telemetry?.startSpan("storage.parseApis",{apisCount:t.length},a?.parentCtx),n=await this.apisStorage.parseMany(t);return r?.setAttribute("status","completed"),r?.setAttribute("parsedApisCount",n.length),r?.setStatus(Bo.OK),r?.end(),n}async parseCollections(t,a,r){const n=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:t.length},r?.parentCtx),i=await this.collectionsStorage.parseMany(t,a);return n?.setAttribute("status","completed"),n?.setAttribute("parsedCollectionsCount",i.length),n?.setStatus(Bo.OK),n?.end(),i}async read(){const t=this.telemetry?.startSpan("storage.read",void 0,void 0),a=this.telemetry?.startSpan("storage.loadUserState",{},t?.parentCtx),[r,n,i]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);a?.setAttribute("status","completed"),a?.setAttribute("environmentCount",i.length),a?.setStatus(Bo.OK),a?.end();const{apiFiles:o,collectionFiles:s,apiUrls:l}=await this.detectProjectFiles(t),c=await this.loadApis(l,t),u=await this.parseApis([...o,...c],t);this.apisStorage.setItemIds(u.map(h=>h.id));const d=await this.parseCollections(s,u,t);return this.collectionsStorage.setItemIds(d.map(h=>h.id)),t?.setAttribute("status","completed"),t?.setStatus(Bo.OK),t?.end(),{project:this.project,activeEnvironmentId:r,tabsState:n,environments:i,apis:u,collections:d}}}var NSe;(function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"})(NSe||(NSe={}));async function OLt(e,t){await Cn("plugin:event|unlisten",{event:e,eventId:t})}async function SLt(e,t,a){var r;const n=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return Cn("plugin:event|listen",{event:e,target:n,handler:S5t(t)}).then(i=>async()=>OLt(e,i))}class zLt{constructor(t,a,r){this.storage=t,this.state=a,this.projectDir=r}watchPath=null;unlistenEvent=null;get tauriStorage(){return this.storage}async start(){if(this.watchPath){console.warn("Watcher already started for:",this.watchPath);return}try{this.unlistenEvent=await SLt("fs-watch-event",async t=>{const a=t.payload;try{await this.handleEvent(a)}catch(r){console.error("Error handling file change:",r)}}),await Cn("fs_watch",{path:this.projectDir,options:{recursive:!0,delayMs:500}}),this.watchPath=this.projectDir}catch(t){throw console.error("Failed to start file watcher:",t),this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),t}}async stop(){if(this.watchPath)try{await Cn("fs_unwatch",{path:this.watchPath})}catch(t){console.error("Error stopping file watcher:",t)}finally{this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),this.watchPath=null}}async handleEvent(t){const{changeType:a,paths:r,pathTypes:n,type:i}=t;if(await this.isProjectFolderRemoved(r,a)){await this.handleProjectFolderRemoval();return}const o=this.filterSpecFiles(r,n);if(o.paths.length===0)return;const s=await this.toFileEntries(o.paths,o.pathTypes);switch(a){case"changed":(i.includes("Data")||i.includes("Name"))&&await this.handleModify(s);break;case"added":await this.handleCreate(s);break;case"deleted":await this.handleDelete(s);break;case"renamed":await this.handleRename(s);break;default:console.log("Unhandled change type:",a)}}filterSpecFiles(t,a){const r=[],n=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.split(".").pop()?.toLowerCase();s&&["yaml","yml","json"].includes(s)&&(r.push(o),n.push(a[i]||"unknown"))}return{paths:r,pathTypes:n}}async toFileEntries(t,a){return Promise.all(t.map(async(r,n)=>({relative_path:await zr.relative(this.projectDir,r),absolute_path:r,type:a[n]||"unknown"})))}consolidateFileEntries(t){const a=[],r=new Set;for(const n of t)r.has(n.relative_path)||(r.add(n.relative_path),this.storage.isWatchExcluded(n.relative_path)||a.push(n));return a}async handleModify(t){const a=!this.storage.isWatchExcluded("replay-environments.yaml")&&t.some(m=>m.relative_path==="replay-environments.yaml"),r=t.filter(m=>m.relative_path!=="replay-environments.yaml"),{newApiFiles:n,existingApiFiles:i}=this.categorizeApisFromFiles(r),{newCollectionFiles:o,existingCollectionFiles:s}=this.categorizeCollectionsFromFiles(r),l=this.findApisToReload(t),c=this.findCollectionsToReload(t),u=[...n,...o];u.length>0&&await this.handleCreate(u),a&&await this.reloadEnvironments();const d=this.consolidateFileEntries([...i,...l]),h=this.consolidateFileEntries([...s,...c]);await this.reloadApis(d),await this.reloadCollections(h)}async handleCreate(t){const a=t.filter(l=>l.type==="api"),r=t.filter(l=>l.type==="collection"),{newApiFiles:n,existingApiFiles:i}=this.categorizeApisFromFiles(a),{newCollectionFiles:o,existingCollectionFiles:s}=this.categorizeCollectionsFromFiles(r);if(n.length>0||o.length>0){n.forEach(u=>this.storage.addPersistExcludedId(u.relative_path)),o.forEach(u=>this.storage.addPersistExcludedId(u.relative_path));const l=n.length>0?await this.tauriStorage.loadAndParseApis(n,void 0,!0):[],c=o.length>0?await this.tauriStorage.loadAndParseCollections(o,void 0):[];this.state.apis.merge(l.filter(u=>u!==null)),this.state.collections.merge(c.filter(u=>u!==null)),setTimeout(()=>{n.forEach(u=>this.storage.removePersistExcludedId(u.relative_path)),o.forEach(u=>this.storage.removePersistExcludedId(u.relative_path))},500)}i.length>0&&await this.reloadApis(i),s.length>0&&await this.reloadCollections(s)}categorizeApisFromFiles(t){const a=new Set,r=[],n=[];for(const i of t)a.has(i.relative_path)||(a.add(i.relative_path),this.state.apis.get({noproxy:!0}).some(o=>o.id===i.relative_path)?n.push(i):i.type==="api"&&r.push(i));return{newApiFiles:r,existingApiFiles:n}}categorizeCollectionsFromFiles(t){const a=new Set,r=[],n=[];for(const i of t)a.has(i.relative_path)||(a.add(i.relative_path),this.state.collections.get({noproxy:!0}).some(o=>o.id===i.relative_path)?n.push(i):i.type==="collection"&&r.push(i));return{newCollectionFiles:r,existingCollectionFiles:n}}async handleDelete(t){for(const a of t){this.storage.addPersistExcludedId(a.relative_path);const r=this.state.apis.get({noproxy:!0}).findIndex(i=>i.id===a.relative_path);r>=0&&(this.state.apis[r].set(Ma),this.tauriStorage.deleteApiFromCache(a.relative_path));const n=this.state.collections.get({noproxy:!0}).findIndex(i=>i.id===a.relative_path);n>=0&&this.state.collections[n].set(Ma),setTimeout(()=>{this.storage.removePersistExcludedId(a.relative_path)},500)}}async handleRename(t){if(t.length>=2){const[a,r]=t;await this.handleDelete([a]),await this.handleCreate([r])}else await this.handleCreate(t)}async isProjectFolderRemoved(t,a){if(t.length===0)return!1;if(a==="deleted"||a==="renamed"){for(const r of t)if(r===this.projectDir)return!0}return t.filter(r=>!r.startsWith(this.projectDir+"/")&&r!==this.projectDir).length>0&&a==="renamed"}async handleProjectFolderRemoval(){const t=this.state.apis.get({noproxy:!0});t.forEach(r=>{this.storage.addPersistExcludedId(r.id),this.tauriStorage.deleteApiFromCache(r.id)}),this.state.apis.set([]);const a=this.state.collections.get({noproxy:!0});a.forEach(r=>{this.storage.addPersistExcludedId(r.id)}),this.state.collections.set([]),setTimeout(()=>{t.forEach(r=>this.storage.removePersistExcludedId(r.id)),a.forEach(r=>this.storage.removePersistExcludedId(r.id))},500),await this.stop()}findApisToReload(t){const a=[];return this.state.apis.forEach(r=>{const n=r.fileDependencies?.get({noproxy:!0})??new Set,i=r.get({noproxy:!0}).id,o=t.find(s=>n.has(s.absolute_path));!this.storage.isWatchExcluded(i)&&o&&a.push(o)}),a}findCollectionsToReload(t){const a=[];return this.state.collections.forEach(r=>{const n=r.fileDependencies?.get({noproxy:!0})??new Set,i=r.get({noproxy:!0}).id,o=t.find(s=>n.has(s.absolute_path));!this.storage.isWatchExcluded(i)&&o&&a.push(o)}),a}async reloadEnvironments(){const t=await this.tauriStorage.readEnviroments();this.storage.addPersistExcludedId("replay-environments.yaml"),this.state.environments.set(t),setTimeout(()=>{this.storage.removePersistExcludedId("replay-environments.yaml")},500)}async reloadApis(t){if(t.length===0)return;const a=await this.tauriStorage.loadAndParseApis(t,void 0,!0);await Promise.all(a.map(async(r,n)=>{if(!r){await this.handleDelete([t[n]]);return}const i=this.state.apis.get({noproxy:!0}).findIndex(o=>o.id===r.id);i>=0?(this.storage.addPersistExcludedId(r.id),this.state.apis[i].set(r),setTimeout(()=>this.storage.removePersistExcludedId(r.id),500)):console.warn("API not found in state after reload:",r.id)}))}async reloadCollections(t){if(t.length===0)return;const a=await this.tauriStorage.loadAndParseCollections(t,void 0);await Promise.all(a.map(async(r,n)=>{if(!r){await this.handleDelete([t[n]]);return}const i=this.state.collections.get({noproxy:!0}).findIndex(o=>o.id===r.id);i>=0?(this.storage.addPersistExcludedId(r.id),this.state.collections[i].set(r),setTimeout(()=>this.storage.removePersistExcludedId(r.id),500)):console.warn("Collection not found in state after reload:",r.id)}))}}function CLt(e=!1){let t,a=!1,r=null,n=null;async function i(){if(!(!Qi()||!t||!n)){await o();try{const l=n.project.userFilesDir.get();r=new zLt(t,n,l),await r.start()}catch(l){console.error("Failed to start file watcher:",l),r=null}}}async function o(){r&&(await r.stop(),r=null)}async function s(){Qi()&&(await o(),await Cn("cleanup_all_managed_watchers"))}return()=>({id:"RootStoragePlugin",onCreate:()=>({cleanup:()=>async()=>{await s()},init:l=>async(c,u,d)=>{if(a||l.path.length>0)return{isInitialized:!1};if(a=!0,n=l,!e){t=Qi()?new xLt(c,u,d):new wLt(c,u,d);const h=await t.read();l.merge(h)}return a=!1,Qi()&&!e&&await i(),{isInitialized:!0}}}),onSet(l,c,u){a||e||t.update(c,u)},onDestroy:async()=>{await s()}})}function jLt({defaultEnvironments:e}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},tabsState:pd(eN),activeEnvironmentId:Vx,environments:e||jve,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:dd.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const PLt=ddt(jLt(),pdt(O5t({key:"replay-root-store"}),CLt())),DSe=j.createContext(PLt);function Ta(){const e=j.useContext(DSe);return sse(e)}function ALt(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1,aiEnabled:!1}}const MLt=ALt(),TLt=j.createContext(MLt);function Mc(){const e=j.useContext(TLt);return sse(e)}function BLt(e,t){const{apps:{apiId:a}}=Ta(),{corsProxyUrl:r,disableCollectionsTab:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l,aiEnabled:c}=Mc();r.set(e?.corsProxyUrl??y5t),a.set(e?.apiId),i.set(e?.oAuth2RedirectURI),n.set(!!e?.disableCollectionsTab),s.set(e?.storageKey),l.set(!!t),c.set(!!e?.aiEnabled),j.useEffect(()=>{o.set(e?.certificates||[])},[e?.certificates])}const $Se=j.createContext({});function pf(){return j.useContext($Se)||{}}const ELt=!0,RLt="0.22.0-next.8",_Lt={version:RLt};class ISe{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(t=>{this._initResolve=t});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new b5t}get isInitialized(){return this._isInitialized}get client(){return this._client}awaitInit(){return this._initPromise}updateCloudEventData(t){this._client.updateCloudEventData(t)}enrichGlobalAttributes(t){this._globalAttributes={...this._globalAttributes,...t}}getGlobalAttributes(){return{...this._globalAttributes}}clearGlobalAttributes(){this._globalAttributes={platform:"",deviceId:""}}init(t){if(this.isInitialized)return;const a=t?.tracerName||"desktop",r=t?.enableErrorInstrumentation??a==="desktop",n={serviceName:"replay",serviceVersion:_Lt.version,version:"1.0.0",tracerName:a,collectorUrl:"",isProd:ELt,enableErrorInstrumentation:r};this._client.init({otel:{...n,...t}}),this._initResolve?.(this),this._isInitialized=!0}sendEvent(t,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}const r=Array.isArray(a)?a.map(n=>({...this._globalAttributes,...n})):{...this._globalAttributes,...a};try{this.client.send(t,r)}catch(n){console.error("Failed to send telemetry event:",n)}}startSpan(t,a,r){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this._client.startSpan(t,{...this._globalAttributes,...a},r)}catch(n){console.error("Failed to start telemetry span:",n);return}}}const gM=new ISe;function ca(){const{telemetry:e}=pf();return gM.isInitialized||gM.init(e),{sendEvent:(t,a)=>{gM.sendEvent(t,a)},startSpan:(t,a,r)=>gM.startSpan(t,a,r)}}const ds=800,Ds=R(Qe).attrs({variant:"text",size:"small",tone:"danger"})`
12539
+ `))}}}async function mM(e,t){const a=new DO({});a.getRulesForSpecVersion=()=>[];const r=await zr.dirname(e),n={config:a,base:r,externalRefResolver:new LSe,dereference:!0};t?n.doc={source:{absoluteRef:e},parsed:t}:n.ref=e;const{bundle:{parsed:i},fileDependencies:o}=await i_(n);return{definition:i,fileDependencies:o}}class kLt{constructor(t){this.apisStorage=t}data=new Map;loading=new Set;pQueue=new yLt({concurrency:20});async get(t){return this.data.has(t)?this.data.get(t)??null:(await this.loadAndParse(t),this.data.get(t)??null)}async load(t,a=!1){this.data.has(t)&&!a||await this.loadAndParse(t,a)}async loadAndParse(t,a=!1){if(this.loading.has(t)){await this.pQueue.add(()=>this.get(t));return}a&&this.data.delete(t),this.loading.add(t),await this.pQueue.add(async()=>{const r=Ac(t)?Eo.WEB:Eo.FS,n=r===Eo.WEB?t:await this.apisStorage.getAbsolutePath(t);try{const{definition:i,fileDependencies:o}=await mM(n);if(!i){this.data.set(t,null);return}const s=this.apisStorage.parse({uri:t,type:r,content:i});this.data.set(t,{...s,fileDependencies:o})}catch(i){if(this.data.set(t,null),i instanceof Error&&(i.message.includes("Unsupported specification")||i.message.includes("File not found")))return;console.error("Error loading api "+t,i);return}}),this.loading.delete(t)}get size(){return this.data.size}delete(t){this.data.delete(t)}getAll(){return Array.from(this.data.values()).filter(t=>t!==null)}clear(){this.data.clear(),this.loading.clear()}}class xLt extends OSe{apiLoader;constructor(t,a,r){const n=new sN(t.systemFilesDir),i=new sN(t.userFilesDir);super(n,i,t,!0,a,r),this.apiLoader=new kLt(this.apisStorage),this.setupWriteListeners(i)}setupWriteListeners(t){t.on("write-start",a=>{this.addWatchExcludedId(a)}),t.on("write-end",a=>{this.removeWatchExcludedId(a)})}async read(){const t=this.telemetry?.startSpan("storage.read",void 0,void 0),a=this.telemetry?.startSpan("storage.loadUserState",{},t?.parentCtx),[r,n,i]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);a?.setAttribute("status","completed"),a?.setAttribute("environmentCount",i.length),a?.setStatus(Bo.OK),a?.end();const{apiFiles:o,collectionFiles:s}=await this.detectProjectFiles(t);await this.loadAndParseApis(o,t);const l=(await this.loadAndParseCollections(s,t)).filter(u=>u!==null);this.collectionsStorage.setItemIds(l.map(u=>u.id));const c=this.apiLoader.getAll();return this.apisStorage.setItemIds(c.map(u=>u.id)),t?.setAttribute("status","completed"),t?.setStatus(Bo.OK),t?.end(),{project:this.project,activeEnvironmentId:r,tabsState:n,environments:i,apis:c,collections:l}}async detectProjectFiles(t){const a=this.telemetry?.startSpan("storage.detectFiles",{},t?.parentCtx),{api_files:r,collection_files:n}=await Cn("fs_scan",{dir:this.project.userFilesDir});return a?.setAttribute("status","completed"),a?.setAttribute("filesCount",r.length+n.length),a?.setAttribute("apiFilesCount",r.length),a?.setAttribute("collectionFilesCount",n.length),a?.setStatus(Bo.OK),a?.end(),{apiFiles:r,collectionFiles:n}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(t){this.apiLoader.delete(t)}async loadAndParseApis(t,a,r=!1){const n=this.telemetry?.startSpan("storage.parseApis",{apisCount:t.length},a?.parentCtx),i=await Ave(t,20,async o=>{try{return await this.apiLoader.load(o.relative_path,r),this.apiLoader.get(o.relative_path)}catch(s){return console.error(`Error parsing YAML/JSON file ${o.absolute_path}:`,s),null}});return n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",this.apiLoader.size),n?.setStatus(Bo.OK),n?.end(),i}async loadAndParseCollections(t,a){const r=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:t.length},a?.parentCtx),n=await Ave(t,20,async i=>{try{const o=await this.userFilesStorage.get(i.relative_path);if(!o)return null;const s=lp.load(o);if(typeof s!="object"||s===null||typeof s.arazzo!="string")return null;const l=[];await Promise.all(s.sourceDescriptions?.map(async u=>{const d=u.type,h=u.url,m=!d||d==="openapi",v=await ZOe({projectPath:this.project.userFilesDir,apiUrl:h,collectionId:i.relative_path});if(m){const f=await this.apiLoader.get(v);f&&l.push(f)}}));const c=await zr.join(this.project.userFilesDir,i.relative_path);return await this.collectionsStorage.parse({uri:i.relative_path,type:Eo.FS,content:s,fileDependencies:new Set([c])},l)}catch(o){return console.error(`Error parsing Arazzo file ${i.relative_path}:`,o),null}});return r?.setAttribute("status","completed"),r?.setAttribute("parsedCollectionsCount",n.length),r?.setStatus(Bo.OK),r?.end(),n}}class PI{constructor(t){this.baseDir=t}writeExcludedKeys=new Set;setWriteExcludedKeys(t){this.writeExcludedKeys=t}async ls(t=""){const a=this.makeKey(t);return Object.keys(localStorage).filter(r=>r.startsWith(a)).map(r=>r.replace(a,""))}async get(t){const a=this.makeKey(t);return localStorage.getItem(a)??null}async has(t){const a=this.makeKey(t);return localStorage.getItem(a)!==null}async set(t,a){if(this.writeExcludedKeys.has(t))return;const r=this.makeKey(t);localStorage.setItem(r,a)}async remove(t){if(this.writeExcludedKeys.has(t))return;const a=this.makeKey(t);localStorage.removeItem(a)}async rename(t,a){const r=this.makeKey(t),n=this.makeKey(a),i=localStorage.getItem(r);i!==null&&(localStorage.setItem(n,i),localStorage.removeItem(r))}makeKey(t){return`replay:fs:${this.baseDir}/${t}`}on(t,a){}off(t,a){}}class wLt extends OSe{constructor(t,a,r){const n=new PI(t.systemFilesDir),i=new PI(t.userFilesDir);super(n,i,t,!1,a,r)}async detectProjectFiles(t){const a=this.telemetry?.startSpan("storage.detectFiles",{},t?.parentCtx),r=(await this.userFilesStorage.ls()).filter(s=>/\.(ya?ml|json)$/.test(s)),n=[],i=[],o=new Set;return await Promise.all(r.map(async s=>{const l=await this.userFilesStorage.get(s);if(l)try{const c=lp.load(l);if(typeof c=="object"&&c!==null)if(typeof c.openapi=="string"){const u=await zr.resolve(await zr.join(this.userFilesStorage.baseDir,s)),{definition:d}=await mM(u,c);n.push({uri:s,type:Eo.FS,content:d})}else typeof c.arazzo=="string"&&(i.push({uri:s,type:Eo.FS,content:c}),c.sourceDescriptions?.forEach(u=>{const d=u.type,h=u.url,m=!d||d==="openapi",v=typeof h=="string"&&Ac(h);m&&v&&o.add(h)}))}catch(c){console.error(`Error parsing YAML/JSON file ${s}:`,c)}})),a?.setAttribute("status","completed"),a?.setAttribute("filesCount",r.length),a?.setAttribute("apiFilesCount",n.length),a?.setAttribute("collectionFilesCount",i.length),a?.setAttribute("apiUrlsCount",o.size),a?.setStatus(Bo.OK),a?.end(),{apiFiles:n,collectionFiles:i,apiUrls:o}}async loadApis(t,a){const r=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:t.size},a?.parentCtx),n=[];return await Promise.all(Array.from(t).map(async i=>{try{const{definition:o}=await mM(i);n.push({uri:i,type:Eo.WEB,content:o})}catch(o){console.error(`Error parsing YAML from ${i}:`,o)}})),r?.setAttribute("status","completed"),r?.setStatus(Bo.OK),r?.end(),n}async parseApis(t,a){const r=this.telemetry?.startSpan("storage.parseApis",{apisCount:t.length},a?.parentCtx),n=await this.apisStorage.parseMany(t);return r?.setAttribute("status","completed"),r?.setAttribute("parsedApisCount",n.length),r?.setStatus(Bo.OK),r?.end(),n}async parseCollections(t,a,r){const n=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:t.length},r?.parentCtx),i=await this.collectionsStorage.parseMany(t,a);return n?.setAttribute("status","completed"),n?.setAttribute("parsedCollectionsCount",i.length),n?.setStatus(Bo.OK),n?.end(),i}async read(){const t=this.telemetry?.startSpan("storage.read",void 0,void 0),a=this.telemetry?.startSpan("storage.loadUserState",{},t?.parentCtx),[r,n,i]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);a?.setAttribute("status","completed"),a?.setAttribute("environmentCount",i.length),a?.setStatus(Bo.OK),a?.end();const{apiFiles:o,collectionFiles:s,apiUrls:l}=await this.detectProjectFiles(t),c=await this.loadApis(l,t),u=await this.parseApis([...o,...c],t);this.apisStorage.setItemIds(u.map(h=>h.id));const d=await this.parseCollections(s,u,t);return this.collectionsStorage.setItemIds(d.map(h=>h.id)),t?.setAttribute("status","completed"),t?.setStatus(Bo.OK),t?.end(),{project:this.project,activeEnvironmentId:r,tabsState:n,environments:i,apis:u,collections:d}}}var NSe;(function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"})(NSe||(NSe={}));async function OLt(e,t){await Cn("plugin:event|unlisten",{event:e,eventId:t})}async function SLt(e,t,a){var r;const n=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return Cn("plugin:event|listen",{event:e,target:n,handler:S5t(t)}).then(i=>async()=>OLt(e,i))}class zLt{constructor(t,a,r){this.storage=t,this.state=a,this.projectDir=r}watchPath=null;unlistenEvent=null;get tauriStorage(){return this.storage}async start(){if(this.watchPath){console.warn("Watcher already started for:",this.watchPath);return}try{this.unlistenEvent=await SLt("fs-watch-event",async t=>{const a=t.payload;try{await this.handleEvent(a)}catch(r){console.error("Error handling file change:",r)}}),await Cn("fs_watch",{path:this.projectDir,options:{recursive:!0,delayMs:500}}),this.watchPath=this.projectDir}catch(t){throw console.error("Failed to start file watcher:",t),this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),t}}async stop(){if(this.watchPath)try{await Cn("fs_unwatch",{path:this.watchPath})}catch(t){console.error("Error stopping file watcher:",t)}finally{this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),this.watchPath=null}}async handleEvent(t){const{changeType:a,paths:r,pathTypes:n,type:i}=t;if(await this.isProjectFolderRemoved(r,a)){await this.handleProjectFolderRemoval();return}const o=this.filterSpecFiles(r,n);if(o.paths.length===0)return;const s=await this.toFileEntries(o.paths,o.pathTypes);switch(a){case"changed":(i.includes("Data")||i.includes("Name"))&&await this.handleModify(s);break;case"added":await this.handleCreate(s);break;case"deleted":await this.handleDelete(s);break;case"renamed":await this.handleRename(s);break;default:console.log("Unhandled change type:",a)}}filterSpecFiles(t,a){const r=[],n=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.split(".").pop()?.toLowerCase();s&&["yaml","yml","json"].includes(s)&&(r.push(o),n.push(a[i]||"unknown"))}return{paths:r,pathTypes:n}}async toFileEntries(t,a){return Promise.all(t.map(async(r,n)=>({relative_path:await zr.relative(this.projectDir,r),absolute_path:r,type:a[n]||"unknown"})))}consolidateFileEntries(t){const a=[],r=new Set;for(const n of t)r.has(n.relative_path)||(r.add(n.relative_path),this.storage.isWatchExcluded(n.relative_path)||a.push(n));return a}async handleModify(t){const a=!this.storage.isWatchExcluded("replay-environments.yaml")&&t.some(m=>m.relative_path==="replay-environments.yaml"),r=t.filter(m=>m.relative_path!=="replay-environments.yaml"),{newApiFiles:n,existingApiFiles:i}=this.categorizeApisFromFiles(r),{newCollectionFiles:o,existingCollectionFiles:s}=this.categorizeCollectionsFromFiles(r),l=this.findApisToReload(t),c=this.findCollectionsToReload(t),u=[...n,...o];u.length>0&&await this.handleCreate(u),a&&await this.reloadEnvironments();const d=this.consolidateFileEntries([...i,...l]),h=this.consolidateFileEntries([...s,...c]);await this.reloadApis(d),await this.reloadCollections(h)}async handleCreate(t){const a=t.filter(l=>l.type==="api"),r=t.filter(l=>l.type==="collection"),{newApiFiles:n,existingApiFiles:i}=this.categorizeApisFromFiles(a),{newCollectionFiles:o,existingCollectionFiles:s}=this.categorizeCollectionsFromFiles(r);if(n.length>0||o.length>0){n.forEach(u=>this.storage.addPersistExcludedId(u.relative_path)),o.forEach(u=>this.storage.addPersistExcludedId(u.relative_path));const l=n.length>0?await this.tauriStorage.loadAndParseApis(n,void 0,!0):[],c=o.length>0?await this.tauriStorage.loadAndParseCollections(o,void 0):[];this.state.apis.merge(l.filter(u=>u!==null)),this.state.collections.merge(c.filter(u=>u!==null)),setTimeout(()=>{n.forEach(u=>this.storage.removePersistExcludedId(u.relative_path)),o.forEach(u=>this.storage.removePersistExcludedId(u.relative_path))},500)}i.length>0&&await this.reloadApis(i),s.length>0&&await this.reloadCollections(s)}categorizeApisFromFiles(t){const a=new Set,r=[],n=[];for(const i of t)a.has(i.relative_path)||(a.add(i.relative_path),this.state.apis.get({noproxy:!0}).some(o=>o.id===i.relative_path)?n.push(i):i.type==="api"&&r.push(i));return{newApiFiles:r,existingApiFiles:n}}categorizeCollectionsFromFiles(t){const a=new Set,r=[],n=[];for(const i of t)a.has(i.relative_path)||(a.add(i.relative_path),this.state.collections.get({noproxy:!0}).some(o=>o.id===i.relative_path)?n.push(i):i.type==="collection"&&r.push(i));return{newCollectionFiles:r,existingCollectionFiles:n}}async handleDelete(t){for(const a of t){this.storage.addPersistExcludedId(a.relative_path);const r=this.state.apis.get({noproxy:!0}).findIndex(i=>i.id===a.relative_path);r>=0&&(this.state.apis[r].set(Ma),this.tauriStorage.deleteApiFromCache(a.relative_path));const n=this.state.collections.get({noproxy:!0}).findIndex(i=>i.id===a.relative_path);n>=0&&this.state.collections[n].set(Ma),setTimeout(()=>{this.storage.removePersistExcludedId(a.relative_path)},500)}}async handleRename(t){if(t.length>=2){const[a,r]=t;await this.handleDelete([a]),await this.handleCreate([r])}else await this.handleCreate(t)}async isProjectFolderRemoved(t,a){if(t.length===0)return!1;if(a==="deleted"||a==="renamed"){for(const r of t)if(r===this.projectDir)return!0}return t.filter(r=>!r.startsWith(this.projectDir+"/")&&r!==this.projectDir).length>0&&a==="renamed"}async handleProjectFolderRemoval(){const t=this.state.apis.get({noproxy:!0});t.forEach(r=>{this.storage.addPersistExcludedId(r.id),this.tauriStorage.deleteApiFromCache(r.id)}),this.state.apis.set([]);const a=this.state.collections.get({noproxy:!0});a.forEach(r=>{this.storage.addPersistExcludedId(r.id)}),this.state.collections.set([]),setTimeout(()=>{t.forEach(r=>this.storage.removePersistExcludedId(r.id)),a.forEach(r=>this.storage.removePersistExcludedId(r.id))},500),await this.stop()}findApisToReload(t){const a=[];return this.state.apis.forEach(r=>{const n=r.fileDependencies?.get({noproxy:!0})??new Set,i=r.get({noproxy:!0}).id,o=t.find(s=>n.has(s.absolute_path));!this.storage.isWatchExcluded(i)&&o&&a.push(o)}),a}findCollectionsToReload(t){const a=[];return this.state.collections.forEach(r=>{const n=r.fileDependencies?.get({noproxy:!0})??new Set,i=r.get({noproxy:!0}).id,o=t.find(s=>n.has(s.absolute_path));!this.storage.isWatchExcluded(i)&&o&&a.push(o)}),a}async reloadEnvironments(){const t=await this.tauriStorage.readEnviroments();this.storage.addPersistExcludedId("replay-environments.yaml"),this.state.environments.set(t),setTimeout(()=>{this.storage.removePersistExcludedId("replay-environments.yaml")},500)}async reloadApis(t){if(t.length===0)return;const a=await this.tauriStorage.loadAndParseApis(t,void 0,!0);await Promise.all(a.map(async(r,n)=>{if(!r){await this.handleDelete([t[n]]);return}const i=this.state.apis.get({noproxy:!0}).findIndex(o=>o.id===r.id);i>=0?(this.storage.addPersistExcludedId(r.id),this.state.apis[i].set(r),setTimeout(()=>this.storage.removePersistExcludedId(r.id),500)):console.warn("API not found in state after reload:",r.id)}))}async reloadCollections(t){if(t.length===0)return;const a=await this.tauriStorage.loadAndParseCollections(t,void 0);await Promise.all(a.map(async(r,n)=>{if(!r){await this.handleDelete([t[n]]);return}const i=this.state.collections.get({noproxy:!0}).findIndex(o=>o.id===r.id);i>=0?(this.storage.addPersistExcludedId(r.id),this.state.collections[i].set(r),setTimeout(()=>this.storage.removePersistExcludedId(r.id),500)):console.warn("Collection not found in state after reload:",r.id)}))}}function CLt(e=!1){let t,a=!1,r=null,n=null;async function i(){if(!(!Qi()||!t||!n)){await o();try{const l=n.project.userFilesDir.get();r=new zLt(t,n,l),await r.start()}catch(l){console.error("Failed to start file watcher:",l),r=null}}}async function o(){r&&(await r.stop(),r=null)}async function s(){Qi()&&(await o(),await Cn("cleanup_all_managed_watchers"))}return()=>({id:"RootStoragePlugin",onCreate:()=>({cleanup:()=>async()=>{await s()},init:l=>async(c,u,d)=>{if(a||l.path.length>0)return{isInitialized:!1};if(a=!0,n=l,!e){t=Qi()?new xLt(c,u,d):new wLt(c,u,d);const h=await t.read();l.merge(h)}return a=!1,Qi()&&!e&&await i(),{isInitialized:!0}}}),onSet(l,c,u){a||e||t.update(c,u)},onDestroy:async()=>{await s()}})}function jLt({defaultEnvironments:e}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},tabsState:pd(eN),activeEnvironmentId:Vx,environments:e||jve,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:dd.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const PLt=ddt(jLt(),pdt(O5t({key:"replay-root-store"}),CLt())),DSe=j.createContext(PLt);function Ta(){const e=j.useContext(DSe);return sse(e)}function ALt(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1,aiEnabled:!1}}const MLt=ALt(),TLt=j.createContext(MLt);function Mc(){const e=j.useContext(TLt);return sse(e)}function BLt(e,t){const{apps:{apiId:a}}=Ta(),{corsProxyUrl:r,disableCollectionsTab:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l,aiEnabled:c}=Mc();r.set(e?.corsProxyUrl??y5t),a.set(e?.apiId),i.set(e?.oAuth2RedirectURI),n.set(!!e?.disableCollectionsTab),s.set(e?.storageKey),l.set(!!t),c.set(!!e?.aiEnabled),j.useEffect(()=>{o.set(e?.certificates||[])},[e?.certificates])}const $Se=j.createContext({});function pf(){return j.useContext($Se)||{}}const ELt=!0,RLt="0.22.0",_Lt={version:RLt};class ISe{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(t=>{this._initResolve=t});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new b5t}get isInitialized(){return this._isInitialized}get client(){return this._client}awaitInit(){return this._initPromise}updateCloudEventData(t){this._client.updateCloudEventData(t)}enrichGlobalAttributes(t){this._globalAttributes={...this._globalAttributes,...t}}getGlobalAttributes(){return{...this._globalAttributes}}clearGlobalAttributes(){this._globalAttributes={platform:"",deviceId:""}}init(t){if(this.isInitialized)return;const a=t?.tracerName||"desktop",r=t?.enableErrorInstrumentation??a==="desktop",n={serviceName:"replay",serviceVersion:_Lt.version,version:"1.0.0",tracerName:a,collectorUrl:"",isProd:ELt,enableErrorInstrumentation:r};this._client.init({otel:{...n,...t}}),this._initResolve?.(this),this._isInitialized=!0}sendEvent(t,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}const r=Array.isArray(a)?a.map(n=>({...this._globalAttributes,...n})):{...this._globalAttributes,...a};try{this.client.send(t,r)}catch(n){console.error("Failed to send telemetry event:",n)}}startSpan(t,a,r){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this._client.startSpan(t,{...this._globalAttributes,...a},r)}catch(n){console.error("Failed to start telemetry span:",n);return}}}const gM=new ISe;function ca(){const{telemetry:e}=pf();return gM.isInitialized||gM.init(e),{sendEvent:(t,a)=>{gM.sendEvent(t,a)},startSpan:(t,a,r)=>gM.startSpan(t,a,r)}}const ds=800,Ds=R(Qe).attrs({variant:"text",size:"small",tone:"danger"})`
12540
12540
  border: none;
12541
12541
  margin: 0;
12542
12542