edgeone 1.2.23-beta.2 → 1.2.23-beta.3

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.
@@ -260,7 +260,7 @@ ${" ".repeat(m)}`)}}}else n?l=`/*${t.value}*/`:l=`//${t.value}`;if(this._endsWit
260
260
  `);return r.message&&!d&&(x=`${" ".repeat(m+1)}${r.message}
261
261
  ${x}`),n?a.reset(x):x}function BDr(e,t,r,n={}){if(!qze){qze=!0;let s="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(s,"DeprecationWarning");else{let c=new Error(s);c.name="DeprecationWarning",console.warn(new Error(s))}}return r=Math.max(r,0),Wze(e,{start:{column:r,line:t}},n)}uM.codeFrameColumns=Wze;uM.default=BDr;uM.highlight=$ze});var Gze=P(KV=>{"use strict";Object.defineProperty(KV,"__esModule",{value:!0});KV.hooks=void 0;var Dai=KV.hooks=[function(e,t){if(e.key==="test"&&(t.isWhile()||t.isSwitchCase())||e.key==="declaration"&&t.isExportDeclaration()||e.key==="body"&&t.isLabeledStatement()||e.listKey==="declarations"&&t.isVariableDeclaration()&&t.node.declarations.length===1||e.key==="expression"&&t.isExpressionStatement())return t.remove(),!0},function(e,t){if(t.isSequenceExpression()&&t.node.expressions.length===1)return t.replaceWith(t.node.expressions[0]),!0},function(e,t){if(t.isBinary())return e.key==="left"?t.replaceWith(t.node.right):t.replaceWith(t.node.left),!0},function(e,t){if(t.isIfStatement()&&e.key==="consequent"||e.key==="body"&&(t.isLoop()||t.isArrowFunctionExpression()))return e.replaceWith({type:"BlockStatement",directives:[],body:[]}),!0}]});var XV=P(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_._assertUnremoved=Zze;u_._callRemovalHooks=Kze;u_._markRemoved=Nfe;u_._remove=Xze;u_._removeFromScope=Jze;u_.remove=QDr;var DDr=Gze(),PDr=UT(),RDr=Ffe(),Yze=x2(),NDr=Es(),FDr=ZV(),ODr=yy();function QDr(){var e;if(Zze.call(this),ODr.resync.call(this),Kze.call(this)){Nfe.call(this);return}(e=this.opts)!=null&&e.noScope||Jze.call(this),this.shareCommentsWithSiblings(),Xze.call(this),Nfe.call(this)}function Jze(){let e=NDr.getBindingIdentifiers(this.node,!1,!1,!0);Object.keys(e).forEach(t=>this.scope.removeBinding(t))}function Kze(){if(this.parentPath){for(let e of DDr.hooks)if(e(this,this.parentPath))return!0}}function Xze(){Array.isArray(this.container)?(this.container.splice(this.key,1),FDr.updateSiblingKeys.call(this,this.key,-1)):RDr._replaceWith.call(this,null)}function Nfe(){if(this._traverseFlags|=Yze.SHOULD_SKIP|Yze.REMOVED,this.parent){var e;(e=(0,PDr.getCachedPaths)(this))==null||e.delete(this.node)}this.node=null}function Zze(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")}});var tHe=P(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});e$.default=void 0;var eHe=Es(),LDr=eHe,{react:jDr}=eHe,{cloneNode:MDr,jsxExpressionContainer:qDr,variableDeclaration:UDr,variableDeclarator:zDr}=LDr,HDr={ReferencedIdentifier(e,t){if(e.isJSXIdentifier()&&jDr.isCompatTag(e.node.name)&&!e.parentPath.isJSXMemberExpression())return;if(e.node.name==="this"){let n=e.scope;do if(n.path.isFunction()&&!n.path.isArrowFunctionExpression())break;while(n=n.parent);n&&t.breakOnScopePaths.push(n.path)}let r=e.scope.getBinding(e.node.name);if(r){for(let n of r.constantViolations)if(n.scope!==r.path.scope){t.mutableBinding=!0,e.stop();return}r===t.scope.getBinding(e.node.name)&&(t.bindings[e.node.name]=r)}}},Ofe=class{constructor(t,r){this.breakOnScopePaths=void 0,this.bindings=void 0,this.mutableBinding=void 0,this.scopes=void 0,this.scope=void 0,this.path=void 0,this.attachAfter=void 0,this.breakOnScopePaths=[],this.bindings={},this.mutableBinding=!1,this.scopes=[],this.scope=r,this.path=t,this.attachAfter=!1}isCompatibleScope(t){for(let r of Object.keys(this.bindings)){let n=this.bindings[r];if(!t.bindingIdentifierEquals(r,n.identifier))return!1}return!0}getCompatibleScopes(){let t=this.path.scope;do{if(this.isCompatibleScope(t))this.scopes.push(t);else break;if(this.breakOnScopePaths.includes(t.path))break}while(t=t.parent)}getAttachmentPath(){let t=this._getAttachmentPath();if(!t)return;let r=t.scope;if(r.path===t&&(r=t.scope.parent),r.path.isProgram()||r.path.isFunction())for(let n of Object.keys(this.bindings)){if(!r.hasOwnBinding(n))continue;let a=this.bindings[n];if(a.kind==="param"||a.path.parentKey==="params")continue;if(this.getAttachmentParentForPath(a.path).key>=t.key){this.attachAfter=!0,t=a.path;for(let c of a.constantViolations)this.getAttachmentParentForPath(c).key>t.key&&(t=c)}}return t}_getAttachmentPath(){let r=this.scopes.pop();if(r){if(r.path.isFunction())if(this.hasOwnParamBindings(r)){if(this.scope===r)return;let n=r.path.get("body").get("body");for(let a=0;a<n.length;a++)if(!n[a].node._blockHoist)return n[a]}else return this.getNextScopeAttachmentParent();else if(r.path.isProgram())return this.getNextScopeAttachmentParent()}}getNextScopeAttachmentParent(){let t=this.scopes.pop();if(t)return this.getAttachmentParentForPath(t.path)}getAttachmentParentForPath(t){do if(!t.parentPath||Array.isArray(t.container)&&t.isStatement())return t;while(t=t.parentPath);return t}hasOwnParamBindings(t){for(let r of Object.keys(this.bindings)){if(!t.hasOwnBinding(r))continue;let n=this.bindings[r];if(n.kind==="param"&&n.constant)return!0}return!1}run(){if(this.path.traverse(HDr,this),this.mutableBinding)return;this.getCompatibleScopes();let t=this.getAttachmentPath();if(!t||t.getFunctionParent()===this.path.getFunctionParent())return;let r=t.scope.generateUidIdentifier("ref"),n=zDr(r,this.path.node),a=this.attachAfter?"insertAfter":"insertBefore",[s]=t[a]([t.isVariableDeclarator()?n:UDr("var",[n])]),c=this.path.parentPath;return c.isJSXElement()&&this.path.container===c.node.children&&(r=qDr(r)),this.path.replaceWith(MDr(r)),s.isVariableDeclarator()?s.get("init"):s.get("declarations.0.init")}};e$.default=Ofe});var ZV=P(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey._containerInsert=qfe;Ey._containerInsertAfter=iHe;Ey._containerInsertBefore=Ufe;Ey._verifyNodeList=lM;Ey.insertAfter=oPr;Ey.insertBefore=sPr;Ey.pushContainer=uPr;Ey.unshiftContainer=cPr;Ey.updateSiblingKeys=oHe;var VDr=UT(),Mfe=x2(),Qfe=yy(),t$=XV(),$Dr=Es(),WDr=tHe(),{arrowFunctionExpression:GDr,assertExpression:YDr,assignmentExpression:JDr,blockStatement:rHe,callExpression:KDr,cloneNode:Lfe,expressionStatement:jfe,isAssignmentExpression:XDr,isCallExpression:ZDr,isExportNamedDeclaration:nHe,isExpression:ePr,isIdentifier:tPr,isSequenceExpression:rPr,isSuper:nPr,thisExpression:iPr}=$Dr;function sPr(e){t$._assertUnremoved.call(this);let t=lM.call(this,e),{parentPath:r,parent:n}=this;if(r.isExpressionStatement()||r.isLabeledStatement()||nHe(n)||r.isExportDefaultDeclaration()&&this.isDeclaration())return r.insertBefore(t);if(this.isNodeType("Expression")&&!this.isJSXElement()||r.isForStatement()&&this.key==="init")return this.node&&t.push(this.node),this.replaceExpressionWithStatements(t);if(Array.isArray(this.container))return Ufe.call(this,t);if(this.isStatementOrBlock()){let a=this.node,s=a&&(!this.isExpressionStatement()||a.expression!=null),[c]=this.replaceWith(rHe(s?[a]:[]));return c.unshiftContainer("body",t)}else throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?")}function qfe(e,t){oHe.call(this,e,t.length);let r=[];this.container.splice(e,0,...t);for(let s=0;s<t.length;s++){var n;let c=e+s,l=this.getSibling(c);r.push(l),(n=this.context)!=null&&n.queue&&Qfe.pushContext.call(l,this.context)}let a=Qfe._getQueueContexts.call(this);for(let s of r){Qfe.setScope.call(s),s.debug("Inserted.");for(let c of a)c.maybeQueue(s,!0)}return r}function Ufe(e){return qfe.call(this,this.key,e)}function iHe(e){return qfe.call(this,this.key+1,e)}var sHe=e=>e[e.length-1];function aHe(e){return rPr(e.parent)&&(sHe(e.parent.expressions)!==e.node||aHe(e.parentPath))}function aPr(e,t){if(!XDr(e)||!tPr(e.left))return!1;let r=t.getBlockParent();return r.hasOwnBinding(e.left.name)&&r.getOwnBinding(e.left.name).constantViolations.length<=1}function oPr(e){if(t$._assertUnremoved.call(this),this.isSequenceExpression())return sHe(this.get("expressions")).insertAfter(e);let t=lM.call(this,e),{parentPath:r,parent:n}=this;if(r.isExpressionStatement()||r.isLabeledStatement()||nHe(n)||r.isExportDefaultDeclaration()&&this.isDeclaration())return r.insertAfter(t.map(a=>ePr(a)?jfe(a):a));if(this.isNodeType("Expression")&&!this.isJSXElement()&&!r.isJSXElement()||r.isForStatement()&&this.key==="init"){let a=this;if(a.node){let s=a.node,{scope:c}=this;if(c.path.isPattern())return YDr(s),a.replaceWith(KDr(GDr([],s),[])),a.get("callee.body").insertAfter(t),[a];if(aHe(a))t.unshift(s);else if(ZDr(s)&&nPr(s.callee))t.unshift(s),t.push(iPr());else if(aPr(s,c))t.unshift(s),t.push(Lfe(s.left));else if(c.isPure(s,!0))t.push(s);else{r.isMethod({computed:!0,key:s})&&(c=c.parent);let l=c.generateDeclaredUidIdentifier();t.unshift(jfe(JDr("=",Lfe(l),s))),t.push(jfe(Lfe(l)))}}return this.replaceExpressionWithStatements(t)}else{if(Array.isArray(this.container))return iHe.call(this,t);if(this.isStatementOrBlock()){let a=this.node,s=a&&(!this.isExpressionStatement()||a.expression!=null),[c]=this.replaceWith(rHe(s?[a]:[]));return c.pushContainer("body",t)}else throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?")}}function oHe(e,t){if(!this.parent)return;let r=(0,VDr.getCachedPaths)(this);if(r)for(let[,n]of r)typeof n.key=="number"&&n.container===this.container&&n.key>=e&&(n.key+=t)}function lM(e){if(!e)return[];Array.isArray(e)||(e=[e]);for(let t=0;t<e.length;t++){let r=e[t],n;if(r?typeof r!="object"?n="contains a non-object node":r.type?r instanceof Mfe.default&&(n="has a NodePath when it expected a raw object"):n="without a type":n="has falsy node",n){let a=Array.isArray(r)?"array":typeof r;throw new Error(`Node list ${n} with the index of ${t} and type of ${a}`)}}return e}function cPr(e,t){t$._assertUnremoved.call(this);let r=lM.call(this,t),n=this.node[e],a=Mfe.default.get({parentPath:this,parent:this.node,container:n,listKey:e,key:0}).setContext(this.context);return Ufe.call(a,r)}function uPr(e,t){t$._assertUnremoved.call(this);let r=lM.call(this,t),n=this.node[e];return Mfe.default.get({parentPath:this,parent:this.node,container:n,listKey:e,key:n.length}).setContext(this.context).replaceWithMultiple(r)}Ey.hoist=function(t=this.scope){return new WDr.default(this,t).run()}});var bM=P(xM=>{"use strict";Object.defineProperty(xM,"__esModule",{value:!0});function lPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hE=class{constructor(t,r,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=r,this.index=n}},jN=class{constructor(t,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=r}};function um(e,t){let{line:r,column:n,index:a}=e;return new hE(r,n+t,a+t)}var cHe="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",pPr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:cHe},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:cHe}},uHe={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},i$=e=>e.type==="UpdateExpression"?uHe.UpdateExpression[`${e.prefix}`]:uHe[e.type],fPr={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
262
262
  - Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:e})=>`'${e==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:e})=>`Unsyntactic ${e==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.
263
- - Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${i$(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${i$(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${i$(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},dPr={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},hPr={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},mPr=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),gPr=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${i$({type:e})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),APr=["message"];function lHe(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:r})}function yPr({toMessage:e,code:t,reasonCode:r,syntaxPlugin:n}){let a=r==="MissingPlugin"||r==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[r]&&(r=s[r])}return function s(c,l){let f=new SyntaxError;return f.code=t,f.reasonCode=r,f.loc=c,f.pos=c.index,f.syntaxPlugin=n,a&&(f.missingPlugin=l.missingPlugin),lHe(f,"clone",function(m={}){var g;let{line:x,column:b,index:A}=(g=m.loc)!=null?g:c;return s(new hE(x,b,A),Object.assign({},l,m.details))}),lHe(f,"details",l),Object.defineProperty(f,"message",{configurable:!0,get(){let d=`${e(l)} (${c.line}:${c.column})`;return this.message=d,d},set(d){Object.defineProperty(this,"message",{value:d,writable:!0})}}),f}}function fE(e,t){if(Array.isArray(e))return n=>fE(n,e[0]);let r={};for(let n of Object.keys(e)){let a=e[n],s=typeof a=="string"?{message:()=>a}:typeof a=="function"?{message:a}:a,{message:c}=s,l=lPr(s,APr),f=typeof c=="string"?()=>c:c;r[n]=yPr(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:f},t?{syntaxPlugin:t}:{},l))}return r}var ot=Object.assign({},fE(pPr),fE(fPr),fE(dPr),fE(hPr),fE`pipelineOperator`(gPr));function vPr(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function xPr(e){let t=vPr();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let r of Object.keys(t))e[r]!=null&&(t[r]=e[r]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((e.startColumn==null||e.startIndex==null)&&e.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType==="commonjs"){if(e.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}var{defineProperty:bPr}=Object,pHe=(e,t)=>{e&&bPr(e,t,{enumerable:!1,value:e[t]})};function pM(e){return pHe(e.loc.start,"index"),pHe(e.loc.end,"index"),e}var EPr=e=>class extends e{parse(){let r=pM(super.parse());return this.optionFlags&256&&(r.tokens=r.tokens.map(pM)),r}parseRegExpLiteral({pattern:r,flags:n}){let a=null;try{a=new RegExp(r,n)}catch{}let s=this.estreeParseLiteral(a);return s.regex={pattern:r,flags:n},s}parseBigIntLiteral(r){let n;try{n=BigInt(r)}catch{n=null}let a=this.estreeParseLiteral(n);return a.bigint=String(a.value||r),a}parseDecimalLiteral(r){let a=this.estreeParseLiteral(null);return a.decimal=String(a.value||r),a}estreeParseLiteral(r){return this.parseLiteral(r,"Literal")}parseStringLiteral(r){return this.estreeParseLiteral(r)}parseNumericLiteral(r){return this.estreeParseLiteral(r)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(r){return this.estreeParseLiteral(r)}estreeParseChainExpression(r,n){let a=this.startNodeAtNode(r);return a.expression=r,this.finishNodeAt(a,"ChainExpression",n)}directiveToStmt(r){let n=r.value;delete r.value,this.castNodeTo(n,"Literal"),n.raw=n.extra.raw,n.value=n.extra.expressionValue;let a=this.castNodeTo(r,"ExpressionStatement");return a.expression=n,a.directive=n.extra.rawValue,delete n.extra,a}fillOptionalPropertiesForTSESLint(r){}cloneEstreeStringLiteral(r){let{start:n,end:a,loc:s,range:c,raw:l,value:f}=r,d=Object.create(r.constructor.prototype);return d.type="Literal",d.start=n,d.end=a,d.loc=s,d.range=c,d.raw=l,d.value=f,d}initFunction(r,n){super.initFunction(r,n),r.expression=!1}checkDeclaration(r){r!=null&&this.isObjectProperty(r)?this.checkDeclaration(r.value):super.checkDeclaration(r)}getObjectOrClassMethodParams(r){return r.value.params}isValidDirective(r){var n;return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&typeof r.expression.value=="string"&&!((n=r.expression.extra)!=null&&n.parenthesized)}parseBlockBody(r,n,a,s,c){super.parseBlockBody(r,n,a,s,c);let l=r.directives.map(f=>this.directiveToStmt(f));r.body=l.concat(r.body),delete r.directives}parsePrivateName(){let r=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(r):r}convertPrivateNameToPrivateIdentifier(r){let n=super.getPrivateNameSV(r);return delete r.id,r.name=n,this.castNodeTo(r,"PrivateIdentifier")}isPrivateName(r){return this.getPluginOption("estree","classFeatures")?r.type==="PrivateIdentifier":super.isPrivateName(r)}getPrivateNameSV(r){return this.getPluginOption("estree","classFeatures")?r.name:super.getPrivateNameSV(r)}parseLiteral(r,n){let a=super.parseLiteral(r,n);return a.raw=a.extra.raw,delete a.extra,a}parseFunctionBody(r,n,a=!1){super.parseFunctionBody(r,n,a),r.expression=r.body.type!=="BlockStatement"}parseMethod(r,n,a,s,c,l,f=!1){let d=this.startNode();d.kind=r.kind,d=super.parseMethod(d,n,a,s,c,l,f),delete d.kind;let{typeParameters:m}=r;m&&(delete r.typeParameters,d.typeParameters=m,this.resetStartLocationFromNode(d,m));let g=this.castNodeTo(d,"FunctionExpression");return r.value=g,l==="ClassPrivateMethod"&&(r.computed=!1),l==="ObjectMethod"?(r.kind==="method"&&(r.kind="init"),r.shorthand=!1,this.finishNode(r,"Property")):this.finishNode(r,"MethodDefinition")}nameIsConstructor(r){return r.type==="Literal"?r.value==="constructor":super.nameIsConstructor(r)}parseClassProperty(...r){let n=super.parseClassProperty(...r);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(n,"PropertyDefinition"),n}parseClassPrivateProperty(...r){let n=super.parseClassPrivateProperty(...r);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(n,"PropertyDefinition"),n.computed=!1),n}parseClassAccessorProperty(r){let n=super.parseClassAccessorProperty(r);return this.getPluginOption("estree","classFeatures")&&(n.abstract&&this.hasPlugin("typescript")?(delete n.abstract,this.castNodeTo(n,"TSAbstractAccessorProperty")):this.castNodeTo(n,"AccessorProperty")),n}parseObjectProperty(r,n,a,s){let c=super.parseObjectProperty(r,n,a,s);return c&&(c.kind="init",this.castNodeTo(c,"Property")),c}finishObjectProperty(r){return r.kind="init",this.finishNode(r,"Property")}isValidLVal(r,n,a,s){return r==="Property"?"value":super.isValidLVal(r,n,a,s)}isAssignable(r,n){return r!=null&&this.isObjectProperty(r)?this.isAssignable(r.value,n):super.isAssignable(r,n)}toAssignable(r,n=!1){if(r!=null&&this.isObjectProperty(r)){let{key:a,value:s}=r;this.isPrivateName(a)&&this.classScope.usePrivateName(this.getPrivateNameSV(a),a.loc.start),this.toAssignable(s,n)}else super.toAssignable(r,n)}toAssignableObjectExpressionProp(r,n,a){r.type==="Property"&&(r.kind==="get"||r.kind==="set")?this.raise(ot.PatternHasAccessor,r.key):r.type==="Property"&&r.method?this.raise(ot.PatternHasMethod,r.key):super.toAssignableObjectExpressionProp(r,n,a)}finishCallExpression(r,n){let a=super.finishCallExpression(r,n);if(a.callee.type==="Import"){var s;this.castNodeTo(a,"ImportExpression"),a.source=a.arguments[0],a.options=(s=a.arguments[1])!=null?s:null;{var c;a.attributes=(c=a.arguments[1])!=null?c:null}delete a.arguments,delete a.callee}else a.type==="OptionalCallExpression"?this.castNodeTo(a,"CallExpression"):a.optional=!1;return a}toReferencedArguments(r){r.type!=="ImportExpression"&&super.toReferencedArguments(r)}parseExport(r,n){let a=this.state.lastTokStartLoc,s=super.parseExport(r,n);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":s.specifiers.length===1&&s.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(s,"ExportAllDeclaration"),s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var c;let{declaration:l}=s;(l==null?void 0:l.type)==="ClassDeclaration"&&((c=l.decorators)==null?void 0:c.length)>0&&l.start===s.start&&this.resetStartLocation(s,a)}break}return s}stopParseSubscript(r,n){let a=super.stopParseSubscript(r,n);return n.optionalChainMember?this.estreeParseChainExpression(a,r.loc.end):a}parseMember(r,n,a,s,c){let l=super.parseMember(r,n,a,s,c);return l.type==="OptionalMemberExpression"?this.castNodeTo(l,"MemberExpression"):l.optional=!1,l}isOptionalMemberExpression(r){return r.type==="ChainExpression"?r.expression.type==="MemberExpression":super.isOptionalMemberExpression(r)}hasPropertyAsPrivateName(r){return r.type==="ChainExpression"&&(r=r.expression),super.hasPropertyAsPrivateName(r)}isObjectProperty(r){return r.type==="Property"&&r.kind==="init"&&!r.method}isObjectMethod(r){return r.type==="Property"&&(r.method||r.kind==="get"||r.kind==="set")}castNodeTo(r,n){let a=super.castNodeTo(r,n);return this.fillOptionalPropertiesForTSESLint(a),a}cloneIdentifier(r){let n=super.cloneIdentifier(r);return this.fillOptionalPropertiesForTSESLint(n),n}cloneStringLiteral(r){return r.type==="Literal"?this.cloneEstreeStringLiteral(r):super.cloneStringLiteral(r)}finishNodeAt(r,n,a){return pM(super.finishNodeAt(r,n,a))}finishNode(r,n){let a=super.finishNode(r,n);return this.fillOptionalPropertiesForTSESLint(a),a}resetStartLocation(r,n){super.resetStartLocation(r,n),pM(r)}resetEndLocation(r,n=this.state.lastTokEndLoc){super.resetEndLocation(r,n),pM(r)}},JT=class{constructor(t,r){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!r}},No={brace:new JT("{"),j_oTag:new JT("<tag"),j_cTag:new JT("</tag"),j_expr:new JT("<tag>...</tag>",!0)};No.template=new JT("`",!0);var ea=!0,gn=!0,zfe=!0,fM=!0,l_=!0,wPr=!0,o$=class{constructor(t,r={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop!=null?r.binop:null,this.updateContext=null}},gde=new Map;function ro(e,t={}){t.keyword=e;let r=Si(e,t);return gde.set(e,r),r}function cm(e,t){return Si(e,{beforeExpr:ea,binop:t})}var gM=-1,E2=[],Ade=[],yde=[],vde=[],xde=[],bde=[];function Si(e,t={}){var r,n,a,s;return++gM,Ade.push(e),yde.push((r=t.binop)!=null?r:-1),vde.push((n=t.beforeExpr)!=null?n:!1),xde.push((a=t.startsExpr)!=null?a:!1),bde.push((s=t.prefix)!=null?s:!1),E2.push(new o$(e,t)),gM}function da(e,t={}){var r,n,a,s;return++gM,gde.set(e,gM),Ade.push(e),yde.push((r=t.binop)!=null?r:-1),vde.push((n=t.beforeExpr)!=null?n:!1),xde.push((a=t.startsExpr)!=null?a:!1),bde.push((s=t.prefix)!=null?s:!1),E2.push(new o$("name",t)),gM}var SPr={bracketL:Si("[",{beforeExpr:ea,startsExpr:gn}),bracketHashL:Si("#[",{beforeExpr:ea,startsExpr:gn}),bracketBarL:Si("[|",{beforeExpr:ea,startsExpr:gn}),bracketR:Si("]"),bracketBarR:Si("|]"),braceL:Si("{",{beforeExpr:ea,startsExpr:gn}),braceBarL:Si("{|",{beforeExpr:ea,startsExpr:gn}),braceHashL:Si("#{",{beforeExpr:ea,startsExpr:gn}),braceR:Si("}"),braceBarR:Si("|}"),parenL:Si("(",{beforeExpr:ea,startsExpr:gn}),parenR:Si(")"),comma:Si(",",{beforeExpr:ea}),semi:Si(";",{beforeExpr:ea}),colon:Si(":",{beforeExpr:ea}),doubleColon:Si("::",{beforeExpr:ea}),dot:Si("."),question:Si("?",{beforeExpr:ea}),questionDot:Si("?."),arrow:Si("=>",{beforeExpr:ea}),template:Si("template"),ellipsis:Si("...",{beforeExpr:ea}),backQuote:Si("`",{startsExpr:gn}),dollarBraceL:Si("${",{beforeExpr:ea,startsExpr:gn}),templateTail:Si("...`",{startsExpr:gn}),templateNonTail:Si("...${",{beforeExpr:ea,startsExpr:gn}),at:Si("@"),hash:Si("#",{startsExpr:gn}),interpreterDirective:Si("#!..."),eq:Si("=",{beforeExpr:ea,isAssign:fM}),assign:Si("_=",{beforeExpr:ea,isAssign:fM}),slashAssign:Si("_=",{beforeExpr:ea,isAssign:fM}),xorAssign:Si("_=",{beforeExpr:ea,isAssign:fM}),moduloAssign:Si("_=",{beforeExpr:ea,isAssign:fM}),incDec:Si("++/--",{prefix:l_,postfix:wPr,startsExpr:gn}),bang:Si("!",{beforeExpr:ea,prefix:l_,startsExpr:gn}),tilde:Si("~",{beforeExpr:ea,prefix:l_,startsExpr:gn}),doubleCaret:Si("^^",{startsExpr:gn}),doubleAt:Si("@@",{startsExpr:gn}),pipeline:cm("|>",0),nullishCoalescing:cm("??",1),logicalOR:cm("||",1),logicalAND:cm("&&",2),bitwiseOR:cm("|",3),bitwiseXOR:cm("^",4),bitwiseAND:cm("&",5),equality:cm("==/!=/===/!==",6),lt:cm("</>/<=/>=",7),gt:cm("</>/<=/>=",7),relational:cm("</>/<=/>=",7),bitShift:cm("<</>>/>>>",8),bitShiftL:cm("<</>>/>>>",8),bitShiftR:cm("<</>>/>>>",8),plusMin:Si("+/-",{beforeExpr:ea,binop:9,prefix:l_,startsExpr:gn}),modulo:Si("%",{binop:10,startsExpr:gn}),star:Si("*",{binop:10}),slash:cm("/",10),exponent:Si("**",{beforeExpr:ea,binop:11,rightAssociative:!0}),_in:ro("in",{beforeExpr:ea,binop:7}),_instanceof:ro("instanceof",{beforeExpr:ea,binop:7}),_break:ro("break"),_case:ro("case",{beforeExpr:ea}),_catch:ro("catch"),_continue:ro("continue"),_debugger:ro("debugger"),_default:ro("default",{beforeExpr:ea}),_else:ro("else",{beforeExpr:ea}),_finally:ro("finally"),_function:ro("function",{startsExpr:gn}),_if:ro("if"),_return:ro("return",{beforeExpr:ea}),_switch:ro("switch"),_throw:ro("throw",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_try:ro("try"),_var:ro("var"),_const:ro("const"),_with:ro("with"),_new:ro("new",{beforeExpr:ea,startsExpr:gn}),_this:ro("this",{startsExpr:gn}),_super:ro("super",{startsExpr:gn}),_class:ro("class",{startsExpr:gn}),_extends:ro("extends",{beforeExpr:ea}),_export:ro("export"),_import:ro("import",{startsExpr:gn}),_null:ro("null",{startsExpr:gn}),_true:ro("true",{startsExpr:gn}),_false:ro("false",{startsExpr:gn}),_typeof:ro("typeof",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_void:ro("void",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_delete:ro("delete",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_do:ro("do",{isLoop:zfe,beforeExpr:ea}),_for:ro("for",{isLoop:zfe}),_while:ro("while",{isLoop:zfe}),_as:da("as",{startsExpr:gn}),_assert:da("assert",{startsExpr:gn}),_async:da("async",{startsExpr:gn}),_await:da("await",{startsExpr:gn}),_defer:da("defer",{startsExpr:gn}),_from:da("from",{startsExpr:gn}),_get:da("get",{startsExpr:gn}),_let:da("let",{startsExpr:gn}),_meta:da("meta",{startsExpr:gn}),_of:da("of",{startsExpr:gn}),_sent:da("sent",{startsExpr:gn}),_set:da("set",{startsExpr:gn}),_source:da("source",{startsExpr:gn}),_static:da("static",{startsExpr:gn}),_using:da("using",{startsExpr:gn}),_yield:da("yield",{startsExpr:gn}),_asserts:da("asserts",{startsExpr:gn}),_checks:da("checks",{startsExpr:gn}),_exports:da("exports",{startsExpr:gn}),_global:da("global",{startsExpr:gn}),_implements:da("implements",{startsExpr:gn}),_intrinsic:da("intrinsic",{startsExpr:gn}),_infer:da("infer",{startsExpr:gn}),_is:da("is",{startsExpr:gn}),_mixins:da("mixins",{startsExpr:gn}),_proto:da("proto",{startsExpr:gn}),_require:da("require",{startsExpr:gn}),_satisfies:da("satisfies",{startsExpr:gn}),_keyof:da("keyof",{startsExpr:gn}),_readonly:da("readonly",{startsExpr:gn}),_unique:da("unique",{startsExpr:gn}),_abstract:da("abstract",{startsExpr:gn}),_declare:da("declare",{startsExpr:gn}),_enum:da("enum",{startsExpr:gn}),_module:da("module",{startsExpr:gn}),_namespace:da("namespace",{startsExpr:gn}),_interface:da("interface",{startsExpr:gn}),_type:da("type",{startsExpr:gn}),_opaque:da("opaque",{startsExpr:gn}),name:Si("name",{startsExpr:gn}),placeholder:Si("%%",{startsExpr:gn}),string:Si("string",{startsExpr:gn}),num:Si("num",{startsExpr:gn}),bigint:Si("bigint",{startsExpr:gn}),decimal:Si("decimal",{startsExpr:gn}),regexp:Si("regexp",{startsExpr:gn}),privateName:Si("#name",{startsExpr:gn}),eof:Si("eof"),jsxName:Si("jsxName"),jsxText:Si("jsxText",{beforeExpr:ea}),jsxTagStart:Si("jsxTagStart",{startsExpr:gn}),jsxTagEnd:Si("jsxTagEnd")};function zo(e){return e>=93&&e<=133}function CPr(e){return e<=92}function ix(e){return e>=58&&e<=133}function wHe(e){return e>=58&&e<=137}function _Pr(e){return vde[e]}function hM(e){return xde[e]}function IPr(e){return e>=29&&e<=33}function fHe(e){return e>=129&&e<=131}function kPr(e){return e>=90&&e<=92}function Ede(e){return e>=58&&e<=92}function TPr(e){return e>=39&&e<=59}function BPr(e){return e===34}function DPr(e){return bde[e]}function PPr(e){return e>=121&&e<=123}function RPr(e){return e>=124&&e<=130}function d_(e){return Ade[e]}function s$(e){return yde[e]}function NPr(e){return e===57}function c$(e){return e>=24&&e<=25}function b2(e){return E2[e]}E2[8].updateContext=e=>{e.pop()},E2[5].updateContext=E2[7].updateContext=E2[23].updateContext=e=>{e.push(No.brace)},E2[22].updateContext=e=>{e[e.length-1]===No.template?e.pop():e.push(No.template)},E2[143].updateContext=e=>{e.push(No.j_expr,No.j_oTag)};var wde="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",SHe="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",FPr=new RegExp("["+wde+"]"),OPr=new RegExp("["+wde+SHe+"]");wde=SHe=null;var CHe=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],QPr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function Yfe(e,t){let r=65536;for(let n=0,a=t.length;n<a;n+=2){if(r+=t[n],r>e)return!1;if(r+=t[n+1],r>=e)return!0}return!1}function dE(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&FPr.test(String.fromCharCode(e)):Yfe(e,CHe)}function KT(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&OPr.test(String.fromCharCode(e)):Yfe(e,CHe)||Yfe(e,QPr)}var Sde={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},LPr=new Set(Sde.keyword),jPr=new Set(Sde.strict),MPr=new Set(Sde.strictBind);function _He(e,t){return t&&e==="await"||e==="enum"}function IHe(e,t){return _He(e,t)||jPr.has(e)}function kHe(e){return MPr.has(e)}function THe(e,t){return IHe(e,t)||kHe(e)}function qPr(e){return LPr.has(e)}function UPr(e,t,r){return e===64&&t===64&&dE(r)}var zPr=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function HPr(e){return zPr.has(e)}var AM=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},yM=class{constructor(t,r){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=r}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:r}=this.scopeStack[t];if(r&128)return!0;if(r&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new AM(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,r,n){let a=this.currentScope();if(r&8||r&16){this.checkRedeclarationInScope(a,t,r,n);let s=a.names.get(t)||0;r&16?s=s|4:(a.firstLexicalName||(a.firstLexicalName=t),s=s|2),a.names.set(t,s),r&8&&this.maybeExportDefined(a,t)}else if(r&4)for(let s=this.scopeStack.length-1;s>=0&&(a=this.scopeStack[s],this.checkRedeclarationInScope(a,t,r,n),a.names.set(t,(a.names.get(t)||0)|1),this.maybeExportDefined(a,t),!(a.flags&1667));--s);this.parser.inModule&&a.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,r){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(r)}checkRedeclarationInScope(t,r,n,a){this.isRedeclaredInScope(t,r,n)&&this.parser.raise(ot.VarRedeclaration,a,{identifierName:r})}isRedeclaredInScope(t,r,n){if(!(n&1))return!1;if(n&8)return t.names.has(r);let a=t.names.get(r)||0;return n&16?(a&2)>0||!this.treatFunctionsAsVarInScope(t)&&(a&1)>0:(a&2)>0&&!(t.flags&8&&t.firstLexicalName===r)||!this.treatFunctionsAsVarInScope(t)&&(a&4)>0}checkLocalExport(t){let{name:r}=t;this.scopeStack[0].names.has(r)||this.undefinedExports.set(r,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:r}=this.scopeStack[t];if(r&1667)return r}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:r}=this.scopeStack[t];if(r&1731&&!(r&4))return r}}},Jfe=class extends AM{constructor(...t){super(...t),this.declareFunctions=new Set}},Kfe=class extends yM{createScope(t){return new Jfe(t)}declareName(t,r,n){let a=this.currentScope();if(r&2048){this.checkRedeclarationInScope(a,t,r,n),this.maybeExportDefined(a,t),a.declareFunctions.add(t);return}super.declareName(t,r,n)}isRedeclaredInScope(t,r,n){if(super.isRedeclaredInScope(t,r,n))return!0;if(n&2048&&!t.declareFunctions.has(r)){let a=t.names.get(r);return(a&4)>0||(a&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},VPr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),Fi=fE`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:r})=>`Enum \`${e}\` has type \`${r}\`, so the initializer of \`${t}\` needs to be a ${r} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:r})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${r}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function $Pr(e){return e.type==="DeclareExportAllDeclaration"||e.type==="DeclareExportDeclaration"&&(!e.declaration||e.declaration.type!=="TypeAlias"&&e.declaration.type!=="InterfaceDeclaration")}function dHe(e){return e.importKind==="type"||e.importKind==="typeof"}var WPr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function GPr(e,t){let r=[],n=[];for(let a=0;a<e.length;a++)(t(e[a],a,e)?r:n).push(e[a]);return[r,n]}var YPr=/\*?\s*@((?:no)?flow)\b/,JPr=e=>class extends e{constructor(...r){super(...r),this.flowPragma=void 0}getScopeHandler(){return Kfe}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(r,n){r!==134&&r!==13&&r!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(r,n)}addComment(r){if(this.flowPragma===void 0){let n=YPr.exec(r.value);if(n)if(n[1]==="flow")this.flowPragma="flow";else if(n[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(r)}flowParseTypeInitialiser(r){let n=this.state.inType;this.state.inType=!0,this.expect(r||14);let a=this.flowParseType();return this.state.inType=n,a}flowParsePredicate(){let r=this.startNode(),n=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>n.index+1&&this.raise(Fi.UnexpectedSpaceBetweenModuloChecks,n),this.eat(10)?(r.value=super.parseExpression(),this.expect(11),this.finishNode(r,"DeclaredPredicate")):this.finishNode(r,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let r=this.state.inType;this.state.inType=!0,this.expect(14);let n=null,a=null;return this.match(54)?(this.state.inType=r,a=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=r,this.match(54)&&(a=this.flowParsePredicate())),[n,a]}flowParseDeclareClass(r){return this.next(),this.flowParseInterfaceish(r,!0),this.finishNode(r,"DeclareClass")}flowParseDeclareFunction(r){this.next();let n=r.id=this.parseIdentifier(),a=this.startNode(),s=this.startNode();this.match(47)?a.typeParameters=this.flowParseTypeParameterDeclaration():a.typeParameters=null,this.expect(10);let c=this.flowParseFunctionTypeParams();return a.params=c.params,a.rest=c.rest,a.this=c._this,this.expect(11),[a.returnType,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),s.typeAnnotation=this.finishNode(a,"FunctionTypeAnnotation"),n.typeAnnotation=this.finishNode(s,"TypeAnnotation"),this.resetEndLocation(n),this.semicolon(),this.scope.declareName(r.id.name,2048,r.id.loc.start),this.finishNode(r,"DeclareFunction")}flowParseDeclare(r,n){if(this.match(80))return this.flowParseDeclareClass(r);if(this.match(68))return this.flowParseDeclareFunction(r);if(this.match(74))return this.flowParseDeclareVariable(r);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(r):(n&&this.raise(Fi.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(r));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(r);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(r);if(this.isContextual(129))return this.flowParseDeclareInterface(r);if(this.match(82))return this.flowParseDeclareExportDeclaration(r,n);throw this.unexpected()}flowParseDeclareVariable(r){return this.next(),r.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(r.id.name,5,r.id.loc.start),this.semicolon(),this.finishNode(r,"DeclareVariable")}flowParseDeclareModule(r){this.scope.enter(0),this.match(134)?r.id=super.parseExprAtom():r.id=this.parseIdentifier();let n=r.body=this.startNode(),a=n.body=[];for(this.expect(5);!this.match(8);){let l=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(Fi.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),a.push(super.parseImport(l))):(this.expectContextual(125,Fi.UnsupportedStatementInDeclareModule),a.push(this.flowParseDeclare(l,!0)))}this.scope.exit(),this.expect(8),this.finishNode(n,"BlockStatement");let s=null,c=!1;return a.forEach(l=>{$Pr(l)?(s==="CommonJS"&&this.raise(Fi.AmbiguousDeclareModuleKind,l),s="ES"):l.type==="DeclareModuleExports"&&(c&&this.raise(Fi.DuplicateDeclareModuleExports,l),s==="ES"&&this.raise(Fi.AmbiguousDeclareModuleKind,l),s="CommonJS",c=!0)}),r.kind=s||"CommonJS",this.finishNode(r,"DeclareModule")}flowParseDeclareExportDeclaration(r,n){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?r.declaration=this.flowParseDeclare(this.startNode()):(r.declaration=this.flowParseType(),this.semicolon()),r.default=!0,this.finishNode(r,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!n){let a=this.state.value;throw this.raise(Fi.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:a,suggestion:WPr[a]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return r.declaration=this.flowParseDeclare(this.startNode()),r.default=!1,this.finishNode(r,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return r=this.parseExport(r,null),r.type==="ExportNamedDeclaration"?(r.default=!1,delete r.exportKind,this.castNodeTo(r,"DeclareExportDeclaration")):this.castNodeTo(r,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(r){return this.next(),this.expectContextual(111),r.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(r,"DeclareModuleExports")}flowParseDeclareTypeAlias(r){this.next();let n=this.flowParseTypeAlias(r);return this.castNodeTo(n,"DeclareTypeAlias"),n}flowParseDeclareOpaqueType(r){this.next();let n=this.flowParseOpaqueType(r,!0);return this.castNodeTo(n,"DeclareOpaqueType"),n}flowParseDeclareInterface(r){return this.next(),this.flowParseInterfaceish(r,!1),this.finishNode(r,"DeclareInterface")}flowParseInterfaceish(r,n){if(r.id=this.flowParseRestrictedIdentifier(!n,!0),this.scope.declareName(r.id.name,n?17:8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.extends=[],this.eat(81))do r.extends.push(this.flowParseInterfaceExtends());while(!n&&this.eat(12));if(n){if(r.implements=[],r.mixins=[],this.eatContextual(117))do r.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do r.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}r.body=this.flowParseObjectType({allowStatic:n,allowExact:!1,allowSpread:!1,allowProto:n,allowInexact:!1})}flowParseInterfaceExtends(){let r=this.startNode();return r.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,this.finishNode(r,"InterfaceExtends")}flowParseInterface(r){return this.flowParseInterfaceish(r,!1),this.finishNode(r,"InterfaceDeclaration")}checkNotUnderscore(r){r==="_"&&this.raise(Fi.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(r,n,a){VPr.has(r)&&this.raise(a?Fi.AssignReservedType:Fi.UnexpectedReservedType,n,{reservedType:r})}flowParseRestrictedIdentifier(r,n){return this.checkReservedType(this.state.value,this.state.startLoc,n),this.parseIdentifier(r)}flowParseTypeAlias(r){return r.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(r.id.name,8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(r,"TypeAlias")}flowParseOpaqueType(r,n){return this.expectContextual(130),r.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(r.id.name,8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.supertype=null,this.match(14)&&(r.supertype=this.flowParseTypeInitialiser(14)),r.impltype=null,n||(r.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(r,"OpaqueType")}flowParseTypeParameter(r=!1){let n=this.state.startLoc,a=this.startNode(),s=this.flowParseVariance(),c=this.flowParseTypeAnnotatableIdentifier();return a.name=c.name,a.variance=s,a.bound=c.typeAnnotation,this.match(29)?(this.eat(29),a.default=this.flowParseType()):r&&this.raise(Fi.MissingTypeParamDefault,n),this.finishNode(a,"TypeParameter")}flowParseTypeParameterDeclaration(){let r=this.state.inType,n=this.startNode();n.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let a=!1;do{let s=this.flowParseTypeParameter(a);n.params.push(s),s.default&&(a=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=r,this.finishNode(n,"TypeParameterDeclaration")}flowInTopLevelContext(r){if(this.curContext()!==No.brace){let n=this.state.context;this.state.context=[n[0]];try{return r()}finally{this.state.context=n}}else return r()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let r=this.startNode(),n=this.state.inType;return this.state.inType=!0,r.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let a=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)r.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=a}),this.state.inType=n,!this.state.inType&&this.curContext()===No.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(r,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let r=this.startNode(),n=this.state.inType;for(r.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)r.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=n,this.finishNode(r,"TypeParameterInstantiation")}flowParseInterfaceType(){let r=this.startNode();if(this.expectContextual(129),r.extends=[],this.eat(81))do r.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return r.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(r,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(r,n,a){return r.static=n,this.lookahead().type===14?(r.id=this.flowParseObjectPropertyKey(),r.key=this.flowParseTypeInitialiser()):(r.id=null,r.key=this.flowParseType()),this.expect(3),r.value=this.flowParseTypeInitialiser(),r.variance=a,this.finishNode(r,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(r,n){return r.static=n,r.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(r.method=!0,r.optional=!1,r.value=this.flowParseObjectTypeMethodish(this.startNodeAt(r.loc.start))):(r.method=!1,this.eat(17)&&(r.optional=!0),r.value=this.flowParseTypeInitialiser()),this.finishNode(r,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(r){for(r.params=[],r.rest=null,r.typeParameters=null,r.this=null,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(r.this=this.flowParseFunctionTypeParam(!0),r.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)r.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(r.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),r.returnType=this.flowParseTypeInitialiser(),this.finishNode(r,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(r,n){let a=this.startNode();return r.static=n,r.value=this.flowParseObjectTypeMethodish(a),this.finishNode(r,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:r,allowExact:n,allowSpread:a,allowProto:s,allowInexact:c}){let l=this.state.inType;this.state.inType=!0;let f=this.startNode();f.callProperties=[],f.properties=[],f.indexers=[],f.internalSlots=[];let d,m,g=!1;for(n&&this.match(6)?(this.expect(6),d=9,m=!0):(this.expect(5),d=8,m=!1),f.exact=m;!this.match(d);){let b=!1,A=null,C=null,I=this.startNode();if(s&&this.isContextual(118)){let O=this.lookahead();O.type!==14&&O.type!==17&&(this.next(),A=this.state.startLoc,r=!1)}if(r&&this.isContextual(106)){let O=this.lookahead();O.type!==14&&O.type!==17&&(this.next(),b=!0)}let k=this.flowParseVariance();if(this.eat(0))A!=null&&this.unexpected(A),this.eat(0)?(k&&this.unexpected(k.loc.start),f.internalSlots.push(this.flowParseObjectTypeInternalSlot(I,b))):f.indexers.push(this.flowParseObjectTypeIndexer(I,b,k));else if(this.match(10)||this.match(47))A!=null&&this.unexpected(A),k&&this.unexpected(k.loc.start),f.callProperties.push(this.flowParseObjectTypeCallProperty(I,b));else{let O="init";if(this.isContextual(99)||this.isContextual(104)){let M=this.lookahead();wHe(M.type)&&(O=this.state.value,this.next())}let j=this.flowParseObjectTypeProperty(I,b,A,k,O,a,c!=null?c:!m);j===null?(g=!0,C=this.state.lastTokStartLoc):f.properties.push(j)}this.flowObjectTypeSemicolon(),C&&!this.match(8)&&!this.match(9)&&this.raise(Fi.UnexpectedExplicitInexactInObject,C)}this.expect(d),a&&(f.inexact=g);let x=this.finishNode(f,"ObjectTypeAnnotation");return this.state.inType=l,x}flowParseObjectTypeProperty(r,n,a,s,c,l,f){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(l?f||this.raise(Fi.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Fi.InexactInsideNonObject,this.state.lastTokStartLoc),s&&this.raise(Fi.InexactVariance,s),null):(l||this.raise(Fi.UnexpectedSpreadType,this.state.lastTokStartLoc),a!=null&&this.unexpected(a),s&&this.raise(Fi.SpreadVariance,s),r.argument=this.flowParseType(),this.finishNode(r,"ObjectTypeSpreadProperty"));{r.key=this.flowParseObjectPropertyKey(),r.static=n,r.proto=a!=null,r.kind=c;let d=!1;return this.match(47)||this.match(10)?(r.method=!0,a!=null&&this.unexpected(a),s&&this.unexpected(s.loc.start),r.value=this.flowParseObjectTypeMethodish(this.startNodeAt(r.loc.start)),(c==="get"||c==="set")&&this.flowCheckGetterSetterParams(r),!l&&r.key.name==="constructor"&&r.value.this&&this.raise(Fi.ThisParamBannedInConstructor,r.value.this)):(c!=="init"&&this.unexpected(),r.method=!1,this.eat(17)&&(d=!0),r.value=this.flowParseTypeInitialiser(),r.variance=s),r.optional=d,this.finishNode(r,"ObjectTypeProperty")}}flowCheckGetterSetterParams(r){let n=r.kind==="get"?0:1,a=r.value.params.length+(r.value.rest?1:0);r.value.this&&this.raise(r.kind==="get"?Fi.GetterMayNotHaveThisParam:Fi.SetterMayNotHaveThisParam,r.value.this),a!==n&&this.raise(r.kind==="get"?ot.BadGetterArity:ot.BadSetterArity,r),r.kind==="set"&&r.value.rest&&this.raise(ot.BadSetterRestParameter,r)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(r,n){r!=null||(r=this.state.startLoc);let a=n||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let s=this.startNodeAt(r);s.qualification=a,s.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(s,"QualifiedTypeIdentifier")}return a}flowParseGenericType(r,n){let a=this.startNodeAt(r);return a.typeParameters=null,a.id=this.flowParseQualifiedTypeIdentifier(r,n),this.match(47)&&(a.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(a,"GenericTypeAnnotation")}flowParseTypeofType(){let r=this.startNode();return this.expect(87),r.argument=this.flowParsePrimaryType(),this.finishNode(r,"TypeofTypeAnnotation")}flowParseTupleType(){let r=this.startNode();for(r.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(r.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(r,"TupleTypeAnnotation")}flowParseFunctionTypeParam(r){let n=null,a=!1,s=null,c=this.startNode(),l=this.lookahead(),f=this.state.type===78;return l.type===14||l.type===17?(f&&!r&&this.raise(Fi.ThisParamMustBeFirst,c),n=this.parseIdentifier(f),this.eat(17)&&(a=!0,f&&this.raise(Fi.ThisParamMayNotBeOptional,c)),s=this.flowParseTypeInitialiser()):s=this.flowParseType(),c.name=n,c.optional=a,c.typeAnnotation=s,this.finishNode(c,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(r){let n=this.startNodeAt(r.loc.start);return n.name=null,n.optional=!1,n.typeAnnotation=r,this.finishNode(n,"FunctionTypeParam")}flowParseFunctionTypeParams(r=[]){let n=null,a=null;for(this.match(78)&&(a=this.flowParseFunctionTypeParam(!0),a.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)r.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(n=this.flowParseFunctionTypeParam(!1)),{params:r,rest:n,_this:a}}flowIdentToTypeAnnotation(r,n,a){switch(a.name){case"any":return this.finishNode(n,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(n,"BooleanTypeAnnotation");case"mixed":return this.finishNode(n,"MixedTypeAnnotation");case"empty":return this.finishNode(n,"EmptyTypeAnnotation");case"number":return this.finishNode(n,"NumberTypeAnnotation");case"string":return this.finishNode(n,"StringTypeAnnotation");case"symbol":return this.finishNode(n,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(a.name),this.flowParseGenericType(r,a)}}flowParsePrimaryType(){let r=this.state.startLoc,n=this.startNode(),a,s,c=!1,l=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,s=this.flowParseTupleType(),this.state.noAnonFunctionType=l,s;case 47:{let f=this.startNode();return f.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),a=this.flowParseFunctionTypeParams(),f.params=a.params,f.rest=a.rest,f.this=a._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),this.finishNode(f,"FunctionTypeAnnotation")}case 10:{let f=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(zo(this.state.type)||this.match(78)){let d=this.lookahead().type;c=d!==17&&d!==14}else c=!0;if(c){if(this.state.noAnonFunctionType=!1,s=this.flowParseType(),this.state.noAnonFunctionType=l,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),s;this.eat(12)}return s?a=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(s)]):a=this.flowParseFunctionTypeParams(),f.params=a.params,f.rest=a.rest,f.this=a._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),f.typeParameters=null,this.finishNode(f,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return n.value=this.match(85),this.next(),this.finishNode(n,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",n);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",n);throw this.raise(Fi.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(n,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(n,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(n,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(n,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Ede(this.state.type)){let f=d_(this.state.type);return this.next(),super.createIdentifier(n,f)}else if(zo(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(r,n,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let r=this.state.startLoc,n=this.flowParsePrimaryType(),a=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let s=this.startNodeAt(r),c=this.eat(18);a=a||c,this.expect(0),!c&&this.match(3)?(s.elementType=n,this.next(),n=this.finishNode(s,"ArrayTypeAnnotation")):(s.objectType=n,s.indexType=this.flowParseType(),this.expect(3),a?(s.optional=c,n=this.finishNode(s,"OptionalIndexedAccessType")):n=this.finishNode(s,"IndexedAccessType"))}return n}flowParsePrefixType(){let r=this.startNode();return this.eat(17)?(r.typeAnnotation=this.flowParsePrefixType(),this.finishNode(r,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let r=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let n=this.startNodeAt(r.loc.start);return n.params=[this.reinterpretTypeAsFunctionTypeParam(r)],n.rest=null,n.this=null,n.returnType=this.flowParseType(),n.typeParameters=null,this.finishNode(n,"FunctionTypeAnnotation")}return r}flowParseIntersectionType(){let r=this.startNode();this.eat(45);let n=this.flowParseAnonFunctionWithoutParens();for(r.types=[n];this.eat(45);)r.types.push(this.flowParseAnonFunctionWithoutParens());return r.types.length===1?n:this.finishNode(r,"IntersectionTypeAnnotation")}flowParseUnionType(){let r=this.startNode();this.eat(43);let n=this.flowParseIntersectionType();for(r.types=[n];this.eat(43);)r.types.push(this.flowParseIntersectionType());return r.types.length===1?n:this.finishNode(r,"UnionTypeAnnotation")}flowParseType(){let r=this.state.inType;this.state.inType=!0;let n=this.flowParseUnionType();return this.state.inType=r,n}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let r=this.state.startLoc,n=this.parseIdentifier();return this.flowParseGenericType(r,n)}else return this.flowParseType()}flowParseTypeAnnotation(){let r=this.startNode();return r.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(r,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(r){let n=r?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(n.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(n)),n}typeCastToParameter(r){return r.expression.typeAnnotation=r.typeAnnotation,this.resetEndLocation(r.expression,r.typeAnnotation.loc.end),r.expression}flowParseVariance(){let r=null;return this.match(53)?(r=this.startNode(),this.state.value==="+"?r.kind="plus":r.kind="minus",this.next(),this.finishNode(r,"Variance")):r}parseFunctionBody(r,n,a=!1){if(n){this.forwardNoArrowParamsConversionAt(r,()=>super.parseFunctionBody(r,!0,a));return}super.parseFunctionBody(r,!1,a)}parseFunctionBodyAndFinish(r,n,a=!1){if(this.match(14)){let s=this.startNode();[s.typeAnnotation,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.returnType=s.typeAnnotation?this.finishNode(s,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(r,n,a)}parseStatementLike(r){if(this.state.strict&&this.isContextual(129)){let a=this.lookahead();if(ix(a.type)){let s=this.startNode();return this.next(),this.flowParseInterface(s)}}else if(this.isContextual(126)){let a=this.startNode();return this.next(),this.flowParseEnumDeclaration(a)}let n=super.parseStatementLike(r);return this.flowPragma===void 0&&!this.isValidDirective(n)&&(this.flowPragma=null),n}parseExpressionStatement(r,n,a){if(n.type==="Identifier"){if(n.name==="declare"){if(this.match(80)||zo(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(r)}else if(zo(this.state.type)){if(n.name==="interface")return this.flowParseInterface(r);if(n.name==="type")return this.flowParseTypeAlias(r);if(n.name==="opaque")return this.flowParseOpaqueType(r,!1)}}return super.parseExpressionStatement(r,n,a)}shouldParseExportDeclaration(){let{type:r}=this.state;return r===126||fHe(r)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:r}=this.state;return r===126||fHe(r)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}return super.parseExportDefaultExpression()}parseConditional(r,n,a){if(!this.match(17))return r;if(this.state.maybeInArrowParameters){let x=this.lookaheadCharCode();if(x===44||x===61||x===58||x===41)return this.setOptionalParametersError(a),r}this.expect(17);let s=this.state.clone(),c=this.state.noArrowAt,l=this.startNodeAt(n),{consequent:f,failed:d}=this.tryParseConditionalConsequent(),[m,g]=this.getArrowLikeExpressions(f);if(d||g.length>0){let x=[...c];if(g.length>0){this.state=s,this.state.noArrowAt=x;for(let b=0;b<g.length;b++)x.push(g[b].start);({consequent:f,failed:d}=this.tryParseConditionalConsequent()),[m,g]=this.getArrowLikeExpressions(f)}d&&m.length>1&&this.raise(Fi.AmbiguousConditionalArrow,s.startLoc),d&&m.length===1&&(this.state=s,x.push(m[0].start),this.state.noArrowAt=x,{consequent:f,failed:d}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(f,!0),this.state.noArrowAt=c,this.expect(14),l.test=r,l.consequent=f,l.alternate=this.forwardNoArrowParamsConversionAt(l,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(l,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let r=this.parseMaybeAssignAllowIn(),n=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:r,failed:n}}getArrowLikeExpressions(r,n){let a=[r],s=[];for(;a.length!==0;){let c=a.pop();c.type==="ArrowFunctionExpression"&&c.body.type!=="BlockStatement"?(c.typeParameters||!c.returnType?this.finishArrowValidation(c):s.push(c),a.push(c.body)):c.type==="ConditionalExpression"&&(a.push(c.consequent),a.push(c.alternate))}return n?(s.forEach(c=>this.finishArrowValidation(c)),[s,[]]):GPr(s,c=>c.params.every(l=>this.isAssignable(l,!0)))}finishArrowValidation(r){var n;this.toAssignableList(r.params,(n=r.extra)==null?void 0:n.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(r,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(r,n){let a;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(r.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),a=n(),this.state.noArrowParamsConversionAt.pop()):a=n(),a}parseParenItem(r,n){let a=super.parseParenItem(r,n);if(this.eat(17)&&(a.optional=!0,this.resetEndLocation(r)),this.match(14)){let s=this.startNodeAt(n);return s.expression=a,s.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(s,"TypeCastExpression")}return a}assertModuleNodeAllowed(r){r.type==="ImportDeclaration"&&(r.importKind==="type"||r.importKind==="typeof")||r.type==="ExportNamedDeclaration"&&r.exportKind==="type"||r.type==="ExportAllDeclaration"&&r.exportKind==="type"||super.assertModuleNodeAllowed(r)}parseExportDeclaration(r){if(this.isContextual(130)){r.exportKind="type";let n=this.startNode();return this.next(),this.match(5)?(r.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(r),null):this.flowParseTypeAlias(n)}else if(this.isContextual(131)){r.exportKind="type";let n=this.startNode();return this.next(),this.flowParseOpaqueType(n,!1)}else if(this.isContextual(129)){r.exportKind="type";let n=this.startNode();return this.next(),this.flowParseInterface(n)}else if(this.isContextual(126)){r.exportKind="value";let n=this.startNode();return this.next(),this.flowParseEnumDeclaration(n)}else return super.parseExportDeclaration(r)}eatExportStar(r){return super.eatExportStar(r)?!0:this.isContextual(130)&&this.lookahead().type===55?(r.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(r){let{startLoc:n}=this.state,a=super.maybeParseExportNamespaceSpecifier(r);return a&&r.exportKind==="type"&&this.unexpected(n),a}parseClassId(r,n,a){super.parseClassId(r,n,a),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(r,n,a){let{startLoc:s}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(r,n))return;n.declare=!0}super.parseClassMember(r,n,a),n.declare&&(n.type!=="ClassProperty"&&n.type!=="ClassPrivateProperty"&&n.type!=="PropertyDefinition"?this.raise(Fi.DeclareClassElement,s):n.value&&this.raise(Fi.DeclareClassFieldInitializer,n.value))}isIterator(r){return r==="iterator"||r==="asyncIterator"}readIterator(){let r=super.readWord1(),n="@@"+r;(!this.isIterator(r)||!this.state.inType)&&this.raise(ot.InvalidIdentifier,this.state.curPosition(),{identifierName:n}),this.finishToken(132,n)}getTokenFromCode(r){let n=this.input.charCodeAt(this.state.pos+1);r===123&&n===124?this.finishOp(6,2):this.state.inType&&(r===62||r===60)?this.finishOp(r===62?48:47,1):this.state.inType&&r===63?n===46?this.finishOp(18,2):this.finishOp(17,1):UPr(r,n,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(r)}isAssignable(r,n){return r.type==="TypeCastExpression"?this.isAssignable(r.expression,n):super.isAssignable(r,n)}toAssignable(r,n=!1){!n&&r.type==="AssignmentExpression"&&r.left.type==="TypeCastExpression"&&(r.left=this.typeCastToParameter(r.left)),super.toAssignable(r,n)}toAssignableList(r,n,a){for(let s=0;s<r.length;s++){let c=r[s];(c==null?void 0:c.type)==="TypeCastExpression"&&(r[s]=this.typeCastToParameter(c))}super.toAssignableList(r,n,a)}toReferencedList(r,n){for(let s=0;s<r.length;s++){var a;let c=r[s];c&&c.type==="TypeCastExpression"&&!((a=c.extra)!=null&&a.parenthesized)&&(r.length>1||!n)&&this.raise(Fi.TypeCastInPattern,c.typeAnnotation)}return r}parseArrayLike(r,n,a){let s=super.parseArrayLike(r,n,a);return a!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(s.elements),s}isValidLVal(r,n,a,s){return r==="TypeCastExpression"||super.isValidLVal(r,n,a,s)}parseClassProperty(r){return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(r)}parseClassPrivateProperty(r){return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(r)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(r){return!this.match(14)&&super.isNonstaticConstructor(r)}pushClassMethod(r,n,a,s,c,l){if(n.variance&&this.unexpected(n.variance.loc.start),delete n.variance,this.match(47)&&(n.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(r,n,a,s,c,l),n.params&&c){let f=n.params;f.length>0&&this.isThisParam(f[0])&&this.raise(Fi.ThisParamBannedInConstructor,n)}else if(n.type==="MethodDefinition"&&c&&n.value.params){let f=n.value.params;f.length>0&&this.isThisParam(f[0])&&this.raise(Fi.ThisParamBannedInConstructor,n)}}pushClassPrivateMethod(r,n,a,s){n.variance&&this.unexpected(n.variance.loc.start),delete n.variance,this.match(47)&&(n.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(r,n,a,s)}parseClassSuper(r){if(super.parseClassSuper(r),r.superClass&&(this.match(47)||this.match(51))&&(r.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let n=r.implements=[];do{let a=this.startNode();a.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?a.typeParameters=this.flowParseTypeParameterInstantiation():a.typeParameters=null,n.push(this.finishNode(a,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(r){super.checkGetterSetterParams(r);let n=this.getObjectOrClassMethodParams(r);if(n.length>0){let a=n[0];this.isThisParam(a)&&r.kind==="get"?this.raise(Fi.GetterMayNotHaveThisParam,a):this.isThisParam(a)&&this.raise(Fi.SetterMayNotHaveThisParam,a)}}parsePropertyNamePrefixOperator(r){r.variance=this.flowParseVariance()}parseObjPropValue(r,n,a,s,c,l,f){r.variance&&this.unexpected(r.variance.loc.start),delete r.variance;let d;this.match(47)&&!l&&(d=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let m=super.parseObjPropValue(r,n,a,s,c,l,f);return d&&((m.value||m).typeParameters=d),m}parseFunctionParamType(r){return this.eat(17)&&(r.type!=="Identifier"&&this.raise(Fi.PatternIsOptional,r),this.isThisParam(r)&&this.raise(Fi.ThisParamMayNotBeOptional,r),r.optional=!0),this.match(14)?r.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(r)&&this.raise(Fi.ThisParamAnnotationRequired,r),this.match(29)&&this.isThisParam(r)&&this.raise(Fi.ThisParamNoDefault,r),this.resetEndLocation(r),r}parseMaybeDefault(r,n){let a=super.parseMaybeDefault(r,n);return a.type==="AssignmentPattern"&&a.typeAnnotation&&a.right.start<a.typeAnnotation.start&&this.raise(Fi.TypeBeforeInitializer,a.typeAnnotation),a}checkImportReflection(r){super.checkImportReflection(r),r.module&&r.importKind!=="value"&&this.raise(Fi.ImportReflectionHasImportType,r.specifiers[0].loc.start)}parseImportSpecifierLocal(r,n,a){n.local=dHe(r)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),r.specifiers.push(this.finishImportSpecifier(n,a))}isPotentialImportPhase(r){if(super.isPotentialImportPhase(r))return!0;if(this.isContextual(130)){if(!r)return!0;let n=this.lookaheadCharCode();return n===123||n===42}return!r&&this.isContextual(87)}applyImportPhase(r,n,a,s){if(super.applyImportPhase(r,n,a,s),n){if(!a&&this.match(65))return;r.exportKind=a==="type"?a:"value"}else a==="type"&&this.match(55)&&this.unexpected(),r.importKind=a==="type"||a==="typeof"?a:"value"}parseImportSpecifier(r,n,a,s,c){let l=r.imported,f=null;l.type==="Identifier"&&(l.name==="type"?f="type":l.name==="typeof"&&(f="typeof"));let d=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let g=this.parseIdentifier(!0);f!==null&&!ix(this.state.type)?(r.imported=g,r.importKind=f,r.local=this.cloneIdentifier(g)):(r.imported=l,r.importKind=null,r.local=this.parseIdentifier())}else{if(f!==null&&ix(this.state.type))r.imported=this.parseIdentifier(!0),r.importKind=f;else{if(n)throw this.raise(ot.ImportBindingIsString,r,{importName:l.value});r.imported=l,r.importKind=null}this.eatContextual(93)?r.local=this.parseIdentifier():(d=!0,r.local=this.cloneIdentifier(r.imported))}let m=dHe(r);return a&&m&&this.raise(Fi.ImportTypeShorthandOnlyInPureImport,r),(a||m)&&this.checkReservedType(r.local.name,r.local.loc.start,!0),d&&!a&&!m&&this.checkReservedWord(r.local.name,r.loc.start,!0,!0),this.finishImportSpecifier(r,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(r,n){let a=r.kind;a!=="get"&&a!=="set"&&this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(r,n)}parseVarId(r,n){super.parseVarId(r,n),this.match(14)&&(r.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(r.id))}parseAsyncArrowFromCallExpression(r,n){if(this.match(14)){let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,r.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=a}return super.parseAsyncArrowFromCallExpression(r,n)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(r,n){var a;let s=null,c;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(s=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(r,n),s),!c.error)return c.node;let{context:d}=this.state,m=d[d.length-1];(m===No.j_oTag||m===No.j_expr)&&d.pop()}if((a=c)!=null&&a.error||this.match(47)){var l,f;s=s||this.state.clone();let d,m=this.tryParse(x=>{var b;d=this.flowParseTypeParameterDeclaration();let A=this.forwardNoArrowParamsConversionAt(d,()=>{let I=super.parseMaybeAssign(r,n);return this.resetStartLocationFromNode(I,d),I});(b=A.extra)!=null&&b.parenthesized&&x();let C=this.maybeUnwrapTypeCastExpression(A);return C.type!=="ArrowFunctionExpression"&&x(),C.typeParameters=d,this.resetStartLocationFromNode(C,d),A},s),g=null;if(m.node&&this.maybeUnwrapTypeCastExpression(m.node).type==="ArrowFunctionExpression"){if(!m.error&&!m.aborted)return m.node.async&&this.raise(Fi.UnexpectedTypeParameterBeforeAsyncArrowFunction,d),m.node;g=m.node}if((l=c)!=null&&l.node)return this.state=c.failState,c.node;if(g)return this.state=m.failState,g;throw(f=c)!=null&&f.thrown?c.error:m.thrown?m.error:this.raise(Fi.UnexpectedTokenAfterTypeParameter,d)}return super.parseMaybeAssign(r,n)}parseArrow(r){if(this.match(14)){let n=this.tryParse(()=>{let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let s=this.startNode();return[s.typeAnnotation,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=a,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),s});if(n.thrown)return null;n.error&&(this.state=n.failState),r.returnType=n.node.typeAnnotation?this.finishNode(n.node,"TypeAnnotation"):null}return super.parseArrow(r)}shouldParseArrow(r){return this.match(14)||super.shouldParseArrow(r)}setArrowFunctionParameters(r,n){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(r.start))?r.params=n:super.setArrowFunctionParameters(r,n)}checkParams(r,n,a,s=!0){if(!(a&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(r.start)))){for(let c=0;c<r.params.length;c++)this.isThisParam(r.params[c])&&c>0&&this.raise(Fi.ThisParamMustBeFirst,r.params[c]);super.checkParams(r,n,a,s)}}parseParenAndDistinguishExpression(r){return super.parseParenAndDistinguishExpression(r&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(r,n,a){if(r.type==="Identifier"&&r.name==="async"&&this.state.noArrowAt.includes(n.index)){this.next();let s=this.startNodeAt(n);s.callee=r,s.arguments=super.parseCallExpressionArguments(),r=this.finishNode(s,"CallExpression")}else if(r.type==="Identifier"&&r.name==="async"&&this.match(47)){let s=this.state.clone(),c=this.tryParse(f=>this.parseAsyncArrowWithTypeParameters(n)||f(),s);if(!c.error&&!c.aborted)return c.node;let l=this.tryParse(()=>super.parseSubscripts(r,n,a),s);if(l.node&&!l.error)return l.node;if(c.node)return this.state=c.failState,c.node;if(l.node)return this.state=l.failState,l.node;throw c.error||l.error}return super.parseSubscripts(r,n,a)}parseSubscript(r,n,a,s){if(this.match(18)&&this.isLookaheadToken_lt()){if(s.optionalChainMember=!0,a)return s.stop=!0,r;this.next();let c=this.startNodeAt(n);return c.callee=r,c.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),c.arguments=this.parseCallExpressionArguments(),c.optional=!0,this.finishCallExpression(c,!0)}else if(!a&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let c=this.startNodeAt(n);c.callee=r;let l=this.tryParse(()=>(c.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),c.arguments=super.parseCallExpressionArguments(),s.optionalChainMember&&(c.optional=!1),this.finishCallExpression(c,s.optionalChainMember)));if(l.node)return l.error&&(this.state=l.failState),l.node}return super.parseSubscript(r,n,a,s)}parseNewCallee(r){super.parseNewCallee(r);let n=null;this.shouldParseTypes()&&this.match(47)&&(n=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),r.typeArguments=n}parseAsyncArrowWithTypeParameters(r){let n=this.startNodeAt(r);if(this.parseFunctionParams(n,!1),!!this.parseArrow(n))return super.parseArrowExpression(n,void 0,!0)}readToken_mult_modulo(r){let n=this.input.charCodeAt(this.state.pos+1);if(r===42&&n===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(r)}readToken_pipe_amp(r){let n=this.input.charCodeAt(this.state.pos+1);if(r===124&&n===125){this.finishOp(9,2);return}super.readToken_pipe_amp(r)}parseTopLevel(r,n){let a=super.parseTopLevel(r,n);return this.state.hasFlowComment&&this.raise(Fi.UnterminatedFlowComment,this.state.curPosition()),a}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Fi.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let r=this.skipFlowComment();r&&(this.state.pos+=r,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:r}=this.state,n=2;for(;[32,9].includes(this.input.charCodeAt(r+n));)n++;let a=this.input.charCodeAt(n+r),s=this.input.charCodeAt(n+r+1);return a===58&&s===58?n+2:this.input.slice(n+r,n+r+12)==="flow-include"?n+12:a===58&&s!==58?n:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(ot.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(r,{enumName:n,memberName:a}){this.raise(Fi.EnumBooleanMemberNotInitialized,r,{memberName:a,enumName:n})}flowEnumErrorInvalidMemberInitializer(r,n){return this.raise(n.explicitType?n.explicitType==="symbol"?Fi.EnumInvalidMemberInitializerSymbolType:Fi.EnumInvalidMemberInitializerPrimaryType:Fi.EnumInvalidMemberInitializerUnknownType,r,n)}flowEnumErrorNumberMemberNotInitialized(r,n){this.raise(Fi.EnumNumberMemberNotInitialized,r,n)}flowEnumErrorStringMemberInconsistentlyInitialized(r,n){this.raise(Fi.EnumStringMemberInconsistentlyInitialized,r,n)}flowEnumMemberInit(){let r=this.state.startLoc,n=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let a=this.parseNumericLiteral(this.state.value);return n()?{type:"number",loc:a.loc.start,value:a}:{type:"invalid",loc:r}}case 134:{let a=this.parseStringLiteral(this.state.value);return n()?{type:"string",loc:a.loc.start,value:a}:{type:"invalid",loc:r}}case 85:case 86:{let a=this.parseBooleanLiteral(this.match(85));return n()?{type:"boolean",loc:a.loc.start,value:a}:{type:"invalid",loc:r}}default:return{type:"invalid",loc:r}}}flowEnumMemberRaw(){let r=this.state.startLoc,n=this.parseIdentifier(!0),a=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:r};return{id:n,init:a}}flowEnumCheckExplicitTypeMismatch(r,n,a){let{explicitType:s}=n;s!==null&&s!==a&&this.flowEnumErrorInvalidMemberInitializer(r,n)}flowEnumMembers({enumName:r,explicitType:n}){let a=new Set,s={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},c=!1;for(;!this.match(8);){if(this.eat(21)){c=!0;break}let l=this.startNode(),{id:f,init:d}=this.flowEnumMemberRaw(),m=f.name;if(m==="")continue;/^[a-z]/.test(m)&&this.raise(Fi.EnumInvalidMemberName,f,{memberName:m,suggestion:m[0].toUpperCase()+m.slice(1),enumName:r}),a.has(m)&&this.raise(Fi.EnumDuplicateMemberName,f,{memberName:m,enumName:r}),a.add(m);let g={enumName:r,explicitType:n,memberName:m};switch(l.id=f,d.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(d.loc,g,"boolean"),l.init=d.value,s.booleanMembers.push(this.finishNode(l,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(d.loc,g,"number"),l.init=d.value,s.numberMembers.push(this.finishNode(l,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(d.loc,g,"string"),l.init=d.value,s.stringMembers.push(this.finishNode(l,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(d.loc,g);case"none":switch(n){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(d.loc,g);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(d.loc,g);break;default:s.defaultedMembers.push(this.finishNode(l,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:s,hasUnknownMembers:c}}flowEnumStringMembers(r,n,{enumName:a}){if(r.length===0)return n;if(n.length===0)return r;if(n.length>r.length){for(let s of r)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:a});return n}else{for(let s of n)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:a});return r}}flowEnumParseExplicitType({enumName:r}){if(!this.eatContextual(102))return null;if(!zo(this.state.type))throw this.raise(Fi.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:r});let{value:n}=this.state;return this.next(),n!=="boolean"&&n!=="number"&&n!=="string"&&n!=="symbol"&&this.raise(Fi.EnumInvalidExplicitType,this.state.startLoc,{enumName:r,invalidEnumType:n}),n}flowEnumBody(r,n){let a=n.name,s=n.loc.start,c=this.flowEnumParseExplicitType({enumName:a});this.expect(5);let{members:l,hasUnknownMembers:f}=this.flowEnumMembers({enumName:a,explicitType:c});switch(r.hasUnknownMembers=f,c){case"boolean":return r.explicitType=!0,r.members=l.booleanMembers,this.expect(8),this.finishNode(r,"EnumBooleanBody");case"number":return r.explicitType=!0,r.members=l.numberMembers,this.expect(8),this.finishNode(r,"EnumNumberBody");case"string":return r.explicitType=!0,r.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(r,"EnumStringBody");case"symbol":return r.members=l.defaultedMembers,this.expect(8),this.finishNode(r,"EnumSymbolBody");default:{let d=()=>(r.members=[],this.expect(8),this.finishNode(r,"EnumStringBody"));r.explicitType=!1;let m=l.booleanMembers.length,g=l.numberMembers.length,x=l.stringMembers.length,b=l.defaultedMembers.length;if(!m&&!g&&!x&&!b)return d();if(!m&&!g)return r.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(r,"EnumStringBody");if(!g&&!x&&m>=b){for(let A of l.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(A.loc.start,{enumName:a,memberName:A.id.name});return r.members=l.booleanMembers,this.expect(8),this.finishNode(r,"EnumBooleanBody")}else if(!m&&!x&&g>=b){for(let A of l.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(A.loc.start,{enumName:a,memberName:A.id.name});return r.members=l.numberMembers,this.expect(8),this.finishNode(r,"EnumNumberBody")}else return this.raise(Fi.EnumInconsistentMemberValues,s,{enumName:a}),d()}}}flowParseEnumDeclaration(r){let n=this.parseIdentifier();return r.id=n,r.body=this.flowEnumBody(this.startNode(),n),this.finishNode(r,"EnumDeclaration")}jsxParseOpeningElementAfterName(r){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(r.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(r)}isLookaheadToken_lt(){let r=this.nextTokenStart();if(this.input.charCodeAt(r)===60){let n=this.input.charCodeAt(r+1);return n!==60&&n!==61}return!1}reScan_lt_gt(){let{type:r}=this.state;r===47?(this.state.pos-=1,this.readToken_lt()):r===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:r}=this.state;return r===51?(this.state.pos-=2,this.finishOp(47,1),47):r}maybeUnwrapTypeCastExpression(r){return r.type==="TypeCastExpression"?r.expression:r}},KPr={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},XPr=/\r\n|[\r\n\u2028\u2029]/,r$=new RegExp(XPr.source,"g");function QN(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function hHe(e,t,r){for(let n=t;n<r;n++)if(QN(e.charCodeAt(n)))return!0;return!1}var Hfe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Vfe=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function ZPr(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var YT=fE`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function p_(e){return e?e.type==="JSXOpeningFragment"||e.type==="JSXClosingFragment":!1}function ON(e){if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return ON(e.object)+"."+ON(e.property);throw new Error("Node had unexpected type: "+e.type)}var eRr=e=>class extends e{jsxReadToken(){let r="",n=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(YT.UnterminatedJsxContent,this.state.startLoc);let a=this.input.charCodeAt(this.state.pos);switch(a){case 60:case 123:if(this.state.pos===this.state.start){a===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(a);return}r+=this.input.slice(n,this.state.pos),this.finishToken(142,r);return;case 38:r+=this.input.slice(n,this.state.pos),r+=this.jsxReadEntity(),n=this.state.pos;break;case 62:case 125:default:QN(a)?(r+=this.input.slice(n,this.state.pos),r+=this.jsxReadNewLine(!0),n=this.state.pos):++this.state.pos}}}jsxReadNewLine(r){let n=this.input.charCodeAt(this.state.pos),a;return++this.state.pos,n===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,a=r?`
263
+ - Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${i$(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${i$(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${i$(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},dPr={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},hPr={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},mPr=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),gPr=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${i$({type:e})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),APr=["message"];function lHe(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:r})}function yPr({toMessage:e,code:t,reasonCode:r,syntaxPlugin:n}){let a=r==="MissingPlugin"||r==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[r]&&(r=s[r])}return function s(c,l){let f=new SyntaxError;return f.code=t,f.reasonCode=r,f.loc=c,f.pos=c.index,f.syntaxPlugin=n,a&&(f.missingPlugin=l.missingPlugin),lHe(f,"clone",function(m={}){var g;let{line:x,column:b,index:A}=(g=m.loc)!=null?g:c;return s(new hE(x,b,A),Object.assign({},l,m.details))}),lHe(f,"details",l),Object.defineProperty(f,"message",{configurable:!0,get(){let d=`${e(l)} (${c.line}:${c.column})`;return this.message=d,d},set(d){Object.defineProperty(this,"message",{value:d,writable:!0})}}),f}}function fE(e,t){if(Array.isArray(e))return n=>fE(n,e[0]);let r={};for(let n of Object.keys(e)){let a=e[n],s=typeof a=="string"?{message:()=>a}:typeof a=="function"?{message:a}:a,{message:c}=s,l=lPr(s,APr),f=typeof c=="string"?()=>c:c;r[n]=yPr(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:f},t?{syntaxPlugin:t}:{},l))}return r}var ot=Object.assign({},fE(pPr),fE(fPr),fE(dPr),fE(hPr),fE`pipelineOperator`(gPr));function vPr(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function xPr(e){let t=vPr();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let r of Object.keys(t))e[r]!=null&&(t[r]=e[r]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((e.startColumn==null||e.startIndex==null)&&e.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType==="commonjs"){if(e.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}var{defineProperty:bPr}=Object,pHe=(e,t)=>{e&&bPr(e,t,{enumerable:!1,value:e[t]})};function pM(e){return pHe(e.loc.start,"index"),pHe(e.loc.end,"index"),e}var EPr=e=>class extends e{parse(){let r=pM(super.parse());return this.optionFlags&256&&(r.tokens=r.tokens.map(pM)),r}parseRegExpLiteral({pattern:r,flags:n}){let a=null;try{a=new RegExp(r,n)}catch{}let s=this.estreeParseLiteral(a);return s.regex={pattern:r,flags:n},s}parseBigIntLiteral(r){let n;try{n=BigInt(r)}catch{n=null}let a=this.estreeParseLiteral(n);return a.bigint=String(a.value||r),a}parseDecimalLiteral(r){let a=this.estreeParseLiteral(null);return a.decimal=String(a.value||r),a}estreeParseLiteral(r){return this.parseLiteral(r,"Literal")}parseStringLiteral(r){return this.estreeParseLiteral(r)}parseNumericLiteral(r){return this.estreeParseLiteral(r)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(r){return this.estreeParseLiteral(r)}estreeParseChainExpression(r,n){let a=this.startNodeAtNode(r);return a.expression=r,this.finishNodeAt(a,"ChainExpression",n)}directiveToStmt(r){let n=r.value;delete r.value,this.castNodeTo(n,"Literal"),n.raw=n.extra.raw,n.value=n.extra.expressionValue;let a=this.castNodeTo(r,"ExpressionStatement");return a.expression=n,a.directive=n.extra.rawValue,delete n.extra,a}fillOptionalPropertiesForTSESLint(r){}cloneEstreeStringLiteral(r){let{start:n,end:a,loc:s,range:c,raw:l,value:f}=r,d=Object.create(r.constructor.prototype);return d.type="Literal",d.start=n,d.end=a,d.loc=s,d.range=c,d.raw=l,d.value=f,d}initFunction(r,n){super.initFunction(r,n),r.expression=!1}checkDeclaration(r){r!=null&&this.isObjectProperty(r)?this.checkDeclaration(r.value):super.checkDeclaration(r)}getObjectOrClassMethodParams(r){return r.value.params}isValidDirective(r){var n;return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&typeof r.expression.value=="string"&&!((n=r.expression.extra)!=null&&n.parenthesized)}parseBlockBody(r,n,a,s,c){super.parseBlockBody(r,n,a,s,c);let l=r.directives.map(f=>this.directiveToStmt(f));r.body=l.concat(r.body),delete r.directives}parsePrivateName(){let r=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(r):r}convertPrivateNameToPrivateIdentifier(r){let n=super.getPrivateNameSV(r);return delete r.id,r.name=n,this.castNodeTo(r,"PrivateIdentifier")}isPrivateName(r){return this.getPluginOption("estree","classFeatures")?r.type==="PrivateIdentifier":super.isPrivateName(r)}getPrivateNameSV(r){return this.getPluginOption("estree","classFeatures")?r.name:super.getPrivateNameSV(r)}parseLiteral(r,n){let a=super.parseLiteral(r,n);return a.raw=a.extra.raw,delete a.extra,a}parseFunctionBody(r,n,a=!1){super.parseFunctionBody(r,n,a),r.expression=r.body.type!=="BlockStatement"}parseMethod(r,n,a,s,c,l,f=!1){let d=this.startNode();d.kind=r.kind,d=super.parseMethod(d,n,a,s,c,l,f),delete d.kind;let{typeParameters:m}=r;m&&(delete r.typeParameters,d.typeParameters=m,this.resetStartLocationFromNode(d,m));let g=this.castNodeTo(d,"FunctionExpression");return r.value=g,l==="ClassPrivateMethod"&&(r.computed=!1),l==="ObjectMethod"?(r.kind==="method"&&(r.kind="init"),r.shorthand=!1,this.finishNode(r,"Property")):this.finishNode(r,"MethodDefinition")}nameIsConstructor(r){return r.type==="Literal"?r.value==="constructor":super.nameIsConstructor(r)}parseClassProperty(...r){let n=super.parseClassProperty(...r);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(n,"PropertyDefinition"),n}parseClassPrivateProperty(...r){let n=super.parseClassPrivateProperty(...r);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(n,"PropertyDefinition"),n.computed=!1),n}parseClassAccessorProperty(r){let n=super.parseClassAccessorProperty(r);return this.getPluginOption("estree","classFeatures")&&(n.abstract&&this.hasPlugin("typescript")?(delete n.abstract,this.castNodeTo(n,"TSAbstractAccessorProperty")):this.castNodeTo(n,"AccessorProperty")),n}parseObjectProperty(r,n,a,s){let c=super.parseObjectProperty(r,n,a,s);return c&&(c.kind="init",this.castNodeTo(c,"Property")),c}finishObjectProperty(r){return r.kind="init",this.finishNode(r,"Property")}isValidLVal(r,n,a,s){return r==="Property"?"value":super.isValidLVal(r,n,a,s)}isAssignable(r,n){return r!=null&&this.isObjectProperty(r)?this.isAssignable(r.value,n):super.isAssignable(r,n)}toAssignable(r,n=!1){if(r!=null&&this.isObjectProperty(r)){let{key:a,value:s}=r;this.isPrivateName(a)&&this.classScope.usePrivateName(this.getPrivateNameSV(a),a.loc.start),this.toAssignable(s,n)}else super.toAssignable(r,n)}toAssignableObjectExpressionProp(r,n,a){r.type==="Property"&&(r.kind==="get"||r.kind==="set")?this.raise(ot.PatternHasAccessor,r.key):r.type==="Property"&&r.method?this.raise(ot.PatternHasMethod,r.key):super.toAssignableObjectExpressionProp(r,n,a)}finishCallExpression(r,n){let a=super.finishCallExpression(r,n);if(a.callee.type==="Import"){var s;this.castNodeTo(a,"ImportExpression"),a.source=a.arguments[0],a.options=(s=a.arguments[1])!=null?s:null;{var c;a.attributes=(c=a.arguments[1])!=null?c:null}delete a.arguments,delete a.callee}else a.type==="OptionalCallExpression"?this.castNodeTo(a,"CallExpression"):a.optional=!1;return a}toReferencedArguments(r){r.type!=="ImportExpression"&&super.toReferencedArguments(r)}parseExport(r,n){let a=this.state.lastTokStartLoc,s=super.parseExport(r,n);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":s.specifiers.length===1&&s.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(s,"ExportAllDeclaration"),s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var c;let{declaration:l}=s;(l==null?void 0:l.type)==="ClassDeclaration"&&((c=l.decorators)==null?void 0:c.length)>0&&l.start===s.start&&this.resetStartLocation(s,a)}break}return s}stopParseSubscript(r,n){let a=super.stopParseSubscript(r,n);return n.optionalChainMember?this.estreeParseChainExpression(a,r.loc.end):a}parseMember(r,n,a,s,c){let l=super.parseMember(r,n,a,s,c);return l.type==="OptionalMemberExpression"?this.castNodeTo(l,"MemberExpression"):l.optional=!1,l}isOptionalMemberExpression(r){return r.type==="ChainExpression"?r.expression.type==="MemberExpression":super.isOptionalMemberExpression(r)}hasPropertyAsPrivateName(r){return r.type==="ChainExpression"&&(r=r.expression),super.hasPropertyAsPrivateName(r)}isObjectProperty(r){return r.type==="Property"&&r.kind==="init"&&!r.method}isObjectMethod(r){return r.type==="Property"&&(r.method||r.kind==="get"||r.kind==="set")}castNodeTo(r,n){let a=super.castNodeTo(r,n);return this.fillOptionalPropertiesForTSESLint(a),a}cloneIdentifier(r){let n=super.cloneIdentifier(r);return this.fillOptionalPropertiesForTSESLint(n),n}cloneStringLiteral(r){return r.type==="Literal"?this.cloneEstreeStringLiteral(r):super.cloneStringLiteral(r)}finishNodeAt(r,n,a){return pM(super.finishNodeAt(r,n,a))}finishNode(r,n){let a=super.finishNode(r,n);return this.fillOptionalPropertiesForTSESLint(a),a}resetStartLocation(r,n){super.resetStartLocation(r,n),pM(r)}resetEndLocation(r,n=this.state.lastTokEndLoc){super.resetEndLocation(r,n),pM(r)}},JT=class{constructor(t,r){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!r}},No={brace:new JT("{"),j_oTag:new JT("<tag"),j_cTag:new JT("</tag"),j_expr:new JT("<tag>...</tag>",!0)};No.template=new JT("`",!0);var ea=!0,gn=!0,zfe=!0,fM=!0,l_=!0,wPr=!0,o$=class{constructor(t,r={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop!=null?r.binop:null,this.updateContext=null}},gde=new Map;function ro(e,t={}){t.keyword=e;let r=Si(e,t);return gde.set(e,r),r}function cm(e,t){return Si(e,{beforeExpr:ea,binop:t})}var gM=-1,E2=[],Ade=[],yde=[],vde=[],xde=[],bde=[];function Si(e,t={}){var r,n,a,s;return++gM,Ade.push(e),yde.push((r=t.binop)!=null?r:-1),vde.push((n=t.beforeExpr)!=null?n:!1),xde.push((a=t.startsExpr)!=null?a:!1),bde.push((s=t.prefix)!=null?s:!1),E2.push(new o$(e,t)),gM}function ha(e,t={}){var r,n,a,s;return++gM,gde.set(e,gM),Ade.push(e),yde.push((r=t.binop)!=null?r:-1),vde.push((n=t.beforeExpr)!=null?n:!1),xde.push((a=t.startsExpr)!=null?a:!1),bde.push((s=t.prefix)!=null?s:!1),E2.push(new o$("name",t)),gM}var SPr={bracketL:Si("[",{beforeExpr:ea,startsExpr:gn}),bracketHashL:Si("#[",{beforeExpr:ea,startsExpr:gn}),bracketBarL:Si("[|",{beforeExpr:ea,startsExpr:gn}),bracketR:Si("]"),bracketBarR:Si("|]"),braceL:Si("{",{beforeExpr:ea,startsExpr:gn}),braceBarL:Si("{|",{beforeExpr:ea,startsExpr:gn}),braceHashL:Si("#{",{beforeExpr:ea,startsExpr:gn}),braceR:Si("}"),braceBarR:Si("|}"),parenL:Si("(",{beforeExpr:ea,startsExpr:gn}),parenR:Si(")"),comma:Si(",",{beforeExpr:ea}),semi:Si(";",{beforeExpr:ea}),colon:Si(":",{beforeExpr:ea}),doubleColon:Si("::",{beforeExpr:ea}),dot:Si("."),question:Si("?",{beforeExpr:ea}),questionDot:Si("?."),arrow:Si("=>",{beforeExpr:ea}),template:Si("template"),ellipsis:Si("...",{beforeExpr:ea}),backQuote:Si("`",{startsExpr:gn}),dollarBraceL:Si("${",{beforeExpr:ea,startsExpr:gn}),templateTail:Si("...`",{startsExpr:gn}),templateNonTail:Si("...${",{beforeExpr:ea,startsExpr:gn}),at:Si("@"),hash:Si("#",{startsExpr:gn}),interpreterDirective:Si("#!..."),eq:Si("=",{beforeExpr:ea,isAssign:fM}),assign:Si("_=",{beforeExpr:ea,isAssign:fM}),slashAssign:Si("_=",{beforeExpr:ea,isAssign:fM}),xorAssign:Si("_=",{beforeExpr:ea,isAssign:fM}),moduloAssign:Si("_=",{beforeExpr:ea,isAssign:fM}),incDec:Si("++/--",{prefix:l_,postfix:wPr,startsExpr:gn}),bang:Si("!",{beforeExpr:ea,prefix:l_,startsExpr:gn}),tilde:Si("~",{beforeExpr:ea,prefix:l_,startsExpr:gn}),doubleCaret:Si("^^",{startsExpr:gn}),doubleAt:Si("@@",{startsExpr:gn}),pipeline:cm("|>",0),nullishCoalescing:cm("??",1),logicalOR:cm("||",1),logicalAND:cm("&&",2),bitwiseOR:cm("|",3),bitwiseXOR:cm("^",4),bitwiseAND:cm("&",5),equality:cm("==/!=/===/!==",6),lt:cm("</>/<=/>=",7),gt:cm("</>/<=/>=",7),relational:cm("</>/<=/>=",7),bitShift:cm("<</>>/>>>",8),bitShiftL:cm("<</>>/>>>",8),bitShiftR:cm("<</>>/>>>",8),plusMin:Si("+/-",{beforeExpr:ea,binop:9,prefix:l_,startsExpr:gn}),modulo:Si("%",{binop:10,startsExpr:gn}),star:Si("*",{binop:10}),slash:cm("/",10),exponent:Si("**",{beforeExpr:ea,binop:11,rightAssociative:!0}),_in:ro("in",{beforeExpr:ea,binop:7}),_instanceof:ro("instanceof",{beforeExpr:ea,binop:7}),_break:ro("break"),_case:ro("case",{beforeExpr:ea}),_catch:ro("catch"),_continue:ro("continue"),_debugger:ro("debugger"),_default:ro("default",{beforeExpr:ea}),_else:ro("else",{beforeExpr:ea}),_finally:ro("finally"),_function:ro("function",{startsExpr:gn}),_if:ro("if"),_return:ro("return",{beforeExpr:ea}),_switch:ro("switch"),_throw:ro("throw",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_try:ro("try"),_var:ro("var"),_const:ro("const"),_with:ro("with"),_new:ro("new",{beforeExpr:ea,startsExpr:gn}),_this:ro("this",{startsExpr:gn}),_super:ro("super",{startsExpr:gn}),_class:ro("class",{startsExpr:gn}),_extends:ro("extends",{beforeExpr:ea}),_export:ro("export"),_import:ro("import",{startsExpr:gn}),_null:ro("null",{startsExpr:gn}),_true:ro("true",{startsExpr:gn}),_false:ro("false",{startsExpr:gn}),_typeof:ro("typeof",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_void:ro("void",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_delete:ro("delete",{beforeExpr:ea,prefix:l_,startsExpr:gn}),_do:ro("do",{isLoop:zfe,beforeExpr:ea}),_for:ro("for",{isLoop:zfe}),_while:ro("while",{isLoop:zfe}),_as:ha("as",{startsExpr:gn}),_assert:ha("assert",{startsExpr:gn}),_async:ha("async",{startsExpr:gn}),_await:ha("await",{startsExpr:gn}),_defer:ha("defer",{startsExpr:gn}),_from:ha("from",{startsExpr:gn}),_get:ha("get",{startsExpr:gn}),_let:ha("let",{startsExpr:gn}),_meta:ha("meta",{startsExpr:gn}),_of:ha("of",{startsExpr:gn}),_sent:ha("sent",{startsExpr:gn}),_set:ha("set",{startsExpr:gn}),_source:ha("source",{startsExpr:gn}),_static:ha("static",{startsExpr:gn}),_using:ha("using",{startsExpr:gn}),_yield:ha("yield",{startsExpr:gn}),_asserts:ha("asserts",{startsExpr:gn}),_checks:ha("checks",{startsExpr:gn}),_exports:ha("exports",{startsExpr:gn}),_global:ha("global",{startsExpr:gn}),_implements:ha("implements",{startsExpr:gn}),_intrinsic:ha("intrinsic",{startsExpr:gn}),_infer:ha("infer",{startsExpr:gn}),_is:ha("is",{startsExpr:gn}),_mixins:ha("mixins",{startsExpr:gn}),_proto:ha("proto",{startsExpr:gn}),_require:ha("require",{startsExpr:gn}),_satisfies:ha("satisfies",{startsExpr:gn}),_keyof:ha("keyof",{startsExpr:gn}),_readonly:ha("readonly",{startsExpr:gn}),_unique:ha("unique",{startsExpr:gn}),_abstract:ha("abstract",{startsExpr:gn}),_declare:ha("declare",{startsExpr:gn}),_enum:ha("enum",{startsExpr:gn}),_module:ha("module",{startsExpr:gn}),_namespace:ha("namespace",{startsExpr:gn}),_interface:ha("interface",{startsExpr:gn}),_type:ha("type",{startsExpr:gn}),_opaque:ha("opaque",{startsExpr:gn}),name:Si("name",{startsExpr:gn}),placeholder:Si("%%",{startsExpr:gn}),string:Si("string",{startsExpr:gn}),num:Si("num",{startsExpr:gn}),bigint:Si("bigint",{startsExpr:gn}),decimal:Si("decimal",{startsExpr:gn}),regexp:Si("regexp",{startsExpr:gn}),privateName:Si("#name",{startsExpr:gn}),eof:Si("eof"),jsxName:Si("jsxName"),jsxText:Si("jsxText",{beforeExpr:ea}),jsxTagStart:Si("jsxTagStart",{startsExpr:gn}),jsxTagEnd:Si("jsxTagEnd")};function zo(e){return e>=93&&e<=133}function CPr(e){return e<=92}function ix(e){return e>=58&&e<=133}function wHe(e){return e>=58&&e<=137}function _Pr(e){return vde[e]}function hM(e){return xde[e]}function IPr(e){return e>=29&&e<=33}function fHe(e){return e>=129&&e<=131}function kPr(e){return e>=90&&e<=92}function Ede(e){return e>=58&&e<=92}function TPr(e){return e>=39&&e<=59}function BPr(e){return e===34}function DPr(e){return bde[e]}function PPr(e){return e>=121&&e<=123}function RPr(e){return e>=124&&e<=130}function d_(e){return Ade[e]}function s$(e){return yde[e]}function NPr(e){return e===57}function c$(e){return e>=24&&e<=25}function b2(e){return E2[e]}E2[8].updateContext=e=>{e.pop()},E2[5].updateContext=E2[7].updateContext=E2[23].updateContext=e=>{e.push(No.brace)},E2[22].updateContext=e=>{e[e.length-1]===No.template?e.pop():e.push(No.template)},E2[143].updateContext=e=>{e.push(No.j_expr,No.j_oTag)};var wde="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",SHe="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",FPr=new RegExp("["+wde+"]"),OPr=new RegExp("["+wde+SHe+"]");wde=SHe=null;var CHe=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],QPr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function Yfe(e,t){let r=65536;for(let n=0,a=t.length;n<a;n+=2){if(r+=t[n],r>e)return!1;if(r+=t[n+1],r>=e)return!0}return!1}function dE(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&FPr.test(String.fromCharCode(e)):Yfe(e,CHe)}function KT(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&OPr.test(String.fromCharCode(e)):Yfe(e,CHe)||Yfe(e,QPr)}var Sde={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},LPr=new Set(Sde.keyword),jPr=new Set(Sde.strict),MPr=new Set(Sde.strictBind);function _He(e,t){return t&&e==="await"||e==="enum"}function IHe(e,t){return _He(e,t)||jPr.has(e)}function kHe(e){return MPr.has(e)}function THe(e,t){return IHe(e,t)||kHe(e)}function qPr(e){return LPr.has(e)}function UPr(e,t,r){return e===64&&t===64&&dE(r)}var zPr=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function HPr(e){return zPr.has(e)}var AM=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},yM=class{constructor(t,r){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=r}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:r}=this.scopeStack[t];if(r&128)return!0;if(r&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new AM(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,r,n){let a=this.currentScope();if(r&8||r&16){this.checkRedeclarationInScope(a,t,r,n);let s=a.names.get(t)||0;r&16?s=s|4:(a.firstLexicalName||(a.firstLexicalName=t),s=s|2),a.names.set(t,s),r&8&&this.maybeExportDefined(a,t)}else if(r&4)for(let s=this.scopeStack.length-1;s>=0&&(a=this.scopeStack[s],this.checkRedeclarationInScope(a,t,r,n),a.names.set(t,(a.names.get(t)||0)|1),this.maybeExportDefined(a,t),!(a.flags&1667));--s);this.parser.inModule&&a.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,r){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(r)}checkRedeclarationInScope(t,r,n,a){this.isRedeclaredInScope(t,r,n)&&this.parser.raise(ot.VarRedeclaration,a,{identifierName:r})}isRedeclaredInScope(t,r,n){if(!(n&1))return!1;if(n&8)return t.names.has(r);let a=t.names.get(r)||0;return n&16?(a&2)>0||!this.treatFunctionsAsVarInScope(t)&&(a&1)>0:(a&2)>0&&!(t.flags&8&&t.firstLexicalName===r)||!this.treatFunctionsAsVarInScope(t)&&(a&4)>0}checkLocalExport(t){let{name:r}=t;this.scopeStack[0].names.has(r)||this.undefinedExports.set(r,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:r}=this.scopeStack[t];if(r&1667)return r}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:r}=this.scopeStack[t];if(r&1731&&!(r&4))return r}}},Jfe=class extends AM{constructor(...t){super(...t),this.declareFunctions=new Set}},Kfe=class extends yM{createScope(t){return new Jfe(t)}declareName(t,r,n){let a=this.currentScope();if(r&2048){this.checkRedeclarationInScope(a,t,r,n),this.maybeExportDefined(a,t),a.declareFunctions.add(t);return}super.declareName(t,r,n)}isRedeclaredInScope(t,r,n){if(super.isRedeclaredInScope(t,r,n))return!0;if(n&2048&&!t.declareFunctions.has(r)){let a=t.names.get(r);return(a&4)>0||(a&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},VPr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),Fi=fE`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:r})=>`Enum \`${e}\` has type \`${r}\`, so the initializer of \`${t}\` needs to be a ${r} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:r})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${r}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function $Pr(e){return e.type==="DeclareExportAllDeclaration"||e.type==="DeclareExportDeclaration"&&(!e.declaration||e.declaration.type!=="TypeAlias"&&e.declaration.type!=="InterfaceDeclaration")}function dHe(e){return e.importKind==="type"||e.importKind==="typeof"}var WPr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function GPr(e,t){let r=[],n=[];for(let a=0;a<e.length;a++)(t(e[a],a,e)?r:n).push(e[a]);return[r,n]}var YPr=/\*?\s*@((?:no)?flow)\b/,JPr=e=>class extends e{constructor(...r){super(...r),this.flowPragma=void 0}getScopeHandler(){return Kfe}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(r,n){r!==134&&r!==13&&r!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(r,n)}addComment(r){if(this.flowPragma===void 0){let n=YPr.exec(r.value);if(n)if(n[1]==="flow")this.flowPragma="flow";else if(n[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(r)}flowParseTypeInitialiser(r){let n=this.state.inType;this.state.inType=!0,this.expect(r||14);let a=this.flowParseType();return this.state.inType=n,a}flowParsePredicate(){let r=this.startNode(),n=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>n.index+1&&this.raise(Fi.UnexpectedSpaceBetweenModuloChecks,n),this.eat(10)?(r.value=super.parseExpression(),this.expect(11),this.finishNode(r,"DeclaredPredicate")):this.finishNode(r,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let r=this.state.inType;this.state.inType=!0,this.expect(14);let n=null,a=null;return this.match(54)?(this.state.inType=r,a=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=r,this.match(54)&&(a=this.flowParsePredicate())),[n,a]}flowParseDeclareClass(r){return this.next(),this.flowParseInterfaceish(r,!0),this.finishNode(r,"DeclareClass")}flowParseDeclareFunction(r){this.next();let n=r.id=this.parseIdentifier(),a=this.startNode(),s=this.startNode();this.match(47)?a.typeParameters=this.flowParseTypeParameterDeclaration():a.typeParameters=null,this.expect(10);let c=this.flowParseFunctionTypeParams();return a.params=c.params,a.rest=c.rest,a.this=c._this,this.expect(11),[a.returnType,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),s.typeAnnotation=this.finishNode(a,"FunctionTypeAnnotation"),n.typeAnnotation=this.finishNode(s,"TypeAnnotation"),this.resetEndLocation(n),this.semicolon(),this.scope.declareName(r.id.name,2048,r.id.loc.start),this.finishNode(r,"DeclareFunction")}flowParseDeclare(r,n){if(this.match(80))return this.flowParseDeclareClass(r);if(this.match(68))return this.flowParseDeclareFunction(r);if(this.match(74))return this.flowParseDeclareVariable(r);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(r):(n&&this.raise(Fi.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(r));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(r);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(r);if(this.isContextual(129))return this.flowParseDeclareInterface(r);if(this.match(82))return this.flowParseDeclareExportDeclaration(r,n);throw this.unexpected()}flowParseDeclareVariable(r){return this.next(),r.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(r.id.name,5,r.id.loc.start),this.semicolon(),this.finishNode(r,"DeclareVariable")}flowParseDeclareModule(r){this.scope.enter(0),this.match(134)?r.id=super.parseExprAtom():r.id=this.parseIdentifier();let n=r.body=this.startNode(),a=n.body=[];for(this.expect(5);!this.match(8);){let l=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(Fi.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),a.push(super.parseImport(l))):(this.expectContextual(125,Fi.UnsupportedStatementInDeclareModule),a.push(this.flowParseDeclare(l,!0)))}this.scope.exit(),this.expect(8),this.finishNode(n,"BlockStatement");let s=null,c=!1;return a.forEach(l=>{$Pr(l)?(s==="CommonJS"&&this.raise(Fi.AmbiguousDeclareModuleKind,l),s="ES"):l.type==="DeclareModuleExports"&&(c&&this.raise(Fi.DuplicateDeclareModuleExports,l),s==="ES"&&this.raise(Fi.AmbiguousDeclareModuleKind,l),s="CommonJS",c=!0)}),r.kind=s||"CommonJS",this.finishNode(r,"DeclareModule")}flowParseDeclareExportDeclaration(r,n){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?r.declaration=this.flowParseDeclare(this.startNode()):(r.declaration=this.flowParseType(),this.semicolon()),r.default=!0,this.finishNode(r,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!n){let a=this.state.value;throw this.raise(Fi.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:a,suggestion:WPr[a]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return r.declaration=this.flowParseDeclare(this.startNode()),r.default=!1,this.finishNode(r,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return r=this.parseExport(r,null),r.type==="ExportNamedDeclaration"?(r.default=!1,delete r.exportKind,this.castNodeTo(r,"DeclareExportDeclaration")):this.castNodeTo(r,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(r){return this.next(),this.expectContextual(111),r.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(r,"DeclareModuleExports")}flowParseDeclareTypeAlias(r){this.next();let n=this.flowParseTypeAlias(r);return this.castNodeTo(n,"DeclareTypeAlias"),n}flowParseDeclareOpaqueType(r){this.next();let n=this.flowParseOpaqueType(r,!0);return this.castNodeTo(n,"DeclareOpaqueType"),n}flowParseDeclareInterface(r){return this.next(),this.flowParseInterfaceish(r,!1),this.finishNode(r,"DeclareInterface")}flowParseInterfaceish(r,n){if(r.id=this.flowParseRestrictedIdentifier(!n,!0),this.scope.declareName(r.id.name,n?17:8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.extends=[],this.eat(81))do r.extends.push(this.flowParseInterfaceExtends());while(!n&&this.eat(12));if(n){if(r.implements=[],r.mixins=[],this.eatContextual(117))do r.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do r.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}r.body=this.flowParseObjectType({allowStatic:n,allowExact:!1,allowSpread:!1,allowProto:n,allowInexact:!1})}flowParseInterfaceExtends(){let r=this.startNode();return r.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,this.finishNode(r,"InterfaceExtends")}flowParseInterface(r){return this.flowParseInterfaceish(r,!1),this.finishNode(r,"InterfaceDeclaration")}checkNotUnderscore(r){r==="_"&&this.raise(Fi.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(r,n,a){VPr.has(r)&&this.raise(a?Fi.AssignReservedType:Fi.UnexpectedReservedType,n,{reservedType:r})}flowParseRestrictedIdentifier(r,n){return this.checkReservedType(this.state.value,this.state.startLoc,n),this.parseIdentifier(r)}flowParseTypeAlias(r){return r.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(r.id.name,8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(r,"TypeAlias")}flowParseOpaqueType(r,n){return this.expectContextual(130),r.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(r.id.name,8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.supertype=null,this.match(14)&&(r.supertype=this.flowParseTypeInitialiser(14)),r.impltype=null,n||(r.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(r,"OpaqueType")}flowParseTypeParameter(r=!1){let n=this.state.startLoc,a=this.startNode(),s=this.flowParseVariance(),c=this.flowParseTypeAnnotatableIdentifier();return a.name=c.name,a.variance=s,a.bound=c.typeAnnotation,this.match(29)?(this.eat(29),a.default=this.flowParseType()):r&&this.raise(Fi.MissingTypeParamDefault,n),this.finishNode(a,"TypeParameter")}flowParseTypeParameterDeclaration(){let r=this.state.inType,n=this.startNode();n.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let a=!1;do{let s=this.flowParseTypeParameter(a);n.params.push(s),s.default&&(a=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=r,this.finishNode(n,"TypeParameterDeclaration")}flowInTopLevelContext(r){if(this.curContext()!==No.brace){let n=this.state.context;this.state.context=[n[0]];try{return r()}finally{this.state.context=n}}else return r()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let r=this.startNode(),n=this.state.inType;return this.state.inType=!0,r.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let a=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)r.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=a}),this.state.inType=n,!this.state.inType&&this.curContext()===No.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(r,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let r=this.startNode(),n=this.state.inType;for(r.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)r.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=n,this.finishNode(r,"TypeParameterInstantiation")}flowParseInterfaceType(){let r=this.startNode();if(this.expectContextual(129),r.extends=[],this.eat(81))do r.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return r.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(r,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(r,n,a){return r.static=n,this.lookahead().type===14?(r.id=this.flowParseObjectPropertyKey(),r.key=this.flowParseTypeInitialiser()):(r.id=null,r.key=this.flowParseType()),this.expect(3),r.value=this.flowParseTypeInitialiser(),r.variance=a,this.finishNode(r,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(r,n){return r.static=n,r.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(r.method=!0,r.optional=!1,r.value=this.flowParseObjectTypeMethodish(this.startNodeAt(r.loc.start))):(r.method=!1,this.eat(17)&&(r.optional=!0),r.value=this.flowParseTypeInitialiser()),this.finishNode(r,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(r){for(r.params=[],r.rest=null,r.typeParameters=null,r.this=null,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(r.this=this.flowParseFunctionTypeParam(!0),r.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)r.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(r.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),r.returnType=this.flowParseTypeInitialiser(),this.finishNode(r,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(r,n){let a=this.startNode();return r.static=n,r.value=this.flowParseObjectTypeMethodish(a),this.finishNode(r,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:r,allowExact:n,allowSpread:a,allowProto:s,allowInexact:c}){let l=this.state.inType;this.state.inType=!0;let f=this.startNode();f.callProperties=[],f.properties=[],f.indexers=[],f.internalSlots=[];let d,m,g=!1;for(n&&this.match(6)?(this.expect(6),d=9,m=!0):(this.expect(5),d=8,m=!1),f.exact=m;!this.match(d);){let b=!1,A=null,C=null,I=this.startNode();if(s&&this.isContextual(118)){let O=this.lookahead();O.type!==14&&O.type!==17&&(this.next(),A=this.state.startLoc,r=!1)}if(r&&this.isContextual(106)){let O=this.lookahead();O.type!==14&&O.type!==17&&(this.next(),b=!0)}let k=this.flowParseVariance();if(this.eat(0))A!=null&&this.unexpected(A),this.eat(0)?(k&&this.unexpected(k.loc.start),f.internalSlots.push(this.flowParseObjectTypeInternalSlot(I,b))):f.indexers.push(this.flowParseObjectTypeIndexer(I,b,k));else if(this.match(10)||this.match(47))A!=null&&this.unexpected(A),k&&this.unexpected(k.loc.start),f.callProperties.push(this.flowParseObjectTypeCallProperty(I,b));else{let O="init";if(this.isContextual(99)||this.isContextual(104)){let M=this.lookahead();wHe(M.type)&&(O=this.state.value,this.next())}let j=this.flowParseObjectTypeProperty(I,b,A,k,O,a,c!=null?c:!m);j===null?(g=!0,C=this.state.lastTokStartLoc):f.properties.push(j)}this.flowObjectTypeSemicolon(),C&&!this.match(8)&&!this.match(9)&&this.raise(Fi.UnexpectedExplicitInexactInObject,C)}this.expect(d),a&&(f.inexact=g);let x=this.finishNode(f,"ObjectTypeAnnotation");return this.state.inType=l,x}flowParseObjectTypeProperty(r,n,a,s,c,l,f){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(l?f||this.raise(Fi.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Fi.InexactInsideNonObject,this.state.lastTokStartLoc),s&&this.raise(Fi.InexactVariance,s),null):(l||this.raise(Fi.UnexpectedSpreadType,this.state.lastTokStartLoc),a!=null&&this.unexpected(a),s&&this.raise(Fi.SpreadVariance,s),r.argument=this.flowParseType(),this.finishNode(r,"ObjectTypeSpreadProperty"));{r.key=this.flowParseObjectPropertyKey(),r.static=n,r.proto=a!=null,r.kind=c;let d=!1;return this.match(47)||this.match(10)?(r.method=!0,a!=null&&this.unexpected(a),s&&this.unexpected(s.loc.start),r.value=this.flowParseObjectTypeMethodish(this.startNodeAt(r.loc.start)),(c==="get"||c==="set")&&this.flowCheckGetterSetterParams(r),!l&&r.key.name==="constructor"&&r.value.this&&this.raise(Fi.ThisParamBannedInConstructor,r.value.this)):(c!=="init"&&this.unexpected(),r.method=!1,this.eat(17)&&(d=!0),r.value=this.flowParseTypeInitialiser(),r.variance=s),r.optional=d,this.finishNode(r,"ObjectTypeProperty")}}flowCheckGetterSetterParams(r){let n=r.kind==="get"?0:1,a=r.value.params.length+(r.value.rest?1:0);r.value.this&&this.raise(r.kind==="get"?Fi.GetterMayNotHaveThisParam:Fi.SetterMayNotHaveThisParam,r.value.this),a!==n&&this.raise(r.kind==="get"?ot.BadGetterArity:ot.BadSetterArity,r),r.kind==="set"&&r.value.rest&&this.raise(ot.BadSetterRestParameter,r)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(r,n){r!=null||(r=this.state.startLoc);let a=n||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let s=this.startNodeAt(r);s.qualification=a,s.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(s,"QualifiedTypeIdentifier")}return a}flowParseGenericType(r,n){let a=this.startNodeAt(r);return a.typeParameters=null,a.id=this.flowParseQualifiedTypeIdentifier(r,n),this.match(47)&&(a.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(a,"GenericTypeAnnotation")}flowParseTypeofType(){let r=this.startNode();return this.expect(87),r.argument=this.flowParsePrimaryType(),this.finishNode(r,"TypeofTypeAnnotation")}flowParseTupleType(){let r=this.startNode();for(r.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(r.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(r,"TupleTypeAnnotation")}flowParseFunctionTypeParam(r){let n=null,a=!1,s=null,c=this.startNode(),l=this.lookahead(),f=this.state.type===78;return l.type===14||l.type===17?(f&&!r&&this.raise(Fi.ThisParamMustBeFirst,c),n=this.parseIdentifier(f),this.eat(17)&&(a=!0,f&&this.raise(Fi.ThisParamMayNotBeOptional,c)),s=this.flowParseTypeInitialiser()):s=this.flowParseType(),c.name=n,c.optional=a,c.typeAnnotation=s,this.finishNode(c,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(r){let n=this.startNodeAt(r.loc.start);return n.name=null,n.optional=!1,n.typeAnnotation=r,this.finishNode(n,"FunctionTypeParam")}flowParseFunctionTypeParams(r=[]){let n=null,a=null;for(this.match(78)&&(a=this.flowParseFunctionTypeParam(!0),a.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)r.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(n=this.flowParseFunctionTypeParam(!1)),{params:r,rest:n,_this:a}}flowIdentToTypeAnnotation(r,n,a){switch(a.name){case"any":return this.finishNode(n,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(n,"BooleanTypeAnnotation");case"mixed":return this.finishNode(n,"MixedTypeAnnotation");case"empty":return this.finishNode(n,"EmptyTypeAnnotation");case"number":return this.finishNode(n,"NumberTypeAnnotation");case"string":return this.finishNode(n,"StringTypeAnnotation");case"symbol":return this.finishNode(n,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(a.name),this.flowParseGenericType(r,a)}}flowParsePrimaryType(){let r=this.state.startLoc,n=this.startNode(),a,s,c=!1,l=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,s=this.flowParseTupleType(),this.state.noAnonFunctionType=l,s;case 47:{let f=this.startNode();return f.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),a=this.flowParseFunctionTypeParams(),f.params=a.params,f.rest=a.rest,f.this=a._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),this.finishNode(f,"FunctionTypeAnnotation")}case 10:{let f=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(zo(this.state.type)||this.match(78)){let d=this.lookahead().type;c=d!==17&&d!==14}else c=!0;if(c){if(this.state.noAnonFunctionType=!1,s=this.flowParseType(),this.state.noAnonFunctionType=l,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),s;this.eat(12)}return s?a=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(s)]):a=this.flowParseFunctionTypeParams(),f.params=a.params,f.rest=a.rest,f.this=a._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),f.typeParameters=null,this.finishNode(f,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return n.value=this.match(85),this.next(),this.finishNode(n,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",n);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",n);throw this.raise(Fi.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(n,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(n,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(n,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(n,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Ede(this.state.type)){let f=d_(this.state.type);return this.next(),super.createIdentifier(n,f)}else if(zo(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(r,n,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let r=this.state.startLoc,n=this.flowParsePrimaryType(),a=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let s=this.startNodeAt(r),c=this.eat(18);a=a||c,this.expect(0),!c&&this.match(3)?(s.elementType=n,this.next(),n=this.finishNode(s,"ArrayTypeAnnotation")):(s.objectType=n,s.indexType=this.flowParseType(),this.expect(3),a?(s.optional=c,n=this.finishNode(s,"OptionalIndexedAccessType")):n=this.finishNode(s,"IndexedAccessType"))}return n}flowParsePrefixType(){let r=this.startNode();return this.eat(17)?(r.typeAnnotation=this.flowParsePrefixType(),this.finishNode(r,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let r=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let n=this.startNodeAt(r.loc.start);return n.params=[this.reinterpretTypeAsFunctionTypeParam(r)],n.rest=null,n.this=null,n.returnType=this.flowParseType(),n.typeParameters=null,this.finishNode(n,"FunctionTypeAnnotation")}return r}flowParseIntersectionType(){let r=this.startNode();this.eat(45);let n=this.flowParseAnonFunctionWithoutParens();for(r.types=[n];this.eat(45);)r.types.push(this.flowParseAnonFunctionWithoutParens());return r.types.length===1?n:this.finishNode(r,"IntersectionTypeAnnotation")}flowParseUnionType(){let r=this.startNode();this.eat(43);let n=this.flowParseIntersectionType();for(r.types=[n];this.eat(43);)r.types.push(this.flowParseIntersectionType());return r.types.length===1?n:this.finishNode(r,"UnionTypeAnnotation")}flowParseType(){let r=this.state.inType;this.state.inType=!0;let n=this.flowParseUnionType();return this.state.inType=r,n}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let r=this.state.startLoc,n=this.parseIdentifier();return this.flowParseGenericType(r,n)}else return this.flowParseType()}flowParseTypeAnnotation(){let r=this.startNode();return r.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(r,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(r){let n=r?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(n.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(n)),n}typeCastToParameter(r){return r.expression.typeAnnotation=r.typeAnnotation,this.resetEndLocation(r.expression,r.typeAnnotation.loc.end),r.expression}flowParseVariance(){let r=null;return this.match(53)?(r=this.startNode(),this.state.value==="+"?r.kind="plus":r.kind="minus",this.next(),this.finishNode(r,"Variance")):r}parseFunctionBody(r,n,a=!1){if(n){this.forwardNoArrowParamsConversionAt(r,()=>super.parseFunctionBody(r,!0,a));return}super.parseFunctionBody(r,!1,a)}parseFunctionBodyAndFinish(r,n,a=!1){if(this.match(14)){let s=this.startNode();[s.typeAnnotation,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.returnType=s.typeAnnotation?this.finishNode(s,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(r,n,a)}parseStatementLike(r){if(this.state.strict&&this.isContextual(129)){let a=this.lookahead();if(ix(a.type)){let s=this.startNode();return this.next(),this.flowParseInterface(s)}}else if(this.isContextual(126)){let a=this.startNode();return this.next(),this.flowParseEnumDeclaration(a)}let n=super.parseStatementLike(r);return this.flowPragma===void 0&&!this.isValidDirective(n)&&(this.flowPragma=null),n}parseExpressionStatement(r,n,a){if(n.type==="Identifier"){if(n.name==="declare"){if(this.match(80)||zo(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(r)}else if(zo(this.state.type)){if(n.name==="interface")return this.flowParseInterface(r);if(n.name==="type")return this.flowParseTypeAlias(r);if(n.name==="opaque")return this.flowParseOpaqueType(r,!1)}}return super.parseExpressionStatement(r,n,a)}shouldParseExportDeclaration(){let{type:r}=this.state;return r===126||fHe(r)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:r}=this.state;return r===126||fHe(r)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}return super.parseExportDefaultExpression()}parseConditional(r,n,a){if(!this.match(17))return r;if(this.state.maybeInArrowParameters){let x=this.lookaheadCharCode();if(x===44||x===61||x===58||x===41)return this.setOptionalParametersError(a),r}this.expect(17);let s=this.state.clone(),c=this.state.noArrowAt,l=this.startNodeAt(n),{consequent:f,failed:d}=this.tryParseConditionalConsequent(),[m,g]=this.getArrowLikeExpressions(f);if(d||g.length>0){let x=[...c];if(g.length>0){this.state=s,this.state.noArrowAt=x;for(let b=0;b<g.length;b++)x.push(g[b].start);({consequent:f,failed:d}=this.tryParseConditionalConsequent()),[m,g]=this.getArrowLikeExpressions(f)}d&&m.length>1&&this.raise(Fi.AmbiguousConditionalArrow,s.startLoc),d&&m.length===1&&(this.state=s,x.push(m[0].start),this.state.noArrowAt=x,{consequent:f,failed:d}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(f,!0),this.state.noArrowAt=c,this.expect(14),l.test=r,l.consequent=f,l.alternate=this.forwardNoArrowParamsConversionAt(l,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(l,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let r=this.parseMaybeAssignAllowIn(),n=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:r,failed:n}}getArrowLikeExpressions(r,n){let a=[r],s=[];for(;a.length!==0;){let c=a.pop();c.type==="ArrowFunctionExpression"&&c.body.type!=="BlockStatement"?(c.typeParameters||!c.returnType?this.finishArrowValidation(c):s.push(c),a.push(c.body)):c.type==="ConditionalExpression"&&(a.push(c.consequent),a.push(c.alternate))}return n?(s.forEach(c=>this.finishArrowValidation(c)),[s,[]]):GPr(s,c=>c.params.every(l=>this.isAssignable(l,!0)))}finishArrowValidation(r){var n;this.toAssignableList(r.params,(n=r.extra)==null?void 0:n.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(r,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(r,n){let a;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(r.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),a=n(),this.state.noArrowParamsConversionAt.pop()):a=n(),a}parseParenItem(r,n){let a=super.parseParenItem(r,n);if(this.eat(17)&&(a.optional=!0,this.resetEndLocation(r)),this.match(14)){let s=this.startNodeAt(n);return s.expression=a,s.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(s,"TypeCastExpression")}return a}assertModuleNodeAllowed(r){r.type==="ImportDeclaration"&&(r.importKind==="type"||r.importKind==="typeof")||r.type==="ExportNamedDeclaration"&&r.exportKind==="type"||r.type==="ExportAllDeclaration"&&r.exportKind==="type"||super.assertModuleNodeAllowed(r)}parseExportDeclaration(r){if(this.isContextual(130)){r.exportKind="type";let n=this.startNode();return this.next(),this.match(5)?(r.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(r),null):this.flowParseTypeAlias(n)}else if(this.isContextual(131)){r.exportKind="type";let n=this.startNode();return this.next(),this.flowParseOpaqueType(n,!1)}else if(this.isContextual(129)){r.exportKind="type";let n=this.startNode();return this.next(),this.flowParseInterface(n)}else if(this.isContextual(126)){r.exportKind="value";let n=this.startNode();return this.next(),this.flowParseEnumDeclaration(n)}else return super.parseExportDeclaration(r)}eatExportStar(r){return super.eatExportStar(r)?!0:this.isContextual(130)&&this.lookahead().type===55?(r.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(r){let{startLoc:n}=this.state,a=super.maybeParseExportNamespaceSpecifier(r);return a&&r.exportKind==="type"&&this.unexpected(n),a}parseClassId(r,n,a){super.parseClassId(r,n,a),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(r,n,a){let{startLoc:s}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(r,n))return;n.declare=!0}super.parseClassMember(r,n,a),n.declare&&(n.type!=="ClassProperty"&&n.type!=="ClassPrivateProperty"&&n.type!=="PropertyDefinition"?this.raise(Fi.DeclareClassElement,s):n.value&&this.raise(Fi.DeclareClassFieldInitializer,n.value))}isIterator(r){return r==="iterator"||r==="asyncIterator"}readIterator(){let r=super.readWord1(),n="@@"+r;(!this.isIterator(r)||!this.state.inType)&&this.raise(ot.InvalidIdentifier,this.state.curPosition(),{identifierName:n}),this.finishToken(132,n)}getTokenFromCode(r){let n=this.input.charCodeAt(this.state.pos+1);r===123&&n===124?this.finishOp(6,2):this.state.inType&&(r===62||r===60)?this.finishOp(r===62?48:47,1):this.state.inType&&r===63?n===46?this.finishOp(18,2):this.finishOp(17,1):UPr(r,n,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(r)}isAssignable(r,n){return r.type==="TypeCastExpression"?this.isAssignable(r.expression,n):super.isAssignable(r,n)}toAssignable(r,n=!1){!n&&r.type==="AssignmentExpression"&&r.left.type==="TypeCastExpression"&&(r.left=this.typeCastToParameter(r.left)),super.toAssignable(r,n)}toAssignableList(r,n,a){for(let s=0;s<r.length;s++){let c=r[s];(c==null?void 0:c.type)==="TypeCastExpression"&&(r[s]=this.typeCastToParameter(c))}super.toAssignableList(r,n,a)}toReferencedList(r,n){for(let s=0;s<r.length;s++){var a;let c=r[s];c&&c.type==="TypeCastExpression"&&!((a=c.extra)!=null&&a.parenthesized)&&(r.length>1||!n)&&this.raise(Fi.TypeCastInPattern,c.typeAnnotation)}return r}parseArrayLike(r,n,a){let s=super.parseArrayLike(r,n,a);return a!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(s.elements),s}isValidLVal(r,n,a,s){return r==="TypeCastExpression"||super.isValidLVal(r,n,a,s)}parseClassProperty(r){return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(r)}parseClassPrivateProperty(r){return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(r)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(r){return!this.match(14)&&super.isNonstaticConstructor(r)}pushClassMethod(r,n,a,s,c,l){if(n.variance&&this.unexpected(n.variance.loc.start),delete n.variance,this.match(47)&&(n.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(r,n,a,s,c,l),n.params&&c){let f=n.params;f.length>0&&this.isThisParam(f[0])&&this.raise(Fi.ThisParamBannedInConstructor,n)}else if(n.type==="MethodDefinition"&&c&&n.value.params){let f=n.value.params;f.length>0&&this.isThisParam(f[0])&&this.raise(Fi.ThisParamBannedInConstructor,n)}}pushClassPrivateMethod(r,n,a,s){n.variance&&this.unexpected(n.variance.loc.start),delete n.variance,this.match(47)&&(n.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(r,n,a,s)}parseClassSuper(r){if(super.parseClassSuper(r),r.superClass&&(this.match(47)||this.match(51))&&(r.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let n=r.implements=[];do{let a=this.startNode();a.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?a.typeParameters=this.flowParseTypeParameterInstantiation():a.typeParameters=null,n.push(this.finishNode(a,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(r){super.checkGetterSetterParams(r);let n=this.getObjectOrClassMethodParams(r);if(n.length>0){let a=n[0];this.isThisParam(a)&&r.kind==="get"?this.raise(Fi.GetterMayNotHaveThisParam,a):this.isThisParam(a)&&this.raise(Fi.SetterMayNotHaveThisParam,a)}}parsePropertyNamePrefixOperator(r){r.variance=this.flowParseVariance()}parseObjPropValue(r,n,a,s,c,l,f){r.variance&&this.unexpected(r.variance.loc.start),delete r.variance;let d;this.match(47)&&!l&&(d=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let m=super.parseObjPropValue(r,n,a,s,c,l,f);return d&&((m.value||m).typeParameters=d),m}parseFunctionParamType(r){return this.eat(17)&&(r.type!=="Identifier"&&this.raise(Fi.PatternIsOptional,r),this.isThisParam(r)&&this.raise(Fi.ThisParamMayNotBeOptional,r),r.optional=!0),this.match(14)?r.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(r)&&this.raise(Fi.ThisParamAnnotationRequired,r),this.match(29)&&this.isThisParam(r)&&this.raise(Fi.ThisParamNoDefault,r),this.resetEndLocation(r),r}parseMaybeDefault(r,n){let a=super.parseMaybeDefault(r,n);return a.type==="AssignmentPattern"&&a.typeAnnotation&&a.right.start<a.typeAnnotation.start&&this.raise(Fi.TypeBeforeInitializer,a.typeAnnotation),a}checkImportReflection(r){super.checkImportReflection(r),r.module&&r.importKind!=="value"&&this.raise(Fi.ImportReflectionHasImportType,r.specifiers[0].loc.start)}parseImportSpecifierLocal(r,n,a){n.local=dHe(r)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),r.specifiers.push(this.finishImportSpecifier(n,a))}isPotentialImportPhase(r){if(super.isPotentialImportPhase(r))return!0;if(this.isContextual(130)){if(!r)return!0;let n=this.lookaheadCharCode();return n===123||n===42}return!r&&this.isContextual(87)}applyImportPhase(r,n,a,s){if(super.applyImportPhase(r,n,a,s),n){if(!a&&this.match(65))return;r.exportKind=a==="type"?a:"value"}else a==="type"&&this.match(55)&&this.unexpected(),r.importKind=a==="type"||a==="typeof"?a:"value"}parseImportSpecifier(r,n,a,s,c){let l=r.imported,f=null;l.type==="Identifier"&&(l.name==="type"?f="type":l.name==="typeof"&&(f="typeof"));let d=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let g=this.parseIdentifier(!0);f!==null&&!ix(this.state.type)?(r.imported=g,r.importKind=f,r.local=this.cloneIdentifier(g)):(r.imported=l,r.importKind=null,r.local=this.parseIdentifier())}else{if(f!==null&&ix(this.state.type))r.imported=this.parseIdentifier(!0),r.importKind=f;else{if(n)throw this.raise(ot.ImportBindingIsString,r,{importName:l.value});r.imported=l,r.importKind=null}this.eatContextual(93)?r.local=this.parseIdentifier():(d=!0,r.local=this.cloneIdentifier(r.imported))}let m=dHe(r);return a&&m&&this.raise(Fi.ImportTypeShorthandOnlyInPureImport,r),(a||m)&&this.checkReservedType(r.local.name,r.local.loc.start,!0),d&&!a&&!m&&this.checkReservedWord(r.local.name,r.loc.start,!0,!0),this.finishImportSpecifier(r,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(r,n){let a=r.kind;a!=="get"&&a!=="set"&&this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(r,n)}parseVarId(r,n){super.parseVarId(r,n),this.match(14)&&(r.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(r.id))}parseAsyncArrowFromCallExpression(r,n){if(this.match(14)){let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,r.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=a}return super.parseAsyncArrowFromCallExpression(r,n)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(r,n){var a;let s=null,c;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(s=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(r,n),s),!c.error)return c.node;let{context:d}=this.state,m=d[d.length-1];(m===No.j_oTag||m===No.j_expr)&&d.pop()}if((a=c)!=null&&a.error||this.match(47)){var l,f;s=s||this.state.clone();let d,m=this.tryParse(x=>{var b;d=this.flowParseTypeParameterDeclaration();let A=this.forwardNoArrowParamsConversionAt(d,()=>{let I=super.parseMaybeAssign(r,n);return this.resetStartLocationFromNode(I,d),I});(b=A.extra)!=null&&b.parenthesized&&x();let C=this.maybeUnwrapTypeCastExpression(A);return C.type!=="ArrowFunctionExpression"&&x(),C.typeParameters=d,this.resetStartLocationFromNode(C,d),A},s),g=null;if(m.node&&this.maybeUnwrapTypeCastExpression(m.node).type==="ArrowFunctionExpression"){if(!m.error&&!m.aborted)return m.node.async&&this.raise(Fi.UnexpectedTypeParameterBeforeAsyncArrowFunction,d),m.node;g=m.node}if((l=c)!=null&&l.node)return this.state=c.failState,c.node;if(g)return this.state=m.failState,g;throw(f=c)!=null&&f.thrown?c.error:m.thrown?m.error:this.raise(Fi.UnexpectedTokenAfterTypeParameter,d)}return super.parseMaybeAssign(r,n)}parseArrow(r){if(this.match(14)){let n=this.tryParse(()=>{let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let s=this.startNode();return[s.typeAnnotation,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=a,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),s});if(n.thrown)return null;n.error&&(this.state=n.failState),r.returnType=n.node.typeAnnotation?this.finishNode(n.node,"TypeAnnotation"):null}return super.parseArrow(r)}shouldParseArrow(r){return this.match(14)||super.shouldParseArrow(r)}setArrowFunctionParameters(r,n){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(r.start))?r.params=n:super.setArrowFunctionParameters(r,n)}checkParams(r,n,a,s=!0){if(!(a&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(r.start)))){for(let c=0;c<r.params.length;c++)this.isThisParam(r.params[c])&&c>0&&this.raise(Fi.ThisParamMustBeFirst,r.params[c]);super.checkParams(r,n,a,s)}}parseParenAndDistinguishExpression(r){return super.parseParenAndDistinguishExpression(r&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(r,n,a){if(r.type==="Identifier"&&r.name==="async"&&this.state.noArrowAt.includes(n.index)){this.next();let s=this.startNodeAt(n);s.callee=r,s.arguments=super.parseCallExpressionArguments(),r=this.finishNode(s,"CallExpression")}else if(r.type==="Identifier"&&r.name==="async"&&this.match(47)){let s=this.state.clone(),c=this.tryParse(f=>this.parseAsyncArrowWithTypeParameters(n)||f(),s);if(!c.error&&!c.aborted)return c.node;let l=this.tryParse(()=>super.parseSubscripts(r,n,a),s);if(l.node&&!l.error)return l.node;if(c.node)return this.state=c.failState,c.node;if(l.node)return this.state=l.failState,l.node;throw c.error||l.error}return super.parseSubscripts(r,n,a)}parseSubscript(r,n,a,s){if(this.match(18)&&this.isLookaheadToken_lt()){if(s.optionalChainMember=!0,a)return s.stop=!0,r;this.next();let c=this.startNodeAt(n);return c.callee=r,c.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),c.arguments=this.parseCallExpressionArguments(),c.optional=!0,this.finishCallExpression(c,!0)}else if(!a&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let c=this.startNodeAt(n);c.callee=r;let l=this.tryParse(()=>(c.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),c.arguments=super.parseCallExpressionArguments(),s.optionalChainMember&&(c.optional=!1),this.finishCallExpression(c,s.optionalChainMember)));if(l.node)return l.error&&(this.state=l.failState),l.node}return super.parseSubscript(r,n,a,s)}parseNewCallee(r){super.parseNewCallee(r);let n=null;this.shouldParseTypes()&&this.match(47)&&(n=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),r.typeArguments=n}parseAsyncArrowWithTypeParameters(r){let n=this.startNodeAt(r);if(this.parseFunctionParams(n,!1),!!this.parseArrow(n))return super.parseArrowExpression(n,void 0,!0)}readToken_mult_modulo(r){let n=this.input.charCodeAt(this.state.pos+1);if(r===42&&n===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(r)}readToken_pipe_amp(r){let n=this.input.charCodeAt(this.state.pos+1);if(r===124&&n===125){this.finishOp(9,2);return}super.readToken_pipe_amp(r)}parseTopLevel(r,n){let a=super.parseTopLevel(r,n);return this.state.hasFlowComment&&this.raise(Fi.UnterminatedFlowComment,this.state.curPosition()),a}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Fi.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let r=this.skipFlowComment();r&&(this.state.pos+=r,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:r}=this.state,n=2;for(;[32,9].includes(this.input.charCodeAt(r+n));)n++;let a=this.input.charCodeAt(n+r),s=this.input.charCodeAt(n+r+1);return a===58&&s===58?n+2:this.input.slice(n+r,n+r+12)==="flow-include"?n+12:a===58&&s!==58?n:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(ot.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(r,{enumName:n,memberName:a}){this.raise(Fi.EnumBooleanMemberNotInitialized,r,{memberName:a,enumName:n})}flowEnumErrorInvalidMemberInitializer(r,n){return this.raise(n.explicitType?n.explicitType==="symbol"?Fi.EnumInvalidMemberInitializerSymbolType:Fi.EnumInvalidMemberInitializerPrimaryType:Fi.EnumInvalidMemberInitializerUnknownType,r,n)}flowEnumErrorNumberMemberNotInitialized(r,n){this.raise(Fi.EnumNumberMemberNotInitialized,r,n)}flowEnumErrorStringMemberInconsistentlyInitialized(r,n){this.raise(Fi.EnumStringMemberInconsistentlyInitialized,r,n)}flowEnumMemberInit(){let r=this.state.startLoc,n=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let a=this.parseNumericLiteral(this.state.value);return n()?{type:"number",loc:a.loc.start,value:a}:{type:"invalid",loc:r}}case 134:{let a=this.parseStringLiteral(this.state.value);return n()?{type:"string",loc:a.loc.start,value:a}:{type:"invalid",loc:r}}case 85:case 86:{let a=this.parseBooleanLiteral(this.match(85));return n()?{type:"boolean",loc:a.loc.start,value:a}:{type:"invalid",loc:r}}default:return{type:"invalid",loc:r}}}flowEnumMemberRaw(){let r=this.state.startLoc,n=this.parseIdentifier(!0),a=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:r};return{id:n,init:a}}flowEnumCheckExplicitTypeMismatch(r,n,a){let{explicitType:s}=n;s!==null&&s!==a&&this.flowEnumErrorInvalidMemberInitializer(r,n)}flowEnumMembers({enumName:r,explicitType:n}){let a=new Set,s={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},c=!1;for(;!this.match(8);){if(this.eat(21)){c=!0;break}let l=this.startNode(),{id:f,init:d}=this.flowEnumMemberRaw(),m=f.name;if(m==="")continue;/^[a-z]/.test(m)&&this.raise(Fi.EnumInvalidMemberName,f,{memberName:m,suggestion:m[0].toUpperCase()+m.slice(1),enumName:r}),a.has(m)&&this.raise(Fi.EnumDuplicateMemberName,f,{memberName:m,enumName:r}),a.add(m);let g={enumName:r,explicitType:n,memberName:m};switch(l.id=f,d.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(d.loc,g,"boolean"),l.init=d.value,s.booleanMembers.push(this.finishNode(l,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(d.loc,g,"number"),l.init=d.value,s.numberMembers.push(this.finishNode(l,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(d.loc,g,"string"),l.init=d.value,s.stringMembers.push(this.finishNode(l,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(d.loc,g);case"none":switch(n){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(d.loc,g);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(d.loc,g);break;default:s.defaultedMembers.push(this.finishNode(l,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:s,hasUnknownMembers:c}}flowEnumStringMembers(r,n,{enumName:a}){if(r.length===0)return n;if(n.length===0)return r;if(n.length>r.length){for(let s of r)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:a});return n}else{for(let s of n)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:a});return r}}flowEnumParseExplicitType({enumName:r}){if(!this.eatContextual(102))return null;if(!zo(this.state.type))throw this.raise(Fi.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:r});let{value:n}=this.state;return this.next(),n!=="boolean"&&n!=="number"&&n!=="string"&&n!=="symbol"&&this.raise(Fi.EnumInvalidExplicitType,this.state.startLoc,{enumName:r,invalidEnumType:n}),n}flowEnumBody(r,n){let a=n.name,s=n.loc.start,c=this.flowEnumParseExplicitType({enumName:a});this.expect(5);let{members:l,hasUnknownMembers:f}=this.flowEnumMembers({enumName:a,explicitType:c});switch(r.hasUnknownMembers=f,c){case"boolean":return r.explicitType=!0,r.members=l.booleanMembers,this.expect(8),this.finishNode(r,"EnumBooleanBody");case"number":return r.explicitType=!0,r.members=l.numberMembers,this.expect(8),this.finishNode(r,"EnumNumberBody");case"string":return r.explicitType=!0,r.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(r,"EnumStringBody");case"symbol":return r.members=l.defaultedMembers,this.expect(8),this.finishNode(r,"EnumSymbolBody");default:{let d=()=>(r.members=[],this.expect(8),this.finishNode(r,"EnumStringBody"));r.explicitType=!1;let m=l.booleanMembers.length,g=l.numberMembers.length,x=l.stringMembers.length,b=l.defaultedMembers.length;if(!m&&!g&&!x&&!b)return d();if(!m&&!g)return r.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(r,"EnumStringBody");if(!g&&!x&&m>=b){for(let A of l.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(A.loc.start,{enumName:a,memberName:A.id.name});return r.members=l.booleanMembers,this.expect(8),this.finishNode(r,"EnumBooleanBody")}else if(!m&&!x&&g>=b){for(let A of l.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(A.loc.start,{enumName:a,memberName:A.id.name});return r.members=l.numberMembers,this.expect(8),this.finishNode(r,"EnumNumberBody")}else return this.raise(Fi.EnumInconsistentMemberValues,s,{enumName:a}),d()}}}flowParseEnumDeclaration(r){let n=this.parseIdentifier();return r.id=n,r.body=this.flowEnumBody(this.startNode(),n),this.finishNode(r,"EnumDeclaration")}jsxParseOpeningElementAfterName(r){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(r.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(r)}isLookaheadToken_lt(){let r=this.nextTokenStart();if(this.input.charCodeAt(r)===60){let n=this.input.charCodeAt(r+1);return n!==60&&n!==61}return!1}reScan_lt_gt(){let{type:r}=this.state;r===47?(this.state.pos-=1,this.readToken_lt()):r===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:r}=this.state;return r===51?(this.state.pos-=2,this.finishOp(47,1),47):r}maybeUnwrapTypeCastExpression(r){return r.type==="TypeCastExpression"?r.expression:r}},KPr={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},XPr=/\r\n|[\r\n\u2028\u2029]/,r$=new RegExp(XPr.source,"g");function QN(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function hHe(e,t,r){for(let n=t;n<r;n++)if(QN(e.charCodeAt(n)))return!0;return!1}var Hfe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Vfe=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function ZPr(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var YT=fE`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function p_(e){return e?e.type==="JSXOpeningFragment"||e.type==="JSXClosingFragment":!1}function ON(e){if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return ON(e.object)+"."+ON(e.property);throw new Error("Node had unexpected type: "+e.type)}var eRr=e=>class extends e{jsxReadToken(){let r="",n=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(YT.UnterminatedJsxContent,this.state.startLoc);let a=this.input.charCodeAt(this.state.pos);switch(a){case 60:case 123:if(this.state.pos===this.state.start){a===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(a);return}r+=this.input.slice(n,this.state.pos),this.finishToken(142,r);return;case 38:r+=this.input.slice(n,this.state.pos),r+=this.jsxReadEntity(),n=this.state.pos;break;case 62:case 125:default:QN(a)?(r+=this.input.slice(n,this.state.pos),r+=this.jsxReadNewLine(!0),n=this.state.pos):++this.state.pos}}}jsxReadNewLine(r){let n=this.input.charCodeAt(this.state.pos),a;return++this.state.pos,n===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,a=r?`
264
264
  `:`\r
265
265
  `):a=String.fromCharCode(n),++this.state.curLine,this.state.lineStart=this.state.pos,a}jsxReadString(r){let n="",a=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ot.UnterminatedString,this.state.startLoc);let s=this.input.charCodeAt(this.state.pos);if(s===r)break;s===38?(n+=this.input.slice(a,this.state.pos),n+=this.jsxReadEntity(),a=this.state.pos):QN(s)?(n+=this.input.slice(a,this.state.pos),n+=this.jsxReadNewLine(!1),a=this.state.pos):++this.state.pos}n+=this.input.slice(a,this.state.pos++),this.finishToken(134,n)}jsxReadEntity(){let r=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let n=10;this.codePointAtPos(this.state.pos)===120&&(n=16,++this.state.pos);let a=this.readInt(n,void 0,!1,"bail");if(a!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(a)}else{let n=0,a=!1;for(;n++<10&&this.state.pos<this.length&&!(a=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(a){let s=this.input.slice(r,this.state.pos),c=KPr[s];if(++this.state.pos,c)return c}}return this.state.pos=r,"&"}jsxReadWord(){let r,n=this.state.pos;do r=this.input.charCodeAt(++this.state.pos);while(KT(r)||r===45);this.finishToken(141,this.input.slice(n,this.state.pos))}jsxParseIdentifier(){let r=this.startNode();return this.match(141)?r.name=this.state.value:Ede(this.state.type)?r.name=d_(this.state.type):this.unexpected(),this.next(),this.finishNode(r,"JSXIdentifier")}jsxParseNamespacedName(){let r=this.state.startLoc,n=this.jsxParseIdentifier();if(!this.eat(14))return n;let a=this.startNodeAt(r);return a.namespace=n,a.name=this.jsxParseIdentifier(),this.finishNode(a,"JSXNamespacedName")}jsxParseElementName(){let r=this.state.startLoc,n=this.jsxParseNamespacedName();if(n.type==="JSXNamespacedName")return n;for(;this.eat(16);){let a=this.startNodeAt(r);a.object=n,a.property=this.jsxParseIdentifier(),n=this.finishNode(a,"JSXMemberExpression")}return n}jsxParseAttributeValue(){let r;switch(this.state.type){case 5:return r=this.startNode(),this.setContext(No.brace),this.next(),r=this.jsxParseExpressionContainer(r,No.j_oTag),r.expression.type==="JSXEmptyExpression"&&this.raise(YT.AttributeIsEmpty,r),r;case 143:case 134:return this.parseExprAtom();default:throw this.raise(YT.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let r=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(r,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(r){return this.next(),r.expression=this.parseExpression(),this.setContext(No.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(r,"JSXSpreadChild")}jsxParseExpressionContainer(r,n){if(this.match(8))r.expression=this.jsxParseEmptyExpression();else{let a=this.parseExpression();r.expression=a}return this.setContext(n),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(r,"JSXExpressionContainer")}jsxParseAttribute(){let r=this.startNode();return this.match(5)?(this.setContext(No.brace),this.next(),this.expect(21),r.argument=this.parseMaybeAssignAllowIn(),this.setContext(No.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(r,"JSXSpreadAttribute")):(r.name=this.jsxParseNamespacedName(),r.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(r,"JSXAttribute"))}jsxParseOpeningElementAt(r){let n=this.startNodeAt(r);return this.eat(144)?this.finishNode(n,"JSXOpeningFragment"):(n.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(n))}jsxParseOpeningElementAfterName(r){let n=[];for(;!this.match(56)&&!this.match(144);)n.push(this.jsxParseAttribute());return r.attributes=n,r.selfClosing=this.eat(56),this.expect(144),this.finishNode(r,"JSXOpeningElement")}jsxParseClosingElementAt(r){let n=this.startNodeAt(r);return this.eat(144)?this.finishNode(n,"JSXClosingFragment"):(n.name=this.jsxParseElementName(),this.expect(144),this.finishNode(n,"JSXClosingElement"))}jsxParseElementAt(r){let n=this.startNodeAt(r),a=[],s=this.jsxParseOpeningElementAt(r),c=null;if(!s.selfClosing){e:for(;;)switch(this.state.type){case 143:if(r=this.state.startLoc,this.next(),this.eat(56)){c=this.jsxParseClosingElementAt(r);break e}a.push(this.jsxParseElementAt(r));break;case 142:a.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let l=this.startNode();this.setContext(No.brace),this.next(),this.match(21)?a.push(this.jsxParseSpreadChild(l)):a.push(this.jsxParseExpressionContainer(l,No.j_expr));break}default:this.unexpected()}p_(s)&&!p_(c)&&c!==null?this.raise(YT.MissingClosingTagFragment,c):!p_(s)&&p_(c)?this.raise(YT.MissingClosingTagElement,c,{openingTagName:ON(s.name)}):!p_(s)&&!p_(c)&&ON(c.name)!==ON(s.name)&&this.raise(YT.MissingClosingTagElement,c,{openingTagName:ON(s.name)})}if(p_(s)?(n.openingFragment=s,n.closingFragment=c):(n.openingElement=s,n.closingElement=c),n.children=a,this.match(47))throw this.raise(YT.UnwrappedAdjacentJSXElements,this.state.startLoc);return p_(s)?this.finishNode(n,"JSXFragment"):this.finishNode(n,"JSXElement")}jsxParseElement(){let r=this.state.startLoc;return this.next(),this.jsxParseElementAt(r)}setContext(r){let{context:n}=this.state;n[n.length-1]=r}parseExprAtom(r){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(r)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(r){let n=this.curContext();if(n===No.j_expr){this.jsxReadToken();return}if(n===No.j_oTag||n===No.j_cTag){if(dE(r)){this.jsxReadWord();return}if(r===62){++this.state.pos,this.finishToken(144);return}if((r===34||r===39)&&n===No.j_oTag){this.jsxReadString(r);return}}if(r===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(r)}updateContext(r){let{context:n,type:a}=this.state;if(a===56&&r===143)n.splice(-2,2,No.j_cTag),this.state.canStartJSXElement=!1;else if(a===143)n.push(No.j_oTag);else if(a===144){let s=n[n.length-1];s===No.j_oTag&&r===56||s===No.j_cTag?(n.pop(),this.state.canStartJSXElement=n[n.length-1]===No.j_expr):(this.setContext(No.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=_Pr(a)}},Xfe=class extends AM{constructor(...t){super(...t),this.tsNames=new Map}},Zfe=class extends yM{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new Xfe(t)}enter(t){t===1024&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t===1024&&this.importsStack.pop(),t}hasImport(t,r){let n=this.importsStack.length;if(this.importsStack[n-1].has(t))return!0;if(!r&&n>1){for(let a=0;a<n-1;a++)if(this.importsStack[a].has(t))return!0}return!1}declareName(t,r,n){if(r&4096){this.hasImport(t,!0)&&this.parser.raise(ot.VarRedeclaration,n,{identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let a=this.currentScope(),s=a.tsNames.get(t)||0;if(r&1024){this.maybeExportDefined(a,t),a.tsNames.set(t,s|16);return}super.declareName(t,r,n),r&2&&(r&1||(this.checkRedeclarationInScope(a,t,r,n),this.maybeExportDefined(a,t)),s=s|1),r&256&&(s=s|2),r&512&&(s=s|4),r&128&&(s=s|8),s&&a.tsNames.set(t,s)}isRedeclaredInScope(t,r,n){let a=t.tsNames.get(r);if((a&2)>0){if(n&256){let s=!!(n&512),c=(a&4)>0;return s!==c}return!0}return n&128&&(a&8)>0?t.names.get(r)&2?!!(n&1):!1:n&2&&(a&1)>0?!0:super.isRedeclaredInScope(t,r,n)}checkLocalExport(t){let{name:r}=t;if(this.hasImport(r))return;let n=this.scopeStack.length;for(let a=n-1;a>=0;a--){let c=this.scopeStack[a].tsNames.get(r);if((c&1)>0||(c&16)>0)return}super.checkLocalExport(t)}},ede=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function a$(e,t){return(e?2:0)|(t?1:0)}var tde=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[r,n]=t;if(!this.hasPlugin(r))return!1;let a=this.plugins.get(r);for(let s of Object.keys(n))if((a==null?void 0:a[s])!==n[s])return!1;return!0}}getPluginOption(t,r){var n;return(n=this.plugins.get(t))==null?void 0:n[r]}};function BHe(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function tRr(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function vM(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function f_(e,t,r){let n=null,a=t.length;for(;n===null&&a>0;)n=t[--a];n===null||n.start>r.start?vM(e,r.comments):BHe(n,r.comments)}var rde=class extends tde{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:r}=this.state;this.comments.length!==r&&(this.comments.length=r),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:r}=this.state,n=r.length;if(n===0)return;let a=n-1,s=r[a];s.start===t.end&&(s.leadingNode=t,a--);let{start:c}=t;for(;a>=0;a--){let l=r[a],f=l.end;if(f>c)l.containingNode=t,this.finalizeComment(l),r.splice(a,1);else{f===c&&(l.trailingNode=t);break}}}finalizeComment(t){var r;let{comments:n}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&BHe(t.leadingNode,n),t.trailingNode!==null&&tRr(t.trailingNode,n);else{let a=t.containingNode,s=t.start;if(this.input.charCodeAt(this.offsetToSourcePos(s)-1)===44)switch(a.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":f_(a,a.properties,t);break;case"CallExpression":case"OptionalCallExpression":f_(a,a.arguments,t);break;case"ImportExpression":f_(a,[a.source,(r=a.options)!=null?r:null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":f_(a,a.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":f_(a,a.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":f_(a,a.specifiers,t);break;case"TSEnumDeclaration":f_(a,a.members,t);break;case"TSEnumBody":f_(a,a.members,t);break;default:vM(a,n)}else vM(a,n)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let r=t.length-1;r>=0;r--)this.finalizeComment(t[r]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:r}=this.state,{length:n}=r;if(n===0)return;let a=r[n-1];a.leadingNode===t&&(a.leadingNode=null)}takeSurroundingComments(t,r,n){let{commentStack:a}=this.state,s=a.length;if(s===0)return;let c=s-1;for(;c>=0;c--){let l=a[c],f=l.end;if(l.start===n)l.leadingNode=t;else if(f===r)l.trailingNode=t;else if(f<r)break}}},nde=class e{constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[No.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:r,startIndex:n,startLine:a,startColumn:s}){this.strict=t===!1?!1:t===!0?!0:r==="module",this.startIndex=n,this.curLine=a,this.lineStart=-s,this.startLoc=this.endLoc=new hE(a,s,n)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new hE(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},rRr=function(t){return t>=48&&t<=57},mHe={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},n$={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function gHe(e,t,r,n,a,s){let c=r,l=n,f=a,d="",m=null,g=r,{length:x}=t;for(;;){if(r>=x){s.unterminated(c,l,f),d+=t.slice(g,r);break}let b=t.charCodeAt(r);if(nRr(e,b,t,r)){d+=t.slice(g,r);break}if(b===92){d+=t.slice(g,r);let A=iRr(t,r,n,a,e==="template",s);A.ch===null&&!m?m={pos:r,lineStart:n,curLine:a}:d+=A.ch,{pos:r,lineStart:n,curLine:a}=A,g=r}else b===8232||b===8233?(++r,++a,n=r):b===10||b===13?e==="template"?(d+=t.slice(g,r)+`
266
266
  `,++r,b===13&&t.charCodeAt(r)===10&&++r,++a,g=n=r):s.unterminated(c,l,f):++r}return{pos:r,str:d,firstInvalidLoc:m,lineStart:n,curLine:a,containsInvalid:!!m}}function nRr(e,t,r,n){return e==="template"?t===96||t===36&&r.charCodeAt(n+1)===123:t===(e==="double"?34:39)}function iRr(e,t,r,n,a,s){let c=!a;t++;let l=d=>({pos:t,ch:d,lineStart:r,curLine:n}),f=e.charCodeAt(t++);switch(f){case 110:return l(`
@@ -444,7 +444,7 @@ ${d.toString(16)}\r
444
444
  ${n.count} ${n.noun} ${n.is} pending:
445
445
 
446
446
  ${t.format(r)}
447
- `.trim())}};wyt.exports=owe});var Byt=P((Wvi,Tyt)=>{"use strict";var{kProxy:YAn,kClose:JAn,kDestroy:KAn,kInterceptors:XAn}=gu(),{URL:Cyt}=require("url"),_yt=_q(),ZAn=f4(),eyn=dq(),{InvalidArgumentError:Dq,RequestAbortedError:tyn}=jc(),Iyt=hq(),Tq=Symbol("proxy agent"),YK=Symbol("proxy client"),Bq=Symbol("proxy headers"),cwe=Symbol("request tls settings"),ryn=Symbol("proxy tls settings"),kyt=Symbol("connect endpoint function");function nyn(e){return e==="https:"?443:80}function iyn(e){if(typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new Dq("Proxy opts.uri is mandatory");return{uri:e.uri,protocol:e.protocol||"https"}}function syn(e,t){return new ZAn(e,t)}var uwe=class extends eyn{constructor(t){if(super(t),this[YAn]=iyn(t),this[Tq]=new _yt(t),this[XAn]=t.interceptors&&t.interceptors.ProxyAgent&&Array.isArray(t.interceptors.ProxyAgent)?t.interceptors.ProxyAgent:[],typeof t=="string"&&(t={uri:t}),!t||!t.uri)throw new Dq("Proxy opts.uri is mandatory");let{clientFactory:r=syn}=t;if(typeof r!="function")throw new Dq("Proxy opts.clientFactory must be a function.");this[cwe]=t.requestTls,this[ryn]=t.proxyTls,this[Bq]=t.headers||{};let n=new Cyt(t.uri),{origin:a,port:s,host:c,username:l,password:f}=n;if(t.auth&&t.token)throw new Dq("opts.auth cannot be used in combination with opts.token");t.auth?this[Bq]["proxy-authorization"]=`Basic ${t.auth}`:t.token?this[Bq]["proxy-authorization"]=t.token:l&&f&&(this[Bq]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(l)}:${decodeURIComponent(f)}`).toString("base64")}`);let d=Iyt({...t.proxyTls});this[kyt]=Iyt({...t.requestTls}),this[YK]=r(n,{connect:d}),this[Tq]=new _yt({...t,connect:async(m,g)=>{let x=m.host;m.port||(x+=`:${nyn(m.protocol)}`);try{let{socket:b,statusCode:A}=await this[YK].connect({origin:a,port:s,path:x,signal:m.signal,headers:{...this[Bq],host:c}});if(A!==200&&(b.on("error",()=>{}).destroy(),g(new tyn(`Proxy response (${A}) !== 200 when HTTP Tunneling`))),m.protocol!=="https:"){g(null,b);return}let C;this[cwe]?C=this[cwe].servername:C=m.servername,this[kyt]({...m,servername:C,httpSocket:b},g)}catch(b){g(b)}}})}dispatch(t,r){let{host:n}=new Cyt(t.origin),a=ayn(t.headers);return oyn(a),this[Tq].dispatch({...t,headers:{...a,host:n}},r)}async[JAn](){await this[Tq].close(),await this[YK].close()}async[KAn](){await this[Tq].destroy(),await this[YK].destroy()}};function ayn(e){if(Array.isArray(e)){let t={};for(let r=0;r<e.length;r+=2)t[e[r]]=e[r+1];return t}return e}function oyn(e){if(e&&Object.keys(e).find(r=>r.toLowerCase()==="proxy-authorization"))throw new Dq("Proxy-Authorization should be sent in ProxyAgent constructor")}Tyt.exports=uwe});var Fyt=P((Gvi,Nyt)=>{var yD=require("assert"),{kRetryHandlerDefaultRetry:Dyt}=gu(),{RequestRetryError:JK}=jc(),{isDisturbed:Pyt,parseHeaders:cyn,parseRangeHeader:Ryt}=mo();function uyn(e){let t=Date.now();return new Date(e).getTime()-t}var lwe=class e{constructor(t,r){let{retryOptions:n,...a}=t,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:f,timeoutFactor:d,methods:m,errorCodes:g,retryAfter:x,statusCodes:b}=n!=null?n:{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts=a,this.abort=null,this.aborted=!1,this.retryOpts={retry:s!=null?s:e[Dyt],retryAfter:x!=null?x:!0,maxTimeout:l!=null?l:30*1e3,timeout:f!=null?f:500,timeoutFactor:d!=null?d:2,maxRetries:c!=null?c:5,methods:m!=null?m:["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:b!=null?b:[500,502,503,504,429],errorCodes:g!=null?g:["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(t,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(t,r,n)}onConnect(t){this.aborted?t(this.reason):this.abort=t}onBodySent(t){if(this.handler.onBodySent)return this.handler.onBodySent(t)}static[Dyt](t,{state:r,opts:n},a){let{statusCode:s,code:c,headers:l}=t,{method:f,retryOptions:d}=n,{maxRetries:m,timeout:g,maxTimeout:x,timeoutFactor:b,statusCodes:A,errorCodes:C,methods:I}=d,{counter:k,currentTimeout:O}=r;if(O=O!=null&&O>0?O:g,c&&c!=="UND_ERR_REQ_RETRY"&&c!=="UND_ERR_SOCKET"&&!C.includes(c)){a(t);return}if(Array.isArray(I)&&!I.includes(f)){a(t);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){a(t);return}if(k>m){a(t);return}let j=l!=null&&l["retry-after"];j&&(j=Number(j),j=isNaN(j)?uyn(j):j*1e3);let M=j>0?Math.min(j,x):Math.min(O*b**k,x);r.currentTimeout=M,setTimeout(()=>a(null),M)}onHeaders(t,r,n,a){let s=cyn(r);if(this.retryCount+=1,t>=300)return this.abort(new JK("Request failed",t,{headers:s,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,t!==206)return!0;let l=Ryt(s["content-range"]);if(!l)return this.abort(new JK("Content-Range mismatch",t,{headers:s,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new JK("ETag mismatch",t,{headers:s,count:this.retryCount})),!1;let{start:f,size:d,end:m=d}=l;return yD(this.start===f,"content-range mismatch"),yD(this.end==null||this.end===m,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(t===206){let l=Ryt(s["content-range"]);if(l==null)return this.handler.onHeaders(t,r,n,a);let{start:f,size:d,end:m=d}=l;yD(f!=null&&Number.isFinite(f)&&this.start!==f,"content-range mismatch"),yD(Number.isFinite(f)),yD(m!=null&&Number.isFinite(m)&&this.end!==m,"invalid content-length"),this.start=f,this.end=m}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l):null}return yD(Number.isFinite(this.start)),yD(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.handler.onHeaders(t,r,n,a)}let c=new JK("Request failed",t,{headers:s,count:this.retryCount});return this.abort(c),!1}onData(t){return this.start+=t.length,this.handler.onData(t)}onComplete(t){return this.retryCount=0,this.handler.onComplete(t)}onError(t){if(this.aborted||Pyt(this.opts.body))return this.handler.onError(t);this.retryOpts.retry(t,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){var a;if(n!=null||this.aborted||Pyt(this.opts.body))return this.handler.onError(n);this.start!==0&&(this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${(a=this.end)!=null?a:""}`}});try{this.dispatch(this.opts,this)}catch(s){this.handler.onError(s)}}}};Nyt.exports=lwe});var b4=P((Yvi,jyt)=>{"use strict";var Oyt=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:lyn}=jc(),pyn=_q();Lyt()===void 0&&Qyt(new pyn);function Qyt(e){if(!e||typeof e.dispatch!="function")throw new lyn("Argument agent must implement Agent");Object.defineProperty(globalThis,Oyt,{value:e,writable:!0,enumerable:!1,configurable:!1})}function Lyt(){return globalThis[Oyt]}jyt.exports={setGlobalDispatcher:Qyt,getGlobalDispatcher:Lyt}});var qyt=P((Kvi,Myt)=>{"use strict";Myt.exports=class{constructor(t){this.handler=t}onConnect(...t){return this.handler.onConnect(...t)}onError(...t){return this.handler.onError(...t)}onUpgrade(...t){return this.handler.onUpgrade(...t)}onHeaders(...t){return this.handler.onHeaders(...t)}onData(...t){return this.handler.onData(...t)}onComplete(...t){return this.handler.onComplete(...t)}onBodySent(...t){return this.handler.onBodySent(...t)}}});var vD=P((Xvi,$yt)=>{"use strict";var{kHeadersList:ng,kConstruct:fyn}=gu(),{kGuard:c1}=sS(),{kEnumerableProperty:o1}=mo(),{makeIterator:E4,isValidHeaderName:Pq,isValidHeaderValue:zyt}=Vy(),dyn=require("util"),{webidl:ha}=Pm(),hyn=require("assert"),rg=Symbol("headers map"),Pd=Symbol("headers map sorted");function Uyt(e){return e===10||e===13||e===9||e===32}function Hyt(e){let t=0,r=e.length;for(;r>t&&Uyt(e.charCodeAt(r-1));)--r;for(;r>t&&Uyt(e.charCodeAt(t));)++t;return t===0&&r===e.length?e:e.substring(t,r)}function Vyt(e,t){if(Array.isArray(t))for(let r=0;r<t.length;++r){let n=t[r];if(n.length!==2)throw ha.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${n.length}.`});pwe(e,n[0],n[1])}else if(typeof t=="object"&&t!==null){let r=Object.keys(t);for(let n=0;n<r.length;++n)pwe(e,r[n],t[r[n]])}else throw ha.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function pwe(e,t,r){if(r=Hyt(r),Pq(t)){if(!zyt(r))throw ha.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ha.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(e[c1]==="immutable")throw new TypeError("immutable");return e[c1],e[ng].append(t,r)}var KK=class e{cookies=null;constructor(t){t instanceof e?(this[rg]=new Map(t[rg]),this[Pd]=t[Pd],this.cookies=t.cookies===null?null:[...t.cookies]):(this[rg]=new Map(t),this[Pd]=null)}contains(t){return t=t.toLowerCase(),this[rg].has(t)}clear(){this[rg].clear(),this[Pd]=null,this.cookies=null}append(t,r){var s;this[Pd]=null;let n=t.toLowerCase(),a=this[rg].get(n);if(a){let c=n==="cookie"?"; ":", ";this[rg].set(n,{name:a.name,value:`${a.value}${c}${r}`})}else this[rg].set(n,{name:t,value:r});n==="set-cookie"&&((s=this.cookies)!=null||(this.cookies=[]),this.cookies.push(r))}set(t,r){this[Pd]=null;let n=t.toLowerCase();n==="set-cookie"&&(this.cookies=[r]),this[rg].set(n,{name:t,value:r})}delete(t){this[Pd]=null,t=t.toLowerCase(),t==="set-cookie"&&(this.cookies=null),this[rg].delete(t)}get(t){let r=this[rg].get(t.toLowerCase());return r===void 0?null:r.value}*[Symbol.iterator](){for(let[t,{value:r}]of this[rg])yield[t,r]}get entries(){let t={};if(this[rg].size)for(let{name:r,value:n}of this[rg].values())t[r]=n;return t}},w4=class e{constructor(t=void 0){t!==fyn&&(this[ng]=new KK,this[c1]="none",t!==void 0&&(t=ha.converters.HeadersInit(t),Vyt(this,t)))}append(t,r){return ha.brandCheck(this,e),ha.argumentLengthCheck(arguments,2,{header:"Headers.append"}),t=ha.converters.ByteString(t),r=ha.converters.ByteString(r),pwe(this,t,r)}delete(t){if(ha.brandCheck(this,e),ha.argumentLengthCheck(arguments,1,{header:"Headers.delete"}),t=ha.converters.ByteString(t),!Pq(t))throw ha.errors.invalidArgument({prefix:"Headers.delete",value:t,type:"header name"});if(this[c1]==="immutable")throw new TypeError("immutable");this[c1],this[ng].contains(t)&&this[ng].delete(t)}get(t){if(ha.brandCheck(this,e),ha.argumentLengthCheck(arguments,1,{header:"Headers.get"}),t=ha.converters.ByteString(t),!Pq(t))throw ha.errors.invalidArgument({prefix:"Headers.get",value:t,type:"header name"});return this[ng].get(t)}has(t){if(ha.brandCheck(this,e),ha.argumentLengthCheck(arguments,1,{header:"Headers.has"}),t=ha.converters.ByteString(t),!Pq(t))throw ha.errors.invalidArgument({prefix:"Headers.has",value:t,type:"header name"});return this[ng].contains(t)}set(t,r){if(ha.brandCheck(this,e),ha.argumentLengthCheck(arguments,2,{header:"Headers.set"}),t=ha.converters.ByteString(t),r=ha.converters.ByteString(r),r=Hyt(r),Pq(t)){if(!zyt(r))throw ha.errors.invalidArgument({prefix:"Headers.set",value:r,type:"header value"})}else throw ha.errors.invalidArgument({prefix:"Headers.set",value:t,type:"header name"});if(this[c1]==="immutable")throw new TypeError("immutable");this[c1],this[ng].set(t,r)}getSetCookie(){ha.brandCheck(this,e);let t=this[ng].cookies;return t?[...t]:[]}get[Pd](){if(this[ng][Pd])return this[ng][Pd];let t=[],r=[...this[ng]].sort((a,s)=>a[0]<s[0]?-1:1),n=this[ng].cookies;for(let a=0;a<r.length;++a){let[s,c]=r[a];if(s==="set-cookie")for(let l=0;l<n.length;++l)t.push([s,n[l]]);else hyn(c!==null),t.push([s,c])}return this[ng][Pd]=t,t}keys(){if(ha.brandCheck(this,e),this[c1]==="immutable"){let t=this[Pd];return E4(()=>t,"Headers","key")}return E4(()=>[...this[Pd].values()],"Headers","key")}values(){if(ha.brandCheck(this,e),this[c1]==="immutable"){let t=this[Pd];return E4(()=>t,"Headers","value")}return E4(()=>[...this[Pd].values()],"Headers","value")}entries(){if(ha.brandCheck(this,e),this[c1]==="immutable"){let t=this[Pd];return E4(()=>t,"Headers","key+value")}return E4(()=>[...this[Pd].values()],"Headers","key+value")}forEach(t,r=globalThis){if(ha.brandCheck(this,e),ha.argumentLengthCheck(arguments,1,{header:"Headers.forEach"}),typeof t!="function")throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(let[n,a]of this)t.apply(r,[a,n,this])}[Symbol.for("nodejs.util.inspect.custom")](){return ha.brandCheck(this,e),this[ng]}};w4.prototype[Symbol.iterator]=w4.prototype.entries;Object.defineProperties(w4.prototype,{append:o1,delete:o1,get:o1,has:o1,set:o1,getSetCookie:o1,keys:o1,values:o1,entries:o1,forEach:o1,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:"Headers",configurable:!0},[dyn.inspect.custom]:{enumerable:!1}});ha.converters.HeadersInit=function(e){if(ha.util.Type(e)==="Object")return e[Symbol.iterator]?ha.converters["sequence<sequence<ByteString>>"](e):ha.converters["record<ByteString, ByteString>"](e);throw ha.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})};$yt.exports={fill:Vyt,Headers:w4,HeadersList:KK}});var tX=P((Zvi,evt)=>{"use strict";var{Headers:myn,HeadersList:Wyt,fill:gyn}=vD(),{extractBody:Gyt,cloneBody:Ayn,mixinBody:yyn}=lq(),hwe=mo(),{kEnumerableProperty:oA}=hwe,{isValidReasonPhrase:vyn,isCancelled:xyn,isAborted:byn,isBlobLike:Eyn,serializeJavascriptValueToJSONString:wyn,isErrorLike:Syn,isomorphicEncode:Cyn}=Vy(),{redirectStatusSet:_yn,nullBodyStatus:Iyn,DOMException:Yyt}=pI(),{kState:zu,kHeaders:Vf,kGuard:S4,kRealm:aA}=sS(),{webidl:na}=Pm(),{FormData:kyn}=lK(),{getGlobalOrigin:Tyn}=ZO(),{URLSerializer:Jyt}=jx(),{kHeadersList:fwe,kConstruct:Byn}=gu(),mwe=require("assert"),{types:dwe}=require("util"),Xyt=globalThis.ReadableStream||require("stream/web").ReadableStream,Dyn=new TextEncoder("utf-8"),C4=class e{static error(){let t={settingsObject:{}},r=new e;return r[zu]=ZK(),r[aA]=t,r[Vf][fwe]=r[zu].headersList,r[Vf][S4]="immutable",r[Vf][aA]=t,r}static json(t,r={}){na.argumentLengthCheck(arguments,1,{header:"Response.json"}),r!==null&&(r=na.converters.ResponseInit(r));let n=Dyn.encode(wyn(t)),a=Gyt(n),s={settingsObject:{}},c=new e;return c[aA]=s,c[Vf][S4]="response",c[Vf][aA]=s,Kyt(c,r,{body:a[0],type:"application/json"}),c}static redirect(t,r=302){let n={settingsObject:{}};na.argumentLengthCheck(arguments,1,{header:"Response.redirect"}),t=na.converters.USVString(t),r=na.converters["unsigned short"](r);let a;try{a=new URL(t,Tyn())}catch(l){throw Object.assign(new TypeError("Failed to parse URL from "+t),{cause:l})}if(!_yn.has(r))throw new RangeError("Invalid status code "+r);let s=new e;s[aA]=n,s[Vf][S4]="immutable",s[Vf][aA]=n,s[zu].status=r;let c=Cyn(Jyt(a));return s[zu].headersList.append("location",c),s}constructor(t=null,r={}){t!==null&&(t=na.converters.BodyInit(t)),r=na.converters.ResponseInit(r),this[aA]={settingsObject:{}},this[zu]=eX({}),this[Vf]=new myn(Byn),this[Vf][S4]="response",this[Vf][fwe]=this[zu].headersList,this[Vf][aA]=this[aA];let n=null;if(t!=null){let[a,s]=Gyt(t);n={body:a,type:s}}Kyt(this,r,n)}get type(){return na.brandCheck(this,e),this[zu].type}get url(){var n;na.brandCheck(this,e);let t=this[zu].urlList,r=(n=t[t.length-1])!=null?n:null;return r===null?"":Jyt(r,!0)}get redirected(){return na.brandCheck(this,e),this[zu].urlList.length>1}get status(){return na.brandCheck(this,e),this[zu].status}get ok(){return na.brandCheck(this,e),this[zu].status>=200&&this[zu].status<=299}get statusText(){return na.brandCheck(this,e),this[zu].statusText}get headers(){return na.brandCheck(this,e),this[Vf]}get body(){return na.brandCheck(this,e),this[zu].body?this[zu].body.stream:null}get bodyUsed(){return na.brandCheck(this,e),!!this[zu].body&&hwe.isDisturbed(this[zu].body.stream)}clone(){if(na.brandCheck(this,e),this.bodyUsed||this.body&&this.body.locked)throw na.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let t=gwe(this[zu]),r=new e;return r[zu]=t,r[aA]=this[aA],r[Vf][fwe]=t.headersList,r[Vf][S4]=this[Vf][S4],r[Vf][aA]=this[Vf][aA],r}};yyn(C4);Object.defineProperties(C4.prototype,{type:oA,url:oA,status:oA,ok:oA,redirected:oA,statusText:oA,headers:oA,clone:oA,body:oA,bodyUsed:oA,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(C4,{json:oA,redirect:oA,error:oA});function gwe(e){if(e.internalResponse)return Zyt(gwe(e.internalResponse),e.type);let t=eX({...e,body:null});return e.body!=null&&(t.body=Ayn(e.body)),t}function eX(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e.headersList?new Wyt(e.headersList):new Wyt,urlList:e.urlList?[...e.urlList]:[]}}function ZK(e){let t=Syn(e);return eX({type:"error",status:0,error:t?e:new Error(e&&String(e)),aborted:e&&e.name==="AbortError"})}function XK(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(r,n){return n in t?t[n]:r[n]},set(r,n,a){return mwe(!(n in t)),r[n]=a,!0}})}function Zyt(e,t){if(t==="basic")return XK(e,{type:"basic",headersList:e.headersList});if(t==="cors")return XK(e,{type:"cors",headersList:e.headersList});if(t==="opaque")return XK(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(t==="opaqueredirect")return XK(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});mwe(!1)}function Pyn(e,t=null){return mwe(xyn(e)),byn(e)?ZK(Object.assign(new Yyt("The operation was aborted.","AbortError"),{cause:t})):ZK(Object.assign(new Yyt("Request was cancelled."),{cause:t}))}function Kyt(e,t,r){if(t.status!==null&&(t.status<200||t.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in t&&t.statusText!=null&&!vyn(String(t.statusText)))throw new TypeError("Invalid statusText");if("status"in t&&t.status!=null&&(e[zu].status=t.status),"statusText"in t&&t.statusText!=null&&(e[zu].statusText=t.statusText),"headers"in t&&t.headers!=null&&gyn(e[Vf],t.headers),r){if(Iyn.includes(e.status))throw na.errors.exception({header:"Response constructor",message:"Invalid response status code "+e.status});e[zu].body=r.body,r.type!=null&&!e[zu].headersList.contains("Content-Type")&&e[zu].headersList.append("content-type",r.type)}}na.converters.ReadableStream=na.interfaceConverter(Xyt);na.converters.FormData=na.interfaceConverter(kyn);na.converters.URLSearchParams=na.interfaceConverter(URLSearchParams);na.converters.XMLHttpRequestBodyInit=function(e){return typeof e=="string"?na.converters.USVString(e):Eyn(e)?na.converters.Blob(e,{strict:!1}):dwe.isArrayBuffer(e)||dwe.isTypedArray(e)||dwe.isDataView(e)?na.converters.BufferSource(e):hwe.isFormDataLike(e)?na.converters.FormData(e,{strict:!1}):e instanceof URLSearchParams?na.converters.URLSearchParams(e):na.converters.DOMString(e)};na.converters.BodyInit=function(e){return e instanceof Xyt?na.converters.ReadableStream(e):e!=null&&e[Symbol.asyncIterator]?e:na.converters.XMLHttpRequestBodyInit(e)};na.converters.ResponseInit=na.dictionaryConverter([{key:"status",converter:na.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:na.converters.ByteString,defaultValue:""},{key:"headers",converter:na.converters.HeadersInit}]);evt.exports={makeNetworkError:ZK,makeResponse:eX,makeAppropriateNetworkError:Pyn,filterResponse:Zyt,Response:C4,cloneResponse:gwe}});var Fq=P((exi,avt)=>{"use strict";var{extractBody:Ryn,mixinBody:Nyn,cloneBody:Fyn}=lq(),{Headers:tvt,fill:Oyn,HeadersList:sX}=vD(),{FinalizationRegistry:Qyn}=_1e()(),Nq=mo(),{isValidHTTPToken:Lyn,sameOrigin:rvt,normalizeMethod:jyn,makePolicyContainer:Myn,normalizeMethodRecord:qyn}=Vy(),{forbiddenMethodsSet:Uyn,corsSafeListedMethodsSet:zyn,referrerPolicy:Hyn,requestRedirect:Vyn,requestMode:$yn,requestCredentials:Wyn,requestCache:Gyn,requestDuplex:Yyn}=pI(),{kEnumerableProperty:Bp}=Nq,{kHeaders:Th,kSignal:Rq,kState:vu,kGuard:rX,kRealm:cA}=sS(),{webidl:fs}=Pm(),{getGlobalOrigin:Jyn}=ZO(),{URLSerializer:Kyn}=jx(),{kHeadersList:nX,kConstruct:iX}=gu(),Xyn=require("assert"),{getMaxListeners:nvt,setMaxListeners:ivt,getEventListeners:Zyn,defaultMaxListeners:svt}=require("events"),Awe=globalThis.TransformStream,evn=Symbol("abortController"),tvn=new Qyn(({signal:e,abort:t})=>{e.removeEventListener("abort",t)}),xD=class e{constructor(t,r={}){var I,k,O;if(t===iX)return;fs.argumentLengthCheck(arguments,1,{header:"Request constructor"}),t=fs.converters.RequestInfo(t),r=fs.converters.RequestInit(r),this[cA]={settingsObject:{baseUrl:Jyn(),get origin(){var j;return(j=this.baseUrl)==null?void 0:j.origin},policyContainer:Myn()}};let n=null,a=null,s=this[cA].settingsObject.baseUrl,c=null;if(typeof t=="string"){let j;try{j=new URL(t,s)}catch(M){throw new TypeError("Failed to parse URL from "+t,{cause:M})}if(j.username||j.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+t);n=aX({urlList:[j]}),a="cors"}else Xyn(t instanceof e),n=t[vu],c=t[Rq];let l=this[cA].settingsObject.origin,f="client";if(((k=(I=n.window)==null?void 0:I.constructor)==null?void 0:k.name)==="EnvironmentSettingsObject"&&rvt(n.window,l)&&(f=n.window),r.window!=null)throw new TypeError(`'window' option '${f}' must be null`);"window"in r&&(f="no-window"),n=aX({method:n.method,headersList:n.headersList,unsafeRequest:n.unsafeRequest,client:this[cA].settingsObject,window:f,priority:n.priority,origin:n.origin,referrer:n.referrer,referrerPolicy:n.referrerPolicy,mode:n.mode,credentials:n.credentials,cache:n.cache,redirect:n.redirect,integrity:n.integrity,keepalive:n.keepalive,reloadNavigation:n.reloadNavigation,historyNavigation:n.historyNavigation,urlList:[...n.urlList]});let d=Object.keys(r).length!==0;if(d&&(n.mode==="navigate"&&(n.mode="same-origin"),n.reloadNavigation=!1,n.historyNavigation=!1,n.origin="client",n.referrer="client",n.referrerPolicy="",n.url=n.urlList[n.urlList.length-1],n.urlList=[n.url]),r.referrer!==void 0){let j=r.referrer;if(j==="")n.referrer="no-referrer";else{let M;try{M=new URL(j,s)}catch(W){throw new TypeError(`Referrer "${j}" is not a valid URL.`,{cause:W})}M.protocol==="about:"&&M.hostname==="client"||l&&!rvt(M,this[cA].settingsObject.baseUrl)?n.referrer="client":n.referrer=M}}r.referrerPolicy!==void 0&&(n.referrerPolicy=r.referrerPolicy);let m;if(r.mode!==void 0?m=r.mode:m=a,m==="navigate")throw fs.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(m!=null&&(n.mode=m),r.credentials!==void 0&&(n.credentials=r.credentials),r.cache!==void 0&&(n.cache=r.cache),n.cache==="only-if-cached"&&n.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(n.redirect=r.redirect),r.integrity!=null&&(n.integrity=String(r.integrity)),r.keepalive!==void 0&&(n.keepalive=!!r.keepalive),r.method!==void 0){let j=r.method;if(!Lyn(j))throw new TypeError(`'${j}' is not a valid HTTP method.`);if(Uyn.has(j.toUpperCase()))throw new TypeError(`'${j}' HTTP method is unsupported.`);j=(O=qyn[j])!=null?O:jyn(j),n.method=j}r.signal!==void 0&&(c=r.signal),this[vu]=n;let g=new AbortController;if(this[Rq]=g.signal,this[Rq][cA]=this[cA],c!=null){if(!c||typeof c.aborted!="boolean"||typeof c.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(c.aborted)g.abort(c.reason);else{this[evn]=g;let j=new WeakRef(g),M=function(){let W=j.deref();W!==void 0&&W.abort(this.reason)};try{(typeof nvt=="function"&&nvt(c)===svt||Zyn(c,"abort").length>=svt)&&ivt(100,c)}catch{}Nq.addAbortListener(c,M),tvn.register(g,{signal:c,abort:M})}}if(this[Th]=new tvt(iX),this[Th][nX]=n.headersList,this[Th][rX]="request",this[Th][cA]=this[cA],m==="no-cors"){if(!zyn.has(n.method))throw new TypeError(`'${n.method} is unsupported in no-cors mode.`);this[Th][rX]="request-no-cors"}if(d){let j=this[Th][nX],M=r.headers!==void 0?r.headers:new sX(j);if(j.clear(),M instanceof sX){for(let[W,se]of M)j.append(W,se);j.cookies=M.cookies}else Oyn(this[Th],M)}let x=t instanceof e?t[vu].body:null;if((r.body!=null||x!=null)&&(n.method==="GET"||n.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let b=null;if(r.body!=null){let[j,M]=Ryn(r.body,n.keepalive);b=j,M&&!this[Th][nX].contains("content-type")&&this[Th].append("content-type",M)}let A=b!=null?b:x;if(A!=null&&A.source==null){if(b!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(n.mode!=="same-origin"&&n.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');n.useCORSPreflightFlag=!0}let C=A;if(b==null&&x!=null){if(Nq.isDisturbed(x.stream)||x.stream.locked)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");Awe||(Awe=require("stream/web").TransformStream);let j=new Awe;x.stream.pipeThrough(j),C={source:x.source,length:x.length,stream:j.readable}}this[vu].body=C}get method(){return fs.brandCheck(this,e),this[vu].method}get url(){return fs.brandCheck(this,e),Kyn(this[vu].url)}get headers(){return fs.brandCheck(this,e),this[Th]}get destination(){return fs.brandCheck(this,e),this[vu].destination}get referrer(){return fs.brandCheck(this,e),this[vu].referrer==="no-referrer"?"":this[vu].referrer==="client"?"about:client":this[vu].referrer.toString()}get referrerPolicy(){return fs.brandCheck(this,e),this[vu].referrerPolicy}get mode(){return fs.brandCheck(this,e),this[vu].mode}get credentials(){return this[vu].credentials}get cache(){return fs.brandCheck(this,e),this[vu].cache}get redirect(){return fs.brandCheck(this,e),this[vu].redirect}get integrity(){return fs.brandCheck(this,e),this[vu].integrity}get keepalive(){return fs.brandCheck(this,e),this[vu].keepalive}get isReloadNavigation(){return fs.brandCheck(this,e),this[vu].reloadNavigation}get isHistoryNavigation(){return fs.brandCheck(this,e),this[vu].historyNavigation}get signal(){return fs.brandCheck(this,e),this[Rq]}get body(){return fs.brandCheck(this,e),this[vu].body?this[vu].body.stream:null}get bodyUsed(){return fs.brandCheck(this,e),!!this[vu].body&&Nq.isDisturbed(this[vu].body.stream)}get duplex(){return fs.brandCheck(this,e),"half"}clone(){var a;if(fs.brandCheck(this,e),this.bodyUsed||(a=this.body)!=null&&a.locked)throw new TypeError("unusable");let t=rvn(this[vu]),r=new e(iX);r[vu]=t,r[cA]=this[cA],r[Th]=new tvt(iX),r[Th][nX]=t.headersList,r[Th][rX]=this[Th][rX],r[Th][cA]=this[Th][cA];let n=new AbortController;return this.signal.aborted?n.abort(this.signal.reason):Nq.addAbortListener(this.signal,()=>{n.abort(this.signal.reason)}),r[Rq]=n.signal,r}};Nyn(xD);function aX(e){let t={method:"GET",localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:!1,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:!1,credentials:"same-origin",useCredentials:!1,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...e,headersList:e.headersList?new sX(e.headersList):new sX};return t.url=t.urlList[0],t}function rvn(e){let t=aX({...e,body:null});return e.body!=null&&(t.body=Fyn(e.body)),t}Object.defineProperties(xD.prototype,{method:Bp,url:Bp,headers:Bp,redirect:Bp,clone:Bp,signal:Bp,duplex:Bp,destination:Bp,body:Bp,bodyUsed:Bp,isHistoryNavigation:Bp,isReloadNavigation:Bp,keepalive:Bp,integrity:Bp,cache:Bp,credentials:Bp,attribute:Bp,referrerPolicy:Bp,referrer:Bp,mode:Bp,[Symbol.toStringTag]:{value:"Request",configurable:!0}});fs.converters.Request=fs.interfaceConverter(xD);fs.converters.RequestInfo=function(e){return typeof e=="string"?fs.converters.USVString(e):e instanceof xD?fs.converters.Request(e):fs.converters.USVString(e)};fs.converters.AbortSignal=fs.interfaceConverter(AbortSignal);fs.converters.RequestInit=fs.dictionaryConverter([{key:"method",converter:fs.converters.ByteString},{key:"headers",converter:fs.converters.HeadersInit},{key:"body",converter:fs.nullableConverter(fs.converters.BodyInit)},{key:"referrer",converter:fs.converters.USVString},{key:"referrerPolicy",converter:fs.converters.DOMString,allowedValues:Hyn},{key:"mode",converter:fs.converters.DOMString,allowedValues:$yn},{key:"credentials",converter:fs.converters.DOMString,allowedValues:Wyn},{key:"cache",converter:fs.converters.DOMString,allowedValues:Gyn},{key:"redirect",converter:fs.converters.DOMString,allowedValues:Vyn},{key:"integrity",converter:fs.converters.DOMString},{key:"keepalive",converter:fs.converters.boolean},{key:"signal",converter:fs.nullableConverter(e=>fs.converters.AbortSignal(e,{strict:!1}))},{key:"window",converter:fs.converters.any},{key:"duplex",converter:fs.converters.DOMString,allowedValues:Yyn}]);avt.exports={Request:xD,makeRequest:aX}});var dX=P((txi,xvt)=>{"use strict";var{Response:nvn,makeNetworkError:Mc,makeAppropriateNetworkError:oX,filterResponse:ywe,makeResponse:cX}=tX(),{Headers:ovt}=vD(),{Request:ivn,makeRequest:svn}=Fq(),Oq=require("zlib"),{bytesMatch:avn,makePolicyContainer:ovn,clonePolicyContainer:cvn,requestBadPort:uvn,TAOCheck:lvn,appendRequestOriginHeader:pvn,responseLocationURL:fvn,requestCurrentURL:u1,setRequestReferrerPolicyOnRedirect:dvn,tryUpgradeRequestToAPotentiallyTrustworthyURL:hvn,createOpaqueTimingInfo:Iwe,appendFetchMetadata:mvn,corsCheck:gvn,crossOriginResourcePolicyCheck:Avn,determineRequestsReferrer:yvn,coarsenedSharedCurrentTime:kwe,createDeferredPromise:vvn,isBlobLike:xvn,sameOrigin:Swe,isCancelled:I4,isAborted:cvt,isErrorLike:bvn,fullyReadBody:fvt,readableStreamClose:Evn,isomorphicEncode:Cwe,urlIsLocal:wvn,urlIsHttpHttpsScheme:Twe,urlHasHttpsScheme:Svn}=Vy(),{kState:_we,kHeaders:vwe,kGuard:Cvn,kRealm:uvt}=sS(),k4=require("assert"),{safelyExtractBody:uX}=lq(),{redirectStatusSet:dvt,nullBodyStatus:hvt,safeMethodsSet:_vn,requestBodyHeader:Ivn,subresourceSet:kvn,DOMException:lX}=pI(),{kHeadersList:_4}=gu(),Tvn=require("events"),{Readable:Bvn,pipeline:Dvn}=require("stream"),{addAbortListener:Pvn,isErrored:Rvn,isReadable:pX,nodeMajor:lvt,nodeMinor:Nvn}=mo(),{dataURLProcessor:Fvn,serializeAMimeType:Ovn}=jx(),{TransformStream:Qvn}=require("stream/web"),{getGlobalDispatcher:Lvn}=b4(),{webidl:jvn}=Pm(),{STATUS_CODES:Mvn}=require("http"),qvn=["GET","HEAD"],xwe,bwe=globalThis.ReadableStream,fX=class extends Tvn{constructor(t){super(),this.dispatcher=t,this.connection=null,this.dump=!1,this.state="ongoing",this.setMaxListeners(21)}terminate(t){var r;this.state==="ongoing"&&(this.state="terminated",(r=this.connection)==null||r.destroy(t),this.emit("terminated",t))}abort(t){var r;this.state==="ongoing"&&(this.state="aborted",t||(t=new lX("The operation was aborted.","AbortError")),this.serializedAbortReason=t,(r=this.connection)==null||r.destroy(t),this.emit("terminated",t))}};function Uvn(e,t={}){var x,b;jvn.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});let r=vvn(),n;try{n=new ivn(e,t)}catch(A){return r.reject(A),r.promise}let a=n[_we];if(n.signal.aborted)return Ewe(r,a,null,n.signal.reason),r.promise;let s=a.client.globalObject;((x=s==null?void 0:s.constructor)==null?void 0:x.name)==="ServiceWorkerGlobalScope"&&(a.serviceWorkers="none");let c=null,l=null,f=!1,d=null;return Pvn(n.signal,()=>{f=!0,k4(d!=null),d.abort(n.signal.reason),Ewe(r,a,c,n.signal.reason)}),d=gvt({request:a,processResponseEndOfBody:A=>mvt(A,"fetch"),processResponse:A=>{if(f)return Promise.resolve();if(A.aborted)return Ewe(r,a,c,d.serializedAbortReason),Promise.resolve();if(A.type==="error")return r.reject(Object.assign(new TypeError("fetch failed"),{cause:A.error})),Promise.resolve();c=new nvn,c[_we]=A,c[uvt]=l,c[vwe][_4]=A.headersList,c[vwe][Cvn]="immutable",c[vwe][uvt]=l,r.resolve(c)},dispatcher:(b=t.dispatcher)!=null?b:Lvn()}),r.promise}function mvt(e,t="other"){var s;if(e.type==="error"&&e.aborted||!((s=e.urlList)!=null&&s.length))return;let r=e.urlList[0],n=e.timingInfo,a=e.cacheState;Twe(r)&&n!==null&&(e.timingAllowPassed||(n=Iwe({startTime:n.startTime}),a=""),n.endTime=kwe(),e.timingInfo=n,zvn(n,r,t,globalThis,a))}function zvn(e,t,r,n,a){(lvt>18||lvt===18&&Nvn>=2)&&performance.markResourceTiming(e,t.href,r,n,a)}function Ewe(e,t,r,n){var s,c;if(n||(n=new lX("The operation was aborted.","AbortError")),e.reject(n),t.body!=null&&pX((s=t.body)==null?void 0:s.stream)&&t.body.stream.cancel(n).catch(l=>{if(l.code!=="ERR_INVALID_STATE")throw l}),r==null)return;let a=r[_we];a.body!=null&&pX((c=a.body)==null?void 0:c.stream)&&a.body.stream.cancel(n).catch(l=>{if(l.code!=="ERR_INVALID_STATE")throw l})}function gvt({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:a,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l}){var b,A,C,I;let f=null,d=!1;e.client!=null&&(f=e.client.globalObject,d=e.client.crossOriginIsolatedCapability);let m=kwe(d),g=Iwe({startTime:m}),x={controller:new fX(l),request:e,timingInfo:g,processRequestBodyChunkLength:t,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:a,taskDestination:f,crossOriginIsolatedCapability:d};return k4(!e.body||e.body.stream),e.window==="client"&&(e.window=((C=(A=(b=e.client)==null?void 0:b.globalObject)==null?void 0:A.constructor)==null?void 0:C.name)==="Window"?e.client:"no-window"),e.origin==="client"&&(e.origin=(I=e.client)==null?void 0:I.origin),e.policyContainer==="client"&&(e.client!=null?e.policyContainer=cvn(e.client.policyContainer):e.policyContainer=ovn()),e.headersList.contains("accept")||e.headersList.append("accept","*/*"),e.headersList.contains("accept-language")||e.headersList.append("accept-language","*"),e.priority,kvn.has(e.destination),Avt(x).catch(k=>{x.controller.terminate(k)}),x.controller}async function Avt(e,t=!1){let r=e.request,n=null;if(r.localURLsOnly&&!wvn(u1(r))&&(n=Mc("local URLs only")),hvn(r),uvn(r)==="blocked"&&(n=Mc("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=yvn(r)),n===null&&(n=await(async()=>{let s=u1(r);return Swe(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await pvt(e)):r.mode==="same-origin"?Mc('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?Mc('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await pvt(e)):Twe(u1(r))?(r.responseTainting="cors",await yvt(e)):Mc("URL scheme must be a HTTP(S) scheme")})()),t)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=ywe(n,"basic"):r.responseTainting==="cors"?n=ywe(n,"cors"):r.responseTainting==="opaque"?n=ywe(n,"opaque"):k4(!1));let a=n.status===0?n:n.internalResponse;if(a.urlList.length===0&&a.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&a.status===206&&a.rangeRequested&&!r.headers.contains("range")&&(n=a=Mc()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||hvt.includes(a.status))&&(a.body=null,e.controller.dump=!0),r.integrity){let s=l=>wwe(e,Mc(l));if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=l=>{if(!avn(l,r.integrity)){s("integrity mismatch");return}n.body=uX(l)[0],wwe(e,n)};await fvt(n.body,c,s)}else wwe(e,n)}function pvt(e){var n;if(I4(e)&&e.request.redirectCount===0)return Promise.resolve(oX(e));let{request:t}=e,{protocol:r}=u1(t);switch(r){case"about:":return Promise.resolve(Mc("about scheme is not supported"));case"blob:":{xwe||(xwe=require("buffer").resolveObjectURL);let a=u1(t);if(a.search.length!==0)return Promise.resolve(Mc("NetworkError when attempting to fetch resource."));let s=xwe(a.toString());if(t.method!=="GET"||!xvn(s))return Promise.resolve(Mc("invalid method"));let c=uX(s),l=c[0],f=Cwe(`${l.length}`),d=(n=c[1])!=null?n:"",m=cX({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:f}],["content-type",{name:"Content-Type",value:d}]]});return m.body=l,Promise.resolve(m)}case"data:":{let a=u1(t),s=Fvn(a);if(s==="failure")return Promise.resolve(Mc("failed to fetch the data URL"));let c=Ovn(s.mimeType);return Promise.resolve(cX({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:c}]],body:uX(s.body)[0]}))}case"file:":return Promise.resolve(Mc("not implemented... yet..."));case"http:":case"https:":return yvt(e).catch(a=>Mc(a));default:return Promise.resolve(Mc("unknown scheme"))}}function Hvn(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function wwe(e,t){t.type==="error"&&(t.urlList=[e.request.urlList[0]],t.timingInfo=Iwe({startTime:e.timingInfo.startTime}));let r=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t))};if(e.processResponse!=null&&queueMicrotask(()=>e.processResponse(t)),t.body==null)r();else{let n=(s,c)=>{c.enqueue(s)},a=new Qvn({start(){},transform:n,flush:r},{size(){return 1}},{size(){return 1}});t.body={stream:t.body.stream.pipeThrough(a)}}if(e.processResponseConsumeBody!=null){let n=s=>e.processResponseConsumeBody(t,s),a=s=>e.processResponseConsumeBody(t,s);if(t.body==null)queueMicrotask(()=>n(null));else return fvt(t.body,n,a);return Promise.resolve()}}async function yvt(e){let t=e.request,r=null,n=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect==="follow"&&(t.serviceWorkers="none"),n=r=await vvt(e),t.responseTainting==="cors"&&gvn(t,r)==="failure")return Mc("cors failure");lvn(t,r)==="failure"&&(t.timingAllowFailed=!0)}return(t.responseTainting==="opaque"||r.type==="opaque")&&Avn(t.origin,t.client,t.destination,n)==="blocked"?Mc("blocked"):(dvt.has(n.status)&&(t.redirect!=="manual"&&e.controller.connection.destroy(),t.redirect==="error"?r=Mc("unexpected redirect"):t.redirect==="manual"?r=n:t.redirect==="follow"?r=await Vvn(e,r):k4(!1)),r.timingInfo=a,r)}function Vvn(e,t){let r=e.request,n=t.internalResponse?t.internalResponse:t,a;try{if(a=fvn(n,u1(r).hash),a==null)return t}catch(c){return Promise.resolve(Mc(c))}if(!Twe(a))return Promise.resolve(Mc("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(Mc("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(a.username||a.password)&&!Swe(r,a))return Promise.resolve(Mc('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(a.username||a.password))return Promise.resolve(Mc('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(Mc());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!qvn.includes(r.method)){r.method="GET",r.body=null;for(let c of Ivn)r.headersList.delete(c)}Swe(u1(r),a)||(r.headersList.delete("authorization"),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie"),r.headersList.delete("host")),r.body!=null&&(k4(r.body.source!=null),r.body=uX(r.body.source)[0]);let s=e.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=kwe(e.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(a),dvn(r,n),Avt(e,!0)}async function vvt(e,t=!1,r=!1){let n=e.request,a=null,s=null,c=null,l=null,f=!1;n.window==="no-window"&&n.redirect==="error"?(a=e,s=n):(s=svn(n),a={...e},a.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",m=s.body?s.body.length:null,g=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(g="0"),m!=null&&(g=Cwe(`${m}`)),g!=null&&s.headersList.append("content-length",g),m!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Cwe(s.referrer.href)),pvn(s),mvn(s),s.headersList.contains("user-agent")||s.headersList.append("user-agent",typeof esbuildDetection>"u"?"undici":"node"),s.cache==="default"&&(s.headersList.contains("if-modified-since")||s.headersList.contains("if-none-match")||s.headersList.contains("if-unmodified-since")||s.headersList.contains("if-match")||s.headersList.contains("if-range"))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control")&&s.headersList.append("cache-control","max-age=0"),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma")||s.headersList.append("pragma","no-cache"),s.headersList.contains("cache-control")||s.headersList.append("cache-control","no-cache")),s.headersList.contains("range")&&s.headersList.append("accept-encoding","identity"),s.headersList.contains("accept-encoding")||(Svn(u1(s))?s.headersList.append("accept-encoding","br, gzip, deflate"):s.headersList.append("accept-encoding","gzip, deflate")),s.headersList.delete("host"),l==null&&(s.cache="no-store"),s.mode!=="no-store"&&s.mode,c==null){if(s.mode==="only-if-cached")return Mc("only if cached");let x=await $vn(a,d,r);!_vn.has(s.method)&&x.status>=200&&x.status<=399,f&&x.status,c==null&&(c=x)}if(c.urlList=[...s.urlList],s.headersList.contains("range")&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?Mc():I4(e)?oX(e):Mc("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(I4(e))return oX(e);e.controller.connection.destroy(),c=await vvt(e,t,!0)}return c}async function $vn(e,t=!1,r=!1){k4(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(A){var C;this.destroyed||(this.destroyed=!0,(C=this.abort)==null||C.call(this,A!=null?A:new lX("The operation was aborted.","AbortError")))}};let n=e.request,a=null,s=e.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let f=null;if(n.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(n.body!=null){let A=async function*(k){var O;I4(e)||(yield k,(O=e.processRequestBodyChunkLength)==null||O.call(e,k.byteLength))},C=()=>{I4(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},I=k=>{I4(e)||(k.name==="AbortError"?e.controller.abort():e.controller.terminate(k))};f=async function*(){try{for await(let k of n.body.stream)yield*A(k);C()}catch(k){I(k)}}()}try{let{body:A,status:C,statusText:I,headersList:k,socket:O}=await b({body:f});if(O)a=cX({status:C,statusText:I,headersList:k,socket:O});else{let j=A[Symbol.asyncIterator]();e.controller.next=()=>j.next(),a=cX({status:C,statusText:I,headersList:k})}}catch(A){return A.name==="AbortError"?(e.controller.connection.destroy(),oX(e,A)):Mc(A)}let d=()=>{e.controller.resume()},m=A=>{e.controller.abort(A)};bwe||(bwe=require("stream/web").ReadableStream);let g=new bwe({async start(A){e.controller.controller=A},async pull(A){await d(A)},async cancel(A){await m(A)}},{highWaterMark:0,size(){return 1}});a.body={stream:g},e.controller.on("terminated",x),e.controller.resume=async()=>{var A;for(;;){let C,I;try{let{done:k,value:O}=await e.controller.next();if(cvt(e))break;C=k?void 0:O}catch(k){e.controller.ended&&!s.encodedBodySize?C=void 0:(C=k,I=!0)}if(C===void 0){Evn(e.controller.controller),Hvn(e,a);return}if(s.decodedBodySize+=(A=C==null?void 0:C.byteLength)!=null?A:0,I){e.controller.terminate(C);return}if(e.controller.controller.enqueue(new Uint8Array(C)),Rvn(g)){e.controller.terminate();return}if(!e.controller.controller.desiredSize)return}};function x(A){cvt(e)?(a.aborted=!0,pX(g)&&e.controller.controller.error(e.controller.serializedAbortReason)):pX(g)&&e.controller.controller.error(new TypeError("terminated",{cause:bvn(A)?A:void 0})),e.controller.connection.destroy()}return a;async function b({body:A}){let C=u1(n),I=e.controller.dispatcher;return new Promise((k,O)=>I.dispatch({path:C.pathname+C.search,origin:C.origin,method:n.method,body:e.controller.dispatcher.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(j){let{connection:M}=e.controller;M.destroyed?j(new lX("The operation was aborted.","AbortError")):(e.controller.on("terminated",j),this.abort=M.abort=j)},onHeaders(j,M,W,se){if(j<200)return;let X=[],ve="",ae=new ovt;if(Array.isArray(M))for(let ye=0;ye<M.length;ye+=2){let ue=M[ye+0].toString("latin1"),ne=M[ye+1].toString("latin1");ue.toLowerCase()==="content-encoding"?X=ne.toLowerCase().split(",").map(be=>be.trim()):ue.toLowerCase()==="location"&&(ve=ne),ae[_4].append(ue,ne)}else{let ye=Object.keys(M);for(let ue of ye){let ne=M[ue];ue.toLowerCase()==="content-encoding"?X=ne.toLowerCase().split(",").map(be=>be.trim()).reverse():ue.toLowerCase()==="location"&&(ve=ne),ae[_4].append(ue,ne)}}this.body=new Bvn({read:W});let he=[],me=n.redirect==="follow"&&ve&&dvt.has(j);if(n.method!=="HEAD"&&n.method!=="CONNECT"&&!hvt.includes(j)&&!me)for(let ye of X)if(ye==="x-gzip"||ye==="gzip")he.push(Oq.createGunzip({flush:Oq.constants.Z_SYNC_FLUSH,finishFlush:Oq.constants.Z_SYNC_FLUSH}));else if(ye==="deflate")he.push(Oq.createInflate());else if(ye==="br")he.push(Oq.createBrotliDecompress());else{he.length=0;break}return k({status:j,statusText:se,headersList:ae[_4],body:he.length?Dvn(this.body,...he,()=>{}):this.body.on("error",()=>{})}),!0},onData(j){if(e.controller.dump)return;let M=j;return s.encodedBodySize+=M.byteLength,this.body.push(M)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(j){var M;this.abort&&e.controller.off("terminated",this.abort),(M=this.body)==null||M.destroy(j),e.controller.terminate(j),O(j)},onUpgrade(j,M,W){if(j!==101)return;let se=new ovt;for(let X=0;X<M.length;X+=2){let ve=M[X+0].toString("latin1"),ae=M[X+1].toString("latin1");se[_4].append(ve,ae)}return k({status:j,statusText:Mvn[j],headersList:se[_4],socket:W}),!0}}))}}xvt.exports={fetch:Uvn,Fetch:fX,fetching:gvt,finalizeAndReportTiming:mvt}});var Bwe=P((rxi,bvt)=>{"use strict";bvt.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var wvt=P((nxi,Evt)=>{"use strict";var{webidl:uA}=Pm(),hX=Symbol("ProgressEvent state"),Dwe=class e extends Event{constructor(t,r={}){t=uA.converters.DOMString(t),r=uA.converters.ProgressEventInit(r!=null?r:{}),super(t,r),this[hX]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return uA.brandCheck(this,e),this[hX].lengthComputable}get loaded(){return uA.brandCheck(this,e),this[hX].loaded}get total(){return uA.brandCheck(this,e),this[hX].total}};uA.converters.ProgressEventInit=uA.dictionaryConverter([{key:"lengthComputable",converter:uA.converters.boolean,defaultValue:!1},{key:"loaded",converter:uA.converters["unsigned long long"],defaultValue:0},{key:"total",converter:uA.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:uA.converters.boolean,defaultValue:!1},{key:"cancelable",converter:uA.converters.boolean,defaultValue:!1},{key:"composed",converter:uA.converters.boolean,defaultValue:!1}]);Evt.exports={ProgressEvent:Dwe}});var Cvt=P((ixi,Svt)=>{"use strict";function Wvn(e){if(!e)return"failure";switch(e.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}Svt.exports={getEncoding:Wvn}});var Rvt=P((sxi,Pvt)=>{"use strict";var{kState:T4,kError:Pwe,kResult:_vt,kAborted:Qq,kLastProgressEventFired:Rwe}=Bwe(),{ProgressEvent:Gvn}=wvt(),{getEncoding:Ivt}=Cvt(),{DOMException:Yvn}=pI(),{serializeAMimeType:Jvn,parseMIMEType:kvt}=jx(),{types:Kvn}=require("util"),{StringDecoder:Tvt}=require("string_decoder"),{btoa:Bvt}=require("buffer"),Xvn={enumerable:!0,writable:!1,configurable:!1};function Zvn(e,t,r,n){if(e[T4]==="loading")throw new Yvn("Invalid state","InvalidStateError");e[T4]="loading",e[_vt]=null,e[Pwe]=null;let s=t.stream().getReader(),c=[],l=s.read(),f=!0;(async()=>{for(;!e[Qq];)try{let{done:d,value:m}=await l;if(f&&!e[Qq]&&queueMicrotask(()=>{vI("loadstart",e)}),f=!1,!d&&Kvn.isUint8Array(m))c.push(m),(e[Rwe]===void 0||Date.now()-e[Rwe]>=50)&&!e[Qq]&&(e[Rwe]=Date.now(),queueMicrotask(()=>{vI("progress",e)})),l=s.read();else if(d){queueMicrotask(()=>{e[T4]="done";try{let g=exn(c,r,t.type,n);if(e[Qq])return;e[_vt]=g,vI("load",e)}catch(g){e[Pwe]=g,vI("error",e)}e[T4]!=="loading"&&vI("loadend",e)});break}}catch(d){if(e[Qq])return;queueMicrotask(()=>{e[T4]="done",e[Pwe]=d,vI("error",e),e[T4]!=="loading"&&vI("loadend",e)});break}})()}function vI(e,t){let r=new Gvn(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(r)}function exn(e,t,r,n){switch(t){case"DataURL":{let a="data:",s=kvt(r||"application/octet-stream");s!=="failure"&&(a+=Jvn(s)),a+=";base64,";let c=new Tvt("latin1");for(let l of e)a+=Bvt(c.write(l));return a+=Bvt(c.end()),a}case"Text":{let a="failure";if(n&&(a=Ivt(n)),a==="failure"&&r){let s=kvt(r);s!=="failure"&&(a=Ivt(s.parameters.get("charset")))}return a==="failure"&&(a="UTF-8"),txn(e,a)}case"ArrayBuffer":return Dvt(e).buffer;case"BinaryString":{let a="",s=new Tvt("latin1");for(let c of e)a+=s.write(c);return a+=s.end(),a}}}function txn(e,t){let r=Dvt(e),n=rxn(r),a=0;n!==null&&(t=n,a=n==="UTF-8"?3:2);let s=r.slice(a);return new TextDecoder(t).decode(s)}function rxn(e){let[t,r,n]=e;return t===239&&r===187&&n===191?"UTF-8":t===254&&r===255?"UTF-16BE":t===255&&r===254?"UTF-16LE":null}function Dvt(e){let t=e.reduce((n,a)=>n+a.byteLength,0),r=0;return e.reduce((n,a)=>(n.set(a,r),r+=a.byteLength,n),new Uint8Array(t))}Pvt.exports={staticPropertyDescriptors:Xvn,readOperation:Zvn,fireAProgressEvent:vI}});var Qvt=P((axi,Ovt)=>{"use strict";var{staticPropertyDescriptors:B4,readOperation:mX,fireAProgressEvent:Nvt}=Rvt(),{kState:bD,kError:Fvt,kResult:gX,kEvents:Ho,kAborted:nxn}=Bwe(),{webidl:kc}=Pm(),{kEnumerableProperty:ig}=mo(),zx=class e extends EventTarget{constructor(){super(),this[bD]="empty",this[gX]=null,this[Fvt]=null,this[Ho]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(t){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"}),t=kc.converters.Blob(t,{strict:!1}),mX(this,t,"ArrayBuffer")}readAsBinaryString(t){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"}),t=kc.converters.Blob(t,{strict:!1}),mX(this,t,"BinaryString")}readAsText(t,r=void 0){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"}),t=kc.converters.Blob(t,{strict:!1}),r!==void 0&&(r=kc.converters.DOMString(r)),mX(this,t,"Text",r)}readAsDataURL(t){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"}),t=kc.converters.Blob(t,{strict:!1}),mX(this,t,"DataURL")}abort(){if(this[bD]==="empty"||this[bD]==="done"){this[gX]=null;return}this[bD]==="loading"&&(this[bD]="done",this[gX]=null),this[nxn]=!0,Nvt("abort",this),this[bD]!=="loading"&&Nvt("loadend",this)}get readyState(){switch(kc.brandCheck(this,e),this[bD]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return kc.brandCheck(this,e),this[gX]}get error(){return kc.brandCheck(this,e),this[Fvt]}get onloadend(){return kc.brandCheck(this,e),this[Ho].loadend}set onloadend(t){kc.brandCheck(this,e),this[Ho].loadend&&this.removeEventListener("loadend",this[Ho].loadend),typeof t=="function"?(this[Ho].loadend=t,this.addEventListener("loadend",t)):this[Ho].loadend=null}get onerror(){return kc.brandCheck(this,e),this[Ho].error}set onerror(t){kc.brandCheck(this,e),this[Ho].error&&this.removeEventListener("error",this[Ho].error),typeof t=="function"?(this[Ho].error=t,this.addEventListener("error",t)):this[Ho].error=null}get onloadstart(){return kc.brandCheck(this,e),this[Ho].loadstart}set onloadstart(t){kc.brandCheck(this,e),this[Ho].loadstart&&this.removeEventListener("loadstart",this[Ho].loadstart),typeof t=="function"?(this[Ho].loadstart=t,this.addEventListener("loadstart",t)):this[Ho].loadstart=null}get onprogress(){return kc.brandCheck(this,e),this[Ho].progress}set onprogress(t){kc.brandCheck(this,e),this[Ho].progress&&this.removeEventListener("progress",this[Ho].progress),typeof t=="function"?(this[Ho].progress=t,this.addEventListener("progress",t)):this[Ho].progress=null}get onload(){return kc.brandCheck(this,e),this[Ho].load}set onload(t){kc.brandCheck(this,e),this[Ho].load&&this.removeEventListener("load",this[Ho].load),typeof t=="function"?(this[Ho].load=t,this.addEventListener("load",t)):this[Ho].load=null}get onabort(){return kc.brandCheck(this,e),this[Ho].abort}set onabort(t){kc.brandCheck(this,e),this[Ho].abort&&this.removeEventListener("abort",this[Ho].abort),typeof t=="function"?(this[Ho].abort=t,this.addEventListener("abort",t)):this[Ho].abort=null}};zx.EMPTY=zx.prototype.EMPTY=0;zx.LOADING=zx.prototype.LOADING=1;zx.DONE=zx.prototype.DONE=2;Object.defineProperties(zx.prototype,{EMPTY:B4,LOADING:B4,DONE:B4,readAsArrayBuffer:ig,readAsBinaryString:ig,readAsText:ig,readAsDataURL:ig,abort:ig,readyState:ig,result:ig,error:ig,onloadstart:ig,onprogress:ig,onload:ig,onabort:ig,onerror:ig,onloadend:ig,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(zx,{EMPTY:B4,LOADING:B4,DONE:B4});Ovt.exports={FileReader:zx}});var AX=P((oxi,Lvt)=>{"use strict";Lvt.exports={kConstruct:gu().kConstruct}});var qvt=P((cxi,Mvt)=>{"use strict";var ixn=require("assert"),{URLSerializer:jvt}=jx(),{isValidHeaderName:sxn}=Vy();function axn(e,t,r=!1){let n=jvt(e,r),a=jvt(t,r);return n===a}function oxn(e){ixn(e!==null);let t=[];for(let r of e.split(",")){if(r=r.trim(),r.length){if(!sxn(r))continue}else continue;t.push(r)}return t}Mvt.exports={urlEquals:axn,fieldValues:oxn}});var Gvt=P((uxi,Wvt)=>{"use strict";var{kConstruct:cxn}=AX(),{urlEquals:uxn,fieldValues:Nwe}=qvt(),{kEnumerableProperty:ED,isDisturbed:lxn}=mo(),{kHeadersList:Uvt}=gu(),{webidl:Vi}=Pm(),{Response:Hvt,cloneResponse:pxn}=tX(),{Request:l1}=Fq(),{kState:Qm,kHeaders:yX,kGuard:zvt,kRealm:fxn}=sS(),{fetching:dxn}=dX(),{urlIsHttpHttpsScheme:vX,createDeferredPromise:D4,readAllBytes:hxn}=Vy(),Fwe=require("assert"),{getGlobalDispatcher:mxn}=b4(),p1,R4,xX,xI,P4,EX,Vvt,hS=class hS{constructor(){nr(this,R4);nr(this,xI);nr(this,EX);nr(this,p1,void 0);arguments[0]!==cxn&&Vi.illegalConstructor(),Qt(this,p1,arguments[1])}async match(t,r={}){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.match"}),t=Vi.converters.RequestInfo(t),r=Vi.converters.CacheQueryOptions(r);let n=await this.matchAll(t,r);if(n.length!==0)return n[0]}async matchAll(t=void 0,r={}){var c,l;Vi.brandCheck(this,hS),t!==void 0&&(t=Vi.converters.RequestInfo(t)),r=Vi.converters.CacheQueryOptions(r);let n=null;if(t!==void 0)if(t instanceof l1){if(n=t[Qm],n.method!=="GET"&&!r.ignoreMethod)return[]}else typeof t=="string"&&(n=new l1(t)[Qm]);let a=[];if(t===void 0)for(let f of re(this,p1))a.push(f[1]);else{let f=yr(this,xI,P4).call(this,n,r);for(let d of f)a.push(d[1])}let s=[];for(let f of a){let d=new Hvt((l=(c=f.body)==null?void 0:c.source)!=null?l:null),m=d[Qm].body;d[Qm]=f,d[Qm].body=m,d[yX][Uvt]=f.headersList,d[yX][zvt]="immutable",s.push(d)}return Object.freeze(s)}async add(t){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.add"}),t=Vi.converters.RequestInfo(t);let r=[t];return await this.addAll(r)}async addAll(t){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.addAll"}),t=Vi.converters["sequence<RequestInfo>"](t);let r=[],n=[];for(let g of t){if(typeof g=="string")continue;let x=g[Qm];if(!vX(x.url)||x.method!=="GET")throw Vi.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}let a=[];for(let g of t){let x=new l1(g)[Qm];if(!vX(x.url))throw Vi.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."});x.initiator="fetch",x.destination="subresource",n.push(x);let b=D4();a.push(dxn({request:x,dispatcher:mxn(),processResponse(A){if(A.type==="error"||A.status===206||A.status<200||A.status>299)b.reject(Vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(A.headersList.contains("vary")){let C=Nwe(A.headersList.get("vary"));for(let I of C)if(I==="*"){b.reject(Vi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let k of a)k.abort();return}}},processResponseEndOfBody(A){if(A.aborted){b.reject(new DOMException("aborted","AbortError"));return}b.resolve(A)}})),r.push(b.promise)}let c=await Promise.all(r),l=[],f=0;for(let g of c){let x={type:"put",request:n[f],response:g};l.push(x),f++}let d=D4(),m=null;try{yr(this,R4,xX).call(this,l)}catch(g){m=g}return queueMicrotask(()=>{m===null?d.resolve(void 0):d.reject(m)}),d.promise}async put(t,r){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,2,{header:"Cache.put"}),t=Vi.converters.RequestInfo(t),r=Vi.converters.Response(r);let n=null;if(t instanceof l1?n=t[Qm]:n=new l1(t)[Qm],!vX(n.url)||n.method!=="GET")throw Vi.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"});let a=r[Qm];if(a.status===206)throw Vi.errors.exception({header:"Cache.put",message:"Got 206 status"});if(a.headersList.contains("vary")){let x=Nwe(a.headersList.get("vary"));for(let b of x)if(b==="*")throw Vi.errors.exception({header:"Cache.put",message:"Got * vary field value"})}if(a.body&&(lxn(a.body.stream)||a.body.stream.locked))throw Vi.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"});let s=pxn(a),c=D4();if(a.body!=null){let b=a.body.stream.getReader();hxn(b).then(c.resolve,c.reject)}else c.resolve(void 0);let l=[],f={type:"put",request:n,response:s};l.push(f);let d=await c.promise;s.body!=null&&(s.body.source=d);let m=D4(),g=null;try{yr(this,R4,xX).call(this,l)}catch(x){g=x}return queueMicrotask(()=>{g===null?m.resolve():m.reject(g)}),m.promise}async delete(t,r={}){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.delete"}),t=Vi.converters.RequestInfo(t),r=Vi.converters.CacheQueryOptions(r);let n=null;if(t instanceof l1){if(n=t[Qm],n.method!=="GET"&&!r.ignoreMethod)return!1}else Fwe(typeof t=="string"),n=new l1(t)[Qm];let a=[],s={type:"delete",request:n,options:r};a.push(s);let c=D4(),l=null,f;try{f=yr(this,R4,xX).call(this,a)}catch(d){l=d}return queueMicrotask(()=>{l===null?c.resolve(!!(f!=null&&f.length)):c.reject(l)}),c.promise}async keys(t=void 0,r={}){Vi.brandCheck(this,hS),t!==void 0&&(t=Vi.converters.RequestInfo(t)),r=Vi.converters.CacheQueryOptions(r);let n=null;if(t!==void 0)if(t instanceof l1){if(n=t[Qm],n.method!=="GET"&&!r.ignoreMethod)return[]}else typeof t=="string"&&(n=new l1(t)[Qm]);let a=D4(),s=[];if(t===void 0)for(let c of re(this,p1))s.push(c[0]);else{let c=yr(this,xI,P4).call(this,n,r);for(let l of c)s.push(l[0])}return queueMicrotask(()=>{let c=[];for(let l of s){let f=new l1("https://a");f[Qm]=l,f[yX][Uvt]=l.headersList,f[yX][zvt]="immutable",f[fxn]=l.client,c.push(f)}a.resolve(Object.freeze(c))}),a.promise}};p1=new WeakMap,R4=new WeakSet,xX=function(t){let r=re(this,p1),n=[...r],a=[],s=[];try{for(let c of t){if(c.type!=="delete"&&c.type!=="put")throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(yr(this,xI,P4).call(this,c.request,c.options,a).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=yr(this,xI,P4).call(this,c.request,c.options),l.length===0)return[];for(let f of l){let d=r.indexOf(f);Fwe(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let f=c.request;if(!vX(f.url))throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(f.method!=="GET")throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=yr(this,xI,P4).call(this,c.request);for(let d of l){let m=r.indexOf(d);Fwe(m!==-1),r.splice(m,1)}r.push([c.request,c.response]),a.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw re(this,p1).length=0,Qt(this,p1,n),c}},xI=new WeakSet,P4=function(t,r,n){let a=[],s=n!=null?n:re(this,p1);for(let c of s){let[l,f]=c;yr(this,EX,Vvt).call(this,t,l,f,r)&&a.push(c)}return a},EX=new WeakSet,Vvt=function(t,r,n=null,a){let s=new URL(t.url),c=new URL(r.url);if(a!=null&&a.ignoreSearch&&(c.search="",s.search=""),!uxn(s,c,!0))return!1;if(n==null||a!=null&&a.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Nwe(n.headersList.get("vary"));for(let f of l){if(f==="*")return!1;let d=r.headersList.get(f),m=t.headersList.get(f);if(d!==m)return!1}return!0};var bX=hS;Object.defineProperties(bX.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:ED,matchAll:ED,add:ED,addAll:ED,put:ED,delete:ED,keys:ED});var $vt=[{key:"ignoreSearch",converter:Vi.converters.boolean,defaultValue:!1},{key:"ignoreMethod",converter:Vi.converters.boolean,defaultValue:!1},{key:"ignoreVary",converter:Vi.converters.boolean,defaultValue:!1}];Vi.converters.CacheQueryOptions=Vi.dictionaryConverter($vt);Vi.converters.MultiCacheQueryOptions=Vi.dictionaryConverter([...$vt,{key:"cacheName",converter:Vi.converters.DOMString}]);Vi.converters.Response=Vi.interfaceConverter(Hvt);Vi.converters["sequence<RequestInfo>"]=Vi.sequenceConverter(Vi.converters.RequestInfo);Wvt.exports={Cache:bX}});var Jvt=P((pxi,Yvt)=>{"use strict";var{kConstruct:Lq}=AX(),{Cache:wX}=Gvt(),{webidl:Lm}=Pm(),{kEnumerableProperty:jq}=mo(),Gy,wD=class wD{constructor(){nr(this,Gy,new Map);arguments[0]!==Lq&&Lm.illegalConstructor()}async match(t,r={}){if(Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"}),t=Lm.converters.RequestInfo(t),r=Lm.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(re(this,Gy).has(r.cacheName)){let n=re(this,Gy).get(r.cacheName);return await new wX(Lq,n).match(t,r)}}else for(let n of re(this,Gy).values()){let s=await new wX(Lq,n).match(t,r);if(s!==void 0)return s}}async has(t){return Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"}),t=Lm.converters.DOMString(t),re(this,Gy).has(t)}async open(t){if(Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"}),t=Lm.converters.DOMString(t),re(this,Gy).has(t)){let n=re(this,Gy).get(t);return new wX(Lq,n)}let r=[];return re(this,Gy).set(t,r),new wX(Lq,r)}async delete(t){return Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"}),t=Lm.converters.DOMString(t),re(this,Gy).delete(t)}async keys(){return Lm.brandCheck(this,wD),[...re(this,Gy).keys()]}};Gy=new WeakMap;var SX=wD;Object.defineProperties(SX.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:jq,has:jq,open:jq,delete:jq,keys:jq});Yvt.exports={CacheStorage:SX}});var Xvt=P((dxi,Kvt)=>{"use strict";Kvt.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Owe=P((hxi,nxt)=>{"use strict";function gxn(e){if(e.length===0)return!1;for(let t of e){let r=t.charCodeAt(0);if(r>=0||r<=8||r>=10||r<=31||r===127)return!1}}function Zvt(e){for(let t of e){let r=t.charCodeAt(0);if(r<=32||r>127||t==="("||t===")"||t===">"||t==="<"||t==="@"||t===","||t===";"||t===":"||t==="\\"||t==='"'||t==="/"||t==="["||t==="]"||t==="?"||t==="="||t==="{"||t==="}")throw new Error("Invalid cookie name")}}function ext(e){for(let t of e){let r=t.charCodeAt(0);if(r<33||r===34||r===44||r===59||r===92||r>126)throw new Error("Invalid header value")}}function txt(e){for(let t of e)if(t.charCodeAt(0)<33||t===";")throw new Error("Invalid cookie path")}function Axn(e){if(e.startsWith("-")||e.endsWith(".")||e.endsWith("-"))throw new Error("Invalid cookie domain")}function rxt(e){typeof e=="number"&&(e=new Date(e));let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=t[e.getUTCDay()],a=e.getUTCDate().toString().padStart(2,"0"),s=r[e.getUTCMonth()],c=e.getUTCFullYear(),l=e.getUTCHours().toString().padStart(2,"0"),f=e.getUTCMinutes().toString().padStart(2,"0"),d=e.getUTCSeconds().toString().padStart(2,"0");return`${n}, ${a} ${s} ${c} ${l}:${f}:${d} GMT`}function yxn(e){if(e<0)throw new Error("Invalid cookie max-age")}function vxn(e){if(e.name.length===0)return null;Zvt(e.name),ext(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&t.push("Secure"),e.httpOnly&&t.push("HttpOnly"),typeof e.maxAge=="number"&&(yxn(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(Axn(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(txt(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!=="Invalid Date"&&t.push(`Expires=${rxt(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let r of e.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...a]=r.split("=");t.push(`${n.trim()}=${a.join("=")}`)}return t.join("; ")}nxt.exports={isCTLExcludingHtab:gxn,validateCookieName:Zvt,validateCookiePath:txt,validateCookieValue:ext,toIMFDate:rxt,stringify:vxn}});var sxt=P((mxi,ixt)=>{"use strict";var{maxNameValuePairSize:xxn,maxAttributeValueSize:bxn}=Xvt(),{isCTLExcludingHtab:Exn}=Owe(),{collectASequenceOfCodePointsFast:CX}=jx(),wxn=require("assert");function Sxn(e){if(Exn(e))return null;let t="",r="",n="",a="";if(e.includes(";")){let s={position:0};t=CX(";",e,s),r=e.slice(s.position)}else t=e;if(!t.includes("="))a=t;else{let s={position:0};n=CX("=",t,s),a=t.slice(s.position+1)}return n=n.trim(),a=a.trim(),n.length+a.length>xxn?null:{name:n,value:a,...N4(r)}}function N4(e,t={}){var c;if(e.length===0)return t;wxn(e[0]===";"),e=e.slice(1);let r="";e.includes(";")?(r=CX(";",e,{position:0}),e=e.slice(r.length)):(r=e,e="");let n="",a="";if(r.includes("=")){let l={position:0};n=CX("=",r,l),a=r.slice(l.position+1)}else n=r;if(n=n.trim(),a=a.trim(),a.length>bxn)return N4(e,t);let s=n.toLowerCase();if(s==="expires"){let l=new Date(a);t.expires=l}else if(s==="max-age"){let l=a.charCodeAt(0);if((l<48||l>57)&&a[0]!=="-"||!/^\d+$/.test(a))return N4(e,t);let f=Number(a);t.maxAge=f}else if(s==="domain"){let l=a;l[0]==="."&&(l=l.slice(1)),l=l.toLowerCase(),t.domain=l}else if(s==="path"){let l="";a.length===0||a[0]!=="/"?l="/":l=a,t.path=l}else if(s==="secure")t.secure=!0;else if(s==="httponly")t.httpOnly=!0;else if(s==="samesite"){let l="Default",f=a.toLowerCase();f.includes("none")&&(l="None"),f.includes("strict")&&(l="Strict"),f.includes("lax")&&(l="Lax"),t.sameSite=l}else(c=t.unparsed)!=null||(t.unparsed=[]),t.unparsed.push(`${n}=${a}`);return N4(e,t)}ixt.exports={parseSetCookie:Sxn,parseUnparsedAttributes:N4}});var uxt=P((gxi,cxt)=>{"use strict";var{parseSetCookie:Cxn}=sxt(),{stringify:axt}=Owe(),{webidl:Ha}=Pm(),{Headers:_X}=vD();function _xn(e){Ha.argumentLengthCheck(arguments,1,{header:"getCookies"}),Ha.brandCheck(e,_X,{strict:!1});let t=e.get("cookie"),r={};if(!t)return r;for(let n of t.split(";")){let[a,...s]=n.split("=");r[a.trim()]=s.join("=")}return r}function Ixn(e,t,r){Ha.argumentLengthCheck(arguments,2,{header:"deleteCookie"}),Ha.brandCheck(e,_X,{strict:!1}),t=Ha.converters.DOMString(t),r=Ha.converters.DeleteCookieAttributes(r),oxt(e,{name:t,value:"",expires:new Date(0),...r})}function kxn(e){Ha.argumentLengthCheck(arguments,1,{header:"getSetCookies"}),Ha.brandCheck(e,_X,{strict:!1});let t=e.getSetCookie();return t?t.map(r=>Cxn(r)):[]}function oxt(e,t){Ha.argumentLengthCheck(arguments,2,{header:"setCookie"}),Ha.brandCheck(e,_X,{strict:!1}),t=Ha.converters.Cookie(t),axt(t)&&e.append("Set-Cookie",axt(t))}Ha.converters.DeleteCookieAttributes=Ha.dictionaryConverter([{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"path",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"domain",defaultValue:null}]);Ha.converters.Cookie=Ha.dictionaryConverter([{converter:Ha.converters.DOMString,key:"name"},{converter:Ha.converters.DOMString,key:"value"},{converter:Ha.nullableConverter(e=>typeof e=="number"?Ha.converters["unsigned long long"](e):new Date(e)),key:"expires",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters["long long"]),key:"maxAge",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"domain",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"path",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.boolean),key:"secure",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.boolean),key:"httpOnly",defaultValue:null},{converter:Ha.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ha.sequenceConverter(Ha.converters.DOMString),key:"unparsed",defaultValue:[]}]);cxt.exports={getCookies:_xn,deleteCookie:Ixn,getSetCookies:kxn,setCookie:oxt}});var F4=P((Axi,lxt)=>{"use strict";var Txn="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",Bxn={enumerable:!0,writable:!1,configurable:!1},Dxn={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Pxn={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},Rxn=2**16-1,Nxn={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Fxn=Buffer.allocUnsafe(0);lxt.exports={uid:Txn,staticPropertyDescriptors:Bxn,states:Dxn,opcodes:Pxn,maxUnsigned16Bit:Rxn,parserStates:Nxn,emptyBuffer:Fxn}});var Mq=P((yxi,pxt)=>{"use strict";pxt.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var Lwe=P((vxi,fxt)=>{"use strict";var{webidl:$i}=Pm(),{kEnumerableProperty:sg}=mo(),{MessagePort:Oxn}=require("worker_threads"),Hx,mS=class mS extends Event{constructor(r,n={}){$i.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"}),r=$i.converters.DOMString(r),n=$i.converters.MessageEventInit(n);super(r,n);nr(this,Hx,void 0);Qt(this,Hx,n)}get data(){return $i.brandCheck(this,mS),re(this,Hx).data}get origin(){return $i.brandCheck(this,mS),re(this,Hx).origin}get lastEventId(){return $i.brandCheck(this,mS),re(this,Hx).lastEventId}get source(){return $i.brandCheck(this,mS),re(this,Hx).source}get ports(){return $i.brandCheck(this,mS),Object.isFrozen(re(this,Hx).ports)||Object.freeze(re(this,Hx).ports),re(this,Hx).ports}initMessageEvent(r,n=!1,a=!1,s=null,c="",l="",f=null,d=[]){return $i.brandCheck(this,mS),$i.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"}),new mS(r,{bubbles:n,cancelable:a,data:s,origin:c,lastEventId:l,source:f,ports:d})}};Hx=new WeakMap;var IX=mS,CD,qq=class qq extends Event{constructor(r,n={}){$i.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"}),r=$i.converters.DOMString(r),n=$i.converters.CloseEventInit(n);super(r,n);nr(this,CD,void 0);Qt(this,CD,n)}get wasClean(){return $i.brandCheck(this,qq),re(this,CD).wasClean}get code(){return $i.brandCheck(this,qq),re(this,CD).code}get reason(){return $i.brandCheck(this,qq),re(this,CD).reason}};CD=new WeakMap;var kX=qq,gS,SD=class SD extends Event{constructor(r,n){$i.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"});super(r,n);nr(this,gS,void 0);r=$i.converters.DOMString(r),n=$i.converters.ErrorEventInit(n!=null?n:{}),Qt(this,gS,n)}get message(){return $i.brandCheck(this,SD),re(this,gS).message}get filename(){return $i.brandCheck(this,SD),re(this,gS).filename}get lineno(){return $i.brandCheck(this,SD),re(this,gS).lineno}get colno(){return $i.brandCheck(this,SD),re(this,gS).colno}get error(){return $i.brandCheck(this,SD),re(this,gS).error}};gS=new WeakMap;var TX=SD;Object.defineProperties(IX.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:sg,origin:sg,lastEventId:sg,source:sg,ports:sg,initMessageEvent:sg});Object.defineProperties(kX.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:sg,code:sg,wasClean:sg});Object.defineProperties(TX.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:sg,filename:sg,lineno:sg,colno:sg,error:sg});$i.converters.MessagePort=$i.interfaceConverter(Oxn);$i.converters["sequence<MessagePort>"]=$i.sequenceConverter($i.converters.MessagePort);var Qwe=[{key:"bubbles",converter:$i.converters.boolean,defaultValue:!1},{key:"cancelable",converter:$i.converters.boolean,defaultValue:!1},{key:"composed",converter:$i.converters.boolean,defaultValue:!1}];$i.converters.MessageEventInit=$i.dictionaryConverter([...Qwe,{key:"data",converter:$i.converters.any,defaultValue:null},{key:"origin",converter:$i.converters.USVString,defaultValue:""},{key:"lastEventId",converter:$i.converters.DOMString,defaultValue:""},{key:"source",converter:$i.nullableConverter($i.converters.MessagePort),defaultValue:null},{key:"ports",converter:$i.converters["sequence<MessagePort>"],get defaultValue(){return[]}}]);$i.converters.CloseEventInit=$i.dictionaryConverter([...Qwe,{key:"wasClean",converter:$i.converters.boolean,defaultValue:!1},{key:"code",converter:$i.converters["unsigned short"],defaultValue:0},{key:"reason",converter:$i.converters.USVString,defaultValue:""}]);$i.converters.ErrorEventInit=$i.dictionaryConverter([...Qwe,{key:"message",converter:$i.converters.DOMString,defaultValue:""},{key:"filename",converter:$i.converters.USVString,defaultValue:""},{key:"lineno",converter:$i.converters["unsigned long"],defaultValue:0},{key:"colno",converter:$i.converters["unsigned long"],defaultValue:0},{key:"error",converter:$i.converters.any}]);fxt.exports={MessageEvent:IX,CloseEvent:kX,ErrorEvent:TX}});var PX=P((bxi,mxt)=>{"use strict";var{kReadyState:BX,kController:Qxn,kResponse:Lxn,kBinaryType:jxn,kWebSocketURL:Mxn}=Mq(),{states:DX,opcodes:dxt}=F4(),{MessageEvent:qxn,ErrorEvent:Uxn}=Lwe();function zxn(e){return e[BX]===DX.OPEN}function Hxn(e){return e[BX]===DX.CLOSING}function Vxn(e){return e[BX]===DX.CLOSED}function jwe(e,t,r=Event,n){let a=new r(e,n);t.dispatchEvent(a)}function $xn(e,t,r){if(e[BX]!==DX.OPEN)return;let n;if(t===dxt.TEXT)try{n=new TextDecoder("utf-8",{fatal:!0}).decode(r)}catch{hxt(e,"Received invalid UTF-8 in text frame.");return}else t===dxt.BINARY&&(e[jxn]==="blob"?n=new Blob([r]):n=new Uint8Array(r).buffer);jwe("message",e,qxn,{origin:e[Mxn].origin,data:n})}function Wxn(e){if(e.length===0)return!1;for(let t of e){let r=t.charCodeAt(0);if(r<33||r>126||t==="("||t===")"||t==="<"||t===">"||t==="@"||t===","||t===";"||t===":"||t==="\\"||t==='"'||t==="/"||t==="["||t==="]"||t==="?"||t==="="||t==="{"||t==="}"||r===32||r===9)return!1}return!0}function Gxn(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function hxt(e,t){let{[Qxn]:r,[Lxn]:n}=e;r.abort(),n!=null&&n.socket&&!n.socket.destroyed&&n.socket.destroy(),t&&jwe("error",e,Uxn,{error:new Error(t)})}mxt.exports={isEstablished:zxn,isClosing:Hxn,isClosed:Vxn,fireEvent:jwe,isValidSubprotocol:Wxn,isValidStatusCode:Gxn,failWebsocketConnection:hxt,websocketMessageReceived:$xn}});var bxt=P((Exi,xxt)=>{"use strict";var qwe=require("diagnostics_channel"),{uid:Yxn,states:Axt}=F4(),{kReadyState:yxt,kSentClose:gxt,kByteParser:vxt,kReceivedClose:Jxn}=Mq(),{fireEvent:Kxn,failWebsocketConnection:_D}=PX(),{CloseEvent:Xxn}=Lwe(),{makeRequest:Zxn}=Fq(),{fetching:ebn}=dX(),{Headers:tbn}=vD(),{getGlobalDispatcher:rbn}=b4(),{kHeadersList:nbn}=gu(),AS={};AS.open=qwe.channel("undici:websocket:open");AS.close=qwe.channel("undici:websocket:close");AS.socketError=qwe.channel("undici:websocket:socket_error");var Mwe;try{Mwe=require("crypto")}catch{}function ibn(e,t,r,n,a){var m;let s=e;s.protocol=e.protocol==="ws:"?"http:":"https:";let c=Zxn({urlList:[s],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(a.headers){let g=new tbn(a.headers)[nbn];c.headersList=g}let l=Mwe.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l),c.headersList.append("sec-websocket-version","13");for(let g of t)c.headersList.append("sec-websocket-protocol",g);let f="";return ebn({request:c,useParallelQueue:!0,dispatcher:(m=a.dispatcher)!=null?m:rbn(),processResponse(g){var I,k;if(g.type==="error"||g.status!==101){_D(r,"Received network error or non-101 status code.");return}if(t.length!==0&&!g.headersList.get("Sec-WebSocket-Protocol")){_D(r,"Server did not respond with sent protocols.");return}if(((I=g.headersList.get("Upgrade"))==null?void 0:I.toLowerCase())!=="websocket"){_D(r,'Server did not set Upgrade header to "websocket".');return}if(((k=g.headersList.get("Connection"))==null?void 0:k.toLowerCase())!=="upgrade"){_D(r,'Server did not set Connection header to "upgrade".');return}let x=g.headersList.get("Sec-WebSocket-Accept"),b=Mwe.createHash("sha1").update(l+Yxn).digest("base64");if(x!==b){_D(r,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=g.headersList.get("Sec-WebSocket-Extensions");if(A!==null&&A!==f){_D(r,"Received different permessage-deflate than the one set.");return}let C=g.headersList.get("Sec-WebSocket-Protocol");if(C!==null&&C!==c.headersList.get("Sec-WebSocket-Protocol")){_D(r,"Protocol was not set in the opening handshake.");return}g.socket.on("data",sbn),g.socket.on("close",abn),g.socket.on("error",obn),AS.open.hasSubscribers&&AS.open.publish({address:g.socket.address(),protocol:C,extensions:A}),n(g)}})}function sbn(e){this.ws[vxt].write(e)||this.pause()}function abn(){var s;let{ws:e}=this,t=e[gxt]&&e[Jxn],r=1005,n="",a=e[vxt].closingInfo;a?(r=(s=a.code)!=null?s:1005,n=a.reason):e[gxt]||(r=1006),e[yxt]=Axt.CLOSED,Kxn("close",e,Xxn,{wasClean:t,code:r,reason:n}),AS.close.hasSubscribers&&AS.close.publish({websocket:e,code:r,reason:n})}function obn(e){let{ws:t}=this;t[yxt]=Axt.CLOSING,AS.socketError.hasSubscribers&&AS.socketError.publish(e),this.destroy()}xxt.exports={establishWebSocketConnection:ibn}});var zwe=P((wxi,wxt)=>{"use strict";var{maxUnsigned16Bit:cbn}=F4(),Ext;try{Ext=require("crypto")}catch{}var Uwe=class{constructor(t){this.frameData=t,this.maskKey=Ext.randomBytes(4)}createFrame(t){var c,l;let r=(l=(c=this.frameData)==null?void 0:c.byteLength)!=null?l:0,n=r,a=6;r>cbn?(a+=8,n=127):r>125&&(a+=2,n=126);let s=Buffer.allocUnsafe(r+a);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+t;s[a-4]=this.maskKey[0],s[a-3]=this.maskKey[1],s[a-2]=this.maskKey[2],s[a-1]=this.maskKey[3],s[1]=n,n===126?s.writeUInt16BE(r,2):n===127&&(s[2]=s[3]=0,s.writeUIntBE(r,4,6)),s[1]|=128;for(let f=0;f<r;f++)s[a+f]=this.frameData[f]^this.maskKey[f%4];return s}};wxt.exports={WebsocketFrameSend:Uwe}});var Dxt=P((Sxi,Bxt)=>{"use strict";var{Writable:ubn}=require("stream"),Txt=require("diagnostics_channel"),{parserStates:Yy,opcodes:Jy,states:lbn,emptyBuffer:pbn}=F4(),{kReadyState:fbn,kSentClose:Sxt,kResponse:Cxt,kReceivedClose:_xt}=Mq(),{isValidStatusCode:Ixt,failWebsocketConnection:Uq,websocketMessageReceived:dbn}=PX(),{WebsocketFrameSend:kxt}=zwe(),O4={};O4.ping=Txt.channel("undici:websocket:ping");O4.pong=Txt.channel("undici:websocket:pong");var Vx,jm,ag,go,Q4,Hwe=class extends ubn{constructor(r){super();nr(this,Vx,[]);nr(this,jm,0);nr(this,ag,Yy.INFO);nr(this,go,{});nr(this,Q4,[]);this.ws=r}_write(r,n,a){re(this,Vx).push(r),Qt(this,jm,re(this,jm)+r.length),this.run(a)}run(r){var n,a;for(;;){if(re(this,ag)===Yy.INFO){if(re(this,jm)<2)return r();let s=this.consume(2);if(re(this,go).fin=(s[0]&128)!==0,re(this,go).opcode=s[0]&15,(a=(n=re(this,go)).originalOpcode)!=null||(n.originalOpcode=re(this,go).opcode),re(this,go).fragmented=!re(this,go).fin&&re(this,go).opcode!==Jy.CONTINUATION,re(this,go).fragmented&&re(this,go).opcode!==Jy.BINARY&&re(this,go).opcode!==Jy.TEXT){Uq(this.ws,"Invalid frame type was fragmented.");return}let c=s[1]&127;if(c<=125?(re(this,go).payloadLength=c,Qt(this,ag,Yy.READ_DATA)):c===126?Qt(this,ag,Yy.PAYLOADLENGTH_16):c===127&&Qt(this,ag,Yy.PAYLOADLENGTH_64),re(this,go).fragmented&&c>125){Uq(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((re(this,go).opcode===Jy.PING||re(this,go).opcode===Jy.PONG||re(this,go).opcode===Jy.CLOSE)&&c>125){Uq(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(re(this,go).opcode===Jy.CLOSE){if(c===1){Uq(this.ws,"Received close frame with a 1-byte body.");return}let l=this.consume(c);if(re(this,go).closeInfo=this.parseCloseBody(!1,l),!this.ws[Sxt]){let f=Buffer.allocUnsafe(2);f.writeUInt16BE(re(this,go).closeInfo.code,0);let d=new kxt(f);this.ws[Cxt].socket.write(d.createFrame(Jy.CLOSE),m=>{m||(this.ws[Sxt]=!0)})}this.ws[fbn]=lbn.CLOSING,this.ws[_xt]=!0,this.end();return}else if(re(this,go).opcode===Jy.PING){let l=this.consume(c);if(!this.ws[_xt]){let f=new kxt(l);this.ws[Cxt].socket.write(f.createFrame(Jy.PONG)),O4.ping.hasSubscribers&&O4.ping.publish({payload:l})}if(Qt(this,ag,Yy.INFO),re(this,jm)>0)continue;r();return}else if(re(this,go).opcode===Jy.PONG){let l=this.consume(c);if(O4.pong.hasSubscribers&&O4.pong.publish({payload:l}),re(this,jm)>0)continue;r();return}}else if(re(this,ag)===Yy.PAYLOADLENGTH_16){if(re(this,jm)<2)return r();let s=this.consume(2);re(this,go).payloadLength=s.readUInt16BE(0),Qt(this,ag,Yy.READ_DATA)}else if(re(this,ag)===Yy.PAYLOADLENGTH_64){if(re(this,jm)<8)return r();let s=this.consume(8),c=s.readUInt32BE(0);if(c>2**31-1){Uq(this.ws,"Received payload length > 2^31 bytes.");return}let l=s.readUInt32BE(4);re(this,go).payloadLength=(c<<8)+l,Qt(this,ag,Yy.READ_DATA)}else if(re(this,ag)===Yy.READ_DATA){if(re(this,jm)<re(this,go).payloadLength)return r();if(re(this,jm)>=re(this,go).payloadLength){let s=this.consume(re(this,go).payloadLength);if(re(this,Q4).push(s),!re(this,go).fragmented||re(this,go).fin&&re(this,go).opcode===Jy.CONTINUATION){let c=Buffer.concat(re(this,Q4));dbn(this.ws,re(this,go).originalOpcode,c),Qt(this,go,{}),re(this,Q4).length=0}Qt(this,ag,Yy.INFO)}}if(!(re(this,jm)>0)){r();break}}}consume(r){if(r>re(this,jm))return null;if(r===0)return pbn;if(re(this,Vx)[0].length===r)return Qt(this,jm,re(this,jm)-re(this,Vx)[0].length),re(this,Vx).shift();let n=Buffer.allocUnsafe(r),a=0;for(;a!==r;){let s=re(this,Vx)[0],{length:c}=s;if(c+a===r){n.set(re(this,Vx).shift(),a);break}else if(c+a>r){n.set(s.subarray(0,r-a),a),re(this,Vx)[0]=s.subarray(r-a);break}else n.set(re(this,Vx).shift(),a),a+=s.length}return Qt(this,jm,re(this,jm)-r),n}parseCloseBody(r,n){let a;if(n.length>=2&&(a=n.readUInt16BE(0)),r)return Ixt(a)?{code:a}:null;let s=n.subarray(2);if(s[0]===239&&s[1]===187&&s[2]===191&&(s=s.subarray(3)),a!==void 0&&!Ixt(a))return null;try{s=new TextDecoder("utf-8",{fatal:!0}).decode(s)}catch{return null}return{code:a,reason:s}}get closingInfo(){return re(this,go).closeInfo}};Vx=new WeakMap,jm=new WeakMap,ag=new WeakMap,go=new WeakMap,Q4=new WeakMap;Bxt.exports={ByteParser:Hwe}});var Mxt=P((_xi,jxt)=>{"use strict";var{webidl:ws}=Pm(),{DOMException:bI}=pI(),{URLSerializer:hbn}=jx(),{getGlobalOrigin:mbn}=ZO(),{staticPropertyDescriptors:EI,states:L4,opcodes:zq,emptyBuffer:gbn}=F4(),{kWebSocketURL:Pxt,kReadyState:yS,kController:Abn,kBinaryType:RX,kResponse:NX,kSentClose:ybn,kByteParser:vbn}=Mq(),{isEstablished:Rxt,isClosing:Nxt,isValidSubprotocol:xbn,failWebsocketConnection:bbn,fireEvent:Ebn}=PX(),{establishWebSocketConnection:wbn}=bxt(),{WebsocketFrameSend:Hq}=zwe(),{ByteParser:Sbn}=Dxt(),{kEnumerableProperty:Ky,isBlobLike:Oxt}=mo(),{getGlobalDispatcher:Cbn}=b4(),{types:Qxt}=require("util"),Fxt=!1,ml,Xy,Vq,$q,FX,Lxt,xu=class xu extends EventTarget{constructor(r,n=[]){super();nr(this,FX);nr(this,ml,{open:null,error:null,close:null,message:null});nr(this,Xy,0);nr(this,Vq,"");nr(this,$q,"");ws.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"}),Fxt||(Fxt=!0,process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"}));let a=ws.converters["DOMString or sequence<DOMString> or WebSocketInit"](n);r=ws.converters.USVString(r),n=a.protocols;let s=mbn(),c;try{c=new URL(r,s)}catch(l){throw new bI(l,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new bI(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new bI("Got fragment","SyntaxError");if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(l=>l.toLowerCase())).size)throw new bI("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(l=>xbn(l)))throw new bI("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[Pxt]=new URL(c.href),this[Abn]=wbn(c,n,this,l=>yr(this,FX,Lxt).call(this,l),a),this[yS]=xu.CONNECTING,this[RX]="blob"}close(r=void 0,n=void 0){if(ws.brandCheck(this,xu),r!==void 0&&(r=ws.converters["unsigned short"](r,{clamp:!0})),n!==void 0&&(n=ws.converters.USVString(n)),r!==void 0&&r!==1e3&&(r<3e3||r>4999))throw new bI("invalid code","InvalidAccessError");let a=0;if(n!==void 0&&(a=Buffer.byteLength(n),a>123))throw new bI(`Reason must be less than 123 bytes; received ${a}`,"SyntaxError");if(!(this[yS]===xu.CLOSING||this[yS]===xu.CLOSED))if(!Rxt(this))bbn(this,"Connection was closed before it was established."),this[yS]=xu.CLOSING;else if(Nxt(this))this[yS]=xu.CLOSING;else{let s=new Hq;r!==void 0&&n===void 0?(s.frameData=Buffer.allocUnsafe(2),s.frameData.writeUInt16BE(r,0)):r!==void 0&&n!==void 0?(s.frameData=Buffer.allocUnsafe(2+a),s.frameData.writeUInt16BE(r,0),s.frameData.write(n,2,"utf-8")):s.frameData=gbn,this[NX].socket.write(s.createFrame(zq.CLOSE),l=>{l||(this[ybn]=!0)}),this[yS]=L4.CLOSING}}send(r){if(ws.brandCheck(this,xu),ws.argumentLengthCheck(arguments,1,{header:"WebSocket.send"}),r=ws.converters.WebSocketSendData(r),this[yS]===xu.CONNECTING)throw new bI("Sent before connected.","InvalidStateError");if(!Rxt(this)||Nxt(this))return;let n=this[NX].socket;if(typeof r=="string"){let a=Buffer.from(r),c=new Hq(a).createFrame(zq.TEXT);Qt(this,Xy,re(this,Xy)+a.byteLength),n.write(c,()=>{Qt(this,Xy,re(this,Xy)-a.byteLength)})}else if(Qxt.isArrayBuffer(r)){let a=Buffer.from(r),c=new Hq(a).createFrame(zq.BINARY);Qt(this,Xy,re(this,Xy)+a.byteLength),n.write(c,()=>{Qt(this,Xy,re(this,Xy)-a.byteLength)})}else if(ArrayBuffer.isView(r)){let a=Buffer.from(r,r.byteOffset,r.byteLength),c=new Hq(a).createFrame(zq.BINARY);Qt(this,Xy,re(this,Xy)+a.byteLength),n.write(c,()=>{Qt(this,Xy,re(this,Xy)-a.byteLength)})}else if(Oxt(r)){let a=new Hq;r.arrayBuffer().then(s=>{let c=Buffer.from(s);a.frameData=c;let l=a.createFrame(zq.BINARY);Qt(this,Xy,re(this,Xy)+c.byteLength),n.write(l,()=>{Qt(this,Xy,re(this,Xy)-c.byteLength)})})}}get readyState(){return ws.brandCheck(this,xu),this[yS]}get bufferedAmount(){return ws.brandCheck(this,xu),re(this,Xy)}get url(){return ws.brandCheck(this,xu),hbn(this[Pxt])}get extensions(){return ws.brandCheck(this,xu),re(this,$q)}get protocol(){return ws.brandCheck(this,xu),re(this,Vq)}get onopen(){return ws.brandCheck(this,xu),re(this,ml).open}set onopen(r){ws.brandCheck(this,xu),re(this,ml).open&&this.removeEventListener("open",re(this,ml).open),typeof r=="function"?(re(this,ml).open=r,this.addEventListener("open",r)):re(this,ml).open=null}get onerror(){return ws.brandCheck(this,xu),re(this,ml).error}set onerror(r){ws.brandCheck(this,xu),re(this,ml).error&&this.removeEventListener("error",re(this,ml).error),typeof r=="function"?(re(this,ml).error=r,this.addEventListener("error",r)):re(this,ml).error=null}get onclose(){return ws.brandCheck(this,xu),re(this,ml).close}set onclose(r){ws.brandCheck(this,xu),re(this,ml).close&&this.removeEventListener("close",re(this,ml).close),typeof r=="function"?(re(this,ml).close=r,this.addEventListener("close",r)):re(this,ml).close=null}get onmessage(){return ws.brandCheck(this,xu),re(this,ml).message}set onmessage(r){ws.brandCheck(this,xu),re(this,ml).message&&this.removeEventListener("message",re(this,ml).message),typeof r=="function"?(re(this,ml).message=r,this.addEventListener("message",r)):re(this,ml).message=null}get binaryType(){return ws.brandCheck(this,xu),this[RX]}set binaryType(r){ws.brandCheck(this,xu),r!=="blob"&&r!=="arraybuffer"?this[RX]="blob":this[RX]=r}};ml=new WeakMap,Xy=new WeakMap,Vq=new WeakMap,$q=new WeakMap,FX=new WeakSet,Lxt=function(r){this[NX]=r;let n=new Sbn(this);n.on("drain",function(){this.ws[NX].socket.resume()}),r.socket.ws=this,this[vbn]=n,this[yS]=L4.OPEN;let a=r.headersList.get("sec-websocket-extensions");a!==null&&Qt(this,$q,a);let s=r.headersList.get("sec-websocket-protocol");s!==null&&Qt(this,Vq,s),Ebn("open",this)};var lA=xu;lA.CONNECTING=lA.prototype.CONNECTING=L4.CONNECTING;lA.OPEN=lA.prototype.OPEN=L4.OPEN;lA.CLOSING=lA.prototype.CLOSING=L4.CLOSING;lA.CLOSED=lA.prototype.CLOSED=L4.CLOSED;Object.defineProperties(lA.prototype,{CONNECTING:EI,OPEN:EI,CLOSING:EI,CLOSED:EI,url:Ky,readyState:Ky,bufferedAmount:Ky,onopen:Ky,onerror:Ky,onclose:Ky,close:Ky,onmessage:Ky,binaryType:Ky,send:Ky,extensions:Ky,protocol:Ky,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(lA,{CONNECTING:EI,OPEN:EI,CLOSING:EI,CLOSED:EI});ws.converters["sequence<DOMString>"]=ws.sequenceConverter(ws.converters.DOMString);ws.converters["DOMString or sequence<DOMString>"]=function(e){return ws.util.Type(e)==="Object"&&Symbol.iterator in e?ws.converters["sequence<DOMString>"](e):ws.converters.DOMString(e)};ws.converters.WebSocketInit=ws.dictionaryConverter([{key:"protocols",converter:ws.converters["DOMString or sequence<DOMString>"],get defaultValue(){return[]}},{key:"dispatcher",converter:e=>e,get defaultValue(){return Cbn()}},{key:"headers",converter:ws.nullableConverter(ws.converters.HeadersInit)}]);ws.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(e){return ws.util.Type(e)==="Object"&&!(Symbol.iterator in e)?ws.converters.WebSocketInit(e):{protocols:ws.converters["DOMString or sequence<DOMString>"](e)}};ws.converters.WebSocketSendData=function(e){if(ws.util.Type(e)==="Object"){if(Oxt(e))return ws.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||Qxt.isAnyArrayBuffer(e))return ws.converters.BufferSource(e)}return ws.converters.USVString(e)};jxt.exports={WebSocket:lA}});var Hxt=P((kxi,Gs)=>{"use strict";var _bn=Eq(),qxt=dK(),Uxt=jc(),Ibn=f4(),kbn=Kgt(),Tbn=_q(),ID=mo(),{InvalidArgumentError:OX}=Uxt,j4=UAt(),Bbn=hq(),Dbn=ewe(),Pbn=Syt(),Rbn=nwe(),Nbn=U1e(),Fbn=Byt(),Obn=Fyt(),{getGlobalDispatcher:zxt,setGlobalDispatcher:Qbn}=b4(),Lbn=qyt(),jbn=ZEe(),Mbn=AK(),Vwe;try{require("crypto"),Vwe=!0}catch{Vwe=!1}Object.assign(qxt.prototype,j4);Gs.exports.Dispatcher=qxt;Gs.exports.Client=_bn;Gs.exports.Pool=Ibn;Gs.exports.BalancedPool=kbn;Gs.exports.Agent=Tbn;Gs.exports.ProxyAgent=Fbn;Gs.exports.RetryHandler=Obn;Gs.exports.DecoratorHandler=Lbn;Gs.exports.RedirectHandler=jbn;Gs.exports.createRedirectInterceptor=Mbn;Gs.exports.buildConnector=Bbn;Gs.exports.errors=Uxt;function Wq(e){return(t,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!t||typeof t!="string"&&typeof t!="object"&&!(t instanceof URL))throw new OX("invalid url");if(r!=null&&typeof r!="object")throw new OX("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new OX("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),t=new URL(ID.parseOrigin(t).origin+c)}else r||(r=typeof t=="object"?t:{}),t=ID.parseURL(t);let{agent:a,dispatcher:s=zxt()}=r;if(a)throw new OX("unsupported opts.agent. Did you mean opts.client?");return e.call(s,{...r,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}Gs.exports.setGlobalDispatcher=Qbn;Gs.exports.getGlobalDispatcher=zxt;if(ID.nodeMajor>16||ID.nodeMajor===16&&ID.nodeMinor>=8){let e=null;Gs.exports.fetch=async function(c){e||(e=dX().fetch);try{return await e(...arguments)}catch(l){throw typeof l=="object"&&Error.captureStackTrace(l,this),l}},Gs.exports.Headers=vD().Headers,Gs.exports.Response=tX().Response,Gs.exports.Request=Fq().Request,Gs.exports.FormData=lK().FormData,Gs.exports.File=cK().File,Gs.exports.FileReader=Qvt().FileReader;let{setGlobalOrigin:t,getGlobalOrigin:r}=ZO();Gs.exports.setGlobalOrigin=t,Gs.exports.getGlobalOrigin=r;let{CacheStorage:n}=Jvt(),{kConstruct:a}=AX();Gs.exports.caches=new n(a)}if(ID.nodeMajor>=16){let{deleteCookie:e,getCookies:t,getSetCookies:r,setCookie:n}=uxt();Gs.exports.deleteCookie=e,Gs.exports.getCookies=t,Gs.exports.getSetCookies=r,Gs.exports.setCookie=n;let{parseMIMEType:a,serializeAMimeType:s}=jx();Gs.exports.parseMIMEType=a,Gs.exports.serializeAMimeType=s}if(ID.nodeMajor>=18&&Vwe){let{WebSocket:e}=Mxt();Gs.exports.WebSocket=e}Gs.exports.request=Wq(j4.request);Gs.exports.stream=Wq(j4.stream);Gs.exports.pipeline=Wq(j4.pipeline);Gs.exports.connect=Wq(j4.connect);Gs.exports.upgrade=Wq(j4.upgrade);Gs.exports.MockClient=Dbn;Gs.exports.MockPool=Rbn;Gs.exports.MockAgent=Pbn;Gs.exports.mockErrors=Nbn});var Yxt=P((Txi,Gxt)=>{Gxt.exports=Wxt;var Wwe=require("fs"),{EventEmitter:qbn}=require("events"),{Minimatch:$we}=require("minimatch"),{resolve:Ubn}=require("path");function zbn(e,t){return new Promise((r,n)=>{Wwe.readdir(e,{withFileTypes:!0},(a,s)=>{if(a)switch(a.code){case"ENOTDIR":t?n(a):r([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":r([]);break;case"ELOOP":default:n(a);break}else r(s)})})}function Vxt(e,t){return new Promise((r,n)=>{(t?Wwe.stat:Wwe.lstat)(e,(s,c)=>{if(s)switch(s.code){case"ENOENT":r(t?Vxt(e,!1):null);break;default:r(null);break}else r(c)})})}async function*$xt(e,t,r,n,a,s){let c=await zbn(t+e,s);for(let l of c){let f=l.name;f===void 0&&(f=l,n=!0);let d=e+"/"+f,m=d.slice(1),g=t+"/"+m,x=null;(n||r)&&(x=await Vxt(g,r)),!x&&l.name!==void 0&&(x=l),x===null&&(x={isDirectory:()=>!1}),x.isDirectory()?a(m)||(yield{relative:m,absolute:g,stats:x},yield*$xt(d,t,r,n,a,!1)):yield{relative:m,absolute:g,stats:x}}}async function*Hbn(e,t,r,n){yield*$xt("",e,t,r,n,!0)}function Vbn(e){return{pattern:e.pattern,dot:!!e.dot,noglobstar:!!e.noglobstar,matchBase:!!e.matchBase,nocase:!!e.nocase,ignore:e.ignore,skip:e.skip,follow:!!e.follow,stat:!!e.stat,nodir:!!e.nodir,mark:!!e.mark,silent:!!e.silent,absolute:!!e.absolute}}var QX=class extends qbn{constructor(t,r,n){if(super(),typeof r=="function"&&(n=r,r=null),this.options=Vbn(r||{}),this.matchers=[],this.options.pattern){let a=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=a.map(s=>new $we(s,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let a=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=a.map(s=>new $we(s,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let a=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=a.map(s=>new $we(s,{dot:!0}))}this.iterator=Hbn(Ubn(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,n&&(this._matches=[],this.on("match",a=>this._matches.push(this.options.absolute?a.absolute:a.relative)),this.on("error",a=>n(a)),this.on("end",()=>n(null,this._matches))),setTimeout(()=>this._next(),0)}_shouldSkipDirectory(t){return this.skipMatchers.some(r=>r.match(t))}_fileMatches(t,r){let n=t+(r?"/":"");return(this.matchers.length===0||this.matchers.some(a=>a.match(n)))&&!this.ignoreMatchers.some(a=>a.match(n))&&(!this.options.nodir||!r)}_next(){!this.paused&&!this.aborted?this.iterator.next().then(t=>{if(t.done)this.emit("end");else{let r=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,r)){let n=t.value.relative,a=t.value.absolute;this.options.mark&&r&&(n+="/",a+="/"),this.options.stat?this.emit("match",{relative:n,absolute:a,stat:t.value.stats}):this.emit("match",{relative:n,absolute:a})}this._next(this.iterator)}}).catch(t=>{this.abort(),this.emit("error",t),!t.code&&!this.options.silent&&console.error(t)}):this.inactive=!0}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}};function Wxt(e,t,r){return new QX(e,t,r)}Wxt.ReaddirGlob=QX});var Kxt=P((Bxi,Jxt)=>{"use strict";var f1=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";f1.writable=e=>f1(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";f1.readable=e=>f1(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";f1.duplex=e=>f1.writable(e)&&f1.readable(e);f1.transform=e=>f1.duplex(e)&&typeof e._transform=="function";Jxt.exports=f1});var Gq=P((Dxi,Gwe)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Gwe.exports={nextTick:$bn}:Gwe.exports=process;function $bn(e,t,r,n){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var a=arguments.length,s,c;switch(a){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,n)});default:for(s=new Array(a-1),c=0;c<s.length;)s[c++]=arguments[c];return process.nextTick(function(){e.apply(null,s)})}}});var Zxt=P((Pxi,Xxt)=>{var Wbn={}.toString;Xxt.exports=Array.isArray||function(e){return Wbn.call(e)=="[object Array]"}});var Ywe=P((Rxi,ebt)=>{ebt.exports=require("stream")});var Yq=P((Jwe,rbt)=>{var LX=require("buffer"),vS=LX.Buffer;function tbt(e,t){for(var r in e)t[r]=e[r]}vS.from&&vS.alloc&&vS.allocUnsafe&&vS.allocUnsafeSlow?rbt.exports=LX:(tbt(LX,Jwe),Jwe.Buffer=M4);function M4(e,t,r){return vS(e,t,r)}tbt(vS,M4);M4.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return vS(e,t,r)};M4.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=vS(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};M4.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return vS(e)};M4.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return LX.SlowBuffer(e)}});var nbt=P((Nxi,Kwe)=>{typeof Object.create=="function"?Kwe.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Kwe.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}});var q4=P((Fxi,Zwe)=>{try{if(Xwe=require("util"),typeof Xwe.inherits!="function")throw"";Zwe.exports=Xwe.inherits}catch{Zwe.exports=nbt()}var Xwe});var sbt=P((Oxi,e2e)=>{"use strict";function Gbn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ibt=Yq().Buffer,Jq=require("util");function Ybn(e,t,r){e.copy(t,r)}e2e.exports=function(){function e(){Gbn(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,a=""+n.data;n=n.next;)a+=r+n.data;return a},e.prototype.concat=function(r){if(this.length===0)return ibt.alloc(0);for(var n=ibt.allocUnsafe(r>>>0),a=this.head,s=0;a;)Ybn(a.data,n,s),s+=a.data.length,a=a.next;return n},e}();Jq&&Jq.inspect&&Jq.inspect.custom&&(e2e.exports.prototype[Jq.inspect.custom]=function(){var e=Jq.inspect({length:this.length});return this.constructor.name+" "+e})});var t2e=P((Qxi,abt)=>{"use strict";var jX=Gq();function Jbn(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return n||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,jX.nextTick(MX,this,e)):jX.nextTick(MX,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,jX.nextTick(MX,r,s)):jX.nextTick(MX,r,s):t&&t(s)}),this)}function Kbn(){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 MX(e,t){e.emit("error",t)}abt.exports={destroy:Jbn,undestroy:Kbn}});var cbt=P((Lxi,obt)=>{obt.exports=require("util").deprecate});var n2e=P((jxi,gbt)=>{"use strict";var kD=Gq();gbt.exports=Dp;function lbt(e){var t=this;this.next=null,this.entry=null,this.finish=function(){mEn(t,e)}}var Xbn=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:kD.nextTick,U4;Dp.WritableState=Xq;var pbt=Object.create(ZB());pbt.inherits=q4();var Zbn={deprecate:cbt()},fbt=Ywe(),UX=Yq().Buffer,eEn=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tEn(e){return UX.from(e)}function rEn(e){return UX.isBuffer(e)||e instanceof eEn}var dbt=t2e();pbt.inherits(Dp,fbt);function nEn(){}function Xq(e,t){U4=U4||TD(),e=e||{};var r=t instanceof U4;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,a=e.writableHighWaterMark,s=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=e.decodeStrings===!1;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(l){lEn(t,l)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new lbt(this)}Xq.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Xq.prototype,"buffer",{get:Zbn.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var qX;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(qX=Function.prototype[Symbol.hasInstance],Object.defineProperty(Dp,Symbol.hasInstance,{value:function(e){return qX.call(this,e)?!0:this!==Dp?!1:e&&e._writableState instanceof Xq}})):qX=function(e){return e instanceof this};function Dp(e){if(U4=U4||TD(),!qX.call(Dp,this)&&!(this instanceof U4))return new Dp(e);this._writableState=new Xq(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),fbt.call(this)}Dp.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function iEn(e,t){var r=new Error("write after end");e.emit("error",r),kD.nextTick(t,r)}function sEn(e,t,r,n){var a=!0,s=!1;return r===null?s=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),kD.nextTick(n,s),a=!1),a}Dp.prototype.write=function(e,t,r){var n=this._writableState,a=!1,s=!n.objectMode&&rEn(e);return s&&!UX.isBuffer(e)&&(e=tEn(e)),typeof t=="function"&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=nEn),n.ended?iEn(this,r):(s||sEn(this,n,e,r))&&(n.pendingcb++,a=oEn(this,n,s,e,t,r)),a};Dp.prototype.cork=function(){var e=this._writableState;e.corked++};Dp.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&hbt(this,e))};Dp.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function aEn(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=UX.from(t,r)),t}Object.defineProperty(Dp.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function oEn(e,t,r,n,a,s){if(!r){var c=aEn(t,n,a);n!==c&&(r=!0,a="buffer",n=c)}var l=t.objectMode?1:n.length;t.length+=l;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:a,isBuf:r,callback:s,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else r2e(e,t,!1,l,n,a,s);return f}function r2e(e,t,r,n,a,s,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}function cEn(e,t,r,n,a){--t.pendingcb,r?(kD.nextTick(a,n),kD.nextTick(Kq,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(a(n),e._writableState.errorEmitted=!0,e.emit("error",n),Kq(e,t))}function uEn(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function lEn(e,t){var r=e._writableState,n=r.sync,a=r.writecb;if(uEn(r),t)cEn(e,r,n,t,a);else{var s=mbt(r);!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&hbt(e,r),n?Xbn(ubt,e,r,s,a):ubt(e,r,s,a)}}function ubt(e,t,r,n){r||pEn(e,t),t.pendingcb--,n(),Kq(e,t)}function pEn(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function hbt(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var c=0,l=!0;r;)a[c]=r,r.isBuf||(l=!1),r=r.next,c+=1;a.allBuffers=l,r2e(e,t,!0,t.length,a,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new lbt(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,d=r.encoding,m=r.callback,g=t.objectMode?1:f.length;if(r2e(e,t,!1,g,f,d,m),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Dp.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};Dp.prototype._writev=null;Dp.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||hEn(this,n,r)};function mbt(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function fEn(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),Kq(e,t)})}function dEn(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,kD.nextTick(fEn,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Kq(e,t){var r=mbt(t);return r&&(dEn(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function hEn(e,t,r){t.ending=!0,Kq(e,t),r&&(t.finished?kD.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function mEn(e,t,r){var n=e.entry;for(e.entry=null;n;){var a=n.callback;t.pendingcb--,a(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(Dp.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Dp.prototype.destroy=dbt.destroy;Dp.prototype._undestroy=dbt.undestroy;Dp.prototype._destroy=function(e,t){this.end(),t(e)}});var TD=P((Mxi,xbt)=>{"use strict";var Abt=Gq(),gEn=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};xbt.exports=xS;var ybt=Object.create(ZB());ybt.inherits=q4();var vbt=a2e(),s2e=n2e();ybt.inherits(xS,vbt);for(i2e=gEn(s2e.prototype),zX=0;zX<i2e.length;zX++)HX=i2e[zX],xS.prototype[HX]||(xS.prototype[HX]=s2e.prototype[HX]);var i2e,HX,zX;function xS(e){if(!(this instanceof xS))return new xS(e);vbt.call(this,e),s2e.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",AEn)}Object.defineProperty(xS.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function AEn(){this.allowHalfOpen||this._writableState.ended||Abt.nextTick(yEn,this)}function yEn(e){e.end()}Object.defineProperty(xS.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});xS.prototype._destroy=function(e,t){this.push(null),this.end(),Abt.nextTick(t,e)}});var u2e=P(Ebt=>{"use strict";var c2e=Yq().Buffer,bbt=c2e.isEncoding||function(e){switch(e=""+e,e&&e.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 vEn(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function xEn(e){var t=vEn(e);if(typeof t!="string"&&(c2e.isEncoding===bbt||!bbt(e)))throw new Error("Unknown encoding: "+e);return t||e}Ebt.StringDecoder=Zq;function Zq(e){this.encoding=xEn(e);var t;switch(this.encoding){case"utf16le":this.text=_En,this.end=IEn,t=4;break;case"utf8":this.fillLast=wEn,t=4;break;case"base64":this.text=kEn,this.end=TEn,t=3;break;default:this.write=BEn,this.end=DEn;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=c2e.allocUnsafe(t)}Zq.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Zq.prototype.end=CEn;Zq.prototype.text=SEn;Zq.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o2e(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function bEn(e,t,r){var n=t.length-1;if(n<r)return 0;var a=o2e(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||a===-2?0:(a=o2e(t[n]),a>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||a===-2?0:(a=o2e(t[n]),a>=0?(a>0&&(a===2?a=0:e.lastNeed=a-3),a):0))}function EEn(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function wEn(e){var t=this.lastTotal-this.lastNeed,r=EEn(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function SEn(e,t){var r=bEn(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function CEn(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function _En(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function IEn(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function kEn(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function TEn(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function BEn(e){return e.toString(this.encoding)}function DEn(e){return e&&e.length?this.write(e):""}});var a2e=P((zxi,Nbt)=>{"use strict";var H4=Gq();Nbt.exports=bu;var PEn=Zxt(),e5;bu.ReadableState=Tbt;var Uxi=require("events").EventEmitter,_bt=function(e,t){return e.listeners(t).length},h2e=Ywe(),t5=Yq().Buffer,REn=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function NEn(e){return t5.from(e)}function FEn(e){return t5.isBuffer(e)||e instanceof REn}var Ibt=Object.create(ZB());Ibt.inherits=q4();var l2e=require("util"),Vo=void 0;l2e&&l2e.debuglog?Vo=l2e.debuglog("stream"):Vo=function(){};var OEn=sbt(),kbt=t2e(),z4;Ibt.inherits(bu,h2e);var p2e=["error","close","destroy","pause","resume"];function QEn(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):PEn(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function Tbt(e,t){e5=e5||TD(),e=e||{};var r=t instanceof e5;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new OEn,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(z4||(z4=u2e().StringDecoder),this.decoder=new z4(e.encoding),this.encoding=e.encoding)}function bu(e){if(e5=e5||TD(),!(this instanceof bu))return new bu(e);this._readableState=new Tbt(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),h2e.call(this)}Object.defineProperty(bu.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});bu.prototype.destroy=kbt.destroy;bu.prototype._undestroy=kbt.undestroy;bu.prototype._destroy=function(e,t){this.push(null),t(e)};bu.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=t5.from(e,t),t=""),n=!0),Bbt(this,e,t,!1,n)};bu.prototype.unshift=function(e){return Bbt(this,e,null,!0,!1)};function Bbt(e,t,r,n,a){var s=e._readableState;if(t===null)s.reading=!1,qEn(e,s);else{var c;a||(c=LEn(s,t)),c?e.emit("error",c):s.objectMode||t&&t.length>0?(typeof t!="string"&&!s.objectMode&&Object.getPrototypeOf(t)!==t5.prototype&&(t=NEn(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):f2e(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||t.length!==0?f2e(e,s,t,!1):Dbt(e,s)):f2e(e,s,t,!1))):n||(s.reading=!1)}return jEn(s)}function f2e(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&VX(e)),Dbt(e,t)}function LEn(e,t){var r;return!FEn(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function jEn(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}bu.prototype.isPaused=function(){return this._readableState.flowing===!1};bu.prototype.setEncoding=function(e){return z4||(z4=u2e().StringDecoder),this._readableState.decoder=new z4(e),this._readableState.encoding=e,this};var wbt=8388608;function MEn(e){return e>=wbt?e=wbt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Sbt(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=MEn(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}bu.prototype.read=function(e){Vo("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Vo("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?d2e(this):VX(this),null;if(e=Sbt(e,t),e===0&&t.ended)return t.length===0&&d2e(this),null;var n=t.needReadable;Vo("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Vo("length less than watermark",n)),t.ended||t.reading?(n=!1,Vo("reading or ended",n)):n&&(Vo("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Sbt(r,t)));var a;return e>0?a=Pbt(e,t):a=null,a===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&d2e(this)),a!==null&&this.emit("data",a),a};function qEn(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,VX(e)}}function VX(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Vo("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?H4.nextTick(Cbt,e):Cbt(e))}function Cbt(e){Vo("emit readable"),e.emit("readable"),m2e(e)}function Dbt(e,t){t.readingMore||(t.readingMore=!0,H4.nextTick(UEn,e,t))}function UEn(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Vo("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}bu.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};bu.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,Vo("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,s=a?l:I;n.endEmitted?H4.nextTick(s):r.once("end",s),e.on("unpipe",c);function c(k,O){Vo("onunpipe"),k===r&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,m())}function l(){Vo("onend"),e.end()}var f=zEn(r);e.on("drain",f);var d=!1;function m(){Vo("cleanup"),e.removeListener("close",A),e.removeListener("finish",C),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",I),r.removeListener("data",x),d=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}var g=!1;r.on("data",x);function x(k){Vo("ondata"),g=!1;var O=e.write(k);O===!1&&!g&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Rbt(n.pipes,e)!==-1)&&!d&&(Vo("false write response, pause",n.awaitDrain),n.awaitDrain++,g=!0),r.pause())}function b(k){Vo("onerror",k),I(),e.removeListener("error",b),_bt(e,"error")===0&&e.emit("error",k)}QEn(e,"error",b);function A(){e.removeListener("finish",C),I()}e.once("close",A);function C(){Vo("onfinish"),e.removeListener("close",A),I()}e.once("finish",C);function I(){Vo("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(Vo("pipe resume"),r.resume()),e};function zEn(e){return function(){var t=e._readableState;Vo("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&_bt(e,"data")&&(t.flowing=!0,m2e(e))}}bu.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<a;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var c=Rbt(t.pipes,e);return c===-1?this:(t.pipes.splice(c,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};bu.prototype.on=function(e,t){var r=h2e.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&VX(this):H4.nextTick(HEn,this))}return r};bu.prototype.addListener=bu.prototype.on;function HEn(e){Vo("readable nexttick read 0"),e.read(0)}bu.prototype.resume=function(){var e=this._readableState;return e.flowing||(Vo("resume"),e.flowing=!0,VEn(this,e)),this};function VEn(e,t){t.resumeScheduled||(t.resumeScheduled=!0,H4.nextTick($En,e,t))}function $En(e,t){t.reading||(Vo("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),m2e(e),t.flowing&&!t.reading&&e.read(0)}bu.prototype.pause=function(){return Vo("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Vo("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function m2e(e){var t=e._readableState;for(Vo("flow",t.flowing);t.flowing&&e.read()!==null;);}bu.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(Vo("wrapped end"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&t.push(c)}t.push(null)}),e.on("data",function(c){if(Vo("wrapped data"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var l=t.push(c);l||(n=!0,e.pause())}});for(var a in e)this[a]===void 0&&typeof e[a]=="function"&&(this[a]=function(c){return function(){return e[c].apply(e,arguments)}}(a));for(var s=0;s<p2e.length;s++)e.on(p2e[s],this.emit.bind(this,p2e[s]));return this._read=function(c){Vo("wrapped _read",c),n&&(n=!1,e.resume())},this};Object.defineProperty(bu.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});bu._fromList=Pbt;function Pbt(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=WEn(e,t.buffer,t.decoder),r}function WEn(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?GEn(e,t):YEn(e,t),n}function GEn(e,t){var r=t.head,n=1,a=r.data;for(e-=a.length;r=r.next;){var s=r.data,c=e>s.length?s.length:e;if(c===s.length?a+=s:a+=s.slice(0,e),e-=c,e===0){c===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(c));break}++n}return t.length-=n,a}function YEn(e,t){var r=t5.allocUnsafe(e),n=t.head,a=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var s=n.data,c=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,c),e-=c,e===0){c===s.length?(++a,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(c));break}++a}return t.length-=a,r}function d2e(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,H4.nextTick(JEn,t,e))}function JEn(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Rbt(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var g2e=P((Hxi,Qbt)=>{"use strict";Qbt.exports=bS;var $X=TD(),Obt=Object.create(ZB());Obt.inherits=q4();Obt.inherits(bS,$X);function KEn(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function bS(e){if(!(this instanceof bS))return new bS(e);$X.call(this,e),this._transformState={afterTransform:KEn.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",XEn)}function XEn(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){Fbt(e,t,r)}):Fbt(this,null,null)}bS.prototype.push=function(e,t){return this._transformState.needTransform=!1,$X.prototype.push.call(this,e,t)};bS.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};bS.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var a=this._readableState;(n.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}};bS.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};bS.prototype._destroy=function(e,t){var r=this;$X.prototype._destroy.call(this,e,function(n){t(n),r.emit("close")})};function Fbt(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var qbt=P((Vxi,Mbt)=>{"use strict";Mbt.exports=r5;var Lbt=g2e(),jbt=Object.create(ZB());jbt.inherits=q4();jbt.inherits(r5,Lbt);function r5(e){if(!(this instanceof r5))return new r5(e);Lbt.call(this,e)}r5.prototype._transform=function(e,t,r){r(null,e)}});var Ubt=P((Rd,WX)=>{var d1=require("stream");process.env.READABLE_STREAM==="disable"&&d1?(WX.exports=d1,Rd=WX.exports=d1.Readable,Rd.Readable=d1.Readable,Rd.Writable=d1.Writable,Rd.Duplex=d1.Duplex,Rd.Transform=d1.Transform,Rd.PassThrough=d1.PassThrough,Rd.Stream=d1):(Rd=WX.exports=a2e(),Rd.Stream=d1||Rd,Rd.Readable=Rd,Rd.Writable=n2e(),Rd.Duplex=TD(),Rd.Transform=g2e(),Rd.PassThrough=qbt())});var Hbt=P(($xi,zbt)=>{zbt.exports=Ubt().PassThrough});var Gbt=P((Wxi,Wbt)=>{var Vbt=require("util"),JX=Hbt();Wbt.exports={Readable:GX,Writable:YX};Vbt.inherits(GX,JX);Vbt.inherits(YX,JX);function $bt(e,t,r){e[t]=function(){return delete e[t],r.apply(this,arguments),this[t].apply(this,arguments)}}function GX(e,t){if(!(this instanceof GX))return new GX(e,t);JX.call(this,t),$bt(this,"_read",function(){var r=e.call(this,t),n=this.emit.bind(this,"error");r.on("error",n),r.pipe(this)}),this.emit("readable")}function YX(e,t){if(!(this instanceof YX))return new YX(e,t);JX.call(this,t),$bt(this,"_write",function(){var r=e.call(this,t),n=this.emit.bind(this,"error");r.on("error",n),this.pipe(r)}),this.emit("writable")}});var A2e=P((Gxi,Ybt)=>{Ybt.exports=function(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var n="";if(r>4&&e[3]==="\\"){var a=e[2];(a==="?"||a===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//")}var s=e.split(/[/\\]+/);return t!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var Hu=P((Yxi,Jbt)=>{"use strict";var y2e=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
447
+ `.trim())}};wyt.exports=owe});var Byt=P((Wvi,Tyt)=>{"use strict";var{kProxy:YAn,kClose:JAn,kDestroy:KAn,kInterceptors:XAn}=gu(),{URL:Cyt}=require("url"),_yt=_q(),ZAn=f4(),eyn=dq(),{InvalidArgumentError:Dq,RequestAbortedError:tyn}=jc(),Iyt=hq(),Tq=Symbol("proxy agent"),YK=Symbol("proxy client"),Bq=Symbol("proxy headers"),cwe=Symbol("request tls settings"),ryn=Symbol("proxy tls settings"),kyt=Symbol("connect endpoint function");function nyn(e){return e==="https:"?443:80}function iyn(e){if(typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new Dq("Proxy opts.uri is mandatory");return{uri:e.uri,protocol:e.protocol||"https"}}function syn(e,t){return new ZAn(e,t)}var uwe=class extends eyn{constructor(t){if(super(t),this[YAn]=iyn(t),this[Tq]=new _yt(t),this[XAn]=t.interceptors&&t.interceptors.ProxyAgent&&Array.isArray(t.interceptors.ProxyAgent)?t.interceptors.ProxyAgent:[],typeof t=="string"&&(t={uri:t}),!t||!t.uri)throw new Dq("Proxy opts.uri is mandatory");let{clientFactory:r=syn}=t;if(typeof r!="function")throw new Dq("Proxy opts.clientFactory must be a function.");this[cwe]=t.requestTls,this[ryn]=t.proxyTls,this[Bq]=t.headers||{};let n=new Cyt(t.uri),{origin:a,port:s,host:c,username:l,password:f}=n;if(t.auth&&t.token)throw new Dq("opts.auth cannot be used in combination with opts.token");t.auth?this[Bq]["proxy-authorization"]=`Basic ${t.auth}`:t.token?this[Bq]["proxy-authorization"]=t.token:l&&f&&(this[Bq]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(l)}:${decodeURIComponent(f)}`).toString("base64")}`);let d=Iyt({...t.proxyTls});this[kyt]=Iyt({...t.requestTls}),this[YK]=r(n,{connect:d}),this[Tq]=new _yt({...t,connect:async(m,g)=>{let x=m.host;m.port||(x+=`:${nyn(m.protocol)}`);try{let{socket:b,statusCode:A}=await this[YK].connect({origin:a,port:s,path:x,signal:m.signal,headers:{...this[Bq],host:c}});if(A!==200&&(b.on("error",()=>{}).destroy(),g(new tyn(`Proxy response (${A}) !== 200 when HTTP Tunneling`))),m.protocol!=="https:"){g(null,b);return}let C;this[cwe]?C=this[cwe].servername:C=m.servername,this[kyt]({...m,servername:C,httpSocket:b},g)}catch(b){g(b)}}})}dispatch(t,r){let{host:n}=new Cyt(t.origin),a=ayn(t.headers);return oyn(a),this[Tq].dispatch({...t,headers:{...a,host:n}},r)}async[JAn](){await this[Tq].close(),await this[YK].close()}async[KAn](){await this[Tq].destroy(),await this[YK].destroy()}};function ayn(e){if(Array.isArray(e)){let t={};for(let r=0;r<e.length;r+=2)t[e[r]]=e[r+1];return t}return e}function oyn(e){if(e&&Object.keys(e).find(r=>r.toLowerCase()==="proxy-authorization"))throw new Dq("Proxy-Authorization should be sent in ProxyAgent constructor")}Tyt.exports=uwe});var Fyt=P((Gvi,Nyt)=>{var yD=require("assert"),{kRetryHandlerDefaultRetry:Dyt}=gu(),{RequestRetryError:JK}=jc(),{isDisturbed:Pyt,parseHeaders:cyn,parseRangeHeader:Ryt}=mo();function uyn(e){let t=Date.now();return new Date(e).getTime()-t}var lwe=class e{constructor(t,r){let{retryOptions:n,...a}=t,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:f,timeoutFactor:d,methods:m,errorCodes:g,retryAfter:x,statusCodes:b}=n!=null?n:{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts=a,this.abort=null,this.aborted=!1,this.retryOpts={retry:s!=null?s:e[Dyt],retryAfter:x!=null?x:!0,maxTimeout:l!=null?l:30*1e3,timeout:f!=null?f:500,timeoutFactor:d!=null?d:2,maxRetries:c!=null?c:5,methods:m!=null?m:["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:b!=null?b:[500,502,503,504,429],errorCodes:g!=null?g:["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(t,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(t,r,n)}onConnect(t){this.aborted?t(this.reason):this.abort=t}onBodySent(t){if(this.handler.onBodySent)return this.handler.onBodySent(t)}static[Dyt](t,{state:r,opts:n},a){let{statusCode:s,code:c,headers:l}=t,{method:f,retryOptions:d}=n,{maxRetries:m,timeout:g,maxTimeout:x,timeoutFactor:b,statusCodes:A,errorCodes:C,methods:I}=d,{counter:k,currentTimeout:O}=r;if(O=O!=null&&O>0?O:g,c&&c!=="UND_ERR_REQ_RETRY"&&c!=="UND_ERR_SOCKET"&&!C.includes(c)){a(t);return}if(Array.isArray(I)&&!I.includes(f)){a(t);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){a(t);return}if(k>m){a(t);return}let j=l!=null&&l["retry-after"];j&&(j=Number(j),j=isNaN(j)?uyn(j):j*1e3);let M=j>0?Math.min(j,x):Math.min(O*b**k,x);r.currentTimeout=M,setTimeout(()=>a(null),M)}onHeaders(t,r,n,a){let s=cyn(r);if(this.retryCount+=1,t>=300)return this.abort(new JK("Request failed",t,{headers:s,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,t!==206)return!0;let l=Ryt(s["content-range"]);if(!l)return this.abort(new JK("Content-Range mismatch",t,{headers:s,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new JK("ETag mismatch",t,{headers:s,count:this.retryCount})),!1;let{start:f,size:d,end:m=d}=l;return yD(this.start===f,"content-range mismatch"),yD(this.end==null||this.end===m,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(t===206){let l=Ryt(s["content-range"]);if(l==null)return this.handler.onHeaders(t,r,n,a);let{start:f,size:d,end:m=d}=l;yD(f!=null&&Number.isFinite(f)&&this.start!==f,"content-range mismatch"),yD(Number.isFinite(f)),yD(m!=null&&Number.isFinite(m)&&this.end!==m,"invalid content-length"),this.start=f,this.end=m}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l):null}return yD(Number.isFinite(this.start)),yD(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.handler.onHeaders(t,r,n,a)}let c=new JK("Request failed",t,{headers:s,count:this.retryCount});return this.abort(c),!1}onData(t){return this.start+=t.length,this.handler.onData(t)}onComplete(t){return this.retryCount=0,this.handler.onComplete(t)}onError(t){if(this.aborted||Pyt(this.opts.body))return this.handler.onError(t);this.retryOpts.retry(t,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){var a;if(n!=null||this.aborted||Pyt(this.opts.body))return this.handler.onError(n);this.start!==0&&(this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${(a=this.end)!=null?a:""}`}});try{this.dispatch(this.opts,this)}catch(s){this.handler.onError(s)}}}};Nyt.exports=lwe});var b4=P((Yvi,jyt)=>{"use strict";var Oyt=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:lyn}=jc(),pyn=_q();Lyt()===void 0&&Qyt(new pyn);function Qyt(e){if(!e||typeof e.dispatch!="function")throw new lyn("Argument agent must implement Agent");Object.defineProperty(globalThis,Oyt,{value:e,writable:!0,enumerable:!1,configurable:!1})}function Lyt(){return globalThis[Oyt]}jyt.exports={setGlobalDispatcher:Qyt,getGlobalDispatcher:Lyt}});var qyt=P((Kvi,Myt)=>{"use strict";Myt.exports=class{constructor(t){this.handler=t}onConnect(...t){return this.handler.onConnect(...t)}onError(...t){return this.handler.onError(...t)}onUpgrade(...t){return this.handler.onUpgrade(...t)}onHeaders(...t){return this.handler.onHeaders(...t)}onData(...t){return this.handler.onData(...t)}onComplete(...t){return this.handler.onComplete(...t)}onBodySent(...t){return this.handler.onBodySent(...t)}}});var vD=P((Xvi,$yt)=>{"use strict";var{kHeadersList:ng,kConstruct:fyn}=gu(),{kGuard:c1}=sS(),{kEnumerableProperty:o1}=mo(),{makeIterator:E4,isValidHeaderName:Pq,isValidHeaderValue:zyt}=Vy(),dyn=require("util"),{webidl:ma}=Pm(),hyn=require("assert"),rg=Symbol("headers map"),Pd=Symbol("headers map sorted");function Uyt(e){return e===10||e===13||e===9||e===32}function Hyt(e){let t=0,r=e.length;for(;r>t&&Uyt(e.charCodeAt(r-1));)--r;for(;r>t&&Uyt(e.charCodeAt(t));)++t;return t===0&&r===e.length?e:e.substring(t,r)}function Vyt(e,t){if(Array.isArray(t))for(let r=0;r<t.length;++r){let n=t[r];if(n.length!==2)throw ma.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${n.length}.`});pwe(e,n[0],n[1])}else if(typeof t=="object"&&t!==null){let r=Object.keys(t);for(let n=0;n<r.length;++n)pwe(e,r[n],t[r[n]])}else throw ma.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function pwe(e,t,r){if(r=Hyt(r),Pq(t)){if(!zyt(r))throw ma.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ma.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(e[c1]==="immutable")throw new TypeError("immutable");return e[c1],e[ng].append(t,r)}var KK=class e{cookies=null;constructor(t){t instanceof e?(this[rg]=new Map(t[rg]),this[Pd]=t[Pd],this.cookies=t.cookies===null?null:[...t.cookies]):(this[rg]=new Map(t),this[Pd]=null)}contains(t){return t=t.toLowerCase(),this[rg].has(t)}clear(){this[rg].clear(),this[Pd]=null,this.cookies=null}append(t,r){var s;this[Pd]=null;let n=t.toLowerCase(),a=this[rg].get(n);if(a){let c=n==="cookie"?"; ":", ";this[rg].set(n,{name:a.name,value:`${a.value}${c}${r}`})}else this[rg].set(n,{name:t,value:r});n==="set-cookie"&&((s=this.cookies)!=null||(this.cookies=[]),this.cookies.push(r))}set(t,r){this[Pd]=null;let n=t.toLowerCase();n==="set-cookie"&&(this.cookies=[r]),this[rg].set(n,{name:t,value:r})}delete(t){this[Pd]=null,t=t.toLowerCase(),t==="set-cookie"&&(this.cookies=null),this[rg].delete(t)}get(t){let r=this[rg].get(t.toLowerCase());return r===void 0?null:r.value}*[Symbol.iterator](){for(let[t,{value:r}]of this[rg])yield[t,r]}get entries(){let t={};if(this[rg].size)for(let{name:r,value:n}of this[rg].values())t[r]=n;return t}},w4=class e{constructor(t=void 0){t!==fyn&&(this[ng]=new KK,this[c1]="none",t!==void 0&&(t=ma.converters.HeadersInit(t),Vyt(this,t)))}append(t,r){return ma.brandCheck(this,e),ma.argumentLengthCheck(arguments,2,{header:"Headers.append"}),t=ma.converters.ByteString(t),r=ma.converters.ByteString(r),pwe(this,t,r)}delete(t){if(ma.brandCheck(this,e),ma.argumentLengthCheck(arguments,1,{header:"Headers.delete"}),t=ma.converters.ByteString(t),!Pq(t))throw ma.errors.invalidArgument({prefix:"Headers.delete",value:t,type:"header name"});if(this[c1]==="immutable")throw new TypeError("immutable");this[c1],this[ng].contains(t)&&this[ng].delete(t)}get(t){if(ma.brandCheck(this,e),ma.argumentLengthCheck(arguments,1,{header:"Headers.get"}),t=ma.converters.ByteString(t),!Pq(t))throw ma.errors.invalidArgument({prefix:"Headers.get",value:t,type:"header name"});return this[ng].get(t)}has(t){if(ma.brandCheck(this,e),ma.argumentLengthCheck(arguments,1,{header:"Headers.has"}),t=ma.converters.ByteString(t),!Pq(t))throw ma.errors.invalidArgument({prefix:"Headers.has",value:t,type:"header name"});return this[ng].contains(t)}set(t,r){if(ma.brandCheck(this,e),ma.argumentLengthCheck(arguments,2,{header:"Headers.set"}),t=ma.converters.ByteString(t),r=ma.converters.ByteString(r),r=Hyt(r),Pq(t)){if(!zyt(r))throw ma.errors.invalidArgument({prefix:"Headers.set",value:r,type:"header value"})}else throw ma.errors.invalidArgument({prefix:"Headers.set",value:t,type:"header name"});if(this[c1]==="immutable")throw new TypeError("immutable");this[c1],this[ng].set(t,r)}getSetCookie(){ma.brandCheck(this,e);let t=this[ng].cookies;return t?[...t]:[]}get[Pd](){if(this[ng][Pd])return this[ng][Pd];let t=[],r=[...this[ng]].sort((a,s)=>a[0]<s[0]?-1:1),n=this[ng].cookies;for(let a=0;a<r.length;++a){let[s,c]=r[a];if(s==="set-cookie")for(let l=0;l<n.length;++l)t.push([s,n[l]]);else hyn(c!==null),t.push([s,c])}return this[ng][Pd]=t,t}keys(){if(ma.brandCheck(this,e),this[c1]==="immutable"){let t=this[Pd];return E4(()=>t,"Headers","key")}return E4(()=>[...this[Pd].values()],"Headers","key")}values(){if(ma.brandCheck(this,e),this[c1]==="immutable"){let t=this[Pd];return E4(()=>t,"Headers","value")}return E4(()=>[...this[Pd].values()],"Headers","value")}entries(){if(ma.brandCheck(this,e),this[c1]==="immutable"){let t=this[Pd];return E4(()=>t,"Headers","key+value")}return E4(()=>[...this[Pd].values()],"Headers","key+value")}forEach(t,r=globalThis){if(ma.brandCheck(this,e),ma.argumentLengthCheck(arguments,1,{header:"Headers.forEach"}),typeof t!="function")throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(let[n,a]of this)t.apply(r,[a,n,this])}[Symbol.for("nodejs.util.inspect.custom")](){return ma.brandCheck(this,e),this[ng]}};w4.prototype[Symbol.iterator]=w4.prototype.entries;Object.defineProperties(w4.prototype,{append:o1,delete:o1,get:o1,has:o1,set:o1,getSetCookie:o1,keys:o1,values:o1,entries:o1,forEach:o1,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:"Headers",configurable:!0},[dyn.inspect.custom]:{enumerable:!1}});ma.converters.HeadersInit=function(e){if(ma.util.Type(e)==="Object")return e[Symbol.iterator]?ma.converters["sequence<sequence<ByteString>>"](e):ma.converters["record<ByteString, ByteString>"](e);throw ma.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})};$yt.exports={fill:Vyt,Headers:w4,HeadersList:KK}});var tX=P((Zvi,evt)=>{"use strict";var{Headers:myn,HeadersList:Wyt,fill:gyn}=vD(),{extractBody:Gyt,cloneBody:Ayn,mixinBody:yyn}=lq(),hwe=mo(),{kEnumerableProperty:oA}=hwe,{isValidReasonPhrase:vyn,isCancelled:xyn,isAborted:byn,isBlobLike:Eyn,serializeJavascriptValueToJSONString:wyn,isErrorLike:Syn,isomorphicEncode:Cyn}=Vy(),{redirectStatusSet:_yn,nullBodyStatus:Iyn,DOMException:Yyt}=pI(),{kState:zu,kHeaders:Vf,kGuard:S4,kRealm:aA}=sS(),{webidl:na}=Pm(),{FormData:kyn}=lK(),{getGlobalOrigin:Tyn}=ZO(),{URLSerializer:Jyt}=jx(),{kHeadersList:fwe,kConstruct:Byn}=gu(),mwe=require("assert"),{types:dwe}=require("util"),Xyt=globalThis.ReadableStream||require("stream/web").ReadableStream,Dyn=new TextEncoder("utf-8"),C4=class e{static error(){let t={settingsObject:{}},r=new e;return r[zu]=ZK(),r[aA]=t,r[Vf][fwe]=r[zu].headersList,r[Vf][S4]="immutable",r[Vf][aA]=t,r}static json(t,r={}){na.argumentLengthCheck(arguments,1,{header:"Response.json"}),r!==null&&(r=na.converters.ResponseInit(r));let n=Dyn.encode(wyn(t)),a=Gyt(n),s={settingsObject:{}},c=new e;return c[aA]=s,c[Vf][S4]="response",c[Vf][aA]=s,Kyt(c,r,{body:a[0],type:"application/json"}),c}static redirect(t,r=302){let n={settingsObject:{}};na.argumentLengthCheck(arguments,1,{header:"Response.redirect"}),t=na.converters.USVString(t),r=na.converters["unsigned short"](r);let a;try{a=new URL(t,Tyn())}catch(l){throw Object.assign(new TypeError("Failed to parse URL from "+t),{cause:l})}if(!_yn.has(r))throw new RangeError("Invalid status code "+r);let s=new e;s[aA]=n,s[Vf][S4]="immutable",s[Vf][aA]=n,s[zu].status=r;let c=Cyn(Jyt(a));return s[zu].headersList.append("location",c),s}constructor(t=null,r={}){t!==null&&(t=na.converters.BodyInit(t)),r=na.converters.ResponseInit(r),this[aA]={settingsObject:{}},this[zu]=eX({}),this[Vf]=new myn(Byn),this[Vf][S4]="response",this[Vf][fwe]=this[zu].headersList,this[Vf][aA]=this[aA];let n=null;if(t!=null){let[a,s]=Gyt(t);n={body:a,type:s}}Kyt(this,r,n)}get type(){return na.brandCheck(this,e),this[zu].type}get url(){var n;na.brandCheck(this,e);let t=this[zu].urlList,r=(n=t[t.length-1])!=null?n:null;return r===null?"":Jyt(r,!0)}get redirected(){return na.brandCheck(this,e),this[zu].urlList.length>1}get status(){return na.brandCheck(this,e),this[zu].status}get ok(){return na.brandCheck(this,e),this[zu].status>=200&&this[zu].status<=299}get statusText(){return na.brandCheck(this,e),this[zu].statusText}get headers(){return na.brandCheck(this,e),this[Vf]}get body(){return na.brandCheck(this,e),this[zu].body?this[zu].body.stream:null}get bodyUsed(){return na.brandCheck(this,e),!!this[zu].body&&hwe.isDisturbed(this[zu].body.stream)}clone(){if(na.brandCheck(this,e),this.bodyUsed||this.body&&this.body.locked)throw na.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let t=gwe(this[zu]),r=new e;return r[zu]=t,r[aA]=this[aA],r[Vf][fwe]=t.headersList,r[Vf][S4]=this[Vf][S4],r[Vf][aA]=this[Vf][aA],r}};yyn(C4);Object.defineProperties(C4.prototype,{type:oA,url:oA,status:oA,ok:oA,redirected:oA,statusText:oA,headers:oA,clone:oA,body:oA,bodyUsed:oA,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(C4,{json:oA,redirect:oA,error:oA});function gwe(e){if(e.internalResponse)return Zyt(gwe(e.internalResponse),e.type);let t=eX({...e,body:null});return e.body!=null&&(t.body=Ayn(e.body)),t}function eX(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e.headersList?new Wyt(e.headersList):new Wyt,urlList:e.urlList?[...e.urlList]:[]}}function ZK(e){let t=Syn(e);return eX({type:"error",status:0,error:t?e:new Error(e&&String(e)),aborted:e&&e.name==="AbortError"})}function XK(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(r,n){return n in t?t[n]:r[n]},set(r,n,a){return mwe(!(n in t)),r[n]=a,!0}})}function Zyt(e,t){if(t==="basic")return XK(e,{type:"basic",headersList:e.headersList});if(t==="cors")return XK(e,{type:"cors",headersList:e.headersList});if(t==="opaque")return XK(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(t==="opaqueredirect")return XK(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});mwe(!1)}function Pyn(e,t=null){return mwe(xyn(e)),byn(e)?ZK(Object.assign(new Yyt("The operation was aborted.","AbortError"),{cause:t})):ZK(Object.assign(new Yyt("Request was cancelled."),{cause:t}))}function Kyt(e,t,r){if(t.status!==null&&(t.status<200||t.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in t&&t.statusText!=null&&!vyn(String(t.statusText)))throw new TypeError("Invalid statusText");if("status"in t&&t.status!=null&&(e[zu].status=t.status),"statusText"in t&&t.statusText!=null&&(e[zu].statusText=t.statusText),"headers"in t&&t.headers!=null&&gyn(e[Vf],t.headers),r){if(Iyn.includes(e.status))throw na.errors.exception({header:"Response constructor",message:"Invalid response status code "+e.status});e[zu].body=r.body,r.type!=null&&!e[zu].headersList.contains("Content-Type")&&e[zu].headersList.append("content-type",r.type)}}na.converters.ReadableStream=na.interfaceConverter(Xyt);na.converters.FormData=na.interfaceConverter(kyn);na.converters.URLSearchParams=na.interfaceConverter(URLSearchParams);na.converters.XMLHttpRequestBodyInit=function(e){return typeof e=="string"?na.converters.USVString(e):Eyn(e)?na.converters.Blob(e,{strict:!1}):dwe.isArrayBuffer(e)||dwe.isTypedArray(e)||dwe.isDataView(e)?na.converters.BufferSource(e):hwe.isFormDataLike(e)?na.converters.FormData(e,{strict:!1}):e instanceof URLSearchParams?na.converters.URLSearchParams(e):na.converters.DOMString(e)};na.converters.BodyInit=function(e){return e instanceof Xyt?na.converters.ReadableStream(e):e!=null&&e[Symbol.asyncIterator]?e:na.converters.XMLHttpRequestBodyInit(e)};na.converters.ResponseInit=na.dictionaryConverter([{key:"status",converter:na.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:na.converters.ByteString,defaultValue:""},{key:"headers",converter:na.converters.HeadersInit}]);evt.exports={makeNetworkError:ZK,makeResponse:eX,makeAppropriateNetworkError:Pyn,filterResponse:Zyt,Response:C4,cloneResponse:gwe}});var Fq=P((exi,avt)=>{"use strict";var{extractBody:Ryn,mixinBody:Nyn,cloneBody:Fyn}=lq(),{Headers:tvt,fill:Oyn,HeadersList:sX}=vD(),{FinalizationRegistry:Qyn}=_1e()(),Nq=mo(),{isValidHTTPToken:Lyn,sameOrigin:rvt,normalizeMethod:jyn,makePolicyContainer:Myn,normalizeMethodRecord:qyn}=Vy(),{forbiddenMethodsSet:Uyn,corsSafeListedMethodsSet:zyn,referrerPolicy:Hyn,requestRedirect:Vyn,requestMode:$yn,requestCredentials:Wyn,requestCache:Gyn,requestDuplex:Yyn}=pI(),{kEnumerableProperty:Bp}=Nq,{kHeaders:Th,kSignal:Rq,kState:vu,kGuard:rX,kRealm:cA}=sS(),{webidl:fs}=Pm(),{getGlobalOrigin:Jyn}=ZO(),{URLSerializer:Kyn}=jx(),{kHeadersList:nX,kConstruct:iX}=gu(),Xyn=require("assert"),{getMaxListeners:nvt,setMaxListeners:ivt,getEventListeners:Zyn,defaultMaxListeners:svt}=require("events"),Awe=globalThis.TransformStream,evn=Symbol("abortController"),tvn=new Qyn(({signal:e,abort:t})=>{e.removeEventListener("abort",t)}),xD=class e{constructor(t,r={}){var I,k,O;if(t===iX)return;fs.argumentLengthCheck(arguments,1,{header:"Request constructor"}),t=fs.converters.RequestInfo(t),r=fs.converters.RequestInit(r),this[cA]={settingsObject:{baseUrl:Jyn(),get origin(){var j;return(j=this.baseUrl)==null?void 0:j.origin},policyContainer:Myn()}};let n=null,a=null,s=this[cA].settingsObject.baseUrl,c=null;if(typeof t=="string"){let j;try{j=new URL(t,s)}catch(M){throw new TypeError("Failed to parse URL from "+t,{cause:M})}if(j.username||j.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+t);n=aX({urlList:[j]}),a="cors"}else Xyn(t instanceof e),n=t[vu],c=t[Rq];let l=this[cA].settingsObject.origin,f="client";if(((k=(I=n.window)==null?void 0:I.constructor)==null?void 0:k.name)==="EnvironmentSettingsObject"&&rvt(n.window,l)&&(f=n.window),r.window!=null)throw new TypeError(`'window' option '${f}' must be null`);"window"in r&&(f="no-window"),n=aX({method:n.method,headersList:n.headersList,unsafeRequest:n.unsafeRequest,client:this[cA].settingsObject,window:f,priority:n.priority,origin:n.origin,referrer:n.referrer,referrerPolicy:n.referrerPolicy,mode:n.mode,credentials:n.credentials,cache:n.cache,redirect:n.redirect,integrity:n.integrity,keepalive:n.keepalive,reloadNavigation:n.reloadNavigation,historyNavigation:n.historyNavigation,urlList:[...n.urlList]});let d=Object.keys(r).length!==0;if(d&&(n.mode==="navigate"&&(n.mode="same-origin"),n.reloadNavigation=!1,n.historyNavigation=!1,n.origin="client",n.referrer="client",n.referrerPolicy="",n.url=n.urlList[n.urlList.length-1],n.urlList=[n.url]),r.referrer!==void 0){let j=r.referrer;if(j==="")n.referrer="no-referrer";else{let M;try{M=new URL(j,s)}catch(W){throw new TypeError(`Referrer "${j}" is not a valid URL.`,{cause:W})}M.protocol==="about:"&&M.hostname==="client"||l&&!rvt(M,this[cA].settingsObject.baseUrl)?n.referrer="client":n.referrer=M}}r.referrerPolicy!==void 0&&(n.referrerPolicy=r.referrerPolicy);let m;if(r.mode!==void 0?m=r.mode:m=a,m==="navigate")throw fs.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(m!=null&&(n.mode=m),r.credentials!==void 0&&(n.credentials=r.credentials),r.cache!==void 0&&(n.cache=r.cache),n.cache==="only-if-cached"&&n.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(n.redirect=r.redirect),r.integrity!=null&&(n.integrity=String(r.integrity)),r.keepalive!==void 0&&(n.keepalive=!!r.keepalive),r.method!==void 0){let j=r.method;if(!Lyn(j))throw new TypeError(`'${j}' is not a valid HTTP method.`);if(Uyn.has(j.toUpperCase()))throw new TypeError(`'${j}' HTTP method is unsupported.`);j=(O=qyn[j])!=null?O:jyn(j),n.method=j}r.signal!==void 0&&(c=r.signal),this[vu]=n;let g=new AbortController;if(this[Rq]=g.signal,this[Rq][cA]=this[cA],c!=null){if(!c||typeof c.aborted!="boolean"||typeof c.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(c.aborted)g.abort(c.reason);else{this[evn]=g;let j=new WeakRef(g),M=function(){let W=j.deref();W!==void 0&&W.abort(this.reason)};try{(typeof nvt=="function"&&nvt(c)===svt||Zyn(c,"abort").length>=svt)&&ivt(100,c)}catch{}Nq.addAbortListener(c,M),tvn.register(g,{signal:c,abort:M})}}if(this[Th]=new tvt(iX),this[Th][nX]=n.headersList,this[Th][rX]="request",this[Th][cA]=this[cA],m==="no-cors"){if(!zyn.has(n.method))throw new TypeError(`'${n.method} is unsupported in no-cors mode.`);this[Th][rX]="request-no-cors"}if(d){let j=this[Th][nX],M=r.headers!==void 0?r.headers:new sX(j);if(j.clear(),M instanceof sX){for(let[W,se]of M)j.append(W,se);j.cookies=M.cookies}else Oyn(this[Th],M)}let x=t instanceof e?t[vu].body:null;if((r.body!=null||x!=null)&&(n.method==="GET"||n.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let b=null;if(r.body!=null){let[j,M]=Ryn(r.body,n.keepalive);b=j,M&&!this[Th][nX].contains("content-type")&&this[Th].append("content-type",M)}let A=b!=null?b:x;if(A!=null&&A.source==null){if(b!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(n.mode!=="same-origin"&&n.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');n.useCORSPreflightFlag=!0}let C=A;if(b==null&&x!=null){if(Nq.isDisturbed(x.stream)||x.stream.locked)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");Awe||(Awe=require("stream/web").TransformStream);let j=new Awe;x.stream.pipeThrough(j),C={source:x.source,length:x.length,stream:j.readable}}this[vu].body=C}get method(){return fs.brandCheck(this,e),this[vu].method}get url(){return fs.brandCheck(this,e),Kyn(this[vu].url)}get headers(){return fs.brandCheck(this,e),this[Th]}get destination(){return fs.brandCheck(this,e),this[vu].destination}get referrer(){return fs.brandCheck(this,e),this[vu].referrer==="no-referrer"?"":this[vu].referrer==="client"?"about:client":this[vu].referrer.toString()}get referrerPolicy(){return fs.brandCheck(this,e),this[vu].referrerPolicy}get mode(){return fs.brandCheck(this,e),this[vu].mode}get credentials(){return this[vu].credentials}get cache(){return fs.brandCheck(this,e),this[vu].cache}get redirect(){return fs.brandCheck(this,e),this[vu].redirect}get integrity(){return fs.brandCheck(this,e),this[vu].integrity}get keepalive(){return fs.brandCheck(this,e),this[vu].keepalive}get isReloadNavigation(){return fs.brandCheck(this,e),this[vu].reloadNavigation}get isHistoryNavigation(){return fs.brandCheck(this,e),this[vu].historyNavigation}get signal(){return fs.brandCheck(this,e),this[Rq]}get body(){return fs.brandCheck(this,e),this[vu].body?this[vu].body.stream:null}get bodyUsed(){return fs.brandCheck(this,e),!!this[vu].body&&Nq.isDisturbed(this[vu].body.stream)}get duplex(){return fs.brandCheck(this,e),"half"}clone(){var a;if(fs.brandCheck(this,e),this.bodyUsed||(a=this.body)!=null&&a.locked)throw new TypeError("unusable");let t=rvn(this[vu]),r=new e(iX);r[vu]=t,r[cA]=this[cA],r[Th]=new tvt(iX),r[Th][nX]=t.headersList,r[Th][rX]=this[Th][rX],r[Th][cA]=this[Th][cA];let n=new AbortController;return this.signal.aborted?n.abort(this.signal.reason):Nq.addAbortListener(this.signal,()=>{n.abort(this.signal.reason)}),r[Rq]=n.signal,r}};Nyn(xD);function aX(e){let t={method:"GET",localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:!1,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:!1,credentials:"same-origin",useCredentials:!1,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...e,headersList:e.headersList?new sX(e.headersList):new sX};return t.url=t.urlList[0],t}function rvn(e){let t=aX({...e,body:null});return e.body!=null&&(t.body=Fyn(e.body)),t}Object.defineProperties(xD.prototype,{method:Bp,url:Bp,headers:Bp,redirect:Bp,clone:Bp,signal:Bp,duplex:Bp,destination:Bp,body:Bp,bodyUsed:Bp,isHistoryNavigation:Bp,isReloadNavigation:Bp,keepalive:Bp,integrity:Bp,cache:Bp,credentials:Bp,attribute:Bp,referrerPolicy:Bp,referrer:Bp,mode:Bp,[Symbol.toStringTag]:{value:"Request",configurable:!0}});fs.converters.Request=fs.interfaceConverter(xD);fs.converters.RequestInfo=function(e){return typeof e=="string"?fs.converters.USVString(e):e instanceof xD?fs.converters.Request(e):fs.converters.USVString(e)};fs.converters.AbortSignal=fs.interfaceConverter(AbortSignal);fs.converters.RequestInit=fs.dictionaryConverter([{key:"method",converter:fs.converters.ByteString},{key:"headers",converter:fs.converters.HeadersInit},{key:"body",converter:fs.nullableConverter(fs.converters.BodyInit)},{key:"referrer",converter:fs.converters.USVString},{key:"referrerPolicy",converter:fs.converters.DOMString,allowedValues:Hyn},{key:"mode",converter:fs.converters.DOMString,allowedValues:$yn},{key:"credentials",converter:fs.converters.DOMString,allowedValues:Wyn},{key:"cache",converter:fs.converters.DOMString,allowedValues:Gyn},{key:"redirect",converter:fs.converters.DOMString,allowedValues:Vyn},{key:"integrity",converter:fs.converters.DOMString},{key:"keepalive",converter:fs.converters.boolean},{key:"signal",converter:fs.nullableConverter(e=>fs.converters.AbortSignal(e,{strict:!1}))},{key:"window",converter:fs.converters.any},{key:"duplex",converter:fs.converters.DOMString,allowedValues:Yyn}]);avt.exports={Request:xD,makeRequest:aX}});var dX=P((txi,xvt)=>{"use strict";var{Response:nvn,makeNetworkError:Mc,makeAppropriateNetworkError:oX,filterResponse:ywe,makeResponse:cX}=tX(),{Headers:ovt}=vD(),{Request:ivn,makeRequest:svn}=Fq(),Oq=require("zlib"),{bytesMatch:avn,makePolicyContainer:ovn,clonePolicyContainer:cvn,requestBadPort:uvn,TAOCheck:lvn,appendRequestOriginHeader:pvn,responseLocationURL:fvn,requestCurrentURL:u1,setRequestReferrerPolicyOnRedirect:dvn,tryUpgradeRequestToAPotentiallyTrustworthyURL:hvn,createOpaqueTimingInfo:Iwe,appendFetchMetadata:mvn,corsCheck:gvn,crossOriginResourcePolicyCheck:Avn,determineRequestsReferrer:yvn,coarsenedSharedCurrentTime:kwe,createDeferredPromise:vvn,isBlobLike:xvn,sameOrigin:Swe,isCancelled:I4,isAborted:cvt,isErrorLike:bvn,fullyReadBody:fvt,readableStreamClose:Evn,isomorphicEncode:Cwe,urlIsLocal:wvn,urlIsHttpHttpsScheme:Twe,urlHasHttpsScheme:Svn}=Vy(),{kState:_we,kHeaders:vwe,kGuard:Cvn,kRealm:uvt}=sS(),k4=require("assert"),{safelyExtractBody:uX}=lq(),{redirectStatusSet:dvt,nullBodyStatus:hvt,safeMethodsSet:_vn,requestBodyHeader:Ivn,subresourceSet:kvn,DOMException:lX}=pI(),{kHeadersList:_4}=gu(),Tvn=require("events"),{Readable:Bvn,pipeline:Dvn}=require("stream"),{addAbortListener:Pvn,isErrored:Rvn,isReadable:pX,nodeMajor:lvt,nodeMinor:Nvn}=mo(),{dataURLProcessor:Fvn,serializeAMimeType:Ovn}=jx(),{TransformStream:Qvn}=require("stream/web"),{getGlobalDispatcher:Lvn}=b4(),{webidl:jvn}=Pm(),{STATUS_CODES:Mvn}=require("http"),qvn=["GET","HEAD"],xwe,bwe=globalThis.ReadableStream,fX=class extends Tvn{constructor(t){super(),this.dispatcher=t,this.connection=null,this.dump=!1,this.state="ongoing",this.setMaxListeners(21)}terminate(t){var r;this.state==="ongoing"&&(this.state="terminated",(r=this.connection)==null||r.destroy(t),this.emit("terminated",t))}abort(t){var r;this.state==="ongoing"&&(this.state="aborted",t||(t=new lX("The operation was aborted.","AbortError")),this.serializedAbortReason=t,(r=this.connection)==null||r.destroy(t),this.emit("terminated",t))}};function Uvn(e,t={}){var x,b;jvn.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});let r=vvn(),n;try{n=new ivn(e,t)}catch(A){return r.reject(A),r.promise}let a=n[_we];if(n.signal.aborted)return Ewe(r,a,null,n.signal.reason),r.promise;let s=a.client.globalObject;((x=s==null?void 0:s.constructor)==null?void 0:x.name)==="ServiceWorkerGlobalScope"&&(a.serviceWorkers="none");let c=null,l=null,f=!1,d=null;return Pvn(n.signal,()=>{f=!0,k4(d!=null),d.abort(n.signal.reason),Ewe(r,a,c,n.signal.reason)}),d=gvt({request:a,processResponseEndOfBody:A=>mvt(A,"fetch"),processResponse:A=>{if(f)return Promise.resolve();if(A.aborted)return Ewe(r,a,c,d.serializedAbortReason),Promise.resolve();if(A.type==="error")return r.reject(Object.assign(new TypeError("fetch failed"),{cause:A.error})),Promise.resolve();c=new nvn,c[_we]=A,c[uvt]=l,c[vwe][_4]=A.headersList,c[vwe][Cvn]="immutable",c[vwe][uvt]=l,r.resolve(c)},dispatcher:(b=t.dispatcher)!=null?b:Lvn()}),r.promise}function mvt(e,t="other"){var s;if(e.type==="error"&&e.aborted||!((s=e.urlList)!=null&&s.length))return;let r=e.urlList[0],n=e.timingInfo,a=e.cacheState;Twe(r)&&n!==null&&(e.timingAllowPassed||(n=Iwe({startTime:n.startTime}),a=""),n.endTime=kwe(),e.timingInfo=n,zvn(n,r,t,globalThis,a))}function zvn(e,t,r,n,a){(lvt>18||lvt===18&&Nvn>=2)&&performance.markResourceTiming(e,t.href,r,n,a)}function Ewe(e,t,r,n){var s,c;if(n||(n=new lX("The operation was aborted.","AbortError")),e.reject(n),t.body!=null&&pX((s=t.body)==null?void 0:s.stream)&&t.body.stream.cancel(n).catch(l=>{if(l.code!=="ERR_INVALID_STATE")throw l}),r==null)return;let a=r[_we];a.body!=null&&pX((c=a.body)==null?void 0:c.stream)&&a.body.stream.cancel(n).catch(l=>{if(l.code!=="ERR_INVALID_STATE")throw l})}function gvt({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:a,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l}){var b,A,C,I;let f=null,d=!1;e.client!=null&&(f=e.client.globalObject,d=e.client.crossOriginIsolatedCapability);let m=kwe(d),g=Iwe({startTime:m}),x={controller:new fX(l),request:e,timingInfo:g,processRequestBodyChunkLength:t,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:a,taskDestination:f,crossOriginIsolatedCapability:d};return k4(!e.body||e.body.stream),e.window==="client"&&(e.window=((C=(A=(b=e.client)==null?void 0:b.globalObject)==null?void 0:A.constructor)==null?void 0:C.name)==="Window"?e.client:"no-window"),e.origin==="client"&&(e.origin=(I=e.client)==null?void 0:I.origin),e.policyContainer==="client"&&(e.client!=null?e.policyContainer=cvn(e.client.policyContainer):e.policyContainer=ovn()),e.headersList.contains("accept")||e.headersList.append("accept","*/*"),e.headersList.contains("accept-language")||e.headersList.append("accept-language","*"),e.priority,kvn.has(e.destination),Avt(x).catch(k=>{x.controller.terminate(k)}),x.controller}async function Avt(e,t=!1){let r=e.request,n=null;if(r.localURLsOnly&&!wvn(u1(r))&&(n=Mc("local URLs only")),hvn(r),uvn(r)==="blocked"&&(n=Mc("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=yvn(r)),n===null&&(n=await(async()=>{let s=u1(r);return Swe(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await pvt(e)):r.mode==="same-origin"?Mc('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?Mc('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await pvt(e)):Twe(u1(r))?(r.responseTainting="cors",await yvt(e)):Mc("URL scheme must be a HTTP(S) scheme")})()),t)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=ywe(n,"basic"):r.responseTainting==="cors"?n=ywe(n,"cors"):r.responseTainting==="opaque"?n=ywe(n,"opaque"):k4(!1));let a=n.status===0?n:n.internalResponse;if(a.urlList.length===0&&a.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&a.status===206&&a.rangeRequested&&!r.headers.contains("range")&&(n=a=Mc()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||hvt.includes(a.status))&&(a.body=null,e.controller.dump=!0),r.integrity){let s=l=>wwe(e,Mc(l));if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=l=>{if(!avn(l,r.integrity)){s("integrity mismatch");return}n.body=uX(l)[0],wwe(e,n)};await fvt(n.body,c,s)}else wwe(e,n)}function pvt(e){var n;if(I4(e)&&e.request.redirectCount===0)return Promise.resolve(oX(e));let{request:t}=e,{protocol:r}=u1(t);switch(r){case"about:":return Promise.resolve(Mc("about scheme is not supported"));case"blob:":{xwe||(xwe=require("buffer").resolveObjectURL);let a=u1(t);if(a.search.length!==0)return Promise.resolve(Mc("NetworkError when attempting to fetch resource."));let s=xwe(a.toString());if(t.method!=="GET"||!xvn(s))return Promise.resolve(Mc("invalid method"));let c=uX(s),l=c[0],f=Cwe(`${l.length}`),d=(n=c[1])!=null?n:"",m=cX({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:f}],["content-type",{name:"Content-Type",value:d}]]});return m.body=l,Promise.resolve(m)}case"data:":{let a=u1(t),s=Fvn(a);if(s==="failure")return Promise.resolve(Mc("failed to fetch the data URL"));let c=Ovn(s.mimeType);return Promise.resolve(cX({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:c}]],body:uX(s.body)[0]}))}case"file:":return Promise.resolve(Mc("not implemented... yet..."));case"http:":case"https:":return yvt(e).catch(a=>Mc(a));default:return Promise.resolve(Mc("unknown scheme"))}}function Hvn(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function wwe(e,t){t.type==="error"&&(t.urlList=[e.request.urlList[0]],t.timingInfo=Iwe({startTime:e.timingInfo.startTime}));let r=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t))};if(e.processResponse!=null&&queueMicrotask(()=>e.processResponse(t)),t.body==null)r();else{let n=(s,c)=>{c.enqueue(s)},a=new Qvn({start(){},transform:n,flush:r},{size(){return 1}},{size(){return 1}});t.body={stream:t.body.stream.pipeThrough(a)}}if(e.processResponseConsumeBody!=null){let n=s=>e.processResponseConsumeBody(t,s),a=s=>e.processResponseConsumeBody(t,s);if(t.body==null)queueMicrotask(()=>n(null));else return fvt(t.body,n,a);return Promise.resolve()}}async function yvt(e){let t=e.request,r=null,n=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect==="follow"&&(t.serviceWorkers="none"),n=r=await vvt(e),t.responseTainting==="cors"&&gvn(t,r)==="failure")return Mc("cors failure");lvn(t,r)==="failure"&&(t.timingAllowFailed=!0)}return(t.responseTainting==="opaque"||r.type==="opaque")&&Avn(t.origin,t.client,t.destination,n)==="blocked"?Mc("blocked"):(dvt.has(n.status)&&(t.redirect!=="manual"&&e.controller.connection.destroy(),t.redirect==="error"?r=Mc("unexpected redirect"):t.redirect==="manual"?r=n:t.redirect==="follow"?r=await Vvn(e,r):k4(!1)),r.timingInfo=a,r)}function Vvn(e,t){let r=e.request,n=t.internalResponse?t.internalResponse:t,a;try{if(a=fvn(n,u1(r).hash),a==null)return t}catch(c){return Promise.resolve(Mc(c))}if(!Twe(a))return Promise.resolve(Mc("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(Mc("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(a.username||a.password)&&!Swe(r,a))return Promise.resolve(Mc('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(a.username||a.password))return Promise.resolve(Mc('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(Mc());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!qvn.includes(r.method)){r.method="GET",r.body=null;for(let c of Ivn)r.headersList.delete(c)}Swe(u1(r),a)||(r.headersList.delete("authorization"),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie"),r.headersList.delete("host")),r.body!=null&&(k4(r.body.source!=null),r.body=uX(r.body.source)[0]);let s=e.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=kwe(e.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(a),dvn(r,n),Avt(e,!0)}async function vvt(e,t=!1,r=!1){let n=e.request,a=null,s=null,c=null,l=null,f=!1;n.window==="no-window"&&n.redirect==="error"?(a=e,s=n):(s=svn(n),a={...e},a.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",m=s.body?s.body.length:null,g=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(g="0"),m!=null&&(g=Cwe(`${m}`)),g!=null&&s.headersList.append("content-length",g),m!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Cwe(s.referrer.href)),pvn(s),mvn(s),s.headersList.contains("user-agent")||s.headersList.append("user-agent",typeof esbuildDetection>"u"?"undici":"node"),s.cache==="default"&&(s.headersList.contains("if-modified-since")||s.headersList.contains("if-none-match")||s.headersList.contains("if-unmodified-since")||s.headersList.contains("if-match")||s.headersList.contains("if-range"))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control")&&s.headersList.append("cache-control","max-age=0"),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma")||s.headersList.append("pragma","no-cache"),s.headersList.contains("cache-control")||s.headersList.append("cache-control","no-cache")),s.headersList.contains("range")&&s.headersList.append("accept-encoding","identity"),s.headersList.contains("accept-encoding")||(Svn(u1(s))?s.headersList.append("accept-encoding","br, gzip, deflate"):s.headersList.append("accept-encoding","gzip, deflate")),s.headersList.delete("host"),l==null&&(s.cache="no-store"),s.mode!=="no-store"&&s.mode,c==null){if(s.mode==="only-if-cached")return Mc("only if cached");let x=await $vn(a,d,r);!_vn.has(s.method)&&x.status>=200&&x.status<=399,f&&x.status,c==null&&(c=x)}if(c.urlList=[...s.urlList],s.headersList.contains("range")&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?Mc():I4(e)?oX(e):Mc("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(I4(e))return oX(e);e.controller.connection.destroy(),c=await vvt(e,t,!0)}return c}async function $vn(e,t=!1,r=!1){k4(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(A){var C;this.destroyed||(this.destroyed=!0,(C=this.abort)==null||C.call(this,A!=null?A:new lX("The operation was aborted.","AbortError")))}};let n=e.request,a=null,s=e.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let f=null;if(n.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(n.body!=null){let A=async function*(k){var O;I4(e)||(yield k,(O=e.processRequestBodyChunkLength)==null||O.call(e,k.byteLength))},C=()=>{I4(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},I=k=>{I4(e)||(k.name==="AbortError"?e.controller.abort():e.controller.terminate(k))};f=async function*(){try{for await(let k of n.body.stream)yield*A(k);C()}catch(k){I(k)}}()}try{let{body:A,status:C,statusText:I,headersList:k,socket:O}=await b({body:f});if(O)a=cX({status:C,statusText:I,headersList:k,socket:O});else{let j=A[Symbol.asyncIterator]();e.controller.next=()=>j.next(),a=cX({status:C,statusText:I,headersList:k})}}catch(A){return A.name==="AbortError"?(e.controller.connection.destroy(),oX(e,A)):Mc(A)}let d=()=>{e.controller.resume()},m=A=>{e.controller.abort(A)};bwe||(bwe=require("stream/web").ReadableStream);let g=new bwe({async start(A){e.controller.controller=A},async pull(A){await d(A)},async cancel(A){await m(A)}},{highWaterMark:0,size(){return 1}});a.body={stream:g},e.controller.on("terminated",x),e.controller.resume=async()=>{var A;for(;;){let C,I;try{let{done:k,value:O}=await e.controller.next();if(cvt(e))break;C=k?void 0:O}catch(k){e.controller.ended&&!s.encodedBodySize?C=void 0:(C=k,I=!0)}if(C===void 0){Evn(e.controller.controller),Hvn(e,a);return}if(s.decodedBodySize+=(A=C==null?void 0:C.byteLength)!=null?A:0,I){e.controller.terminate(C);return}if(e.controller.controller.enqueue(new Uint8Array(C)),Rvn(g)){e.controller.terminate();return}if(!e.controller.controller.desiredSize)return}};function x(A){cvt(e)?(a.aborted=!0,pX(g)&&e.controller.controller.error(e.controller.serializedAbortReason)):pX(g)&&e.controller.controller.error(new TypeError("terminated",{cause:bvn(A)?A:void 0})),e.controller.connection.destroy()}return a;async function b({body:A}){let C=u1(n),I=e.controller.dispatcher;return new Promise((k,O)=>I.dispatch({path:C.pathname+C.search,origin:C.origin,method:n.method,body:e.controller.dispatcher.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(j){let{connection:M}=e.controller;M.destroyed?j(new lX("The operation was aborted.","AbortError")):(e.controller.on("terminated",j),this.abort=M.abort=j)},onHeaders(j,M,W,se){if(j<200)return;let X=[],ve="",ae=new ovt;if(Array.isArray(M))for(let ye=0;ye<M.length;ye+=2){let ue=M[ye+0].toString("latin1"),ne=M[ye+1].toString("latin1");ue.toLowerCase()==="content-encoding"?X=ne.toLowerCase().split(",").map(be=>be.trim()):ue.toLowerCase()==="location"&&(ve=ne),ae[_4].append(ue,ne)}else{let ye=Object.keys(M);for(let ue of ye){let ne=M[ue];ue.toLowerCase()==="content-encoding"?X=ne.toLowerCase().split(",").map(be=>be.trim()).reverse():ue.toLowerCase()==="location"&&(ve=ne),ae[_4].append(ue,ne)}}this.body=new Bvn({read:W});let he=[],me=n.redirect==="follow"&&ve&&dvt.has(j);if(n.method!=="HEAD"&&n.method!=="CONNECT"&&!hvt.includes(j)&&!me)for(let ye of X)if(ye==="x-gzip"||ye==="gzip")he.push(Oq.createGunzip({flush:Oq.constants.Z_SYNC_FLUSH,finishFlush:Oq.constants.Z_SYNC_FLUSH}));else if(ye==="deflate")he.push(Oq.createInflate());else if(ye==="br")he.push(Oq.createBrotliDecompress());else{he.length=0;break}return k({status:j,statusText:se,headersList:ae[_4],body:he.length?Dvn(this.body,...he,()=>{}):this.body.on("error",()=>{})}),!0},onData(j){if(e.controller.dump)return;let M=j;return s.encodedBodySize+=M.byteLength,this.body.push(M)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(j){var M;this.abort&&e.controller.off("terminated",this.abort),(M=this.body)==null||M.destroy(j),e.controller.terminate(j),O(j)},onUpgrade(j,M,W){if(j!==101)return;let se=new ovt;for(let X=0;X<M.length;X+=2){let ve=M[X+0].toString("latin1"),ae=M[X+1].toString("latin1");se[_4].append(ve,ae)}return k({status:j,statusText:Mvn[j],headersList:se[_4],socket:W}),!0}}))}}xvt.exports={fetch:Uvn,Fetch:fX,fetching:gvt,finalizeAndReportTiming:mvt}});var Bwe=P((rxi,bvt)=>{"use strict";bvt.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var wvt=P((nxi,Evt)=>{"use strict";var{webidl:uA}=Pm(),hX=Symbol("ProgressEvent state"),Dwe=class e extends Event{constructor(t,r={}){t=uA.converters.DOMString(t),r=uA.converters.ProgressEventInit(r!=null?r:{}),super(t,r),this[hX]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return uA.brandCheck(this,e),this[hX].lengthComputable}get loaded(){return uA.brandCheck(this,e),this[hX].loaded}get total(){return uA.brandCheck(this,e),this[hX].total}};uA.converters.ProgressEventInit=uA.dictionaryConverter([{key:"lengthComputable",converter:uA.converters.boolean,defaultValue:!1},{key:"loaded",converter:uA.converters["unsigned long long"],defaultValue:0},{key:"total",converter:uA.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:uA.converters.boolean,defaultValue:!1},{key:"cancelable",converter:uA.converters.boolean,defaultValue:!1},{key:"composed",converter:uA.converters.boolean,defaultValue:!1}]);Evt.exports={ProgressEvent:Dwe}});var Cvt=P((ixi,Svt)=>{"use strict";function Wvn(e){if(!e)return"failure";switch(e.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}Svt.exports={getEncoding:Wvn}});var Rvt=P((sxi,Pvt)=>{"use strict";var{kState:T4,kError:Pwe,kResult:_vt,kAborted:Qq,kLastProgressEventFired:Rwe}=Bwe(),{ProgressEvent:Gvn}=wvt(),{getEncoding:Ivt}=Cvt(),{DOMException:Yvn}=pI(),{serializeAMimeType:Jvn,parseMIMEType:kvt}=jx(),{types:Kvn}=require("util"),{StringDecoder:Tvt}=require("string_decoder"),{btoa:Bvt}=require("buffer"),Xvn={enumerable:!0,writable:!1,configurable:!1};function Zvn(e,t,r,n){if(e[T4]==="loading")throw new Yvn("Invalid state","InvalidStateError");e[T4]="loading",e[_vt]=null,e[Pwe]=null;let s=t.stream().getReader(),c=[],l=s.read(),f=!0;(async()=>{for(;!e[Qq];)try{let{done:d,value:m}=await l;if(f&&!e[Qq]&&queueMicrotask(()=>{vI("loadstart",e)}),f=!1,!d&&Kvn.isUint8Array(m))c.push(m),(e[Rwe]===void 0||Date.now()-e[Rwe]>=50)&&!e[Qq]&&(e[Rwe]=Date.now(),queueMicrotask(()=>{vI("progress",e)})),l=s.read();else if(d){queueMicrotask(()=>{e[T4]="done";try{let g=exn(c,r,t.type,n);if(e[Qq])return;e[_vt]=g,vI("load",e)}catch(g){e[Pwe]=g,vI("error",e)}e[T4]!=="loading"&&vI("loadend",e)});break}}catch(d){if(e[Qq])return;queueMicrotask(()=>{e[T4]="done",e[Pwe]=d,vI("error",e),e[T4]!=="loading"&&vI("loadend",e)});break}})()}function vI(e,t){let r=new Gvn(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(r)}function exn(e,t,r,n){switch(t){case"DataURL":{let a="data:",s=kvt(r||"application/octet-stream");s!=="failure"&&(a+=Jvn(s)),a+=";base64,";let c=new Tvt("latin1");for(let l of e)a+=Bvt(c.write(l));return a+=Bvt(c.end()),a}case"Text":{let a="failure";if(n&&(a=Ivt(n)),a==="failure"&&r){let s=kvt(r);s!=="failure"&&(a=Ivt(s.parameters.get("charset")))}return a==="failure"&&(a="UTF-8"),txn(e,a)}case"ArrayBuffer":return Dvt(e).buffer;case"BinaryString":{let a="",s=new Tvt("latin1");for(let c of e)a+=s.write(c);return a+=s.end(),a}}}function txn(e,t){let r=Dvt(e),n=rxn(r),a=0;n!==null&&(t=n,a=n==="UTF-8"?3:2);let s=r.slice(a);return new TextDecoder(t).decode(s)}function rxn(e){let[t,r,n]=e;return t===239&&r===187&&n===191?"UTF-8":t===254&&r===255?"UTF-16BE":t===255&&r===254?"UTF-16LE":null}function Dvt(e){let t=e.reduce((n,a)=>n+a.byteLength,0),r=0;return e.reduce((n,a)=>(n.set(a,r),r+=a.byteLength,n),new Uint8Array(t))}Pvt.exports={staticPropertyDescriptors:Xvn,readOperation:Zvn,fireAProgressEvent:vI}});var Qvt=P((axi,Ovt)=>{"use strict";var{staticPropertyDescriptors:B4,readOperation:mX,fireAProgressEvent:Nvt}=Rvt(),{kState:bD,kError:Fvt,kResult:gX,kEvents:Ho,kAborted:nxn}=Bwe(),{webidl:kc}=Pm(),{kEnumerableProperty:ig}=mo(),zx=class e extends EventTarget{constructor(){super(),this[bD]="empty",this[gX]=null,this[Fvt]=null,this[Ho]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(t){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"}),t=kc.converters.Blob(t,{strict:!1}),mX(this,t,"ArrayBuffer")}readAsBinaryString(t){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"}),t=kc.converters.Blob(t,{strict:!1}),mX(this,t,"BinaryString")}readAsText(t,r=void 0){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"}),t=kc.converters.Blob(t,{strict:!1}),r!==void 0&&(r=kc.converters.DOMString(r)),mX(this,t,"Text",r)}readAsDataURL(t){kc.brandCheck(this,e),kc.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"}),t=kc.converters.Blob(t,{strict:!1}),mX(this,t,"DataURL")}abort(){if(this[bD]==="empty"||this[bD]==="done"){this[gX]=null;return}this[bD]==="loading"&&(this[bD]="done",this[gX]=null),this[nxn]=!0,Nvt("abort",this),this[bD]!=="loading"&&Nvt("loadend",this)}get readyState(){switch(kc.brandCheck(this,e),this[bD]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return kc.brandCheck(this,e),this[gX]}get error(){return kc.brandCheck(this,e),this[Fvt]}get onloadend(){return kc.brandCheck(this,e),this[Ho].loadend}set onloadend(t){kc.brandCheck(this,e),this[Ho].loadend&&this.removeEventListener("loadend",this[Ho].loadend),typeof t=="function"?(this[Ho].loadend=t,this.addEventListener("loadend",t)):this[Ho].loadend=null}get onerror(){return kc.brandCheck(this,e),this[Ho].error}set onerror(t){kc.brandCheck(this,e),this[Ho].error&&this.removeEventListener("error",this[Ho].error),typeof t=="function"?(this[Ho].error=t,this.addEventListener("error",t)):this[Ho].error=null}get onloadstart(){return kc.brandCheck(this,e),this[Ho].loadstart}set onloadstart(t){kc.brandCheck(this,e),this[Ho].loadstart&&this.removeEventListener("loadstart",this[Ho].loadstart),typeof t=="function"?(this[Ho].loadstart=t,this.addEventListener("loadstart",t)):this[Ho].loadstart=null}get onprogress(){return kc.brandCheck(this,e),this[Ho].progress}set onprogress(t){kc.brandCheck(this,e),this[Ho].progress&&this.removeEventListener("progress",this[Ho].progress),typeof t=="function"?(this[Ho].progress=t,this.addEventListener("progress",t)):this[Ho].progress=null}get onload(){return kc.brandCheck(this,e),this[Ho].load}set onload(t){kc.brandCheck(this,e),this[Ho].load&&this.removeEventListener("load",this[Ho].load),typeof t=="function"?(this[Ho].load=t,this.addEventListener("load",t)):this[Ho].load=null}get onabort(){return kc.brandCheck(this,e),this[Ho].abort}set onabort(t){kc.brandCheck(this,e),this[Ho].abort&&this.removeEventListener("abort",this[Ho].abort),typeof t=="function"?(this[Ho].abort=t,this.addEventListener("abort",t)):this[Ho].abort=null}};zx.EMPTY=zx.prototype.EMPTY=0;zx.LOADING=zx.prototype.LOADING=1;zx.DONE=zx.prototype.DONE=2;Object.defineProperties(zx.prototype,{EMPTY:B4,LOADING:B4,DONE:B4,readAsArrayBuffer:ig,readAsBinaryString:ig,readAsText:ig,readAsDataURL:ig,abort:ig,readyState:ig,result:ig,error:ig,onloadstart:ig,onprogress:ig,onload:ig,onabort:ig,onerror:ig,onloadend:ig,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(zx,{EMPTY:B4,LOADING:B4,DONE:B4});Ovt.exports={FileReader:zx}});var AX=P((oxi,Lvt)=>{"use strict";Lvt.exports={kConstruct:gu().kConstruct}});var qvt=P((cxi,Mvt)=>{"use strict";var ixn=require("assert"),{URLSerializer:jvt}=jx(),{isValidHeaderName:sxn}=Vy();function axn(e,t,r=!1){let n=jvt(e,r),a=jvt(t,r);return n===a}function oxn(e){ixn(e!==null);let t=[];for(let r of e.split(",")){if(r=r.trim(),r.length){if(!sxn(r))continue}else continue;t.push(r)}return t}Mvt.exports={urlEquals:axn,fieldValues:oxn}});var Gvt=P((uxi,Wvt)=>{"use strict";var{kConstruct:cxn}=AX(),{urlEquals:uxn,fieldValues:Nwe}=qvt(),{kEnumerableProperty:ED,isDisturbed:lxn}=mo(),{kHeadersList:Uvt}=gu(),{webidl:Vi}=Pm(),{Response:Hvt,cloneResponse:pxn}=tX(),{Request:l1}=Fq(),{kState:Qm,kHeaders:yX,kGuard:zvt,kRealm:fxn}=sS(),{fetching:dxn}=dX(),{urlIsHttpHttpsScheme:vX,createDeferredPromise:D4,readAllBytes:hxn}=Vy(),Fwe=require("assert"),{getGlobalDispatcher:mxn}=b4(),p1,R4,xX,xI,P4,EX,Vvt,hS=class hS{constructor(){nr(this,R4);nr(this,xI);nr(this,EX);nr(this,p1,void 0);arguments[0]!==cxn&&Vi.illegalConstructor(),Qt(this,p1,arguments[1])}async match(t,r={}){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.match"}),t=Vi.converters.RequestInfo(t),r=Vi.converters.CacheQueryOptions(r);let n=await this.matchAll(t,r);if(n.length!==0)return n[0]}async matchAll(t=void 0,r={}){var c,l;Vi.brandCheck(this,hS),t!==void 0&&(t=Vi.converters.RequestInfo(t)),r=Vi.converters.CacheQueryOptions(r);let n=null;if(t!==void 0)if(t instanceof l1){if(n=t[Qm],n.method!=="GET"&&!r.ignoreMethod)return[]}else typeof t=="string"&&(n=new l1(t)[Qm]);let a=[];if(t===void 0)for(let f of re(this,p1))a.push(f[1]);else{let f=yr(this,xI,P4).call(this,n,r);for(let d of f)a.push(d[1])}let s=[];for(let f of a){let d=new Hvt((l=(c=f.body)==null?void 0:c.source)!=null?l:null),m=d[Qm].body;d[Qm]=f,d[Qm].body=m,d[yX][Uvt]=f.headersList,d[yX][zvt]="immutable",s.push(d)}return Object.freeze(s)}async add(t){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.add"}),t=Vi.converters.RequestInfo(t);let r=[t];return await this.addAll(r)}async addAll(t){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.addAll"}),t=Vi.converters["sequence<RequestInfo>"](t);let r=[],n=[];for(let g of t){if(typeof g=="string")continue;let x=g[Qm];if(!vX(x.url)||x.method!=="GET")throw Vi.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}let a=[];for(let g of t){let x=new l1(g)[Qm];if(!vX(x.url))throw Vi.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."});x.initiator="fetch",x.destination="subresource",n.push(x);let b=D4();a.push(dxn({request:x,dispatcher:mxn(),processResponse(A){if(A.type==="error"||A.status===206||A.status<200||A.status>299)b.reject(Vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(A.headersList.contains("vary")){let C=Nwe(A.headersList.get("vary"));for(let I of C)if(I==="*"){b.reject(Vi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let k of a)k.abort();return}}},processResponseEndOfBody(A){if(A.aborted){b.reject(new DOMException("aborted","AbortError"));return}b.resolve(A)}})),r.push(b.promise)}let c=await Promise.all(r),l=[],f=0;for(let g of c){let x={type:"put",request:n[f],response:g};l.push(x),f++}let d=D4(),m=null;try{yr(this,R4,xX).call(this,l)}catch(g){m=g}return queueMicrotask(()=>{m===null?d.resolve(void 0):d.reject(m)}),d.promise}async put(t,r){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,2,{header:"Cache.put"}),t=Vi.converters.RequestInfo(t),r=Vi.converters.Response(r);let n=null;if(t instanceof l1?n=t[Qm]:n=new l1(t)[Qm],!vX(n.url)||n.method!=="GET")throw Vi.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"});let a=r[Qm];if(a.status===206)throw Vi.errors.exception({header:"Cache.put",message:"Got 206 status"});if(a.headersList.contains("vary")){let x=Nwe(a.headersList.get("vary"));for(let b of x)if(b==="*")throw Vi.errors.exception({header:"Cache.put",message:"Got * vary field value"})}if(a.body&&(lxn(a.body.stream)||a.body.stream.locked))throw Vi.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"});let s=pxn(a),c=D4();if(a.body!=null){let b=a.body.stream.getReader();hxn(b).then(c.resolve,c.reject)}else c.resolve(void 0);let l=[],f={type:"put",request:n,response:s};l.push(f);let d=await c.promise;s.body!=null&&(s.body.source=d);let m=D4(),g=null;try{yr(this,R4,xX).call(this,l)}catch(x){g=x}return queueMicrotask(()=>{g===null?m.resolve():m.reject(g)}),m.promise}async delete(t,r={}){Vi.brandCheck(this,hS),Vi.argumentLengthCheck(arguments,1,{header:"Cache.delete"}),t=Vi.converters.RequestInfo(t),r=Vi.converters.CacheQueryOptions(r);let n=null;if(t instanceof l1){if(n=t[Qm],n.method!=="GET"&&!r.ignoreMethod)return!1}else Fwe(typeof t=="string"),n=new l1(t)[Qm];let a=[],s={type:"delete",request:n,options:r};a.push(s);let c=D4(),l=null,f;try{f=yr(this,R4,xX).call(this,a)}catch(d){l=d}return queueMicrotask(()=>{l===null?c.resolve(!!(f!=null&&f.length)):c.reject(l)}),c.promise}async keys(t=void 0,r={}){Vi.brandCheck(this,hS),t!==void 0&&(t=Vi.converters.RequestInfo(t)),r=Vi.converters.CacheQueryOptions(r);let n=null;if(t!==void 0)if(t instanceof l1){if(n=t[Qm],n.method!=="GET"&&!r.ignoreMethod)return[]}else typeof t=="string"&&(n=new l1(t)[Qm]);let a=D4(),s=[];if(t===void 0)for(let c of re(this,p1))s.push(c[0]);else{let c=yr(this,xI,P4).call(this,n,r);for(let l of c)s.push(l[0])}return queueMicrotask(()=>{let c=[];for(let l of s){let f=new l1("https://a");f[Qm]=l,f[yX][Uvt]=l.headersList,f[yX][zvt]="immutable",f[fxn]=l.client,c.push(f)}a.resolve(Object.freeze(c))}),a.promise}};p1=new WeakMap,R4=new WeakSet,xX=function(t){let r=re(this,p1),n=[...r],a=[],s=[];try{for(let c of t){if(c.type!=="delete"&&c.type!=="put")throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(yr(this,xI,P4).call(this,c.request,c.options,a).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=yr(this,xI,P4).call(this,c.request,c.options),l.length===0)return[];for(let f of l){let d=r.indexOf(f);Fwe(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let f=c.request;if(!vX(f.url))throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(f.method!=="GET")throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Vi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=yr(this,xI,P4).call(this,c.request);for(let d of l){let m=r.indexOf(d);Fwe(m!==-1),r.splice(m,1)}r.push([c.request,c.response]),a.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw re(this,p1).length=0,Qt(this,p1,n),c}},xI=new WeakSet,P4=function(t,r,n){let a=[],s=n!=null?n:re(this,p1);for(let c of s){let[l,f]=c;yr(this,EX,Vvt).call(this,t,l,f,r)&&a.push(c)}return a},EX=new WeakSet,Vvt=function(t,r,n=null,a){let s=new URL(t.url),c=new URL(r.url);if(a!=null&&a.ignoreSearch&&(c.search="",s.search=""),!uxn(s,c,!0))return!1;if(n==null||a!=null&&a.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Nwe(n.headersList.get("vary"));for(let f of l){if(f==="*")return!1;let d=r.headersList.get(f),m=t.headersList.get(f);if(d!==m)return!1}return!0};var bX=hS;Object.defineProperties(bX.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:ED,matchAll:ED,add:ED,addAll:ED,put:ED,delete:ED,keys:ED});var $vt=[{key:"ignoreSearch",converter:Vi.converters.boolean,defaultValue:!1},{key:"ignoreMethod",converter:Vi.converters.boolean,defaultValue:!1},{key:"ignoreVary",converter:Vi.converters.boolean,defaultValue:!1}];Vi.converters.CacheQueryOptions=Vi.dictionaryConverter($vt);Vi.converters.MultiCacheQueryOptions=Vi.dictionaryConverter([...$vt,{key:"cacheName",converter:Vi.converters.DOMString}]);Vi.converters.Response=Vi.interfaceConverter(Hvt);Vi.converters["sequence<RequestInfo>"]=Vi.sequenceConverter(Vi.converters.RequestInfo);Wvt.exports={Cache:bX}});var Jvt=P((pxi,Yvt)=>{"use strict";var{kConstruct:Lq}=AX(),{Cache:wX}=Gvt(),{webidl:Lm}=Pm(),{kEnumerableProperty:jq}=mo(),Gy,wD=class wD{constructor(){nr(this,Gy,new Map);arguments[0]!==Lq&&Lm.illegalConstructor()}async match(t,r={}){if(Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"}),t=Lm.converters.RequestInfo(t),r=Lm.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(re(this,Gy).has(r.cacheName)){let n=re(this,Gy).get(r.cacheName);return await new wX(Lq,n).match(t,r)}}else for(let n of re(this,Gy).values()){let s=await new wX(Lq,n).match(t,r);if(s!==void 0)return s}}async has(t){return Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"}),t=Lm.converters.DOMString(t),re(this,Gy).has(t)}async open(t){if(Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"}),t=Lm.converters.DOMString(t),re(this,Gy).has(t)){let n=re(this,Gy).get(t);return new wX(Lq,n)}let r=[];return re(this,Gy).set(t,r),new wX(Lq,r)}async delete(t){return Lm.brandCheck(this,wD),Lm.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"}),t=Lm.converters.DOMString(t),re(this,Gy).delete(t)}async keys(){return Lm.brandCheck(this,wD),[...re(this,Gy).keys()]}};Gy=new WeakMap;var SX=wD;Object.defineProperties(SX.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:jq,has:jq,open:jq,delete:jq,keys:jq});Yvt.exports={CacheStorage:SX}});var Xvt=P((dxi,Kvt)=>{"use strict";Kvt.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Owe=P((hxi,nxt)=>{"use strict";function gxn(e){if(e.length===0)return!1;for(let t of e){let r=t.charCodeAt(0);if(r>=0||r<=8||r>=10||r<=31||r===127)return!1}}function Zvt(e){for(let t of e){let r=t.charCodeAt(0);if(r<=32||r>127||t==="("||t===")"||t===">"||t==="<"||t==="@"||t===","||t===";"||t===":"||t==="\\"||t==='"'||t==="/"||t==="["||t==="]"||t==="?"||t==="="||t==="{"||t==="}")throw new Error("Invalid cookie name")}}function ext(e){for(let t of e){let r=t.charCodeAt(0);if(r<33||r===34||r===44||r===59||r===92||r>126)throw new Error("Invalid header value")}}function txt(e){for(let t of e)if(t.charCodeAt(0)<33||t===";")throw new Error("Invalid cookie path")}function Axn(e){if(e.startsWith("-")||e.endsWith(".")||e.endsWith("-"))throw new Error("Invalid cookie domain")}function rxt(e){typeof e=="number"&&(e=new Date(e));let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=t[e.getUTCDay()],a=e.getUTCDate().toString().padStart(2,"0"),s=r[e.getUTCMonth()],c=e.getUTCFullYear(),l=e.getUTCHours().toString().padStart(2,"0"),f=e.getUTCMinutes().toString().padStart(2,"0"),d=e.getUTCSeconds().toString().padStart(2,"0");return`${n}, ${a} ${s} ${c} ${l}:${f}:${d} GMT`}function yxn(e){if(e<0)throw new Error("Invalid cookie max-age")}function vxn(e){if(e.name.length===0)return null;Zvt(e.name),ext(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&t.push("Secure"),e.httpOnly&&t.push("HttpOnly"),typeof e.maxAge=="number"&&(yxn(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(Axn(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(txt(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!=="Invalid Date"&&t.push(`Expires=${rxt(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let r of e.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...a]=r.split("=");t.push(`${n.trim()}=${a.join("=")}`)}return t.join("; ")}nxt.exports={isCTLExcludingHtab:gxn,validateCookieName:Zvt,validateCookiePath:txt,validateCookieValue:ext,toIMFDate:rxt,stringify:vxn}});var sxt=P((mxi,ixt)=>{"use strict";var{maxNameValuePairSize:xxn,maxAttributeValueSize:bxn}=Xvt(),{isCTLExcludingHtab:Exn}=Owe(),{collectASequenceOfCodePointsFast:CX}=jx(),wxn=require("assert");function Sxn(e){if(Exn(e))return null;let t="",r="",n="",a="";if(e.includes(";")){let s={position:0};t=CX(";",e,s),r=e.slice(s.position)}else t=e;if(!t.includes("="))a=t;else{let s={position:0};n=CX("=",t,s),a=t.slice(s.position+1)}return n=n.trim(),a=a.trim(),n.length+a.length>xxn?null:{name:n,value:a,...N4(r)}}function N4(e,t={}){var c;if(e.length===0)return t;wxn(e[0]===";"),e=e.slice(1);let r="";e.includes(";")?(r=CX(";",e,{position:0}),e=e.slice(r.length)):(r=e,e="");let n="",a="";if(r.includes("=")){let l={position:0};n=CX("=",r,l),a=r.slice(l.position+1)}else n=r;if(n=n.trim(),a=a.trim(),a.length>bxn)return N4(e,t);let s=n.toLowerCase();if(s==="expires"){let l=new Date(a);t.expires=l}else if(s==="max-age"){let l=a.charCodeAt(0);if((l<48||l>57)&&a[0]!=="-"||!/^\d+$/.test(a))return N4(e,t);let f=Number(a);t.maxAge=f}else if(s==="domain"){let l=a;l[0]==="."&&(l=l.slice(1)),l=l.toLowerCase(),t.domain=l}else if(s==="path"){let l="";a.length===0||a[0]!=="/"?l="/":l=a,t.path=l}else if(s==="secure")t.secure=!0;else if(s==="httponly")t.httpOnly=!0;else if(s==="samesite"){let l="Default",f=a.toLowerCase();f.includes("none")&&(l="None"),f.includes("strict")&&(l="Strict"),f.includes("lax")&&(l="Lax"),t.sameSite=l}else(c=t.unparsed)!=null||(t.unparsed=[]),t.unparsed.push(`${n}=${a}`);return N4(e,t)}ixt.exports={parseSetCookie:Sxn,parseUnparsedAttributes:N4}});var uxt=P((gxi,cxt)=>{"use strict";var{parseSetCookie:Cxn}=sxt(),{stringify:axt}=Owe(),{webidl:Ha}=Pm(),{Headers:_X}=vD();function _xn(e){Ha.argumentLengthCheck(arguments,1,{header:"getCookies"}),Ha.brandCheck(e,_X,{strict:!1});let t=e.get("cookie"),r={};if(!t)return r;for(let n of t.split(";")){let[a,...s]=n.split("=");r[a.trim()]=s.join("=")}return r}function Ixn(e,t,r){Ha.argumentLengthCheck(arguments,2,{header:"deleteCookie"}),Ha.brandCheck(e,_X,{strict:!1}),t=Ha.converters.DOMString(t),r=Ha.converters.DeleteCookieAttributes(r),oxt(e,{name:t,value:"",expires:new Date(0),...r})}function kxn(e){Ha.argumentLengthCheck(arguments,1,{header:"getSetCookies"}),Ha.brandCheck(e,_X,{strict:!1});let t=e.getSetCookie();return t?t.map(r=>Cxn(r)):[]}function oxt(e,t){Ha.argumentLengthCheck(arguments,2,{header:"setCookie"}),Ha.brandCheck(e,_X,{strict:!1}),t=Ha.converters.Cookie(t),axt(t)&&e.append("Set-Cookie",axt(t))}Ha.converters.DeleteCookieAttributes=Ha.dictionaryConverter([{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"path",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"domain",defaultValue:null}]);Ha.converters.Cookie=Ha.dictionaryConverter([{converter:Ha.converters.DOMString,key:"name"},{converter:Ha.converters.DOMString,key:"value"},{converter:Ha.nullableConverter(e=>typeof e=="number"?Ha.converters["unsigned long long"](e):new Date(e)),key:"expires",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters["long long"]),key:"maxAge",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"domain",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.DOMString),key:"path",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.boolean),key:"secure",defaultValue:null},{converter:Ha.nullableConverter(Ha.converters.boolean),key:"httpOnly",defaultValue:null},{converter:Ha.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ha.sequenceConverter(Ha.converters.DOMString),key:"unparsed",defaultValue:[]}]);cxt.exports={getCookies:_xn,deleteCookie:Ixn,getSetCookies:kxn,setCookie:oxt}});var F4=P((Axi,lxt)=>{"use strict";var Txn="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",Bxn={enumerable:!0,writable:!1,configurable:!1},Dxn={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Pxn={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},Rxn=2**16-1,Nxn={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Fxn=Buffer.allocUnsafe(0);lxt.exports={uid:Txn,staticPropertyDescriptors:Bxn,states:Dxn,opcodes:Pxn,maxUnsigned16Bit:Rxn,parserStates:Nxn,emptyBuffer:Fxn}});var Mq=P((yxi,pxt)=>{"use strict";pxt.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var Lwe=P((vxi,fxt)=>{"use strict";var{webidl:$i}=Pm(),{kEnumerableProperty:sg}=mo(),{MessagePort:Oxn}=require("worker_threads"),Hx,mS=class mS extends Event{constructor(r,n={}){$i.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"}),r=$i.converters.DOMString(r),n=$i.converters.MessageEventInit(n);super(r,n);nr(this,Hx,void 0);Qt(this,Hx,n)}get data(){return $i.brandCheck(this,mS),re(this,Hx).data}get origin(){return $i.brandCheck(this,mS),re(this,Hx).origin}get lastEventId(){return $i.brandCheck(this,mS),re(this,Hx).lastEventId}get source(){return $i.brandCheck(this,mS),re(this,Hx).source}get ports(){return $i.brandCheck(this,mS),Object.isFrozen(re(this,Hx).ports)||Object.freeze(re(this,Hx).ports),re(this,Hx).ports}initMessageEvent(r,n=!1,a=!1,s=null,c="",l="",f=null,d=[]){return $i.brandCheck(this,mS),$i.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"}),new mS(r,{bubbles:n,cancelable:a,data:s,origin:c,lastEventId:l,source:f,ports:d})}};Hx=new WeakMap;var IX=mS,CD,qq=class qq extends Event{constructor(r,n={}){$i.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"}),r=$i.converters.DOMString(r),n=$i.converters.CloseEventInit(n);super(r,n);nr(this,CD,void 0);Qt(this,CD,n)}get wasClean(){return $i.brandCheck(this,qq),re(this,CD).wasClean}get code(){return $i.brandCheck(this,qq),re(this,CD).code}get reason(){return $i.brandCheck(this,qq),re(this,CD).reason}};CD=new WeakMap;var kX=qq,gS,SD=class SD extends Event{constructor(r,n){$i.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"});super(r,n);nr(this,gS,void 0);r=$i.converters.DOMString(r),n=$i.converters.ErrorEventInit(n!=null?n:{}),Qt(this,gS,n)}get message(){return $i.brandCheck(this,SD),re(this,gS).message}get filename(){return $i.brandCheck(this,SD),re(this,gS).filename}get lineno(){return $i.brandCheck(this,SD),re(this,gS).lineno}get colno(){return $i.brandCheck(this,SD),re(this,gS).colno}get error(){return $i.brandCheck(this,SD),re(this,gS).error}};gS=new WeakMap;var TX=SD;Object.defineProperties(IX.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:sg,origin:sg,lastEventId:sg,source:sg,ports:sg,initMessageEvent:sg});Object.defineProperties(kX.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:sg,code:sg,wasClean:sg});Object.defineProperties(TX.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:sg,filename:sg,lineno:sg,colno:sg,error:sg});$i.converters.MessagePort=$i.interfaceConverter(Oxn);$i.converters["sequence<MessagePort>"]=$i.sequenceConverter($i.converters.MessagePort);var Qwe=[{key:"bubbles",converter:$i.converters.boolean,defaultValue:!1},{key:"cancelable",converter:$i.converters.boolean,defaultValue:!1},{key:"composed",converter:$i.converters.boolean,defaultValue:!1}];$i.converters.MessageEventInit=$i.dictionaryConverter([...Qwe,{key:"data",converter:$i.converters.any,defaultValue:null},{key:"origin",converter:$i.converters.USVString,defaultValue:""},{key:"lastEventId",converter:$i.converters.DOMString,defaultValue:""},{key:"source",converter:$i.nullableConverter($i.converters.MessagePort),defaultValue:null},{key:"ports",converter:$i.converters["sequence<MessagePort>"],get defaultValue(){return[]}}]);$i.converters.CloseEventInit=$i.dictionaryConverter([...Qwe,{key:"wasClean",converter:$i.converters.boolean,defaultValue:!1},{key:"code",converter:$i.converters["unsigned short"],defaultValue:0},{key:"reason",converter:$i.converters.USVString,defaultValue:""}]);$i.converters.ErrorEventInit=$i.dictionaryConverter([...Qwe,{key:"message",converter:$i.converters.DOMString,defaultValue:""},{key:"filename",converter:$i.converters.USVString,defaultValue:""},{key:"lineno",converter:$i.converters["unsigned long"],defaultValue:0},{key:"colno",converter:$i.converters["unsigned long"],defaultValue:0},{key:"error",converter:$i.converters.any}]);fxt.exports={MessageEvent:IX,CloseEvent:kX,ErrorEvent:TX}});var PX=P((bxi,mxt)=>{"use strict";var{kReadyState:BX,kController:Qxn,kResponse:Lxn,kBinaryType:jxn,kWebSocketURL:Mxn}=Mq(),{states:DX,opcodes:dxt}=F4(),{MessageEvent:qxn,ErrorEvent:Uxn}=Lwe();function zxn(e){return e[BX]===DX.OPEN}function Hxn(e){return e[BX]===DX.CLOSING}function Vxn(e){return e[BX]===DX.CLOSED}function jwe(e,t,r=Event,n){let a=new r(e,n);t.dispatchEvent(a)}function $xn(e,t,r){if(e[BX]!==DX.OPEN)return;let n;if(t===dxt.TEXT)try{n=new TextDecoder("utf-8",{fatal:!0}).decode(r)}catch{hxt(e,"Received invalid UTF-8 in text frame.");return}else t===dxt.BINARY&&(e[jxn]==="blob"?n=new Blob([r]):n=new Uint8Array(r).buffer);jwe("message",e,qxn,{origin:e[Mxn].origin,data:n})}function Wxn(e){if(e.length===0)return!1;for(let t of e){let r=t.charCodeAt(0);if(r<33||r>126||t==="("||t===")"||t==="<"||t===">"||t==="@"||t===","||t===";"||t===":"||t==="\\"||t==='"'||t==="/"||t==="["||t==="]"||t==="?"||t==="="||t==="{"||t==="}"||r===32||r===9)return!1}return!0}function Gxn(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function hxt(e,t){let{[Qxn]:r,[Lxn]:n}=e;r.abort(),n!=null&&n.socket&&!n.socket.destroyed&&n.socket.destroy(),t&&jwe("error",e,Uxn,{error:new Error(t)})}mxt.exports={isEstablished:zxn,isClosing:Hxn,isClosed:Vxn,fireEvent:jwe,isValidSubprotocol:Wxn,isValidStatusCode:Gxn,failWebsocketConnection:hxt,websocketMessageReceived:$xn}});var bxt=P((Exi,xxt)=>{"use strict";var qwe=require("diagnostics_channel"),{uid:Yxn,states:Axt}=F4(),{kReadyState:yxt,kSentClose:gxt,kByteParser:vxt,kReceivedClose:Jxn}=Mq(),{fireEvent:Kxn,failWebsocketConnection:_D}=PX(),{CloseEvent:Xxn}=Lwe(),{makeRequest:Zxn}=Fq(),{fetching:ebn}=dX(),{Headers:tbn}=vD(),{getGlobalDispatcher:rbn}=b4(),{kHeadersList:nbn}=gu(),AS={};AS.open=qwe.channel("undici:websocket:open");AS.close=qwe.channel("undici:websocket:close");AS.socketError=qwe.channel("undici:websocket:socket_error");var Mwe;try{Mwe=require("crypto")}catch{}function ibn(e,t,r,n,a){var m;let s=e;s.protocol=e.protocol==="ws:"?"http:":"https:";let c=Zxn({urlList:[s],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(a.headers){let g=new tbn(a.headers)[nbn];c.headersList=g}let l=Mwe.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l),c.headersList.append("sec-websocket-version","13");for(let g of t)c.headersList.append("sec-websocket-protocol",g);let f="";return ebn({request:c,useParallelQueue:!0,dispatcher:(m=a.dispatcher)!=null?m:rbn(),processResponse(g){var I,k;if(g.type==="error"||g.status!==101){_D(r,"Received network error or non-101 status code.");return}if(t.length!==0&&!g.headersList.get("Sec-WebSocket-Protocol")){_D(r,"Server did not respond with sent protocols.");return}if(((I=g.headersList.get("Upgrade"))==null?void 0:I.toLowerCase())!=="websocket"){_D(r,'Server did not set Upgrade header to "websocket".');return}if(((k=g.headersList.get("Connection"))==null?void 0:k.toLowerCase())!=="upgrade"){_D(r,'Server did not set Connection header to "upgrade".');return}let x=g.headersList.get("Sec-WebSocket-Accept"),b=Mwe.createHash("sha1").update(l+Yxn).digest("base64");if(x!==b){_D(r,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=g.headersList.get("Sec-WebSocket-Extensions");if(A!==null&&A!==f){_D(r,"Received different permessage-deflate than the one set.");return}let C=g.headersList.get("Sec-WebSocket-Protocol");if(C!==null&&C!==c.headersList.get("Sec-WebSocket-Protocol")){_D(r,"Protocol was not set in the opening handshake.");return}g.socket.on("data",sbn),g.socket.on("close",abn),g.socket.on("error",obn),AS.open.hasSubscribers&&AS.open.publish({address:g.socket.address(),protocol:C,extensions:A}),n(g)}})}function sbn(e){this.ws[vxt].write(e)||this.pause()}function abn(){var s;let{ws:e}=this,t=e[gxt]&&e[Jxn],r=1005,n="",a=e[vxt].closingInfo;a?(r=(s=a.code)!=null?s:1005,n=a.reason):e[gxt]||(r=1006),e[yxt]=Axt.CLOSED,Kxn("close",e,Xxn,{wasClean:t,code:r,reason:n}),AS.close.hasSubscribers&&AS.close.publish({websocket:e,code:r,reason:n})}function obn(e){let{ws:t}=this;t[yxt]=Axt.CLOSING,AS.socketError.hasSubscribers&&AS.socketError.publish(e),this.destroy()}xxt.exports={establishWebSocketConnection:ibn}});var zwe=P((wxi,wxt)=>{"use strict";var{maxUnsigned16Bit:cbn}=F4(),Ext;try{Ext=require("crypto")}catch{}var Uwe=class{constructor(t){this.frameData=t,this.maskKey=Ext.randomBytes(4)}createFrame(t){var c,l;let r=(l=(c=this.frameData)==null?void 0:c.byteLength)!=null?l:0,n=r,a=6;r>cbn?(a+=8,n=127):r>125&&(a+=2,n=126);let s=Buffer.allocUnsafe(r+a);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+t;s[a-4]=this.maskKey[0],s[a-3]=this.maskKey[1],s[a-2]=this.maskKey[2],s[a-1]=this.maskKey[3],s[1]=n,n===126?s.writeUInt16BE(r,2):n===127&&(s[2]=s[3]=0,s.writeUIntBE(r,4,6)),s[1]|=128;for(let f=0;f<r;f++)s[a+f]=this.frameData[f]^this.maskKey[f%4];return s}};wxt.exports={WebsocketFrameSend:Uwe}});var Dxt=P((Sxi,Bxt)=>{"use strict";var{Writable:ubn}=require("stream"),Txt=require("diagnostics_channel"),{parserStates:Yy,opcodes:Jy,states:lbn,emptyBuffer:pbn}=F4(),{kReadyState:fbn,kSentClose:Sxt,kResponse:Cxt,kReceivedClose:_xt}=Mq(),{isValidStatusCode:Ixt,failWebsocketConnection:Uq,websocketMessageReceived:dbn}=PX(),{WebsocketFrameSend:kxt}=zwe(),O4={};O4.ping=Txt.channel("undici:websocket:ping");O4.pong=Txt.channel("undici:websocket:pong");var Vx,jm,ag,go,Q4,Hwe=class extends ubn{constructor(r){super();nr(this,Vx,[]);nr(this,jm,0);nr(this,ag,Yy.INFO);nr(this,go,{});nr(this,Q4,[]);this.ws=r}_write(r,n,a){re(this,Vx).push(r),Qt(this,jm,re(this,jm)+r.length),this.run(a)}run(r){var n,a;for(;;){if(re(this,ag)===Yy.INFO){if(re(this,jm)<2)return r();let s=this.consume(2);if(re(this,go).fin=(s[0]&128)!==0,re(this,go).opcode=s[0]&15,(a=(n=re(this,go)).originalOpcode)!=null||(n.originalOpcode=re(this,go).opcode),re(this,go).fragmented=!re(this,go).fin&&re(this,go).opcode!==Jy.CONTINUATION,re(this,go).fragmented&&re(this,go).opcode!==Jy.BINARY&&re(this,go).opcode!==Jy.TEXT){Uq(this.ws,"Invalid frame type was fragmented.");return}let c=s[1]&127;if(c<=125?(re(this,go).payloadLength=c,Qt(this,ag,Yy.READ_DATA)):c===126?Qt(this,ag,Yy.PAYLOADLENGTH_16):c===127&&Qt(this,ag,Yy.PAYLOADLENGTH_64),re(this,go).fragmented&&c>125){Uq(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((re(this,go).opcode===Jy.PING||re(this,go).opcode===Jy.PONG||re(this,go).opcode===Jy.CLOSE)&&c>125){Uq(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(re(this,go).opcode===Jy.CLOSE){if(c===1){Uq(this.ws,"Received close frame with a 1-byte body.");return}let l=this.consume(c);if(re(this,go).closeInfo=this.parseCloseBody(!1,l),!this.ws[Sxt]){let f=Buffer.allocUnsafe(2);f.writeUInt16BE(re(this,go).closeInfo.code,0);let d=new kxt(f);this.ws[Cxt].socket.write(d.createFrame(Jy.CLOSE),m=>{m||(this.ws[Sxt]=!0)})}this.ws[fbn]=lbn.CLOSING,this.ws[_xt]=!0,this.end();return}else if(re(this,go).opcode===Jy.PING){let l=this.consume(c);if(!this.ws[_xt]){let f=new kxt(l);this.ws[Cxt].socket.write(f.createFrame(Jy.PONG)),O4.ping.hasSubscribers&&O4.ping.publish({payload:l})}if(Qt(this,ag,Yy.INFO),re(this,jm)>0)continue;r();return}else if(re(this,go).opcode===Jy.PONG){let l=this.consume(c);if(O4.pong.hasSubscribers&&O4.pong.publish({payload:l}),re(this,jm)>0)continue;r();return}}else if(re(this,ag)===Yy.PAYLOADLENGTH_16){if(re(this,jm)<2)return r();let s=this.consume(2);re(this,go).payloadLength=s.readUInt16BE(0),Qt(this,ag,Yy.READ_DATA)}else if(re(this,ag)===Yy.PAYLOADLENGTH_64){if(re(this,jm)<8)return r();let s=this.consume(8),c=s.readUInt32BE(0);if(c>2**31-1){Uq(this.ws,"Received payload length > 2^31 bytes.");return}let l=s.readUInt32BE(4);re(this,go).payloadLength=(c<<8)+l,Qt(this,ag,Yy.READ_DATA)}else if(re(this,ag)===Yy.READ_DATA){if(re(this,jm)<re(this,go).payloadLength)return r();if(re(this,jm)>=re(this,go).payloadLength){let s=this.consume(re(this,go).payloadLength);if(re(this,Q4).push(s),!re(this,go).fragmented||re(this,go).fin&&re(this,go).opcode===Jy.CONTINUATION){let c=Buffer.concat(re(this,Q4));dbn(this.ws,re(this,go).originalOpcode,c),Qt(this,go,{}),re(this,Q4).length=0}Qt(this,ag,Yy.INFO)}}if(!(re(this,jm)>0)){r();break}}}consume(r){if(r>re(this,jm))return null;if(r===0)return pbn;if(re(this,Vx)[0].length===r)return Qt(this,jm,re(this,jm)-re(this,Vx)[0].length),re(this,Vx).shift();let n=Buffer.allocUnsafe(r),a=0;for(;a!==r;){let s=re(this,Vx)[0],{length:c}=s;if(c+a===r){n.set(re(this,Vx).shift(),a);break}else if(c+a>r){n.set(s.subarray(0,r-a),a),re(this,Vx)[0]=s.subarray(r-a);break}else n.set(re(this,Vx).shift(),a),a+=s.length}return Qt(this,jm,re(this,jm)-r),n}parseCloseBody(r,n){let a;if(n.length>=2&&(a=n.readUInt16BE(0)),r)return Ixt(a)?{code:a}:null;let s=n.subarray(2);if(s[0]===239&&s[1]===187&&s[2]===191&&(s=s.subarray(3)),a!==void 0&&!Ixt(a))return null;try{s=new TextDecoder("utf-8",{fatal:!0}).decode(s)}catch{return null}return{code:a,reason:s}}get closingInfo(){return re(this,go).closeInfo}};Vx=new WeakMap,jm=new WeakMap,ag=new WeakMap,go=new WeakMap,Q4=new WeakMap;Bxt.exports={ByteParser:Hwe}});var Mxt=P((_xi,jxt)=>{"use strict";var{webidl:ws}=Pm(),{DOMException:bI}=pI(),{URLSerializer:hbn}=jx(),{getGlobalOrigin:mbn}=ZO(),{staticPropertyDescriptors:EI,states:L4,opcodes:zq,emptyBuffer:gbn}=F4(),{kWebSocketURL:Pxt,kReadyState:yS,kController:Abn,kBinaryType:RX,kResponse:NX,kSentClose:ybn,kByteParser:vbn}=Mq(),{isEstablished:Rxt,isClosing:Nxt,isValidSubprotocol:xbn,failWebsocketConnection:bbn,fireEvent:Ebn}=PX(),{establishWebSocketConnection:wbn}=bxt(),{WebsocketFrameSend:Hq}=zwe(),{ByteParser:Sbn}=Dxt(),{kEnumerableProperty:Ky,isBlobLike:Oxt}=mo(),{getGlobalDispatcher:Cbn}=b4(),{types:Qxt}=require("util"),Fxt=!1,ml,Xy,Vq,$q,FX,Lxt,xu=class xu extends EventTarget{constructor(r,n=[]){super();nr(this,FX);nr(this,ml,{open:null,error:null,close:null,message:null});nr(this,Xy,0);nr(this,Vq,"");nr(this,$q,"");ws.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"}),Fxt||(Fxt=!0,process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"}));let a=ws.converters["DOMString or sequence<DOMString> or WebSocketInit"](n);r=ws.converters.USVString(r),n=a.protocols;let s=mbn(),c;try{c=new URL(r,s)}catch(l){throw new bI(l,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new bI(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new bI("Got fragment","SyntaxError");if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(l=>l.toLowerCase())).size)throw new bI("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(l=>xbn(l)))throw new bI("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[Pxt]=new URL(c.href),this[Abn]=wbn(c,n,this,l=>yr(this,FX,Lxt).call(this,l),a),this[yS]=xu.CONNECTING,this[RX]="blob"}close(r=void 0,n=void 0){if(ws.brandCheck(this,xu),r!==void 0&&(r=ws.converters["unsigned short"](r,{clamp:!0})),n!==void 0&&(n=ws.converters.USVString(n)),r!==void 0&&r!==1e3&&(r<3e3||r>4999))throw new bI("invalid code","InvalidAccessError");let a=0;if(n!==void 0&&(a=Buffer.byteLength(n),a>123))throw new bI(`Reason must be less than 123 bytes; received ${a}`,"SyntaxError");if(!(this[yS]===xu.CLOSING||this[yS]===xu.CLOSED))if(!Rxt(this))bbn(this,"Connection was closed before it was established."),this[yS]=xu.CLOSING;else if(Nxt(this))this[yS]=xu.CLOSING;else{let s=new Hq;r!==void 0&&n===void 0?(s.frameData=Buffer.allocUnsafe(2),s.frameData.writeUInt16BE(r,0)):r!==void 0&&n!==void 0?(s.frameData=Buffer.allocUnsafe(2+a),s.frameData.writeUInt16BE(r,0),s.frameData.write(n,2,"utf-8")):s.frameData=gbn,this[NX].socket.write(s.createFrame(zq.CLOSE),l=>{l||(this[ybn]=!0)}),this[yS]=L4.CLOSING}}send(r){if(ws.brandCheck(this,xu),ws.argumentLengthCheck(arguments,1,{header:"WebSocket.send"}),r=ws.converters.WebSocketSendData(r),this[yS]===xu.CONNECTING)throw new bI("Sent before connected.","InvalidStateError");if(!Rxt(this)||Nxt(this))return;let n=this[NX].socket;if(typeof r=="string"){let a=Buffer.from(r),c=new Hq(a).createFrame(zq.TEXT);Qt(this,Xy,re(this,Xy)+a.byteLength),n.write(c,()=>{Qt(this,Xy,re(this,Xy)-a.byteLength)})}else if(Qxt.isArrayBuffer(r)){let a=Buffer.from(r),c=new Hq(a).createFrame(zq.BINARY);Qt(this,Xy,re(this,Xy)+a.byteLength),n.write(c,()=>{Qt(this,Xy,re(this,Xy)-a.byteLength)})}else if(ArrayBuffer.isView(r)){let a=Buffer.from(r,r.byteOffset,r.byteLength),c=new Hq(a).createFrame(zq.BINARY);Qt(this,Xy,re(this,Xy)+a.byteLength),n.write(c,()=>{Qt(this,Xy,re(this,Xy)-a.byteLength)})}else if(Oxt(r)){let a=new Hq;r.arrayBuffer().then(s=>{let c=Buffer.from(s);a.frameData=c;let l=a.createFrame(zq.BINARY);Qt(this,Xy,re(this,Xy)+c.byteLength),n.write(l,()=>{Qt(this,Xy,re(this,Xy)-c.byteLength)})})}}get readyState(){return ws.brandCheck(this,xu),this[yS]}get bufferedAmount(){return ws.brandCheck(this,xu),re(this,Xy)}get url(){return ws.brandCheck(this,xu),hbn(this[Pxt])}get extensions(){return ws.brandCheck(this,xu),re(this,$q)}get protocol(){return ws.brandCheck(this,xu),re(this,Vq)}get onopen(){return ws.brandCheck(this,xu),re(this,ml).open}set onopen(r){ws.brandCheck(this,xu),re(this,ml).open&&this.removeEventListener("open",re(this,ml).open),typeof r=="function"?(re(this,ml).open=r,this.addEventListener("open",r)):re(this,ml).open=null}get onerror(){return ws.brandCheck(this,xu),re(this,ml).error}set onerror(r){ws.brandCheck(this,xu),re(this,ml).error&&this.removeEventListener("error",re(this,ml).error),typeof r=="function"?(re(this,ml).error=r,this.addEventListener("error",r)):re(this,ml).error=null}get onclose(){return ws.brandCheck(this,xu),re(this,ml).close}set onclose(r){ws.brandCheck(this,xu),re(this,ml).close&&this.removeEventListener("close",re(this,ml).close),typeof r=="function"?(re(this,ml).close=r,this.addEventListener("close",r)):re(this,ml).close=null}get onmessage(){return ws.brandCheck(this,xu),re(this,ml).message}set onmessage(r){ws.brandCheck(this,xu),re(this,ml).message&&this.removeEventListener("message",re(this,ml).message),typeof r=="function"?(re(this,ml).message=r,this.addEventListener("message",r)):re(this,ml).message=null}get binaryType(){return ws.brandCheck(this,xu),this[RX]}set binaryType(r){ws.brandCheck(this,xu),r!=="blob"&&r!=="arraybuffer"?this[RX]="blob":this[RX]=r}};ml=new WeakMap,Xy=new WeakMap,Vq=new WeakMap,$q=new WeakMap,FX=new WeakSet,Lxt=function(r){this[NX]=r;let n=new Sbn(this);n.on("drain",function(){this.ws[NX].socket.resume()}),r.socket.ws=this,this[vbn]=n,this[yS]=L4.OPEN;let a=r.headersList.get("sec-websocket-extensions");a!==null&&Qt(this,$q,a);let s=r.headersList.get("sec-websocket-protocol");s!==null&&Qt(this,Vq,s),Ebn("open",this)};var lA=xu;lA.CONNECTING=lA.prototype.CONNECTING=L4.CONNECTING;lA.OPEN=lA.prototype.OPEN=L4.OPEN;lA.CLOSING=lA.prototype.CLOSING=L4.CLOSING;lA.CLOSED=lA.prototype.CLOSED=L4.CLOSED;Object.defineProperties(lA.prototype,{CONNECTING:EI,OPEN:EI,CLOSING:EI,CLOSED:EI,url:Ky,readyState:Ky,bufferedAmount:Ky,onopen:Ky,onerror:Ky,onclose:Ky,close:Ky,onmessage:Ky,binaryType:Ky,send:Ky,extensions:Ky,protocol:Ky,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(lA,{CONNECTING:EI,OPEN:EI,CLOSING:EI,CLOSED:EI});ws.converters["sequence<DOMString>"]=ws.sequenceConverter(ws.converters.DOMString);ws.converters["DOMString or sequence<DOMString>"]=function(e){return ws.util.Type(e)==="Object"&&Symbol.iterator in e?ws.converters["sequence<DOMString>"](e):ws.converters.DOMString(e)};ws.converters.WebSocketInit=ws.dictionaryConverter([{key:"protocols",converter:ws.converters["DOMString or sequence<DOMString>"],get defaultValue(){return[]}},{key:"dispatcher",converter:e=>e,get defaultValue(){return Cbn()}},{key:"headers",converter:ws.nullableConverter(ws.converters.HeadersInit)}]);ws.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(e){return ws.util.Type(e)==="Object"&&!(Symbol.iterator in e)?ws.converters.WebSocketInit(e):{protocols:ws.converters["DOMString or sequence<DOMString>"](e)}};ws.converters.WebSocketSendData=function(e){if(ws.util.Type(e)==="Object"){if(Oxt(e))return ws.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||Qxt.isAnyArrayBuffer(e))return ws.converters.BufferSource(e)}return ws.converters.USVString(e)};jxt.exports={WebSocket:lA}});var Hxt=P((kxi,Gs)=>{"use strict";var _bn=Eq(),qxt=dK(),Uxt=jc(),Ibn=f4(),kbn=Kgt(),Tbn=_q(),ID=mo(),{InvalidArgumentError:OX}=Uxt,j4=UAt(),Bbn=hq(),Dbn=ewe(),Pbn=Syt(),Rbn=nwe(),Nbn=U1e(),Fbn=Byt(),Obn=Fyt(),{getGlobalDispatcher:zxt,setGlobalDispatcher:Qbn}=b4(),Lbn=qyt(),jbn=ZEe(),Mbn=AK(),Vwe;try{require("crypto"),Vwe=!0}catch{Vwe=!1}Object.assign(qxt.prototype,j4);Gs.exports.Dispatcher=qxt;Gs.exports.Client=_bn;Gs.exports.Pool=Ibn;Gs.exports.BalancedPool=kbn;Gs.exports.Agent=Tbn;Gs.exports.ProxyAgent=Fbn;Gs.exports.RetryHandler=Obn;Gs.exports.DecoratorHandler=Lbn;Gs.exports.RedirectHandler=jbn;Gs.exports.createRedirectInterceptor=Mbn;Gs.exports.buildConnector=Bbn;Gs.exports.errors=Uxt;function Wq(e){return(t,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!t||typeof t!="string"&&typeof t!="object"&&!(t instanceof URL))throw new OX("invalid url");if(r!=null&&typeof r!="object")throw new OX("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new OX("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),t=new URL(ID.parseOrigin(t).origin+c)}else r||(r=typeof t=="object"?t:{}),t=ID.parseURL(t);let{agent:a,dispatcher:s=zxt()}=r;if(a)throw new OX("unsupported opts.agent. Did you mean opts.client?");return e.call(s,{...r,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}Gs.exports.setGlobalDispatcher=Qbn;Gs.exports.getGlobalDispatcher=zxt;if(ID.nodeMajor>16||ID.nodeMajor===16&&ID.nodeMinor>=8){let e=null;Gs.exports.fetch=async function(c){e||(e=dX().fetch);try{return await e(...arguments)}catch(l){throw typeof l=="object"&&Error.captureStackTrace(l,this),l}},Gs.exports.Headers=vD().Headers,Gs.exports.Response=tX().Response,Gs.exports.Request=Fq().Request,Gs.exports.FormData=lK().FormData,Gs.exports.File=cK().File,Gs.exports.FileReader=Qvt().FileReader;let{setGlobalOrigin:t,getGlobalOrigin:r}=ZO();Gs.exports.setGlobalOrigin=t,Gs.exports.getGlobalOrigin=r;let{CacheStorage:n}=Jvt(),{kConstruct:a}=AX();Gs.exports.caches=new n(a)}if(ID.nodeMajor>=16){let{deleteCookie:e,getCookies:t,getSetCookies:r,setCookie:n}=uxt();Gs.exports.deleteCookie=e,Gs.exports.getCookies=t,Gs.exports.getSetCookies=r,Gs.exports.setCookie=n;let{parseMIMEType:a,serializeAMimeType:s}=jx();Gs.exports.parseMIMEType=a,Gs.exports.serializeAMimeType=s}if(ID.nodeMajor>=18&&Vwe){let{WebSocket:e}=Mxt();Gs.exports.WebSocket=e}Gs.exports.request=Wq(j4.request);Gs.exports.stream=Wq(j4.stream);Gs.exports.pipeline=Wq(j4.pipeline);Gs.exports.connect=Wq(j4.connect);Gs.exports.upgrade=Wq(j4.upgrade);Gs.exports.MockClient=Dbn;Gs.exports.MockPool=Rbn;Gs.exports.MockAgent=Pbn;Gs.exports.mockErrors=Nbn});var Yxt=P((Txi,Gxt)=>{Gxt.exports=Wxt;var Wwe=require("fs"),{EventEmitter:qbn}=require("events"),{Minimatch:$we}=require("minimatch"),{resolve:Ubn}=require("path");function zbn(e,t){return new Promise((r,n)=>{Wwe.readdir(e,{withFileTypes:!0},(a,s)=>{if(a)switch(a.code){case"ENOTDIR":t?n(a):r([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":r([]);break;case"ELOOP":default:n(a);break}else r(s)})})}function Vxt(e,t){return new Promise((r,n)=>{(t?Wwe.stat:Wwe.lstat)(e,(s,c)=>{if(s)switch(s.code){case"ENOENT":r(t?Vxt(e,!1):null);break;default:r(null);break}else r(c)})})}async function*$xt(e,t,r,n,a,s){let c=await zbn(t+e,s);for(let l of c){let f=l.name;f===void 0&&(f=l,n=!0);let d=e+"/"+f,m=d.slice(1),g=t+"/"+m,x=null;(n||r)&&(x=await Vxt(g,r)),!x&&l.name!==void 0&&(x=l),x===null&&(x={isDirectory:()=>!1}),x.isDirectory()?a(m)||(yield{relative:m,absolute:g,stats:x},yield*$xt(d,t,r,n,a,!1)):yield{relative:m,absolute:g,stats:x}}}async function*Hbn(e,t,r,n){yield*$xt("",e,t,r,n,!0)}function Vbn(e){return{pattern:e.pattern,dot:!!e.dot,noglobstar:!!e.noglobstar,matchBase:!!e.matchBase,nocase:!!e.nocase,ignore:e.ignore,skip:e.skip,follow:!!e.follow,stat:!!e.stat,nodir:!!e.nodir,mark:!!e.mark,silent:!!e.silent,absolute:!!e.absolute}}var QX=class extends qbn{constructor(t,r,n){if(super(),typeof r=="function"&&(n=r,r=null),this.options=Vbn(r||{}),this.matchers=[],this.options.pattern){let a=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=a.map(s=>new $we(s,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let a=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=a.map(s=>new $we(s,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let a=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=a.map(s=>new $we(s,{dot:!0}))}this.iterator=Hbn(Ubn(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,n&&(this._matches=[],this.on("match",a=>this._matches.push(this.options.absolute?a.absolute:a.relative)),this.on("error",a=>n(a)),this.on("end",()=>n(null,this._matches))),setTimeout(()=>this._next(),0)}_shouldSkipDirectory(t){return this.skipMatchers.some(r=>r.match(t))}_fileMatches(t,r){let n=t+(r?"/":"");return(this.matchers.length===0||this.matchers.some(a=>a.match(n)))&&!this.ignoreMatchers.some(a=>a.match(n))&&(!this.options.nodir||!r)}_next(){!this.paused&&!this.aborted?this.iterator.next().then(t=>{if(t.done)this.emit("end");else{let r=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,r)){let n=t.value.relative,a=t.value.absolute;this.options.mark&&r&&(n+="/",a+="/"),this.options.stat?this.emit("match",{relative:n,absolute:a,stat:t.value.stats}):this.emit("match",{relative:n,absolute:a})}this._next(this.iterator)}}).catch(t=>{this.abort(),this.emit("error",t),!t.code&&!this.options.silent&&console.error(t)}):this.inactive=!0}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}};function Wxt(e,t,r){return new QX(e,t,r)}Wxt.ReaddirGlob=QX});var Kxt=P((Bxi,Jxt)=>{"use strict";var f1=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";f1.writable=e=>f1(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";f1.readable=e=>f1(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";f1.duplex=e=>f1.writable(e)&&f1.readable(e);f1.transform=e=>f1.duplex(e)&&typeof e._transform=="function";Jxt.exports=f1});var Gq=P((Dxi,Gwe)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Gwe.exports={nextTick:$bn}:Gwe.exports=process;function $bn(e,t,r,n){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var a=arguments.length,s,c;switch(a){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,n)});default:for(s=new Array(a-1),c=0;c<s.length;)s[c++]=arguments[c];return process.nextTick(function(){e.apply(null,s)})}}});var Zxt=P((Pxi,Xxt)=>{var Wbn={}.toString;Xxt.exports=Array.isArray||function(e){return Wbn.call(e)=="[object Array]"}});var Ywe=P((Rxi,ebt)=>{ebt.exports=require("stream")});var Yq=P((Jwe,rbt)=>{var LX=require("buffer"),vS=LX.Buffer;function tbt(e,t){for(var r in e)t[r]=e[r]}vS.from&&vS.alloc&&vS.allocUnsafe&&vS.allocUnsafeSlow?rbt.exports=LX:(tbt(LX,Jwe),Jwe.Buffer=M4);function M4(e,t,r){return vS(e,t,r)}tbt(vS,M4);M4.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return vS(e,t,r)};M4.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=vS(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};M4.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return vS(e)};M4.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return LX.SlowBuffer(e)}});var nbt=P((Nxi,Kwe)=>{typeof Object.create=="function"?Kwe.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Kwe.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}});var q4=P((Fxi,Zwe)=>{try{if(Xwe=require("util"),typeof Xwe.inherits!="function")throw"";Zwe.exports=Xwe.inherits}catch{Zwe.exports=nbt()}var Xwe});var sbt=P((Oxi,e2e)=>{"use strict";function Gbn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ibt=Yq().Buffer,Jq=require("util");function Ybn(e,t,r){e.copy(t,r)}e2e.exports=function(){function e(){Gbn(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,a=""+n.data;n=n.next;)a+=r+n.data;return a},e.prototype.concat=function(r){if(this.length===0)return ibt.alloc(0);for(var n=ibt.allocUnsafe(r>>>0),a=this.head,s=0;a;)Ybn(a.data,n,s),s+=a.data.length,a=a.next;return n},e}();Jq&&Jq.inspect&&Jq.inspect.custom&&(e2e.exports.prototype[Jq.inspect.custom]=function(){var e=Jq.inspect({length:this.length});return this.constructor.name+" "+e})});var t2e=P((Qxi,abt)=>{"use strict";var jX=Gq();function Jbn(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return n||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,jX.nextTick(MX,this,e)):jX.nextTick(MX,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,jX.nextTick(MX,r,s)):jX.nextTick(MX,r,s):t&&t(s)}),this)}function Kbn(){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 MX(e,t){e.emit("error",t)}abt.exports={destroy:Jbn,undestroy:Kbn}});var cbt=P((Lxi,obt)=>{obt.exports=require("util").deprecate});var n2e=P((jxi,gbt)=>{"use strict";var kD=Gq();gbt.exports=Dp;function lbt(e){var t=this;this.next=null,this.entry=null,this.finish=function(){mEn(t,e)}}var Xbn=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:kD.nextTick,U4;Dp.WritableState=Xq;var pbt=Object.create(ZB());pbt.inherits=q4();var Zbn={deprecate:cbt()},fbt=Ywe(),UX=Yq().Buffer,eEn=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tEn(e){return UX.from(e)}function rEn(e){return UX.isBuffer(e)||e instanceof eEn}var dbt=t2e();pbt.inherits(Dp,fbt);function nEn(){}function Xq(e,t){U4=U4||TD(),e=e||{};var r=t instanceof U4;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,a=e.writableHighWaterMark,s=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=e.decodeStrings===!1;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(l){lEn(t,l)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new lbt(this)}Xq.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Xq.prototype,"buffer",{get:Zbn.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var qX;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(qX=Function.prototype[Symbol.hasInstance],Object.defineProperty(Dp,Symbol.hasInstance,{value:function(e){return qX.call(this,e)?!0:this!==Dp?!1:e&&e._writableState instanceof Xq}})):qX=function(e){return e instanceof this};function Dp(e){if(U4=U4||TD(),!qX.call(Dp,this)&&!(this instanceof U4))return new Dp(e);this._writableState=new Xq(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),fbt.call(this)}Dp.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function iEn(e,t){var r=new Error("write after end");e.emit("error",r),kD.nextTick(t,r)}function sEn(e,t,r,n){var a=!0,s=!1;return r===null?s=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),kD.nextTick(n,s),a=!1),a}Dp.prototype.write=function(e,t,r){var n=this._writableState,a=!1,s=!n.objectMode&&rEn(e);return s&&!UX.isBuffer(e)&&(e=tEn(e)),typeof t=="function"&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=nEn),n.ended?iEn(this,r):(s||sEn(this,n,e,r))&&(n.pendingcb++,a=oEn(this,n,s,e,t,r)),a};Dp.prototype.cork=function(){var e=this._writableState;e.corked++};Dp.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&hbt(this,e))};Dp.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function aEn(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=UX.from(t,r)),t}Object.defineProperty(Dp.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function oEn(e,t,r,n,a,s){if(!r){var c=aEn(t,n,a);n!==c&&(r=!0,a="buffer",n=c)}var l=t.objectMode?1:n.length;t.length+=l;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:a,isBuf:r,callback:s,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else r2e(e,t,!1,l,n,a,s);return f}function r2e(e,t,r,n,a,s,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}function cEn(e,t,r,n,a){--t.pendingcb,r?(kD.nextTick(a,n),kD.nextTick(Kq,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(a(n),e._writableState.errorEmitted=!0,e.emit("error",n),Kq(e,t))}function uEn(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function lEn(e,t){var r=e._writableState,n=r.sync,a=r.writecb;if(uEn(r),t)cEn(e,r,n,t,a);else{var s=mbt(r);!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&hbt(e,r),n?Xbn(ubt,e,r,s,a):ubt(e,r,s,a)}}function ubt(e,t,r,n){r||pEn(e,t),t.pendingcb--,n(),Kq(e,t)}function pEn(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function hbt(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var c=0,l=!0;r;)a[c]=r,r.isBuf||(l=!1),r=r.next,c+=1;a.allBuffers=l,r2e(e,t,!0,t.length,a,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new lbt(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,d=r.encoding,m=r.callback,g=t.objectMode?1:f.length;if(r2e(e,t,!1,g,f,d,m),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Dp.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};Dp.prototype._writev=null;Dp.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||hEn(this,n,r)};function mbt(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function fEn(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),Kq(e,t)})}function dEn(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,kD.nextTick(fEn,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Kq(e,t){var r=mbt(t);return r&&(dEn(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function hEn(e,t,r){t.ending=!0,Kq(e,t),r&&(t.finished?kD.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function mEn(e,t,r){var n=e.entry;for(e.entry=null;n;){var a=n.callback;t.pendingcb--,a(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(Dp.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Dp.prototype.destroy=dbt.destroy;Dp.prototype._undestroy=dbt.undestroy;Dp.prototype._destroy=function(e,t){this.end(),t(e)}});var TD=P((Mxi,xbt)=>{"use strict";var Abt=Gq(),gEn=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};xbt.exports=xS;var ybt=Object.create(ZB());ybt.inherits=q4();var vbt=a2e(),s2e=n2e();ybt.inherits(xS,vbt);for(i2e=gEn(s2e.prototype),zX=0;zX<i2e.length;zX++)HX=i2e[zX],xS.prototype[HX]||(xS.prototype[HX]=s2e.prototype[HX]);var i2e,HX,zX;function xS(e){if(!(this instanceof xS))return new xS(e);vbt.call(this,e),s2e.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",AEn)}Object.defineProperty(xS.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function AEn(){this.allowHalfOpen||this._writableState.ended||Abt.nextTick(yEn,this)}function yEn(e){e.end()}Object.defineProperty(xS.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});xS.prototype._destroy=function(e,t){this.push(null),this.end(),Abt.nextTick(t,e)}});var u2e=P(Ebt=>{"use strict";var c2e=Yq().Buffer,bbt=c2e.isEncoding||function(e){switch(e=""+e,e&&e.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 vEn(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function xEn(e){var t=vEn(e);if(typeof t!="string"&&(c2e.isEncoding===bbt||!bbt(e)))throw new Error("Unknown encoding: "+e);return t||e}Ebt.StringDecoder=Zq;function Zq(e){this.encoding=xEn(e);var t;switch(this.encoding){case"utf16le":this.text=_En,this.end=IEn,t=4;break;case"utf8":this.fillLast=wEn,t=4;break;case"base64":this.text=kEn,this.end=TEn,t=3;break;default:this.write=BEn,this.end=DEn;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=c2e.allocUnsafe(t)}Zq.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Zq.prototype.end=CEn;Zq.prototype.text=SEn;Zq.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o2e(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function bEn(e,t,r){var n=t.length-1;if(n<r)return 0;var a=o2e(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||a===-2?0:(a=o2e(t[n]),a>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||a===-2?0:(a=o2e(t[n]),a>=0?(a>0&&(a===2?a=0:e.lastNeed=a-3),a):0))}function EEn(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function wEn(e){var t=this.lastTotal-this.lastNeed,r=EEn(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function SEn(e,t){var r=bEn(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function CEn(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function _En(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function IEn(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function kEn(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function TEn(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function BEn(e){return e.toString(this.encoding)}function DEn(e){return e&&e.length?this.write(e):""}});var a2e=P((zxi,Nbt)=>{"use strict";var H4=Gq();Nbt.exports=bu;var PEn=Zxt(),e5;bu.ReadableState=Tbt;var Uxi=require("events").EventEmitter,_bt=function(e,t){return e.listeners(t).length},h2e=Ywe(),t5=Yq().Buffer,REn=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function NEn(e){return t5.from(e)}function FEn(e){return t5.isBuffer(e)||e instanceof REn}var Ibt=Object.create(ZB());Ibt.inherits=q4();var l2e=require("util"),Vo=void 0;l2e&&l2e.debuglog?Vo=l2e.debuglog("stream"):Vo=function(){};var OEn=sbt(),kbt=t2e(),z4;Ibt.inherits(bu,h2e);var p2e=["error","close","destroy","pause","resume"];function QEn(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):PEn(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function Tbt(e,t){e5=e5||TD(),e=e||{};var r=t instanceof e5;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new OEn,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(z4||(z4=u2e().StringDecoder),this.decoder=new z4(e.encoding),this.encoding=e.encoding)}function bu(e){if(e5=e5||TD(),!(this instanceof bu))return new bu(e);this._readableState=new Tbt(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),h2e.call(this)}Object.defineProperty(bu.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});bu.prototype.destroy=kbt.destroy;bu.prototype._undestroy=kbt.undestroy;bu.prototype._destroy=function(e,t){this.push(null),t(e)};bu.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=t5.from(e,t),t=""),n=!0),Bbt(this,e,t,!1,n)};bu.prototype.unshift=function(e){return Bbt(this,e,null,!0,!1)};function Bbt(e,t,r,n,a){var s=e._readableState;if(t===null)s.reading=!1,qEn(e,s);else{var c;a||(c=LEn(s,t)),c?e.emit("error",c):s.objectMode||t&&t.length>0?(typeof t!="string"&&!s.objectMode&&Object.getPrototypeOf(t)!==t5.prototype&&(t=NEn(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):f2e(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||t.length!==0?f2e(e,s,t,!1):Dbt(e,s)):f2e(e,s,t,!1))):n||(s.reading=!1)}return jEn(s)}function f2e(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&VX(e)),Dbt(e,t)}function LEn(e,t){var r;return!FEn(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function jEn(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}bu.prototype.isPaused=function(){return this._readableState.flowing===!1};bu.prototype.setEncoding=function(e){return z4||(z4=u2e().StringDecoder),this._readableState.decoder=new z4(e),this._readableState.encoding=e,this};var wbt=8388608;function MEn(e){return e>=wbt?e=wbt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Sbt(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=MEn(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}bu.prototype.read=function(e){Vo("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Vo("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?d2e(this):VX(this),null;if(e=Sbt(e,t),e===0&&t.ended)return t.length===0&&d2e(this),null;var n=t.needReadable;Vo("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Vo("length less than watermark",n)),t.ended||t.reading?(n=!1,Vo("reading or ended",n)):n&&(Vo("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Sbt(r,t)));var a;return e>0?a=Pbt(e,t):a=null,a===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&d2e(this)),a!==null&&this.emit("data",a),a};function qEn(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,VX(e)}}function VX(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Vo("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?H4.nextTick(Cbt,e):Cbt(e))}function Cbt(e){Vo("emit readable"),e.emit("readable"),m2e(e)}function Dbt(e,t){t.readingMore||(t.readingMore=!0,H4.nextTick(UEn,e,t))}function UEn(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Vo("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}bu.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};bu.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,Vo("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,s=a?l:I;n.endEmitted?H4.nextTick(s):r.once("end",s),e.on("unpipe",c);function c(k,O){Vo("onunpipe"),k===r&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,m())}function l(){Vo("onend"),e.end()}var f=zEn(r);e.on("drain",f);var d=!1;function m(){Vo("cleanup"),e.removeListener("close",A),e.removeListener("finish",C),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",I),r.removeListener("data",x),d=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}var g=!1;r.on("data",x);function x(k){Vo("ondata"),g=!1;var O=e.write(k);O===!1&&!g&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Rbt(n.pipes,e)!==-1)&&!d&&(Vo("false write response, pause",n.awaitDrain),n.awaitDrain++,g=!0),r.pause())}function b(k){Vo("onerror",k),I(),e.removeListener("error",b),_bt(e,"error")===0&&e.emit("error",k)}QEn(e,"error",b);function A(){e.removeListener("finish",C),I()}e.once("close",A);function C(){Vo("onfinish"),e.removeListener("close",A),I()}e.once("finish",C);function I(){Vo("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(Vo("pipe resume"),r.resume()),e};function zEn(e){return function(){var t=e._readableState;Vo("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&_bt(e,"data")&&(t.flowing=!0,m2e(e))}}bu.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<a;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var c=Rbt(t.pipes,e);return c===-1?this:(t.pipes.splice(c,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};bu.prototype.on=function(e,t){var r=h2e.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&VX(this):H4.nextTick(HEn,this))}return r};bu.prototype.addListener=bu.prototype.on;function HEn(e){Vo("readable nexttick read 0"),e.read(0)}bu.prototype.resume=function(){var e=this._readableState;return e.flowing||(Vo("resume"),e.flowing=!0,VEn(this,e)),this};function VEn(e,t){t.resumeScheduled||(t.resumeScheduled=!0,H4.nextTick($En,e,t))}function $En(e,t){t.reading||(Vo("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),m2e(e),t.flowing&&!t.reading&&e.read(0)}bu.prototype.pause=function(){return Vo("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Vo("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function m2e(e){var t=e._readableState;for(Vo("flow",t.flowing);t.flowing&&e.read()!==null;);}bu.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(Vo("wrapped end"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&t.push(c)}t.push(null)}),e.on("data",function(c){if(Vo("wrapped data"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var l=t.push(c);l||(n=!0,e.pause())}});for(var a in e)this[a]===void 0&&typeof e[a]=="function"&&(this[a]=function(c){return function(){return e[c].apply(e,arguments)}}(a));for(var s=0;s<p2e.length;s++)e.on(p2e[s],this.emit.bind(this,p2e[s]));return this._read=function(c){Vo("wrapped _read",c),n&&(n=!1,e.resume())},this};Object.defineProperty(bu.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});bu._fromList=Pbt;function Pbt(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=WEn(e,t.buffer,t.decoder),r}function WEn(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?GEn(e,t):YEn(e,t),n}function GEn(e,t){var r=t.head,n=1,a=r.data;for(e-=a.length;r=r.next;){var s=r.data,c=e>s.length?s.length:e;if(c===s.length?a+=s:a+=s.slice(0,e),e-=c,e===0){c===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(c));break}++n}return t.length-=n,a}function YEn(e,t){var r=t5.allocUnsafe(e),n=t.head,a=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var s=n.data,c=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,c),e-=c,e===0){c===s.length?(++a,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(c));break}++a}return t.length-=a,r}function d2e(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,H4.nextTick(JEn,t,e))}function JEn(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Rbt(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var g2e=P((Hxi,Qbt)=>{"use strict";Qbt.exports=bS;var $X=TD(),Obt=Object.create(ZB());Obt.inherits=q4();Obt.inherits(bS,$X);function KEn(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function bS(e){if(!(this instanceof bS))return new bS(e);$X.call(this,e),this._transformState={afterTransform:KEn.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",XEn)}function XEn(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){Fbt(e,t,r)}):Fbt(this,null,null)}bS.prototype.push=function(e,t){return this._transformState.needTransform=!1,$X.prototype.push.call(this,e,t)};bS.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};bS.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var a=this._readableState;(n.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}};bS.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};bS.prototype._destroy=function(e,t){var r=this;$X.prototype._destroy.call(this,e,function(n){t(n),r.emit("close")})};function Fbt(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var qbt=P((Vxi,Mbt)=>{"use strict";Mbt.exports=r5;var Lbt=g2e(),jbt=Object.create(ZB());jbt.inherits=q4();jbt.inherits(r5,Lbt);function r5(e){if(!(this instanceof r5))return new r5(e);Lbt.call(this,e)}r5.prototype._transform=function(e,t,r){r(null,e)}});var Ubt=P((Rd,WX)=>{var d1=require("stream");process.env.READABLE_STREAM==="disable"&&d1?(WX.exports=d1,Rd=WX.exports=d1.Readable,Rd.Readable=d1.Readable,Rd.Writable=d1.Writable,Rd.Duplex=d1.Duplex,Rd.Transform=d1.Transform,Rd.PassThrough=d1.PassThrough,Rd.Stream=d1):(Rd=WX.exports=a2e(),Rd.Stream=d1||Rd,Rd.Readable=Rd,Rd.Writable=n2e(),Rd.Duplex=TD(),Rd.Transform=g2e(),Rd.PassThrough=qbt())});var Hbt=P(($xi,zbt)=>{zbt.exports=Ubt().PassThrough});var Gbt=P((Wxi,Wbt)=>{var Vbt=require("util"),JX=Hbt();Wbt.exports={Readable:GX,Writable:YX};Vbt.inherits(GX,JX);Vbt.inherits(YX,JX);function $bt(e,t,r){e[t]=function(){return delete e[t],r.apply(this,arguments),this[t].apply(this,arguments)}}function GX(e,t){if(!(this instanceof GX))return new GX(e,t);JX.call(this,t),$bt(this,"_read",function(){var r=e.call(this,t),n=this.emit.bind(this,"error");r.on("error",n),r.pipe(this)}),this.emit("readable")}function YX(e,t){if(!(this instanceof YX))return new YX(e,t);JX.call(this,t),$bt(this,"_write",function(){var r=e.call(this,t),n=this.emit.bind(this,"error");r.on("error",n),this.pipe(r)}),this.emit("writable")}});var A2e=P((Gxi,Ybt)=>{Ybt.exports=function(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var n="";if(r>4&&e[3]==="\\"){var a=e[2];(a==="?"||a===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//")}var s=e.split(/[/\\]+/);return t!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var Hu=P((Yxi,Jbt)=>{"use strict";var y2e=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
448
448
  `;super(r),this.name="AggregateError",this.errors=t}};Jbt.exports={AggregateError:y2e,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var v2e=P((Jxi,Kbt)=>{"use strict";Kbt.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let a=t.shift();return n==="f"?a.toFixed(6):n==="j"?JSON.stringify(a):n==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var Bh=P((Kxi,eEt)=>{"use strict";var{format:ZEn,inspect:KX}=v2e(),{AggregateError:e1n}=Hu(),t1n=globalThis.AggregateError||e1n,r1n=Symbol("kIsNodeError"),n1n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],i1n=/^([A-Z][a-z0-9]*)+$/,s1n="__node_internal_",XX={};function BD(e,t){if(!e)throw new XX.ERR_INTERNAL_ASSERTION(t)}function Xbt(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function a1n(e,t,r){if(typeof t=="function")return BD(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return BD(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:ZEn(t,...r)}function Nd(e,t,r){r||(r=Error);class n extends r{constructor(...s){super(a1n(e,t,s))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[r1n]=!0,XX[e]=n}function Zbt(e){let t=s1n+e.name;return Object.defineProperty(e,"name",{value:t}),e}function o1n(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new t1n([t,e],t.message);return r.code=t.code,r}return e||t}var x2e=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new XX.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Nd("ERR_ASSERTION","%s",Error);Nd("ERR_INVALID_ARG_TYPE",(e,t,r)=>{BD(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let a=[],s=[],c=[];for(let f of t)BD(typeof f=="string","All expected entries have to be of type string"),n1n.includes(f)?a.push(f.toLowerCase()):i1n.test(f)?s.push(f):(BD(f!=="object",'The value "object" should be written as "Object"'),c.push(f));if(s.length>0){let f=a.indexOf("object");f!==-1&&(a.splice(a,f,1),s.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{let f=a.pop();n+=`one of type ${a.join(", ")}, or ${f}`}}(s.length>0||c.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let f=s.pop();n+=`an instance of ${s.join(", ")}, or ${f}`}}c.length>0&&(n+=" or ")}switch(c.length){case 0:break;case 1:c[0].toLowerCase()!==c[0]&&(n+="an "),n+=`${c[0]}`;break;case 2:n+=`one of ${c[0]} or ${c[1]}`;break;default:{let f=c.pop();n+=`one of ${c.join(", ")}, or ${f}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var l;if((l=r.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${r.constructor.name}`;else{let f=KX(r,{depth:-1});n+=`. Received ${f}`}}else{let f=KX(r,{colors:!1});f.length>25&&(f=`${f.slice(0,25)}...`),n+=`. Received type ${typeof r} (${f})`}return n},TypeError);Nd("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=KX(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);Nd("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let a=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);Nd("ERR_MISSING_ARGS",(...e)=>{BD(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);Nd("ERR_OUT_OF_RANGE",(e,t,r)=>{BD(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=Xbt(String(r));else if(typeof r=="bigint"){n=String(r);let a=BigInt(2)**BigInt(32);(r>a||r<-a)&&(n=Xbt(n)),n+="n"}else n=KX(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);Nd("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Nd("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Nd("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Nd("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Nd("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Nd("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Nd("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Nd("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Nd("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Nd("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Nd("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);eEt.exports={AbortError:x2e,aggregateTwoErrors:Zbt(o1n),hideStackFrames:Zbt,codes:XX}});var lEt=P((s5,i5)=>{"use strict";Object.defineProperty(s5,"__esModule",{value:!0});var aEt=new WeakMap,b2e=new WeakMap;function Eu(e){let t=aEt.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function tEt(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function V4(e,t){aEt.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=Object.keys(t);for(let n=0;n<r.length;++n){let a=r[n];a in this||Object.defineProperty(this,a,oEt(a))}}V4.prototype={get type(){return Eu(this).event.type},get target(){return Eu(this).eventTarget},get currentTarget(){return Eu(this).currentTarget},composedPath(){let e=Eu(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return Eu(this).eventPhase},stopPropagation(){let e=Eu(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){let e=Eu(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return!!Eu(this).event.bubbles},get cancelable(){return!!Eu(this).event.cancelable},preventDefault(){tEt(Eu(this))},get defaultPrevented(){return Eu(this).canceled},get composed(){return!!Eu(this).event.composed},get timeStamp(){return Eu(this).timeStamp},get srcElement(){return Eu(this).eventTarget},get cancelBubble(){return Eu(this).stopped},set cancelBubble(e){if(!e)return;let t=Eu(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!Eu(this).canceled},set returnValue(e){e||tEt(Eu(this))},initEvent(){}};Object.defineProperty(V4.prototype,"constructor",{value:V4,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(V4.prototype,window.Event.prototype),b2e.set(window.Event.prototype,V4));function oEt(e){return{get(){return Eu(this).event[e]},set(t){Eu(this).event[e]=t},configurable:!0,enumerable:!0}}function c1n(e){return{value(){let t=Eu(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function u1n(e,t){let r=Object.keys(t);if(r.length===0)return e;function n(a,s){e.call(this,a,s)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let a=0;a<r.length;++a){let s=r[a];if(!(s in e.prototype)){let l=typeof Object.getOwnPropertyDescriptor(t,s).value=="function";Object.defineProperty(n.prototype,s,l?c1n(s):oEt(s))}}return n}function cEt(e){if(e==null||e===Object.prototype)return V4;let t=b2e.get(e);return t==null&&(t=u1n(cEt(Object.getPrototypeOf(e)),e),b2e.set(e,t)),t}function l1n(e,t){let r=cEt(Object.getPrototypeOf(t));return new r(e,t)}function p1n(e){return Eu(e).immediateStopped}function f1n(e,t){Eu(e).eventPhase=t}function d1n(e,t){Eu(e).currentTarget=t}function rEt(e,t){Eu(e).passiveListener=t}var uEt=new WeakMap,nEt=1,iEt=2,ZX=3;function eZ(e){return e!==null&&typeof e=="object"}function n5(e){let t=uEt.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function h1n(e){return{get(){let r=n5(this).get(e);for(;r!=null;){if(r.listenerType===ZX)return r.listener;r=r.next}return null},set(t){typeof t!="function"&&!eZ(t)&&(t=null);let r=n5(this),n=null,a=r.get(e);for(;a!=null;)a.listenerType===ZX?n!==null?n.next=a.next:a.next!==null?r.set(e,a.next):r.delete(e):n=a,a=a.next;if(t!==null){let s={listener:t,listenerType:ZX,passive:!1,once:!1,next:null};n===null?r.set(e,s):n.next=s}},configurable:!0,enumerable:!0}}function E2e(e,t){Object.defineProperty(e,`on${t}`,h1n(t))}function sEt(e){function t(){$x.call(this)}t.prototype=Object.create($x.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)E2e(t.prototype,e[r]);return t}function $x(){if(this instanceof $x){uEt.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return sEt(arguments[0]);if(arguments.length>0){let e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return sEt(e)}throw new TypeError("Cannot call a class as a function")}$x.prototype={addEventListener(e,t,r){if(t==null)return;if(typeof t!="function"&&!eZ(t))throw new TypeError("'listener' should be a function or an object.");let n=n5(this),a=eZ(r),c=(a?!!r.capture:!!r)?nEt:iEt,l={listener:t,listenerType:c,passive:a&&!!r.passive,once:a&&!!r.once,next:null},f=n.get(e);if(f===void 0){n.set(e,l);return}let d=null;for(;f!=null;){if(f.listener===t&&f.listenerType===c)return;d=f,f=f.next}d.next=l},removeEventListener(e,t,r){if(t==null)return;let n=n5(this),s=(eZ(r)?!!r.capture:!!r)?nEt:iEt,c=null,l=n.get(e);for(;l!=null;){if(l.listener===t&&l.listenerType===s){c!==null?c.next=l.next:l.next!==null?n.set(e,l.next):n.delete(e);return}c=l,l=l.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');let t=n5(this),r=e.type,n=t.get(r);if(n==null)return!0;let a=l1n(this,e),s=null;for(;n!=null;){if(n.once?s!==null?s.next=n.next:n.next!==null?t.set(r,n.next):t.delete(r):s=n,rEt(a,n.passive?n.listener:null),typeof n.listener=="function")try{n.listener.call(this,a)}catch(c){typeof console<"u"&&typeof console.error=="function"&&console.error(c)}else n.listenerType!==ZX&&typeof n.listener.handleEvent=="function"&&n.listener.handleEvent(a);if(p1n(a))break;n=n.next}return rEt(a,null),f1n(a,0),d1n(a,null),!a.defaultPrevented}};Object.defineProperty($x.prototype,"constructor",{value:$x,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf($x.prototype,window.EventTarget.prototype);s5.defineEventAttribute=E2e;s5.EventTarget=$x;s5.default=$x;i5.exports=$x;i5.exports.EventTarget=i5.exports.default=$x;i5.exports.defineEventAttribute=E2e});var lp=P((o5,a5)=>{"use strict";Object.defineProperty(o5,"__esModule",{value:!0});var w2e=lEt(),wI=class extends w2e.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let t=tZ.get(this);if(typeof t!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return t}};w2e.defineEventAttribute(wI.prototype,"abort");function m1n(){let e=Object.create(wI.prototype);return w2e.EventTarget.call(e),tZ.set(e,!1),e}function g1n(e){tZ.get(e)===!1&&(tZ.set(e,!0),e.dispatchEvent({type:"abort"}))}var tZ=new WeakMap;Object.defineProperties(wI.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(wI.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});var SI=class{constructor(){fEt.set(this,m1n())}get signal(){return pEt(this)}abort(){g1n(pEt(this))}},fEt=new WeakMap;function pEt(e){let t=fEt.get(e);if(t==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?"null":typeof e}`);return t}Object.defineProperties(SI.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(SI.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});o5.AbortController=SI;o5.AbortSignal=wI;o5.default=SI;a5.exports=SI;a5.exports.AbortController=a5.exports.default=SI;a5.exports.AbortSignal=wI});var Mm=P((Xxi,C2e)=>{"use strict";var A1n=require("buffer"),{format:y1n,inspect:v1n}=v2e(),{codes:{ERR_INVALID_ARG_TYPE:S2e}}=Bh(),{kResistStopPropagation:x1n,AggregateError:b1n,SymbolDispose:E1n}=Hu(),w1n=globalThis.AbortSignal||lp().AbortSignal,S1n=globalThis.AbortController||lp().AbortController,C1n=Object.getPrototypeOf(async function(){}).constructor,dEt=globalThis.Blob||A1n.Blob,_1n=typeof dEt<"u"?function(t){return t instanceof dEt}:function(t){return!1},hEt=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new S2e(t,"AbortSignal",e)},I1n=(e,t)=>{if(typeof e!="function")throw new S2e(t,"Function",e)};C2e.exports={AggregateError:b1n,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((n,...a)=>n?r(n):t(...a))})},debuglog(){return function(){}},format:y1n,inspect:v1n,types:{isAsyncFunction(e){return e instanceof C1n},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:_1n,deprecate(e,t){return e},addAbortListener:require("events").addAbortListener||function(t,r){if(t===void 0)throw new S2e("signal","AbortSignal",t);hEt(t,"signal"),I1n(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[x1n]:!0}),n=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[E1n](){var a;(a=n)===null||a===void 0||a()}}},AbortSignalAny:w1n.any||function(t){if(t.length===1)return t[0];let r=new S1n,n=()=>r.abort();return t.forEach(a=>{hEt(a,"signals"),a.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(a=>a.removeEventListener("abort",n))},{once:!0}),r.signal}};C2e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var W4=P((Zxi,SEt)=>{"use strict";var{ArrayIsArray:I2e,ArrayPrototypeIncludes:yEt,ArrayPrototypeJoin:vEt,ArrayPrototypeMap:k1n,NumberIsInteger:k2e,NumberIsNaN:T1n,NumberMAX_SAFE_INTEGER:B1n,NumberMIN_SAFE_INTEGER:D1n,NumberParseInt:P1n,ObjectPrototypeHasOwnProperty:R1n,RegExpPrototypeExec:xEt,String:N1n,StringPrototypeToUpperCase:F1n,StringPrototypeTrim:O1n}=Hu(),{hideStackFrames:Zy,codes:{ERR_SOCKET_BAD_PORT:Q1n,ERR_INVALID_ARG_TYPE:Dh,ERR_INVALID_ARG_VALUE:$4,ERR_OUT_OF_RANGE:DD,ERR_UNKNOWN_SIGNAL:mEt}}=Bh(),{normalizeEncoding:L1n}=Mm(),{isAsyncFunction:j1n,isArrayBufferView:M1n}=Mm().types,gEt={};function q1n(e){return e===(e|0)}function U1n(e){return e===e>>>0}var z1n=/^[0-7]+$/,H1n="must be a 32-bit unsigned integer or an octal string";function V1n(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(xEt(z1n,e)===null)throw new $4(t,e,H1n);e=P1n(e,8)}return bEt(e,t),e}var $1n=Zy((e,t,r=D1n,n=B1n)=>{if(typeof e!="number")throw new Dh(t,"number",e);if(!k2e(e))throw new DD(t,"an integer",e);if(e<r||e>n)throw new DD(t,`>= ${r} && <= ${n}`,e)}),W1n=Zy((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new Dh(t,"number",e);if(!k2e(e))throw new DD(t,"an integer",e);if(e<r||e>n)throw new DD(t,`>= ${r} && <= ${n}`,e)}),bEt=Zy((e,t,r=!1)=>{if(typeof e!="number")throw new Dh(t,"number",e);if(!k2e(e))throw new DD(t,"an integer",e);let n=r?1:0,a=4294967295;if(e<n||e>a)throw new DD(t,`>= ${n} && <= ${a}`,e)});function T2e(e,t){if(typeof e!="string")throw new Dh(t,"string",e)}function G1n(e,t,r=void 0,n){if(typeof e!="number")throw new Dh(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&T1n(e))throw new DD(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}var Y1n=Zy((e,t,r)=>{if(!yEt(r,e)){let a="must be one of: "+vEt(k1n(r,s=>typeof s=="string"?`'${s}'`:N1n(s)),", ");throw new $4(t,e,a)}});function EEt(e,t){if(typeof e!="boolean")throw new Dh(t,"boolean",e)}function _2e(e,t,r){return e==null||!R1n(e,t)?r:e[t]}var J1n=Zy((e,t,r=null)=>{let n=_2e(r,"allowArray",!1),a=_2e(r,"allowFunction",!1);if(!_2e(r,"nullable",!1)&&e===null||!n&&I2e(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new Dh(t,"Object",e)}),K1n=Zy((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new Dh(t,"a dictionary",e)}),rZ=Zy((e,t,r=0)=>{if(!I2e(e))throw new Dh(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new $4(t,e,n)}});function X1n(e,t){rZ(e,t);for(let r=0;r<e.length;r++)T2e(e[r],`${t}[${r}]`)}function Z1n(e,t){rZ(e,t);for(let r=0;r<e.length;r++)EEt(e[r],`${t}[${r}]`)}function ewn(e,t){rZ(e,t);for(let r=0;r<e.length;r++){let n=e[r],a=`${t}[${r}]`;if(n==null)throw new Dh(a,"AbortSignal",n);wEt(n,a)}}function twn(e,t="signal"){if(T2e(e,t),gEt[e]===void 0)throw gEt[F1n(e)]!==void 0?new mEt(e+" (signals must use all capital letters)"):new mEt(e)}var rwn=Zy((e,t="buffer")=>{if(!M1n(e))throw new Dh(t,["Buffer","TypedArray","DataView"],e)});function nwn(e,t){let r=L1n(t),n=e.length;if(r==="hex"&&n%2!==0)throw new $4("encoding",t,`is invalid for data of length ${n}`)}function iwn(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&O1n(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new Q1n(t,e,r);return e|0}var wEt=Zy((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Dh(t,"AbortSignal",e)}),swn=Zy((e,t)=>{if(typeof e!="function")throw new Dh(t,"Function",e)}),awn=Zy((e,t)=>{if(typeof e!="function"||j1n(e))throw new Dh(t,"Function",e)}),own=Zy((e,t)=>{if(e!==void 0)throw new Dh(t,"undefined",e)});function cwn(e,t,r){if(!yEt(r,e))throw new Dh(t,`('${vEt(r,"|")}')`,e)}var uwn=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function AEt(e,t){if(typeof e>"u"||!xEt(uwn,e))throw new $4(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function lwn(e){if(typeof e=="string")return AEt(e,"hints"),e;if(I2e(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let a=e[n];AEt(a,"hints"),r+=a,n!==t-1&&(r+=", ")}return r}throw new $4("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}SEt.exports={isInt32:q1n,isUint32:U1n,parseFileMode:V1n,validateArray:rZ,validateStringArray:X1n,validateBooleanArray:Z1n,validateAbortSignalArray:ewn,validateBoolean:EEt,validateBuffer:rwn,validateDictionary:K1n,validateEncoding:nwn,validateFunction:swn,validateInt32:W1n,validateInteger:$1n,validateNumber:G1n,validateObject:J1n,validateOneOf:Y1n,validatePlainFunction:awn,validatePort:iwn,validateSignalName:twn,validateString:T2e,validateUint32:bEt,validateUndefined:own,validateUnion:cwn,validateAbortSignal:wEt,validateLinkHeaderValue:lwn}});var mc=P((ebi,CEt)=>{CEt.exports=global.process});var m1=P((tbi,MEt)=>{"use strict";var{SymbolAsyncIterator:_Et,SymbolIterator:IEt,SymbolFor:PD}=Hu(),kEt=PD("nodejs.stream.destroyed"),TEt=PD("nodejs.stream.errored"),B2e=PD("nodejs.stream.readable"),D2e=PD("nodejs.stream.writable"),BEt=PD("nodejs.stream.disturbed"),pwn=PD("nodejs.webstream.isClosedPromise"),fwn=PD("nodejs.webstream.controllerErrorFunction");function nZ(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function iZ(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function dwn(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function h1(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function DEt(e){return!!(e&&!h1(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function PEt(e){return!!(e&&!h1(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function REt(e){return!!(e&&!h1(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function hwn(e){return DEt(e)||PEt(e)||REt(e)}function mwn(e,t){return e==null?!1:t===!0?typeof e[_Et]=="function":t===!1?typeof e[IEt]=="function":typeof e[_Et]=="function"||typeof e[IEt]=="function"}function sZ(e){if(!h1(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[kEt]||n!=null&&n.destroyed)}function NEt(e){if(!iZ(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function gwn(e,t){if(!iZ(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function Awn(e){if(!nZ(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function FEt(e,t){if(!nZ(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function OEt(e){return e&&e[B2e]!=null?e[B2e]:typeof(e==null?void 0:e.readable)!="boolean"?null:sZ(e)?!1:nZ(e)&&e.readable&&!FEt(e)}function QEt(e){return e&&e[D2e]!=null?e[D2e]:typeof(e==null?void 0:e.writable)!="boolean"?null:sZ(e)?!1:iZ(e)&&e.writable&&!NEt(e)}function ywn(e,t){return h1(e)?sZ(e)?!0:!((t==null?void 0:t.readable)!==!1&&OEt(e)||(t==null?void 0:t.writable)!==!1&&QEt(e)):null}function vwn(e){var t,r;return h1(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function xwn(e){var t,r;return h1(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function bwn(e){if(!h1(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&LEt(e)?e._closed:null}function LEt(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function jEt(e){return typeof e._sent100=="boolean"&&LEt(e)}function Ewn(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function wwn(e){if(!h1(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&jEt(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Swn(e){var t;return!!(e&&((t=e[BEt])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function Cwn(e){var t,r,n,a,s,c,l,f,d,m;return!!(e&&((t=(r=(n=(a=(s=(c=e[TEt])!==null&&c!==void 0?c:e.readableErrored)!==null&&s!==void 0?s:e.writableErrored)!==null&&a!==void 0?a:(l=e._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(f=e._writableState)===null||f===void 0?void 0:f.errorEmitted)!==null&&r!==void 0?r:(d=e._readableState)===null||d===void 0?void 0:d.errored)!==null&&t!==void 0?t:!((m=e._writableState)===null||m===void 0)&&m.errored))}MEt.exports={isDestroyed:sZ,kIsDestroyed:kEt,isDisturbed:Swn,kIsDisturbed:BEt,isErrored:Cwn,kIsErrored:TEt,isReadable:OEt,kIsReadable:B2e,kIsClosedPromise:pwn,kControllerErrorFunction:fwn,kIsWritable:D2e,isClosed:bwn,isDuplexNodeStream:dwn,isFinished:ywn,isIterable:mwn,isReadableNodeStream:nZ,isReadableStream:DEt,isReadableEnded:Awn,isReadableFinished:FEt,isReadableErrored:xwn,isNodeStream:h1,isWebStream:hwn,isWritable:QEt,isWritableNodeStream:iZ,isWritableStream:PEt,isWritableEnded:NEt,isWritableFinished:gwn,isWritableErrored:vwn,isServerRequest:Ewn,isServerResponse:jEt,willEmitClose:wwn,isTransformStream:REt}});var ES=P((rbi,O2e)=>{"use strict";var CI=mc(),{AbortError:YEt,codes:_wn}=Bh(),{ERR_INVALID_ARG_TYPE:Iwn,ERR_STREAM_PREMATURE_CLOSE:qEt}=_wn,{kEmptyObject:R2e,once:N2e}=Mm(),{validateAbortSignal:kwn,validateFunction:Twn,validateObject:Bwn,validateBoolean:Dwn}=W4(),{Promise:Pwn,PromisePrototypeThen:Rwn,SymbolDispose:JEt}=Hu(),{isClosed:Nwn,isReadable:UEt,isReadableNodeStream:P2e,isReadableStream:Fwn,isReadableFinished:zEt,isReadableErrored:HEt,isWritable:VEt,isWritableNodeStream:$Et,isWritableStream:Own,isWritableFinished:WEt,isWritableErrored:GEt,isNodeStream:Qwn,willEmitClose:Lwn,kIsClosedPromise:jwn}=m1(),G4;function Mwn(e){return e.setHeader&&typeof e.abort=="function"}var F2e=()=>{};function KEt(e,t,r){var n,a;if(arguments.length===2?(r=t,t=R2e):t==null?t=R2e:Bwn(t,"options"),Twn(r,"callback"),kwn(t.signal,"options.signal"),r=N2e(r),Fwn(e)||Own(e))return qwn(e,t,r);if(!Qwn(e))throw new Iwn("stream",["ReadableStream","WritableStream","Stream"],e);let s=(n=t.readable)!==null&&n!==void 0?n:P2e(e),c=(a=t.writable)!==null&&a!==void 0?a:$Et(e),l=e._writableState,f=e._readableState,d=()=>{e.writable||x()},m=Lwn(e)&&P2e(e)===s&&$Et(e)===c,g=WEt(e,!1),x=()=>{g=!0,e.destroyed&&(m=!1),!(m&&(!e.readable||s))&&(!s||b)&&r.call(e)},b=zEt(e,!1),A=()=>{b=!0,e.destroyed&&(m=!1),!(m&&(!e.writable||c))&&(!c||g)&&r.call(e)},C=W=>{r.call(e,W)},I=Nwn(e),k=()=>{I=!0;let W=GEt(e)||HEt(e);if(W&&typeof W!="boolean")return r.call(e,W);if(s&&!b&&P2e(e,!0)&&!zEt(e,!1))return r.call(e,new qEt);if(c&&!g&&!WEt(e,!1))return r.call(e,new qEt);r.call(e)},O=()=>{I=!0;let W=GEt(e)||HEt(e);if(W&&typeof W!="boolean")return r.call(e,W);r.call(e)},j=()=>{e.req.on("finish",x)};Mwn(e)?(e.on("complete",x),m||e.on("abort",k),e.req?j():e.on("request",j)):c&&!l&&(e.on("end",d),e.on("close",d)),!m&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",A),e.on("finish",x),t.error!==!1&&e.on("error",C),e.on("close",k),I?CI.nextTick(k):l!=null&&l.errorEmitted||f!=null&&f.errorEmitted?m||CI.nextTick(O):(!s&&(!m||UEt(e))&&(g||VEt(e)===!1)||!c&&(!m||VEt(e))&&(b||UEt(e)===!1)||f&&e.req&&e.aborted)&&CI.nextTick(O);let M=()=>{r=F2e,e.removeListener("aborted",k),e.removeListener("complete",x),e.removeListener("abort",k),e.removeListener("request",j),e.req&&e.req.removeListener("finish",x),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",x),e.removeListener("end",A),e.removeListener("error",C),e.removeListener("close",k)};if(t.signal&&!I){let W=()=>{let se=r;M(),se.call(e,new YEt(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)CI.nextTick(W);else{G4=G4||Mm().addAbortListener;let se=G4(t.signal,W),X=r;r=N2e((...ve)=>{se[JEt](),X.apply(e,ve)})}}return M}function qwn(e,t,r){let n=!1,a=F2e;if(t.signal)if(a=()=>{n=!0,r.call(e,new YEt(void 0,{cause:t.signal.reason}))},t.signal.aborted)CI.nextTick(a);else{G4=G4||Mm().addAbortListener;let c=G4(t.signal,a),l=r;r=N2e((...f)=>{c[JEt](),l.apply(e,f)})}let s=(...c)=>{n||CI.nextTick(()=>r.apply(e,c))};return Rwn(e[jwn].promise,s,s),F2e}function Uwn(e,t){var r;let n=!1;return t===null&&(t=R2e),(r=t)!==null&&r!==void 0&&r.cleanup&&(Dwn(t.cleanup,"cleanup"),n=t.cleanup),new Pwn((a,s)=>{let c=KEt(e,t,l=>{n&&c(),l?s(l):a()})})}O2e.exports=KEt;O2e.exports.finished=Uwn});var RD=P((nbi,s1t)=>{"use strict";var g1=mc(),{aggregateTwoErrors:zwn,codes:{ERR_MULTIPLE_CALLBACK:Hwn},AbortError:Vwn}=Bh(),{Symbol:e1t}=Hu(),{kIsDestroyed:$wn,isDestroyed:Wwn,isFinished:Gwn,isServerRequest:Ywn}=m1(),t1t=e1t("kDestroy"),Q2e=e1t("kConstruct");function r1t(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function Jwn(e,t){let r=this._readableState,n=this._writableState,a=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(r1t(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?XEt(this,e,t):this.once(t1t,function(s){XEt(this,zwn(s,e),t)}),this)}function XEt(e,t,r){let n=!1;function a(s){if(n)return;n=!0;let c=e._readableState,l=e._writableState;r1t(s,l,c),l&&(l.closed=!0),c&&(c.closed=!0),typeof r=="function"&&r(s),s?g1.nextTick(Kwn,e,s):g1.nextTick(n1t,e)}try{e._destroy(t||null,a)}catch(s){a(s)}}function Kwn(e,t){L2e(e,t),n1t(e)}function n1t(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function L2e(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function Xwn(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function j2e(e,t,r){let n=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),n&&!n.errored&&(n.errored=t),r?g1.nextTick(L2e,e,t):L2e(e,t))}function Zwn(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(Q2e,t),!(e.listenerCount(Q2e)>1)&&g1.nextTick(e2n,e)}function e2n(e){let t=!1;function r(n){if(t){j2e(e,n!=null?n:new Hwn);return}t=!0;let a=e._readableState,s=e._writableState,c=s||a;a&&(a.constructed=!0),s&&(s.constructed=!0),c.destroyed?e.emit(t1t,n):n?j2e(e,n,!0):g1.nextTick(t2n,e)}try{e._construct(n=>{g1.nextTick(r,n)})}catch(n){g1.nextTick(r,n)}}function t2n(e){e.emit(Q2e)}function ZEt(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function i1t(e){e.emit("close")}function r2n(e,t){e.emit("error",t),g1.nextTick(i1t,e)}function n2n(e,t){!e||Wwn(e)||(!t&&!Gwn(e)&&(t=new Vwn),Ywn(e)?(e.socket=null,e.destroy(t)):ZEt(e)?e.abort():ZEt(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?g1.nextTick(r2n,e,t):g1.nextTick(i1t,e),e.destroyed||(e[$wn]=!0))}s1t.exports={construct:Zwn,destroyer:n2n,destroy:Jwn,undestroy:Xwn,errorOrDestroy:j2e}});var cZ=P((ibi,o1t)=>{"use strict";var{ArrayIsArray:i2n,ObjectSetPrototypeOf:a1t}=Hu(),{EventEmitter:aZ}=require("events");function oZ(e){aZ.call(this,e)}a1t(oZ.prototype,aZ.prototype);a1t(oZ,aZ);oZ.prototype.pipe=function(e,t){let r=this;function n(m){e.writable&&e.write(m)===!1&&r.pause&&r.pause()}r.on("data",n);function a(){r.readable&&r.resume&&r.resume()}e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",c),r.on("close",l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}function f(m){d(),aZ.listenerCount(this,"error")===0&&this.emit("error",m)}M2e(r,"error",f),M2e(e,"error",f);function d(){r.removeListener("data",n),e.removeListener("drain",a),r.removeListener("end",c),r.removeListener("close",l),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e};function M2e(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):i2n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}o1t.exports={Stream:oZ,prependListener:M2e}});var c5=P((sbi,uZ)=>{"use strict";var{SymbolDispose:s2n}=Hu(),{AbortError:c1t,codes:a2n}=Bh(),{isNodeStream:u1t,isWebStream:o2n,kControllerErrorFunction:c2n}=m1(),u2n=ES(),{ERR_INVALID_ARG_TYPE:l1t}=a2n,q2e,l2n=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new l1t(t,"AbortSignal",e)};uZ.exports.addAbortSignal=function(t,r){if(l2n(t,"signal"),!u1t(r)&&!o2n(r))throw new l1t("stream",["ReadableStream","WritableStream","Stream"],r);return uZ.exports.addAbortSignalNoValidate(t,r)};uZ.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=u1t(t)?()=>{t.destroy(new c1t(void 0,{cause:e.reason}))}:()=>{t[c2n](new c1t(void 0,{cause:e.reason}))};if(e.aborted)r();else{q2e=q2e||Mm().addAbortListener;let n=q2e(e,r);u2n(t,n[s2n])}return t}});var d1t=P((obi,f1t)=>{"use strict";var{StringPrototypeSlice:p1t,SymbolIterator:p2n,TypedArrayPrototypeSet:lZ,Uint8Array:f2n}=Hu(),{Buffer:U2e}=require("buffer"),{inspect:d2n}=Mm();f1t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return U2e.alloc(0);let r=U2e.allocUnsafe(t>>>0),n=this.head,a=0;for(;n;)lZ(r,n.data,a),a+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let a=n.slice(0,t);return this.head.data=n.slice(t),a}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[p2n](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,a=0;do{let s=n.data;if(t>s.length)r+=s,t-=s.length;else{t===s.length?(r+=s,++a,n.next?this.head=n.next:this.head=this.tail=null):(r+=p1t(s,0,t),this.head=n,n.data=p1t(s,t));break}++a}while((n=n.next)!==null);return this.length-=a,r}_getBuffer(t){let r=U2e.allocUnsafe(t),n=t,a=this.head,s=0;do{let c=a.data;if(t>c.length)lZ(r,c,n-t),t-=c.length;else{t===c.length?(lZ(r,c,n-t),++s,a.next?this.head=a.next:this.head=this.tail=null):(lZ(r,new f2n(c.buffer,c.byteOffset,t),n-t),this.head=a,a.data=c.slice(t));break}++s}while((a=a.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return d2n(this,{...r,depth:0,customInspect:!1})}}});var u5=P((cbi,A1t)=>{"use strict";var{MathFloor:h2n,NumberIsInteger:m2n}=Hu(),{validateInteger:g2n}=W4(),{ERR_INVALID_ARG_VALUE:A2n}=Bh().codes,h1t=16*1024,m1t=16;function y2n(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function g1t(e){return e?m1t:h1t}function v2n(e,t){g2n(t,"value",0),e?m1t=t:h1t=t}function x2n(e,t,r,n){let a=y2n(t,n,r);if(a!=null){if(!m2n(a)||a<0){let s=n?`options.${r}`:"options.highWaterMark";throw new A2n(s,a)}return h2n(a)}return g1t(e.objectMode)}A1t.exports={getHighWaterMark:x2n,getDefaultHighWaterMark:g1t,setDefaultHighWaterMark:v2n}});var p5=P(v1t=>{"use strict";var H2e=$_().Buffer,y1t=H2e.isEncoding||function(e){switch(e=""+e,e&&e.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 b2n(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function E2n(e){var t=b2n(e);if(typeof t!="string"&&(H2e.isEncoding===y1t||!y1t(e)))throw new Error("Unknown encoding: "+e);return t||e}v1t.StringDecoder=l5;function l5(e){this.encoding=E2n(e);var t;switch(this.encoding){case"utf16le":this.text=k2n,this.end=T2n,t=4;break;case"utf8":this.fillLast=C2n,t=4;break;case"base64":this.text=B2n,this.end=D2n,t=3;break;default:this.write=P2n,this.end=R2n;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=H2e.allocUnsafe(t)}l5.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};l5.prototype.end=I2n;l5.prototype.text=_2n;l5.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function z2e(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function w2n(e,t,r){var n=t.length-1;if(n<r)return 0;var a=z2e(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||a===-2?0:(a=z2e(t[n]),a>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||a===-2?0:(a=z2e(t[n]),a>=0?(a>0&&(a===2?a=0:e.lastNeed=a-3),a):0))}function S2n(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function C2n(e){var t=this.lastTotal-this.lastNeed,r=S2n(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function _2n(e,t){var r=w2n(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function I2n(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function k2n(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function T2n(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function B2n(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function D2n(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function P2n(e){return e.toString(this.encoding)}function R2n(e){return e&&e.length?this.write(e):""}});var V2e=P((lbi,w1t)=>{"use strict";var x1t=mc(),{PromisePrototypeThen:N2n,SymbolAsyncIterator:b1t,SymbolIterator:E1t}=Hu(),{Buffer:F2n}=require("buffer"),{ERR_INVALID_ARG_TYPE:O2n,ERR_STREAM_NULL_VALUES:Q2n}=Bh().codes;function L2n(e,t,r){let n;if(typeof t=="string"||t instanceof F2n)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let a;if(t&&t[b1t])a=!0,n=t[b1t]();else if(t&&t[E1t])a=!1,n=t[E1t]();else throw new O2n("iterable",["Iterable"],t);let s=new e({objectMode:!0,highWaterMark:1,...r}),c=!1;s._read=function(){c||(c=!0,f())},s._destroy=function(d,m){N2n(l(d),()=>x1t.nextTick(m,d),g=>x1t.nextTick(m,g||d))};async function l(d){let m=d!=null,g=typeof n.throw=="function";if(m&&g){let{value:x,done:b}=await n.throw(d);if(await x,b)return}if(typeof n.return=="function"){let{value:x}=await n.return();await x}}async function f(){for(;;){try{let{value:d,done:m}=a?await n.next():n.next();if(m)s.push(null);else{let g=d&&typeof d.then=="function"?await d:d;if(g===null)throw c=!1,new Q2n;if(s.push(g))continue;c=!1}}catch(d){s.destroy(d)}break}}return s}w1t.exports=L2n});var d5=P((pbi,q1t)=>{"use strict";var Wx=mc(),{ArrayPrototypeIndexOf:j2n,NumberIsInteger:M2n,NumberIsNaN:q2n,NumberParseInt:U2n,ObjectDefineProperties:Z2e,ObjectKeys:z2n,ObjectSetPrototypeOf:_1t,Promise:I1t,SafeSet:H2n,SymbolAsyncDispose:V2n,SymbolAsyncIterator:$2n,Symbol:W2n}=Hu();q1t.exports=ia;ia.ReadableState=hZ;var{EventEmitter:G2n}=require("events"),{Stream:_I,prependListener:Y2n}=cZ(),{Buffer:$2e}=require("buffer"),{addAbortSignal:J2n}=c5(),k1t=ES(),Va=Mm().debuglog("stream",e=>{Va=e}),K2n=d1t(),K4=RD(),{getHighWaterMark:X2n,getDefaultHighWaterMark:Z2n}=u5(),{aggregateTwoErrors:S1t,codes:{ERR_INVALID_ARG_TYPE:eSn,ERR_METHOD_NOT_IMPLEMENTED:tSn,ERR_OUT_OF_RANGE:rSn,ERR_STREAM_PUSH_AFTER_EOF:nSn,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:iSn},AbortError:sSn}=Bh(),{validateObject:aSn}=W4(),ND=W2n("kPaused"),{StringDecoder:T1t}=p5(),oSn=V2e();_1t(ia.prototype,_I.prototype);_1t(ia,_I);var W2e=()=>{},{errorOrDestroy:Y4}=K4,J4=1,cSn=2,B1t=4,f5=8,D1t=16,pZ=32,fZ=64,P1t=128,uSn=256,lSn=512,pSn=1024,K2e=2048,X2e=4096,fSn=8192,dSn=16384,hSn=32768,R1t=65536,mSn=1<<17,gSn=1<<18;function rf(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}Z2e(hZ.prototype,{objectMode:rf(J4),ended:rf(cSn),endEmitted:rf(B1t),reading:rf(f5),constructed:rf(D1t),sync:rf(pZ),needReadable:rf(fZ),emittedReadable:rf(P1t),readableListening:rf(uSn),resumeScheduled:rf(lSn),errorEmitted:rf(pSn),emitClose:rf(K2e),autoDestroy:rf(X2e),destroyed:rf(fSn),closed:rf(dSn),closeEmitted:rf(hSn),multiAwaitDrain:rf(R1t),readingMore:rf(mSn),dataEmitted:rf(gSn)});function hZ(e,t,r){typeof r!="boolean"&&(r=t instanceof A1()),this.state=K2e|X2e|D1t|pZ,e&&e.objectMode&&(this.state|=J4),r&&e&&e.readableObjectMode&&(this.state|=J4),this.highWaterMark=e?X2n(this,e,"readableHighWaterMark",r):Z2n(!1),this.buffer=new K2n,this.length=0,this.pipes=[],this.flowing=null,this[ND]=null,e&&e.emitClose===!1&&(this.state&=~K2e),e&&e.autoDestroy===!1&&(this.state&=~X2e),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new T1t(e.encoding),this.encoding=e.encoding)}function ia(e){if(!(this instanceof ia))return new ia(e);let t=this instanceof A1();this._readableState=new hZ(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&J2n(e.signal,this)),_I.call(this,e),K4.construct(this,()=>{this._readableState.needReadable&&dZ(this,this._readableState)})}ia.prototype.destroy=K4.destroy;ia.prototype._undestroy=K4.undestroy;ia.prototype._destroy=function(e,t){t(e)};ia.prototype[G2n.captureRejectionSymbol]=function(e){this.destroy(e)};ia.prototype[V2n]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new sSn,this.destroy(e)),new I1t((t,r)=>k1t(this,n=>n&&n!==e?r(n):t(null)))};ia.prototype.push=function(e,t){return N1t(this,e,t,!1)};ia.prototype.unshift=function(e,t){return N1t(this,e,t,!0)};function N1t(e,t,r,n){Va("readableAddChunk",t);let a=e._readableState,s;if(a.state&J4||(typeof t=="string"?(r=r||a.defaultEncoding,a.encoding!==r&&(n&&a.encoding?t=$2e.from(t,r).toString(a.encoding):(t=$2e.from(t,r),r=""))):t instanceof $2e?r="":_I._isUint8Array(t)?(t=_I._uint8ArrayToBuffer(t),r=""):t!=null&&(s=new eSn("chunk",["string","Buffer","Uint8Array"],t))),s)Y4(e,s);else if(t===null)a.state&=~f5,vSn(e,a);else if(a.state&J4||t&&t.length>0)if(n)if(a.state&B1t)Y4(e,new iSn);else{if(a.destroyed||a.errored)return!1;G2e(e,a,t,!0)}else if(a.ended)Y4(e,new nSn);else{if(a.destroyed||a.errored)return!1;a.state&=~f5,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?G2e(e,a,t,!1):dZ(e,a)):G2e(e,a,t,!1)}else n||(a.state&=~f5,dZ(e,a));return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function G2e(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&R1t?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&fZ&&mZ(e)),dZ(e,t)}ia.prototype.isPaused=function(){let e=this._readableState;return e[ND]===!0||e.flowing===!1};ia.prototype.setEncoding=function(e){let t=new T1t(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let a of r)n+=t.write(a);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var ASn=1073741824;function ySn(e){if(e>ASn)throw new rSn("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function C1t(e,t){return e<=0||t.length===0&&t.ended?0:t.state&J4?1:q2n(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}ia.prototype.read=function(e){Va("read",e),e===void 0?e=NaN:M2n(e)||(e=U2n(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=ySn(e)),e!==0&&(t.state&=~P1t),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Va("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Y2e(this):mZ(this),null;if(e=C1t(e,t),e===0&&t.ended)return t.length===0&&Y2e(this),null;let n=(t.state&fZ)!==0;if(Va("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Va("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,Va("reading, ended or constructing",n);else if(n){Va("do read"),t.state|=f5|pZ,t.length===0&&(t.state|=fZ);try{this._read(t.highWaterMark)}catch(s){Y4(this,s)}t.state&=~pZ,t.reading||(e=C1t(r,t))}let a;return e>0?a=j1t(e,t):a=null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Y2e(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",a)),a};function vSn(e,t){if(Va("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?mZ(e):(t.needReadable=!1,t.emittedReadable=!0,F1t(e))}}function mZ(e){let t=e._readableState;Va("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Va("emitReadable",t.flowing),t.emittedReadable=!0,Wx.nextTick(F1t,e))}function F1t(e){let t=e._readableState;Va("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Q1t(e)}function dZ(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Wx.nextTick(xSn,e,t))}function xSn(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(Va("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}ia.prototype._read=function(e){throw new tSn("_read()")};ia.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new H2n(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),Va("pipe count=%d opts=%j",n.pipes.length,t);let s=(!t||t.end!==!1)&&e!==Wx.stdout&&e!==Wx.stderr?l:I;n.endEmitted?Wx.nextTick(s):r.once("end",s),e.on("unpipe",c);function c(k,O){Va("onunpipe"),k===r&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,m())}function l(){Va("onend"),e.end()}let f,d=!1;function m(){Va("cleanup"),e.removeListener("close",A),e.removeListener("finish",C),f&&e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",I),r.removeListener("data",x),d=!0,f&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&f()}function g(){d||(n.pipes.length===1&&n.pipes[0]===e?(Va("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(Va("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),f||(f=bSn(r,e),e.on("drain",f))}r.on("data",x);function x(k){Va("ondata");let O=e.write(k);Va("dest.write",O),O===!1&&g()}function b(k){if(Va("onerror",k),I(),e.removeListener("error",b),e.listenerCount("error")===0){let O=e._writableState||e._readableState;O&&!O.errorEmitted?Y4(e,k):e.emit("error",k)}}Y2n(e,"error",b);function A(){e.removeListener("finish",C),I()}e.once("close",A);function C(){Va("onfinish"),e.removeListener("close",A),I()}e.once("finish",C);function I(){Va("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?g():n.flowing||(Va("pipe resume"),r.resume()),e};function bSn(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(Va("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(Va("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}ia.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let a=t.pipes;t.pipes=[],this.pause();for(let s=0;s<a.length;s++)a[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=j2n(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};ia.prototype.on=function(e,t){let r=_I.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,Va("on readable",n.length,n.reading),n.length?mZ(this):n.reading||Wx.nextTick(ESn,this)),r};ia.prototype.addListener=ia.prototype.on;ia.prototype.removeListener=function(e,t){let r=_I.prototype.removeListener.call(this,e,t);return e==="readable"&&Wx.nextTick(O1t,this),r};ia.prototype.off=ia.prototype.removeListener;ia.prototype.removeAllListeners=function(e){let t=_I.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Wx.nextTick(O1t,this),t};function O1t(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[ND]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ESn(e){Va("readable nexttick read 0"),e.read(0)}ia.prototype.resume=function(){let e=this._readableState;return e.flowing||(Va("resume"),e.flowing=!e.readableListening,wSn(this,e)),e[ND]=!1,this};function wSn(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Wx.nextTick(SSn,e,t))}function SSn(e,t){Va("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Q1t(e),t.flowing&&!t.reading&&e.read(0)}ia.prototype.pause=function(){return Va("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Va("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ND]=!0,this};function Q1t(e){let t=e._readableState;for(Va("flow",t.flowing);t.flowing&&e.read()!==null;);}ia.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{Y4(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=z2n(e);for(let n=1;n<r.length;n++){let a=r[n];this[a]===void 0&&typeof e[a]=="function"&&(this[a]=e[a].bind(e))}return this};ia.prototype[$2n]=function(){return L1t(this)};ia.prototype.iterator=function(e){return e!==void 0&&aSn(e,"options"),L1t(this,e)};function L1t(e,t){typeof e.read!="function"&&(e=ia.wrap(e,{objectMode:!0}));let r=CSn(e,t);return r.stream=e,r}async function*CSn(e,t){let r=W2e;function n(c){this===e?(r(),r=W2e):r=c}e.on("readable",n);let a,s=k1t(e,{writable:!1},c=>{a=c?S1t(a,c):null,r(),r=W2e});try{for(;;){let c=e.destroyed?null:e.read();if(c!==null)yield c;else{if(a)throw a;if(a===null)return;await new I1t(n)}}}catch(c){throw a=S1t(a,c),a}finally{(a||(t==null?void 0:t.destroyOnReturn)!==!1)&&(a===void 0||e._readableState.autoDestroy)?K4.destroyer(e,null):(e.off("readable",n),s())}}Z2e(ia.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Z2e(hZ.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ND]!==!1},set(e){this[ND]=!!e}}});ia._fromList=j1t;function j1t(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function Y2e(e){let t=e._readableState;Va("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Wx.nextTick(_Sn,t,e))}function _Sn(e,t){if(Va("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Wx.nextTick(ISn,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function ISn(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}ia.from=function(e,t){return oSn(ia,e,t)};var J2e;function M1t(){return J2e===void 0&&(J2e={}),J2e}ia.fromWeb=function(e,t){return M1t().newStreamReadableFromReadableStream(e,t)};ia.toWeb=function(e,t){return M1t().newReadableStreamFromStreamReadable(e,t)};ia.wrap=function(e,t){var r,n;return new ia({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(a,s){K4.destroyer(e,a),s(a)}}).wrap(e)}});var xZ=P((fbi,Z1t)=>{"use strict";var FD=mc(),{ArrayPrototypeSlice:H1t,Error:kSn,FunctionPrototypeSymbolHasInstance:V1t,ObjectDefineProperty:$1t,ObjectDefineProperties:TSn,ObjectSetPrototypeOf:W1t,StringPrototypeToLowerCase:BSn,Symbol:DSn,SymbolHasInstance:PSn}=Hu();Z1t.exports=gl;gl.WritableState=g5;var{EventEmitter:RSn}=require("events"),h5=cZ().Stream,{Buffer:gZ}=require("buffer"),vZ=RD(),{addAbortSignal:NSn}=c5(),{getHighWaterMark:FSn,getDefaultHighWaterMark:OSn}=u5(),{ERR_INVALID_ARG_TYPE:QSn,ERR_METHOD_NOT_IMPLEMENTED:LSn,ERR_MULTIPLE_CALLBACK:G1t,ERR_STREAM_CANNOT_PIPE:jSn,ERR_STREAM_DESTROYED:m5,ERR_STREAM_ALREADY_FINISHED:MSn,ERR_STREAM_NULL_VALUES:qSn,ERR_STREAM_WRITE_AFTER_END:USn,ERR_UNKNOWN_ENCODING:Y1t}=Bh().codes,{errorOrDestroy:X4}=vZ;W1t(gl.prototype,h5.prototype);W1t(gl,h5);function rSe(){}var Z4=DSn("kOnFinished");function g5(e,t,r){typeof r!="boolean"&&(r=t instanceof A1()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?FSn(this,e,"writableHighWaterMark",r):OSn(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=HSn.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,yZ(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Z4]=[]}function yZ(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}g5.prototype.getBuffer=function(){return H1t(this.buffered,this.bufferedIndex)};$1t(g5.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function gl(e){let t=this instanceof A1();if(!t&&!V1t(gl,this))return new gl(e);this._writableState=new g5(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&NSn(e.signal,this)),h5.call(this,e),vZ.construct(this,()=>{let r=this._writableState;r.writing||iSe(this,r),sSe(this,r)})}$1t(gl,PSn,{__proto__:null,value:function(e){return V1t(this,e)?!0:this!==gl?!1:e&&e._writableState instanceof g5}});gl.prototype.pipe=function(){X4(this,new jSn)};function J1t(e,t,r,n){let a=e._writableState;if(typeof r=="function")n=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!=="buffer"&&!gZ.isEncoding(r))throw new Y1t(r);typeof n!="function"&&(n=rSe)}if(t===null)throw new qSn;if(!a.objectMode)if(typeof t=="string")a.decodeStrings!==!1&&(t=gZ.from(t,r),r="buffer");else if(t instanceof gZ)r="buffer";else if(h5._isUint8Array(t))t=h5._uint8ArrayToBuffer(t),r="buffer";else throw new QSn("chunk",["string","Buffer","Uint8Array"],t);let s;return a.ending?s=new USn:a.destroyed&&(s=new m5("write")),s?(FD.nextTick(n,s),X4(e,s,!0),s):(a.pendingcb++,zSn(e,a,t,r,n))}gl.prototype.write=function(e,t,r){return J1t(this,e,t,r)===!0};gl.prototype.cork=function(){this._writableState.corked++};gl.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||iSe(this,e))};gl.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=BSn(t)),!gZ.isEncoding(t))throw new Y1t(t);return this._writableState.defaultEncoding=t,this};function zSn(e,t,r,n,a){let s=t.objectMode?1:r.length;t.length+=s;let c=t.length<t.highWaterMark;return c||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:a}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&a!==rSe&&(t.allNoop=!1)):(t.writelen=s,t.writecb=a,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),c&&!t.errored&&!t.destroyed}function U1t(e,t,r,n,a,s,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m5("write")):r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}function z1t(e,t,r,n){--t.pendingcb,n(r),nSe(t),X4(e,r)}function HSn(e,t){let r=e._writableState,n=r.sync,a=r.writecb;if(typeof a!="function"){X4(e,new G1t);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?FD.nextTick(z1t,e,r,t,a):z1t(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&iSe(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},FD.nextTick(VSn,r.afterWriteTickInfo)):K1t(e,r,1,a))}function VSn({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,K1t(e,t,r,n)}function K1t(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&nSe(t),sSe(e,t)}function nSe(e){if(e.writing)return;for(let a=e.bufferedIndex;a<e.buffered.length;++a){var t;let{chunk:s,callback:c}=e.buffered[a],l=e.objectMode?1:s.length;e.length-=l,c((t=e.errored)!==null&&t!==void 0?t:new m5("write"))}let r=e[Z4].splice(0);for(let a=0;a<r.length;a++){var n;r[a]((n=e.errored)!==null&&n!==void 0?n:new m5("end"))}yZ(e)}function iSe(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:a}=t,s=r.length-n;if(!s)return;let c=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let l=t.allNoop?rSe:d=>{for(let m=c;m<r.length;++m)r[m].callback(d)},f=t.allNoop&&c===0?r:H1t(r,c);f.allBuffers=t.allBuffers,U1t(e,t,!0,t.length,f,"",l),yZ(t)}else{do{let{chunk:l,encoding:f,callback:d}=r[c];r[c++]=null;let m=a?1:l.length;U1t(e,t,!1,m,l,f,d)}while(c<r.length&&!t.writing);c===r.length?yZ(t):c>256?(r.splice(0,c),t.bufferedIndex=0):t.bufferedIndex=c}t.bufferProcessing=!1}gl.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new LSn("_write()")};gl.prototype._writev=null;gl.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let a;if(e!=null){let s=J1t(this,e,t);s instanceof kSn&&(a=s)}return n.corked&&(n.corked=1,this.uncork()),a||(!n.errored&&!n.ending?(n.ending=!0,sSe(this,n,!0),n.ended=!0):n.finished?a=new MSn("end"):n.destroyed&&(a=new m5("end"))),typeof r=="function"&&(a||n.finished?FD.nextTick(r,a):n[Z4].push(r)),this};function AZ(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function $Sn(e,t){let r=!1;function n(a){if(r){X4(e,a!=null?a:G1t());return}if(r=!0,t.pendingcb--,a){let s=t[Z4].splice(0);for(let c=0;c<s.length;c++)s[c](a);X4(e,a,t.sync)}else AZ(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,FD.nextTick(tSe,e,t))}t.sync=!0,t.pendingcb++;try{e._final(n)}catch(a){n(a)}t.sync=!1}function WSn(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,$Sn(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function sSe(e,t,r){AZ(t)&&(WSn(e,t),t.pendingcb===0&&(r?(t.pendingcb++,FD.nextTick((n,a)=>{AZ(a)?tSe(n,a):a.pendingcb--},e,t)):AZ(t)&&(t.pendingcb++,tSe(e,t))))}function tSe(e,t){t.pendingcb--,t.finished=!0;let r=t[Z4].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}TSn(gl.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var GSn=vZ.destroy;gl.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Z4].length)&&FD.nextTick(nSe,r),GSn.call(this,e,t),this};gl.prototype._undestroy=vZ.undestroy;gl.prototype._destroy=function(e,t){t(e)};gl.prototype[RSn.captureRejectionSymbol]=function(e){this.destroy(e)};var eSe;function X1t(){return eSe===void 0&&(eSe={}),eSe}gl.fromWeb=function(e,t){return X1t().newStreamWritableFromWritableStream(e,t)};gl.toWeb=function(e){return X1t().newWritableStreamFromStreamWritable(e)}});var hwt=P((dbi,dwt)=>{var aSe=mc(),YSn=require("buffer"),{isReadable:JSn,isWritable:KSn,isIterable:ewt,isNodeStream:XSn,isReadableNodeStream:twt,isWritableNodeStream:rwt,isDuplexNodeStream:ZSn,isReadableStream:nwt,isWritableStream:iwt}=m1(),swt=ES(),{AbortError:pwt,codes:{ERR_INVALID_ARG_TYPE:eCn,ERR_INVALID_RETURN_VALUE:awt}}=Bh(),{destroyer:tQ}=RD(),tCn=A1(),fwt=d5(),rCn=xZ(),{createDeferredPromise:owt}=Mm(),cwt=V2e(),uwt=globalThis.Blob||YSn.Blob,nCn=typeof uwt<"u"?function(t){return t instanceof uwt}:function(t){return!1},iCn=globalThis.AbortController||lp().AbortController,{FunctionPrototypeCall:lwt}=Hu(),II=class extends tCn{constructor(t){super(t),(t==null?void 0:t.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(t==null?void 0:t.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};dwt.exports=function e(t,r){if(ZSn(t))return t;if(twt(t))return eQ({readable:t});if(rwt(t))return eQ({writable:t});if(XSn(t))return eQ({writable:!1,readable:!1});if(nwt(t))return eQ({readable:fwt.fromWeb(t)});if(iwt(t))return eQ({writable:rCn.fromWeb(t)});if(typeof t=="function"){let{value:a,write:s,final:c,destroy:l}=sCn(t);if(ewt(a))return cwt(II,a,{objectMode:!0,write:s,final:c,destroy:l});let f=a==null?void 0:a.then;if(typeof f=="function"){let d,m=lwt(f,a,g=>{if(g!=null)throw new awt("nully","body",g)},g=>{tQ(d,g)});return d=new II({objectMode:!0,readable:!1,write:s,final(g){c(async()=>{try{await m,aSe.nextTick(g,null)}catch(x){aSe.nextTick(g,x)}})},destroy:l})}throw new awt("Iterable, AsyncIterable or AsyncFunction",r,a)}if(nCn(t))return e(t.arrayBuffer());if(ewt(t))return cwt(II,t,{objectMode:!0,writable:!1});if(nwt(t==null?void 0:t.readable)&&iwt(t==null?void 0:t.writable))return II.fromWeb(t);if(typeof(t==null?void 0:t.writable)=="object"||typeof(t==null?void 0:t.readable)=="object"){let a=t!=null&&t.readable?twt(t==null?void 0:t.readable)?t==null?void 0:t.readable:e(t.readable):void 0,s=t!=null&&t.writable?rwt(t==null?void 0:t.writable)?t==null?void 0:t.writable:e(t.writable):void 0;return eQ({readable:a,writable:s})}let n=t==null?void 0:t.then;if(typeof n=="function"){let a;return lwt(n,t,s=>{s!=null&&a.push(s),a.push(null)},s=>{tQ(a,s)}),a=new II({objectMode:!0,writable:!1,read(){}})}throw new eCn(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function sCn(e){let{promise:t,resolve:r}=owt(),n=new iCn,a=n.signal;return{value:e(async function*(){for(;;){let c=t;t=null;let{chunk:l,done:f,cb:d}=await c;if(aSe.nextTick(d),f)return;if(a.aborted)throw new pwt(void 0,{cause:a.reason});({promise:t,resolve:r}=owt()),yield l}}(),{signal:a}),write(c,l,f){let d=r;r=null,d({chunk:c,done:!1,cb:f})},final(c){let l=r;r=null,l({done:!0,cb:c})},destroy(c,l){n.abort(),l(c)}}}function eQ(e){let t=e.readable&&typeof e.readable.read!="function"?fwt.wrap(e.readable):e.readable,r=e.writable,n=!!JSn(t),a=!!KSn(r),s,c,l,f,d;function m(g){let x=f;f=null,x?x(g):g&&d.destroy(g)}return d=new II({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:a}),a&&(swt(r,g=>{a=!1,g&&tQ(t,g),m(g)}),d._write=function(g,x,b){r.write(g,x)?b():s=b},d._final=function(g){r.end(),c=g},r.on("drain",function(){if(s){let g=s;s=null,g()}}),r.on("finish",function(){if(c){let g=c;c=null,g()}})),n&&(swt(t,g=>{n=!1,g&&tQ(t,g),m(g)}),t.on("readable",function(){if(l){let g=l;l=null,g()}}),t.on("end",function(){d.push(null)}),d._read=function(){for(;;){let g=t.read();if(g===null){l=d._read;return}if(!d.push(g))return}}),d._destroy=function(g,x){!g&&f!==null&&(g=new pwt),l=null,s=null,c=null,f===null?x(g):(f=x,tQ(r,g),tQ(t,g))},d}});var A1=P((hbi,Awt)=>{"use strict";var{ObjectDefineProperties:aCn,ObjectGetOwnPropertyDescriptor:wS,ObjectKeys:oCn,ObjectSetPrototypeOf:mwt}=Hu();Awt.exports=Gx;var uSe=d5(),ev=xZ();mwt(Gx.prototype,uSe.prototype);mwt(Gx,uSe);{let e=oCn(ev.prototype);for(let t=0;t<e.length;t++){let r=e[t];Gx.prototype[r]||(Gx.prototype[r]=ev.prototype[r])}}function Gx(e){if(!(this instanceof Gx))return new Gx(e);uSe.call(this,e),ev.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}aCn(Gx.prototype,{writable:{__proto__:null,...wS(ev.prototype,"writable")},writableHighWaterMark:{__proto__:null,...wS(ev.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...wS(ev.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...wS(ev.prototype,"writableBuffer")},writableLength:{__proto__:null,...wS(ev.prototype,"writableLength")},writableFinished:{__proto__:null,...wS(ev.prototype,"writableFinished")},writableCorked:{__proto__:null,...wS(ev.prototype,"writableCorked")},writableEnded:{__proto__:null,...wS(ev.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...wS(ev.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var oSe;function gwt(){return oSe===void 0&&(oSe={}),oSe}Gx.fromWeb=function(e,t){return gwt().newStreamDuplexFromReadableWritablePair(e,t)};Gx.toWeb=function(e){return gwt().newReadableWritablePairFromDuplex(e)};var cSe;Gx.from=function(e){return cSe||(cSe=hwt()),cSe(e,"body")}});var fSe=P((mbi,vwt)=>{"use strict";var{ObjectSetPrototypeOf:ywt,Symbol:cCn}=Hu();vwt.exports=SS;var{ERR_METHOD_NOT_IMPLEMENTED:uCn}=Bh().codes,pSe=A1(),{getHighWaterMark:lCn}=u5();ywt(SS.prototype,pSe.prototype);ywt(SS,pSe);var A5=cCn("kCallback");function SS(e){if(!(this instanceof SS))return new SS(e);let t=e?lCn(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),pSe.call(this,e),this._readableState.sync=!1,this[A5]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",pCn)}function lSe(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function pCn(){this._final!==lSe&&lSe.call(this)}SS.prototype._final=lSe;SS.prototype._transform=function(e,t,r){throw new uCn("_transform()")};SS.prototype._write=function(e,t,r){let n=this._readableState,a=this._writableState,s=n.length;this._transform(e,t,(c,l)=>{if(c){r(c);return}l!=null&&this.push(l),a.ended||s===n.length||n.length<n.highWaterMark?r():this[A5]=r})};SS.prototype._read=function(){if(this[A5]){let e=this[A5];this[A5]=null,e()}}});var hSe=P((gbi,bwt)=>{"use strict";var{ObjectSetPrototypeOf:xwt}=Hu();bwt.exports=rQ;var dSe=fSe();xwt(rQ.prototype,dSe.prototype);xwt(rQ,dSe);function rQ(e){if(!(this instanceof rQ))return new rQ(e);dSe.call(this,e)}rQ.prototype._transform=function(e,t,r){r(null,e)}});var SZ=P((Abi,_wt)=>{var y5=mc(),{ArrayIsArray:fCn,Promise:dCn,SymbolAsyncIterator:hCn,SymbolDispose:mCn}=Hu(),wZ=ES(),{once:gCn}=Mm(),ACn=RD(),Ewt=A1(),{aggregateTwoErrors:yCn,codes:{ERR_INVALID_ARG_TYPE:wSe,ERR_INVALID_RETURN_VALUE:mSe,ERR_MISSING_ARGS:vCn,ERR_STREAM_DESTROYED:xCn,ERR_STREAM_PREMATURE_CLOSE:bCn},AbortError:ECn}=Bh(),{validateFunction:wCn,validateAbortSignal:SCn}=W4(),{isIterable:OD,isReadable:gSe,isReadableNodeStream:EZ,isNodeStream:wwt,isTransformStream:nQ,isWebStream:CCn,isReadableStream:ASe,isReadableFinished:_Cn}=m1(),ICn=globalThis.AbortController||lp().AbortController,ySe,vSe,xSe;function Swt(e,t,r){let n=!1;e.on("close",()=>{n=!0});let a=wZ(e,{readable:t,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,ACn.destroyer(e,s||new xCn("pipe")))},cleanup:a}}function kCn(e){return wCn(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function bSe(e){if(OD(e))return e;if(EZ(e))return TCn(e);throw new wSe("val",["Readable","Iterable","AsyncIterable"],e)}async function*TCn(e){vSe||(vSe=d5()),yield*vSe.prototype[hCn].call(e)}async function bZ(e,t,r,{end:n}){let a,s=null,c=d=>{if(d&&(a=d),s){let m=s;s=null,m()}},l=()=>new dCn((d,m)=>{a?m(a):s=()=>{a?m(a):d()}});t.on("drain",c);let f=wZ(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let d of e)t.write(d)||await l();n&&(t.end(),await l()),r()}catch(d){r(a!==d?yCn(a,d):d)}finally{f(),t.off("drain",c)}}async function ESe(e,t,r,{end:n}){nQ(t)&&(t=t.writable);let a=t.getWriter();try{for await(let s of e)await a.ready,a.write(s).catch(()=>{});await a.ready,n&&await a.close(),r()}catch(s){try{await a.abort(s),r(s)}catch(c){r(c)}}}function BCn(...e){return Cwt(e,gCn(kCn(e)))}function Cwt(e,t,r){if(e.length===1&&fCn(e[0])&&(e=e[0]),e.length<2)throw new vCn("streams");let n=new ICn,a=n.signal,s=r==null?void 0:r.signal,c=[];SCn(s,"options.signal");function l(){A(new ECn)}xSe=xSe||Mm().addAbortListener;let f;s&&(f=xSe(s,l));let d,m,g=[],x=0;function b(j){A(j,--x===0)}function A(j,M){var W;if(j&&(!d||d.code==="ERR_STREAM_PREMATURE_CLOSE")&&(d=j),!(!d&&!M)){for(;g.length;)g.shift()(d);(W=f)===null||W===void 0||W[mCn](),n.abort(),M&&(d||c.forEach(se=>se()),y5.nextTick(t,d,m))}}let C;for(let j=0;j<e.length;j++){let M=e[j],W=j<e.length-1,se=j>0,X=W||(r==null?void 0:r.end)!==!1,ve=j===e.length-1;if(wwt(M)){let ae=function(he){he&&he.name!=="AbortError"&&he.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(he)};var O=ae;if(X){let{destroy:he,cleanup:me}=Swt(M,W,se);g.push(he),gSe(M)&&ve&&c.push(me)}M.on("error",ae),gSe(M)&&ve&&c.push(()=>{M.removeListener("error",ae)})}if(j===0)if(typeof M=="function"){if(C=M({signal:a}),!OD(C))throw new mSe("Iterable, AsyncIterable or Stream","source",C)}else OD(M)||EZ(M)||nQ(M)?C=M:C=Ewt.from(M);else if(typeof M=="function"){if(nQ(C)){var I;C=bSe((I=C)===null||I===void 0?void 0:I.readable)}else C=bSe(C);if(C=M(C,{signal:a}),W){if(!OD(C,!0))throw new mSe("AsyncIterable",`transform[${j-1}]`,C)}else{var k;ySe||(ySe=hSe());let ae=new ySe({objectMode:!0}),he=(k=C)===null||k===void 0?void 0:k.then;if(typeof he=="function")x++,he.call(C,ue=>{m=ue,ue!=null&&ae.write(ue),X&&ae.end(),y5.nextTick(b)},ue=>{ae.destroy(ue),y5.nextTick(b,ue)});else if(OD(C,!0))x++,bZ(C,ae,b,{end:X});else if(ASe(C)||nQ(C)){let ue=C.readable||C;x++,bZ(ue,ae,b,{end:X})}else throw new mSe("AsyncIterable or Promise","destination",C);C=ae;let{destroy:me,cleanup:ye}=Swt(C,!1,!0);g.push(me),ve&&c.push(ye)}}else if(wwt(M)){if(EZ(C)){x+=2;let ae=DCn(C,M,b,{end:X});gSe(M)&&ve&&c.push(ae)}else if(nQ(C)||ASe(C)){let ae=C.readable||C;x++,bZ(ae,M,b,{end:X})}else if(OD(C))x++,bZ(C,M,b,{end:X});else throw new wSe("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=M}else if(CCn(M)){if(EZ(C))x++,ESe(bSe(C),M,b,{end:X});else if(ASe(C)||OD(C))x++,ESe(C,M,b,{end:X});else if(nQ(C))x++,ESe(C.readable,M,b,{end:X});else throw new wSe("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=M}else C=Ewt.from(M)}return(a!=null&&a.aborted||s!=null&&s.aborted)&&y5.nextTick(l),C}function DCn(e,t,r,{end:n}){let a=!1;if(t.on("close",()=>{a||r(new bCn)}),e.pipe(t,{end:!1}),n){let c=function(){a=!0,t.end()};var s=c;_Cn(e)?y5.nextTick(c):e.once("end",c)}else r();return wZ(e,{readable:!0,writable:!1},c=>{let l=e._readableState;c&&c.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?e.once("end",r).once("error",r):r(c)}),wZ(t,{readable:!1,writable:!0},r)}_wt.exports={pipelineImpl:Cwt,pipeline:BCn}});var CSe=P((ybi,Pwt)=>{"use strict";var{pipeline:PCn}=SZ(),CZ=A1(),{destroyer:RCn}=RD(),{isNodeStream:_Z,isReadable:Iwt,isWritable:kwt,isWebStream:SSe,isTransformStream:QD,isWritableStream:Twt,isReadableStream:Bwt}=m1(),{AbortError:NCn,codes:{ERR_INVALID_ARG_VALUE:Dwt,ERR_MISSING_ARGS:FCn}}=Bh(),OCn=ES();Pwt.exports=function(...t){if(t.length===0)throw new FCn("streams");if(t.length===1)return CZ.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=CZ.from(t[0])),typeof t[t.length-1]=="function"){let b=t.length-1;t[b]=CZ.from(t[b])}for(let b=0;b<t.length;++b)if(!(!_Z(t[b])&&!SSe(t[b]))){if(b<t.length-1&&!(Iwt(t[b])||Bwt(t[b])||QD(t[b])))throw new Dwt(`streams[${b}]`,r[b],"must be readable");if(b>0&&!(kwt(t[b])||Twt(t[b])||QD(t[b])))throw new Dwt(`streams[${b}]`,r[b],"must be writable")}let n,a,s,c,l;function f(b){let A=c;c=null,A?A(b):b?l.destroy(b):!x&&!g&&l.destroy()}let d=t[0],m=PCn(t,f),g=!!(kwt(d)||Twt(d)||QD(d)),x=!!(Iwt(m)||Bwt(m)||QD(m));if(l=new CZ({writableObjectMode:!!(d!=null&&d.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:g,readable:x}),g){if(_Z(d))l._write=function(A,C,I){d.write(A,C)?I():n=I},l._final=function(A){d.end(),a=A},d.on("drain",function(){if(n){let A=n;n=null,A()}});else if(SSe(d)){let C=(QD(d)?d.writable:d).getWriter();l._write=async function(I,k,O){try{await C.ready,C.write(I).catch(()=>{}),O()}catch(j){O(j)}},l._final=async function(I){try{await C.ready,C.close().catch(()=>{}),a=I}catch(k){I(k)}}}let b=QD(m)?m.readable:m;OCn(b,()=>{if(a){let A=a;a=null,A()}})}if(x){if(_Z(m))m.on("readable",function(){if(s){let b=s;s=null,b()}}),m.on("end",function(){l.push(null)}),l._read=function(){for(;;){let b=m.read();if(b===null){s=l._read;return}if(!l.push(b))return}};else if(SSe(m)){let A=(QD(m)?m.readable:m).getReader();l._read=async function(){for(;;)try{let{value:C,done:I}=await A.read();if(!l.push(C))return;if(I){l.push(null);return}}catch{return}}}}return l._destroy=function(b,A){!b&&c!==null&&(b=new NCn),s=null,n=null,a=null,c===null?A(b):(c=A,_Z(m)&&RCn(m,b))},l}});var Uwt=P((vbi,kSe)=>{"use strict";var QCn=globalThis.AbortController||lp().AbortController,{codes:{ERR_INVALID_ARG_VALUE:LCn,ERR_INVALID_ARG_TYPE:v5,ERR_MISSING_ARGS:jCn,ERR_OUT_OF_RANGE:MCn},AbortError:y1}=Bh(),{validateAbortSignal:LD,validateInteger:Rwt,validateObject:jD}=W4(),qCn=Hu().Symbol("kWeak"),UCn=Hu().Symbol("kResistStopPropagation"),{finished:zCn}=ES(),HCn=CSe(),{addAbortSignalNoValidate:VCn}=c5(),{isWritable:$Cn,isNodeStream:WCn}=m1(),{deprecate:GCn}=Mm(),{ArrayPrototypePush:YCn,Boolean:JCn,MathFloor:Nwt,Number:KCn,NumberIsNaN:XCn,Promise:Fwt,PromiseReject:Owt,PromiseResolve:ZCn,PromisePrototypeThen:Qwt,Symbol:jwt}=Hu(),IZ=jwt("kEmpty"),Lwt=jwt("kEof");function e_n(e,t){if(t!=null&&jD(t,"options"),(t==null?void 0:t.signal)!=null&&LD(t.signal,"options.signal"),WCn(e)&&!$Cn(e))throw new LCn("stream",e,"must be writable");let r=HCn(this,e);return t!=null&&t.signal&&VCn(t.signal,r),r}function kZ(e,t){if(typeof e!="function")throw new v5("fn",["Function","AsyncFunction"],e);t!=null&&jD(t,"options"),(t==null?void 0:t.signal)!=null&&LD(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=Nwt(t.concurrency));let n=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(n=Nwt(t.highWaterMark)),Rwt(r,"options.concurrency",1),Rwt(n,"options.highWaterMark",0),n+=r,async function*(){let s=Mm().AbortSignalAny([t==null?void 0:t.signal].filter(JCn)),c=this,l=[],f={signal:s},d,m,g=!1,x=0;function b(){g=!0,A()}function A(){x-=1,C()}function C(){m&&!g&&x<r&&l.length<n&&(m(),m=null)}async function I(){try{for await(let k of c){if(g)return;if(s.aborted)throw new y1;try{if(k=e(k,f),k===IZ)continue;k=ZCn(k)}catch(O){k=Owt(O)}x+=1,Qwt(k,A,b),l.push(k),d&&(d(),d=null),!g&&(l.length>=n||x>=r)&&await new Fwt(O=>{m=O})}l.push(Lwt)}catch(k){let O=Owt(k);Qwt(O,A,b),l.push(O)}finally{g=!0,d&&(d(),d=null)}}I();try{for(;;){for(;l.length>0;){let k=await l[0];if(k===Lwt)return;if(s.aborted)throw new y1;k!==IZ&&(yield k),l.shift(),C()}await new Fwt(k=>{d=k})}}finally{g=!0,m&&(m(),m=null)}}.call(this)}function t_n(e=void 0){return e!=null&&jD(e,"options"),(e==null?void 0:e.signal)!=null&&LD(e.signal,"options.signal"),async function*(){let r=0;for await(let a of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new y1({cause:e.signal.reason});yield[r++,a]}}.call(this)}async function Mwt(e,t=void 0){for await(let r of ISe.call(this,e,t))return!0;return!1}async function r_n(e,t=void 0){if(typeof e!="function")throw new v5("fn",["Function","AsyncFunction"],e);return!await Mwt.call(this,async(...r)=>!await e(...r),t)}async function n_n(e,t){for await(let r of ISe.call(this,e,t))return r}async function i_n(e,t){if(typeof e!="function")throw new v5("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a),IZ}for await(let n of kZ.call(this,r,t));}function ISe(e,t){if(typeof e!="function")throw new v5("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a)?n:IZ}return kZ.call(this,r,t)}var _Se=class extends jCn{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function s_n(e,t,r){var n;if(typeof e!="function")throw new v5("reducer",["Function","AsyncFunction"],e);r!=null&&jD(r,"options"),(r==null?void 0:r.signal)!=null&&LD(r.signal,"options.signal");let a=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let d=new y1(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await zCn(this.destroy(d)),d}let s=new QCn,c=s.signal;if(r!=null&&r.signal){let d={once:!0,[qCn]:this,[UCn]:!0};r.signal.addEventListener("abort",()=>s.abort(),d)}let l=!1;try{for await(let d of this){var f;if(l=!0,r!=null&&(f=r.signal)!==null&&f!==void 0&&f.aborted)throw new y1;a?t=await e(t,d,{signal:c}):(t=d,a=!0)}if(!l&&!a)throw new _Se}finally{s.abort()}return t}async function a_n(e){e!=null&&jD(e,"options"),(e==null?void 0:e.signal)!=null&&LD(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new y1(void 0,{cause:e.signal.reason});YCn(t,n)}return t}function o_n(e,t){let r=kZ.call(this,e,t);return async function*(){for await(let a of r)yield*a}.call(this)}function qwt(e){if(e=KCn(e),XCn(e))return 0;if(e<0)throw new MCn("number",">= 0",e);return e}function c_n(e,t=void 0){return t!=null&&jD(t,"options"),(t==null?void 0:t.signal)!=null&&LD(t.signal,"options.signal"),e=qwt(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new y1;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new y1;e--<=0&&(yield s)}}.call(this)}function u_n(e,t=void 0){return t!=null&&jD(t,"options"),(t==null?void 0:t.signal)!=null&&LD(t.signal,"options.signal"),e=qwt(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new y1;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new y1;if(e-- >0&&(yield s),e<=0)return}}.call(this)}kSe.exports.streamReturningOperators={asIndexedPairs:GCn(t_n,"readable.asIndexedPairs will be removed in a future version."),drop:c_n,filter:ISe,flatMap:o_n,map:kZ,take:u_n,compose:e_n};kSe.exports.promiseReturningOperators={every:r_n,forEach:i_n,reduce:s_n,toArray:a_n,some:Mwt,find:n_n}});var TSe=P((xbi,zwt)=>{"use strict";var{ArrayPrototypePop:l_n,Promise:p_n}=Hu(),{isIterable:f_n,isNodeStream:d_n,isWebStream:h_n}=m1(),{pipelineImpl:m_n}=SZ(),{finished:g_n}=ES();BSe();function A_n(...e){return new p_n((t,r)=>{let n,a,s=e[e.length-1];if(s&&typeof s=="object"&&!d_n(s)&&!f_n(s)&&!h_n(s)){let c=l_n(e);n=c.signal,a=c.end}m_n(e,(c,l)=>{c?r(c):t(l)},{signal:n,end:a})})}zwt.exports={finished:g_n,pipeline:A_n}});var BSe=P((bbi,Xwt)=>{"use strict";var{Buffer:y_n}=require("buffer"),{ObjectDefineProperty:CS,ObjectKeys:$wt,ReflectApply:Wwt}=Hu(),{promisify:{custom:Gwt}}=Mm(),{streamReturningOperators:Hwt,promiseReturningOperators:Vwt}=Uwt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Ywt}}=Bh(),v_n=CSe(),{setDefaultHighWaterMark:x_n,getDefaultHighWaterMark:b_n}=u5(),{pipeline:Jwt}=SZ(),{destroyer:E_n}=RD(),Kwt=ES(),DSe=TSe(),x5=m1(),wu=Xwt.exports=cZ().Stream;wu.isDestroyed=x5.isDestroyed;wu.isDisturbed=x5.isDisturbed;wu.isErrored=x5.isErrored;wu.isReadable=x5.isReadable;wu.isWritable=x5.isWritable;wu.Readable=d5();for(let e of $wt(Hwt)){let r=function(...n){if(new.target)throw Ywt();return wu.Readable.from(Wwt(t,this,n))},t=Hwt[e];CS(r,"name",{__proto__:null,value:t.name}),CS(r,"length",{__proto__:null,value:t.length}),CS(wu.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of $wt(Vwt)){let r=function(...n){if(new.target)throw Ywt();return Wwt(t,this,n)},t=Vwt[e];CS(r,"name",{__proto__:null,value:t.name}),CS(r,"length",{__proto__:null,value:t.length}),CS(wu.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}wu.Writable=xZ();wu.Duplex=A1();wu.Transform=fSe();wu.PassThrough=hSe();wu.pipeline=Jwt;var{addAbortSignal:w_n}=c5();wu.addAbortSignal=w_n;wu.finished=Kwt;wu.destroy=E_n;wu.compose=v_n;wu.setDefaultHighWaterMark=x_n;wu.getDefaultHighWaterMark=b_n;CS(wu,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return DSe}});CS(Jwt,Gwt,{__proto__:null,enumerable:!0,get(){return DSe.pipeline}});CS(Kwt,Gwt,{__proto__:null,enumerable:!0,get(){return DSe.finished}});wu.Stream=wu;wu._isUint8Array=function(t){return t instanceof Uint8Array};wu._uint8ArrayToBuffer=function(t){return y_n.from(t.buffer,t.byteOffset,t.byteLength)}});var Zwt=P((Ebi,Ta)=>{"use strict";var nf=require("stream");if(nf&&process.env.READABLE_STREAM==="disable"){let e=nf.promises;Ta.exports._uint8ArrayToBuffer=nf._uint8ArrayToBuffer,Ta.exports._isUint8Array=nf._isUint8Array,Ta.exports.isDisturbed=nf.isDisturbed,Ta.exports.isErrored=nf.isErrored,Ta.exports.isReadable=nf.isReadable,Ta.exports.Readable=nf.Readable,Ta.exports.Writable=nf.Writable,Ta.exports.Duplex=nf.Duplex,Ta.exports.Transform=nf.Transform,Ta.exports.PassThrough=nf.PassThrough,Ta.exports.addAbortSignal=nf.addAbortSignal,Ta.exports.finished=nf.finished,Ta.exports.destroy=nf.destroy,Ta.exports.pipeline=nf.pipeline,Ta.exports.compose=nf.compose,Object.defineProperty(nf,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Ta.exports.Stream=nf.Stream}else{let e=BSe(),t=TSe(),r=e.Readable.destroy;Ta.exports=e.Readable,Ta.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,Ta.exports._isUint8Array=e._isUint8Array,Ta.exports.isDisturbed=e.isDisturbed,Ta.exports.isErrored=e.isErrored,Ta.exports.isReadable=e.isReadable,Ta.exports.Readable=e.Readable,Ta.exports.Writable=e.Writable,Ta.exports.Duplex=e.Duplex,Ta.exports.Transform=e.Transform,Ta.exports.PassThrough=e.PassThrough,Ta.exports.addAbortSignal=e.addAbortSignal,Ta.exports.finished=e.finished,Ta.exports.destroy=e.destroy,Ta.exports.destroy=r,Ta.exports.pipeline=e.pipeline,Ta.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),Ta.exports.Stream=e.Stream}Ta.exports.default=Ta.exports});var a2t=P(RZ=>{"use strict";Object.defineProperty(RZ,"__esModule",{value:!0});RZ.LRUCache=void 0;var iQ=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r2t=new Set,PSe=typeof process=="object"&&process?process:{},n2t=(e,t,r,n)=>{typeof PSe.emitWarning=="function"?PSe.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},DZ=globalThis.AbortController,e2t=globalThis.AbortSignal,t2t;if(typeof DZ>"u"){e2t=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,a){this._onabort.push(a)}},DZ=class{constructor(){t()}signal=new e2t;abort(n){var a,s;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let c of this.signal._onabort)c(n);(s=(a=this.signal).onabort)==null||s.call(a,n)}}};let e=((t2t=PSe.env)==null?void 0:t2t.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,n2t("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var S_n=e=>!r2t.has(e),Cbi=Symbol("type"),kI=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),i2t=e=>kI(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?sQ:null:null,sQ=class extends Array{constructor(t){super(t),this.fill(0)}},RSe=class e{heap;length;static#e=!1;static create(t){let r=i2t(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Yx,pA,Jx,Kx,aQ,oQ,sf,Xx,Pp,Cu,Ts,qm,fA,Ph,$f,Zx,Wf,eb,tb,dA,rb,PI,Um,E5,FSe,MD,_S,w5,hA,PZ,s2t,qD,cQ,S5,v1,TI,x1,BI,C5,OSe,C_n,uQ,TZ,lQ,BZ,qc,Su,_5,QSe,UD,b5,b1,DI,I5,LSe,jSe=class jSe{constructor(t){nr(this,E5);nr(this,PZ);nr(this,v1);nr(this,x1);nr(this,C5);nr(this,uQ);nr(this,lQ);nr(this,qc);nr(this,_5);nr(this,UD);nr(this,b1);nr(this,I5);nr(this,Yx,void 0);nr(this,pA,void 0);nr(this,Jx,void 0);nr(this,Kx,void 0);nr(this,aQ,void 0);nr(this,oQ,void 0);Ps(this,"ttl");Ps(this,"ttlResolution");Ps(this,"ttlAutopurge");Ps(this,"updateAgeOnGet");Ps(this,"updateAgeOnHas");Ps(this,"allowStale");Ps(this,"noDisposeOnSet");Ps(this,"noUpdateTTL");Ps(this,"maxEntrySize");Ps(this,"sizeCalculation");Ps(this,"noDeleteOnFetchRejection");Ps(this,"noDeleteOnStaleGet");Ps(this,"allowStaleOnFetchAbort");Ps(this,"allowStaleOnFetchRejection");Ps(this,"ignoreFetchAbort");nr(this,sf,void 0);nr(this,Xx,void 0);nr(this,Pp,void 0);nr(this,Cu,void 0);nr(this,Ts,void 0);nr(this,qm,void 0);nr(this,fA,void 0);nr(this,Ph,void 0);nr(this,$f,void 0);nr(this,Zx,void 0);nr(this,Wf,void 0);nr(this,eb,void 0);nr(this,tb,void 0);nr(this,dA,void 0);nr(this,rb,void 0);nr(this,PI,void 0);nr(this,Um,void 0);nr(this,MD,()=>{});nr(this,_S,()=>{});nr(this,w5,()=>{});nr(this,hA,()=>!1);nr(this,qD,t=>{});nr(this,cQ,(t,r,n)=>{});nr(this,S5,(t,r,n,a)=>{if(n||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ps(this,C_n,"LRUCache");let{max:r=0,ttl:n,ttlResolution:a=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:f,dispose:d,disposeAfter:m,noDisposeOnSet:g,noUpdateTTL:x,maxSize:b=0,maxEntrySize:A=0,sizeCalculation:C,fetchMethod:I,memoMethod:k,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:j,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:W,ignoreFetchAbort:se}=t;if(r!==0&&!kI(r))throw new TypeError("max option must be a nonnegative integer");let X=r?i2t(r):Array;if(!X)throw new Error("invalid max value: "+r);if(Qt(this,Yx,r),Qt(this,pA,b),this.maxEntrySize=A||re(this,pA),this.sizeCalculation=C,this.sizeCalculation){if(!re(this,pA)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(Qt(this,oQ,k),I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(Qt(this,aQ,I),Qt(this,PI,!!I),Qt(this,Pp,new Map),Qt(this,Cu,new Array(r).fill(void 0)),Qt(this,Ts,new Array(r).fill(void 0)),Qt(this,qm,new X(r)),Qt(this,fA,new X(r)),Qt(this,Ph,0),Qt(this,$f,0),Qt(this,Zx,RSe.create(r)),Qt(this,sf,0),Qt(this,Xx,0),typeof d=="function"&&Qt(this,Jx,d),typeof m=="function"?(Qt(this,Kx,m),Qt(this,Wf,[])):(Qt(this,Kx,void 0),Qt(this,Wf,void 0)),Qt(this,rb,!!re(this,Jx)),Qt(this,Um,!!re(this,Kx)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!W,this.ignoreFetchAbort=!!se,this.maxEntrySize!==0){if(re(this,pA)!==0&&!kI(re(this,pA)))throw new TypeError("maxSize must be a positive integer if specified");if(!kI(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");yr(this,PZ,s2t).call(this)}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!j,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=kI(a)||a===0?a:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!kI(this.ttl))throw new TypeError("ttl must be a positive integer if specified");yr(this,E5,FSe).call(this)}if(re(this,Yx)===0&&this.ttl===0&&re(this,pA)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!re(this,Yx)&&!re(this,pA)){let ve="LRU_CACHE_UNBOUNDED";S_n(ve)&&(r2t.add(ve),n2t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ve,jSe))}}static unsafeExposeInternals(t){return{starts:re(t,tb),ttls:re(t,dA),sizes:re(t,eb),keyMap:re(t,Pp),keyList:re(t,Cu),valList:re(t,Ts),next:re(t,qm),prev:re(t,fA),get head(){return re(t,Ph)},get tail(){return re(t,$f)},free:re(t,Zx),isBackgroundFetch:r=>{var n;return yr(n=t,qc,Su).call(n,r)},backgroundFetch:(r,n,a,s)=>{var c;return yr(c=t,lQ,BZ).call(c,r,n,a,s)},moveToTail:r=>{var n;return yr(n=t,UD,b5).call(n,r)},indexes:r=>{var n;return yr(n=t,v1,TI).call(n,r)},rindexes:r=>{var n;return yr(n=t,x1,BI).call(n,r)},isStale:r=>{var n;return re(n=t,hA).call(n,r)}}}get max(){return re(this,Yx)}get maxSize(){return re(this,pA)}get calculatedSize(){return re(this,Xx)}get size(){return re(this,sf)}get fetchMethod(){return re(this,aQ)}get memoMethod(){return re(this,oQ)}get dispose(){return re(this,Jx)}get disposeAfter(){return re(this,Kx)}getRemainingTTL(t){return re(this,Pp).has(t)?1/0:0}*entries(){for(let t of yr(this,v1,TI).call(this))re(this,Ts)[t]!==void 0&&re(this,Cu)[t]!==void 0&&!yr(this,qc,Su).call(this,re(this,Ts)[t])&&(yield[re(this,Cu)[t],re(this,Ts)[t]])}*rentries(){for(let t of yr(this,x1,BI).call(this))re(this,Ts)[t]!==void 0&&re(this,Cu)[t]!==void 0&&!yr(this,qc,Su).call(this,re(this,Ts)[t])&&(yield[re(this,Cu)[t],re(this,Ts)[t]])}*keys(){for(let t of yr(this,v1,TI).call(this)){let r=re(this,Cu)[t];r!==void 0&&!yr(this,qc,Su).call(this,re(this,Ts)[t])&&(yield r)}}*rkeys(){for(let t of yr(this,x1,BI).call(this)){let r=re(this,Cu)[t];r!==void 0&&!yr(this,qc,Su).call(this,re(this,Ts)[t])&&(yield r)}}*values(){for(let t of yr(this,v1,TI).call(this))re(this,Ts)[t]!==void 0&&!yr(this,qc,Su).call(this,re(this,Ts)[t])&&(yield re(this,Ts)[t])}*rvalues(){for(let t of yr(this,x1,BI).call(this))re(this,Ts)[t]!==void 0&&!yr(this,qc,Su).call(this,re(this,Ts)[t])&&(yield re(this,Ts)[t])}[Symbol.iterator](){return this.entries()}find(t,r={}){for(let n of yr(this,v1,TI).call(this)){let a=re(this,Ts)[n],s=yr(this,qc,Su).call(this,a)?a.__staleWhileFetching:a;if(s!==void 0&&t(s,re(this,Cu)[n],this))return this.get(re(this,Cu)[n],r)}}forEach(t,r=this){for(let n of yr(this,v1,TI).call(this)){let a=re(this,Ts)[n],s=yr(this,qc,Su).call(this,a)?a.__staleWhileFetching:a;s!==void 0&&t.call(r,s,re(this,Cu)[n],this)}}rforEach(t,r=this){for(let n of yr(this,x1,BI).call(this)){let a=re(this,Ts)[n],s=yr(this,qc,Su).call(this,a)?a.__staleWhileFetching:a;s!==void 0&&t.call(r,s,re(this,Cu)[n],this)}}purgeStale(){let t=!1;for(let r of yr(this,x1,BI).call(this,{allowStale:!0}))re(this,hA).call(this,r)&&(yr(this,b1,DI).call(this,re(this,Cu)[r],"expire"),t=!0);return t}info(t){let r=re(this,Pp).get(t);if(r===void 0)return;let n=re(this,Ts)[r],a=yr(this,qc,Su).call(this,n)?n.__staleWhileFetching:n;if(a===void 0)return;let s={value:a};if(re(this,dA)&&re(this,tb)){let c=re(this,dA)[r],l=re(this,tb)[r];if(c&&l){let f=c-(iQ.now()-l);s.ttl=f,s.start=Date.now()}}return re(this,eb)&&(s.size=re(this,eb)[r]),s}dump(){let t=[];for(let r of yr(this,v1,TI).call(this,{allowStale:!0})){let n=re(this,Cu)[r],a=re(this,Ts)[r],s=yr(this,qc,Su).call(this,a)?a.__staleWhileFetching:a;if(s===void 0||n===void 0)continue;let c={value:s};if(re(this,dA)&&re(this,tb)){c.ttl=re(this,dA)[r];let l=iQ.now()-re(this,tb)[r];c.start=Math.floor(Date.now()-l)}re(this,eb)&&(c.size=re(this,eb)[r]),t.unshift([n,c])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let a=Date.now()-n.start;n.start=iQ.now()-a}this.set(r,n.value,n)}}set(t,r,n={}){var x,b,A,C,I;if(r===void 0)return this.delete(t),this;let{ttl:a=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:f}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,m=re(this,S5).call(this,t,r,n.size||0,l);if(this.maxEntrySize&&m>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),yr(this,b1,DI).call(this,t,"set"),this;let g=re(this,sf)===0?void 0:re(this,Pp).get(t);if(g===void 0)g=re(this,sf)===0?re(this,$f):re(this,Zx).length!==0?re(this,Zx).pop():re(this,sf)===re(this,Yx)?yr(this,uQ,TZ).call(this,!1):re(this,sf),re(this,Cu)[g]=t,re(this,Ts)[g]=r,re(this,Pp).set(t,g),re(this,qm)[re(this,$f)]=g,re(this,fA)[g]=re(this,$f),Qt(this,$f,g),A7(this,sf)._++,re(this,cQ).call(this,g,m,f),f&&(f.set="add"),d=!1;else{yr(this,UD,b5).call(this,g);let k=re(this,Ts)[g];if(r!==k){if(re(this,PI)&&yr(this,qc,Su).call(this,k)){k.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:O}=k;O!==void 0&&!c&&(re(this,rb)&&((x=re(this,Jx))==null||x.call(this,O,t,"set")),re(this,Um)&&((b=re(this,Wf))==null||b.push([O,t,"set"])))}else c||(re(this,rb)&&((A=re(this,Jx))==null||A.call(this,k,t,"set")),re(this,Um)&&((C=re(this,Wf))==null||C.push([k,t,"set"])));if(re(this,qD).call(this,g),re(this,cQ).call(this,g,m,f),re(this,Ts)[g]=r,f){f.set="replace";let O=k&&yr(this,qc,Su).call(this,k)?k.__staleWhileFetching:k;O!==void 0&&(f.oldValue=O)}}else f&&(f.set="update")}if(a!==0&&!re(this,dA)&&yr(this,E5,FSe).call(this),re(this,dA)&&(d||re(this,w5).call(this,g,a,s),f&&re(this,_S).call(this,f,g)),!c&&re(this,Um)&&re(this,Wf)){let k=re(this,Wf),O;for(;O=k==null?void 0:k.shift();)(I=re(this,Kx))==null||I.call(this,...O)}return this}pop(){var t;try{for(;re(this,sf);){let r=re(this,Ts)[re(this,Ph)];if(yr(this,uQ,TZ).call(this,!0),yr(this,qc,Su).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(re(this,Um)&&re(this,Wf)){let r=re(this,Wf),n;for(;n=r==null?void 0:r.shift();)(t=re(this,Kx))==null||t.call(this,...n)}}}has(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:a}=r,s=re(this,Pp).get(t);if(s!==void 0){let c=re(this,Ts)[s];if(yr(this,qc,Su).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(re(this,hA).call(this,s))a&&(a.has="stale",re(this,_S).call(this,a,s));else return n&&re(this,MD).call(this,s),a&&(a.has="hit",re(this,_S).call(this,a,s)),!0}else a&&(a.has="miss");return!1}peek(t,r={}){let{allowStale:n=this.allowStale}=r,a=re(this,Pp).get(t);if(a===void 0||!n&&re(this,hA).call(this,a))return;let s=re(this,Ts)[a];return yr(this,qc,Su).call(this,s)?s.__staleWhileFetching:s}async fetch(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:f=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:C,forceRefresh:I=!1,status:k,signal:O}=r;if(!re(this,PI))return k&&(k.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:a,noDeleteOnStaleGet:s,status:k});let j={allowStale:n,updateAgeOnGet:a,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:f,sizeCalculation:d,noUpdateTTL:m,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:A,ignoreFetchAbort:b,status:k,signal:O},M=re(this,Pp).get(t);if(M===void 0){k&&(k.fetch="miss");let W=yr(this,lQ,BZ).call(this,t,M,j,C);return W.__returned=W}else{let W=re(this,Ts)[M];if(yr(this,qc,Su).call(this,W)){let he=n&&W.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",he&&(k.returnedStale=!0)),he?W.__staleWhileFetching:W.__returned=W}let se=re(this,hA).call(this,M);if(!I&&!se)return k&&(k.fetch="hit"),yr(this,UD,b5).call(this,M),a&&re(this,MD).call(this,M),k&&re(this,_S).call(this,k,M),W;let X=yr(this,lQ,BZ).call(this,t,M,j,C),ae=X.__staleWhileFetching!==void 0&&n;return k&&(k.fetch=se?"stale":"refresh",ae&&se&&(k.returnedStale=!0)),ae?X.__staleWhileFetching:X.__returned=X}}async forceFetch(t,r={}){let n=await this.fetch(t,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(t,r={}){let n=re(this,oQ);if(!n)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:s,...c}=r,l=this.get(t,c);if(!s&&l!==void 0)return l;let f=n(t,l,{options:c,context:a});return this.set(t,f,c),f}get(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=re(this,Pp).get(t);if(l!==void 0){let f=re(this,Ts)[l],d=yr(this,qc,Su).call(this,f);return c&&re(this,_S).call(this,c,l),re(this,hA).call(this,l)?(c&&(c.get="stale"),d?(c&&n&&f.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?f.__staleWhileFetching:void 0):(s||yr(this,b1,DI).call(this,t,"expire"),c&&n&&(c.returnedStale=!0),n?f:void 0)):(c&&(c.get="hit"),d?f.__staleWhileFetching:(yr(this,UD,b5).call(this,l),a&&re(this,MD).call(this,l),f))}else c&&(c.get="miss")}delete(t){return yr(this,b1,DI).call(this,t,"delete")}clear(){return yr(this,I5,LSe).call(this,"delete")}};C_n=Symbol.toStringTag,Yx=new WeakMap,pA=new WeakMap,Jx=new WeakMap,Kx=new WeakMap,aQ=new WeakMap,oQ=new WeakMap,sf=new WeakMap,Xx=new WeakMap,Pp=new WeakMap,Cu=new WeakMap,Ts=new WeakMap,qm=new WeakMap,fA=new WeakMap,Ph=new WeakMap,$f=new WeakMap,Zx=new WeakMap,Wf=new WeakMap,eb=new WeakMap,tb=new WeakMap,dA=new WeakMap,rb=new WeakMap,PI=new WeakMap,Um=new WeakMap,E5=new WeakSet,FSe=function(){let t=new sQ(re(this,Yx)),r=new sQ(re(this,Yx));Qt(this,dA,t),Qt(this,tb,r),Qt(this,w5,(s,c,l=iQ.now())=>{if(r[s]=c!==0?l:0,t[s]=c,c!==0&&this.ttlAutopurge){let f=setTimeout(()=>{re(this,hA).call(this,s)&&yr(this,b1,DI).call(this,re(this,Cu)[s],"expire")},c+1);f.unref&&f.unref()}}),Qt(this,MD,s=>{r[s]=t[s]!==0?iQ.now():0}),Qt(this,_S,(s,c)=>{if(t[c]){let l=t[c],f=r[c];if(!l||!f)return;s.ttl=l,s.start=f,s.now=n||a();let d=s.now-f;s.remainingTTL=l-d}});let n=0,a=()=>{let s=iQ.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s};this.getRemainingTTL=s=>{let c=re(this,Pp).get(s);if(c===void 0)return 0;let l=t[c],f=r[c];if(!l||!f)return 1/0;let d=(n||a())-f;return l-d},Qt(this,hA,s=>{let c=r[s],l=t[s];return!!l&&!!c&&(n||a())-c>l})},MD=new WeakMap,_S=new WeakMap,w5=new WeakMap,hA=new WeakMap,PZ=new WeakSet,s2t=function(){let t=new sQ(re(this,Yx));Qt(this,Xx,0),Qt(this,eb,t),Qt(this,qD,r=>{Qt(this,Xx,re(this,Xx)-t[r]),t[r]=0}),Qt(this,S5,(r,n,a,s)=>{if(yr(this,qc,Su).call(this,n))return 0;if(!kI(a))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(a=s(n,r),!kI(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),Qt(this,cQ,(r,n,a)=>{if(t[r]=n,re(this,pA)){let s=re(this,pA)-t[r];for(;re(this,Xx)>s;)yr(this,uQ,TZ).call(this,!0)}Qt(this,Xx,re(this,Xx)+t[r]),a&&(a.entrySize=n,a.totalCalculatedSize=re(this,Xx))})},qD=new WeakMap,cQ=new WeakMap,S5=new WeakMap,v1=new WeakSet,TI=function*({allowStale:t=this.allowStale}={}){if(re(this,sf))for(let r=re(this,$f);!(!yr(this,C5,OSe).call(this,r)||((t||!re(this,hA).call(this,r))&&(yield r),r===re(this,Ph)));)r=re(this,fA)[r]},x1=new WeakSet,BI=function*({allowStale:t=this.allowStale}={}){if(re(this,sf))for(let r=re(this,Ph);!(!yr(this,C5,OSe).call(this,r)||((t||!re(this,hA).call(this,r))&&(yield r),r===re(this,$f)));)r=re(this,qm)[r]},C5=new WeakSet,OSe=function(t){return t!==void 0&&re(this,Pp).get(re(this,Cu)[t])===t},uQ=new WeakSet,TZ=function(t){var s,c;let r=re(this,Ph),n=re(this,Cu)[r],a=re(this,Ts)[r];return re(this,PI)&&yr(this,qc,Su).call(this,a)?a.__abortController.abort(new Error("evicted")):(re(this,rb)||re(this,Um))&&(re(this,rb)&&((s=re(this,Jx))==null||s.call(this,a,n,"evict")),re(this,Um)&&((c=re(this,Wf))==null||c.push([a,n,"evict"]))),re(this,qD).call(this,r),t&&(re(this,Cu)[r]=void 0,re(this,Ts)[r]=void 0,re(this,Zx).push(r)),re(this,sf)===1?(Qt(this,Ph,Qt(this,$f,0)),re(this,Zx).length=0):Qt(this,Ph,re(this,qm)[r]),re(this,Pp).delete(n),A7(this,sf)._--,r},lQ=new WeakSet,BZ=function(t,r,n,a){let s=r===void 0?void 0:re(this,Ts)[r];if(yr(this,qc,Su).call(this,s))return s;let c=new DZ,{signal:l}=n;l==null||l.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let f={signal:c.signal,options:n,context:a},d=(C,I=!1)=>{let{aborted:k}=c.signal,O=n.ignoreFetchAbort&&C!==void 0;if(n.status&&(k&&!I?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,O&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),k&&!O&&!I)return g(c.signal.reason);let j=b;return re(this,Ts)[r]===b&&(C===void 0?j.__staleWhileFetching?re(this,Ts)[r]=j.__staleWhileFetching:yr(this,b1,DI).call(this,t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(t,C,f.options))),C},m=C=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=C),g(C)),g=C=>{let{aborted:I}=c.signal,k=I&&n.allowStaleOnFetchAbort,O=k||n.allowStaleOnFetchRejection,j=O||n.noDeleteOnFetchRejection,M=b;if(re(this,Ts)[r]===b&&(!j||M.__staleWhileFetching===void 0?yr(this,b1,DI).call(this,t,"fetch"):k||(re(this,Ts)[r]=M.__staleWhileFetching)),O)return n.status&&M.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw C},x=(C,I)=>{var O;let k=(O=re(this,aQ))==null?void 0:O.call(this,t,s,f);k&&k instanceof Promise&&k.then(j=>C(j===void 0?void 0:j),I),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(C(void 0),n.allowStaleOnFetchAbort&&(C=j=>d(j,!0)))})};n.status&&(n.status.fetchDispatched=!0);let b=new Promise(x).then(d,m),A=Object.assign(b,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(t,A,{...f.options,status:void 0}),r=re(this,Pp).get(t)):re(this,Ts)[r]=A,A},qc=new WeakSet,Su=function(t){if(!re(this,PI))return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof DZ},_5=new WeakSet,QSe=function(t,r){re(this,fA)[r]=t,re(this,qm)[t]=r},UD=new WeakSet,b5=function(t){t!==re(this,$f)&&(t===re(this,Ph)?Qt(this,Ph,re(this,qm)[t]):yr(this,_5,QSe).call(this,re(this,fA)[t],re(this,qm)[t]),yr(this,_5,QSe).call(this,re(this,$f),t),Qt(this,$f,t))},b1=new WeakSet,DI=function(t,r){var a,s,c,l;let n=!1;if(re(this,sf)!==0){let f=re(this,Pp).get(t);if(f!==void 0)if(n=!0,re(this,sf)===1)yr(this,I5,LSe).call(this,r);else{re(this,qD).call(this,f);let d=re(this,Ts)[f];if(yr(this,qc,Su).call(this,d)?d.__abortController.abort(new Error("deleted")):(re(this,rb)||re(this,Um))&&(re(this,rb)&&((a=re(this,Jx))==null||a.call(this,d,t,r)),re(this,Um)&&((s=re(this,Wf))==null||s.push([d,t,r]))),re(this,Pp).delete(t),re(this,Cu)[f]=void 0,re(this,Ts)[f]=void 0,f===re(this,$f))Qt(this,$f,re(this,fA)[f]);else if(f===re(this,Ph))Qt(this,Ph,re(this,qm)[f]);else{let m=re(this,fA)[f];re(this,qm)[m]=re(this,qm)[f];let g=re(this,qm)[f];re(this,fA)[g]=re(this,fA)[f]}A7(this,sf)._--,re(this,Zx).push(f)}}if(re(this,Um)&&((c=re(this,Wf))!=null&&c.length)){let f=re(this,Wf),d;for(;d=f==null?void 0:f.shift();)(l=re(this,Kx))==null||l.call(this,...d)}return n},I5=new WeakSet,LSe=function(t){var r,n,a;for(let s of yr(this,x1,BI).call(this,{allowStale:!0})){let c=re(this,Ts)[s];if(yr(this,qc,Su).call(this,c))c.__abortController.abort(new Error("deleted"));else{let l=re(this,Cu)[s];re(this,rb)&&((r=re(this,Jx))==null||r.call(this,c,l,t)),re(this,Um)&&((n=re(this,Wf))==null||n.push([c,l,t]))}}if(re(this,Pp).clear(),re(this,Ts).fill(void 0),re(this,Cu).fill(void 0),re(this,dA)&&re(this,tb)&&(re(this,dA).fill(0),re(this,tb).fill(0)),re(this,eb)&&re(this,eb).fill(0),Qt(this,Ph,0),Qt(this,$f,0),re(this,Zx).length=0,Qt(this,Xx,0),Qt(this,sf,0),re(this,Um)&&re(this,Wf)){let s=re(this,Wf),c;for(;c=s==null?void 0:s.shift();)(a=re(this,Kx))==null||a.call(this,...c)}};var NSe=jSe;RZ.LRUCache=NSe});var WSe=P(Hm=>{"use strict";var __n=Hm&&Hm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hm,"__esModule",{value:!0});Hm.Minipass=Hm.isWritable=Hm.isReadable=Hm.isStream=void 0;var o2t=typeof process=="object"&&process?process:{stdout:null,stderr:null},$Se=require("events"),p2t=__n(require("stream")),I_n=require("string_decoder"),k_n=e=>!!e&&typeof e=="object"&&(e instanceof MZ||e instanceof p2t.default||(0,Hm.isReadable)(e)||(0,Hm.isWritable)(e));Hm.isStream=k_n;var T_n=e=>!!e&&typeof e=="object"&&e instanceof $Se.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==p2t.default.Writable.prototype.pipe;Hm.isReadable=T_n;var B_n=e=>!!e&&typeof e=="object"&&e instanceof $Se.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function";Hm.isWritable=B_n;var IS=Symbol("EOF"),kS=Symbol("maybeEmitEnd"),RI=Symbol("emittedEnd"),NZ=Symbol("emittingEnd"),k5=Symbol("emittedError"),FZ=Symbol("closed"),c2t=Symbol("read"),OZ=Symbol("flush"),u2t=Symbol("flushChunk"),nb=Symbol("encoding"),pQ=Symbol("decoder"),Gf=Symbol("flowing"),T5=Symbol("paused"),fQ=Symbol("resume"),Yf=Symbol("buffer"),zm=Symbol("pipes"),Jf=Symbol("bufferLength"),MSe=Symbol("bufferPush"),QZ=Symbol("bufferShift"),Rh=Symbol("objectMode"),pp=Symbol("destroyed"),qSe=Symbol("error"),USe=Symbol("emitData"),l2t=Symbol("emitEnd"),zSe=Symbol("emitEnd2"),E1=Symbol("async"),HSe=Symbol("abort"),LZ=Symbol("aborted"),B5=Symbol("signal"),zD=Symbol("dataListeners"),mA=Symbol("discarded"),D5=e=>Promise.resolve().then(e),D_n=e=>e(),P_n=e=>e==="end"||e==="finish"||e==="prefinish",R_n=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,N_n=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),jZ=class{src;dest;opts;ondrain;constructor(t,r,n){this.src=t,this.dest=r,this.opts=n,this.ondrain=()=>t[fQ](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},VSe=class extends jZ{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,r,n){super(t,r,n),this.proxyErrors=a=>r.emit("error",a),t.on("error",this.proxyErrors)}},F_n=e=>!!e.objectMode,O_n=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",MZ=class extends $Se.EventEmitter{[Gf]=!1;[T5]=!1;[zm]=[];[Yf]=[];[Rh];[nb];[E1];[pQ];[IS]=!1;[RI]=!1;[NZ]=!1;[FZ]=!1;[k5]=null;[Jf]=0;[pp]=!1;[B5];[LZ]=!1;[zD]=0;[mA]=!1;writable=!0;readable=!0;constructor(...t){let r=t[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");F_n(r)?(this[Rh]=!0,this[nb]=null):O_n(r)?(this[nb]=r.encoding,this[Rh]=!1):(this[Rh]=!1,this[nb]=null),this[E1]=!!r.async,this[pQ]=this[nb]?new I_n.StringDecoder(this[nb]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Yf]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[zm]});let{signal:n}=r;n&&(this[B5]=n,n.aborted?this[HSe]():n.addEventListener("abort",()=>this[HSe]()))}get bufferLength(){return this[Jf]}get encoding(){return this[nb]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Rh]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[E1]}set async(t){this[E1]=this[E1]||!!t}[HSe](){var t,r;this[LZ]=!0,this.emit("abort",(t=this[B5])==null?void 0:t.reason),this.destroy((r=this[B5])==null?void 0:r.reason)}get aborted(){return this[LZ]}set aborted(t){}write(t,r,n){var s;if(this[LZ])return!1;if(this[IS])throw new Error("write after end");if(this[pp])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let a=this[E1]?D5:D_n;if(!this[Rh]&&!Buffer.isBuffer(t)){if(N_n(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(R_n(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Rh]?(this[Gf]&&this[Jf]!==0&&this[OZ](!0),this[Gf]?this.emit("data",t):this[MSe](t),this[Jf]!==0&&this.emit("readable"),n&&a(n),this[Gf]):t.length?(typeof t=="string"&&!(r===this[nb]&&!((s=this[pQ])!=null&&s.lastNeed))&&(t=Buffer.from(t,r)),Buffer.isBuffer(t)&&this[nb]&&(t=this[pQ].write(t)),this[Gf]&&this[Jf]!==0&&this[OZ](!0),this[Gf]?this.emit("data",t):this[MSe](t),this[Jf]!==0&&this.emit("readable"),n&&a(n),this[Gf]):(this[Jf]!==0&&this.emit("readable"),n&&a(n),this[Gf])}read(t){if(this[pp])return null;if(this[mA]=!1,this[Jf]===0||t===0||t&&t>this[Jf])return this[kS](),null;this[Rh]&&(t=null),this[Yf].length>1&&!this[Rh]&&(this[Yf]=[this[nb]?this[Yf].join(""):Buffer.concat(this[Yf],this[Jf])]);let r=this[c2t](t||null,this[Yf][0]);return this[kS](),r}[c2t](t,r){if(this[Rh])this[QZ]();else{let n=r;t===n.length||t===null?this[QZ]():typeof n=="string"?(this[Yf][0]=n.slice(t),r=n.slice(0,t),this[Jf]-=t):(this[Yf][0]=n.subarray(t),r=n.subarray(0,t),this[Jf]-=t)}return this.emit("data",r),!this[Yf].length&&!this[IS]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r="utf8"),t!==void 0&&this.write(t,r),n&&this.once("end",n),this[IS]=!0,this.writable=!1,(this[Gf]||!this[T5])&&this[kS](),this}[fQ](){this[pp]||(!this[zD]&&!this[zm].length&&(this[mA]=!0),this[T5]=!1,this[Gf]=!0,this.emit("resume"),this[Yf].length?this[OZ]():this[IS]?this[kS]():this.emit("drain"))}resume(){return this[fQ]()}pause(){this[Gf]=!1,this[T5]=!0,this[mA]=!1}get destroyed(){return this[pp]}get flowing(){return this[Gf]}get paused(){return this[T5]}[MSe](t){this[Rh]?this[Jf]+=1:this[Jf]+=t.length,this[Yf].push(t)}[QZ](){return this[Rh]?this[Jf]-=1:this[Jf]-=this[Yf][0].length,this[Yf].shift()}[OZ](t=!1){do;while(this[u2t](this[QZ]())&&this[Yf].length);!t&&!this[Yf].length&&!this[IS]&&this.emit("drain")}[u2t](t){return this.emit("data",t),this[Gf]}pipe(t,r){if(this[pp])return t;this[mA]=!1;let n=this[RI];return r=r||{},t===o2t.stdout||t===o2t.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&t.end():(this[zm].push(r.proxyErrors?new VSe(this,t,r):new jZ(this,t,r)),this[E1]?D5(()=>this[fQ]()):this[fQ]()),t}unpipe(t){let r=this[zm].find(n=>n.dest===t);r&&(this[zm].length===1?(this[Gf]&&this[zD]===0&&(this[Gf]=!1),this[zm]=[]):this[zm].splice(this[zm].indexOf(r),1),r.unpipe())}addListener(t,r){return this.on(t,r)}on(t,r){let n=super.on(t,r);if(t==="data")this[mA]=!1,this[zD]++,!this[zm].length&&!this[Gf]&&this[fQ]();else if(t==="readable"&&this[Jf]!==0)super.emit("readable");else if(P_n(t)&&this[RI])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[k5]){let a=r;this[E1]?D5(()=>a.call(this,this[k5])):a.call(this,this[k5])}return n}removeListener(t,r){return this.off(t,r)}off(t,r){let n=super.off(t,r);return t==="data"&&(this[zD]=this.listeners("data").length,this[zD]===0&&!this[mA]&&!this[zm].length&&(this[Gf]=!1)),n}removeAllListeners(t){let r=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[zD]=0,!this[mA]&&!this[zm].length&&(this[Gf]=!1)),r}get emittedEnd(){return this[RI]}[kS](){!this[NZ]&&!this[RI]&&!this[pp]&&this[Yf].length===0&&this[IS]&&(this[NZ]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[FZ]&&this.emit("close"),this[NZ]=!1)}emit(t,...r){let n=r[0];if(t!=="error"&&t!=="close"&&t!==pp&&this[pp])return!1;if(t==="data")return!this[Rh]&&!n?!1:this[E1]?(D5(()=>this[USe](n)),!0):this[USe](n);if(t==="end")return this[l2t]();if(t==="close"){if(this[FZ]=!0,!this[RI]&&!this[pp])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(t==="error"){this[k5]=n,super.emit(qSe,n);let s=!this[B5]||this.listeners("error").length?super.emit("error",n):!1;return this[kS](),s}else if(t==="resume"){let s=super.emit("resume");return this[kS](),s}else if(t==="finish"||t==="prefinish"){let s=super.emit(t);return this.removeAllListeners(t),s}let a=super.emit(t,...r);return this[kS](),a}[USe](t){for(let n of this[zm])n.dest.write(t)===!1&&this.pause();let r=this[mA]?!1:super.emit("data",t);return this[kS](),r}[l2t](){return this[RI]?!1:(this[RI]=!0,this.readable=!1,this[E1]?(D5(()=>this[zSe]()),!0):this[zSe]())}[zSe](){if(this[pQ]){let r=this[pQ].end();if(r){for(let n of this[zm])n.dest.write(r);this[mA]||super.emit("data",r)}}for(let r of this[zm])r.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Rh]||(t.dataLength=0);let r=this.promise();return this.on("data",n=>{t.push(n),this[Rh]||(t.dataLength+=n.length)}),await r,t}async concat(){if(this[Rh])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[nb]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,r)=>{this.on(pp,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[mA]=!1;let t=!1,r=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return r();let a=this.read();if(a!==null)return Promise.resolve({done:!1,value:a});if(this[IS])return r();let s,c,l=g=>{this.off("data",f),this.off("end",d),this.off(pp,m),r(),c(g)},f=g=>{this.off("error",l),this.off("end",d),this.off(pp,m),this.pause(),s({value:g,done:!!this[IS]})},d=()=>{this.off("error",l),this.off("data",f),this.off(pp,m),r(),s({done:!0,value:void 0})},m=()=>l(new Error("stream destroyed"));return new Promise((g,x)=>{c=x,s=g,this.once(pp,m),this.once("error",l),this.once("end",d),this.once("data",f)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[mA]=!1;let t=!1,r=()=>(this.pause(),this.off(qSe,r),this.off(pp,r),this.off("end",r),t=!0,{done:!0,value:void 0}),n=()=>{if(t)return r();let a=this.read();return a===null?r():{done:!1,value:a}};return this.once("end",r),this.once(qSe,r),this.once(pp,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(t){if(this[pp])return t?this.emit("error",t):this.emit(pp),this;this[pp]=!0,this[mA]=!0,this[Yf].length=0,this[Jf]=0;let r=this;return typeof r.close=="function"&&!this[FZ]&&r.close(),t?this.emit("error",t):this.emit(pp),this}static get isStream(){return Hm.isStream}};Hm.Minipass=MZ});var B2t=P(ac=>{"use strict";var Q_n=ac&&ac.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),L_n=ac&&ac.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),j_n=ac&&ac.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Q_n(t,e,r);return L_n(t,e),t};Object.defineProperty(ac,"__esModule",{value:!0});ac.PathScurry=ac.Path=ac.PathScurryDarwin=ac.PathScurryPosix=ac.PathScurryWin32=ac.PathScurryBase=ac.PathPosix=ac.PathWin32=ac.PathBase=ac.ChildrenCache=ac.ResolveCache=void 0;var A2t=a2t(),GZ=require("path"),M_n=require("url"),R5=require("fs"),q_n=j_n(require("fs")),U_n=R5.realpathSync.native,qZ=require("fs/promises"),f2t=WSe(),N5={lstatSync:R5.lstatSync,readdir:R5.readdir,readdirSync:R5.readdirSync,readlinkSync:R5.readlinkSync,realpathSync:U_n,promises:{lstat:qZ.lstat,readdir:qZ.readdir,readlink:qZ.readlink,realpath:qZ.realpath}},y2t=e=>!e||e===N5||e===q_n?N5:{...N5,...e,promises:{...N5.promises,...e.promises||{}}},v2t=/^\\\\\?\\([a-z]:)\\?$/i,z_n=e=>e.replace(/\//g,"\\").replace(v2t,"$1\\"),H_n=/[\\\/]/,rv=0,x2t=1,b2t=2,w1=4,E2t=6,w2t=8,HD=10,S2t=12,tv=15,P5=~tv,GSe=16,d2t=32,F5=64,ib=128,UZ=256,HZ=512,h2t=F5|ib|HZ,V_n=1023,YSe=e=>e.isFile()?w2t:e.isDirectory()?w1:e.isSymbolicLink()?HD:e.isCharacterDevice()?b2t:e.isBlockDevice()?E2t:e.isSocket()?S2t:e.isFIFO()?x2t:rv,m2t=new Map,O5=e=>{let t=m2t.get(e);if(t)return t;let r=e.normalize("NFKD");return m2t.set(e,r),r},g2t=new Map,zZ=e=>{let t=g2t.get(e);if(t)return t;let r=O5(e.toLowerCase());return g2t.set(e,r),r},j5=class extends A2t.LRUCache{constructor(){super({max:256})}};ac.ResolveCache=j5;var YZ=class extends A2t.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:r=>r.length+1})}};ac.ChildrenCache=YZ;var C2t=Symbol("PathScurry setAsCwd"),Vm,V5,$5,W5,G5,Y5,J5,K5,X5,Z5,e9,t9,r9,n9,i9,s9,a9,o9,c9,NI,VD,S1,TS,BS,DS,Ss,$D,PS,C1,u9,JSe,dQ,VZ,WD,Q5,l9,KSe,p9,XSe,GD,L5,hQ,$Z,f9,ZSe,d9,eCe,mQ,WZ,KZ,_2t,XZ,I2t,ZZ,k2t,h9,tCe,gQ,AQ,eee,T2t,YD,Fd=class{constructor(t,r=rv,n,a,s,c,l){nr(this,u9);nr(this,dQ);nr(this,WD);nr(this,l9);nr(this,p9);nr(this,GD);nr(this,hQ);nr(this,f9);nr(this,d9);nr(this,mQ);nr(this,KZ);nr(this,XZ);nr(this,ZZ);nr(this,h9);nr(this,eee);Ps(this,"name");Ps(this,"root");Ps(this,"roots");Ps(this,"parent");Ps(this,"nocase");Ps(this,"isCWD",!1);nr(this,Vm,void 0);nr(this,V5,void 0);nr(this,$5,void 0);nr(this,W5,void 0);nr(this,G5,void 0);nr(this,Y5,void 0);nr(this,J5,void 0);nr(this,K5,void 0);nr(this,X5,void 0);nr(this,Z5,void 0);nr(this,e9,void 0);nr(this,t9,void 0);nr(this,r9,void 0);nr(this,n9,void 0);nr(this,i9,void 0);nr(this,s9,void 0);nr(this,a9,void 0);nr(this,o9,void 0);nr(this,c9,void 0);nr(this,NI,void 0);nr(this,VD,void 0);nr(this,S1,void 0);nr(this,TS,void 0);nr(this,BS,void 0);nr(this,DS,void 0);nr(this,Ss,void 0);nr(this,$D,void 0);nr(this,PS,void 0);nr(this,C1,void 0);nr(this,gQ,[]);nr(this,AQ,!1);nr(this,YD,void 0);this.name=t,Qt(this,NI,s?zZ(t):O5(t)),Qt(this,Ss,r&V_n),this.nocase=s,this.roots=a,this.root=n||this,Qt(this,$D,c),Qt(this,S1,l.fullpath),Qt(this,BS,l.relative),Qt(this,DS,l.relativePosix),this.parent=l.parent,this.parent?Qt(this,Vm,re(this.parent,Vm)):Qt(this,Vm,y2t(l.fs))}get dev(){return re(this,V5)}get mode(){return re(this,$5)}get nlink(){return re(this,W5)}get uid(){return re(this,G5)}get gid(){return re(this,Y5)}get rdev(){return re(this,J5)}get blksize(){return re(this,K5)}get ino(){return re(this,X5)}get size(){return re(this,Z5)}get blocks(){return re(this,e9)}get atimeMs(){return re(this,t9)}get mtimeMs(){return re(this,r9)}get ctimeMs(){return re(this,n9)}get birthtimeMs(){return re(this,i9)}get atime(){return re(this,s9)}get mtime(){return re(this,a9)}get ctime(){return re(this,o9)}get birthtime(){return re(this,c9)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return re(this,VD)!==void 0?re(this,VD):this.parent?Qt(this,VD,this.parent.depth()+1):Qt(this,VD,0)}childrenCache(){return re(this,$D)}resolve(t){var c;if(!t)return this;let r=this.getRootString(t),a=t.substring(r.length).split(this.splitSep);return r?yr(c=this.getRoot(r),u9,JSe).call(c,a):yr(this,u9,JSe).call(this,a)}children(){let t=re(this,$D).get(this);if(t)return t;let r=Object.assign([],{provisional:0});return re(this,$D).set(this,r),Qt(this,Ss,re(this,Ss)&~GSe),r}child(t,r){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let n=this.children(),a=this.nocase?zZ(t):O5(t);for(let f of n)if(re(f,NI)===a)return f;let s=this.parent?this.sep:"",c=re(this,S1)?re(this,S1)+s+t:void 0,l=this.newChild(t,rv,{...r,parent:this,fullpath:c});return this.canReaddir()||Qt(l,Ss,re(l,Ss)|ib),n.push(l),l}relative(){if(this.isCWD)return"";if(re(this,BS)!==void 0)return re(this,BS);let t=this.name,r=this.parent;if(!r)return Qt(this,BS,this.name);let n=r.relative();return n+(!n||!r.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(re(this,DS)!==void 0)return re(this,DS);let t=this.name,r=this.parent;if(!r)return Qt(this,DS,this.fullpathPosix());let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+t}fullpath(){if(re(this,S1)!==void 0)return re(this,S1);let t=this.name,r=this.parent;if(!r)return Qt(this,S1,this.name);let a=r.fullpath()+(r.parent?this.sep:"")+t;return Qt(this,S1,a)}fullpathPosix(){if(re(this,TS)!==void 0)return re(this,TS);if(this.sep==="/")return Qt(this,TS,this.fullpath());if(!this.parent){let a=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(a)?Qt(this,TS,`//?/${a}`):Qt(this,TS,a)}let t=this.parent,r=t.fullpathPosix(),n=r+(!r||!t.parent?"":"/")+this.name;return Qt(this,TS,n)}isUnknown(){return(re(this,Ss)&tv)===rv}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(re(this,Ss)&tv)===w2t}isDirectory(){return(re(this,Ss)&tv)===w1}isCharacterDevice(){return(re(this,Ss)&tv)===b2t}isBlockDevice(){return(re(this,Ss)&tv)===E2t}isFIFO(){return(re(this,Ss)&tv)===x2t}isSocket(){return(re(this,Ss)&tv)===S2t}isSymbolicLink(){return(re(this,Ss)&HD)===HD}lstatCached(){return re(this,Ss)&d2t?this:void 0}readlinkCached(){return re(this,PS)}realpathCached(){return re(this,C1)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(re(this,PS))return!0;if(!this.parent)return!1;let t=re(this,Ss)&tv;return!(t!==rv&&t!==HD||re(this,Ss)&UZ||re(this,Ss)&ib)}calledReaddir(){return!!(re(this,Ss)&GSe)}isENOENT(){return!!(re(this,Ss)&ib)}isNamed(t){return this.nocase?re(this,NI)===zZ(t):re(this,NI)===O5(t)}async readlink(){var r;let t=re(this,PS);if(t)return t;if(this.canReadlink()&&this.parent)try{let n=await re(this,Vm).promises.readlink(this.fullpath()),a=(r=await this.parent.realpath())==null?void 0:r.resolve(n);if(a)return Qt(this,PS,a)}catch(n){yr(this,d9,eCe).call(this,n.code);return}}readlinkSync(){var r;let t=re(this,PS);if(t)return t;if(this.canReadlink()&&this.parent)try{let n=re(this,Vm).readlinkSync(this.fullpath()),a=(r=this.parent.realpathSync())==null?void 0:r.resolve(n);if(a)return Qt(this,PS,a)}catch(n){yr(this,d9,eCe).call(this,n.code);return}}async lstat(){if(!(re(this,Ss)&ib))try{return yr(this,h9,tCe).call(this,await re(this,Vm).promises.lstat(this.fullpath())),this}catch(t){yr(this,f9,ZSe).call(this,t.code)}}lstatSync(){if(!(re(this,Ss)&ib))try{return yr(this,h9,tCe).call(this,re(this,Vm).lstatSync(this.fullpath())),this}catch(t){yr(this,f9,ZSe).call(this,t.code)}}readdirCB(t,r=!1){if(!this.canReaddir()){r?t(null,[]):queueMicrotask(()=>t(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?t(null,s):queueMicrotask(()=>t(null,s));return}if(re(this,gQ).push(t),re(this,AQ))return;Qt(this,AQ,!0);let a=this.fullpath();re(this,Vm).readdir(a,{withFileTypes:!0},(s,c)=>{if(s)yr(this,hQ,$Z).call(this,s.code),n.provisional=0;else{for(let l of c)yr(this,mQ,WZ).call(this,l,n);yr(this,dQ,VZ).call(this,n)}yr(this,eee,T2t).call(this,n.slice(0,n.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();if(re(this,YD))await re(this,YD);else{let n=()=>{};Qt(this,YD,new Promise(a=>n=a));try{for(let a of await re(this,Vm).promises.readdir(r,{withFileTypes:!0}))yr(this,mQ,WZ).call(this,a,t);yr(this,dQ,VZ).call(this,t)}catch(a){yr(this,hQ,$Z).call(this,a.code),t.provisional=0}Qt(this,YD,void 0),n()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();try{for(let n of re(this,Vm).readdirSync(r,{withFileTypes:!0}))yr(this,mQ,WZ).call(this,n,t);yr(this,dQ,VZ).call(this,t)}catch(n){yr(this,hQ,$Z).call(this,n.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(re(this,Ss)&h2t)return!1;let t=tv&re(this,Ss);return t===rv||t===w1||t===HD}shouldWalk(t,r){return(re(this,Ss)&w1)===w1&&!(re(this,Ss)&h2t)&&!t.has(this)&&(!r||r(this))}async realpath(){if(re(this,C1))return re(this,C1);if(!((HZ|UZ|ib)&re(this,Ss)))try{let t=await re(this,Vm).promises.realpath(this.fullpath());return Qt(this,C1,this.resolve(t))}catch{yr(this,p9,XSe).call(this)}}realpathSync(){if(re(this,C1))return re(this,C1);if(!((HZ|UZ|ib)&re(this,Ss)))try{let t=re(this,Vm).realpathSync(this.fullpath());return Qt(this,C1,this.resolve(t))}catch{yr(this,p9,XSe).call(this)}}[C2t](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],a=this;for(;a&&a.parent;)r.add(a),Qt(a,BS,n.join(this.sep)),Qt(a,DS,n.join("/")),a=a.parent,n.push("..");for(a=t;a&&a.parent&&!r.has(a);)Qt(a,BS,void 0),Qt(a,DS,void 0),a=a.parent}};Vm=new WeakMap,V5=new WeakMap,$5=new WeakMap,W5=new WeakMap,G5=new WeakMap,Y5=new WeakMap,J5=new WeakMap,K5=new WeakMap,X5=new WeakMap,Z5=new WeakMap,e9=new WeakMap,t9=new WeakMap,r9=new WeakMap,n9=new WeakMap,i9=new WeakMap,s9=new WeakMap,a9=new WeakMap,o9=new WeakMap,c9=new WeakMap,NI=new WeakMap,VD=new WeakMap,S1=new WeakMap,TS=new WeakMap,BS=new WeakMap,DS=new WeakMap,Ss=new WeakMap,$D=new WeakMap,PS=new WeakMap,C1=new WeakMap,u9=new WeakSet,JSe=function(t){let r=this;for(let n of t)r=r.child(n);return r},dQ=new WeakSet,VZ=function(t){var r;Qt(this,Ss,re(this,Ss)|GSe);for(let n=t.provisional;n<t.length;n++){let a=t[n];a&&yr(r=a,WD,Q5).call(r)}},WD=new WeakSet,Q5=function(){re(this,Ss)&ib||(Qt(this,Ss,(re(this,Ss)|ib)&P5),yr(this,l9,KSe).call(this))},l9=new WeakSet,KSe=function(){var r;let t=this.children();t.provisional=0;for(let n of t)yr(r=n,WD,Q5).call(r)},p9=new WeakSet,XSe=function(){Qt(this,Ss,re(this,Ss)|HZ),yr(this,GD,L5).call(this)},GD=new WeakSet,L5=function(){if(re(this,Ss)&F5)return;let t=re(this,Ss);(t&tv)===w1&&(t&=P5),Qt(this,Ss,t|F5),yr(this,l9,KSe).call(this)},hQ=new WeakSet,$Z=function(t=""){t==="ENOTDIR"||t==="EPERM"?yr(this,GD,L5).call(this):t==="ENOENT"?yr(this,WD,Q5).call(this):this.children().provisional=0},f9=new WeakSet,ZSe=function(t=""){var r;if(t==="ENOTDIR"){let n=this.parent;yr(r=n,GD,L5).call(r)}else t==="ENOENT"&&yr(this,WD,Q5).call(this)},d9=new WeakSet,eCe=function(t=""){var n;let r=re(this,Ss);r|=UZ,t==="ENOENT"&&(r|=ib),(t==="EINVAL"||t==="UNKNOWN")&&(r&=P5),Qt(this,Ss,r),t==="ENOTDIR"&&this.parent&&yr(n=this.parent,GD,L5).call(n)},mQ=new WeakSet,WZ=function(t,r){return yr(this,XZ,I2t).call(this,t,r)||yr(this,KZ,_2t).call(this,t,r)},KZ=new WeakSet,_2t=function(t,r){let n=YSe(t),a=this.newChild(t.name,n,{parent:this}),s=re(a,Ss)&tv;return s!==w1&&s!==HD&&s!==rv&&Qt(a,Ss,re(a,Ss)|F5),r.unshift(a),r.provisional++,a},XZ=new WeakSet,I2t=function(t,r){for(let n=r.provisional;n<r.length;n++){let a=r[n];if((this.nocase?zZ(t.name):O5(t.name))===re(a,NI))return yr(this,ZZ,k2t).call(this,t,a,n,r)}},ZZ=new WeakSet,k2t=function(t,r,n,a){let s=r.name;return Qt(r,Ss,re(r,Ss)&P5|YSe(t)),s!==t.name&&(r.name=t.name),n!==a.provisional&&(n===a.length-1?a.pop():a.splice(n,1),a.unshift(r)),a.provisional++,r},h9=new WeakSet,tCe=function(t){let{atime:r,atimeMs:n,birthtime:a,birthtimeMs:s,blksize:c,blocks:l,ctime:f,ctimeMs:d,dev:m,gid:g,ino:x,mode:b,mtime:A,mtimeMs:C,nlink:I,rdev:k,size:O,uid:j}=t;Qt(this,s9,r),Qt(this,t9,n),Qt(this,c9,a),Qt(this,i9,s),Qt(this,K5,c),Qt(this,e9,l),Qt(this,o9,f),Qt(this,n9,d),Qt(this,V5,m),Qt(this,Y5,g),Qt(this,X5,x),Qt(this,$5,b),Qt(this,a9,A),Qt(this,r9,C),Qt(this,W5,I),Qt(this,J5,k),Qt(this,Z5,O),Qt(this,G5,j);let M=YSe(t);Qt(this,Ss,re(this,Ss)&P5|M|d2t),M!==rv&&M!==w1&&M!==HD&&Qt(this,Ss,re(this,Ss)|F5)},gQ=new WeakMap,AQ=new WeakMap,eee=new WeakSet,T2t=function(t){Qt(this,AQ,!1);let r=re(this,gQ).slice();re(this,gQ).length=0,r.forEach(n=>n(null,t))},YD=new WeakMap;ac.PathBase=Fd;var M5=class e extends Fd{sep="\\";splitSep=H_n;constructor(t,r=rv,n,a,s,c,l){super(t,r,n,a,s,c,l)}newChild(t,r=rv,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(t){return GZ.win32.parse(t).root}getRoot(t){if(t=z_n(t.toUpperCase()),t===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(t,r))return this.roots[t]=n;return this.roots[t]=new z5(t,this).root}sameRoot(t,r=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(v2t,"$1\\"),t===r}};ac.PathWin32=M5;var q5=class e extends Fd{splitSep="/";sep="/";constructor(t,r=rv,n,a,s,c,l){super(t,r,n,a,s,c,l)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,r=rv,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}};ac.PathPosix=q5;var yQ,vQ,m9,g9,U5=class{constructor(t=process.cwd(),r,n,{nocase:a,childrenCacheSize:s=16*1024,fs:c=N5}={}){Ps(this,"root");Ps(this,"rootPath");Ps(this,"roots");Ps(this,"cwd");nr(this,yQ,void 0);nr(this,vQ,void 0);nr(this,m9,void 0);Ps(this,"nocase");nr(this,g9,void 0);Qt(this,g9,y2t(c)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,M_n.fileURLToPath)(t));let l=r.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),Qt(this,yQ,new j5),Qt(this,vQ,new j5),Qt(this,m9,new YZ(s));let f=l.substring(this.rootPath.length).split(n);if(f.length===1&&!f[0]&&f.pop(),a===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=a,this.root=this.newRoot(re(this,g9)),this.roots[this.rootPath]=this.root;let d=this.root,m=f.length-1,g=r.sep,x=this.rootPath,b=!1;for(let A of f){let C=m--;d=d.child(A,{relative:new Array(C).fill("..").join(g),relativePosix:new Array(C).fill("..").join("/"),fullpath:x+=(b?"":g)+A}),b=!0}this.cwd=d}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return re(this,m9)}resolve(...t){let r="";for(let s=t.length-1;s>=0;s--){let c=t[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=re(this,yQ).get(r);if(n!==void 0)return n;let a=this.cwd.resolve(r).fullpath();return re(this,yQ).set(r,a),a}resolvePosix(...t){let r="";for(let s=t.length-1;s>=0;s--){let c=t[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=re(this,vQ).get(r);if(n!==void 0)return n;let a=this.cwd.resolve(r).fullpathPosix();return re(this,vQ).set(r,a),a}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n}=r;if(t.canReaddir()){let a=await t.readdir();return n?a:a.map(s=>s.name)}else return[]}readdirSync(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n=!0}=r;return t.canReaddir()?n?t.readdirSync():t.readdirSync().map(a=>a.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t.withFileTypes,t=this.cwd);let n=await t.readlink();return r?n:n==null?void 0:n.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t.withFileTypes,t=this.cwd);let n=t.readlinkSync();return r?n:n==null?void 0:n.fullpath()}async realpath(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t.withFileTypes,t=this.cwd);let n=await t.realpath();return r?n:n==null?void 0:n.fullpath()}realpathSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t.withFileTypes,t=this.cwd);let n=t.realpathSync();return r?n:n==null?void 0:n.fullpath()}async walk(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:a=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(t))&&l.push(n?t:t.fullpath());let f=new Set,d=(g,x)=>{f.add(g),g.readdirCB((b,A)=>{if(b)return x(b);let C=A.length;if(!C)return x();let I=()=>{--C===0&&x()};for(let k of A)(!s||s(k))&&l.push(n?k:k.fullpath()),a&&k.isSymbolicLink()?k.realpath().then(O=>O!=null&&O.isUnknown()?O.lstat():O).then(O=>O!=null&&O.shouldWalk(f,c)?d(O,I):I()):k.shouldWalk(f,c)?d(k,I):I()},!0)},m=t;return new Promise((g,x)=>{d(m,b=>{if(b)return x(b);g(l)})})}walkSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:a=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(t))&&l.push(n?t:t.fullpath());let f=new Set([t]);for(let d of f){let m=d.readdirSync();for(let g of m){(!s||s(g))&&l.push(n?g:g.fullpath());let x=g;if(g.isSymbolicLink()){if(!(a&&(x=g.realpathSync())))continue;x.isUnknown()&&x.lstatSync()}x.shouldWalk(f,c)&&f.add(x)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,r={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd),this.stream(t,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:a=!1,filter:s,walkFilter:c}=r;(!s||s(t))&&(yield n?t:t.fullpath());let l=new Set([t]);for(let f of l){let d=f.readdirSync();for(let m of d){(!s||s(m))&&(yield n?m:m.fullpath());let g=m;if(m.isSymbolicLink()){if(!(a&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(l,c)&&l.add(g)}}}stream(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:a=!1,filter:s,walkFilter:c}=r,l=new f2t.Minipass({objectMode:!0});(!s||s(t))&&l.write(n?t:t.fullpath());let f=new Set,d=[t],m=0,g=()=>{let x=!1;for(;!x;){let b=d.shift();if(!b){m===0&&l.end();return}m++,f.add(b);let A=(I,k,O=!1)=>{if(I)return l.emit("error",I);if(a&&!O){let j=[];for(let M of k)M.isSymbolicLink()&&j.push(M.realpath().then(W=>W!=null&&W.isUnknown()?W.lstat():W));if(j.length){Promise.all(j).then(()=>A(null,k,!0));return}}for(let j of k)j&&(!s||s(j))&&(l.write(n?j:j.fullpath())||(x=!0));m--;for(let j of k){let M=j.realpathCached()||j;M.shouldWalk(f,c)&&d.push(M)}x&&!l.flowing?l.once("drain",g):C||g()},C=!0;b.readdirCB(A,!0),C=!1}};return g(),l}streamSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Fd||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:a=!1,filter:s,walkFilter:c}=r,l=new f2t.Minipass({objectMode:!0}),f=new Set;(!s||s(t))&&l.write(n?t:t.fullpath());let d=[t],m=0,g=()=>{let x=!1;for(;!x;){let b=d.shift();if(!b){m===0&&l.end();return}m++,f.add(b);let A=b.readdirSync();for(let C of A)(!s||s(C))&&(l.write(n?C:C.fullpath())||(x=!0));m--;for(let C of A){let I=C;if(C.isSymbolicLink()){if(!(a&&(I=C.realpathSync())))continue;I.isUnknown()&&I.lstatSync()}I.shouldWalk(f,c)&&d.push(I)}}x&&!l.flowing&&l.once("drain",g)};return g(),l}chdir(t=this.cwd){let r=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[C2t](r)}};yQ=new WeakMap,vQ=new WeakMap,m9=new WeakMap,g9=new WeakMap;ac.PathScurryBase=U5;var z5=class extends U5{sep="\\";constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,GZ.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let a=this.cwd;a;a=a.parent)a.nocase=this.nocase}parseRootPath(t){return GZ.win32.parse(t).root.toUpperCase()}newRoot(t){return new M5(this.rootPath,w1,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};ac.PathScurryWin32=z5;var H5=class extends U5{sep="/";constructor(t=process.cwd(),r={}){let{nocase:n=!1}=r;super(t,GZ.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(t){return"/"}newRoot(t){return new q5(this.rootPath,w1,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};ac.PathScurryPosix=H5;var JZ=class extends H5{constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,{...r,nocase:n})}};ac.PathScurryDarwin=JZ;ac.Path=process.platform==="win32"?M5:q5;ac.PathScurry=process.platform==="win32"?z5:process.platform==="darwin"?JZ:H5});var iCe=P(tee=>{"use strict";Object.defineProperty(tee,"__esModule",{value:!0});tee.Pattern=void 0;var $_n=require("minimatch"),W_n=e=>e.length>=1,G_n=e=>e.length>=1,af,gA,Kf,JD,sb,A9,FI,OI,QI,xQ,nCe=class nCe{constructor(t,r,n,a){nr(this,af,void 0);nr(this,gA,void 0);nr(this,Kf,void 0);Ps(this,"length");nr(this,JD,void 0);nr(this,sb,void 0);nr(this,A9,void 0);nr(this,FI,void 0);nr(this,OI,void 0);nr(this,QI,void 0);nr(this,xQ,!0);if(!W_n(t))throw new TypeError("empty pattern list");if(!G_n(r))throw new TypeError("empty glob list");if(r.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,n<0||n>=this.length)throw new TypeError("index out of range");if(Qt(this,af,t),Qt(this,gA,r),Qt(this,Kf,n),Qt(this,JD,a),re(this,Kf)===0){if(this.isUNC()){let[s,c,l,f,...d]=re(this,af),[m,g,x,b,...A]=re(this,gA);d[0]===""&&(d.shift(),A.shift());let C=[s,c,l,f,""].join("/"),I=[m,g,x,b,""].join("/");Qt(this,af,[C,...d]),Qt(this,gA,[I,...A]),this.length=re(this,af).length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=re(this,af),[l,...f]=re(this,gA);c[0]===""&&(c.shift(),f.shift());let d=s+"/",m=l+"/";Qt(this,af,[d,...c]),Qt(this,gA,[m,...f]),this.length=re(this,af).length}}}pattern(){return re(this,af)[re(this,Kf)]}isString(){return typeof re(this,af)[re(this,Kf)]=="string"}isGlobstar(){return re(this,af)[re(this,Kf)]===$_n.GLOBSTAR}isRegExp(){return re(this,af)[re(this,Kf)]instanceof RegExp}globString(){return Qt(this,A9,re(this,A9)||(re(this,Kf)===0?this.isAbsolute()?re(this,gA)[0]+re(this,gA).slice(1).join("/"):re(this,gA).join("/"):re(this,gA).slice(re(this,Kf)).join("/")))}hasMore(){return this.length>re(this,Kf)+1}rest(){return re(this,sb)!==void 0?re(this,sb):this.hasMore()?(Qt(this,sb,new nCe(re(this,af),re(this,gA),re(this,Kf)+1,re(this,JD))),Qt(re(this,sb),QI,re(this,QI)),Qt(re(this,sb),OI,re(this,OI)),Qt(re(this,sb),FI,re(this,FI)),re(this,sb)):Qt(this,sb,null)}isUNC(){let t=re(this,af);return re(this,OI)!==void 0?re(this,OI):Qt(this,OI,re(this,JD)==="win32"&&re(this,Kf)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=re(this,af);return re(this,FI)!==void 0?re(this,FI):Qt(this,FI,re(this,JD)==="win32"&&re(this,Kf)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=re(this,af);return re(this,QI)!==void 0?re(this,QI):Qt(this,QI,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=re(this,af)[0];return typeof t=="string"&&this.isAbsolute()&&re(this,Kf)===0?t:""}checkFollowGlobstar(){return!(re(this,Kf)===0||!this.isGlobstar()||!re(this,xQ))}markFollowGlobstar(){return re(this,Kf)===0||!this.isGlobstar()||!re(this,xQ)?!1:(Qt(this,xQ,!1),!0)}};af=new WeakMap,gA=new WeakMap,Kf=new WeakMap,JD=new WeakMap,sb=new WeakMap,A9=new WeakMap,FI=new WeakMap,OI=new WeakMap,QI=new WeakMap,xQ=new WeakMap;var rCe=nCe;tee.Pattern=rCe});var aCe=P(ree=>{"use strict";Object.defineProperty(ree,"__esModule",{value:!0});ree.Ignore=void 0;var D2t=require("minimatch"),Y_n=iCe(),J_n=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",sCe=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:r,nocase:n,noext:a,noglobstar:s,platform:c=J_n}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:a,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of t)this.add(l)}add(t){let r=new D2t.Minimatch(t,this.mmopts);for(let n=0;n<r.set.length;n++){let a=r.set[n],s=r.globParts[n];if(!a||!s)throw new Error("invalid pattern object");for(;a[0]==="."&&s[0]===".";)a.shift(),s.shift();let c=new Y_n.Pattern(a,s,0,this.platform),l=new D2t.Minimatch(c.globString(),this.mmopts),f=s[s.length-1]==="**",d=c.isAbsolute();d?this.absolute.push(l):this.relative.push(l),f&&(d?this.absoluteChildren.push(l):this.relativeChildren.push(l))}}ignored(t){let r=t.fullpath(),n=`${r}/`,a=t.relative()||".",s=`${a}/`;for(let c of this.relative)if(c.match(a)||c.match(s))return!0;for(let c of this.absolute)if(c.match(r)||c.match(n))return!0;return!1}childrenIgnored(t){let r=t.fullpath()+"/",n=(t.relative()||".")+"/";for(let a of this.relativeChildren)if(a.match(n))return!0;for(let a of this.absoluteChildren)if(a.match(r))return!0;return!1}};ree.Ignore=sCe});var R2t=P(_1=>{"use strict";Object.defineProperty(_1,"__esModule",{value:!0});_1.Processor=_1.SubWalks=_1.MatchRecord=_1.HasWalkedCache=void 0;var P2t=require("minimatch"),nee=class e{store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,r){var n;return(n=this.store.get(t.fullpath()))==null?void 0:n.has(r.globString())}storeWalked(t,r){let n=t.fullpath(),a=this.store.get(n);a?a.add(r.globString()):this.store.set(n,new Set([r.globString()]))}};_1.HasWalkedCache=nee;var iee=class{store=new Map;add(t,r,n){let a=(r?2:0)|(n?1:0),s=this.store.get(t);this.store.set(t,s===void 0?a:a&s)}entries(){return[...this.store.entries()].map(([t,r])=>[t,!!(r&2),!!(r&1)])}};_1.MatchRecord=iee;var see=class{store=new Map;add(t,r){if(!t.canReaddir())return;let n=this.store.get(t);n?n.find(a=>a.globString()===r.globString())||n.push(r):this.store.set(t,[r])}get(t){let r=this.store.get(t);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};_1.SubWalks=see;var oCe=class e{hasWalkedCache;matches=new iee;subwalks=new see;patterns;follow;dot;opts;constructor(t,r){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=r?r.copy():new nee}processPatterns(t,r){this.patterns=r;let n=r.map(a=>[t,a]);for(let[a,s]of n){this.hasWalkedCache.storeWalked(a,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){a=a.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let g=s.rest();if(g)s=g;else{this.matches.add(a,!0,!1);continue}}if(a.isENOENT())continue;let f,d,m=!1;for(;typeof(f=s.pattern())=="string"&&(d=s.rest());)a=a.resolve(f),s=d,m=!0;if(f=s.pattern(),d=s.rest(),m){if(this.hasWalkedCache.hasWalked(a,s))continue;this.hasWalkedCache.storeWalked(a,s)}if(typeof f=="string"){let g=f===".."||f===""||f===".";this.matches.add(a.resolve(f),l,g);continue}else if(f===P2t.GLOBSTAR){(!a.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(a,s);let g=d==null?void 0:d.pattern(),x=d==null?void 0:d.rest();if(!d||(g===""||g===".")&&!x)this.matches.add(a,l,g===""||g===".");else if(g===".."){let b=a.parent||a;x?this.hasWalkedCache.hasWalked(b,x)||this.subwalks.add(b,x):this.matches.add(b,l,!0)}}else f instanceof RegExp&&this.subwalks.add(a,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,r){let n=this.subwalks.get(t),a=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),f=c.pattern(),d=c.rest();f===P2t.GLOBSTAR?a.testGlobstar(s,c,d,l):f instanceof RegExp?a.testRegExp(s,f,d,l):a.testString(s,f,d,l)}return a}testGlobstar(t,r,n,a){if((this.dot||!t.name.startsWith("."))&&(r.hasMore()||this.matches.add(t,a,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,r):t.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(t,n):r.markFollowGlobstar()&&this.subwalks.add(t,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(t,s,n.rest(),a);else if(s===".."){let c=t.parent||t;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(t,s,n.rest(),a)}}testRegExp(t,r,n,a){r.test(t.name)&&(n?this.subwalks.add(t,n):this.matches.add(t,a,!1))}testString(t,r,n,a){t.isNamed(r)&&(n?this.subwalks.add(t,n):this.matches.add(t,a,!1))}};_1.Processor=oCe});var O2t=P(LI=>{"use strict";Object.defineProperty(LI,"__esModule",{value:!0});LI.GlobStream=LI.GlobWalker=LI.GlobUtil=void 0;var K_n=WSe(),N2t=aCe(),F2t=R2t(),X_n=(e,t)=>typeof e=="string"?new N2t.Ignore([e],t):Array.isArray(e)?new N2t.Ignore(e,t):e,bQ,RS,XD,NS,KD,v9,cCe,y9=class{constructor(t,r,n){nr(this,NS);nr(this,v9);Ps(this,"path");Ps(this,"patterns");Ps(this,"opts");Ps(this,"seen",new Set);Ps(this,"paused",!1);Ps(this,"aborted",!1);nr(this,bQ,[]);nr(this,RS,void 0);nr(this,XD,void 0);Ps(this,"signal");Ps(this,"maxDepth");Ps(this,"includeChildMatches");var a;if(this.patterns=t,this.path=r,this.opts=n,Qt(this,XD,!n.posix&&n.platform==="win32"?"\\":"/"),this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(Qt(this,RS,X_n((a=n.ignore)!=null?a:[],n)),!this.includeChildMatches&&typeof re(this,RS).add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{re(this,bQ).length=0}))}pause(){this.paused=!0}resume(){var r;if((r=this.signal)!=null&&r.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=re(this,bQ).shift());)t()}onResume(t){var r;(r=this.signal)!=null&&r.aborted||(this.paused?re(this,bQ).push(t):t())}async matchCheck(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||await t.realpath(),!n)return;t=n}let s=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(s!=null&&s.isSymbolicLink())){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(t,r){var n;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!r||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((n=t.realpathCached())!=null&&n.isDirectory()))&&!yr(this,NS,KD).call(this,t)?t:void 0}matchCheckSync(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||t.realpathSync(),!n)return;t=n}let s=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(s!=null&&s.isSymbolicLink())){let c=s.realpathSync();c&&(c!=null&&c.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(t,r){var s;if(yr(this,NS,KD).call(this,t))return;if(!this.includeChildMatches&&((s=re(this,RS))!=null&&s.add)){let c=`${t.relativePosix()}/**`;re(this,RS).add(c)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(t);let a=this.opts.mark&&t.isDirectory()?re(this,XD):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(n){let c=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(c+a)}else{let c=this.opts.posix?t.relativePosix():t.relative(),l=this.opts.dotRelative&&!c.startsWith(".."+re(this,XD))?"."+re(this,XD):"";this.matchEmit(c?l+c+a:"."+a)}}async match(t,r,n){let a=await this.matchCheck(t,n);a&&this.matchFinish(a,r)}matchSync(t,r,n){let a=this.matchCheckSync(t,n);a&&this.matchFinish(a,r)}walkCB(t,r,n){var a;(a=this.signal)!=null&&a.aborted&&n(),this.walkCB2(t,r,new F2t.Processor(this.opts),n)}walkCB2(t,r,n,a){var l;if(yr(this,v9,cCe).call(this,t))return a();if((l=this.signal)!=null&&l.aborted&&a(),this.paused){this.onResume(()=>this.walkCB2(t,r,n,a));return}n.processPatterns(t,r);let s=1,c=()=>{--s===0&&a()};for(let[f,d,m]of n.matches.entries())yr(this,NS,KD).call(this,f)||(s++,this.match(f,d,m).then(()=>c()));for(let f of n.subwalkTargets()){if(this.maxDepth!==1/0&&f.depth()>=this.maxDepth)continue;s++;let d=f.readdirCached();f.calledReaddir()?this.walkCB3(f,d,n,c):f.readdirCB((m,g)=>this.walkCB3(f,g,n,c),!0)}c()}walkCB3(t,r,n,a){n=n.filterEntries(t,r);let s=1,c=()=>{--s===0&&a()};for(let[l,f,d]of n.matches.entries())yr(this,NS,KD).call(this,l)||(s++,this.match(l,f,d).then(()=>c()));for(let[l,f]of n.subwalks.entries())s++,this.walkCB2(l,f,n.child(),c);c()}walkCBSync(t,r,n){var a;(a=this.signal)!=null&&a.aborted&&n(),this.walkCB2Sync(t,r,new F2t.Processor(this.opts),n)}walkCB2Sync(t,r,n,a){var l;if(yr(this,v9,cCe).call(this,t))return a();if((l=this.signal)!=null&&l.aborted&&a(),this.paused){this.onResume(()=>this.walkCB2Sync(t,r,n,a));return}n.processPatterns(t,r);let s=1,c=()=>{--s===0&&a()};for(let[f,d,m]of n.matches.entries())yr(this,NS,KD).call(this,f)||this.matchSync(f,d,m);for(let f of n.subwalkTargets()){if(this.maxDepth!==1/0&&f.depth()>=this.maxDepth)continue;s++;let d=f.readdirSync();this.walkCB3Sync(f,d,n,c)}c()}walkCB3Sync(t,r,n,a){n=n.filterEntries(t,r);let s=1,c=()=>{--s===0&&a()};for(let[l,f,d]of n.matches.entries())yr(this,NS,KD).call(this,l)||this.matchSync(l,f,d);for(let[l,f]of n.subwalks.entries())s++,this.walkCB2Sync(l,f,n.child(),c);c()}};bQ=new WeakMap,RS=new WeakMap,XD=new WeakMap,NS=new WeakSet,KD=function(t){var r,n;return this.seen.has(t)||!!((n=(r=re(this,RS))==null?void 0:r.ignored)!=null&&n.call(r,t))},v9=new WeakSet,cCe=function(t){var r,n;return!!((n=(r=re(this,RS))==null?void 0:r.childrenIgnored)!=null&&n.call(r,t))};LI.GlobUtil=y9;var uCe=class extends y9{matches=new Set;constructor(t,r,n){super(t,r,n)}matchEmit(t){this.matches.add(t)}async walk(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((r,n)=>{this.walkCB(this.path,this.patterns,()=>{var a;(a=this.signal)!=null&&a.aborted?n(this.signal.reason):r(this.matches)})}),this.matches}walkSync(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var r;if((r=this.signal)!=null&&r.aborted)throw this.signal.reason}),this.matches}};LI.GlobWalker=uCe;var lCe=class extends y9{results;constructor(t,r,n){super(t,r,n),this.results=new K_n.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};LI.GlobStream=lCe});var fCe=P(cee=>{"use strict";Object.defineProperty(cee,"__esModule",{value:!0});cee.Glob=void 0;var Z_n=require("minimatch"),eIn=require("url"),aee=B2t(),tIn=iCe(),oee=O2t(),rIn=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",pCe=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,eIn.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(f=>f.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(f=>f.includes("/")?f:`./**/${f}`)}if(this.pattern=t,this.platform=r.platform||rIn,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let f=r.platform==="win32"?aee.PathScurryWin32:r.platform==="darwin"?aee.PathScurryDarwin:r.platform?aee.PathScurryPosix:aee.PathScurry;this.scurry=new f(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",a={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(f=>new Z_n.Minimatch(f,a)),[c,l]=s.reduce((f,d)=>(f[0].push(...d.set),f[1].push(...d.globParts),f),[[],[]]);this.patterns=c.map((f,d)=>{let m=l[d];if(!m)throw new Error("invalid pattern object");return new tIn.Pattern(f,m,0,this.platform)})}async walk(){return[...await new oee.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new oee.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new oee.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new oee.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};cee.Glob=pCe});var dCe=P(uee=>{"use strict";Object.defineProperty(uee,"__esModule",{value:!0});uee.hasMagic=void 0;var nIn=require("minimatch"),iIn=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new nIn.Minimatch(r,t).hasMagic())return!0;return!1};uee.hasMagic=iIn});var M2t=P($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.glob=$a.sync=$a.iterate=$a.iterateSync=$a.stream=$a.streamSync=$a.Ignore=$a.hasMagic=$a.Glob=$a.unescape=$a.escape=void 0;$a.globStreamSync=x9;$a.globStream=hCe;$a.globSync=mCe;$a.globIterateSync=b9;$a.globIterate=gCe;var Q2t=require("minimatch"),ZD=fCe(),sIn=dCe(),j2t=require("minimatch");Object.defineProperty($a,"escape",{enumerable:!0,get:function(){return j2t.escape}});Object.defineProperty($a,"unescape",{enumerable:!0,get:function(){return j2t.unescape}});var aIn=fCe();Object.defineProperty($a,"Glob",{enumerable:!0,get:function(){return aIn.Glob}});var oIn=dCe();Object.defineProperty($a,"hasMagic",{enumerable:!0,get:function(){return oIn.hasMagic}});var cIn=aCe();Object.defineProperty($a,"Ignore",{enumerable:!0,get:function(){return cIn.Ignore}});function x9(e,t={}){return new ZD.Glob(e,t).streamSync()}function hCe(e,t={}){return new ZD.Glob(e,t).stream()}function mCe(e,t={}){return new ZD.Glob(e,t).walkSync()}async function L2t(e,t={}){return new ZD.Glob(e,t).walk()}function b9(e,t={}){return new ZD.Glob(e,t).iterateSync()}function gCe(e,t={}){return new ZD.Glob(e,t).iterate()}$a.streamSync=x9;$a.stream=Object.assign(hCe,{sync:x9});$a.iterateSync=b9;$a.iterate=Object.assign(gCe,{sync:b9});$a.sync=Object.assign(mCe,{stream:x9,iterate:b9});$a.glob=Object.assign(L2t,{glob:L2t,globSync:mCe,sync:$a.sync,globStream:hCe,stream:$a.stream,globStreamSync:x9,streamSync:$a.streamSync,globIterate:gCe,iterate:$a.iterate,globIterateSync:b9,iterateSync:$a.iterateSync,Glob:ZD.Glob,hasMagic:sIn.hasMagic,escape:Q2t.escape,unescape:Q2t.unescape});$a.glob.glob=$a.glob});var H2t=P((Mbi,z2t)=>{var U2t=g_(),EQ=require("path"),ACe=require("lodash/flatten"),uIn=require("lodash/difference"),lIn=require("lodash/union"),pIn=require("lodash/isPlainObject"),fIn=M2t(),eP=z2t.exports={},q2t=/[\/\\]/g,dIn=function(e,t){var r=[];return ACe(e).forEach(function(n){var a=n.indexOf("!")===0;a&&(n=n.slice(1));var s=t(n);a?r=uIn(r,s):r=lIn(r,s)}),r};eP.exists=function(){var e=EQ.join.apply(EQ,arguments);return U2t.existsSync(e)};eP.expand=function(...e){var t=pIn(e[0])?e.shift():{},r=Array.isArray(e[0])?e[0]:e;if(r.length===0)return[];var n=dIn(r,function(a){return fIn.sync(a,t)});return t.filter&&(n=n.filter(function(a){a=EQ.join(t.cwd||"",a);try{return typeof t.filter=="function"?t.filter(a):U2t.statSync(a)[t.filter]()}catch{return!1}})),n};eP.expandMapping=function(e,t,r){r=Object.assign({rename:function(s,c){return EQ.join(s||"",c)}},r);var n=[],a={};return eP.expand(r,e).forEach(function(s){var c=s;r.flatten&&(c=EQ.basename(c)),r.ext&&(c=c.replace(/(\.[^\/]*)?$/,r.ext));var l=r.rename(t,c,r);r.cwd&&(s=EQ.join(r.cwd,s)),l=l.replace(q2t,"/"),s=s.replace(q2t,"/"),a[l]?a[l].src.push(s):(n.push({src:[s],dest:l}),a[l]=n[n.length-1])}),n};eP.normalizeFilesArray=function(e){var t=[];return e.forEach(function(r){var n;("src"in r||"dest"in r)&&t.push(r)}),t.length===0?[]:(t=_(t).chain().forEach(function(r){!("src"in r)||!r.src||(Array.isArray(r.src)?r.src=ACe(r.src):r.src=[r.src])}).map(function(r){var n=Object.assign({},r);if(delete n.src,delete n.dest,r.expand)return eP.expandMapping(r.src,r.dest,n).map(function(s){var c=Object.assign({},r);return c.orig=Object.assign({},r),c.src=s.src,c.dest=s.dest,["expand","cwd","flatten","rename","ext"].forEach(function(l){delete c[l]}),c});var a=Object.assign({},r);return a.orig=Object.assign({},r),"src"in a&&Object.defineProperty(a,"src",{enumerable:!0,get:function s(){var c;return"result"in s||(c=r.src,c=Array.isArray(c)?ACe(c):[c],s.result=eP.expand(n,c)),s.result}}),"dest"in a&&(a.dest=r.dest),a}).flatten().value(),t)}});var wQ=P((Ubi,W2t)=>{var yCe=g_(),V2t=require("path"),hIn=Kxt(),mIn=Gbt(),$2t=A2e(),gIn=require("lodash/defaults"),qbi=require("stream").Stream,AIn=Zwt().PassThrough,AA=W2t.exports={};AA.file=H2t();AA.collectStream=function(e,t){var r=[],n=0;e.on("error",t),e.on("data",function(a){r.push(a),n+=a.length}),e.on("end",function(){var a=Buffer.alloc(n),s=0;r.forEach(function(c){c.copy(a,s),s+=c.length}),t(null,a)})};AA.dateify=function(e){return e=e||new Date,e instanceof Date?e=e:typeof e=="string"?e=new Date(e):e=new Date,e};AA.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},gIn(...n)};AA.isStream=function(e){return hIn(e)};AA.lazyReadStream=function(e){return new mIn.Readable(function(){return yCe.createReadStream(e)})};AA.normalizeInputSource=function(e){return e===null?Buffer.alloc(0):typeof e=="string"?Buffer.from(e):AA.isStream(e)?e.pipe(new AIn):e};AA.sanitizePath=function(e){return $2t(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};AA.trailingSlashIt=function(e){return e.slice(-1)!=="/"?e+"/":e};AA.unixifyPath=function(e){return $2t(e,!1).replace(/^\w+:/,"")};AA.walkdir=function(e,t,r){var n=[];typeof t=="function"&&(r=t,t=e),yCe.readdir(e,function(a,s){var c=0,l,f;if(a)return r(a);(function d(){if(l=s[c++],!l)return r(null,n);f=V2t.join(e,l),yCe.stat(f,function(m,g){n.push({path:f,relative:V2t.relative(t,f).replace(/\\/g,"/"),stats:g}),g&&g.isDirectory()?AA.walkdir(f,t,function(x,b){if(x)return r(x);b.forEach(function(A){n.push(A)}),d()}):d()})})()})}});var K2t=P((Y2t,J2t)=>{var yIn=require("util"),vIn={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function G2t(e,t){Error.captureStackTrace(this,this.constructor),this.message=vIn[e]||e,this.code=e,this.data=t}yIn.inherits(G2t,Error);Y2t=J2t.exports=G2t});var Vu=P((zbi,X2t)=>{"use strict";var vCe=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
449
449
  `;super(r),this.name="AggregateError",this.errors=t}};X2t.exports={AggregateError:vCe,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var xCe=P((Hbi,Z2t)=>{"use strict";Z2t.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let a=t.shift();return n==="f"?a.toFixed(6):n==="j"?JSON.stringify(a):n==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var Nh=P((Vbi,rSt)=>{"use strict";var{format:xIn,inspect:lee}=xCe(),{AggregateError:bIn}=Vu(),EIn=globalThis.AggregateError||bIn,wIn=Symbol("kIsNodeError"),SIn=["string","function","number","object","Function","Object","boolean","bigint","symbol"],CIn=/^([A-Z][a-z0-9]*)+$/,_In="__node_internal_",pee={};function tP(e,t){if(!e)throw new pee.ERR_INTERNAL_ASSERTION(t)}function eSt(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function IIn(e,t,r){if(typeof t=="function")return tP(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return tP(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:xIn(t,...r)}function Od(e,t,r){r||(r=Error);class n extends r{constructor(...s){super(IIn(e,t,s))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[wIn]=!0,pee[e]=n}function tSt(e){let t=_In+e.name;return Object.defineProperty(e,"name",{value:t}),e}function kIn(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new EIn([t,e],t.message);return r.code=t.code,r}return e||t}var bCe=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new pee.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Od("ERR_ASSERTION","%s",Error);Od("ERR_INVALID_ARG_TYPE",(e,t,r)=>{tP(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let a=[],s=[],c=[];for(let f of t)tP(typeof f=="string","All expected entries have to be of type string"),SIn.includes(f)?a.push(f.toLowerCase()):CIn.test(f)?s.push(f):(tP(f!=="object",'The value "object" should be written as "Object"'),c.push(f));if(s.length>0){let f=a.indexOf("object");f!==-1&&(a.splice(a,f,1),s.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{let f=a.pop();n+=`one of type ${a.join(", ")}, or ${f}`}}(s.length>0||c.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let f=s.pop();n+=`an instance of ${s.join(", ")}, or ${f}`}}c.length>0&&(n+=" or ")}switch(c.length){case 0:break;case 1:c[0].toLowerCase()!==c[0]&&(n+="an "),n+=`${c[0]}`;break;case 2:n+=`one of ${c[0]} or ${c[1]}`;break;default:{let f=c.pop();n+=`one of ${c.join(", ")}, or ${f}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var l;if((l=r.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${r.constructor.name}`;else{let f=lee(r,{depth:-1});n+=`. Received ${f}`}}else{let f=lee(r,{colors:!1});f.length>25&&(f=`${f.slice(0,25)}...`),n+=`. Received type ${typeof r} (${f})`}return n},TypeError);Od("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=lee(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);Od("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let a=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);Od("ERR_MISSING_ARGS",(...e)=>{tP(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);Od("ERR_OUT_OF_RANGE",(e,t,r)=>{tP(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=eSt(String(r));else if(typeof r=="bigint"){n=String(r);let a=BigInt(2)**BigInt(32);(r>a||r<-a)&&(n=eSt(n)),n+="n"}else n=lee(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);Od("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Od("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Od("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Od("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Od("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Od("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Od("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Od("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Od("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Od("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Od("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);rSt.exports={AbortError:bCe,aggregateTwoErrors:tSt(kIn),hideStackFrames:tSt,codes:pee}});var $m=P(($bi,wCe)=>{"use strict";var TIn=require("buffer"),{format:BIn,inspect:DIn}=xCe(),{codes:{ERR_INVALID_ARG_TYPE:ECe}}=Nh(),{kResistStopPropagation:PIn,AggregateError:RIn,SymbolDispose:NIn}=Vu(),FIn=globalThis.AbortSignal||lp().AbortSignal,OIn=globalThis.AbortController||lp().AbortController,QIn=Object.getPrototypeOf(async function(){}).constructor,nSt=globalThis.Blob||TIn.Blob,LIn=typeof nSt<"u"?function(t){return t instanceof nSt}:function(t){return!1},iSt=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new ECe(t,"AbortSignal",e)},jIn=(e,t)=>{if(typeof e!="function")throw new ECe(t,"Function",e)};wCe.exports={AggregateError:RIn,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((n,...a)=>n?r(n):t(...a))})},debuglog(){return function(){}},format:BIn,inspect:DIn,types:{isAsyncFunction(e){return e instanceof QIn},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:LIn,deprecate(e,t){return e},addAbortListener:require("events").addAbortListener||function(t,r){if(t===void 0)throw new ECe("signal","AbortSignal",t);iSt(t,"signal"),jIn(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[PIn]:!0}),n=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[NIn](){var a;(a=n)===null||a===void 0||a()}}},AbortSignalAny:FIn.any||function(t){if(t.length===1)return t[0];let r=new OIn,n=()=>r.abort();return t.forEach(a=>{iSt(a,"signals"),a.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(a=>a.removeEventListener("abort",n))},{once:!0}),r.signal}};wCe.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var CQ=P((Wbi,hSt)=>{"use strict";var{ArrayIsArray:CCe,ArrayPrototypeIncludes:cSt,ArrayPrototypeJoin:uSt,ArrayPrototypeMap:MIn,NumberIsInteger:_Ce,NumberIsNaN:qIn,NumberMAX_SAFE_INTEGER:UIn,NumberMIN_SAFE_INTEGER:zIn,NumberParseInt:HIn,ObjectPrototypeHasOwnProperty:VIn,RegExpPrototypeExec:lSt,String:$In,StringPrototypeToUpperCase:WIn,StringPrototypeTrim:GIn}=Vu(),{hideStackFrames:nv,codes:{ERR_SOCKET_BAD_PORT:YIn,ERR_INVALID_ARG_TYPE:Fh,ERR_INVALID_ARG_VALUE:SQ,ERR_OUT_OF_RANGE:rP,ERR_UNKNOWN_SIGNAL:sSt}}=Nh(),{normalizeEncoding:JIn}=$m(),{isAsyncFunction:KIn,isArrayBufferView:XIn}=$m().types,aSt={};function ZIn(e){return e===(e|0)}function ekn(e){return e===e>>>0}var tkn=/^[0-7]+$/,rkn="must be a 32-bit unsigned integer or an octal string";function nkn(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(lSt(tkn,e)===null)throw new SQ(t,e,rkn);e=HIn(e,8)}return pSt(e,t),e}var ikn=nv((e,t,r=zIn,n=UIn)=>{if(typeof e!="number")throw new Fh(t,"number",e);if(!_Ce(e))throw new rP(t,"an integer",e);if(e<r||e>n)throw new rP(t,`>= ${r} && <= ${n}`,e)}),skn=nv((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new Fh(t,"number",e);if(!_Ce(e))throw new rP(t,"an integer",e);if(e<r||e>n)throw new rP(t,`>= ${r} && <= ${n}`,e)}),pSt=nv((e,t,r=!1)=>{if(typeof e!="number")throw new Fh(t,"number",e);if(!_Ce(e))throw new rP(t,"an integer",e);let n=r?1:0,a=4294967295;if(e<n||e>a)throw new rP(t,`>= ${n} && <= ${a}`,e)});function ICe(e,t){if(typeof e!="string")throw new Fh(t,"string",e)}function akn(e,t,r=void 0,n){if(typeof e!="number")throw new Fh(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&qIn(e))throw new rP(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}var okn=nv((e,t,r)=>{if(!cSt(r,e)){let a="must be one of: "+uSt(MIn(r,s=>typeof s=="string"?`'${s}'`:$In(s)),", ");throw new SQ(t,e,a)}});function fSt(e,t){if(typeof e!="boolean")throw new Fh(t,"boolean",e)}function SCe(e,t,r){return e==null||!VIn(e,t)?r:e[t]}var ckn=nv((e,t,r=null)=>{let n=SCe(r,"allowArray",!1),a=SCe(r,"allowFunction",!1);if(!SCe(r,"nullable",!1)&&e===null||!n&&CCe(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new Fh(t,"Object",e)}),ukn=nv((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new Fh(t,"a dictionary",e)}),fee=nv((e,t,r=0)=>{if(!CCe(e))throw new Fh(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new SQ(t,e,n)}});function lkn(e,t){fee(e,t);for(let r=0;r<e.length;r++)ICe(e[r],`${t}[${r}]`)}function pkn(e,t){fee(e,t);for(let r=0;r<e.length;r++)fSt(e[r],`${t}[${r}]`)}function fkn(e,t){fee(e,t);for(let r=0;r<e.length;r++){let n=e[r],a=`${t}[${r}]`;if(n==null)throw new Fh(a,"AbortSignal",n);dSt(n,a)}}function dkn(e,t="signal"){if(ICe(e,t),aSt[e]===void 0)throw aSt[WIn(e)]!==void 0?new sSt(e+" (signals must use all capital letters)"):new sSt(e)}var hkn=nv((e,t="buffer")=>{if(!XIn(e))throw new Fh(t,["Buffer","TypedArray","DataView"],e)});function mkn(e,t){let r=JIn(t),n=e.length;if(r==="hex"&&n%2!==0)throw new SQ("encoding",t,`is invalid for data of length ${n}`)}function gkn(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&GIn(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new YIn(t,e,r);return e|0}var dSt=nv((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Fh(t,"AbortSignal",e)}),Akn=nv((e,t)=>{if(typeof e!="function")throw new Fh(t,"Function",e)}),ykn=nv((e,t)=>{if(typeof e!="function"||KIn(e))throw new Fh(t,"Function",e)}),vkn=nv((e,t)=>{if(e!==void 0)throw new Fh(t,"undefined",e)});function xkn(e,t,r){if(!cSt(r,e))throw new Fh(t,`('${uSt(r,"|")}')`,e)}var bkn=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function oSt(e,t){if(typeof e>"u"||!lSt(bkn,e))throw new SQ(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ekn(e){if(typeof e=="string")return oSt(e,"hints"),e;if(CCe(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let a=e[n];oSt(a,"hints"),r+=a,n!==t-1&&(r+=", ")}return r}throw new SQ("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}hSt.exports={isInt32:ZIn,isUint32:ekn,parseFileMode:nkn,validateArray:fee,validateStringArray:lkn,validateBooleanArray:pkn,validateAbortSignalArray:fkn,validateBoolean:fSt,validateBuffer:hkn,validateDictionary:ukn,validateEncoding:mkn,validateFunction:Akn,validateInt32:skn,validateInteger:ikn,validateNumber:akn,validateObject:ckn,validateOneOf:okn,validatePlainFunction:ykn,validatePort:gkn,validateSignalName:dkn,validateString:ICe,validateUint32:pSt,validateUndefined:vkn,validateUnion:xkn,validateAbortSignal:dSt,validateLinkHeaderValue:Ekn}});var k1=P((Gbi,TSt)=>{"use strict";var{SymbolAsyncIterator:mSt,SymbolIterator:gSt,SymbolFor:nP}=Vu(),ASt=nP("nodejs.stream.destroyed"),ySt=nP("nodejs.stream.errored"),kCe=nP("nodejs.stream.readable"),TCe=nP("nodejs.stream.writable"),vSt=nP("nodejs.stream.disturbed"),wkn=nP("nodejs.webstream.isClosedPromise"),Skn=nP("nodejs.webstream.controllerErrorFunction");function dee(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function hee(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function Ckn(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function I1(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function xSt(e){return!!(e&&!I1(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function bSt(e){return!!(e&&!I1(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function ESt(e){return!!(e&&!I1(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function _kn(e){return xSt(e)||bSt(e)||ESt(e)}function Ikn(e,t){return e==null?!1:t===!0?typeof e[mSt]=="function":t===!1?typeof e[gSt]=="function":typeof e[mSt]=="function"||typeof e[gSt]=="function"}function mee(e){if(!I1(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[ASt]||n!=null&&n.destroyed)}function wSt(e){if(!hee(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function kkn(e,t){if(!hee(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function Tkn(e){if(!dee(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function SSt(e,t){if(!dee(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function CSt(e){return e&&e[kCe]!=null?e[kCe]:typeof(e==null?void 0:e.readable)!="boolean"?null:mee(e)?!1:dee(e)&&e.readable&&!SSt(e)}function _St(e){return e&&e[TCe]!=null?e[TCe]:typeof(e==null?void 0:e.writable)!="boolean"?null:mee(e)?!1:hee(e)&&e.writable&&!wSt(e)}function Bkn(e,t){return I1(e)?mee(e)?!0:!((t==null?void 0:t.readable)!==!1&&CSt(e)||(t==null?void 0:t.writable)!==!1&&_St(e)):null}function Dkn(e){var t,r;return I1(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function Pkn(e){var t,r;return I1(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function Rkn(e){if(!I1(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&ISt(e)?e._closed:null}function ISt(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function kSt(e){return typeof e._sent100=="boolean"&&ISt(e)}function Nkn(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function Fkn(e){if(!I1(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&kSt(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Okn(e){var t;return!!(e&&((t=e[vSt])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function Qkn(e){var t,r,n,a,s,c,l,f,d,m;return!!(e&&((t=(r=(n=(a=(s=(c=e[ySt])!==null&&c!==void 0?c:e.readableErrored)!==null&&s!==void 0?s:e.writableErrored)!==null&&a!==void 0?a:(l=e._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(f=e._writableState)===null||f===void 0?void 0:f.errorEmitted)!==null&&r!==void 0?r:(d=e._readableState)===null||d===void 0?void 0:d.errored)!==null&&t!==void 0?t:!((m=e._writableState)===null||m===void 0)&&m.errored))}TSt.exports={isDestroyed:mee,kIsDestroyed:ASt,isDisturbed:Okn,kIsDisturbed:vSt,isErrored:Qkn,kIsErrored:ySt,isReadable:CSt,kIsReadable:kCe,kIsClosedPromise:wkn,kControllerErrorFunction:Skn,kIsWritable:TCe,isClosed:Rkn,isDuplexNodeStream:Ckn,isFinished:Bkn,isIterable:Ikn,isReadableNodeStream:dee,isReadableStream:xSt,isReadableEnded:Tkn,isReadableFinished:SSt,isReadableErrored:Pkn,isNodeStream:I1,isWebStream:_kn,isWritable:_St,isWritableNodeStream:hee,isWritableStream:bSt,isWritableEnded:wSt,isWritableFinished:kkn,isWritableErrored:Dkn,isServerRequest:Nkn,isServerResponse:kSt,willEmitClose:Fkn,isTransformStream:ESt}});var OS=P((Ybi,NCe)=>{"use strict";var jI=mc(),{AbortError:LSt,codes:Lkn}=Nh(),{ERR_INVALID_ARG_TYPE:jkn,ERR_STREAM_PREMATURE_CLOSE:BSt}=Lkn,{kEmptyObject:DCe,once:PCe}=$m(),{validateAbortSignal:Mkn,validateFunction:qkn,validateObject:Ukn,validateBoolean:zkn}=CQ(),{Promise:Hkn,PromisePrototypeThen:Vkn,SymbolDispose:jSt}=Vu(),{isClosed:$kn,isReadable:DSt,isReadableNodeStream:BCe,isReadableStream:Wkn,isReadableFinished:PSt,isReadableErrored:RSt,isWritable:NSt,isWritableNodeStream:FSt,isWritableStream:Gkn,isWritableFinished:OSt,isWritableErrored:QSt,isNodeStream:Ykn,willEmitClose:Jkn,kIsClosedPromise:Kkn}=k1(),_Q;function Xkn(e){return e.setHeader&&typeof e.abort=="function"}var RCe=()=>{};function MSt(e,t,r){var n,a;if(arguments.length===2?(r=t,t=DCe):t==null?t=DCe:Ukn(t,"options"),qkn(r,"callback"),Mkn(t.signal,"options.signal"),r=PCe(r),Wkn(e)||Gkn(e))return Zkn(e,t,r);if(!Ykn(e))throw new jkn("stream",["ReadableStream","WritableStream","Stream"],e);let s=(n=t.readable)!==null&&n!==void 0?n:BCe(e),c=(a=t.writable)!==null&&a!==void 0?a:FSt(e),l=e._writableState,f=e._readableState,d=()=>{e.writable||x()},m=Jkn(e)&&BCe(e)===s&&FSt(e)===c,g=OSt(e,!1),x=()=>{g=!0,e.destroyed&&(m=!1),!(m&&(!e.readable||s))&&(!s||b)&&r.call(e)},b=PSt(e,!1),A=()=>{b=!0,e.destroyed&&(m=!1),!(m&&(!e.writable||c))&&(!c||g)&&r.call(e)},C=W=>{r.call(e,W)},I=$kn(e),k=()=>{I=!0;let W=QSt(e)||RSt(e);if(W&&typeof W!="boolean")return r.call(e,W);if(s&&!b&&BCe(e,!0)&&!PSt(e,!1))return r.call(e,new BSt);if(c&&!g&&!OSt(e,!1))return r.call(e,new BSt);r.call(e)},O=()=>{I=!0;let W=QSt(e)||RSt(e);if(W&&typeof W!="boolean")return r.call(e,W);r.call(e)},j=()=>{e.req.on("finish",x)};Xkn(e)?(e.on("complete",x),m||e.on("abort",k),e.req?j():e.on("request",j)):c&&!l&&(e.on("end",d),e.on("close",d)),!m&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",A),e.on("finish",x),t.error!==!1&&e.on("error",C),e.on("close",k),I?jI.nextTick(k):l!=null&&l.errorEmitted||f!=null&&f.errorEmitted?m||jI.nextTick(O):(!s&&(!m||DSt(e))&&(g||NSt(e)===!1)||!c&&(!m||NSt(e))&&(b||DSt(e)===!1)||f&&e.req&&e.aborted)&&jI.nextTick(O);let M=()=>{r=RCe,e.removeListener("aborted",k),e.removeListener("complete",x),e.removeListener("abort",k),e.removeListener("request",j),e.req&&e.req.removeListener("finish",x),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",x),e.removeListener("end",A),e.removeListener("error",C),e.removeListener("close",k)};if(t.signal&&!I){let W=()=>{let se=r;M(),se.call(e,new LSt(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)jI.nextTick(W);else{_Q=_Q||$m().addAbortListener;let se=_Q(t.signal,W),X=r;r=PCe((...ve)=>{se[jSt](),X.apply(e,ve)})}}return M}function Zkn(e,t,r){let n=!1,a=RCe;if(t.signal)if(a=()=>{n=!0,r.call(e,new LSt(void 0,{cause:t.signal.reason}))},t.signal.aborted)jI.nextTick(a);else{_Q=_Q||$m().addAbortListener;let c=_Q(t.signal,a),l=r;r=PCe((...f)=>{c[jSt](),l.apply(e,f)})}let s=(...c)=>{n||jI.nextTick(()=>r.apply(e,c))};return Vkn(e[Kkn].promise,s,s),RCe}function eTn(e,t){var r;let n=!1;return t===null&&(t=DCe),(r=t)!==null&&r!==void 0&&r.cleanup&&(zkn(t.cleanup,"cleanup"),n=t.cleanup),new Hkn((a,s)=>{let c=MSt(e,t,l=>{n&&c(),l?s(l):a()})})}NCe.exports=MSt;NCe.exports.finished=eTn});var iP=P((Jbi,GSt)=>{"use strict";var T1=mc(),{aggregateTwoErrors:tTn,codes:{ERR_MULTIPLE_CALLBACK:rTn},AbortError:nTn}=Nh(),{Symbol:zSt}=Vu(),{kIsDestroyed:iTn,isDestroyed:sTn,isFinished:aTn,isServerRequest:oTn}=k1(),HSt=zSt("kDestroy"),FCe=zSt("kConstruct");function VSt(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function cTn(e,t){let r=this._readableState,n=this._writableState,a=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(VSt(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?qSt(this,e,t):this.once(HSt,function(s){qSt(this,tTn(s,e),t)}),this)}function qSt(e,t,r){let n=!1;function a(s){if(n)return;n=!0;let c=e._readableState,l=e._writableState;VSt(s,l,c),l&&(l.closed=!0),c&&(c.closed=!0),typeof r=="function"&&r(s),s?T1.nextTick(uTn,e,s):T1.nextTick($St,e)}try{e._destroy(t||null,a)}catch(s){a(s)}}function uTn(e,t){OCe(e,t),$St(e)}function $St(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function OCe(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function lTn(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function QCe(e,t,r){let n=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),n&&!n.errored&&(n.errored=t),r?T1.nextTick(OCe,e,t):OCe(e,t))}function pTn(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(FCe,t),!(e.listenerCount(FCe)>1)&&T1.nextTick(fTn,e)}function fTn(e){let t=!1;function r(n){if(t){QCe(e,n!=null?n:new rTn);return}t=!0;let a=e._readableState,s=e._writableState,c=s||a;a&&(a.constructed=!0),s&&(s.constructed=!0),c.destroyed?e.emit(HSt,n):n?QCe(e,n,!0):T1.nextTick(dTn,e)}try{e._construct(n=>{T1.nextTick(r,n)})}catch(n){T1.nextTick(r,n)}}function dTn(e){e.emit(FCe)}function USt(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function WSt(e){e.emit("close")}function hTn(e,t){e.emit("error",t),T1.nextTick(WSt,e)}function mTn(e,t){!e||sTn(e)||(!t&&!aTn(e)&&(t=new nTn),oTn(e)?(e.socket=null,e.destroy(t)):USt(e)?e.abort():USt(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?T1.nextTick(hTn,e,t):T1.nextTick(WSt,e),e.destroyed||(e[iTn]=!0))}GSt.exports={construct:pTn,destroyer:mTn,destroy:cTn,undestroy:lTn,errorOrDestroy:QCe}});var yee=P((Kbi,JSt)=>{"use strict";var{ArrayIsArray:gTn,ObjectSetPrototypeOf:YSt}=Vu(),{EventEmitter:gee}=require("events");function Aee(e){gee.call(this,e)}YSt(Aee.prototype,gee.prototype);YSt(Aee,gee);Aee.prototype.pipe=function(e,t){let r=this;function n(m){e.writable&&e.write(m)===!1&&r.pause&&r.pause()}r.on("data",n);function a(){r.readable&&r.resume&&r.resume()}e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",c),r.on("close",l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}function f(m){d(),gee.listenerCount(this,"error")===0&&this.emit("error",m)}LCe(r,"error",f),LCe(e,"error",f);function d(){r.removeListener("data",n),e.removeListener("drain",a),r.removeListener("end",c),r.removeListener("close",l),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e};function LCe(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):gTn(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}JSt.exports={Stream:Aee,prependListener:LCe}});var E9=P((Xbi,vee)=>{"use strict";var{SymbolDispose:ATn}=Vu(),{AbortError:KSt,codes:yTn}=Nh(),{isNodeStream:XSt,isWebStream:vTn,kControllerErrorFunction:xTn}=k1(),bTn=OS(),{ERR_INVALID_ARG_TYPE:ZSt}=yTn,jCe,ETn=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new ZSt(t,"AbortSignal",e)};vee.exports.addAbortSignal=function(t,r){if(ETn(t,"signal"),!XSt(r)&&!vTn(r))throw new ZSt("stream",["ReadableStream","WritableStream","Stream"],r);return vee.exports.addAbortSignalNoValidate(t,r)};vee.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=XSt(t)?()=>{t.destroy(new KSt(void 0,{cause:e.reason}))}:()=>{t[xTn](new KSt(void 0,{cause:e.reason}))};if(e.aborted)r();else{jCe=jCe||$m().addAbortListener;let n=jCe(e,r);bTn(t,n[ATn])}return t}});var rCt=P((eEi,tCt)=>{"use strict";var{StringPrototypeSlice:eCt,SymbolIterator:wTn,TypedArrayPrototypeSet:xee,Uint8Array:STn}=Vu(),{Buffer:MCe}=require("buffer"),{inspect:CTn}=$m();tCt.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return MCe.alloc(0);let r=MCe.allocUnsafe(t>>>0),n=this.head,a=0;for(;n;)xee(r,n.data,a),a+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let a=n.slice(0,t);return this.head.data=n.slice(t),a}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[wTn](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,a=0;do{let s=n.data;if(t>s.length)r+=s,t-=s.length;else{t===s.length?(r+=s,++a,n.next?this.head=n.next:this.head=this.tail=null):(r+=eCt(s,0,t),this.head=n,n.data=eCt(s,t));break}++a}while((n=n.next)!==null);return this.length-=a,r}_getBuffer(t){let r=MCe.allocUnsafe(t),n=t,a=this.head,s=0;do{let c=a.data;if(t>c.length)xee(r,c,n-t),t-=c.length;else{t===c.length?(xee(r,c,n-t),++s,a.next?this.head=a.next:this.head=this.tail=null):(xee(r,new STn(c.buffer,c.byteOffset,t),n-t),this.head=a,a.data=c.slice(t));break}++s}while((a=a.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return CTn(this,{...r,depth:0,customInspect:!1})}}});var w9=P((tEi,aCt)=>{"use strict";var{MathFloor:_Tn,NumberIsInteger:ITn}=Vu(),{validateInteger:kTn}=CQ(),{ERR_INVALID_ARG_VALUE:TTn}=Nh().codes,nCt=16*1024,iCt=16;function BTn(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function sCt(e){return e?iCt:nCt}function DTn(e,t){kTn(t,"value",0),e?iCt=t:nCt=t}function PTn(e,t,r,n){let a=BTn(t,n,r);if(a!=null){if(!ITn(a)||a<0){let s=n?`options.${r}`:"options.highWaterMark";throw new TTn(s,a)}return _Tn(a)}return sCt(e.objectMode)}aCt.exports={getHighWaterMark:PTn,getDefaultHighWaterMark:sCt,setDefaultHighWaterMark:DTn}});var qCe=P((rEi,lCt)=>{"use strict";var oCt=mc(),{PromisePrototypeThen:RTn,SymbolAsyncIterator:cCt,SymbolIterator:uCt}=Vu(),{Buffer:NTn}=require("buffer"),{ERR_INVALID_ARG_TYPE:FTn,ERR_STREAM_NULL_VALUES:OTn}=Nh().codes;function QTn(e,t,r){let n;if(typeof t=="string"||t instanceof NTn)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let a;if(t&&t[cCt])a=!0,n=t[cCt]();else if(t&&t[uCt])a=!1,n=t[uCt]();else throw new FTn("iterable",["Iterable"],t);let s=new e({objectMode:!0,highWaterMark:1,...r}),c=!1;s._read=function(){c||(c=!0,f())},s._destroy=function(d,m){RTn(l(d),()=>oCt.nextTick(m,d),g=>oCt.nextTick(m,g||d))};async function l(d){let m=d!=null,g=typeof n.throw=="function";if(m&&g){let{value:x,done:b}=await n.throw(d);if(await x,b)return}if(typeof n.return=="function"){let{value:x}=await n.return();await x}}async function f(){for(;;){try{let{value:d,done:m}=a?await n.next():n.next();if(m)s.push(null);else{let g=d&&typeof d.then=="function"?await d:d;if(g===null)throw c=!1,new OTn;if(s.push(g))continue;c=!1}}catch(d){s.destroy(d)}break}}return s}lCt.exports=QTn});var C9=P((nEi,kCt)=>{"use strict";var ab=mc(),{ArrayPrototypeIndexOf:LTn,NumberIsInteger:jTn,NumberIsNaN:MTn,NumberParseInt:qTn,ObjectDefineProperties:YCe,ObjectKeys:UTn,ObjectSetPrototypeOf:dCt,Promise:hCt,SafeSet:zTn,SymbolAsyncDispose:HTn,SymbolAsyncIterator:VTn,Symbol:$Tn}=Vu();kCt.exports=sa;sa.ReadableState=See;var{EventEmitter:WTn}=require("events"),{Stream:MI,prependListener:GTn}=yee(),{Buffer:UCe}=require("buffer"),{addAbortSignal:YTn}=E9(),mCt=OS(),Wa=$m().debuglog("stream",e=>{Wa=e}),JTn=rCt(),TQ=iP(),{getHighWaterMark:KTn,getDefaultHighWaterMark:XTn}=w9(),{aggregateTwoErrors:pCt,codes:{ERR_INVALID_ARG_TYPE:ZTn,ERR_METHOD_NOT_IMPLEMENTED:eBn,ERR_OUT_OF_RANGE:tBn,ERR_STREAM_PUSH_AFTER_EOF:rBn,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:nBn},AbortError:iBn}=Nh(),{validateObject:sBn}=CQ(),sP=$Tn("kPaused"),{StringDecoder:gCt}=p5(),aBn=qCe();dCt(sa.prototype,MI.prototype);dCt(sa,MI);var zCe=()=>{},{errorOrDestroy:IQ}=TQ,kQ=1,oBn=2,ACt=4,S9=8,yCt=16,bee=32,Eee=64,vCt=128,cBn=256,uBn=512,lBn=1024,WCe=2048,GCe=4096,pBn=8192,fBn=16384,dBn=32768,xCt=65536,hBn=1<<17,mBn=1<<18;function of(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}YCe(See.prototype,{objectMode:of(kQ),ended:of(oBn),endEmitted:of(ACt),reading:of(S9),constructed:of(yCt),sync:of(bee),needReadable:of(Eee),emittedReadable:of(vCt),readableListening:of(cBn),resumeScheduled:of(uBn),errorEmitted:of(lBn),emitClose:of(WCe),autoDestroy:of(GCe),destroyed:of(pBn),closed:of(fBn),closeEmitted:of(dBn),multiAwaitDrain:of(xCt),readingMore:of(hBn),dataEmitted:of(mBn)});function See(e,t,r){typeof r!="boolean"&&(r=t instanceof B1()),this.state=WCe|GCe|yCt|bee,e&&e.objectMode&&(this.state|=kQ),r&&e&&e.readableObjectMode&&(this.state|=kQ),this.highWaterMark=e?KTn(this,e,"readableHighWaterMark",r):XTn(!1),this.buffer=new JTn,this.length=0,this.pipes=[],this.flowing=null,this[sP]=null,e&&e.emitClose===!1&&(this.state&=~WCe),e&&e.autoDestroy===!1&&(this.state&=~GCe),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new gCt(e.encoding),this.encoding=e.encoding)}function sa(e){if(!(this instanceof sa))return new sa(e);let t=this instanceof B1();this._readableState=new See(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&YTn(e.signal,this)),MI.call(this,e),TQ.construct(this,()=>{this._readableState.needReadable&&wee(this,this._readableState)})}sa.prototype.destroy=TQ.destroy;sa.prototype._undestroy=TQ.undestroy;sa.prototype._destroy=function(e,t){t(e)};sa.prototype[WTn.captureRejectionSymbol]=function(e){this.destroy(e)};sa.prototype[HTn]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new iBn,this.destroy(e)),new hCt((t,r)=>mCt(this,n=>n&&n!==e?r(n):t(null)))};sa.prototype.push=function(e,t){return bCt(this,e,t,!1)};sa.prototype.unshift=function(e,t){return bCt(this,e,t,!0)};function bCt(e,t,r,n){Wa("readableAddChunk",t);let a=e._readableState,s;if(a.state&kQ||(typeof t=="string"?(r=r||a.defaultEncoding,a.encoding!==r&&(n&&a.encoding?t=UCe.from(t,r).toString(a.encoding):(t=UCe.from(t,r),r=""))):t instanceof UCe?r="":MI._isUint8Array(t)?(t=MI._uint8ArrayToBuffer(t),r=""):t!=null&&(s=new ZTn("chunk",["string","Buffer","Uint8Array"],t))),s)IQ(e,s);else if(t===null)a.state&=~S9,yBn(e,a);else if(a.state&kQ||t&&t.length>0)if(n)if(a.state&ACt)IQ(e,new nBn);else{if(a.destroyed||a.errored)return!1;HCe(e,a,t,!0)}else if(a.ended)IQ(e,new rBn);else{if(a.destroyed||a.errored)return!1;a.state&=~S9,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?HCe(e,a,t,!1):wee(e,a)):HCe(e,a,t,!1)}else n||(a.state&=~S9,wee(e,a));return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function HCe(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&xCt?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&Eee&&Cee(e)),wee(e,t)}sa.prototype.isPaused=function(){let e=this._readableState;return e[sP]===!0||e.flowing===!1};sa.prototype.setEncoding=function(e){let t=new gCt(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let a of r)n+=t.write(a);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var gBn=1073741824;function ABn(e){if(e>gBn)throw new tBn("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function fCt(e,t){return e<=0||t.length===0&&t.ended?0:t.state&kQ?1:MTn(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}sa.prototype.read=function(e){Wa("read",e),e===void 0?e=NaN:jTn(e)||(e=qTn(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=ABn(e)),e!==0&&(t.state&=~vCt),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Wa("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?VCe(this):Cee(this),null;if(e=fCt(e,t),e===0&&t.ended)return t.length===0&&VCe(this),null;let n=(t.state&Eee)!==0;if(Wa("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Wa("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,Wa("reading, ended or constructing",n);else if(n){Wa("do read"),t.state|=S9|bee,t.length===0&&(t.state|=Eee);try{this._read(t.highWaterMark)}catch(s){IQ(this,s)}t.state&=~bee,t.reading||(e=fCt(r,t))}let a;return e>0?a=_Ct(e,t):a=null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&VCe(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",a)),a};function yBn(e,t){if(Wa("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Cee(e):(t.needReadable=!1,t.emittedReadable=!0,ECt(e))}}function Cee(e){let t=e._readableState;Wa("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Wa("emitReadable",t.flowing),t.emittedReadable=!0,ab.nextTick(ECt,e))}function ECt(e){let t=e._readableState;Wa("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,SCt(e)}function wee(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,ab.nextTick(vBn,e,t))}function vBn(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(Wa("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}sa.prototype._read=function(e){throw new eBn("_read()")};sa.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new zTn(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),Wa("pipe count=%d opts=%j",n.pipes.length,t);let s=(!t||t.end!==!1)&&e!==ab.stdout&&e!==ab.stderr?l:I;n.endEmitted?ab.nextTick(s):r.once("end",s),e.on("unpipe",c);function c(k,O){Wa("onunpipe"),k===r&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,m())}function l(){Wa("onend"),e.end()}let f,d=!1;function m(){Wa("cleanup"),e.removeListener("close",A),e.removeListener("finish",C),f&&e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",I),r.removeListener("data",x),d=!0,f&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&f()}function g(){d||(n.pipes.length===1&&n.pipes[0]===e?(Wa("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(Wa("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),f||(f=xBn(r,e),e.on("drain",f))}r.on("data",x);function x(k){Wa("ondata");let O=e.write(k);Wa("dest.write",O),O===!1&&g()}function b(k){if(Wa("onerror",k),I(),e.removeListener("error",b),e.listenerCount("error")===0){let O=e._writableState||e._readableState;O&&!O.errorEmitted?IQ(e,k):e.emit("error",k)}}GTn(e,"error",b);function A(){e.removeListener("finish",C),I()}e.once("close",A);function C(){Wa("onfinish"),e.removeListener("close",A),I()}e.once("finish",C);function I(){Wa("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?g():n.flowing||(Wa("pipe resume"),r.resume()),e};function xBn(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(Wa("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(Wa("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}sa.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let a=t.pipes;t.pipes=[],this.pause();for(let s=0;s<a.length;s++)a[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=LTn(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};sa.prototype.on=function(e,t){let r=MI.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,Wa("on readable",n.length,n.reading),n.length?Cee(this):n.reading||ab.nextTick(bBn,this)),r};sa.prototype.addListener=sa.prototype.on;sa.prototype.removeListener=function(e,t){let r=MI.prototype.removeListener.call(this,e,t);return e==="readable"&&ab.nextTick(wCt,this),r};sa.prototype.off=sa.prototype.removeListener;sa.prototype.removeAllListeners=function(e){let t=MI.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&ab.nextTick(wCt,this),t};function wCt(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[sP]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function bBn(e){Wa("readable nexttick read 0"),e.read(0)}sa.prototype.resume=function(){let e=this._readableState;return e.flowing||(Wa("resume"),e.flowing=!e.readableListening,EBn(this,e)),e[sP]=!1,this};function EBn(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ab.nextTick(wBn,e,t))}function wBn(e,t){Wa("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),SCt(e),t.flowing&&!t.reading&&e.read(0)}sa.prototype.pause=function(){return Wa("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Wa("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[sP]=!0,this};function SCt(e){let t=e._readableState;for(Wa("flow",t.flowing);t.flowing&&e.read()!==null;);}sa.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{IQ(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=UTn(e);for(let n=1;n<r.length;n++){let a=r[n];this[a]===void 0&&typeof e[a]=="function"&&(this[a]=e[a].bind(e))}return this};sa.prototype[VTn]=function(){return CCt(this)};sa.prototype.iterator=function(e){return e!==void 0&&sBn(e,"options"),CCt(this,e)};function CCt(e,t){typeof e.read!="function"&&(e=sa.wrap(e,{objectMode:!0}));let r=SBn(e,t);return r.stream=e,r}async function*SBn(e,t){let r=zCe;function n(c){this===e?(r(),r=zCe):r=c}e.on("readable",n);let a,s=mCt(e,{writable:!1},c=>{a=c?pCt(a,c):null,r(),r=zCe});try{for(;;){let c=e.destroyed?null:e.read();if(c!==null)yield c;else{if(a)throw a;if(a===null)return;await new hCt(n)}}}catch(c){throw a=pCt(a,c),a}finally{(a||(t==null?void 0:t.destroyOnReturn)!==!1)&&(a===void 0||e._readableState.autoDestroy)?TQ.destroyer(e,null):(e.off("readable",n),s())}}YCe(sa.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});YCe(See.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[sP]!==!1},set(e){this[sP]=!!e}}});sa._fromList=_Ct;function _Ct(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function VCe(e){let t=e._readableState;Wa("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,ab.nextTick(CBn,t,e))}function CBn(e,t){if(Wa("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)ab.nextTick(_Bn,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function _Bn(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}sa.from=function(e,t){return aBn(sa,e,t)};var $Ce;function ICt(){return $Ce===void 0&&($Ce={}),$Ce}sa.fromWeb=function(e,t){return ICt().newStreamReadableFromReadableStream(e,t)};sa.toWeb=function(e,t){return ICt().newReadableStreamFromStreamReadable(e,t)};sa.wrap=function(e,t){var r,n;return new sa({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(a,s){TQ.destroyer(e,a),s(a)}}).wrap(e)}});var Bee=P((iEi,MCt)=>{"use strict";var aP=mc(),{ArrayPrototypeSlice:DCt,Error:IBn,FunctionPrototypeSymbolHasInstance:PCt,ObjectDefineProperty:RCt,ObjectDefineProperties:kBn,ObjectSetPrototypeOf:NCt,StringPrototypeToLowerCase:TBn,Symbol:BBn,SymbolHasInstance:DBn}=Vu();MCt.exports=Al;Al.WritableState=k9;var{EventEmitter:PBn}=require("events"),_9=yee().Stream,{Buffer:_ee}=require("buffer"),Tee=iP(),{addAbortSignal:RBn}=E9(),{getHighWaterMark:NBn,getDefaultHighWaterMark:FBn}=w9(),{ERR_INVALID_ARG_TYPE:OBn,ERR_METHOD_NOT_IMPLEMENTED:QBn,ERR_MULTIPLE_CALLBACK:FCt,ERR_STREAM_CANNOT_PIPE:LBn,ERR_STREAM_DESTROYED:I9,ERR_STREAM_ALREADY_FINISHED:jBn,ERR_STREAM_NULL_VALUES:MBn,ERR_STREAM_WRITE_AFTER_END:qBn,ERR_UNKNOWN_ENCODING:OCt}=Nh().codes,{errorOrDestroy:BQ}=Tee;NCt(Al.prototype,_9.prototype);NCt(Al,_9);function XCe(){}var DQ=BBn("kOnFinished");function k9(e,t,r){typeof r!="boolean"&&(r=t instanceof B1()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?NBn(this,e,"writableHighWaterMark",r):FBn(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=zBn.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,kee(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[DQ]=[]}function kee(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}k9.prototype.getBuffer=function(){return DCt(this.buffered,this.bufferedIndex)};RCt(k9.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Al(e){let t=this instanceof B1();if(!t&&!PCt(Al,this))return new Al(e);this._writableState=new k9(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&RBn(e.signal,this)),_9.call(this,e),Tee.construct(this,()=>{let r=this._writableState;r.writing||e_e(this,r),t_e(this,r)})}RCt(Al,DBn,{__proto__:null,value:function(e){return PCt(this,e)?!0:this!==Al?!1:e&&e._writableState instanceof k9}});Al.prototype.pipe=function(){BQ(this,new LBn)};function QCt(e,t,r,n){let a=e._writableState;if(typeof r=="function")n=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!=="buffer"&&!_ee.isEncoding(r))throw new OCt(r);typeof n!="function"&&(n=XCe)}if(t===null)throw new MBn;if(!a.objectMode)if(typeof t=="string")a.decodeStrings!==!1&&(t=_ee.from(t,r),r="buffer");else if(t instanceof _ee)r="buffer";else if(_9._isUint8Array(t))t=_9._uint8ArrayToBuffer(t),r="buffer";else throw new OBn("chunk",["string","Buffer","Uint8Array"],t);let s;return a.ending?s=new qBn:a.destroyed&&(s=new I9("write")),s?(aP.nextTick(n,s),BQ(e,s,!0),s):(a.pendingcb++,UBn(e,a,t,r,n))}Al.prototype.write=function(e,t,r){return QCt(this,e,t,r)===!0};Al.prototype.cork=function(){this._writableState.corked++};Al.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||e_e(this,e))};Al.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=TBn(t)),!_ee.isEncoding(t))throw new OCt(t);return this._writableState.defaultEncoding=t,this};function UBn(e,t,r,n,a){let s=t.objectMode?1:r.length;t.length+=s;let c=t.length<t.highWaterMark;return c||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:a}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&a!==XCe&&(t.allNoop=!1)):(t.writelen=s,t.writecb=a,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),c&&!t.errored&&!t.destroyed}function TCt(e,t,r,n,a,s,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new I9("write")):r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}function BCt(e,t,r,n){--t.pendingcb,n(r),ZCe(t),BQ(e,r)}function zBn(e,t){let r=e._writableState,n=r.sync,a=r.writecb;if(typeof a!="function"){BQ(e,new FCt);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?aP.nextTick(BCt,e,r,t,a):BCt(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&e_e(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},aP.nextTick(HBn,r.afterWriteTickInfo)):LCt(e,r,1,a))}function HBn({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,LCt(e,t,r,n)}function LCt(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&ZCe(t),t_e(e,t)}function ZCe(e){if(e.writing)return;for(let a=e.bufferedIndex;a<e.buffered.length;++a){var t;let{chunk:s,callback:c}=e.buffered[a],l=e.objectMode?1:s.length;e.length-=l,c((t=e.errored)!==null&&t!==void 0?t:new I9("write"))}let r=e[DQ].splice(0);for(let a=0;a<r.length;a++){var n;r[a]((n=e.errored)!==null&&n!==void 0?n:new I9("end"))}kee(e)}function e_e(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:a}=t,s=r.length-n;if(!s)return;let c=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let l=t.allNoop?XCe:d=>{for(let m=c;m<r.length;++m)r[m].callback(d)},f=t.allNoop&&c===0?r:DCt(r,c);f.allBuffers=t.allBuffers,TCt(e,t,!0,t.length,f,"",l),kee(t)}else{do{let{chunk:l,encoding:f,callback:d}=r[c];r[c++]=null;let m=a?1:l.length;TCt(e,t,!1,m,l,f,d)}while(c<r.length&&!t.writing);c===r.length?kee(t):c>256?(r.splice(0,c),t.bufferedIndex=0):t.bufferedIndex=c}t.bufferProcessing=!1}Al.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new QBn("_write()")};Al.prototype._writev=null;Al.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let a;if(e!=null){let s=QCt(this,e,t);s instanceof IBn&&(a=s)}return n.corked&&(n.corked=1,this.uncork()),a||(!n.errored&&!n.ending?(n.ending=!0,t_e(this,n,!0),n.ended=!0):n.finished?a=new jBn("end"):n.destroyed&&(a=new I9("end"))),typeof r=="function"&&(a||n.finished?aP.nextTick(r,a):n[DQ].push(r)),this};function Iee(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function VBn(e,t){let r=!1;function n(a){if(r){BQ(e,a!=null?a:FCt());return}if(r=!0,t.pendingcb--,a){let s=t[DQ].splice(0);for(let c=0;c<s.length;c++)s[c](a);BQ(e,a,t.sync)}else Iee(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,aP.nextTick(KCe,e,t))}t.sync=!0,t.pendingcb++;try{e._final(n)}catch(a){n(a)}t.sync=!1}function $Bn(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,VBn(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function t_e(e,t,r){Iee(t)&&($Bn(e,t),t.pendingcb===0&&(r?(t.pendingcb++,aP.nextTick((n,a)=>{Iee(a)?KCe(n,a):a.pendingcb--},e,t)):Iee(t)&&(t.pendingcb++,KCe(e,t))))}function KCe(e,t){t.pendingcb--,t.finished=!0;let r=t[DQ].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}kBn(Al.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var WBn=Tee.destroy;Al.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[DQ].length)&&aP.nextTick(ZCe,r),WBn.call(this,e,t),this};Al.prototype._undestroy=Tee.undestroy;Al.prototype._destroy=function(e,t){t(e)};Al.prototype[PBn.captureRejectionSymbol]=function(e){this.destroy(e)};var JCe;function jCt(){return JCe===void 0&&(JCe={}),JCe}Al.fromWeb=function(e,t){return jCt().newStreamWritableFromWritableStream(e,t)};Al.toWeb=function(e){return jCt().newWritableStreamFromStreamWritable(e)}});var t_t=P((sEi,e_t)=>{var r_e=mc(),GBn=require("buffer"),{isReadable:YBn,isWritable:JBn,isIterable:qCt,isNodeStream:KBn,isReadableNodeStream:UCt,isWritableNodeStream:zCt,isDuplexNodeStream:XBn,isReadableStream:HCt,isWritableStream:VCt}=k1(),$Ct=OS(),{AbortError:XCt,codes:{ERR_INVALID_ARG_TYPE:ZBn,ERR_INVALID_RETURN_VALUE:WCt}}=Nh(),{destroyer:RQ}=iP(),eDn=B1(),ZCt=C9(),tDn=Bee(),{createDeferredPromise:GCt}=$m(),YCt=qCe(),JCt=globalThis.Blob||GBn.Blob,rDn=typeof JCt<"u"?function(t){return t instanceof JCt}:function(t){return!1},nDn=globalThis.AbortController||lp().AbortController,{FunctionPrototypeCall:KCt}=Vu(),qI=class extends eDn{constructor(t){super(t),(t==null?void 0:t.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(t==null?void 0:t.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};e_t.exports=function e(t,r){if(XBn(t))return t;if(UCt(t))return PQ({readable:t});if(zCt(t))return PQ({writable:t});if(KBn(t))return PQ({writable:!1,readable:!1});if(HCt(t))return PQ({readable:ZCt.fromWeb(t)});if(VCt(t))return PQ({writable:tDn.fromWeb(t)});if(typeof t=="function"){let{value:a,write:s,final:c,destroy:l}=iDn(t);if(qCt(a))return YCt(qI,a,{objectMode:!0,write:s,final:c,destroy:l});let f=a==null?void 0:a.then;if(typeof f=="function"){let d,m=KCt(f,a,g=>{if(g!=null)throw new WCt("nully","body",g)},g=>{RQ(d,g)});return d=new qI({objectMode:!0,readable:!1,write:s,final(g){c(async()=>{try{await m,r_e.nextTick(g,null)}catch(x){r_e.nextTick(g,x)}})},destroy:l})}throw new WCt("Iterable, AsyncIterable or AsyncFunction",r,a)}if(rDn(t))return e(t.arrayBuffer());if(qCt(t))return YCt(qI,t,{objectMode:!0,writable:!1});if(HCt(t==null?void 0:t.readable)&&VCt(t==null?void 0:t.writable))return qI.fromWeb(t);if(typeof(t==null?void 0:t.writable)=="object"||typeof(t==null?void 0:t.readable)=="object"){let a=t!=null&&t.readable?UCt(t==null?void 0:t.readable)?t==null?void 0:t.readable:e(t.readable):void 0,s=t!=null&&t.writable?zCt(t==null?void 0:t.writable)?t==null?void 0:t.writable:e(t.writable):void 0;return PQ({readable:a,writable:s})}let n=t==null?void 0:t.then;if(typeof n=="function"){let a;return KCt(n,t,s=>{s!=null&&a.push(s),a.push(null)},s=>{RQ(a,s)}),a=new qI({objectMode:!0,writable:!1,read(){}})}throw new ZBn(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function iDn(e){let{promise:t,resolve:r}=GCt(),n=new nDn,a=n.signal;return{value:e(async function*(){for(;;){let c=t;t=null;let{chunk:l,done:f,cb:d}=await c;if(r_e.nextTick(d),f)return;if(a.aborted)throw new XCt(void 0,{cause:a.reason});({promise:t,resolve:r}=GCt()),yield l}}(),{signal:a}),write(c,l,f){let d=r;r=null,d({chunk:c,done:!1,cb:f})},final(c){let l=r;r=null,l({done:!0,cb:c})},destroy(c,l){n.abort(),l(c)}}}function PQ(e){let t=e.readable&&typeof e.readable.read!="function"?ZCt.wrap(e.readable):e.readable,r=e.writable,n=!!YBn(t),a=!!JBn(r),s,c,l,f,d;function m(g){let x=f;f=null,x?x(g):g&&d.destroy(g)}return d=new qI({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:a}),a&&($Ct(r,g=>{a=!1,g&&RQ(t,g),m(g)}),d._write=function(g,x,b){r.write(g,x)?b():s=b},d._final=function(g){r.end(),c=g},r.on("drain",function(){if(s){let g=s;s=null,g()}}),r.on("finish",function(){if(c){let g=c;c=null,g()}})),n&&($Ct(t,g=>{n=!1,g&&RQ(t,g),m(g)}),t.on("readable",function(){if(l){let g=l;l=null,g()}}),t.on("end",function(){d.push(null)}),d._read=function(){for(;;){let g=t.read();if(g===null){l=d._read;return}if(!d.push(g))return}}),d._destroy=function(g,x){!g&&f!==null&&(g=new XCt),l=null,s=null,c=null,f===null?x(g):(f=x,RQ(r,g),RQ(t,g))},d}});var B1=P((aEi,i_t)=>{"use strict";var{ObjectDefineProperties:sDn,ObjectGetOwnPropertyDescriptor:QS,ObjectKeys:aDn,ObjectSetPrototypeOf:r_t}=Vu();i_t.exports=ob;var s_e=C9(),iv=Bee();r_t(ob.prototype,s_e.prototype);r_t(ob,s_e);{let e=aDn(iv.prototype);for(let t=0;t<e.length;t++){let r=e[t];ob.prototype[r]||(ob.prototype[r]=iv.prototype[r])}}function ob(e){if(!(this instanceof ob))return new ob(e);s_e.call(this,e),iv.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}sDn(ob.prototype,{writable:{__proto__:null,...QS(iv.prototype,"writable")},writableHighWaterMark:{__proto__:null,...QS(iv.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...QS(iv.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...QS(iv.prototype,"writableBuffer")},writableLength:{__proto__:null,...QS(iv.prototype,"writableLength")},writableFinished:{__proto__:null,...QS(iv.prototype,"writableFinished")},writableCorked:{__proto__:null,...QS(iv.prototype,"writableCorked")},writableEnded:{__proto__:null,...QS(iv.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...QS(iv.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var n_e;function n_t(){return n_e===void 0&&(n_e={}),n_e}ob.fromWeb=function(e,t){return n_t().newStreamDuplexFromReadableWritablePair(e,t)};ob.toWeb=function(e){return n_t().newReadableWritablePairFromDuplex(e)};var i_e;ob.from=function(e){return i_e||(i_e=t_t()),i_e(e,"body")}});var c_e=P((oEi,a_t)=>{"use strict";var{ObjectSetPrototypeOf:s_t,Symbol:oDn}=Vu();a_t.exports=LS;var{ERR_METHOD_NOT_IMPLEMENTED:cDn}=Nh().codes,o_e=B1(),{getHighWaterMark:uDn}=w9();s_t(LS.prototype,o_e.prototype);s_t(LS,o_e);var T9=oDn("kCallback");function LS(e){if(!(this instanceof LS))return new LS(e);let t=e?uDn(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o_e.call(this,e),this._readableState.sync=!1,this[T9]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",lDn)}function a_e(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function lDn(){this._final!==a_e&&a_e.call(this)}LS.prototype._final=a_e;LS.prototype._transform=function(e,t,r){throw new cDn("_transform()")};LS.prototype._write=function(e,t,r){let n=this._readableState,a=this._writableState,s=n.length;this._transform(e,t,(c,l)=>{if(c){r(c);return}l!=null&&this.push(l),a.ended||s===n.length||n.length<n.highWaterMark?r():this[T9]=r})};LS.prototype._read=function(){if(this[T9]){let e=this[T9];this[T9]=null,e()}}});var l_e=P((cEi,c_t)=>{"use strict";var{ObjectSetPrototypeOf:o_t}=Vu();c_t.exports=NQ;var u_e=c_e();o_t(NQ.prototype,u_e.prototype);o_t(NQ,u_e);function NQ(e){if(!(this instanceof NQ))return new NQ(e);u_e.call(this,e)}NQ.prototype._transform=function(e,t,r){r(null,e)}});var Nee=P((uEi,d_t)=>{var B9=mc(),{ArrayIsArray:pDn,Promise:fDn,SymbolAsyncIterator:dDn,SymbolDispose:hDn}=Vu(),Ree=OS(),{once:mDn}=$m(),gDn=iP(),u_t=B1(),{aggregateTwoErrors:ADn,codes:{ERR_INVALID_ARG_TYPE:v_e,ERR_INVALID_RETURN_VALUE:p_e,ERR_MISSING_ARGS:yDn,ERR_STREAM_DESTROYED:vDn,ERR_STREAM_PREMATURE_CLOSE:xDn},AbortError:bDn}=Nh(),{validateFunction:EDn,validateAbortSignal:wDn}=CQ(),{isIterable:oP,isReadable:f_e,isReadableNodeStream:Pee,isNodeStream:l_t,isTransformStream:FQ,isWebStream:SDn,isReadableStream:d_e,isReadableFinished:CDn}=k1(),_Dn=globalThis.AbortController||lp().AbortController,h_e,m_e,g_e;function p_t(e,t,r){let n=!1;e.on("close",()=>{n=!0});let a=Ree(e,{readable:t,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,gDn.destroyer(e,s||new vDn("pipe")))},cleanup:a}}function IDn(e){return EDn(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function A_e(e){if(oP(e))return e;if(Pee(e))return kDn(e);throw new v_e("val",["Readable","Iterable","AsyncIterable"],e)}async function*kDn(e){m_e||(m_e=C9()),yield*m_e.prototype[dDn].call(e)}async function Dee(e,t,r,{end:n}){let a,s=null,c=d=>{if(d&&(a=d),s){let m=s;s=null,m()}},l=()=>new fDn((d,m)=>{a?m(a):s=()=>{a?m(a):d()}});t.on("drain",c);let f=Ree(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let d of e)t.write(d)||await l();n&&(t.end(),await l()),r()}catch(d){r(a!==d?ADn(a,d):d)}finally{f(),t.off("drain",c)}}async function y_e(e,t,r,{end:n}){FQ(t)&&(t=t.writable);let a=t.getWriter();try{for await(let s of e)await a.ready,a.write(s).catch(()=>{});await a.ready,n&&await a.close(),r()}catch(s){try{await a.abort(s),r(s)}catch(c){r(c)}}}function TDn(...e){return f_t(e,mDn(IDn(e)))}function f_t(e,t,r){if(e.length===1&&pDn(e[0])&&(e=e[0]),e.length<2)throw new yDn("streams");let n=new _Dn,a=n.signal,s=r==null?void 0:r.signal,c=[];wDn(s,"options.signal");function l(){A(new bDn)}g_e=g_e||$m().addAbortListener;let f;s&&(f=g_e(s,l));let d,m,g=[],x=0;function b(j){A(j,--x===0)}function A(j,M){var W;if(j&&(!d||d.code==="ERR_STREAM_PREMATURE_CLOSE")&&(d=j),!(!d&&!M)){for(;g.length;)g.shift()(d);(W=f)===null||W===void 0||W[hDn](),n.abort(),M&&(d||c.forEach(se=>se()),B9.nextTick(t,d,m))}}let C;for(let j=0;j<e.length;j++){let M=e[j],W=j<e.length-1,se=j>0,X=W||(r==null?void 0:r.end)!==!1,ve=j===e.length-1;if(l_t(M)){let ae=function(he){he&&he.name!=="AbortError"&&he.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(he)};var O=ae;if(X){let{destroy:he,cleanup:me}=p_t(M,W,se);g.push(he),f_e(M)&&ve&&c.push(me)}M.on("error",ae),f_e(M)&&ve&&c.push(()=>{M.removeListener("error",ae)})}if(j===0)if(typeof M=="function"){if(C=M({signal:a}),!oP(C))throw new p_e("Iterable, AsyncIterable or Stream","source",C)}else oP(M)||Pee(M)||FQ(M)?C=M:C=u_t.from(M);else if(typeof M=="function"){if(FQ(C)){var I;C=A_e((I=C)===null||I===void 0?void 0:I.readable)}else C=A_e(C);if(C=M(C,{signal:a}),W){if(!oP(C,!0))throw new p_e("AsyncIterable",`transform[${j-1}]`,C)}else{var k;h_e||(h_e=l_e());let ae=new h_e({objectMode:!0}),he=(k=C)===null||k===void 0?void 0:k.then;if(typeof he=="function")x++,he.call(C,ue=>{m=ue,ue!=null&&ae.write(ue),X&&ae.end(),B9.nextTick(b)},ue=>{ae.destroy(ue),B9.nextTick(b,ue)});else if(oP(C,!0))x++,Dee(C,ae,b,{end:X});else if(d_e(C)||FQ(C)){let ue=C.readable||C;x++,Dee(ue,ae,b,{end:X})}else throw new p_e("AsyncIterable or Promise","destination",C);C=ae;let{destroy:me,cleanup:ye}=p_t(C,!1,!0);g.push(me),ve&&c.push(ye)}}else if(l_t(M)){if(Pee(C)){x+=2;let ae=BDn(C,M,b,{end:X});f_e(M)&&ve&&c.push(ae)}else if(FQ(C)||d_e(C)){let ae=C.readable||C;x++,Dee(ae,M,b,{end:X})}else if(oP(C))x++,Dee(C,M,b,{end:X});else throw new v_e("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=M}else if(SDn(M)){if(Pee(C))x++,y_e(A_e(C),M,b,{end:X});else if(d_e(C)||oP(C))x++,y_e(C,M,b,{end:X});else if(FQ(C))x++,y_e(C.readable,M,b,{end:X});else throw new v_e("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=M}else C=u_t.from(M)}return(a!=null&&a.aborted||s!=null&&s.aborted)&&B9.nextTick(l),C}function BDn(e,t,r,{end:n}){let a=!1;if(t.on("close",()=>{a||r(new xDn)}),e.pipe(t,{end:!1}),n){let c=function(){a=!0,t.end()};var s=c;CDn(e)?B9.nextTick(c):e.once("end",c)}else r();return Ree(e,{readable:!0,writable:!1},c=>{let l=e._readableState;c&&c.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?e.once("end",r).once("error",r):r(c)}),Ree(t,{readable:!1,writable:!0},r)}d_t.exports={pipelineImpl:f_t,pipeline:TDn}});var b_e=P((lEi,v_t)=>{"use strict";var{pipeline:DDn}=Nee(),Fee=B1(),{destroyer:PDn}=iP(),{isNodeStream:Oee,isReadable:h_t,isWritable:m_t,isWebStream:x_e,isTransformStream:cP,isWritableStream:g_t,isReadableStream:A_t}=k1(),{AbortError:RDn,codes:{ERR_INVALID_ARG_VALUE:y_t,ERR_MISSING_ARGS:NDn}}=Nh(),FDn=OS();v_t.exports=function(...t){if(t.length===0)throw new NDn("streams");if(t.length===1)return Fee.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=Fee.from(t[0])),typeof t[t.length-1]=="function"){let b=t.length-1;t[b]=Fee.from(t[b])}for(let b=0;b<t.length;++b)if(!(!Oee(t[b])&&!x_e(t[b]))){if(b<t.length-1&&!(h_t(t[b])||A_t(t[b])||cP(t[b])))throw new y_t(`streams[${b}]`,r[b],"must be readable");if(b>0&&!(m_t(t[b])||g_t(t[b])||cP(t[b])))throw new y_t(`streams[${b}]`,r[b],"must be writable")}let n,a,s,c,l;function f(b){let A=c;c=null,A?A(b):b?l.destroy(b):!x&&!g&&l.destroy()}let d=t[0],m=DDn(t,f),g=!!(m_t(d)||g_t(d)||cP(d)),x=!!(h_t(m)||A_t(m)||cP(m));if(l=new Fee({writableObjectMode:!!(d!=null&&d.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:g,readable:x}),g){if(Oee(d))l._write=function(A,C,I){d.write(A,C)?I():n=I},l._final=function(A){d.end(),a=A},d.on("drain",function(){if(n){let A=n;n=null,A()}});else if(x_e(d)){let C=(cP(d)?d.writable:d).getWriter();l._write=async function(I,k,O){try{await C.ready,C.write(I).catch(()=>{}),O()}catch(j){O(j)}},l._final=async function(I){try{await C.ready,C.close().catch(()=>{}),a=I}catch(k){I(k)}}}let b=cP(m)?m.readable:m;FDn(b,()=>{if(a){let A=a;a=null,A()}})}if(x){if(Oee(m))m.on("readable",function(){if(s){let b=s;s=null,b()}}),m.on("end",function(){l.push(null)}),l._read=function(){for(;;){let b=m.read();if(b===null){s=l._read;return}if(!l.push(b))return}};else if(x_e(m)){let A=(cP(m)?m.readable:m).getReader();l._read=async function(){for(;;)try{let{value:C,done:I}=await A.read();if(!l.push(C))return;if(I){l.push(null);return}}catch{return}}}}return l._destroy=function(b,A){!b&&c!==null&&(b=new RDn),s=null,n=null,a=null,c===null?A(b):(c=A,Oee(m)&&PDn(m,b))},l}});var T_t=P((pEi,S_e)=>{"use strict";var ODn=globalThis.AbortController||lp().AbortController,{codes:{ERR_INVALID_ARG_VALUE:QDn,ERR_INVALID_ARG_TYPE:D9,ERR_MISSING_ARGS:LDn,ERR_OUT_OF_RANGE:jDn},AbortError:D1}=Nh(),{validateAbortSignal:uP,validateInteger:x_t,validateObject:lP}=CQ(),MDn=Vu().Symbol("kWeak"),qDn=Vu().Symbol("kResistStopPropagation"),{finished:UDn}=OS(),zDn=b_e(),{addAbortSignalNoValidate:HDn}=E9(),{isWritable:VDn,isNodeStream:$Dn}=k1(),{deprecate:WDn}=$m(),{ArrayPrototypePush:GDn,Boolean:YDn,MathFloor:b_t,Number:JDn,NumberIsNaN:KDn,Promise:E_t,PromiseReject:w_t,PromiseResolve:XDn,PromisePrototypeThen:S_t,Symbol:__t}=Vu(),Qee=__t("kEmpty"),C_t=__t("kEof");function ZDn(e,t){if(t!=null&&lP(t,"options"),(t==null?void 0:t.signal)!=null&&uP(t.signal,"options.signal"),$Dn(e)&&!VDn(e))throw new QDn("stream",e,"must be writable");let r=zDn(this,e);return t!=null&&t.signal&&HDn(t.signal,r),r}function Lee(e,t){if(typeof e!="function")throw new D9("fn",["Function","AsyncFunction"],e);t!=null&&lP(t,"options"),(t==null?void 0:t.signal)!=null&&uP(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=b_t(t.concurrency));let n=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(n=b_t(t.highWaterMark)),x_t(r,"options.concurrency",1),x_t(n,"options.highWaterMark",0),n+=r,async function*(){let s=$m().AbortSignalAny([t==null?void 0:t.signal].filter(YDn)),c=this,l=[],f={signal:s},d,m,g=!1,x=0;function b(){g=!0,A()}function A(){x-=1,C()}function C(){m&&!g&&x<r&&l.length<n&&(m(),m=null)}async function I(){try{for await(let k of c){if(g)return;if(s.aborted)throw new D1;try{if(k=e(k,f),k===Qee)continue;k=XDn(k)}catch(O){k=w_t(O)}x+=1,S_t(k,A,b),l.push(k),d&&(d(),d=null),!g&&(l.length>=n||x>=r)&&await new E_t(O=>{m=O})}l.push(C_t)}catch(k){let O=w_t(k);S_t(O,A,b),l.push(O)}finally{g=!0,d&&(d(),d=null)}}I();try{for(;;){for(;l.length>0;){let k=await l[0];if(k===C_t)return;if(s.aborted)throw new D1;k!==Qee&&(yield k),l.shift(),C()}await new E_t(k=>{d=k})}}finally{g=!0,m&&(m(),m=null)}}.call(this)}function ePn(e=void 0){return e!=null&&lP(e,"options"),(e==null?void 0:e.signal)!=null&&uP(e.signal,"options.signal"),async function*(){let r=0;for await(let a of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new D1({cause:e.signal.reason});yield[r++,a]}}.call(this)}async function I_t(e,t=void 0){for await(let r of w_e.call(this,e,t))return!0;return!1}async function tPn(e,t=void 0){if(typeof e!="function")throw new D9("fn",["Function","AsyncFunction"],e);return!await I_t.call(this,async(...r)=>!await e(...r),t)}async function rPn(e,t){for await(let r of w_e.call(this,e,t))return r}async function nPn(e,t){if(typeof e!="function")throw new D9("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a),Qee}for await(let n of Lee.call(this,r,t));}function w_e(e,t){if(typeof e!="function")throw new D9("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a)?n:Qee}return Lee.call(this,r,t)}var E_e=class extends LDn{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function iPn(e,t,r){var n;if(typeof e!="function")throw new D9("reducer",["Function","AsyncFunction"],e);r!=null&&lP(r,"options"),(r==null?void 0:r.signal)!=null&&uP(r.signal,"options.signal");let a=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let d=new D1(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await UDn(this.destroy(d)),d}let s=new ODn,c=s.signal;if(r!=null&&r.signal){let d={once:!0,[MDn]:this,[qDn]:!0};r.signal.addEventListener("abort",()=>s.abort(),d)}let l=!1;try{for await(let d of this){var f;if(l=!0,r!=null&&(f=r.signal)!==null&&f!==void 0&&f.aborted)throw new D1;a?t=await e(t,d,{signal:c}):(t=d,a=!0)}if(!l&&!a)throw new E_e}finally{s.abort()}return t}async function sPn(e){e!=null&&lP(e,"options"),(e==null?void 0:e.signal)!=null&&uP(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new D1(void 0,{cause:e.signal.reason});GDn(t,n)}return t}function aPn(e,t){let r=Lee.call(this,e,t);return async function*(){for await(let a of r)yield*a}.call(this)}function k_t(e){if(e=JDn(e),KDn(e))return 0;if(e<0)throw new jDn("number",">= 0",e);return e}function oPn(e,t=void 0){return t!=null&&lP(t,"options"),(t==null?void 0:t.signal)!=null&&uP(t.signal,"options.signal"),e=k_t(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new D1;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new D1;e--<=0&&(yield s)}}.call(this)}function cPn(e,t=void 0){return t!=null&&lP(t,"options"),(t==null?void 0:t.signal)!=null&&uP(t.signal,"options.signal"),e=k_t(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new D1;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new D1;if(e-- >0&&(yield s),e<=0)return}}.call(this)}S_e.exports.streamReturningOperators={asIndexedPairs:WDn(ePn,"readable.asIndexedPairs will be removed in a future version."),drop:oPn,filter:w_e,flatMap:aPn,map:Lee,take:cPn,compose:ZDn};S_e.exports.promiseReturningOperators={every:tPn,forEach:nPn,reduce:iPn,toArray:sPn,some:I_t,find:rPn}});var C_e=P((fEi,B_t)=>{"use strict";var{ArrayPrototypePop:uPn,Promise:lPn}=Vu(),{isIterable:pPn,isNodeStream:fPn,isWebStream:dPn}=k1(),{pipelineImpl:hPn}=Nee(),{finished:mPn}=OS();__e();function gPn(...e){return new lPn((t,r)=>{let n,a,s=e[e.length-1];if(s&&typeof s=="object"&&!fPn(s)&&!pPn(s)&&!dPn(s)){let c=uPn(e);n=c.signal,a=c.end}hPn(e,(c,l)=>{c?r(c):t(l)},{signal:n,end:a})})}B_t.exports={finished:mPn,pipeline:gPn}});var __e=P((dEi,j_t)=>{"use strict";var{Buffer:APn}=require("buffer"),{ObjectDefineProperty:jS,ObjectKeys:R_t,ReflectApply:N_t}=Vu(),{promisify:{custom:F_t}}=$m(),{streamReturningOperators:D_t,promiseReturningOperators:P_t}=T_t(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:O_t}}=Nh(),yPn=b_e(),{setDefaultHighWaterMark:vPn,getDefaultHighWaterMark:xPn}=w9(),{pipeline:Q_t}=Nee(),{destroyer:bPn}=iP(),L_t=OS(),I_e=C_e(),P9=k1(),_u=j_t.exports=yee().Stream;_u.isDestroyed=P9.isDestroyed;_u.isDisturbed=P9.isDisturbed;_u.isErrored=P9.isErrored;_u.isReadable=P9.isReadable;_u.isWritable=P9.isWritable;_u.Readable=C9();for(let e of R_t(D_t)){let r=function(...n){if(new.target)throw O_t();return _u.Readable.from(N_t(t,this,n))},t=D_t[e];jS(r,"name",{__proto__:null,value:t.name}),jS(r,"length",{__proto__:null,value:t.length}),jS(_u.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of R_t(P_t)){let r=function(...n){if(new.target)throw O_t();return N_t(t,this,n)},t=P_t[e];jS(r,"name",{__proto__:null,value:t.name}),jS(r,"length",{__proto__:null,value:t.length}),jS(_u.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}_u.Writable=Bee();_u.Duplex=B1();_u.Transform=c_e();_u.PassThrough=l_e();_u.pipeline=Q_t;var{addAbortSignal:EPn}=E9();_u.addAbortSignal=EPn;_u.finished=L_t;_u.destroy=bPn;_u.compose=yPn;_u.setDefaultHighWaterMark=vPn;_u.getDefaultHighWaterMark=xPn;jS(_u,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return I_e}});jS(Q_t,F_t,{__proto__:null,enumerable:!0,get(){return I_e.pipeline}});jS(L_t,F_t,{__proto__:null,enumerable:!0,get(){return I_e.finished}});_u.Stream=_u;_u._isUint8Array=function(t){return t instanceof Uint8Array};_u._uint8ArrayToBuffer=function(t){return APn.from(t.buffer,t.byteOffset,t.byteLength)}});var k_e=P((hEi,Ba)=>{"use strict";var cf=require("stream");if(cf&&process.env.READABLE_STREAM==="disable"){let e=cf.promises;Ba.exports._uint8ArrayToBuffer=cf._uint8ArrayToBuffer,Ba.exports._isUint8Array=cf._isUint8Array,Ba.exports.isDisturbed=cf.isDisturbed,Ba.exports.isErrored=cf.isErrored,Ba.exports.isReadable=cf.isReadable,Ba.exports.Readable=cf.Readable,Ba.exports.Writable=cf.Writable,Ba.exports.Duplex=cf.Duplex,Ba.exports.Transform=cf.Transform,Ba.exports.PassThrough=cf.PassThrough,Ba.exports.addAbortSignal=cf.addAbortSignal,Ba.exports.finished=cf.finished,Ba.exports.destroy=cf.destroy,Ba.exports.pipeline=cf.pipeline,Ba.exports.compose=cf.compose,Object.defineProperty(cf,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Ba.exports.Stream=cf.Stream}else{let e=__e(),t=C_e(),r=e.Readable.destroy;Ba.exports=e.Readable,Ba.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,Ba.exports._isUint8Array=e._isUint8Array,Ba.exports.isDisturbed=e.isDisturbed,Ba.exports.isErrored=e.isErrored,Ba.exports.isReadable=e.isReadable,Ba.exports.Readable=e.Readable,Ba.exports.Writable=e.Writable,Ba.exports.Duplex=e.Duplex,Ba.exports.Transform=e.Transform,Ba.exports.PassThrough=e.PassThrough,Ba.exports.addAbortSignal=e.addAbortSignal,Ba.exports.finished=e.finished,Ba.exports.destroy=e.destroy,Ba.exports.destroy=r,Ba.exports.pipeline=e.pipeline,Ba.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),Ba.exports.Stream=e.Stream}Ba.exports.default=Ba.exports});var H_t=P((mEi,z_t)=>{var D_e=require("fs"),q_t=Yxt(),M_t=iue(),T_e=require("path"),P1=wQ(),wPn=require("util").inherits,ql=K2t(),U_t=k_e().Transform,B_e=process.platform==="win32",Oo=function(e,t){if(!(this instanceof Oo))return new Oo(e,t);typeof e!="string"&&(t=e,e="zip"),t=this.options=P1.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),U_t.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=M_t.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=M_t.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};wPn(Oo,U_t);Oo.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()};Oo.prototype._append=function(e,t){t=t||{};var r={source:null,filepath:e};t.name||(t.name=e),t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof D_e.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)};Oo.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)};Oo.prototype._maybeFinalize=function(){return this._state.finalizing||this._state.finalized||this._state.aborted?!1:this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()?(this._finalize(),!0):!1};Oo.prototype._moduleAppend=function(e,t,r){if(this._state.aborted){r();return}this._module.append(e,t,function(n){if(this._task=null,this._state.aborted){this._shutdown();return}if(n){this.emit("error",n),setImmediate(r);return}this.emit("entry",t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(r)}.bind(this))};Oo.prototype._moduleFinalize=function(){typeof this._module.finalize=="function"?this._module.finalize():typeof this._module.end=="function"?this._module.end():this.emit("error",new ql("NOENDMETHOD"))};Oo.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0};Oo.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]};Oo.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1};Oo.prototype._normalizeEntryData=function(e,t){e=P1.defaults(e,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&e.stats===!1&&(e.stats=t);var r=e.type==="directory";return e.name&&(typeof e.prefix=="string"&&e.prefix!==""&&(e.name=e.prefix+"/"+e.name,e.prefix=null),e.name=P1.sanitizePath(e.name),e.type!=="symlink"&&e.name.slice(-1)==="/"?(r=!0,e.type="directory"):r&&(e.name+="/")),typeof e.mode=="number"?B_e?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(B_e?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,B_e&&r&&(e.mode=493)):e.mode===null&&(e.mode=r?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=P1.dateify(e.date),e};Oo.prototype._onModuleError=function(e){this.emit("error",e)};Oo.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()};Oo.prototype._onQueueTask=function(e,t){var r=()=>{e.data.callback&&e.data.callback(),t()};if(this._state.finalizing||this._state.finalized||this._state.aborted){r();return}this._task=e,this._moduleAppend(e.source,e.data,r)};Oo.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}D_e.lstat(e.filepath,function(r,n){if(this._state.aborted){setImmediate(t);return}if(r){this._entriesCount--,this.emit("warning",r),setImmediate(t);return}e=this._updateQueueTaskWithStats(e,n),e&&(n.size&&(this._fsEntriesTotalBytes+=n.size),this._queue.push(e)),setImmediate(t)}.bind(this))};Oo.prototype._shutdown=function(){this._moduleUnpipe(),this.end()};Oo.prototype._transform=function(e,t,r){e&&(this._pointer+=e.length),r(null,e)};Oo.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type="file",e.data.sourceType="stream",e.source=P1.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=P1.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=P1.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports("symlink")){var r=D_e.readlinkSync(e.filepath),n=T_e.dirname(e.filepath);e.data.type="symlink",e.data.linkname=T_e.relative(n,T_e.resolve(n,r)),e.data.sourceType="buffer",e.source=Buffer.concat([])}else return t.isDirectory()?this.emit("warning",new ql("DIRECTORYNOTSUPPORTED",e.data)):t.isSymbolicLink()?this.emit("warning",new ql("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new ql("ENTRYNOTSUPPORTED",e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e};Oo.prototype.abort=function(){return this._state.aborted||this._state.finalized?this:(this._abort(),this)};Oo.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit("error",new ql("QUEUECLOSED")),this;if(t=this._normalizeEntryData(t),typeof t.name!="string"||t.name.length===0)return this.emit("error",new ql("ENTRYNAMEREQUIRED")),this;if(t.type==="directory"&&!this._moduleSupports("directory"))return this.emit("error",new ql("DIRECTORYNOTSUPPORTED",{name:t.name})),this;if(e=P1.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else if(P1.isStream(e))t.sourceType="stream";else return this.emit("error",new ql("INPUTSTEAMBUFFERREQUIRED",{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this};Oo.prototype.directory=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new ql("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new ql("DIRECTORYDIRPATHREQUIRED")),this;this._pending++,t===!1?t="":typeof t!="string"&&(t=e);var n=!1;typeof r=="function"?(n=r,r={}):typeof r!="object"&&(r={});var a={stat:!0,dot:!0};function s(){this._pending--,this._maybeFinalize()}function c(d){this.emit("error",d)}function l(d){f.pause();var m=!1,g=Object.assign({},r);g.name=d.relative,g.prefix=t,g.stats=d.stat,g.callback=f.resume.bind(f);try{if(n){if(g=n(g),g===!1)m=!0;else if(typeof g!="object")throw new ql("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:e})}}catch(x){this.emit("error",x);return}if(m){f.resume();return}this._append(d.absolute,g)}var f=q_t(e,a);return f.on("error",c.bind(this)),f.on("match",l.bind(this)),f.on("end",s.bind(this)),this};Oo.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit("error",new ql("QUEUECLOSED")),this):typeof e!="string"||e.length===0?(this.emit("error",new ql("FILEFILEPATHREQUIRED")),this):(this._append(e,t),this)};Oo.prototype.glob=function(e,t,r){this._pending++,t=P1.defaults(t,{stat:!0,pattern:e});function n(){this._pending--,this._maybeFinalize()}function a(l){this.emit("error",l)}function s(l){c.pause();var f=Object.assign({},r);f.callback=c.resume.bind(c),f.stats=l.stat,f.name=l.relative,this._append(l.absolute,f)}var c=q_t(t.cwd||".",t);return c.on("error",a.bind(this)),c.on("match",s.bind(this)),c.on("end",n.bind(this)),this};Oo.prototype.finalize=function(){if(this._state.aborted){var e=new ql("ABORTED");return this.emit("error",e),Promise.reject(e)}if(this._state.finalize){var t=new ql("FINALIZING");return this.emit("error",t),Promise.reject(t)}this._state.finalize=!0,this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var r=this;return new Promise(function(n,a){var s;r._module.on("end",function(){s||n()}),r._module.on("error",function(c){s=!0,a(c)})})};Oo.prototype.setFormat=function(e){return this._format?(this.emit("error",new ql("FORMATSET")),this):(this._format=e,this)};Oo.prototype.setModule=function(e){return this._state.aborted?(this.emit("error",new ql("ABORTED")),this):this._state.module?(this.emit("error",new ql("MODULESET")),this):(this._module=e,this._modulePipe(),this)};Oo.prototype.symlink=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new ql("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new ql("SYMLINKFILEPATHREQUIRED")),this;if(typeof t!="string"||t.length===0)return this.emit("error",new ql("SYMLINKTARGETREQUIRED",{filepath:e})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new ql("SYMLINKNOTSUPPORTED",{filepath:e})),this;var n={};return n.type="symlink",n.name=e.replace(/\\/g,"/"),n.linkname=t.replace(/\\/g,"/"),n.sourceType="buffer",typeof r=="number"&&(n.mode=r),this._entriesCount++,this._queue.push({data:n,source:Buffer.concat([])}),this};Oo.prototype.pointer=function(){return this._pointer};Oo.prototype.use=function(e){return this._streams.push(e),this};z_t.exports=Oo});var Mee=P((gEi,V_t)=>{var jee=V_t.exports=function(){};jee.prototype.getName=function(){};jee.prototype.getSize=function(){};jee.prototype.getLastModifiedDate=function(){};jee.prototype.isDirectory=function(){}});var qee=P((AEi,$_t)=>{var sv=$_t.exports={};sv.dateToDos=function(e,t){t=t||!1;var r=t?e.getFullYear():e.getUTCFullYear();if(r<1980)return 2162688;if(r>=2044)return 2141175677;var n={year:r,month:t?e.getMonth():e.getUTCMonth(),date:t?e.getDate():e.getUTCDate(),hours:t?e.getHours():e.getUTCHours(),minutes:t?e.getMinutes():e.getUTCMinutes(),seconds:t?e.getSeconds():e.getUTCSeconds()};return n.year-1980<<25|n.month+1<<21|n.date<<16|n.hours<<11|n.minutes<<5|n.seconds/2};sv.dosToDate=function(e){return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)};sv.fromDosTime=function(e){return sv.dosToDate(e.readUInt32LE(0))};sv.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t};sv.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t};sv.getShortBytesValue=function(e,t){return e.readUInt16LE(t)};sv.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t};sv.getLongBytesValue=function(e,t){return e.readUInt32LE(t)};sv.toDosTime=function(e){return sv.getLongBytes(sv.dateToDos(e))}});var P_e=P((yEi,X_t)=>{var W_t=qee(),G_t=8,Y_t=1,SPn=4,CPn=2,J_t=64,K_t=2048,Qd=X_t.exports=function(){return this instanceof Qd?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new Qd};Qd.prototype.encode=function(){return W_t.getShortBytes((this.descriptor?G_t:0)|(this.utf8?K_t:0)|(this.encryption?Y_t:0)|(this.strongEncryption?J_t:0))};Qd.prototype.parse=function(e,t){var r=W_t.getShortBytesValue(e,t),n=new Qd;return n.useDataDescriptor((r&G_t)!==0),n.useUTF8ForNames((r&K_t)!==0),n.useStrongEncryption((r&J_t)!==0),n.useEncryption((r&Y_t)!==0),n.setSlidingDictionarySize(r&CPn?8192:4096),n.setNumberOfShannonFanoTrees(r&SPn?3:2),n};Qd.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e};Qd.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};Qd.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e};Qd.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};Qd.prototype.useDataDescriptor=function(e){this.descriptor=e};Qd.prototype.usesDataDescriptor=function(){return this.descriptor};Qd.prototype.useEncryption=function(e){this.encryption=e};Qd.prototype.usesEncryption=function(){return this.encryption};Qd.prototype.useStrongEncryption=function(e){this.strongEncryption=e};Qd.prototype.usesStrongEncryption=function(){return this.strongEncryption};Qd.prototype.useUTF8ForNames=function(e){this.utf8=e};Qd.prototype.usesUTF8ForNames=function(){return this.utf8}});var eIt=P((vEi,Z_t)=>{Z_t.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}});var R_e=P((xEi,tIt)=>{tIt.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}});var N_e=P((bEi,aIt)=>{var _Pn=require("util").inherits,IPn=A2e(),nIt=Mee(),iIt=P_e(),rIt=eIt(),Wm=R_e(),sIt=qee(),ya=aIt.exports=function(e){if(!(this instanceof ya))return new ya(e);nIt.call(this),this.platform=Wm.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new iIt,this.crc=0,this.time=-1,this.minver=Wm.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};_Pn(ya,nIt);ya.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};ya.prototype.getComment=function(){return this.comment!==null?this.comment:""};ya.prototype.getCompressedSize=function(){return this.csize};ya.prototype.getCrc=function(){return this.crc};ya.prototype.getExternalAttributes=function(){return this.exattr};ya.prototype.getExtra=function(){return this.extra!==null?this.extra:Wm.EMPTY};ya.prototype.getGeneralPurposeBit=function(){return this.gpb};ya.prototype.getInternalAttributes=function(){return this.inattr};ya.prototype.getLastModifiedDate=function(){return this.getTime()};ya.prototype.getLocalFileDataExtra=function(){return this.getExtra()};ya.prototype.getMethod=function(){return this.method};ya.prototype.getName=function(){return this.name};ya.prototype.getPlatform=function(){return this.platform};ya.prototype.getSize=function(){return this.size};ya.prototype.getTime=function(){return this.time!==-1?sIt.dosToDate(this.time):-1};ya.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};ya.prototype.getUnixMode=function(){return this.platform!==Wm.PLATFORM_UNIX?0:this.getExternalAttributes()>>Wm.SHORT_SHIFT&Wm.SHORT_MASK};ya.prototype.getVersionNeededToExtract=function(){return this.minver};ya.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e};ya.prototype.setCompressedSize=function(e){if(e<0)throw new Error("invalid entry compressed size");this.csize=e};ya.prototype.setCrc=function(e){if(e<0)throw new Error("invalid entry crc32");this.crc=e};ya.prototype.setExternalAttributes=function(e){this.exattr=e>>>0};ya.prototype.setExtra=function(e){this.extra=e};ya.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof iIt))throw new Error("invalid entry GeneralPurposeBit");this.gpb=e};ya.prototype.setInternalAttributes=function(e){this.inattr=e};ya.prototype.setMethod=function(e){if(e<0)throw new Error("invalid entry compression method");this.method=e};ya.prototype.setName=function(e,t=!1){e=IPn(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,""),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e};ya.prototype.setPlatform=function(e){this.platform=e};ya.prototype.setSize=function(e){if(e<0)throw new Error("invalid entry size");this.size=e};ya.prototype.setTime=function(e,t){if(!(e instanceof Date))throw new Error("invalid entry time");this.time=sIt.dateToDos(e,t)};ya.prototype.setUnixMode=function(e){e|=this.isDirectory()?Wm.S_IFDIR:Wm.S_IFREG;var t=0;t|=e<<Wm.SHORT_SHIFT|(this.isDirectory()?Wm.S_DOS_D:Wm.S_DOS_A),this.setExternalAttributes(t),this.mode=e&Wm.MODE_MASK,this.platform=Wm.PLATFORM_UNIX};ya.prototype.setVersionNeededToExtract=function(e){this.minver=e};ya.prototype.isDirectory=function(){return this.getName().slice(-1)==="/"};ya.prototype.isUnixSymlink=function(){return(this.getUnixMode()&rIt.FILE_TYPE_FLAG)===rIt.LINK_FLAG};ya.prototype.isZip64=function(){return this.csize>Wm.ZIP64_MAGIC||this.size>Wm.ZIP64_MAGIC}});var F_e=P((EEi,oIt)=>{"use strict";var R1=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";R1.writable=e=>R1(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";R1.readable=e=>R1(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";R1.duplex=e=>R1.writable(e)&&R1.readable(e);R1.transform=e=>R1.duplex(e)&&typeof e._transform=="function";oIt.exports=R1});var $u=P((wEi,cIt)=>{"use strict";var O_e=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
450
450
  `;super(r),this.name="AggregateError",this.errors=t}};cIt.exports={AggregateError:O_e,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var Q_e=P((SEi,uIt)=>{"use strict";uIt.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let a=t.shift();return n==="f"?a.toFixed(6):n==="j"?JSON.stringify(a):n==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var Oh=P((CEi,fIt)=>{"use strict";var{format:kPn,inspect:Uee}=Q_e(),{AggregateError:TPn}=$u(),BPn=globalThis.AggregateError||TPn,DPn=Symbol("kIsNodeError"),PPn=["string","function","number","object","Function","Object","boolean","bigint","symbol"],RPn=/^([A-Z][a-z0-9]*)+$/,NPn="__node_internal_",zee={};function pP(e,t){if(!e)throw new zee.ERR_INTERNAL_ASSERTION(t)}function lIt(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function FPn(e,t,r){if(typeof t=="function")return pP(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return pP(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:kPn(t,...r)}function Ld(e,t,r){r||(r=Error);class n extends r{constructor(...s){super(FPn(e,t,s))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[DPn]=!0,zee[e]=n}function pIt(e){let t=NPn+e.name;return Object.defineProperty(e,"name",{value:t}),e}function OPn(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new BPn([t,e],t.message);return r.code=t.code,r}return e||t}var L_e=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new zee.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Ld("ERR_ASSERTION","%s",Error);Ld("ERR_INVALID_ARG_TYPE",(e,t,r)=>{pP(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let a=[],s=[],c=[];for(let f of t)pP(typeof f=="string","All expected entries have to be of type string"),PPn.includes(f)?a.push(f.toLowerCase()):RPn.test(f)?s.push(f):(pP(f!=="object",'The value "object" should be written as "Object"'),c.push(f));if(s.length>0){let f=a.indexOf("object");f!==-1&&(a.splice(a,f,1),s.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{let f=a.pop();n+=`one of type ${a.join(", ")}, or ${f}`}}(s.length>0||c.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let f=s.pop();n+=`an instance of ${s.join(", ")}, or ${f}`}}c.length>0&&(n+=" or ")}switch(c.length){case 0:break;case 1:c[0].toLowerCase()!==c[0]&&(n+="an "),n+=`${c[0]}`;break;case 2:n+=`one of ${c[0]} or ${c[1]}`;break;default:{let f=c.pop();n+=`one of ${c.join(", ")}, or ${f}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var l;if((l=r.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${r.constructor.name}`;else{let f=Uee(r,{depth:-1});n+=`. Received ${f}`}}else{let f=Uee(r,{colors:!1});f.length>25&&(f=`${f.slice(0,25)}...`),n+=`. Received type ${typeof r} (${f})`}return n},TypeError);Ld("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=Uee(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);Ld("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let a=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);Ld("ERR_MISSING_ARGS",(...e)=>{pP(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);Ld("ERR_OUT_OF_RANGE",(e,t,r)=>{pP(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=lIt(String(r));else if(typeof r=="bigint"){n=String(r);let a=BigInt(2)**BigInt(32);(r>a||r<-a)&&(n=lIt(n)),n+="n"}else n=Uee(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);Ld("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Ld("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Ld("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Ld("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Ld("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Ld("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ld("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Ld("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Ld("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Ld("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Ld("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);fIt.exports={AbortError:L_e,aggregateTwoErrors:pIt(OPn),hideStackFrames:pIt,codes:zee}});var Gm=P((_Ei,M_e)=>{"use strict";var QPn=require("buffer"),{format:LPn,inspect:jPn}=Q_e(),{codes:{ERR_INVALID_ARG_TYPE:j_e}}=Oh(),{kResistStopPropagation:MPn,AggregateError:qPn,SymbolDispose:UPn}=$u(),zPn=globalThis.AbortSignal||lp().AbortSignal,HPn=globalThis.AbortController||lp().AbortController,VPn=Object.getPrototypeOf(async function(){}).constructor,dIt=globalThis.Blob||QPn.Blob,$Pn=typeof dIt<"u"?function(t){return t instanceof dIt}:function(t){return!1},hIt=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new j_e(t,"AbortSignal",e)},WPn=(e,t)=>{if(typeof e!="function")throw new j_e(t,"Function",e)};M_e.exports={AggregateError:qPn,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((n,...a)=>n?r(n):t(...a))})},debuglog(){return function(){}},format:LPn,inspect:jPn,types:{isAsyncFunction(e){return e instanceof VPn},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:$Pn,deprecate(e,t){return e},addAbortListener:require("events").addAbortListener||function(t,r){if(t===void 0)throw new j_e("signal","AbortSignal",t);hIt(t,"signal"),WPn(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[MPn]:!0}),n=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[UPn](){var a;(a=n)===null||a===void 0||a()}}},AbortSignalAny:zPn.any||function(t){if(t.length===1)return t[0];let r=new HPn,n=()=>r.abort();return t.forEach(a=>{hIt(a,"signals"),a.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(a=>a.removeEventListener("abort",n))},{once:!0}),r.signal}};M_e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var QQ=P((IEi,SIt)=>{"use strict";var{ArrayIsArray:U_e,ArrayPrototypeIncludes:yIt,ArrayPrototypeJoin:vIt,ArrayPrototypeMap:GPn,NumberIsInteger:z_e,NumberIsNaN:YPn,NumberMAX_SAFE_INTEGER:JPn,NumberMIN_SAFE_INTEGER:KPn,NumberParseInt:XPn,ObjectPrototypeHasOwnProperty:ZPn,RegExpPrototypeExec:xIt,String:eRn,StringPrototypeToUpperCase:tRn,StringPrototypeTrim:rRn}=$u(),{hideStackFrames:av,codes:{ERR_SOCKET_BAD_PORT:nRn,ERR_INVALID_ARG_TYPE:Qh,ERR_INVALID_ARG_VALUE:OQ,ERR_OUT_OF_RANGE:fP,ERR_UNKNOWN_SIGNAL:mIt}}=Oh(),{normalizeEncoding:iRn}=Gm(),{isAsyncFunction:sRn,isArrayBufferView:aRn}=Gm().types,gIt={};function oRn(e){return e===(e|0)}function cRn(e){return e===e>>>0}var uRn=/^[0-7]+$/,lRn="must be a 32-bit unsigned integer or an octal string";function pRn(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(xIt(uRn,e)===null)throw new OQ(t,e,lRn);e=XPn(e,8)}return bIt(e,t),e}var fRn=av((e,t,r=KPn,n=JPn)=>{if(typeof e!="number")throw new Qh(t,"number",e);if(!z_e(e))throw new fP(t,"an integer",e);if(e<r||e>n)throw new fP(t,`>= ${r} && <= ${n}`,e)}),dRn=av((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new Qh(t,"number",e);if(!z_e(e))throw new fP(t,"an integer",e);if(e<r||e>n)throw new fP(t,`>= ${r} && <= ${n}`,e)}),bIt=av((e,t,r=!1)=>{if(typeof e!="number")throw new Qh(t,"number",e);if(!z_e(e))throw new fP(t,"an integer",e);let n=r?1:0,a=4294967295;if(e<n||e>a)throw new fP(t,`>= ${n} && <= ${a}`,e)});function H_e(e,t){if(typeof e!="string")throw new Qh(t,"string",e)}function hRn(e,t,r=void 0,n){if(typeof e!="number")throw new Qh(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&YPn(e))throw new fP(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}var mRn=av((e,t,r)=>{if(!yIt(r,e)){let a="must be one of: "+vIt(GPn(r,s=>typeof s=="string"?`'${s}'`:eRn(s)),", ");throw new OQ(t,e,a)}});function EIt(e,t){if(typeof e!="boolean")throw new Qh(t,"boolean",e)}function q_e(e,t,r){return e==null||!ZPn(e,t)?r:e[t]}var gRn=av((e,t,r=null)=>{let n=q_e(r,"allowArray",!1),a=q_e(r,"allowFunction",!1);if(!q_e(r,"nullable",!1)&&e===null||!n&&U_e(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new Qh(t,"Object",e)}),ARn=av((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new Qh(t,"a dictionary",e)}),Hee=av((e,t,r=0)=>{if(!U_e(e))throw new Qh(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new OQ(t,e,n)}});function yRn(e,t){Hee(e,t);for(let r=0;r<e.length;r++)H_e(e[r],`${t}[${r}]`)}function vRn(e,t){Hee(e,t);for(let r=0;r<e.length;r++)EIt(e[r],`${t}[${r}]`)}function xRn(e,t){Hee(e,t);for(let r=0;r<e.length;r++){let n=e[r],a=`${t}[${r}]`;if(n==null)throw new Qh(a,"AbortSignal",n);wIt(n,a)}}function bRn(e,t="signal"){if(H_e(e,t),gIt[e]===void 0)throw gIt[tRn(e)]!==void 0?new mIt(e+" (signals must use all capital letters)"):new mIt(e)}var ERn=av((e,t="buffer")=>{if(!aRn(e))throw new Qh(t,["Buffer","TypedArray","DataView"],e)});function wRn(e,t){let r=iRn(t),n=e.length;if(r==="hex"&&n%2!==0)throw new OQ("encoding",t,`is invalid for data of length ${n}`)}function SRn(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&rRn(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new nRn(t,e,r);return e|0}var wIt=av((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Qh(t,"AbortSignal",e)}),CRn=av((e,t)=>{if(typeof e!="function")throw new Qh(t,"Function",e)}),_Rn=av((e,t)=>{if(typeof e!="function"||sRn(e))throw new Qh(t,"Function",e)}),IRn=av((e,t)=>{if(e!==void 0)throw new Qh(t,"undefined",e)});function kRn(e,t,r){if(!yIt(r,e))throw new Qh(t,`('${vIt(r,"|")}')`,e)}var TRn=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function AIt(e,t){if(typeof e>"u"||!xIt(TRn,e))throw new OQ(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function BRn(e){if(typeof e=="string")return AIt(e,"hints"),e;if(U_e(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let a=e[n];AIt(a,"hints"),r+=a,n!==t-1&&(r+=", ")}return r}throw new OQ("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}SIt.exports={isInt32:oRn,isUint32:cRn,parseFileMode:pRn,validateArray:Hee,validateStringArray:yRn,validateBooleanArray:vRn,validateAbortSignalArray:xRn,validateBoolean:EIt,validateBuffer:ERn,validateDictionary:ARn,validateEncoding:wRn,validateFunction:CRn,validateInt32:dRn,validateInteger:fRn,validateNumber:hRn,validateObject:gRn,validateOneOf:mRn,validatePlainFunction:_Rn,validatePort:SRn,validateSignalName:bRn,validateString:H_e,validateUint32:bIt,validateUndefined:IRn,validateUnion:kRn,validateAbortSignal:wIt,validateLinkHeaderValue:BRn}});var F1=P((kEi,jIt)=>{"use strict";var{SymbolAsyncIterator:CIt,SymbolIterator:_It,SymbolFor:dP}=$u(),IIt=dP("nodejs.stream.destroyed"),kIt=dP("nodejs.stream.errored"),V_e=dP("nodejs.stream.readable"),$_e=dP("nodejs.stream.writable"),TIt=dP("nodejs.stream.disturbed"),DRn=dP("nodejs.webstream.isClosedPromise"),PRn=dP("nodejs.webstream.controllerErrorFunction");function Vee(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function $ee(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function RRn(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function N1(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function BIt(e){return!!(e&&!N1(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function DIt(e){return!!(e&&!N1(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function PIt(e){return!!(e&&!N1(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function NRn(e){return BIt(e)||DIt(e)||PIt(e)}function FRn(e,t){return e==null?!1:t===!0?typeof e[CIt]=="function":t===!1?typeof e[_It]=="function":typeof e[CIt]=="function"||typeof e[_It]=="function"}function Wee(e){if(!N1(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[IIt]||n!=null&&n.destroyed)}function RIt(e){if(!$ee(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function ORn(e,t){if(!$ee(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function QRn(e){if(!Vee(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function NIt(e,t){if(!Vee(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function FIt(e){return e&&e[V_e]!=null?e[V_e]:typeof(e==null?void 0:e.readable)!="boolean"?null:Wee(e)?!1:Vee(e)&&e.readable&&!NIt(e)}function OIt(e){return e&&e[$_e]!=null?e[$_e]:typeof(e==null?void 0:e.writable)!="boolean"?null:Wee(e)?!1:$ee(e)&&e.writable&&!RIt(e)}function LRn(e,t){return N1(e)?Wee(e)?!0:!((t==null?void 0:t.readable)!==!1&&FIt(e)||(t==null?void 0:t.writable)!==!1&&OIt(e)):null}function jRn(e){var t,r;return N1(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function MRn(e){var t,r;return N1(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function qRn(e){if(!N1(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&QIt(e)?e._closed:null}function QIt(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function LIt(e){return typeof e._sent100=="boolean"&&QIt(e)}function URn(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function zRn(e){if(!N1(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&LIt(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function HRn(e){var t;return!!(e&&((t=e[TIt])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function VRn(e){var t,r,n,a,s,c,l,f,d,m;return!!(e&&((t=(r=(n=(a=(s=(c=e[kIt])!==null&&c!==void 0?c:e.readableErrored)!==null&&s!==void 0?s:e.writableErrored)!==null&&a!==void 0?a:(l=e._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(f=e._writableState)===null||f===void 0?void 0:f.errorEmitted)!==null&&r!==void 0?r:(d=e._readableState)===null||d===void 0?void 0:d.errored)!==null&&t!==void 0?t:!((m=e._writableState)===null||m===void 0)&&m.errored))}jIt.exports={isDestroyed:Wee,kIsDestroyed:IIt,isDisturbed:HRn,kIsDisturbed:TIt,isErrored:VRn,kIsErrored:kIt,isReadable:FIt,kIsReadable:V_e,kIsClosedPromise:DRn,kControllerErrorFunction:PRn,kIsWritable:$_e,isClosed:qRn,isDuplexNodeStream:RRn,isFinished:LRn,isIterable:FRn,isReadableNodeStream:Vee,isReadableStream:BIt,isReadableEnded:QRn,isReadableFinished:NIt,isReadableErrored:MRn,isNodeStream:N1,isWebStream:NRn,isWritable:OIt,isWritableNodeStream:$ee,isWritableStream:DIt,isWritableEnded:RIt,isWritableFinished:ORn,isWritableErrored:jRn,isServerRequest:URn,isServerResponse:LIt,willEmitClose:zRn,isTransformStream:PIt}});var MS=P((TEi,K_e)=>{"use strict";var UI=mc(),{AbortError:GIt,codes:$Rn}=Oh(),{ERR_INVALID_ARG_TYPE:WRn,ERR_STREAM_PREMATURE_CLOSE:MIt}=$Rn,{kEmptyObject:G_e,once:Y_e}=Gm(),{validateAbortSignal:GRn,validateFunction:YRn,validateObject:JRn,validateBoolean:KRn}=QQ(),{Promise:XRn,PromisePrototypeThen:ZRn,SymbolDispose:YIt}=$u(),{isClosed:eNn,isReadable:qIt,isReadableNodeStream:W_e,isReadableStream:tNn,isReadableFinished:UIt,isReadableErrored:zIt,isWritable:HIt,isWritableNodeStream:VIt,isWritableStream:rNn,isWritableFinished:$It,isWritableErrored:WIt,isNodeStream:nNn,willEmitClose:iNn,kIsClosedPromise:sNn}=F1(),LQ;function aNn(e){return e.setHeader&&typeof e.abort=="function"}var J_e=()=>{};function JIt(e,t,r){var n,a;if(arguments.length===2?(r=t,t=G_e):t==null?t=G_e:JRn(t,"options"),YRn(r,"callback"),GRn(t.signal,"options.signal"),r=Y_e(r),tNn(e)||rNn(e))return oNn(e,t,r);if(!nNn(e))throw new WRn("stream",["ReadableStream","WritableStream","Stream"],e);let s=(n=t.readable)!==null&&n!==void 0?n:W_e(e),c=(a=t.writable)!==null&&a!==void 0?a:VIt(e),l=e._writableState,f=e._readableState,d=()=>{e.writable||x()},m=iNn(e)&&W_e(e)===s&&VIt(e)===c,g=$It(e,!1),x=()=>{g=!0,e.destroyed&&(m=!1),!(m&&(!e.readable||s))&&(!s||b)&&r.call(e)},b=UIt(e,!1),A=()=>{b=!0,e.destroyed&&(m=!1),!(m&&(!e.writable||c))&&(!c||g)&&r.call(e)},C=W=>{r.call(e,W)},I=eNn(e),k=()=>{I=!0;let W=WIt(e)||zIt(e);if(W&&typeof W!="boolean")return r.call(e,W);if(s&&!b&&W_e(e,!0)&&!UIt(e,!1))return r.call(e,new MIt);if(c&&!g&&!$It(e,!1))return r.call(e,new MIt);r.call(e)},O=()=>{I=!0;let W=WIt(e)||zIt(e);if(W&&typeof W!="boolean")return r.call(e,W);r.call(e)},j=()=>{e.req.on("finish",x)};aNn(e)?(e.on("complete",x),m||e.on("abort",k),e.req?j():e.on("request",j)):c&&!l&&(e.on("end",d),e.on("close",d)),!m&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",A),e.on("finish",x),t.error!==!1&&e.on("error",C),e.on("close",k),I?UI.nextTick(k):l!=null&&l.errorEmitted||f!=null&&f.errorEmitted?m||UI.nextTick(O):(!s&&(!m||qIt(e))&&(g||HIt(e)===!1)||!c&&(!m||HIt(e))&&(b||qIt(e)===!1)||f&&e.req&&e.aborted)&&UI.nextTick(O);let M=()=>{r=J_e,e.removeListener("aborted",k),e.removeListener("complete",x),e.removeListener("abort",k),e.removeListener("request",j),e.req&&e.req.removeListener("finish",x),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",x),e.removeListener("end",A),e.removeListener("error",C),e.removeListener("close",k)};if(t.signal&&!I){let W=()=>{let se=r;M(),se.call(e,new GIt(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)UI.nextTick(W);else{LQ=LQ||Gm().addAbortListener;let se=LQ(t.signal,W),X=r;r=Y_e((...ve)=>{se[YIt](),X.apply(e,ve)})}}return M}function oNn(e,t,r){let n=!1,a=J_e;if(t.signal)if(a=()=>{n=!0,r.call(e,new GIt(void 0,{cause:t.signal.reason}))},t.signal.aborted)UI.nextTick(a);else{LQ=LQ||Gm().addAbortListener;let c=LQ(t.signal,a),l=r;r=Y_e((...f)=>{c[YIt](),l.apply(e,f)})}let s=(...c)=>{n||UI.nextTick(()=>r.apply(e,c))};return ZRn(e[sNn].promise,s,s),J_e}function cNn(e,t){var r;let n=!1;return t===null&&(t=G_e),(r=t)!==null&&r!==void 0&&r.cleanup&&(KRn(t.cleanup,"cleanup"),n=t.cleanup),new XRn((a,s)=>{let c=JIt(e,t,l=>{n&&c(),l?s(l):a()})})}K_e.exports=JIt;K_e.exports.finished=cNn});var hP=P((BEi,ikt)=>{"use strict";var O1=mc(),{aggregateTwoErrors:uNn,codes:{ERR_MULTIPLE_CALLBACK:lNn},AbortError:pNn}=Oh(),{Symbol:ZIt}=$u(),{kIsDestroyed:fNn,isDestroyed:dNn,isFinished:hNn,isServerRequest:mNn}=F1(),ekt=ZIt("kDestroy"),X_e=ZIt("kConstruct");function tkt(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function gNn(e,t){let r=this._readableState,n=this._writableState,a=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(tkt(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?KIt(this,e,t):this.once(ekt,function(s){KIt(this,uNn(s,e),t)}),this)}function KIt(e,t,r){let n=!1;function a(s){if(n)return;n=!0;let c=e._readableState,l=e._writableState;tkt(s,l,c),l&&(l.closed=!0),c&&(c.closed=!0),typeof r=="function"&&r(s),s?O1.nextTick(ANn,e,s):O1.nextTick(rkt,e)}try{e._destroy(t||null,a)}catch(s){a(s)}}function ANn(e,t){Z_e(e,t),rkt(e)}function rkt(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function Z_e(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function yNn(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function eIe(e,t,r){let n=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),n&&!n.errored&&(n.errored=t),r?O1.nextTick(Z_e,e,t):Z_e(e,t))}function vNn(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(X_e,t),!(e.listenerCount(X_e)>1)&&O1.nextTick(xNn,e)}function xNn(e){let t=!1;function r(n){if(t){eIe(e,n!=null?n:new lNn);return}t=!0;let a=e._readableState,s=e._writableState,c=s||a;a&&(a.constructed=!0),s&&(s.constructed=!0),c.destroyed?e.emit(ekt,n):n?eIe(e,n,!0):O1.nextTick(bNn,e)}try{e._construct(n=>{O1.nextTick(r,n)})}catch(n){O1.nextTick(r,n)}}function bNn(e){e.emit(X_e)}function XIt(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function nkt(e){e.emit("close")}function ENn(e,t){e.emit("error",t),O1.nextTick(nkt,e)}function wNn(e,t){!e||dNn(e)||(!t&&!hNn(e)&&(t=new pNn),mNn(e)?(e.socket=null,e.destroy(t)):XIt(e)?e.abort():XIt(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?O1.nextTick(ENn,e,t):O1.nextTick(nkt,e),e.destroyed||(e[fNn]=!0))}ikt.exports={construct:vNn,destroyer:wNn,destroy:gNn,undestroy:yNn,errorOrDestroy:eIe}});var Jee=P((DEi,akt)=>{"use strict";var{ArrayIsArray:SNn,ObjectSetPrototypeOf:skt}=$u(),{EventEmitter:Gee}=require("events");function Yee(e){Gee.call(this,e)}skt(Yee.prototype,Gee.prototype);skt(Yee,Gee);Yee.prototype.pipe=function(e,t){let r=this;function n(m){e.writable&&e.write(m)===!1&&r.pause&&r.pause()}r.on("data",n);function a(){r.readable&&r.resume&&r.resume()}e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",c),r.on("close",l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}function f(m){d(),Gee.listenerCount(this,"error")===0&&this.emit("error",m)}tIe(r,"error",f),tIe(e,"error",f);function d(){r.removeListener("data",n),e.removeListener("drain",a),r.removeListener("end",c),r.removeListener("close",l),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e};function tIe(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):SNn(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}akt.exports={Stream:Yee,prependListener:tIe}});var R9=P((PEi,Kee)=>{"use strict";var{SymbolDispose:CNn}=$u(),{AbortError:okt,codes:_Nn}=Oh(),{isNodeStream:ckt,isWebStream:INn,kControllerErrorFunction:kNn}=F1(),TNn=MS(),{ERR_INVALID_ARG_TYPE:ukt}=_Nn,rIe,BNn=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new ukt(t,"AbortSignal",e)};Kee.exports.addAbortSignal=function(t,r){if(BNn(t,"signal"),!ckt(r)&&!INn(r))throw new ukt("stream",["ReadableStream","WritableStream","Stream"],r);return Kee.exports.addAbortSignalNoValidate(t,r)};Kee.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=ckt(t)?()=>{t.destroy(new okt(void 0,{cause:e.reason}))}:()=>{t[kNn](new okt(void 0,{cause:e.reason}))};if(e.aborted)r();else{rIe=rIe||Gm().addAbortListener;let n=rIe(e,r);TNn(t,n[CNn])}return t}});var fkt=P((NEi,pkt)=>{"use strict";var{StringPrototypeSlice:lkt,SymbolIterator:DNn,TypedArrayPrototypeSet:Xee,Uint8Array:PNn}=$u(),{Buffer:nIe}=require("buffer"),{inspect:RNn}=Gm();pkt.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return nIe.alloc(0);let r=nIe.allocUnsafe(t>>>0),n=this.head,a=0;for(;n;)Xee(r,n.data,a),a+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let a=n.slice(0,t);return this.head.data=n.slice(t),a}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[DNn](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,a=0;do{let s=n.data;if(t>s.length)r+=s,t-=s.length;else{t===s.length?(r+=s,++a,n.next?this.head=n.next:this.head=this.tail=null):(r+=lkt(s,0,t),this.head=n,n.data=lkt(s,t));break}++a}while((n=n.next)!==null);return this.length-=a,r}_getBuffer(t){let r=nIe.allocUnsafe(t),n=t,a=this.head,s=0;do{let c=a.data;if(t>c.length)Xee(r,c,n-t),t-=c.length;else{t===c.length?(Xee(r,c,n-t),++s,a.next?this.head=a.next:this.head=this.tail=null):(Xee(r,new PNn(c.buffer,c.byteOffset,t),n-t),this.head=a,a.data=c.slice(t));break}++s}while((a=a.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return RNn(this,{...r,depth:0,customInspect:!1})}}});var N9=P((FEi,gkt)=>{"use strict";var{MathFloor:NNn,NumberIsInteger:FNn}=$u(),{validateInteger:ONn}=QQ(),{ERR_INVALID_ARG_VALUE:QNn}=Oh().codes,dkt=16*1024,hkt=16;function LNn(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function mkt(e){return e?hkt:dkt}function jNn(e,t){ONn(t,"value",0),e?hkt=t:dkt=t}function MNn(e,t,r,n){let a=LNn(t,n,r);if(a!=null){if(!FNn(a)||a<0){let s=n?`options.${r}`:"options.highWaterMark";throw new QNn(s,a)}return NNn(a)}return mkt(e.objectMode)}gkt.exports={getHighWaterMark:MNn,getDefaultHighWaterMark:mkt,setDefaultHighWaterMark:jNn}});var iIe=P((OEi,xkt)=>{"use strict";var Akt=mc(),{PromisePrototypeThen:qNn,SymbolAsyncIterator:ykt,SymbolIterator:vkt}=$u(),{Buffer:UNn}=require("buffer"),{ERR_INVALID_ARG_TYPE:zNn,ERR_STREAM_NULL_VALUES:HNn}=Oh().codes;function VNn(e,t,r){let n;if(typeof t=="string"||t instanceof UNn)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let a;if(t&&t[ykt])a=!0,n=t[ykt]();else if(t&&t[vkt])a=!1,n=t[vkt]();else throw new zNn("iterable",["Iterable"],t);let s=new e({objectMode:!0,highWaterMark:1,...r}),c=!1;s._read=function(){c||(c=!0,f())},s._destroy=function(d,m){qNn(l(d),()=>Akt.nextTick(m,d),g=>Akt.nextTick(m,g||d))};async function l(d){let m=d!=null,g=typeof n.throw=="function";if(m&&g){let{value:x,done:b}=await n.throw(d);if(await x,b)return}if(typeof n.return=="function"){let{value:x}=await n.return();await x}}async function f(){for(;;){try{let{value:d,done:m}=a?await n.next():n.next();if(m)s.push(null);else{let g=d&&typeof d.then=="function"?await d:d;if(g===null)throw c=!1,new HNn;if(s.push(g))continue;c=!1}}catch(d){s.destroy(d)}break}}return s}xkt.exports=VNn});var O9=P((QEi,Lkt)=>{"use strict";var ub=mc(),{ArrayPrototypeIndexOf:$Nn,NumberIsInteger:WNn,NumberIsNaN:GNn,NumberParseInt:YNn,ObjectDefineProperties:fIe,ObjectKeys:JNn,ObjectSetPrototypeOf:wkt,Promise:Skt,SafeSet:KNn,SymbolAsyncDispose:XNn,SymbolAsyncIterator:ZNn,Symbol:eFn}=$u();Lkt.exports=aa;aa.ReadableState=rte;var{EventEmitter:tFn}=require("events"),{Stream:zI,prependListener:rFn}=Jee(),{Buffer:sIe}=require("buffer"),{addAbortSignal:nFn}=R9(),Ckt=MS(),Ga=Gm().debuglog("stream",e=>{Ga=e}),iFn=fkt(),qQ=hP(),{getHighWaterMark:sFn,getDefaultHighWaterMark:aFn}=N9(),{aggregateTwoErrors:bkt,codes:{ERR_INVALID_ARG_TYPE:oFn,ERR_METHOD_NOT_IMPLEMENTED:cFn,ERR_OUT_OF_RANGE:uFn,ERR_STREAM_PUSH_AFTER_EOF:lFn,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:pFn},AbortError:fFn}=Oh(),{validateObject:dFn}=QQ(),mP=eFn("kPaused"),{StringDecoder:_kt}=p5(),hFn=iIe();wkt(aa.prototype,zI.prototype);wkt(aa,zI);var aIe=()=>{},{errorOrDestroy:jQ}=qQ,MQ=1,mFn=2,Ikt=4,F9=8,kkt=16,Zee=32,ete=64,Tkt=128,gFn=256,AFn=512,yFn=1024,lIe=2048,pIe=4096,vFn=8192,xFn=16384,bFn=32768,Bkt=65536,EFn=1<<17,wFn=1<<18;function uf(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}fIe(rte.prototype,{objectMode:uf(MQ),ended:uf(mFn),endEmitted:uf(Ikt),reading:uf(F9),constructed:uf(kkt),sync:uf(Zee),needReadable:uf(ete),emittedReadable:uf(Tkt),readableListening:uf(gFn),resumeScheduled:uf(AFn),errorEmitted:uf(yFn),emitClose:uf(lIe),autoDestroy:uf(pIe),destroyed:uf(vFn),closed:uf(xFn),closeEmitted:uf(bFn),multiAwaitDrain:uf(Bkt),readingMore:uf(EFn),dataEmitted:uf(wFn)});function rte(e,t,r){typeof r!="boolean"&&(r=t instanceof Q1()),this.state=lIe|pIe|kkt|Zee,e&&e.objectMode&&(this.state|=MQ),r&&e&&e.readableObjectMode&&(this.state|=MQ),this.highWaterMark=e?sFn(this,e,"readableHighWaterMark",r):aFn(!1),this.buffer=new iFn,this.length=0,this.pipes=[],this.flowing=null,this[mP]=null,e&&e.emitClose===!1&&(this.state&=~lIe),e&&e.autoDestroy===!1&&(this.state&=~pIe),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new _kt(e.encoding),this.encoding=e.encoding)}function aa(e){if(!(this instanceof aa))return new aa(e);let t=this instanceof Q1();this._readableState=new rte(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&nFn(e.signal,this)),zI.call(this,e),qQ.construct(this,()=>{this._readableState.needReadable&&tte(this,this._readableState)})}aa.prototype.destroy=qQ.destroy;aa.prototype._undestroy=qQ.undestroy;aa.prototype._destroy=function(e,t){t(e)};aa.prototype[tFn.captureRejectionSymbol]=function(e){this.destroy(e)};aa.prototype[XNn]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new fFn,this.destroy(e)),new Skt((t,r)=>Ckt(this,n=>n&&n!==e?r(n):t(null)))};aa.prototype.push=function(e,t){return Dkt(this,e,t,!1)};aa.prototype.unshift=function(e,t){return Dkt(this,e,t,!0)};function Dkt(e,t,r,n){Ga("readableAddChunk",t);let a=e._readableState,s;if(a.state&MQ||(typeof t=="string"?(r=r||a.defaultEncoding,a.encoding!==r&&(n&&a.encoding?t=sIe.from(t,r).toString(a.encoding):(t=sIe.from(t,r),r=""))):t instanceof sIe?r="":zI._isUint8Array(t)?(t=zI._uint8ArrayToBuffer(t),r=""):t!=null&&(s=new oFn("chunk",["string","Buffer","Uint8Array"],t))),s)jQ(e,s);else if(t===null)a.state&=~F9,_Fn(e,a);else if(a.state&MQ||t&&t.length>0)if(n)if(a.state&Ikt)jQ(e,new pFn);else{if(a.destroyed||a.errored)return!1;oIe(e,a,t,!0)}else if(a.ended)jQ(e,new lFn);else{if(a.destroyed||a.errored)return!1;a.state&=~F9,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?oIe(e,a,t,!1):tte(e,a)):oIe(e,a,t,!1)}else n||(a.state&=~F9,tte(e,a));return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function oIe(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Bkt?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&ete&&nte(e)),tte(e,t)}aa.prototype.isPaused=function(){let e=this._readableState;return e[mP]===!0||e.flowing===!1};aa.prototype.setEncoding=function(e){let t=new _kt(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let a of r)n+=t.write(a);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var SFn=1073741824;function CFn(e){if(e>SFn)throw new uFn("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function Ekt(e,t){return e<=0||t.length===0&&t.ended?0:t.state&MQ?1:GNn(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}aa.prototype.read=function(e){Ga("read",e),e===void 0?e=NaN:WNn(e)||(e=YNn(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=CFn(e)),e!==0&&(t.state&=~Tkt),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Ga("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?cIe(this):nte(this),null;if(e=Ekt(e,t),e===0&&t.ended)return t.length===0&&cIe(this),null;let n=(t.state&ete)!==0;if(Ga("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Ga("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,Ga("reading, ended or constructing",n);else if(n){Ga("do read"),t.state|=F9|Zee,t.length===0&&(t.state|=ete);try{this._read(t.highWaterMark)}catch(s){jQ(this,s)}t.state&=~Zee,t.reading||(e=Ekt(r,t))}let a;return e>0?a=Okt(e,t):a=null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&cIe(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",a)),a};function _Fn(e,t){if(Ga("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?nte(e):(t.needReadable=!1,t.emittedReadable=!0,Pkt(e))}}function nte(e){let t=e._readableState;Ga("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Ga("emitReadable",t.flowing),t.emittedReadable=!0,ub.nextTick(Pkt,e))}function Pkt(e){let t=e._readableState;Ga("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Nkt(e)}function tte(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,ub.nextTick(IFn,e,t))}function IFn(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(Ga("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}aa.prototype._read=function(e){throw new cFn("_read()")};aa.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new KNn(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),Ga("pipe count=%d opts=%j",n.pipes.length,t);let s=(!t||t.end!==!1)&&e!==ub.stdout&&e!==ub.stderr?l:I;n.endEmitted?ub.nextTick(s):r.once("end",s),e.on("unpipe",c);function c(k,O){Ga("onunpipe"),k===r&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,m())}function l(){Ga("onend"),e.end()}let f,d=!1;function m(){Ga("cleanup"),e.removeListener("close",A),e.removeListener("finish",C),f&&e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",I),r.removeListener("data",x),d=!0,f&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&f()}function g(){d||(n.pipes.length===1&&n.pipes[0]===e?(Ga("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(Ga("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),f||(f=kFn(r,e),e.on("drain",f))}r.on("data",x);function x(k){Ga("ondata");let O=e.write(k);Ga("dest.write",O),O===!1&&g()}function b(k){if(Ga("onerror",k),I(),e.removeListener("error",b),e.listenerCount("error")===0){let O=e._writableState||e._readableState;O&&!O.errorEmitted?jQ(e,k):e.emit("error",k)}}rFn(e,"error",b);function A(){e.removeListener("finish",C),I()}e.once("close",A);function C(){Ga("onfinish"),e.removeListener("close",A),I()}e.once("finish",C);function I(){Ga("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?g():n.flowing||(Ga("pipe resume"),r.resume()),e};function kFn(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(Ga("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(Ga("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}aa.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let a=t.pipes;t.pipes=[],this.pause();for(let s=0;s<a.length;s++)a[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=$Nn(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};aa.prototype.on=function(e,t){let r=zI.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,Ga("on readable",n.length,n.reading),n.length?nte(this):n.reading||ub.nextTick(TFn,this)),r};aa.prototype.addListener=aa.prototype.on;aa.prototype.removeListener=function(e,t){let r=zI.prototype.removeListener.call(this,e,t);return e==="readable"&&ub.nextTick(Rkt,this),r};aa.prototype.off=aa.prototype.removeListener;aa.prototype.removeAllListeners=function(e){let t=zI.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&ub.nextTick(Rkt,this),t};function Rkt(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[mP]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function TFn(e){Ga("readable nexttick read 0"),e.read(0)}aa.prototype.resume=function(){let e=this._readableState;return e.flowing||(Ga("resume"),e.flowing=!e.readableListening,BFn(this,e)),e[mP]=!1,this};function BFn(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ub.nextTick(DFn,e,t))}function DFn(e,t){Ga("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Nkt(e),t.flowing&&!t.reading&&e.read(0)}aa.prototype.pause=function(){return Ga("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ga("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[mP]=!0,this};function Nkt(e){let t=e._readableState;for(Ga("flow",t.flowing);t.flowing&&e.read()!==null;);}aa.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{jQ(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=JNn(e);for(let n=1;n<r.length;n++){let a=r[n];this[a]===void 0&&typeof e[a]=="function"&&(this[a]=e[a].bind(e))}return this};aa.prototype[ZNn]=function(){return Fkt(this)};aa.prototype.iterator=function(e){return e!==void 0&&dFn(e,"options"),Fkt(this,e)};function Fkt(e,t){typeof e.read!="function"&&(e=aa.wrap(e,{objectMode:!0}));let r=PFn(e,t);return r.stream=e,r}async function*PFn(e,t){let r=aIe;function n(c){this===e?(r(),r=aIe):r=c}e.on("readable",n);let a,s=Ckt(e,{writable:!1},c=>{a=c?bkt(a,c):null,r(),r=aIe});try{for(;;){let c=e.destroyed?null:e.read();if(c!==null)yield c;else{if(a)throw a;if(a===null)return;await new Skt(n)}}}catch(c){throw a=bkt(a,c),a}finally{(a||(t==null?void 0:t.destroyOnReturn)!==!1)&&(a===void 0||e._readableState.autoDestroy)?qQ.destroyer(e,null):(e.off("readable",n),s())}}fIe(aa.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});fIe(rte.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[mP]!==!1},set(e){this[mP]=!!e}}});aa._fromList=Okt;function Okt(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function cIe(e){let t=e._readableState;Ga("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,ub.nextTick(RFn,t,e))}function RFn(e,t){if(Ga("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)ub.nextTick(NFn,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function NFn(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}aa.from=function(e,t){return hFn(aa,e,t)};var uIe;function Qkt(){return uIe===void 0&&(uIe={}),uIe}aa.fromWeb=function(e,t){return Qkt().newStreamReadableFromReadableStream(e,t)};aa.toWeb=function(e,t){return Qkt().newReadableStreamFromStreamReadable(e,t)};aa.wrap=function(e,t){var r,n;return new aa({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(a,s){qQ.destroyer(e,a),s(a)}}).wrap(e)}});var cte=P((LEi,Jkt)=>{"use strict";var gP=mc(),{ArrayPrototypeSlice:qkt,Error:FFn,FunctionPrototypeSymbolHasInstance:Ukt,ObjectDefineProperty:zkt,ObjectDefineProperties:OFn,ObjectSetPrototypeOf:Hkt,StringPrototypeToLowerCase:QFn,Symbol:LFn,SymbolHasInstance:jFn}=$u();Jkt.exports=yl;yl.WritableState=j9;var{EventEmitter:MFn}=require("events"),Q9=Jee().Stream,{Buffer:ite}=require("buffer"),ote=hP(),{addAbortSignal:qFn}=R9(),{getHighWaterMark:UFn,getDefaultHighWaterMark:zFn}=N9(),{ERR_INVALID_ARG_TYPE:HFn,ERR_METHOD_NOT_IMPLEMENTED:VFn,ERR_MULTIPLE_CALLBACK:Vkt,ERR_STREAM_CANNOT_PIPE:$Fn,ERR_STREAM_DESTROYED:L9,ERR_STREAM_ALREADY_FINISHED:WFn,ERR_STREAM_NULL_VALUES:GFn,ERR_STREAM_WRITE_AFTER_END:YFn,ERR_UNKNOWN_ENCODING:$kt}=Oh().codes,{errorOrDestroy:UQ}=ote;Hkt(yl.prototype,Q9.prototype);Hkt(yl,Q9);function mIe(){}var zQ=LFn("kOnFinished");function j9(e,t,r){typeof r!="boolean"&&(r=t instanceof Q1()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?UFn(this,e,"writableHighWaterMark",r):zFn(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=KFn.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ate(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[zQ]=[]}function ate(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}j9.prototype.getBuffer=function(){return qkt(this.buffered,this.bufferedIndex)};zkt(j9.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function yl(e){let t=this instanceof Q1();if(!t&&!Ukt(yl,this))return new yl(e);this._writableState=new j9(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&qFn(e.signal,this)),Q9.call(this,e),ote.construct(this,()=>{let r=this._writableState;r.writing||AIe(this,r),yIe(this,r)})}zkt(yl,jFn,{__proto__:null,value:function(e){return Ukt(this,e)?!0:this!==yl?!1:e&&e._writableState instanceof j9}});yl.prototype.pipe=function(){UQ(this,new $Fn)};function Wkt(e,t,r,n){let a=e._writableState;if(typeof r=="function")n=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!=="buffer"&&!ite.isEncoding(r))throw new $kt(r);typeof n!="function"&&(n=mIe)}if(t===null)throw new GFn;if(!a.objectMode)if(typeof t=="string")a.decodeStrings!==!1&&(t=ite.from(t,r),r="buffer");else if(t instanceof ite)r="buffer";else if(Q9._isUint8Array(t))t=Q9._uint8ArrayToBuffer(t),r="buffer";else throw new HFn("chunk",["string","Buffer","Uint8Array"],t);let s;return a.ending?s=new YFn:a.destroyed&&(s=new L9("write")),s?(gP.nextTick(n,s),UQ(e,s,!0),s):(a.pendingcb++,JFn(e,a,t,r,n))}yl.prototype.write=function(e,t,r){return Wkt(this,e,t,r)===!0};yl.prototype.cork=function(){this._writableState.corked++};yl.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||AIe(this,e))};yl.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=QFn(t)),!ite.isEncoding(t))throw new $kt(t);return this._writableState.defaultEncoding=t,this};function JFn(e,t,r,n,a){let s=t.objectMode?1:r.length;t.length+=s;let c=t.length<t.highWaterMark;return c||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:a}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&a!==mIe&&(t.allNoop=!1)):(t.writelen=s,t.writecb=a,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),c&&!t.errored&&!t.destroyed}function jkt(e,t,r,n,a,s,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new L9("write")):r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}function Mkt(e,t,r,n){--t.pendingcb,n(r),gIe(t),UQ(e,r)}function KFn(e,t){let r=e._writableState,n=r.sync,a=r.writecb;if(typeof a!="function"){UQ(e,new Vkt);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?gP.nextTick(Mkt,e,r,t,a):Mkt(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&AIe(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},gP.nextTick(XFn,r.afterWriteTickInfo)):Gkt(e,r,1,a))}function XFn({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,Gkt(e,t,r,n)}function Gkt(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&gIe(t),yIe(e,t)}function gIe(e){if(e.writing)return;for(let a=e.bufferedIndex;a<e.buffered.length;++a){var t;let{chunk:s,callback:c}=e.buffered[a],l=e.objectMode?1:s.length;e.length-=l,c((t=e.errored)!==null&&t!==void 0?t:new L9("write"))}let r=e[zQ].splice(0);for(let a=0;a<r.length;a++){var n;r[a]((n=e.errored)!==null&&n!==void 0?n:new L9("end"))}ate(e)}function AIe(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:a}=t,s=r.length-n;if(!s)return;let c=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let l=t.allNoop?mIe:d=>{for(let m=c;m<r.length;++m)r[m].callback(d)},f=t.allNoop&&c===0?r:qkt(r,c);f.allBuffers=t.allBuffers,jkt(e,t,!0,t.length,f,"",l),ate(t)}else{do{let{chunk:l,encoding:f,callback:d}=r[c];r[c++]=null;let m=a?1:l.length;jkt(e,t,!1,m,l,f,d)}while(c<r.length&&!t.writing);c===r.length?ate(t):c>256?(r.splice(0,c),t.bufferedIndex=0):t.bufferedIndex=c}t.bufferProcessing=!1}yl.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new VFn("_write()")};yl.prototype._writev=null;yl.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let a;if(e!=null){let s=Wkt(this,e,t);s instanceof FFn&&(a=s)}return n.corked&&(n.corked=1,this.uncork()),a||(!n.errored&&!n.ending?(n.ending=!0,yIe(this,n,!0),n.ended=!0):n.finished?a=new WFn("end"):n.destroyed&&(a=new L9("end"))),typeof r=="function"&&(a||n.finished?gP.nextTick(r,a):n[zQ].push(r)),this};function ste(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function ZFn(e,t){let r=!1;function n(a){if(r){UQ(e,a!=null?a:Vkt());return}if(r=!0,t.pendingcb--,a){let s=t[zQ].splice(0);for(let c=0;c<s.length;c++)s[c](a);UQ(e,a,t.sync)}else ste(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,gP.nextTick(hIe,e,t))}t.sync=!0,t.pendingcb++;try{e._final(n)}catch(a){n(a)}t.sync=!1}function eOn(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,ZFn(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function yIe(e,t,r){ste(t)&&(eOn(e,t),t.pendingcb===0&&(r?(t.pendingcb++,gP.nextTick((n,a)=>{ste(a)?hIe(n,a):a.pendingcb--},e,t)):ste(t)&&(t.pendingcb++,hIe(e,t))))}function hIe(e,t){t.pendingcb--,t.finished=!0;let r=t[zQ].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}OFn(yl.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var tOn=ote.destroy;yl.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[zQ].length)&&gP.nextTick(gIe,r),tOn.call(this,e,t),this};yl.prototype._undestroy=ote.undestroy;yl.prototype._destroy=function(e,t){t(e)};yl.prototype[MFn.captureRejectionSymbol]=function(e){this.destroy(e)};var dIe;function Ykt(){return dIe===void 0&&(dIe={}),dIe}yl.fromWeb=function(e,t){return Ykt().newStreamWritableFromWritableStream(e,t)};yl.toWeb=function(e){return Ykt().newWritableStreamFromStreamWritable(e)}});var pTt=P((jEi,lTt)=>{var vIe=mc(),rOn=require("buffer"),{isReadable:nOn,isWritable:iOn,isIterable:Kkt,isNodeStream:sOn,isReadableNodeStream:Xkt,isWritableNodeStream:Zkt,isDuplexNodeStream:aOn,isReadableStream:eTt,isWritableStream:tTt}=F1(),rTt=MS(),{AbortError:cTt,codes:{ERR_INVALID_ARG_TYPE:oOn,ERR_INVALID_RETURN_VALUE:nTt}}=Oh(),{destroyer:VQ}=hP(),cOn=Q1(),uTt=O9(),uOn=cte(),{createDeferredPromise:iTt}=Gm(),sTt=iIe(),aTt=globalThis.Blob||rOn.Blob,lOn=typeof aTt<"u"?function(t){return t instanceof aTt}:function(t){return!1},pOn=globalThis.AbortController||lp().AbortController,{FunctionPrototypeCall:oTt}=$u(),HI=class extends cOn{constructor(t){super(t),(t==null?void 0:t.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(t==null?void 0:t.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};lTt.exports=function e(t,r){if(aOn(t))return t;if(Xkt(t))return HQ({readable:t});if(Zkt(t))return HQ({writable:t});if(sOn(t))return HQ({writable:!1,readable:!1});if(eTt(t))return HQ({readable:uTt.fromWeb(t)});if(tTt(t))return HQ({writable:uOn.fromWeb(t)});if(typeof t=="function"){let{value:a,write:s,final:c,destroy:l}=fOn(t);if(Kkt(a))return sTt(HI,a,{objectMode:!0,write:s,final:c,destroy:l});let f=a==null?void 0:a.then;if(typeof f=="function"){let d,m=oTt(f,a,g=>{if(g!=null)throw new nTt("nully","body",g)},g=>{VQ(d,g)});return d=new HI({objectMode:!0,readable:!1,write:s,final(g){c(async()=>{try{await m,vIe.nextTick(g,null)}catch(x){vIe.nextTick(g,x)}})},destroy:l})}throw new nTt("Iterable, AsyncIterable or AsyncFunction",r,a)}if(lOn(t))return e(t.arrayBuffer());if(Kkt(t))return sTt(HI,t,{objectMode:!0,writable:!1});if(eTt(t==null?void 0:t.readable)&&tTt(t==null?void 0:t.writable))return HI.fromWeb(t);if(typeof(t==null?void 0:t.writable)=="object"||typeof(t==null?void 0:t.readable)=="object"){let a=t!=null&&t.readable?Xkt(t==null?void 0:t.readable)?t==null?void 0:t.readable:e(t.readable):void 0,s=t!=null&&t.writable?Zkt(t==null?void 0:t.writable)?t==null?void 0:t.writable:e(t.writable):void 0;return HQ({readable:a,writable:s})}let n=t==null?void 0:t.then;if(typeof n=="function"){let a;return oTt(n,t,s=>{s!=null&&a.push(s),a.push(null)},s=>{VQ(a,s)}),a=new HI({objectMode:!0,writable:!1,read(){}})}throw new oOn(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function fOn(e){let{promise:t,resolve:r}=iTt(),n=new pOn,a=n.signal;return{value:e(async function*(){for(;;){let c=t;t=null;let{chunk:l,done:f,cb:d}=await c;if(vIe.nextTick(d),f)return;if(a.aborted)throw new cTt(void 0,{cause:a.reason});({promise:t,resolve:r}=iTt()),yield l}}(),{signal:a}),write(c,l,f){let d=r;r=null,d({chunk:c,done:!1,cb:f})},final(c){let l=r;r=null,l({done:!0,cb:c})},destroy(c,l){n.abort(),l(c)}}}function HQ(e){let t=e.readable&&typeof e.readable.read!="function"?uTt.wrap(e.readable):e.readable,r=e.writable,n=!!nOn(t),a=!!iOn(r),s,c,l,f,d;function m(g){let x=f;f=null,x?x(g):g&&d.destroy(g)}return d=new HI({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:a}),a&&(rTt(r,g=>{a=!1,g&&VQ(t,g),m(g)}),d._write=function(g,x,b){r.write(g,x)?b():s=b},d._final=function(g){r.end(),c=g},r.on("drain",function(){if(s){let g=s;s=null,g()}}),r.on("finish",function(){if(c){let g=c;c=null,g()}})),n&&(rTt(t,g=>{n=!1,g&&VQ(t,g),m(g)}),t.on("readable",function(){if(l){let g=l;l=null,g()}}),t.on("end",function(){d.push(null)}),d._read=function(){for(;;){let g=t.read();if(g===null){l=d._read;return}if(!d.push(g))return}}),d._destroy=function(g,x){!g&&f!==null&&(g=new cTt),l=null,s=null,c=null,f===null?x(g):(f=x,VQ(r,g),VQ(t,g))},d}});var Q1=P((MEi,hTt)=>{"use strict";var{ObjectDefineProperties:dOn,ObjectGetOwnPropertyDescriptor:qS,ObjectKeys:hOn,ObjectSetPrototypeOf:fTt}=$u();hTt.exports=lb;var EIe=O9(),ov=cte();fTt(lb.prototype,EIe.prototype);fTt(lb,EIe);{let e=hOn(ov.prototype);for(let t=0;t<e.length;t++){let r=e[t];lb.prototype[r]||(lb.prototype[r]=ov.prototype[r])}}function lb(e){if(!(this instanceof lb))return new lb(e);EIe.call(this,e),ov.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}dOn(lb.prototype,{writable:{__proto__:null,...qS(ov.prototype,"writable")},writableHighWaterMark:{__proto__:null,...qS(ov.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...qS(ov.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...qS(ov.prototype,"writableBuffer")},writableLength:{__proto__:null,...qS(ov.prototype,"writableLength")},writableFinished:{__proto__:null,...qS(ov.prototype,"writableFinished")},writableCorked:{__proto__:null,...qS(ov.prototype,"writableCorked")},writableEnded:{__proto__:null,...qS(ov.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...qS(ov.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var xIe;function dTt(){return xIe===void 0&&(xIe={}),xIe}lb.fromWeb=function(e,t){return dTt().newStreamDuplexFromReadableWritablePair(e,t)};lb.toWeb=function(e){return dTt().newReadableWritablePairFromDuplex(e)};var bIe;lb.from=function(e){return bIe||(bIe=pTt()),bIe(e,"body")}});var CIe=P((qEi,gTt)=>{"use strict";var{ObjectSetPrototypeOf:mTt,Symbol:mOn}=$u();gTt.exports=US;var{ERR_METHOD_NOT_IMPLEMENTED:gOn}=Oh().codes,SIe=Q1(),{getHighWaterMark:AOn}=N9();mTt(US.prototype,SIe.prototype);mTt(US,SIe);var M9=mOn("kCallback");function US(e){if(!(this instanceof US))return new US(e);let t=e?AOn(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),SIe.call(this,e),this._readableState.sync=!1,this[M9]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",yOn)}function wIe(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function yOn(){this._final!==wIe&&wIe.call(this)}US.prototype._final=wIe;US.prototype._transform=function(e,t,r){throw new gOn("_transform()")};US.prototype._write=function(e,t,r){let n=this._readableState,a=this._writableState,s=n.length;this._transform(e,t,(c,l)=>{if(c){r(c);return}l!=null&&this.push(l),a.ended||s===n.length||n.length<n.highWaterMark?r():this[M9]=r})};US.prototype._read=function(){if(this[M9]){let e=this[M9];this[M9]=null,e()}}});var IIe=P((UEi,yTt)=>{"use strict";var{ObjectSetPrototypeOf:ATt}=$u();yTt.exports=$Q;var _Ie=CIe();ATt($Q.prototype,_Ie.prototype);ATt($Q,_Ie);function $Q(e){if(!(this instanceof $Q))return new $Q(e);_Ie.call(this,e)}$Q.prototype._transform=function(e,t,r){r(null,e)}});var fte=P((zEi,wTt)=>{var q9=mc(),{ArrayIsArray:vOn,Promise:xOn,SymbolAsyncIterator:bOn,SymbolDispose:EOn}=$u(),pte=MS(),{once:wOn}=Gm(),SOn=hP(),vTt=Q1(),{aggregateTwoErrors:COn,codes:{ERR_INVALID_ARG_TYPE:OIe,ERR_INVALID_RETURN_VALUE:kIe,ERR_MISSING_ARGS:_On,ERR_STREAM_DESTROYED:IOn,ERR_STREAM_PREMATURE_CLOSE:kOn},AbortError:TOn}=Oh(),{validateFunction:BOn,validateAbortSignal:DOn}=QQ(),{isIterable:AP,isReadable:TIe,isReadableNodeStream:lte,isNodeStream:xTt,isTransformStream:WQ,isWebStream:POn,isReadableStream:BIe,isReadableFinished:ROn}=F1(),NOn=globalThis.AbortController||lp().AbortController,DIe,PIe,RIe;function bTt(e,t,r){let n=!1;e.on("close",()=>{n=!0});let a=pte(e,{readable:t,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,SOn.destroyer(e,s||new IOn("pipe")))},cleanup:a}}function FOn(e){return BOn(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function NIe(e){if(AP(e))return e;if(lte(e))return OOn(e);throw new OIe("val",["Readable","Iterable","AsyncIterable"],e)}async function*OOn(e){PIe||(PIe=O9()),yield*PIe.prototype[bOn].call(e)}async function ute(e,t,r,{end:n}){let a,s=null,c=d=>{if(d&&(a=d),s){let m=s;s=null,m()}},l=()=>new xOn((d,m)=>{a?m(a):s=()=>{a?m(a):d()}});t.on("drain",c);let f=pte(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let d of e)t.write(d)||await l();n&&(t.end(),await l()),r()}catch(d){r(a!==d?COn(a,d):d)}finally{f(),t.off("drain",c)}}async function FIe(e,t,r,{end:n}){WQ(t)&&(t=t.writable);let a=t.getWriter();try{for await(let s of e)await a.ready,a.write(s).catch(()=>{});await a.ready,n&&await a.close(),r()}catch(s){try{await a.abort(s),r(s)}catch(c){r(c)}}}function QOn(...e){return ETt(e,wOn(FOn(e)))}function ETt(e,t,r){if(e.length===1&&vOn(e[0])&&(e=e[0]),e.length<2)throw new _On("streams");let n=new NOn,a=n.signal,s=r==null?void 0:r.signal,c=[];DOn(s,"options.signal");function l(){A(new TOn)}RIe=RIe||Gm().addAbortListener;let f;s&&(f=RIe(s,l));let d,m,g=[],x=0;function b(j){A(j,--x===0)}function A(j,M){var W;if(j&&(!d||d.code==="ERR_STREAM_PREMATURE_CLOSE")&&(d=j),!(!d&&!M)){for(;g.length;)g.shift()(d);(W=f)===null||W===void 0||W[EOn](),n.abort(),M&&(d||c.forEach(se=>se()),q9.nextTick(t,d,m))}}let C;for(let j=0;j<e.length;j++){let M=e[j],W=j<e.length-1,se=j>0,X=W||(r==null?void 0:r.end)!==!1,ve=j===e.length-1;if(xTt(M)){let ae=function(he){he&&he.name!=="AbortError"&&he.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(he)};var O=ae;if(X){let{destroy:he,cleanup:me}=bTt(M,W,se);g.push(he),TIe(M)&&ve&&c.push(me)}M.on("error",ae),TIe(M)&&ve&&c.push(()=>{M.removeListener("error",ae)})}if(j===0)if(typeof M=="function"){if(C=M({signal:a}),!AP(C))throw new kIe("Iterable, AsyncIterable or Stream","source",C)}else AP(M)||lte(M)||WQ(M)?C=M:C=vTt.from(M);else if(typeof M=="function"){if(WQ(C)){var I;C=NIe((I=C)===null||I===void 0?void 0:I.readable)}else C=NIe(C);if(C=M(C,{signal:a}),W){if(!AP(C,!0))throw new kIe("AsyncIterable",`transform[${j-1}]`,C)}else{var k;DIe||(DIe=IIe());let ae=new DIe({objectMode:!0}),he=(k=C)===null||k===void 0?void 0:k.then;if(typeof he=="function")x++,he.call(C,ue=>{m=ue,ue!=null&&ae.write(ue),X&&ae.end(),q9.nextTick(b)},ue=>{ae.destroy(ue),q9.nextTick(b,ue)});else if(AP(C,!0))x++,ute(C,ae,b,{end:X});else if(BIe(C)||WQ(C)){let ue=C.readable||C;x++,ute(ue,ae,b,{end:X})}else throw new kIe("AsyncIterable or Promise","destination",C);C=ae;let{destroy:me,cleanup:ye}=bTt(C,!1,!0);g.push(me),ve&&c.push(ye)}}else if(xTt(M)){if(lte(C)){x+=2;let ae=LOn(C,M,b,{end:X});TIe(M)&&ve&&c.push(ae)}else if(WQ(C)||BIe(C)){let ae=C.readable||C;x++,ute(ae,M,b,{end:X})}else if(AP(C))x++,ute(C,M,b,{end:X});else throw new OIe("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=M}else if(POn(M)){if(lte(C))x++,FIe(NIe(C),M,b,{end:X});else if(BIe(C)||AP(C))x++,FIe(C,M,b,{end:X});else if(WQ(C))x++,FIe(C.readable,M,b,{end:X});else throw new OIe("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=M}else C=vTt.from(M)}return(a!=null&&a.aborted||s!=null&&s.aborted)&&q9.nextTick(l),C}function LOn(e,t,r,{end:n}){let a=!1;if(t.on("close",()=>{a||r(new kOn)}),e.pipe(t,{end:!1}),n){let c=function(){a=!0,t.end()};var s=c;ROn(e)?q9.nextTick(c):e.once("end",c)}else r();return pte(e,{readable:!0,writable:!1},c=>{let l=e._readableState;c&&c.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?e.once("end",r).once("error",r):r(c)}),pte(t,{readable:!1,writable:!0},r)}wTt.exports={pipelineImpl:ETt,pipeline:QOn}});var LIe=P((HEi,TTt)=>{"use strict";var{pipeline:jOn}=fte(),dte=Q1(),{destroyer:MOn}=hP(),{isNodeStream:hte,isReadable:STt,isWritable:CTt,isWebStream:QIe,isTransformStream:yP,isWritableStream:_Tt,isReadableStream:ITt}=F1(),{AbortError:qOn,codes:{ERR_INVALID_ARG_VALUE:kTt,ERR_MISSING_ARGS:UOn}}=Oh(),zOn=MS();TTt.exports=function(...t){if(t.length===0)throw new UOn("streams");if(t.length===1)return dte.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=dte.from(t[0])),typeof t[t.length-1]=="function"){let b=t.length-1;t[b]=dte.from(t[b])}for(let b=0;b<t.length;++b)if(!(!hte(t[b])&&!QIe(t[b]))){if(b<t.length-1&&!(STt(t[b])||ITt(t[b])||yP(t[b])))throw new kTt(`streams[${b}]`,r[b],"must be readable");if(b>0&&!(CTt(t[b])||_Tt(t[b])||yP(t[b])))throw new kTt(`streams[${b}]`,r[b],"must be writable")}let n,a,s,c,l;function f(b){let A=c;c=null,A?A(b):b?l.destroy(b):!x&&!g&&l.destroy()}let d=t[0],m=jOn(t,f),g=!!(CTt(d)||_Tt(d)||yP(d)),x=!!(STt(m)||ITt(m)||yP(m));if(l=new dte({writableObjectMode:!!(d!=null&&d.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:g,readable:x}),g){if(hte(d))l._write=function(A,C,I){d.write(A,C)?I():n=I},l._final=function(A){d.end(),a=A},d.on("drain",function(){if(n){let A=n;n=null,A()}});else if(QIe(d)){let C=(yP(d)?d.writable:d).getWriter();l._write=async function(I,k,O){try{await C.ready,C.write(I).catch(()=>{}),O()}catch(j){O(j)}},l._final=async function(I){try{await C.ready,C.close().catch(()=>{}),a=I}catch(k){I(k)}}}let b=yP(m)?m.readable:m;zOn(b,()=>{if(a){let A=a;a=null,A()}})}if(x){if(hte(m))m.on("readable",function(){if(s){let b=s;s=null,b()}}),m.on("end",function(){l.push(null)}),l._read=function(){for(;;){let b=m.read();if(b===null){s=l._read;return}if(!l.push(b))return}};else if(QIe(m)){let A=(yP(m)?m.readable:m).getReader();l._read=async function(){for(;;)try{let{value:C,done:I}=await A.read();if(!l.push(C))return;if(I){l.push(null);return}}catch{return}}}}return l._destroy=function(b,A){!b&&c!==null&&(b=new qOn),s=null,n=null,a=null,c===null?A(b):(c=A,hte(m)&&MOn(m,b))},l}});var jTt=P((VEi,qIe)=>{"use strict";var HOn=globalThis.AbortController||lp().AbortController,{codes:{ERR_INVALID_ARG_VALUE:VOn,ERR_INVALID_ARG_TYPE:U9,ERR_MISSING_ARGS:$On,ERR_OUT_OF_RANGE:WOn},AbortError:L1}=Oh(),{validateAbortSignal:vP,validateInteger:BTt,validateObject:xP}=QQ(),GOn=$u().Symbol("kWeak"),YOn=$u().Symbol("kResistStopPropagation"),{finished:JOn}=MS(),KOn=LIe(),{addAbortSignalNoValidate:XOn}=R9(),{isWritable:ZOn,isNodeStream:e4n}=F1(),{deprecate:t4n}=Gm(),{ArrayPrototypePush:r4n,Boolean:n4n,MathFloor:DTt,Number:i4n,NumberIsNaN:s4n,Promise:PTt,PromiseReject:RTt,PromiseResolve:a4n,PromisePrototypeThen:NTt,Symbol:OTt}=$u(),mte=OTt("kEmpty"),FTt=OTt("kEof");function o4n(e,t){if(t!=null&&xP(t,"options"),(t==null?void 0:t.signal)!=null&&vP(t.signal,"options.signal"),e4n(e)&&!ZOn(e))throw new VOn("stream",e,"must be writable");let r=KOn(this,e);return t!=null&&t.signal&&XOn(t.signal,r),r}function gte(e,t){if(typeof e!="function")throw new U9("fn",["Function","AsyncFunction"],e);t!=null&&xP(t,"options"),(t==null?void 0:t.signal)!=null&&vP(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=DTt(t.concurrency));let n=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(n=DTt(t.highWaterMark)),BTt(r,"options.concurrency",1),BTt(n,"options.highWaterMark",0),n+=r,async function*(){let s=Gm().AbortSignalAny([t==null?void 0:t.signal].filter(n4n)),c=this,l=[],f={signal:s},d,m,g=!1,x=0;function b(){g=!0,A()}function A(){x-=1,C()}function C(){m&&!g&&x<r&&l.length<n&&(m(),m=null)}async function I(){try{for await(let k of c){if(g)return;if(s.aborted)throw new L1;try{if(k=e(k,f),k===mte)continue;k=a4n(k)}catch(O){k=RTt(O)}x+=1,NTt(k,A,b),l.push(k),d&&(d(),d=null),!g&&(l.length>=n||x>=r)&&await new PTt(O=>{m=O})}l.push(FTt)}catch(k){let O=RTt(k);NTt(O,A,b),l.push(O)}finally{g=!0,d&&(d(),d=null)}}I();try{for(;;){for(;l.length>0;){let k=await l[0];if(k===FTt)return;if(s.aborted)throw new L1;k!==mte&&(yield k),l.shift(),C()}await new PTt(k=>{d=k})}}finally{g=!0,m&&(m(),m=null)}}.call(this)}function c4n(e=void 0){return e!=null&&xP(e,"options"),(e==null?void 0:e.signal)!=null&&vP(e.signal,"options.signal"),async function*(){let r=0;for await(let a of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new L1({cause:e.signal.reason});yield[r++,a]}}.call(this)}async function QTt(e,t=void 0){for await(let r of MIe.call(this,e,t))return!0;return!1}async function u4n(e,t=void 0){if(typeof e!="function")throw new U9("fn",["Function","AsyncFunction"],e);return!await QTt.call(this,async(...r)=>!await e(...r),t)}async function l4n(e,t){for await(let r of MIe.call(this,e,t))return r}async function p4n(e,t){if(typeof e!="function")throw new U9("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a),mte}for await(let n of gte.call(this,r,t));}function MIe(e,t){if(typeof e!="function")throw new U9("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a)?n:mte}return gte.call(this,r,t)}var jIe=class extends $On{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function f4n(e,t,r){var n;if(typeof e!="function")throw new U9("reducer",["Function","AsyncFunction"],e);r!=null&&xP(r,"options"),(r==null?void 0:r.signal)!=null&&vP(r.signal,"options.signal");let a=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let d=new L1(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await JOn(this.destroy(d)),d}let s=new HOn,c=s.signal;if(r!=null&&r.signal){let d={once:!0,[GOn]:this,[YOn]:!0};r.signal.addEventListener("abort",()=>s.abort(),d)}let l=!1;try{for await(let d of this){var f;if(l=!0,r!=null&&(f=r.signal)!==null&&f!==void 0&&f.aborted)throw new L1;a?t=await e(t,d,{signal:c}):(t=d,a=!0)}if(!l&&!a)throw new jIe}finally{s.abort()}return t}async function d4n(e){e!=null&&xP(e,"options"),(e==null?void 0:e.signal)!=null&&vP(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new L1(void 0,{cause:e.signal.reason});r4n(t,n)}return t}function h4n(e,t){let r=gte.call(this,e,t);return async function*(){for await(let a of r)yield*a}.call(this)}function LTt(e){if(e=i4n(e),s4n(e))return 0;if(e<0)throw new WOn("number",">= 0",e);return e}function m4n(e,t=void 0){return t!=null&&xP(t,"options"),(t==null?void 0:t.signal)!=null&&vP(t.signal,"options.signal"),e=LTt(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new L1;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new L1;e--<=0&&(yield s)}}.call(this)}function g4n(e,t=void 0){return t!=null&&xP(t,"options"),(t==null?void 0:t.signal)!=null&&vP(t.signal,"options.signal"),e=LTt(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new L1;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new L1;if(e-- >0&&(yield s),e<=0)return}}.call(this)}qIe.exports.streamReturningOperators={asIndexedPairs:t4n(c4n,"readable.asIndexedPairs will be removed in a future version."),drop:m4n,filter:MIe,flatMap:h4n,map:gte,take:g4n,compose:o4n};qIe.exports.promiseReturningOperators={every:u4n,forEach:p4n,reduce:f4n,toArray:d4n,some:QTt,find:l4n}});var UIe=P(($Ei,MTt)=>{"use strict";var{ArrayPrototypePop:A4n,Promise:y4n}=$u(),{isIterable:v4n,isNodeStream:x4n,isWebStream:b4n}=F1(),{pipelineImpl:E4n}=fte(),{finished:w4n}=MS();zIe();function S4n(...e){return new y4n((t,r)=>{let n,a,s=e[e.length-1];if(s&&typeof s=="object"&&!x4n(s)&&!v4n(s)&&!b4n(s)){let c=A4n(e);n=c.signal,a=c.end}E4n(e,(c,l)=>{c?r(c):t(l)},{signal:n,end:a})})}MTt.exports={finished:w4n,pipeline:S4n}});var zIe=P((WEi,YTt)=>{"use strict";var{Buffer:C4n}=require("buffer"),{ObjectDefineProperty:zS,ObjectKeys:zTt,ReflectApply:HTt}=$u(),{promisify:{custom:VTt}}=Gm(),{streamReturningOperators:qTt,promiseReturningOperators:UTt}=jTt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:$Tt}}=Oh(),_4n=LIe(),{setDefaultHighWaterMark:I4n,getDefaultHighWaterMark:k4n}=N9(),{pipeline:WTt}=fte(),{destroyer:T4n}=hP(),GTt=MS(),HIe=UIe(),z9=F1(),Iu=YTt.exports=Jee().Stream;Iu.isDestroyed=z9.isDestroyed;Iu.isDisturbed=z9.isDisturbed;Iu.isErrored=z9.isErrored;Iu.isReadable=z9.isReadable;Iu.isWritable=z9.isWritable;Iu.Readable=O9();for(let e of zTt(qTt)){let r=function(...n){if(new.target)throw $Tt();return Iu.Readable.from(HTt(t,this,n))},t=qTt[e];zS(r,"name",{__proto__:null,value:t.name}),zS(r,"length",{__proto__:null,value:t.length}),zS(Iu.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of zTt(UTt)){let r=function(...n){if(new.target)throw $Tt();return HTt(t,this,n)},t=UTt[e];zS(r,"name",{__proto__:null,value:t.name}),zS(r,"length",{__proto__:null,value:t.length}),zS(Iu.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}Iu.Writable=cte();Iu.Duplex=Q1();Iu.Transform=CIe();Iu.PassThrough=IIe();Iu.pipeline=WTt;var{addAbortSignal:B4n}=R9();Iu.addAbortSignal=B4n;Iu.finished=GTt;Iu.destroy=T4n;Iu.compose=_4n;Iu.setDefaultHighWaterMark=I4n;Iu.getDefaultHighWaterMark=k4n;zS(Iu,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return HIe}});zS(WTt,VTt,{__proto__:null,enumerable:!0,get(){return HIe.pipeline}});zS(GTt,VTt,{__proto__:null,enumerable:!0,get(){return HIe.finished}});Iu.Stream=Iu;Iu._isUint8Array=function(t){return t instanceof Uint8Array};Iu._uint8ArrayToBuffer=function(t){return C4n.from(t.buffer,t.byteOffset,t.byteLength)}});var VIe=P((GEi,Da)=>{"use strict";var lf=require("stream");if(lf&&process.env.READABLE_STREAM==="disable"){let e=lf.promises;Da.exports._uint8ArrayToBuffer=lf._uint8ArrayToBuffer,Da.exports._isUint8Array=lf._isUint8Array,Da.exports.isDisturbed=lf.isDisturbed,Da.exports.isErrored=lf.isErrored,Da.exports.isReadable=lf.isReadable,Da.exports.Readable=lf.Readable,Da.exports.Writable=lf.Writable,Da.exports.Duplex=lf.Duplex,Da.exports.Transform=lf.Transform,Da.exports.PassThrough=lf.PassThrough,Da.exports.addAbortSignal=lf.addAbortSignal,Da.exports.finished=lf.finished,Da.exports.destroy=lf.destroy,Da.exports.pipeline=lf.pipeline,Da.exports.compose=lf.compose,Object.defineProperty(lf,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Da.exports.Stream=lf.Stream}else{let e=zIe(),t=UIe(),r=e.Readable.destroy;Da.exports=e.Readable,Da.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,Da.exports._isUint8Array=e._isUint8Array,Da.exports.isDisturbed=e.isDisturbed,Da.exports.isErrored=e.isErrored,Da.exports.isReadable=e.isReadable,Da.exports.Readable=e.Readable,Da.exports.Writable=e.Writable,Da.exports.Duplex=e.Duplex,Da.exports.Transform=e.Transform,Da.exports.PassThrough=e.PassThrough,Da.exports.addAbortSignal=e.addAbortSignal,Da.exports.finished=e.finished,Da.exports.destroy=e.destroy,Da.exports.destroy=r,Da.exports.pipeline=e.pipeline,Da.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),Da.exports.Stream=e.Stream}Da.exports.default=Da.exports});var $Ie=P((JEi,JTt)=>{var YEi=require("stream").Stream,D4n=VIe().PassThrough,P4n=F_e(),R4n=JTt.exports={};R4n.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e=="string")return Buffer.from(e);if(P4n(e)&&!e._readableState){var t=new D4n;return e.pipe(t),t}return e}});var GIe=P((KEi,KTt)=>{var N4n=require("util").inherits,F4n=F_e(),WIe=VIe().Transform,O4n=Mee(),Q4n=$Ie(),yA=KTt.exports=function(e){if(!(this instanceof yA))return new yA(e);WIe.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};N4n(yA,WIe);yA.prototype._appendBuffer=function(e,t,r){};yA.prototype._appendStream=function(e,t,r){};yA.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)};yA.prototype._finish=function(e){};yA.prototype._normalizeEntry=function(e){};yA.prototype._transform=function(e,t,r){r(null,e)};yA.prototype.entry=function(e,t,r){if(t=t||null,typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),!(e instanceof O4n)){r(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){r(new Error("unacceptable entry after finish"));return}if(this._archive.processing){r(new Error("already processing an entry"));return}if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=Q4n.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else if(F4n(t))this._appendStream(e,t,r);else{this._archive.processing=!1,r(new Error("input source must be valid Stream or Buffer instance"));return}return this};yA.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()};yA.prototype.getBytesWritten=function(){return this.offset};yA.prototype.write=function(e,t){return e&&(this.offset+=e.length),WIe.prototype.write.call(this,e,t)}});var Ate=P(YIe=>{var XTt;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof YIe=="object"?e(YIe):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(XTt={}):e(XTt={})})(function(e){e.version="1.2.2";function t(){for(var X=0,ve=new Array(256),ae=0;ae!=256;++ae)X=ae,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,X=X&1?-306674912^X>>>1:X>>>1,ve[ae]=X;return typeof Int32Array<"u"?new Int32Array(ve):ve}var r=t();function n(X){var ve=0,ae=0,he=0,me=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(he=0;he!=256;++he)me[he]=X[he];for(he=0;he!=256;++he)for(ae=X[he],ve=256+he;ve<4096;ve+=256)ae=me[ve]=ae>>>8^X[ae&255];var ye=[];for(he=1;he!=16;++he)ye[he-1]=typeof Int32Array<"u"?me.subarray(he*256,he*256+256):me.slice(he*256,he*256+256);return ye}var a=n(r),s=a[0],c=a[1],l=a[2],f=a[3],d=a[4],m=a[5],g=a[6],x=a[7],b=a[8],A=a[9],C=a[10],I=a[11],k=a[12],O=a[13],j=a[14];function M(X,ve){for(var ae=ve^-1,he=0,me=X.length;he<me;)ae=ae>>>8^r[(ae^X.charCodeAt(he++))&255];return~ae}function W(X,ve){for(var ae=ve^-1,he=X.length-15,me=0;me<he;)ae=j[X[me++]^ae&255]^O[X[me++]^ae>>8&255]^k[X[me++]^ae>>16&255]^I[X[me++]^ae>>>24]^C[X[me++]]^A[X[me++]]^b[X[me++]]^x[X[me++]]^g[X[me++]]^m[X[me++]]^d[X[me++]]^f[X[me++]]^l[X[me++]]^c[X[me++]]^s[X[me++]]^r[X[me++]];for(he+=15;me<he;)ae=ae>>>8^r[(ae^X[me++])&255];return~ae}function se(X,ve){for(var ae=ve^-1,he=0,me=X.length,ye=0,ue=0;he<me;)ye=X.charCodeAt(he++),ye<128?ae=ae>>>8^r[(ae^ye)&255]:ye<2048?(ae=ae>>>8^r[(ae^(192|ye>>6&31))&255],ae=ae>>>8^r[(ae^(128|ye&63))&255]):ye>=55296&&ye<57344?(ye=(ye&1023)+64,ue=X.charCodeAt(he++)&1023,ae=ae>>>8^r[(ae^(240|ye>>8&7))&255],ae=ae>>>8^r[(ae^(128|ye>>2&63))&255],ae=ae>>>8^r[(ae^(128|ue>>6&15|(ye&3)<<4))&255],ae=ae>>>8^r[(ae^(128|ue&63))&255]):(ae=ae>>>8^r[(ae^(224|ye>>12&15))&255],ae=ae>>>8^r[(ae^(128|ye>>6&63))&255],ae=ae>>>8^r[(ae^(128|ye&63))&255]);return~ae}e.table=r,e.bstr=M,e.buf=W,e.str=se})});var Wu=P((ZEi,ZTt)=>{"use strict";var JIe=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
@@ -519,7 +519,7 @@ ${A.join(`
519
519
  `;x.forEach(A=>{b+=A}),t.fail(b)}};let f={};s.conflicts=function(g,x){Kn("<string|object> [array|string]",[g,x],arguments.length),typeof g=="object"?Object.keys(g).forEach(b=>{s.conflicts(b,g[b])}):(e.global(g),f[g]||(f[g]=[]),Array.isArray(x)?x.forEach(b=>s.conflicts(g,b)):f[g].push(x))},s.getConflicting=()=>f,s.conflicting=function(g){Object.keys(g).forEach(x=>{f[x]&&f[x].forEach(b=>{b&&g[x]!==void 0&&g[b]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",x,b))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(x=>{f[x].forEach(b=>{b&&g[r.Parser.camelCase(x)]!==void 0&&g[r.Parser.camelCase(b)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",x,b))})})},s.recommendCommands=function(g,x){x=x.sort((I,k)=>k.length-I.length);let A=null,C=1/0;for(let I=0,k;(k=x[I])!==void 0;I++){let O=QPe(g,k);O<=3&&O<C&&(C=O,A=k)}A&&t.fail(n("Did you mean %s?",A))},s.reset=function(g){return c=RC(c,x=>!g[x]),f=RC(f,x=>!g[x]),s};let d=[];return s.freeze=function(){d.push({implied:c,conflicting:f})},s.unfreeze=function(){let g=d.pop();tm(g,void 0,r),{implied:c,conflicting:f}=g},s}var Zn=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},qe=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ep,Nk,J3,ty,Og,T7,FC,Fk,B7,ry,D7,ny,Hb,Qg,iy,P7,AR,_f,wi,R7,N7,Lg,Ok,yR,Qk,OC,F7,ls,Lk,jk,Mk,bs,O7,Vb,Tl;function sRe(e){return(t=[],r=e.process.cwd(),n)=>{let a=new gie(t,r,n,e);return Object.defineProperty(a,"argv",{get:()=>a.parse(),enumerable:!0}),a.help(),a.version(),a}}var MPe=Symbol("copyDoubleDash"),qPe=Symbol("copyDoubleDash"),aie=Symbol("deleteFromParserHintObject"),UPe=Symbol("emitWarning"),zPe=Symbol("freeze"),HPe=Symbol("getDollarZero"),qk=Symbol("getParserConfiguration"),VPe=Symbol("getUsageConfiguration"),oie=Symbol("guessLocale"),$Pe=Symbol("guessVersion"),WPe=Symbol("parsePositionalNumbers"),cie=Symbol("pkgUp"),QC=Symbol("populateParserHintArray"),vR=Symbol("populateParserHintSingleValueDictionary"),uie=Symbol("populateParserHintArrayDictionary"),lie=Symbol("populateParserHintDictionary"),pie=Symbol("sanitizeKey"),fie=Symbol("setKey"),die=Symbol("unfreeze"),GPe=Symbol("validateAsync"),YPe=Symbol("getCommandInstance"),JPe=Symbol("getContext"),KPe=Symbol("getHasOutput"),XPe=Symbol("getLoggerInstance"),ZPe=Symbol("getParseContext"),eRe=Symbol("getUsageInstance"),tRe=Symbol("getValidationInstance"),Q7=Symbol("hasParseCallback"),rRe=Symbol("isGlobalContext"),Uk=Symbol("postProcess"),nRe=Symbol("rebase"),hie=Symbol("reset"),K3=Symbol("runYargsParserAndExecuteCommands"),mie=Symbol("runValidation"),iRe=Symbol("setHasOutput"),zk=Symbol("kTrackManuallySetKeys"),gie=class{constructor(t=[],r,n,a){this.customScriptName=!1,this.parsed=!1,ep.set(this,void 0),Nk.set(this,void 0),J3.set(this,{commands:[],fullCommands:[]}),ty.set(this,null),Og.set(this,null),T7.set(this,"show-hidden"),FC.set(this,null),Fk.set(this,!0),B7.set(this,{}),ry.set(this,!0),D7.set(this,[]),ny.set(this,void 0),Hb.set(this,{}),Qg.set(this,!1),iy.set(this,null),P7.set(this,!0),AR.set(this,void 0),_f.set(this,""),wi.set(this,void 0),R7.set(this,void 0),N7.set(this,{}),Lg.set(this,null),Ok.set(this,null),yR.set(this,{}),Qk.set(this,{}),OC.set(this,void 0),F7.set(this,!1),ls.set(this,void 0),Lk.set(this,!1),jk.set(this,!1),Mk.set(this,!1),bs.set(this,void 0),O7.set(this,{}),Vb.set(this,null),Tl.set(this,void 0),Zn(this,ls,a,"f"),Zn(this,OC,t,"f"),Zn(this,Nk,r,"f"),Zn(this,R7,n,"f"),Zn(this,ny,new _7(this),"f"),this.$0=this[HPe](),this[hie](),Zn(this,ep,qe(this,ep,"f"),"f"),Zn(this,bs,qe(this,bs,"f"),"f"),Zn(this,Tl,qe(this,Tl,"f"),"f"),Zn(this,wi,qe(this,wi,"f"),"f"),qe(this,wi,"f").showHiddenOpt=qe(this,T7,"f"),Zn(this,AR,this[qPe](),"f")}addHelpOpt(t,r){let n="help";return Kn("[string|boolean] [string]",[t,r],arguments.length),qe(this,iy,"f")&&(this[aie](qe(this,iy,"f")),Zn(this,iy,null,"f")),t===!1&&r===void 0?this:(Zn(this,iy,typeof t=="string"?t:n,"f"),this.boolean(qe(this,iy,"f")),this.describe(qe(this,iy,"f"),r||qe(this,bs,"f").deferY18nLookup("Show help")),this)}help(t,r){return this.addHelpOpt(t,r)}addShowHiddenOpt(t,r){if(Kn("[string|boolean] [string]",[t,r],arguments.length),t===!1&&r===void 0)return this;let n=typeof t=="string"?t:qe(this,T7,"f");return this.boolean(n),this.describe(n,r||qe(this,bs,"f").deferY18nLookup("Show hidden options")),qe(this,wi,"f").showHiddenOpt=n,this}showHidden(t,r){return this.addShowHiddenOpt(t,r)}alias(t,r){return Kn("<object|string|array> [string|array]",[t,r],arguments.length),this[uie](this.alias.bind(this),"alias",t,r),this}array(t){return Kn("<array|string>",[t],arguments.length),this[QC]("array",t),this[zk](t),this}boolean(t){return Kn("<array|string>",[t],arguments.length),this[QC]("boolean",t),this[zk](t),this}check(t,r){return Kn("<function> [boolean]",[t,r],arguments.length),this.middleware((n,a)=>Rk(()=>t(n,a.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&qe(this,bs,"f").fail(s.toString(),s):qe(this,bs,"f").fail(qe(this,ls,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(qe(this,bs,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(t,r){return Kn("<object|string|array> [string|array]",[t,r],arguments.length),this[uie](this.choices.bind(this),"choices",t,r),this}coerce(t,r){if(Kn("<object|string|array> [function]",[t,r],arguments.length),Array.isArray(t)){if(!r)throw new uu("coerce callback must be provided");for(let n of t)this.coerce(n,r);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!r)throw new uu("coerce callback must be provided");return qe(this,wi,"f").key[t]=!0,qe(this,ny,"f").addCoerceMiddleware((n,a)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?Rk(()=>(s=a.getAliases(),r(n[t])),l=>{n[t]=l;let f=a.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&f!==!0)for(let d of s[t])n[d]=l;return n},l=>{throw new uu(l.message)}):n},t),this}conflicts(t,r){return Kn("<string|object> [string|array]",[t,r],arguments.length),qe(this,Tl,"f").conflicts(t,r),this}config(t="config",r,n){return Kn("[object|string] [string|function] [function]",[t,r,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=W3(t,qe(this,Nk,"f"),this[qk]()["deep-merge-config"]||!1,qe(this,ls,"f")),qe(this,wi,"f").configObjects=(qe(this,wi,"f").configObjects||[]).concat(t),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(t,r||qe(this,bs,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(a=>{qe(this,wi,"f").config[a]=n||!0}),this)}completion(t,r,n){return Kn("[string] [string|boolean|function] [function]",[t,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Zn(this,Og,t||qe(this,Og,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(qe(this,Og,"f"),r),n&&qe(this,ty,"f").registerFunction(n),this}command(t,r,n,a,s,c){return Kn("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,r,n,a,s,c],arguments.length),qe(this,ep,"f").addHandler(t,r,n,a,s,c),this}commands(t,r,n,a,s,c){return this.command(t,r,n,a,s,c)}commandDir(t,r){Kn("<string> [object]",[t,r],arguments.length);let n=qe(this,R7,"f")||qe(this,ls,"f").require;return qe(this,ep,"f").addDirectory(t,n,qe(this,ls,"f").getCallerFile(),r),this}count(t){return Kn("<array|string>",[t],arguments.length),this[QC]("count",t),this[zk](t),this}default(t,r,n){return Kn("<object|string|array> [*] [string]",[t,r,n],arguments.length),n&&(tie(t,qe(this,ls,"f")),qe(this,wi,"f").defaultDescription[t]=n),typeof r=="function"&&(tie(t,qe(this,ls,"f")),qe(this,wi,"f").defaultDescription[t]||(qe(this,wi,"f").defaultDescription[t]=qe(this,bs,"f").functionDescription(r)),r=r.call()),this[vR](this.default.bind(this),"default",t,r),this}defaults(t,r,n){return this.default(t,r,n)}demandCommand(t=1,r,n,a){return Kn("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,r,n,a],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),qe(this,wi,"f").demandedCommands._={min:t,max:r,minMsg:n,maxMsg:a},this}demand(t,r,n){return Array.isArray(r)?(r.forEach(a=>{tm(n,!0,qe(this,ls,"f")),this.demandOption(a,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof t=="number"?(tm(n,!0,qe(this,ls,"f")),this.demandCommand(t,r,n,n)):Array.isArray(t)?t.forEach(a=>{tm(n,!0,qe(this,ls,"f")),this.demandOption(a,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,r){return Kn("<object|string|array> [string]",[t,r],arguments.length),this[vR](this.demandOption.bind(this),"demandedOptions",t,r),this}deprecateOption(t,r){return Kn("<string> [string|boolean]",[t,r],arguments.length),qe(this,wi,"f").deprecatedOptions[t]=r,this}describe(t,r){return Kn("<object|string|array> [string]",[t,r],arguments.length),this[fie](t,!0),qe(this,bs,"f").describe(t,r),this}detectLocale(t){return Kn("<boolean>",[t],arguments.length),Zn(this,Fk,t,"f"),this}env(t){return Kn("[string|boolean]",[t],arguments.length),t===!1?delete qe(this,wi,"f").envPrefix:qe(this,wi,"f").envPrefix=t||"",this}epilogue(t){return Kn("<string>",[t],arguments.length),qe(this,bs,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,r){return Kn("<string|array> [string]",[t,r],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):qe(this,bs,"f").example(t,r),this}exit(t,r){Zn(this,Qg,!0,"f"),Zn(this,FC,r,"f"),qe(this,ry,"f")&&qe(this,ls,"f").process.exit(t)}exitProcess(t=!0){return Kn("[boolean]",[t],arguments.length),Zn(this,ry,t,"f"),this}fail(t){if(Kn("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new uu("Invalid first argument. Expected function or boolean 'false'");return qe(this,bs,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,r){return Kn("<array> [function]",[t,r],arguments.length),r?qe(this,ty,"f").getCompletion(t,r):new Promise((n,a)=>{qe(this,ty,"f").getCompletion(t,(s,c)=>{s?a(s):n(c)})})}getDemandedOptions(){return Kn([],0),qe(this,wi,"f").demandedOptions}getDemandedCommands(){return Kn([],0),qe(this,wi,"f").demandedCommands}getDeprecatedOptions(){return Kn([],0),qe(this,wi,"f").deprecatedOptions}getDetectLocale(){return qe(this,Fk,"f")}getExitProcess(){return qe(this,ry,"f")}getGroups(){return Object.assign({},qe(this,Hb,"f"),qe(this,Qk,"f"))}getHelp(){if(Zn(this,Qg,!0,"f"),!qe(this,bs,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[K3](qe(this,OC,"f"),void 0,void 0,0,!0);if(lu(r))return r.then(()=>qe(this,bs,"f").help())}let t=qe(this,ep,"f").runDefaultBuilderOn(this);if(lu(t))return t.then(()=>qe(this,bs,"f").help())}return Promise.resolve(qe(this,bs,"f").help())}getOptions(){return qe(this,wi,"f")}getStrict(){return qe(this,Lk,"f")}getStrictCommands(){return qe(this,jk,"f")}getStrictOptions(){return qe(this,Mk,"f")}global(t,r){return Kn("<string|array> [boolean]",[t,r],arguments.length),t=[].concat(t),r!==!1?qe(this,wi,"f").local=qe(this,wi,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{qe(this,wi,"f").local.includes(n)||qe(this,wi,"f").local.push(n)}),this}group(t,r){Kn("<string|array> <string>",[t,r],arguments.length);let n=qe(this,Qk,"f")[r]||qe(this,Hb,"f")[r];qe(this,Qk,"f")[r]&&delete qe(this,Qk,"f")[r];let a={};return qe(this,Hb,"f")[r]=(n||[]).concat(t).filter(s=>a[s]?!1:a[s]=!0),this}hide(t){return Kn("<string>",[t],arguments.length),qe(this,wi,"f").hiddenOptions.push(t),this}implies(t,r){return Kn("<string|object> [number|string|array]",[t,r],arguments.length),qe(this,Tl,"f").implies(t,r),this}locale(t){return Kn("[string]",[t],arguments.length),t===void 0?(this[oie](),qe(this,ls,"f").y18n.getLocale()):(Zn(this,Fk,!1,"f"),qe(this,ls,"f").y18n.setLocale(t),this)}middleware(t,r,n){return qe(this,ny,"f").addMiddleware(t,!!r,n)}nargs(t,r){return Kn("<string|object|array> [number]",[t,r],arguments.length),this[vR](this.nargs.bind(this),"narg",t,r),this}normalize(t){return Kn("<array|string>",[t],arguments.length),this[QC]("normalize",t),this}number(t){return Kn("<array|string>",[t],arguments.length),this[QC]("number",t),this[zk](t),this}option(t,r){if(Kn("<string|object> [object]",[t,r],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof r!="object"&&(r={}),this[zk](t),qe(this,Vb,"f")&&(t==="version"||(r==null?void 0:r.alias)==="version")&&this[UPe](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
520
520
  `),void 0,"versionWarning"),qe(this,wi,"f").key[t]=!0,r.alias&&this.alias(t,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(t,n);let a=r.demand||r.required||r.require;a&&this.demand(t,a),r.demandOption&&this.demandOption(t,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(t,r.conflicts),"default"in r&&this.default(t,r.default),r.implies!==void 0&&this.implies(t,r.implies),r.nargs!==void 0&&this.nargs(t,r.nargs),r.config&&this.config(t,r.configParser),r.normalize&&this.normalize(t),r.choices&&this.choices(t,r.choices),r.coerce&&this.coerce(t,r.coerce),r.group&&this.group(t,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(t),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(t),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(t),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(t),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(t),typeof r.global=="boolean"&&this.global(t,r.global),r.defaultDescription&&(qe(this,wi,"f").defaultDescription[t]=r.defaultDescription),r.skipValidation&&this.skipValidation(t);let s=r.describe||r.description||r.desc,c=qe(this,bs,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,t)||typeof s=="string")&&this.describe(t,s),r.hidden&&this.hide(t),r.requiresArg&&this.requiresArg(t)}return this}options(t,r){return this.option(t,r)}parse(t,r,n){Kn("[string|array] [function|boolean|object] [function]",[t,r,n],arguments.length),this[zPe](),typeof t>"u"&&(t=qe(this,OC,"f")),typeof r=="object"&&(Zn(this,Ok,r,"f"),r=n),typeof r=="function"&&(Zn(this,Lg,r,"f"),r=!1),r||Zn(this,OC,t,"f"),qe(this,Lg,"f")&&Zn(this,ry,!1,"f");let a=this[K3](t,!!r),s=this.parsed;return qe(this,ty,"f").setParsed(this.parsed),lu(a)?a.then(c=>(qe(this,Lg,"f")&&qe(this,Lg,"f").call(this,qe(this,FC,"f"),c,qe(this,_f,"f")),c)).catch(c=>{throw qe(this,Lg,"f")&&qe(this,Lg,"f")(c,this.parsed.argv,qe(this,_f,"f")),c}).finally(()=>{this[die](),this.parsed=s}):(qe(this,Lg,"f")&&qe(this,Lg,"f").call(this,qe(this,FC,"f"),a,qe(this,_f,"f")),this[die](),this.parsed=s,a)}parseAsync(t,r,n){let a=this.parse(t,r,n);return lu(a)?a:Promise.resolve(a)}parseSync(t,r,n){let a=this.parse(t,r,n);if(lu(a))throw new uu(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return a}parserConfiguration(t){return Kn("<object>",[t],arguments.length),Zn(this,N7,t,"f"),this}pkgConf(t,r){Kn("<string> [string]",[t,r],arguments.length);let n=null,a=this[cie](r||qe(this,Nk,"f"));return a[t]&&typeof a[t]=="object"&&(n=W3(a[t],r||qe(this,Nk,"f"),this[qk]()["deep-merge-config"]||!1,qe(this,ls,"f")),qe(this,wi,"f").configObjects=(qe(this,wi,"f").configObjects||[]).concat(n)),this}positional(t,r){Kn("<string> <object>",[t,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=RC(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let a=qe(this,J3,"f").fullCommands[qe(this,J3,"f").fullCommands.length-1],s=a?qe(this,ep,"f").cmdToParseOptions(a):{array:[],alias:{},default:{},demand:{}};return mR(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(t)!==-1&&(r[c]=!0):l[t]&&!(c in r)&&(r[c]=l[t])}),this.group(t,qe(this,bs,"f").getPositionalGroupName()),this.option(t,r)}recommendCommands(t=!0){return Kn("[boolean]",[t],arguments.length),Zn(this,F7,t,"f"),this}required(t,r,n){return this.demand(t,r,n)}require(t,r,n){return this.demand(t,r,n)}requiresArg(t){return Kn("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&qe(this,wi,"f").narg[t]?this:(this[vR](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,r){return Kn("[string] [string]",[t,r],arguments.length),t=t||this.$0,qe(this,AR,"f").log(qe(this,ty,"f").generateCompletionScript(t,r||qe(this,Og,"f")||"completion")),this}showHelp(t){if(Kn("[string|function]",[t],arguments.length),Zn(this,Qg,!0,"f"),!qe(this,bs,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[K3](qe(this,OC,"f"),void 0,void 0,0,!0);if(lu(n))return n.then(()=>{qe(this,bs,"f").showHelp(t)}),this}let r=qe(this,ep,"f").runDefaultBuilderOn(this);if(lu(r))return r.then(()=>{qe(this,bs,"f").showHelp(t)}),this}return qe(this,bs,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,r){return Kn("[boolean|string] [string]",[t,r],arguments.length),qe(this,bs,"f").showHelpOnFail(t,r),this}showVersion(t){return Kn("[string|function]",[t],arguments.length),qe(this,bs,"f").showVersion(t),this}skipValidation(t){return Kn("<array|string>",[t],arguments.length),this[QC]("skipValidation",t),this}strict(t){return Kn("[boolean]",[t],arguments.length),Zn(this,Lk,t!==!1,"f"),this}strictCommands(t){return Kn("[boolean]",[t],arguments.length),Zn(this,jk,t!==!1,"f"),this}strictOptions(t){return Kn("[boolean]",[t],arguments.length),Zn(this,Mk,t!==!1,"f"),this}string(t){return Kn("<array|string>",[t],arguments.length),this[QC]("string",t),this[zk](t),this}terminalWidth(){return Kn([],0),qe(this,ls,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return Kn("<object>",[t],arguments.length),Zn(this,Fk,!1,"f"),qe(this,ls,"f").y18n.updateLocale(t),this}usage(t,r,n,a){if(Kn("<string|null|undefined> [string|boolean] [function|object] [function]",[t,r,n,a],arguments.length),r!==void 0){if(tm(t,null,qe(this,ls,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,r,n,a);throw new uu(".usage() description must start with $0 if being used as alias for .command()")}else return qe(this,bs,"f").usage(t),this}usageConfiguration(t){return Kn("<object>",[t],arguments.length),Zn(this,O7,t,"f"),this}version(t,r,n){let a="version";if(Kn("[boolean|string] [string] [string]",[t,r,n],arguments.length),qe(this,Vb,"f")&&(this[aie](qe(this,Vb,"f")),qe(this,bs,"f").version(void 0),Zn(this,Vb,null,"f")),arguments.length===0)n=this[$Pe](),t=a;else if(arguments.length===1){if(t===!1)return this;n=t,t=a}else arguments.length===2&&(n=r,r=void 0);return Zn(this,Vb,typeof t=="string"?t:a,"f"),r=r||qe(this,bs,"f").deferY18nLookup("Show version number"),qe(this,bs,"f").version(n||void 0),this.boolean(qe(this,Vb,"f")),this.describe(qe(this,Vb,"f"),r),this}wrap(t){return Kn("<number|null|undefined>",[t],arguments.length),qe(this,bs,"f").wrap(t),this}[(ep=new WeakMap,Nk=new WeakMap,J3=new WeakMap,ty=new WeakMap,Og=new WeakMap,T7=new WeakMap,FC=new WeakMap,Fk=new WeakMap,B7=new WeakMap,ry=new WeakMap,D7=new WeakMap,ny=new WeakMap,Hb=new WeakMap,Qg=new WeakMap,iy=new WeakMap,P7=new WeakMap,AR=new WeakMap,_f=new WeakMap,wi=new WeakMap,R7=new WeakMap,N7=new WeakMap,Lg=new WeakMap,Ok=new WeakMap,yR=new WeakMap,Qk=new WeakMap,OC=new WeakMap,F7=new WeakMap,ls=new WeakMap,Lk=new WeakMap,jk=new WeakMap,Mk=new WeakMap,bs=new WeakMap,O7=new WeakMap,Vb=new WeakMap,Tl=new WeakMap,MPe)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[qPe](){return{log:(...t)=>{this[Q7]()||console.log(...t),Zn(this,Qg,!0,"f"),qe(this,_f,"f").length&&Zn(this,_f,qe(this,_f,"f")+`
521
521
  `,"f"),Zn(this,_f,qe(this,_f,"f")+t.join(" "),"f")},error:(...t)=>{this[Q7]()||console.error(...t),Zn(this,Qg,!0,"f"),qe(this,_f,"f").length&&Zn(this,_f,qe(this,_f,"f")+`
522
- `,"f"),Zn(this,_f,qe(this,_f,"f")+t.join(" "),"f")}}}[aie](t){mR(qe(this,wi,"f")).forEach(r=>{if((a=>a==="configObjects")(r))return;let n=qe(this,wi,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete qe(this,bs,"f").getDescriptions()[t]}[UPe](t,r,n){qe(this,B7,"f")[n]||(qe(this,ls,"f").process.emitWarning(t,r),qe(this,B7,"f")[n]=!0)}[zPe](){qe(this,D7,"f").push({options:qe(this,wi,"f"),configObjects:qe(this,wi,"f").configObjects.slice(0),exitProcess:qe(this,ry,"f"),groups:qe(this,Hb,"f"),strict:qe(this,Lk,"f"),strictCommands:qe(this,jk,"f"),strictOptions:qe(this,Mk,"f"),completionCommand:qe(this,Og,"f"),output:qe(this,_f,"f"),exitError:qe(this,FC,"f"),hasOutput:qe(this,Qg,"f"),parsed:this.parsed,parseFn:qe(this,Lg,"f"),parseContext:qe(this,Ok,"f")}),qe(this,bs,"f").freeze(),qe(this,Tl,"f").freeze(),qe(this,ep,"f").freeze(),qe(this,ny,"f").freeze()}[HPe](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(qe(this,ls,"f").process.argv()[0])?r=qe(this,ls,"f").process.argv().slice(1,2):r=qe(this,ls,"f").process.argv().slice(0,1),t=r.map(n=>{let a=this[nRe](qe(this,Nk,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&a.length<n.length?a:n}).join(" ").trim(),qe(this,ls,"f").getEnv("_")&&qe(this,ls,"f").getProcessArgvBin()===qe(this,ls,"f").getEnv("_")&&(t=qe(this,ls,"f").getEnv("_").replace(`${qe(this,ls,"f").path.dirname(qe(this,ls,"f").process.execPath())}/`,"")),t}[qk](){return qe(this,N7,"f")}[VPe](){return qe(this,O7,"f")}[oie](){if(!qe(this,Fk,"f"))return;let t=qe(this,ls,"f").getEnv("LC_ALL")||qe(this,ls,"f").getEnv("LC_MESSAGES")||qe(this,ls,"f").getEnv("LANG")||qe(this,ls,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[$Pe](){return this[cie]().version||"unknown"}[WPe](t){let r=t["--"]?t["--"]:t._;for(let n=0,a;(a=r[n])!==void 0;n++)qe(this,ls,"f").Parser.looksLikeNumber(a)&&Number.isSafeInteger(Math.floor(parseFloat(`${a}`)))&&(r[n]=Number(a));return t}[cie](t){let r=t||"*";if(qe(this,yR,"f")[r])return qe(this,yR,"f")[r];let n={};try{let a=t||qe(this,ls,"f").mainFilename;!t&&qe(this,ls,"f").path.extname(a)&&(a=qe(this,ls,"f").path.dirname(a));let s=qe(this,ls,"f").findUp(a,(c,l)=>{if(l.includes("package.json"))return"package.json"});tm(s,void 0,qe(this,ls,"f")),n=JSON.parse(qe(this,ls,"f").readFileSync(s,"utf8"))}catch{}return qe(this,yR,"f")[r]=n||{},qe(this,yR,"f")[r]}[QC](t,r){r=[].concat(r),r.forEach(n=>{n=this[pie](n),qe(this,wi,"f")[t].push(n)})}[vR](t,r,n,a){this[lie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=l})}[uie](t,r,n,a){this[lie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=(qe(this,wi,"f")[s][c]||[]).concat(l)})}[lie](t,r,n,a,s){if(Array.isArray(n))n.forEach(c=>{t(c,a)});else if((c=>typeof c=="object")(n))for(let c of mR(n))t(c,n[c]);else s(r,this[pie](n),a)}[pie](t){return t==="__proto__"?"___proto___":t}[fie](t,r){return this[vR](this[fie].bind(this),"key",t,r),this}[die](){var t,r,n,a,s,c,l,f,d,m,g,x;let b=qe(this,D7,"f").pop();tm(b,void 0,qe(this,ls,"f"));let A;t=this,r=this,n=this,a=this,s=this,c=this,l=this,f=this,d=this,m=this,g=this,x=this,{options:{set value(C){Zn(t,wi,C,"f")}}.value,configObjects:A,exitProcess:{set value(C){Zn(r,ry,C,"f")}}.value,groups:{set value(C){Zn(n,Hb,C,"f")}}.value,output:{set value(C){Zn(a,_f,C,"f")}}.value,exitError:{set value(C){Zn(s,FC,C,"f")}}.value,hasOutput:{set value(C){Zn(c,Qg,C,"f")}}.value,parsed:this.parsed,strict:{set value(C){Zn(l,Lk,C,"f")}}.value,strictCommands:{set value(C){Zn(f,jk,C,"f")}}.value,strictOptions:{set value(C){Zn(d,Mk,C,"f")}}.value,completionCommand:{set value(C){Zn(m,Og,C,"f")}}.value,parseFn:{set value(C){Zn(g,Lg,C,"f")}}.value,parseContext:{set value(C){Zn(x,Ok,C,"f")}}.value}=b,qe(this,wi,"f").configObjects=A,qe(this,bs,"f").unfreeze(),qe(this,Tl,"f").unfreeze(),qe(this,ep,"f").unfreeze(),qe(this,ny,"f").unfreeze()}[GPe](t,r){return Rk(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[YPe].bind(this),getContext:this[JPe].bind(this),getHasOutput:this[KPe].bind(this),getLoggerInstance:this[XPe].bind(this),getParseContext:this[ZPe].bind(this),getParserConfiguration:this[qk].bind(this),getUsageConfiguration:this[VPe].bind(this),getUsageInstance:this[eRe].bind(this),getValidationInstance:this[tRe].bind(this),hasParseCallback:this[Q7].bind(this),isGlobalContext:this[rRe].bind(this),postProcess:this[Uk].bind(this),reset:this[hie].bind(this),runValidation:this[mie].bind(this),runYargsParserAndExecuteCommands:this[K3].bind(this),setHasOutput:this[iRe].bind(this)}}[YPe](){return qe(this,ep,"f")}[JPe](){return qe(this,J3,"f")}[KPe](){return qe(this,Qg,"f")}[XPe](){return qe(this,AR,"f")}[ZPe](){return qe(this,Ok,"f")||{}}[eRe](){return qe(this,bs,"f")}[tRe](){return qe(this,Tl,"f")}[Q7](){return!!qe(this,Lg,"f")}[rRe](){return qe(this,P7,"f")}[Uk](t,r,n,a){return n||lu(t)||(r||(t=this[MPe](t)),(this[qk]()["parse-positional-numbers"]||this[qk]()["parse-positional-numbers"]===void 0)&&(t=this[WPe](t)),a&&(t=Pk(t,this,qe(this,ny,"f").getMiddleware(),!1))),t}[hie](t={}){Zn(this,wi,qe(this,wi,"f")||{},"f");let r={};r.local=qe(this,wi,"f").local||[],r.configObjects=qe(this,wi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(qe(this,Qk,"f"),Object.keys(qe(this,Hb,"f")).reduce((c,l)=>{let f=qe(this,Hb,"f")[l].filter(d=>!(d in n));return f.length>0&&(c[l]=f),c},{})),Zn(this,Hb,{},"f");let a=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return a.forEach(c=>{r[c]=(qe(this,wi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=RC(qe(this,wi,"f")[c],l=>!n[l])}),r.envPrefix=qe(this,wi,"f").envPrefix,Zn(this,wi,r,"f"),Zn(this,bs,qe(this,bs,"f")?qe(this,bs,"f").reset(n):RPe(this,qe(this,ls,"f")),"f"),Zn(this,Tl,qe(this,Tl,"f")?qe(this,Tl,"f").reset(n):jPe(this,qe(this,bs,"f"),qe(this,ls,"f")),"f"),Zn(this,ep,qe(this,ep,"f")?qe(this,ep,"f").reset():BPe(qe(this,bs,"f"),qe(this,Tl,"f"),qe(this,ny,"f"),qe(this,ls,"f")),"f"),qe(this,ty,"f")||Zn(this,ty,OPe(this,qe(this,bs,"f"),qe(this,ep,"f"),qe(this,ls,"f")),"f"),qe(this,ny,"f").reset(),Zn(this,Og,null,"f"),Zn(this,_f,"","f"),Zn(this,FC,null,"f"),Zn(this,Qg,!1,"f"),this.parsed=!1,this}[nRe](t,r){return qe(this,ls,"f").path.relative(t,r)}[K3](t,r,n,a=0,s=!1){let c=!!n||s;t=t||qe(this,OC,"f"),qe(this,wi,"f").__=qe(this,ls,"f").y18n.__,qe(this,wi,"f").configuration=this[qk]();let l=!!qe(this,wi,"f").configuration["populate--"],f=Object.assign({},qe(this,wi,"f").configuration,{"populate--":!0}),d=qe(this,ls,"f").Parser.detailed(t,Object.assign({},qe(this,wi,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),m=Object.assign(d.argv,qe(this,Ok,"f")),g,x=d.aliases,b=!1,A=!1;Object.keys(m).forEach(C=>{C===qe(this,iy,"f")&&m[C]?b=!0:C===qe(this,Vb,"f")&&m[C]&&(A=!0)}),m.$0=this.$0,this.parsed=d,a===0&&qe(this,bs,"f").clearCachedHelpMessage();try{if(this[oie](),r)return this[Uk](m,l,!!n,!1);qe(this,iy,"f")&&[qe(this,iy,"f")].concat(x[qe(this,iy,"f")]||[]).filter(j=>j.length>1).includes(""+m._[m._.length-1])&&(m._.pop(),b=!0),Zn(this,P7,!1,"f");let C=qe(this,ep,"f").getCommands(),I=qe(this,ty,"f").completionKey in m,k=b||I||s;if(m._.length){if(C.length){let O;for(let j=a||0,M;m._[j]!==void 0;j++)if(M=String(m._[j]),C.includes(M)&&M!==qe(this,Og,"f")){let W=qe(this,ep,"f").runCommand(M,this,d,j+1,s,b||A||s);return this[Uk](W,l,!!n,!1)}else if(!O&&M!==qe(this,Og,"f")){O=M;break}!qe(this,ep,"f").hasDefaultCommand()&&qe(this,F7,"f")&&O&&!k&&qe(this,Tl,"f").recommendCommands(O,C)}qe(this,Og,"f")&&m._.includes(qe(this,Og,"f"))&&!I&&(qe(this,ry,"f")&&NC(!0),this.showCompletionScript(),this.exit(0))}if(qe(this,ep,"f").hasDefaultCommand()&&!k){let O=qe(this,ep,"f").runCommand(null,this,d,0,s,b||A||s);return this[Uk](O,l,!!n,!1)}if(I){qe(this,ry,"f")&&NC(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${qe(this,ty,"f").completionKey}`)+1);return qe(this,ty,"f").getCompletion(O,(j,M)=>{if(j)throw new uu(j.message);(M||[]).forEach(W=>{qe(this,AR,"f").log(W)}),this.exit(0)}),this[Uk](m,!l,!!n,!1)}if(qe(this,Qg,"f")||(b?(qe(this,ry,"f")&&NC(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(qe(this,ry,"f")&&NC(!0),c=!0,qe(this,bs,"f").showVersion("log"),this.exit(0))),!c&&qe(this,wi,"f").skipValidation.length>0&&(c=Object.keys(m).some(O=>qe(this,wi,"f").skipValidation.indexOf(O)>=0&&m[O]===!0)),!c){if(d.error)throw new uu(d.error.message);if(!I){let O=this[mie](x,{},d.error);n||(g=Pk(m,this,qe(this,ny,"f").getMiddleware(),!0)),g=this[GPe](O,g!=null?g:m),lu(g)&&!n&&(g=g.then(()=>Pk(m,this,qe(this,ny,"f").getMiddleware(),!1)))}}}catch(C){if(C instanceof uu)qe(this,bs,"f").fail(C.message,C);else throw C}return this[Uk](g!=null?g:m,l,!!n,!0)}[mie](t,r,n,a){let s={...this.getDemandedOptions()};return c=>{if(n)throw new uu(n.message);qe(this,Tl,"f").nonOptionCount(c),qe(this,Tl,"f").requiredArguments(c,s);let l=!1;qe(this,jk,"f")&&(l=qe(this,Tl,"f").unknownCommands(c)),qe(this,Lk,"f")&&!l?qe(this,Tl,"f").unknownArguments(c,t,r,!!a):qe(this,Mk,"f")&&qe(this,Tl,"f").unknownArguments(c,t,{},!1,!1),qe(this,Tl,"f").limitedChoices(c),qe(this,Tl,"f").implications(c),qe(this,Tl,"f").conflicting(c)}}[iRe](){Zn(this,Qg,!0,"f")}[zk](t){if(typeof t=="string")qe(this,wi,"f").key[t]=!0;else for(let r of t)qe(this,wi,"f").key[r]=!0}};function DPe(e){return!!e&&typeof e.getInternalMethods=="function"}var A7t=sRe(eie),aRe=A7t;var Hk={name:"edgeone",version:"1.2.23-beta.2",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/templates","./edgeone-dist/pages/dev/runner-worker.js"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build",prepublishOnly:"npm run build","test:compression":"node test-compression.js"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/nuxt-pages":"^1.0.14","@edgeone/opennextjs-pages":"0.0.7",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2",zod:"^3.23.8","zod-to-json-schema":"^3.23.5"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}};var Aie=class{log(t,r){try{let n=this.format(r),a=JSON.stringify({key:t,value:n});process.send(a)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},v7t=new Aie,L7=v7t;var kqe=wr(Cc()),Tqe=wr(OR()),Bqe=wr(xae());var aQe=wr(Sae()),Kw=wr(require("fs"));var Cae=wr(require("path"));function C0(e,t){return Cae.default.join(e,t)}function di(e){return C0(process.cwd(),e)}function G4e(e){return Cae.default.dirname(e)}var Bz=sQe(),Dae=require("path");function Pae(){try{Bz.initSync({dir:WWt()})}catch(e){console.error("[File] initStorage error",e)}}async function jR(e,t,r){Pae(),await Bz.setItem(e,t).catch(n=>{console.error("[File] setLocalData error",n)}),r==null||r()}async function MR(e){return Pae(),await Bz.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}async function Dz(e){Pae(),await Bz.removeItem(e).catch(t=>{console.error("[File] removeLocalData error",t)})}function WWt(){try{let e=Dae.parse(process.cwd()).root,t=process.cwd(),n=Dae.relative(e,t).split(Dae.sep).length-2;return`${new Array(Math.max(0,n)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function oQe(e){return Kw.default.statSync(e)}function GWt(e){return Kw.default.mkdirSync(e,{recursive:!0})}function YWt(e){return Kw.default.existsSync(e)}function KL(e){return Kw.default.existsSync(e)}function Pz(e,t="utf-8"){return Kw.default.readFileSync(e,t)}function _0(e){let t=Pz(e);return JSON.parse(t)}function qR(e){let t=Pz(e);return aQe.default.parse(t)}function uy(e,t,r="utf-8"){let n=G4e(e);return YWt(n)||GWt(n),Kw.default.writeFileSync(e,t,r)}function Rae(e,t){return KL(e)?Kw.default.appendFileSync(e,t):Kw.default.writeFileSync(e,t)}var Ks=wr(OR()),Rs=wr(Cc()),lQe=wr(cQe());function rT({prefix:e="cli"}){return Rs.default.createElement(Ks.Text,{color:"grey"},"[",e,"]")}function Kr(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"red"},"[\u2718] "),e));r()}function ma(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"green"},"[\u2714] "),e));r()}function Xw(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Oc(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(rT,{prefix:t}),e));r()}function Rz(e){let{unmount:t}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},e));t()}function ei(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"white"},Rs.default.createElement(rT,{prefix:t}),e));r()}function pQe(e,t,r="cli"){let n=t;t.includes("http")&&(n=new URL(t).pathname);let{unmount:a}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"grey"},e," ",n));a()}function Fae({timestamp:e}){return Rs.default.createElement(Ks.Box,{width:13},Rs.default.createElement(Ks.Text,{color:"grey"},(0,lQe.default)(e).format("HH:mm:ss.SSS")))}function fQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(Fae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white"},e)));r()}function dQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(Fae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Rs.default.createElement(Ks.Text,null," ",e)));r()}function Oae(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(Fae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Rs.default.createElement(Ks.Text,{color:"white"}," ",e)));r()}function JWt({content:e="Loading",prefix:t="cli",intervalMs:r=500,maxDots:n=6}){let[a,s]=(0,Rs.useState)("");return(0,Rs.useEffect)(()=>{let c=setInterval(()=>{s(l=>l.length>=n?"":l+".")},r);return()=>clearInterval(c)},[r,n]),Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(rT,{prefix:t}),e,a)}function hQe(e="Loading",t="cli",r=500,n=6){let a=(0,Ks.render)(Rs.default.createElement(JWt,{content:e,prefix:t,intervalMs:r,maxDots:n}));return{stop:()=>a.unmount()}}function uQe({percent:e,width:t=30,prefix:r="cli",label:n="Progress",color:a="cyan"}){let s=Math.max(0,Math.min(100,Math.round(e))),c=Math.round(s/100*t),l=t-c,f="\u2593".repeat(c),d="\u2591".repeat(Math.max(0,l)),m=String(s).padStart(3," ");return Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:r}),Rs.default.createElement(Ks.Text,{color:a},n,": "),"[",Rs.default.createElement(Ks.Text,{color:a},f),d,"] ",m,"%")}function mQe(e="Progress",t="cli",r=30,n="cyan"){let a=0,s=(0,Ks.render)(Rs.default.createElement(uQe,{percent:a,width:r,prefix:t,label:e,color:n}));return{update:(c,l)=>{a=c;let f=l!=null?l:e;s.rerender(Rs.default.createElement(uQe,{percent:a,width:r,prefix:t,label:f,color:n}))},stop:()=>s.unmount()}}var Qzn=require("fs"),Lzn=require("path");async function Gv(){return process.env.EDGEONE_PAGES_API_REGION?process.env.EDGEONE_PAGES_API_REGION:await MR("login_region")}function XL(e,t){return function(){return e.apply(t,arguments)}}var{toString:KWt}=Object.prototype,{getPrototypeOf:Lae}=Object,{iterator:Fz,toStringTag:AQe}=Symbol,Oz=(e=>t=>{let r=KWt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Yv=e=>(e=e.toLowerCase(),t=>Oz(t)===e),Qz=e=>t=>typeof t===e,{isArray:zR}=Array,ZL=Qz("undefined");function ej(e){return e!==null&&!ZL(e)&&e.constructor!==null&&!ZL(e.constructor)&&I0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var yQe=Yv("ArrayBuffer");function XWt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yQe(e.buffer),t}var ZWt=Qz("string"),I0=Qz("function"),vQe=Qz("number"),tj=e=>e!==null&&typeof e=="object",eGt=e=>e===!0||e===!1,Nz=e=>{if(Oz(e)!=="object")return!1;let t=Lae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(AQe in e)&&!(Fz in e)},tGt=e=>{if(!tj(e)||ej(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},rGt=Yv("Date"),nGt=Yv("File"),iGt=Yv("Blob"),sGt=Yv("FileList"),aGt=e=>tj(e)&&I0(e.pipe),oGt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||I0(e.append)&&((t=Oz(e))==="formdata"||t==="object"&&I0(e.toString)&&e.toString()==="[object FormData]"))},cGt=Yv("URLSearchParams"),[uGt,lGt,pGt,fGt]=["ReadableStream","Request","Response","Headers"].map(Yv),dGt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rj(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),zR(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(ej(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),c=s.length,l;for(n=0;n<c;n++)l=s[n],t.call(null,e[l],l,e)}}function xQe(e,t){if(ej(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}var nT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bQe=e=>!ZL(e)&&e!==nT;function Qae(){let{caseless:e}=bQe(this)&&this||{},t={},r=(n,a)=>{let s=e&&xQe(t,a)||a;Nz(t[s])&&Nz(n)?t[s]=Qae(t[s],n):Nz(n)?t[s]=Qae({},n):zR(n)?t[s]=n.slice():t[s]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&rj(arguments[n],r);return t}var hGt=(e,t,r,{allOwnKeys:n}={})=>(rj(t,(a,s)=>{r&&I0(a)?e[s]=XL(a,r):e[s]=a},{allOwnKeys:n}),e),mGt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gGt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},AGt=(e,t,r,n)=>{let a,s,c,l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)c=a[s],(!n||n(c,e,t))&&!l[c]&&(t[c]=e[c],l[c]=!0);e=r!==!1&&Lae(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},yGt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},vGt=e=>{if(!e)return null;if(zR(e))return e;let t=e.length;if(!vQe(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},xGt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lae(Uint8Array)),bGt=(e,t)=>{let n=(e&&e[Fz]).call(e),a;for(;(a=n.next())&&!a.done;){let s=a.value;t.call(e,s[0],s[1])}},EGt=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},wGt=Yv("HTMLFormElement"),SGt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),gQe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),CGt=Yv("RegExp"),EQe=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};rj(r,(a,s)=>{let c;(c=t(a,s,e))!==!1&&(n[s]=c||a)}),Object.defineProperties(e,n)},_Gt=e=>{EQe(e,(t,r)=>{if(I0(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(I0(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},IGt=(e,t)=>{let r={},n=a=>{a.forEach(s=>{r[s]=!0})};return zR(e)?n(e):n(String(e).split(t)),r},kGt=()=>{},TGt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function BGt(e){return!!(e&&I0(e.append)&&e[AQe]==="FormData"&&e[Fz])}var DGt=e=>{let t=new Array(10),r=(n,a)=>{if(tj(n)){if(t.indexOf(n)>=0)return;if(ej(n))return n;if(!("toJSON"in n)){t[a]=n;let s=zR(n)?[]:{};return rj(n,(c,l)=>{let f=r(c,a+1);!ZL(f)&&(s[l]=f)}),t[a]=void 0,s}}return n};return r(e,0)},PGt=Yv("AsyncFunction"),RGt=e=>e&&(tj(e)||I0(e))&&I0(e.then)&&I0(e.catch),wQe=((e,t)=>e?setImmediate:t?((r,n)=>(nT.addEventListener("message",({source:a,data:s})=>{a===nT&&s===r&&n.length&&n.shift()()},!1),a=>{n.push(a),nT.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",I0(nT.postMessage)),NGt=typeof queueMicrotask<"u"?queueMicrotask.bind(nT):typeof process<"u"&&process.nextTick||wQe,FGt=e=>e!=null&&I0(e[Fz]),bt={isArray:zR,isArrayBuffer:yQe,isBuffer:ej,isFormData:oGt,isArrayBufferView:XWt,isString:ZWt,isNumber:vQe,isBoolean:eGt,isObject:tj,isPlainObject:Nz,isEmptyObject:tGt,isReadableStream:uGt,isRequest:lGt,isResponse:pGt,isHeaders:fGt,isUndefined:ZL,isDate:rGt,isFile:nGt,isBlob:iGt,isRegExp:CGt,isFunction:I0,isStream:aGt,isURLSearchParams:cGt,isTypedArray:xGt,isFileList:sGt,forEach:rj,merge:Qae,extend:hGt,trim:dGt,stripBOM:mGt,inherits:gGt,toFlatObject:AGt,kindOf:Oz,kindOfTest:Yv,endsWith:yGt,toArray:vGt,forEachEntry:bGt,matchAll:EGt,isHTMLForm:wGt,hasOwnProperty:gQe,hasOwnProp:gQe,reduceDescriptors:EQe,freezeMethods:_Gt,toObjectSet:IGt,toCamelCase:SGt,noop:kGt,toFiniteNumber:TGt,findKey:xQe,global:nT,isContextDefined:bQe,isSpecCompliantForm:BGt,toJSONObject:DGt,isAsyncFn:PGt,isThenable:RGt,setImmediate:wQe,asap:NGt,isIterable:FGt};function HR(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}bt.inherits(HR,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:bt.toJSONObject(this.config),code:this.code,status:this.status}}});var SQe=HR.prototype,CQe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{CQe[e]={value:e}});Object.defineProperties(HR,CQe);Object.defineProperty(SQe,"isAxiosError",{value:!0});HR.from=(e,t,r,n,a,s)=>{let c=Object.create(SQe);return bt.toFlatObject(e,c,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),HR.call(c,e.message,t,r,n,a),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};var Cn=HR;var ILe=wr(_Le(),1),Yz=ILe.default;function soe(e){return bt.isPlainObject(e)||bt.isArray(e)}function TLe(e){return bt.endsWith(e,"[]")?e.slice(0,-2):e}function kLe(e,t,r){return e?e.concat(t).map(function(a,s){return a=TLe(a),!r&&s?"["+a+"]":a}).join(r?".":""):t}function xJt(e){return bt.isArray(e)&&!e.some(soe)}var bJt=bt.toFlatObject(bt,{},null,function(t){return/^is[A-Z]/.test(t)});function EJt(e,t,r){if(!bt.isObject(e))throw new TypeError("target must be an object");t=t||new(Yz||FormData),r=bt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,I){return!bt.isUndefined(I[C])});let n=r.metaTokens,a=r.visitor||m,s=r.dots,c=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&bt.isSpecCompliantForm(t);if(!bt.isFunction(a))throw new TypeError("visitor must be a function");function d(A){if(A===null)return"";if(bt.isDate(A))return A.toISOString();if(bt.isBoolean(A))return A.toString();if(!f&&bt.isBlob(A))throw new Cn("Blob is not supported. Use a Buffer instead.");return bt.isArrayBuffer(A)||bt.isTypedArray(A)?f&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function m(A,C,I){let k=A;if(A&&!I&&typeof A=="object"){if(bt.endsWith(C,"{}"))C=n?C:C.slice(0,-2),A=JSON.stringify(A);else if(bt.isArray(A)&&xJt(A)||(bt.isFileList(A)||bt.endsWith(C,"[]"))&&(k=bt.toArray(A)))return C=TLe(C),k.forEach(function(j,M){!(bt.isUndefined(j)||j===null)&&t.append(c===!0?kLe([C],M,s):c===null?C:C+"[]",d(j))}),!1}return soe(A)?!0:(t.append(kLe(I,C,s),d(A)),!1)}let g=[],x=Object.assign(bJt,{defaultVisitor:m,convertValue:d,isVisitable:soe});function b(A,C){if(!bt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+C.join("."));g.push(A),bt.forEach(A,function(k,O){(!(bt.isUndefined(k)||k===null)&&a.call(t,k,bt.isString(O)?O.trim():O,C,x))===!0&&b(k,C?C.concat(O):[O])}),g.pop()}}if(!bt.isObject(e))throw new TypeError("data must be an object");return b(e),t}var HC=EJt;function BLe(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function DLe(e,t){this._pairs=[],e&&HC(e,this,t)}var PLe=DLe.prototype;PLe.append=function(t,r){this._pairs.push([t,r])};PLe.toString=function(t){let r=t?function(n){return t.call(this,n,BLe)}:BLe;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};var RLe=DLe;function wJt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sT(e,t,r){if(!t)return e;let n=r&&r.encode||wJt;bt.isFunction(r)&&(r={serialize:r});let a=r&&r.serialize,s;if(a?s=a(t,r):s=bt.isURLSearchParams(t)?t.toString():new RLe(t,r).toString(n),s){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var aoe=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){bt.forEach(this.handlers,function(n){n!==null&&t(n)})}},ooe=aoe;var YR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var QLe=wr(require("crypto"),1);var NLe=wr(require("url"),1),FLe=NLe.default.URLSearchParams;var coe="abcdefghijklmnopqrstuvwxyz",OLe="0123456789",LLe={DIGIT:OLe,ALPHA:coe,ALPHA_DIGIT:coe+coe.toUpperCase()+OLe},SJt=(e=16,t=LLe.ALPHA_DIGIT)=>{let r="",{length:n}=t,a=new Uint32Array(e);QLe.default.randomFillSync(a);for(let s=0;s<e;s++)r+=t[a[s]%n];return r},jLe={isNode:!0,classes:{URLSearchParams:FLe,FormData:Yz,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:LLe,generateString:SJt,protocols:["http","https","file","data"]};var poe={};tPe(poe,{hasBrowserEnv:()=>loe,hasStandardBrowserEnv:()=>CJt,hasStandardBrowserWebWorkerEnv:()=>_Jt,navigator:()=>uoe,origin:()=>IJt});var loe=typeof window<"u"&&typeof document<"u",uoe=typeof navigator=="object"&&navigator||void 0,CJt=loe&&(!uoe||["ReactNative","NativeScript","NS"].indexOf(uoe.product)<0),_Jt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",IJt=loe&&window.location.href||"http://localhost";var Po={...poe,...jLe};function foe(e,t){return HC(e,new Po.classes.URLSearchParams,{visitor:function(r,n,a,s){return Po.isNode&&bt.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function kJt(e){return bt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function TJt(e){let t={},r=Object.keys(e),n,a=r.length,s;for(n=0;n<a;n++)s=r[n],t[s]=e[s];return t}function BJt(e){function t(r,n,a,s){let c=r[s++];if(c==="__proto__")return!0;let l=Number.isFinite(+c),f=s>=r.length;return c=!c&&bt.isArray(a)?a.length:c,f?(bt.hasOwnProp(a,c)?a[c]=[a[c],n]:a[c]=n,!l):((!a[c]||!bt.isObject(a[c]))&&(a[c]=[]),t(r,n,a[c],s)&&bt.isArray(a[c])&&(a[c]=TJt(a[c])),!l)}if(bt.isFormData(e)&&bt.isFunction(e.entries)){let r={};return bt.forEachEntry(e,(n,a)=>{t(kJt(n),a,r,0)}),r}return null}var Jz=BJt;function DJt(e,t,r){if(bt.isString(e))try{return(t||JSON.parse)(e),bt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var doe={transitional:YR,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",a=n.indexOf("application/json")>-1,s=bt.isObject(t);if(s&&bt.isHTMLForm(t)&&(t=new FormData(t)),bt.isFormData(t))return a?JSON.stringify(Jz(t)):t;if(bt.isArrayBuffer(t)||bt.isBuffer(t)||bt.isStream(t)||bt.isFile(t)||bt.isBlob(t)||bt.isReadableStream(t))return t;if(bt.isArrayBufferView(t))return t.buffer;if(bt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return foe(t,this.formSerializer).toString();if((l=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return HC(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||a?(r.setContentType("application/json",!1),DJt(t)):t}],transformResponse:[function(t){let r=this.transitional||doe.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(bt.isResponse(t)||bt.isReadableStream(t))return t;if(t&&bt.isString(t)&&(n&&!this.responseType||a)){let c=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(l){if(c)throw l.name==="SyntaxError"?Cn.from(l,Cn.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Po.classes.FormData,Blob:Po.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};bt.forEach(["delete","get","head","post","put","patch"],e=>{doe.headers[e]={}});var JR=doe;var PJt=bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),MLe=e=>{let t={},r,n,a;return e&&e.split(`
522
+ `,"f"),Zn(this,_f,qe(this,_f,"f")+t.join(" "),"f")}}}[aie](t){mR(qe(this,wi,"f")).forEach(r=>{if((a=>a==="configObjects")(r))return;let n=qe(this,wi,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete qe(this,bs,"f").getDescriptions()[t]}[UPe](t,r,n){qe(this,B7,"f")[n]||(qe(this,ls,"f").process.emitWarning(t,r),qe(this,B7,"f")[n]=!0)}[zPe](){qe(this,D7,"f").push({options:qe(this,wi,"f"),configObjects:qe(this,wi,"f").configObjects.slice(0),exitProcess:qe(this,ry,"f"),groups:qe(this,Hb,"f"),strict:qe(this,Lk,"f"),strictCommands:qe(this,jk,"f"),strictOptions:qe(this,Mk,"f"),completionCommand:qe(this,Og,"f"),output:qe(this,_f,"f"),exitError:qe(this,FC,"f"),hasOutput:qe(this,Qg,"f"),parsed:this.parsed,parseFn:qe(this,Lg,"f"),parseContext:qe(this,Ok,"f")}),qe(this,bs,"f").freeze(),qe(this,Tl,"f").freeze(),qe(this,ep,"f").freeze(),qe(this,ny,"f").freeze()}[HPe](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(qe(this,ls,"f").process.argv()[0])?r=qe(this,ls,"f").process.argv().slice(1,2):r=qe(this,ls,"f").process.argv().slice(0,1),t=r.map(n=>{let a=this[nRe](qe(this,Nk,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&a.length<n.length?a:n}).join(" ").trim(),qe(this,ls,"f").getEnv("_")&&qe(this,ls,"f").getProcessArgvBin()===qe(this,ls,"f").getEnv("_")&&(t=qe(this,ls,"f").getEnv("_").replace(`${qe(this,ls,"f").path.dirname(qe(this,ls,"f").process.execPath())}/`,"")),t}[qk](){return qe(this,N7,"f")}[VPe](){return qe(this,O7,"f")}[oie](){if(!qe(this,Fk,"f"))return;let t=qe(this,ls,"f").getEnv("LC_ALL")||qe(this,ls,"f").getEnv("LC_MESSAGES")||qe(this,ls,"f").getEnv("LANG")||qe(this,ls,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[$Pe](){return this[cie]().version||"unknown"}[WPe](t){let r=t["--"]?t["--"]:t._;for(let n=0,a;(a=r[n])!==void 0;n++)qe(this,ls,"f").Parser.looksLikeNumber(a)&&Number.isSafeInteger(Math.floor(parseFloat(`${a}`)))&&(r[n]=Number(a));return t}[cie](t){let r=t||"*";if(qe(this,yR,"f")[r])return qe(this,yR,"f")[r];let n={};try{let a=t||qe(this,ls,"f").mainFilename;!t&&qe(this,ls,"f").path.extname(a)&&(a=qe(this,ls,"f").path.dirname(a));let s=qe(this,ls,"f").findUp(a,(c,l)=>{if(l.includes("package.json"))return"package.json"});tm(s,void 0,qe(this,ls,"f")),n=JSON.parse(qe(this,ls,"f").readFileSync(s,"utf8"))}catch{}return qe(this,yR,"f")[r]=n||{},qe(this,yR,"f")[r]}[QC](t,r){r=[].concat(r),r.forEach(n=>{n=this[pie](n),qe(this,wi,"f")[t].push(n)})}[vR](t,r,n,a){this[lie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=l})}[uie](t,r,n,a){this[lie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=(qe(this,wi,"f")[s][c]||[]).concat(l)})}[lie](t,r,n,a,s){if(Array.isArray(n))n.forEach(c=>{t(c,a)});else if((c=>typeof c=="object")(n))for(let c of mR(n))t(c,n[c]);else s(r,this[pie](n),a)}[pie](t){return t==="__proto__"?"___proto___":t}[fie](t,r){return this[vR](this[fie].bind(this),"key",t,r),this}[die](){var t,r,n,a,s,c,l,f,d,m,g,x;let b=qe(this,D7,"f").pop();tm(b,void 0,qe(this,ls,"f"));let A;t=this,r=this,n=this,a=this,s=this,c=this,l=this,f=this,d=this,m=this,g=this,x=this,{options:{set value(C){Zn(t,wi,C,"f")}}.value,configObjects:A,exitProcess:{set value(C){Zn(r,ry,C,"f")}}.value,groups:{set value(C){Zn(n,Hb,C,"f")}}.value,output:{set value(C){Zn(a,_f,C,"f")}}.value,exitError:{set value(C){Zn(s,FC,C,"f")}}.value,hasOutput:{set value(C){Zn(c,Qg,C,"f")}}.value,parsed:this.parsed,strict:{set value(C){Zn(l,Lk,C,"f")}}.value,strictCommands:{set value(C){Zn(f,jk,C,"f")}}.value,strictOptions:{set value(C){Zn(d,Mk,C,"f")}}.value,completionCommand:{set value(C){Zn(m,Og,C,"f")}}.value,parseFn:{set value(C){Zn(g,Lg,C,"f")}}.value,parseContext:{set value(C){Zn(x,Ok,C,"f")}}.value}=b,qe(this,wi,"f").configObjects=A,qe(this,bs,"f").unfreeze(),qe(this,Tl,"f").unfreeze(),qe(this,ep,"f").unfreeze(),qe(this,ny,"f").unfreeze()}[GPe](t,r){return Rk(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[YPe].bind(this),getContext:this[JPe].bind(this),getHasOutput:this[KPe].bind(this),getLoggerInstance:this[XPe].bind(this),getParseContext:this[ZPe].bind(this),getParserConfiguration:this[qk].bind(this),getUsageConfiguration:this[VPe].bind(this),getUsageInstance:this[eRe].bind(this),getValidationInstance:this[tRe].bind(this),hasParseCallback:this[Q7].bind(this),isGlobalContext:this[rRe].bind(this),postProcess:this[Uk].bind(this),reset:this[hie].bind(this),runValidation:this[mie].bind(this),runYargsParserAndExecuteCommands:this[K3].bind(this),setHasOutput:this[iRe].bind(this)}}[YPe](){return qe(this,ep,"f")}[JPe](){return qe(this,J3,"f")}[KPe](){return qe(this,Qg,"f")}[XPe](){return qe(this,AR,"f")}[ZPe](){return qe(this,Ok,"f")||{}}[eRe](){return qe(this,bs,"f")}[tRe](){return qe(this,Tl,"f")}[Q7](){return!!qe(this,Lg,"f")}[rRe](){return qe(this,P7,"f")}[Uk](t,r,n,a){return n||lu(t)||(r||(t=this[MPe](t)),(this[qk]()["parse-positional-numbers"]||this[qk]()["parse-positional-numbers"]===void 0)&&(t=this[WPe](t)),a&&(t=Pk(t,this,qe(this,ny,"f").getMiddleware(),!1))),t}[hie](t={}){Zn(this,wi,qe(this,wi,"f")||{},"f");let r={};r.local=qe(this,wi,"f").local||[],r.configObjects=qe(this,wi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(qe(this,Qk,"f"),Object.keys(qe(this,Hb,"f")).reduce((c,l)=>{let f=qe(this,Hb,"f")[l].filter(d=>!(d in n));return f.length>0&&(c[l]=f),c},{})),Zn(this,Hb,{},"f");let a=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return a.forEach(c=>{r[c]=(qe(this,wi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=RC(qe(this,wi,"f")[c],l=>!n[l])}),r.envPrefix=qe(this,wi,"f").envPrefix,Zn(this,wi,r,"f"),Zn(this,bs,qe(this,bs,"f")?qe(this,bs,"f").reset(n):RPe(this,qe(this,ls,"f")),"f"),Zn(this,Tl,qe(this,Tl,"f")?qe(this,Tl,"f").reset(n):jPe(this,qe(this,bs,"f"),qe(this,ls,"f")),"f"),Zn(this,ep,qe(this,ep,"f")?qe(this,ep,"f").reset():BPe(qe(this,bs,"f"),qe(this,Tl,"f"),qe(this,ny,"f"),qe(this,ls,"f")),"f"),qe(this,ty,"f")||Zn(this,ty,OPe(this,qe(this,bs,"f"),qe(this,ep,"f"),qe(this,ls,"f")),"f"),qe(this,ny,"f").reset(),Zn(this,Og,null,"f"),Zn(this,_f,"","f"),Zn(this,FC,null,"f"),Zn(this,Qg,!1,"f"),this.parsed=!1,this}[nRe](t,r){return qe(this,ls,"f").path.relative(t,r)}[K3](t,r,n,a=0,s=!1){let c=!!n||s;t=t||qe(this,OC,"f"),qe(this,wi,"f").__=qe(this,ls,"f").y18n.__,qe(this,wi,"f").configuration=this[qk]();let l=!!qe(this,wi,"f").configuration["populate--"],f=Object.assign({},qe(this,wi,"f").configuration,{"populate--":!0}),d=qe(this,ls,"f").Parser.detailed(t,Object.assign({},qe(this,wi,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),m=Object.assign(d.argv,qe(this,Ok,"f")),g,x=d.aliases,b=!1,A=!1;Object.keys(m).forEach(C=>{C===qe(this,iy,"f")&&m[C]?b=!0:C===qe(this,Vb,"f")&&m[C]&&(A=!0)}),m.$0=this.$0,this.parsed=d,a===0&&qe(this,bs,"f").clearCachedHelpMessage();try{if(this[oie](),r)return this[Uk](m,l,!!n,!1);qe(this,iy,"f")&&[qe(this,iy,"f")].concat(x[qe(this,iy,"f")]||[]).filter(j=>j.length>1).includes(""+m._[m._.length-1])&&(m._.pop(),b=!0),Zn(this,P7,!1,"f");let C=qe(this,ep,"f").getCommands(),I=qe(this,ty,"f").completionKey in m,k=b||I||s;if(m._.length){if(C.length){let O;for(let j=a||0,M;m._[j]!==void 0;j++)if(M=String(m._[j]),C.includes(M)&&M!==qe(this,Og,"f")){let W=qe(this,ep,"f").runCommand(M,this,d,j+1,s,b||A||s);return this[Uk](W,l,!!n,!1)}else if(!O&&M!==qe(this,Og,"f")){O=M;break}!qe(this,ep,"f").hasDefaultCommand()&&qe(this,F7,"f")&&O&&!k&&qe(this,Tl,"f").recommendCommands(O,C)}qe(this,Og,"f")&&m._.includes(qe(this,Og,"f"))&&!I&&(qe(this,ry,"f")&&NC(!0),this.showCompletionScript(),this.exit(0))}if(qe(this,ep,"f").hasDefaultCommand()&&!k){let O=qe(this,ep,"f").runCommand(null,this,d,0,s,b||A||s);return this[Uk](O,l,!!n,!1)}if(I){qe(this,ry,"f")&&NC(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${qe(this,ty,"f").completionKey}`)+1);return qe(this,ty,"f").getCompletion(O,(j,M)=>{if(j)throw new uu(j.message);(M||[]).forEach(W=>{qe(this,AR,"f").log(W)}),this.exit(0)}),this[Uk](m,!l,!!n,!1)}if(qe(this,Qg,"f")||(b?(qe(this,ry,"f")&&NC(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(qe(this,ry,"f")&&NC(!0),c=!0,qe(this,bs,"f").showVersion("log"),this.exit(0))),!c&&qe(this,wi,"f").skipValidation.length>0&&(c=Object.keys(m).some(O=>qe(this,wi,"f").skipValidation.indexOf(O)>=0&&m[O]===!0)),!c){if(d.error)throw new uu(d.error.message);if(!I){let O=this[mie](x,{},d.error);n||(g=Pk(m,this,qe(this,ny,"f").getMiddleware(),!0)),g=this[GPe](O,g!=null?g:m),lu(g)&&!n&&(g=g.then(()=>Pk(m,this,qe(this,ny,"f").getMiddleware(),!1)))}}}catch(C){if(C instanceof uu)qe(this,bs,"f").fail(C.message,C);else throw C}return this[Uk](g!=null?g:m,l,!!n,!0)}[mie](t,r,n,a){let s={...this.getDemandedOptions()};return c=>{if(n)throw new uu(n.message);qe(this,Tl,"f").nonOptionCount(c),qe(this,Tl,"f").requiredArguments(c,s);let l=!1;qe(this,jk,"f")&&(l=qe(this,Tl,"f").unknownCommands(c)),qe(this,Lk,"f")&&!l?qe(this,Tl,"f").unknownArguments(c,t,r,!!a):qe(this,Mk,"f")&&qe(this,Tl,"f").unknownArguments(c,t,{},!1,!1),qe(this,Tl,"f").limitedChoices(c),qe(this,Tl,"f").implications(c),qe(this,Tl,"f").conflicting(c)}}[iRe](){Zn(this,Qg,!0,"f")}[zk](t){if(typeof t=="string")qe(this,wi,"f").key[t]=!0;else for(let r of t)qe(this,wi,"f").key[r]=!0}};function DPe(e){return!!e&&typeof e.getInternalMethods=="function"}var A7t=sRe(eie),aRe=A7t;var Hk={name:"edgeone",version:"1.2.23-beta.3",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/templates","./edgeone-dist/pages/dev/runner-worker.js"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build",prepublishOnly:"npm run build","test:compression":"node test-compression.js"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/nuxt-pages":"^1.0.14","@edgeone/opennextjs-pages":"0.0.7",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2",zod:"^3.23.8","zod-to-json-schema":"^3.23.5"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}};var Aie=class{log(t,r){try{let n=this.format(r),a=JSON.stringify({key:t,value:n});process.send(a)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},v7t=new Aie,L7=v7t;var kqe=wr(Cc()),Tqe=wr(OR()),Bqe=wr(xae());var aQe=wr(Sae()),Kw=wr(require("fs"));var Cae=wr(require("path"));function C0(e,t){return Cae.default.join(e,t)}function di(e){return C0(process.cwd(),e)}function G4e(e){return Cae.default.dirname(e)}var Bz=sQe(),Dae=require("path");function Pae(){try{Bz.initSync({dir:WWt()})}catch(e){console.error("[File] initStorage error",e)}}async function jR(e,t,r){Pae(),await Bz.setItem(e,t).catch(n=>{console.error("[File] setLocalData error",n)}),r==null||r()}async function MR(e){return Pae(),await Bz.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}async function Dz(e){Pae(),await Bz.removeItem(e).catch(t=>{console.error("[File] removeLocalData error",t)})}function WWt(){try{let e=Dae.parse(process.cwd()).root,t=process.cwd(),n=Dae.relative(e,t).split(Dae.sep).length-2;return`${new Array(Math.max(0,n)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function oQe(e){return Kw.default.statSync(e)}function GWt(e){return Kw.default.mkdirSync(e,{recursive:!0})}function YWt(e){return Kw.default.existsSync(e)}function KL(e){return Kw.default.existsSync(e)}function Pz(e,t="utf-8"){return Kw.default.readFileSync(e,t)}function _0(e){let t=Pz(e);return JSON.parse(t)}function qR(e){let t=Pz(e);return aQe.default.parse(t)}function uy(e,t,r="utf-8"){let n=G4e(e);return YWt(n)||GWt(n),Kw.default.writeFileSync(e,t,r)}function Rae(e,t){return KL(e)?Kw.default.appendFileSync(e,t):Kw.default.writeFileSync(e,t)}var Ks=wr(OR()),Rs=wr(Cc()),lQe=wr(cQe());function rT({prefix:e="cli"}){return Rs.default.createElement(Ks.Text,{color:"grey"},"[",e,"]")}function Kr(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"red"},"[\u2718] "),e));r()}function da(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"green"},"[\u2714] "),e));r()}function Xw(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Oc(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(rT,{prefix:t}),e));r()}function Rz(e){let{unmount:t}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},e));t()}function ei(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"white"},Rs.default.createElement(rT,{prefix:t}),e));r()}function pQe(e,t,r="cli"){let n=t;t.includes("http")&&(n=new URL(t).pathname);let{unmount:a}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"grey"},e," ",n));a()}function Fae({timestamp:e}){return Rs.default.createElement(Ks.Box,{width:13},Rs.default.createElement(Ks.Text,{color:"grey"},(0,lQe.default)(e).format("HH:mm:ss.SSS")))}function fQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(Fae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white"},e)));r()}function dQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(Fae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Rs.default.createElement(Ks.Text,null," ",e)));r()}function Oae(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(Fae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Rs.default.createElement(Ks.Text,{color:"white"}," ",e)));r()}function JWt({content:e="Loading",prefix:t="cli",intervalMs:r=500,maxDots:n=6}){let[a,s]=(0,Rs.useState)("");return(0,Rs.useEffect)(()=>{let c=setInterval(()=>{s(l=>l.length>=n?"":l+".")},r);return()=>clearInterval(c)},[r,n]),Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(rT,{prefix:t}),e,a)}function hQe(e="Loading",t="cli",r=500,n=6){let a=(0,Ks.render)(Rs.default.createElement(JWt,{content:e,prefix:t,intervalMs:r,maxDots:n}));return{stop:()=>a.unmount()}}function uQe({percent:e,width:t=30,prefix:r="cli",label:n="Progress",color:a="cyan"}){let s=Math.max(0,Math.min(100,Math.round(e))),c=Math.round(s/100*t),l=t-c,f="\u2593".repeat(c),d="\u2591".repeat(Math.max(0,l)),m=String(s).padStart(3," ");return Rs.default.createElement(Ks.Text,null,Rs.default.createElement(rT,{prefix:r}),Rs.default.createElement(Ks.Text,{color:a},n,": "),"[",Rs.default.createElement(Ks.Text,{color:a},f),d,"] ",m,"%")}function mQe(e="Progress",t="cli",r=30,n="cyan"){let a=0,s=(0,Ks.render)(Rs.default.createElement(uQe,{percent:a,width:r,prefix:t,label:e,color:n}));return{update:(c,l)=>{a=c;let f=l!=null?l:e;s.rerender(Rs.default.createElement(uQe,{percent:a,width:r,prefix:t,label:f,color:n}))},stop:()=>s.unmount()}}var Qzn=require("fs"),Lzn=require("path");async function Gv(){return process.env.EDGEONE_PAGES_API_REGION?process.env.EDGEONE_PAGES_API_REGION:await MR("login_region")}function XL(e,t){return function(){return e.apply(t,arguments)}}var{toString:KWt}=Object.prototype,{getPrototypeOf:Lae}=Object,{iterator:Fz,toStringTag:AQe}=Symbol,Oz=(e=>t=>{let r=KWt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Yv=e=>(e=e.toLowerCase(),t=>Oz(t)===e),Qz=e=>t=>typeof t===e,{isArray:zR}=Array,ZL=Qz("undefined");function ej(e){return e!==null&&!ZL(e)&&e.constructor!==null&&!ZL(e.constructor)&&I0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var yQe=Yv("ArrayBuffer");function XWt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yQe(e.buffer),t}var ZWt=Qz("string"),I0=Qz("function"),vQe=Qz("number"),tj=e=>e!==null&&typeof e=="object",eGt=e=>e===!0||e===!1,Nz=e=>{if(Oz(e)!=="object")return!1;let t=Lae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(AQe in e)&&!(Fz in e)},tGt=e=>{if(!tj(e)||ej(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},rGt=Yv("Date"),nGt=Yv("File"),iGt=Yv("Blob"),sGt=Yv("FileList"),aGt=e=>tj(e)&&I0(e.pipe),oGt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||I0(e.append)&&((t=Oz(e))==="formdata"||t==="object"&&I0(e.toString)&&e.toString()==="[object FormData]"))},cGt=Yv("URLSearchParams"),[uGt,lGt,pGt,fGt]=["ReadableStream","Request","Response","Headers"].map(Yv),dGt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rj(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),zR(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(ej(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),c=s.length,l;for(n=0;n<c;n++)l=s[n],t.call(null,e[l],l,e)}}function xQe(e,t){if(ej(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}var nT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bQe=e=>!ZL(e)&&e!==nT;function Qae(){let{caseless:e}=bQe(this)&&this||{},t={},r=(n,a)=>{let s=e&&xQe(t,a)||a;Nz(t[s])&&Nz(n)?t[s]=Qae(t[s],n):Nz(n)?t[s]=Qae({},n):zR(n)?t[s]=n.slice():t[s]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&rj(arguments[n],r);return t}var hGt=(e,t,r,{allOwnKeys:n}={})=>(rj(t,(a,s)=>{r&&I0(a)?e[s]=XL(a,r):e[s]=a},{allOwnKeys:n}),e),mGt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gGt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},AGt=(e,t,r,n)=>{let a,s,c,l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)c=a[s],(!n||n(c,e,t))&&!l[c]&&(t[c]=e[c],l[c]=!0);e=r!==!1&&Lae(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},yGt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},vGt=e=>{if(!e)return null;if(zR(e))return e;let t=e.length;if(!vQe(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},xGt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lae(Uint8Array)),bGt=(e,t)=>{let n=(e&&e[Fz]).call(e),a;for(;(a=n.next())&&!a.done;){let s=a.value;t.call(e,s[0],s[1])}},EGt=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},wGt=Yv("HTMLFormElement"),SGt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),gQe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),CGt=Yv("RegExp"),EQe=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};rj(r,(a,s)=>{let c;(c=t(a,s,e))!==!1&&(n[s]=c||a)}),Object.defineProperties(e,n)},_Gt=e=>{EQe(e,(t,r)=>{if(I0(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(I0(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},IGt=(e,t)=>{let r={},n=a=>{a.forEach(s=>{r[s]=!0})};return zR(e)?n(e):n(String(e).split(t)),r},kGt=()=>{},TGt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function BGt(e){return!!(e&&I0(e.append)&&e[AQe]==="FormData"&&e[Fz])}var DGt=e=>{let t=new Array(10),r=(n,a)=>{if(tj(n)){if(t.indexOf(n)>=0)return;if(ej(n))return n;if(!("toJSON"in n)){t[a]=n;let s=zR(n)?[]:{};return rj(n,(c,l)=>{let f=r(c,a+1);!ZL(f)&&(s[l]=f)}),t[a]=void 0,s}}return n};return r(e,0)},PGt=Yv("AsyncFunction"),RGt=e=>e&&(tj(e)||I0(e))&&I0(e.then)&&I0(e.catch),wQe=((e,t)=>e?setImmediate:t?((r,n)=>(nT.addEventListener("message",({source:a,data:s})=>{a===nT&&s===r&&n.length&&n.shift()()},!1),a=>{n.push(a),nT.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",I0(nT.postMessage)),NGt=typeof queueMicrotask<"u"?queueMicrotask.bind(nT):typeof process<"u"&&process.nextTick||wQe,FGt=e=>e!=null&&I0(e[Fz]),bt={isArray:zR,isArrayBuffer:yQe,isBuffer:ej,isFormData:oGt,isArrayBufferView:XWt,isString:ZWt,isNumber:vQe,isBoolean:eGt,isObject:tj,isPlainObject:Nz,isEmptyObject:tGt,isReadableStream:uGt,isRequest:lGt,isResponse:pGt,isHeaders:fGt,isUndefined:ZL,isDate:rGt,isFile:nGt,isBlob:iGt,isRegExp:CGt,isFunction:I0,isStream:aGt,isURLSearchParams:cGt,isTypedArray:xGt,isFileList:sGt,forEach:rj,merge:Qae,extend:hGt,trim:dGt,stripBOM:mGt,inherits:gGt,toFlatObject:AGt,kindOf:Oz,kindOfTest:Yv,endsWith:yGt,toArray:vGt,forEachEntry:bGt,matchAll:EGt,isHTMLForm:wGt,hasOwnProperty:gQe,hasOwnProp:gQe,reduceDescriptors:EQe,freezeMethods:_Gt,toObjectSet:IGt,toCamelCase:SGt,noop:kGt,toFiniteNumber:TGt,findKey:xQe,global:nT,isContextDefined:bQe,isSpecCompliantForm:BGt,toJSONObject:DGt,isAsyncFn:PGt,isThenable:RGt,setImmediate:wQe,asap:NGt,isIterable:FGt};function HR(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}bt.inherits(HR,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:bt.toJSONObject(this.config),code:this.code,status:this.status}}});var SQe=HR.prototype,CQe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{CQe[e]={value:e}});Object.defineProperties(HR,CQe);Object.defineProperty(SQe,"isAxiosError",{value:!0});HR.from=(e,t,r,n,a,s)=>{let c=Object.create(SQe);return bt.toFlatObject(e,c,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),HR.call(c,e.message,t,r,n,a),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};var Cn=HR;var ILe=wr(_Le(),1),Yz=ILe.default;function soe(e){return bt.isPlainObject(e)||bt.isArray(e)}function TLe(e){return bt.endsWith(e,"[]")?e.slice(0,-2):e}function kLe(e,t,r){return e?e.concat(t).map(function(a,s){return a=TLe(a),!r&&s?"["+a+"]":a}).join(r?".":""):t}function xJt(e){return bt.isArray(e)&&!e.some(soe)}var bJt=bt.toFlatObject(bt,{},null,function(t){return/^is[A-Z]/.test(t)});function EJt(e,t,r){if(!bt.isObject(e))throw new TypeError("target must be an object");t=t||new(Yz||FormData),r=bt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,I){return!bt.isUndefined(I[C])});let n=r.metaTokens,a=r.visitor||m,s=r.dots,c=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&bt.isSpecCompliantForm(t);if(!bt.isFunction(a))throw new TypeError("visitor must be a function");function d(A){if(A===null)return"";if(bt.isDate(A))return A.toISOString();if(bt.isBoolean(A))return A.toString();if(!f&&bt.isBlob(A))throw new Cn("Blob is not supported. Use a Buffer instead.");return bt.isArrayBuffer(A)||bt.isTypedArray(A)?f&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function m(A,C,I){let k=A;if(A&&!I&&typeof A=="object"){if(bt.endsWith(C,"{}"))C=n?C:C.slice(0,-2),A=JSON.stringify(A);else if(bt.isArray(A)&&xJt(A)||(bt.isFileList(A)||bt.endsWith(C,"[]"))&&(k=bt.toArray(A)))return C=TLe(C),k.forEach(function(j,M){!(bt.isUndefined(j)||j===null)&&t.append(c===!0?kLe([C],M,s):c===null?C:C+"[]",d(j))}),!1}return soe(A)?!0:(t.append(kLe(I,C,s),d(A)),!1)}let g=[],x=Object.assign(bJt,{defaultVisitor:m,convertValue:d,isVisitable:soe});function b(A,C){if(!bt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+C.join("."));g.push(A),bt.forEach(A,function(k,O){(!(bt.isUndefined(k)||k===null)&&a.call(t,k,bt.isString(O)?O.trim():O,C,x))===!0&&b(k,C?C.concat(O):[O])}),g.pop()}}if(!bt.isObject(e))throw new TypeError("data must be an object");return b(e),t}var HC=EJt;function BLe(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function DLe(e,t){this._pairs=[],e&&HC(e,this,t)}var PLe=DLe.prototype;PLe.append=function(t,r){this._pairs.push([t,r])};PLe.toString=function(t){let r=t?function(n){return t.call(this,n,BLe)}:BLe;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};var RLe=DLe;function wJt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sT(e,t,r){if(!t)return e;let n=r&&r.encode||wJt;bt.isFunction(r)&&(r={serialize:r});let a=r&&r.serialize,s;if(a?s=a(t,r):s=bt.isURLSearchParams(t)?t.toString():new RLe(t,r).toString(n),s){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var aoe=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){bt.forEach(this.handlers,function(n){n!==null&&t(n)})}},ooe=aoe;var YR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var QLe=wr(require("crypto"),1);var NLe=wr(require("url"),1),FLe=NLe.default.URLSearchParams;var coe="abcdefghijklmnopqrstuvwxyz",OLe="0123456789",LLe={DIGIT:OLe,ALPHA:coe,ALPHA_DIGIT:coe+coe.toUpperCase()+OLe},SJt=(e=16,t=LLe.ALPHA_DIGIT)=>{let r="",{length:n}=t,a=new Uint32Array(e);QLe.default.randomFillSync(a);for(let s=0;s<e;s++)r+=t[a[s]%n];return r},jLe={isNode:!0,classes:{URLSearchParams:FLe,FormData:Yz,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:LLe,generateString:SJt,protocols:["http","https","file","data"]};var poe={};tPe(poe,{hasBrowserEnv:()=>loe,hasStandardBrowserEnv:()=>CJt,hasStandardBrowserWebWorkerEnv:()=>_Jt,navigator:()=>uoe,origin:()=>IJt});var loe=typeof window<"u"&&typeof document<"u",uoe=typeof navigator=="object"&&navigator||void 0,CJt=loe&&(!uoe||["ReactNative","NativeScript","NS"].indexOf(uoe.product)<0),_Jt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",IJt=loe&&window.location.href||"http://localhost";var Po={...poe,...jLe};function foe(e,t){return HC(e,new Po.classes.URLSearchParams,{visitor:function(r,n,a,s){return Po.isNode&&bt.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function kJt(e){return bt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function TJt(e){let t={},r=Object.keys(e),n,a=r.length,s;for(n=0;n<a;n++)s=r[n],t[s]=e[s];return t}function BJt(e){function t(r,n,a,s){let c=r[s++];if(c==="__proto__")return!0;let l=Number.isFinite(+c),f=s>=r.length;return c=!c&&bt.isArray(a)?a.length:c,f?(bt.hasOwnProp(a,c)?a[c]=[a[c],n]:a[c]=n,!l):((!a[c]||!bt.isObject(a[c]))&&(a[c]=[]),t(r,n,a[c],s)&&bt.isArray(a[c])&&(a[c]=TJt(a[c])),!l)}if(bt.isFormData(e)&&bt.isFunction(e.entries)){let r={};return bt.forEachEntry(e,(n,a)=>{t(kJt(n),a,r,0)}),r}return null}var Jz=BJt;function DJt(e,t,r){if(bt.isString(e))try{return(t||JSON.parse)(e),bt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var doe={transitional:YR,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",a=n.indexOf("application/json")>-1,s=bt.isObject(t);if(s&&bt.isHTMLForm(t)&&(t=new FormData(t)),bt.isFormData(t))return a?JSON.stringify(Jz(t)):t;if(bt.isArrayBuffer(t)||bt.isBuffer(t)||bt.isStream(t)||bt.isFile(t)||bt.isBlob(t)||bt.isReadableStream(t))return t;if(bt.isArrayBufferView(t))return t.buffer;if(bt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return foe(t,this.formSerializer).toString();if((l=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return HC(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||a?(r.setContentType("application/json",!1),DJt(t)):t}],transformResponse:[function(t){let r=this.transitional||doe.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(bt.isResponse(t)||bt.isReadableStream(t))return t;if(t&&bt.isString(t)&&(n&&!this.responseType||a)){let c=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(l){if(c)throw l.name==="SyntaxError"?Cn.from(l,Cn.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Po.classes.FormData,Blob:Po.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};bt.forEach(["delete","get","head","post","put","patch"],e=>{doe.headers[e]={}});var JR=doe;var PJt=bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),MLe=e=>{let t={},r,n,a;return e&&e.split(`
523
523
  `).forEach(function(c){a=c.indexOf(":"),r=c.substring(0,a).trim().toLowerCase(),n=c.substring(a+1).trim(),!(!r||t[r]&&PJt[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var qLe=Symbol("internals");function oj(e){return e&&String(e).trim().toLowerCase()}function Kz(e){return e===!1||e==null?e:bt.isArray(e)?e.map(Kz):String(e)}function RJt(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var NJt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function hoe(e,t,r,n,a){if(bt.isFunction(n))return n.call(this,t,r);if(a&&(t=r),!!bt.isString(t)){if(bt.isString(n))return t.indexOf(n)!==-1;if(bt.isRegExp(n))return n.test(t)}}function FJt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function OJt(e,t){let r=bt.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(a,s,c){return this[n].call(this,t,a,s,c)},configurable:!0})})}var KR=class{constructor(t){t&&this.set(t)}set(t,r,n){let a=this;function s(l,f,d){let m=oj(f);if(!m)throw new Error("header name must be a non-empty string");let g=bt.findKey(a,m);(!g||a[g]===void 0||d===!0||d===void 0&&a[g]!==!1)&&(a[g||f]=Kz(l))}let c=(l,f)=>bt.forEach(l,(d,m)=>s(d,m,f));if(bt.isPlainObject(t)||t instanceof this.constructor)c(t,r);else if(bt.isString(t)&&(t=t.trim())&&!NJt(t))c(MLe(t),r);else if(bt.isObject(t)&&bt.isIterable(t)){let l={},f,d;for(let m of t){if(!bt.isArray(m))throw TypeError("Object iterator must return a key-value pair");l[d=m[0]]=(f=l[d])?bt.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}c(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=oj(t),t){let n=bt.findKey(this,t);if(n){let a=this[n];if(!r)return a;if(r===!0)return RJt(a);if(bt.isFunction(r))return r.call(this,a,n);if(bt.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=oj(t),t){let n=bt.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||hoe(this,this[n],n,r)))}return!1}delete(t,r){let n=this,a=!1;function s(c){if(c=oj(c),c){let l=bt.findKey(n,c);l&&(!r||hoe(n,n[l],l,r))&&(delete n[l],a=!0)}}return bt.isArray(t)?t.forEach(s):s(t),a}clear(t){let r=Object.keys(this),n=r.length,a=!1;for(;n--;){let s=r[n];(!t||hoe(this,this[s],s,t,!0))&&(delete this[s],a=!0)}return a}normalize(t){let r=this,n={};return bt.forEach(this,(a,s)=>{let c=bt.findKey(n,s);if(c){r[c]=Kz(a),delete r[s];return}let l=t?FJt(s):String(s).trim();l!==s&&delete r[s],r[l]=Kz(a),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return bt.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=t&&bt.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
524
524
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){let n=(this[qLe]=this[qLe]={accessors:{}}).accessors,a=this.prototype;function s(c){let l=oj(c);n[l]||(OJt(a,c),n[l]=!0)}return bt.isArray(t)?t.forEach(s):s(t),this}};KR.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);bt.reduceDescriptors(KR.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});bt.freezeMethods(KR);var el=KR;function cj(e,t){let r=this||JR,n=t||r,a=el.from(n.headers),s=n.data;return bt.forEach(e,function(l){s=l.call(r,s,a.normalize(),t?t.status:void 0)}),a.normalize(),s}function uj(e){return!!(e&&e.__CANCEL__)}function ULe(e,t,r){Cn.call(this,e==null?"canceled":e,Cn.ERR_CANCELED,t,r),this.name="CanceledError"}bt.inherits(ULe,Cn,{__CANCEL__:!0});var qg=ULe;function Kb(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Cn("Request failed with status code "+r.status,[Cn.ERR_BAD_REQUEST,Cn.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function moe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function goe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function aT(e,t,r){let n=!moe(t);return e&&(n||r==!1)?goe(e,t):t}var yje=wr(HLe(),1),vje=wr(require("http"),1),xje=wr(require("https"),1),bje=wr(require("util"),1),Eje=wr(Doe(),1),e2=wr(require("zlib"),1);var lT="1.11.0";function hj(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var vKt=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Poe(e,t,r){let n=r&&r.Blob||Po.classes.Blob,a=hj(e);if(t===void 0&&n&&(t=!0),a==="data"){e=a.length?e.slice(a.length+1):e;let s=vKt.exec(e);if(!s)throw new Cn("Invalid URL",Cn.ERR_INVALID_URL);let c=s[1],l=s[2],f=s[3],d=Buffer.from(decodeURIComponent(f),l?"base64":"utf8");if(t){if(!n)throw new Cn("Blob is not supported",Cn.ERR_NOT_SUPPORT);return new n([d],{type:c})}return d}throw new Cn("Unsupported protocol "+a,Cn.ERR_NOT_SUPPORT)}var fT=wr(require("stream"),1);var nje=wr(require("stream"),1);var Roe=Symbol("internals"),Noe=class extends nje.default.Transform{constructor(t){t=bt.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,a)=>!bt.isUndefined(a[n])),super({readableHighWaterMark:t.chunkSize});let r=this[Roe]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[Roe];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let a=this[Roe],s=a.maxRate,c=this.readableHighWaterMark,l=a.timeWindow,f=1e3/l,d=s/f,m=a.minChunkSize!==!1?Math.max(a.minChunkSize,d*.01):0,g=(b,A)=>{let C=Buffer.byteLength(b);a.bytesSeen+=C,a.bytes+=C,a.isCaptured&&this.emit("progress",a.bytesSeen),this.push(b)?process.nextTick(A):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(A)}},x=(b,A)=>{let C=Buffer.byteLength(b),I=null,k=c,O,j=0;if(s){let M=Date.now();(!a.ts||(j=M-a.ts)>=l)&&(a.ts=M,O=d-a.bytes,a.bytes=O<0?-O:0,j=0),O=d-a.bytes}if(s){if(O<=0)return setTimeout(()=>{A(null,b)},l-j);O<k&&(k=O)}k&&C>k&&C-k>m&&(I=b.subarray(k),b=b.subarray(0,k)),g(b,I?()=>{process.nextTick(A,null,I)}:A)};x(t,function b(A,C){if(A)return n(A);C?x(C,b):n(null)})}},Foe=Noe;var wje=require("events");var sje=wr(require("util"),1),aje=require("stream");var{asyncIterator:ije}=Symbol,xKt=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[ije]?yield*e[ije]():yield e},nH=xKt;var bKt=Po.ALPHABET.ALPHA_DIGIT+"-_",mj=typeof TextEncoder=="function"?new TextEncoder:new sje.default.TextEncoder,pT=`\r
525
525
  `,EKt=mj.encode(pT),wKt=2,Ooe=class{constructor(t,r){let{escapeName:n}=this.constructor,a=bt.isString(r),s=`Content-Disposition: form-data; name="${n(t)}"${!a&&r.name?`; filename="${n(r.name)}"`:""}${pT}`;a?r=mj.encode(String(r).replace(/\r?\n|\r\n?/g,pT)):s+=`Content-Type: ${r.type||"application/octet-stream"}${pT}`,this.headers=mj.encode(s+pT),this.contentLength=a?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+wKt,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;bt.isTypedArray(t)?yield t:yield*nH(t),yield EKt}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},SKt=(e,t,r)=>{let{tag:n="form-data-boundary",size:a=25,boundary:s=n+"-"+Po.generateString(a,bKt)}=r||{};if(!bt.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let c=mj.encode("--"+s+pT),l=mj.encode("--"+s+"--"+pT),f=l.byteLength,d=Array.from(e.entries()).map(([g,x])=>{let b=new Ooe(g,x);return f+=b.size,b});f+=c.byteLength*d.length,f=bt.toFiniteNumber(f);let m={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(f)&&(m["Content-Length"]=f),t&&t(m),aje.Readable.from(async function*(){for(let g of d)yield c,yield*g.encode();yield l}())},oje=SKt;var cje=wr(require("stream"),1),Qoe=class extends cje.default.Transform{__transform(t,r,n){this.push(t),n()}_transform(t,r,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let a=Buffer.alloc(2);a[0]=120,a[1]=156,this.push(a,r)}this.__transform(t,r,n)}},uje=Qoe;var CKt=(e,t)=>bt.isAsyncFn(e)?function(...r){let n=r.pop();e.apply(this,r).then(a=>{try{t?n(null,...t(a)):n(null,a)}catch(s){n(s)}},n)}:e,lje=CKt;function _Kt(e,t){e=e||10;let r=new Array(e),n=new Array(e),a=0,s=0,c;return t=t!==void 0?t:1e3,function(f){let d=Date.now(),m=n[s];c||(c=d),r[a]=f,n[a]=d;let g=s,x=0;for(;g!==a;)x+=r[g++],g=g%e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),d-c<t)return;let b=m&&d-m;return b?Math.round(x*1e3/b):void 0}}var pje=_Kt;function IKt(e,t){let r=0,n=1e3/t,a,s,c=(d,m=Date.now())=>{r=m,a=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{let m=Date.now(),g=m-r;g>=n?c(d,m):(a=d,s||(s=setTimeout(()=>{s=null,c(a)},n-g)))},()=>a&&c(a)]}var fje=IKt;var Zw=(e,t,r=3)=>{let n=0,a=pje(50,250);return fje(s=>{let c=s.loaded,l=s.lengthComputable?s.total:void 0,f=c-n,d=a(f),m=c<=l;n=c;let g={loaded:c,total:l,progress:l?c/l:void 0,bytes:f,rate:d||void 0,estimated:d&&l&&m?(l-c)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(g)},r)},rN=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},nN=e=>(...t)=>bt.asap(()=>e(...t));var dje={flush:e2.default.constants.Z_SYNC_FLUSH,finishFlush:e2.default.constants.Z_SYNC_FLUSH},kKt={flush:e2.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:e2.default.constants.BROTLI_OPERATION_FLUSH},hje=bt.isFunction(e2.default.createBrotliDecompress),{http:TKt,https:BKt}=Eje.default,DKt=/https:?/,mje=Po.protocols.map(e=>e+":"),gje=(e,[t,r])=>(e.on("end",r).on("error",r),t);function PKt(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function Sje(e,t,r){let n=t;if(!n&&n!==!1){let a=yje.default.getProxyForUrl(r);a&&(n=new URL(a))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let s=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");let a=n.hostname||n.host;e.hostname=a,e.host=a,e.port=n.port,e.path=r,n.protocol&&(e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}e.beforeRedirects.proxy=function(s){Sje(s,t,s.href)}}var RKt=typeof process<"u"&&bt.kindOf(process)==="process",NKt=e=>new Promise((t,r)=>{let n,a,s=(f,d)=>{a||(a=!0,n&&n(f,d))},c=f=>{s(f),t(f)},l=f=>{s(f,!0),r(f)};e(c,l,f=>n=f).catch(l)}),FKt=({address:e,family:t})=>{if(!bt.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},Aje=(e,t)=>FKt(bt.isObject(e)?e:{address:e,family:t}),Cje=RKt&&function(t){return NKt(async function(n,a,s){let{data:c,lookup:l,family:f}=t,{responseType:d,responseEncoding:m}=t,g=t.method.toUpperCase(),x,b=!1,A;if(l){let Ae=lje(l,we=>bt.isArray(we)?we:[we]);l=(we,Me,We)=>{Ae(we,Me,(Tt,Vt,ht)=>{if(Tt)return We(Tt);let it=bt.isArray(Vt)?Vt.map(He=>Aje(He)):[Aje(Vt,ht)];Me.all?We(Tt,it):We(Tt,it[0].address,it[0].family)})}}let C=new wje.EventEmitter,I=()=>{t.cancelToken&&t.cancelToken.unsubscribe(k),t.signal&&t.signal.removeEventListener("abort",k),C.removeAllListeners()};s((Ae,we)=>{x=!0,we&&(b=!0,I())});function k(Ae){C.emit("abort",!Ae||Ae.type?new qg(null,t,A):Ae)}C.once("abort",a),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(k),t.signal&&(t.signal.aborted?k():t.signal.addEventListener("abort",k)));let O=aT(t.baseURL,t.url,t.allowAbsoluteUrls),j=new URL(O,Po.hasBrowserEnv?Po.origin:void 0),M=j.protocol||mje[0];if(M==="data:"){let Ae;if(g!=="GET")return Kb(n,a,{status:405,statusText:"method not allowed",headers:{},config:t});try{Ae=Poe(t.url,d==="blob",{Blob:t.env&&t.env.Blob})}catch(we){throw Cn.from(we,Cn.ERR_BAD_REQUEST,t)}return d==="text"?(Ae=Ae.toString(m),(!m||m==="utf8")&&(Ae=bt.stripBOM(Ae))):d==="stream"&&(Ae=fT.default.Readable.from(Ae)),Kb(n,a,{data:Ae,status:200,statusText:"OK",headers:new el,config:t})}if(mje.indexOf(M)===-1)return a(new Cn("Unsupported protocol "+M,Cn.ERR_BAD_REQUEST,t));let W=el.from(t.headers).normalize();W.set("User-Agent","axios/"+lT,!1);let{onUploadProgress:se,onDownloadProgress:X}=t,ve=t.maxRate,ae,he;if(bt.isSpecCompliantForm(c)){let Ae=W.getContentType(/boundary=([-_\w\d]{10,70})/i);c=oje(c,we=>{W.set(we)},{tag:`axios-${lT}-boundary`,boundary:Ae&&Ae[1]||void 0})}else if(bt.isFormData(c)&&bt.isFunction(c.getHeaders)){if(W.set(c.getHeaders()),!W.hasContentLength())try{let Ae=await bje.default.promisify(c.getLength).call(c);Number.isFinite(Ae)&&Ae>=0&&W.setContentLength(Ae)}catch{}}else if(bt.isBlob(c)||bt.isFile(c))c.size&&W.setContentType(c.type||"application/octet-stream"),W.setContentLength(c.size||0),c=fT.default.Readable.from(nH(c));else if(c&&!bt.isStream(c)){if(!Buffer.isBuffer(c))if(bt.isArrayBuffer(c))c=Buffer.from(new Uint8Array(c));else if(bt.isString(c))c=Buffer.from(c,"utf-8");else return a(new Cn("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Cn.ERR_BAD_REQUEST,t));if(W.setContentLength(c.length,!1),t.maxBodyLength>-1&&c.length>t.maxBodyLength)return a(new Cn("Request body larger than maxBodyLength limit",Cn.ERR_BAD_REQUEST,t))}let me=bt.toFiniteNumber(W.getContentLength());bt.isArray(ve)?(ae=ve[0],he=ve[1]):ae=he=ve,c&&(se||ae)&&(bt.isStream(c)||(c=fT.default.Readable.from(c,{objectMode:!1})),c=fT.default.pipeline([c,new Foe({maxRate:bt.toFiniteNumber(ae)})],bt.noop),se&&c.on("progress",gje(c,rN(me,Zw(nN(se),!1,3)))));let ye;if(t.auth){let Ae=t.auth.username||"",we=t.auth.password||"";ye=Ae+":"+we}if(!ye&&j.username){let Ae=j.username,we=j.password;ye=Ae+":"+we}ye&&W.delete("authorization");let ue;try{ue=sT(j.pathname+j.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(Ae){let we=new Error(Ae.message);return we.config=t,we.url=t.url,we.exists=!0,a(we)}W.set("Accept-Encoding","gzip, compress, deflate"+(hje?", br":""),!1);let ne={path:ue,method:g,headers:W.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:ye,protocol:M,family:f,beforeRedirect:PKt,beforeRedirects:{}};!bt.isUndefined(l)&&(ne.lookup=l),t.socketPath?ne.socketPath=t.socketPath:(ne.hostname=j.hostname.startsWith("[")?j.hostname.slice(1,-1):j.hostname,ne.port=j.port,Sje(ne,t.proxy,M+"//"+j.hostname+(j.port?":"+j.port:"")+ne.path));let be,$e=DKt.test(ne.protocol);if(ne.agent=$e?t.httpsAgent:t.httpAgent,t.transport?be=t.transport:t.maxRedirects===0?be=$e?xje.default:vje.default:(t.maxRedirects&&(ne.maxRedirects=t.maxRedirects),t.beforeRedirect&&(ne.beforeRedirects.config=t.beforeRedirect),be=$e?BKt:TKt),t.maxBodyLength>-1?ne.maxBodyLength=t.maxBodyLength:ne.maxBodyLength=1/0,t.insecureHTTPParser&&(ne.insecureHTTPParser=t.insecureHTTPParser),A=be.request(ne,function(we){if(A.destroyed)return;let Me=[we],We=+we.headers["content-length"];if(X||he){let He=new Foe({maxRate:bt.toFiniteNumber(he)});X&&He.on("progress",gje(He,rN(We,Zw(nN(X),!0,3)))),Me.push(He)}let Tt=we,Vt=we.req||A;if(t.decompress!==!1&&we.headers["content-encoding"])switch((g==="HEAD"||we.statusCode===204)&&delete we.headers["content-encoding"],(we.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Me.push(e2.default.createUnzip(dje)),delete we.headers["content-encoding"];break;case"deflate":Me.push(new uje),Me.push(e2.default.createUnzip(dje)),delete we.headers["content-encoding"];break;case"br":hje&&(Me.push(e2.default.createBrotliDecompress(kKt)),delete we.headers["content-encoding"])}Tt=Me.length>1?fT.default.pipeline(Me,bt.noop):Me[0];let ht=fT.default.finished(Tt,()=>{ht(),I()}),it={status:we.statusCode,statusText:we.statusMessage,headers:new el(we.headers),config:t,request:Vt};if(d==="stream")it.data=Tt,Kb(n,a,it);else{let He=[],rt=0;Tt.on("data",function(Wt){He.push(Wt),rt+=Wt.length,t.maxContentLength>-1&&rt>t.maxContentLength&&(b=!0,Tt.destroy(),a(new Cn("maxContentLength size of "+t.maxContentLength+" exceeded",Cn.ERR_BAD_RESPONSE,t,Vt)))}),Tt.on("aborted",function(){if(b)return;let Wt=new Cn("stream has been aborted",Cn.ERR_BAD_RESPONSE,t,Vt);Tt.destroy(Wt),a(Wt)}),Tt.on("error",function(Wt){A.destroyed||a(Cn.from(Wt,null,t,Vt))}),Tt.on("end",function(){try{let Wt=He.length===1?He[0]:Buffer.concat(He);d!=="arraybuffer"&&(Wt=Wt.toString(m),(!m||m==="utf8")&&(Wt=bt.stripBOM(Wt))),it.data=Wt}catch(Wt){return a(Cn.from(Wt,null,t,it.request,it))}Kb(n,a,it)})}C.once("abort",He=>{Tt.destroyed||(Tt.emit("error",He),Tt.destroy())})}),C.once("abort",Ae=>{a(Ae),A.destroy(Ae)}),A.on("error",function(we){a(Cn.from(we,null,t,A))}),A.on("socket",function(we){we.setKeepAlive(!0,1e3*60)}),t.timeout){let Ae=parseInt(t.timeout,10);if(Number.isNaN(Ae)){a(new Cn("error trying to parse `config.timeout` to int",Cn.ERR_BAD_OPTION_VALUE,t,A));return}A.setTimeout(Ae,function(){if(x)return;let Me=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",We=t.transitional||YR;t.timeoutErrorMessage&&(Me=t.timeoutErrorMessage),a(new Cn(Me,We.clarifyTimeoutError?Cn.ETIMEDOUT:Cn.ECONNABORTED,t,A)),k()})}if(bt.isStream(c)){let Ae=!1,we=!1;c.on("end",()=>{Ae=!0}),c.once("error",Me=>{we=!0,A.destroy(Me)}),c.on("close",()=>{!Ae&&!we&&k(new qg("Request stream has been aborted",t,A))}),c.pipe(A)}else A.end(c)})};var _je=Po.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Po.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Po.origin),Po.navigator&&/(msie|trident)/i.test(Po.navigator.userAgent)):()=>!0;var Ije=Po.hasStandardBrowserEnv?{write(e,t,r,n,a,s){let c=[e+"="+encodeURIComponent(t)];bt.isNumber(r)&&c.push("expires="+new Date(r).toGMTString()),bt.isString(n)&&c.push("path="+n),bt.isString(a)&&c.push("domain="+a),s===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var kje=e=>e instanceof el?{...e}:e;function Kv(e,t){t=t||{};let r={};function n(d,m,g,x){return bt.isPlainObject(d)&&bt.isPlainObject(m)?bt.merge.call({caseless:x},d,m):bt.isPlainObject(m)?bt.merge({},m):bt.isArray(m)?m.slice():m}function a(d,m,g,x){if(bt.isUndefined(m)){if(!bt.isUndefined(d))return n(void 0,d,g,x)}else return n(d,m,g,x)}function s(d,m){if(!bt.isUndefined(m))return n(void 0,m)}function c(d,m){if(bt.isUndefined(m)){if(!bt.isUndefined(d))return n(void 0,d)}else return n(void 0,m)}function l(d,m,g){if(g in t)return n(d,m);if(g in e)return n(void 0,d)}let f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:l,headers:(d,m,g)=>a(kje(d),kje(m),g,!0)};return bt.forEach(Object.keys({...e,...t}),function(m){let g=f[m]||a,x=g(e[m],t[m],m);bt.isUndefined(x)&&g!==l||(r[m]=x)}),r}var iH=e=>{let t=Kv({},e),{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:s,headers:c,auth:l}=t;t.headers=c=el.from(c),t.url=sT(aT(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&c.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let f;if(bt.isFormData(r)){if(Po.hasStandardBrowserEnv||Po.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){let[d,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([d||"multipart/form-data",...m].join("; "))}}if(Po.hasStandardBrowserEnv&&(n&&bt.isFunction(n)&&(n=n(t)),n||n!==!1&&_je(t.url))){let d=a&&s&&Ije.read(s);d&&c.set(a,d)}return t};var OKt=typeof XMLHttpRequest<"u",Tje=OKt&&function(e){return new Promise(function(r,n){let a=iH(e),s=a.data,c=el.from(a.headers).normalize(),{responseType:l,onUploadProgress:f,onDownloadProgress:d}=a,m,g,x,b,A;function C(){b&&b(),A&&A(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let I=new XMLHttpRequest;I.open(a.method.toUpperCase(),a.url,!0),I.timeout=a.timeout;function k(){if(!I)return;let j=el.from("getAllResponseHeaders"in I&&I.getAllResponseHeaders()),W={data:!l||l==="text"||l==="json"?I.responseText:I.response,status:I.status,statusText:I.statusText,headers:j,config:e,request:I};Kb(function(X){r(X),C()},function(X){n(X),C()},W),I=null}"onloadend"in I?I.onloadend=k:I.onreadystatechange=function(){!I||I.readyState!==4||I.status===0&&!(I.responseURL&&I.responseURL.indexOf("file:")===0)||setTimeout(k)},I.onabort=function(){I&&(n(new Cn("Request aborted",Cn.ECONNABORTED,e,I)),I=null)},I.onerror=function(){n(new Cn("Network Error",Cn.ERR_NETWORK,e,I)),I=null},I.ontimeout=function(){let M=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",W=a.transitional||YR;a.timeoutErrorMessage&&(M=a.timeoutErrorMessage),n(new Cn(M,W.clarifyTimeoutError?Cn.ETIMEDOUT:Cn.ECONNABORTED,e,I)),I=null},s===void 0&&c.setContentType(null),"setRequestHeader"in I&&bt.forEach(c.toJSON(),function(M,W){I.setRequestHeader(W,M)}),bt.isUndefined(a.withCredentials)||(I.withCredentials=!!a.withCredentials),l&&l!=="json"&&(I.responseType=a.responseType),d&&([x,A]=Zw(d,!0),I.addEventListener("progress",x)),f&&I.upload&&([g,b]=Zw(f),I.upload.addEventListener("progress",g),I.upload.addEventListener("loadend",b)),(a.cancelToken||a.signal)&&(m=j=>{I&&(n(!j||j.type?new qg(null,e,I):j),I.abort(),I=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));let O=hj(a.url);if(O&&Po.protocols.indexOf(O)===-1){n(new Cn("Unsupported protocol "+O+":",Cn.ERR_BAD_REQUEST,e));return}I.send(s||null)})};var QKt=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,a,s=function(d){if(!a){a=!0,l();let m=d instanceof Error?d:this.reason;n.abort(m instanceof Cn?m:new qg(m instanceof Error?m.message:m))}},c=t&&setTimeout(()=>{c=null,s(new Cn(`timeout ${t} of ms exceeded`,Cn.ETIMEDOUT))},t),l=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));let{signal:f}=n;return f.unsubscribe=()=>bt.asap(l),f}},Bje=QKt;var LKt=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,a;for(;n<r;)a=n+t,yield e.slice(n,a),n=a},jKt=async function*(e,t){for await(let r of MKt(e))yield*LKt(r,t)},MKt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Loe=(e,t,r,n)=>{let a=jKt(e,t),s=0,c,l=f=>{c||(c=!0,n&&n(f))};return new ReadableStream({async pull(f){try{let{done:d,value:m}=await a.next();if(d){l(),f.close();return}let g=m.byteLength;if(r){let x=s+=g;r(x)}f.enqueue(new Uint8Array(m))}catch(d){throw l(d),d}},cancel(f){return l(f),a.return()}},{highWaterMark:2})};var aH=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Pje=aH&&typeof ReadableStream=="function",qKt=aH&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Rje=(e,...t)=>{try{return!!e(...t)}catch{return!1}},UKt=Pje&&Rje(()=>{let e=!1,t=new Request(Po.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Dje=64*1024,joe=Pje&&Rje(()=>bt.isReadableStream(new Response("").body)),sH={stream:joe&&(e=>e.body)};aH&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!sH[t]&&(sH[t]=bt.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Cn(`Response type '${t}' is not supported`,Cn.ERR_NOT_SUPPORT,n)})})})(new Response);var zKt=async e=>{if(e==null)return 0;if(bt.isBlob(e))return e.size;if(bt.isSpecCompliantForm(e))return(await new Request(Po.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(bt.isArrayBufferView(e)||bt.isArrayBuffer(e))return e.byteLength;if(bt.isURLSearchParams(e)&&(e=e+""),bt.isString(e))return(await qKt(e)).byteLength},HKt=async(e,t)=>{let r=bt.toFiniteNumber(e.getContentLength());return r==null?zKt(t):r},Nje=aH&&(async e=>{let{url:t,method:r,data:n,signal:a,cancelToken:s,timeout:c,onDownloadProgress:l,onUploadProgress:f,responseType:d,headers:m,withCredentials:g="same-origin",fetchOptions:x}=iH(e);d=d?(d+"").toLowerCase():"text";let b=Bje([a,s&&s.toAbortSignal()],c),A,C=b&&b.unsubscribe&&(()=>{b.unsubscribe()}),I;try{if(f&&UKt&&r!=="get"&&r!=="head"&&(I=await HKt(m,n))!==0){let W=new Request(t,{method:"POST",body:n,duplex:"half"}),se;if(bt.isFormData(n)&&(se=W.headers.get("content-type"))&&m.setContentType(se),W.body){let[X,ve]=rN(I,Zw(nN(f)));n=Loe(W.body,Dje,X,ve)}}bt.isString(g)||(g=g?"include":"omit");let k="credentials"in Request.prototype;A=new Request(t,{...x,signal:b,method:r.toUpperCase(),headers:m.normalize().toJSON(),body:n,duplex:"half",credentials:k?g:void 0});let O=await fetch(A,x),j=joe&&(d==="stream"||d==="response");if(joe&&(l||j&&C)){let W={};["status","statusText","headers"].forEach(ae=>{W[ae]=O[ae]});let se=bt.toFiniteNumber(O.headers.get("content-length")),[X,ve]=l&&rN(se,Zw(nN(l),!0))||[];O=new Response(Loe(O.body,Dje,X,()=>{ve&&ve(),C&&C()}),W)}d=d||"text";let M=await sH[bt.findKey(sH,d)||"text"](O,e);return!j&&C&&C(),await new Promise((W,se)=>{Kb(W,se,{data:M,headers:el.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:A})})}catch(k){throw C&&C(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new Cn("Network Error",Cn.ERR_NETWORK,e,A),{cause:k.cause||k}):Cn.from(k,k&&k.code,e,A)}});var Moe={http:Cje,xhr:Tje,fetch:Nje};bt.forEach(Moe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var Fje=e=>`- ${e}`,VKt=e=>bt.isFunction(e)||e===null||e===!1,oH={getAdapter:e=>{e=bt.isArray(e)?e:[e];let{length:t}=e,r,n,a={};for(let s=0;s<t;s++){r=e[s];let c;if(n=r,!VKt(r)&&(n=Moe[(c=String(r)).toLowerCase()],n===void 0))throw new Cn(`Unknown adapter '${c}'`);if(n)break;a[c||"#"+s]=n}if(!n){let s=Object.entries(a).map(([l,f])=>`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build")),c=t?s.length>1?`since :
@@ -531,8 +531,8 @@ ${A.join(`
531
531
  .env
532
532
  .edgeone/*
533
533
  .tef_dist/*
534
- `,t=`${process.cwd()}/.gitignore`;if(!oue.existsSync(t)){oue.writeFileSync(t,e.trim()),ma(".gitignore created!");return}try{if(oue.readFileSync(t,"utf8").includes("# Tencent Cloud EdgeOne")){ma(".gitignore already contains Tencent Cloud EdgeOne configuration, do nothing!");return}Rae(t,e),ma(".gitignore updated!")}catch{Rae(t,e),ma(".gitignore updated!")}}async function Rqe(e){e.command("login","Login to Edgeone",{},async t=>{await ly()?(ma("Login successfully!"),sN("Login Res","Login success"),process.exit()):(ma(`You are already logged in.
535
- If you want to switch user, please run "edgeone switch".`),sN("Login Res","Already logged in "))}),e.command("whoami","Get user information.",{},async t=>{let r=await D0("DescribeUserInfo",{}).catch(c=>{yd("Run whoami command failed.",{message:c.errorMessage,stack:c}),Kr("You are not authenticated. Please run `edgeone login`."),process.exit(1)}),{AppId:n,Uin:a,UserName:s}=r.Data;console.log("Your Tencent Cloud account information:"),(0,Tqe.render)(kqe.default.createElement(Bqe.default,{data:[{Key:"Account Name",Value:s},{Key:"Account ID",Value:a},{Key:"APPID",Value:n}]}))}),e.command("switch","Switch user.",{},async t=>{await Pqe(),DH(),ma("User switch successfully."),process.exit(1)}),e.command("logout","Logout from Edgeone.",{},async t=>{await Dz("eo_token"),await Dz("EDGEONE_PAGES_API_TOKEN"),await Dz("env_vars_pull_prompt"),ma("Logout successfully!")})}var A5e=wr(Hqe()),YH=wr(require("path"));var ltr=wr(require("crypto")),ftr=require("lodash"),Vqe=wr(require("fs")),$qe=wr(require("path"));async function OH(e){var t,r;try{let n=JSON.parse(await Vqe.default.promises.readFile($qe.default.join(e,"package.json"),"utf-8"));return((t=n.dependencies)==null?void 0:t.nuxt)||((r=n.devDependencies)==null?void 0:r.nuxt)||"latest"}catch{return"latest"}}function gue(){return process.env.LANG==="zh_CN.UTF-8"}var po;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(po||(po={}));var yue;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(yue||(yue={}));var Mn=po.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),f2=e=>{switch(typeof e){case"undefined":return Mn.undefined;case"string":return Mn.string;case"number":return isNaN(e)?Mn.nan:Mn.number;case"boolean":return Mn.boolean;case"function":return Mn.function;case"bigint":return Mn.bigint;case"symbol":return Mn.symbol;case"object":return Array.isArray(e)?Mn.array:e===null?Mn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Mn.promise:typeof Map<"u"&&e instanceof Map?Mn.map:typeof Set<"u"&&e instanceof Set?Mn.set:typeof Date<"u"&&e instanceof Date?Mn.date:Mn.object;default:return Mn.unknown}},Yr=po.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),dtr=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ug=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,f=0;for(;f<c.path.length;){let d=c.path[f];f===c.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(c))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return a(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,po.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ug.create=e=>new Ug(e);var dN=(e,t)=>{let r;switch(e.code){case Yr.invalid_type:e.received===Mn.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Yr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,po.jsonStringifyReplacer)}`;break;case Yr.unrecognized_keys:r=`Unrecognized key(s) in object: ${po.joinValues(e.keys,", ")}`;break;case Yr.invalid_union:r="Invalid input";break;case Yr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${po.joinValues(e.options)}`;break;case Yr.invalid_enum_value:r=`Invalid enum value. Expected ${po.joinValues(e.options)}, received '${e.received}'`;break;case Yr.invalid_arguments:r="Invalid function arguments";break;case Yr.invalid_return_type:r="Invalid function return type";break;case Yr.invalid_date:r="Invalid date";break;case Yr.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:po.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Yr.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Yr.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Yr.custom:r="Invalid input";break;case Yr.invalid_intersection_types:r="Intersection results could not be merged";break;case Yr.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Yr.not_finite:r="Number must be finite";break;default:r=t.defaultError,po.assertNever(e)}return{message:r}},Jqe=dN;function htr(e){Jqe=e}function QH(){return Jqe}var LH=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",f=n.filter(d=>!!d).slice().reverse();for(let d of f)l=d(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},mtr=[];function _n(e,t){let r=QH(),n=LH({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===dN?void 0:dN].filter(a=>!!a)});e.common.issues.push(n)}var ch=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return ps;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,c=await a.value;n.push({key:s,value:c})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return ps;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}},ps=Object.freeze({status:"aborted"}),fN=e=>({status:"dirty",value:e}),nm=e=>({status:"valid",value:e}),vue=e=>e.status==="aborted",xue=e=>e.status==="dirty",yT=e=>e.status==="valid",Oj=e=>typeof Promise<"u"&&e instanceof Promise;function jH(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Kqe(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}var mi;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(mi||(mi={}));var Nj,Fj,dy=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Wqe=(e,t)=>{if(yT(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ug(e.common.issues);return this._error=r,this._error}}};function js(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(c,l)=>{var f,d;let{message:m}=e;return c.code==="invalid_enum_value"?{message:m!=null?m:l.defaultError}:typeof l.data>"u"?{message:(f=m!=null?m:n)!==null&&f!==void 0?f:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(d=m!=null?m:r)!==null&&d!==void 0?d:l.defaultError}},description:a}}var Ms=class{get description(){return this._def.description}_getType(t){return f2(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:f2(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ch,ctx:{common:t.parent.common,data:t.data,parsedType:f2(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Oj(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f2(t)},s=this._parseSync({data:t,path:a.path,parent:a});return Wqe(a,s)}"~validate"(t){var r,n;let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f2(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:a});return yT(s)?{value:s.value}:{issues:a.common.issues}}catch(s){!((n=(r=s==null?void 0:s.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(s=>yT(s)?{value:s.value}:{issues:a.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f2(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(Oj(a)?a:Promise.resolve(a));return Wqe(n,s)}refine(t,r){let n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{let c=t(a),l=()=>s.addIssue({code:Yr.custom,...n(a)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new zg({schema:this,typeName:os.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return fy.create(this,this._def)}nullable(){return aE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return h2.create(this)}promise(){return ZC.create(this,this._def)}or(t){return CT.create([this,t],this._def)}and(t){return _T.create(this,t,this._def)}transform(t){return new zg({...js(this._def),schema:this,typeName:os.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new DT({...js(this._def),innerType:this,defaultValue:r,typeName:os.ZodDefault})}brand(){return new Qj({typeName:os.ZodBranded,type:this,...js(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new PT({...js(this._def),innerType:this,catchValue:r,typeName:os.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Lj.create(this,t)}readonly(){return RT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},gtr=/^c[^\s-]{8,}$/i,Atr=/^[0-9a-z]+$/,ytr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vtr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xtr=/^[a-z0-9_-]{21}$/i,btr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Etr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wtr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Str="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Aue,Ctr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_tr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Itr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ktr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ttr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Btr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Xqe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dtr=new RegExp(`^${Xqe}$`);function Zqe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Ptr(e){return new RegExp(`^${Zqe(e)}$`)}function e5e(e){let t=`${Xqe}T${Zqe(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Rtr(e,t){return!!((t==="v4"||!t)&&Ctr.test(e)||(t==="v6"||!t)&&Itr.test(e))}function Ntr(e,t){if(!btr.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||!a.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function Ftr(e,t){return!!((t==="v4"||!t)&&_tr.test(e)||(t==="v6"||!t)&&ktr.test(e))}var KC=class e extends Ms{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Mn.string){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.string,received:s.parsedType}),ps}let n=new ch,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?_n(a,{code:Yr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&_n(a,{code:Yr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")wtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"email",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Aue||(Aue=new RegExp(Str,"u")),Aue.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"emoji",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")vtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"uuid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")xtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"nanoid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")gtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cuid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Atr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cuid2",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ytr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"ulid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),_n(a,{validation:"url",code:Yr.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"regex",code:Yr.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?e5e(s).test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Dtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Ptr(s).test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Etr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"duration",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Rtr(t.data,s.version)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"ip",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Ntr(t.data,s.alg)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"jwt",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Ftr(t.data,s.version)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cidr",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ttr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"base64",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Btr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"base64url",code:Yr.invalid_string,message:s.message}),n.dirty()):po.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:Yr.invalid_string,...mi.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...mi.errToObj(t)})}url(t){return this._addCheck({kind:"url",...mi.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...mi.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...mi.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...mi.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...mi.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...mi.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...mi.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...mi.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...mi.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...mi.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...mi.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...mi.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...mi.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...mi.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...mi.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...mi.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...mi.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...mi.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...mi.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...mi.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...mi.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...mi.errToObj(r)})}nonempty(t){return this.min(1,mi.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};KC.create=e=>{var t;return new KC({checks:[],typeName:os.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...js(e)})};function Otr(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}var vT=class e extends Ms{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Mn.number){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.number,received:s.parsedType}),ps}let n,a=new ch;for(let s of this._def.checks)s.kind==="int"?po.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Otr(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_finite,message:s.message}),a.dirty()):po.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,mi.toString(r))}gt(t,r){return this.setLimit("min",t,!1,mi.toString(r))}lte(t,r){return this.setLimit("max",t,!0,mi.toString(r))}lt(t,r){return this.setLimit("max",t,!1,mi.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:mi.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:mi.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mi.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:mi.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:mi.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:mi.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:mi.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&po.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};vT.create=e=>new vT({checks:[],typeName:os.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...js(e)});var xT=class e extends Ms{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Mn.bigint)return this._getInvalidInput(t);let n,a=new ch;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):po.assertNever(s);return{status:a.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return _n(r,{code:Yr.invalid_type,expected:Mn.bigint,received:r.parsedType}),ps}gte(t,r){return this.setLimit("min",t,!0,mi.toString(r))}gt(t,r){return this.setLimit("min",t,!1,mi.toString(r))}lte(t,r){return this.setLimit("max",t,!0,mi.toString(r))}lt(t,r){return this.setLimit("max",t,!1,mi.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:mi.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:mi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:mi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:mi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:mi.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:mi.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xT.create=e=>{var t;return new xT({checks:[],typeName:os.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...js(e)})};var bT=class extends Ms{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Mn.boolean){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.boolean,received:n.parsedType}),ps}return nm(t.data)}};bT.create=e=>new bT({typeName:os.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...js(e)});var ET=class e extends Ms{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Mn.date){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.date,received:s.parsedType}),ps}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_date}),ps}let n=new ch,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):po.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:mi.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:mi.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};ET.create=e=>new ET({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:os.ZodDate,...js(e)});var hN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.symbol){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.symbol,received:n.parsedType}),ps}return nm(t.data)}};hN.create=e=>new hN({typeName:os.ZodSymbol,...js(e)});var wT=class extends Ms{_parse(t){if(this._getType(t)!==Mn.undefined){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.undefined,received:n.parsedType}),ps}return nm(t.data)}};wT.create=e=>new wT({typeName:os.ZodUndefined,...js(e)});var ST=class extends Ms{_parse(t){if(this._getType(t)!==Mn.null){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.null,received:n.parsedType}),ps}return nm(t.data)}};ST.create=e=>new ST({typeName:os.ZodNull,...js(e)});var XC=class extends Ms{constructor(){super(...arguments),this._any=!0}_parse(t){return nm(t.data)}};XC.create=e=>new XC({typeName:os.ZodAny,...js(e)});var d2=class extends Ms{constructor(){super(...arguments),this._unknown=!0}_parse(t){return nm(t.data)}};d2.create=e=>new d2({typeName:os.ZodUnknown,...js(e)});var tx=class extends Ms{_parse(t){let r=this._getOrReturnCtx(t);return _n(r,{code:Yr.invalid_type,expected:Mn.never,received:r.parsedType}),ps}};tx.create=e=>new tx({typeName:os.ZodNever,...js(e)});var mN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.undefined){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.void,received:n.parsedType}),ps}return nm(t.data)}};mN.create=e=>new mN({typeName:os.ZodVoid,...js(e)});var h2=class e extends Ms{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==Mn.array)return _n(r,{code:Yr.invalid_type,expected:Mn.array,received:r.parsedType}),ps;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(_n(r,{code:c?Yr.too_big:Yr.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(_n(r,{code:Yr.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(_n(r,{code:Yr.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>a.type._parseAsync(new dy(r,c,r.path,l)))).then(c=>ch.mergeArray(n,c));let s=[...r.data].map((c,l)=>a.type._parseSync(new dy(r,c,r.path,l)));return ch.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:mi.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:mi.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:mi.toString(r)}})}nonempty(t){return this.min(1,t)}};h2.create=(e,t)=>new h2({type:e,minLength:null,maxLength:null,exactLength:null,typeName:os.ZodArray,...js(t)});function pN(e){if(e instanceof N0){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=fy.create(pN(n))}return new N0({...e._def,shape:()=>t})}else return e instanceof h2?new h2({...e._def,type:pN(e.element)}):e instanceof fy?fy.create(pN(e.unwrap())):e instanceof aE?aE.create(pN(e.unwrap())):e instanceof sE?sE.create(e.items.map(t=>pN(t))):e}var N0=class e extends Ms{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=po.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Mn.object){let d=this._getOrReturnCtx(t);return _n(d,{code:Yr.invalid_type,expected:Mn.object,received:d.parsedType}),ps}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof tx&&this._def.unknownKeys==="strip"))for(let d in a.data)c.includes(d)||l.push(d);let f=[];for(let d of c){let m=s[d],g=a.data[d];f.push({key:{status:"valid",value:d},value:m._parse(new dy(a,g,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof tx){let d=this._def.unknownKeys;if(d==="passthrough")for(let m of l)f.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(d==="strict")l.length>0&&(_n(a,{code:Yr.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let m of l){let g=a.data[m];f.push({key:{status:"valid",value:m},value:d._parse(new dy(a,g,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let m of f){let g=await m.key,x=await m.value;d.push({key:g,value:x,alwaysSet:m.alwaysSet})}return d}).then(d=>ch.mergeObjectSync(n,d)):ch.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return mi.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let f=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=mi.errToObj(t).message)!==null&&l!==void 0?l:f}:{message:f}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:os.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return po.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return po.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return pN(this)}partial(t){let r={};return po.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return po.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof fy;)s=s._def.innerType;r[n]=s}}),new e({...this._def,shape:()=>r})}keyof(){return t5e(po.objectKeys(this.shape))}};N0.create=(e,t)=>new N0({shape:()=>e,unknownKeys:"strip",catchall:tx.create(),typeName:os.ZodObject,...js(t)});N0.strictCreate=(e,t)=>new N0({shape:()=>e,unknownKeys:"strict",catchall:tx.create(),typeName:os.ZodObject,...js(t)});N0.lazycreate=(e,t)=>new N0({shape:e,unknownKeys:"strip",catchall:tx.create(),typeName:os.ZodObject,...js(t)});var CT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new Ug(l.ctx.common.issues));return _n(r,{code:Yr.invalid_union,unionErrors:c}),ps}if(r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let f of n){let d={...r,common:{...r.common,issues:[]},parent:null},m=f._parseSync({data:r.data,path:r.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(f=>new Ug(f));return _n(r,{code:Yr.invalid_union,unionErrors:l}),ps}}get options(){return this._def.options}};CT.create=(e,t)=>new CT({options:e,typeName:os.ZodUnion,...js(t)});var p2=e=>e instanceof IT?p2(e.schema):e instanceof zg?p2(e.innerType()):e instanceof kT?[e.value]:e instanceof TT?e.options:e instanceof BT?po.objectValues(e.enum):e instanceof DT?p2(e._def.innerType):e instanceof wT?[void 0]:e instanceof ST?[null]:e instanceof fy?[void 0,...p2(e.unwrap())]:e instanceof aE?[null,...p2(e.unwrap())]:e instanceof Qj||e instanceof RT?p2(e.unwrap()):e instanceof PT?p2(e._def.innerType):[],MH=class e extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.object)return _n(r,{code:Yr.invalid_type,expected:Mn.object,received:r.parsedType}),ps;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(_n(r,{code:Yr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ps)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let c=p2(s.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of c){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new e({typeName:os.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...js(n)})}};function bue(e,t){let r=f2(e),n=f2(t);if(e===t)return{valid:!0,data:e};if(r===Mn.object&&n===Mn.object){let a=po.objectKeys(t),s=po.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let f=bue(e[l],t[l]);if(!f.valid)return{valid:!1};c[l]=f.data}return{valid:!0,data:c}}else if(r===Mn.array&&n===Mn.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],f=bue(c,l);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return r===Mn.date&&n===Mn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var _T=class extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(s,c)=>{if(vue(s)||vue(c))return ps;let l=bue(s.value,c.value);return l.valid?((xue(s)||xue(c))&&r.dirty(),{status:r.value,value:l.data}):(_n(n,{code:Yr.invalid_intersection_types}),ps)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>a(s,c)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};_T.create=(e,t,r)=>new _T({left:e,right:t,typeName:os.ZodIntersection,...js(r)});var sE=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.array)return _n(n,{code:Yr.invalid_type,expected:Mn.array,received:n.parsedType}),ps;if(n.data.length<this._def.items.length)return _n(n,{code:Yr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ps;!this._def.rest&&n.data.length>this._def.items.length&&(_n(n,{code:Yr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((c,l)=>{let f=this._def.items[l]||this._def.rest;return f?f._parse(new dy(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>ch.mergeArray(r,c)):ch.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};sE.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sE({items:e,typeName:os.ZodTuple,rest:null,...js(t)})};var qH=class e extends Ms{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.object)return _n(n,{code:Yr.invalid_type,expected:Mn.object,received:n.parsedType}),ps;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new dy(n,l,n.path,l)),value:c._parse(new dy(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?ch.mergeObjectAsync(r,a):ch.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ms?new e({keyType:t,valueType:r,typeName:os.ZodRecord,...js(n)}):new e({keyType:KC.create(),valueType:t,typeName:os.ZodRecord,...js(r)})}},gN=class extends Ms{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.map)return _n(n,{code:Yr.invalid_type,expected:Mn.map,received:n.parsedType}),ps;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,f],d)=>({key:a._parse(new dy(n,l,n.path,[d,"key"])),value:s._parse(new dy(n,f,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let f of c){let d=await f.key,m=await f.value;if(d.status==="aborted"||m.status==="aborted")return ps;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),l.set(d.value,m.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let f of c){let d=f.key,m=f.value;if(d.status==="aborted"||m.status==="aborted")return ps;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),l.set(d.value,m.value)}return{status:r.value,value:l}}}};gN.create=(e,t,r)=>new gN({valueType:t,keyType:e,typeName:os.ZodMap,...js(r)});var AN=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.set)return _n(n,{code:Yr.invalid_type,expected:Mn.set,received:n.parsedType}),ps;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(_n(n,{code:Yr.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(_n(n,{code:Yr.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(f){let d=new Set;for(let m of f){if(m.status==="aborted")return ps;m.status==="dirty"&&r.dirty(),d.add(m.value)}return{status:r.value,value:d}}let l=[...n.data.values()].map((f,d)=>s._parse(new dy(n,f,n.path,d)));return n.common.async?Promise.all(l).then(f=>c(f)):c(l)}min(t,r){return new e({...this._def,minSize:{value:t,message:mi.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:mi.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};AN.create=(e,t)=>new AN({valueType:e,minSize:null,maxSize:null,typeName:os.ZodSet,...js(t)});var UH=class e extends Ms{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.function)return _n(r,{code:Yr.invalid_type,expected:Mn.function,received:r.parsedType}),ps;function n(l,f){return LH({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,QH(),dN].filter(d=>!!d),issueData:{code:Yr.invalid_arguments,argumentsError:f}})}function a(l,f){return LH({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,QH(),dN].filter(d=>!!d),issueData:{code:Yr.invalid_return_type,returnTypeError:f}})}let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof ZC){let l=this;return nm(async function(...f){let d=new Ug([]),m=await l._def.args.parseAsync(f,s).catch(b=>{throw d.addIssue(n(f,b)),d}),g=await Reflect.apply(c,this,m);return await l._def.returns._def.type.parseAsync(g,s).catch(b=>{throw d.addIssue(a(g,b)),d})})}else{let l=this;return nm(function(...f){let d=l._def.args.safeParse(f,s);if(!d.success)throw new Ug([n(f,d.error)]);let m=Reflect.apply(c,this,d.data),g=l._def.returns.safeParse(m,s);if(!g.success)throw new Ug([a(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:sE.create(t).rest(d2.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||sE.create([]).rest(d2.create()),returns:r||d2.create(),typeName:os.ZodFunction,...js(n)})}},IT=class extends Ms{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};IT.create=(e,t)=>new IT({getter:e,typeName:os.ZodLazy,...js(t)});var kT=class extends Ms{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return _n(r,{received:r.data,code:Yr.invalid_literal,expected:this._def.value}),ps}return{status:"valid",value:t.data}}get value(){return this._def.value}};kT.create=(e,t)=>new kT({value:e,typeName:os.ZodLiteral,...js(t)});function t5e(e,t){return new TT({values:e,typeName:os.ZodEnum,...js(t)})}var TT=class e extends Ms{constructor(){super(...arguments),Nj.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return _n(r,{expected:po.joinValues(n),received:r.parsedType,code:Yr.invalid_type}),ps}if(jH(this,Nj,"f")||Kqe(this,Nj,new Set(this._def.values),"f"),!jH(this,Nj,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return _n(r,{received:r.data,code:Yr.invalid_enum_value,options:n}),ps}return nm(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Nj=new WeakMap;TT.create=t5e;var BT=class extends Ms{constructor(){super(...arguments),Fj.set(this,void 0)}_parse(t){let r=po.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Mn.string&&n.parsedType!==Mn.number){let a=po.objectValues(r);return _n(n,{expected:po.joinValues(a),received:n.parsedType,code:Yr.invalid_type}),ps}if(jH(this,Fj,"f")||Kqe(this,Fj,new Set(po.getValidEnumValues(this._def.values)),"f"),!jH(this,Fj,"f").has(t.data)){let a=po.objectValues(r);return _n(n,{received:n.data,code:Yr.invalid_enum_value,options:a}),ps}return nm(t.data)}get enum(){return this._def.values}};Fj=new WeakMap;BT.create=(e,t)=>new BT({values:e,typeName:os.ZodNativeEnum,...js(t)});var ZC=class extends Ms{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.promise&&r.common.async===!1)return _n(r,{code:Yr.invalid_type,expected:Mn.promise,received:r.parsedType}),ps;let n=r.parsedType===Mn.promise?r.data:Promise.resolve(r.data);return nm(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ZC.create=(e,t)=>new ZC({type:e,typeName:os.ZodPromise,...js(t)});var zg=class extends Ms{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===os.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:c=>{_n(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let c=a.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return ps;let f=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return f.status==="aborted"?ps:f.status==="dirty"||r.value==="dirty"?fN(f.value):f});{if(r.value==="aborted")return ps;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?ps:l.status==="dirty"||r.value==="dirty"?fN(l.value):l}}if(a.type==="refinement"){let c=l=>{let f=a.refinement(l,s);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?ps:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?ps:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yT(c))return c;let l=a.transform(c.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>yT(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);po.assertNever(a)}};zg.create=(e,t,r)=>new zg({schema:e,typeName:os.ZodEffects,effect:t,...js(r)});zg.createWithPreprocess=(e,t,r)=>new zg({schema:t,effect:{type:"preprocess",transform:e},typeName:os.ZodEffects,...js(r)});var fy=class extends Ms{_parse(t){return this._getType(t)===Mn.undefined?nm(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};fy.create=(e,t)=>new fy({innerType:e,typeName:os.ZodOptional,...js(t)});var aE=class extends Ms{_parse(t){return this._getType(t)===Mn.null?nm(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};aE.create=(e,t)=>new aE({innerType:e,typeName:os.ZodNullable,...js(t)});var DT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Mn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};DT.create=(e,t)=>new DT({innerType:e,typeName:os.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...js(t)});var PT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Oj(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ug(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ug(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};PT.create=(e,t)=>new PT({innerType:e,typeName:os.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...js(t)});var yN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.nan){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.nan,received:n.parsedType}),ps}return{status:"valid",value:t.data}}};yN.create=e=>new yN({typeName:os.ZodNaN,...js(e)});var Qtr=Symbol("zod_brand"),Qj=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Lj=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ps:s.status==="dirty"?(r.dirty(),fN(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ps:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:os.ZodPipeline})}},RT=class extends Ms{_parse(t){let r=this._def.innerType._parse(t),n=a=>(yT(a)&&(a.value=Object.freeze(a.value)),a);return Oj(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};RT.create=(e,t)=>new RT({innerType:e,typeName:os.ZodReadonly,...js(t)});function Gqe(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function r5e(e,t={},r){return e?XC.create().superRefine((n,a)=>{var s,c;let l=e(n);if(l instanceof Promise)return l.then(f=>{var d,m;if(!f){let g=Gqe(t,n),x=(m=(d=g.fatal)!==null&&d!==void 0?d:r)!==null&&m!==void 0?m:!0;a.addIssue({code:"custom",...g,fatal:x})}});if(!l){let f=Gqe(t,n),d=(c=(s=f.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0;a.addIssue({code:"custom",...f,fatal:d})}}):XC.create()}var Ltr={object:N0.lazycreate},os;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(os||(os={}));var jtr=(e,t={message:`Input not instance of ${e.name}`})=>r5e(r=>r instanceof e,t),n5e=KC.create,i5e=vT.create,Mtr=yN.create,qtr=xT.create,s5e=bT.create,Utr=ET.create,ztr=hN.create,Htr=wT.create,Vtr=ST.create,$tr=XC.create,Wtr=d2.create,Gtr=tx.create,Ytr=mN.create,Jtr=h2.create,Ktr=N0.create,Xtr=N0.strictCreate,Ztr=CT.create,trr=MH.create,rrr=_T.create,nrr=sE.create,irr=qH.create,srr=gN.create,arr=AN.create,orr=UH.create,crr=IT.create,urr=kT.create,lrr=TT.create,prr=BT.create,frr=ZC.create,Yqe=zg.create,drr=fy.create,hrr=aE.create,mrr=zg.createWithPreprocess,grr=Lj.create,Arr=()=>n5e().optional(),yrr=()=>i5e().optional(),vrr=()=>s5e().optional(),xrr={string:e=>KC.create({...e,coerce:!0}),number:e=>vT.create({...e,coerce:!0}),boolean:e=>bT.create({...e,coerce:!0}),bigint:e=>xT.create({...e,coerce:!0}),date:e=>ET.create({...e,coerce:!0})},brr=ps,Or=Object.freeze({__proto__:null,defaultErrorMap:dN,setErrorMap:htr,getErrorMap:QH,makeIssue:LH,EMPTY_PATH:mtr,addIssueToContext:_n,ParseStatus:ch,INVALID:ps,DIRTY:fN,OK:nm,isAborted:vue,isDirty:xue,isValid:yT,isAsync:Oj,get util(){return po},get objectUtil(){return yue},ZodParsedType:Mn,getParsedType:f2,ZodType:Ms,datetimeRegex:e5e,ZodString:KC,ZodNumber:vT,ZodBigInt:xT,ZodBoolean:bT,ZodDate:ET,ZodSymbol:hN,ZodUndefined:wT,ZodNull:ST,ZodAny:XC,ZodUnknown:d2,ZodNever:tx,ZodVoid:mN,ZodArray:h2,ZodObject:N0,ZodUnion:CT,ZodDiscriminatedUnion:MH,ZodIntersection:_T,ZodTuple:sE,ZodRecord:qH,ZodMap:gN,ZodSet:AN,ZodFunction:UH,ZodLazy:IT,ZodLiteral:kT,ZodEnum:TT,ZodNativeEnum:BT,ZodPromise:ZC,ZodEffects:zg,ZodTransformer:zg,ZodOptional:fy,ZodNullable:aE,ZodDefault:DT,ZodCatch:PT,ZodNaN:yN,BRAND:Qtr,ZodBranded:Qj,ZodPipeline:Lj,ZodReadonly:RT,custom:r5e,Schema:Ms,ZodSchema:Ms,late:Ltr,get ZodFirstPartyTypeKind(){return os},coerce:xrr,any:$tr,array:Jtr,bigint:qtr,boolean:s5e,date:Utr,discriminatedUnion:trr,effect:Yqe,enum:lrr,function:orr,instanceof:jtr,intersection:rrr,lazy:crr,literal:urr,map:srr,nan:Mtr,nativeEnum:prr,never:Gtr,null:Vtr,nullable:hrr,number:i5e,object:Ktr,oboolean:vrr,onumber:yrr,optional:drr,ostring:Arr,pipeline:grr,preprocess:mrr,promise:frr,record:irr,set:arr,strictObject:Xtr,string:n5e,symbol:ztr,transformer:Yqe,tuple:nrr,undefined:Htr,union:Ztr,unknown:Wtr,void:Ytr,NEVER:brr,ZodIssueCode:Yr,quotelessJson:dtr,ZodError:Ug});var UJn=Or.object({monitor:Or.array(Or.string()).optional(),command:Or.string().optional(),cwd:Or.string().optional(),target_file:Or.string()}),Err=Or.object({assets_dir:Or.string().optional(),proxy_path:Or.string().optional()}),zJn=Or.object({port:Or.union([Or.number(),Or.string()]).optional(),origin:Or.string().optional(),timeout:Or.union([Or.number(),Or.string()]).optional(),sandbox:Or.boolean().optional(),favicon:Or.boolean().optional(),minify:Or.boolean().optional(),site:Err.optional()}),wrr=Or.object({target:Or.string(),operator:Or.union([Or.literal("equal"),Or.literal("notequal")]),values:Or.array(Or.string())}),Srr=Or.object({condition:Or.array(wrr)}),HJn=Or.object({minify:Or.boolean().optional(),rule:Or.array(Srr).optional()}),Crr=Or.object({maxDuration:Or.number().optional()}),VJn=Or.object({type:Or.enum(["header","cookie","host","query"]),key:Or.string(),value:Or.string().optional()}),Sue=(e,t)=>{var a;let r=e.replace(/\\([?*])/g,"$1");return r.length===0?t.addIssue({code:Or.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(r)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):((a=r.match(/\*/g))==null?void 0:a.length)>1?t.addIssue({code:Or.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(r)||/:(?![a-zA-Z0-9]+)/.test(r)?t.addIssue({code:Or.ZodIssueCode.custom,message:": match error"}):!0},HH=Or.object({source:Or.string().superRefine(Sue)});function _rr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),a=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(a==="stale-while-revalidate"||a==="stale-if-error"){let s=`${a}=86400`;if(n===-1)return`value match error: Cache-Control directive "${a}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`value match error: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}var Irr=Or.object({key:Or.string().min(1).max(100).superRefine((e,t)=>/[^a-zA-Z0-9-]/.test(e)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):!0),value:Or.string().min(1).max(1e3).superRefine((e,t)=>/[\u4e00-\u9fa5]/.test(e)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((e,t)=>{if(e.key.toLowerCase()==="cache-control"){let r=_rr(e.value);r&&t.addIssue({code:Or.ZodIssueCode.custom,path:["value"],message:r})}}),krr=Irr.array().min(1),Trr=HH.merge(Or.object({headers:krr})).array(),Brr=Or.union([Or.literal(307),Or.literal(301),Or.literal(302),Or.literal(308),Or.literal(303),Or.literal(304)]),Drr=HH.merge(Or.object({destination:Or.string().superRefine(Sue),permanent:Or.boolean().optional(),statusCode:Brr.optional()})).array();var Prr=HH.merge(Or.object({destination:Or.string().superRefine(Sue)})).array(),Rrr=HH.merge(Or.object({cacheTtl:Or.number()})).array(),a5e=Or.object({included_files:Or.array(Or.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:Or.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:Or.array(Or.string()).optional().describe("Node modules to be treated as external dependencies")}),o5e=Or.object({$schema:Or.string().transform(e=>"").optional(),outputDirectory:Or.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:Or.string().optional().describe("the install command to run."),buildCommand:Or.string().optional().describe("the build command to run."),nodeVersion:Or.string().optional().describe("the node version to use."),nodeFunctionsConfig:Crr.optional(),headers:Trr.optional(),redirects:Drr.optional(),rewrites:Prr.optional(),caches:Rrr.optional(),"node-functions":a5e.optional().describe("Node function specific configuration"),"edge-functions":a5e.optional().describe("Edge function specific configuration")}),Eue=Symbol("filteredSchema"),zH=Symbol("symFilteredValue"),c5e=wue(o5e);function Nrr(e){return e.errors.map(t=>`${t.message}`).join(`
534
+ `,t=`${process.cwd()}/.gitignore`;if(!oue.existsSync(t)){oue.writeFileSync(t,e.trim()),da(".gitignore created!");return}try{if(oue.readFileSync(t,"utf8").includes("# Tencent Cloud EdgeOne")){da(".gitignore already contains Tencent Cloud EdgeOne configuration, do nothing!");return}Rae(t,e),da(".gitignore updated!")}catch{Rae(t,e),da(".gitignore updated!")}}async function Rqe(e){e.command("login","Login to Edgeone",{},async t=>{await ly()?(da("Login successfully!"),sN("Login Res","Login success"),process.exit()):(da(`You are already logged in.
535
+ If you want to switch user, please run "edgeone switch".`),sN("Login Res","Already logged in "))}),e.command("whoami","Get user information.",{},async t=>{let r=await D0("DescribeUserInfo",{}).catch(c=>{yd("Run whoami command failed.",{message:c.errorMessage,stack:c}),Kr("You are not authenticated. Please run `edgeone login`."),process.exit(1)}),{AppId:n,Uin:a,UserName:s}=r.Data;console.log("Your Tencent Cloud account information:"),(0,Tqe.render)(kqe.default.createElement(Bqe.default,{data:[{Key:"Account Name",Value:s},{Key:"Account ID",Value:a},{Key:"APPID",Value:n}]}))}),e.command("switch","Switch user.",{},async t=>{await Pqe(),DH(),da("User switch successfully."),process.exit(1)}),e.command("logout","Logout from Edgeone.",{},async t=>{await Dz("eo_token"),await Dz("EDGEONE_PAGES_API_TOKEN"),await Dz("env_vars_pull_prompt"),da("Logout successfully!")})}var A5e=wr(Hqe()),YH=wr(require("path"));var ltr=wr(require("crypto")),ftr=require("lodash"),Vqe=wr(require("fs")),$qe=wr(require("path"));async function OH(e){var t,r;try{let n=JSON.parse(await Vqe.default.promises.readFile($qe.default.join(e,"package.json"),"utf-8"));return((t=n.dependencies)==null?void 0:t.nuxt)||((r=n.devDependencies)==null?void 0:r.nuxt)||"latest"}catch{return"latest"}}function gue(){return process.env.LANG==="zh_CN.UTF-8"}var po;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(po||(po={}));var yue;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(yue||(yue={}));var Mn=po.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),f2=e=>{switch(typeof e){case"undefined":return Mn.undefined;case"string":return Mn.string;case"number":return isNaN(e)?Mn.nan:Mn.number;case"boolean":return Mn.boolean;case"function":return Mn.function;case"bigint":return Mn.bigint;case"symbol":return Mn.symbol;case"object":return Array.isArray(e)?Mn.array:e===null?Mn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Mn.promise:typeof Map<"u"&&e instanceof Map?Mn.map:typeof Set<"u"&&e instanceof Set?Mn.set:typeof Date<"u"&&e instanceof Date?Mn.date:Mn.object;default:return Mn.unknown}},Yr=po.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),dtr=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ug=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,f=0;for(;f<c.path.length;){let d=c.path[f];f===c.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(c))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return a(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,po.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ug.create=e=>new Ug(e);var dN=(e,t)=>{let r;switch(e.code){case Yr.invalid_type:e.received===Mn.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Yr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,po.jsonStringifyReplacer)}`;break;case Yr.unrecognized_keys:r=`Unrecognized key(s) in object: ${po.joinValues(e.keys,", ")}`;break;case Yr.invalid_union:r="Invalid input";break;case Yr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${po.joinValues(e.options)}`;break;case Yr.invalid_enum_value:r=`Invalid enum value. Expected ${po.joinValues(e.options)}, received '${e.received}'`;break;case Yr.invalid_arguments:r="Invalid function arguments";break;case Yr.invalid_return_type:r="Invalid function return type";break;case Yr.invalid_date:r="Invalid date";break;case Yr.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:po.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Yr.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Yr.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Yr.custom:r="Invalid input";break;case Yr.invalid_intersection_types:r="Intersection results could not be merged";break;case Yr.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Yr.not_finite:r="Number must be finite";break;default:r=t.defaultError,po.assertNever(e)}return{message:r}},Jqe=dN;function htr(e){Jqe=e}function QH(){return Jqe}var LH=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",f=n.filter(d=>!!d).slice().reverse();for(let d of f)l=d(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},mtr=[];function _n(e,t){let r=QH(),n=LH({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===dN?void 0:dN].filter(a=>!!a)});e.common.issues.push(n)}var ch=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return ps;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,c=await a.value;n.push({key:s,value:c})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return ps;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}},ps=Object.freeze({status:"aborted"}),fN=e=>({status:"dirty",value:e}),nm=e=>({status:"valid",value:e}),vue=e=>e.status==="aborted",xue=e=>e.status==="dirty",yT=e=>e.status==="valid",Oj=e=>typeof Promise<"u"&&e instanceof Promise;function jH(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Kqe(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}var mi;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(mi||(mi={}));var Nj,Fj,dy=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Wqe=(e,t)=>{if(yT(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ug(e.common.issues);return this._error=r,this._error}}};function js(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(c,l)=>{var f,d;let{message:m}=e;return c.code==="invalid_enum_value"?{message:m!=null?m:l.defaultError}:typeof l.data>"u"?{message:(f=m!=null?m:n)!==null&&f!==void 0?f:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(d=m!=null?m:r)!==null&&d!==void 0?d:l.defaultError}},description:a}}var Ms=class{get description(){return this._def.description}_getType(t){return f2(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:f2(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ch,ctx:{common:t.parent.common,data:t.data,parsedType:f2(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Oj(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f2(t)},s=this._parseSync({data:t,path:a.path,parent:a});return Wqe(a,s)}"~validate"(t){var r,n;let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f2(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:a});return yT(s)?{value:s.value}:{issues:a.common.issues}}catch(s){!((n=(r=s==null?void 0:s.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(s=>yT(s)?{value:s.value}:{issues:a.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f2(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(Oj(a)?a:Promise.resolve(a));return Wqe(n,s)}refine(t,r){let n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{let c=t(a),l=()=>s.addIssue({code:Yr.custom,...n(a)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new zg({schema:this,typeName:os.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return fy.create(this,this._def)}nullable(){return aE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return h2.create(this)}promise(){return ZC.create(this,this._def)}or(t){return CT.create([this,t],this._def)}and(t){return _T.create(this,t,this._def)}transform(t){return new zg({...js(this._def),schema:this,typeName:os.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new DT({...js(this._def),innerType:this,defaultValue:r,typeName:os.ZodDefault})}brand(){return new Qj({typeName:os.ZodBranded,type:this,...js(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new PT({...js(this._def),innerType:this,catchValue:r,typeName:os.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Lj.create(this,t)}readonly(){return RT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},gtr=/^c[^\s-]{8,}$/i,Atr=/^[0-9a-z]+$/,ytr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vtr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xtr=/^[a-z0-9_-]{21}$/i,btr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Etr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wtr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Str="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Aue,Ctr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_tr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Itr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ktr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ttr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Btr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Xqe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dtr=new RegExp(`^${Xqe}$`);function Zqe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Ptr(e){return new RegExp(`^${Zqe(e)}$`)}function e5e(e){let t=`${Xqe}T${Zqe(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Rtr(e,t){return!!((t==="v4"||!t)&&Ctr.test(e)||(t==="v6"||!t)&&Itr.test(e))}function Ntr(e,t){if(!btr.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||!a.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function Ftr(e,t){return!!((t==="v4"||!t)&&_tr.test(e)||(t==="v6"||!t)&&ktr.test(e))}var KC=class e extends Ms{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Mn.string){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.string,received:s.parsedType}),ps}let n=new ch,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?_n(a,{code:Yr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&_n(a,{code:Yr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")wtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"email",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Aue||(Aue=new RegExp(Str,"u")),Aue.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"emoji",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")vtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"uuid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")xtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"nanoid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")gtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cuid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Atr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cuid2",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ytr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"ulid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),_n(a,{validation:"url",code:Yr.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"regex",code:Yr.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?e5e(s).test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Dtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Ptr(s).test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Etr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"duration",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Rtr(t.data,s.version)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"ip",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Ntr(t.data,s.alg)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"jwt",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Ftr(t.data,s.version)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cidr",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ttr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"base64",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Btr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"base64url",code:Yr.invalid_string,message:s.message}),n.dirty()):po.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:Yr.invalid_string,...mi.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...mi.errToObj(t)})}url(t){return this._addCheck({kind:"url",...mi.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...mi.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...mi.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...mi.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...mi.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...mi.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...mi.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...mi.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...mi.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...mi.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...mi.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...mi.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...mi.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...mi.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...mi.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...mi.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...mi.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...mi.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...mi.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...mi.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...mi.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...mi.errToObj(r)})}nonempty(t){return this.min(1,mi.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};KC.create=e=>{var t;return new KC({checks:[],typeName:os.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...js(e)})};function Otr(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}var vT=class e extends Ms{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Mn.number){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.number,received:s.parsedType}),ps}let n,a=new ch;for(let s of this._def.checks)s.kind==="int"?po.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Otr(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_finite,message:s.message}),a.dirty()):po.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,mi.toString(r))}gt(t,r){return this.setLimit("min",t,!1,mi.toString(r))}lte(t,r){return this.setLimit("max",t,!0,mi.toString(r))}lt(t,r){return this.setLimit("max",t,!1,mi.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:mi.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:mi.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mi.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:mi.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:mi.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:mi.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:mi.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&po.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};vT.create=e=>new vT({checks:[],typeName:os.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...js(e)});var xT=class e extends Ms{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Mn.bigint)return this._getInvalidInput(t);let n,a=new ch;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):po.assertNever(s);return{status:a.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return _n(r,{code:Yr.invalid_type,expected:Mn.bigint,received:r.parsedType}),ps}gte(t,r){return this.setLimit("min",t,!0,mi.toString(r))}gt(t,r){return this.setLimit("min",t,!1,mi.toString(r))}lte(t,r){return this.setLimit("max",t,!0,mi.toString(r))}lt(t,r){return this.setLimit("max",t,!1,mi.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:mi.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:mi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:mi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:mi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:mi.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:mi.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xT.create=e=>{var t;return new xT({checks:[],typeName:os.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...js(e)})};var bT=class extends Ms{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Mn.boolean){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.boolean,received:n.parsedType}),ps}return nm(t.data)}};bT.create=e=>new bT({typeName:os.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...js(e)});var ET=class e extends Ms{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Mn.date){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.date,received:s.parsedType}),ps}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_date}),ps}let n=new ch,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):po.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:mi.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:mi.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};ET.create=e=>new ET({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:os.ZodDate,...js(e)});var hN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.symbol){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.symbol,received:n.parsedType}),ps}return nm(t.data)}};hN.create=e=>new hN({typeName:os.ZodSymbol,...js(e)});var wT=class extends Ms{_parse(t){if(this._getType(t)!==Mn.undefined){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.undefined,received:n.parsedType}),ps}return nm(t.data)}};wT.create=e=>new wT({typeName:os.ZodUndefined,...js(e)});var ST=class extends Ms{_parse(t){if(this._getType(t)!==Mn.null){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.null,received:n.parsedType}),ps}return nm(t.data)}};ST.create=e=>new ST({typeName:os.ZodNull,...js(e)});var XC=class extends Ms{constructor(){super(...arguments),this._any=!0}_parse(t){return nm(t.data)}};XC.create=e=>new XC({typeName:os.ZodAny,...js(e)});var d2=class extends Ms{constructor(){super(...arguments),this._unknown=!0}_parse(t){return nm(t.data)}};d2.create=e=>new d2({typeName:os.ZodUnknown,...js(e)});var tx=class extends Ms{_parse(t){let r=this._getOrReturnCtx(t);return _n(r,{code:Yr.invalid_type,expected:Mn.never,received:r.parsedType}),ps}};tx.create=e=>new tx({typeName:os.ZodNever,...js(e)});var mN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.undefined){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.void,received:n.parsedType}),ps}return nm(t.data)}};mN.create=e=>new mN({typeName:os.ZodVoid,...js(e)});var h2=class e extends Ms{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==Mn.array)return _n(r,{code:Yr.invalid_type,expected:Mn.array,received:r.parsedType}),ps;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(_n(r,{code:c?Yr.too_big:Yr.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(_n(r,{code:Yr.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(_n(r,{code:Yr.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>a.type._parseAsync(new dy(r,c,r.path,l)))).then(c=>ch.mergeArray(n,c));let s=[...r.data].map((c,l)=>a.type._parseSync(new dy(r,c,r.path,l)));return ch.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:mi.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:mi.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:mi.toString(r)}})}nonempty(t){return this.min(1,t)}};h2.create=(e,t)=>new h2({type:e,minLength:null,maxLength:null,exactLength:null,typeName:os.ZodArray,...js(t)});function pN(e){if(e instanceof N0){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=fy.create(pN(n))}return new N0({...e._def,shape:()=>t})}else return e instanceof h2?new h2({...e._def,type:pN(e.element)}):e instanceof fy?fy.create(pN(e.unwrap())):e instanceof aE?aE.create(pN(e.unwrap())):e instanceof sE?sE.create(e.items.map(t=>pN(t))):e}var N0=class e extends Ms{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=po.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Mn.object){let d=this._getOrReturnCtx(t);return _n(d,{code:Yr.invalid_type,expected:Mn.object,received:d.parsedType}),ps}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof tx&&this._def.unknownKeys==="strip"))for(let d in a.data)c.includes(d)||l.push(d);let f=[];for(let d of c){let m=s[d],g=a.data[d];f.push({key:{status:"valid",value:d},value:m._parse(new dy(a,g,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof tx){let d=this._def.unknownKeys;if(d==="passthrough")for(let m of l)f.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(d==="strict")l.length>0&&(_n(a,{code:Yr.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let m of l){let g=a.data[m];f.push({key:{status:"valid",value:m},value:d._parse(new dy(a,g,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let m of f){let g=await m.key,x=await m.value;d.push({key:g,value:x,alwaysSet:m.alwaysSet})}return d}).then(d=>ch.mergeObjectSync(n,d)):ch.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return mi.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let f=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=mi.errToObj(t).message)!==null&&l!==void 0?l:f}:{message:f}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:os.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return po.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return po.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return pN(this)}partial(t){let r={};return po.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return po.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof fy;)s=s._def.innerType;r[n]=s}}),new e({...this._def,shape:()=>r})}keyof(){return t5e(po.objectKeys(this.shape))}};N0.create=(e,t)=>new N0({shape:()=>e,unknownKeys:"strip",catchall:tx.create(),typeName:os.ZodObject,...js(t)});N0.strictCreate=(e,t)=>new N0({shape:()=>e,unknownKeys:"strict",catchall:tx.create(),typeName:os.ZodObject,...js(t)});N0.lazycreate=(e,t)=>new N0({shape:e,unknownKeys:"strip",catchall:tx.create(),typeName:os.ZodObject,...js(t)});var CT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new Ug(l.ctx.common.issues));return _n(r,{code:Yr.invalid_union,unionErrors:c}),ps}if(r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let f of n){let d={...r,common:{...r.common,issues:[]},parent:null},m=f._parseSync({data:r.data,path:r.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(f=>new Ug(f));return _n(r,{code:Yr.invalid_union,unionErrors:l}),ps}}get options(){return this._def.options}};CT.create=(e,t)=>new CT({options:e,typeName:os.ZodUnion,...js(t)});var p2=e=>e instanceof IT?p2(e.schema):e instanceof zg?p2(e.innerType()):e instanceof kT?[e.value]:e instanceof TT?e.options:e instanceof BT?po.objectValues(e.enum):e instanceof DT?p2(e._def.innerType):e instanceof wT?[void 0]:e instanceof ST?[null]:e instanceof fy?[void 0,...p2(e.unwrap())]:e instanceof aE?[null,...p2(e.unwrap())]:e instanceof Qj||e instanceof RT?p2(e.unwrap()):e instanceof PT?p2(e._def.innerType):[],MH=class e extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.object)return _n(r,{code:Yr.invalid_type,expected:Mn.object,received:r.parsedType}),ps;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(_n(r,{code:Yr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ps)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let c=p2(s.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of c){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new e({typeName:os.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...js(n)})}};function bue(e,t){let r=f2(e),n=f2(t);if(e===t)return{valid:!0,data:e};if(r===Mn.object&&n===Mn.object){let a=po.objectKeys(t),s=po.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let f=bue(e[l],t[l]);if(!f.valid)return{valid:!1};c[l]=f.data}return{valid:!0,data:c}}else if(r===Mn.array&&n===Mn.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],f=bue(c,l);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return r===Mn.date&&n===Mn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var _T=class extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(s,c)=>{if(vue(s)||vue(c))return ps;let l=bue(s.value,c.value);return l.valid?((xue(s)||xue(c))&&r.dirty(),{status:r.value,value:l.data}):(_n(n,{code:Yr.invalid_intersection_types}),ps)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>a(s,c)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};_T.create=(e,t,r)=>new _T({left:e,right:t,typeName:os.ZodIntersection,...js(r)});var sE=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.array)return _n(n,{code:Yr.invalid_type,expected:Mn.array,received:n.parsedType}),ps;if(n.data.length<this._def.items.length)return _n(n,{code:Yr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ps;!this._def.rest&&n.data.length>this._def.items.length&&(_n(n,{code:Yr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((c,l)=>{let f=this._def.items[l]||this._def.rest;return f?f._parse(new dy(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>ch.mergeArray(r,c)):ch.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};sE.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sE({items:e,typeName:os.ZodTuple,rest:null,...js(t)})};var qH=class e extends Ms{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.object)return _n(n,{code:Yr.invalid_type,expected:Mn.object,received:n.parsedType}),ps;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new dy(n,l,n.path,l)),value:c._parse(new dy(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?ch.mergeObjectAsync(r,a):ch.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ms?new e({keyType:t,valueType:r,typeName:os.ZodRecord,...js(n)}):new e({keyType:KC.create(),valueType:t,typeName:os.ZodRecord,...js(r)})}},gN=class extends Ms{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.map)return _n(n,{code:Yr.invalid_type,expected:Mn.map,received:n.parsedType}),ps;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,f],d)=>({key:a._parse(new dy(n,l,n.path,[d,"key"])),value:s._parse(new dy(n,f,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let f of c){let d=await f.key,m=await f.value;if(d.status==="aborted"||m.status==="aborted")return ps;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),l.set(d.value,m.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let f of c){let d=f.key,m=f.value;if(d.status==="aborted"||m.status==="aborted")return ps;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),l.set(d.value,m.value)}return{status:r.value,value:l}}}};gN.create=(e,t,r)=>new gN({valueType:t,keyType:e,typeName:os.ZodMap,...js(r)});var AN=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.set)return _n(n,{code:Yr.invalid_type,expected:Mn.set,received:n.parsedType}),ps;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(_n(n,{code:Yr.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(_n(n,{code:Yr.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(f){let d=new Set;for(let m of f){if(m.status==="aborted")return ps;m.status==="dirty"&&r.dirty(),d.add(m.value)}return{status:r.value,value:d}}let l=[...n.data.values()].map((f,d)=>s._parse(new dy(n,f,n.path,d)));return n.common.async?Promise.all(l).then(f=>c(f)):c(l)}min(t,r){return new e({...this._def,minSize:{value:t,message:mi.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:mi.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};AN.create=(e,t)=>new AN({valueType:e,minSize:null,maxSize:null,typeName:os.ZodSet,...js(t)});var UH=class e extends Ms{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.function)return _n(r,{code:Yr.invalid_type,expected:Mn.function,received:r.parsedType}),ps;function n(l,f){return LH({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,QH(),dN].filter(d=>!!d),issueData:{code:Yr.invalid_arguments,argumentsError:f}})}function a(l,f){return LH({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,QH(),dN].filter(d=>!!d),issueData:{code:Yr.invalid_return_type,returnTypeError:f}})}let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof ZC){let l=this;return nm(async function(...f){let d=new Ug([]),m=await l._def.args.parseAsync(f,s).catch(b=>{throw d.addIssue(n(f,b)),d}),g=await Reflect.apply(c,this,m);return await l._def.returns._def.type.parseAsync(g,s).catch(b=>{throw d.addIssue(a(g,b)),d})})}else{let l=this;return nm(function(...f){let d=l._def.args.safeParse(f,s);if(!d.success)throw new Ug([n(f,d.error)]);let m=Reflect.apply(c,this,d.data),g=l._def.returns.safeParse(m,s);if(!g.success)throw new Ug([a(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:sE.create(t).rest(d2.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||sE.create([]).rest(d2.create()),returns:r||d2.create(),typeName:os.ZodFunction,...js(n)})}},IT=class extends Ms{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};IT.create=(e,t)=>new IT({getter:e,typeName:os.ZodLazy,...js(t)});var kT=class extends Ms{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return _n(r,{received:r.data,code:Yr.invalid_literal,expected:this._def.value}),ps}return{status:"valid",value:t.data}}get value(){return this._def.value}};kT.create=(e,t)=>new kT({value:e,typeName:os.ZodLiteral,...js(t)});function t5e(e,t){return new TT({values:e,typeName:os.ZodEnum,...js(t)})}var TT=class e extends Ms{constructor(){super(...arguments),Nj.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return _n(r,{expected:po.joinValues(n),received:r.parsedType,code:Yr.invalid_type}),ps}if(jH(this,Nj,"f")||Kqe(this,Nj,new Set(this._def.values),"f"),!jH(this,Nj,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return _n(r,{received:r.data,code:Yr.invalid_enum_value,options:n}),ps}return nm(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Nj=new WeakMap;TT.create=t5e;var BT=class extends Ms{constructor(){super(...arguments),Fj.set(this,void 0)}_parse(t){let r=po.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Mn.string&&n.parsedType!==Mn.number){let a=po.objectValues(r);return _n(n,{expected:po.joinValues(a),received:n.parsedType,code:Yr.invalid_type}),ps}if(jH(this,Fj,"f")||Kqe(this,Fj,new Set(po.getValidEnumValues(this._def.values)),"f"),!jH(this,Fj,"f").has(t.data)){let a=po.objectValues(r);return _n(n,{received:n.data,code:Yr.invalid_enum_value,options:a}),ps}return nm(t.data)}get enum(){return this._def.values}};Fj=new WeakMap;BT.create=(e,t)=>new BT({values:e,typeName:os.ZodNativeEnum,...js(t)});var ZC=class extends Ms{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.promise&&r.common.async===!1)return _n(r,{code:Yr.invalid_type,expected:Mn.promise,received:r.parsedType}),ps;let n=r.parsedType===Mn.promise?r.data:Promise.resolve(r.data);return nm(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ZC.create=(e,t)=>new ZC({type:e,typeName:os.ZodPromise,...js(t)});var zg=class extends Ms{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===os.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:c=>{_n(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let c=a.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return ps;let f=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return f.status==="aborted"?ps:f.status==="dirty"||r.value==="dirty"?fN(f.value):f});{if(r.value==="aborted")return ps;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?ps:l.status==="dirty"||r.value==="dirty"?fN(l.value):l}}if(a.type==="refinement"){let c=l=>{let f=a.refinement(l,s);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?ps:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?ps:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yT(c))return c;let l=a.transform(c.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>yT(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);po.assertNever(a)}};zg.create=(e,t,r)=>new zg({schema:e,typeName:os.ZodEffects,effect:t,...js(r)});zg.createWithPreprocess=(e,t,r)=>new zg({schema:t,effect:{type:"preprocess",transform:e},typeName:os.ZodEffects,...js(r)});var fy=class extends Ms{_parse(t){return this._getType(t)===Mn.undefined?nm(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};fy.create=(e,t)=>new fy({innerType:e,typeName:os.ZodOptional,...js(t)});var aE=class extends Ms{_parse(t){return this._getType(t)===Mn.null?nm(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};aE.create=(e,t)=>new aE({innerType:e,typeName:os.ZodNullable,...js(t)});var DT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Mn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};DT.create=(e,t)=>new DT({innerType:e,typeName:os.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...js(t)});var PT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Oj(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ug(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ug(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};PT.create=(e,t)=>new PT({innerType:e,typeName:os.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...js(t)});var yN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.nan){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.nan,received:n.parsedType}),ps}return{status:"valid",value:t.data}}};yN.create=e=>new yN({typeName:os.ZodNaN,...js(e)});var Qtr=Symbol("zod_brand"),Qj=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Lj=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ps:s.status==="dirty"?(r.dirty(),fN(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ps:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:os.ZodPipeline})}},RT=class extends Ms{_parse(t){let r=this._def.innerType._parse(t),n=a=>(yT(a)&&(a.value=Object.freeze(a.value)),a);return Oj(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};RT.create=(e,t)=>new RT({innerType:e,typeName:os.ZodReadonly,...js(t)});function Gqe(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function r5e(e,t={},r){return e?XC.create().superRefine((n,a)=>{var s,c;let l=e(n);if(l instanceof Promise)return l.then(f=>{var d,m;if(!f){let g=Gqe(t,n),x=(m=(d=g.fatal)!==null&&d!==void 0?d:r)!==null&&m!==void 0?m:!0;a.addIssue({code:"custom",...g,fatal:x})}});if(!l){let f=Gqe(t,n),d=(c=(s=f.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0;a.addIssue({code:"custom",...f,fatal:d})}}):XC.create()}var Ltr={object:N0.lazycreate},os;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(os||(os={}));var jtr=(e,t={message:`Input not instance of ${e.name}`})=>r5e(r=>r instanceof e,t),n5e=KC.create,i5e=vT.create,Mtr=yN.create,qtr=xT.create,s5e=bT.create,Utr=ET.create,ztr=hN.create,Htr=wT.create,Vtr=ST.create,$tr=XC.create,Wtr=d2.create,Gtr=tx.create,Ytr=mN.create,Jtr=h2.create,Ktr=N0.create,Xtr=N0.strictCreate,Ztr=CT.create,trr=MH.create,rrr=_T.create,nrr=sE.create,irr=qH.create,srr=gN.create,arr=AN.create,orr=UH.create,crr=IT.create,urr=kT.create,lrr=TT.create,prr=BT.create,frr=ZC.create,Yqe=zg.create,drr=fy.create,hrr=aE.create,mrr=zg.createWithPreprocess,grr=Lj.create,Arr=()=>n5e().optional(),yrr=()=>i5e().optional(),vrr=()=>s5e().optional(),xrr={string:e=>KC.create({...e,coerce:!0}),number:e=>vT.create({...e,coerce:!0}),boolean:e=>bT.create({...e,coerce:!0}),bigint:e=>xT.create({...e,coerce:!0}),date:e=>ET.create({...e,coerce:!0})},brr=ps,Or=Object.freeze({__proto__:null,defaultErrorMap:dN,setErrorMap:htr,getErrorMap:QH,makeIssue:LH,EMPTY_PATH:mtr,addIssueToContext:_n,ParseStatus:ch,INVALID:ps,DIRTY:fN,OK:nm,isAborted:vue,isDirty:xue,isValid:yT,isAsync:Oj,get util(){return po},get objectUtil(){return yue},ZodParsedType:Mn,getParsedType:f2,ZodType:Ms,datetimeRegex:e5e,ZodString:KC,ZodNumber:vT,ZodBigInt:xT,ZodBoolean:bT,ZodDate:ET,ZodSymbol:hN,ZodUndefined:wT,ZodNull:ST,ZodAny:XC,ZodUnknown:d2,ZodNever:tx,ZodVoid:mN,ZodArray:h2,ZodObject:N0,ZodUnion:CT,ZodDiscriminatedUnion:MH,ZodIntersection:_T,ZodTuple:sE,ZodRecord:qH,ZodMap:gN,ZodSet:AN,ZodFunction:UH,ZodLazy:IT,ZodLiteral:kT,ZodEnum:TT,ZodNativeEnum:BT,ZodPromise:ZC,ZodEffects:zg,ZodTransformer:zg,ZodOptional:fy,ZodNullable:aE,ZodDefault:DT,ZodCatch:PT,ZodNaN:yN,BRAND:Qtr,ZodBranded:Qj,ZodPipeline:Lj,ZodReadonly:RT,custom:r5e,Schema:Ms,ZodSchema:Ms,late:Ltr,get ZodFirstPartyTypeKind(){return os},coerce:xrr,any:$tr,array:Jtr,bigint:qtr,boolean:s5e,date:Utr,discriminatedUnion:trr,effect:Yqe,enum:lrr,function:orr,instanceof:jtr,intersection:rrr,lazy:crr,literal:urr,map:srr,nan:Mtr,nativeEnum:prr,never:Gtr,null:Vtr,nullable:hrr,number:i5e,object:Ktr,oboolean:vrr,onumber:yrr,optional:drr,ostring:Arr,pipeline:grr,preprocess:mrr,promise:frr,record:irr,set:arr,strictObject:Xtr,string:n5e,symbol:ztr,transformer:Yqe,tuple:nrr,undefined:Htr,union:Ztr,unknown:Wtr,void:Ytr,NEVER:brr,ZodIssueCode:Yr,quotelessJson:dtr,ZodError:Ug});var UJn=Or.object({monitor:Or.array(Or.string()).optional(),command:Or.string().optional(),cwd:Or.string().optional(),target_file:Or.string()}),Err=Or.object({assets_dir:Or.string().optional(),proxy_path:Or.string().optional()}),zJn=Or.object({port:Or.union([Or.number(),Or.string()]).optional(),origin:Or.string().optional(),timeout:Or.union([Or.number(),Or.string()]).optional(),sandbox:Or.boolean().optional(),favicon:Or.boolean().optional(),minify:Or.boolean().optional(),site:Err.optional()}),wrr=Or.object({target:Or.string(),operator:Or.union([Or.literal("equal"),Or.literal("notequal")]),values:Or.array(Or.string())}),Srr=Or.object({condition:Or.array(wrr)}),HJn=Or.object({minify:Or.boolean().optional(),rule:Or.array(Srr).optional()}),Crr=Or.object({maxDuration:Or.number().optional()}),VJn=Or.object({type:Or.enum(["header","cookie","host","query"]),key:Or.string(),value:Or.string().optional()}),Sue=(e,t)=>{var a;let r=e.replace(/\\([?*])/g,"$1");return r.length===0?t.addIssue({code:Or.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(r)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):((a=r.match(/\*/g))==null?void 0:a.length)>1?t.addIssue({code:Or.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(r)||/:(?![a-zA-Z0-9]+)/.test(r)?t.addIssue({code:Or.ZodIssueCode.custom,message:": match error"}):!0},HH=Or.object({source:Or.string().superRefine(Sue)});function _rr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),a=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(a==="stale-while-revalidate"||a==="stale-if-error"){let s=`${a}=86400`;if(n===-1)return`value match error: Cache-Control directive "${a}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`value match error: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}var Irr=Or.object({key:Or.string().min(1).max(100).superRefine((e,t)=>/[^a-zA-Z0-9-]/.test(e)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):!0),value:Or.string().min(1).max(1e3).superRefine((e,t)=>/[\u4e00-\u9fa5]/.test(e)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((e,t)=>{if(e.key.toLowerCase()==="cache-control"){let r=_rr(e.value);r&&t.addIssue({code:Or.ZodIssueCode.custom,path:["value"],message:r})}}),krr=Irr.array().min(1),Trr=HH.merge(Or.object({headers:krr})).array(),Brr=Or.union([Or.literal(307),Or.literal(301),Or.literal(302),Or.literal(308),Or.literal(303),Or.literal(304)]),Drr=HH.merge(Or.object({destination:Or.string().superRefine(Sue),permanent:Or.boolean().optional(),statusCode:Brr.optional()})).array();var Prr=HH.merge(Or.object({destination:Or.string().superRefine(Sue)})).array(),Rrr=HH.merge(Or.object({cacheTtl:Or.number()})).array(),a5e=Or.object({included_files:Or.array(Or.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:Or.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:Or.array(Or.string()).optional().describe("Node modules to be treated as external dependencies")}),o5e=Or.object({$schema:Or.string().transform(e=>"").optional(),outputDirectory:Or.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:Or.string().optional().describe("the install command to run."),buildCommand:Or.string().optional().describe("the build command to run."),nodeVersion:Or.string().optional().describe("the node version to use."),nodeFunctionsConfig:Crr.optional(),headers:Trr.optional(),redirects:Drr.optional(),rewrites:Prr.optional(),caches:Rrr.optional(),"node-functions":a5e.optional().describe("Node function specific configuration"),"edge-functions":a5e.optional().describe("Edge function specific configuration")}),Eue=Symbol("filteredSchema"),zH=Symbol("symFilteredValue"),c5e=wue(o5e);function Nrr(e){return e.errors.map(t=>`${t.message}`).join(`
536
536
  `)}function hy(){return!0}function wue(e,t=["root"]){if(e[Eue])return e;let r=e;if((e instanceof Or.ZodOptional||e instanceof Or.ZodNullable||e instanceof Or.ZodReadonly||e instanceof Or.ZodPromise||e instanceof Or.ZodBranded)&&(r=e.unwrap()),r[Eue])return r;let n=null;try{if(r instanceof Or.ZodArray){let a=wue(r.element,[...t,"[]"]);return n=Or.array(Or.any()).optional().transform(s=>{if(t.length===4&&t.includes("headers")&&(s?s!=null&&s.length||console.warn('"error in root.headers.[].headers": length is invalid, min 1 length error'):console.warn('"error in root.headers.[].headers": undefined is invalid, Required')),!s)return;if(!s.length)return[];let c=[];for(let f=0;f<s.length;f++){let d=s[f];if(d===zH)continue;let m=a.safeParse(d,{path:[...t,`[${f}]`]});if(!m.success){hy();continue}!m.data||m.data===zH||c.push(m.data)}let l=30;return t.length===4&&t[3]==="headers"&&c.length>3?(console.warn(`"error in root.headers.[].headers": length is invalid, max ${l} length error`),c.slice(0,l)):c}),n}return r instanceof Or.ZodObject?(n=Or.object(Object.fromEntries(Object.entries(r.shape).map(([a,s])=>[a,wue(s,[...t,a])]))).transform(a=>{let s=e.safeParse(a,{path:t});return s.success?s.data:(hy(),zH)}),n):(n=Or.any().transform(a=>{if(a===zH)return;let s=e.safeParse(a,{path:t});if(!s.success){hy()&&console.warn(`"error in ${t.join(".")}": ${JSON.stringify(a)} is invalid, ${Nrr(s.error)}`);return}return s.data}),n)}catch(a){hy()&&console.error("%c [ e ]-220","font-size:13px; background:pink; color:#bf2c9f;",a)}finally{n&&(n[Eue]=!0)}}var Frr=Or.object({TENCENT_SECRET_KEY:Or.string(),TENCENT_SECRET_ID:Or.string(),DEV_SERVER_ENDPOINT:Or.string().optional(),DEV_SERVER_PORT:Or.union([Or.number(),Or.string()]).optional()}),u5e={tefConfigSchema:o5e,envConfigSchema:Frr};var VH=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}};var $H=class extends VH{constructor(t){super(`[ConfigLoadError] ${t}`)}};function Orr(e){return e.length===1?e[0].toString():e.reduce((t,r)=>{if(typeof r=="number")return`${t}[${r.toString()}]`;if(r.includes('"'))return`${t}["${r.replace(/"/g,'\\"')}"]`;if(!/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u.test(r))return`${t}["${r}"]`;let n=t.length===0?"":".";return t+n+r},"")}function l5e(e,t,r){var n;if(e.code==="invalid_union")return e.unionErrors.reduce((a,s)=>{let c=s.issues.map(l=>l5e(l,t,r)).join(t);return a.includes(c)||a.push(c),a},[]).join(r);if(((n=e.path)==null?void 0:n.length)!==0){if(e.path.length===1){let a=e.path[0];if(typeof a=="number")return`${e.message} at index ${a}`}return`${e.message} at "${Orr(e.path)}"`}return e.message}function Qrr(e,t,r){return e.length>0?[t,e].join(r):t}function Lrr(e,t){let{issueSeparator:r=`
537
537
  `,unionSeparator:n=", or ",prefixSeparator:a=`
538
538
  `,prefix:s}=t,c=e.errors.map(l=>l5e(l,r,n)).join(r);return Qrr(c,s,a)}var WH=class extends VH{details;constructor(t,r){let n=Lrr(r,{prefix:`${t}:`});super(`[ValidationError] ${n}`),this.details=r.errors}};var Xi={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"};function vN(e){return Object.prototype.toString.call(e)==="[object Object]"}function jj(e){return Object.prototype.toString.call(e)==="[object Array]"}function e_(e){return Object.prototype.toString.call(e)==="[object String]"}function p5e(e){return Object.prototype.toString.call(e)==="[object Number]"}function GH(e){var n;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return Xi.min_string;if(t.length>500)return Xi.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((n=t.match(/\*/g))==null?void 0:n.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return Xi.char_match;if(t.length){let a=t.split("/");if(a.some(l=>l.includes(":")&&(l.includes("*")||l.includes(".")))||a.some(l=>l.split(":").length>2))return Xi.char_match}}function f5e(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return Xi.min_string;if(e.length>500)return Xi.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return Xi.char_match}function jrr(e){if(e.length===0)return Xi.min_string;if(e.length>100)return Xi.max_string;if(/[^a-zA-Z0-9-]/.test(e))return Xi.char_match}function Mrr(e){if(e.length===0)return Xi.min_string;if(e.length>1e3)return Xi.max_string;if(/[\u4e00-\u9fa5]/.test(e))return Xi.char_match}function qrr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),a=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(a==="stale-while-revalidate"||a==="stale-if-error"){let s=`${a}=86400`;if(n===-1)return`${Xi.value_match}: Cache-Control directive "${a}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`${Xi.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}function Urr(e){if(![301,302,303,304,307,308].includes(e))return Xi.value_match}function zrr(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return Xi.value_match}function Hrr(e,t){let r=[],n=[];if(!jj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!vN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{key:c,value:l}=s;if(!e_(c)){n.push({path:[...t,`[${a}]`,"key"],message:Xi.invalid_type});continue}let f=jrr(c);if(f){n.push({path:[...t,`[${a}]`,"key"],message:f});continue}if(!e_(l)){n.push({path:[...t,`[${a}]`,"value"],message:Xi.invalid_type});continue}let d=Mrr(l);if(d){n.push({path:[...t,`[${a}]`,"value"],message:d});continue}if(c.toLowerCase()==="cache-control"){let m=qrr(l);if(m){n.push({path:[...t,`[${a}]`,"value"],message:m});continue}}r.push({key:c,value:l})}return[r,n]}function Vrr(e,t){let r=[],n=[];if(!jj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!vN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,headers:l}=s;if(!e_(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=GH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}let[d,m]=Hrr(l,[...t,`[${a}]`,"headers"]);d.length>100&&(m.push({path:[...t,`[${a}]`,"headers"],message:Xi.max_length}),d=d.slice(0,100)),(l==null?void 0:l.length)<1&&d.length<1&&m.push({path:[...t,`[${a}]`,"headers"],message:Xi.min_length}),d.length&&r.push({source:c,headers:d}),n.push(...m)}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function $rr(e,t){let r=[],n=[];if(!jj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!vN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,destination:l,statusCode:f}=s;if(!e_(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let d=GH(c);if(d){n.push({path:[...t,`[${a}]`,"source"],message:d});continue}if(!e_(l)){n.push({path:[...t,`[${a}]`,"destination"],message:Xi.invalid_type});continue}let m=f5e(l);if(m){n.push({path:[...t,`[${a}]`,"destination"],message:m});continue}if(!p5e(f)){n.push({path:[...t,`[${a}]`,"statusCode"],message:Xi.invalid_type});continue}let g=Urr(f);if(g){n.push({path:[...t,`[${a}]`,"statusCode"],message:g});continue}r.push({source:c,destination:l,statusCode:f})}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function Wrr(e,t){let r=[],n=[];if(!jj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!vN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,destination:l}=s;if(!e_(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=GH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}if(!e_(l)){n.push({path:[...t,`[${a}]`,"destination"],message:Xi.invalid_type});continue}let d=f5e(l);if(d){n.push({path:[...t,`[${a}]`,"destination"],message:d});continue}r.push({source:c,destination:l})}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function Grr(e,t){let r=[],n=[];if(!jj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!vN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,cacheTtl:l}=s;if(!e_(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=GH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}if(!p5e(l)){n.push({path:[...t,`[${a}]`,"cacheTtl"],message:Xi.invalid_type});continue}let d=zrr(l);if(d){n.push({path:[...t,`[${a}]`,"cacheTtl"],message:d});continue}r.push({source:c,cacheTtl:l})}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function d5e(e,t){let r={headers:[],redirects:[],rewrites:[],caches:[]},n=[];if(!vN(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];let{headers:a=[],redirects:s=[],rewrites:c=[],caches:l=[]}=e,[f,d]=Vrr(a,[...t,"headers"]),[m,g]=$rr(s,[...t,"redirects"]),[x,b]=Wrr(c,[...t,"rewrites"]),[A,C]=Grr(l,[...t,"caches"]);r.headers=f,r.redirects=m,r.rewrites=x,r.caches=A,r["node-functions"]=e["node-functions"],r["edge-functions"]=e["edge-functions"];let I=["outputDirectory","installCommand","buildCommand","nodeVersion","nodeFunctionsConfig"];for(let k in e)I.includes(k)&&e[k]&&(r[k]=e[k]);return n.push(...d,...g,...b,...C),[r,n]}var Yrr=/^(?=.{2,30}$)[a-z0-9]+(-[a-z0-9]+)*-?[a-z0-9]+$/,h5e=Or.string().refine(e=>Yrr.test(e)),Jrr=Or.enum(["vps-react-ts","vps-react","vps-vue-ts","vps-vue","manaia-demo","manaia-demo-ts"]),Krr=Or.object({name:h5e}),Xrr=Or.object({name:h5e,template:Jrr}),Zrr=Or.object({script:Or.string().optional()}),enr=Or.object({script:Or.string().optional()}),tnr=Or.object({}),rnr=Or.object({}),m5e={initArgsSchema:Krr,generateArgsSchema:Xrr,devArgsSchema:Zrr,publishArgsSchema:enr,deleteArgsSchema:tnr,testArgsSchema:rnr};function nnr(e,t){return r=>{try{e.parse(r)}catch(n){throw new WH(`Failed to validate ${t}`,n)}}}function inr(){let e={};return Object.entries({...m5e,...u5e}).forEach(([t,r])=>{let n=t.replace("Schema","");e[n]=nnr(r,n)}),e}var eKn=inr();function snr(e="",t={confPath:""}){try{e=e||process.cwd();let[r,n]=anr(e);if(t.exists=n,!n)return t.showError||hy(),{headers:[],redirects:[],rewrites:[]};t.confPath=r;let a=Pz(r);return A5e.default.parse(a)}catch{t.showError||hy()}}var g5e="edgeone";async function y5e(e=!1){var s,c,l,f,d,m,g,x,b;!e&&console.log(`
@@ -1238,7 +1238,7 @@ export default {
1238
1238
  `).filter(a=>{let s=a.match(YVe);if(s===null||!s[1])return!0;let c=s[1];return c.includes(".app/Contents/Resources/electron.asar")||c.includes(".app/Contents/Resources/default_app.asar")||c.includes("node_modules/electron/dist/resources/electron.asar")||c.includes("node_modules/electron/dist/resources/default_app.asar")?!1:!N4r.test(c)}).filter(a=>a.trim()!=="").map(a=>(n&&(a=a.replace(n,"$1")),t&&(a=a.replace(YVe,(s,c)=>s.replace(c,c.replace(F4r,"~")))),a)).join(`
1239
1239
  `)}var O4r=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),NM,RM=class extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);r=r.map(a=>a instanceof Error?a:a!==null&&typeof a=="object"?Object.assign(new Error(a.message),a):new Error(a));let n=r.map(a=>typeof a.stack=="string"&&a.stack.length>0?O4r(uhe(a.stack)):String(a)).join(`
1240
1240
  `);n=`
1241
- `+ahe(n,4);super(n);nr(this,NM,void 0);Ps(this,"name","AggregateError");Qt(this,NM,r)}get errors(){return re(this,NM).slice()}};NM=new WeakMap;var lhe=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},JVe=e=>globalThis.DOMException===void 0?new lhe(e):new DOMException(e),KVe=e=>{let t=e.reason===void 0?JVe("This operation was aborted."):e.reason;return t instanceof Error?t:JVe(t)};async function b$(e,t,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:a}={}){return new Promise((s,c)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let l=[],f=[],d=new Map,m=!1,g=!1,x=!1,b=0,A=0,C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),I=O=>{m=!0,g=!0,c(O)};a&&(a.aborted&&I(KVe(a)),a.addEventListener("abort",()=>{I(KVe(a))}));let k=async()=>{if(g)return;let O=await C.next(),j=A;if(A++,O.done){if(x=!0,b===0&&!g){if(!n&&f.length>0){I(new RM(f));return}if(g=!0,d.size===0){s(l);return}let M=[];for(let[W,se]of l.entries())d.get(W)!==XVe&&M.push(se);s(M)}return}b++,(async()=>{try{let M=await O.value;if(g)return;let W=await t(M,j);W===XVe&&d.set(j,W),l[j]=W,b--,await k()}catch(M){if(n)I(M);else{f.push(M),b--;try{await k()}catch(W){I(W)}}}})()};(async()=>{for(let O=0;O<r;O++){try{await k()}catch(j){I(j);break}if(x||m)break}})()})}var XVe=Symbol("skip");var phe=wr(require("os")),j4r=wr(e$e()),L4r=require("fast-glob"),t$e=phe.default.cpus().length===0?2:phe.default.cpus().length*2;async function M4r(e,t){if(!t||!e||e.length===0)return{excludePatterns:[],paths:[]};try{let{include:r,excludePatterns:n}=e.reduce((c,l)=>{if(l.startsWith("!")){let f=(0,$g.resolve)(t,l.slice(1));return{include:c.include,excludePatterns:[...c.excludePatterns,f]}}return{include:[...c.include,l],excludePatterns:c.excludePatterns}},{include:[],excludePatterns:[]});if(r.length===0)return{excludePatterns:n,paths:[]};let s=(await L4r(r,{absolute:!0,cwd:t,dot:!1,ignore:n,onlyFiles:!1,markDirectories:!0,followSymbolicLinks:!1})).filter(c=>!c.endsWith("/")).map($g.normalize);return{excludePatterns:n,paths:s}}catch(r){if(r.code==="ENOENT")return{excludePatterns:[],paths:[]};throw r}}function q4r(e,t=[]){return t.length===0?e:e.filter(r=>!t.some(n=>(0,r$e.minimatch)(r,n)))}function U4r({commonPrefix:e,path:t,userNamespace:r=""}){let n=(0,$g.normalize)(t),a=n;return e&&n.startsWith(e)&&(a=n.slice(e.length),a.startsWith($g.sep)&&(a=a.slice(1))),((r?`${r}${$g.sep}`:"")+a).replace(/\\/g,"/")}async function z4r({srcFiles:e,destFolder:t,basePath:r,aliases:n=new Map,userNamespace:a=""}){let s=[...new Set(e)],c=new Map;await b$(s,async l=>{try{let f=n.get(l)||l,d=U4r({commonPrefix:r,path:f,userNamespace:a}),m=(0,$g.join)(t,d);if((await(0,cx.stat)(l)).isSymbolicLink()){let x=await(0,cx.readlink)(l),b=c.get(x)||new Set;b.add(m),c.set(x,b);return}await(0,cx.mkdir)((0,$g.dirname)(m),{recursive:!0}),await(0,cx.copyFile)(l,m)}catch(f){console.warn(`Failed to copy file ${l}:`,f.message)}},{concurrency:t$e}),await b$([...c.entries()],async([l,f])=>{for(let d of f)try{await(0,cx.mkdir)((0,$g.dirname)(d),{recursive:!0}),await(0,cx.symlink)(l,d)}catch(m){console.warn(`Failed to create symlink ${d}:`,m.message)}},{concurrency:t$e})}async function n$e(e,t,r,n){if(!e||e.length===0)return 0;try{let{excludePatterns:a,paths:s}=await M4r(e,t),c=q4r(s,a);return c.length===0?0:(await z4r({srcFiles:c,destFolder:r,basePath:t,userNamespace:n}),console.log(`\u{1F4E6} Processed ${c.length} included files`),c.length)}catch(a){throw console.error("Failed to process included files:",a.message),a}}function E$(e,t){if(!e||typeof e!="object")return[];let r=e[t];if(!r||typeof r!="object")return[];let n=r.included_files;return Array.isArray(n)?n.filter(a=>typeof a=="string"&&a.trim()):[]}function w$(e,t,r){if(!e||typeof e!="object")return r;let n=e[t];if(!n||typeof n!="object")return r;let a=n.included_files_base_path;return typeof a=="string"&&a.trim()?a.trim():r}var C$=wr(bM()),S$=wr(g2()),s$e=wr(HV()),ph=wr(Es()),ux=require("path"),a$e=require("fs"),fhe=require("minimatch");function i$e(e,t,r,n){try{let a=(0,ux.resolve)((0,ux.dirname)(t),e);if(!(0,a$e.existsSync)(a))return{isIncluded:!1};let s=(0,ux.relative)(n,a),{include:c,excludePatterns:l}=r.reduce((x,b)=>{if(b.startsWith("!")){let A=(0,ux.resolve)(n,b.slice(1));return{include:x.include,excludePatterns:[...x.excludePatterns,A]}}return{include:[...x.include,b],excludePatterns:x.excludePatterns}},{include:[],excludePatterns:[]}),f={dot:!1,matchBase:!1,noglobstar:!1,nocase:!1},d=c.length===0||c.some(x=>(0,fhe.minimatch)(s,x,f)),m=l.some(x=>(0,fhe.minimatch)(a,x,f));return d&&!m?{isIncluded:!0,originalPath:a,relativePath:s}:{isIncluded:!1}}catch{return{isIncluded:!1}}}function H4r(e,t){let n=(0,ux.normalize)(e);n.startsWith(ux.sep)&&(n=n.slice(1));let a=n.replace(/\\/g,"/");return`join(__dirname, '${t}', '${a}')`}function V4r(e,t,r){let n=[];try{let a=C$.parse(e,{sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,plugins:["typescript","jsx","decorators-legacy","classProperties","objectRestSpread","asyncGenerators","functionBind","exportDefaultFrom","exportNamespaceFrom","dynamicImport","nullishCoalescingOperator","optionalChaining"]}),s=!1;if((0,S$.default)(a,{StringLiteral(l){let{value:f}=l.node;if(typeof f=="string"&&(f.includes("/")||f.includes("\\")||f.includes(".."))){let d=i$e(f,r.sourceFilePath,r.includedFiles,r.basePath);if(d.isIncluded&&d.relativePath){let m=H4r(d.relativePath,r.targetNamespace),g=C$.parseExpression(m);l.replaceWith(g),n.push(f),s=!0}}},TemplateLiteral(l){let{quasis:f}=l.node;f.forEach((d,m)=>{let g=d.value.raw;if(g&&(g.includes("/")||g.includes("\\")||g.includes(".."))){let x=i$e(g,r.sourceFilePath,r.includedFiles,r.basePath);x.isIncluded&&x.relativePath&&(n.push(g),console.warn(`Template literal path transformation needed: ${g} in ${r.sourceFilePath}`))}})}}),s){let l=!1,f=!1;if((0,S$.default)(a,{ImportDeclaration(d){d.node.source.value==="path"&&(l=!0,d.node.specifiers.forEach(m=>{ph.isImportSpecifier(m)&&ph.isIdentifier(m.imported,{name:"join"})&&(f=!0)}))}}),l)f||(0,S$.default)(a,{ImportDeclaration(d){d.node.source.value==="path"&&d.node.specifiers.push(ph.importSpecifier(ph.identifier("join"),ph.identifier("join")))}});else{let d=ph.importDeclaration([ph.importSpecifier(ph.identifier("join"),ph.identifier("join"))],ph.stringLiteral("path"));a.program.body.unshift(d)}}return{code:(0,s$e.default)(a,{retainLines:!1,compact:!1}).code,transformedPaths:n}}catch(a){return console.warn(`Failed to transform paths in ${t}:`,a.message),{code:e,transformedPaths:[]}}}function o$e(e,t,r,n,a="included_files"){if(!r||!r.length)return e;let s=V4r(e,t,{includedFiles:r,basePath:n,targetNamespace:a,sourceFilePath:t});return s.transformedPaths.length>0&&s.transformedPaths.forEach(c=>{console.log(`Copied static files for function: ${c} -> included_files/${c}`)}),s.code}var UM=wr(Ihe()),khe=wr(require("path"));function $3r(e){let{externalModules:t}=e;return!t||t.length===0?[]:t}function W3r(e,t){var r,n,a;try{let s=khe.default.join(e,"package.json");if(!UM.default.existsSync(s))return console.warn(`package.json not found in ${e}, using "latest" for ${t}`),"latest";let c=UM.default.readJsonSync(s),l=((r=c.dependencies)==null?void 0:r[t])||((n=c.devDependencies)==null?void 0:n[t])||((a=c.peerDependencies)==null?void 0:a[t]);return l||(console.warn(`Module ${t} not found in package.json dependencies, using "latest"`),"latest")}catch(s){return console.warn(`Error reading package.json for ${t}:`,s),"latest"}}function G3r(e){let{externalModules:t,projectRoot:r}=e;if(!t||t.length===0)return[];let n=[];for(let a of t){let s=W3r(r,a);n.push({name:a,version:s})}return n}async function Y3r(e){let{externalModules:t,projectRoot:r,outputDir:n}=e,a={name:"edgeone-function-runtime",version:"1.0.0",description:"Runtime dependencies for EdgeOne function",main:"index.mjs",type:"module",dependencies:{}};if(!t||t.length===0)return a;let s=G3r(e);for(let c of s)a.dependencies[c.name]=c.version;return a}async function J3r(e){let{outputDir:t}=e;try{await UM.default.ensureDir(t);let r=await Y3r(e),n=khe.default.join(t,"package.json");await UM.default.writeJson(n,r,{spaces:2}),console.log(`\u{1F4E6} Generated package.json with ${Object.keys(r.dependencies).length} external dependencies`)}catch(r){throw console.error("Error writing package.json:",r),r}}async function tGe(e){let t=$3r(e);return await J3r(e),t}var O$=wr(require("fs"));function x_(e,t,r){let n=di("edgeone.json");if(O$.default.existsSync(n)){let a=JSON.parse(O$.default.readFileSync(n,"utf-8"));if(a[e])return a[e]}return process.env[t]?process.env[t]:r()}function Q$(){let e=O$.default.readdirSync(di("")),t=e.length===1&&e[0]===".edgeone",r=e.length===2&&e.includes(".edgeone")&&e.includes(".git");return t||r}function L$(e){var n,a,s,c;let t=e.find(l=>(l==null?void 0:l.routePath)==="/"),r=e.find(l=>/\/:(\w+)\*$/.test(l==null?void 0:l.routePath)&&(l==null?void 0:l.mountPath)==="/");if(t){let l=(n=t==null?void 0:t.module[0])==null?void 0:n.split("/")[0],f=(a=t==null?void 0:t.module[0])==null?void 0:a.split("/")[1].replace(/:.*$/,"");Xw(gue()?`\u68C0\u6D4B\u5230 ${l} \u6839\u76EE\u5F55\u4E0B\u5B58\u5728 ${f}\uFF0C\u4F1A\u5BFC\u81F4\u8BBF\u95EE\u7F51\u7AD9\u9996\u9875\u8FDB\u5165\u5230\u8BE5\u51FD\u6570\uFF0C\u5EFA\u8BAE\u653E\u7F6E\u5230 ${l}/api/${f}\uFF0C\u6216\u81EA\u884C\u5728\u51FD\u6570\u5185\u5904\u7406\u9996\u9875\u5185\u5BB9\u7684\u8FD4\u56DE\u3002`:`The file ${f} was detected in the root directory of ${l}. This will cause visiting the website's homepage to trigger this function. It is recommended to place it in ${l}/api/${f} or handle the homepage content return within the function itself.`,`${l}`)}if(r){let l=(s=r==null?void 0:r.module[0])==null?void 0:s.split("/")[0],f=(c=r==null?void 0:r.module[0])==null?void 0:c.split("/")[1].replace(/:.*$/,"");Xw(gue()?`\u68C0\u6D4B\u5230 ${l} \u6839\u76EE\u5F55\u4E0B\u5B58\u5728 ${f}\uFF0C\u4F1A\u5BFC\u81F4\u6839\u8DEF\u5F84\u5916\u5176\u4ED6\u6240\u6709\u8DEF\u5F84\u90FD\u4F1A\u8FDB\u5165\u5230\u8BE5\u51FD\u6570\uFF0C\u5EFA\u8BAE\u653E\u7F6E\u5230 ${l}/api/${f}\uFF0C\u6216\u81EA\u884C\u5728\u51FD\u6570\u5185\u5904\u7406\u9759\u6001\u8D44\u6E90\u7684\u8FD4\u56DE\u3002`:`The file ${f} was detected in the root directory of ${l}. This will cause all other paths outside the root to trigger this function. It is recommended to place it in ${l}/api/${f} or handle static resource returns within the function itself.`,`${l}`)}}function K3r(e){for(var t=[],r=0;r<e.length;){var n=e[r];if(n==="*"||n==="+"||n==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(n==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(n==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(n==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(n===":"){for(var a="",s=r+1;s<e.length;){var c=e.charCodeAt(s);if(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||c===95){a+=e[s++];continue}break}if(!a)throw new TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:a}),r=s;continue}if(n==="("){var l=1,f="",s=r+1;if(e[s]==="?")throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;){if(e[s]==="\\"){f+=e[s++]+e[s++];continue}if(e[s]===")"){if(l--,l===0){s++;break}}else if(e[s]==="("&&(l++,e[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+s);f+=e[s++]}if(l)throw new TypeError("Unbalanced pattern at "+r);if(!f)throw new TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:f}),r=s;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}function X3r(e,t){t===void 0&&(t={});for(var r=K3r(e),n=t.prefixes,a=n===void 0?"./":n,s="[^"+ZN(t.delimiter||"/#?")+"]+?",c=[],l=0,f=0,d="",m=function(se){if(f<r.length&&r[f].type===se)return r[f++].value},g=function(se){var X=m(se);if(X!==void 0)return X;var ve=r[f],ae=ve.type,he=ve.index;throw new TypeError("Unexpected "+ae+" at "+he+", expected "+se)},x=function(){for(var se="",X;X=m("CHAR")||m("ESCAPED_CHAR");)se+=X;return se};f<r.length;){var b=m("CHAR"),A=m("NAME"),C=m("PATTERN");if(A||C){var I=b||"";a.indexOf(I)===-1&&(d+=I,I=""),d&&(c.push(d),d=""),c.push({name:A||l++,prefix:I,suffix:"",pattern:C||s,modifier:m("MODIFIER")||""});continue}var k=b||m("ESCAPED_CHAR");if(k){d+=k;continue}d&&(c.push(d),d="");var O=m("OPEN");if(O){var I=x(),j=m("NAME")||"",M=m("PATTERN")||"",W=x();g("CLOSE"),c.push({name:j||(M?l++:""),pattern:j&&!M?s:M,prefix:I,suffix:W,modifier:m("MODIFIER")||""});continue}g("END")}return c}function ZN(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function rGe(e){return e&&e.sensitive?"":"i"}function Z3r(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}function eLr(e,t,r){var n=e.map(function(a){return zM(a,t,r).source});return new RegExp("(?:"+n.join("|")+")",rGe(r))}function tLr(e,t,r){return rLr(X3r(e,r),t,r)}function rLr(e,t,r){r===void 0&&(r={});for(var n=r.strict,a=n===void 0?!1:n,s=r.start,c=s===void 0?!0:s,l=r.end,f=l===void 0?!0:l,d=r.encode,m=d===void 0?function(se){return se}:d,g="["+ZN(r.endsWith||"")+"]|$",x="["+ZN(r.delimiter||"/#?")+"]",b=c?"^":"",A=0,C=e;A<C.length;A++){var I=C[A];if(typeof I=="string")b+=ZN(m(I));else{var k=ZN(m(I.prefix)),O=ZN(m(I.suffix));if(I.pattern)if(t&&t.push(I),k||O)if(I.modifier==="+"||I.modifier==="*"){var j=I.modifier==="*"?"?":"";b+="(?:"+k+"((?:"+I.pattern+")(?:"+O+k+"(?:"+I.pattern+"))*)"+O+")"+j}else b+="(?:"+k+"("+I.pattern+")"+O+")"+I.modifier;else b+="("+I.pattern+")"+I.modifier;else b+="(?:"+k+O+")"+I.modifier}}if(f)a||(b+=x+"?"),b+=r.endsWith?"(?="+g+")":"$";else{var M=e[e.length-1],W=typeof M=="string"?x.indexOf(M[M.length-1])>-1:M===void 0;a||(b+="(?:"+x+"(?="+g+"))?"),W||(b+="(?="+x+"|"+g+")")}return new RegExp(b,rGe(r))}function zM(e,t,r){return e instanceof RegExp?Z3r(e,t):Array.isArray(e)?eLr(e,t,r):tLr(e,t,r)}var Bhe=wr(g2()),Dhe=wr(HV()),Am=wr(Es()),qs=wr(require("fs")),fo=wr(require("path")),b_=wr(require("esbuild"));function nGe(){return`
1241
+ `+ahe(n,4);super(n);nr(this,NM,void 0);Ps(this,"name","AggregateError");Qt(this,NM,r)}get errors(){return re(this,NM).slice()}};NM=new WeakMap;var lhe=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},JVe=e=>globalThis.DOMException===void 0?new lhe(e):new DOMException(e),KVe=e=>{let t=e.reason===void 0?JVe("This operation was aborted."):e.reason;return t instanceof Error?t:JVe(t)};async function b$(e,t,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:a}={}){return new Promise((s,c)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let l=[],f=[],d=new Map,m=!1,g=!1,x=!1,b=0,A=0,C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),I=O=>{m=!0,g=!0,c(O)};a&&(a.aborted&&I(KVe(a)),a.addEventListener("abort",()=>{I(KVe(a))}));let k=async()=>{if(g)return;let O=await C.next(),j=A;if(A++,O.done){if(x=!0,b===0&&!g){if(!n&&f.length>0){I(new RM(f));return}if(g=!0,d.size===0){s(l);return}let M=[];for(let[W,se]of l.entries())d.get(W)!==XVe&&M.push(se);s(M)}return}b++,(async()=>{try{let M=await O.value;if(g)return;let W=await t(M,j);W===XVe&&d.set(j,W),l[j]=W,b--,await k()}catch(M){if(n)I(M);else{f.push(M),b--;try{await k()}catch(W){I(W)}}}})()};(async()=>{for(let O=0;O<r;O++){try{await k()}catch(j){I(j);break}if(x||m)break}})()})}var XVe=Symbol("skip");var phe=wr(require("os")),j4r=wr(e$e()),L4r=require("fast-glob"),t$e=phe.default.cpus().length===0?2:phe.default.cpus().length*2;async function M4r(e,t){if(!t||!e||e.length===0)return{excludePatterns:[],paths:[]};try{let{include:r,excludePatterns:n}=e.reduce((c,l)=>{if(l.startsWith("!")){let f=(0,$g.resolve)(t,l.slice(1));return{include:c.include,excludePatterns:[...c.excludePatterns,f]}}return{include:[...c.include,l],excludePatterns:c.excludePatterns}},{include:[],excludePatterns:[]});if(r.length===0)return{excludePatterns:n,paths:[]};let s=(await L4r(r,{absolute:!0,cwd:t,dot:!1,ignore:n,onlyFiles:!1,markDirectories:!0,followSymbolicLinks:!1})).filter(c=>!c.endsWith("/")).map($g.normalize);return{excludePatterns:n,paths:s}}catch(r){if(r.code==="ENOENT")return{excludePatterns:[],paths:[]};throw r}}function q4r(e,t=[]){return t.length===0?e:e.filter(r=>!t.some(n=>(0,r$e.minimatch)(r,n)))}function U4r({commonPrefix:e,path:t,userNamespace:r=""}){let n=(0,$g.normalize)(t),a=n;return e&&n.startsWith(e)&&(a=n.slice(e.length),a.startsWith($g.sep)&&(a=a.slice(1))),((r?`${r}${$g.sep}`:"")+a).replace(/\\/g,"/")}async function z4r({srcFiles:e,destFolder:t,basePath:r,aliases:n=new Map,userNamespace:a=""}){let s=[...new Set(e)],c=new Map;await b$(s,async l=>{try{let f=n.get(l)||l,d=U4r({commonPrefix:r,path:f,userNamespace:a}),m=(0,$g.join)(t,d);if((await(0,cx.stat)(l)).isSymbolicLink()){let x=await(0,cx.readlink)(l),b=c.get(x)||new Set;b.add(m),c.set(x,b);return}await(0,cx.mkdir)((0,$g.dirname)(m),{recursive:!0}),await(0,cx.copyFile)(l,m)}catch(f){console.warn(`Failed to copy file ${l}:`,f.message)}},{concurrency:t$e}),await b$([...c.entries()],async([l,f])=>{for(let d of f)try{await(0,cx.mkdir)((0,$g.dirname)(d),{recursive:!0}),await(0,cx.symlink)(l,d)}catch(m){console.warn(`Failed to create symlink ${d}:`,m.message)}},{concurrency:t$e})}async function n$e(e,t,r,n){if(!e||e.length===0)return 0;try{let{excludePatterns:a,paths:s}=await M4r(e,t),c=q4r(s,a);return c.length===0?0:(await z4r({srcFiles:c,destFolder:r,basePath:t,userNamespace:n}),console.log(`\u{1F4E6} Processed ${c.length} included files`),c.length)}catch(a){throw console.error("Failed to process included files:",a.message),a}}function E$(e,t){if(!e||typeof e!="object")return[];let r=e[t];if(!r||typeof r!="object")return[];let n=r.included_files;return Array.isArray(n)?n.filter(a=>typeof a=="string"&&a.trim()):[]}function w$(e,t,r){if(!e||typeof e!="object")return r;let n=e[t];if(!n||typeof n!="object")return r;let a=n.included_files_base_path;return typeof a=="string"&&a.trim()?a.trim():r}var C$=wr(bM()),S$=wr(g2()),s$e=wr(HV()),ph=wr(Es()),ux=require("path"),a$e=require("fs"),fhe=require("minimatch");function i$e(e,t,r,n){try{let a=(0,ux.resolve)((0,ux.dirname)(t),e);if(!(0,a$e.existsSync)(a))return{isIncluded:!1};let s=(0,ux.relative)(n,a),{include:c,excludePatterns:l}=r.reduce((x,b)=>{if(b.startsWith("!")){let A=(0,ux.resolve)(n,b.slice(1));return{include:x.include,excludePatterns:[...x.excludePatterns,A]}}return{include:[...x.include,b],excludePatterns:x.excludePatterns}},{include:[],excludePatterns:[]}),f={dot:!1,matchBase:!1,noglobstar:!1,nocase:!1},d=c.length===0||c.some(x=>(0,fhe.minimatch)(s,x,f)),m=l.some(x=>(0,fhe.minimatch)(a,x,f));return d&&!m?{isIncluded:!0,originalPath:a,relativePath:s}:{isIncluded:!1}}catch{return{isIncluded:!1}}}function H4r(e,t){let n=(0,ux.normalize)(e);n.startsWith(ux.sep)&&(n=n.slice(1));let a=n.replace(/\\/g,"/");return`join(__dirname, '${t}', '${a}')`}function V4r(e,t,r){let n=[];try{let a=C$.parse(e,{sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,plugins:["typescript","jsx","decorators-legacy","classProperties","objectRestSpread","asyncGenerators","functionBind","exportDefaultFrom","exportNamespaceFrom","dynamicImport","nullishCoalescingOperator","optionalChaining"]}),s=!1;if((0,S$.default)(a,{StringLiteral(l){let{value:f}=l.node;if(typeof f=="string"&&(f.includes("/")||f.includes("\\")||f.includes(".."))){let d=i$e(f,r.sourceFilePath,r.includedFiles,r.basePath);if(d.isIncluded&&d.relativePath){let m=H4r(d.relativePath,r.targetNamespace),g=C$.parseExpression(m);l.replaceWith(g),n.push(f),s=!0}}},TemplateLiteral(l){let{quasis:f}=l.node;f.forEach((d,m)=>{let g=d.value.raw;if(g&&(g.includes("/")||g.includes("\\")||g.includes(".."))){let x=i$e(g,r.sourceFilePath,r.includedFiles,r.basePath);x.isIncluded&&x.relativePath&&(n.push(g),console.warn(`Template literal path transformation needed: ${g} in ${r.sourceFilePath}`))}})}}),s){let l=!1,f=!1;if((0,S$.default)(a,{ImportDeclaration(d){d.node.source.value==="path"&&(l=!0,d.node.specifiers.forEach(m=>{ph.isImportSpecifier(m)&&ph.isIdentifier(m.imported,{name:"join"})&&(f=!0)}))}}),l)f||(0,S$.default)(a,{ImportDeclaration(d){d.node.source.value==="path"&&d.node.specifiers.push(ph.importSpecifier(ph.identifier("join"),ph.identifier("join")))}});else{let d=ph.importDeclaration([ph.importSpecifier(ph.identifier("join"),ph.identifier("join"))],ph.stringLiteral("path"));a.program.body.unshift(d)}}return{code:(0,s$e.default)(a,{retainLines:!1,compact:!1}).code,transformedPaths:n}}catch(a){return console.warn(`Failed to transform paths in ${t}:`,a.message),{code:e,transformedPaths:[]}}}function o$e(e,t,r,n,a="included_files"){if(!r||!r.length)return e;let s=V4r(e,t,{includedFiles:r,basePath:n,targetNamespace:a,sourceFilePath:t});return s.transformedPaths.length>0&&s.transformedPaths.forEach(c=>{console.log(`Copied static files for function: ${c} -> included_files/${c}`)}),s.code}var UM=wr(Ihe()),khe=wr(require("path"));function $3r(e){let{externalModules:t}=e;return!t||t.length===0?[]:t}function W3r(e,t){var r,n,a;try{let s=khe.default.join(e,"package.json");if(!UM.default.existsSync(s))return console.warn(`package.json not found in ${e}, using "latest" for ${t}`),"latest";let c=UM.default.readJsonSync(s),l=((r=c.dependencies)==null?void 0:r[t])||((n=c.devDependencies)==null?void 0:n[t])||((a=c.peerDependencies)==null?void 0:a[t]);return l||(console.warn(`Module ${t} not found in package.json dependencies, using "latest"`),"latest")}catch(s){return console.warn(`Error reading package.json for ${t}:`,s),"latest"}}function G3r(e){let{externalModules:t,projectRoot:r}=e;if(!t||t.length===0)return[];let n=[];for(let a of t){let s=W3r(r,a);n.push({name:a,version:s})}return n}async function Y3r(e){let{externalModules:t,projectRoot:r,outputDir:n}=e,a={name:"edgeone-function-runtime",version:"1.0.0",description:"Runtime dependencies for EdgeOne function",main:"index.mjs",dependencies:{}};if(!t||t.length===0)return a;let s=G3r(e);for(let c of s)a.dependencies[c.name]=c.version;return a}async function J3r(e){let{outputDir:t}=e;try{await UM.default.ensureDir(t);let r=await Y3r(e),n=khe.default.join(t,"package.json");await UM.default.writeJson(n,r,{spaces:2}),console.log(`\u{1F4E6} Generated package.json with ${Object.keys(r.dependencies).length} external dependencies`)}catch(r){throw console.error("Error writing package.json:",r),r}}async function tGe(e){let t=$3r(e);return await J3r(e),t}var O$=wr(require("fs"));function x_(e,t,r){let n=di("edgeone.json");if(O$.default.existsSync(n)){let a=JSON.parse(O$.default.readFileSync(n,"utf-8"));if(a[e])return a[e]}return process.env[t]?process.env[t]:r()}function Q$(){let e=O$.default.readdirSync(di("")),t=e.length===1&&e[0]===".edgeone",r=e.length===2&&e.includes(".edgeone")&&e.includes(".git");return t||r}function L$(e){var n,a,s,c;let t=e.find(l=>(l==null?void 0:l.routePath)==="/"),r=e.find(l=>/\/:(\w+)\*$/.test(l==null?void 0:l.routePath)&&(l==null?void 0:l.mountPath)==="/");if(t){let l=(n=t==null?void 0:t.module[0])==null?void 0:n.split("/")[0],f=(a=t==null?void 0:t.module[0])==null?void 0:a.split("/")[1].replace(/:.*$/,"");Xw(gue()?`\u68C0\u6D4B\u5230 ${l} \u6839\u76EE\u5F55\u4E0B\u5B58\u5728 ${f}\uFF0C\u4F1A\u5BFC\u81F4\u8BBF\u95EE\u7F51\u7AD9\u9996\u9875\u8FDB\u5165\u5230\u8BE5\u51FD\u6570\uFF0C\u5EFA\u8BAE\u653E\u7F6E\u5230 ${l}/api/${f}\uFF0C\u6216\u81EA\u884C\u5728\u51FD\u6570\u5185\u5904\u7406\u9996\u9875\u5185\u5BB9\u7684\u8FD4\u56DE\u3002`:`The file ${f} was detected in the root directory of ${l}. This will cause visiting the website's homepage to trigger this function. It is recommended to place it in ${l}/api/${f} or handle the homepage content return within the function itself.`,`${l}`)}if(r){let l=(s=r==null?void 0:r.module[0])==null?void 0:s.split("/")[0],f=(c=r==null?void 0:r.module[0])==null?void 0:c.split("/")[1].replace(/:.*$/,"");Xw(gue()?`\u68C0\u6D4B\u5230 ${l} \u6839\u76EE\u5F55\u4E0B\u5B58\u5728 ${f}\uFF0C\u4F1A\u5BFC\u81F4\u6839\u8DEF\u5F84\u5916\u5176\u4ED6\u6240\u6709\u8DEF\u5F84\u90FD\u4F1A\u8FDB\u5165\u5230\u8BE5\u51FD\u6570\uFF0C\u5EFA\u8BAE\u653E\u7F6E\u5230 ${l}/api/${f}\uFF0C\u6216\u81EA\u884C\u5728\u51FD\u6570\u5185\u5904\u7406\u9759\u6001\u8D44\u6E90\u7684\u8FD4\u56DE\u3002`:`The file ${f} was detected in the root directory of ${l}. This will cause all other paths outside the root to trigger this function. It is recommended to place it in ${l}/api/${f} or handle static resource returns within the function itself.`,`${l}`)}}function K3r(e){for(var t=[],r=0;r<e.length;){var n=e[r];if(n==="*"||n==="+"||n==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(n==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(n==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(n==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(n===":"){for(var a="",s=r+1;s<e.length;){var c=e.charCodeAt(s);if(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||c===95){a+=e[s++];continue}break}if(!a)throw new TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:a}),r=s;continue}if(n==="("){var l=1,f="",s=r+1;if(e[s]==="?")throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;){if(e[s]==="\\"){f+=e[s++]+e[s++];continue}if(e[s]===")"){if(l--,l===0){s++;break}}else if(e[s]==="("&&(l++,e[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+s);f+=e[s++]}if(l)throw new TypeError("Unbalanced pattern at "+r);if(!f)throw new TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:f}),r=s;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}function X3r(e,t){t===void 0&&(t={});for(var r=K3r(e),n=t.prefixes,a=n===void 0?"./":n,s="[^"+ZN(t.delimiter||"/#?")+"]+?",c=[],l=0,f=0,d="",m=function(se){if(f<r.length&&r[f].type===se)return r[f++].value},g=function(se){var X=m(se);if(X!==void 0)return X;var ve=r[f],ae=ve.type,he=ve.index;throw new TypeError("Unexpected "+ae+" at "+he+", expected "+se)},x=function(){for(var se="",X;X=m("CHAR")||m("ESCAPED_CHAR");)se+=X;return se};f<r.length;){var b=m("CHAR"),A=m("NAME"),C=m("PATTERN");if(A||C){var I=b||"";a.indexOf(I)===-1&&(d+=I,I=""),d&&(c.push(d),d=""),c.push({name:A||l++,prefix:I,suffix:"",pattern:C||s,modifier:m("MODIFIER")||""});continue}var k=b||m("ESCAPED_CHAR");if(k){d+=k;continue}d&&(c.push(d),d="");var O=m("OPEN");if(O){var I=x(),j=m("NAME")||"",M=m("PATTERN")||"",W=x();g("CLOSE"),c.push({name:j||(M?l++:""),pattern:j&&!M?s:M,prefix:I,suffix:W,modifier:m("MODIFIER")||""});continue}g("END")}return c}function ZN(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function rGe(e){return e&&e.sensitive?"":"i"}function Z3r(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}function eLr(e,t,r){var n=e.map(function(a){return zM(a,t,r).source});return new RegExp("(?:"+n.join("|")+")",rGe(r))}function tLr(e,t,r){return rLr(X3r(e,r),t,r)}function rLr(e,t,r){r===void 0&&(r={});for(var n=r.strict,a=n===void 0?!1:n,s=r.start,c=s===void 0?!0:s,l=r.end,f=l===void 0?!0:l,d=r.encode,m=d===void 0?function(se){return se}:d,g="["+ZN(r.endsWith||"")+"]|$",x="["+ZN(r.delimiter||"/#?")+"]",b=c?"^":"",A=0,C=e;A<C.length;A++){var I=C[A];if(typeof I=="string")b+=ZN(m(I));else{var k=ZN(m(I.prefix)),O=ZN(m(I.suffix));if(I.pattern)if(t&&t.push(I),k||O)if(I.modifier==="+"||I.modifier==="*"){var j=I.modifier==="*"?"?":"";b+="(?:"+k+"((?:"+I.pattern+")(?:"+O+k+"(?:"+I.pattern+"))*)"+O+")"+j}else b+="(?:"+k+"("+I.pattern+")"+O+")"+I.modifier;else b+="("+I.pattern+")"+I.modifier;else b+="(?:"+k+O+")"+I.modifier}}if(f)a||(b+=x+"?"),b+=r.endsWith?"(?="+g+")":"$";else{var M=e[e.length-1],W=typeof M=="string"?x.indexOf(M[M.length-1])>-1:M===void 0;a||(b+="(?:"+x+"(?="+g+"))?"),W||(b+="(?="+x+"|"+g+")")}return new RegExp(b,rGe(r))}function zM(e,t,r){return e instanceof RegExp?Z3r(e,t):Array.isArray(e)?eLr(e,t,r):tLr(e,t,r)}var Bhe=wr(g2()),Dhe=wr(HV()),Am=wr(Es()),qs=wr(require("fs")),fo=wr(require("path")),b_=wr(require("esbuild"));function nGe(){return`
1242
1242
  async function handleResponse(res, response, passHeaders = {}) {
1243
1243
  const startTime = Date.now();
1244
1244
 
@@ -3354,8 +3354,8 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
3354
3354
  [StaticAssetsBuilder] Start to execute...`),Q$()){console.log("[StaticAssetsBuilder] Project directory only contains .edgeone directory, skipping build step");return}let r=new Date().getTime(),n=di(".edgeone/assets");Kc.default.existsSync(n)&&Kc.default.rmSync(n,{recursive:!0,force:!0});let a;try{a=await iJe(di(""))}catch(g){Kr(`Framework detection failed: ${g.message}`,"StaticAssetsBuilder");return}console.log("[StaticAssetsBuilder] DescribeFramework time:",new Date().getTime()-r+"ms");let s=!1,c=di("package.json");if(Kc.default.existsSync(c)){let g=JSON.parse(Kc.default.readFileSync(c,"utf-8"));g.scripts&&g.scripts.build&&(s=!0)}if(x_("buildCommand","BuildCommand",()=>"")&&(s=!0),r=new Date().getTime(),a.Framework==="other"&&!s){try{nKe()}catch(g){Kr(`${g.message}`,"StaticAssetsBuilder"),process.exit(1)}console.log("[StaticAssetsBuilder] MoveProjectToAssets time:",new Date().getTime()-r+"ms");return}let l="",f="",d=a.Framework==="next",m=a.Framework==="nuxt";if(d){let g=Mqr();l=g.configBackupPath,f=g.configPath}try{let g=Lqr();console.log("[StaticAssetsBuilder] BuildScript:",g),r=new Date().getTime(),g&&g.trim()?await u0e(g,this.env):console.log("[StaticAssetsBuilder] No build script configured, skipping build step"),console.log("[StaticAssetsBuilder] BuildCommand execute time:",new Date().getTime()-r+"ms"),r=new Date().getTime();let x=["next","nuxt"].includes(a.Framework);if(a.Framework==="nuxt"){let A=di("")||"",C=await OH(A)||"1.0.0";x=c0e(C)}let b=Kc.default.existsSync(n);if(!x&&!b)try{let A=di(l0e(a));if(console.log(`[StaticAssetsBuilder] BuildResultInfos: OutputDir:${l0e(a)}, Source:${A}, Target:${n}`),!Kc.default.existsSync(A)){if(a.Framework==="hono")return;Kr(`The output directory ${A} for static assets build artifacts does not exist. Please check your build configuration and set edgeone.json. Refer to https://edgeone.ai/document/162316940304400384?product=edgedeveloperplatform`,"StaticAssetsBuilder");return}n.startsWith(A)?nKe():(A=iKe(A),Qqr.copySync(A,n,{recursive:!0}))}catch(A){Kr(`${A.message}
3355
3355
  If you configured the output directory yourself, please add it to edgeone.json. Refer to https://edgeone.ai/document/162316940304400384?product=edgedeveloperplatform`,"StaticAssetsBuilder"),process.exit(1)}console.log("[StaticAssetsBuilder] MoveProjectToAssets time:",new Date().getTime()-r+"ms"),r=new Date().getTime()}catch(g){Kr(`${g.message}`,"StaticAssetsBuilder"),process.exit(1)}finally{l&&(Kc.default.copyFileSync(l,f),Kc.default.unlinkSync(l))}}};function Lqr(){return x_("buildCommand","BuildCommand",()=>jqr(_W()))}function l0e(e){return x_("outputDirectory","OutputDir",()=>e.OutputDir)}function jqr(e){let t=di("package.json"),r=!1;if(Kc.default.existsSync(t))try{let n=JSON.parse(Kc.default.readFileSync(t,"utf-8"));r=n.scripts&&n.scripts.build}catch{console.log("[builder] Project does not have a package.json")}if(!r)return console.log("[builder] No build script found in package.json, skipping build step"),"";switch(e){case"yarn":return"yarn build";case"pnpm":return"pnpm run build";case"bun":return"bun run build";default:return"npm run build"}}function Mqr(){let e="",t="",r=di("tsconfig.json"),n=di("jsconfig.json");if(Kc.default.existsSync(r))t=r;else if(Kc.default.existsSync(n))t=n;else return{configBackupPath:"",configPath:""};e=AF.default.join(di(".edgeone"),AF.default.basename(t)+".backup.json"),Kc.default.existsSync(e)||Kc.default.mkdirSync(AF.default.dirname(e),{recursive:!0}),Kc.default.copyFileSync(t,e);let a=JSON.parse(Kc.default.readFileSync(t,"utf-8"));return a.exclude||(a.exclude=[]),a.exclude.includes("node-functions")||a.exclude.push("node-functions"),a.exclude.includes("edge-functions")||a.exclude.push("edge-functions"),a.exclude.includes("functions")||a.exclude.push("functions"),Kc.default.writeFileSync(t,JSON.stringify(a)),{configBackupPath:e,configPath:t}}function nKe(){let e=di(".edgeone/assets");Kc.default.mkdirSync(e,{recursive:!0});let t=di(l0e({OutputDir:""}));t=iKe(t);let r=["node_modules","cloud-functions","node-functions","edge-functions","functions",".vercel",".gitignore",".git",".vscode",".edgeone",new RegExp("^\\.(?!\\.?$)[^/]+$")];console.log(`[StaticAssetsBuilder] Copying files from ${t} to ${e}`);try{let n=Kc.default.readdirSync(t);for(let a of n){if(r.includes(a)||r.some(l=>l instanceof RegExp&&l.test(a))){console.log(`[StaticAssetsBuilder] Skipping excluded item: ${a}`);continue}let s=AF.default.join(t,a),c=AF.default.join(e,a);try{Kc.default.statSync(s).isDirectory()?(Kc.default.cpSync(s,c,{recursive:!0,force:!0}),console.log(`[StaticAssetsBuilder] Copied directory: ${a}`)):(Kc.default.copyFileSync(s,c),console.log(`[StaticAssetsBuilder] Copied file: ${a}`))}catch(l){console.warn(`[StaticAssetsBuilder] Failed to copy ${a}: ${l.message}`)}}console.log(`[StaticAssetsBuilder] Successfully copied project files to ${e}`)}catch(n){throw console.error(`[StaticAssetsBuilder] Error copying files: ${n.message}`),n}}function iKe(e){let t=e;return Kc.default.lstatSync(e).isSymbolicLink()&&(t=Kc.default.readlinkSync(e)),t}var xm=wr(require("fs")),fKe=wr(require("path"));var DW=wr(require("fs")),k_=wr(require("path")),TW=class{children=new Map;isEndOfPath=!1;hasWildcardChild=!1},BW=class{root=new TW;_hasWildcard=!1;insert(t){let r=this.root;for(let n of t){if(n==="*"){r.hasWildcardChild=!0;break}r.children.has(n)||r.children.set(n,new TW),r=r.children.get(n)}r.isEndOfPath=!0}dfs(t,r,n){if(t.hasWildcardChild){this._hasWildcard=!0,n.push([...r,"*"]);return}t.isEndOfPath&&n.push([...r]);for(let[a,s]of t.children)this.dfs(s,[...r,a],n)}reduce(t,r){if(!(r.hasWildcardChild||t.hasWildcardChild))for(let[n,a]of r.children){if(a.children.size===0)continue;let s=t.children.get(n);if(s===void 0){a.children.size>1&&(a.hasWildcardChild=!0);continue}this.reduce(s,a)}}reduceAllPaths(t){return this.reduce(t.root,this.root),this}getAllPaths(){let t=[];return this._hasWildcard=!1,this.dfs(this.root,[],t),[t,this._hasWildcard]}};function qqr(e){return e.startsWith("^")||/\(\[\^\/\]/.test(e)||/\(\.\+\)/.test(e)?"regex":/\[[^\]]+\]/.test(e)?"bracket":"param"}function Uqr(e){let t=e.replace(/^\^/,"").replace(/\$$/,"");return t=t.replace(/\([^)]*\)\?/g,""),t=t.replace(/\([^)]+\)/g,"___DYNAMIC___"),t.split(/\\?\//).filter(Boolean).map(n=>n==="___DYNAMIC___"||n.includes("___DYNAMIC___")||/\.\*|\.\+|\.\[\^[^\]]*\][\*\+]?|\[\^[^\]]*\][\*\+]?|\\[dDwWsS][\*\+]?/.test(n)?"*":n.replace(/\\/g,""))}function zqr(e){return e.split("/").filter(Boolean).map(r=>r.startsWith(":")||r==="*"||r==="**"||r===".*"||r===".+"||/^\[\^[^\]]*\][\*\+]?$/.test(r)?"*":r)}function Hqr(e){return e.split("/").filter(Boolean).map(r=>/\[[^\]]+\]/.test(r)?"*":r)}function sKe(e){return e.split("/").filter(Boolean)}function cKe(e){switch(qqr(e)){case"regex":return Uqr(e);case"bracket":return Hqr(e);case"param":default:return zqr(e)}}function N2(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function aKe(e){return e.length===0?"/":"/"+e.map((r,n)=>r==="*"?n===e.length-1?".*":"[^/]+":N2(r)).join("/")}function Vqr(e){return e.length===0?"/":"/"+e.join("/")}function $qr(e){let t=new Map;for(let r of e)for(let n of e)if(n!==r&&n.startsWith(r+"/")){let a=n.slice(r.length);if(!a.includes(".")||(a.match(/\//g)||[]).length>1)continue;t.has(r)||t.set(r,[]),t.get(r).push(a)}return t}function Wqr(e,t){return(t.get(e)||[]).sort().join("|")}function Gqr(e,t){let r=new Map;for(let n of e){if(n.endsWith("/*")||n.endsWith("/.*")||n==="/")continue;let a=!1;for(let[d,m]of t){for(let g of m)if(n===d+g){a=!0;break}if(a)break}if(a)continue;let s=n.lastIndexOf("/"),c=s>0?n.slice(0,s):"/",l=Wqr(n,t),f=`${c}::${l}`;r.has(f)||r.set(f,{routes:[],suffixes:t.get(n)||[]}),r.get(f).routes.push(n)}return r}function Yqr(e,t){let{minSiblingsToMerge:r,maxGroupSize:n}=t,a=[],s=[];for(let d of e)d.endsWith("/.*")?a.push(d):s.push(d);let c=$qr(s),l=Gqr(s,c),f=[...a];s.includes("/")&&f.push("/");for(let[d,m]of l){let{routes:g,suffixes:x}=m,b=d.split("::")[0];if(g.length>=r)for(let A=0;A<g.length;A+=n){let I=g.slice(A,A+n).map(j=>{let M=j.lastIndexOf("/");return M>0?j.slice(M+1):j.slice(1)}),k,O=N2(b);if(b==="/"?k="/("+I.map(N2).join("|")+")":k=O+"/("+I.map(N2).join("|")+")",x.length>0){let j=x.map(N2).join("|");k+="(?:$|"+j+")"}f.push(k)}else for(let A of g){let C=c.get(A)||[],I=N2(A);if(C.length>0){let k=C.map(N2).join("|");f.push(I+"(?:$|"+k+")")}else f.push(I)}}return f}function uKe(e,t,r=[]){if(!DW.existsSync(e))return r;let n=DW.readdirSync(e,{withFileTypes:!0});for(let a of n){let s=k_.join(e,a.name);if(a.isDirectory())uKe(s,t,r);else if(a.isFile()){let l="/"+k_.relative(t,s).replace(/\\/g,"/");r.push(l)}}return r}function Jqr(e){if(e.endsWith("/index.html")){let t=e.slice(0,-11);return t===""?"/":t}return e.endsWith(".html")?e.slice(0,-5):e}function Kqr(e){let t=new Set;for(let r of e)t.add(Jqr(r));return Array.from(t)}function Xqr(e){let t=cKe(e),r=[];for(let n of t){if(n==="*")break;r.push(n)}return r.length>0?"/"+r.join("/"):"/"}function Zqr(e){if(!/\*|\.\+|\[\^[^\]]*\]|\\[dDwWsS]|\(/.test(e))return null;let r=e.split(/\//).filter(Boolean),n=[];for(let a of r){if(/\*|\.\+|\[\^[^\]]*\]|\\[dDwWsS]|\(/.test(a))break;n.push(a)}return n.length>0?"/"+n.join("/"):"/"}function e5r(e,t){for(let r of e){let n=Zqr(r);if(n!==null)for(let a of t){let s=Xqr(a);(s.startsWith(n+"/")||s===n)&&console.warn(`\u26A0\uFE0F Warning: customRoutes.static "${r}" may cover dynamicRoute "${a}"`)}}}function lKe(e){if(e.startsWith("^")||/\(\[\^[^\]]*\]/.test(e)||/\(\.\+\)/.test(e)||/\.\*/.test(e)||/\.\+/.test(e))return e;if(/(?<!\.)(\*\*|\*)/.test(e)){let t=e;return t=t.replace(/\*\*/g,"___DOUBLE_STAR___"),t=t.replace(/\*/g,"___SINGLE_STAR___"),t=N2(t),t=t.replace(/___DOUBLE_STAR___/g,".*"),t=t.replace(/___SINGLE_STAR___/g,"[^/]*"),t}return N2(e)}function t5r(e){return e.map(t=>{let r=lKe(t);return r.startsWith("^")||(r="^"+r),r.endsWith("$")||(r=r+"$"),new RegExp(r)})}function oKe(e,t){return t.some(r=>r.test(e))}function r5r(e,t=[],r={},n={}){var O,j;let{enabled:a=!0,minSiblingsToMerge:s=2,maxGroupSize:c=50}=n,l=(O=r.static)!=null?O:[],f=(j=r.dynamic)!=null?j:[],d=[...t,...f];l.length>0&&d.length>0&&e5r(l,d);let m=l.map(lKe),g=t5r(l);if(!a){let M=e.filter(W=>!oKe(W,g)).map(W=>{let se=sKe(W);return aKe(se)});return[...new Set([...m,...M])]}let x=new BW;for(let M of e){if(M==="*"||M==="/*"||oKe(M,g))continue;let W=sKe(M);x.insert(W)}let b=new BW;for(let M of d){let W=cKe(M);W.length>0&&W[0]!=="*"&&b.insert(W)}let[A]=x.reduceAllPaths(b).getAllPaths(),C=[];for(let M of A)M.length>0&&M[M.length-1]==="*"?C.push(aKe(M)):C.push(Vqr(M));let I=Yqr(C,{minSiblingsToMerge:s,maxGroupSize:c}),k=[...new Set([...m,...I])];return k.sort((M,W)=>{let se=M.includes("/.*")||M.includes("[^/]*"),X=W.includes("/.*")||W.includes("[^/]*");return se&&!X?-1:!se&&X?1:M.localeCompare(W)}),k}function pKe(e,t=[],r={}){let n=k_.isAbsolute(e)?e:k_.resolve(process.cwd(),e),a=uKe(n,n),s=Kqr(a),c=r5r(s,t,r);return{routes:s,compressedRoutes:c,totalFiles:a.length}}function p0e(e){try{if(xm.default.existsSync(e)){let t=xm.default.readFileSync(e,"utf-8");return JSON.parse(t)}}catch(t){console.warn(`Warning: Failed to read or parse meta file ${e}:`,t)}return{}}function f0e(e){try{return xm.default.existsSync(e)?xm.default.readdirSync(e).length>0:!1}catch(t){return console.warn(`Warning: Failed to check directory ${e}:`,t),!1}}function dKe(e,t){if(typeof e!="object"||e===null)return t;if(typeof t!="object"||t===null)return e;let r={...e};for(let n in t)t.hasOwnProperty(n)&&(Array.isArray(t[n])?Array.isArray(e[n])?r[n]=[...e[n],...t[n]]:r[n]=t[n]:typeof t[n]=="object"&&t[n]!==null?r[n]=dKe(e[n],t[n]):r[n]=t[n]);return r}var d0e=new Map;function h0e(e,t){d0e.set(e,t)}h0e("node-function",eF);h0e("edge-function",tF);h0e("static-assets",kW);async function hKe(){var b,A,C,I,k,O;let e=f0e("./node-functions"),t=f0e("./functions")||f0e("./edge-functions"),r="./.edgeone/node-functions/meta.json",n="./.edgeone/edge-functions/meta.json",a={},s=await my(!1)||{};if("nodeFunctionsConfig"in s&&s.nodeFunctionsConfig){a.nodeFunctionsConfig=s.nodeFunctionsConfig;let{nodeFunctionsConfig:j,...M}=s;a.conf=M}else a.conf=s;let c="./.edgeone/assets";function l(j){let M=xm.default.readdirSync(j,{withFileTypes:!0});for(let W of M)if(!W.isDirectory()&&W.name==="404.html")return!0;return!1}a.has404=!1,xm.default.existsSync(c)&&l(c)&&(a.has404=!0),a.conf.has404=a.has404,await PM();let f="./.edgeone/server-handler/meta.json";if(xm.default.existsSync(f)){let j=p0e(f);a=dKe(a,j)}if(((b=a.frameworkRoutes)==null?void 0:b.length)>0||((A=a.nextRoutes)==null?void 0:A.length)>0){console.log("[cli] Generate static routes");let j={static:[],dynamic:[]},M=di("edgeone.json");if(xm.default.existsSync(M))try{let{routesExtend:ve}=JSON.parse(xm.default.readFileSync(M).toString());j.dynamic=(C=ve==null?void 0:ve.dynamic)!=null?C:[],j.static=(I=ve==null?void 0:ve.static)!=null?I:[]}catch(ve){console.warn("Warning: Failed to read edgeone.json:",ve)}let W=[...(k=a.frameworkRoutes)!=null?k:[],...(O=a.nextRoutes)!=null?O:[]].filter(ve=>!ve.isStatic).map(ve=>ve.regexPath||ve.path),se=pKe("./.edgeone/assets",W,j);a.frameworkRoutes=se.compressedRoutes.map(ve=>({regexPath:ve,isStatic:!0})),a.nextRoutes&&delete a.nextRoutes,xm.default.existsSync("./.edgeone/server-handler/index.mjs")&&(console.log("[cli] SSR enabled"),a.conf.ssr404=!0)}if(e){let j=p0e(r);Object.keys(j).length===0&&console.warn("Warning: Node functions exist but meta file is missing or empty"),a.nodeFunctionsRoutes=j.routes}let d=xm.default.existsSync(n);if(t||d){let j=p0e(n);t&&Object.keys(j).length===0&&console.warn("Warning: Edge functions exist but meta file is missing or empty"),t&&(a.edgeFunctionsRoutes=j.routes),j&&j.middleware&&(a.middleware=j.middleware)}let m="./.edgeone";xm.default.existsSync(m)||xm.default.mkdirSync(m,{recursive:!0});let g=JSON.stringify(a,null,2),x=Buffer.byteLength(g,"utf8");x>16384&&console.warn("\u26A0\uFE0F Warning: Meta file is too large",x);try{xm.default.writeFileSync(fKe.default.join(m,"meta.json"),g)}catch(j){console.warn("Warning: Failed to write merged meta file:",j)}}async function mKe({mode:e,env:t,installCommand:r,external:n}){let a=[];for(let[s,c]of d0e)if(s==="static-assets"&&await c.decide(e)){a.push({type:s,builder:new c({mode:e,env:t,installCommand:r})});break}for(let[s,c]of d0e)s!=="static-assets"&&await c.decide(e)&&a.push({type:s,builder:new c({mode:e,env:t,installCommand:r,external:n})});return a}var gKe=wr(require("path"));var yF=class{plugins=[];cwd;constructor(t){this.cwd=t}async loadPlugins(t){if(t.plugins)for(let r of t.plugins)try{let n;if(this.isPluginObject(r))n=r,ei("Loaded internal plugin","plugins");else{let a,s={};Array.isArray(r)?[a,s]=r:a=r,(a.startsWith("./")||a.startsWith("../"))&&(a=gKe.default.resolve(this.cwd,a));let c=await Function("pluginPath","return import(pluginPath)")(a),l=c.default||c;typeof l.configure=="function"&&l.configure(s),n=l,ei(`Loaded external plugin from ${a}`,"plugins")}this.plugins.push(n)}catch(n){throw Kr(`Failed to load plugin ${JSON.stringify(r)}: ${n.message}`,"plugins"),n}}isPluginObject(t){return!t||typeof t!="object"?!1:"name"in t&&"hooks"in t?!0:["onPreBuild","onBuild","onPreDev","onDev"].some(r=>typeof t[r]=="function")}async executeHook(t,r){for(let n of this.plugins)try{let a="hooks"in n?n.hooks[t]:n[t];typeof a=="function"&&await a(r)}catch(a){Kr(`Error executing ${t} hook: ${a.message}`,"plugins"),process.exit(1)}}async onPreBuild(t){await this.executeHook("onPreBuild",t)}async onBuild(t){await this.executeHook("onBuild",t)}async onPreDev(t){await this.executeHook("onPreDev",t)}async onDev(t){await this.executeHook("onDev",t)}async onPostBuild(t){await this.executeHook("onPostBuild",t)}};var p8=require("fs"),PW=require("path"),ali=require("esbuild");async function RW(e){var A,C,I,k,O,j,M;let t=process.cwd(),{ENV_STR:r="",env:n,installCommand:a,external:s=""}=e,c=r?{NG_CLI_ANALYTICS:(A=process.env.NG_CLI_ANALYTICS)!=null?A:"false",NUXT_TELEMETRY_DISABLED:(C=process.env.NUXT_TELEMETRY_DISABLED)!=null?C:"1",COREPACK_ENABLE_DOWNLOAD_PROMPT:(I=process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT)!=null?I:"0",COREPACK_ENABLE_STRICT:(k=process.env.COREPACK_ENABLE_STRICT)!=null?k:"0",YARN_ENABLE_INTERACTIVE:(O=process.env.YARN_ENABLE_INTERACTIVE)!=null?O:"0",NPM_CONFIG_YES:(j=process.env.NPM_CONFIG_YES)!=null?j:"true",CI:(M=process.env.CI)!=null?M:"true",TMPDIR:process.env.TMPDIR,YARN_CACHE_FOLDER:process.env.YARN_CACHE_FOLDER,PNPM_STORE_DIR:process.env.PNPM_STORE_DIR,BUN_TMPDIR:process.env.BUN_TMPDIR,BUN_INSTALL_CACHE_DIR:process.env.BUN_INSTALL_CACHE_DIR,BUN_INSTALL_GLOBAL_DIR:process.env.BUN_INSTALL_GLOBAL_DIR,...JSON.parse(r)}:n||process.env||{};if(Q$()){await PM(),console.log("[builder] project only contains .edgeone directory, skipping build");return}if(PW.basename(t)===".edgeone"){await PM(),console.log("[builder] running build command in .edgeone directory, skipping build");return}await rKe(a,c);let f=new yF(t);console.log("inited plugin manager");let d=new Date().getTime(),m=await my();console.log("getTefConfigMeta time",new Date().getTime()-d),d=new Date().getTime();let g=await IW(t,m);await f.loadPlugins(g),console.log("resolvePlugins time",new Date().getTime()-d+"ms"),d=new Date().getTime(),await f.onPreBuild({cwd:t,env:c,config:m}),d=new Date().getTime();let x=PW.join(t,".edgeone");if(p8.existsSync(x)){let W=PW.join(x,"edge-functions"),se=PW.join(x,"node-functions");if(p8.existsSync(W))try{p8.rmSync(W,{recursive:!0,force:!0})}catch(X){console.warn("Failed to remove .edgeone/edge-functions:",X.message)}if(p8.existsSync(se))try{p8.rmSync(se,{recursive:!0,force:!0})}catch(X){console.warn("Failed to remove .edgeone/node-functions:",X.message)}}let b=await mKe({mode:"prod",env:c,installCommand:a,external:s});console.log("decideBuilders time",new Date().getTime()-d+"ms"),d=new Date().getTime();for(let W of b)try{await W.builder.build()}catch(se){console.error("%c [ e ]-188","font-size:13px; background:pink; color:#bf2c9f;","Builder Error:",se),process.exit(1)}console.log("build time",new Date().getTime()-d+"ms"),d=new Date().getTime(),await f.onBuild({cwd:t,env:c,config:m,getRuntimeShim:()=>EN}),console.log("onBuild time",new Date().getTime()-d+"ms"),d=new Date().getTime(),await f.onPostBuild({cwd:t,env:c,config:m}),console.log("onPostBuild time",new Date().getTime()-d+"ms"),d=new Date().getTime(),await hKe(),console.log("buildMeta time",new Date().getTime()-d+"ms")}async function AKe(e){try{let t=await my();if(!t)return;let n=v5e(t).map(({key:a,value:s})=>`export ${a}='${s}'`).join(`
3356
3356
  `);uy("./.edgeone/ci.rc",n)}catch(t){console.error("%c [ e ]-188","font-size:13px; background:pink; color:#bf2c9f;",t)}}var vKe=wr(Cc()),xKe=wr(OR()),bKe=wr(xae());var m0e=wr(require("fs")),g0e=async e=>{let r=await D0("DescribePagesProjectEnvs",{ProjectId:e}),{EnvVars:n}=r;return n},T_=async(e,t,r=".env")=>{let n=di(`./${r}`),a={};try{a=qR(n)}catch{ei(`No existing ${r} file found, will create new one`)}let s=[];Object.keys(a).forEach(g=>{s.push({Key:g,Value:a[g]})}),ei("Pulling environment variables...");let c;t?c=await t(e):c=await D0("DescribePagesProjectEnvs",{ProjectId:e}).catch(g=>{console.error(g)});let l=c,{EnvVars:f}=l,d=new Map;s.forEach(g=>{d.set(g.Key,g.Value)}),f.forEach(g=>{d.set(g.Key,g.Value)});let m="";d.forEach((g,x)=>{m+=`${x}=${g}
3357
- `}),uy(n,m),f&&f.length>0?ma(`Pulling environment variables to ${r} succeed!`):ei("No environment variables found.")},EKe=async e=>{let t=await g0e(e);if(t.length===0){ei("No environment variables found.");return}(0,xKe.render)(vKe.createElement(bKe.default,{data:t.map(r=>({Key:r.Key,Value:r.Value}))}))},yKe=async(e,t,r,n)=>{let a=await D0("ModifyPagesProjectEnvs",{ProjectId:e,EnvVars:[{Key:t,Value:r+""}]});if(n)return!(a!=null&&a.Message);a!=null&&a.Message?Kr(`Add environment ${t} variables failed!`):ma(`Add environment ${t} variables succeed!`)},wKe=async(e,t,r)=>{if(!t||!r)return Kr("Variable name and value cannot be empty."),!1;if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(t))return Kr("Variable names must start with a letter and can only contain letters, numbers, and underscores."),!1;if(!(await g0e(e)).find(c=>c.Key===t))await yKe(e,t,r);else{let c=await A0e(e,t,!0),l=await yKe(e,t,r,!0);c&&l?ma(`Update environment ${t} variables succeed!`):Kr(`Update environment ${t} variables failed!`)}let s=di("./.env");if(m0e.default.existsSync(s)){let c=qR(s);c[t]=r;let l="";Object.keys(c).forEach(f=>{l+=`${f}=${c[f]}
3358
- `}),uy(s,l)}},A0e=async(e,t,r)=>{if(!(await g0e(e)).find(c=>c.Key===t))return Kr(`Environment variable ${t} does not exist, no need to remove.`),!1;let a=await D0("DeletePagesProjectEnvs",{ProjectId:e,EnvVars:[t]},{tipLoading:!1});if(r)return!(a!=null&&a.Message);a!=null&&a.Message?Kr(`Remove environment ${t} variables failed!`):ma(`Remove environment ${t} variables succeed!`);let s=di("./.env");if(m0e.default.existsSync(s)){let c=qR(s);delete c[t];let l="";Object.keys(c).forEach(f=>{l+=`${f}=${c[f]}
3357
+ `}),uy(n,m),f&&f.length>0?da(`Pulling environment variables to ${r} succeed!`):ei("No environment variables found.")},EKe=async e=>{let t=await g0e(e);if(t.length===0){ei("No environment variables found.");return}(0,xKe.render)(vKe.createElement(bKe.default,{data:t.map(r=>({Key:r.Key,Value:r.Value}))}))},yKe=async(e,t,r,n)=>{let a=await D0("ModifyPagesProjectEnvs",{ProjectId:e,EnvVars:[{Key:t,Value:r+""}]});if(n)return!(a!=null&&a.Message);a!=null&&a.Message?Kr(`Add environment ${t} variables failed!`):da(`Add environment ${t} variables succeed!`)},wKe=async(e,t,r)=>{if(t==null||r===null||r===void 0)return Kr("Variable name and value cannot be empty."),!1;if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(t))return Kr("Variable names must start with a letter and can only contain letters, numbers, and underscores."),!1;if(!(await g0e(e)).find(c=>c.Key===t))await yKe(e,t,r);else{let c=await A0e(e,t,!0),l=await yKe(e,t,r,!0);c&&l?da(`Update environment ${t} variables succeed!`):Kr(`Update environment ${t} variables failed!`)}let s=di("./.env");if(m0e.default.existsSync(s)){let c=qR(s);c[t]=r;let l="";Object.keys(c).forEach(f=>{l+=`${f}=${c[f]}
3358
+ `}),uy(s,l)}},A0e=async(e,t,r)=>{if(!(await g0e(e)).find(c=>c.Key===t))return Kr(`Environment variable ${t} does not exist, no need to remove.`),!1;let a=await D0("DeletePagesProjectEnvs",{ProjectId:e,EnvVars:[t]},{tipLoading:!1});if(r)return!(a!=null&&a.Message);a!=null&&a.Message?Kr(`Remove environment ${t} variables failed!`):da(`Remove environment ${t} variables succeed!`);let s=di("./.env");if(m0e.default.existsSync(s)){let c=qR(s);delete c[t];let l="";Object.keys(c).forEach(f=>{l+=`${f}=${c[f]}
3359
3359
  `}),uy(s,l)}};var Pet=wr(require("http")),Ret=wr(GKe()),Net=wr(OXe());var QXe=(e=0)=>t=>`\x1B[${t+e}m`,LXe=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,jXe=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ju={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Oli=Object.keys(ju.modifier),V5r=Object.keys(ju.color),$5r=Object.keys(ju.bgColor),Qli=[...V5r,...$5r];function W5r(){let e=new Map;for(let[t,r]of Object.entries(ju)){for(let[n,a]of Object.entries(r))ju[n]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},r[n]=ju[n],e.set(a[0],a[1]);Object.defineProperty(ju,t,{value:r,enumerable:!1})}return Object.defineProperty(ju,"codes",{value:e,enumerable:!1}),ju.color.close="\x1B[39m",ju.bgColor.close="\x1B[49m",ju.color.ansi=QXe(),ju.color.ansi256=LXe(),ju.color.ansi16m=jXe(),ju.bgColor.ansi=QXe(10),ju.bgColor.ansi256=LXe(10),ju.bgColor.ansi16m=jXe(10),Object.defineProperties(ju,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let a=Number.parseInt(n,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:t=>ju.rgbToAnsi256(...ju.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,a;if(t>=232)r=((t-232)*10+8)/255,n=r,a=r;else{t-=16;let l=t%36;r=Math.floor(t/36)/5,n=Math.floor(l/6)/5,a=l%6/5}let s=Math.max(r,n,a)*2;if(s===0)return 30;let c=30+(Math.round(a)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ju.ansi256ToAnsi(ju.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ju.ansi256ToAnsi(ju.hexToAnsi256(t)),enumerable:!1}}),ju}var G5r=W5r(),gx=G5r;var jW=wr(require("process"),1),qXe=wr(require("os"),1),D0e=wr(require("tty"),1);function By(e,t=globalThis.Deno?globalThis.Deno.args:jW.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),a=t.indexOf("--");return n!==-1&&(a===-1||n<a)}var{env:Mu}=jW.default,LW;By("no-color")||By("no-colors")||By("color=false")||By("color=never")?LW=0:(By("color")||By("colors")||By("color=true")||By("color=always"))&&(LW=1);function Y5r(){if("FORCE_COLOR"in Mu)return Mu.FORCE_COLOR==="true"?1:Mu.FORCE_COLOR==="false"?0:Mu.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Mu.FORCE_COLOR,10),3)}function J5r(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function K5r(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Y5r();n!==void 0&&(LW=n);let a=r?LW:n;if(a===0)return 0;if(r){if(By("color=16m")||By("color=full")||By("color=truecolor"))return 3;if(By("color=256"))return 2}if("TF_BUILD"in Mu&&"AGENT_NAME"in Mu)return 1;if(e&&!t&&a===void 0)return 0;let s=a||0;if(Mu.TERM==="dumb")return s;if(jW.default.platform==="win32"){let c=qXe.default.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in Mu)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(c=>c in Mu)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(c=>c in Mu)||Mu.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Mu)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Mu.TEAMCITY_VERSION)?1:0;if(Mu.COLORTERM==="truecolor"||Mu.TERM==="xterm-kitty"||Mu.TERM==="xterm-ghostty"||Mu.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Mu){let c=Number.parseInt((Mu.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Mu.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Mu.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Mu.TERM)||"COLORTERM"in Mu?1:s}function MXe(e,t={}){let r=K5r(e,{streamIsTTY:e&&e.isTTY,...t});return J5r(r)}var X5r={stdout:MXe({isTTY:D0e.default.isatty(1)}),stderr:MXe({isTTY:D0e.default.isatty(2)})},UXe=X5r;function zXe(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let a=t.length,s=0,c="";do c+=e.slice(s,n)+t+r,s=n+a,n=e.indexOf(t,s);while(n!==-1);return c+=e.slice(s),c}function HXe(e,t,r,n){let a=0,s="";do{let c=e[n-1]==="\r";s+=e.slice(a,c?n-1:n)+t+(c?`\r
3360
3360
  `:`
3361
3361
  `)+r,a=n+1,n=e.indexOf(`
@@ -3480,8 +3480,8 @@ If you configured the output directory yourself, please add it to edgeone.json.
3480
3480
  </div>
3481
3481
 
3482
3482
  </body>
3483
- </html>`;var OF=class{devConfig;buildInstance;config;server;constructor(t){this.devConfig=t,this.config={...t,watchPaths:nG(this)},this.buildInstance=new eF({mode:"dev",env:t.env})}async start(t={}){try{let r;if(t.skipBuild)r={routes:this.buildInstance.getRoutes()};else{let a=await I8(9e3);r=await this.buildInstance.build({port:a})}if(r.routes.length===0)return{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:[],status:"no-routes"};if(this.server&&await this.stop(),await KH(process.cwd())==="esm"){let a=cge.default.join(process.cwd(),".edgeone/node-functions/index.mjs");await(async()=>{try{let s=(0,het.spawn)("node",[a],{stdio:["pipe","inherit","inherit"],env:{...process.env,NODE_ENV:"development"},cwd:process.cwd()});await new Promise((c,l)=>{s.on("spawn",()=>{console.log("[dev] node function dev server started"),c(void 0)}),s.on("error",f=>{Kr("Failed to start ESM dev server:",f.message),l(f)})}),this.server=s}catch(s){throw Kr("Failed to start ESM dev server:",s.message),console.log("Failed to start ESM dev server:",s.stack),s}})()}else{let a=cge.default.join(process.cwd(),".edgeone/node-functions/launcher.js");try{delete require.cache[require.resolve(a)];let s=require(a);this.server=await s.startServer(),console.log("[dev] node function dev server started")}catch(s){throw Kr("[dev] Failed to start dev server:",s.message),console.log("[dev]Failed to start dev server:",s.stack),s}}return{destUrl:`http://localhost:${this.buildInstance.wrapPort}`,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:r.routes,status:"started"}}catch(r){return{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:[],status:"startFailed",error:r.message}}}async stop(){this.server&&(this.server.kill?(this.server.kill("SIGTERM"),console.log("[dev] node function dev server stopped")):await new Promise((t,r)=>{this.server.close(n=>{n?(console.log("[dev] node function dev server stopped with error",n),r(n)):(console.log("[dev] node function dev server stopped"),t())})}),this.server=null)}async handleFileChange(t){try{let r=!1;this.buildInstance&&this.buildInstance.rebuildFunction&&t?(ei(`[dev] Incremental rebuilding for: ${t}`),await this.buildInstance.rebuildFunction(t),r=!0):ei("[dev] Falling back to full rebuild"),await this.stop();let n=await this.start({skipBuild:r});return n.status==="startFailed"?{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:n.routes,status:"rebuildFailed",error:n.error}:{destUrl:`http://localhost:${this.buildInstance.wrapPort}`,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:n.routes,status:"rebuilt"}}catch(r){return{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:[],status:"rebuildFailed",error:r.message}}}};var iG=new Map;iG.set("edge-function",DF);iG.set("node-function",OF);var met=require("worker_threads"),get=require("path"),Aet=require("events");var sG=class extends Aet.EventEmitter{workers=new Map;constructor(){super(),process.on("exit",()=>this.stopAll())}async startRunner(t,r){await this.stopRunner(t);let n=new met.Worker((0,get.join)(__dirname,"pages","dev","runner-worker.js"),{workerData:{key:t,config:r},env:{...process.env,FORCE_COLOR:!0}});return this.workers.set(t,n),n.on("error",a=>{console.error(`[Worker ${t}] Error:`,a),yd(`Worker ${t} error`,a)}),n.on("exit",a=>{console.error(`[Worker ${t}] Exited with code ${a}`),this.workers.delete(t)}),new Promise((a,s)=>{let c=l=>{if(process.env.DEBUG&&console.log(`[Worker ${t}] messageHandler`,l),l.type==="started"){n.off("message",c);let f=l.devMatch;ma(`Dev server runner started for ${t}.`),f.process=n,n.on("message",d=>{d.type==="rebuilt"?(Oc(`[Worker ${t}] Rebuilt completed, updating devMatch`),Object.assign(f,d.devMatch),this.emit("rebuilt",{key:t,devMatch:{...d.devMatch,process:n}})):(d.type==="startFailed"||d.type==="rebuildFailed")&&(this.emit(d.type,{key:t,error:d.error,devMatch:f}),this.stopRunner(t))}),a(f)}else l.type==="startFailed"?(n.off("message",c),s(new Error(`Runner startup failed for ${t}: ${l.error}`))):l.type==="error"&&l.phase==="startup"&&(n.off("message",c),s(new Error(l.error)))};n.on("message",c),n.postMessage({type:"start"})})}async stopRunner(t){let r=this.workers.get(t);if(!(!r||!r.threadId))return Oc(`[WorkerManager] Stopping runner worker for ${t}`),new Promise(n=>{let a=setTimeout(()=>{console.warn(`[Worker ${t}] Force terminating after timeout`),r.terminate(),this.workers.delete(t),n()},5e3);r.once("exit",()=>{clearTimeout(a),this.workers.delete(t),n()});try{r.postMessage({type:"stop"})}catch(s){console.error(`[Worker ${t}] Error sending stop message:`,s),r.terminate(),this.workers.delete(t),n()}})}async stopAll(){let t=[];for(let r of this.workers.keys())t.push(this.stopRunner(r));await Promise.all(t)}getWorker(t){return this.workers.get(t)}async sendRebuildMessage(t,r){let n=this.workers.get(t);if(!n||!n.threadId)return console.log("Rebuild message failed, worker not found",t,n,this.workers),!1;Oc(`[Worker ${t}] Sending rebuild message`,t);try{return n.postMessage({type:"rebuild",filePath:r}),!0}catch(a){return console.error(`[Worker ${t}] Error sending rebuild message:`,a),!1}}};var uge=wr(require("fs"));var yet=["middleware.js","middleware.ts"],k8=class{middlewareExecutor=null;config=null;env;constructor(t={}){this.env=t}static hasMiddleware(){for(let t of yet){let r=di(`./${t}`);if(uge.default.existsSync(r))return!0}return!1}findMiddlewareFile(){for(let t of yet){let r=di(`./${t}`);if(uge.default.existsSync(r))return r}return null}async build(){var r,n,a;let t=this.findMiddlewareFile();if(!t){ei("\u26A0\uFE0F No middleware file found"),this.middlewareExecutor=null,this.config=null;return}try{let c=await new HM({mode:"dev",env:this.env,silent:!1}).buildMiddleware(t),l=(n=(r=c.config)==null?void 0:r.normalizedMatcher)!=null&&n.length?c.config.normalizedMatcher:U$((a=c.config)==null?void 0:a.matcher);this.config={...c.config,normalizedMatcher:l},this.middlewareExecutor=this.createRuntimeExecutor(c.code,this.config),ei("\u2705 Middleware loaded successfully")}catch(s){let c=s instanceof Error?s.message:String(s);throw Kr(`\u274C Failed to build middleware: ${c}`),s}}createRuntimeExecutor(t,r){let a=new Function(`${q$(t,r)}
3484
- return { executeMiddleware };`)();if(!a||typeof a.executeMiddleware!="function")throw new Error("Middleware runtime did not expose executeMiddleware");return a.executeMiddleware}async execute(t){if(!this.middlewareExecutor)return null;let r=t.request;if(!r)throw new Error("Invalid middleware context: request is undefined");try{let a={request:this.createFetchRequest(r),urlInfo:t.urlInfo,env:t.env,waitUntil:t.waitUntil};return await this.middlewareExecutor(a)}catch(n){let a=n instanceof Error?n.message:String(n);return Kr(`Middleware execution error: ${a}`),null}}createFetchRequest(t){var l;let r=this.convertHeaders(t.headers||{}),n=t.url||"/",a=((l=t.headers)==null?void 0:l.host)||"localhost",s=n.startsWith("http://")||n.startsWith("https://")?n:`http://${a}${n.startsWith("/")?n:`/${n}`}`,c=t.method||"GET";return new Request(s,{method:c,headers:r})}convertHeaders(t){let r=new Headers;for(let[n,a]of Object.entries(t))a&&(Array.isArray(a)?a.forEach(s=>{typeof s=="string"&&r.append(n,s)}):typeof a=="string"&&r.set(n,a));return r}getConfig(){return this.config}};var pge=Det(),aG=require("fs"),oG=require("path"),UUr=require("chokidar");var cG=class{server;proxy;devConfig;buildMatches;inProgressBuilds;watcher;watchAggregationId;devMatches=new Map;workerManager=new sG;listeningPort;devPort;devOrigin;devProcess;devLog;rebuildDebounceTimer;middlewareRunner;constructor(t){this.devConfig=t,this.server=Pet.default.createServer(this.devServerHandler.bind(this)),this.listeningPort=this.devConfig.port||8088,this.devPort=this.devConfig.fePort||6699,this.devConfig.devCommand=pet(),this.proxy=Ret.default.createProxyServer({changeOrigin:!0,ws:!0,xfwd:!0}),this.setupProxy(),this.workerManager.on("rebuilt",({key:r,devMatch:n})=>{Oc("Server updated."),this.devMatches.set(r,n)}),this.workerManager.on("startFailed",({key:r,error:n})=>{console.error(`[DevServer] Runner ${r} start failed:`,n),this.devMatches.delete(r)}),this.workerManager.on("rebuildFailed",({key:r,error:n})=>{console.error(`[DevServer] Runner ${r} rebuild failed:`,n),this.devMatches.delete(r)})}async start(){var s;let{timeout:t="",favicon:r=!1}=this.devConfig||{},n=fet(iG),a=await I8(this.listeningPort,!0);if(this.listeningPort=a,k8.hasMiddleware())try{this.middlewareRunner=new k8(((s=this.devConfig)==null?void 0:s.env)||{}),await this.middlewareRunner.build()}catch(c){Kr(`Failed to load middleware: ${c.message}`)}for(let[c,l]of n)try{let f=new l(this.devConfig);Oc(`Starting dev server for ${c} in worker thread`);let d=await this.workerManager.startRunner(c,f.config);process.env.DEBUG&&console.log(`[DevServer] started sucesssfully devMatch for ${c}`),this.devMatches.set(c,d),process.env.DEBUG&&c==="node-function"&&d.destUrl&&qW(`Node-functions server running at: ${UW(`${d.destUrl}`)}`)}catch(f){console.error(`Failed to start runner for ${c}:`,f),yd(`Failed to start runner for ${c}`,f)}await this.runDevCommand(),this.server.listen(this.listeningPort,()=>{qW(`Running at: ${UW(`http://localhost:${this.listeningPort}`)}`),this.devLog&&process.stdout.write(this.devLog),zUr(this.devMatches,async(c,{path:l,type:f})=>{if(c){console.error("Watch error:",c);return}this.rebuildDebounceTimer&&clearTimeout(this.rebuildDebounceTimer),this.rebuildDebounceTimer=setTimeout(async()=>{console.log(`[DevServer] File changed: ${l}, type: ${f}`),Oc("Change detected, rebuild and update server..."),await this.workerManager.sendRebuildMessage(f,l),this.rebuildDebounceTimer=void 0},500)},async c=>{ei(`[DevServer] New functions found for ${c}, starting runner`);let l=await this.workerManager.startRunner(c,this.devConfig);this.devMatches.set(c,l)},async c=>{ei(`[DevServer] All functions removed for ${c}, stopping runner`),this.workerManager.stopRunner(c),this.devMatches.delete(c)})}),this.server.on("upgrade",(c,l,f)=>{if(this.isHMRRequest(c)&&this.devOrigin)try{this.proxy.ws(c,l,f,{target:this.devOrigin,changeOrigin:!0,timeout:3e4})}catch(m){console.error("WebSocket proxy error:",m.message),l.destroy()}else l.destroy()})}stop(){}isHMRRequest(t){let r=t.url||"",n=["/_next/webpack-hmr","/__webpack_hmr","/_vite/ws","/__vite_hmr","/sockjs-node","/socket.io","/_nuxt/","/__nuxt_hmr"];return n.some(a=>r.startsWith(a))?!0:t.headers.upgrade==="websocket"?n.some(a=>r.startsWith(a))||r.includes("hmr"):!!(r.includes("hmr")&&!r.includes("_rsc="))}isRSCRequest(t){let r=t.url||"";return r.includes("?_rsc=")||r.includes("&_rsc=")}async devServerHandler(t,r){var c,l,f,d;if(this.middlewareRunner)try{let m=`http://${t.headers.host||"localhost"}${t.url}`,g=new URL(m),x={request:t,urlInfo:g,env:this.devConfig.env||{},waitUntil:A=>{}},b=await this.middlewareRunner.execute(x);if(b){let A=((c=b.headers)==null?void 0:c.get("x-middleware-next"))==="1",C=(l=b.headers)==null?void 0:l.get("x-middleware-rewrite"),I=(f=b.headers)==null?void 0:f.get("x-middleware-request-headers");if(C&&(process.env.DEBUG&&console.log(`[Middleware] Rewrite: ${t.url} -> ${C}`),t.url=C),I&&this.applyRequestHeaderPatch(t,I),!A&&!C){process.env.DEBUG&&console.log(`[Middleware] Return response: ${b.status}`),r.writeHead(b.status,Object.fromEntries(b.headers.entries()));let k=await b.text();return r.end(k)}process.env.DEBUG&&A&&console.log("[Middleware] Next: continue to functions")}}catch(m){Kr(`Middleware execution error: ${m.message}`)}let n=(d=this.routeMatch(t))!=null?d:"",a=this.isHMRRequest(t),s=this.isRSCRequest(t);if(process.env.DEBUG&&(console.log(`[DevServer] ${t.method} ${t.url} - isHMR: ${a}, isRSC: ${s}, destUrl: ${n}`),console.log("--------------------------------check dev matches--------------------------------"),console.log(this.devMatches),console.log("--------------------------------check dev matches--------------------------------")),n&&!a&&!s)pQe(t.method.toUpperCase(),t.url),this.proxy.web(t,r,{target:n,changeOrigin:!0});else if(this.devOrigin)try{this.proxy.web(t,r,{target:this.devOrigin,changeOrigin:!0,ws:!0,timeout:5e3})}catch(m){console.error("Proxy web error:",m.message),r.writeHead(502,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:"Bad Gateway",message:"Frontend dev server is temporarily unavailable"}))}else{let m=this.staticMatch(t);if(m){let g=pge.lookup(m)||"application/octet-stream";return r.setHeader("Content-Type",g),aG.createReadStream(m).pipe(r)}else{r.statusCode=404;let g=this.staticMatch("/404.html"),x=this.staticMatch("/index.html");if(g)return r.setHeader("Content-Type",pge.lookup(g)),aG.createReadStream(g).pipe(r);if(x)return r.setHeader("Content-Type",pge.lookup(x)),aG.createReadStream(x).pipe(r);r.setHeader("Content-Type","text/html; charset=utf-8"),r.end(det)}}}async runDevCommand(){let t=this.devConfig.devCommand;if(!t||t.indexOf("undefined")>-1)return;let r=await I8(this.devPort);this.devPort=r;let[n,...a]=t.split(" ");a.push("--port",this.devPort);let s=(0,Net.spawn)(n,a,{cwd:process.cwd(),env:{...process.env,FORCE_COLOR:"1"},stdio:["inherit","pipe","pipe"]});this.devProcess=s;let c=new RegExp(this.devPort.toString(),"g");if(!s.stdout||!s.stderr)throw new Error("Expected child process to have stdout and stderr");s.stderr.pipe(process.stderr),s.stdout.setEncoding("utf8"),await new Promise(l=>{let f=setTimeout(()=>l(!1),2e3);s.stdout.once("data",d=>{this.devLog=d,clearTimeout(f),l(!0)})}),process.env.DEBUG&&qW(`DevServer running at: ${UW(`http://localhost:${this.devPort}`)}`),s.stdout.on("data",l=>{process.stdout.write(l.replace(c,this.listeningPort.toString()))}),s.on("error",l=>{Kr(`Error executing dev command: ${l.message}`)}),s.on("close",l=>{l!==0?Xw(`Dev command exited with code ${l}`):ei("Dev command exited normally"),setTimeout(()=>{(!this.devProcess||this.devProcess.killed)&&(this.devOrigin=void 0,ei("Dev server origin cleared"))},2e3)}),this.devOrigin=`http://localhost:${this.devPort}`}staticMatch(t){var c;let r=typeof t=="string"?t:t!=null&&t.url?decodeURI(t.url):"",n=(c=r==null?void 0:r.split("?")[0])==null?void 0:c.replace(/^\//,""),a=x_("outputDirectory","OutputDir",()=>""),s=di(oG.join(a,n||"index.html"));return aG.existsSync(s)?s:null}routeMatch(t){var f,d;let r=t.url||"",n=t.method||"GET";if(this.isHMRRequest(t))return null;let a=r.split("?")[0],s=Array.from(this.devMatches.entries()).filter(([m,g])=>g.routes.some(x=>{if(x.isFramework&&a.startsWith(x.routePath)&&(a.replace(x.routePath,"").startsWith("/")||a.replace(x.routePath,"")===""))return!0;let b=(x==null?void 0:x.method)||"",A;return x!=null&&x.routePath&&(A=`^${x.routePath.replace(/\//g,"\\/").replace(/\/:(\w+)\*$/,"/.*").replace(/:(\w+)/g,"([^/]*)")}$`),process.env.DEBUG&&console.log(" \u5339\u914D\u68C0\u67E5",x.routePath,new RegExp(A).test(a),b.includes(t.method)),A?new RegExp(A).test(a)&&b.includes(t.method):!1})),c=["edge-function","node-function"];return(d=(f=s.sort((m,g)=>c.indexOf(m[0])-c.indexOf(g[0]))[0])==null?void 0:f[1])==null?void 0:d.destUrl}setupProxy(){this.proxy.on("error",(t,r,n)=>{if(console.error("proxy error",t),r&&this.isHMRRequest(r)){console.log("HMR proxy error for:",r.url);return}yd("Proxy server error",t),n&&!n.headersSent&&(n.writeHead(502,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Bad Gateway",message:"The upstream server is temporarily unavailable"})))}),this.proxy.on("proxyRes",(t,r,n)=>{this.isRSCRequest(r)&&(t.headers["content-type"]||(t.headers["content-type"]="text/plain; charset=utf-8"),t.headers["cache-control"]="no-cache, no-store, must-revalidate",t.headers.pragma="no-cache",t.headers.expires="0"),this.isHMRRequest(r)&&(t.headers["access-control-allow-origin"]="*",t.headers["access-control-allow-methods"]="GET, POST, PUT, DELETE, OPTIONS",t.headers["access-control-allow-headers"]="Content-Type, Authorization, X-Requested-With",r.headers.upgrade==="websocket"&&(t.headers["access-control-allow-credentials"]="true"))}),this.proxy.on("proxyReqWs",(t,r,n,a,s)=>{n.on("error",c=>{console.error("WebSocket socket error:",c.message)})}),this.proxy.on("proxyResWs",(t,r,n,a)=>{n.on("error",s=>{console.error("WebSocket response error:",s.message)})}),this.proxy.on("econnreset",(t,r,n,a)=>{console.log("Connection reset, probably due to dev server restart")})}applyRequestHeaderPatch(t,r){try{let n=decodeURIComponent(r),a=JSON.parse(n);Object.entries(a).forEach(([s,c])=>{let l=s.toLowerCase();if(c===null||typeof c>"u"){delete t.headers[l];return}t.headers[l]=c})}catch(n){Kr(`Failed to apply middleware request headers: ${n instanceof Error?n.message:String(n)}`)}}async reloadMiddleware(){if(this.middlewareRunner)try{await this.middlewareRunner.build(),ma("\u2705 Middleware reloaded successfully")}catch(t){Kr(`Failed to reload middleware: ${t.message}`)}}async close(){if(this.rebuildDebounceTimer&&(clearTimeout(this.rebuildDebounceTimer),this.rebuildDebounceTimer=void 0),await this.workerManager.stopAll(),this.devProcess)try{this.devProcess.pid&&process.kill(this.devProcess.pid,0)&&process.kill(this.devProcess.pid)}catch(t){t.code!=="ESRCH"&&console.error("Failed to kill dev process:",t)}finally{this.devProcess=null}return new Promise(t=>{if(!this.server.listening){t();return}this.server.close(()=>{console.log("HTTP server closed"),t()})})}};async function zUr(e,t,r,n,a){function s(l,f){try{let d=A=>oG.normalize(A).replace(/^\.\//,"").replace(/\\/g,"/"),m=d(l),g=d(f),x=oG.resolve(process.cwd(),f);return oG.resolve(process.cwd(),l).startsWith(x)||m.startsWith(g)}catch(d){console.error("match path error",d)}}UUr.watch(".",{ignored:[/(^|[\/\\])\../,/node_modules/,/\.git/,/dist/,/build/,/\.edgeone/],persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:300}}).on("add",async function(l){let f=l.startsWith("node-functions/")&&!l.endsWith("/"),d=l.startsWith("edge-functions/")&&!l.endsWith("/");if(console.log("add",l,"; file type:",f?"node-function":d?"edge-function":"unknown"),f||d){let m=f?"node-functions":"edge-functions",g=f?"node-function":"edge-function";if(P_(m)>=1&&!e.has(g))try{await(r==null?void 0:r(g)),Oc(`[DevServer] Runner ${g} started`)}catch(b){console.error(`Failed to start runner ${g}:`,b)}else{let b=Array.from(e.values()).find(A=>A.watch.some(C=>s(l,C)));t(null,{path:l,type:(b==null?void 0:b.type)||"unknown"})}}}).on("unlink",async function(l){console.log("unlink",l);let f=l.startsWith("node-functions/")&&!l.endsWith("/"),d=l.startsWith("edge-functions/")&&!l.endsWith("/"),m=l==="node-functions"||l==="node-functions/";if(m||(l==="edge-functions"||l==="edge-functions/")){let x=m?"node-function":"edge-function";await(n==null?void 0:n(x))}else if(f||d){let x=f?"node-functions":"edge-functions",b=f?"node-function":"edge-function",A=0;try{A=P_(x)}catch{A=0}if(A===0)await(n==null?void 0:n(b));else{let C=Array.from(e.values()).find(I=>I.watch.some(k=>s(l,k)));t(null,{path:l,type:(C==null?void 0:C.type)||"unknown"})}}}).on("change",async function(l){if(console.log("change",l),l==="middleware.js"||l==="middleware.ts"){Oc("Middleware changed, reloading...");try{await(a==null?void 0:a.reloadMiddleware())}catch(d){Kr(`Failed to reload middleware: ${d.message}`)}return}let f=Array.from(e.values()).find(d=>{var m;return(m=d.watch)==null?void 0:m.some(g=>s(l,g))});if(f)t(null,{path:l,type:(f==null?void 0:f.type)||"unknown"});else{let d=l.startsWith("node-functions/")&&!l.endsWith("/"),m="";d?m="node-function":isEdgeFuncFile&&(m="edge-function"),m&&await(r==null?void 0:r(m))}})}var Oet=wr(require("path"));var Fet=lN();async function HUr(){let t=`env_vars_pull_prompt_${Oet.default.basename(process.cwd())}`;try{let r=new Date().toISOString().split("T")[0],n=await MR(t);if(n&&n.date===r)return n.shouldPull;let{pullEnvVars:a}=await Fet({type:"confirm",name:"pullEnvVars",message:"Sync environment variables from the EdgeOne Pages console?",default:!0});return Rz("Your choice will be remembered for the rest of the day."),await jR(t,{date:r,shouldPull:a}),a}catch(r){console.warn("Failed to check env vars pull prompt cache:",r);let{pullEnvVars:n}=await Fet({type:"confirm",name:"pullEnvVars",message:"Do you want to pull env vars from EdgeOne Pages Console?",default:!0});return n}}async function Qet(e){let{token:t}=e;t&&(process.env.EDGEONE_PAGES_API_TOKEN=t,await VC()),e.debug&&(process.env.DEBUG="true",console.log("Running in debug mode")),await ly();let r=process.cwd(),n;try{n=_0(`${process.cwd()}/.edgeone/project.json`)}catch{}let a={},s=await HUr();if(n&&n.Name&&n.ProjectId){a={...a,...n},s&&await T_(n.ProjectId).catch(g=>{yd("Dev pull env vars error,",g),Kr("Pull env vars error:"+g.message)});let m={};try{let g=di("./.env");m=xN(g),a.env=m}catch{m={}}}else ei("Dev server running in raw mode...");let c=new yF(r),l=await my(),f=await IW(r,l);await c.loadPlugins(f),e.fePort&&(a.fePort=e.fePort),e.port&&(a.port=e.port),await c.onPreDev({cwd:r,env:a.env||{},config:l});let d=new cG(a);return process.on("SIGINT",async()=>{console.log("Received SIGINT signal, shutting down..."),d&&await d.close(),process.exit(0)}),process.on("SIGTERM",async()=>{console.log("Received SIGTERM signal, shutting down..."),d&&await d.close(),process.exit(0)}),await c.onDev({cwd:r,env:a.env||{},config:l}),await d.start().then(()=>{setTimeout(()=>{console.log(" Shutting down local server..."),process.exit(1)},1e3*60*60*2)}).catch(m=>{yd("Dev server unhandled error:",m),Kr("Run pages dev error:"+m)})}var vNt=wr(require("fs"));var lNt=wr(rmt()),Tu=wr(require("path")),W1=wr(require("fs/promises")),pNt=wr(Sae());var fNt=require("fs");var sre=wr(Hxt()),wqn=cNt(),uNt=process.env.https_proxy||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.HTTP_PROXY;if(uNt){let e=new sre.ProxyAgent(uNt);(0,sre.setGlobalDispatcher)(e)}pNt.default.config();var $1={FILE_PARALLEL_LIMIT:parseInt(process.env.COS_FILE_PARALLEL_LIMIT||"10"),CHUNK_PARALLEL_LIMIT:parseInt(process.env.COS_CHUNK_PARALLEL_LIMIT||"8"),CHUNK_SIZE_MB:parseInt(process.env.COS_CHUNK_SIZE_MB||"8"),CHUNK_RETRY_TIMES:parseInt(process.env.COS_CHUNK_RETRY_TIMES||"2")},dNt="https://pages-api.cloud.tencent.com/v1",Sqn="https://pages-api.edgeone.ai/v1";var hNt=dNt;var Cqn=async()=>{let e=process.env.EDGEONE_PAGES_API_TOKEN;if(!e)throw new Error('Missing EDGEONE_PAGES_API_TOKEN. Please provide a api token with --token or login first with "edgeone login".');return e},_qn=async()=>`Bearer ${await Cqn()}`,hb=()=>{let e=process.env.EDGEONE_PAGES_PROJECT_NAME||"";if(!e)throw new Error("Project name is required. Please provide using the -n or --name parameter.");return e},QP=async e=>{var c,l;let{action:t,data:r={},baseUrl:n=hNt,throwOnError:a=!0}=e,s={Action:t,...r};try{let f=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:await _qn()},body:JSON.stringify(s)});if(!f.ok){let m=await f.text(),g=new Error(`API request failed (${f.status}): ${m}`);if(a)throw g;return{Code:-1,Data:{},Message:g.message,RequestId:""}}let d=await f.json();if(d.Code!==0&&a)throw(l=(c=d.Data)==null?void 0:c.Response)!=null&&l.Error?new Error(d.Data.Response.Error.Message):new Error(`API error: ${d.Message}`);return d}catch(f){if(a)throw Kr(`[callApi] ${t} failed: ${f instanceof Error?f.message:String(f)}`),f;return{Code:-1,Data:{},Message:f instanceof Error?f.message:String(f),RequestId:""}}},rk={token:null,cos:null},mNt=()=>{rk.token=null,rk.cos=null},ire=e=>new Promise(t=>setTimeout(t,e)),Iqn=async()=>{let e=async n=>{let a=await QP({action:"DescribePagesProjects",data:{PageNumber:1,PageSize:10},baseUrl:n,throwOnError:!1});return{success:a.Code===0,code:a.Code}},t=await Gv(),r=[];r=[dNt,Sqn];for(let n of r)if((await e(n)).success){hNt=n;return}throw new Error('Invalid EDGEONE_PAGES_API_TOKEN. Please provide a valid API token with --token or login first with "edgeone login". For more information, please refer to https://edgeone.ai/document/177158578324279296')},gNt=(e,t)=>{if(e.Provider&&e.Provider!=="Upload")throw new Error(`[${t}] Project ${hb()} exists but has Provider '${e.Provider}'. This project type does not support direct folder or zip file deployment. Only projects with Provider 'Upload' are supported.`)},ANt=async(e="global")=>{var r,n,a,s,c,l;if(rk.token)return rk.token;let t;try{let f=await are({projectName:hb()});if(((a=(n=(r=f.Data)==null?void 0:r.Response)==null?void 0:n.Projects)==null?void 0:a.length)>0){let d=f.Data.Response.Projects[0];t=d.ProjectId,gNt(d,"getCosTempToken")}else{let d=await UTe(e);if(((l=(c=(s=d.Data)==null?void 0:s.Response)==null?void 0:c.Projects)==null?void 0:l.length)>0)t=d.Data.Response.Projects[0].ProjectId;else throw new Error(`Failed to create project ${hb()}`)}}catch(f){throw Kr(`[getCosTempToken] Error: ${f instanceof Error?f.message:String(f)}`),new Error(`Failed to get or create project ${hb()}: ${f instanceof Error?f.message:String(f)}`)}try{let f=await QP({action:"DescribePagesCosTempToken",data:{ProjectId:t}});return rk.token=f,f}catch(f){throw Kr(`[getCosTempToken] Error getting COS token: ${f instanceof Error?f.message:String(f)}`),f}},kqn=async(e="global")=>{var r,n,a;if(!hb())throw new Error("Project name is required. Please provide using the -n or --name parameter.");let t;try{t=await are({projectName:hb()})}catch(s){if(s instanceof Error&&s.message.includes("Provider")&&s.message.includes("This project type does not support"))throw s;return Oc(`[getOrCreateProject] Error checking project ${hb()}: ${s}. Attempting to create project.`),await UTe(e)}if(((a=(n=(r=t.Data)==null?void 0:r.Response)==null?void 0:n.Projects)==null?void 0:a.length)>0){let s=t.Data.Response.Projects[0];return gNt(s,"getOrCreateProject"),ma(`Project ${mB.highlight(hb())} already exists. Using existing project.`),t}return Xw(`Project ${mB.highlight(hb())} doesn't exist. Creating new project.`),await UTe(e)},UTe=async(e="global")=>{var t,r,n,a,s;try{Oc(`[CreatePagesProject] Creating new project with name: ${hb()} in ${e} area`);let c=await QP({action:"CreatePagesProject",data:{Name:hb(),Provider:"Upload",Channel:"Custom",Area:e,Source:process.env.PAGES_SOURCE||"cli"}});if(!((r=(t=c==null?void 0:c.Data)==null?void 0:t.Response)!=null&&r.ProjectId))throw new Error(((s=(a=(n=c==null?void 0:c.Data)==null?void 0:n.Response)==null?void 0:a.Error)==null?void 0:s.Message)||"Failed to get ProjectId from API response");return await ire(2e3),await are({projectId:c.Data.Response.ProjectId})}catch(c){throw Kr("Error creating pages project: "+c),c}},are=async e=>{let{projectId:t,projectName:r}=e;try{let n=[];t&&n.push({Name:"ProjectId",Values:[t]}),r&&n.push({Name:"Name",Values:[r]});let a=await QP({action:"DescribePagesProjects",data:{Filters:n,Offset:0,Limit:10,OrderBy:"CreatedOn"}});return a.Data?a.Data.Response?a.Data.Response.Projects||(a.Data.Response.Projects=[]):a.Data.Response={Projects:[]}:a.Data={Response:{Projects:[]}},a}catch(n){return Kr(`[describePagesProjects] Error: ${n instanceof Error?n.message:String(n)}`),{Code:-1,Data:{Response:{Projects:[]}},Message:n instanceof Error?n.message:String(n),RequestId:""}}},Tqn=async(e,t=!0)=>await QP({action:"DescribePagesDeployments",data:{ProjectId:e,Offset:0,Limit:50,OrderBy:"CreatedOn",Order:"Desc"},throwOnError:t}),Bqn=async e=>await QP({action:"DescribePagesEncipherToken",data:{Text:e}}),HTe=e=>Tu.extname(e).toLowerCase()===".zip",Dqn=async e=>{let{projectId:t,targetPath:r,isZip:n,env:a}=e;return await QP({action:"CreatePagesDeployment",data:{ProjectId:t,ViaMeta:"Upload",Provider:"Upload",Env:a,DistType:n?"Zip":"Folder",TempBucketPath:r,BuildFrom:"CLI"}})},zTe=async(e="global")=>{if(rk.cos)return rk.cos;let t=await ANt(e);if(t.Code!==0||!t.Data||!t.Data.Response||!t.Data.Response.Credentials)throw new Error("Failed to get COS temp token");let n=t.Data.Response.Credentials,a=new lNt.default({SecretId:n.TmpSecretId,SecretKey:n.TmpSecretKey,SecurityToken:n.Token,FileParallelLimit:$1.FILE_PARALLEL_LIMIT,ChunkParallelLimit:$1.CHUNK_PARALLEL_LIMIT,ChunkRetryTimes:$1.CHUNK_RETRY_TIMES,ChunkSize:1024*1024*$1.CHUNK_SIZE_MB,SliceSize:1024*1024*$1.CHUNK_SIZE_MB,ProgressInterval:1e3});return rk.cos=a,a},Pqn=async e=>{let t=[],r=async n=>{let a=await W1.readdir(n,{withFileTypes:!0});for(let s of a){let c=Tu.join(n,s.name),l=s.isDirectory(),f=await W1.stat(c);t.push({isDir:l,path:l?`${c}/`:c,size:l?0:f.size}),l&&await r(c)}};try{if(await r(e),t.length>1e6)throw new Error("too_much_files");return t}catch(n){throw Kr("Error in fastListFolder: "+n),n}},Rqn=async(e,t={})=>{let r=Tu.dirname(e),n=Tu.basename(e),a=Tu.basename(process.cwd()),s=Tu.join(r,`${a}.zip`),{level:c=9,excludePatterns:l=["node_modules",".git",".DS_Store","*.log"],includeHidden:f=!1}=t;return new Promise(async(d,m)=>{try{let g=(0,fNt.createWriteStream)(s),x=wqn("zip",{zlib:{level:c}});x.on("error",b=>{throw b}),g.on("close",()=>{d(s)}),x.pipe(g),n===".edgeone"?x.directory(e,`${a}/${n}`,{ignore:l,dot:f}):x.directory(e,n,{ignore:l,dot:f}),await x.finalize()}catch(g){throw Kr(`[zipFile] Error compressing folder: ${g instanceof Error?g.message:String(g)}`),g}})},Nqn=async(e,t,r,n,a=!1,s="global",c=!1)=>{let l=Tu.isAbsolute(e)?e:di(e);if(a&&!HTe(l))try{let x=await Rqn(l,{level:6,excludePatterns:["node_modules",".git",".DS_Store","*.log","*.tmp"],includeHidden:c}),b=Tu.basename(x),A=await zTe(s),C=new fU(A,t,r,n);try{let I=await C.uploadZipFile(x,b);return W1.unlink(x).catch(()=>{}),I}catch(I){throw Kr(`[uploadToEdgeOneCOS] Error uploading compressed file: ${I instanceof Error?I.message:String(I)}`),I}}catch(x){Kr(`[optionallyCompressAndUpload] Compression failed, falling back to direct upload: ${x instanceof Error?x.message:String(x)}`)}Oc("[uploadToEdgeOneCOS] Scanning directory for files...");let f=await Pqn(e);Oc(`[uploadToEdgeOneCOS] Found ${f.length} files/directories in ${e}`);let d=Oqn(f,e,t,r,n);Oc(`[uploadToEdgeOneCOS] Uploading ${d.length} files to COS with targetPath: ${n}...`);let m=await zTe(s);return await new fU(m,t,r,n).uploadMultipleFiles(d),Oc("[uploadToEdgeOneCOS] Upload successful."),{success:!0,targetPath:n,isZip:!1}},Fqn=e=>{let t={next:{dirName:"next",versions:[14,15]},react:{dirName:"react",versions:[18]},"react-dom":{dirName:"react-dom",versions:[18]}},r=[];for(let n in t){let a=t[n],s=Tu.join(e,"server-handler","node_modules",a.dirName,"package.json");if(KL(s)){let c=_0(s);c!=null&&c.version&&a.versions.includes(parseInt(c==null?void 0:c.version.split(".")[0],10))&&r.push(`server-handler/node_modules/${a.dirName}/`)}}return r};var Oqn=(e,t,r,n,a)=>{let s=Tu.basename(t),c=Tu.basename(Tu.dirname(t)),l=[];return s===".edgeone"&&dirExitsSync(Tu.join(t,"server-handler"))&&(l=Fqn(t)),e.map(f=>{let d=Tu.relative(t,f.path).replace(/\\/g,"/"),m=s===".edgeone"?`${a}/${c}/${s}/${d||""}`:`${a}/${d||""}`;return{Bucket:r,Region:n,Key:m,FilePath:f.path}}).filter(f=>!(f.FilePath.endsWith("/")||f.Key==="/"||f.Key===""||l.length&&l.some(d=>f.FilePath.includes(d))||f.FilePath!==t&&f.FilePath.startsWith(".")&&f.FilePath!==Tu.basename(f.FilePath)||f.FilePath.startsWith(`node_modules${Tu.sep}`)))};var fU=class{cos;bucket;region;targetPath;constructor(t,r,n,a){this.cos=t,this.bucket=r,this.region=n,this.targetPath=a}async uploadSingleFile(t,r){return new Promise((n,a)=>{let s=mQe("[Uploader] Uploading file","cli",30,"cyan");this.cos.uploadFile({Bucket:this.bucket,Region:this.region,Key:r,FilePath:t,SliceSize:1024*1024*$1.CHUNK_SIZE_MB,ChunkSize:1024*1024*$1.CHUNK_SIZE_MB,ChunkParallel:$1.CHUNK_PARALLEL_LIMIT,ChunkRetryTimes:$1.CHUNK_RETRY_TIMES,onProgress:c=>{if(c.percent!=null){let l=Math.max(0,Math.min(100,Math.round(c.percent*100)));s.update(l,"[Uploader] Uploading file")}},onHashProgress:c=>{if(c.percent!=null){let l=Math.max(0,Math.min(100,Math.round(c.percent*100)));s.update(l,"Calculating hash")}}},(c,l)=>{s.stop(),c?(Kr(`[Uploader] Error uploading file ${r}: ${c.message}`),a(c)):n(l)})})}async uploadMultipleFiles(t){Oc(`[uploadFiles] Starting upload of ${t.length} files with optimized settings...`);let r=100;if(t.length>r){Oc(`[uploadFiles] Large file count detected (${t.length}), processing in batches of ${r}...`);let n=[];for(let a=0;a<t.length;a+=r){let s=t.slice(a,a+r);Oc(`[uploadFiles] Processing batch ${Math.floor(a/r)+1}/${Math.ceil(t.length/r)} (${s.length} files)...`);let c=await this.uploadFilesBatch(s);n.push(c)}return{files:n.flat()}}else return this.uploadFilesBatch(t)}async uploadFilesBatch(t){return new Promise((r,n)=>{this.cos.uploadFiles({files:t,SliceSize:1024*1024*$1.CHUNK_SIZE_MB,onProgress:a=>{if(a.percent){let s=Math.round(a.percent*100)}},onFileFinish:(a,s,c)=>{a?Kr(`[uploadFilesBatch] File upload failed: ${c.Key} - ${a.message}`):process.env.DEBUG_UPLOAD&&Oc(`[uploadFilesBatch] File uploaded successfully: ${c.Key}`)}},function(a,s){a?(Kr(`[uploadFilesBatch] Batch upload failed: ${a.message}`),n(a)):(Oc(`[uploadFilesBatch] Batch uploaded successfully (${t.length} files)`),r(s))})})}async uploadZipFile(t,r){let n=`${this.targetPath}/${r}`;try{return await this.uploadSingleFile(t,n),ma("File uploaded successfully"),{success:!0,isZip:!0,targetPath:n}}catch(a){throw Kr(`[Uploader] Error uploading zip file: ${a instanceof Error?a.message:String(a)}`),a}}},Qqn=async(e,t="global")=>{var r;try{let n=await ANt(t);if(n.Code!==0||!((r=n==null?void 0:n.Data)!=null&&r.Response))throw new Error(`Failed to get COS token: ${n.Message||"Invalid token response"}`);let a=n.Data.Response,s=a.Bucket,c=a.Region,l=a.TargetPath;if(!s||!c||!l)throw new Error("Missing required COS parameters (Bucket, Region, TargetPath) in token response.");if(HTe(e)){Oc(`[uploadToEdgeOneCOS] Uploading zip file to COS with targetPath: ${l}...`);let d=Tu.basename(e),m=`${l}/${d}`,g=await zTe(t),x=new fU(g,s,c,l);try{return await x.uploadZipFile(e,d)}catch(b){throw Kr(`[uploadToEdgeOneCOS] Error uploading zip file: ${b instanceof Error?b.message:String(b)}`),b}}else return await Nqn(e,s,c,l,!0,t,e!=="./")}catch(n){throw mNt(),Kr(`[uploadToEdgeOneCOS] Error: ${n instanceof Error?n.message:String(n)}`),new Error(`Error uploading to COS: ${n instanceof Error?n.message:String(n)}`)}},Lqn=async(e,t)=>{let r=!0,n=null,a=hQe("[DeployStatus] Deploying","cli",300,6);for(;r;)try{let s=await Tqn(e,!1);if(s.Code!==0){await ire(5e3);continue}if(n=s.Data.Response.Deployments.find(c=>c.DeploymentId===t),!n)throw new Error(`Deployment with ID ${t} not found`);["Process","Pending"].includes(n.Status)?await ire(5e3):r=!1}catch{await ire(5e3);continue}return a.stop(),n},jqn=async e=>{try{await W1.access(e)}catch{throw new Error("localPath does not exist")}let t=await W1.stat(e),r=HTe(e);if(!t.isDirectory()&&!r)throw new Error("localPath must be a folder or zip file");return r},Mqn=async(e,t,r="Production")=>{var s,c,l,f,d,m,g;let n=await are({projectId:t});if(!((l=(c=(s=n==null?void 0:n.Data)==null?void 0:s.Response)==null?void 0:c.Projects)!=null&&l[0]))throw new Error("Failed to retrieve project status information.");let a=n.Data.Response.Projects[0];if(e.Status==="Success"){if(r==="Production"&&a.CustomDomains&&a.CustomDomains.length>0){let k=a.CustomDomains[0];if(k.Status==="Pass")return{type:"custom",url:`https://${k.Domain}`,projectId:t}}let x;r==="Production"?x=a.PresetDomain:x=e.PreviewUrl?e.PreviewUrl.replace("https://",""):a.PresetDomain;let b=await Bqn(x);if(b.Code!==0||!((d=(f=b==null?void 0:b.Data)==null?void 0:f.Response)!=null&&d.Token)||!((g=(m=b==null?void 0:b.Data)==null?void 0:m.Response)!=null&&g.Timestamp))throw new Error(`Deployment completed, but failed to get access token: ${b.Message||"Invalid token data"}`);let{Token:A,Timestamp:C}=b.Data.Response;return{type:"preset",url:`https://${x}?eo_token=${A}&eo_time=${C}`,projectId:t}}else throw new Error(`Deployment failed with status: ${e.Status}`)},yNt=async(e,t="Production",r="global")=>{var n,a,s,c,l;try{mNt();let f=await jqn(e);await Iqn();let d=await kqn(r),m=(s=(a=(n=d==null?void 0:d.Data)==null?void 0:n.Response)==null?void 0:a.Projects)==null?void 0:s[0],g=m==null?void 0:m.ProjectId;if(!g)throw new Error("Failed to retrieve Project ID after get/create. Please check the project name and API key.");ma(`Using Project ID: ${mB.highlight(g)}`);let x=Tu.join(process.cwd(),".edgeone","project.json");uy(x,JSON.stringify({Name:m.Name,ProjectId:g}));let b=await Qqn(e,r);if(!b.targetPath)throw new Error("COS upload succeeded but targetPath is missing.");let A=b.targetPath;ma(`Creating deployment in ${t} environment...`);let C=await Dqn({projectId:g,targetPath:A,isZip:b.isZip||f,env:t});if(!((l=(c=C==null?void 0:C.Data)==null?void 0:c.Response)!=null&&l.DeploymentId))throw new Error("Failed to create deployment: deployment ID not returned from API");let I=C.Data.Response.DeploymentId;ma(`Created deployment with Deployment ID: ${mB.highlight(I)}`);let k=await Lqn(g,I);k.Status==="Success"?ma(`Deploy ${k.Status}`):Kr(`Deploy ${k.Status}`);let O=await Mqn(k,g,t);return ma("Deployment to EdgeOne Pages completed successfully! To view your project's live URL."),console.log(`EDGEONE_DEPLOY_URL=${O.url}`),console.log(`EDGEONE_DEPLOY_TYPE=${O.type}`),console.log(`EDGEONE_PROJECT_ID=${O.projectId}`),{deploymentId:I,...O}}catch(f){throw f}};var ore=async e=>{try{let t=e.directoryOrZip;if(!t){console.log("Execute auto build and deploy .edgeone directory");let m;try{m=_0(`${process.cwd()}/.edgeone/project.json`)}catch{}m&&(m!=null&&m.ProjectId)&&await T_(m.ProjectId).catch(g=>{Kr("Pull env vars error:"+g.message)}),await RW({}),t=di("./.edgeone")}let r=e.name||e.n;if(r||vNt.existsSync(di("./.edgeone/project.json"))&&(r=_0(di("./.edgeone/project.json")).Name),!r){Kr(`Missing project name. Please use -n or --name option, for example: edgeone pages deploy ./directory -n my-project-name Or you can run "${y8("edgeone pages link")}" first`),process.exit(1);return}let n=e.area||e.a||"global";process.env.EDGEONE_PAGES_PROJECT_NAME=r;let s=(e.env||"production").toLowerCase()==="preview"?"Preview":"Production",c=e.token||e.t;if(c)process.env.EDGEONE_PAGES_API_TOKEN=c,ma("Using provided API token for deployment...");else try{let m=await dT();if(!m){Kr("No API token provided and not logged in."),Kr("Please either:"),Kr(" 1. Login first: edgeone login"),Kr(" 2. Or provide a token: edgeone pages deploy ./dist -n project-name -t $EDGEONE_API_TOKEN"),process.exit(1);return}process.env.EDGEONE_PAGES_API_TOKEN=m,ma("Using local login token for deployment...")}catch{Kr("No API token provided and not logged in."),Kr("Please either:"),Kr(" 1. Login first: edgeone login"),Kr(" 2. Or provide a token: edgeone pages deploy ./dist -n project-name -t $EDGEONE_API_TOKEN"),process.exit(1);return}ma(`Deploying ${t} to project ${r} (${s} environment, ${n} area)...`);let l=await yNt(t,s,n),d=await Gv()==="china"?"https://console.cloud.tencent.com/edgeone/pages/project/":"https://console.tencentcloud.com/edgeone/pages/project/";return ma(`You can view your deployment in the EdgeOne Pages Console at: ${mB.highlight(`${d}${l.projectId}/deployment/${l.deploymentId}`)}`),l}catch(t){let r=t&&typeof t=="object"&&"message"in t?String(t.message):String(t);Kr(`Deployment failed: ${r}`),process.exit(1)}};async function dU(e,t){let{token:r,file:n}=t;try{r&&(process.env.EDGEONE_PAGES_API_TOKEN=r,await VC())}catch(l){Kr(`check and set region failed: ${l}`),process.exit(1)}await ly();let a;try{a=_0(`${process.cwd()}/.edgeone/project.json`)}catch{Kr("Can't read project infomation, you need to run 'edgeone pages link' first"),process.exit()}let s,c;switch(e){case"pull":T_(a.ProjectId,void 0,n);break;case"ls":EKe(a.ProjectId);break;case"set":s=t._[3],c=t._[4],wKe(a.ProjectId,s,c);break;case"rm":s=t._[3],A0e(a.ProjectId,s);break;default:Kr(`Invalid command: ${e}`),process.exit(1)}}var VTe=lN(),lv=require("fs"),Mh=require("path");function qqn(){let e=Mh.join(process.cwd(),"functions");if(lv.existsSync(e))console.log("Pages function folder already exists.");else{let t=Mh.join(process.cwd(),"edge-functions","helloworld-edge","index.js"),r=`export function onRequest(context) {
3483
+ </html>`;var OF=class{devConfig;buildInstance;config;server;constructor(t){this.devConfig=t,this.config={...t,watchPaths:nG(this)},this.buildInstance=new eF({mode:"dev",env:t.env})}async start(t={}){try{let r;if(t.skipBuild)r={routes:this.buildInstance.getRoutes()};else{let a=await I8(9e3);r=await this.buildInstance.build({port:a})}if(r.routes.length===0)return{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:[],status:"no-routes"};if(this.server&&await this.stop(),await KH(process.cwd())==="esm"){let a=cge.default.join(process.cwd(),".edgeone/node-functions/index.mjs");await(async()=>{try{let s=(0,het.spawn)("node",[a],{stdio:["pipe","inherit","inherit"],env:{...process.env,NODE_ENV:"development"},cwd:process.cwd()});await new Promise((c,l)=>{s.on("spawn",()=>{console.log("[dev] node function dev server started"),c(void 0)}),s.on("error",f=>{Kr("Failed to start ESM dev server:",f.message),l(f)})}),this.server=s}catch(s){throw Kr("Failed to start ESM dev server:",s.message),console.log("Failed to start ESM dev server:",s.stack),s}})()}else{let a=cge.default.join(process.cwd(),".edgeone/node-functions/launcher.js");try{delete require.cache[require.resolve(a)];let s=require(a);this.server=await s.startServer(),console.log("[dev] node function dev server started")}catch(s){throw Kr("[dev] Failed to start dev server:",s.message),console.log("[dev]Failed to start dev server:",s.stack),s}}return{destUrl:`http://localhost:${this.buildInstance.wrapPort}`,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:r.routes,status:"started"}}catch(r){return{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:[],status:"startFailed",error:r.message}}}async stop(){this.server&&(this.server.kill?(this.server.kill("SIGTERM"),console.log("[dev] node function dev server stopped")):await new Promise((t,r)=>{this.server.close(n=>{n?(console.log("[dev] node function dev server stopped with error",n),r(n)):(console.log("[dev] node function dev server stopped"),t())})}),this.server=null)}async handleFileChange(t){try{let r=!1;this.buildInstance&&this.buildInstance.rebuildFunction&&t?(ei(`[dev] Incremental rebuilding for: ${t}`),await this.buildInstance.rebuildFunction(t),r=!0):ei("[dev] Falling back to full rebuild"),await this.stop();let n=await this.start({skipBuild:r});return n.status==="startFailed"?{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:n.routes,status:"rebuildFailed",error:n.error}:{destUrl:`http://localhost:${this.buildInstance.wrapPort}`,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:n.routes,status:"rebuilt"}}catch(r){return{destUrl:null,watch:this.config.watchPaths,type:"node-function",config:this.config,routes:[],status:"rebuildFailed",error:r.message}}}};var iG=new Map;iG.set("edge-function",DF);iG.set("node-function",OF);var met=require("worker_threads"),get=require("path"),Aet=require("events");var sG=class extends Aet.EventEmitter{workers=new Map;constructor(){super(),process.on("exit",()=>this.stopAll())}async startRunner(t,r){await this.stopRunner(t);let n=new met.Worker((0,get.join)(__dirname,"pages","dev","runner-worker.js"),{workerData:{key:t,config:r},env:{...process.env,FORCE_COLOR:!0}});return this.workers.set(t,n),n.on("error",a=>{console.error(`[Worker ${t}] Error:`,a),yd(`Worker ${t} error`,a)}),n.on("exit",a=>{console.error(`[Worker ${t}] Exited with code ${a}`),this.workers.delete(t)}),new Promise((a,s)=>{let c=l=>{if(process.env.DEBUG&&console.log(`[Worker ${t}] messageHandler`,l),l.type==="started"){n.off("message",c);let f=l.devMatch;da(`Dev server runner started for ${t}.`),f.process=n,n.on("message",d=>{d.type==="rebuilt"?(Oc(`[Worker ${t}] Rebuilt completed, updating devMatch`),Object.assign(f,d.devMatch),this.emit("rebuilt",{key:t,devMatch:{...d.devMatch,process:n}})):(d.type==="startFailed"||d.type==="rebuildFailed")&&(this.emit(d.type,{key:t,error:d.error,devMatch:f}),this.stopRunner(t))}),a(f)}else l.type==="startFailed"?(n.off("message",c),s(new Error(`Runner startup failed for ${t}: ${l.error}`))):l.type==="error"&&l.phase==="startup"&&(n.off("message",c),s(new Error(l.error)))};n.on("message",c),n.postMessage({type:"start"})})}async stopRunner(t){let r=this.workers.get(t);if(!(!r||!r.threadId))return Oc(`[WorkerManager] Stopping runner worker for ${t}`),new Promise(n=>{let a=setTimeout(()=>{console.warn(`[Worker ${t}] Force terminating after timeout`),r.terminate(),this.workers.delete(t),n()},5e3);r.once("exit",()=>{clearTimeout(a),this.workers.delete(t),n()});try{r.postMessage({type:"stop"})}catch(s){console.error(`[Worker ${t}] Error sending stop message:`,s),r.terminate(),this.workers.delete(t),n()}})}async stopAll(){let t=[];for(let r of this.workers.keys())t.push(this.stopRunner(r));await Promise.all(t)}getWorker(t){return this.workers.get(t)}async sendRebuildMessage(t,r){let n=this.workers.get(t);if(!n||!n.threadId)return console.log("Rebuild message failed, worker not found",t,n,this.workers),!1;Oc(`[Worker ${t}] Sending rebuild message`,t);try{return n.postMessage({type:"rebuild",filePath:r}),!0}catch(a){return console.error(`[Worker ${t}] Error sending rebuild message:`,a),!1}}};var uge=wr(require("fs"));var yet=["middleware.js","middleware.ts"],k8=class{middlewareExecutor=null;config=null;env;constructor(t={}){this.env=t}static hasMiddleware(){for(let t of yet){let r=di(`./${t}`);if(uge.default.existsSync(r))return!0}return!1}findMiddlewareFile(){for(let t of yet){let r=di(`./${t}`);if(uge.default.existsSync(r))return r}return null}async build(){var r,n,a;let t=this.findMiddlewareFile();if(!t){ei("\u26A0\uFE0F No middleware file found"),this.middlewareExecutor=null,this.config=null;return}try{let c=await new HM({mode:"dev",env:this.env,silent:!1}).buildMiddleware(t),l=(n=(r=c.config)==null?void 0:r.normalizedMatcher)!=null&&n.length?c.config.normalizedMatcher:U$((a=c.config)==null?void 0:a.matcher);this.config={...c.config,normalizedMatcher:l},this.middlewareExecutor=this.createRuntimeExecutor(c.code,this.config),ei("\u2705 Middleware loaded successfully")}catch(s){let c=s instanceof Error?s.message:String(s);throw Kr(`\u274C Failed to build middleware: ${c}`),s}}createRuntimeExecutor(t,r){let a=new Function(`${q$(t,r)}
3484
+ return { executeMiddleware };`)();if(!a||typeof a.executeMiddleware!="function")throw new Error("Middleware runtime did not expose executeMiddleware");return a.executeMiddleware}async execute(t){if(!this.middlewareExecutor)return null;let r=t.request;if(!r)throw new Error("Invalid middleware context: request is undefined");try{let a={request:this.createFetchRequest(r),urlInfo:t.urlInfo,env:t.env,waitUntil:t.waitUntil};return await this.middlewareExecutor(a)}catch(n){let a=n instanceof Error?n.message:String(n);return Kr(`Middleware execution error: ${a}`),null}}createFetchRequest(t){var l;let r=this.convertHeaders(t.headers||{}),n=t.url||"/",a=((l=t.headers)==null?void 0:l.host)||"localhost",s=n.startsWith("http://")||n.startsWith("https://")?n:`http://${a}${n.startsWith("/")?n:`/${n}`}`,c=t.method||"GET";return new Request(s,{method:c,headers:r})}convertHeaders(t){let r=new Headers;for(let[n,a]of Object.entries(t))a&&(Array.isArray(a)?a.forEach(s=>{typeof s=="string"&&r.append(n,s)}):typeof a=="string"&&r.set(n,a));return r}getConfig(){return this.config}};var pge=Det(),aG=require("fs"),oG=require("path"),UUr=require("chokidar");var cG=class{server;proxy;devConfig;buildMatches;inProgressBuilds;watcher;watchAggregationId;devMatches=new Map;workerManager=new sG;listeningPort;devPort;devOrigin;devProcess;devLog;rebuildDebounceTimer;middlewareRunner;constructor(t){this.devConfig=t,this.server=Pet.default.createServer(this.devServerHandler.bind(this)),this.listeningPort=this.devConfig.port||8088,this.devPort=this.devConfig.fePort||6699,this.devConfig.devCommand=pet(),this.proxy=Ret.default.createProxyServer({changeOrigin:!0,ws:!0,xfwd:!0}),this.setupProxy(),this.workerManager.on("rebuilt",({key:r,devMatch:n})=>{Oc("Server updated."),this.devMatches.set(r,n)}),this.workerManager.on("startFailed",({key:r,error:n})=>{console.error(`[DevServer] Runner ${r} start failed:`,n),this.devMatches.delete(r)}),this.workerManager.on("rebuildFailed",({key:r,error:n})=>{console.error(`[DevServer] Runner ${r} rebuild failed:`,n),this.devMatches.delete(r)})}async start(){var s;let{timeout:t="",favicon:r=!1}=this.devConfig||{},n=fet(iG),a=await I8(this.listeningPort,!0);if(this.listeningPort=a,k8.hasMiddleware())try{this.middlewareRunner=new k8(((s=this.devConfig)==null?void 0:s.env)||{}),await this.middlewareRunner.build()}catch(c){Kr(`Failed to load middleware: ${c.message}`)}for(let[c,l]of n)try{let f=new l(this.devConfig);Oc(`Starting dev server for ${c} in worker thread`);let d=await this.workerManager.startRunner(c,f.config);process.env.DEBUG&&console.log(`[DevServer] started sucesssfully devMatch for ${c}`),this.devMatches.set(c,d),process.env.DEBUG&&c==="node-function"&&d.destUrl&&qW(`Node-functions server running at: ${UW(`${d.destUrl}`)}`)}catch(f){console.error(`Failed to start runner for ${c}:`,f),yd(`Failed to start runner for ${c}`,f)}await this.runDevCommand(),this.server.listen(this.listeningPort,()=>{qW(`Running at: ${UW(`http://localhost:${this.listeningPort}`)}`),this.devLog&&process.stdout.write(this.devLog),zUr(this.devMatches,async(c,{path:l,type:f})=>{if(c){console.error("Watch error:",c);return}this.rebuildDebounceTimer&&clearTimeout(this.rebuildDebounceTimer),this.rebuildDebounceTimer=setTimeout(async()=>{console.log(`[DevServer] File changed: ${l}, type: ${f}`),Oc("Change detected, rebuild and update server..."),await this.workerManager.sendRebuildMessage(f,l),this.rebuildDebounceTimer=void 0},500)},async c=>{ei(`[DevServer] New functions found for ${c}, starting runner`);let l=await this.workerManager.startRunner(c,this.devConfig);this.devMatches.set(c,l)},async c=>{ei(`[DevServer] All functions removed for ${c}, stopping runner`),this.workerManager.stopRunner(c),this.devMatches.delete(c)})}),this.server.on("upgrade",(c,l,f)=>{if(this.isHMRRequest(c)&&this.devOrigin)try{this.proxy.ws(c,l,f,{target:this.devOrigin,changeOrigin:!0,timeout:3e4})}catch(m){console.error("WebSocket proxy error:",m.message),l.destroy()}else l.destroy()})}stop(){}isHMRRequest(t){let r=t.url||"",n=["/_next/webpack-hmr","/__webpack_hmr","/_vite/ws","/__vite_hmr","/sockjs-node","/socket.io","/_nuxt/","/__nuxt_hmr"];return n.some(a=>r.startsWith(a))?!0:t.headers.upgrade==="websocket"?n.some(a=>r.startsWith(a))||r.includes("hmr"):!!(r.includes("hmr")&&!r.includes("_rsc="))}isRSCRequest(t){let r=t.url||"";return r.includes("?_rsc=")||r.includes("&_rsc=")}async devServerHandler(t,r){var c,l,f,d;if(this.middlewareRunner)try{let m=`http://${t.headers.host||"localhost"}${t.url}`,g=new URL(m),x={request:t,urlInfo:g,env:this.devConfig.env||{},waitUntil:A=>{}},b=await this.middlewareRunner.execute(x);if(b){let A=((c=b.headers)==null?void 0:c.get("x-middleware-next"))==="1",C=(l=b.headers)==null?void 0:l.get("x-middleware-rewrite"),I=(f=b.headers)==null?void 0:f.get("x-middleware-request-headers");if(C&&(process.env.DEBUG&&console.log(`[Middleware] Rewrite: ${t.url} -> ${C}`),t.url=C),I&&this.applyRequestHeaderPatch(t,I),!A&&!C){process.env.DEBUG&&console.log(`[Middleware] Return response: ${b.status}`),r.writeHead(b.status,Object.fromEntries(b.headers.entries()));let k=await b.text();return r.end(k)}process.env.DEBUG&&A&&console.log("[Middleware] Next: continue to functions")}}catch(m){Kr(`Middleware execution error: ${m.message}`)}let n=(d=this.routeMatch(t))!=null?d:"",a=this.isHMRRequest(t),s=this.isRSCRequest(t);if(process.env.DEBUG&&(console.log(`[DevServer] ${t.method} ${t.url} - isHMR: ${a}, isRSC: ${s}, destUrl: ${n}`),console.log("--------------------------------check dev matches--------------------------------"),console.log(this.devMatches),console.log("--------------------------------check dev matches--------------------------------")),n&&!a&&!s)pQe(t.method.toUpperCase(),t.url),this.proxy.web(t,r,{target:n,changeOrigin:!0});else if(this.devOrigin)try{this.proxy.web(t,r,{target:this.devOrigin,changeOrigin:!0,ws:!0,timeout:5e3})}catch(m){console.error("Proxy web error:",m.message),r.writeHead(502,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:"Bad Gateway",message:"Frontend dev server is temporarily unavailable"}))}else{let m=this.staticMatch(t);if(m){let g=pge.lookup(m)||"application/octet-stream";return r.setHeader("Content-Type",g),aG.createReadStream(m).pipe(r)}else{r.statusCode=404;let g=this.staticMatch("/404.html"),x=this.staticMatch("/index.html");if(g)return r.setHeader("Content-Type",pge.lookup(g)),aG.createReadStream(g).pipe(r);if(x)return r.setHeader("Content-Type",pge.lookup(x)),aG.createReadStream(x).pipe(r);r.setHeader("Content-Type","text/html; charset=utf-8"),r.end(det)}}}async runDevCommand(){let t=this.devConfig.devCommand;if(!t||t.indexOf("undefined")>-1)return;let r=await I8(this.devPort);this.devPort=r;let[n,...a]=t.split(" ");a.push("--port",this.devPort);let s=(0,Net.spawn)(n,a,{cwd:process.cwd(),env:{...process.env,FORCE_COLOR:"1"},stdio:["inherit","pipe","pipe"]});this.devProcess=s;let c=new RegExp(this.devPort.toString(),"g");if(!s.stdout||!s.stderr)throw new Error("Expected child process to have stdout and stderr");s.stderr.pipe(process.stderr),s.stdout.setEncoding("utf8"),await new Promise(l=>{let f=setTimeout(()=>l(!1),2e3);s.stdout.once("data",d=>{this.devLog=d,clearTimeout(f),l(!0)})}),process.env.DEBUG&&qW(`DevServer running at: ${UW(`http://localhost:${this.devPort}`)}`),s.stdout.on("data",l=>{process.stdout.write(l.replace(c,this.listeningPort.toString()))}),s.on("error",l=>{Kr(`Error executing dev command: ${l.message}`)}),s.on("close",l=>{l!==0?Xw(`Dev command exited with code ${l}`):ei("Dev command exited normally"),setTimeout(()=>{(!this.devProcess||this.devProcess.killed)&&(this.devOrigin=void 0,ei("Dev server origin cleared"))},2e3)}),this.devOrigin=`http://localhost:${this.devPort}`}staticMatch(t){var c;let r=typeof t=="string"?t:t!=null&&t.url?decodeURI(t.url):"",n=(c=r==null?void 0:r.split("?")[0])==null?void 0:c.replace(/^\//,""),a=x_("outputDirectory","OutputDir",()=>""),s=di(oG.join(a,n||"index.html"));return aG.existsSync(s)?s:null}routeMatch(t){var f,d;let r=t.url||"",n=t.method||"GET";if(this.isHMRRequest(t))return null;let a=r.split("?")[0],s=Array.from(this.devMatches.entries()).filter(([m,g])=>g.routes.some(x=>{if(x.isFramework&&a.startsWith(x.routePath)&&(a.replace(x.routePath,"").startsWith("/")||a.replace(x.routePath,"")===""))return!0;let b=(x==null?void 0:x.method)||"",A;return x!=null&&x.routePath&&(A=`^${x.routePath.replace(/\//g,"\\/").replace(/\/:(\w+)\*$/,"/.*").replace(/:(\w+)/g,"([^/]*)")}$`),process.env.DEBUG&&console.log(" \u5339\u914D\u68C0\u67E5",x.routePath,new RegExp(A).test(a),b.includes(t.method)),A?new RegExp(A).test(a)&&b.includes(t.method):!1})),c=["edge-function","node-function"];return(d=(f=s.sort((m,g)=>c.indexOf(m[0])-c.indexOf(g[0]))[0])==null?void 0:f[1])==null?void 0:d.destUrl}setupProxy(){this.proxy.on("error",(t,r,n)=>{if(console.error("proxy error",t),r&&this.isHMRRequest(r)){console.log("HMR proxy error for:",r.url);return}yd("Proxy server error",t),n&&!n.headersSent&&(n.writeHead(502,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Bad Gateway",message:"The upstream server is temporarily unavailable"})))}),this.proxy.on("proxyRes",(t,r,n)=>{this.isRSCRequest(r)&&(t.headers["content-type"]||(t.headers["content-type"]="text/plain; charset=utf-8"),t.headers["cache-control"]="no-cache, no-store, must-revalidate",t.headers.pragma="no-cache",t.headers.expires="0"),this.isHMRRequest(r)&&(t.headers["access-control-allow-origin"]="*",t.headers["access-control-allow-methods"]="GET, POST, PUT, DELETE, OPTIONS",t.headers["access-control-allow-headers"]="Content-Type, Authorization, X-Requested-With",r.headers.upgrade==="websocket"&&(t.headers["access-control-allow-credentials"]="true"))}),this.proxy.on("proxyReqWs",(t,r,n,a,s)=>{n.on("error",c=>{console.error("WebSocket socket error:",c.message)})}),this.proxy.on("proxyResWs",(t,r,n,a)=>{n.on("error",s=>{console.error("WebSocket response error:",s.message)})}),this.proxy.on("econnreset",(t,r,n,a)=>{console.log("Connection reset, probably due to dev server restart")})}applyRequestHeaderPatch(t,r){try{let n=decodeURIComponent(r),a=JSON.parse(n);Object.entries(a).forEach(([s,c])=>{let l=s.toLowerCase();if(c===null||typeof c>"u"){delete t.headers[l];return}t.headers[l]=c})}catch(n){Kr(`Failed to apply middleware request headers: ${n instanceof Error?n.message:String(n)}`)}}async reloadMiddleware(){if(this.middlewareRunner)try{await this.middlewareRunner.build(),da("\u2705 Middleware reloaded successfully")}catch(t){Kr(`Failed to reload middleware: ${t.message}`)}}async close(){if(this.rebuildDebounceTimer&&(clearTimeout(this.rebuildDebounceTimer),this.rebuildDebounceTimer=void 0),await this.workerManager.stopAll(),this.devProcess)try{this.devProcess.pid&&process.kill(this.devProcess.pid,0)&&process.kill(this.devProcess.pid)}catch(t){t.code!=="ESRCH"&&console.error("Failed to kill dev process:",t)}finally{this.devProcess=null}return new Promise(t=>{if(!this.server.listening){t();return}this.server.close(()=>{console.log("HTTP server closed"),t()})})}};async function zUr(e,t,r,n,a){function s(l,f){try{let d=A=>oG.normalize(A).replace(/^\.\//,"").replace(/\\/g,"/"),m=d(l),g=d(f),x=oG.resolve(process.cwd(),f);return oG.resolve(process.cwd(),l).startsWith(x)||m.startsWith(g)}catch(d){console.error("match path error",d)}}UUr.watch(".",{ignored:[/(^|[\/\\])\../,/node_modules/,/\.git/,/dist/,/build/,/\.edgeone/],persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:300}}).on("add",async function(l){let f=l.startsWith("node-functions/")&&!l.endsWith("/"),d=l.startsWith("edge-functions/")&&!l.endsWith("/");if(console.log("add",l,"; file type:",f?"node-function":d?"edge-function":"unknown"),f||d){let m=f?"node-functions":"edge-functions",g=f?"node-function":"edge-function";if(P_(m)>=1&&!e.has(g))try{await(r==null?void 0:r(g)),Oc(`[DevServer] Runner ${g} started`)}catch(b){console.error(`Failed to start runner ${g}:`,b)}else{let b=Array.from(e.values()).find(A=>A.watch.some(C=>s(l,C)));t(null,{path:l,type:(b==null?void 0:b.type)||"unknown"})}}}).on("unlink",async function(l){console.log("unlink",l);let f=l.startsWith("node-functions/")&&!l.endsWith("/"),d=l.startsWith("edge-functions/")&&!l.endsWith("/"),m=l==="node-functions"||l==="node-functions/";if(m||(l==="edge-functions"||l==="edge-functions/")){let x=m?"node-function":"edge-function";await(n==null?void 0:n(x))}else if(f||d){let x=f?"node-functions":"edge-functions",b=f?"node-function":"edge-function",A=0;try{A=P_(x)}catch{A=0}if(A===0)await(n==null?void 0:n(b));else{let C=Array.from(e.values()).find(I=>I.watch.some(k=>s(l,k)));t(null,{path:l,type:(C==null?void 0:C.type)||"unknown"})}}}).on("change",async function(l){if(console.log("change",l),l==="middleware.js"||l==="middleware.ts"){Oc("Middleware changed, reloading...");try{await(a==null?void 0:a.reloadMiddleware())}catch(d){Kr(`Failed to reload middleware: ${d.message}`)}return}let f=Array.from(e.values()).find(d=>{var m;return(m=d.watch)==null?void 0:m.some(g=>s(l,g))});if(f)t(null,{path:l,type:(f==null?void 0:f.type)||"unknown"});else{let d=l.startsWith("node-functions/")&&!l.endsWith("/"),m="";d?m="node-function":isEdgeFuncFile&&(m="edge-function"),m&&await(r==null?void 0:r(m))}})}var Oet=wr(require("path"));var Fet=lN();async function HUr(){let t=`env_vars_pull_prompt_${Oet.default.basename(process.cwd())}`;try{let r=new Date().toISOString().split("T")[0],n=await MR(t);if(n&&n.date===r)return n.shouldPull;let{pullEnvVars:a}=await Fet({type:"confirm",name:"pullEnvVars",message:"Sync environment variables from the EdgeOne Pages console?",default:!0});return Rz("Your choice will be remembered for the rest of the day."),await jR(t,{date:r,shouldPull:a}),a}catch(r){console.warn("Failed to check env vars pull prompt cache:",r);let{pullEnvVars:n}=await Fet({type:"confirm",name:"pullEnvVars",message:"Do you want to pull env vars from EdgeOne Pages Console?",default:!0});return n}}async function Qet(e){let{token:t}=e;t&&(process.env.EDGEONE_PAGES_API_TOKEN=t,await VC()),e.debug&&(process.env.DEBUG="true",console.log("Running in debug mode")),await ly();let r=process.cwd(),n;try{n=_0(`${process.cwd()}/.edgeone/project.json`)}catch{}let a={},s=await HUr();if(n&&n.Name&&n.ProjectId){a={...a,...n},s&&await T_(n.ProjectId).catch(g=>{yd("Dev pull env vars error,",g),Kr("Pull env vars error:"+g.message)});let m={};try{let g=di("./.env");m=xN(g),a.env=m}catch{m={}}}else ei("Dev server running in raw mode...");let c=new yF(r),l=await my(),f=await IW(r,l);await c.loadPlugins(f),e.fePort&&(a.fePort=e.fePort),e.port&&(a.port=e.port),await c.onPreDev({cwd:r,env:a.env||{},config:l});let d=new cG(a);return process.on("SIGINT",async()=>{console.log("Received SIGINT signal, shutting down..."),d&&await d.close(),process.exit(0)}),process.on("SIGTERM",async()=>{console.log("Received SIGTERM signal, shutting down..."),d&&await d.close(),process.exit(0)}),await c.onDev({cwd:r,env:a.env||{},config:l}),await d.start().then(()=>{setTimeout(()=>{console.log(" Shutting down local server..."),process.exit(1)},1e3*60*60*2)}).catch(m=>{yd("Dev server unhandled error:",m),Kr("Run pages dev error:"+m)})}var vNt=wr(require("fs"));var lNt=wr(rmt()),Tu=wr(require("path")),W1=wr(require("fs/promises")),pNt=wr(Sae());var fNt=require("fs");var sre=wr(Hxt()),wqn=cNt(),uNt=process.env.https_proxy||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.HTTP_PROXY;if(uNt){let e=new sre.ProxyAgent(uNt);(0,sre.setGlobalDispatcher)(e)}pNt.default.config();var $1={FILE_PARALLEL_LIMIT:parseInt(process.env.COS_FILE_PARALLEL_LIMIT||"10"),CHUNK_PARALLEL_LIMIT:parseInt(process.env.COS_CHUNK_PARALLEL_LIMIT||"8"),CHUNK_SIZE_MB:parseInt(process.env.COS_CHUNK_SIZE_MB||"8"),CHUNK_RETRY_TIMES:parseInt(process.env.COS_CHUNK_RETRY_TIMES||"2")},dNt="https://pages-api.cloud.tencent.com/v1",Sqn="https://pages-api.edgeone.ai/v1";var hNt=dNt;var Cqn=async()=>{let e=process.env.EDGEONE_PAGES_API_TOKEN;if(!e)throw new Error('Missing EDGEONE_PAGES_API_TOKEN. Please provide a api token with --token or login first with "edgeone login".');return e},_qn=async()=>`Bearer ${await Cqn()}`,hb=()=>{let e=process.env.EDGEONE_PAGES_PROJECT_NAME||"";if(!e)throw new Error("Project name is required. Please provide using the -n or --name parameter.");return e},QP=async e=>{var c,l;let{action:t,data:r={},baseUrl:n=hNt,throwOnError:a=!0}=e,s={Action:t,...r};try{let f=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:await _qn()},body:JSON.stringify(s)});if(!f.ok){let m=await f.text(),g=new Error(`API request failed (${f.status}): ${m}`);if(a)throw g;return{Code:-1,Data:{},Message:g.message,RequestId:""}}let d=await f.json();if(d.Code!==0&&a)throw(l=(c=d.Data)==null?void 0:c.Response)!=null&&l.Error?new Error(d.Data.Response.Error.Message):new Error(`API error: ${d.Message}`);return d}catch(f){if(a)throw Kr(`[callApi] ${t} failed: ${f instanceof Error?f.message:String(f)}`),f;return{Code:-1,Data:{},Message:f instanceof Error?f.message:String(f),RequestId:""}}},rk={token:null,cos:null},mNt=()=>{rk.token=null,rk.cos=null},ire=e=>new Promise(t=>setTimeout(t,e)),Iqn=async()=>{let e=async n=>{let a=await QP({action:"DescribePagesProjects",data:{PageNumber:1,PageSize:10},baseUrl:n,throwOnError:!1});return{success:a.Code===0,code:a.Code}},t=await Gv(),r=[];r=[dNt,Sqn];for(let n of r)if((await e(n)).success){hNt=n;return}throw new Error('Invalid EDGEONE_PAGES_API_TOKEN. Please provide a valid API token with --token or login first with "edgeone login". For more information, please refer to https://edgeone.ai/document/177158578324279296')},gNt=(e,t)=>{if(e.Provider&&e.Provider!=="Upload")throw new Error(`[${t}] Project ${hb()} exists but has Provider '${e.Provider}'. This project type does not support direct folder or zip file deployment. Only projects with Provider 'Upload' are supported.`)},ANt=async(e="global")=>{var r,n,a,s,c,l;if(rk.token)return rk.token;let t;try{let f=await are({projectName:hb()});if(((a=(n=(r=f.Data)==null?void 0:r.Response)==null?void 0:n.Projects)==null?void 0:a.length)>0){let d=f.Data.Response.Projects[0];t=d.ProjectId,gNt(d,"getCosTempToken")}else{let d=await UTe(e);if(((l=(c=(s=d.Data)==null?void 0:s.Response)==null?void 0:c.Projects)==null?void 0:l.length)>0)t=d.Data.Response.Projects[0].ProjectId;else throw new Error(`Failed to create project ${hb()}`)}}catch(f){throw Kr(`[getCosTempToken] Error: ${f instanceof Error?f.message:String(f)}`),new Error(`Failed to get or create project ${hb()}: ${f instanceof Error?f.message:String(f)}`)}try{let f=await QP({action:"DescribePagesCosTempToken",data:{ProjectId:t}});return rk.token=f,f}catch(f){throw Kr(`[getCosTempToken] Error getting COS token: ${f instanceof Error?f.message:String(f)}`),f}},kqn=async(e="global")=>{var r,n,a;if(!hb())throw new Error("Project name is required. Please provide using the -n or --name parameter.");let t;try{t=await are({projectName:hb()})}catch(s){if(s instanceof Error&&s.message.includes("Provider")&&s.message.includes("This project type does not support"))throw s;return Oc(`[getOrCreateProject] Error checking project ${hb()}: ${s}. Attempting to create project.`),await UTe(e)}if(((a=(n=(r=t.Data)==null?void 0:r.Response)==null?void 0:n.Projects)==null?void 0:a.length)>0){let s=t.Data.Response.Projects[0];return gNt(s,"getOrCreateProject"),da(`Project ${mB.highlight(hb())} already exists. Using existing project.`),t}return Xw(`Project ${mB.highlight(hb())} doesn't exist. Creating new project.`),await UTe(e)},UTe=async(e="global")=>{var t,r,n,a,s;try{Oc(`[CreatePagesProject] Creating new project with name: ${hb()} in ${e} area`);let c=await QP({action:"CreatePagesProject",data:{Name:hb(),Provider:"Upload",Channel:"Custom",Area:e,Source:process.env.PAGES_SOURCE||"cli"}});if(!((r=(t=c==null?void 0:c.Data)==null?void 0:t.Response)!=null&&r.ProjectId))throw new Error(((s=(a=(n=c==null?void 0:c.Data)==null?void 0:n.Response)==null?void 0:a.Error)==null?void 0:s.Message)||"Failed to get ProjectId from API response");return await ire(2e3),await are({projectId:c.Data.Response.ProjectId})}catch(c){throw Kr("Error creating pages project: "+c),c}},are=async e=>{let{projectId:t,projectName:r}=e;try{let n=[];t&&n.push({Name:"ProjectId",Values:[t]}),r&&n.push({Name:"Name",Values:[r]});let a=await QP({action:"DescribePagesProjects",data:{Filters:n,Offset:0,Limit:10,OrderBy:"CreatedOn"}});return a.Data?a.Data.Response?a.Data.Response.Projects||(a.Data.Response.Projects=[]):a.Data.Response={Projects:[]}:a.Data={Response:{Projects:[]}},a}catch(n){return Kr(`[describePagesProjects] Error: ${n instanceof Error?n.message:String(n)}`),{Code:-1,Data:{Response:{Projects:[]}},Message:n instanceof Error?n.message:String(n),RequestId:""}}},Tqn=async(e,t=!0)=>await QP({action:"DescribePagesDeployments",data:{ProjectId:e,Offset:0,Limit:50,OrderBy:"CreatedOn",Order:"Desc"},throwOnError:t}),Bqn=async e=>await QP({action:"DescribePagesEncipherToken",data:{Text:e}}),HTe=e=>Tu.extname(e).toLowerCase()===".zip",Dqn=async e=>{let{projectId:t,targetPath:r,isZip:n,env:a}=e;return await QP({action:"CreatePagesDeployment",data:{ProjectId:t,ViaMeta:"Upload",Provider:"Upload",Env:a,DistType:n?"Zip":"Folder",TempBucketPath:r,BuildFrom:"CLI"}})},zTe=async(e="global")=>{if(rk.cos)return rk.cos;let t=await ANt(e);if(t.Code!==0||!t.Data||!t.Data.Response||!t.Data.Response.Credentials)throw new Error("Failed to get COS temp token");let n=t.Data.Response.Credentials,a=new lNt.default({SecretId:n.TmpSecretId,SecretKey:n.TmpSecretKey,SecurityToken:n.Token,FileParallelLimit:$1.FILE_PARALLEL_LIMIT,ChunkParallelLimit:$1.CHUNK_PARALLEL_LIMIT,ChunkRetryTimes:$1.CHUNK_RETRY_TIMES,ChunkSize:1024*1024*$1.CHUNK_SIZE_MB,SliceSize:1024*1024*$1.CHUNK_SIZE_MB,ProgressInterval:1e3});return rk.cos=a,a},Pqn=async e=>{let t=[],r=async n=>{let a=await W1.readdir(n,{withFileTypes:!0});for(let s of a){let c=Tu.join(n,s.name),l=s.isDirectory(),f=await W1.stat(c);t.push({isDir:l,path:l?`${c}/`:c,size:l?0:f.size}),l&&await r(c)}};try{if(await r(e),t.length>1e6)throw new Error("too_much_files");return t}catch(n){throw Kr("Error in fastListFolder: "+n),n}},Rqn=async(e,t={})=>{let r=Tu.dirname(e),n=Tu.basename(e),a=Tu.basename(process.cwd()),s=Tu.join(r,`${a}.zip`),{level:c=9,excludePatterns:l=["node_modules",".git",".DS_Store","*.log"],includeHidden:f=!1}=t;return new Promise(async(d,m)=>{try{let g=(0,fNt.createWriteStream)(s),x=wqn("zip",{zlib:{level:c}});x.on("error",b=>{throw b}),g.on("close",()=>{d(s)}),x.pipe(g),n===".edgeone"?x.directory(e,`${a}/${n}`,{ignore:l,dot:f}):x.directory(e,n,{ignore:l,dot:f}),await x.finalize()}catch(g){throw Kr(`[zipFile] Error compressing folder: ${g instanceof Error?g.message:String(g)}`),g}})},Nqn=async(e,t,r,n,a=!1,s="global",c=!1)=>{let l=Tu.isAbsolute(e)?e:di(e);if(a&&!HTe(l))try{let x=await Rqn(l,{level:6,excludePatterns:["node_modules",".git",".DS_Store","*.log","*.tmp"],includeHidden:c}),b=Tu.basename(x),A=await zTe(s),C=new fU(A,t,r,n);try{let I=await C.uploadZipFile(x,b);return W1.unlink(x).catch(()=>{}),I}catch(I){throw Kr(`[uploadToEdgeOneCOS] Error uploading compressed file: ${I instanceof Error?I.message:String(I)}`),I}}catch(x){Kr(`[optionallyCompressAndUpload] Compression failed, falling back to direct upload: ${x instanceof Error?x.message:String(x)}`)}Oc("[uploadToEdgeOneCOS] Scanning directory for files...");let f=await Pqn(e);Oc(`[uploadToEdgeOneCOS] Found ${f.length} files/directories in ${e}`);let d=Oqn(f,e,t,r,n);Oc(`[uploadToEdgeOneCOS] Uploading ${d.length} files to COS with targetPath: ${n}...`);let m=await zTe(s);return await new fU(m,t,r,n).uploadMultipleFiles(d),Oc("[uploadToEdgeOneCOS] Upload successful."),{success:!0,targetPath:n,isZip:!1}},Fqn=e=>{let t={next:{dirName:"next",versions:[14,15]},react:{dirName:"react",versions:[18]},"react-dom":{dirName:"react-dom",versions:[18]}},r=[];for(let n in t){let a=t[n],s=Tu.join(e,"server-handler","node_modules",a.dirName,"package.json");if(KL(s)){let c=_0(s);c!=null&&c.version&&a.versions.includes(parseInt(c==null?void 0:c.version.split(".")[0],10))&&r.push(`server-handler/node_modules/${a.dirName}/`)}}return r};var Oqn=(e,t,r,n,a)=>{let s=Tu.basename(t),c=Tu.basename(Tu.dirname(t)),l=[];return s===".edgeone"&&dirExitsSync(Tu.join(t,"server-handler"))&&(l=Fqn(t)),e.map(f=>{let d=Tu.relative(t,f.path).replace(/\\/g,"/"),m=s===".edgeone"?`${a}/${c}/${s}/${d||""}`:`${a}/${d||""}`;return{Bucket:r,Region:n,Key:m,FilePath:f.path}}).filter(f=>!(f.FilePath.endsWith("/")||f.Key==="/"||f.Key===""||l.length&&l.some(d=>f.FilePath.includes(d))||f.FilePath!==t&&f.FilePath.startsWith(".")&&f.FilePath!==Tu.basename(f.FilePath)||f.FilePath.startsWith(`node_modules${Tu.sep}`)))};var fU=class{cos;bucket;region;targetPath;constructor(t,r,n,a){this.cos=t,this.bucket=r,this.region=n,this.targetPath=a}async uploadSingleFile(t,r){return new Promise((n,a)=>{let s=mQe("[Uploader] Uploading file","cli",30,"cyan");this.cos.uploadFile({Bucket:this.bucket,Region:this.region,Key:r,FilePath:t,SliceSize:1024*1024*$1.CHUNK_SIZE_MB,ChunkSize:1024*1024*$1.CHUNK_SIZE_MB,ChunkParallel:$1.CHUNK_PARALLEL_LIMIT,ChunkRetryTimes:$1.CHUNK_RETRY_TIMES,onProgress:c=>{if(c.percent!=null){let l=Math.max(0,Math.min(100,Math.round(c.percent*100)));s.update(l,"[Uploader] Uploading file")}},onHashProgress:c=>{if(c.percent!=null){let l=Math.max(0,Math.min(100,Math.round(c.percent*100)));s.update(l,"Calculating hash")}}},(c,l)=>{s.stop(),c?(Kr(`[Uploader] Error uploading file ${r}: ${c.message}`),a(c)):n(l)})})}async uploadMultipleFiles(t){Oc(`[uploadFiles] Starting upload of ${t.length} files with optimized settings...`);let r=100;if(t.length>r){Oc(`[uploadFiles] Large file count detected (${t.length}), processing in batches of ${r}...`);let n=[];for(let a=0;a<t.length;a+=r){let s=t.slice(a,a+r);Oc(`[uploadFiles] Processing batch ${Math.floor(a/r)+1}/${Math.ceil(t.length/r)} (${s.length} files)...`);let c=await this.uploadFilesBatch(s);n.push(c)}return{files:n.flat()}}else return this.uploadFilesBatch(t)}async uploadFilesBatch(t){return new Promise((r,n)=>{this.cos.uploadFiles({files:t,SliceSize:1024*1024*$1.CHUNK_SIZE_MB,onProgress:a=>{if(a.percent){let s=Math.round(a.percent*100)}},onFileFinish:(a,s,c)=>{a?Kr(`[uploadFilesBatch] File upload failed: ${c.Key} - ${a.message}`):process.env.DEBUG_UPLOAD&&Oc(`[uploadFilesBatch] File uploaded successfully: ${c.Key}`)}},function(a,s){a?(Kr(`[uploadFilesBatch] Batch upload failed: ${a.message}`),n(a)):(Oc(`[uploadFilesBatch] Batch uploaded successfully (${t.length} files)`),r(s))})})}async uploadZipFile(t,r){let n=`${this.targetPath}/${r}`;try{return await this.uploadSingleFile(t,n),da("File uploaded successfully"),{success:!0,isZip:!0,targetPath:n}}catch(a){throw Kr(`[Uploader] Error uploading zip file: ${a instanceof Error?a.message:String(a)}`),a}}},Qqn=async(e,t="global")=>{var r;try{let n=await ANt(t);if(n.Code!==0||!((r=n==null?void 0:n.Data)!=null&&r.Response))throw new Error(`Failed to get COS token: ${n.Message||"Invalid token response"}`);let a=n.Data.Response,s=a.Bucket,c=a.Region,l=a.TargetPath;if(!s||!c||!l)throw new Error("Missing required COS parameters (Bucket, Region, TargetPath) in token response.");if(HTe(e)){Oc(`[uploadToEdgeOneCOS] Uploading zip file to COS with targetPath: ${l}...`);let d=Tu.basename(e),m=`${l}/${d}`,g=await zTe(t),x=new fU(g,s,c,l);try{return await x.uploadZipFile(e,d)}catch(b){throw Kr(`[uploadToEdgeOneCOS] Error uploading zip file: ${b instanceof Error?b.message:String(b)}`),b}}else return await Nqn(e,s,c,l,!0,t,e!=="./")}catch(n){throw mNt(),Kr(`[uploadToEdgeOneCOS] Error: ${n instanceof Error?n.message:String(n)}`),new Error(`Error uploading to COS: ${n instanceof Error?n.message:String(n)}`)}},Lqn=async(e,t)=>{let r=!0,n=null,a=hQe("[DeployStatus] Deploying","cli",300,6);for(;r;)try{let s=await Tqn(e,!1);if(s.Code!==0){await ire(5e3);continue}if(n=s.Data.Response.Deployments.find(c=>c.DeploymentId===t),!n)throw new Error(`Deployment with ID ${t} not found`);["Process","Pending"].includes(n.Status)?await ire(5e3):r=!1}catch{await ire(5e3);continue}return a.stop(),n},jqn=async e=>{try{await W1.access(e)}catch{throw new Error("localPath does not exist")}let t=await W1.stat(e),r=HTe(e);if(!t.isDirectory()&&!r)throw new Error("localPath must be a folder or zip file");return r},Mqn=async(e,t,r="Production")=>{var s,c,l,f,d,m,g;let n=await are({projectId:t});if(!((l=(c=(s=n==null?void 0:n.Data)==null?void 0:s.Response)==null?void 0:c.Projects)!=null&&l[0]))throw new Error("Failed to retrieve project status information.");let a=n.Data.Response.Projects[0];if(e.Status==="Success"){if(r==="Production"&&a.CustomDomains&&a.CustomDomains.length>0){let k=a.CustomDomains[0];if(k.Status==="Pass")return{type:"custom",url:`https://${k.Domain}`,projectId:t}}let x;r==="Production"?x=a.PresetDomain:x=e.PreviewUrl?e.PreviewUrl.replace("https://",""):a.PresetDomain;let b=await Bqn(x);if(b.Code!==0||!((d=(f=b==null?void 0:b.Data)==null?void 0:f.Response)!=null&&d.Token)||!((g=(m=b==null?void 0:b.Data)==null?void 0:m.Response)!=null&&g.Timestamp))throw new Error(`Deployment completed, but failed to get access token: ${b.Message||"Invalid token data"}`);let{Token:A,Timestamp:C}=b.Data.Response;return{type:"preset",url:`https://${x}?eo_token=${A}&eo_time=${C}`,projectId:t}}else throw new Error(`Deployment failed with status: ${e.Status}`)},yNt=async(e,t="Production",r="global")=>{var n,a,s,c,l;try{mNt();let f=await jqn(e);await Iqn();let d=await kqn(r),m=(s=(a=(n=d==null?void 0:d.Data)==null?void 0:n.Response)==null?void 0:a.Projects)==null?void 0:s[0],g=m==null?void 0:m.ProjectId;if(!g)throw new Error("Failed to retrieve Project ID after get/create. Please check the project name and API key.");da(`Using Project ID: ${mB.highlight(g)}`);let x=Tu.join(process.cwd(),".edgeone","project.json");uy(x,JSON.stringify({Name:m.Name,ProjectId:g}));let b=await Qqn(e,r);if(!b.targetPath)throw new Error("COS upload succeeded but targetPath is missing.");let A=b.targetPath;da(`Creating deployment in ${t} environment...`);let C=await Dqn({projectId:g,targetPath:A,isZip:b.isZip||f,env:t});if(!((l=(c=C==null?void 0:C.Data)==null?void 0:c.Response)!=null&&l.DeploymentId))throw new Error("Failed to create deployment: deployment ID not returned from API");let I=C.Data.Response.DeploymentId;da(`Created deployment with Deployment ID: ${mB.highlight(I)}`);let k=await Lqn(g,I);k.Status==="Success"?da(`Deploy ${k.Status}`):Kr(`Deploy ${k.Status}`);let O=await Mqn(k,g,t);return da("Deployment to EdgeOne Pages completed successfully! To view your project's live URL."),console.log(`EDGEONE_DEPLOY_URL=${O.url}`),console.log(`EDGEONE_DEPLOY_TYPE=${O.type}`),console.log(`EDGEONE_PROJECT_ID=${O.projectId}`),{deploymentId:I,...O}}catch(f){throw f}};var ore=async e=>{try{let t=e.directoryOrZip;if(!t){console.log("Execute auto build and deploy .edgeone directory");let m;try{m=_0(`${process.cwd()}/.edgeone/project.json`)}catch{}if(m&&(m!=null&&m.ProjectId)){let g=e.token||e.t;g&&(process.env.EDGEONE_PAGES_API_TOKEN=g,da("Using provided API token for deployment...")),await T_(m.ProjectId).catch(x=>{Kr("Pull env vars error:"+x.message)})}await RW({}),t=di("./.edgeone")}let r=e.name||e.n;if(r||vNt.existsSync(di("./.edgeone/project.json"))&&(r=_0(di("./.edgeone/project.json")).Name),!r){Kr(`Missing project name. Please use -n or --name option, for example: edgeone pages deploy ./directory -n my-project-name Or you can run "${y8("edgeone pages link")}" first`),process.exit(1);return}let n=e.area||e.a||"global";process.env.EDGEONE_PAGES_PROJECT_NAME=r;let s=(e.env||"production").toLowerCase()==="preview"?"Preview":"Production",c=e.token||e.t;if(c)process.env.EDGEONE_PAGES_API_TOKEN=c,da("Using provided API token for deployment...");else try{let m=await dT();if(!m){Kr("No API token provided and not logged in."),Kr("Please either:"),Kr(" 1. Login first: edgeone login"),Kr(" 2. Or provide a token: edgeone pages deploy ./dist -n project-name -t $EDGEONE_API_TOKEN"),process.exit(1);return}process.env.EDGEONE_PAGES_API_TOKEN=m,da("Using local login token for deployment...")}catch{Kr("No API token provided and not logged in."),Kr("Please either:"),Kr(" 1. Login first: edgeone login"),Kr(" 2. Or provide a token: edgeone pages deploy ./dist -n project-name -t $EDGEONE_API_TOKEN"),process.exit(1);return}da(`Deploying ${t} to project ${r} (${s} environment, ${n} area)...`);let l=await yNt(t,s,n),d=await Gv()==="china"?"https://console.cloud.tencent.com/edgeone/pages/project/":"https://console.tencentcloud.com/edgeone/pages/project/";return da(`You can view your deployment in the EdgeOne Pages Console at: ${mB.highlight(`${d}${l.projectId}/deployment/${l.deploymentId}`)}`),l}catch(t){let r=t&&typeof t=="object"&&"message"in t?String(t.message):String(t);Kr(`Deployment failed: ${r}`),process.exit(1)}};async function dU(e,t){let{token:r,file:n}=t;try{r&&(process.env.EDGEONE_PAGES_API_TOKEN=r,await VC())}catch(l){Kr(`check and set region failed: ${l}`),process.exit(1)}await ly();let a;try{a=_0(`${process.cwd()}/.edgeone/project.json`)}catch{Kr("Can't read project infomation, you need to run 'edgeone pages link' first"),process.exit()}let s,c;switch(e){case"pull":T_(a.ProjectId,void 0,n);break;case"ls":EKe(a.ProjectId);break;case"set":s=t._[3],c=t._[4],wKe(a.ProjectId,s,c);break;case"rm":s=t._[3],A0e(a.ProjectId,s);break;default:Kr(`Invalid command: ${e}`),process.exit(1)}}var VTe=lN(),lv=require("fs"),Mh=require("path");function qqn(){let e=Mh.join(process.cwd(),"functions");if(lv.existsSync(e))console.log("Pages function folder already exists.");else{let t=Mh.join(process.cwd(),"edge-functions","helloworld-edge","index.js"),r=`export function onRequest(context) {
3485
3485
  const json = JSON.stringify({
3486
3486
  "code": 0,
3487
3487
  "message": "Hello World"
@@ -3497,10 +3497,10 @@ return { executeMiddleware };`)();if(!a||typeof a.executeMiddleware!="function")
3497
3497
  `;lv.mkdirSync(Mh.dirname(t),{recursive:!0});try{lv.writeFileSync(t,r)}catch(n){console.error("Create function failed:",n)}}}function Uqn(){let e=Mh.join(process.cwd(),"node-functions");if(lv.existsSync(e))console.log("Node function folder already exists.");else{let t=Mh.join(process.cwd(),"node-functions","helloworld-cloud","index.js"),r=`export async function onRequest(context) {
3498
3498
  return new Response("Hello, world!")
3499
3499
  }
3500
- `;lv.mkdirSync(Mh.dirname(t),{recursive:!0});try{lv.writeFileSync(t,r)}catch(n){console.error("Create cloud function failed:",n)}}}async function zqn(){let e="https://docs.edgeone.site/pages-llms.mdc",t=process.cwd(),r=[],n=process.env.HOME||process.env.USERPROFILE||"",a=!process.env.CURSOR_TRACE_ID||lv.existsSync(Mh.join(t,".cursor"))||n&&lv.existsSync(Mh.join(n,".cursor")),s=!!process.env.PATH.includes("windsurf")||lv.existsSync(Mh.join(t,".windsurfrules")),c=!!process.env.CODE_BUDDY_TRACE_ID||lv.existsSync(Mh.join(t,".codebuddy"));if(a){let l=Mh.join(t,".cursor","rules");r.push(Mh.join(l,"pages-llms.mdc"))}if(s){let l=Mh.join(t,".windsurfrules");r.push(l)}c&&r.push(Mh.join(t,"CODEBUDDY.md")),!a&&!s&&!c&&(r.push(Mh.join(t,"pages-llms.mdc")),Oc("No IDE detected, adding to project root, please manually add it to your IDE."));try{let l=await fetch(e,{headers:{accept:"text/markdown,text/plain,*/*"}});if(!l.ok){console.error(`Download AI rule failed: HTTP ${l.status} ${l.statusText}`);return}let f=await l.text();for(let d of r)try{lv.mkdirSync(Mh.dirname(d),{recursive:!0}),lv.writeFileSync(d,f,"utf8"),ma(`AI rule written: ${d}`)}catch(m){console.error(`Write AI rule failed: ${d}`,m)}}catch(l){console.error("Download AI rule failed:",l)}}async function xNt(e){let{token:t}=e;t&&(process.env.EDGEONE_PAGES_API_TOKEN=t,await VC()),await ly();let{createEdge:r}=await VTe({type:"confirm",name:"createEdge",message:"Do you want to create an Edge Function example?",initial:!0});r&&(qqn(),ma("Edge Function example created!"));let{createCloud:n}=await VTe({type:"confirm",name:"createCloud",message:"Do you want to create a Node Function example?",initial:!0});n&&(Uqn(),ma("Node Function example created!"));let{createAIRule:a}=await VTe({type:"confirm",name:"createAIRule",message:"Do you want to create an AI rule file to help you build the project?",initial:!0});a&&await zqn(),DH(),ma("Project init success!"),process.exit(0)}var WTe=wr(lN());async function bNt(e){let n=(await D0("DescribePagesProjects",{ProjectIds:[],Filters:[{Name:"Name",Values:[e]}]})).Projects.find(a=>a.Name===e);if(!n)throw new Error(`Project ${e} not found. Please check your project name.`);return n}var $Te=require("fs"),$wi=require("path");async function Hqn(){let e=async()=>{let{name:t}=await(0,WTe.default)({type:"text",name:"name",message:"Input your EdgeOne Pages project name"},{onCancel:()=>{process.exit(1)}}),r=await bNt(t).catch(async n=>{if(n.message==="AuthFailure")return Kr("Auth Failed, please input your secret id and secret key again."),process.exit(1);YXe("Project not found, please check your project name.");let{createNewDeployment:a}=await(0,WTe.default)({type:"confirm",name:"createNewDeployment",message:`Do you want to create a new deployment with project name "${t}" ?`});if(a){Oc("Creating new deployment...");let s=await dT(),c=await ore({name:t,directoryOrZip:"./",token:s});return{name:t,ProjectId:(c==null?void 0:c.projectId)||""}}return null});return r?{name:t,targetProject:r}:await e()};return await e()}async function ENt(e){let{token:t}=e;t&&(process.env.EDGEONE_PAGES_API_TOKEN=t,await VC()),await ly();let{name:r,targetProject:n}=await Hqn();if(r){let a=`${process.cwd()}/.edgeone`;$Te.existsSync(a)||$Te.mkdirSync(a),$Te.writeFile(`${a}/project.json`,`{
3500
+ `;lv.mkdirSync(Mh.dirname(t),{recursive:!0});try{lv.writeFileSync(t,r)}catch(n){console.error("Create cloud function failed:",n)}}}async function zqn(){let e="https://docs.edgeone.site/pages-llms.mdc",t=process.cwd(),r=[],n=process.env.HOME||process.env.USERPROFILE||"",a=!process.env.CURSOR_TRACE_ID||lv.existsSync(Mh.join(t,".cursor"))||n&&lv.existsSync(Mh.join(n,".cursor")),s=!!process.env.PATH.includes("windsurf")||lv.existsSync(Mh.join(t,".windsurfrules")),c=!!process.env.CODE_BUDDY_TRACE_ID||lv.existsSync(Mh.join(t,".codebuddy"));if(a){let l=Mh.join(t,".cursor","rules");r.push(Mh.join(l,"pages-llms.mdc"))}if(s){let l=Mh.join(t,".windsurfrules");r.push(l)}c&&r.push(Mh.join(t,"CODEBUDDY.md")),!a&&!s&&!c&&(r.push(Mh.join(t,"pages-llms.mdc")),Oc("No IDE detected, adding to project root, please manually add it to your IDE."));try{let l=await fetch(e,{headers:{accept:"text/markdown,text/plain,*/*"}});if(!l.ok){console.error(`Download AI rule failed: HTTP ${l.status} ${l.statusText}`);return}let f=await l.text();for(let d of r)try{lv.mkdirSync(Mh.dirname(d),{recursive:!0}),lv.writeFileSync(d,f,"utf8"),da(`AI rule written: ${d}`)}catch(m){console.error(`Write AI rule failed: ${d}`,m)}}catch(l){console.error("Download AI rule failed:",l)}}async function xNt(e){let{token:t}=e;t&&(process.env.EDGEONE_PAGES_API_TOKEN=t,await VC()),await ly();let{createEdge:r}=await VTe({type:"confirm",name:"createEdge",message:"Do you want to create an Edge Function example?",initial:!0});r&&(qqn(),da("Edge Function example created!"));let{createCloud:n}=await VTe({type:"confirm",name:"createCloud",message:"Do you want to create a Node Function example?",initial:!0});n&&(Uqn(),da("Node Function example created!"));let{createAIRule:a}=await VTe({type:"confirm",name:"createAIRule",message:"Do you want to create an AI rule file to help you build the project?",initial:!0});a&&await zqn(),DH(),da("Project init success!"),process.exit(0)}var WTe=wr(lN());async function bNt(e){let n=(await D0("DescribePagesProjects",{ProjectIds:[],Filters:[{Name:"Name",Values:[e]}]})).Projects.find(a=>a.Name===e);if(!n)throw new Error(`Project ${e} not found. Please check your project name.`);return n}var $Te=require("fs"),$wi=require("path");async function Hqn(){let e=async()=>{let{name:t}=await(0,WTe.default)({type:"text",name:"name",message:"Input your EdgeOne Pages project name"},{onCancel:()=>{process.exit(1)}}),r=await bNt(t).catch(async n=>{if(n.message==="AuthFailure")return Kr("Auth Failed, please input your secret id and secret key again."),process.exit(1);YXe("Project not found, please check your project name.");let{createNewDeployment:a}=await(0,WTe.default)({type:"confirm",name:"createNewDeployment",message:`Do you want to create a new deployment with project name "${t}" ?`});if(a){Oc("Creating new deployment...");let s=await dT(),c=await ore({name:t,directoryOrZip:"./",token:s});return{name:t,ProjectId:(c==null?void 0:c.projectId)||""}}return null});return r?{name:t,targetProject:r}:await e()};return await e()}async function ENt(e){let{token:t}=e;t&&(process.env.EDGEONE_PAGES_API_TOKEN=t,await VC()),await ly();let{name:r,targetProject:n}=await Hqn();if(r){let a=`${process.cwd()}/.edgeone`;$Te.existsSync(a)||$Te.mkdirSync(a),$Te.writeFile(`${a}/project.json`,`{
3501
3501
  "Name": "${r}",
3502
3502
  "ProjectId": "${n.ProjectId}"
3503
- }`,async s=>{s&&console.error(s),await T_(n.ProjectId).catch(c=>{reportError("Dev pull env vars error,",c),Kr("Pull env vars error:"+c.message)}),ma(`Project ${r} linked successfully.`),process.exit(0)})}}var nk=wr(require("fs")),hU=wr(require("path"));function GTe(e,t,r){try{let n=nk.default.readFileSync(e,"utf-8"),a=n.replace(/\{\{PAGES_PROXY_UUID\}\}/g,t).replace(/\{\{PAGES_PROXY_HOST\}\}/g,r);n!==a&&(nk.default.writeFileSync(e,a,"utf-8"),console.log(`\u2713 Replaced proxy variables in: ${e}`))}catch(n){console.error(`\u2717 Failed to process file ${e}:`,n instanceof Error?n.message:n)}}function wNt(e){let t=e.proxyHost,r=e.proxyUuid;if(!t||!r){console.warn("\u26A0\uFE0F proxyHost or proxyUuid is missing, skipping proxy replacement");return}let n=process.cwd(),a=hU.default.join(n,".edgeone/node-functions");if(nk.default.existsSync(a)){let l=nk.default.readdirSync(a);l.length>0&&l.forEach(f=>{let d=hU.default.join(a,f);nk.default.statSync(d).isFile()&&GTe(d,r,t)})}let s=hU.default.join(n,".edgeone/server-handler/index.mjs");nk.default.existsSync(s)&&GTe(s,r,t);let c=hU.default.join(n,".edgeone/server-handler/bootstrap.js");nk.default.existsSync(c)&&GTe(c,r,t)}process.on("uncaughtException",function(e){});process.on("unhandledRejection",function(e){});var Vqn=e=>e.command("pull","Pull environment variables from the project",t=>t.option("f",{alias:"file",type:"string",describe:"File to write environment variables to",demandOption:!1}).option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}),t=>{dU("pull",t)}).command("ls","List environment variables in the project",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}),t=>{dU("ls",t)}).command("set","Set environment variables to the project",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).positional("key",{type:"string",describe:"Environment variable key",demandOption:!0}).positional("value",{type:"string",describe:"Environment variable value",demandOption:!0}),t=>{dU("set",t)}).command("rm","Remove environment variables from the project",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).positional("key",{type:"string",describe:"Environment variable key",demandOption:!0}),t=>{dU("rm",t)}),$qn=async e=>{e.command("init","Init your local project for cli to run",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).options("version",{hidden:!0}).options("help",{hidden:!0}),xNt).command("dev","Develop your Pages Functions locally.",t=>t.option("debug",{type:"boolean",describe:"Debug mode",default:!1}).option("port",{type:"number",describe:"Customize the port of the frontend server"}).option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).parse(),Qet).command("build",!1,t=>t.option("external",{type:"string",describe:"Comma-separated list of packages to externalize (e.g., argon2,bcrypt)",default:""}),RW).command("ci",!1,{},AKe).command("env","Get your project env script.",Vqn,t=>{e.showHelp()}).command("link","Link your project to EdgeOne Pages Project for better debugging and platform capabilities.",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).options("version",{hidden:!0}).options("help",{hidden:!0}),ENt).command("deploy [directoryOrZip]","Deploy your project to EdgeOne Pages. To use an existing project, it must be of the direct upload type.",t=>t.positional("directoryOrZip",{type:"string",describe:"Path of folder or ZIP package to deploy (optional, defaults to current directory)",demandOption:!1}).option("n",{alias:"name",type:"string",describe:"Project name for deployment (creates new or updates existing project)",demandOption:!1}).option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).option("e",{alias:"env",type:"string",describe:"Environment to deploy to (production or preview)",choices:["production","preview"],default:"production"}).option("a",{alias:"area",type:"string",describe:"Area to deploy to (global or overseas)",choices:["global","overseas"],default:"global"}).version(!1).help().options("version",{hidden:!0}).options("help",{hidden:!0}),ore).command("replace",!1,t=>t.option("proxyHost",{type:"string",describe:"Proxy host",default:""}).option("proxyUuid",{type:"string",describe:"Proxy uuid",default:""}).parse(),wNt).help().alias("h","help")};function SNt(e){e.command("pages [command]","\u26A1\uFE0F Edgeone Pages",t=>$qn(t),t=>{let{command:r}=t;["init","dev","build","ci","env","deploy","help"].includes(r)||e.showHelp()})}var Md=wr(OR()),Jm=wr(Cc()),uFt=wr(cFt());var C5n="https://www.npmjs.com/package/edgeone";var _5n=`
3503
+ }`,async s=>{s&&console.error(s),await T_(n.ProjectId).catch(c=>{reportError("Dev pull env vars error,",c),Kr("Pull env vars error:"+c.message)}),da(`Project ${r} linked successfully.`),process.exit(0)})}}var nk=wr(require("fs")),hU=wr(require("path"));function GTe(e,t,r){try{let n=nk.default.readFileSync(e,"utf-8"),a=n.replace(/\{\{PAGES_PROXY_UUID\}\}/g,t).replace(/\{\{PAGES_PROXY_HOST\}\}/g,r);n!==a&&(nk.default.writeFileSync(e,a,"utf-8"),console.log(`\u2713 Replaced proxy variables in: ${e}`))}catch(n){console.error(`\u2717 Failed to process file ${e}:`,n instanceof Error?n.message:n)}}function wNt(e){let t=e.proxyHost,r=e.proxyUuid;if(!t||!r){console.warn("\u26A0\uFE0F proxyHost or proxyUuid is missing, skipping proxy replacement");return}let n=process.cwd(),a=hU.default.join(n,".edgeone/node-functions");if(nk.default.existsSync(a)){let l=nk.default.readdirSync(a);l.length>0&&l.forEach(f=>{let d=hU.default.join(a,f);nk.default.statSync(d).isFile()&&GTe(d,r,t)})}let s=hU.default.join(n,".edgeone/server-handler/index.mjs");nk.default.existsSync(s)&&GTe(s,r,t);let c=hU.default.join(n,".edgeone/server-handler/bootstrap.js");nk.default.existsSync(c)&&GTe(c,r,t)}process.on("uncaughtException",function(e){});process.on("unhandledRejection",function(e){});var Vqn=e=>e.command("pull","Pull environment variables from the project",t=>t.option("f",{alias:"file",type:"string",describe:"File to write environment variables to",demandOption:!1}).option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}),t=>{dU("pull",t)}).command("ls","List environment variables in the project",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}),t=>{dU("ls",t)}).command("set","Set environment variables to the project",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).positional("key",{type:"string",describe:"Environment variable key",demandOption:!0}).positional("value",{type:"string",describe:"Environment variable value",demandOption:!0}),t=>{dU("set",t)}).command("rm","Remove environment variables from the project",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).positional("key",{type:"string",describe:"Environment variable key",demandOption:!0}),t=>{dU("rm",t)}),$qn=async e=>{e.command("init","Init your local project for cli to run",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).options("version",{hidden:!0}).options("help",{hidden:!0}),xNt).command("dev","Develop your Pages Functions locally.",t=>t.option("debug",{type:"boolean",describe:"Debug mode",default:!1}).option("port",{type:"number",describe:"Customize the port of the frontend server"}).option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).parse(),Qet).command("build",!1,t=>t.option("external",{type:"string",describe:"Comma-separated list of packages to externalize (e.g., argon2,bcrypt)",default:""}),RW).command("ci",!1,{},AKe).command("env","Get your project env script.",Vqn,t=>{e.showHelp()}).command("link","Link your project to EdgeOne Pages Project for better debugging and platform capabilities.",t=>t.option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).options("version",{hidden:!0}).options("help",{hidden:!0}),ENt).command("deploy [directoryOrZip]","Deploy your project to EdgeOne Pages. To use an existing project, it must be of the direct upload type.",t=>t.positional("directoryOrZip",{type:"string",describe:"Path of folder or ZIP package to deploy (optional, defaults to current directory)",demandOption:!1}).option("n",{alias:"name",type:"string",describe:"Project name for deployment (creates new or updates existing project)",demandOption:!1}).option("t",{alias:"token",type:"string",describe:"API Token for CI/CD or non-interactive environments (optional if logged in)",demandOption:!1}).option("e",{alias:"env",type:"string",describe:"Environment to deploy to (production or preview)",choices:["production","preview"],default:"production"}).option("a",{alias:"area",type:"string",describe:"Area to deploy to (global or overseas)",choices:["global","overseas"],default:"global"}).version(!1).help().options("version",{hidden:!0}).options("help",{hidden:!0}),ore).command("replace",!1,t=>t.option("proxyHost",{type:"string",describe:"Proxy host",default:""}).option("proxyUuid",{type:"string",describe:"Proxy uuid",default:""}).parse(),wNt).help().alias("h","help")};function SNt(e){e.command("pages [command]","\u26A1\uFE0F Edgeone Pages",t=>$qn(t),t=>{let{command:r}=t;["init","dev","build","ci","env","deploy","help"].includes(r)||e.showHelp()})}var Md=wr(OR()),Jm=wr(Cc()),uFt=wr(cFt());var C5n="https://www.npmjs.com/package/edgeone";var _5n=`
3504
3504
  ______ ____ ______ ______ ____ _ __ ______
3505
3505
  / ____// __ \\ / ____// ____// __ \\ / | / // ____/
3506
3506
  / __/ / / / // / __ / __/ / / / // |/ // __/