@cartesi/cli 2.0.0-alpha.20 → 2.0.0-alpha.22
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.
- package/dist/index.js +685 -50
- package/dist/index.js.map +785 -0
- package/package.json +80 -84
- package/LICENSE +0 -202
- package/dist/base.d.ts +0 -28
- package/dist/base.d.ts.map +0 -1
- package/dist/base.js +0 -109
- package/dist/builder/directory.d.ts +0 -3
- package/dist/builder/directory.d.ts.map +0 -1
- package/dist/builder/directory.js +0 -39
- package/dist/builder/docker.d.ts +0 -10
- package/dist/builder/docker.d.ts.map +0 -1
- package/dist/builder/docker.js +0 -114
- package/dist/builder/empty.d.ts +0 -3
- package/dist/builder/empty.d.ts.map +0 -1
- package/dist/builder/empty.js +0 -21
- package/dist/builder/index.d.ts +0 -6
- package/dist/builder/index.d.ts.map +0 -1
- package/dist/builder/index.js +0 -5
- package/dist/builder/none.d.ts +0 -3
- package/dist/builder/none.d.ts.map +0 -1
- package/dist/builder/none.js +0 -11
- package/dist/builder/tar.d.ts +0 -3
- package/dist/builder/tar.d.ts.map +0 -1
- package/dist/builder/tar.js +0 -30
- package/dist/commands/address-book.d.ts +0 -6
- package/dist/commands/address-book.d.ts.map +0 -1
- package/dist/commands/address-book.js +0 -44
- package/dist/commands/build.d.ts +0 -8
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -97
- package/dist/commands/clean.d.ts +0 -3
- package/dist/commands/clean.d.ts.map +0 -1
- package/dist/commands/clean.js +0 -10
- package/dist/commands/create.d.ts +0 -7
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -37
- package/dist/commands/deploy/build.d.ts +0 -3
- package/dist/commands/deploy/build.d.ts.map +0 -1
- package/dist/commands/deploy/build.js +0 -9
- package/dist/commands/deploy.d.ts +0 -3
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -12
- package/dist/commands/deposit/erc1155.d.ts +0 -18
- package/dist/commands/deposit/erc1155.d.ts.map +0 -1
- package/dist/commands/deposit/erc1155.js +0 -254
- package/dist/commands/deposit/erc20.d.ts +0 -10
- package/dist/commands/deposit/erc20.d.ts.map +0 -1
- package/dist/commands/deposit/erc20.js +0 -125
- package/dist/commands/deposit/erc721.d.ts +0 -10
- package/dist/commands/deposit/erc721.d.ts.map +0 -1
- package/dist/commands/deposit/erc721.js +0 -143
- package/dist/commands/deposit/ether.d.ts +0 -10
- package/dist/commands/deposit/ether.d.ts.map +0 -1
- package/dist/commands/deposit/ether.js +0 -65
- package/dist/commands/deposit.d.ts +0 -9
- package/dist/commands/deposit.d.ts.map +0 -1
- package/dist/commands/deposit.js +0 -37
- package/dist/commands/doctor.d.ts +0 -3
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -105
- package/dist/commands/hash.d.ts +0 -5
- package/dist/commands/hash.d.ts.map +0 -1
- package/dist/commands/hash.js +0 -22
- package/dist/commands/logs.d.ts +0 -9
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -34
- package/dist/commands/run.d.ts +0 -15
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -202
- package/dist/commands/send.d.ts +0 -10
- package/dist/commands/send.d.ts.map +0 -1
- package/dist/commands/send.js +0 -130
- package/dist/commands/shell.d.ts +0 -7
- package/dist/commands/shell.d.ts.map +0 -1
- package/dist/commands/shell.js +0 -48
- package/dist/commands/status.d.ts +0 -6
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -50
- package/dist/compose/default.env +0 -36
- package/dist/compose/docker-compose-anvil.yaml +0 -39
- package/dist/compose/docker-compose-bundler.yaml +0 -71
- package/dist/compose/docker-compose-database.yaml +0 -12
- package/dist/compose/docker-compose-explorer.yaml +0 -96
- package/dist/compose/docker-compose-graphql.yaml +0 -38
- package/dist/compose/docker-compose-node-cpus.yaml +0 -6
- package/dist/compose/docker-compose-node-memory.yaml +0 -6
- package/dist/compose/docker-compose-node.yaml +0 -50
- package/dist/compose/docker-compose-passkey-server.yaml +0 -37
- package/dist/compose/docker-compose-paymaster.yaml +0 -40
- package/dist/compose/docker-compose-proxy.yaml +0 -24
- package/dist/config.d.ts +0 -124
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -418
- package/dist/contracts.d.ts +0 -4376
- package/dist/contracts.d.ts.map +0 -1
- package/dist/contracts.js +0 -1839
- package/dist/exec/cartesi-machine.d.ts +0 -9
- package/dist/exec/cartesi-machine.d.ts.map +0 -1
- package/dist/exec/cartesi-machine.js +0 -18
- package/dist/exec/genext2fs.d.ts +0 -31
- package/dist/exec/genext2fs.d.ts.map +0 -1
- package/dist/exec/genext2fs.js +0 -44
- package/dist/exec/index.d.ts +0 -4
- package/dist/exec/index.d.ts.map +0 -1
- package/dist/exec/index.js +0 -3
- package/dist/exec/mksquashfs.d.ts +0 -21
- package/dist/exec/mksquashfs.d.ts.map +0 -1
- package/dist/exec/mksquashfs.js +0 -47
- package/dist/exec/rollups.d.ts +0 -105
- package/dist/exec/rollups.d.ts.map +0 -1
- package/dist/exec/rollups.js +0 -383
- package/dist/exec/util.d.ts +0 -21
- package/dist/exec/util.d.ts.map +0 -1
- package/dist/exec/util.js +0 -31
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/machine.d.ts +0 -12
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js +0 -90
- package/dist/prompts.d.ts +0 -73
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js +0 -192
- package/dist/template.d.ts +0 -3
- package/dist/template.d.ts.map +0 -1
- package/dist/template.js +0 -16
- package/dist/types/docker.d.ts +0 -22
- package/dist/types/docker.d.ts.map +0 -1
- package/dist/types/docker.js +0 -1
- package/dist/wallet.d.ts +0 -9225
- package/dist/wallet.d.ts.map +0 -1
- package/dist/wallet.js +0 -41
package/dist/index.js
CHANGED
|
@@ -1,23 +1,684 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import{createRequire as jv}from"node:module";var Nv=Object.create;var{getPrototypeOf:Tv,defineProperty:gY,getOwnPropertyNames:Lv}=Object;var Pv=Object.prototype.hasOwnProperty;var ID=(D,F,J)=>{J=D!=null?Nv(Tv(D)):{};let Q=F||!D||!D.__esModule?gY(J,"default",{value:D,enumerable:!0}):J;for(let $ of Lv(D))if(!Pv.call(Q,$))gY(Q,$,{get:()=>D[$],enumerable:!0});return Q};var R=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var K8=(D,F)=>{for(var J in F)gY(D,J,{get:F[J],enumerable:!0,configurable:!0,set:(Q)=>F[J]=()=>Q})};var x=(D,F)=>()=>(D&&(F=D(D=0)),F);var r=jv(import.meta.url);var _9=R((Sv)=>{class mY extends Error{constructor(D,F,J){super(J);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class Dz extends mY{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Sv.CommanderError=mY;Sv.InvalidArgumentError=Dz});var $J=R((hv)=>{var{InvalidArgumentError:yv}=_9();class Fz{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,J)=>{if(!this.argChoices.includes(F))throw new yv(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,J);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function fv(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}hv.Argument=Fz;hv.humanReadableArgName=fv});var dY=R((gv)=>{var{humanReadableArgName:uv}=$J();class Jz{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter((Q)=>!Q._hidden),J=D._getHelpCommand();if(J&&!J._hidden)F.push(J);if(this.sortSubcommands)F.sort((Q,$)=>{return Q.name().localeCompare($.name())});return F}compareOptions(D,F){let J=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return J(D).localeCompare(J(F))}visibleOptions(D){let F=D.options.filter((Q)=>!Q.hidden),J=D._getHelpOption();if(J&&!J.hidden){let Q=J.short&&D._findOption(J.short),$=J.long&&D._findOption(J.long);if(!Q&&!$)F.push(J);else if(J.long&&!$)F.push(D.createOption(J.long,J.description));else if(J.short&&!Q)F.push(D.createOption(J.short,J.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let J=D.parent;J;J=J.parent){let Q=J.options.filter(($)=>!$.hidden);F.push(...Q)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map((J)=>uv(J)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce((J,Q)=>{return Math.max(J,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm(Q))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((J,Q)=>{return Math.max(J,this.displayWidth(F.styleOptionTerm(F.optionTerm(Q))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((J,Q)=>{return Math.max(J,this.displayWidth(F.styleOptionTerm(F.optionTerm(Q))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((J,Q)=>{return Math.max(J,this.displayWidth(F.styleArgumentTerm(F.argumentTerm(Q))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let J="";for(let Q=D.parent;Q;Q=Q.parent)J=Q.name()+" "+J;return J+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let J=`(${F.join(", ")})`;if(D.description)return`${D.description} ${J}`;return J}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let J=`(${F.join(", ")})`;if(D.description)return`${D.description} ${J}`;return J}return D.description}formatItemList(D,F,J){if(F.length===0)return[];return[J.styleTitle(D),...F,""]}groupItems(D,F,J){let Q=new Map;return D.forEach(($)=>{let Z=J($);if(!Q.has(Z))Q.set(Z,[])}),F.forEach(($)=>{let Z=J($);if(!Q.has(Z))Q.set(Z,[]);Q.get(Z).push($)}),Q}formatHelp(D,F){let J=F.padWidth(D,F),Q=F.helpWidth??80;function $(W,B){return F.formatItem(W,J,B,F)}let Z=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],X=F.commandDescription(D);if(X.length>0)Z=Z.concat([F.boxWrap(F.styleCommandDescription(X),Q),""]);let Y=F.visibleArguments(D).map((W)=>{return $(F.styleArgumentTerm(F.argumentTerm(W)),F.styleArgumentDescription(F.argumentDescription(W)))});if(Z=Z.concat(this.formatItemList("Arguments:",Y,F)),this.groupItems(D.options,F.visibleOptions(D),(W)=>W.helpGroupHeading??"Options:").forEach((W,B)=>{let K=W.map((U)=>{return $(F.styleOptionTerm(F.optionTerm(U)),F.styleOptionDescription(F.optionDescription(U)))});Z=Z.concat(this.formatItemList(B,K,F))}),F.showGlobalOptions){let W=F.visibleGlobalOptions(D).map((B)=>{return $(F.styleOptionTerm(F.optionTerm(B)),F.styleOptionDescription(F.optionDescription(B)))});Z=Z.concat(this.formatItemList("Global Options:",W,F))}return this.groupItems(D.commands,F.visibleCommands(D),(W)=>W.helpGroup()||"Commands:").forEach((W,B)=>{let K=W.map((U)=>{return $(F.styleSubcommandTerm(F.subcommandTerm(U)),F.styleSubcommandDescription(F.subcommandDescription(U)))});Z=Z.concat(this.formatItemList(B,K,F))}),Z.join(`
|
|
2
|
+
`)}displayWidth(D){return Qz(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F==="[command]")return this.styleSubcommandText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleCommandText(F)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleSubcommandText(F)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,F){return Math.max(F.longestOptionTermLength(D,F),F.longestGlobalOptionTermLength(D,F),F.longestSubcommandTermLength(D,F),F.longestArgumentTermLength(D,F))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,F,J,Q){let Z=" ".repeat(2);if(!J)return Z+D;let X=D.padEnd(F+D.length-Q.displayWidth(D)),Y=2,G=(this.helpWidth??80)-F-Y-2,W;if(G<this.minWidthToWrap||Q.preformatted(J))W=J;else W=Q.boxWrap(J,G).replace(/\n/g,`
|
|
3
|
+
`+" ".repeat(F+Y));return Z+X+" ".repeat(Y)+W.replace(/\n/g,`
|
|
4
|
+
${Z}`)}boxWrap(D,F){if(F<this.minWidthToWrap)return D;let J=D.split(/\r\n|\n/),Q=/[\s]*[^\s]+/g,$=[];return J.forEach((Z)=>{let X=Z.match(Q);if(X===null){$.push("");return}let Y=[X.shift()],q=this.displayWidth(Y[0]);X.forEach((G)=>{let W=this.displayWidth(G);if(q+W<=F){Y.push(G),q+=W;return}$.push(Y.join(""));let B=G.trimStart();Y=[B],q=this.displayWidth(B)}),$.push(Y.join(""))}),$.join(`
|
|
5
|
+
`)}}function Qz(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}gv.Help=Jz;gv.stripColor=Qz});var pY=R((cv)=>{var{InvalidArgumentError:pv}=_9();class Zz{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let J=lv(D);if(this.short=J.shortFlag,this.long=J.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,J)=>{if(!this.argChoices.includes(F))throw new pv(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,J);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return $z(this.name().replace(/^no-/,""));return $z(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Xz{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,J)=>{if(this.positiveOptions.has(J))this.dualOptions.add(J)})}valueFromOption(D,F){let J=F.attributeName();if(!this.dualOptions.has(J))return!0;let Q=this.negativeOptions.get(J).presetArg,$=Q!==void 0?Q:!1;return F.negate===($===D)}}function $z(D){return D.split("-").reduce((F,J)=>{return F+J[0].toUpperCase()+J.slice(1)})}function lv(D){let F,J,Q=/^-[^-]$/,$=/^--[^-]/,Z=D.split(/[ |,]+/).concat("guard");if(Q.test(Z[0]))F=Z.shift();if($.test(Z[0]))J=Z.shift();if(!F&&Q.test(Z[0]))F=Z.shift();if(!F&&$.test(Z[0]))F=J,J=Z.shift();if(Z[0].startsWith("-")){let X=Z[0],Y=`option creation failed due to '${X}' in option flags '${D}'`;if(/^-[^-][^-]/.test(X))throw Error(`${Y}
|
|
6
|
+
- a short flag is a single dash and a single character
|
|
7
|
+
- either use a single dash and a single character (for a short flag)
|
|
8
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Q.test(X))throw Error(`${Y}
|
|
9
|
+
- too many short flags`);if($.test(X))throw Error(`${Y}
|
|
10
|
+
- too many long flags`);throw Error(`${Y}
|
|
11
|
+
- unrecognised flag format`)}if(F===void 0&&J===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:J}}cv.Option=Zz;cv.DualOptions=Xz});var Yz=R((rv)=>{function ov(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let J=[];for(let Q=0;Q<=D.length;Q++)J[Q]=[Q];for(let Q=0;Q<=F.length;Q++)J[0][Q]=Q;for(let Q=1;Q<=F.length;Q++)for(let $=1;$<=D.length;$++){let Z=1;if(D[$-1]===F[Q-1])Z=0;else Z=1;if(J[$][Q]=Math.min(J[$-1][Q]+1,J[$][Q-1]+1,J[$-1][Q-1]+Z),$>1&&Q>1&&D[$-1]===F[Q-2]&&D[$-2]===F[Q-1])J[$][Q]=Math.min(J[$][Q],J[$-2][Q-2]+1)}return J[D.length][F.length]}function av(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let J=D.startsWith("--");if(J)D=D.slice(2),F=F.map((X)=>X.slice(2));let Q=[],$=3,Z=0.4;if(F.forEach((X)=>{if(X.length<=1)return;let Y=ov(D,X),q=Math.max(D.length,X.length);if((q-Y)/q>Z){if(Y<$)$=Y,Q=[X];else if(Y===$)Q.push(X)}}),Q.sort((X,Y)=>X.localeCompare(Y)),J)Q=Q.map((X)=>`--${X}`);if(Q.length>1)return`
|
|
12
|
+
(Did you mean one of ${Q.join(", ")}?)`;if(Q.length===1)return`
|
|
13
|
+
(Did you mean ${Q[0]}?)`;return""}rv.suggestSimilar=av});var Bz=R(($u)=>{var tv=r("node:events").EventEmitter,lY=r("node:child_process"),l2=r("node:path"),ZJ=r("node:fs"),VD=r("node:process"),{Argument:ev,humanReadableArgName:Du}=$J(),{CommanderError:cY}=_9(),{Help:Fu,stripColor:Ju}=dY(),{Option:qz,DualOptions:Qu}=pY(),{suggestSimilar:Gz}=Yz();class iY extends tv{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(F)=>VD.stdout.write(F),writeErr:(F)=>VD.stderr.write(F),outputError:(F,J)=>J(F),getOutHelpWidth:()=>VD.stdout.isTTY?VD.stdout.columns:void 0,getErrHelpWidth:()=>VD.stderr.isTTY?VD.stderr.columns:void 0,getOutHasColors:()=>nY()??(VD.stdout.isTTY&&VD.stdout.hasColors?.()),getErrHasColors:()=>nY()??(VD.stderr.isTTY&&VD.stderr.hasColors?.()),stripColor:(F)=>Ju(F)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,J){let Q=F,$=J;if(typeof Q==="object"&&Q!==null)$=Q,Q=null;$=$||{};let[,Z,X]=D.match(/([^ ]+) *(.*)/),Y=this.createCommand(Z);if(Q)Y.description(Q),Y._executableHandler=!0;if($.isDefault)this._defaultCommandName=Y._name;if(Y._hidden=!!($.noHelp||$.hidden),Y._executableFile=$.executableFile||null,X)Y.arguments(X);if(this._registerCommand(Y),Y.parent=this,Y.copyInheritedSettings(this),Q)return this;return Y}createCommand(D){return new iY(D)}createHelp(){return Object.assign(new Fu,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...D},this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
|
|
14
|
+
- specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new ev(D,F)}argument(D,F,J,Q){let $=this.createArgument(D,F);if(typeof J==="function")$.default(Q).argParser(J);else $.default(J);return this.addArgument($),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F?.variadic)throw Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,F){if(typeof D==="boolean"){if(this._addImplicitHelpCommand=D,D&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let J=D??"help [command]",[,Q,$]=J.match(/([^ ]+) *(.*)/),Z=F??"display help for command",X=this.createCommand(Q);if(X.helpOption(!1),$)X.arguments($);if(Z)X.description(Z);if(this._addImplicitHelpCommand=!0,this._helpCommand=X,D||F)this._initCommandGroup(X);return this}addHelpCommand(D,F){if(typeof D!=="object")return this.helpCommand(D,F),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this._initCommandGroup(D),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,F){let J=["preSubcommand","preAction","postAction"];if(!J.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
|
|
15
|
+
Expecting one of '${J.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,J){if(this._exitCallback)this._exitCallback(new cY(D,F,J));VD.exit(D)}action(D){let F=(J)=>{let Q=this.registeredArguments.length,$=J.slice(0,Q);if(this._storeOptionsAsProperties)$[Q]=this;else $[Q]=this.opts();return $.push(this),D.apply(this,$)};return this._actionHandler=F,this}createOption(D,F){return new qz(D,F)}_callParseArg(D,F,J,Q){try{return D.parseArg(F,J)}catch($){if($.code==="commander.invalidArgument"){let Z=`${Q} ${$.message}`;this.error(Z,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let J=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${J}'
|
|
16
|
+
- already used by option '${F.flags}'`)}this._initOptionGroup(D),this.options.push(D)}_registerCommand(D){let F=(Q)=>{return[Q.name()].concat(Q.aliases())},J=F(D).find((Q)=>this._findCommand(Q));if(J){let Q=F(this._findCommand(J)).join("|"),$=F(D).join("|");throw Error(`cannot add command '${$}' as already have command '${Q}'`)}this._initCommandGroup(D),this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),J=D.attributeName();if(D.negate){let $=D.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(J,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(J,D.defaultValue,"default");let Q=($,Z,X)=>{if($==null&&D.presetArg!==void 0)$=D.presetArg;let Y=this.getOptionValue(J);if($!==null&&D.parseArg)$=this._callParseArg(D,$,Y,Z);else if($!==null&&D.variadic)$=D._collectValue($,Y);if($==null)if(D.negate)$=!1;else if(D.isBoolean()||D.optional)$=!0;else $="";this.setOptionValueWithSource(J,$,X)};if(this.on("option:"+F,($)=>{let Z=`error: option '${D.flags}' argument '${$}' is invalid.`;Q($,Z,"cli")}),D.envVar)this.on("optionEnv:"+F,($)=>{let Z=`error: option '${D.flags}' value '${$}' from env '${D.envVar}' is invalid.`;Q($,Z,"env")});return this}_optionEx(D,F,J,Q,$){if(typeof F==="object"&&F instanceof qz)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Z=this.createOption(F,J);if(Z.makeOptionMandatory(!!D.mandatory),typeof Q==="function")Z.default($).argParser(Q);else if(Q instanceof RegExp){let X=Q;Q=(Y,q)=>{let G=X.exec(Y);return G?G[0]:q},Z.default($).argParser(Q)}else Z.default(Q);return this.addOption(Z)}option(D,F,J,Q){return this._optionEx({},D,F,J,Q)}requiredOption(D,F,J,Q){return this._optionEx({mandatory:!0},D,F,J,Q)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,F){return this.setOptionValueWithSource(D,F,void 0)}setOptionValueWithSource(D,F,J){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=J,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((J)=>{if(J.getOptionValueSource(D)!==void 0)F=J.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(VD.versions?.electron)F.from="electron";let Q=VD.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))F.from="eval"}if(D===void 0)D=VD.argv;this.rawArgs=D.slice();let J;switch(F.from){case void 0:case"node":this._scriptPath=D[1],J=D.slice(2);break;case"electron":if(VD.defaultApp)this._scriptPath=D[1],J=D.slice(2);else J=D.slice(1);break;case"user":J=D.slice(0);break;case"eval":J=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",J}parse(D,F){this._prepareForParse();let J=this._prepareUserArgs(D,F);return this._parseCommand([],J),this}async parseAsync(D,F){this._prepareForParse();let J=this._prepareUserArgs(D,F);return await this._parseCommand([],J),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
17
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(D,F,J){if(ZJ.existsSync(D))return;let Q=F?`searched for local subcommand relative to directory '${F}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",$=`'${D}' does not exist
|
|
18
|
+
- if '${J}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
19
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
20
|
+
- ${Q}`;throw Error($)}_executeSubCommand(D,F){F=F.slice();let J=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function $(G,W){let B=l2.resolve(G,W);if(ZJ.existsSync(B))return B;if(Q.includes(l2.extname(W)))return;let K=Q.find((U)=>ZJ.existsSync(`${B}${U}`));if(K)return`${B}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Z=D._executableFile||`${this._name}-${D._name}`,X=this._executableDir||"";if(this._scriptPath){let G;try{G=ZJ.realpathSync(this._scriptPath)}catch{G=this._scriptPath}X=l2.resolve(l2.dirname(G),X)}if(X){let G=$(X,Z);if(!G&&!D._executableFile&&this._scriptPath){let W=l2.basename(this._scriptPath,l2.extname(this._scriptPath));if(W!==this._name)G=$(X,`${W}-${D._name}`)}Z=G||Z}J=Q.includes(l2.extname(Z));let Y;if(VD.platform!=="win32")if(J)F.unshift(Z),F=Wz(VD.execArgv).concat(F),Y=lY.spawn(VD.argv[0],F,{stdio:"inherit"});else Y=lY.spawn(Z,F,{stdio:"inherit"});else this._checkForMissingExecutable(Z,X,D._name),F.unshift(Z),F=Wz(VD.execArgv).concat(F),Y=lY.spawn(VD.execPath,F,{stdio:"inherit"});if(!Y.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{VD.on(W,()=>{if(Y.killed===!1&&Y.exitCode===null)Y.kill(W)})});let q=this._exitCallback;Y.on("close",(G)=>{if(G=G??1,!q)VD.exit(G);else q(new cY(G,"commander.executeSubCommandAsync","(close)"))}),Y.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Z,X,D._name);else if(G.code==="EACCES")throw Error(`'${Z}' not executable`);if(!q)VD.exit(1);else{let W=new cY(1,"commander.executeSubCommandAsync","(error)");W.nestedError=G,q(W)}}),this.runningCommand=Y}_dispatchSubcommand(D,F,J){let Q=this._findCommand(D);if(!Q)this.help({error:!0});Q._prepareForParse();let $;return $=this._chainOrCallSubCommandHook($,Q,"preSubcommand"),$=this._chainOrCall($,()=>{if(Q._executableHandler)this._executeSubCommand(Q,F.concat(J));else return Q._parseCommand(F,J)}),$}_dispatchHelpCommand(D){if(!D)this.help();let F=this._findCommand(D);if(F&&!F._executableHandler)F.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,F)=>{if(D.required&&this.args[F]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(J,Q,$)=>{let Z=Q;if(Q!==null&&J.parseArg){let X=`error: command-argument value '${Q}' is invalid for argument '${J.name()}'.`;Z=this._callParseArg(J,Q,$,X)}return Z};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((J,Q)=>{let $=J.defaultValue;if(J.variadic){if(Q<this.args.length){if($=this.args.slice(Q),J.parseArg)$=$.reduce((Z,X)=>{return D(J,X,Z)},J.defaultValue)}else if($===void 0)$=[]}else if(Q<this.args.length){if($=this.args[Q],J.parseArg)$=D(J,$,J.defaultValue)}F[Q]=$}),this.processedArgs=F}_chainOrCall(D,F){if(D?.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let J=D,Q=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[F]!==void 0).forEach(($)=>{$._lifeCycleHooks[F].forEach((Z)=>{Q.push({hookedCommand:$,callback:Z})})}),F==="postAction")Q.reverse();return Q.forEach(($)=>{J=this._chainOrCall(J,()=>{return $.callback($.hookedCommand,this)})}),J}_chainOrCallSubCommandHook(D,F,J){let Q=D;if(this._lifeCycleHooks[J]!==void 0)this._lifeCycleHooks[J].forEach(($)=>{Q=this._chainOrCall(Q,()=>{return $(this,F)})});return Q}_parseCommand(D,F){let J=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(J.operands),F=J.unknown,this.args=D.concat(F),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),F);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(F),this._dispatchSubcommand(this._defaultCommandName,D,F);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(J.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=()=>{if(J.unknown.length>0)this.unknownOption(J.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){Q(),this._processArguments();let Z;if(Z=this._chainOrCallHooks(Z,"preAction"),Z=this._chainOrCall(Z,()=>this._actionHandler(this.processedArgs)),this.parent)Z=this._chainOrCall(Z,()=>{this.parent.emit($,D,F)});return Z=this._chainOrCallHooks(Z,"postAction"),Z}if(this.parent?.listenerCount($))Q(),this._processArguments(),this.parent.emit($,D,F);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,F);if(this.listenerCount("command:*"))this.emit("command:*",D,F);else if(this.commands.length)this.unknownCommand();else Q(),this._processArguments()}else if(this.commands.length)Q(),this.help({error:!0});else Q(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((F)=>F._name===D||F._aliases.includes(D))}_findOption(D){return this.options.find((F)=>F.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((F)=>{if(F.mandatory&&D.getOptionValue(F.attributeName())===void 0)D.missingMandatoryOptionValue(F)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((J)=>{let Q=J.attributeName();if(this.getOptionValue(Q)===void 0)return!1;return this.getOptionValueSource(Q)!=="default"});D.filter((J)=>J.conflictsWith.length>0).forEach((J)=>{let Q=D.find(($)=>J.conflictsWith.includes($.attributeName()));if(Q)this._conflictingOption(J,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],J=[],Q=F;function $(G){return G.length>1&&G[0]==="-"}let Z=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((W)=>W.options.map((B)=>B.short).some((B)=>/^-\d$/.test(B)))},X=null,Y=null,q=0;while(q<D.length||Y){let G=Y??D[q++];if(Y=null,G==="--"){if(Q===J)Q.push(G);Q.push(...D.slice(q));break}if(X&&(!$(G)||Z(G))){this.emit(`option:${X.name()}`,G);continue}if(X=null,$(G)){let W=this._findOption(G);if(W){if(W.required){let B=D[q++];if(B===void 0)this.optionMissingArgument(W);this.emit(`option:${W.name()}`,B)}else if(W.optional){let B=null;if(q<D.length&&(!$(D[q])||Z(D[q])))B=D[q++];this.emit(`option:${W.name()}`,B)}else this.emit(`option:${W.name()}`);X=W.variadic?W:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let W=this._findOption(`-${G[1]}`);if(W){if(W.required||W.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${W.name()}`,G.slice(2));else this.emit(`option:${W.name()}`),Y=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let W=G.indexOf("="),B=this._findOption(G.slice(0,W));if(B&&(B.required||B.optional)){this.emit(`option:${B.name()}`,G.slice(W+1));continue}}if(Q===F&&$(G)&&!(this.commands.length===0&&Z(G)))Q=J;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&J.length===0){if(this._findCommand(G)){F.push(G),J.push(...D.slice(q));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){F.push(G,...D.slice(q));break}else if(this._defaultCommandName){J.push(G,...D.slice(q));break}}if(this._passThroughOptions){Q.push(G,...D.slice(q));break}Q.push(G)}return{operands:F,unknown:J}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let J=0;J<F;J++){let Q=this.options[J].attributeName();D[Q]=Q===this._versionOptionName?this._version:this[Q]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,F)=>Object.assign(D,F.opts()),{})}error(D,F){if(this._outputConfiguration.outputError(`${D}
|
|
21
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
22
|
+
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
23
|
+
`),this.outputHelp({error:!0});let J=F||{},Q=J.exitCode||1,$=J.code||"commander.error";this._exit(Q,$,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in VD.env){let F=D.attributeName();if(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,VD.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new Qu(this.options),F=(J)=>{return this.getOptionValue(J)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(J))};this.options.filter((J)=>J.implied!==void 0&&F(J.attributeName())&&D.valueFromOption(this.getOptionValue(J.attributeName()),J)).forEach((J)=>{Object.keys(J.implied).filter((Q)=>!F(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,J.implied[Q],"implied")})})}missingArgument(D){let F=`error: missing required argument '${D}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(D){let F=`error: option '${D.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let F=`error: required option '${D.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,F){let J=(Z)=>{let X=Z.attributeName(),Y=this.getOptionValue(X),q=this.options.find((W)=>W.negate&&X===W.attributeName()),G=this.options.find((W)=>!W.negate&&X===W.attributeName());if(q&&(q.presetArg===void 0&&Y===!1||q.presetArg!==void 0&&Y===q.presetArg))return q;return G||Z},Q=(Z)=>{let X=J(Z),Y=X.attributeName();if(this.getOptionValueSource(Y)==="env")return`environment variable '${X.envVar}'`;return`option '${X.flags}'`},$=`error: ${Q(D)} cannot be used with ${Q(F)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let Q=[],$=this;do{let Z=$.createHelp().visibleOptions($).filter((X)=>X.long).map((X)=>X.long);Q=Q.concat(Z),$=$.parent}while($&&!$._enablePositionalOptions);F=Gz(D,Q)}let J=`error: unknown option '${D}'${F}`;this.error(J,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,J=F===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${J} but got ${D.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(Q.push($.name()),$.alias())Q.push($.alias())}),F=Gz(D,Q)}let J=`error: unknown command '${D}'${F}`;this.error(J,{code:"commander.unknownCommand"})}version(D,F,J){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",J=J||"output the version number";let Q=this.createOption(F,J);return this._versionOptionName=Q.attributeName(),this._registerOption(Q),this.on("option:"+Q.name(),()=>{this._outputConfiguration.writeOut(`${D}
|
|
24
|
+
`),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let J=this.parent?._findCommand(D);if(J){let Q=[J.name()].concat(J.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${Q}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map((J)=>{return Du(J)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=l2.basename(D,l2.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp(),J=this._getOutputContext(D);F.prepareContext({error:J.error,helpWidth:J.helpWidth,outputHasColors:J.hasColors});let Q=F.formatHelp(this,F);if(J.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext(D){D=D||{};let F=!!D.error,J,Q,$;if(F)J=(X)=>this._outputConfiguration.writeErr(X),Q=this._outputConfiguration.getErrHasColors(),$=this._outputConfiguration.getErrHelpWidth();else J=(X)=>this._outputConfiguration.writeOut(X),Q=this._outputConfiguration.getOutHasColors(),$=this._outputConfiguration.getOutHelpWidth();return{error:F,write:(X)=>{if(!Q)X=this._outputConfiguration.stripColor(X);return J(X)},hasColors:Q,helpWidth:$}}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let J=this._getOutputContext(D),Q={error:J.error,write:J.write,command:this};this._getCommandAndAncestors().reverse().forEach((Z)=>Z.emit("beforeAllHelp",Q)),this.emit("beforeHelp",Q);let $=this.helpInformation({error:J.error});if(F){if($=F($),typeof $!=="string"&&!Buffer.isBuffer($))throw Error("outputHelp callback must return a string or a Buffer")}if(J.write($),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((Z)=>Z.emit("afterAllHelp",Q))}helpOption(D,F){if(typeof D==="boolean"){if(D){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(D??"-h, --help",F??"display help for command"),D||F)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let F=Number(VD.exitCode??0);if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let J=["beforeAll","before","after","afterAll"];if(!J.includes(D))throw Error(`Unexpected value for position to addHelpText.
|
|
25
|
+
Expecting one of '${J.join("', '")}'`);let Q=`${D}Help`;return this.on(Q,($)=>{let Z;if(typeof F==="function")Z=F({error:$.error,command:$.command});else Z=F;if(Z)$.write(`${Z}
|
|
26
|
+
`)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((Q)=>F.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Wz(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let J,Q="127.0.0.1",$="9229",Z;if((Z=F.match(/^(--inspect(-brk)?)$/))!==null)J=Z[1];else if((Z=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(J=Z[1],/^\d+$/.test(Z[3]))$=Z[3];else Q=Z[3];else if((Z=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)J=Z[1],Q=Z[3],$=Z[4];if(J&&$!=="0")return`${J}=${Q}:${parseInt($)+1}`;return F})}function nY(){if(VD.env.NO_COLOR||VD.env.FORCE_COLOR==="0"||VD.env.FORCE_COLOR==="false")return!1;if(VD.env.FORCE_COLOR||VD.env.CLICOLOR_FORCE!==void 0)return!0;return}$u.Command=iY;$u.useColor=nY});var Hz=R((Gu)=>{var{Argument:Kz}=$J(),{Command:oY}=Bz(),{CommanderError:Yu,InvalidArgumentError:Uz}=_9(),{Help:qu}=dY(),{Option:Vz}=pY();Gu.program=new oY;Gu.createCommand=(D)=>new oY(D);Gu.createOption=(D,F)=>new Vz(D,F);Gu.createArgument=(D,F)=>new Kz(D,F);Gu.Command=oY;Gu.Option=Vz;Gu.Argument=Kz;Gu.Help=qu;Gu.CommanderError=Yu;Gu.InvalidArgumentError=Uz;Gu.InvalidOptionArgumentError=Uz});var Cz=R((D8,zz)=>{var S8=Hz();D8=zz.exports={};D8.program=new S8.Command;D8.Argument=S8.Argument;D8.Command=S8.Command;D8.CommanderError=S8.CommanderError;D8.Help=S8.Help;D8.InvalidArgumentError=S8.InvalidArgumentError;D8.InvalidOptionArgumentError=S8.InvalidArgumentError;D8.Option=S8.Option;D8.createCommand=(D)=>new S8.Command(D);D8.createOption=(D,F)=>new S8.Option(D,F);D8.createArgument=(D,F)=>new S8.Argument(D,F)});var XJ=R((HYD,Mz)=>{var aY=[],Oz=0,_0=(D,F)=>{if(Oz>=F)aY.push(D)};_0.WARN=1;_0.INFO=2;_0.DEBUG=3;_0.reset=()=>{aY=[]};_0.setDebugLevel=(D)=>{Oz=D};_0.warn=(D)=>_0(D,_0.WARN);_0.info=(D)=>_0(D,_0.INFO);_0.debug=(D)=>_0(D,_0.DEBUG);_0.debugMessages=()=>aY;Mz.exports=_0});var Rz=R((zYD,Ez)=>{Ez.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var wz=R((CYD,Az)=>{var Ru=Rz();Az.exports=(D)=>typeof D==="string"?D.replace(Ru(),""):D});var Nz=R((_YD,rY)=>{var Iz=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};rY.exports=Iz;rY.exports.default=Iz});var Lz=R((OYD,Tz)=>{Tz.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var jz=R((MYD,sY)=>{var Au=wz(),wu=Nz(),Iu=Lz(),Pz=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=Au(D),D.length===0)return 0;D=D.replace(Iu()," ");let F=0;for(let J=0;J<D.length;J++){let Q=D.codePointAt(J);if(Q<=31||Q>=127&&Q<=159)continue;if(Q>=768&&Q<=879)continue;if(Q>65535)J++;F+=wu(Q)?2:1}return F};sY.exports=Pz;sY.exports.default=Pz});var tY=R((EYD,yz)=>{var Sz=jz();function YJ(D){return D?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function $2(D){let F=YJ();return(""+D).replace(F,"").split(`
|
|
27
|
+
`).reduce(function($,Z){return Sz(Z)>$?Sz(Z):$},0)}function O9(D,F){return Array(F+1).join(D)}function Nu(D,F,J,Q){let $=$2(D);if(F+1>=$){let Z=F-$;switch(Q){case"right":{D=O9(J,Z)+D;break}case"center":{let X=Math.ceil(Z/2),Y=Z-X;D=O9(J,Y)+D+O9(J,X);break}default:{D=D+O9(J,Z);break}}}return D}var a3={};function M9(D,F,J){F="\x1B["+F+"m",J="\x1B["+J+"m",a3[F]={set:D,to:!0},a3[J]={set:D,to:!1},a3[D]={on:F,off:J}}M9("bold",1,22);M9("italics",3,23);M9("underline",4,24);M9("inverse",7,27);M9("strikethrough",9,29);function xz(D,F){let J=F[1]?parseInt(F[1].split(";")[0]):0;if(J>=30&&J<=39||J>=90&&J<=97){D.lastForegroundAdded=F[0];return}if(J>=40&&J<=49||J>=100&&J<=107){D.lastBackgroundAdded=F[0];return}if(J===0){for(let $ in D)if(Object.prototype.hasOwnProperty.call(D,$))delete D[$];return}let Q=a3[F[0]];if(Q)D[Q.set]=Q.to}function Tu(D){let F=YJ(!0),J=F.exec(D),Q={};while(J!==null)xz(Q,J),J=F.exec(D);return Q}function kz(D,F){let{lastBackgroundAdded:J,lastForegroundAdded:Q}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function($){if(D[$])F+=a3[$].off}),J&&J!="\x1B[49m")F+="\x1B[49m";if(Q&&Q!="\x1B[39m")F+="\x1B[39m";return F}function Lu(D,F){let{lastBackgroundAdded:J,lastForegroundAdded:Q}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function($){if(D[$])F=a3[$].on+F}),J&&J!="\x1B[49m")F=J+F;if(Q&&Q!="\x1B[39m")F=Q+F;return F}function Pu(D,F){if(D.length===$2(D))return D.substr(0,F);while($2(D)>F)D=D.slice(0,-1);return D}function ju(D,F){let J=YJ(!0),Q=D.split(YJ()),$=0,Z=0,X="",Y,q={};while(Z<F){Y=J.exec(D);let G=Q[$];if($++,Z+$2(G)>F)G=Pu(G,F-Z);if(X+=G,Z+=$2(G),Z<F){if(!Y)break;X+=Y[0],xz(q,Y)}}return kz(q,X)}function Su(D,F,J){if(J=J||"…",$2(D)<=F)return D;F-=$2(J);let $=ju(D,F);$+=J;let Z="\x1B]8;;\x07";if(D.includes(Z)&&!$.includes(Z))$+=Z;return $}function xu(){return{chars:{top:"─","top-mid":"┬","top-left":"┌","top-right":"┐",bottom:"─","bottom-mid":"┴","bottom-left":"└","bottom-right":"┘",left:"│","left-mid":"├",mid:"─","mid-mid":"┼",right:"│","right-mid":"┤",middle:"│"},truncate:"…",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function ku(D,F){D=D||{},F=F||xu();let J=Object.assign({},F,D);return J.chars=Object.assign({},F.chars,D.chars),J.style=Object.assign({},F.style,D.style),J}function yu(D,F){let J=[],Q=F.split(/(\s+)/g),$=[],Z=0,X;for(let Y=0;Y<Q.length;Y+=2){let q=Q[Y],G=Z+$2(q);if(Z>0&&X)G+=X.length;if(G>D){if(Z!==0)J.push($.join(""));$=[q],Z=$2(q)}else $.push(X||"",q),Z=G;X=Q[Y+1]}if(Z)J.push($.join(""));return J}function fu(D,F){let J=[],Q="";function $(X,Y){if(Q.length&&Y)Q+=Y;Q+=X;while(Q.length>D)J.push(Q.slice(0,D)),Q=Q.slice(D)}let Z=F.split(/(\s+)/g);for(let X=0;X<Z.length;X+=2)$(Z[X],X&&Z[X-1]);if(Q.length)J.push(Q);return J}function hu(D,F,J=!0){let Q=[];F=F.split(`
|
|
28
|
+
`);let $=J?yu:fu;for(let Z=0;Z<F.length;Z++)Q.push.apply(Q,$(D,F[Z]));return Q}function bu(D){let F={},J=[];for(let Q=0;Q<D.length;Q++){let $=Lu(F,D[Q]);F=Tu($);let Z=Object.assign({},F);J.push(kz(Z,$))}return J}function vu(D,F){return["\x1B]","8",";",";",D||F,"\x07",F,"\x1B]","8",";",";","\x07"].join("")}yz.exports={strlen:$2,repeat:O9,pad:Nu,truncate:Su,mergeOptions:ku,wordWrap:hu,colorizeLines:bu,hyperlink:vu}});var vz=R((RYD,bz)=>{var hz={};bz.exports=hz;var fz={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(fz).forEach(function(D){var F=fz[D],J=hz[D]=[];J.open="\x1B["+F[0]+"m",J.close="\x1B["+F[1]+"m"})});var gz=R((AYD,uz)=>{uz.exports=function(D,F){F=F||process.argv;var J=F.indexOf("--"),Q=/^-{1,2}/.test(D)?"":"--",$=F.indexOf(Q+D);return $!==-1&&(J===-1?!0:$<J)}});var dz=R((wYD,mz)=>{var uu=r("os"),x8=gz(),P0=process.env,r3=void 0;if(x8("no-color")||x8("no-colors")||x8("color=false"))r3=!1;else if(x8("color")||x8("colors")||x8("color=true")||x8("color=always"))r3=!0;if("FORCE_COLOR"in P0)r3=P0.FORCE_COLOR.length===0||parseInt(P0.FORCE_COLOR,10)!==0;function gu(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function mu(D){if(r3===!1)return 0;if(x8("color=16m")||x8("color=full")||x8("color=truecolor"))return 3;if(x8("color=256"))return 2;if(D&&!D.isTTY&&r3!==!0)return 0;var F=r3?1:0;if(process.platform==="win32"){var J=uu.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in P0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function($){return $ in P0})||P0.CI_NAME==="codeship")return 1;return F}if("TEAMCITY_VERSION"in P0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(P0.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in P0){var Q=parseInt((P0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(P0.TERM_PROGRAM){case"iTerm.app":return Q>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(P0.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(P0.TERM))return 1;if("COLORTERM"in P0)return 1;if(P0.TERM==="dumb")return F;return F}function eY(D){var F=mu(D);return gu(F)}mz.exports={supportsColor:eY,stdout:eY(process.stdout),stderr:eY(process.stderr)}});var lz=R((IYD,pz)=>{pz.exports=function(F,J){var Q="";F=F||"Run the trap, drop the bass",F=F.split("");var $={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return F.forEach(function(Z){Z=Z.toLowerCase();var X=$[Z]||[" "],Y=Math.floor(Math.random()*X.length);if(typeof $[Z]<"u")Q+=$[Z][Y];else Q+=Z}),Q}});var nz=R((NYD,cz)=>{cz.exports=function(F,J){F=F||" he is here ";var Q={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},$=[].concat(Q.up,Q.down,Q.mid);function Z(q){var G=Math.floor(Math.random()*q);return G}function X(q){var G=!1;return $.filter(function(W){G=W===q}),G}function Y(q,G){var W="",B,K;G=G||{},G.up=typeof G.up<"u"?G.up:!0,G.mid=typeof G.mid<"u"?G.mid:!0,G.down=typeof G.down<"u"?G.down:!0,G.size=typeof G.size<"u"?G.size:"maxi",q=q.split("");for(K in q){if(X(K))continue;switch(W=W+q[K],B={up:0,down:0,mid:0},G.size){case"mini":B.up=Z(8),B.mid=Z(2),B.down=Z(8);break;case"maxi":B.up=Z(16)+3,B.mid=Z(4)+1,B.down=Z(64)+3;break;default:B.up=Z(8)+1,B.mid=Z(6)/2,B.down=Z(8)+1;break}var U=["up","mid","down"];for(var V in U){var H=U[V];for(var z=0;z<=B[H];z++)if(G[H])W=W+Q[H][Z(Q[H].length)]}}return W}return Y(F,J)}});var oz=R((TYD,iz)=>{iz.exports=function(D){return function(F,J,Q){if(F===" ")return F;switch(J%3){case 0:return D.red(F);case 1:return D.white(F);case 2:return D.blue(F)}}}});var rz=R((LYD,az)=>{az.exports=function(D){return function(F,J,Q){return J%2===0?F:D.inverse(F)}}});var tz=R((PYD,sz)=>{sz.exports=function(D){var F=["red","yellow","green","blue","magenta"];return function(J,Q,$){if(J===" ")return J;else return D[F[Q++%F.length]](J)}}});var DC=R((jYD,ez)=>{ez.exports=function(D){var F=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(J,Q,$){return J===" "?J:D[F[Math.round(Math.random()*(F.length-2))]](J)}}});var ZC=R((xYD,$C)=>{var YD={};$C.exports=YD;YD.themes={};var du=r("util"),SF=YD.styles=vz(),FC=Object.defineProperties,pu=new RegExp(/[\r\n]+/g);YD.supportsColor=dz().supportsColor;if(typeof YD.enabled>"u")YD.enabled=YD.supportsColor()!==!1;YD.enable=function(){YD.enabled=!0};YD.disable=function(){YD.enabled=!1};YD.stripColors=YD.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var SYD=YD.stylize=function(F,J){if(!YD.enabled)return F+"";var Q=SF[J];if(!Q&&J in YD)return YD[J](F);return Q.open+F+Q.close},lu=/[|\\{}()[\]^$+*?.]/g,cu=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(lu,"\\$&")};function JC(D){var F=function J(){return iu.apply(J,arguments)};return F._styles=D,F.__proto__=nu,F}var QC=function(){var D={};return SF.grey=SF.gray,Object.keys(SF).forEach(function(F){SF[F].closeRe=new RegExp(cu(SF[F].close),"g"),D[F]={get:function(){return JC(this._styles.concat(F))}}}),D}(),nu=FC(function(){},QC);function iu(){var D=Array.prototype.slice.call(arguments),F=D.map(function(X){if(X!=null&&X.constructor===String)return X;else return du.inspect(X)}).join(" ");if(!YD.enabled||!F)return F;var J=F.indexOf(`
|
|
29
|
+
`)!=-1,Q=this._styles,$=Q.length;while($--){var Z=SF[Q[$]];if(F=Z.open+F.replace(Z.closeRe,Z.open)+Z.close,J)F=F.replace(pu,function(X){return Z.close+X+Z.open})}return F}YD.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var F in D)(function(J){YD[J]=function(Q){if(typeof D[J]==="object"){var $=Q;for(var Z in D[J])$=YD[D[J][Z]]($);return $}return YD[D[J]](Q)}})(F)};function ou(){var D={};return Object.keys(QC).forEach(function(F){D[F]={get:function(){return JC([F])}}}),D}var au=function(F,J){var Q=J.split("");return Q=Q.map(F),Q.join("")};YD.trap=lz();YD.zalgo=nz();YD.maps={};YD.maps.america=oz()(YD);YD.maps.zebra=rz()(YD);YD.maps.rainbow=tz()(YD);YD.maps.random=DC()(YD);for(Dq in YD.maps)(function(D){YD[D]=function(F){return au(YD.maps[D],F)}})(Dq);var Dq;FC(YD,ou())});var YC=R((kYD,XC)=>{var ru=ZC();XC.exports=ru});var BC=R((yYD,WJ)=>{var{info:su,debug:WC}=XJ(),F8=tY();class E9{constructor(D){this.setOptions(D),this.x=null,this.y=null}setOptions(D){if(["boolean","number","bigint","string"].indexOf(typeof D)!==-1)D={content:""+D};D=D||{},this.options=D;let F=D.content;if(["boolean","number","bigint","string"].indexOf(typeof F)!==-1)this.content=String(F);else if(!F)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof F);if(this.colSpan=D.colSpan||1,this.rowSpan=D.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(D,F){this.cells=F;let J=this.options.chars||{},Q=D.chars,$=this.chars={};eu.forEach(function(Y){Fq(J,Q,Y,$)}),this.truncate=this.options.truncate||D.truncate;let Z=this.options.style=this.options.style||{},X=D.style;Fq(Z,X,"padding-left",this),Fq(Z,X,"padding-right",this),this.head=Z.head||X.head,this.border=Z.border||X.border,this.fixedWidth=D.colWidths[this.x],this.lines=this.computeLines(D),this.desiredWidth=F8.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(D){let F=D.wordWrap||D.textWrap,{wordWrap:J=F}=this.options;if(this.fixedWidth&&J){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let Z=1;while(Z<this.colSpan)this.fixedWidth+=D.colWidths[this.x+Z],Z++}let{wrapOnWordBoundary:Q=!0}=D,{wrapOnWordBoundary:$=Q}=this.options;return this.wrapLines(F8.wordWrap(this.fixedWidth,this.content,$))}return this.wrapLines(this.content.split(`
|
|
30
|
+
`))}wrapLines(D){let F=F8.colorizeLines(D);if(this.href)return F.map((J)=>F8.hyperlink(this.href,J));return F}init(D){let F=this.x,J=this.y;this.widths=D.colWidths.slice(F,F+this.colSpan),this.heights=D.rowHeights.slice(J,J+this.rowSpan),this.width=this.widths.reduce(GC,-1),this.height=this.heights.reduce(GC,-1),this.hAlign=this.options.hAlign||D.colAligns[F],this.vAlign=this.options.vAlign||D.rowAligns[J],this.drawRight=F+this.colSpan==D.colWidths.length}draw(D,F){if(D=="top")return this.drawTop(this.drawRight);if(D=="bottom")return this.drawBottom(this.drawRight);let J=F8.truncate(this.content,10,this.truncate);if(!D)su(`${this.y}-${this.x}: ${this.rowSpan-D}x${this.colSpan} Cell ${J}`);let Q=Math.max(this.height-this.lines.length,0),$;switch(this.vAlign){case"center":$=Math.ceil(Q/2);break;case"bottom":$=Q;break;default:$=0}if(D<$||D>=$+this.lines.length)return this.drawEmpty(this.drawRight,F);let Z=this.lines.length>this.height&&D+1>=this.height;return this.drawLine(D-$,this.drawRight,Z,F)}drawTop(D){let F=[];if(this.cells)this.widths.forEach(function(J,Q){F.push(this._topLeftChar(Q)),F.push(F8.repeat(this.chars[this.y==0?"top":"mid"],J))},this);else F.push(this._topLeftChar(0)),F.push(F8.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(D)F.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",F.join(""))}_topLeftChar(D){let F=this.x+D,J;if(this.y==0)J=F==0?"topLeft":D==0?"topMid":"top";else if(F==0)J="leftMid";else if(J=D==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][F]instanceof E9.ColSpanCell)J=D==0?"topMid":"mid";if(D==0){let $=1;while(this.cells[this.y][F-$]instanceof E9.ColSpanCell)$++;if(this.cells[this.y][F-$]instanceof E9.RowSpanCell)J="leftMid"}}return this.chars[J]}wrapWithStyleColors(D,F){if(this[D]&&this[D].length)try{let J=YC();for(let Q=this[D].length-1;Q>=0;Q--)J=J[this[D][Q]];return J(F)}catch(J){return F}else return F}drawLine(D,F,J,Q){let $=this.chars[this.x==0?"left":"middle"];if(this.x&&Q&&this.cells){let B=this.cells[this.y+Q][this.x-1];while(B instanceof qJ)B=this.cells[B.y][B.x-1];if(!(B instanceof GJ))$=this.chars.rightMid}let Z=F8.repeat(" ",this.paddingLeft),X=F?this.chars.right:"",Y=F8.repeat(" ",this.paddingRight),q=this.lines[D],G=this.width-(this.paddingLeft+this.paddingRight);if(J)q+=this.truncate||"…";let W=F8.truncate(q,G,this.truncate);return W=F8.pad(W,G," ",this.hAlign),W=Z+W+Y,this.stylizeLine($,W,X)}stylizeLine(D,F,J){if(D=this.wrapWithStyleColors("border",D),J=this.wrapWithStyleColors("border",J),this.y===0)F=this.wrapWithStyleColors("head",F);return D+F+J}drawBottom(D){let F=this.chars[this.x==0?"bottomLeft":"bottomMid"],J=F8.repeat(this.chars.bottom,this.width),Q=D?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",F+J+Q)}drawEmpty(D,F){let J=this.chars[this.x==0?"left":"middle"];if(this.x&&F&&this.cells){let Z=this.cells[this.y+F][this.x-1];while(Z instanceof qJ)Z=this.cells[Z.y][Z.x-1];if(!(Z instanceof GJ))J=this.chars.rightMid}let Q=D?this.chars.right:"",$=F8.repeat(" ",this.width);return this.stylizeLine(J,$,Q)}}class qJ{constructor(){}draw(D){if(typeof D==="number")WC(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class GJ{constructor(D){this.originalCell=D}init(D){let F=this.y,J=this.originalCell.y;this.cellOffset=F-J,this.offset=tu(D.rowHeights,J,this.cellOffset)}draw(D){if(D=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(D=="bottom")return this.originalCell.draw("bottom");return WC(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+D)}mergeTableOptions(){}}function qC(...D){return D.filter((F)=>F!==void 0&&F!==null).shift()}function Fq(D,F,J,Q){let $=J.split("-");if($.length>1)$[1]=$[1].charAt(0).toUpperCase()+$[1].substr(1),$=$.join(""),Q[$]=qC(D[$],D[J],F[$],F[J]);else Q[J]=qC(D[J],F[J])}function tu(D,F,J){let Q=D[F];for(let $=1;$<J;$++)Q+=1+D[F+$];return Q}function GC(D,F){return D+F+1}var eu=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];WJ.exports=E9;WJ.exports.ColSpanCell=qJ;WJ.exports.RowSpanCell=GJ});var VC=R((fYD,UC)=>{var{warn:Dg,debug:Fg}=XJ(),Jq=BC(),{ColSpanCell:Jg,RowSpanCell:Qg}=Jq;(function(){function D(U,V){if(U[V]>0)return D(U,V+1);return V}function F(U){let V={};U.forEach(function(H,z){let _=0;H.forEach(function(M){M.y=z,M.x=z?D(V,_):_;let C=M.rowSpan||1,O=M.colSpan||1;if(C>1)for(let E=0;E<O;E++)V[M.x+E]=C;_=M.x+O}),Object.keys(V).forEach((M)=>{if(V[M]--,V[M]<1)delete V[M]})})}function J(U){let V=0;return U.forEach(function(H){H.forEach(function(z){V=Math.max(V,z.x+(z.colSpan||1))})}),V}function Q(U){return U.length}function $(U,V){let H=U.y,z=U.y-1+(U.rowSpan||1),_=V.y,M=V.y-1+(V.rowSpan||1),C=!(H>M||_>z),O=U.x,E=U.x-1+(U.colSpan||1),A=V.x,N=V.x-1+(V.colSpan||1),w=!(O>N||A>E);return C&&w}function Z(U,V,H){let z=Math.min(U.length-1,H),_={x:V,y:H};for(let M=0;M<=z;M++){let C=U[M];for(let O=0;O<C.length;O++)if($(_,C[O]))return!0}return!1}function X(U,V,H,z){for(let _=H;_<z;_++)if(Z(U,_,V))return!1;return!0}function Y(U){U.forEach(function(V,H){V.forEach(function(z){for(let _=1;_<z.rowSpan;_++){let M=new Qg(z);M.x=z.x,M.y=z.y+_,M.colSpan=z.colSpan,G(M,U[H+_])}})})}function q(U){for(let V=U.length-1;V>=0;V--){let H=U[V];for(let z=0;z<H.length;z++){let _=H[z];for(let M=1;M<_.colSpan;M++){let C=new Jg;C.x=_.x+M,C.y=_.y,H.splice(z+1,0,C)}}}}function G(U,V){let H=0;while(H<V.length&&V[H].x<U.x)H++;V.splice(H,0,U)}function W(U){let V=Q(U),H=J(U);Fg(`Max rows: ${V}; Max cols: ${H}`);for(let z=0;z<V;z++)for(let _=0;_<H;_++)if(!Z(U,_,z)){let M={x:_,y:z,colSpan:1,rowSpan:1};_++;while(_<H&&!Z(U,_,z))M.colSpan++,_++;let C=z+1;while(C<V&&X(U,C,M.x,M.x+M.colSpan))M.rowSpan++,C++;let O=new Jq(M);O.x=M.x,O.y=M.y,Dg(`Missing cell at ${O.y}-${O.x}.`),G(O,U[z])}}function B(U){return U.map(function(V){if(!Array.isArray(V)){let H=Object.keys(V)[0];if(V=V[H],Array.isArray(V))V=V.slice(),V.unshift(H);else V=[H,V]}return V.map(function(H){return new Jq(H)})})}function K(U){let V=B(U);return F(V),W(V),Y(V),q(V),V}UC.exports={makeTableLayout:K,layoutTable:F,addRowSpanCells:Y,maxWidth:J,fillInTable:W,computeWidths:KC("colSpan","desiredWidth","x",1),computeHeights:KC("rowSpan","desiredHeight","y",1)}})();function KC(D,F,J,Q){return function($,Z){let X=[],Y=[],q={};Z.forEach(function(G){G.forEach(function(W){if((W[D]||1)>1)Y.push(W);else X[W[J]]=Math.max(X[W[J]]||0,W[F]||0,Q)})}),$.forEach(function(G,W){if(typeof G==="number")X[W]=G});for(let G=Y.length-1;G>=0;G--){let W=Y[G],B=W[D],K=W[J],U=X[K],V=typeof $[K]==="number"?0:1;if(typeof U==="number"){for(let H=1;H<B;H++)if(U+=1+X[K+H],typeof $[K+H]!=="number")V++}else if(U=F==="desiredWidth"?W.desiredWidth-1:1,!q[K]||q[K]<U)q[K]=U;if(W[F]>U){let H=0;while(V>0&&W[F]>U){if(typeof $[K+H]!=="number"){let z=Math.round((W[F]-U)/V);U+=z,X[K+H]+=z,V--}H++}}}Object.assign($,X,q);for(let G=0;G<$.length;G++)$[G]=Math.max(Q,$[G]||0)}}});var Xq=R((hYD,HC)=>{var c2=XJ(),$g=tY(),Qq=VC();class Zq extends Array{constructor(D){super();let F=$g.mergeOptions(D);if(Object.defineProperty(this,"options",{value:F,enumerable:F.debug}),F.debug){switch(typeof F.debug){case"boolean":c2.setDebugLevel(c2.WARN);break;case"number":c2.setDebugLevel(F.debug);break;case"string":c2.setDebugLevel(parseInt(F.debug,10));break;default:c2.setDebugLevel(c2.WARN),c2.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof F.debug}`)}Object.defineProperty(this,"messages",{get(){return c2.debugMessages()}})}}toString(){let D=this,F=this.options.head&&this.options.head.length;if(F){if(D=[this.options.head],this.length)D.push.apply(D,this)}else this.options.style.head=[];let J=Qq.makeTableLayout(D);J.forEach(function($){$.forEach(function(Z){Z.mergeTableOptions(this.options,J)},this)},this),Qq.computeWidths(this.options.colWidths,J),Qq.computeHeights(this.options.rowHeights,J),J.forEach(function($){$.forEach(function(Z){Z.init(this.options)},this)},this);let Q=[];for(let $=0;$<J.length;$++){let Z=J[$],X=this.options.rowHeights[$];if($===0||!this.options.style.compact||$==1&&F)$q(Z,"top",Q);for(let Y=0;Y<X;Y++)$q(Z,Y,Q);if($+1==J.length)$q(Z,"bottom",Q)}return Q.join(`
|
|
31
|
+
`)}get width(){return this.toString().split(`
|
|
32
|
+
`)[0].length}}Zq.reset=()=>c2.reset();function $q(D,F,J){let Q=[];D.forEach(function(Z){Q.push(Z.draw(F))});let $=Q.join("");if($.length)J.push($)}HC.exports=Zq});var sC=R((HGD,rC)=>{rC.exports=aC;aC.sync=Zm;var iC=r("fs");function $m(D,F){var J=F.pathExt!==void 0?F.pathExt:process.env.PATHEXT;if(!J)return!0;if(J=J.split(";"),J.indexOf("")!==-1)return!0;for(var Q=0;Q<J.length;Q++){var $=J[Q].toLowerCase();if($&&D.substr(-$.length).toLowerCase()===$)return!0}return!1}function oC(D,F,J){if(!D.isSymbolicLink()&&!D.isFile())return!1;return $m(F,J)}function aC(D,F,J){iC.stat(D,function(Q,$){J(Q,Q?!1:oC($,D,F))})}function Zm(D,F){return oC(iC.statSync(D),D,F)}});var J_=R((zGD,F_)=>{F_.exports=eC;eC.sync=Xm;var tC=r("fs");function eC(D,F,J){tC.stat(D,function(Q,$){J(Q,Q?!1:D_($,F))})}function Xm(D,F){return D_(tC.statSync(D),F)}function D_(D,F){return D.isFile()&&Ym(D,F)}function Ym(D,F){var{mode:J,uid:Q,gid:$}=D,Z=F.uid!==void 0?F.uid:process.getuid&&process.getuid(),X=F.gid!==void 0?F.gid:process.getgid&&process.getgid(),Y=parseInt("100",8),q=parseInt("010",8),G=parseInt("001",8),W=Y|q,B=J&G||J&q&&$===X||J&Y&&Q===Z||J&W&&Z===0;return B}});var $_=R((_GD,Q_)=>{var CGD=r("fs"),AJ;if(process.platform==="win32"||global.TESTING_WINDOWS)AJ=sC();else AJ=J_();Q_.exports=zq;zq.sync=qm;function zq(D,F,J){if(typeof F==="function")J=F,F={};if(!J){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(Q,$){zq(D,F||{},function(Z,X){if(Z)$(Z);else Q(X)})})}AJ(D,F||{},function(Q,$){if(Q){if(Q.code==="EACCES"||F&&F.ignoreErrors)Q=null,$=!1}J(Q,$)})}function qm(D,F){try{return AJ.sync(D,F||{})}catch(J){if(F&&F.ignoreErrors||J.code==="EACCES")return!1;else throw J}}});var B_=R((OGD,W_)=>{var D6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Z_=r("path"),Gm=D6?";":":",X_=$_(),Y_=(D)=>Object.assign(Error(`not found: ${D}`),{code:"ENOENT"}),q_=(D,F)=>{let J=F.colon||Gm,Q=D.match(/\//)||D6&&D.match(/\\/)?[""]:[...D6?[process.cwd()]:[],...(F.path||process.env.PATH||"").split(J)],$=D6?F.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Z=D6?$.split(J):[""];if(D6){if(D.indexOf(".")!==-1&&Z[0]!=="")Z.unshift("")}return{pathEnv:Q,pathExt:Z,pathExtExe:$}},G_=(D,F,J)=>{if(typeof F==="function")J=F,F={};if(!F)F={};let{pathEnv:Q,pathExt:$,pathExtExe:Z}=q_(D,F),X=[],Y=(G)=>new Promise((W,B)=>{if(G===Q.length)return F.all&&X.length?W(X):B(Y_(D));let K=Q[G],U=/^".*"$/.test(K)?K.slice(1,-1):K,V=Z_.join(U,D),H=!U&&/^\.[\\\/]/.test(D)?D.slice(0,2)+V:V;W(q(H,G,0))}),q=(G,W,B)=>new Promise((K,U)=>{if(B===$.length)return K(Y(W+1));let V=$[B];X_(G+V,{pathExt:Z},(H,z)=>{if(!H&&z)if(F.all)X.push(G+V);else return K(G+V);return K(q(G,W,B+1))})});return J?Y(0).then((G)=>J(null,G),J):Y(0)},Wm=(D,F)=>{F=F||{};let{pathEnv:J,pathExt:Q,pathExtExe:$}=q_(D,F),Z=[];for(let X=0;X<J.length;X++){let Y=J[X],q=/^".*"$/.test(Y)?Y.slice(1,-1):Y,G=Z_.join(q,D),W=!q&&/^\.[\\\/]/.test(D)?D.slice(0,2)+G:G;for(let B=0;B<Q.length;B++){let K=W+Q[B];try{if(X_.sync(K,{pathExt:$}))if(F.all)Z.push(K);else return K}catch(U){}}}if(F.all&&Z.length)return Z;if(F.nothrow)return null;throw Y_(D)};W_.exports=G_;G_.sync=Wm});var U_=R((MGD,Cq)=>{var K_=(D={})=>{let F=D.env||process.env;if((D.platform||process.platform)!=="win32")return"PATH";return Object.keys(F).reverse().find((Q)=>Q.toUpperCase()==="PATH")||"Path"};Cq.exports=K_;Cq.exports.default=K_});var C_=R((EGD,z_)=>{var V_=r("path"),Bm=B_(),Km=U_();function H_(D,F){let J=D.options.env||process.env,Q=process.cwd(),$=D.options.cwd!=null,Z=$&&process.chdir!==void 0&&!process.chdir.disabled;if(Z)try{process.chdir(D.options.cwd)}catch(Y){}let X;try{X=Bm.sync(D.command,{path:J[Km({env:J})],pathExt:F?V_.delimiter:void 0})}catch(Y){}finally{if(Z)process.chdir(Q)}if(X)X=V_.resolve($?D.options.cwd:"",X);return X}function Um(D){return H_(D)||H_(D,!0)}z_.exports=Um});var __=R((zm,Oq)=>{var _q=/([()\][%!^"`<>&|;, *?])/g;function Vm(D){return D=D.replace(_q,"^$1"),D}function Hm(D,F){if(D=`${D}`,D=D.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),D=D.replace(/(?=(\\+?)?)\1$/,"$1$1"),D=`"${D}"`,D=D.replace(_q,"^$1"),F)D=D.replace(_q,"^$1");return D}zm.command=Vm;zm.argument=Hm});var M_=R((RGD,O_)=>{O_.exports=/^#!(.*)/});var R_=R((AGD,E_)=>{var Om=M_();E_.exports=(D="")=>{let F=D.match(Om);if(!F)return null;let[J,Q]=F[0].replace(/#! ?/,"").split(" "),$=J.split("/").pop();if($==="env")return Q;return Q?`${$} ${Q}`:$}});var w_=R((wGD,A_)=>{var Mq=r("fs"),Mm=R_();function Em(D){let J=Buffer.alloc(150),Q;try{Q=Mq.openSync(D,"r"),Mq.readSync(Q,J,0,150,0),Mq.closeSync(Q)}catch($){}return Mm(J.toString())}A_.exports=Em});var L_=R((IGD,T_)=>{var Rm=r("path"),I_=C_(),N_=__(),Am=w_(),wm=process.platform==="win32",Im=/\.(?:com|exe)$/i,Nm=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Tm(D){D.file=I_(D);let F=D.file&&Am(D.file);if(F)return D.args.unshift(D.file),D.command=F,I_(D);return D.file}function Lm(D){if(!wm)return D;let F=Tm(D),J=!Im.test(F);if(D.options.forceShell||J){let Q=Nm.test(F);D.command=Rm.normalize(D.command),D.command=N_.command(D.command),D.args=D.args.map((Z)=>N_.argument(Z,Q));let $=[D.command].concat(D.args).join(" ");D.args=["/d","/s","/c",`"${$}"`],D.command=process.env.comspec||"cmd.exe",D.options.windowsVerbatimArguments=!0}return D}function Pm(D,F,J){if(F&&!Array.isArray(F))J=F,F=null;F=F?F.slice(0):[],J=Object.assign({},J);let Q={command:D,args:F,options:J,file:void 0,original:{command:D,args:F}};return J.shell?Q:Lm(Q)}T_.exports=Pm});var S_=R((NGD,j_)=>{var Eq=process.platform==="win32";function Rq(D,F){return Object.assign(Error(`${F} ${D.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${F} ${D.command}`,path:D.command,spawnargs:D.args})}function jm(D,F){if(!Eq)return;let J=D.emit;D.emit=function(Q,$){if(Q==="exit"){let Z=P_($,F);if(Z)return J.call(D,"error",Z)}return J.apply(D,arguments)}}function P_(D,F){if(Eq&&D===1&&!F.file)return Rq(F.original,"spawn");return null}function Sm(D,F){if(Eq&&D===1&&!F.file)return Rq(F.original,"spawnSync");return null}j_.exports={hookChildProcess:jm,verifyENOENT:P_,verifyENOENTSync:Sm,notFoundError:Rq}});var y_=R((TGD,F6)=>{var x_=r("child_process"),Aq=L_(),wq=S_();function k_(D,F,J){let Q=Aq(D,F,J),$=x_.spawn(Q.command,Q.args,Q.options);return wq.hookChildProcess($,Q),$}function xm(D,F,J){let Q=Aq(D,F,J),$=x_.spawnSync(Q.command,Q.args,Q.options);return $.error=$.error||wq.verifyENOENTSync($.status,Q),$}F6.exports=k_;F6.exports.spawn=k_;F6.exports.sync=xm;F6.exports._parse=Aq;F6.exports._enoent=wq});var uF;var vE=x(()=>{uF=[];uF.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")uF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")uF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class uE{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(KG[BG])return KG[BG];En(KG,BG,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let J=this.listeners[D],Q=J.indexOf(F);if(Q===-1)return;if(Q===0&&J.length===1)J.length=0;else J.splice(Q,1)}emit(D,F,J){if(this.emitted[D])return!1;this.emitted[D]=!0;let Q=!1;for(let $ of this.listeners[D])Q=$(F,J)===!0||Q;if(D==="exit")Q=this.emit("afterExit",F,J)||Q;return Q}}class VG{}var BQ=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",BG,KG,En,Rn=(D)=>{return{onExit(F,J){return D.onExit(F,J)},load(){return D.load()},unload(){return D.unload()}}},gE,mE,UG,B6,fHD,hHD;var KQ=x(()=>{vE();BG=Symbol.for("signal-exit emitter"),KG=globalThis,En=Object.defineProperty.bind(Object);gE=class gE extends VG{onExit(){return()=>{}}load(){}unload(){}};mE=class mE extends VG{#F=UG.platform==="win32"?"SIGINT":"SIGHUP";#J=new uE;#D;#Q;#Y;#X={};#$=!1;constructor(D){super();this.#D=D,this.#X={};for(let F of uF)this.#X[F]=()=>{let J=this.#D.listeners(F),{count:Q}=this.#J,$=D;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")Q+=$.__signal_exit_emitter__.count;if(J.length===Q){this.unload();let Z=this.#J.emit("exit",null,F),X=F==="SIGHUP"?this.#F:F;if(!Z)D.kill(D.pid,X)}};this.#Y=D.reallyExit,this.#Q=D.emit}onExit(D,F){if(!BQ(this.#D))return()=>{};if(this.#$===!1)this.load();let J=F?.alwaysLast?"afterExit":"exit";return this.#J.on(J,D),()=>{if(this.#J.removeListener(J,D),this.#J.listeners.exit.length===0&&this.#J.listeners.afterExit.length===0)this.unload()}}load(){if(this.#$)return;this.#$=!0,this.#J.count+=1;for(let D of uF)try{let F=this.#X[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#Z(D,...F)},this.#D.reallyExit=(D)=>{return this.#q(D)}}unload(){if(!this.#$)return;this.#$=!1,uF.forEach((D)=>{let F=this.#X[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch(J){}}),this.#D.emit=this.#Q,this.#D.reallyExit=this.#Y,this.#J.count-=1}#q(D){if(!BQ(this.#D))return 0;return this.#D.exitCode=D||0,this.#J.emit("exit",this.#D.exitCode,null),this.#Y.call(this.#D,this.#D.exitCode)}#Z(D,...F){let J=this.#Q;if(D==="exit"&&BQ(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let Q=J.call(this.#D,D,...F);return this.#J.emit("exit",this.#D.exitCode,null),Q}else return J.call(this.#D,D,...F)}};UG=globalThis.process,{onExit:B6,load:fHD,unload:hHD}=Rn(BQ(UG)?new mE(UG):new gE)});var LR="1.2.3";var vD;var U6=x(()=>{vD=class vD extends Error{constructor(D,F={}){let J=F.cause instanceof vD?F.cause.details:F.cause?.message?F.cause.message:F.details,Q=F.cause instanceof vD?F.cause.docsPath||F.docsPath:F.docsPath,$=[D||"An error occurred.","",...F.metaMessages?[...F.metaMessages,""]:[],...Q?[`Docs: https://abitype.dev${Q}`]:[],...J?[`Details: ${J}`]:[],`Version: abitype@${LR}`].join(`
|
|
33
|
+
`);super($);if(Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),F.cause)this.cause=F.cause;this.details=J,this.docsPath=Q,this.metaMessages=F.metaMessages,this.shortMessage=D}}});function Q8(D,F){return D.exec(F)?.groups}var yG,fG,MQ;var b9=x(()=>{yG=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,fG=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,MQ=/^\(.+?\).*?$/});function EQ(D){let F=D.type;if(PR.test(D.type)&&"components"in D){F="(";let J=D.components.length;for(let $=0;$<J;$++){let Z=D.components[$];if(F+=EQ(Z),$<J-1)F+=", "}let Q=Q8(PR,D.type);return F+=`)${Q?.array||""}`,EQ({...D,type:F})}if("indexed"in D&&D.indexed)F=`${F} indexed`;if(D.name)return`${F} ${D.name}`;return F}var PR;var jR=x(()=>{b9();PR=/^tuple(?<array>(\[(\d*)\])*)$/});function s2(D){let F="",J=D.length;for(let Q=0;Q<J;Q++){let $=D[Q];if(F+=EQ($),Q!==J-1)F+=", "}return F}var hG=x(()=>{jR()});function gF(D){if(D.type==="function")return`function ${D.name}(${s2(D.inputs)})${D.stateMutability&&D.stateMutability!=="nonpayable"?` ${D.stateMutability}`:""}${D.outputs?.length?` returns (${s2(D.outputs)})`:""}`;if(D.type==="event")return`event ${D.name}(${s2(D.inputs)})`;if(D.type==="error")return`error ${D.name}(${s2(D.inputs)})`;if(D.type==="constructor")return`constructor(${s2(D.inputs)})${D.stateMutability==="payable"?" payable":""}`;if(D.type==="fallback")return`fallback() external${D.stateMutability==="payable"?" payable":""}`;return"receive() external payable"}var SR=x(()=>{hG()});function kR(D){return xR.test(D)}function yR(D){return Q8(xR,D)}function hR(D){return fR.test(D)}function bR(D){return Q8(fR,D)}function uR(D){return vR.test(D)}function gR(D){return Q8(vR,D)}function f1(D){return mR.test(D)}function dR(D){return Q8(mR,D)}function lR(D){return pR.test(D)}function cR(D){return Q8(pR,D)}function iR(D){return nR.test(D)}function oR(D){return Q8(nR,D)}function aR(D){return yi.test(D)}var xR,fR,vR,mR,pR,nR,yi,bG,rR,RQ;var V6=x(()=>{b9();xR=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;fR=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;vR=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;mR=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;pR=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;nR=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;yi=/^receive\(\) external payable$/;bG=new Set(["memory","indexed","storage","calldata"]),rR=new Set(["indexed"]),RQ=new Set(["calldata","memory","storage"])});var AQ,wQ,vG;var IQ=x(()=>{U6();AQ=class AQ extends vD{constructor({signature:D}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(D,null,2)})`,docsPath:"/api/human#parseabiitem-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}};wQ=class wQ extends vD{constructor({type:D}){super("Unknown type.",{metaMessages:[`Type "${D}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}};vG=class vG extends vD{constructor({type:D}){super("Unknown type.",{metaMessages:[`Type "${D}" is not a valid ABI type.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var NQ,TQ,LQ,PQ,jQ,SQ;var xQ=x(()=>{U6();NQ=class NQ extends vD{constructor({params:D}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(D,null,2)})`,docsPath:"/api/human#parseabiparameters-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}};TQ=class TQ extends vD{constructor({param:D}){super("Invalid ABI parameter.",{details:D});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}};LQ=class LQ extends vD{constructor({param:D,name:F}){super("Invalid ABI parameter.",{details:D,metaMessages:[`"${F}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}};PQ=class PQ extends vD{constructor({param:D,type:F,modifier:J}){super("Invalid ABI parameter.",{details:D,metaMessages:[`Modifier "${J}" not allowed${F?` in "${F}" type`:""}.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}};jQ=class jQ extends vD{constructor({param:D,type:F,modifier:J}){super("Invalid ABI parameter.",{details:D,metaMessages:[`Modifier "${J}" not allowed${F?` in "${F}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${J}" was given.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}};SQ=class SQ extends vD{constructor({abiParameter:D}){super("Invalid ABI parameter.",{details:JSON.stringify(D,null,2),metaMessages:["ABI parameter type is invalid."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var W2,kQ,yQ;var uG=x(()=>{U6();W2=class W2 extends vD{constructor({signature:D,type:F}){super(`Invalid ${F} signature.`,{details:D});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};kQ=class kQ extends vD{constructor({signature:D}){super("Unknown signature.",{details:D});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}};yQ=class yQ extends vD{constructor({signature:D}){super("Invalid struct signature.",{details:D,metaMessages:["No properties exist."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var fQ;var sR=x(()=>{U6();fQ=class fQ extends vD{constructor({type:D}){super("Circular reference detected.",{metaMessages:[`Struct "${D}" is a circular reference.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var hQ;var tR=x(()=>{U6();hQ=class hQ extends vD{constructor({current:D,depth:F}){super("Unbalanced parentheses.",{metaMessages:[`"${D.trim()}" has too many ${F>0?"opening":"closing"} parentheses.`],details:`Depth "${F}"`});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function eR(D,F,J){let Q="";if(J)for(let $ of Object.entries(J)){if(!$)continue;let Z="";for(let X of $[1])Z+=`[${X.type}${X.name?`:${X.name}`:""}]`;Q+=`(${$[0]}{${Z}})`}if(F)return`${F}:${D}${Q}`;return`${D}${Q}`}var bQ;var DA=x(()=>{bQ=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function v9(D,F={}){if(uR(D))return fi(D,F);if(hR(D))return hi(D,F);if(kR(D))return bi(D,F);if(lR(D))return vi(D,F);if(iR(D))return ui(D);if(aR(D))return{type:"receive",stateMutability:"payable"};throw new kQ({signature:D})}function fi(D,F={}){let J=gR(D);if(!J)throw new W2({signature:D,type:"function"});let Q=d0(J.parameters),$=[],Z=Q.length;for(let Y=0;Y<Z;Y++)$.push(h8(Q[Y],{modifiers:RQ,structs:F,type:"function"}));let X=[];if(J.returns){let Y=d0(J.returns),q=Y.length;for(let G=0;G<q;G++)X.push(h8(Y[G],{modifiers:RQ,structs:F,type:"function"}))}return{name:J.name,type:"function",stateMutability:J.stateMutability??"nonpayable",inputs:$,outputs:X}}function hi(D,F={}){let J=bR(D);if(!J)throw new W2({signature:D,type:"event"});let Q=d0(J.parameters),$=[],Z=Q.length;for(let X=0;X<Z;X++)$.push(h8(Q[X],{modifiers:rR,structs:F,type:"event"}));return{name:J.name,type:"event",inputs:$}}function bi(D,F={}){let J=yR(D);if(!J)throw new W2({signature:D,type:"error"});let Q=d0(J.parameters),$=[],Z=Q.length;for(let X=0;X<Z;X++)$.push(h8(Q[X],{structs:F,type:"error"}));return{name:J.name,type:"error",inputs:$}}function vi(D,F={}){let J=cR(D);if(!J)throw new W2({signature:D,type:"constructor"});let Q=d0(J.parameters),$=[],Z=Q.length;for(let X=0;X<Z;X++)$.push(h8(Q[X],{structs:F,type:"constructor"}));return{type:"constructor",stateMutability:J.stateMutability??"nonpayable",inputs:$}}function ui(D){let F=oR(D);if(!F)throw new W2({signature:D,type:"fallback"});return{type:"fallback",stateMutability:F.stateMutability??"nonpayable"}}function h8(D,F){let J=eR(D,F?.type,F?.structs);if(bQ.has(J))return bQ.get(J);let Q=MQ.test(D),$=Q8(Q?mi:gi,D);if(!$)throw new TQ({param:D});if($.name&&li($.name))throw new LQ({param:D,name:$.name});let Z=$.name?{name:$.name}:{},X=$.modifier==="indexed"?{indexed:!0}:{},Y=F?.structs??{},q,G={};if(Q){q="tuple";let B=d0($.type),K=[],U=B.length;for(let V=0;V<U;V++)K.push(h8(B[V],{structs:Y}));G={components:K}}else if($.type in Y)q="tuple",G={components:Y[$.type]};else if(di.test($.type))q=`${$.type}256`;else if($.type==="address payable")q="address";else if(q=$.type,F?.type!=="struct"&&!gG(q))throw new vG({type:q});if($.modifier){if(!F?.modifiers?.has?.($.modifier))throw new PQ({param:D,type:F?.type,modifier:$.modifier});if(RQ.has($.modifier)&&!ci(q,!!$.array))throw new jQ({param:D,type:F?.type,modifier:$.modifier})}let W={type:`${q}${$.array??""}`,...Z,...X,...G};return bQ.set(J,W),W}function d0(D,F=[],J="",Q=0){let $=D.trim().length;for(let Z=0;Z<$;Z++){let X=D[Z],Y=D.slice(Z+1);switch(X){case",":return Q===0?d0(Y,[...F,J.trim()]):d0(Y,F,`${J}${X}`,Q);case"(":return d0(Y,F,`${J}${X}`,Q+1);case")":return d0(Y,F,`${J}${X}`,Q-1);default:return d0(Y,F,`${J}${X}`,Q)}}if(J==="")return F;if(Q!==0)throw new hQ({current:J,depth:Q});return F.push(J.trim()),F}function gG(D){return D==="address"||D==="bool"||D==="function"||D==="string"||yG.test(D)||fG.test(D)}function li(D){return D==="address"||D==="bool"||D==="function"||D==="string"||D==="tuple"||yG.test(D)||fG.test(D)||pi.test(D)}function ci(D,F){return F||D==="bytes"||D==="string"||D==="tuple"}var gi,mi,di,pi;var H6=x(()=>{b9();IQ();xQ();uG();tR();DA();V6();gi=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,mi=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,di=/^u?int$/;pi=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function z6(D){let F={},J=D.length;for(let X=0;X<J;X++){let Y=D[X];if(!f1(Y))continue;let q=dR(Y);if(!q)throw new W2({signature:Y,type:"struct"});let G=q.properties.split(";"),W=[],B=G.length;for(let K=0;K<B;K++){let V=G[K].trim();if(!V)continue;let H=h8(V,{type:"struct"});W.push(H)}if(!W.length)throw new yQ({signature:Y});F[q.name]=W}let Q={},$=Object.entries(F),Z=$.length;for(let X=0;X<Z;X++){let[Y,q]=$[X];Q[Y]=FA(q,F)}return Q}function FA(D=[],F={},J=new Set){let Q=[],$=D.length;for(let Z=0;Z<$;Z++){let X=D[Z];if(MQ.test(X.type))Q.push(X);else{let q=Q8(ni,X.type);if(!q?.type)throw new SQ({abiParameter:X});let{array:G,type:W}=q;if(W in F){if(J.has(W))throw new fQ({type:W});Q.push({...X,type:`tuple${G??""}`,components:FA(F[W],F,new Set([...J,W]))})}else if(gG(W))Q.push(X);else throw new wQ({type:W})}}return Q}var ni;var vQ=x(()=>{b9();IQ();xQ();uG();sR();V6();H6();ni=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function u9(D){let F=z6(D),J=[],Q=D.length;for(let $=0;$<Q;$++){let Z=D[$];if(f1(Z))continue;J.push(v9(Z,F))}return J}var JA=x(()=>{V6();vQ();H6()});function g9(D){let F;if(typeof D==="string")F=v9(D);else{let J=z6(D),Q=D.length;for(let $=0;$<Q;$++){let Z=D[$];if(f1(Z))continue;F=v9(Z,J);break}}if(!F)throw new AQ({signature:D});return F}var QA=x(()=>{IQ();V6();vQ();H6()});function B2(D){let F=[];if(typeof D==="string"){let J=d0(D),Q=J.length;for(let $=0;$<Q;$++)F.push(h8(J[$],{modifiers:bG}))}else{let J=z6(D),Q=D.length;for(let $=0;$<Q;$++){let Z=D[$];if(f1(Z))continue;let X=d0(Z),Y=X.length;for(let q=0;q<Y;q++)F.push(h8(X[q],{modifiers:bG,structs:J}))}}if(F.length===0)throw new NQ({params:D});return F}var $A=x(()=>{xQ();V6();vQ();H6();H6()});var C6=x(()=>{SR();hG();JA();QA();$A()});function eD(D,{includeName:F=!1}={}){if(D.type!=="function"&&D.type!=="event"&&D.type!=="error")throw new mG(D.type);return`${D.name}(${m9(D.inputs,{includeName:F})})`}function m9(D,{includeName:F=!1}={}){if(!D)return"";return D.map((J)=>ii(J,{includeName:F})).join(F?", ":",")}function ii(D,{includeName:F}){if(D.type.startsWith("tuple"))return`(${m9(D.components,{includeName:F})})${D.type.slice(5)}`;return D.type+(F&&D.name?` ${D.name}`:"")}var t2=x(()=>{gD()});function e(D,{strict:F=!0}={}){if(!D)return!1;if(typeof D!=="string")return!1;return F?/^0x[0-9a-fA-F]*$/.test(D):D.startsWith("0x")}function GD(D){if(e(D,{strict:!1}))return Math.ceil((D.length-2)/2);return D.length}var z8=()=>{};var dG="2.43.5";function XA(D,F){if(F?.(D))return D;if(D&&typeof D==="object"&&"cause"in D&&D.cause!==void 0)return XA(D.cause,F);return F?null:D}var pG,P;var s=x(()=>{pG={getDocsUrl:({docsBaseUrl:D,docsPath:F="",docsSlug:J})=>F?`${D??"https://viem.sh"}${F}${J?`#${J}`:""}`:void 0,version:`viem@${dG}`};P=class P extends Error{constructor(D,F={}){let J=(()=>{if(F.cause instanceof P)return F.cause.details;if(F.cause?.message)return F.cause.message;return F.details})(),Q=(()=>{if(F.cause instanceof P)return F.cause.docsPath||F.docsPath;return F.docsPath})(),$=pG.getDocsUrl?.({...F,docsPath:Q}),Z=[D||"An error occurred.","",...F.metaMessages?[...F.metaMessages,""]:[],...$?[`Docs: ${$}`]:[],...J?[`Details: ${J}`]:[],...pG.version?[`Version: ${pG.version}`]:[]].join(`
|
|
34
|
+
`);super(Z,F.cause?{cause:F.cause}:void 0);Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=J,this.docsPath=Q,this.metaMessages=F.metaMessages,this.name=F.name??this.name,this.shortMessage=D,this.version=dG}walk(D){return XA(this,D)}}});var lG,uQ,d9,b8,cG,nG,iG,oG,gQ,p9,aG,rG,mQ,K2,l9,sG,tG,eG,h1,mF,DW,FW,c9,mG;var gD=x(()=>{t2();z8();s();lG=class lG extends P{constructor({docsPath:D}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
35
|
+
`),{docsPath:D,name:"AbiConstructorNotFoundError"})}};uQ=class uQ extends P{constructor({docsPath:D}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
36
|
+
`),{docsPath:D,name:"AbiConstructorParamsNotFoundError"})}};d9=class d9 extends P{constructor({data:D,params:F,size:J}){super([`Data size of ${J} bytes is too small for given parameters.`].join(`
|
|
37
|
+
`),{metaMessages:[`Params: (${m9(F,{includeName:!0})})`,`Data: ${D} (${J} bytes)`],name:"AbiDecodingDataSizeTooSmallError"});Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=D,this.params=F,this.size=J}};b8=class b8 extends P{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}};cG=class cG extends P{constructor({expectedLength:D,givenLength:F,type:J}){super([`ABI encoding array length mismatch for type ${J}.`,`Expected length: ${D}`,`Given length: ${F}`].join(`
|
|
38
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}};nG=class nG extends P{constructor({expectedSize:D,value:F}){super(`Size of bytes "${F}" (bytes${GD(F)}) does not match expected size (bytes${D}).`,{name:"AbiEncodingBytesSizeMismatchError"})}};iG=class iG extends P{constructor({expectedLength:D,givenLength:F}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${D}`,`Given length (values): ${F}`].join(`
|
|
39
|
+
`),{name:"AbiEncodingLengthMismatchError"})}};oG=class oG extends P{constructor(D,{docsPath:F}){super([`Arguments (\`args\`) were provided to "${D}", but "${D}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
40
|
+
`),{docsPath:F,name:"AbiErrorInputsNotFoundError"})}};gQ=class gQ extends P{constructor(D,{docsPath:F}={}){super([`Error ${D?`"${D}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
41
|
+
`),{docsPath:F,name:"AbiErrorNotFoundError"})}};p9=class p9 extends P{constructor(D,{docsPath:F}){super([`Encoded error signature "${D}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${D}.`].join(`
|
|
42
|
+
`),{docsPath:F,name:"AbiErrorSignatureNotFoundError"});Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=D}};aG=class aG extends P{constructor({docsPath:D}){super("Cannot extract event signature from empty topics.",{docsPath:D,name:"AbiEventSignatureEmptyTopicsError"})}};rG=class rG extends P{constructor(D,{docsPath:F}){super([`Encoded event signature "${D}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${D}.`].join(`
|
|
43
|
+
`),{docsPath:F,name:"AbiEventSignatureNotFoundError"})}};mQ=class mQ extends P{constructor(D,{docsPath:F}={}){super([`Event ${D?`"${D}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
|
|
44
|
+
`),{docsPath:F,name:"AbiEventNotFoundError"})}};K2=class K2 extends P{constructor(D,{docsPath:F}={}){super([`Function ${D?`"${D}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
45
|
+
`),{docsPath:F,name:"AbiFunctionNotFoundError"})}};l9=class l9 extends P{constructor(D,{docsPath:F}){super([`Function "${D}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
46
|
+
`),{docsPath:F,name:"AbiFunctionOutputsNotFoundError"})}};sG=class sG extends P{constructor(D,{docsPath:F}){super([`Encoded function signature "${D}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${D}.`].join(`
|
|
47
|
+
`),{docsPath:F,name:"AbiFunctionSignatureNotFoundError"})}};tG=class tG extends P{constructor(D,F){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${D.type}\` in \`${eD(D.abiItem)}\`, and`,`\`${F.type}\` in \`${eD(F.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}};eG=class eG extends P{constructor({expectedSize:D,givenSize:F}){super(`Expected bytes${D}, got bytes${F}.`,{name:"BytesSizeMismatchError"})}};h1=class h1 extends P{constructor({abiItem:D,data:F,params:J,size:Q}){super([`Data size of ${Q} bytes is too small for non-indexed event parameters.`].join(`
|
|
48
|
+
`),{metaMessages:[`Params: (${m9(J,{includeName:!0})})`,`Data: ${F} (${Q} bytes)`],name:"DecodeLogDataMismatch"});Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=D,this.data=F,this.params=J,this.size=Q}};mF=class mF extends P{constructor({abiItem:D,param:F}){super([`Expected a topic for indexed event parameter${F.name?` "${F.name}"`:""} on event "${eD(D,{includeName:!0})}".`].join(`
|
|
49
|
+
`),{name:"DecodeLogTopicsMismatch"});Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=D}};DW=class DW extends P{constructor(D,{docsPath:F}){super([`Type "${D}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
50
|
+
`),{docsPath:F,name:"InvalidAbiEncodingType"})}};FW=class FW extends P{constructor(D,{docsPath:F}){super([`Type "${D}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
51
|
+
`),{docsPath:F,name:"InvalidAbiDecodingType"})}};c9=class c9 extends P{constructor(D){super([`Value "${D}" is not a valid array.`].join(`
|
|
52
|
+
`),{name:"InvalidArrayError"})}};mG=class mG extends P{constructor(D){super([`"${D}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
53
|
+
`),{name:"InvalidDefinitionTypeError"})}}});var dQ,pQ,lQ;var cQ=x(()=>{s();dQ=class dQ extends P{constructor({offset:D,position:F,size:J}){super(`Slice ${F==="start"?"starting":"ending"} at offset "${D}" is out-of-bounds (size: ${J}).`,{name:"SliceOffsetOutOfBoundsError"})}};pQ=class pQ extends P{constructor({size:D,targetSize:F,type:J}){super(`${J.charAt(0).toUpperCase()}${J.slice(1).toLowerCase()} size (${D}) exceeds padding size (${F}).`,{name:"SizeExceedsPaddingSizeError"})}};lQ=class lQ extends P{constructor({size:D,targetSize:F,type:J}){super(`${J.charAt(0).toUpperCase()}${J.slice(1).toLowerCase()} is expected to be ${F} ${J} long, but is ${D} ${J} long.`,{name:"InvalidBytesLengthError"})}}});function b1(D,{dir:F,size:J=32}={}){if(typeof D==="string")return e2(D,{dir:F,size:J});return oi(D,{dir:F,size:J})}function e2(D,{dir:F,size:J=32}={}){if(J===null)return D;let Q=D.replace("0x","");if(Q.length>J*2)throw new pQ({size:Math.ceil(Q.length/2),targetSize:J,type:"hex"});return`0x${Q[F==="right"?"padEnd":"padStart"](J*2,"0")}`}function oi(D,{dir:F,size:J=32}={}){if(J===null)return D;if(D.length>J)throw new pQ({size:D.length,targetSize:J,type:"bytes"});let Q=new Uint8Array(J);for(let $=0;$<J;$++){let Z=F==="right";Q[Z?$:J-$-1]=D[Z?$:D.length-$-1]}return Q}var nQ=x(()=>{cQ()});var n9,QW,$W,ZW;var i9=x(()=>{s();n9=class n9 extends P{constructor({max:D,min:F,signed:J,size:Q,value:$}){super(`Number "${$}" is not in safe ${Q?`${Q*8}-bit ${J?"signed":"unsigned"} `:""}integer range ${D?`(${F} to ${D})`:`(above ${F})`}`,{name:"IntegerOutOfRangeError"})}};QW=class QW extends P{constructor(D){super(`Bytes value "${D}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};$W=class $W extends P{constructor(D){super(`Hex value "${D}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}};ZW=class ZW extends P{constructor({givenSize:D,maxSize:F}){super(`Size cannot exceed ${F} bytes. Given size: ${D} bytes.`,{name:"SizeOverflowError"})}}});function $8(D,{dir:F="left"}={}){let J=typeof D==="string"?D.replace("0x",""):D,Q=0;for(let $=0;$<J.length-1;$++)if(J[F==="left"?$:J.length-$-1].toString()==="0")Q++;else break;if(J=F==="left"?J.slice(Q):J.slice(0,J.length-Q),typeof D==="string"){if(J.length===1&&F==="right")J=`${J}0`;return`0x${J.length%2===1?`0${J}`:J}`}return J}function p0(D,{size:F}){if(GD(D)>F)throw new ZW({givenSize:GD(D),maxSize:F})}function kD(D,F={}){let{signed:J}=F;if(F.size)p0(D,{size:F.size});let Q=BigInt(D);if(!J)return Q;let $=(D.length-2)/2,Z=(1n<<BigInt($)*8n-1n)-1n;if(Q<=Z)return Q;return Q-BigInt(`0x${"f".padStart($*2,"f")}`)-1n}function iQ(D,F={}){let J=D;if(F.size)p0(J,{size:F.size}),J=$8(J);if($8(J)==="0x00")return!1;if($8(J)==="0x01")return!0;throw new $W(J)}function OD(D,F={}){return Number(kD(D,F))}var D0=x(()=>{i9();z8()});function cD(D,F={}){if(typeof D==="number"||typeof D==="bigint")return k(D,F);if(typeof D==="string")return G0(D,F);if(typeof D==="boolean")return o9(D,F);return BD(D,F)}function o9(D,F={}){let J=`0x${Number(D)}`;if(typeof F.size==="number")return p0(J,{size:F.size}),b1(J,{size:F.size});return J}function BD(D,F={}){let J="";for(let $=0;$<D.length;$++)J+=ai[D[$]];let Q=`0x${J}`;if(typeof F.size==="number")return p0(Q,{size:F.size}),b1(Q,{dir:"right",size:F.size});return Q}function k(D,F={}){let{signed:J,size:Q}=F,$=BigInt(D),Z;if(Q)if(J)Z=(1n<<BigInt(Q)*8n-1n)-1n;else Z=2n**(BigInt(Q)*8n)-1n;else if(typeof D==="number")Z=BigInt(Number.MAX_SAFE_INTEGER);let X=typeof Z==="bigint"&&J?-Z-1n:0;if(Z&&$>Z||$<X){let q=typeof D==="bigint"?"n":"";throw new n9({max:Z?`${Z}${q}`:void 0,min:`${X}${q}`,signed:J,size:Q,value:`${D}${q}`})}let Y=`0x${(J&&$<0?(1n<<BigInt(Q*8))+BigInt($):$).toString(16)}`;if(Q)return b1(Y,{size:Q});return Y}function G0(D,F={}){let J=ri.encode(D);return BD(J,F)}var ai,ri;var c=x(()=>{i9();nQ();D0();ai=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"));ri=new TextEncoder});function C8(D,F={}){if(typeof D==="number"||typeof D==="bigint")return ei(D,F);if(typeof D==="boolean")return ti(D,F);if(e(D))return W0(D,F);return v8(D,F)}function ti(D,F={}){let J=new Uint8Array(1);if(J[0]=Number(D),typeof F.size==="number")return p0(J,{size:F.size}),b1(J,{size:F.size});return J}function YA(D){if(D>=D1.zero&&D<=D1.nine)return D-D1.zero;if(D>=D1.A&&D<=D1.F)return D-(D1.A-10);if(D>=D1.a&&D<=D1.f)return D-(D1.a-10);return}function W0(D,F={}){let J=D;if(F.size)p0(J,{size:F.size}),J=b1(J,{dir:"right",size:F.size});let Q=J.slice(2);if(Q.length%2)Q=`0${Q}`;let $=Q.length/2,Z=new Uint8Array($);for(let X=0,Y=0;X<$;X++){let q=YA(Q.charCodeAt(Y++)),G=YA(Q.charCodeAt(Y++));if(q===void 0||G===void 0)throw new P(`Invalid byte sequence ("${Q[Y-2]}${Q[Y-1]}" in "${Q}").`);Z[X]=q*16+G}return Z}function ei(D,F){let J=k(D,F);return W0(J)}function v8(D,F={}){let J=si.encode(D);if(typeof F.size==="number")return p0(J,{size:F.size}),b1(J,{dir:"right",size:F.size});return J}var si,D1;var B0=x(()=>{s();nQ();D0();c();si=new TextEncoder;D1={zero:48,nine:57,A:65,F:70,a:97,f:102}});function Do(D,F=!1){if(F)return{h:Number(D&oQ),l:Number(D>>qA&oQ)};return{h:Number(D>>qA&oQ)|0,l:Number(D&oQ)|0}}function GA(D,F=!1){let J=D.length,Q=new Uint32Array(J),$=new Uint32Array(J);for(let Z=0;Z<J;Z++){let{h:X,l:Y}=Do(D[Z],F);[Q[Z],$[Z]]=[X,Y]}return[Q,$]}var oQ,qA,WA=(D,F,J)=>D<<J|F>>>32-J,BA=(D,F,J)=>F<<J|D>>>32-J,KA=(D,F,J)=>F<<J-32|D>>>64-J,UA=(D,F,J)=>D<<J-32|F>>>64-J;var VA=x(()=>{oQ=BigInt(4294967295),qA=BigInt(32)});import*as F1 from"node:crypto";var dF;var HA=x(()=>{dF=F1&&typeof F1==="object"&&"webcrypto"in F1?F1.webcrypto:F1&&typeof F1==="object"&&("randomBytes"in F1)?F1:void 0});function Fo(D){return D instanceof Uint8Array||ArrayBuffer.isView(D)&&D.constructor.name==="Uint8Array"}function pF(D){if(!Number.isSafeInteger(D)||D<0)throw Error("positive integer expected, got "+D)}function U2(D,...F){if(!Fo(D))throw Error("Uint8Array expected");if(F.length>0&&!F.includes(D.length))throw Error("Uint8Array expected of length "+F+", got length="+D.length)}function zA(D){if(typeof D!=="function"||typeof D.create!=="function")throw Error("Hash should be wrapped by utils.createHasher");pF(D.outputLen),pF(D.blockLen)}function J1(D,F=!0){if(D.destroyed)throw Error("Hash instance has been destroyed");if(F&&D.finished)throw Error("Hash#digest() has already been called")}function aQ(D,F){U2(D);let J=F.outputLen;if(D.length<J)throw Error("digestInto() expects output buffer of length at least "+J)}function CA(D){return new Uint32Array(D.buffer,D.byteOffset,Math.floor(D.byteLength/4))}function V2(...D){for(let F=0;F<D.length;F++)D[F].fill(0)}function rQ(D){return new DataView(D.buffer,D.byteOffset,D.byteLength)}function u8(D,F){return D<<32-F|D>>>F}function Qo(D){return D<<24&4278190080|D<<8&16711680|D>>>8&65280|D>>>24&255}function $o(D){for(let F=0;F<D.length;F++)D[F]=Qo(D[F]);return D}function Zo(D){if(typeof D!=="string")throw Error("string expected");return new Uint8Array(new TextEncoder().encode(D))}function lF(D){if(typeof D==="string")D=Zo(D);return U2(D),D}function _A(...D){let F=0;for(let Q=0;Q<D.length;Q++){let $=D[Q];U2($),F+=$.length}let J=new Uint8Array(F);for(let Q=0,$=0;Q<D.length;Q++){let Z=D[Q];J.set(Z,$),$+=Z.length}return J}class cF{}function sQ(D){let F=(Q)=>D().update(lF(Q)).digest(),J=D();return F.outputLen=J.outputLen,F.blockLen=J.blockLen,F.create=()=>D(),F}function tQ(D=32){if(dF&&typeof dF.getRandomValues==="function")return dF.getRandomValues(new Uint8Array(D));if(dF&&typeof dF.randomBytes==="function")return Uint8Array.from(dF.randomBytes(D));throw Error("crypto.getRandomValues must be defined")}var Jo,XW;var v1=x(()=>{HA();/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Jo=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();XW=Jo?(D)=>D:$o});function Uo(D,F=24){let J=new Uint32Array(10);for(let Q=24-F;Q<24;Q++){for(let X=0;X<10;X++)J[X]=D[X]^D[X+10]^D[X+20]^D[X+30]^D[X+40];for(let X=0;X<10;X+=2){let Y=(X+8)%10,q=(X+2)%10,G=J[q],W=J[q+1],B=OA(G,W,1)^J[Y],K=MA(G,W,1)^J[Y+1];for(let U=0;U<50;U+=10)D[X+U]^=B,D[X+U+1]^=K}let $=D[2],Z=D[3];for(let X=0;X<24;X++){let Y=RA[X],q=OA($,Z,Y),G=MA($,Z,Y),W=EA[X];$=D[W],Z=D[W+1],D[W]=q,D[W+1]=G}for(let X=0;X<50;X+=10){for(let Y=0;Y<10;Y++)J[Y]=D[X+Y];for(let Y=0;Y<10;Y++)D[X+Y]^=~J[(Y+2)%10]&J[(Y+4)%10]}D[0]^=Bo[Q],D[1]^=Ko[Q]}V2(J)}var Xo,a9,Yo,qo,Go,Wo,EA,RA,AA,wA,Bo,Ko,OA=(D,F,J)=>J>32?KA(D,F,J):WA(D,F,J),MA=(D,F,J)=>J>32?UA(D,F,J):BA(D,F,J),YW,Vo=(D,F,J)=>sQ(()=>new YW(F,D,J)),eQ;var qW=x(()=>{VA();v1();Xo=BigInt(0),a9=BigInt(1),Yo=BigInt(2),qo=BigInt(7),Go=BigInt(256),Wo=BigInt(113),EA=[],RA=[],AA=[];for(let D=0,F=a9,J=1,Q=0;D<24;D++){[J,Q]=[Q,(2*J+3*Q)%5],EA.push(2*(5*Q+J)),RA.push((D+1)*(D+2)/2%64);let $=Xo;for(let Z=0;Z<7;Z++)if(F=(F<<a9^(F>>qo)*Wo)%Go,F&Yo)$^=a9<<(a9<<BigInt(Z))-a9;AA.push($)}wA=GA(AA,!0),Bo=wA[0],Ko=wA[1];YW=class YW extends cF{constructor(D,F,J,Q=!1,$=24){super();if(this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=D,this.suffix=F,this.outputLen=J,this.enableXOF=Q,this.rounds=$,pF(J),!(0<D&&D<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=CA(this.state)}clone(){return this._cloneInto()}keccak(){XW(this.state32),Uo(this.state32,this.rounds),XW(this.state32),this.posOut=0,this.pos=0}update(D){J1(this),D=lF(D),U2(D);let{blockLen:F,state:J}=this,Q=D.length;for(let $=0;$<Q;){let Z=Math.min(F-this.pos,Q-$);for(let X=0;X<Z;X++)J[this.pos++]^=D[$++];if(this.pos===F)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:D,suffix:F,pos:J,blockLen:Q}=this;if(D[J]^=F,(F&128)!==0&&J===Q-1)this.keccak();D[Q-1]^=128,this.keccak()}writeInto(D){J1(this,!1),U2(D),this.finish();let F=this.state,{blockLen:J}=this;for(let Q=0,$=D.length;Q<$;){if(this.posOut>=J)this.keccak();let Z=Math.min(J-this.posOut,$-Q);D.set(F.subarray(this.posOut,this.posOut+Z),Q),this.posOut+=Z,Q+=Z}return D}xofInto(D){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(D)}xof(D){return pF(D),this.xofInto(new Uint8Array(D))}digestInto(D){if(aQ(D,this),this.finished)throw Error("digest() was already called");return this.writeInto(D),this.destroy(),D}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,V2(this.state)}_cloneInto(D){let{blockLen:F,suffix:J,outputLen:Q,rounds:$,enableXOF:Z}=this;return D||(D=new YW(F,J,Q,Z,$)),D.state32.set(this.state32),D.pos=this.pos,D.posOut=this.posOut,D.finished=this.finished,D.rounds=$,D.suffix=J,D.outputLen=Q,D.enableXOF=Z,D.destroyed=this.destroyed,D}};eQ=(()=>Vo(1,136,32))()});function MD(D,F){let J=F||"hex",Q=eQ(e(D,{strict:!1})?C8(D):D);if(J==="bytes")return Q;return cD(Q)}var g8=x(()=>{qW();B0();c()});function IA(D){return Ho(D)}var Ho=(D)=>MD(C8(D));var NA=x(()=>{B0();g8()});function TA(D){let F=!0,J="",Q=0,$="",Z=!1;for(let X=0;X<D.length;X++){let Y=D[X];if(["(",")",","].includes(Y))F=!0;if(Y==="(")Q++;if(Y===")")Q--;if(!F)continue;if(Q===0){if(Y===" "&&["event","function",""].includes($))$="";else if($+=Y,Y===")"){Z=!0;break}continue}if(Y===" "){if(D[X-1]!==","&&J!==","&&J!==",(")J="",F=!1;continue}$+=Y,J+=Y}if(!Z)throw new P("Unable to normalize signature.");return $}var LA=x(()=>{s()});var PA=(D)=>{let F=(()=>{if(typeof D==="string")return D;return gF(D)})();return TA(F)};var jA=x(()=>{C6();LA()});function D$(D){return IA(PA(D))}var GW=x(()=>{NA();jA()});var u1;var r9=x(()=>{GW();u1=D$});var j0;var nF=x(()=>{s();j0=class j0 extends P{constructor({address:D}){super(`Address "${D}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var Z8;var iF=x(()=>{Z8=class Z8 extends Map{constructor(D){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=D}get(D){let F=super.get(D);if(super.has(D)&&F!==void 0)this.delete(D),super.set(D,F);return F}set(D,F){if(super.set(D,F),this.maxSize&&this.size>this.maxSize){let J=this.keys().next().value;if(J)this.delete(J)}return this}}});function H2(D,F){if(WW.has(`${D}.${F}`))return WW.get(`${D}.${F}`);let J=F?`${F}${D.toLowerCase()}`:D.substring(2).toLowerCase(),Q=MD(v8(J),"bytes"),$=(F?J.substring(`${F}0x`.length):J).split("");for(let X=0;X<40;X+=2){if(Q[X>>1]>>4>=8&&$[X])$[X]=$[X].toUpperCase();if((Q[X>>1]&15)>=8&&$[X+1])$[X+1]=$[X+1].toUpperCase()}let Z=`0x${$.join("")}`;return WW.set(`${D}.${F}`,Z),Z}function RD(D,F){if(!FD(D,{strict:!1}))throw new j0({address:D});return H2(D,F)}var WW;var Q1=x(()=>{nF();B0();g8();iF();z2();WW=new Z8(8192)});function FD(D,F){let{strict:J=!0}=F??{},Q=`${D}.${J}`;if(BW.has(Q))return BW.get(Q);let $=(()=>{if(!zo.test(D))return!1;if(D.toLowerCase()===D)return!0;if(J)return H2(D)===D;return!0})();return BW.set(Q,$),$}var zo,BW;var z2=x(()=>{iF();Q1();zo=/^0x[a-fA-F0-9]{40}$/,BW=new Z8(8192)});function nD(D){if(typeof D[0]==="string")return m8(D);return Co(D)}function Co(D){let F=0;for(let $ of D)F+=$.length;let J=new Uint8Array(F),Q=0;for(let $ of D)J.set($,Q),Q+=$.length;return J}function m8(D){return`0x${D.reduce((F,J)=>F+J.replace("0x",""),"")}`}function C2(D,F,J,{strict:Q}={}){if(e(D,{strict:!1}))return F$(D,F,J,{strict:Q});return KW(D,F,J,{strict:Q})}function SA(D,F){if(typeof F==="number"&&F>0&&F>GD(D)-1)throw new dQ({offset:F,position:"start",size:GD(D)})}function xA(D,F,J){if(typeof F==="number"&&typeof J==="number"&&GD(D)!==J-F)throw new dQ({offset:J,position:"end",size:GD(D)})}function KW(D,F,J,{strict:Q}={}){SA(D,F);let $=D.slice(F,J);if(Q)xA($,F,J);return $}function F$(D,F,J,{strict:Q}={}){SA(D,F);let $=`0x${D.replace("0x","").slice((F??0)*2,(J??D.length)*2)}`;if(Q)xA($,F,J);return $}var oF=x(()=>{cQ();z8()});var kA,J$;var UW=x(()=>{kA=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,J$=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function iD(D,F){if(D.length!==F.length)throw new iG({expectedLength:D.length,givenLength:F.length});let J=_o({params:D,values:F}),Q=HW(J);if(Q.length===0)return"0x";return Q}function _o({params:D,values:F}){let J=[];for(let Q=0;Q<D.length;Q++)J.push(VW({param:D[Q],value:F[Q]}));return J}function VW({param:D,value:F}){let J=Q$(D.type);if(J){let[Q,$]=J;return Mo(F,{length:Q,param:{...D,type:$}})}if(D.type==="tuple")return Io(F,{param:D});if(D.type==="address")return Oo(F);if(D.type==="bool")return Ro(F);if(D.type.startsWith("uint")||D.type.startsWith("int")){let Q=D.type.startsWith("int"),[,,$="256"]=J$.exec(D.type)??[];return Ao(F,{signed:Q,size:Number($)})}if(D.type.startsWith("bytes"))return Eo(F,{param:D});if(D.type==="string")return wo(F);throw new DW(D.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function HW(D){let F=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)F+=32;else F+=GD(Y)}let J=[],Q=[],$=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)J.push(k(F+$,{size:32})),Q.push(Y),$+=GD(Y);else J.push(Y)}return nD([...J,...Q])}function Oo(D){if(!FD(D))throw new j0({address:D});return{dynamic:!1,encoded:e2(D.toLowerCase())}}function Mo(D,{length:F,param:J}){let Q=F===null;if(!Array.isArray(D))throw new c9(D);if(!Q&&D.length!==F)throw new cG({expectedLength:F,givenLength:D.length,type:`${J.type}[${F}]`});let $=!1,Z=[];for(let X=0;X<D.length;X++){let Y=VW({param:J,value:D[X]});if(Y.dynamic)$=!0;Z.push(Y)}if(Q||$){let X=HW(Z);if(Q){let Y=k(Z.length,{size:32});return{dynamic:!0,encoded:Z.length>0?nD([Y,X]):Y}}if($)return{dynamic:!0,encoded:X}}return{dynamic:!1,encoded:nD(Z.map(({encoded:X})=>X))}}function Eo(D,{param:F}){let[,J]=F.type.split("bytes"),Q=GD(D);if(!J){let $=D;if(Q%32!==0)$=e2($,{dir:"right",size:Math.ceil((D.length-2)/2/32)*32});return{dynamic:!0,encoded:nD([e2(k(Q,{size:32})),$])}}if(Q!==Number.parseInt(J,10))throw new nG({expectedSize:Number.parseInt(J,10),value:D});return{dynamic:!1,encoded:e2(D,{dir:"right"})}}function Ro(D){if(typeof D!=="boolean")throw new P(`Invalid boolean value: "${D}" (type: ${typeof D}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:e2(o9(D))}}function Ao(D,{signed:F,size:J=256}){if(typeof J==="number"){let Q=2n**(BigInt(J)-(F?1n:0n))-1n,$=F?-Q-1n:0n;if(D>Q||D<$)throw new n9({max:Q.toString(),min:$.toString(),signed:F,size:J/8,value:D.toString()})}return{dynamic:!1,encoded:k(D,{size:32,signed:F})}}function wo(D){let F=G0(D),J=Math.ceil(GD(F)/32),Q=[];for(let $=0;$<J;$++)Q.push(e2(C2(F,$*32,($+1)*32),{dir:"right"}));return{dynamic:!0,encoded:nD([e2(k(GD(F),{size:32})),...Q])}}function Io(D,{param:F}){let J=!1,Q=[];for(let $=0;$<F.components.length;$++){let Z=F.components[$],X=Array.isArray(D)?$:Z.name,Y=VW({param:Z,value:D[X]});if(Q.push(Y),Y.dynamic)J=!0}return{dynamic:J,encoded:J?HW(Q):nD(Q.map(({encoded:$})=>$))}}function Q$(D){let F=D.match(/^(.*)\[(\d+)?\]$/);return F?[F[2]?Number(F[2]):null,F[1]]:void 0}var _2=x(()=>{gD();nF();s();i9();z2();nQ();z8();oF();c();UW()});var O2=(D)=>C2(D$(D),0,4);var _6=x(()=>{oF();GW()});function l0(D){let{abi:F,args:J=[],name:Q}=D,$=e(Q,{strict:!1}),Z=F.filter((Y)=>{if($){if(Y.type==="function")return O2(Y)===Q;if(Y.type==="event")return u1(Y)===Q;return!1}return"name"in Y&&Y.name===Q});if(Z.length===0)return;if(Z.length===1)return Z[0];let X;for(let Y of Z){if(!("inputs"in Y))continue;if(!J||J.length===0){if(!Y.inputs||Y.inputs.length===0)return Y;continue}if(!Y.inputs)continue;if(Y.inputs.length===0)continue;if(Y.inputs.length!==J.length)continue;if(J.every((G,W)=>{let B="inputs"in Y&&Y.inputs[W];if(!B)return!1;return zW(G,B)})){if(X&&"inputs"in X&&X.inputs){let G=yA(Y.inputs,X.inputs,J);if(G)throw new tG({abiItem:Y,type:G[0]},{abiItem:X,type:G[1]})}X=Y}}if(X)return X;return Z[0]}function zW(D,F){let J=typeof D,Q=F.type;switch(Q){case"address":return FD(D,{strict:!1});case"bool":return J==="boolean";case"function":return J==="string";case"string":return J==="string";default:{if(Q==="tuple"&&"components"in F)return Object.values(F.components).every(($,Z)=>{return J==="object"&&zW(Object.values(D)[Z],$)});if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(Q))return J==="number"||J==="bigint";if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(Q))return J==="string"||D instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(Q))return Array.isArray(D)&&D.every(($)=>zW($,{...F,type:Q.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}}function yA(D,F,J){for(let Q in D){let $=D[Q],Z=F[Q];if($.type==="tuple"&&Z.type==="tuple"&&"components"in $&&"components"in Z)return yA($.components,Z.components,J[Q]);let X=[$.type,Z.type];if((()=>{if(X.includes("address")&&X.includes("bytes20"))return!0;if(X.includes("address")&&X.includes("string"))return FD(J[Q],{strict:!1});if(X.includes("address")&&X.includes("bytes"))return FD(J[Q],{strict:!1});return!1})())return X}return}var g1=x(()=>{gD();z2();r9();_6()});function i(D){if(typeof D==="string")return{address:D,type:"json-rpc"};return D}function vA(D){let{abi:F,args:J,functionName:Q}=D,$=F[0];if(Q){let Z=l0({abi:F,args:J,name:Q});if(!Z)throw new K2(Q,{docsPath:bA});$=Z}if($.type!=="function")throw new K2(void 0,{docsPath:bA});return{abi:[$],functionName:O2(eD($))}}var bA="/docs/contract/encodeFunctionData";var uA=x(()=>{gD();_6();t2();g1()});function AD(D){let{args:F}=D,{abi:J,functionName:Q}=(()=>{if(D.abi.length===1&&D.functionName?.startsWith("0x"))return D;return vA(D)})(),$=J[0],Z=Q,X="inputs"in $&&$.inputs?iD($.inputs,F??[]):void 0;return m8([Z,X??"0x"])}var X8=x(()=>{_2();uA()});var gA,Z$,mA;var X$=x(()=>{gA={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Z$={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},mA={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});var Y$,s9,CW;var _W=x(()=>{s();Y$=class Y$ extends P{constructor({offset:D}){super(`Offset \`${D}\` cannot be negative.`,{name:"NegativeOffsetError"})}};s9=class s9 extends P{constructor({length:D,position:F}){super(`Position \`${F}\` is out of bounds (\`0 < position < ${D}\`).`,{name:"PositionOutOfBoundsError"})}};CW=class CW extends P{constructor({count:D,limit:F}){super(`Recursive read limit of \`${F}\` exceeded (recursive read count: \`${D}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function O6(D,{recursiveReadLimit:F=8192}={}){let J=Object.create(No);return J.bytes=D,J.dataView=new DataView(D.buffer??D,D.byteOffset,D.byteLength),J.positionReadCount=new Map,J.recursiveReadLimit=F,J}var No;var q$=x(()=>{_W();No={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new CW({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(D){if(D<0||D>this.bytes.length-1)throw new s9({length:this.bytes.length,position:D})},decrementPosition(D){if(D<0)throw new Y$({offset:D});let F=this.position-D;this.assertPosition(F),this.position=F},getReadCount(D){return this.positionReadCount.get(D||this.position)||0},incrementPosition(D){if(D<0)throw new Y$({offset:D});let F=this.position+D;this.assertPosition(F),this.position=F},inspectByte(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectBytes(D,F){let J=F??this.position;return this.assertPosition(J+D-1),this.bytes.subarray(J,J+D)},inspectUint8(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectUint16(D){let F=D??this.position;return this.assertPosition(F+1),this.dataView.getUint16(F)},inspectUint24(D){let F=D??this.position;return this.assertPosition(F+2),(this.dataView.getUint16(F)<<8)+this.dataView.getUint8(F+2)},inspectUint32(D){let F=D??this.position;return this.assertPosition(F+3),this.dataView.getUint32(F)},pushByte(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushBytes(D){this.assertPosition(this.position+D.length-1),this.bytes.set(D,this.position),this.position+=D.length},pushUint8(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushUint16(D){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,D),this.position+=2},pushUint24(D){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,D>>8),this.dataView.setUint8(this.position+2,D&255),this.position+=3},pushUint32(D){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,D),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let D=this.inspectByte();return this.position++,D},readBytes(D,F){this.assertReadLimit(),this._touch();let J=this.inspectBytes(D);return this.position+=F??D,J},readUint8(){this.assertReadLimit(),this._touch();let D=this.inspectUint8();return this.position+=1,D},readUint16(){this.assertReadLimit(),this._touch();let D=this.inspectUint16();return this.position+=2,D},readUint24(){this.assertReadLimit(),this._touch();let D=this.inspectUint24();return this.position+=3,D},readUint32(){this.assertReadLimit(),this._touch();let D=this.inspectUint32();return this.position+=4,D},get remaining(){return this.bytes.length-this.position},setPosition(D){let F=this.position;return this.assertPosition(D),this.position=D,()=>this.position=F},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let D=this.getReadCount();if(this.positionReadCount.set(this.position,D+1),D>0)this.recursiveReadCount++}}});function dA(D,F={}){if(typeof F.size<"u")p0(D,{size:F.size});let J=BD(D,F);return kD(J,F)}function pA(D,F={}){let J=D;if(typeof F.size<"u")p0(J,{size:F.size}),J=$8(J);if(J.length>1||J[0]>1)throw new QW(J);return Boolean(J[0])}function E2(D,F={}){if(typeof F.size<"u")p0(D,{size:F.size});let J=BD(D,F);return OD(J,F)}function lA(D,F={}){let J=D;if(typeof F.size<"u")p0(J,{size:F.size}),J=$8(J,{dir:"right"});return new TextDecoder().decode(J)}var cA=x(()=>{i9();D0();c()});function $1(D,F){let J=typeof F==="string"?W0(F):F,Q=O6(J);if(GD(J)===0&&D.length>0)throw new b8;if(GD(F)&&GD(F)<32)throw new d9({data:typeof F==="string"?F:BD(F),params:D,size:GD(F)});let $=0,Z=[];for(let X=0;X<D.length;++X){let Y=D[X];Q.setPosition($);let[q,G]=M6(Q,Y,{staticPosition:0});$+=G,Z.push(q)}return Z}function M6(D,F,{staticPosition:J}){let Q=Q$(F.type);if(Q){let[$,Z]=Q;return Lo(D,{...F,type:Z},{length:$,staticPosition:J})}if(F.type==="tuple")return xo(D,F,{staticPosition:J});if(F.type==="address")return To(D);if(F.type==="bool")return Po(D);if(F.type.startsWith("bytes"))return jo(D,F,{staticPosition:J});if(F.type.startsWith("uint")||F.type.startsWith("int"))return So(D,F);if(F.type==="string")return ko(D,{staticPosition:J});throw new FW(F.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function To(D){let F=D.readBytes(32);return[H2(BD(KW(F,-20))),32]}function Lo(D,F,{length:J,staticPosition:Q}){if(!J){let X=E2(D.readBytes(OW)),Y=Q+X,q=Y+nA;D.setPosition(Y);let G=E2(D.readBytes(nA)),W=t9(F),B=0,K=[];for(let U=0;U<G;++U){D.setPosition(q+(W?U*32:B));let[V,H]=M6(D,F,{staticPosition:q});B+=H,K.push(V)}return D.setPosition(Q+32),[K,32]}if(t9(F)){let X=E2(D.readBytes(OW)),Y=Q+X,q=[];for(let G=0;G<J;++G){D.setPosition(Y+G*32);let[W]=M6(D,F,{staticPosition:Y});q.push(W)}return D.setPosition(Q+32),[q,32]}let $=0,Z=[];for(let X=0;X<J;++X){let[Y,q]=M6(D,F,{staticPosition:Q+$});$+=q,Z.push(Y)}return[Z,$]}function Po(D){return[pA(D.readBytes(32),{size:32}),32]}function jo(D,F,{staticPosition:J}){let[Q,$]=F.type.split("bytes");if(!$){let X=E2(D.readBytes(32));D.setPosition(J+X);let Y=E2(D.readBytes(32));if(Y===0)return D.setPosition(J+32),["0x",32];let q=D.readBytes(Y);return D.setPosition(J+32),[BD(q),32]}return[BD(D.readBytes(Number.parseInt($,10),32)),32]}function So(D,F){let J=F.type.startsWith("int"),Q=Number.parseInt(F.type.split("int")[1]||"256",10),$=D.readBytes(32);return[Q>48?dA($,{signed:J}):E2($,{signed:J}),32]}function xo(D,F,{staticPosition:J}){let Q=F.components.length===0||F.components.some(({name:X})=>!X),$=Q?[]:{},Z=0;if(t9(F)){let X=E2(D.readBytes(OW)),Y=J+X;for(let q=0;q<F.components.length;++q){let G=F.components[q];D.setPosition(Y+Z);let[W,B]=M6(D,G,{staticPosition:Y});Z+=B,$[Q?q:G?.name]=W}return D.setPosition(J+32),[$,32]}for(let X=0;X<F.components.length;++X){let Y=F.components[X],[q,G]=M6(D,Y,{staticPosition:J});$[Q?X:Y?.name]=q,Z+=G}return[$,Z]}function ko(D,{staticPosition:F}){let J=E2(D.readBytes(32)),Q=F+J;D.setPosition(Q);let $=E2(D.readBytes(32));if($===0)return D.setPosition(F+32),["",32];let Z=D.readBytes($,32),X=lA($8(Z));return D.setPosition(F+32),[X,32]}function t9(D){let{type:F}=D;if(F==="string")return!0;if(F==="bytes")return!0;if(F.endsWith("[]"))return!0;if(F==="tuple")return D.components?.some(t9);let J=Q$(D.type);if(J&&t9({...D,type:J[1]}))return!0;return!1}var nA=32,OW=32;var e9=x(()=>{gD();Q1();q$();z8();oF();cA();B0();c();_2()});function G$(D){let{abi:F,data:J}=D,Q=C2(J,0,4);if(Q==="0x")throw new b8;let Z=[...F||[],Z$,mA].find((X)=>X.type==="error"&&Q===O2(eD(X)));if(!Z)throw new p9(Q,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:Z,args:"inputs"in Z&&Z.inputs&&Z.inputs.length>0?$1(Z.inputs,C2(J,4)):void 0,errorName:Z.name}}var MW=x(()=>{X$();gD();oF();_6();e9();t2()});var qD=(D,F,J)=>JSON.stringify(D,(Q,$)=>{let Z=typeof $==="bigint"?$.toString():$;return typeof F==="function"?F(Q,Z):Z},J);function EW({abiItem:D,args:F,includeFunctionName:J=!0,includeName:Q=!1}){if(!("name"in D))return;if(!("inputs"in D))return;if(!D.inputs)return;return`${J?D.name:""}(${D.inputs.map(($,Z)=>`${Q&&$.name?`${$.name}: `:""}${typeof F[Z]==="object"?qD(F[Z]):F[Z]}`).join(", ")})`}var iA=()=>{};var oA,aA;var RW=x(()=>{oA={gwei:9,wei:18},aA={ether:-9,wei:9}});function d8(D,F){let J=D.toString(),Q=J.startsWith("-");if(Q)J=J.slice(1);J=J.padStart(F,"0");let[$,Z]=[J.slice(0,J.length-F),J.slice(J.length-F)];return Z=Z.replace(/(0+)$/,""),`${Q?"-":""}${$||"0"}${Z?`.${Z}`:""}`}function E6(D,F="wei"){return d8(D,oA[F])}var W$=x(()=>{RW()});function F0(D,F="wei"){return d8(D,aA[F])}var R6=x(()=>{RW()});function rA(D){return D.reduce((F,{slot:J,value:Q})=>{return`${F} ${J}: ${Q}
|
|
54
|
+
`},"")}function sA(D){return D.reduce((F,{address:J,...Q})=>{let $=`${F} ${J}:
|
|
55
|
+
`;if(Q.nonce)$+=` nonce: ${Q.nonce}
|
|
56
|
+
`;if(Q.balance)$+=` balance: ${Q.balance}
|
|
57
|
+
`;if(Q.code)$+=` code: ${Q.code}
|
|
58
|
+
`;if(Q.state)$+=` state:
|
|
59
|
+
`,$+=rA(Q.state);if(Q.stateDiff)$+=` stateDiff:
|
|
60
|
+
`,$+=rA(Q.stateDiff);return $},` State Override:
|
|
61
|
+
`).slice(0,-1)}var AW,wW;var IW=x(()=>{s();AW=class AW extends P{constructor({address:D}){super(`State for account "${D}" is set multiple times.`,{name:"AccountStateConflictError"})}};wW=class wW extends P{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}});function aF(D){let F=Object.entries(D).map(([Q,$])=>{if($===void 0||$===!1)return null;return[Q,$]}).filter(Boolean),J=F.reduce((Q,[$])=>Math.max(Q,$.length),0);return F.map(([Q,$])=>` ${`${Q}:`.padEnd(J+1)} ${$}`).join(`
|
|
62
|
+
`)}var NW,TW,D4,F4,J4,LW;var R2=x(()=>{W$();R6();s();NW=class NW extends P{constructor({transaction:D}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",aF(D),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}};TW=class TW extends P{constructor(D,{account:F,docsPath:J,chain:Q,data:$,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:W,value:B}){let K=aF({chain:Q&&`${Q?.name} (id: ${Q?.id})`,from:F?.address,to:W,value:typeof B<"u"&&`${E6(B)} ${Q?.nativeCurrency?.symbol||"ETH"}`,data:$,gas:Z,gasPrice:typeof X<"u"&&`${F0(X)} gwei`,maxFeePerGas:typeof Y<"u"&&`${F0(Y)} gwei`,maxPriorityFeePerGas:typeof q<"u"&&`${F0(q)} gwei`,nonce:G});super(D.shortMessage,{cause:D,docsPath:J,metaMessages:[...D.metaMessages?[...D.metaMessages," "]:[],"Request Arguments:",K].filter(Boolean),name:"TransactionExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=D}};D4=class D4 extends P{constructor({blockHash:D,blockNumber:F,blockTag:J,hash:Q,index:$}){let Z="Transaction";if(J&&$!==void 0)Z=`Transaction at block time "${J}" at index "${$}"`;if(D&&$!==void 0)Z=`Transaction at block hash "${D}" at index "${$}"`;if(F&&$!==void 0)Z=`Transaction at block number "${F}" at index "${$}"`;if(Q)Z=`Transaction with hash "${Q}"`;super(`${Z} could not be found.`,{name:"TransactionNotFoundError"})}};F4=class F4 extends P{constructor({hash:D}){super(`Transaction receipt with hash "${D}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}};J4=class J4 extends P{constructor({receipt:D}){super(`Transaction with hash "${D.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"});Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=D}};LW=class LW extends P{constructor({hash:D}){super(`Timed out while waiting for transaction with hash "${D}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}});var tA=(D)=>D,rF=(D)=>D;var A6,w6,A2,B$,K$,w2;var Z1=x(()=>{X$();MW();t2();iA();g1();W$();R6();gD();s();IW();R2();A6=class A6 extends P{constructor(D,{account:F,docsPath:J,chain:Q,data:$,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:W,value:B,stateOverride:K}){let U=F?i(F):void 0,V=aF({from:U?.address,to:W,value:typeof B<"u"&&`${E6(B)} ${Q?.nativeCurrency?.symbol||"ETH"}`,data:$,gas:Z,gasPrice:typeof X<"u"&&`${F0(X)} gwei`,maxFeePerGas:typeof Y<"u"&&`${F0(Y)} gwei`,maxPriorityFeePerGas:typeof q<"u"&&`${F0(q)} gwei`,nonce:G});if(K)V+=`
|
|
63
|
+
${sA(K)}`;super(D.shortMessage,{cause:D,docsPath:J,metaMessages:[...D.metaMessages?[...D.metaMessages," "]:[],"Raw Call Arguments:",V].filter(Boolean),name:"CallExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=D}};w6=class w6 extends P{constructor(D,{abi:F,args:J,contractAddress:Q,docsPath:$,functionName:Z,sender:X}){let Y=l0({abi:F,args:J,name:Z}),q=Y?EW({abiItem:Y,args:J,includeFunctionName:!1,includeName:!1}):void 0,G=Y?eD(Y,{includeName:!0}):void 0,W=aF({address:Q&&tA(Q),function:G,args:q&&q!=="()"&&`${[...Array(Z?.length??0).keys()].map(()=>" ").join("")}${q}`,sender:X});super(D.shortMessage||`An unknown error occurred while executing the contract function "${Z}".`,{cause:D,docsPath:$,metaMessages:[...D.metaMessages?[...D.metaMessages," "]:[],W&&"Contract Call:",W].filter(Boolean),name:"ContractFunctionExecutionError"});Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=F,this.args=J,this.cause=D,this.contractAddress=Q,this.functionName=Z,this.sender=X}};A2=class A2 extends P{constructor({abi:D,data:F,functionName:J,message:Q}){let $,Z,X,Y;if(F&&F!=="0x")try{Z=G$({abi:D,data:F});let{abiItem:G,errorName:W,args:B}=Z;if(W==="Error")Y=B[0];else if(W==="Panic"){let[K]=B;Y=gA[K]}else{let K=G?eD(G,{includeName:!0}):void 0,U=G&&B?EW({abiItem:G,args:B,includeFunctionName:!1,includeName:!1}):void 0;X=[K?`Error: ${K}`:"",U&&U!=="()"?` ${[...Array(W?.length??0).keys()].map(()=>" ").join("")}${U}`:""]}}catch(G){$=G}else if(Q)Y=Q;let q;if($ instanceof p9)q=$.signature,X=[`Unable to decode signature "${q}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${q}.`];super(Y&&Y!=="execution reverted"||q?[`The contract function "${J}" reverted with the following ${q?"signature":"reason"}:`,Y||q].join(`
|
|
64
|
+
`):`The contract function "${J}" reverted.`,{cause:$,metaMessages:X,name:"ContractFunctionRevertedError"});Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=Z,this.raw=F,this.reason=Y,this.signature=q}};B$=class B$ extends P{constructor({functionName:D}){super(`The contract function "${D}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${D}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}};K$=class K$ extends P{constructor({factory:D}){super(`Deployment for counterfactual contract call failed${D?` for factory "${D}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}};w2=class w2 extends P{constructor({data:D,message:F}){super(F||"",{name:"RawContractError"});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=D}}});var p8,sF,U$;var tF=x(()=>{s();p8=class p8 extends P{constructor({body:D,cause:F,details:J,headers:Q,status:$,url:Z}){super("HTTP request failed.",{cause:F,details:J,metaMessages:[$&&`Status: ${$}`,`URL: ${rF(Z)}`,D&&`Request body: ${qD(D)}`].filter(Boolean),name:"HttpRequestError"});Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=D,this.headers=Q,this.status=$,this.url=Z}};sF=class sF extends P{constructor({body:D,error:F,url:J}){super("RPC Request failed.",{cause:F,details:F.message,metaMessages:[`URL: ${rF(J)}`,`Request body: ${qD(D)}`],name:"RpcRequestError"});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=F.code,this.data=F.data,this.url=J}};U$=class U$ extends P{constructor({body:D,url:F}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${rF(F)}`,`Request body: ${qD(D)}`],name:"TimeoutError"});Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=F}}});var yo=-1,S0,c0,I6,N6,T6,L6,X1,_8,P6,j6,S6,d1,eF,x6,D3,k6,y6,f6,h6,b6,p1,v6,u6,g6,m6,d6,l1,PW;var p6=x(()=>{s();tF();S0=class S0 extends P{constructor(D,{code:F,docsPath:J,metaMessages:Q,name:$,shortMessage:Z}){super(Z,{cause:D,docsPath:J,metaMessages:Q||D?.metaMessages,name:$||"RpcError"});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=$||D.name,this.code=D instanceof sF?D.code:F??yo}};c0=class c0 extends S0{constructor(D,F){super(D,F);Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=F.data}};I6=class I6 extends S0{constructor(D){super(D,{code:I6.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(I6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});N6=class N6 extends S0{constructor(D){super(D,{code:N6.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(N6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});T6=class T6 extends S0{constructor(D,{method:F}={}){super(D,{code:T6.code,name:"MethodNotFoundRpcError",shortMessage:`The method${F?` "${F}"`:""} does not exist / is not available.`})}};Object.defineProperty(T6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});L6=class L6 extends S0{constructor(D){super(D,{code:L6.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
65
|
+
`)})}};Object.defineProperty(L6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});X1=class X1 extends S0{constructor(D){super(D,{code:X1.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(X1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});_8=class _8 extends S0{constructor(D){super(D,{code:_8.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
66
|
+
`)})}};Object.defineProperty(_8,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32000});P6=class P6 extends S0{constructor(D){super(D,{code:P6.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(P6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});j6=class j6 extends S0{constructor(D){super(D,{code:j6.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(j6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});S6=class S6 extends S0{constructor(D){super(D,{code:S6.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(S6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});d1=class d1 extends S0{constructor(D,{method:F}={}){super(D,{code:d1.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${F?` "${F}"`:""} is not supported.`})}};Object.defineProperty(d1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});eF=class eF extends S0{constructor(D){super(D,{code:eF.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(eF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});x6=class x6 extends S0{constructor(D){super(D,{code:x6.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(x6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});D3=class D3 extends c0{constructor(D){super(D,{code:D3.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(D3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});k6=class k6 extends c0{constructor(D){super(D,{code:k6.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(k6,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});y6=class y6 extends c0{constructor(D,{method:F}={}){super(D,{code:y6.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${F?` " ${F}"`:""}.`})}};Object.defineProperty(y6,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});f6=class f6 extends c0{constructor(D){super(D,{code:f6.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(f6,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});h6=class h6 extends c0{constructor(D){super(D,{code:h6.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(h6,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});b6=class b6 extends c0{constructor(D){super(D,{code:b6.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(b6,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});p1=class p1 extends c0{constructor(D){super(D,{code:p1.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};Object.defineProperty(p1,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});v6=class v6 extends c0{constructor(D){super(D,{code:v6.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};Object.defineProperty(v6,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});u6=class u6 extends c0{constructor(D){super(D,{code:u6.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};Object.defineProperty(u6,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});g6=class g6 extends c0{constructor(D){super(D,{code:g6.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};Object.defineProperty(g6,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});m6=class m6 extends c0{constructor(D){super(D,{code:m6.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};Object.defineProperty(m6,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});d6=class d6 extends c0{constructor(D){super(D,{code:d6.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};Object.defineProperty(d6,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});l1=class l1 extends c0{constructor(D){super(D,{code:l1.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};Object.defineProperty(l1,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});PW=class PW extends S0{constructor(D){super(D,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}});function ho(D,F,J,Q){if(typeof D.setBigUint64==="function")return D.setBigUint64(F,J,Q);let $=BigInt(32),Z=BigInt(4294967295),X=Number(J>>$&Z),Y=Number(J&Z),q=Q?4:0,G=Q?0:4;D.setUint32(F+q,X,Q),D.setUint32(F+G,Y,Q)}function Dw(D,F,J){return D&F^~D&J}function Fw(D,F,J){return D&F^D&J^F&J}var jW,Y1;var Jw=x(()=>{v1();jW=class jW extends cF{constructor(D,F,J,Q){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=D,this.outputLen=F,this.padOffset=J,this.isLE=Q,this.buffer=new Uint8Array(D),this.view=rQ(this.buffer)}update(D){J1(this),D=lF(D),U2(D);let{view:F,buffer:J,blockLen:Q}=this,$=D.length;for(let Z=0;Z<$;){let X=Math.min(Q-this.pos,$-Z);if(X===Q){let Y=rQ(D);for(;Q<=$-Z;Z+=Q)this.process(Y,Z);continue}if(J.set(D.subarray(Z,Z+X),this.pos),this.pos+=X,Z+=X,this.pos===Q)this.process(F,0),this.pos=0}return this.length+=D.length,this.roundClean(),this}digestInto(D){J1(this),aQ(D,this),this.finished=!0;let{buffer:F,view:J,blockLen:Q,isLE:$}=this,{pos:Z}=this;if(F[Z++]=128,V2(this.buffer.subarray(Z)),this.padOffset>Q-Z)this.process(J,0),Z=0;for(let W=Z;W<Q;W++)F[W]=0;ho(J,Q-8,BigInt(this.length*8),$),this.process(J,0);let X=rQ(D),Y=this.outputLen;if(Y%4)throw Error("_sha2: outputLen should be aligned to 32bit");let q=Y/4,G=this.get();if(q>G.length)throw Error("_sha2: outputLen bigger than state");for(let W=0;W<q;W++)X.setUint32(4*W,G[W],$)}digest(){let{buffer:D,outputLen:F}=this;this.digestInto(D);let J=D.slice(0,F);return this.destroy(),J}_cloneInto(D){D||(D=new this.constructor),D.set(...this.get());let{blockLen:F,buffer:J,length:Q,finished:$,destroyed:Z,pos:X}=this;if(D.destroyed=Z,D.finished=$,D.length=Q,D.pos=X,Q%F)D.buffer.set(J);return D}clone(){return this._cloneInto()}};Y1=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var bo,c1,SW,F3;var xW=x(()=>{Jw();v1();bo=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c1=new Uint32Array(64);SW=class SW extends jW{constructor(D=32){super(64,D,8,!1);this.A=Y1[0]|0,this.B=Y1[1]|0,this.C=Y1[2]|0,this.D=Y1[3]|0,this.E=Y1[4]|0,this.F=Y1[5]|0,this.G=Y1[6]|0,this.H=Y1[7]|0}get(){let{A:D,B:F,C:J,D:Q,E:$,F:Z,G:X,H:Y}=this;return[D,F,J,Q,$,Z,X,Y]}set(D,F,J,Q,$,Z,X,Y){this.A=D|0,this.B=F|0,this.C=J|0,this.D=Q|0,this.E=$|0,this.F=Z|0,this.G=X|0,this.H=Y|0}process(D,F){for(let W=0;W<16;W++,F+=4)c1[W]=D.getUint32(F,!1);for(let W=16;W<64;W++){let B=c1[W-15],K=c1[W-2],U=u8(B,7)^u8(B,18)^B>>>3,V=u8(K,17)^u8(K,19)^K>>>10;c1[W]=V+c1[W-7]+U+c1[W-16]|0}let{A:J,B:Q,C:$,D:Z,E:X,F:Y,G:q,H:G}=this;for(let W=0;W<64;W++){let B=u8(X,6)^u8(X,11)^u8(X,25),K=G+B+Dw(X,Y,q)+bo[W]+c1[W]|0,V=(u8(J,2)^u8(J,13)^u8(J,22))+Fw(J,Q,$)|0;G=q,q=Y,Y=X,X=Z+K|0,Z=$,$=Q,Q=J,J=K+V|0}J=J+this.A|0,Q=Q+this.B|0,$=$+this.C|0,Z=Z+this.D|0,X=X+this.E|0,Y=Y+this.F|0,q=q+this.G|0,G=G+this.H|0,this.set(J,Q,$,Z,X,Y,q,G)}roundClean(){V2(c1)}destroy(){this.set(0,0,0,0,0,0,0,0),V2(this.buffer)}};F3=sQ(()=>new SW)});var kW,yW=(D,F,J)=>new kW(D,F).update(J).digest();var Qw=x(()=>{v1();kW=class kW extends cF{constructor(D,F){super();this.finished=!1,this.destroyed=!1,zA(D);let J=lF(F);if(this.iHash=D.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let Q=this.blockLen,$=new Uint8Array(Q);$.set(J.length>Q?D.create().update(J).digest():J);for(let Z=0;Z<$.length;Z++)$[Z]^=54;this.iHash.update($),this.oHash=D.create();for(let Z=0;Z<$.length;Z++)$[Z]^=106;this.oHash.update($),V2($)}update(D){return J1(this),this.iHash.update(D),this}digestInto(D){J1(this),U2(D,this.outputLen),this.finished=!0,this.iHash.digestInto(D),this.oHash.update(D),this.oHash.digestInto(D),this.destroy()}digest(){let D=new Uint8Array(this.oHash.outputLen);return this.digestInto(D),D}_cloneInto(D){D||(D=Object.create(Object.getPrototypeOf(this),{}));let{oHash:F,iHash:J,finished:Q,destroyed:$,blockLen:Z,outputLen:X}=this;return D=D,D.finished=Q,D.destroyed=$,D.blockLen=Z,D.outputLen=X,D.oHash=F._cloneInto(D.oHash),D.iHash=J._cloneInto(D.iHash),D}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};yW.create=(D,F)=>new kW(D,F)});function l6(D){return D instanceof Uint8Array||ArrayBuffer.isView(D)&&D.constructor.name==="Uint8Array"}function G1(D){if(!l6(D))throw Error("Uint8Array expected")}function c6(D,F){if(typeof F!=="boolean")throw Error(D+" boolean expected, got "+F)}function Q4(D){let F=D.toString(16);return F.length&1?"0"+F:F}function Xw(D){if(typeof D!=="string")throw Error("hex string expected, got "+typeof D);return D===""?vW:BigInt("0x"+D)}function n6(D){if(G1(D),Yw)return D.toHex();let F="";for(let J=0;J<D.length;J++)F+=vo[D[J]];return F}function $w(D){if(D>=q1._0&&D<=q1._9)return D-q1._0;if(D>=q1.A&&D<=q1.F)return D-(q1.A-10);if(D>=q1.a&&D<=q1.f)return D-(q1.a-10);return}function $4(D){if(typeof D!=="string")throw Error("hex string expected, got "+typeof D);if(Yw)return Uint8Array.fromHex(D);let F=D.length,J=F/2;if(F%2)throw Error("hex string expected, got unpadded hex of length "+F);let Q=new Uint8Array(J);for(let $=0,Z=0;$<J;$++,Z+=2){let X=$w(D.charCodeAt(Z)),Y=$w(D.charCodeAt(Z+1));if(X===void 0||Y===void 0){let q=D[Z]+D[Z+1];throw Error('hex string expected, got non-hex character "'+q+'" at index '+Z)}Q[$]=X*16+Y}return Q}function n0(D){return Xw(n6(D))}function uW(D){return G1(D),Xw(n6(Uint8Array.from(D).reverse()))}function I2(D,F){return $4(D.toString(16).padStart(F*2,"0"))}function gW(D,F){return I2(D,F).reverse()}function oD(D,F,J){let Q;if(typeof F==="string")try{Q=$4(F)}catch(Z){throw Error(D+" must be hex string or Uint8Array, cause: "+Z)}else if(l6(F))Q=Uint8Array.from(F);else throw Error(D+" must be hex string or Uint8Array");let $=Q.length;if(typeof J==="number"&&$!==J)throw Error(D+" of length "+J+" expected, got "+$);return Q}function x0(...D){let F=0;for(let Q=0;Q<D.length;Q++){let $=D[Q];G1($),F+=$.length}let J=new Uint8Array(F);for(let Q=0,$=0;Q<D.length;Q++){let Z=D[Q];J.set(Z,$),$+=Z.length}return J}function V$(D){if(typeof D!=="string")throw Error("string expected");return new Uint8Array(new TextEncoder().encode(D))}function J3(D,F,J){return fW(D)&&fW(F)&&fW(J)&&F<=D&&D<J}function W1(D,F,J,Q){if(!J3(F,J,Q))throw Error("expected valid "+D+": "+J+" <= n < "+Q+", got "+F)}function qw(D){let F;for(F=0;D>vW;D>>=bW,F+=1);return F}function Gw(D,F,J){if(typeof D!=="number"||D<2)throw Error("hashLen must be a number");if(typeof F!=="number"||F<2)throw Error("qByteLen must be a number");if(typeof J!=="function")throw Error("hmacFn must be a function");let Q=hW(D),$=hW(D),Z=0,X=()=>{Q.fill(1),$.fill(0),Z=0},Y=(...B)=>J($,Q,...B),q=(B=hW(0))=>{if($=Y(Zw([0]),B),Q=Y(),B.length===0)return;$=Y(Zw([1]),B),Q=Y()},G=()=>{if(Z++>=1000)throw Error("drbg: tried 1000 values");let B=0,K=[];while(B<F){Q=Y();let U=Q.slice();K.push(U),B+=Q.length}return x0(...K)};return(B,K)=>{X(),q(B);let U=void 0;while(!(U=K(G())))q();return X(),U}}function B1(D,F,J={}){let Q=($,Z,X)=>{let Y=uo[Z];if(typeof Y!=="function")throw Error("invalid validator function");let q=D[$];if(X&&q===void 0)return;if(!Y(q,D))throw Error("param "+String($)+" is invalid. Expected "+Z+", got "+q)};for(let[$,Z]of Object.entries(F))Q($,Z,!1);for(let[$,Z]of Object.entries(J))Q($,Z,!0);return D}function mW(D){let F=new WeakMap;return(J,...Q)=>{let $=F.get(J);if($!==void 0)return $;let Z=D(J,...Q);return F.set(J,Z),Z}}var vW,bW,Yw,vo,q1,fW=(D)=>typeof D==="bigint"&&vW<=D,Q3=(D)=>(bW<<BigInt(D))-bW,hW=(D)=>new Uint8Array(D),Zw=(D)=>Uint8Array.from(D),uo;var i6=x(()=>{/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */vW=BigInt(0),bW=BigInt(1);Yw=typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function",vo=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"));q1={_0:48,_9:57,A:65,F:70,a:97,f:102};uo={bigint:(D)=>typeof D==="bigint",function:(D)=>typeof D==="function",boolean:(D)=>typeof D==="boolean",string:(D)=>typeof D==="string",stringOrUint8Array:(D)=>typeof D==="string"||l6(D),isSafeInteger:(D)=>Number.isSafeInteger(D),array:(D)=>Array.isArray(D),field:(D,F)=>F.Fp.isValid(D),hash:(D)=>typeof D==="function"&&Number.isSafeInteger(D.outputLen)}});function mD(D,F){let J=D%F;return J>=k0?J:F+J}function q8(D,F,J){let Q=D;while(F-- >k0)Q*=Q,Q%=J;return Q}function H$(D,F){if(D===k0)throw Error("invert: expected non-zero number");if(F<=k0)throw Error("invert: expected positive modulus, got "+F);let J=mD(D,F),Q=F,$=k0,Z=O0,X=O0,Y=k0;while(J!==k0){let G=Q/J,W=Q%J,B=$-X*G,K=Z-Y*G;Q=J,J=W,$=X,Z=Y,X=B,Y=K}if(Q!==O0)throw Error("invert: does not exist");return mD($,F)}function Vw(D,F){let J=(D.ORDER+O0)/Bw,Q=D.pow(F,J);if(!D.eql(D.sqr(Q),F))throw Error("Cannot find square root");return Q}function mo(D,F){let J=(D.ORDER-Kw)/Uw,Q=D.mul(F,$3),$=D.pow(Q,J),Z=D.mul(F,$),X=D.mul(D.mul(Z,$3),$),Y=D.mul(Z,D.sub(X,D.ONE));if(!D.eql(D.sqr(Y),F))throw Error("Cannot find square root");return Y}function po(D){if(D<BigInt(3))throw Error("sqrt is not defined for small field");let F=D-O0,J=0;while(F%$3===k0)F/=$3,J++;let Q=$3,$=Z4(D);while(Ww($,Q)===1)if(Q++>1000)throw Error("Cannot find square root: probably non-prime P");if(J===1)return Vw;let Z=$.pow(Q,F),X=(F+O0)/$3;return function(q,G){if(q.is0(G))return G;if(Ww(q,G)!==1)throw Error("Cannot find square root");let W=J,B=q.mul(q.ONE,Z),K=q.pow(G,F),U=q.pow(G,X);while(!q.eql(K,q.ONE)){if(q.is0(K))return q.ZERO;let V=1,H=q.sqr(K);while(!q.eql(H,q.ONE))if(V++,H=q.sqr(H),V===W)throw Error("Cannot find square root");let z=O0<<BigInt(W-V-1),_=q.pow(B,z);W=V,B=q.sqr(_),K=q.mul(K,B),U=q.mul(U,_)}return U}}function lo(D){if(D%Bw===go)return Vw;if(D%Uw===Kw)return mo;return po(D)}function z$(D){let F={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},J=co.reduce((Q,$)=>{return Q[$]="function",Q},F);return B1(D,J)}function no(D,F,J){if(J<k0)throw Error("invalid exponent, negatives unsupported");if(J===k0)return D.ONE;if(J===O0)return F;let Q=D.ONE,$=F;while(J>k0){if(J&O0)Q=D.mul(Q,$);$=D.sqr($),J>>=O0}return Q}function o6(D,F,J=!1){let Q=Array(F.length).fill(J?D.ZERO:void 0),$=F.reduce((X,Y,q)=>{if(D.is0(Y))return X;return Q[q]=X,D.mul(X,Y)},D.ONE),Z=D.inv($);return F.reduceRight((X,Y,q)=>{if(D.is0(Y))return X;return Q[q]=D.mul(X,Q[q]),D.mul(X,Y)},Z),Q}function Ww(D,F){let J=(D.ORDER-O0)/$3,Q=D.pow(F,J),$=D.eql(Q,D.ONE),Z=D.eql(Q,D.ZERO),X=D.eql(Q,D.neg(D.ONE));if(!$&&!Z&&!X)throw Error("invalid Legendre symbol result");return $?1:Z?0:-1}function dW(D,F){if(F!==void 0)pF(F);let J=F!==void 0?F:D.toString(2).length,Q=Math.ceil(J/8);return{nBitLength:J,nByteLength:Q}}function Z4(D,F,J=!1,Q={}){if(D<=k0)throw Error("invalid field: expected ORDER > 0, got "+D);let{nBitLength:$,nByteLength:Z}=dW(D,F);if(Z>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let X,Y=Object.freeze({ORDER:D,isLE:J,BITS:$,BYTES:Z,MASK:Q3($),ZERO:k0,ONE:O0,create:(q)=>mD(q,D),isValid:(q)=>{if(typeof q!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof q);return k0<=q&&q<D},is0:(q)=>q===k0,isOdd:(q)=>(q&O0)===O0,neg:(q)=>mD(-q,D),eql:(q,G)=>q===G,sqr:(q)=>mD(q*q,D),add:(q,G)=>mD(q+G,D),sub:(q,G)=>mD(q-G,D),mul:(q,G)=>mD(q*G,D),pow:(q,G)=>no(Y,q,G),div:(q,G)=>mD(q*H$(G,D),D),sqrN:(q)=>q*q,addN:(q,G)=>q+G,subN:(q,G)=>q-G,mulN:(q,G)=>q*G,inv:(q)=>H$(q,D),sqrt:Q.sqrt||((q)=>{if(!X)X=lo(D);return X(Y,q)}),toBytes:(q)=>J?gW(q,Z):I2(q,Z),fromBytes:(q)=>{if(q.length!==Z)throw Error("Field.fromBytes: expected "+Z+" bytes, got "+q.length);return J?uW(q):n0(q)},invertBatch:(q)=>o6(Y,q),cmov:(q,G,W)=>W?G:q});return Object.freeze(Y)}function Hw(D){if(typeof D!=="bigint")throw Error("field order must be bigint");let F=D.toString(2).length;return Math.ceil(F/8)}function pW(D){let F=Hw(D);return F+Math.ceil(F/2)}function zw(D,F,J=!1){let Q=D.length,$=Hw(F),Z=pW(F);if(Q<16||Q<Z||Q>1024)throw Error("expected "+Z+"-1024 bytes of input, got "+Q);let X=J?uW(D):n0(D),Y=mD(X,F-O0)+O0;return J?gW(Y,$):I2(Y,$)}var k0,O0,$3,go,Bw,Kw,Uw,co;var X4=x(()=>{v1();i6();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */k0=BigInt(0),O0=BigInt(1),$3=BigInt(2),go=BigInt(3),Bw=BigInt(4),Kw=BigInt(5),Uw=BigInt(8);co=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function lW(D,F){let J=F.negate();return D?J:F}function Ow(D,F){if(!Number.isSafeInteger(D)||D<=0||D>F)throw Error("invalid window size, expected [1.."+F+"], got W="+D)}function cW(D,F){Ow(D,F);let J=Math.ceil(F/D)+1,Q=2**(D-1),$=2**D,Z=Q3(D),X=BigInt(D);return{windows:J,windowSize:Q,mask:Z,maxNumber:$,shiftBy:X}}function _w(D,F,J){let{windowSize:Q,mask:$,maxNumber:Z,shiftBy:X}=J,Y=Number(D&$),q=D>>X;if(Y>Q)Y-=Z,q+=oW;let G=F*Q,W=G+Math.abs(Y)-1,B=Y===0,K=Y<0,U=F%2!==0;return{nextN:q,offset:W,isZero:B,isNeg:K,isNegF:U,offsetF:G}}function io(D,F){if(!Array.isArray(D))throw Error("array expected");D.forEach((J,Q)=>{if(!(J instanceof F))throw Error("invalid point at index "+Q)})}function oo(D,F){if(!Array.isArray(D))throw Error("array of scalars expected");D.forEach((J,Q)=>{if(!F.isValid(J))throw Error("invalid scalar at index "+Q)})}function iW(D){return Mw.get(D)||1}function Ew(D,F){return{constTimeNegate:lW,hasPrecomputes(J){return iW(J)!==1},unsafeLadder(J,Q,$=D.ZERO){let Z=J;while(Q>Cw){if(Q&oW)$=$.add(Z);Z=Z.double(),Q>>=oW}return $},precomputeWindow(J,Q){let{windows:$,windowSize:Z}=cW(Q,F),X=[],Y=J,q=Y;for(let G=0;G<$;G++){q=Y,X.push(q);for(let W=1;W<Z;W++)q=q.add(Y),X.push(q);Y=q.double()}return X},wNAF(J,Q,$){let{ZERO:Z,BASE:X}=D,Y=cW(J,F);for(let q=0;q<Y.windows;q++){let{nextN:G,offset:W,isZero:B,isNeg:K,isNegF:U,offsetF:V}=_w($,q,Y);if($=G,B)X=X.add(lW(U,Q[V]));else Z=Z.add(lW(K,Q[W]))}return{p:Z,f:X}},wNAFUnsafe(J,Q,$,Z=D.ZERO){let X=cW(J,F);for(let Y=0;Y<X.windows;Y++){if($===Cw)break;let{nextN:q,offset:G,isZero:W,isNeg:B}=_w($,Y,X);if($=q,W)continue;else{let K=Q[G];Z=Z.add(B?K.negate():K)}}return Z},getPrecomputes(J,Q,$){let Z=nW.get(Q);if(!Z){if(Z=this.precomputeWindow(Q,J),J!==1)nW.set(Q,$(Z))}return Z},wNAFCached(J,Q,$){let Z=iW(J);return this.wNAF(Z,this.getPrecomputes(Z,J,$),Q)},wNAFCachedUnsafe(J,Q,$,Z){let X=iW(J);if(X===1)return this.unsafeLadder(J,Q,Z);return this.wNAFUnsafe(X,this.getPrecomputes(X,J,$),Q,Z)},setWindowSize(J,Q){Ow(Q,F),Mw.set(J,Q),nW.delete(J)}}}function Rw(D,F,J,Q){io(J,D),oo(Q,F);let $=J.length,Z=Q.length;if($!==Z)throw Error("arrays of points and scalars must have equal length");let X=D.ZERO,Y=qw(BigInt($)),q=1;if(Y>12)q=Y-3;else if(Y>4)q=Y-2;else if(Y>0)q=2;let G=Q3(q),W=Array(Number(G)+1).fill(X),B=Math.floor((F.BITS-1)/q)*q,K=X;for(let U=B;U>=0;U-=q){W.fill(X);for(let H=0;H<Z;H++){let z=Q[H],_=Number(z>>BigInt(U)&G);W[_]=W[_].add(J[H])}let V=X;for(let H=W.length-1,z=X;H>0;H--)z=z.add(W[H]),V=V.add(z);if(K=K.add(V),U!==0)for(let H=0;H<q;H++)K=K.double()}return K}function aW(D){return z$(D.Fp),B1(D,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...dW(D.n,D.nBitLength),...D,...{p:D.Fp.ORDER}})}var Cw,oW,nW,Mw;var Aw=x(()=>{X4();i6();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Cw=BigInt(0),oW=BigInt(1);nW=new WeakMap,Mw=new WeakMap});function ww(D){if(D.lowS!==void 0)c6("lowS",D.lowS);if(D.prehash!==void 0)c6("prehash",D.prehash)}function ao(D){let F=aW(D);B1(F,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:J,Fp:Q,a:$}=F;if(J){if(!Q.eql($,Q.ZERO))throw Error("invalid endo: CURVE.a must be 0");if(typeof J!=="object"||typeof J.beta!=="bigint"||typeof J.splitScalar!=="function")throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...F})}function rW(D,F){return n6(I2(D,F))}function ro(D){let F=ao(D),{Fp:J}=F,Q=Z4(F.n,F.nBitLength),$=F.toBytes||((C,O,E)=>{let A=O.toAffine();return x0(Uint8Array.from([4]),J.toBytes(A.x),J.toBytes(A.y))}),Z=F.fromBytes||((C)=>{let O=C.subarray(1),E=J.fromBytes(O.subarray(0,J.BYTES)),A=J.fromBytes(O.subarray(J.BYTES,2*J.BYTES));return{x:E,y:A}});function X(C){let{a:O,b:E}=F,A=J.sqr(C),N=J.mul(A,C);return J.add(J.add(N,J.mul(C,O)),E)}function Y(C,O){let E=J.sqr(O),A=X(C);return J.eql(E,A)}if(!Y(F.Gx,F.Gy))throw Error("bad curve params: generator point");let q=J.mul(J.pow(F.a,Y4),sW),G=J.mul(J.sqr(F.b),BigInt(27));if(J.is0(J.add(q,G)))throw Error("bad curve params: a or b");function W(C){return J3(C,CD,F.n)}function B(C){let{allowedPrivateKeyLengths:O,nByteLength:E,wrapPrivateKey:A,n:N}=F;if(O&&typeof C!=="bigint"){if(l6(C))C=n6(C);if(typeof C!=="string"||!O.includes(C.length))throw Error("invalid private key");C=C.padStart(E*2,"0")}let w;try{w=typeof C==="bigint"?C:n0(oD("private key",C,E))}catch(T){throw Error("invalid private key, expected hex or "+E+" bytes, got "+typeof C)}if(A)w=mD(w,N);return W1("private key",w,CD,N),w}function K(C){if(!(C instanceof H))throw Error("ProjectivePoint expected")}let U=mW((C,O)=>{let{px:E,py:A,pz:N}=C;if(J.eql(N,J.ONE))return{x:E,y:A};let w=C.is0();if(O==null)O=w?J.ONE:J.inv(N);let T=J.mul(E,O),I=J.mul(A,O),S=J.mul(N,O);if(w)return{x:J.ZERO,y:J.ZERO};if(!J.eql(S,J.ONE))throw Error("invZ was invalid");return{x:T,y:I}}),V=mW((C)=>{if(C.is0()){if(F.allowInfinityPoint&&!J.is0(C.py))return;throw Error("bad point: ZERO")}let{x:O,y:E}=C.toAffine();if(!J.isValid(O)||!J.isValid(E))throw Error("bad point: x or y not FE");if(!Y(O,E))throw Error("bad point: equation left != right");if(!C.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class H{constructor(C,O,E){if(C==null||!J.isValid(C))throw Error("x required");if(O==null||!J.isValid(O)||J.is0(O))throw Error("y required");if(E==null||!J.isValid(E))throw Error("z required");this.px=C,this.py=O,this.pz=E,Object.freeze(this)}static fromAffine(C){let{x:O,y:E}=C||{};if(!C||!J.isValid(O)||!J.isValid(E))throw Error("invalid affine point");if(C instanceof H)throw Error("projective point not allowed");let A=(N)=>J.eql(N,J.ZERO);if(A(O)&&A(E))return H.ZERO;return new H(O,E,J.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){let O=o6(J,C.map((E)=>E.pz));return C.map((E,A)=>E.toAffine(O[A])).map(H.fromAffine)}static fromHex(C){let O=H.fromAffine(Z(oD("pointHex",C)));return O.assertValidity(),O}static fromPrivateKey(C){return H.BASE.multiply(B(C))}static msm(C,O){return Rw(H,Q,C,O)}_setWindowSize(C){M.setWindowSize(this,C)}assertValidity(){V(this)}hasEvenY(){let{y:C}=this.toAffine();if(J.isOdd)return!J.isOdd(C);throw Error("Field doesn't support isOdd")}equals(C){K(C);let{px:O,py:E,pz:A}=this,{px:N,py:w,pz:T}=C,I=J.eql(J.mul(O,T),J.mul(N,A)),S=J.eql(J.mul(E,T),J.mul(w,A));return I&&S}negate(){return new H(this.px,J.neg(this.py),this.pz)}double(){let{a:C,b:O}=F,E=J.mul(O,Y4),{px:A,py:N,pz:w}=this,T=J.ZERO,I=J.ZERO,S=J.ZERO,L=J.mul(A,A),y=J.mul(N,N),m=J.mul(w,w),j=J.mul(A,N);return j=J.add(j,j),S=J.mul(A,w),S=J.add(S,S),T=J.mul(C,S),I=J.mul(E,m),I=J.add(T,I),T=J.sub(y,I),I=J.add(y,I),I=J.mul(T,I),T=J.mul(j,T),S=J.mul(E,S),m=J.mul(C,m),j=J.sub(L,m),j=J.mul(C,j),j=J.add(j,S),S=J.add(L,L),L=J.add(S,L),L=J.add(L,m),L=J.mul(L,j),I=J.add(I,L),m=J.mul(N,w),m=J.add(m,m),L=J.mul(m,j),T=J.sub(T,L),S=J.mul(m,y),S=J.add(S,S),S=J.add(S,S),new H(T,I,S)}add(C){K(C);let{px:O,py:E,pz:A}=this,{px:N,py:w,pz:T}=C,I=J.ZERO,S=J.ZERO,L=J.ZERO,y=F.a,m=J.mul(F.b,Y4),j=J.mul(O,N),h=J.mul(E,w),g=J.mul(A,T),v=J.add(O,E),u=J.add(N,w);v=J.mul(v,u),u=J.add(j,h),v=J.sub(v,u),u=J.add(O,A);let o=J.add(N,T);return u=J.mul(u,o),o=J.add(j,g),u=J.sub(u,o),o=J.add(E,A),I=J.add(w,T),o=J.mul(o,I),I=J.add(h,g),o=J.sub(o,I),L=J.mul(y,u),I=J.mul(m,g),L=J.add(I,L),I=J.sub(h,L),L=J.add(h,L),S=J.mul(I,L),h=J.add(j,j),h=J.add(h,j),g=J.mul(y,g),u=J.mul(m,u),h=J.add(h,g),g=J.sub(j,g),g=J.mul(y,g),u=J.add(u,g),j=J.mul(h,u),S=J.add(S,j),j=J.mul(o,u),I=J.mul(v,I),I=J.sub(I,j),j=J.mul(v,h),L=J.mul(o,L),L=J.add(L,j),new H(I,S,L)}subtract(C){return this.add(C.negate())}is0(){return this.equals(H.ZERO)}wNAF(C){return M.wNAFCached(this,C,H.normalizeZ)}multiplyUnsafe(C){let{endo:O,n:E}=F;W1("scalar",C,l8,E);let A=H.ZERO;if(C===l8)return A;if(this.is0()||C===CD)return this;if(!O||M.hasPrecomputes(this))return M.wNAFCachedUnsafe(this,C,H.normalizeZ);let{k1neg:N,k1:w,k2neg:T,k2:I}=O.splitScalar(C),S=A,L=A,y=this;while(w>l8||I>l8){if(w&CD)S=S.add(y);if(I&CD)L=L.add(y);y=y.double(),w>>=CD,I>>=CD}if(N)S=S.negate();if(T)L=L.negate();return L=new H(J.mul(L.px,O.beta),L.py,L.pz),S.add(L)}multiply(C){let{endo:O,n:E}=F;W1("scalar",C,CD,E);let A,N;if(O){let{k1neg:w,k1:T,k2neg:I,k2:S}=O.splitScalar(C),{p:L,f:y}=this.wNAF(T),{p:m,f:j}=this.wNAF(S);L=M.constTimeNegate(w,L),m=M.constTimeNegate(I,m),m=new H(J.mul(m.px,O.beta),m.py,m.pz),A=L.add(m),N=y.add(j)}else{let{p:w,f:T}=this.wNAF(C);A=w,N=T}return H.normalizeZ([A,N])[0]}multiplyAndAddUnsafe(C,O,E){let A=H.BASE,N=(T,I)=>I===l8||I===CD||!T.equals(A)?T.multiplyUnsafe(I):T.multiply(I),w=N(this,O).add(N(C,E));return w.is0()?void 0:w}toAffine(C){return U(this,C)}isTorsionFree(){let{h:C,isTorsionFree:O}=F;if(C===CD)return!0;if(O)return O(H,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:C,clearCofactor:O}=F;if(C===CD)return this;if(O)return O(H,this);return this.multiplyUnsafe(F.h)}toRawBytes(C=!0){return c6("isCompressed",C),this.assertValidity(),$(H,this,C)}toHex(C=!0){return c6("isCompressed",C),n6(this.toRawBytes(C))}}H.BASE=new H(F.Gx,F.Gy,J.ONE),H.ZERO=new H(J.ZERO,J.ONE,J.ZERO);let{endo:z,nBitLength:_}=F,M=Ew(H,z?Math.ceil(_/2):_);return{CURVE:F,ProjectivePoint:H,normPrivateKeyToScalar:B,weierstrassEquation:X,isWithinCurveOrder:W}}function so(D){let F=aW(D);return B1(F,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...F})}function Nw(D){let F=so(D),{Fp:J,n:Q,nByteLength:$,nBitLength:Z}=F,X=J.BYTES+1,Y=2*J.BYTES+1;function q(j){return mD(j,Q)}function G(j){return H$(j,Q)}let{ProjectivePoint:W,normPrivateKeyToScalar:B,weierstrassEquation:K,isWithinCurveOrder:U}=ro({...F,toBytes(j,h,g){let v=h.toAffine(),u=J.toBytes(v.x),o=x0;if(c6("isCompressed",g),g)return o(Uint8Array.from([h.hasEvenY()?2:3]),u);else return o(Uint8Array.from([4]),u,J.toBytes(v.y))},fromBytes(j){let h=j.length,g=j[0],v=j.subarray(1);if(h===X&&(g===2||g===3)){let u=n0(v);if(!J3(u,CD,J.ORDER))throw Error("Point is not on curve");let o=K(u),lD;try{lD=J.sqrt(o)}catch(e0){let C0=e0 instanceof Error?": "+e0.message:"";throw Error("Point is not on curve"+C0)}let ED=(lD&CD)===CD;if((g&1)===1!==ED)lD=J.neg(lD);return{x:u,y:lD}}else if(h===Y&&g===4){let u=J.fromBytes(v.subarray(0,J.BYTES)),o=J.fromBytes(v.subarray(J.BYTES,2*J.BYTES));return{x:u,y:o}}else{let u=X,o=Y;throw Error("invalid Point, expected length of "+u+", or uncompressed "+o+", got "+h)}}});function V(j){let h=Q>>CD;return j>h}function H(j){return V(j)?q(-j):j}let z=(j,h,g)=>n0(j.slice(h,g));class _{constructor(j,h,g){if(W1("r",j,CD,Q),W1("s",h,CD,Q),this.r=j,this.s=h,g!=null)this.recovery=g;Object.freeze(this)}static fromCompact(j){let h=$;return j=oD("compactSignature",j,h*2),new _(z(j,0,h),z(j,h,2*h))}static fromDER(j){let{r:h,s:g}=K1.toSig(oD("DER",j));return new _(h,g)}assertValidity(){}addRecoveryBit(j){return new _(this.r,this.s,j)}recoverPublicKey(j){let{r:h,s:g,recovery:v}=this,u=N(oD("msgHash",j));if(v==null||![0,1,2,3].includes(v))throw Error("recovery id invalid");let o=v===2||v===3?h+F.n:h;if(o>=J.ORDER)throw Error("recovery id 2 or 3 invalid");let lD=(v&1)===0?"02":"03",ED=W.fromHex(lD+rW(o,J.BYTES)),B8=G(o),e0=q(-u*B8),C0=q(g*B8),j1=W.BASE.multiplyAndAddUnsafe(ED,e0,C0);if(!j1)throw Error("point at infinify");return j1.assertValidity(),j1}hasHighS(){return V(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,q(-this.s),this.recovery):this}toDERRawBytes(){return $4(this.toDERHex())}toDERHex(){return K1.hexFromSig(this)}toCompactRawBytes(){return $4(this.toCompactHex())}toCompactHex(){let j=$;return rW(this.r,j)+rW(this.s,j)}}let M={isValidPrivateKey(j){try{return B(j),!0}catch(h){return!1}},normPrivateKeyToScalar:B,randomPrivateKey:()=>{let j=pW(F.n);return zw(F.randomBytes(j),F.n)},precompute(j=8,h=W.BASE){return h._setWindowSize(j),h.multiply(BigInt(3)),h}};function C(j,h=!0){return W.fromPrivateKey(j).toRawBytes(h)}function O(j){if(typeof j==="bigint")return!1;if(j instanceof W)return!0;let g=oD("key",j).length,v=J.BYTES,u=v+1,o=2*v+1;if(F.allowedPrivateKeyLengths||$===u)return;else return g===u||g===o}function E(j,h,g=!0){if(O(j)===!0)throw Error("first arg must be private key");if(O(h)===!1)throw Error("second arg must be public key");return W.fromHex(h).multiply(B(j)).toRawBytes(g)}let A=F.bits2int||function(j){if(j.length>8192)throw Error("input is too large");let h=n0(j),g=j.length*8-Z;return g>0?h>>BigInt(g):h},N=F.bits2int_modN||function(j){return q(A(j))},w=Q3(Z);function T(j){return W1("num < 2^"+Z,j,l8,w),I2(j,$)}function I(j,h,g=S){if(["recovered","canonical"].some((PF)=>(PF in g)))throw Error("sign() legacy options not supported");let{hash:v,randomBytes:u}=F,{lowS:o,prehash:lD,extraEntropy:ED}=g;if(o==null)o=!0;if(j=oD("msgHash",j),ww(g),lD)j=oD("prehashed msgHash",v(j));let B8=N(j),e0=B(h),C0=[T(e0),T(B8)];if(ED!=null&&ED!==!1){let PF=ED===!0?u(J.BYTES):ED;C0.push(oD("extraEntropy",PF))}let j1=x0(...C0),QJ=B8;function vY(PF){let i3=A(PF);if(!U(i3))return;let uY=G(i3),z9=W.BASE.multiply(i3).toAffine(),jF=q(z9.x);if(jF===l8)return;let C9=q(uY*q(QJ+jF*e0));if(C9===l8)return;let o3=(z9.x===jF?0:2)|Number(z9.y&CD),eH=C9;if(o&&V(C9))eH=H(C9),o3^=1;return new _(jF,eH,o3)}return{seed:j1,k2sig:vY}}let S={lowS:F.lowS,prehash:!1},L={lowS:F.lowS,prehash:!1};function y(j,h,g=S){let{seed:v,k2sig:u}=I(j,h,g),o=F;return Gw(o.hash.outputLen,o.nByteLength,o.hmac)(v,u)}W.BASE._setWindowSize(8);function m(j,h,g,v=L){let u=j;h=oD("msgHash",h),g=oD("publicKey",g);let{lowS:o,prehash:lD,format:ED}=v;if(ww(v),"strict"in v)throw Error("options.strict was renamed to lowS");if(ED!==void 0&&ED!=="compact"&&ED!=="der")throw Error("format must be compact or der");let B8=typeof u==="string"||l6(u),e0=!B8&&!ED&&typeof u==="object"&&u!==null&&typeof u.r==="bigint"&&typeof u.s==="bigint";if(!B8&&!e0)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");let C0=void 0,j1;try{if(e0)C0=new _(u.r,u.s);if(B8){try{if(ED!=="compact")C0=_.fromDER(u)}catch(o3){if(!(o3 instanceof K1.Err))throw o3}if(!C0&&ED!=="der")C0=_.fromCompact(u)}j1=W.fromHex(g)}catch(o3){return!1}if(!C0)return!1;if(o&&C0.hasHighS())return!1;if(lD)h=F.hash(h);let{r:QJ,s:vY}=C0,PF=N(h),i3=G(vY),uY=q(PF*i3),z9=q(QJ*i3),jF=W.BASE.multiplyAndAddUnsafe(j1,uY,z9)?.toAffine();if(!jF)return!1;return q(jF.x)===QJ}return{CURVE:F,getPublicKey:C,getSharedSecret:E,sign:y,verify:m,ProjectivePoint:W,Signature:_,utils:M}}function to(D,F){let J=D.ORDER,Q=l8;for(let V=J-CD;V%n1===l8;V/=n1)Q+=CD;let $=Q,Z=n1<<$-CD-CD,X=Z*n1,Y=(J-CD)/X,q=(Y-CD)/n1,G=X-CD,W=Z,B=D.pow(F,Y),K=D.pow(F,(Y+CD)/n1),U=(V,H)=>{let z=B,_=D.pow(H,G),M=D.sqr(_);M=D.mul(M,H);let C=D.mul(V,M);C=D.pow(C,q),C=D.mul(C,_),_=D.mul(C,H),M=D.mul(C,V);let O=D.mul(M,_);C=D.pow(O,W);let E=D.eql(C,D.ONE);_=D.mul(M,K),C=D.mul(O,z),M=D.cmov(_,M,E),O=D.cmov(C,O,E);for(let A=$;A>CD;A--){let N=A-n1;N=n1<<N-CD;let w=D.pow(O,N),T=D.eql(w,D.ONE);_=D.mul(M,z),z=D.mul(z,z),w=D.mul(O,z),M=D.cmov(_,M,T),O=D.cmov(w,O,T)}return{isValid:E,value:M}};if(D.ORDER%sW===Y4){let V=(D.ORDER-Y4)/sW,H=D.sqrt(D.neg(F));U=(z,_)=>{let M=D.sqr(_),C=D.mul(z,_);M=D.mul(M,C);let O=D.pow(M,V);O=D.mul(O,C);let E=D.mul(O,H),A=D.mul(D.sqr(O),_),N=D.eql(A,z),w=D.cmov(E,O,N);return{isValid:N,value:w}}}return U}function Tw(D,F){if(z$(D),!D.isValid(F.A)||!D.isValid(F.B)||!D.isValid(F.Z))throw Error("mapToCurveSimpleSWU: invalid opts");let J=to(D,F.Z);if(!D.isOdd)throw Error("Fp.isOdd is not implemented!");return(Q)=>{let $,Z,X,Y,q,G,W,B;$=D.sqr(Q),$=D.mul($,F.Z),Z=D.sqr($),Z=D.add(Z,$),X=D.add(Z,D.ONE),X=D.mul(X,F.B),Y=D.cmov(F.Z,D.neg(Z),!D.eql(Z,D.ZERO)),Y=D.mul(Y,F.A),Z=D.sqr(X),G=D.sqr(Y),q=D.mul(G,F.A),Z=D.add(Z,q),Z=D.mul(Z,X),G=D.mul(G,Y),q=D.mul(G,F.B),Z=D.add(Z,q),W=D.mul($,X);let{isValid:K,value:U}=J(Z,G);B=D.mul($,Q),B=D.mul(B,U),W=D.cmov(W,X,K),B=D.cmov(B,U,K);let V=D.isOdd(Q)===D.isOdd(B);B=D.cmov(D.neg(B),B,V);let H=o6(D,[Y],!0)[0];return W=D.mul(W,H),{x:W,y:B}}}var Iw,K1,l8,CD,n1,Y4,sW;var tW=x(()=>{Aw();X4();i6();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Iw=class Iw extends Error{constructor(D=""){super(D)}};K1={Err:Iw,_tlv:{encode:(D,F)=>{let{Err:J}=K1;if(D<0||D>256)throw new J("tlv.encode: wrong tag");if(F.length&1)throw new J("tlv.encode: unpadded data");let Q=F.length/2,$=Q4(Q);if($.length/2&128)throw new J("tlv.encode: long form length too big");let Z=Q>127?Q4($.length/2|128):"";return Q4(D)+Z+$+F},decode(D,F){let{Err:J}=K1,Q=0;if(D<0||D>256)throw new J("tlv.encode: wrong tag");if(F.length<2||F[Q++]!==D)throw new J("tlv.decode: wrong tlv");let $=F[Q++],Z=!!($&128),X=0;if(!Z)X=$;else{let q=$&127;if(!q)throw new J("tlv.decode(long): indefinite length not supported");if(q>4)throw new J("tlv.decode(long): byte length is too big");let G=F.subarray(Q,Q+q);if(G.length!==q)throw new J("tlv.decode: length bytes not complete");if(G[0]===0)throw new J("tlv.decode(long): zero leftmost byte");for(let W of G)X=X<<8|W;if(Q+=q,X<128)throw new J("tlv.decode(long): not minimal encoding")}let Y=F.subarray(Q,Q+X);if(Y.length!==X)throw new J("tlv.decode: wrong value length");return{v:Y,l:F.subarray(Q+X)}}},_int:{encode(D){let{Err:F}=K1;if(D<l8)throw new F("integer: negative integers are not allowed");let J=Q4(D);if(Number.parseInt(J[0],16)&8)J="00"+J;if(J.length&1)throw new F("unexpected DER parsing assertion: unpadded hex");return J},decode(D){let{Err:F}=K1;if(D[0]&128)throw new F("invalid signature integer: negative");if(D[0]===0&&!(D[1]&128))throw new F("invalid signature integer: unnecessary leading zero");return n0(D)}},toSig(D){let{Err:F,_int:J,_tlv:Q}=K1,$=oD("signature",D),{v:Z,l:X}=Q.decode(48,$);if(X.length)throw new F("invalid signature: left bytes after parsing");let{v:Y,l:q}=Q.decode(2,Z),{v:G,l:W}=Q.decode(2,q);if(W.length)throw new F("invalid signature: left bytes after parsing");return{r:J.decode(Y),s:J.decode(G)}},hexFromSig(D){let{_tlv:F,_int:J}=K1,Q=F.encode(2,J.encode(D.r)),$=F.encode(2,J.encode(D.s)),Z=Q+$;return F.encode(48,Z)}};l8=BigInt(0),CD=BigInt(1),n1=BigInt(2),Y4=BigInt(3),sW=BigInt(4)});function eo(D){return{hash:D,hmac:(F,...J)=>yW(D,F,_A(...J)),randomBytes:tQ}}function Lw(D,F){let J=(Q)=>Nw({...D,...eo(Q)});return{...J(F),create:J}}var Pw=x(()=>{Qw();v1();tW();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});function i1(D,F){if(q4(D),q4(F),D<0||D>=1<<8*F)throw Error("invalid I2OSP input: "+D);let J=Array.from({length:F}).fill(0);for(let Q=F-1;Q>=0;Q--)J[Q]=D&255,D>>>=8;return new Uint8Array(J)}function Fa(D,F){let J=new Uint8Array(D.length);for(let Q=0;Q<D.length;Q++)J[Q]=D[Q]^F[Q];return J}function q4(D){if(!Number.isSafeInteger(D))throw Error("number expected")}function Ja(D,F,J,Q){if(G1(D),G1(F),q4(J),F.length>255)F=Q(x0(V$("H2C-OVERSIZE-DST-"),F));let{outputLen:$,blockLen:Z}=Q,X=Math.ceil(J/$);if(J>65535||X>255)throw Error("expand_message_xmd: invalid lenInBytes");let Y=x0(F,i1(F.length,1)),q=i1(0,Z),G=i1(J,2),W=Array(X),B=Q(x0(q,D,G,i1(0,1),Y));W[0]=Q(x0(B,i1(1,1),Y));for(let U=1;U<=X;U++){let V=[Fa(B,W[U-1]),i1(U+1,1),Y];W[U]=Q(x0(...V))}return x0(...W).slice(0,J)}function Qa(D,F,J,Q,$){if(G1(D),G1(F),q4(J),F.length>255){let Z=Math.ceil(2*Q/8);F=$.create({dkLen:Z}).update(V$("H2C-OVERSIZE-DST-")).update(F).digest()}if(J>65535||F.length>255)throw Error("expand_message_xof: invalid lenInBytes");return $.create({dkLen:J}).update(D).update(i1(J,2)).update(F).update(i1(F.length,1)).digest()}function jw(D,F,J){B1(J,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:Q,k:$,m:Z,hash:X,expand:Y,DST:q}=J;G1(D),q4(F);let G=typeof q==="string"?V$(q):q,W=Q.toString(2).length,B=Math.ceil((W+$)/8),K=F*Z*B,U;if(Y==="xmd")U=Ja(D,G,K,X);else if(Y==="xof")U=Qa(D,G,K,$,X);else if(Y==="_internal_pass")U=D;else throw Error('expand must be "xmd" or "xof"');let V=Array(F);for(let H=0;H<F;H++){let z=Array(Z);for(let _=0;_<Z;_++){let M=B*(_+H*Z),C=U.subarray(M,M+B);z[_]=mD(Da(C),Q)}V[H]=z}return V}function Sw(D,F){let J=F.map((Q)=>Array.from(Q).reverse());return(Q,$)=>{let[Z,X,Y,q]=J.map((B)=>B.reduce((K,U)=>D.add(D.mul(K,Q),U))),[G,W]=o6(D,[X,q],!0);return Q=D.mul(Z,G),$=D.mul($,D.mul(Y,W)),{x:Q,y:$}}}function xw(D,F,J){if(typeof F!=="function")throw Error("mapToCurve() must be defined");function Q(Z){return D.fromAffine(F(Z))}function $(Z){let X=Z.clearCofactor();if(X.equals(D.ZERO))return D.ZERO;return X.assertValidity(),X}return{defaults:J,hashToCurve(Z,X){let Y=jw(Z,2,{...J,DST:J.DST,...X}),q=Q(Y[0]),G=Q(Y[1]);return $(q.add(G))},encodeToCurve(Z,X){let Y=jw(Z,1,{...J,DST:J.encodeDST,...X});return $(Q(Y[0]))},mapToCurve(Z){if(!Array.isArray(Z))throw Error("expected array of bigints");for(let X of Z)if(typeof X!=="bigint")throw Error("expected array of bigints");return $(Q(Z))}}}var Da;var kw=x(()=>{X4();i6();Da=n0});var gw={};K8(gw,{secp256k1_hasher:()=>ZB,secp256k1:()=>U1,schnorr:()=>Ya,hashToCurve:()=>Wa,encodeToCurve:()=>Ba});function hw(D){let F=B4,J=BigInt(3),Q=BigInt(6),$=BigInt(11),Z=BigInt(22),X=BigInt(23),Y=BigInt(44),q=BigInt(88),G=D*D*D%F,W=G*G*D%F,B=q8(W,J,F)*W%F,K=q8(B,J,F)*W%F,U=q8(K,_$,F)*G%F,V=q8(U,$,F)*U%F,H=q8(V,Z,F)*V%F,z=q8(H,Y,F)*H%F,_=q8(z,q,F)*z%F,M=q8(_,Y,F)*H%F,C=q8(M,J,F)*W%F,O=q8(C,X,F)*V%F,E=q8(O,Q,F)*G%F,A=q8(E,_$,F);if(!o1.eql(o1.sqr(A),D))throw Error("Cannot find square root");return A}function O$(D,...F){let J=fw[D];if(J===void 0){let Q=F3(Uint8Array.from(D,($)=>$.charCodeAt(0)));J=x0(Q,Q),fw[D]=J}return F3(x0(J,...F))}function FB(D){let F=U1.utils.normPrivateKeyToScalar(D),J=$B.fromPrivateKey(F);return{scalar:J.hasEvenY()?F:W4(-F),bytes:QB(J)}}function bw(D){W1("x",D,G4,B4);let F=eW(D*D),J=eW(F*D+BigInt(7)),Q=hw(J);if(Q%_$!==JB)Q=eW(-Q);let $=new $B(D,Q,G4);return $.assertValidity(),$}function vw(...D){return W4(a6(O$("BIP0340/challenge",...D)))}function Za(D){return FB(D).bytes}function Xa(D,F,J=tQ(32)){let Q=oD("message",D),{bytes:$,scalar:Z}=FB(F),X=oD("auxRand",J,32),Y=DB(Z^a6(O$("BIP0340/aux",X))),q=O$("BIP0340/nonce",Y,$,Q),G=W4(a6(q));if(G===JB)throw Error("sign failed: k is zero");let{bytes:W,scalar:B}=FB(G),K=vw(W,$,Q),U=new Uint8Array(64);if(U.set(W,0),U.set(DB(W4(B+K*Z)),32),!uw(U,Q,$))throw Error("sign: Invalid signature produced");return U}function uw(D,F,J){let Q=oD("signature",D,64),$=oD("message",F),Z=oD("publicKey",J,32);try{let X=bw(a6(Z)),Y=a6(Q.subarray(0,32));if(!J3(Y,G4,B4))return!1;let q=a6(Q.subarray(32,64));if(!J3(q,G4,C$))return!1;let G=vw(DB(Y),QB(X),$),W=$a(X,q,W4(-G));if(!W||!W.hasEvenY()||W.toAffine().x!==Y)return!1;return!0}catch(X){return!1}}var B4,C$,JB,G4,_$,yw=(D,F)=>(D+F/_$)/F,o1,U1,fw,QB=(D)=>D.toRawBytes(!0).slice(1),DB=(D)=>I2(D,32),eW=(D)=>mD(D,B4),W4=(D)=>mD(D,C$),$B,$a=(D,F,J)=>$B.BASE.multiplyAndAddUnsafe(D,F,J),a6,Ya,qa,Ga,ZB,Wa,Ba;var M$=x(()=>{xW();v1();Pw();kw();X4();i6();tW();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */B4=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),C$=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),JB=BigInt(0),G4=BigInt(1),_$=BigInt(2);o1=Z4(B4,void 0,void 0,{sqrt:hw}),U1=Lw({a:JB,b:BigInt(7),Fp:o1,n:C$,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:(D)=>{let F=C$,J=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Q=-G4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),$=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),Z=J,X=BigInt("0x100000000000000000000000000000000"),Y=yw(Z*D,F),q=yw(-Q*D,F),G=mD(D-Y*J-q*$,F),W=mD(-Y*Q-q*Z,F),B=G>X,K=W>X;if(B)G=F-G;if(K)W=F-W;if(G>X||W>X)throw Error("splitScalar: Endomorphism failed, k="+D);return{k1neg:B,k1:G,k2neg:K,k2:W}}}},F3),fw={};$B=(()=>U1.ProjectivePoint)();a6=n0;Ya=(()=>({getPublicKey:Za,sign:Xa,verify:uw,utils:{randomPrivateKey:U1.utils.randomPrivateKey,lift_x:bw,pointToBytes:QB,numberToBytesBE:I2,bytesToNumberBE:n0,taggedHash:O$,mod:mD}}))(),qa=(()=>Sw(o1,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((D)=>D.map((F)=>BigInt(F)))))(),Ga=(()=>Tw(o1,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:o1.create(BigInt("-11"))}))(),ZB=(()=>xw(U1.ProjectivePoint,(D)=>{let{x:F,y:J}=Ga(o1.create(D[0]));return qa(F,J)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:o1.ORDER,m:1,k:128,expand:"xmd",hash:F3}))(),Wa=(()=>ZB.hashToCurve)(),Ba=(()=>ZB.encodeToCurve)()});var r1,Z3,K4,U4,V4,H4,z4,C4,_4,O4,X3,c8;var Y3=x(()=>{R6();s();r1=class r1 extends P{constructor({cause:D,message:F}={}){let J=F?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${J?`with reason: ${J}`:"for an unknown reason"}.`,{cause:D,name:"ExecutionRevertedError"})}};Object.defineProperty(r1,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(r1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});Z3=class Z3 extends P{constructor({cause:D,maxFeePerGas:F}={}){super(`The fee cap (\`maxFeePerGas\`${F?` = ${F0(F)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:D,name:"FeeCapTooHighError"})}};Object.defineProperty(Z3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});K4=class K4 extends P{constructor({cause:D,maxFeePerGas:F}={}){super(`The fee cap (\`maxFeePerGas\`${F?` = ${F0(F)}`:""} gwei) cannot be lower than the block base fee.`,{cause:D,name:"FeeCapTooLowError"})}};Object.defineProperty(K4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});U4=class U4 extends P{constructor({cause:D,nonce:F}={}){super(`Nonce provided for the transaction ${F?`(${F}) `:""}is higher than the next one expected.`,{cause:D,name:"NonceTooHighError"})}};Object.defineProperty(U4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});V4=class V4 extends P{constructor({cause:D,nonce:F}={}){super([`Nonce provided for the transaction ${F?`(${F}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
67
|
+
`),{cause:D,name:"NonceTooLowError"})}};Object.defineProperty(V4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});H4=class H4 extends P{constructor({cause:D,nonce:F}={}){super(`Nonce provided for the transaction ${F?`(${F}) `:""}exceeds the maximum allowed nonce.`,{cause:D,name:"NonceMaxValueError"})}};Object.defineProperty(H4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});z4=class z4 extends P{constructor({cause:D}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
68
|
+
`),{cause:D,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(z4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});C4=class C4 extends P{constructor({cause:D,gas:F}={}){super(`The amount of gas ${F?`(${F}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:D,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(C4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});_4=class _4 extends P{constructor({cause:D,gas:F}={}){super(`The amount of gas ${F?`(${F}) `:""}provided for the transaction is too low.`,{cause:D,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(_4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});O4=class O4 extends P{constructor({cause:D}){super("The transaction type is not supported for this chain.",{cause:D,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(O4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});X3=class X3 extends P{constructor({cause:D,maxPriorityFeePerGas:F,maxFeePerGas:J}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${F?` = ${F0(F)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${J?` = ${F0(J)} gwei`:""}).`].join(`
|
|
69
|
+
`),{cause:D,name:"TipAboveFeeCapError"})}};Object.defineProperty(X3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});c8=class c8 extends P{constructor({cause:D}){super(`An error occurred while executing: ${D?.shortMessage}`,{cause:D,name:"UnknownNodeError"})}}});function s1(D,F){let J=(D.details||"").toLowerCase(),Q=D instanceof P?D.walk(($)=>$?.code===r1.code):D;if(Q instanceof P)return new r1({cause:D,message:Q.details});if(r1.nodeMessage.test(J))return new r1({cause:D,message:D.details});if(Z3.nodeMessage.test(J))return new Z3({cause:D,maxFeePerGas:F?.maxFeePerGas});if(K4.nodeMessage.test(J))return new K4({cause:D,maxFeePerGas:F?.maxFeePerGas});if(U4.nodeMessage.test(J))return new U4({cause:D,nonce:F?.nonce});if(V4.nodeMessage.test(J))return new V4({cause:D,nonce:F?.nonce});if(H4.nodeMessage.test(J))return new H4({cause:D,nonce:F?.nonce});if(z4.nodeMessage.test(J))return new z4({cause:D});if(C4.nodeMessage.test(J))return new C4({cause:D,gas:F?.gas});if(_4.nodeMessage.test(J))return new _4({cause:D,gas:F?.gas});if(O4.nodeMessage.test(J))return new O4({cause:D});if(X3.nodeMessage.test(J))return new X3({cause:D,maxFeePerGas:F?.maxFeePerGas,maxPriorityFeePerGas:F?.maxPriorityFeePerGas});return new c8({cause:D})}var M4=x(()=>{s();Y3()});function i0(D,{format:F}){if(!F)return{};let J={};function Q(Z){let X=Object.keys(Z);for(let Y of X){if(Y in D)J[Y]=D[Y];if(Z[Y]&&typeof Z[Y]==="object"&&!Array.isArray(Z[Y]))Q(Z[Y])}}let $=F(D||{});return Q($),J}function Q0(D,F){let J={};if(typeof D.authorizationList<"u")J.authorizationList=Ha(D.authorizationList);if(typeof D.accessList<"u")J.accessList=D.accessList;if(typeof D.blobVersionedHashes<"u")J.blobVersionedHashes=D.blobVersionedHashes;if(typeof D.blobs<"u")if(typeof D.blobs[0]!=="string")J.blobs=D.blobs.map((Q)=>BD(Q));else J.blobs=D.blobs;if(typeof D.data<"u")J.data=D.data;if(D.account)J.from=D.account.address;if(typeof D.from<"u")J.from=D.from;if(typeof D.gas<"u")J.gas=k(D.gas);if(typeof D.gasPrice<"u")J.gasPrice=k(D.gasPrice);if(typeof D.maxFeePerBlobGas<"u")J.maxFeePerBlobGas=k(D.maxFeePerBlobGas);if(typeof D.maxFeePerGas<"u")J.maxFeePerGas=k(D.maxFeePerGas);if(typeof D.maxPriorityFeePerGas<"u")J.maxPriorityFeePerGas=k(D.maxPriorityFeePerGas);if(typeof D.nonce<"u")J.nonce=k(D.nonce);if(typeof D.to<"u")J.to=D.to;if(typeof D.type<"u")J.type=Va[D.type];if(typeof D.value<"u")J.value=k(D.value);return J}function Ha(D){return D.map((F)=>({address:F.address,r:F.r?k(BigInt(F.r)):F.r,s:F.s?k(BigInt(F.s)):F.s,chainId:k(F.chainId),nonce:k(F.nonce),...typeof F.yParity<"u"?{yParity:k(F.yParity)}:{},...typeof F.v<"u"&&typeof F.yParity>"u"?{v:k(F.v)}:{}}))}var Va;var N2=x(()=>{c();Va={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"}});function ow(D){if(!D||D.length===0)return;return D.reduce((F,{slot:J,value:Q})=>{if(J.length!==66)throw new lQ({size:J.length,targetSize:66,type:"hex"});if(Q.length!==66)throw new lQ({size:Q.length,targetSize:66,type:"hex"});return F[J]=Q,F},{})}function za(D){let{balance:F,nonce:J,state:Q,stateDiff:$,code:Z}=D,X={};if(Z!==void 0)X.code=Z;if(F!==void 0)X.balance=k(F);if(J!==void 0)X.nonce=k(J);if(Q!==void 0)X.state=ow(Q);if($!==void 0){if(X.state)throw new wW;X.stateDiff=ow($)}return X}function r6(D){if(!D)return;let F={};for(let{address:J,...Q}of D){if(!FD(J,{strict:!1}))throw new j0({address:J});if(F[J])throw new AW({address:J});F[J]=za(Q)}return F}var R$=x(()=>{nF();cQ();IW();z2();c()});var ewD,DID,FID,JID,QID,$ID,ZID,XID,YID,qID,GID,WID,BID,KID,UID,VID,HID,zID,CID,_ID,OID,MID,EID,RID,AID,wID,IID,NID,TID,LID,PID,jID,SID,xID,kID,yID,fID,hID,bID,vID,uID,gID,mID,dID,pID,lID,cID,nID,iID,oID,aID,rID,sID,tID,eID,DND,FND,JND,QND,$ND,ZND,XND,YND,qND,GND,WND,BND,KND,UND,VND,HND,zND,CND,_ND,OND,MND,END,RND,AND,wND,IND,NND,TND,LND,PND,jND,SND,xND,kND,yND,fND,hND,bND,vND,uND,aw;var rw=x(()=>{ewD=2n**(8n-1n)-1n,DID=2n**(16n-1n)-1n,FID=2n**(24n-1n)-1n,JID=2n**(32n-1n)-1n,QID=2n**(40n-1n)-1n,$ID=2n**(48n-1n)-1n,ZID=2n**(56n-1n)-1n,XID=2n**(64n-1n)-1n,YID=2n**(72n-1n)-1n,qID=2n**(80n-1n)-1n,GID=2n**(88n-1n)-1n,WID=2n**(96n-1n)-1n,BID=2n**(104n-1n)-1n,KID=2n**(112n-1n)-1n,UID=2n**(120n-1n)-1n,VID=2n**(128n-1n)-1n,HID=2n**(136n-1n)-1n,zID=2n**(144n-1n)-1n,CID=2n**(152n-1n)-1n,_ID=2n**(160n-1n)-1n,OID=2n**(168n-1n)-1n,MID=2n**(176n-1n)-1n,EID=2n**(184n-1n)-1n,RID=2n**(192n-1n)-1n,AID=2n**(200n-1n)-1n,wID=2n**(208n-1n)-1n,IID=2n**(216n-1n)-1n,NID=2n**(224n-1n)-1n,TID=2n**(232n-1n)-1n,LID=2n**(240n-1n)-1n,PID=2n**(248n-1n)-1n,jID=2n**(256n-1n)-1n,SID=-(2n**(8n-1n)),xID=-(2n**(16n-1n)),kID=-(2n**(24n-1n)),yID=-(2n**(32n-1n)),fID=-(2n**(40n-1n)),hID=-(2n**(48n-1n)),bID=-(2n**(56n-1n)),vID=-(2n**(64n-1n)),uID=-(2n**(72n-1n)),gID=-(2n**(80n-1n)),mID=-(2n**(88n-1n)),dID=-(2n**(96n-1n)),pID=-(2n**(104n-1n)),lID=-(2n**(112n-1n)),cID=-(2n**(120n-1n)),nID=-(2n**(128n-1n)),iID=-(2n**(136n-1n)),oID=-(2n**(144n-1n)),aID=-(2n**(152n-1n)),rID=-(2n**(160n-1n)),sID=-(2n**(168n-1n)),tID=-(2n**(176n-1n)),eID=-(2n**(184n-1n)),DND=-(2n**(192n-1n)),FND=-(2n**(200n-1n)),JND=-(2n**(208n-1n)),QND=-(2n**(216n-1n)),$ND=-(2n**(224n-1n)),ZND=-(2n**(232n-1n)),XND=-(2n**(240n-1n)),YND=-(2n**(248n-1n)),qND=-(2n**(256n-1n)),GND=2n**8n-1n,WND=2n**16n-1n,BND=2n**24n-1n,KND=2n**32n-1n,UND=2n**40n-1n,VND=2n**48n-1n,HND=2n**56n-1n,zND=2n**64n-1n,CND=2n**72n-1n,_ND=2n**80n-1n,OND=2n**88n-1n,MND=2n**96n-1n,END=2n**104n-1n,RND=2n**112n-1n,AND=2n**120n-1n,wND=2n**128n-1n,IND=2n**136n-1n,NND=2n**144n-1n,TND=2n**152n-1n,LND=2n**160n-1n,PND=2n**168n-1n,jND=2n**176n-1n,SND=2n**184n-1n,xND=2n**192n-1n,kND=2n**200n-1n,yND=2n**208n-1n,fND=2n**216n-1n,hND=2n**224n-1n,bND=2n**232n-1n,vND=2n**240n-1n,uND=2n**248n-1n,aw=2n**256n-1n});function $0(D){let{account:F,maxFeePerGas:J,maxPriorityFeePerGas:Q,to:$}=D,Z=F?i(F):void 0;if(Z&&!FD(Z.address))throw new j0({address:Z.address});if($&&!FD($))throw new j0({address:$});if(J&&J>aw)throw new Z3({maxFeePerGas:J});if(Q&&J&&Q>J)throw new X3({maxFeePerGas:J,maxPriorityFeePerGas:Q})}var T2=x(()=>{rw();nF();Y3();z2()});function O8(D,F){if(!FD(D,{strict:!1}))throw new j0({address:D});if(!FD(F,{strict:!1}))throw new j0({address:F});return D.toLowerCase()===F.toLowerCase()}var G3=x(()=>{nF();z2()});function o0(D){let{abi:F,args:J,functionName:Q,data:$}=D,Z=F[0];if(Q){let Y=l0({abi:F,args:J,name:Q});if(!Y)throw new K2(Q,{docsPath:VB});Z=Y}if(Z.type!=="function")throw new K2(void 0,{docsPath:VB});if(!Z.outputs)throw new l9(Z.name,{docsPath:VB});let X=$1(Z.outputs,$);if(X&&X.length>1)return X;if(X&&X.length===1)return X[0];return}var VB="/docs/contract/decodeFunctionResult";var e1=x(()=>{gD();e9();g1()});var KI="0.1.1";function UI(){return KI}var VI=()=>{};function HI(D,F){if(F?.(D))return D;if(D&&typeof D==="object"&&"cause"in D&&D.cause)return HI(D.cause,F);return F?null:D}var d;var a0=x(()=>{VI();d=class d extends Error{static setStaticOptions(D){d.prototype.docsOrigin=D.docsOrigin,d.prototype.showVersion=D.showVersion,d.prototype.version=D.version}constructor(D,F={}){let J=(()=>{if(F.cause instanceof d){if(F.cause.details)return F.cause.details;if(F.cause.shortMessage)return F.cause.shortMessage}if(F.cause&&"details"in F.cause&&typeof F.cause.details==="string")return F.cause.details;if(F.cause?.message)return F.cause.message;return F.details})(),Q=(()=>{if(F.cause instanceof d)return F.cause.docsPath||F.docsPath;return F.docsPath})(),$=F.docsOrigin??d.prototype.docsOrigin,Z=`${$}${Q??""}`,X=Boolean(F.version??d.prototype.showVersion),Y=F.version??d.prototype.version,q=[D||"An error occurred.",...F.metaMessages?["",...F.metaMessages]:[],...J||Q||X?["",J?`Details: ${J}`:void 0,Q?`See: ${Z}`:void 0,X?`Version: ${Y}`:void 0]:[]].filter((G)=>typeof G==="string").join(`
|
|
70
|
+
`);super(q,F.cause?{cause:F.cause}:void 0);Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=F.cause,this.details=J,this.docs=Z,this.docsOrigin=$,this.docsPath=Q,this.shortMessage=D,this.showVersion=X,this.version=Y}walk(D){return HI(this,D)}};Object.defineProperty(d,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${UI()}`}});(()=>{d.setStaticOptions(d.defaultStaticOptions)})()});function $7(D,F){if(M8(D)>F)throw new CB({givenSize:M8(D),maxSize:F})}function zI(D,F){if(typeof F==="number"&&F>0&&F>M8(D)-1)throw new L$({offset:F,position:"start",size:M8(D)})}function CI(D,F,J){if(typeof F==="number"&&typeof J==="number"&&M8(D)!==J-F)throw new L$({offset:J,position:"end",size:M8(D)})}function HB(D){if(D>=V1.zero&&D<=V1.nine)return D-V1.zero;if(D>=V1.A&&D<=V1.F)return D-(V1.A-10);if(D>=V1.a&&D<=V1.f)return D-(V1.a-10);return}function _I(D,F={}){let{dir:J,size:Q=32}=F;if(Q===0)return D;if(D.length>Q)throw new _B({size:D.length,targetSize:Q,type:"Bytes"});let $=new Uint8Array(Q);for(let Z=0;Z<Q;Z++){let X=J==="right";$[X?Z:Q-Z-1]=D[X?Z:D.length-Z-1]}return $}function zB(D,F={}){let{dir:J="left"}=F,Q=D,$=0;for(let Z=0;Z<Q.length-1;Z++)if(Q[J==="left"?Z:Q.length-Z-1].toString()==="0")$++;else break;return Q=J==="left"?Q.slice($):Q.slice(0,Q.length-$),Q}var V1;var OI=x(()=>{DF();V1={zero:48,nine:57,A:65,F:70,a:97,f:102}});function Z7(D,F){if(TD(D)>F)throw new EB({givenSize:TD(D),maxSize:F})}function MI(D,F){if(typeof F==="number"&&F>0&&F>TD(D)-1)throw new P$({offset:F,position:"start",size:TD(D)})}function EI(D,F,J){if(typeof F==="number"&&typeof J==="number"&&TD(D)!==J-F)throw new P$({offset:J,position:"end",size:TD(D)})}function OB(D,F={}){let{dir:J,size:Q=32}=F;if(Q===0)return D;let $=D.replace("0x","");if($.length>Q*2)throw new RB({size:Math.ceil($.length/2),targetSize:Q,type:"Hex"});return`0x${$[J==="right"?"padEnd":"padStart"](Q*2,"0")}`}function RI(D,F={}){let{dir:J="left"}=F,Q=D.replace("0x",""),$=0;for(let Z=0;Z<Q.length-1;Z++)if(Q[J==="left"?Z:Q.length-Z-1].toString()==="0")$++;else break;if(Q=J==="left"?Q.slice($):Q.slice(0,Q.length-$),Q==="0")return"0x";if(J==="right"&&Q.length%2===1)return`0x${Q}0`;return`0x${Q}`}var MB=x(()=>{X0()});function FF(D,F,J){return JSON.stringify(D,(Q,$)=>{if(typeof F==="function")return F(Q,$);if(typeof $==="bigint")return $.toString()+"#__bigint";return $},J)}function Aa(D){if(D instanceof Uint8Array)return;if(!D)throw new w4(D);if(typeof D!=="object")throw new w4(D);if(!("BYTES_PER_ELEMENT"in D))throw new w4(D);if(D.BYTES_PER_ELEMENT!==1||D.constructor.name!=="Uint8Array")throw new w4(D)}function wI(D){if(D instanceof Uint8Array)return D;if(typeof D==="string")return X7(D);return wa(D)}function wa(D){return D instanceof Uint8Array?D:new Uint8Array(D)}function X7(D,F={}){let{size:J}=F,Q=D;if(J)Z7(D,J),Q=j2(D,J);let $=Q.slice(2);if($.length%2)$=`0${$}`;let Z=$.length/2,X=new Uint8Array(Z);for(let Y=0,q=0;Y<Z;Y++){let G=HB($.charCodeAt(q++)),W=HB($.charCodeAt(q++));if(G===void 0||W===void 0)throw new d(`Invalid byte sequence ("${$[q-2]}${$[q-1]}" in "${$}").`);X[Y]=G<<4|W}return X}function II(D,F={}){let{size:J}=F,Q=Ra.encode(D);if(typeof J==="number")return $7(Q,J),Ia(Q,J);return Q}function Ia(D,F){return _I(D,{dir:"right",size:F})}function M8(D){return D.length}function NI(D,F,J,Q={}){let{strict:$}=Q;zI(D,F);let Z=D.slice(F,J);if($)CI(Z,F,J);return Z}function TI(D,F={}){let{size:J}=F;if(typeof J<"u")$7(D,J);let Q=dD(D,F);return wB(Q,F)}function LI(D,F={}){let{size:J}=F,Q=D;if(typeof J<"u")$7(Q,J),Q=AB(Q);if(Q.length>1||Q[0]>1)throw new SI(Q);return Boolean(Q[0])}function P2(D,F={}){let{size:J}=F;if(typeof J<"u")$7(D,J);let Q=dD(D,F);return S$(Q,F)}function PI(D,F={}){let{size:J}=F,Q=D;if(typeof J<"u")$7(Q,J),Q=Na(Q);return Ea.decode(Q)}function AB(D){return zB(D,{dir:"left"})}function Na(D){return zB(D,{dir:"right"})}function jI(D){try{return Aa(D),!0}catch{return!1}}var Ea,Ra,SI,w4,CB,L$,_B;var DF=x(()=>{a0();X0();OI();MB();Ea=new TextDecoder,Ra=new TextEncoder;SI=class SI extends d{constructor(D){super(`Bytes value \`${D}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}};w4=class w4 extends d{constructor(D){super(`Value \`${typeof D==="object"?FF(D):D}\` of type \`${typeof D}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}};CB=class CB extends d{constructor({givenSize:D,maxSize:F}){super(`Size cannot exceed \`${F}\` bytes. Given size: \`${D}\` bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}};L$=class L$ extends d{constructor({offset:D,position:F,size:J}){super(`Slice ${F==="start"?"starting":"ending"} at offset \`${D}\` is out-of-bounds (size: \`${J}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}};_B=class _B extends d{constructor({size:D,targetSize:F,type:J}){super(`${J.charAt(0).toUpperCase()}${J.slice(1).toLowerCase()} size (\`${D}\`) exceeds padding size (\`${F}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}});function Pa(D,F={}){let{strict:J=!1}=F;if(!D)throw new IB(D);if(typeof D!=="string")throw new IB(D);if(J){if(!/^0x[0-9a-fA-F]*$/.test(D))throw new NB(D)}if(!D.startsWith("0x"))throw new NB(D)}function yD(...D){return`0x${D.reduce((F,J)=>F+J.replace("0x",""),"")}`}function Y7(D){if(D instanceof Uint8Array)return dD(D);if(Array.isArray(D))return dD(new Uint8Array(D));return D}function x$(D,F={}){let J=`0x${Number(D)}`;if(typeof F.size==="number")return Z7(J,F.size),H1(J,F.size);return J}function dD(D,F={}){let J="";for(let $=0;$<D.length;$++)J+=La[D[$]];let Q=`0x${J}`;if(typeof F.size==="number")return Z7(Q,F.size),j2(Q,F.size);return Q}function KD(D,F={}){let{signed:J,size:Q}=F,$=BigInt(D),Z;if(Q)if(J)Z=(1n<<BigInt(Q)*8n-1n)-1n;else Z=2n**(BigInt(Q)*8n)-1n;else if(typeof D==="number")Z=BigInt(Number.MAX_SAFE_INTEGER);let X=typeof Z==="bigint"&&J?-Z-1n:0;if(Z&&$>Z||$<X){let G=typeof D==="bigint"?"n":"";throw new k$({max:Z?`${Z}${G}`:void 0,min:`${X}${G}`,signed:J,size:Q,value:`${D}${G}`})}let q=`0x${(J&&$<0?BigInt.asUintN(Q*8,BigInt($)):$).toString(16)}`;if(Q)return H1(q,Q);return q}function q7(D,F={}){return dD(Ta.encode(D),F)}function H1(D,F){return OB(D,{dir:"left",size:F})}function j2(D,F){return OB(D,{dir:"right",size:F})}function LD(D,F,J,Q={}){let{strict:$}=Q;MI(D,F);let Z=`0x${D.replace("0x","").slice((F??0)*2,(J??D.length)*2)}`;if($)EI(Z,F,J);return Z}function TD(D){return Math.ceil((D.length-2)/2)}function TB(D){return RI(D,{dir:"left"})}function wB(D,F={}){let{signed:J}=F;if(F.size)Z7(D,F.size);let Q=BigInt(D);if(!J)return Q;let $=(D.length-2)/2,Z=(1n<<BigInt($)*8n)-1n,X=Z>>1n;if(Q<=X)return Q;return Q-Z-1n}function S$(D,F={}){let{signed:J,size:Q}=F;if(!J&&!Q)return Number(D);return Number(wB(D,F))}function I4(D,F={}){let{strict:J=!1}=F;try{return Pa(D,{strict:J}),!0}catch{return!1}}var Ta,La,k$,IB,NB,EB,P$,RB;var X0=x(()=>{a0();MB();Ta=new TextEncoder,La=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"));k$=class k$ extends d{constructor({max:D,min:F,signed:J,size:Q,value:$}){super(`Number \`${$}\` is not in safe${Q?` ${Q*8}-bit`:""}${J?" signed":" unsigned"} integer range ${D?`(\`${F}\` to \`${D}\`)`:`(above \`${F}\`)`}`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};IB=class IB extends d{constructor(D){super(`Value \`${typeof D==="object"?FF(D):D}\` of type \`${typeof D}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}};NB=class NB extends d{constructor(D){super(`Value \`${D}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}};EB=class EB extends d{constructor({givenSize:D,maxSize:F}){super(`Size cannot exceed \`${F}\` bytes. Given size: \`${D}\` bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};P$=class P$ extends d{constructor({offset:D,position:F,size:J}){super(`Slice ${F==="start"?"starting":"ending"} at offset \`${D}\` is out-of-bounds (size: \`${J}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}};RB=class RB extends d{constructor({size:D,targetSize:F,type:J}){super(`${J.charAt(0).toUpperCase()}${J.slice(1).toLowerCase()} size (\`${D}\`) exceeds padding size (\`${F}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}});function xI(D){return{address:D.address,amount:KD(D.amount),index:KD(D.index),validatorIndex:KD(D.validatorIndex)}}var kI=x(()=>{X0()});function y$(D){return{...typeof D.baseFeePerGas==="bigint"&&{baseFeePerGas:KD(D.baseFeePerGas)},...typeof D.blobBaseFee==="bigint"&&{blobBaseFee:KD(D.blobBaseFee)},...typeof D.feeRecipient==="string"&&{feeRecipient:D.feeRecipient},...typeof D.gasLimit==="bigint"&&{gasLimit:KD(D.gasLimit)},...typeof D.number==="bigint"&&{number:KD(D.number)},...typeof D.prevRandao==="bigint"&&{prevRandao:KD(D.prevRandao)},...typeof D.time==="bigint"&&{time:KD(D.time)},...D.withdrawals&&{withdrawals:D.withdrawals.map(xI)}}}var LB=x(()=>{X0();kI()});var JF,f$,fI,h$,hI,PB,jB,SB,N4,G7,b$;var z1=x(()=>{JF=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],f$=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],fI=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],h$=[...fI,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],hI=[...fI,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],PB=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],jB=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],SB=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],N4=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],G7=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],b$=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}]});var bI="0x82ad56cb";var v$="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",vI="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",uI="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",W7="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";var B7,xB,kB,u$;var g$=x(()=>{s();B7=class B7 extends P{constructor({blockNumber:D,chain:F,contract:J}){super(`Chain "${F.name}" does not support contract "${J.name}".`,{metaMessages:["This could be due to any of the following:",...D&&J.blockCreated&&J.blockCreated>D?[`- The contract "${J.name}" was not deployed until block ${J.blockCreated} (current block ${D}).`]:[`- The chain does not have the contract "${J.name}" configured.`]],name:"ChainDoesNotSupportContract"})}};xB=class xB extends P{constructor({chain:D,currentChainId:F}){super(`The current chain of the wallet (id: ${F}) does not match the target chain for the transaction (id: ${D.id} – ${D.name}).`,{metaMessages:[`Current Chain ID: ${F}`,`Expected Chain ID: ${D.id} – ${D.name}`],name:"ChainMismatchError"})}};kB=class kB extends P{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
|
|
71
|
+
`),{name:"ChainNotFoundError"})}};u$=class u$ extends P{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}});function K3(D){let{abi:F,args:J,bytecode:Q}=D;if(!J||J.length===0)return Q;let $=F.find((X)=>("type"in X)&&X.type==="constructor");if(!$)throw new lG({docsPath:yB});if(!("inputs"in $))throw new uQ({docsPath:yB});if(!$.inputs||$.inputs.length===0)throw new uQ({docsPath:yB});let Z=iD($.inputs,J);return m8([Q,Z])}var yB="/docs/contract/encodeDeployData";var m$=x(()=>{gD();_2()});function E8({blockNumber:D,chain:F,contract:J}){let Q=F?.contracts?.[J];if(!Q)throw new B7({chain:F,contract:{name:J}});if(D&&Q.blockCreated&&Q.blockCreated>D)throw new B7({blockNumber:D,chain:F,contract:{name:J,blockCreated:Q.blockCreated}});return Q.address}var U3=x(()=>{g$()});function d$(D,{docsPath:F,...J}){let Q=(()=>{let $=s1(D,J);if($ instanceof c8)return D;return $})();return new A6(Q,{docsPath:F,...J})}var fB=x(()=>{Z1();Y3();M4()});function K7(){let D=()=>{return},F=()=>{return};return{promise:new Promise((Q,$)=>{D=Q,F=$}),resolve:D,reject:F}}function p$({fn:D,id:F,shouldSplitBatch:J,wait:Q=0,sort:$}){let Z=async()=>{let W=q();X();let B=W.map(({args:K})=>K);if(B.length===0)return;D(B).then((K)=>{if($&&Array.isArray(K))K.sort($);for(let U=0;U<W.length;U++){let{resolve:V}=W[U];V?.([K[U],K])}}).catch((K)=>{for(let U=0;U<W.length;U++){let{reject:V}=W[U];V?.(K)}})},X=()=>hB.delete(F),Y=()=>q().map(({args:W})=>W),q=()=>hB.get(F)||[],G=(W)=>hB.set(F,[...q(),W]);return{flush:X,async schedule(W){let{promise:B,resolve:K,reject:U}=K7();if(J?.([...Y(),W]))Z();if(q().length>0)return G({args:W,resolve:K,reject:U}),B;return G({args:W,resolve:K,reject:U}),setTimeout(Z,Q),B}}}var hB;var bB=x(()=>{hB=new Map});var vB,uB,gB;var gI=x(()=>{s();vB=class vB extends P{constructor({callbackSelector:D,cause:F,data:J,extraData:Q,sender:$,urls:Z}){super(F.shortMessage||"An error occurred while fetching for an offchain result.",{cause:F,metaMessages:[...F.metaMessages||[],F.metaMessages?.length?"":[],"Offchain Gateway Call:",Z&&[" Gateway URL(s):",...Z.map((X)=>` ${rF(X)}`)],` Sender: ${$}`,` Data: ${J}`,` Callback selector: ${D}`,` Extra data: ${Q}`].flat(),name:"OffchainLookupError"})}};uB=class uB extends P{constructor({result:D,url:F}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${rF(F)}`,`Response: ${qD(D)}`],name:"OffchainLookupResponseMalformedError"})}};gB=class gB extends P{constructor({sender:D,to:F}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${F}`,`OffchainLookup sender address: ${D}`],name:"OffchainLookupSenderMismatchError"})}}});function mI(D){let{abi:F,data:J}=D,Q=C2(J,0,4),$=F.find((Z)=>Z.type==="function"&&Q===O2(eD(Z)));if(!$)throw new sG(Q,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:$.name,args:"inputs"in $&&$.inputs&&$.inputs.length>0?$1($.inputs,C2(J,4)):void 0}}var dI=x(()=>{gD();oF();_6();e9();t2()});function dB(D){let{abi:F,errorName:J,args:Q}=D,$=F[0];if(J){let q=l0({abi:F,args:Q,name:J});if(!q)throw new gQ(J,{docsPath:mB});$=q}if($.type!=="error")throw new gQ(void 0,{docsPath:mB});let Z=eD($),X=O2(Z),Y="0x";if(Q&&Q.length>0){if(!$.inputs)throw new oG($.name,{docsPath:mB});Y=iD($.inputs,Q)}return m8([X,Y])}var mB="/docs/contract/encodeErrorResult";var pI=x(()=>{gD();_6();_2();t2();g1()});function lI(D){let{abi:F,functionName:J,result:Q}=D,$=F[0];if(J){let X=l0({abi:F,name:J});if(!X)throw new K2(J,{docsPath:pB});$=X}if($.type!=="function")throw new K2(void 0,{docsPath:pB});if(!$.outputs)throw new l9($.name,{docsPath:pB});let Z=(()=>{if($.outputs.length===0)return[];if($.outputs.length===1)return[Q];if(Array.isArray(Q))return Q;throw new c9(Q)})();return iD($.outputs,Z)}var pB="/docs/contract/encodeFunctionResult";var cI=x(()=>{gD();_2();g1()});async function lB(D){let{data:F,ccipRequest:J}=D,{args:[Q]}=mI({abi:f$,data:F}),$=[],Z=[];return await Promise.all(Q.map(async(X,Y)=>{try{Z[Y]=X.urls.includes(C1)?await lB({data:X.data,ccipRequest:J}):await J(X),$[Y]=!1}catch(q){$[Y]=!0,Z[Y]=Sa(q)}})),lI({abi:f$,functionName:"query",result:[$,Z]})}function Sa(D){if(D.name==="HttpRequestError"&&D.status)return dB({abi:f$,errorName:"HttpError",args:[D.status,D.shortMessage]});return dB({abi:[Z$],errorName:"Error",args:["shortMessage"in D?D.shortMessage:D.message]})}var C1="x-batch-gateway:true";var T4=x(()=>{z1();X$();dI();pI();cI()});var oI={};K8(oI,{offchainLookupSignature:()=>xa,offchainLookupAbiItem:()=>nI,offchainLookup:()=>ka,ccipRequest:()=>iI});async function ka(D,{blockNumber:F,blockTag:J,data:Q,to:$}){let{args:Z}=G$({data:Q,abi:[nI]}),[X,Y,q,G,W]=Z,{ccipRead:B}=D,K=B&&typeof B?.request==="function"?B.request:iI;try{if(!O8($,X))throw new gB({sender:X,to:$});let U=Y.includes(C1)?await lB({data:q,ccipRequest:K}):await K({data:q,sender:X,urls:Y}),{data:V}=await S2(D,{blockNumber:F,blockTag:J,data:nD([G,iD([{type:"bytes"},{type:"bytes"}],[U,W])]),to:$});return V}catch(U){throw new vB({callbackSelector:G,cause:U,data:Q,extraData:W,sender:X,urls:Y})}}async function iI({data:D,sender:F,urls:J}){let Q=Error("An unknown error occurred.");for(let $=0;$<J.length;$++){let Z=J[$],X=Z.includes("{data}")?"GET":"POST",Y=X==="POST"?{data:D,sender:F}:void 0,q=X==="POST"?{"Content-Type":"application/json"}:{};try{let G=await fetch(Z.replace("{sender}",F.toLowerCase()).replace("{data}",D),{body:JSON.stringify(Y),headers:q,method:X}),W;if(G.headers.get("Content-Type")?.startsWith("application/json"))W=(await G.json()).data;else W=await G.text();if(!G.ok){Q=new p8({body:Y,details:W?.error?qD(W.error):G.statusText,headers:G.headers,status:G.status,url:Z});continue}if(!e(W)){Q=new uB({result:W,url:Z});continue}return W}catch(G){Q=new p8({body:Y,details:G.message,url:Z})}}throw Q}var xa="0x556f1830",nI;var aI=x(()=>{U7();gI();tF();MW();_2();G3();T4();nI={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function S2(D,F){let{account:J=D.account,authorizationList:Q,batch:$=Boolean(D.batch?.multicall),blockNumber:Z,blockTag:X=D.experimental_blockTag??"latest",accessList:Y,blobs:q,blockOverrides:G,code:W,data:B,factory:K,factoryData:U,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:M,nonce:C,to:O,value:E,stateOverride:A,...N}=F,w=J?i(J):void 0;if(W&&(K||U))throw new P("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(W&&O)throw new P("Cannot provide both `code` & `to` as parameters.");let T=W&&B,I=K&&U&&O&&B,S=T||I,L=(()=>{if(T)return rI({code:W,data:B});if(I)return ha({data:B,factory:K,factoryData:U,to:O});return B})();try{$0(F);let m=(typeof Z==="bigint"?k(Z):void 0)||X,j=G?y$(G):void 0,h=r6(A),g=D.chain?.formatters?.transactionRequest?.format,u=(g||Q0)({...i0(N,{format:g}),accessList:Y,account:w,authorizationList:Q,blobs:q,data:L,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:M,nonce:C,to:S?void 0:O,value:E},"call");if($&&ya({request:u})&&!h&&!j)try{return await fa(D,{...u,blockNumber:Z,blockTag:X})}catch(ED){if(!(ED instanceof u$)&&!(ED instanceof B7))throw ED}let o=(()=>{let ED=[u,m];if(h&&j)return[...ED,h,j];if(h)return[...ED,h];if(j)return[...ED,{},j];return ED})(),lD=await D.request({method:"eth_call",params:o});if(lD==="0x")return{data:void 0};return{data:lD}}catch(y){let m=ba(y),{offchainLookup:j,offchainLookupSignature:h}=await Promise.resolve().then(() => (aI(),oI));if(D.ccipRead!==!1&&m?.slice(0,10)===h&&O)return{data:await j(D,{data:m,to:O})};if(S&&m?.slice(0,10)==="0x101bb98d")throw new K$({factory:K});throw d$(y,{...F,account:w,chain:D.chain})}}function ya({request:D}){let{data:F,to:J,...Q}=D;if(!F)return!1;if(F.startsWith(bI))return!1;if(!J)return!1;if(Object.values(Q).filter(($)=>typeof $<"u").length>0)return!1;return!0}async function fa(D,F){let{batchSize:J=1024,deployless:Q=!1,wait:$=0}=typeof D.batch?.multicall==="object"?D.batch.multicall:{},{blockNumber:Z,blockTag:X=D.experimental_blockTag??"latest",data:Y,to:q}=F,G=(()=>{if(Q)return null;if(F.multicallAddress)return F.multicallAddress;if(D.chain)return E8({blockNumber:Z,chain:D.chain,contract:"multicall3"});throw new u$})(),B=(typeof Z==="bigint"?k(Z):void 0)||X,{schedule:K}=p$({id:`${D.uid}.${B}`,wait:$,shouldSplitBatch(H){return H.reduce((_,{data:M})=>_+(M.length-2),0)>J*2},fn:async(H)=>{let z=H.map((C)=>({allowFailure:!0,callData:C.data,target:C.to})),_=AD({abi:JF,args:[z],functionName:"aggregate3"}),M=await D.request({method:"eth_call",params:[{...G===null?{data:rI({code:W7,data:_})}:{to:G,data:_}},B]});return o0({abi:JF,args:[z],functionName:"aggregate3",data:M||"0x"})}}),[{returnData:U,success:V}]=await K({data:Y,to:q});if(!V)throw new w2({data:U});if(U==="0x")return{data:void 0};return{data:U}}function rI(D){let{code:F,data:J}=D;return K3({abi:u9(["constructor(bytes, bytes)"]),bytecode:v$,args:[F,J]})}function ha(D){let{data:F,factory:J,factoryData:Q,to:$}=D;return K3({abi:u9(["constructor(address, bytes, address, bytes)"]),bytecode:vI,args:[$,F,J,Q]})}function ba(D){if(!(D instanceof P))return;let F=D.walk();return typeof F?.data==="object"?F.data?.data:F.data}var U7=x(()=>{C6();LB();z1();s();g$();Z1();e1();m$();X8();U3();c();fB();N2();bB();R$();T2()});var hL=R((mcD,IZ)=>{/*!
|
|
72
|
+
* bytes
|
|
73
|
+
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
74
|
+
* Copyright(c) 2015 Jed Watson
|
|
75
|
+
* MIT Licensed
|
|
76
|
+
*/IZ.exports=Ys;IZ.exports.format=yL;IZ.exports.parse=fL;var $s=/\B(?=(\d{3})+(?!\d))/g,Zs=/(?:\.0*|(\.[^0]+)0+)$/,GF={b:1,kb:1024,mb:1048576,gb:1073741824,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Xs=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Ys(D,F){if(typeof D==="string")return fL(D);if(typeof D==="number")return yL(D,F);return null}function yL(D,F){if(!Number.isFinite(D))return null;var J=Math.abs(D),Q=F&&F.thousandsSeparator||"",$=F&&F.unitSeparator||"",Z=F&&F.decimalPlaces!==void 0?F.decimalPlaces:2,X=Boolean(F&&F.fixedDecimals),Y=F&&F.unit||"";if(!Y||!GF[Y.toLowerCase()])if(J>=GF.pb)Y="PB";else if(J>=GF.tb)Y="TB";else if(J>=GF.gb)Y="GB";else if(J>=GF.mb)Y="MB";else if(J>=GF.kb)Y="KB";else Y="B";var q=D/GF[Y.toLowerCase()],G=q.toFixed(Z);if(!X)G=G.replace(Zs,"$1");if(Q)G=G.split(".").map(function(W,B){return B===0?W.replace($s,Q):W}).join(".");return G+$+Y}function fL(D){if(typeof D==="number"&&!isNaN(D))return D;if(typeof D!=="string")return null;var F=Xs.exec(D),J,Q="b";if(!F)J=parseInt(D,10),Q="b";else J=parseFloat(F[1]),Q=F[4].toLowerCase();if(isNaN(J))return null;return Math.floor(GF[Q]*J)}});var EP=R((fnD,FU)=>{var ps=Object.prototype.hasOwnProperty,y0="~";function i4(){}if(Object.create){if(i4.prototype=Object.create(null),!new i4().__proto__)y0=!1}function ls(D,F,J){this.fn=D,this.context=F,this.once=J||!1}function MP(D,F,J,Q,$){if(typeof J!=="function")throw TypeError("The listener must be a function");var Z=new ls(J,Q||D,$),X=y0?y0+F:F;if(!D._events[X])D._events[X]=Z,D._eventsCount++;else if(!D._events[X].fn)D._events[X].push(Z);else D._events[X]=[D._events[X],Z];return D}function uZ(D,F){if(--D._eventsCount===0)D._events=new i4;else delete D._events[F]}function A0(){this._events=new i4,this._eventsCount=0}A0.prototype.eventNames=function(){var F=[],J,Q;if(this._eventsCount===0)return F;for(Q in J=this._events)if(ps.call(J,Q))F.push(y0?Q.slice(1):Q);if(Object.getOwnPropertySymbols)return F.concat(Object.getOwnPropertySymbols(J));return F};A0.prototype.listeners=function(F){var J=y0?y0+F:F,Q=this._events[J];if(!Q)return[];if(Q.fn)return[Q.fn];for(var $=0,Z=Q.length,X=Array(Z);$<Z;$++)X[$]=Q[$].fn;return X};A0.prototype.listenerCount=function(F){var J=y0?y0+F:F,Q=this._events[J];if(!Q)return 0;if(Q.fn)return 1;return Q.length};A0.prototype.emit=function(F,J,Q,$,Z,X){var Y=y0?y0+F:F;if(!this._events[Y])return!1;var q=this._events[Y],G=arguments.length,W,B;if(q.fn){if(q.once)this.removeListener(F,q.fn,void 0,!0);switch(G){case 1:return q.fn.call(q.context),!0;case 2:return q.fn.call(q.context,J),!0;case 3:return q.fn.call(q.context,J,Q),!0;case 4:return q.fn.call(q.context,J,Q,$),!0;case 5:return q.fn.call(q.context,J,Q,$,Z),!0;case 6:return q.fn.call(q.context,J,Q,$,Z,X),!0}for(B=1,W=Array(G-1);B<G;B++)W[B-1]=arguments[B];q.fn.apply(q.context,W)}else{var K=q.length,U;for(B=0;B<K;B++){if(q[B].once)this.removeListener(F,q[B].fn,void 0,!0);switch(G){case 1:q[B].fn.call(q[B].context);break;case 2:q[B].fn.call(q[B].context,J);break;case 3:q[B].fn.call(q[B].context,J,Q);break;case 4:q[B].fn.call(q[B].context,J,Q,$);break;default:if(!W)for(U=1,W=Array(G-1);U<G;U++)W[U-1]=arguments[U];q[B].fn.apply(q[B].context,W)}}}return!0};A0.prototype.on=function(F,J,Q){return MP(this,F,J,Q,!1)};A0.prototype.once=function(F,J,Q){return MP(this,F,J,Q,!0)};A0.prototype.removeListener=function(F,J,Q,$){var Z=y0?y0+F:F;if(!this._events[Z])return this;if(!J)return uZ(this,Z),this;var X=this._events[Z];if(X.fn){if(X.fn===J&&(!$||X.once)&&(!Q||X.context===Q))uZ(this,Z)}else{for(var Y=0,q=[],G=X.length;Y<G;Y++)if(X[Y].fn!==J||$&&!X[Y].once||Q&&X[Y].context!==Q)q.push(X[Y]);if(q.length)this._events[Z]=q.length===1?q[0]:q;else uZ(this,Z)}return this};A0.prototype.removeAllListeners=function(F){var J;if(F){if(J=y0?y0+F:F,this._events[J])uZ(this,J)}else this._events=new i4,this._eventsCount=0;return this};A0.prototype.off=A0.prototype.removeListener;A0.prototype.addListener=A0.prototype.on;A0.prefixed=y0;A0.EventEmitter=A0;if(typeof FU<"u")FU.exports=A0});var PP=R((IiD,LP)=>{LP.exports=Dt;function k7(D){if(D instanceof Buffer)return Buffer.from(D);return new D.constructor(D.buffer.slice(),D.byteOffset,D.length)}function Dt(D){if(D=D||{},D.circles)return Ft(D);let F=new Map;if(F.set(Date,(X)=>new Date(X)),F.set(Map,(X,Y)=>new Map(Q(Array.from(X),Y))),F.set(Set,(X,Y)=>new Set(Q(Array.from(X),Y))),D.constructorHandlers)for(let X of D.constructorHandlers)F.set(X[0],X[1]);let J=null;return D.proto?Z:$;function Q(X,Y){let q=Object.keys(X),G=Array(q.length);for(let W=0;W<q.length;W++){let B=q[W],K=X[B];if(typeof K!=="object"||K===null)G[B]=K;else if(K.constructor!==Object&&(J=F.get(K.constructor)))G[B]=J(K,Y);else if(ArrayBuffer.isView(K))G[B]=k7(K);else G[B]=Y(K)}return G}function $(X){if(typeof X!=="object"||X===null)return X;if(Array.isArray(X))return Q(X,$);if(X.constructor!==Object&&(J=F.get(X.constructor)))return J(X,$);let Y={};for(let q in X){if(Object.hasOwnProperty.call(X,q)===!1)continue;let G=X[q];if(typeof G!=="object"||G===null)Y[q]=G;else if(G.constructor!==Object&&(J=F.get(G.constructor)))Y[q]=J(G,$);else if(ArrayBuffer.isView(G))Y[q]=k7(G);else Y[q]=$(G)}return Y}function Z(X){if(typeof X!=="object"||X===null)return X;if(Array.isArray(X))return Q(X,Z);if(X.constructor!==Object&&(J=F.get(X.constructor)))return J(X,Z);let Y={};for(let q in X){let G=X[q];if(typeof G!=="object"||G===null)Y[q]=G;else if(G.constructor!==Object&&(J=F.get(G.constructor)))Y[q]=J(G,Z);else if(ArrayBuffer.isView(G))Y[q]=k7(G);else Y[q]=Z(G)}return Y}}function Ft(D){let F=[],J=[],Q=new Map;if(Q.set(Date,(q)=>new Date(q)),Q.set(Map,(q,G)=>new Map(Z(Array.from(q),G))),Q.set(Set,(q,G)=>new Set(Z(Array.from(q),G))),D.constructorHandlers)for(let q of D.constructorHandlers)Q.set(q[0],q[1]);let $=null;return D.proto?Y:X;function Z(q,G){let W=Object.keys(q),B=Array(W.length);for(let K=0;K<W.length;K++){let U=W[K],V=q[U];if(typeof V!=="object"||V===null)B[U]=V;else if(V.constructor!==Object&&($=Q.get(V.constructor)))B[U]=$(V,G);else if(ArrayBuffer.isView(V))B[U]=k7(V);else{let H=F.indexOf(V);if(H!==-1)B[U]=J[H];else B[U]=G(V)}}return B}function X(q){if(typeof q!=="object"||q===null)return q;if(Array.isArray(q))return Z(q,X);if(q.constructor!==Object&&($=Q.get(q.constructor)))return $(q,X);let G={};F.push(q),J.push(G);for(let W in q){if(Object.hasOwnProperty.call(q,W)===!1)continue;let B=q[W];if(typeof B!=="object"||B===null)G[W]=B;else if(B.constructor!==Object&&($=Q.get(B.constructor)))G[W]=$(B,X);else if(ArrayBuffer.isView(B))G[W]=k7(B);else{let K=F.indexOf(B);if(K!==-1)G[W]=J[K];else G[W]=X(B)}}return F.pop(),J.pop(),G}function Y(q){if(typeof q!=="object"||q===null)return q;if(Array.isArray(q))return Z(q,Y);if(q.constructor!==Object&&($=Q.get(q.constructor)))return $(q,Y);let G={};F.push(q),J.push(G);for(let W in q){let B=q[W];if(typeof B!=="object"||B===null)G[W]=B;else if(B.constructor!==Object&&($=Q.get(B.constructor)))G[W]=$(B,Y);else if(ArrayBuffer.isView(B))G[W]=k7(B);else{let K=F.indexOf(B);if(K!==-1)G[W]=J[K];else G[W]=Y(B)}}return F.pop(),J.pop(),G}}});var y7,NiD,TiD,LiD,PiD,jiD,SiD,xiD,kiD,yiD,o4,fiD,hiD,biD,viD,uiD;var jP=x(()=>{y7=globalThis.window?.document!==void 0,NiD=globalThis.process?.versions?.node!==void 0,TiD=globalThis.process?.versions?.bun!==void 0,LiD=globalThis.Deno?.version?.deno!==void 0,PiD=globalThis.process?.versions?.electron!==void 0,jiD=globalThis.navigator?.userAgent?.includes("jsdom")===!0,SiD=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,xiD=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,kiD=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,yiD=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,o4=globalThis.navigator?.userAgentData?.platform,fiD=o4==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",hiD=o4==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",biD=o4==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",viD=o4==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),uiD=o4==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android"});var r4={};K8(r4,{setCwd:()=>kt,scrollUp:()=>Rt,scrollDown:()=>At,link:()=>St,image:()=>xt,iTerm:()=>fP,exitAlternativeScreen:()=>Pt,eraseUp:()=>Et,eraseStartLine:()=>Ot,eraseScreen:()=>mZ,eraseLines:()=>Ct,eraseLine:()=>yP,eraseEndLine:()=>_t,eraseDown:()=>Mt,enterAlternativeScreen:()=>Lt,cursorUp:()=>xP,cursorTo:()=>Zt,cursorShow:()=>zt,cursorSavePosition:()=>Wt,cursorRestorePosition:()=>Bt,cursorPrevLine:()=>Vt,cursorNextLine:()=>Ut,cursorMove:()=>Xt,cursorLeft:()=>kP,cursorHide:()=>Ht,cursorGetPosition:()=>Kt,cursorForward:()=>qt,cursorDown:()=>Yt,cursorBackward:()=>Gt,clearViewport:()=>It,clearTerminal:()=>Tt,clearScreen:()=>wt,beep:()=>jt,ConEmu:()=>hP});import f7 from"node:process";import Jt from"node:os";var UD="\x1B[",h7="\x1B]",A3="\x07",a4=";",SP,Qt,$t,QU,b7=(D)=>{if($t)return"\x1BPtmux;"+D.replaceAll("\x1B","\x1B\x1B")+"\x1B\\";return D},Zt=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");if(typeof F!=="number")return UD+(D+1)+"G";return UD+(F+1)+a4+(D+1)+"H"},Xt=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");let J="";if(D<0)J+=UD+-D+"D";else if(D>0)J+=UD+D+"C";if(F<0)J+=UD+-F+"A";else if(F>0)J+=UD+F+"B";return J},xP=(D=1)=>UD+D+"A",Yt=(D=1)=>UD+D+"B",qt=(D=1)=>UD+D+"C",Gt=(D=1)=>UD+D+"D",kP,Wt,Bt,Kt,Ut,Vt,Ht,zt,Ct=(D)=>{let F="";for(let J=0;J<D;J++)F+=yP+(J<D-1?xP():"");if(D)F+=kP;return F},_t,Ot,yP,Mt,Et,mZ,Rt,At,wt="\x1Bc",It,Nt=()=>{if(y7||!Qt)return!1;let D=Jt.release().split("."),F=Number(D[0]),J=Number(D[2]??0);if(F<10)return!0;if(F===10&&J<10586)return!0;return!1},Tt,Lt,Pt,jt,St=(D,F)=>{let J=b7(`${h7}8${a4}${a4}${F}${A3}`),Q=b7(`${h7}8${a4}${a4}${A3}`);return J+D+Q},xt=(D,F={})=>{let J=`${h7}1337;File=inline=1`;if(F.width)J+=`;width=${F.width}`;if(F.height)J+=`;height=${F.height}`;if(F.preserveAspectRatio===!1)J+=";preserveAspectRatio=0";let Q=Buffer.from(D);return b7(J+`;size=${Q.byteLength}:`+Q.toString("base64")+A3)},fP,hP,kt=(D=QU())=>fP.setCwd(D)+hP.setCwd(D);var $U=x(()=>{jP();SP=!y7&&f7.env.TERM_PROGRAM==="Apple_Terminal",Qt=!y7&&f7.platform==="win32",$t=!y7&&(f7.env.TERM?.startsWith("screen")||f7.env.TERM?.startsWith("tmux")||f7.env.TMUX!==void 0),QU=y7?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:f7.cwd,kP=UD+"G",Wt=SP?"\x1B7":UD+"s",Bt=SP?"\x1B8":UD+"u",Kt=UD+"6n",Ut=UD+"E",Vt=UD+"F",Ht=UD+"?25l",zt=UD+"?25h",_t=UD+"K",Ot=UD+"1K",yP=UD+"2K",Mt=UD+"J",Et=UD+"1J",mZ=UD+"2J",Rt=UD+"S",At=UD+"T",It=`${mZ}${UD}H`,Tt=Nt()?`${mZ}${UD}0f`:`${mZ}${UD}3J${UD}H`,Lt=UD+"?1049h",Pt=UD+"?1049l",jt=A3,fP={setCwd:(D=QU())=>b7(`${h7}50;CurrentDir=${D}${A3}`),annotation(D,F={}){let J=`${h7}1337;`,Q=F.x!==void 0,$=F.y!==void 0;if((Q||$)&&!(Q&&$&&F.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(D=D.replaceAll("|",""),J+=F.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",F.length>0)J+=(Q?[D,F.length,F.x,F.y]:[F.length,D]).join("|");else J+=D;return b7(J+A3)}},hP={setCwd:(D=QU())=>b7(`${h7}9;9;${D}${A3}`)}});var bP=x(()=>{$U();$U()});function ZU(D,F,{ignoreNonConfigurable:J=!1}={}){let{name:Q}=D;for(let $ of Reflect.ownKeys(F))yt(D,F,$,J);return ht(D,F),gt(D,F,Q),D}var yt=(D,F,J,Q)=>{if(J==="length"||J==="prototype")return;if(J==="arguments"||J==="caller")return;let $=Object.getOwnPropertyDescriptor(D,J),Z=Object.getOwnPropertyDescriptor(F,J);if(!ft($,Z)&&Q)return;Object.defineProperty(D,J,Z)},ft=function(D,F){return D===void 0||D.configurable||D.writable===F.writable&&D.enumerable===F.enumerable&&D.configurable===F.configurable&&(D.writable||D.value===F.value)},ht=(D,F)=>{let J=Object.getPrototypeOf(F);if(J===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,J)},bt=(D,F)=>`/* Wrapped ${D}*/
|
|
77
|
+
${F}`,vt,ut,gt=(D,F,J)=>{let Q=J===""?"":`with ${J.trim()}() `,$=bt.bind(null,Q,F.toString());Object.defineProperty($,"name",ut);let{writable:Z,enumerable:X,configurable:Y}=vt;Object.defineProperty(D,"toString",{value:$,writable:Z,enumerable:X,configurable:Y})};var vP=x(()=>{vt=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ut=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var dZ,uP=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let J,Q=0,$=D.displayName||D.name||"<anonymous>",Z=function(...X){if(dZ.set(Z,++Q),Q===1)J=D.apply(this,X),D=void 0;else if(F.throw===!0)throw Error(`Function \`${$}\` can only be called once`);return J};return ZU(Z,D),dZ.set(Z,Q),Z},gP;var mP=x(()=>{vP();dZ=new WeakMap;uP.callCount=(D)=>{if(!dZ.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return dZ.get(D)};gP=uP});import pZ from"node:process";var dP,mt,pP;var lP=x(()=>{mP();KQ();dP=pZ.stderr.isTTY?pZ.stderr:pZ.stdout.isTTY?pZ.stdout:void 0,mt=dP?gP(()=>{B6(()=>{dP.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},pP=mt});import cP from"node:process";var lZ=!1,v7,u7;var XU=x(()=>{lP();v7={};v7.show=(D=cP.stderr)=>{if(!D.isTTY)return;lZ=!1,D.write("\x1B[?25h")};v7.hide=(D=cP.stderr)=>{if(!D.isTTY)return;pP(),lZ=!0,D.write("\x1B[?25l")};v7.toggle=(D,F)=>{if(D!==void 0)lZ=D;if(lZ)v7.show(F);else v7.hide(F)};u7=v7});function YU({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}function a8(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(dt,"")}var dt;var g7=x(()=>{dt=YU()});function nP(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function s4(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function t4(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}var qU=()=>{};function pt(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function e4(D,{ambiguousAsWide:F=!1}={}){if(pt(D),s4(D)||t4(D)||F&&nP(D))return 2;return 1}var cZ=x(()=>{qU();qU()});var oP=R((WoD,iP)=>{iP.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});function w3(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:J=!0,countAnsiEscapeCodes:Q=!1}=F;if(!Q)D=a8(D);if(D.length===0)return 0;let $=0,Z={ambiguousAsWide:!J};for(let{segment:X}of lt.segment(D)){let Y=X.codePointAt(0);if(Y<=31||Y>=127&&Y<=159)continue;if(Y>=8203&&Y<=8207||Y===65279)continue;if(Y>=768&&Y<=879||Y>=6832&&Y<=6911||Y>=7616&&Y<=7679||Y>=8400&&Y<=8447||Y>=65056&&Y<=65071)continue;if(Y>=55296&&Y<=57343)continue;if(Y>=65024&&Y<=65039)continue;if(ct.test(X))continue;if(aP.default().test(X)){$+=2;continue}$+=e4(Y,Z)}return $}var aP,lt,ct;var rP=x(()=>{g7();cZ();aP=ID(oP(),1),lt=new Intl.Segmenter,ct=/^\p{Default_Ignorable_Code_Point}$/u});function ot(){let D=new Map;for(let[F,J]of Object.entries(SD)){for(let[Q,$]of Object.entries(J))SD[Q]={open:`\x1B[${$[0]}m`,close:`\x1B[${$[1]}m`},J[Q]=SD[Q],D.set($[0],$[1]);Object.defineProperty(SD,F,{value:J,enumerable:!1})}return Object.defineProperty(SD,"codes",{value:D,enumerable:!1}),SD.color.close="\x1B[39m",SD.bgColor.close="\x1B[49m",SD.color.ansi=sP(),SD.color.ansi256=tP(),SD.color.ansi16m=eP(),SD.bgColor.ansi=sP(10),SD.bgColor.ansi256=tP(10),SD.bgColor.ansi16m=eP(10),Object.defineProperties(SD,{rgbToAnsi256:{value(F,J,Q){if(F===J&&J===Q){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(J/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value(F){let J=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!J)return[0,0,0];let[Q]=J;if(Q.length===3)Q=[...Q].map((Z)=>Z+Z).join("");let $=Number.parseInt(Q,16);return[$>>16&255,$>>8&255,$&255]},enumerable:!1},hexToAnsi256:{value:(F)=>SD.rgbToAnsi256(...SD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let J,Q,$;if(F>=232)J=((F-232)*10+8)/255,Q=J,$=J;else{F-=16;let Y=F%36;J=Math.floor(F/36)/5,Q=Math.floor(Y/6)/5,$=Y%6/5}let Z=Math.max(J,Q,$)*2;if(Z===0)return 30;let X=30+(Math.round($)<<2|Math.round(Q)<<1|Math.round(J));if(Z===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:(F,J,Q)=>SD.ansi256ToAnsi(SD.rgbToAnsi256(F,J,Q)),enumerable:!1},hexToAnsi:{value:(F)=>SD.ansi256ToAnsi(SD.hexToAnsi256(F)),enumerable:!1}}),SD}var sP=(D=0)=>(F)=>`\x1B[${F+D}m`,tP=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,eP=(D=0)=>(F,J,Q)=>`\x1B[${38+D};2;${F};${J};${Q}m`,SD,VoD,nt,it,HoD,at,r8;var GU=x(()=>{SD={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]}},VoD=Object.keys(SD.modifier),nt=Object.keys(SD.color),it=Object.keys(SD.bgColor),HoD=[...nt,...it];at=ot(),r8=at});var $j={};K8($j,{default:()=>m7});function m7(D,F,J){return String(D).normalize().replaceAll(`\r
|
|
78
|
+
`,`
|
|
79
|
+
`).split(`
|
|
80
|
+
`).map((Q)=>De(Q,F,J)).join(`
|
|
81
|
+
`)}var iZ,rt=39,BU="\x07",Jj="[",st="]",Qj="m",nZ,Dj=(D)=>`${iZ.values().next().value}${Jj}${D}${Qj}`,Fj=(D)=>`${iZ.values().next().value}${nZ}${D}${BU}`,tt=(D)=>D.split(" ").map((F)=>w3(F)),WU=(D,F,J)=>{let Q=[...F],$=!1,Z=!1,X=w3(a8(D.at(-1)));for(let[Y,q]of Q.entries()){let G=w3(q);if(X+G<=J)D[D.length-1]+=q;else D.push(q),X=0;if(iZ.has(q))$=!0,Z=Q.slice(Y+1,Y+1+nZ.length).join("")===nZ;if($){if(Z){if(q===BU)$=!1,Z=!1}else if(q===Qj)$=!1;continue}if(X+=G,X===J&&Y<Q.length-1)D.push(""),X=0}if(!X&&D.at(-1).length>0&&D.length>1)D[D.length-2]+=D.pop()},et=(D)=>{let F=D.split(" "),J=F.length;while(J>0){if(w3(F[J-1])>0)break;J--}if(J===F.length)return D;return F.slice(0,J).join(" ")+F.slice(J).join("")},De=(D,F,J={})=>{if(J.trim!==!1&&D.trim()==="")return"";let Q="",$,Z,X=tt(D),Y=[""];for(let[B,K]of D.split(" ").entries()){if(J.trim!==!1)Y[Y.length-1]=Y.at(-1).trimStart();let U=w3(Y.at(-1));if(B!==0){if(U>=F&&(J.wordWrap===!1||J.trim===!1))Y.push(""),U=0;if(U>0||J.trim===!1)Y[Y.length-1]+=" ",U++}if(J.hard&&X[B]>F){let V=F-U,H=1+Math.floor((X[B]-V-1)/F);if(Math.floor((X[B]-1)/F)<H)Y.push("");WU(Y,K,F);continue}if(U+X[B]>F&&U>0&&X[B]>0){if(J.wordWrap===!1&&U<F){WU(Y,K,F);continue}Y.push("")}if(U+X[B]>F&&J.wordWrap===!1){WU(Y,K,F);continue}Y[Y.length-1]+=K}if(J.trim!==!1)Y=Y.map((B)=>et(B));let q=Y.join(`
|
|
82
|
+
`),G=[...q],W=0;for(let[B,K]of G.entries()){if(Q+=K,iZ.has(K)){let{groups:V}=new RegExp(`(?:\\${Jj}(?<code>\\d+)m|\\${nZ}(?<uri>.*)${BU})`).exec(q.slice(W))||{groups:{}};if(V.code!==void 0){let H=Number.parseFloat(V.code);$=H===rt?void 0:H}else if(V.uri!==void 0)Z=V.uri.length===0?void 0:V.uri}let U=r8.codes.get(Number($));if(G[B+1]===`
|
|
83
|
+
`){if(Z)Q+=Fj("");if($&&U)Q+=Dj(U)}else if(K===`
|
|
84
|
+
`){if($&&U)Q+=Dj($);if(Z)Q+=Fj(Z)}W+=K.length}return Q};var oZ=x(()=>{rP();g7();GU();iZ=new Set(["\x1B",""]),nZ=`${st}8;;`});function KU(D){if(!Number.isInteger(D))return!1;return s4(D)||t4(D)}var Zj=x(()=>{cZ()});function Ze(D){if(VU.has(D))return D;if(UU.has(D))return UU.get(D);if(D=D.slice(2),D.includes(";"))D=D[0]+"0";let F=r8.codes.get(Number.parseInt(D,10));if(F)return r8.color.ansi(F);return r8.reset.open}function Xe(D){for(let F=0;F<D.length;F++){let J=D.codePointAt(F);if(J>=Je&&J<=Qe)return F}return-1}function Ye(D,F){D=D.slice(F,F+$e);let J=Xe(D);if(J!==-1){let Q=D.indexOf("m",J);if(Q===-1)Q=D.length;return D.slice(0,Q+1)}}function qe(D,F=Number.POSITIVE_INFINITY){let J=[],Q=0,$=0;while(Q<D.length){let Z=D.codePointAt(Q);if(Fe.has(Z)){let q=Ye(D,Q);if(q){J.push({type:"ansi",code:q,endCode:Ze(q)}),Q+=q.length;continue}}let X=KU(Z),Y=String.fromCodePoint(Z);if(J.push({type:"character",value:Y,isFullWidth:X}),Q+=Y.length,$+=X?2:Y.length,$>=F)break}return J}function Xj(D){let F=[];for(let J of D)if(J.code===r8.reset.open)F=[];else if(VU.has(J.code))F=F.filter((Q)=>Q.endCode!==J.code);else F=F.filter((Q)=>Q.endCode!==J.endCode),F.push(J);return F}function Ge(D){return Xj(D).map(({endCode:Q})=>Q).reverse().join("")}function w8(D,F,J){let Q=qe(D,J),$=[],Z=0,X="",Y=!1;for(let q of Q){if(J!==void 0&&Z>=J)break;if(q.type==="ansi"){if($.push(q),Y)X+=q.code}else{if(!Y&&Z>=F)Y=!0,$=Xj($),X=$.map(({code:G})=>G).join("");if(Y)X+=q.value;Z+=q.isFullWidth?2:q.value.length}}return X+=Ge($),X}var Fe,Je,Qe,$e=19,VU,UU;var HU=x(()=>{GU();Zj();Fe=new Set([27,155]),Je="0".codePointAt(0),Qe="9".codePointAt(0),VU=new Set,UU=new Map;for(let[D,F]of r8.codes)VU.add(r8.color.ansi(F)),UU.set(r8.color.ansi(D),r8.color.ansi(F))});var qj={};K8(qj,{logUpdateStderr:()=>Ue,default:()=>Ve,createLogUpdate:()=>CU});import Yj from"node:process";function CU(D,{showCursor:F=!1}={}){let J=0,Q=zU(D),$="",Z=()=>{$="",Q=zU(D),J=0},X=(...Y)=>{if(!F)u7.hide();let q=Be(D,Y.join(" ")+`
|
|
85
|
+
`),G=zU(D);if(q===$&&Q===G)return;$=q,Q=G,q=m7(q,G,{trim:!1,hard:!0,wordWrap:!1}),D.write(r4.eraseLines(J)+q),J=q.split(`
|
|
86
|
+
`).length};return X.clear=()=>{D.write(r4.eraseLines(J)),Z()},X.done=()=>{if(Z(),!F)u7.show()},X}var We=24,zU=({columns:D=80})=>D,Be=(D,F)=>{let J=D.rows??We,Q=F.split(`
|
|
87
|
+
`),$=Math.max(0,Q.length-J);return $?w8(F,a8(Q.slice(0,$).join(`
|
|
88
|
+
`)).length+1):F},Ke,Ve,Ue;var Gj=x(()=>{bP();XU();oZ();HU();g7();Ke=CU(Yj.stdout),Ve=Ke,Ue=CU(Yj.stderr)});function Oe(D){return D.replace(Ce,"")}function Me(D){return ze.test(D)}function Ee(D,F){let J=0;if(D.length>1){for(let Q of D.slice(1))if(Q>=""&&Q<="")J+=e4(Q.codePointAt(0),F)}return J}function KF(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:J=!0,countAnsiEscapeCodes:Q=!1}=F,$=D;if(!Q)$=a8($);if($.length===0)return 0;let Z=0,X={ambiguousAsWide:!J};for(let{segment:Y}of He.segment($)){if(Me(Y))continue;if(_e.test(Y)){Z+=2;continue}let q=Oe(Y).codePointAt(0);Z+=e4(q,X),Z+=Ee(Y,X)}return Z}var He,ze,Ce,_e;var _U=x(()=>{g7();cZ();He=new Intl.Segmenter,ze=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,Ce=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,_e=/^\p{RGI_Emoji}$/v});var Bj={};K8(Bj,{default:()=>Wj});function aZ(D,F,J){if(D.charAt(F)===" ")return F;let Q=J?1:-1;for(let $=0;$<=3;$++){let Z=F+$*Q;if(D.charAt(Z)===" ")return Z}return F}function Wj(D,F,J={}){let{position:Q="end",space:$=!1,preferTruncationOnSpace:Z=!1}=J,{truncationCharacter:X="…"}=J;if(typeof D!=="string")throw TypeError(`Expected \`input\` to be a string, got ${typeof D}`);if(typeof F!=="number")throw TypeError(`Expected \`columns\` to be a number, got ${typeof F}`);if(F<1)return"";let Y=KF(D);if(Y<=F)return D;if(F===1)return X;let q={ESC:27,LEFT_BRACKET:91,LETTER_M:109},G=(V)=>V>=48&&V<=57||V===59;function W(V){let H=0;while(H+2<V.length&&V.codePointAt(H)===q.ESC&&V.codePointAt(H+1)===q.LEFT_BRACKET){let z=H+2;while(z<V.length&&G(V.codePointAt(z)))z++;if(z<V.length&&V.codePointAt(z)===q.LETTER_M){H=z+1;continue}break}return H}function B(V){let H=V.length;while(H>1&&V.codePointAt(H-1)===q.LETTER_M){let z=H-2;while(z>=0&&G(V.codePointAt(z)))z--;if(z>=1&&V.codePointAt(z-1)===q.ESC&&V.codePointAt(z)===q.LEFT_BRACKET){H=z-1;continue}break}return H}function K(V,H){let z=B(V);if(z===V.length)return V+H;return V.slice(0,z)+H+V.slice(z)}function U(V,H){let z=W(H);if(z===0)return V+H;return H.slice(0,z)+V+H.slice(z)}if(Q==="start"){if(Z){let H=aZ(D,Y-F+1,!0),z=w8(D,H,Y).trim();return U(X,z)}if($)X+=" ";let V=w8(D,Y-F+KF(X),Y);return U(X,V)}if(Q==="middle"){if($)X=` ${X} `;let V=Math.floor(F/2);if(Z){let H=aZ(D,V),z=aZ(D,Y-(F-V)+1,!0);return w8(D,0,H)+X+w8(D,z,Y).trim()}return w8(D,0,V)+X+w8(D,Y-(F-V)+KF(X),Y)}if(Q==="end"){if(Z){let H=aZ(D,F-1),z=w8(D,0,H);return K(z,X)}if($)X=` ${X}`;let V=w8(D,0,F-KF(X));return K(V,X)}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${Q}`)}var Kj=x(()=>{HU();_U()});var WD=R((WDD)=>{var IU=Symbol.for("yaml.alias"),Lj=Symbol.for("yaml.document"),DX=Symbol.for("yaml.map"),Pj=Symbol.for("yaml.pair"),NU=Symbol.for("yaml.scalar"),FX=Symbol.for("yaml.seq"),_1=Symbol.for("yaml.node.type"),QDD=(D)=>!!D&&typeof D==="object"&&D[_1]===IU,$DD=(D)=>!!D&&typeof D==="object"&&D[_1]===Lj,ZDD=(D)=>!!D&&typeof D==="object"&&D[_1]===DX,XDD=(D)=>!!D&&typeof D==="object"&&D[_1]===Pj,jj=(D)=>!!D&&typeof D==="object"&&D[_1]===NU,YDD=(D)=>!!D&&typeof D==="object"&&D[_1]===FX;function Sj(D){if(D&&typeof D==="object")switch(D[_1]){case DX:case FX:return!0}return!1}function qDD(D){if(D&&typeof D==="object")switch(D[_1]){case IU:case DX:case NU:case FX:return!0}return!1}var GDD=(D)=>(jj(D)||Sj(D))&&!!D.anchor;WDD.ALIAS=IU;WDD.DOC=Lj;WDD.MAP=DX;WDD.NODE_TYPE=_1;WDD.PAIR=Pj;WDD.SCALAR=NU;WDD.SEQ=FX;WDD.hasAnchor=GDD;WDD.isAlias=QDD;WDD.isCollection=Sj;WDD.isDocument=$DD;WDD.isMap=ZDD;WDD.isNode=qDD;WDD.isPair=XDD;WDD.isScalar=jj;WDD.isSeq=YDD});var $5=R((TDD)=>{var J0=WD(),s0=Symbol("break visit"),xj=Symbol("skip children"),f2=Symbol("remove node");function JX(D,F){let J=kj(F);if(J0.isDocument(D)){if(l7(null,D.contents,J,Object.freeze([D]))===f2)D.contents=null}else l7(null,D,J,Object.freeze([]))}JX.BREAK=s0;JX.SKIP=xj;JX.REMOVE=f2;function l7(D,F,J,Q){let $=yj(D,F,J,Q);if(J0.isNode($)||J0.isPair($))return fj(D,Q,$),l7(D,$,J,Q);if(typeof $!=="symbol"){if(J0.isCollection(F)){Q=Object.freeze(Q.concat(F));for(let Z=0;Z<F.items.length;++Z){let X=l7(Z,F.items[Z],J,Q);if(typeof X==="number")Z=X-1;else if(X===s0)return s0;else if(X===f2)F.items.splice(Z,1),Z-=1}}else if(J0.isPair(F)){Q=Object.freeze(Q.concat(F));let Z=l7("key",F.key,J,Q);if(Z===s0)return s0;else if(Z===f2)F.key=null;let X=l7("value",F.value,J,Q);if(X===s0)return s0;else if(X===f2)F.value=null}}return $}async function QX(D,F){let J=kj(F);if(J0.isDocument(D)){if(await c7(null,D.contents,J,Object.freeze([D]))===f2)D.contents=null}else await c7(null,D,J,Object.freeze([]))}QX.BREAK=s0;QX.SKIP=xj;QX.REMOVE=f2;async function c7(D,F,J,Q){let $=await yj(D,F,J,Q);if(J0.isNode($)||J0.isPair($))return fj(D,Q,$),c7(D,$,J,Q);if(typeof $!=="symbol"){if(J0.isCollection(F)){Q=Object.freeze(Q.concat(F));for(let Z=0;Z<F.items.length;++Z){let X=await c7(Z,F.items[Z],J,Q);if(typeof X==="number")Z=X-1;else if(X===s0)return s0;else if(X===f2)F.items.splice(Z,1),Z-=1}}else if(J0.isPair(F)){Q=Object.freeze(Q.concat(F));let Z=await c7("key",F.key,J,Q);if(Z===s0)return s0;else if(Z===f2)F.key=null;let X=await c7("value",F.value,J,Q);if(X===s0)return s0;else if(X===f2)F.value=null}}return $}function kj(D){if(typeof D==="object"&&(D.Collection||D.Node||D.Value))return Object.assign({Alias:D.Node,Map:D.Node,Scalar:D.Node,Seq:D.Node},D.Value&&{Map:D.Value,Scalar:D.Value,Seq:D.Value},D.Collection&&{Map:D.Collection,Seq:D.Collection},D);return D}function yj(D,F,J,Q){if(typeof J==="function")return J(D,F,Q);if(J0.isMap(F))return J.Map?.(D,F,Q);if(J0.isSeq(F))return J.Seq?.(D,F,Q);if(J0.isPair(F))return J.Pair?.(D,F,Q);if(J0.isScalar(F))return J.Scalar?.(D,F,Q);if(J0.isAlias(F))return J.Alias?.(D,F,Q);return}function fj(D,F,J){let Q=F[F.length-1];if(J0.isCollection(Q))Q.items[D]=J;else if(J0.isPair(Q))if(D==="key")Q.key=J;else Q.value=J;else if(J0.isDocument(Q))Q.contents=J;else{let $=J0.isAlias(Q)?"alias":"scalar";throw Error(`Cannot replace node with ${$} parent`)}}TDD.visit=JX;TDD.visitAsync=QX});var TU=R((kDD)=>{var hj=WD(),jDD=$5(),SDD={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},xDD=(D)=>D.replace(/[!,[\]{}]/g,(F)=>SDD[F]);class I8{constructor(D,F){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},I8.defaultYaml,D),this.tags=Object.assign({},I8.defaultTags,F)}clone(){let D=new I8(this.yaml,this.tags);return D.docStart=this.docStart,D}atDocument(){let D=new I8(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:I8.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},I8.defaultTags);break}return D}add(D,F){if(this.atNextDocument)this.yaml={explicit:I8.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},I8.defaultTags),this.atNextDocument=!1;let J=D.trim().split(/[ \t]+/),Q=J.shift();switch(Q){case"%TAG":{if(J.length!==2){if(F(0,"%TAG directive should contain exactly two parts"),J.length<2)return!1}let[$,Z]=J;return this.tags[$]=Z,!0}case"%YAML":{if(this.yaml.explicit=!0,J.length!==1)return F(0,"%YAML directive should contain exactly one part"),!1;let[$]=J;if($==="1.1"||$==="1.2")return this.yaml.version=$,!0;else{let Z=/^\d+\.\d+$/.test($);return F(6,`Unsupported YAML version ${$}`,Z),!1}}default:return F(0,`Unknown directive ${Q}`,!0),!1}}tagName(D,F){if(D==="!")return"!";if(D[0]!=="!")return F(`Not a valid tag: ${D}`),null;if(D[1]==="<"){let Z=D.slice(2,-1);if(Z==="!"||Z==="!!")return F(`Verbatim tags aren't resolved, so ${D} is invalid.`),null;if(D[D.length-1]!==">")F("Verbatim tags must end with a >");return Z}let[,J,Q]=D.match(/^(.*!)([^!]*)$/s);if(!Q)F(`The ${D} tag has no suffix`);let $=this.tags[J];if($)try{return $+decodeURIComponent(Q)}catch(Z){return F(String(Z)),null}if(J==="!")return D;return F(`Could not resolve tag: ${D}`),null}tagString(D){for(let[F,J]of Object.entries(this.tags))if(D.startsWith(J))return F+xDD(D.substring(J.length));return D[0]==="!"?D:`!<${D}>`}toString(D){let F=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],J=Object.entries(this.tags),Q;if(D&&J.length>0&&hj.isNode(D.contents)){let $={};jDD.visit(D.contents,(Z,X)=>{if(hj.isNode(X)&&X.tag)$[X.tag]=!0}),Q=Object.keys($)}else Q=[];for(let[$,Z]of J){if($==="!!"&&Z==="tag:yaml.org,2002:")continue;if(!D||Q.some((X)=>X.startsWith(Z)))F.push(`%TAG ${$} ${Z}`)}return F.join(`
|
|
89
|
+
`)}}I8.defaultYaml={explicit:!1,version:"1.2"};I8.defaultTags={"!!":"tag:yaml.org,2002:"};kDD.Directives=I8});var $X=R((vDD)=>{var bj=WD(),fDD=$5();function hDD(D){if(/[\x00-\x19\s,[\]{}]/.test(D)){let J=`Anchor must not contain whitespace or control characters: ${JSON.stringify(D)}`;throw Error(J)}return!0}function vj(D){let F=new Set;return fDD.visit(D,{Value(J,Q){if(Q.anchor)F.add(Q.anchor)}}),F}function uj(D,F){for(let J=1;;++J){let Q=`${D}${J}`;if(!F.has(Q))return Q}}function bDD(D,F){let J=[],Q=new Map,$=null;return{onAnchor:(Z)=>{J.push(Z),$??($=vj(D));let X=uj(F,$);return $.add(X),X},setAnchors:()=>{for(let Z of J){let X=Q.get(Z);if(typeof X==="object"&&X.anchor&&(bj.isScalar(X.node)||bj.isCollection(X.node)))X.node.anchor=X.anchor;else{let Y=Error("Failed to resolve repeated object (this should not happen)");throw Y.source=Z,Y}}},sourceObjects:Q}}vDD.anchorIsValid=hDD;vDD.anchorNames=vj;vDD.createNodeAnchors=bDD;vDD.findNewAnchor=uj});var LU=R((pDD)=>{function Z5(D,F,J,Q){if(Q&&typeof Q==="object")if(Array.isArray(Q))for(let $=0,Z=Q.length;$<Z;++$){let X=Q[$],Y=Z5(D,Q,String($),X);if(Y===void 0)delete Q[$];else if(Y!==X)Q[$]=Y}else if(Q instanceof Map)for(let $ of Array.from(Q.keys())){let Z=Q.get($),X=Z5(D,Q,$,Z);if(X===void 0)Q.delete($);else if(X!==Z)Q.set($,X)}else if(Q instanceof Set)for(let $ of Array.from(Q)){let Z=Z5(D,Q,$,$);if(Z===void 0)Q.delete($);else if(Z!==$)Q.delete($),Q.add(Z)}else for(let[$,Z]of Object.entries(Q)){let X=Z5(D,Q,$,Z);if(X===void 0)delete Q[$];else if(X!==Z)Q[$]=X}return D.call(F,J,Q)}pDD.applyReviver=Z5});var VF=R((nDD)=>{var cDD=WD();function gj(D,F,J){if(Array.isArray(D))return D.map((Q,$)=>gj(Q,String($),J));if(D&&typeof D.toJSON==="function"){if(!J||!cDD.hasAnchor(D))return D.toJSON(F,J);let Q={aliasCount:0,count:1,res:void 0};J.anchors.set(D,Q),J.onCreate=(Z)=>{Q.res=Z,delete J.onCreate};let $=D.toJSON(F,J);if(J.onCreate)J.onCreate($);return $}if(typeof D==="bigint"&&!J?.keep)return Number(D);return D}nDD.toJS=gj});var ZX=R((rDD)=>{var oDD=LU(),mj=WD(),aDD=VF();class dj{constructor(D){Object.defineProperty(this,mj.NODE_TYPE,{value:D})}clone(){let D=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)D.range=this.range.slice();return D}toJS(D,{mapAsMap:F,maxAliasCount:J,onAnchor:Q,reviver:$}={}){if(!mj.isDocument(D))throw TypeError("A document argument is required");let Z={anchors:new Map,doc:D,keep:!0,mapAsMap:F===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},X=aDD.toJS(this,"",Z);if(typeof Q==="function")for(let{count:Y,res:q}of Z.anchors.values())Q(q,Y);return typeof $==="function"?oDD.applyReviver($,{"":X},"",X):X}}rDD.NodeBase=dj});var X5=R((J0D)=>{var tDD=$X(),eDD=$5(),n7=WD(),D0D=ZX(),F0D=VF();class pj extends D0D.NodeBase{constructor(D){super(n7.ALIAS);this.source=D,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(D,F){let J;if(F?.aliasResolveCache)J=F.aliasResolveCache;else if(J=[],eDD.visit(D,{Node:($,Z)=>{if(n7.isAlias(Z)||n7.hasAnchor(Z))J.push(Z)}}),F)F.aliasResolveCache=J;let Q=void 0;for(let $ of J){if($===this)break;if($.anchor===this.source)Q=$}return Q}toJSON(D,F){if(!F)return{source:this.source};let{anchors:J,doc:Q,maxAliasCount:$}=F,Z=this.resolve(Q,F);if(!Z){let Y=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Y)}let X=J.get(Z);if(!X)F0D.toJS(Z,null,F),X=J.get(Z);if(X?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if($>=0){if(X.count+=1,X.aliasCount===0)X.aliasCount=XX(Q,Z,J);if(X.count*X.aliasCount>$)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return X.res}toString(D,F,J){let Q=`*${this.source}`;if(D){if(tDD.anchorIsValid(this.source),D.options.verifyAliasOrder&&!D.anchors.has(this.source)){let $=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error($)}if(D.implicitKey)return`${Q} `}return Q}}function XX(D,F,J){if(n7.isAlias(F)){let Q=F.resolve(D),$=J&&Q&&J.get(Q);return $?$.count*$.aliasCount:0}else if(n7.isCollection(F)){let Q=0;for(let $ of F.items){let Z=XX(D,$,J);if(Z>Q)Q=Z}return Q}else if(n7.isPair(F)){let Q=XX(D,F.key,J),$=XX(D,F.value,J);return Math.max(Q,$)}return 1}J0D.Alias=pj});var rD=R((q0D)=>{var $0D=WD(),Z0D=ZX(),X0D=VF(),Y0D=(D)=>!D||typeof D!=="function"&&typeof D!=="object";class I3 extends Z0D.NodeBase{constructor(D){super($0D.SCALAR);this.value=D}toJSON(D,F){return F?.keep?this.value:X0D.toJS(this.value,D,F)}toString(){return String(this.value)}}I3.BLOCK_FOLDED="BLOCK_FOLDED";I3.BLOCK_LITERAL="BLOCK_LITERAL";I3.PLAIN="PLAIN";I3.QUOTE_DOUBLE="QUOTE_DOUBLE";I3.QUOTE_SINGLE="QUOTE_SINGLE";q0D.Scalar=I3;q0D.isScalarValue=Y0D});var Y5=R((H0D)=>{var B0D=X5(),N3=WD(),lj=rD(),K0D="tag:yaml.org,2002:";function U0D(D,F,J){if(F){let Q=J.filter((Z)=>Z.tag===F),$=Q.find((Z)=>!Z.format)??Q[0];if(!$)throw Error(`Tag ${F} not found`);return $}return J.find((Q)=>Q.identify?.(D)&&!Q.format)}function V0D(D,F,J){if(N3.isDocument(D))D=D.contents;if(N3.isNode(D))return D;if(N3.isPair(D)){let B=J.schema[N3.MAP].createNode?.(J.schema,null,J);return B.items.push(D),B}if(D instanceof String||D instanceof Number||D instanceof Boolean||typeof BigInt<"u"&&D instanceof BigInt)D=D.valueOf();let{aliasDuplicateObjects:Q,onAnchor:$,onTagObj:Z,schema:X,sourceObjects:Y}=J,q=void 0;if(Q&&D&&typeof D==="object")if(q=Y.get(D),q)return q.anchor??(q.anchor=$(D)),new B0D.Alias(q.anchor);else q={anchor:null,node:null},Y.set(D,q);if(F?.startsWith("!!"))F=K0D+F.slice(2);let G=U0D(D,F,X.tags);if(!G){if(D&&typeof D.toJSON==="function")D=D.toJSON();if(!D||typeof D!=="object"){let B=new lj.Scalar(D);if(q)q.node=B;return B}G=D instanceof Map?X[N3.MAP]:(Symbol.iterator in Object(D))?X[N3.SEQ]:X[N3.MAP]}if(Z)Z(G),delete J.onTagObj;let W=G?.createNode?G.createNode(J.schema,D,J):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(J.schema,D,J):new lj.Scalar(D);if(F)W.tag=F;else if(!G.default)W.tag=G.tag;if(q)q.node=W;return W}H0D.createNode=V0D});var YX=R((O0D)=>{var C0D=Y5(),h2=WD(),_0D=ZX();function PU(D,F,J){let Q=J;for(let $=F.length-1;$>=0;--$){let Z=F[$];if(typeof Z==="number"&&Number.isInteger(Z)&&Z>=0){let X=[];X[Z]=Q,Q=X}else Q=new Map([[Z,Q]])}return C0D.createNode(Q,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:D,sourceObjects:new Map})}var cj=(D)=>D==null||typeof D==="object"&&!!D[Symbol.iterator]().next().done;class nj extends _0D.NodeBase{constructor(D,F){super(D);Object.defineProperty(this,"schema",{value:F,configurable:!0,enumerable:!1,writable:!0})}clone(D){let F=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(D)F.schema=D;if(F.items=F.items.map((J)=>h2.isNode(J)||h2.isPair(J)?J.clone(D):J),this.range)F.range=this.range.slice();return F}addIn(D,F){if(cj(D))this.add(F);else{let[J,...Q]=D,$=this.get(J,!0);if(h2.isCollection($))$.addIn(Q,F);else if($===void 0&&this.schema)this.set(J,PU(this.schema,Q,F));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Q}`)}}deleteIn(D){let[F,...J]=D;if(J.length===0)return this.delete(F);let Q=this.get(F,!0);if(h2.isCollection(Q))return Q.deleteIn(J);else throw Error(`Expected YAML collection at ${F}. Remaining path: ${J}`)}getIn(D,F){let[J,...Q]=D,$=this.get(J,!0);if(Q.length===0)return!F&&h2.isScalar($)?$.value:$;else return h2.isCollection($)?$.getIn(Q,F):void 0}hasAllNullValues(D){return this.items.every((F)=>{if(!h2.isPair(F))return!1;let J=F.value;return J==null||D&&h2.isScalar(J)&&J.value==null&&!J.commentBefore&&!J.comment&&!J.tag})}hasIn(D){let[F,...J]=D;if(J.length===0)return this.has(F);let Q=this.get(F,!0);return h2.isCollection(Q)?Q.hasIn(J):!1}setIn(D,F){let[J,...Q]=D;if(Q.length===0)this.set(J,F);else{let $=this.get(J,!0);if(h2.isCollection($))$.setIn(Q,F);else if($===void 0&&this.schema)this.set(J,PU(this.schema,Q,F));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Q}`)}}}O0D.Collection=nj;O0D.collectionFromPath=PU;O0D.isEmptyPath=cj});var q5=R((I0D)=>{var A0D=(D)=>D.replace(/^(?!$)(?: $)?/gm,"#");function jU(D,F){if(/^\n+$/.test(D))return D.substring(1);return F?D.replace(/^(?! *$)/gm,F):D}var w0D=(D,F,J)=>D.endsWith(`
|
|
90
|
+
`)?jU(J,F):J.includes(`
|
|
91
|
+
`)?`
|
|
92
|
+
`+jU(J,F):(D.endsWith(" ")?"":" ")+J;I0D.indentComment=jU;I0D.lineComment=w0D;I0D.stringifyComment=A0D});var oj=R((j0D)=>{function P0D(D,F,J="flow",{indentAtStart:Q,lineWidth:$=80,minContentWidth:Z=20,onFold:X,onOverflow:Y}={}){if(!$||$<0)return D;if($<Z)Z=0;let q=Math.max(1+Z,1+$-F.length);if(D.length<=q)return D;let G=[],W={},B=$-F.length;if(typeof Q==="number")if(Q>$-Math.max(2,Z))G.push(0);else B=$-Q;let K=void 0,U=void 0,V=!1,H=-1,z=-1,_=-1;if(J==="block"){if(H=ij(D,H,F.length),H!==-1)B=H+q}for(let C;C=D[H+=1];){if(J==="quoted"&&C==="\\"){switch(z=H,D[H+1]){case"x":H+=3;break;case"u":H+=5;break;case"U":H+=9;break;default:H+=1}_=H}if(C===`
|
|
93
|
+
`){if(J==="block")H=ij(D,H,F.length);B=H+F.length+q,K=void 0}else{if(C===" "&&U&&U!==" "&&U!==`
|
|
94
|
+
`&&U!=="\t"){let O=D[H+1];if(O&&O!==" "&&O!==`
|
|
95
|
+
`&&O!=="\t")K=H}if(H>=B)if(K)G.push(K),B=K+q,K=void 0;else if(J==="quoted"){while(U===" "||U==="\t")U=C,C=D[H+=1],V=!0;let O=H>_+1?H-2:z-1;if(W[O])return D;G.push(O),W[O]=!0,B=O+q,K=void 0}else V=!0}U=C}if(V&&Y)Y();if(G.length===0)return D;if(X)X();let M=D.slice(0,G[0]);for(let C=0;C<G.length;++C){let O=G[C],E=G[C+1]||D.length;if(O===0)M=`
|
|
96
|
+
${F}${D.slice(0,E)}`;else{if(J==="quoted"&&W[O])M+=`${D[O]}\\`;M+=`
|
|
97
|
+
${F}${D.slice(O+1,E)}`}}return M}function ij(D,F,J){let Q=F,$=F+1,Z=D[$];while(Z===" "||Z==="\t")if(F<$+J)Z=D[++F];else{do Z=D[++F];while(Z&&Z!==`
|
|
98
|
+
`);Q=F,$=F+1,Z=D[$]}return Q}j0D.FOLD_BLOCK="block";j0D.FOLD_FLOW="flow";j0D.FOLD_QUOTED="quoted";j0D.foldFlowLines=P0D});var W5=R((v0D)=>{var s8=rD(),HF=oj(),GX=(D,F)=>({indentAtStart:F?D.indent.length:D.indentAtStart,lineWidth:D.options.lineWidth,minContentWidth:D.options.minContentWidth}),WX=(D)=>/^(%|---|\.\.\.)/m.test(D);function f0D(D,F,J){if(!F||F<0)return!1;let Q=F-J,$=D.length;if($<=Q)return!1;for(let Z=0,X=0;Z<$;++Z)if(D[Z]===`
|
|
99
|
+
`){if(Z-X>Q)return!0;if(X=Z+1,$-X<=Q)return!1}return!0}function G5(D,F){let J=JSON.stringify(D);if(F.options.doubleQuotedAsJSON)return J;let{implicitKey:Q}=F,$=F.options.doubleQuotedMinMultiLineLength,Z=F.indent||(WX(D)?" ":""),X="",Y=0;for(let q=0,G=J[q];G;G=J[++q]){if(G===" "&&J[q+1]==="\\"&&J[q+2]==="n")X+=J.slice(Y,q)+"\\ ",q+=1,Y=q,G="\\";if(G==="\\")switch(J[q+1]){case"u":{X+=J.slice(Y,q);let W=J.substr(q+2,4);switch(W){case"0000":X+="\\0";break;case"0007":X+="\\a";break;case"000b":X+="\\v";break;case"001b":X+="\\e";break;case"0085":X+="\\N";break;case"00a0":X+="\\_";break;case"2028":X+="\\L";break;case"2029":X+="\\P";break;default:if(W.substr(0,2)==="00")X+="\\x"+W.substr(2);else X+=J.substr(q,6)}q+=5,Y=q+1}break;case"n":if(Q||J[q+2]==='"'||J.length<$)q+=1;else{X+=J.slice(Y,q)+`
|
|
100
|
+
|
|
101
|
+
`;while(J[q+2]==="\\"&&J[q+3]==="n"&&J[q+4]!=='"')X+=`
|
|
102
|
+
`,q+=2;if(X+=Z,J[q+2]===" ")X+="\\";q+=1,Y=q+1}break;default:q+=1}}return X=Y?X+J.slice(Y):J,Q?X:HF.foldFlowLines(X,Z,HF.FOLD_QUOTED,GX(F,!1))}function SU(D,F){if(F.options.singleQuote===!1||F.implicitKey&&D.includes(`
|
|
103
|
+
`)||/[ \t]\n|\n[ \t]/.test(D))return G5(D,F);let J=F.indent||(WX(D)?" ":""),Q="'"+D.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
104
|
+
${J}`)+"'";return F.implicitKey?Q:HF.foldFlowLines(Q,J,HF.FOLD_FLOW,GX(F,!1))}function i7(D,F){let{singleQuote:J}=F.options,Q;if(J===!1)Q=G5;else{let $=D.includes('"'),Z=D.includes("'");if($&&!Z)Q=SU;else if(Z&&!$)Q=G5;else Q=J?SU:G5}return Q(D,F)}var xU;try{xU=new RegExp(`(^|(?<!
|
|
105
|
+
))
|
|
106
|
+
+(?!
|
|
107
|
+
|$)`,"g")}catch{xU=/\n+(?!\n|$)/g}function qX({comment:D,type:F,value:J},Q,$,Z){let{blockQuote:X,commentString:Y,lineWidth:q}=Q.options;if(!X||/\n[\t ]+$/.test(J))return i7(J,Q);let G=Q.indent||(Q.forceBlockIndent||WX(J)?" ":""),W=X==="literal"?!0:X==="folded"||F===s8.Scalar.BLOCK_FOLDED?!1:F===s8.Scalar.BLOCK_LITERAL?!0:!f0D(J,q,G.length);if(!J)return W?`|
|
|
108
|
+
`:`>
|
|
109
|
+
`;let B,K;for(K=J.length;K>0;--K){let E=J[K-1];if(E!==`
|
|
110
|
+
`&&E!=="\t"&&E!==" ")break}let U=J.substring(K),V=U.indexOf(`
|
|
111
|
+
`);if(V===-1)B="-";else if(J===U||V!==U.length-1){if(B="+",Z)Z()}else B="";if(U){if(J=J.slice(0,-U.length),U[U.length-1]===`
|
|
112
|
+
`)U=U.slice(0,-1);U=U.replace(xU,`$&${G}`)}let H=!1,z,_=-1;for(z=0;z<J.length;++z){let E=J[z];if(E===" ")H=!0;else if(E===`
|
|
113
|
+
`)_=z;else break}let M=J.substring(0,_<z?_+1:z);if(M)J=J.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let O=(H?G?"2":"1":"")+B;if(D){if(O+=" "+Y(D.replace(/ ?[\r\n]+/g," ")),$)$()}if(!W){let E=J.replace(/\n+/g,`
|
|
114
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,N=GX(Q,!0);if(X!=="folded"&&F!==s8.Scalar.BLOCK_FOLDED)N.onOverflow=()=>{A=!0};let w=HF.foldFlowLines(`${M}${E}${U}`,G,HF.FOLD_BLOCK,N);if(!A)return`>${O}
|
|
115
|
+
${G}${w}`}return J=J.replace(/\n+/g,`$&${G}`),`|${O}
|
|
116
|
+
${G}${M}${J}${U}`}function h0D(D,F,J,Q){let{type:$,value:Z}=D,{actualString:X,implicitKey:Y,indent:q,indentStep:G,inFlow:W}=F;if(Y&&Z.includes(`
|
|
117
|
+
`)||W&&/[[\]{},]/.test(Z))return i7(Z,F);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Z))return Y||W||!Z.includes(`
|
|
118
|
+
`)?i7(Z,F):qX(D,F,J,Q);if(!Y&&!W&&$!==s8.Scalar.PLAIN&&Z.includes(`
|
|
119
|
+
`))return qX(D,F,J,Q);if(WX(Z)){if(q==="")return F.forceBlockIndent=!0,qX(D,F,J,Q);else if(Y&&q===G)return i7(Z,F)}let B=Z.replace(/\n+/g,`$&
|
|
120
|
+
${q}`);if(X){let K=(H)=>H.default&&H.tag!=="tag:yaml.org,2002:str"&&H.test?.test(B),{compat:U,tags:V}=F.doc.schema;if(V.some(K)||U?.some(K))return i7(Z,F)}return Y?B:HF.foldFlowLines(B,q,HF.FOLD_FLOW,GX(F,!1))}function b0D(D,F,J,Q){let{implicitKey:$,inFlow:Z}=F,X=typeof D.value==="string"?D:Object.assign({},D,{value:String(D.value)}),{type:Y}=D;if(Y!==s8.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(X.value))Y=s8.Scalar.QUOTE_DOUBLE}let q=(W)=>{switch(W){case s8.Scalar.BLOCK_FOLDED:case s8.Scalar.BLOCK_LITERAL:return $||Z?i7(X.value,F):qX(X,F,J,Q);case s8.Scalar.QUOTE_DOUBLE:return G5(X.value,F);case s8.Scalar.QUOTE_SINGLE:return SU(X.value,F);case s8.Scalar.PLAIN:return h0D(X,F,J,Q);default:return null}},G=q(Y);if(G===null){let{defaultKeyType:W,defaultStringType:B}=F.options,K=$&&W||B;if(G=q(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}v0D.stringifyString=b0D});var B5=R((i0D)=>{var g0D=$X(),zF=WD(),m0D=q5(),d0D=W5();function p0D(D,F){let J=Object.assign({blockQuote:!0,commentString:m0D.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},D.schema.toStringOptions,F),Q;switch(J.collectionStyle){case"block":Q=!1;break;case"flow":Q=!0;break;default:Q=null}return{anchors:new Set,doc:D,flowCollectionPadding:J.flowCollectionPadding?" ":"",indent:"",indentStep:typeof J.indent==="number"?" ".repeat(J.indent):" ",inFlow:Q,options:J}}function l0D(D,F){if(F.tag){let $=D.filter((Z)=>Z.tag===F.tag);if($.length>0)return $.find((Z)=>Z.format===F.format)??$[0]}let J=void 0,Q;if(zF.isScalar(F)){Q=F.value;let $=D.filter((Z)=>Z.identify?.(Q));if($.length>1){let Z=$.filter((X)=>X.test);if(Z.length>0)$=Z}J=$.find((Z)=>Z.format===F.format)??$.find((Z)=>!Z.format)}else Q=F,J=D.find(($)=>$.nodeClass&&Q instanceof $.nodeClass);if(!J){let $=Q?.constructor?.name??(Q===null?"null":typeof Q);throw Error(`Tag not resolved for ${$} value`)}return J}function c0D(D,F,{anchors:J,doc:Q}){if(!Q.directives)return"";let $=[],Z=(zF.isScalar(D)||zF.isCollection(D))&&D.anchor;if(Z&&g0D.anchorIsValid(Z))J.add(Z),$.push(`&${Z}`);let X=D.tag??(F.default?null:F.tag);if(X)$.push(Q.directives.tagString(X));return $.join(" ")}function n0D(D,F,J,Q){if(zF.isPair(D))return D.toString(F,J,Q);if(zF.isAlias(D)){if(F.doc.directives)return D.toString(F);if(F.resolvedAliases?.has(D))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(F.resolvedAliases)F.resolvedAliases.add(D);else F.resolvedAliases=new Set([D]);D=D.resolve(F.doc)}}let $=void 0,Z=zF.isNode(D)?D:F.doc.createNode(D,{onTagObj:(q)=>$=q});$??($=l0D(F.doc.schema.tags,Z));let X=c0D(Z,$,F);if(X.length>0)F.indentAtStart=(F.indentAtStart??0)+X.length+1;let Y=typeof $.stringify==="function"?$.stringify(Z,F,J,Q):zF.isScalar(Z)?d0D.stringifyString(Z,F,J,Q):Z.toString(F,J,Q);if(!X)return Y;return zF.isScalar(Z)||Y[0]==="{"||Y[0]==="["?`${X} ${Y}`:`${X}
|
|
121
|
+
${F.indent}${Y}`}i0D.createStringifyContext=p0D;i0D.stringify=n0D});var sj=R((s0D)=>{var O1=WD(),aj=rD(),rj=B5(),K5=q5();function r0D({key:D,value:F},J,Q,$){let{allNullValues:Z,doc:X,indent:Y,indentStep:q,options:{commentString:G,indentSeq:W,simpleKeys:B}}=J,K=O1.isNode(D)&&D.comment||null;if(B){if(K)throw Error("With simple keys, key nodes cannot have comments");if(O1.isCollection(D)||!O1.isNode(D)&&typeof D==="object")throw Error("With simple keys, collection cannot be used as a key value")}let U=!B&&(!D||K&&F==null&&!J.inFlow||O1.isCollection(D)||(O1.isScalar(D)?D.type===aj.Scalar.BLOCK_FOLDED||D.type===aj.Scalar.BLOCK_LITERAL:typeof D==="object"));J=Object.assign({},J,{allNullValues:!1,implicitKey:!U&&(B||!Z),indent:Y+q});let V=!1,H=!1,z=rj.stringify(D,J,()=>V=!0,()=>H=!0);if(!U&&!J.inFlow&&z.length>1024){if(B)throw Error("With simple keys, single line scalar must not span more than 1024 characters");U=!0}if(J.inFlow){if(Z||F==null){if(V&&Q)Q();return z===""?"?":U?`? ${z}`:z}}else if(Z&&!B||F==null&&U){if(z=`? ${z}`,K&&!V)z+=K5.lineComment(z,J.indent,G(K));else if(H&&$)$();return z}if(V)K=null;if(U){if(K)z+=K5.lineComment(z,J.indent,G(K));z=`? ${z}
|
|
122
|
+
${Y}:`}else if(z=`${z}:`,K)z+=K5.lineComment(z,J.indent,G(K));let _,M,C;if(O1.isNode(F))_=!!F.spaceBefore,M=F.commentBefore,C=F.comment;else if(_=!1,M=null,C=null,F&&typeof F==="object")F=X.createNode(F);if(J.implicitKey=!1,!U&&!K&&O1.isScalar(F))J.indentAtStart=z.length+1;if(H=!1,!W&&q.length>=2&&!J.inFlow&&!U&&O1.isSeq(F)&&!F.flow&&!F.tag&&!F.anchor)J.indent=J.indent.substring(2);let O=!1,E=rj.stringify(F,J,()=>O=!0,()=>H=!0),A=" ";if(K||_||M){if(A=_?`
|
|
123
|
+
`:"",M){let N=G(M);A+=`
|
|
124
|
+
${K5.indentComment(N,J.indent)}`}if(E===""&&!J.inFlow){if(A===`
|
|
125
|
+
`&&C)A=`
|
|
126
|
+
|
|
127
|
+
`}else A+=`
|
|
128
|
+
${J.indent}`}else if(!U&&O1.isCollection(F)){let N=E[0],w=E.indexOf(`
|
|
129
|
+
`),T=w!==-1,I=J.inFlow??F.flow??F.items.length===0;if(T||!I){let S=!1;if(T&&(N==="&"||N==="!")){let L=E.indexOf(" ");if(N==="&"&&L!==-1&&L<w&&E[L+1]==="!")L=E.indexOf(" ",L+1);if(L===-1||w<L)S=!0}if(!S)A=`
|
|
130
|
+
${J.indent}`}}else if(E===""||E[0]===`
|
|
131
|
+
`)A="";if(z+=A+E,J.inFlow){if(O&&Q)Q()}else if(C&&!O)z+=K5.lineComment(z,J.indent,G(C));else if(H&&$)$();return z}s0D.stringifyPair=r0D});var kU=R((F8D)=>{var tj=r("process");function e0D(D,...F){if(D==="debug")console.log(...F)}function D8D(D,F){if(D==="debug"||D==="warn")if(typeof tj.emitWarning==="function")tj.emitWarning(F);else console.warn(F)}F8D.debug=e0D;F8D.warn=D8D});var UX=R((Z8D)=>{var U5=WD(),ej=rD(),BX="<<",KX={identify:(D)=>D===BX||typeof D==="symbol"&&D.description===BX,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ej.Scalar(Symbol(BX)),{addToJSMap:DS}),stringify:()=>BX},$8D=(D,F)=>(KX.identify(F)||U5.isScalar(F)&&(!F.type||F.type===ej.Scalar.PLAIN)&&KX.identify(F.value))&&D?.doc.schema.tags.some((J)=>J.tag===KX.tag&&J.default);function DS(D,F,J){if(J=D&&U5.isAlias(J)?J.resolve(D.doc):J,U5.isSeq(J))for(let Q of J.items)yU(D,F,Q);else if(Array.isArray(J))for(let Q of J)yU(D,F,Q);else yU(D,F,J)}function yU(D,F,J){let Q=D&&U5.isAlias(J)?J.resolve(D.doc):J;if(!U5.isMap(Q))throw Error("Merge sources must be maps or map aliases");let $=Q.toJSON(null,D,Map);for(let[Z,X]of $)if(F instanceof Map){if(!F.has(Z))F.set(Z,X)}else if(F instanceof Set)F.add(Z);else if(!Object.prototype.hasOwnProperty.call(F,Z))Object.defineProperty(F,Z,{value:X,writable:!0,enumerable:!0,configurable:!0});return F}Z8D.addMergeToJSMap=DS;Z8D.isMergeKey=$8D;Z8D.merge=KX});var hU=R((U8D)=>{var G8D=kU(),FS=UX(),W8D=B5(),JS=WD(),fU=VF();function B8D(D,F,{key:J,value:Q}){if(JS.isNode(J)&&J.addToJSMap)J.addToJSMap(D,F,Q);else if(FS.isMergeKey(D,J))FS.addMergeToJSMap(D,F,Q);else{let $=fU.toJS(J,"",D);if(F instanceof Map)F.set($,fU.toJS(Q,$,D));else if(F instanceof Set)F.add($);else{let Z=K8D(J,$,D),X=fU.toJS(Q,Z,D);if(Z in F)Object.defineProperty(F,Z,{value:X,writable:!0,enumerable:!0,configurable:!0});else F[Z]=X}}return F}function K8D(D,F,J){if(F===null)return"";if(typeof F!=="object")return String(F);if(JS.isNode(D)&&J?.doc){let Q=W8D.createStringifyContext(J.doc,{});Q.anchors=new Set;for(let Z of J.anchors.keys())Q.anchors.add(Z.anchor);Q.inFlow=!0,Q.inStringifyKey=!0;let $=D.toString(Q);if(!J.mapKeyWarned){let Z=JSON.stringify($);if(Z.length>40)Z=Z.substring(0,36)+'..."';G8D.warn(J.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Z}. Set mapAsMap: true to use object keys.`),J.mapKeyWarned=!0}return $}return JSON.stringify(F)}U8D.addPairToJSMap=B8D});var CF=R((_8D)=>{var QS=Y5(),H8D=sj(),z8D=hU(),VX=WD();function C8D(D,F,J){let Q=QS.createNode(D,void 0,J),$=QS.createNode(F,void 0,J);return new HX(Q,$)}class HX{constructor(D,F=null){Object.defineProperty(this,VX.NODE_TYPE,{value:VX.PAIR}),this.key=D,this.value=F}clone(D){let{key:F,value:J}=this;if(VX.isNode(F))F=F.clone(D);if(VX.isNode(J))J=J.clone(D);return new HX(F,J)}toJSON(D,F){let J=F?.mapAsMap?new Map:{};return z8D.addPairToJSMap(F,J,this)}toString(D,F,J){return D?.doc?H8D.stringifyPair(this,D,F,J):JSON.stringify(this)}}_8D.Pair=HX;_8D.createPair=C8D});var bU=R((w8D)=>{var T3=WD(),$S=B5(),zX=q5();function E8D(D,F,J){return(F.inFlow??D.flow?A8D:R8D)(D,F,J)}function R8D({comment:D,items:F},J,{blockItemPrefix:Q,flowChars:$,itemIndent:Z,onChompKeep:X,onComment:Y}){let{indent:q,options:{commentString:G}}=J,W=Object.assign({},J,{indent:Z,type:null}),B=!1,K=[];for(let V=0;V<F.length;++V){let H=F[V],z=null;if(T3.isNode(H)){if(!B&&H.spaceBefore)K.push("");if(CX(J,K,H.commentBefore,B),H.comment)z=H.comment}else if(T3.isPair(H)){let M=T3.isNode(H.key)?H.key:null;if(M){if(!B&&M.spaceBefore)K.push("");CX(J,K,M.commentBefore,B)}}B=!1;let _=$S.stringify(H,W,()=>z=null,()=>B=!0);if(z)_+=zX.lineComment(_,Z,G(z));if(B&&z)B=!1;K.push(Q+_)}let U;if(K.length===0)U=$.start+$.end;else{U=K[0];for(let V=1;V<K.length;++V){let H=K[V];U+=H?`
|
|
132
|
+
${q}${H}`:`
|
|
133
|
+
`}}if(D){if(U+=`
|
|
134
|
+
`+zX.indentComment(G(D),q),Y)Y()}else if(B&&X)X();return U}function A8D({items:D},F,{flowChars:J,itemIndent:Q}){let{indent:$,indentStep:Z,flowCollectionPadding:X,options:{commentString:Y}}=F;Q+=Z;let q=Object.assign({},F,{indent:Q,inFlow:!0,type:null}),G=!1,W=0,B=[];for(let V=0;V<D.length;++V){let H=D[V],z=null;if(T3.isNode(H)){if(H.spaceBefore)B.push("");if(CX(F,B,H.commentBefore,!1),H.comment)z=H.comment}else if(T3.isPair(H)){let M=T3.isNode(H.key)?H.key:null;if(M){if(M.spaceBefore)B.push("");if(CX(F,B,M.commentBefore,!1),M.comment)G=!0}let C=T3.isNode(H.value)?H.value:null;if(C){if(C.comment)z=C.comment;if(C.commentBefore)G=!0}else if(H.value==null&&M?.comment)z=M.comment}if(z)G=!0;let _=$S.stringify(H,q,()=>z=null);if(V<D.length-1)_+=",";if(z)_+=zX.lineComment(_,Q,Y(z));if(!G&&(B.length>W||_.includes(`
|
|
135
|
+
`)))G=!0;B.push(_),W=B.length}let{start:K,end:U}=J;if(B.length===0)return K+U;else{if(!G){let V=B.reduce((H,z)=>H+z.length+2,2);G=F.options.lineWidth>0&&V>F.options.lineWidth}if(G){let V=K;for(let H of B)V+=H?`
|
|
136
|
+
${Z}${$}${H}`:`
|
|
137
|
+
`;return`${V}
|
|
138
|
+
${$}${U}`}else return`${K}${X}${B.join(" ")}${X}${U}`}}function CX({indent:D,options:{commentString:F}},J,Q,$){if(Q&&$)Q=Q.replace(/^\n+/,"");if(Q){let Z=zX.indentComment(F(Q),D);J.push(Z.trimStart())}}w8D.stringifyCollection=E8D});var OF=R((j8D)=>{var N8D=bU(),T8D=hU(),L8D=YX(),_F=WD(),_X=CF(),P8D=rD();function V5(D,F){let J=_F.isScalar(F)?F.value:F;for(let Q of D)if(_F.isPair(Q)){if(Q.key===F||Q.key===J)return Q;if(_F.isScalar(Q.key)&&Q.key.value===J)return Q}return}class ZS extends L8D.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(D){super(_F.MAP,D);this.items=[]}static from(D,F,J){let{keepUndefined:Q,replacer:$}=J,Z=new this(D),X=(Y,q)=>{if(typeof $==="function")q=$.call(F,Y,q);else if(Array.isArray($)&&!$.includes(Y))return;if(q!==void 0||Q)Z.items.push(_X.createPair(Y,q,J))};if(F instanceof Map)for(let[Y,q]of F)X(Y,q);else if(F&&typeof F==="object")for(let Y of Object.keys(F))X(Y,F[Y]);if(typeof D.sortMapEntries==="function")Z.items.sort(D.sortMapEntries);return Z}add(D,F){let J;if(_F.isPair(D))J=D;else if(!D||typeof D!=="object"||!("key"in D))J=new _X.Pair(D,D?.value);else J=new _X.Pair(D.key,D.value);let Q=V5(this.items,J.key),$=this.schema?.sortMapEntries;if(Q){if(!F)throw Error(`Key ${J.key} already set`);if(_F.isScalar(Q.value)&&P8D.isScalarValue(J.value))Q.value.value=J.value;else Q.value=J.value}else if($){let Z=this.items.findIndex((X)=>$(J,X)<0);if(Z===-1)this.items.push(J);else this.items.splice(Z,0,J)}else this.items.push(J)}delete(D){let F=V5(this.items,D);if(!F)return!1;return this.items.splice(this.items.indexOf(F),1).length>0}get(D,F){let Q=V5(this.items,D)?.value;return(!F&&_F.isScalar(Q)?Q.value:Q)??void 0}has(D){return!!V5(this.items,D)}set(D,F){this.add(new _X.Pair(D,F),!0)}toJSON(D,F,J){let Q=J?new J:F?.mapAsMap?new Map:{};if(F?.onCreate)F.onCreate(Q);for(let $ of this.items)T8D.addPairToJSMap(F,Q,$);return Q}toString(D,F,J){if(!D)return JSON.stringify(this);for(let Q of this.items)if(!_F.isPair(Q))throw Error(`Map items must all be pairs; found ${JSON.stringify(Q)} instead`);if(!D.allNullValues&&this.hasAllNullValues(!1))D=Object.assign({},D,{allNullValues:!0});return N8D.stringifyCollection(this,D,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:D.indent||"",onChompKeep:J,onComment:F})}}j8D.YAMLMap=ZS;j8D.findPair=V5});var o7=R((f8D)=>{var k8D=WD(),XS=OF(),y8D={collection:"map",default:!0,nodeClass:XS.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(D,F){if(!k8D.isMap(D))F("Expected a mapping for this tag");return D},createNode:(D,F,J)=>XS.YAMLMap.from(D,F,J)};f8D.map=y8D});var MF=R((d8D)=>{var b8D=Y5(),v8D=bU(),u8D=YX(),MX=WD(),g8D=rD(),m8D=VF();class YS extends u8D.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(D){super(MX.SEQ,D);this.items=[]}add(D){this.items.push(D)}delete(D){let F=OX(D);if(typeof F!=="number")return!1;return this.items.splice(F,1).length>0}get(D,F){let J=OX(D);if(typeof J!=="number")return;let Q=this.items[J];return!F&&MX.isScalar(Q)?Q.value:Q}has(D){let F=OX(D);return typeof F==="number"&&F<this.items.length}set(D,F){let J=OX(D);if(typeof J!=="number")throw Error(`Expected a valid index, not ${D}.`);let Q=this.items[J];if(MX.isScalar(Q)&&g8D.isScalarValue(F))Q.value=F;else this.items[J]=F}toJSON(D,F){let J=[];if(F?.onCreate)F.onCreate(J);let Q=0;for(let $ of this.items)J.push(m8D.toJS($,String(Q++),F));return J}toString(D,F,J){if(!D)return JSON.stringify(this);return v8D.stringifyCollection(this,D,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(D.indent||"")+" ",onChompKeep:J,onComment:F})}static from(D,F,J){let{replacer:Q}=J,$=new this(D);if(F&&Symbol.iterator in Object(F)){let Z=0;for(let X of F){if(typeof Q==="function"){let Y=F instanceof Set?X:String(Z++);X=Q.call(F,Y,X)}$.items.push(b8D.createNode(X,void 0,J))}}return $}}function OX(D){let F=MX.isScalar(D)?D.value:D;if(F&&typeof F==="string")F=Number(F);return typeof F==="number"&&Number.isInteger(F)&&F>=0?F:null}d8D.YAMLSeq=YS});var a7=R((n8D)=>{var l8D=WD(),qS=MF(),c8D={collection:"seq",default:!0,nodeClass:qS.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(D,F){if(!l8D.isSeq(D))F("Expected a sequence for this tag");return D},createNode:(D,F,J)=>qS.YAMLSeq.from(D,F,J)};n8D.seq=c8D});var H5=R((r8D)=>{var o8D=W5(),a8D={identify:(D)=>typeof D==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(D)=>D,stringify(D,F,J,Q){return F=Object.assign({actualString:!0},F),o8D.stringifyString(D,F,J,Q)}};r8D.string=a8D});var EX=R((t8D)=>{var GS=rD(),WS={identify:(D)=>D==null,createNode:()=>new GS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new GS.Scalar(null),stringify:({source:D},F)=>typeof D==="string"&&WS.test.test(D)?D:F.options.nullStr};t8D.nullTag=WS});var vU=R((F2D)=>{var D2D=rD(),BS={identify:(D)=>typeof D==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(D)=>new D2D.Scalar(D[0]==="t"||D[0]==="T"),stringify({source:D,value:F},J){if(D&&BS.test.test(D)){let Q=D[0]==="t"||D[0]==="T";if(F===Q)return D}return F?J.options.trueStr:J.options.falseStr}};F2D.boolTag=BS});var r7=R(($2D)=>{function Q2D({format:D,minFractionDigits:F,tag:J,value:Q}){if(typeof Q==="bigint")return String(Q);let $=typeof Q==="number"?Q:Number(Q);if(!isFinite($))return isNaN($)?".nan":$<0?"-.inf":".inf";let Z=Object.is(Q,-0)?"-0":JSON.stringify(Q);if(!D&&F&&(!J||J==="tag:yaml.org,2002:float")&&/^\d/.test(Z)){let X=Z.indexOf(".");if(X<0)X=Z.length,Z+=".";let Y=F-(Z.length-X-1);while(Y-- >0)Z+="0"}return Z}$2D.stringifyNumber=Q2D});var gU=R((W2D)=>{var X2D=rD(),uU=r7(),Y2D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(D)=>D.slice(-3).toLowerCase()==="nan"?NaN:D[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:uU.stringifyNumber},q2D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(D)=>parseFloat(D),stringify(D){let F=Number(D.value);return isFinite(F)?F.toExponential():uU.stringifyNumber(D)}},G2D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(D){let F=new X2D.Scalar(parseFloat(D)),J=D.indexOf(".");if(J!==-1&&D[D.length-1]==="0")F.minFractionDigits=D.length-J-1;return F},stringify:uU.stringifyNumber};W2D.float=G2D;W2D.floatExp=q2D;W2D.floatNaN=Y2D});var dU=R((C2D)=>{var KS=r7(),RX=(D)=>typeof D==="bigint"||Number.isInteger(D),mU=(D,F,J,{intAsBigInt:Q})=>Q?BigInt(D):parseInt(D.substring(F),J);function US(D,F,J){let{value:Q}=D;if(RX(Q)&&Q>=0)return J+Q.toString(F);return KS.stringifyNumber(D)}var V2D={identify:(D)=>RX(D)&&D>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(D,F,J)=>mU(D,2,8,J),stringify:(D)=>US(D,8,"0o")},H2D={identify:RX,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(D,F,J)=>mU(D,0,10,J),stringify:KS.stringifyNumber},z2D={identify:(D)=>RX(D)&&D>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(D,F,J)=>mU(D,2,16,J),stringify:(D)=>US(D,16,"0x")};C2D.int=H2D;C2D.intHex=z2D;C2D.intOct=V2D});var VS=R((T2D)=>{var E2D=o7(),R2D=EX(),A2D=a7(),w2D=H5(),I2D=vU(),pU=gU(),lU=dU(),N2D=[E2D.map,A2D.seq,w2D.string,R2D.nullTag,I2D.boolTag,lU.intOct,lU.int,lU.intHex,pU.floatNaN,pU.floatExp,pU.float];T2D.schema=N2D});var zS=R((f2D)=>{var P2D=rD(),j2D=o7(),S2D=a7();function HS(D){return typeof D==="bigint"||Number.isInteger(D)}var AX=({value:D})=>JSON.stringify(D),x2D=[{identify:(D)=>typeof D==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(D)=>D,stringify:AX},{identify:(D)=>D==null,createNode:()=>new P2D.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:AX},{identify:(D)=>typeof D==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(D)=>D==="true",stringify:AX},{identify:HS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(D,F,{intAsBigInt:J})=>J?BigInt(D):parseInt(D,10),stringify:({value:D})=>HS(D)?D.toString():JSON.stringify(D)},{identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(D)=>parseFloat(D),stringify:AX}],k2D={default:!0,tag:"",test:/^/,resolve(D,F){return F(`Unresolved plain scalar ${JSON.stringify(D)}`),D}},y2D=[j2D.map,S2D.seq].concat(x2D,k2D);f2D.schema=y2D});var nU=R((u2D)=>{var z5=r("buffer"),cU=rD(),b2D=W5(),v2D={identify:(D)=>D instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(D,F){if(typeof z5.Buffer==="function")return z5.Buffer.from(D,"base64");else if(typeof atob==="function"){let J=atob(D.replace(/[\n\r]/g,"")),Q=new Uint8Array(J.length);for(let $=0;$<J.length;++$)Q[$]=J.charCodeAt($);return Q}else return F("This environment does not support reading binary tags; either Buffer or atob is required"),D},stringify({comment:D,type:F,value:J},Q,$,Z){if(!J)return"";let X=J,Y;if(typeof z5.Buffer==="function")Y=X instanceof z5.Buffer?X.toString("base64"):z5.Buffer.from(X.buffer).toString("base64");else if(typeof btoa==="function"){let q="";for(let G=0;G<X.length;++G)q+=String.fromCharCode(X[G]);Y=btoa(q)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(F??(F=cU.Scalar.BLOCK_LITERAL),F!==cU.Scalar.QUOTE_DOUBLE){let q=Math.max(Q.options.lineWidth-Q.indent.length,Q.options.minContentWidth),G=Math.ceil(Y.length/q),W=Array(G);for(let B=0,K=0;B<G;++B,K+=q)W[B]=Y.substr(K,q);Y=W.join(F===cU.Scalar.BLOCK_LITERAL?`
|
|
139
|
+
`:" ")}return b2D.stringifyString({comment:D,type:F,value:Y},Q,$,Z)}};u2D.binary=v2D});var IX=R((l2D)=>{var wX=WD(),iU=CF(),m2D=rD(),d2D=MF();function CS(D,F){if(wX.isSeq(D))for(let J=0;J<D.items.length;++J){let Q=D.items[J];if(wX.isPair(Q))continue;else if(wX.isMap(Q)){if(Q.items.length>1)F("Each pair must have its own sequence indicator");let $=Q.items[0]||new iU.Pair(new m2D.Scalar(null));if(Q.commentBefore)$.key.commentBefore=$.key.commentBefore?`${Q.commentBefore}
|
|
140
|
+
${$.key.commentBefore}`:Q.commentBefore;if(Q.comment){let Z=$.value??$.key;Z.comment=Z.comment?`${Q.comment}
|
|
141
|
+
${Z.comment}`:Q.comment}Q=$}D.items[J]=wX.isPair(Q)?Q:new iU.Pair(Q)}else F("Expected a sequence for this tag");return D}function _S(D,F,J){let{replacer:Q}=J,$=new d2D.YAMLSeq(D);$.tag="tag:yaml.org,2002:pairs";let Z=0;if(F&&Symbol.iterator in Object(F))for(let X of F){if(typeof Q==="function")X=Q.call(F,String(Z++),X);let Y,q;if(Array.isArray(X))if(X.length===2)Y=X[0],q=X[1];else throw TypeError(`Expected [key, value] tuple: ${X}`);else if(X&&X instanceof Object){let G=Object.keys(X);if(G.length===1)Y=G[0],q=X[Y];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else Y=X;$.items.push(iU.createPair(Y,q,J))}return $}var p2D={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:CS,createNode:_S};l2D.createPairs=_S;l2D.pairs=p2D;l2D.resolvePairs=CS});var aU=R((r2D)=>{var OS=WD(),oU=VF(),C5=OF(),o2D=MF(),MS=IX();class L3 extends o2D.YAMLSeq{constructor(){super();this.add=C5.YAMLMap.prototype.add.bind(this),this.delete=C5.YAMLMap.prototype.delete.bind(this),this.get=C5.YAMLMap.prototype.get.bind(this),this.has=C5.YAMLMap.prototype.has.bind(this),this.set=C5.YAMLMap.prototype.set.bind(this),this.tag=L3.tag}toJSON(D,F){if(!F)return super.toJSON(D);let J=new Map;if(F?.onCreate)F.onCreate(J);for(let Q of this.items){let $,Z;if(OS.isPair(Q))$=oU.toJS(Q.key,"",F),Z=oU.toJS(Q.value,$,F);else $=oU.toJS(Q,"",F);if(J.has($))throw Error("Ordered maps must not include duplicate keys");J.set($,Z)}return J}static from(D,F,J){let Q=MS.createPairs(D,F,J),$=new this;return $.items=Q.items,$}}L3.tag="tag:yaml.org,2002:omap";var a2D={collection:"seq",identify:(D)=>D instanceof Map,nodeClass:L3,default:!1,tag:"tag:yaml.org,2002:omap",resolve(D,F){let J=MS.resolvePairs(D,F),Q=[];for(let{key:$}of J.items)if(OS.isScalar($))if(Q.includes($.value))F(`Ordered maps must not include duplicate keys: ${$.value}`);else Q.push($.value);return Object.assign(new L3,J)},createNode:(D,F,J)=>L3.from(D,F,J)};r2D.YAMLOMap=L3;r2D.omap=a2D});var IS=R((e2D)=>{var ES=rD();function RS({value:D,source:F},J){if(F&&(D?AS:wS).test.test(F))return F;return D?J.options.trueStr:J.options.falseStr}var AS={identify:(D)=>D===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ES.Scalar(!0),stringify:RS},wS={identify:(D)=>D===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ES.Scalar(!1),stringify:RS};e2D.falseTag=wS;e2D.trueTag=AS});var NS=R((X1D)=>{var J1D=rD(),rU=r7(),Q1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(D)=>D.slice(-3).toLowerCase()==="nan"?NaN:D[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:rU.stringifyNumber},$1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(D)=>parseFloat(D.replace(/_/g,"")),stringify(D){let F=Number(D.value);return isFinite(F)?F.toExponential():rU.stringifyNumber(D)}},Z1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(D){let F=new J1D.Scalar(parseFloat(D.replace(/_/g,""))),J=D.indexOf(".");if(J!==-1){let Q=D.substring(J+1).replace(/_/g,"");if(Q[Q.length-1]==="0")F.minFractionDigits=Q.length}return F},stringify:rU.stringifyNumber};X1D.float=Z1D;X1D.floatExp=$1D;X1D.floatNaN=Q1D});var LS=R((V1D)=>{var TS=r7(),_5=(D)=>typeof D==="bigint"||Number.isInteger(D);function NX(D,F,J,{intAsBigInt:Q}){let $=D[0];if($==="-"||$==="+")F+=1;if(D=D.substring(F).replace(/_/g,""),Q){switch(J){case 2:D=`0b${D}`;break;case 8:D=`0o${D}`;break;case 16:D=`0x${D}`;break}let X=BigInt(D);return $==="-"?BigInt(-1)*X:X}let Z=parseInt(D,J);return $==="-"?-1*Z:Z}function sU(D,F,J){let{value:Q}=D;if(_5(Q)){let $=Q.toString(F);return Q<0?"-"+J+$.substr(1):J+$}return TS.stringifyNumber(D)}var W1D={identify:_5,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(D,F,J)=>NX(D,2,2,J),stringify:(D)=>sU(D,2,"0b")},B1D={identify:_5,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(D,F,J)=>NX(D,1,8,J),stringify:(D)=>sU(D,8,"0")},K1D={identify:_5,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(D,F,J)=>NX(D,0,10,J),stringify:TS.stringifyNumber},U1D={identify:_5,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(D,F,J)=>NX(D,2,16,J),stringify:(D)=>sU(D,16,"0x")};V1D.int=K1D;V1D.intBin=W1D;V1D.intHex=U1D;V1D.intOct=B1D});var tU=R((M1D)=>{var PX=WD(),TX=CF(),LX=OF();class P3 extends LX.YAMLMap{constructor(D){super(D);this.tag=P3.tag}add(D){let F;if(PX.isPair(D))F=D;else if(D&&typeof D==="object"&&"key"in D&&"value"in D&&D.value===null)F=new TX.Pair(D.key,null);else F=new TX.Pair(D,null);if(!LX.findPair(this.items,F.key))this.items.push(F)}get(D,F){let J=LX.findPair(this.items,D);return!F&&PX.isPair(J)?PX.isScalar(J.key)?J.key.value:J.key:J}set(D,F){if(typeof F!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof F}`);let J=LX.findPair(this.items,D);if(J&&!F)this.items.splice(this.items.indexOf(J),1);else if(!J&&F)this.items.push(new TX.Pair(D))}toJSON(D,F){return super.toJSON(D,F,Set)}toString(D,F,J){if(!D)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},D,{allNullValues:!0}),F,J);else throw Error("Set items must all have null values")}static from(D,F,J){let{replacer:Q}=J,$=new this(D);if(F&&Symbol.iterator in Object(F))for(let Z of F){if(typeof Q==="function")Z=Q.call(F,Z,Z);$.items.push(TX.createPair(Z,null,J))}return $}}P3.tag="tag:yaml.org,2002:set";var O1D={collection:"map",identify:(D)=>D instanceof Set,nodeClass:P3,default:!1,tag:"tag:yaml.org,2002:set",createNode:(D,F,J)=>P3.from(D,F,J),resolve(D,F){if(PX.isMap(D))if(D.hasAllNullValues(!0))return Object.assign(new P3,D);else F("Set items must all have null values");else F("Expected a mapping for this tag");return D}};M1D.YAMLSet=P3;M1D.set=O1D});var DV=R((N1D)=>{var A1D=r7();function eU(D,F){let J=D[0],Q=J==="-"||J==="+"?D.substring(1):D,$=(X)=>F?BigInt(X):Number(X),Z=Q.replace(/_/g,"").split(":").reduce((X,Y)=>X*$(60)+$(Y),$(0));return J==="-"?$(-1)*Z:Z}function PS(D){let{value:F}=D,J=(X)=>X;if(typeof F==="bigint")J=(X)=>BigInt(X);else if(isNaN(F)||!isFinite(F))return A1D.stringifyNumber(D);let Q="";if(F<0)Q="-",F*=J(-1);let $=J(60),Z=[F%$];if(F<60)Z.unshift(0);else if(F=(F-Z[0])/$,Z.unshift(F%$),F>=60)F=(F-Z[0])/$,Z.unshift(F);return Q+Z.map((X)=>String(X).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var w1D={identify:(D)=>typeof D==="bigint"||Number.isInteger(D),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(D,F,{intAsBigInt:J})=>eU(D,J),stringify:PS},I1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(D)=>eU(D,!1),stringify:PS},jS={identify:(D)=>D instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(D){let F=D.match(jS.test);if(!F)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,J,Q,$,Z,X,Y]=F.map(Number),q=F[7]?Number((F[7]+"00").substr(1,3)):0,G=Date.UTC(J,Q-1,$,Z||0,X||0,Y||0,q),W=F[8];if(W&&W!=="Z"){let B=eU(W,!1);if(Math.abs(B)<30)B*=60;G-=60000*B}return new Date(G)},stringify:({value:D})=>D?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};N1D.floatTime=I1D;N1D.intTime=w1D;N1D.timestamp=jS});var xS=R((g1D)=>{var j1D=o7(),S1D=EX(),x1D=a7(),k1D=H5(),y1D=nU(),SS=IS(),FV=NS(),jX=LS(),f1D=UX(),h1D=aU(),b1D=IX(),v1D=tU(),JV=DV(),u1D=[j1D.map,x1D.seq,k1D.string,S1D.nullTag,SS.trueTag,SS.falseTag,jX.intBin,jX.intOct,jX.int,jX.intHex,FV.floatNaN,FV.floatExp,FV.float,y1D.binary,f1D.merge,h1D.omap,b1D.pairs,v1D.set,JV.intTime,JV.floatTime,JV.timestamp];g1D.schema=u1D});var dS=R((a1D)=>{var hS=o7(),d1D=EX(),bS=a7(),p1D=H5(),l1D=vU(),QV=gU(),$V=dU(),c1D=VS(),n1D=zS(),vS=nU(),O5=UX(),uS=aU(),gS=IX(),kS=xS(),mS=tU(),SX=DV(),yS=new Map([["core",c1D.schema],["failsafe",[hS.map,bS.seq,p1D.string]],["json",n1D.schema],["yaml11",kS.schema],["yaml-1.1",kS.schema]]),fS={binary:vS.binary,bool:l1D.boolTag,float:QV.float,floatExp:QV.floatExp,floatNaN:QV.floatNaN,floatTime:SX.floatTime,int:$V.int,intHex:$V.intHex,intOct:$V.intOct,intTime:SX.intTime,map:hS.map,merge:O5.merge,null:d1D.nullTag,omap:uS.omap,pairs:gS.pairs,seq:bS.seq,set:mS.set,timestamp:SX.timestamp},i1D={"tag:yaml.org,2002:binary":vS.binary,"tag:yaml.org,2002:merge":O5.merge,"tag:yaml.org,2002:omap":uS.omap,"tag:yaml.org,2002:pairs":gS.pairs,"tag:yaml.org,2002:set":mS.set,"tag:yaml.org,2002:timestamp":SX.timestamp};function o1D(D,F,J){let Q=yS.get(F);if(Q&&!D)return J&&!Q.includes(O5.merge)?Q.concat(O5.merge):Q.slice();let $=Q;if(!$)if(Array.isArray(D))$=[];else{let Z=Array.from(yS.keys()).filter((X)=>X!=="yaml11").map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown schema "${F}"; use one of ${Z} or define customTags array`)}if(Array.isArray(D))for(let Z of D)$=$.concat(Z);else if(typeof D==="function")$=D($.slice());if(J)$=$.concat(O5.merge);return $.reduce((Z,X)=>{let Y=typeof X==="string"?fS[X]:X;if(!Y){let q=JSON.stringify(X),G=Object.keys(fS).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${q}; use one of ${G}`)}if(!Z.includes(Y))Z.push(Y);return Z},[])}a1D.coreKnownTags=i1D;a1D.getTags=o1D});var YV=R((JFD)=>{var ZV=WD(),t1D=o7(),e1D=a7(),DFD=H5(),xX=dS(),FFD=(D,F)=>D.key<F.key?-1:D.key>F.key?1:0;class XV{constructor({compat:D,customTags:F,merge:J,resolveKnownTags:Q,schema:$,sortMapEntries:Z,toStringDefaults:X}){this.compat=Array.isArray(D)?xX.getTags(D,"compat"):D?xX.getTags(null,D):null,this.name=typeof $==="string"&&$||"core",this.knownTags=Q?xX.coreKnownTags:{},this.tags=xX.getTags(F,this.name,J),this.toStringOptions=X??null,Object.defineProperty(this,ZV.MAP,{value:t1D.map}),Object.defineProperty(this,ZV.SCALAR,{value:DFD.string}),Object.defineProperty(this,ZV.SEQ,{value:e1D.seq}),this.sortMapEntries=typeof Z==="function"?Z:Z===!0?FFD:null}clone(){let D=Object.create(XV.prototype,Object.getOwnPropertyDescriptors(this));return D.tags=this.tags.slice(),D}}JFD.Schema=XV});var pS=R((XFD)=>{var $FD=WD(),qV=B5(),M5=q5();function ZFD(D,F){let J=[],Q=F.directives===!0;if(F.directives!==!1&&D.directives){let q=D.directives.toString(D);if(q)J.push(q),Q=!0;else if(D.directives.docStart)Q=!0}if(Q)J.push("---");let $=qV.createStringifyContext(D,F),{commentString:Z}=$.options;if(D.commentBefore){if(J.length!==1)J.unshift("");let q=Z(D.commentBefore);J.unshift(M5.indentComment(q,""))}let X=!1,Y=null;if(D.contents){if($FD.isNode(D.contents)){if(D.contents.spaceBefore&&Q)J.push("");if(D.contents.commentBefore){let W=Z(D.contents.commentBefore);J.push(M5.indentComment(W,""))}$.forceBlockIndent=!!D.comment,Y=D.contents.comment}let q=Y?void 0:()=>X=!0,G=qV.stringify(D.contents,$,()=>Y=null,q);if(Y)G+=M5.lineComment(G,"",Z(Y));if((G[0]==="|"||G[0]===">")&&J[J.length-1]==="---")J[J.length-1]=`--- ${G}`;else J.push(G)}else J.push(qV.stringify(D.contents,$));if(D.directives?.docEnd)if(D.comment){let q=Z(D.comment);if(q.includes(`
|
|
142
|
+
`))J.push("..."),J.push(M5.indentComment(q,""));else J.push(`... ${q}`)}else J.push("...");else{let q=D.comment;if(q&&X)q=q.replace(/^\n+/,"");if(q){if((!X||Y)&&J[J.length-1]!=="")J.push("");J.push(M5.indentComment(Z(q),""))}}return J.join(`
|
|
143
|
+
`)+`
|
|
144
|
+
`}XFD.stringifyDocument=ZFD});var E5=R((HFD)=>{var qFD=X5(),s7=YX(),N8=WD(),GFD=CF(),WFD=VF(),BFD=YV(),KFD=pS(),GV=$X(),UFD=LU(),VFD=Y5(),WV=TU();class BV{constructor(D,F,J){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,N8.NODE_TYPE,{value:N8.DOC});let Q=null;if(typeof F==="function"||Array.isArray(F))Q=F;else if(J===void 0&&F)J=F,F=void 0;let $=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},J);this.options=$;let{version:Z}=$;if(J?._directives){if(this.directives=J._directives.atDocument(),this.directives.yaml.explicit)Z=this.directives.yaml.version}else this.directives=new WV.Directives({version:Z});this.setSchema(Z,J),this.contents=D===void 0?null:this.createNode(D,Q,J)}clone(){let D=Object.create(BV.prototype,{[N8.NODE_TYPE]:{value:N8.DOC}});if(D.commentBefore=this.commentBefore,D.comment=this.comment,D.errors=this.errors.slice(),D.warnings=this.warnings.slice(),D.options=Object.assign({},this.options),this.directives)D.directives=this.directives.clone();if(D.schema=this.schema.clone(),D.contents=N8.isNode(this.contents)?this.contents.clone(D.schema):this.contents,this.range)D.range=this.range.slice();return D}add(D){if(t7(this.contents))this.contents.add(D)}addIn(D,F){if(t7(this.contents))this.contents.addIn(D,F)}createAlias(D,F){if(!D.anchor){let J=GV.anchorNames(this);D.anchor=!F||J.has(F)?GV.findNewAnchor(F||"a",J):F}return new qFD.Alias(D.anchor)}createNode(D,F,J){let Q=void 0;if(typeof F==="function")D=F.call({"":D},"",D),Q=F;else if(Array.isArray(F)){let H=(_)=>typeof _==="number"||_ instanceof String||_ instanceof Number,z=F.filter(H).map(String);if(z.length>0)F=F.concat(z);Q=F}else if(J===void 0&&F)J=F,F=void 0;let{aliasDuplicateObjects:$,anchorPrefix:Z,flow:X,keepUndefined:Y,onTagObj:q,tag:G}=J??{},{onAnchor:W,setAnchors:B,sourceObjects:K}=GV.createNodeAnchors(this,Z||"a"),U={aliasDuplicateObjects:$??!0,keepUndefined:Y??!1,onAnchor:W,onTagObj:q,replacer:Q,schema:this.schema,sourceObjects:K},V=VFD.createNode(D,G,U);if(X&&N8.isCollection(V))V.flow=!0;return B(),V}createPair(D,F,J={}){let Q=this.createNode(D,null,J),$=this.createNode(F,null,J);return new GFD.Pair(Q,$)}delete(D){return t7(this.contents)?this.contents.delete(D):!1}deleteIn(D){if(s7.isEmptyPath(D)){if(this.contents==null)return!1;return this.contents=null,!0}return t7(this.contents)?this.contents.deleteIn(D):!1}get(D,F){return N8.isCollection(this.contents)?this.contents.get(D,F):void 0}getIn(D,F){if(s7.isEmptyPath(D))return!F&&N8.isScalar(this.contents)?this.contents.value:this.contents;return N8.isCollection(this.contents)?this.contents.getIn(D,F):void 0}has(D){return N8.isCollection(this.contents)?this.contents.has(D):!1}hasIn(D){if(s7.isEmptyPath(D))return this.contents!==void 0;return N8.isCollection(this.contents)?this.contents.hasIn(D):!1}set(D,F){if(this.contents==null)this.contents=s7.collectionFromPath(this.schema,[D],F);else if(t7(this.contents))this.contents.set(D,F)}setIn(D,F){if(s7.isEmptyPath(D))this.contents=F;else if(this.contents==null)this.contents=s7.collectionFromPath(this.schema,Array.from(D),F);else if(t7(this.contents))this.contents.setIn(D,F)}setSchema(D,F={}){if(typeof D==="number")D=String(D);let J;switch(D){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new WV.Directives({version:"1.1"});J={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=D;else this.directives=new WV.Directives({version:D});J={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;J=null;break;default:{let Q=JSON.stringify(D);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Q}`)}}if(F.schema instanceof Object)this.schema=F.schema;else if(J)this.schema=new BFD.Schema(Object.assign(J,F));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:D,jsonArg:F,mapAsMap:J,maxAliasCount:Q,onAnchor:$,reviver:Z}={}){let X={anchors:new Map,doc:this,keep:!D,mapAsMap:J===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},Y=WFD.toJS(this.contents,F??"",X);if(typeof $==="function")for(let{count:q,res:G}of X.anchors.values())$(G,q);return typeof Z==="function"?UFD.applyReviver(Z,{"":Y},"",Y):Y}toJSON(D,F){return this.toJS({json:!0,jsonArg:D,mapAsMap:!1,onAnchor:F})}toString(D={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in D&&(!Number.isInteger(D.indent)||Number(D.indent)<=0)){let F=JSON.stringify(D.indent);throw Error(`"indent" option must be a positive integer, not ${F}`)}return KFD.stringifyDocument(this,D)}}function t7(D){if(N8.isCollection(D))return!0;throw Error("Expected a YAML collection as document contents")}HFD.Document=BV});var R5=R((_FD)=>{class kX extends Error{constructor(D,F,J,Q){super();this.name=D,this.code=J,this.message=Q,this.pos=F}}class lS extends kX{constructor(D,F,J){super("YAMLParseError",D,F,J)}}class cS extends kX{constructor(D,F,J){super("YAMLWarning",D,F,J)}}var CFD=(D,F)=>(J)=>{if(J.pos[0]===-1)return;J.linePos=J.pos.map((Y)=>F.linePos(Y));let{line:Q,col:$}=J.linePos[0];J.message+=` at line ${Q}, column ${$}`;let Z=$-1,X=D.substring(F.lineStarts[Q-1],F.lineStarts[Q]).replace(/[\n\r]+$/,"");if(Z>=60&&X.length>80){let Y=Math.min(Z-39,X.length-79);X="…"+X.substring(Y),Z-=Y-1}if(X.length>80)X=X.substring(0,79)+"…";if(Q>1&&/^ *$/.test(X.substring(0,Z))){let Y=D.substring(F.lineStarts[Q-2],F.lineStarts[Q-1]);if(Y.length>80)Y=Y.substring(0,79)+`…
|
|
145
|
+
`;X=Y+X}if(/[^ ]/.test(X)){let Y=1,q=J.linePos[1];if(q?.line===Q&&q.col>$)Y=Math.max(1,Math.min(q.col-$,80-Z));let G=" ".repeat(Z)+"^".repeat(Y);J.message+=`:
|
|
146
|
+
|
|
147
|
+
${X}
|
|
148
|
+
${G}
|
|
149
|
+
`}};_FD.YAMLError=kX;_FD.YAMLParseError=lS;_FD.YAMLWarning=cS;_FD.prettifyError=CFD});var A5=R((wFD)=>{function AFD(D,{flow:F,indicator:J,next:Q,offset:$,onError:Z,parentIndent:X,startOnNewline:Y}){let q=!1,G=Y,W=Y,B="",K="",U=!1,V=!1,H=null,z=null,_=null,M=null,C=null,O=null,E=null;for(let w of D){if(V){if(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma")Z(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(H){if(G&&w.type!=="comment"&&w.type!=="newline")Z(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");H=null}switch(w.type){case"space":if(!F&&(J!=="doc-start"||Q?.type!=="flow-collection")&&w.source.includes("\t"))H=w;W=!0;break;case"comment":{if(!W)Z(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=w.source.substring(1)||" ";if(!B)B=T;else B+=K+T;K="",G=!1;break}case"newline":if(G){if(B)B+=w.source;else if(!O||J!=="seq-item-ind")q=!0}else K+=w.source;if(G=!0,U=!0,z||_)M=w;W=!0;break;case"anchor":if(z)Z(w,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(w.source.endsWith(":"))Z(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);z=w,E??(E=w.offset),G=!1,W=!1,V=!0;break;case"tag":{if(_)Z(w,"MULTIPLE_TAGS","A node can have at most one tag");_=w,E??(E=w.offset),G=!1,W=!1,V=!0;break}case J:if(z||_)Z(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`);if(O)Z(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${F??"collection"}`);O=w,G=J==="seq-item-ind"||J==="explicit-key-ind",W=!1;break;case"comma":if(F){if(C)Z(w,"UNEXPECTED_TOKEN",`Unexpected , in ${F}`);C=w,G=!1,W=!1;break}default:Z(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),G=!1,W=!1}}let A=D[D.length-1],N=A?A.offset+A.source.length:$;if(V&&Q&&Q.type!=="space"&&Q.type!=="newline"&&Q.type!=="comma"&&(Q.type!=="scalar"||Q.source!==""))Z(Q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(H&&(G&&H.indent<=X||Q?.type==="block-map"||Q?.type==="block-seq"))Z(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:O,spaceBefore:q,comment:B,hasNewline:U,anchor:z,tag:_,newlineAfterProp:M,end:N,start:E??N}}wFD.resolveProps=AFD});var yX=R((NFD)=>{function KV(D){if(!D)return null;switch(D.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(D.source.includes(`
|
|
150
|
+
`))return!0;if(D.end){for(let F of D.end)if(F.type==="newline")return!0}return!1;case"flow-collection":for(let F of D.items){for(let J of F.start)if(J.type==="newline")return!0;if(F.sep){for(let J of F.sep)if(J.type==="newline")return!0}if(KV(F.key)||KV(F.value))return!0}return!1;default:return!0}}NFD.containsNewline=KV});var UV=R((jFD)=>{var LFD=yX();function PFD(D,F,J){if(F?.type==="flow-collection"){let Q=F.end[0];if(Q.indent===D&&(Q.source==="]"||Q.source==="}")&&LFD.containsNewline(F))J(Q,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}jFD.flowIndentCheck=PFD});var VV=R((kFD)=>{var nS=WD();function xFD(D,F,J){let{uniqueKeys:Q}=D.options;if(Q===!1)return!1;let $=typeof Q==="function"?Q:(Z,X)=>Z===X||nS.isScalar(Z)&&nS.isScalar(X)&&Z.value===X.value;return F.some((Z)=>$(Z.key,J))}kFD.mapIncludes=xFD});var sS=R((uFD)=>{var iS=CF(),fFD=OF(),oS=A5(),hFD=yX(),aS=UV(),bFD=VV(),rS="All mapping items must start at the same column";function vFD({composeNode:D,composeEmptyNode:F},J,Q,$,Z){let Y=new(Z?.nodeClass??fFD.YAMLMap)(J.schema);if(J.atRoot)J.atRoot=!1;let q=Q.offset,G=null;for(let W of Q.items){let{start:B,key:K,sep:U,value:V}=W,H=oS.resolveProps(B,{indicator:"explicit-key-ind",next:K??U?.[0],offset:q,onError:$,parentIndent:Q.indent,startOnNewline:!0}),z=!H.found;if(z){if(K){if(K.type==="block-seq")$(q,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==Q.indent)$(q,"BAD_INDENT",rS)}if(!H.anchor&&!H.tag&&!U){if(G=H.end,H.comment)if(Y.comment)Y.comment+=`
|
|
151
|
+
`+H.comment;else Y.comment=H.comment;continue}if(H.newlineAfterProp||hFD.containsNewline(K))$(K??B[B.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(H.found?.indent!==Q.indent)$(q,"BAD_INDENT",rS);J.atKey=!0;let _=H.end,M=K?D(J,K,H,$):F(J,_,B,null,H,$);if(J.schema.compat)aS.flowIndentCheck(Q.indent,K,$);if(J.atKey=!1,bFD.mapIncludes(J,Y.items,M))$(_,"DUPLICATE_KEY","Map keys must be unique");let C=oS.resolveProps(U??[],{indicator:"map-value-ind",next:V,offset:M.range[2],onError:$,parentIndent:Q.indent,startOnNewline:!K||K.type==="block-scalar"});if(q=C.end,C.found){if(z){if(V?.type==="block-map"&&!C.hasNewline)$(q,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(J.options.strict&&H.start<C.found.offset-1024)$(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=V?D(J,V,C,$):F(J,q,U,null,C,$);if(J.schema.compat)aS.flowIndentCheck(Q.indent,V,$);q=O.range[2];let E=new iS.Pair(M,O);if(J.options.keepSourceTokens)E.srcToken=W;Y.items.push(E)}else{if(z)$(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(M.comment)M.comment+=`
|
|
152
|
+
`+C.comment;else M.comment=C.comment;let O=new iS.Pair(M);if(J.options.keepSourceTokens)O.srcToken=W;Y.items.push(O)}}if(G&&G<q)$(G,"IMPOSSIBLE","Map comment with trailing content");return Y.range=[Q.offset,q,G??q],Y}uFD.resolveBlockMap=vFD});var tS=R((cFD)=>{var mFD=MF(),dFD=A5(),pFD=UV();function lFD({composeNode:D,composeEmptyNode:F},J,Q,$,Z){let Y=new(Z?.nodeClass??mFD.YAMLSeq)(J.schema);if(J.atRoot)J.atRoot=!1;if(J.atKey)J.atKey=!1;let q=Q.offset,G=null;for(let{start:W,value:B}of Q.items){let K=dFD.resolveProps(W,{indicator:"seq-item-ind",next:B,offset:q,onError:$,parentIndent:Q.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||B)if(B?.type==="block-seq")$(K.end,"BAD_INDENT","All sequence items must start at the same column");else $(q,"MISSING_CHAR","Sequence item without - indicator");else{if(G=K.end,K.comment)Y.comment=K.comment;continue}let U=B?D(J,B,K,$):F(J,K.end,W,null,K,$);if(J.schema.compat)pFD.flowIndentCheck(Q.indent,B,$);q=U.range[2],Y.items.push(U)}return Y.range=[Q.offset,q,G??q],Y}cFD.resolveBlockSeq=lFD});var e7=R((oFD)=>{function iFD(D,F,J,Q){let $="";if(D){let Z=!1,X="";for(let Y of D){let{source:q,type:G}=Y;switch(G){case"space":Z=!0;break;case"comment":{if(J&&!Z)Q(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=q.substring(1)||" ";if(!$)$=W;else $+=X+W;X="";break}case"newline":if($)X+=q;Z=!0;break;default:Q(Y,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}F+=q.length}}return{comment:$,offset:F}}oFD.resolveEnd=iFD});var Fx=R((Q3D)=>{var rFD=WD(),sFD=CF(),eS=OF(),tFD=MF(),eFD=e7(),Dx=A5(),D3D=yX(),F3D=VV(),HV="Block collections are not allowed within flow collections",zV=(D)=>D&&(D.type==="block-map"||D.type==="block-seq");function J3D({composeNode:D,composeEmptyNode:F},J,Q,$,Z){let X=Q.start.source==="{",Y=X?"flow map":"flow sequence",G=new(Z?.nodeClass??(X?eS.YAMLMap:tFD.YAMLSeq))(J.schema);G.flow=!0;let W=J.atRoot;if(W)J.atRoot=!1;if(J.atKey)J.atKey=!1;let B=Q.offset+Q.start.source.length;for(let z=0;z<Q.items.length;++z){let _=Q.items[z],{start:M,key:C,sep:O,value:E}=_,A=Dx.resolveProps(M,{flow:Y,indicator:"explicit-key-ind",next:C??O?.[0],offset:B,onError:$,parentIndent:Q.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!O&&!E){if(z===0&&A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`);else if(z<Q.items.length-1)$(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Y}`);if(A.comment)if(G.comment)G.comment+=`
|
|
153
|
+
`+A.comment;else G.comment=A.comment;B=A.end;continue}if(!X&&J.options.strict&&D3D.containsNewline(C))$(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(z===0){if(A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`)}else{if(!A.comma)$(A.start,"MISSING_CHAR",`Missing , between ${Y} items`);if(A.comment){let N="";D:for(let w of M)switch(w.type){case"comma":case"space":break;case"comment":N=w.source.substring(1);break D;default:break D}if(N){let w=G.items[G.items.length-1];if(rFD.isPair(w))w=w.value??w.key;if(w.comment)w.comment+=`
|
|
154
|
+
`+N;else w.comment=N;A.comment=A.comment.substring(N.length+1)}}}if(!X&&!O&&!A.found){let N=E?D(J,E,A,$):F(J,A.end,O,null,A,$);if(G.items.push(N),B=N.range[2],zV(E))$(N.range,"BLOCK_IN_FLOW",HV)}else{J.atKey=!0;let N=A.end,w=C?D(J,C,A,$):F(J,N,M,null,A,$);if(zV(C))$(w.range,"BLOCK_IN_FLOW",HV);J.atKey=!1;let T=Dx.resolveProps(O??[],{flow:Y,indicator:"map-value-ind",next:E,offset:w.range[2],onError:$,parentIndent:Q.indent,startOnNewline:!1});if(T.found){if(!X&&!A.found&&J.options.strict){if(O)for(let L of O){if(L===T.found)break;if(L.type==="newline"){$(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<T.found.offset-1024)$(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(E)if("source"in E&&E.source?.[0]===":")$(E,"MISSING_CHAR",`Missing space after : in ${Y}`);else $(T.start,"MISSING_CHAR",`Missing , or : between ${Y} items`);let I=E?D(J,E,T,$):T.found?F(J,T.end,O,null,T,$):null;if(I){if(zV(E))$(I.range,"BLOCK_IN_FLOW",HV)}else if(T.comment)if(w.comment)w.comment+=`
|
|
155
|
+
`+T.comment;else w.comment=T.comment;let S=new sFD.Pair(w,I);if(J.options.keepSourceTokens)S.srcToken=_;if(X){let L=G;if(F3D.mapIncludes(J,L.items,w))$(N,"DUPLICATE_KEY","Map keys must be unique");L.items.push(S)}else{let L=new eS.YAMLMap(J.schema);L.flow=!0,L.items.push(S);let y=(I??w).range;L.range=[w.range[0],y[1],y[2]],G.items.push(L)}B=I?I.range[2]:T.end}}let K=X?"}":"]",[U,...V]=Q.end,H=B;if(U?.source===K)H=U.offset+U.source.length;else{let z=Y[0].toUpperCase()+Y.substring(1),_=W?`${z} must end with a ${K}`:`${z} in block collection must be sufficiently indented and end with a ${K}`;if($(B,W?"MISSING_CHAR":"BAD_INDENT",_),U&&U.source.length!==1)V.unshift(U)}if(V.length>0){let z=eFD.resolveEnd(V,H,J.options.strict,$);if(z.comment)if(G.comment)G.comment+=`
|
|
156
|
+
`+z.comment;else G.comment=z.comment;G.range=[Q.offset,H,z.offset]}else G.range=[Q.offset,H,H];return G}Q3D.resolveFlowCollection=J3D});var Jx=R((U3D)=>{var Z3D=WD(),X3D=rD(),Y3D=OF(),q3D=MF(),G3D=sS(),W3D=tS(),B3D=Fx();function CV(D,F,J,Q,$,Z){let X=J.type==="block-map"?G3D.resolveBlockMap(D,F,J,Q,Z):J.type==="block-seq"?W3D.resolveBlockSeq(D,F,J,Q,Z):B3D.resolveFlowCollection(D,F,J,Q,Z),Y=X.constructor;if($==="!"||$===Y.tagName)return X.tag=Y.tagName,X;if($)X.tag=$;return X}function K3D(D,F,J,Q,$){let Z=Q.tag,X=!Z?null:F.directives.tagName(Z.source,(K)=>$(Z,"TAG_RESOLVE_FAILED",K));if(J.type==="block-seq"){let{anchor:K,newlineAfterProp:U}=Q,V=K&&Z?K.offset>Z.offset?K:Z:K??Z;if(V&&(!U||U.offset<V.offset))$(V,"MISSING_CHAR","Missing newline after block sequence props")}let Y=J.type==="block-map"?"map":J.type==="block-seq"?"seq":J.start.source==="{"?"map":"seq";if(!Z||!X||X==="!"||X===Y3D.YAMLMap.tagName&&Y==="map"||X===q3D.YAMLSeq.tagName&&Y==="seq")return CV(D,F,J,$,X);let q=F.schema.tags.find((K)=>K.tag===X&&K.collection===Y);if(!q){let K=F.schema.knownTags[X];if(K?.collection===Y)F.schema.tags.push(Object.assign({},K,{default:!1})),q=K;else{if(K)$(Z,"BAD_COLLECTION_TYPE",`${K.tag} used for ${Y} collection, but expects ${K.collection??"scalar"}`,!0);else $(Z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,!0);return CV(D,F,J,$,X)}}let G=CV(D,F,J,$,X,q),W=q.resolve?.(G,(K)=>$(Z,"TAG_RESOLVE_FAILED",K),F.options)??G,B=Z3D.isNode(W)?W:new X3D.Scalar(W);if(B.range=G.range,B.tag=X,q?.format)B.format=q.format;return B}U3D.composeCollection=K3D});var OV=R((_3D)=>{var _V=rD();function H3D(D,F,J){let Q=F.offset,$=z3D(F,D.options.strict,J);if(!$)return{value:"",type:null,comment:"",range:[Q,Q,Q]};let Z=$.mode===">"?_V.Scalar.BLOCK_FOLDED:_V.Scalar.BLOCK_LITERAL,X=F.source?C3D(F.source):[],Y=X.length;for(let H=X.length-1;H>=0;--H){let z=X[H][1];if(z===""||z==="\r")Y=H;else break}if(Y===0){let H=$.chomp==="+"&&X.length>0?`
|
|
157
|
+
`.repeat(Math.max(1,X.length-1)):"",z=Q+$.length;if(F.source)z+=F.source.length;return{value:H,type:Z,comment:$.comment,range:[Q,z,z]}}let q=F.indent+$.indent,G=F.offset+$.length,W=0;for(let H=0;H<Y;++H){let[z,_]=X[H];if(_===""||_==="\r"){if($.indent===0&&z.length>q)q=z.length}else{if(z.length<q)J(G+z.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if($.indent===0)q=z.length;if(W=H,q===0&&!D.atRoot)J(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=z.length+_.length+1}for(let H=X.length-1;H>=Y;--H)if(X[H][0].length>q)Y=H+1;let B="",K="",U=!1;for(let H=0;H<W;++H)B+=X[H][0].slice(q)+`
|
|
158
|
+
`;for(let H=W;H<Y;++H){let[z,_]=X[H];G+=z.length+_.length+1;let M=_[_.length-1]==="\r";if(M)_=_.slice(0,-1);if(_&&z.length<q){let O=`Block scalar lines must not be less indented than their ${$.indent?"explicit indentation indicator":"first line"}`;J(G-_.length-(M?2:1),"BAD_INDENT",O),z=""}if(Z===_V.Scalar.BLOCK_LITERAL)B+=K+z.slice(q)+_,K=`
|
|
159
|
+
`;else if(z.length>q||_[0]==="\t"){if(K===" ")K=`
|
|
160
|
+
`;else if(!U&&K===`
|
|
161
|
+
`)K=`
|
|
162
|
+
|
|
163
|
+
`;B+=K+z.slice(q)+_,K=`
|
|
164
|
+
`,U=!0}else if(_==="")if(K===`
|
|
165
|
+
`)B+=`
|
|
166
|
+
`;else K=`
|
|
167
|
+
`;else B+=K+_,K=" ",U=!1}switch($.chomp){case"-":break;case"+":for(let H=Y;H<X.length;++H)B+=`
|
|
168
|
+
`+X[H][0].slice(q);if(B[B.length-1]!==`
|
|
169
|
+
`)B+=`
|
|
170
|
+
`;break;default:B+=`
|
|
171
|
+
`}let V=Q+$.length+F.source.length;return{value:B,type:Z,comment:$.comment,range:[Q,V,V]}}function z3D({offset:D,props:F},J,Q){if(F[0].type!=="block-scalar-header")return Q(F[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:$}=F[0],Z=$[0],X=0,Y="",q=-1;for(let K=1;K<$.length;++K){let U=$[K];if(!Y&&(U==="-"||U==="+"))Y=U;else{let V=Number(U);if(!X&&V)X=V;else if(q===-1)q=D+K}}if(q!==-1)Q(q,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${$}`);let G=!1,W="",B=$.length;for(let K=1;K<F.length;++K){let U=F[K];switch(U.type){case"space":G=!0;case"newline":B+=U.source.length;break;case"comment":if(J&&!G)Q(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");B+=U.source.length,W=U.source.substring(1);break;case"error":Q(U,"UNEXPECTED_TOKEN",U.message),B+=U.source.length;break;default:{let V=`Unexpected token in block scalar header: ${U.type}`;Q(U,"UNEXPECTED_TOKEN",V);let H=U.source;if(H&&typeof H==="string")B+=H.length}}}return{mode:Z,indent:X,chomp:Y,comment:W,length:B}}function C3D(D){let F=D.split(/\n( *)/),J=F[0],Q=J.match(/^( *)/),Z=[Q?.[1]?[Q[1],J.slice(Q[1].length)]:["",J]];for(let X=1;X<F.length;X+=2)Z.push([F[X],F[X+1]]);return Z}_3D.resolveBlockScalar=H3D});var EV=R((L3D)=>{var MV=rD(),M3D=e7();function E3D(D,F,J){let{offset:Q,type:$,source:Z,end:X}=D,Y,q,G=(K,U,V)=>J(Q+K,U,V);switch($){case"scalar":Y=MV.Scalar.PLAIN,q=R3D(Z,G);break;case"single-quoted-scalar":Y=MV.Scalar.QUOTE_SINGLE,q=A3D(Z,G);break;case"double-quoted-scalar":Y=MV.Scalar.QUOTE_DOUBLE,q=w3D(Z,G);break;default:return J(D,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${$}`),{value:"",type:null,comment:"",range:[Q,Q+Z.length,Q+Z.length]}}let W=Q+Z.length,B=M3D.resolveEnd(X,W,F,J);return{value:q,type:Y,comment:B.comment,range:[Q,W,B.offset]}}function R3D(D,F){let J="";switch(D[0]){case"\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=`block scalar indicator ${D[0]}`;break}case"@":case"`":{J=`reserved character ${D[0]}`;break}}if(J)F(0,"BAD_SCALAR_START",`Plain value cannot start with ${J}`);return Qx(D)}function A3D(D,F){if(D[D.length-1]!=="'"||D.length===1)F(D.length,"MISSING_CHAR","Missing closing 'quote");return Qx(D.slice(1,-1)).replace(/''/g,"'")}function Qx(D){let F,J;try{F=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
172
|
+
`,"sy"),J=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
173
|
+
`,"sy")}catch{F=/(.*?)[ \t]*\r?\n/sy,J=/[ \t]*(.*?)[ \t]*\r?\n/sy}let Q=F.exec(D);if(!Q)return D;let $=Q[1],Z=" ",X=F.lastIndex;J.lastIndex=X;while(Q=J.exec(D)){if(Q[1]==="")if(Z===`
|
|
174
|
+
`)$+=Z;else Z=`
|
|
175
|
+
`;else $+=Z+Q[1],Z=" ";X=J.lastIndex}let Y=/[ \t]*(.*)/sy;return Y.lastIndex=X,Q=Y.exec(D),$+Z+(Q?.[1]??"")}function w3D(D,F){let J="";for(let Q=1;Q<D.length-1;++Q){let $=D[Q];if($==="\r"&&D[Q+1]===`
|
|
176
|
+
`)continue;if($===`
|
|
177
|
+
`){let{fold:Z,offset:X}=I3D(D,Q);J+=Z,Q=X}else if($==="\\"){let Z=D[++Q],X=N3D[Z];if(X)J+=X;else if(Z===`
|
|
178
|
+
`){Z=D[Q+1];while(Z===" "||Z==="\t")Z=D[++Q+1]}else if(Z==="\r"&&D[Q+1]===`
|
|
179
|
+
`){Z=D[++Q+1];while(Z===" "||Z==="\t")Z=D[++Q+1]}else if(Z==="x"||Z==="u"||Z==="U"){let Y={x:2,u:4,U:8}[Z];J+=T3D(D,Q+1,Y,F),Q+=Y}else{let Y=D.substr(Q-1,2);F(Q-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),J+=Y}}else if($===" "||$==="\t"){let Z=Q,X=D[Q+1];while(X===" "||X==="\t")X=D[++Q+1];if(X!==`
|
|
180
|
+
`&&!(X==="\r"&&D[Q+2]===`
|
|
181
|
+
`))J+=Q>Z?D.slice(Z,Q+1):$}else J+=$}if(D[D.length-1]!=='"'||D.length===1)F(D.length,"MISSING_CHAR",'Missing closing "quote');return J}function I3D(D,F){let J="",Q=D[F+1];while(Q===" "||Q==="\t"||Q===`
|
|
182
|
+
`||Q==="\r"){if(Q==="\r"&&D[F+2]!==`
|
|
183
|
+
`)break;if(Q===`
|
|
184
|
+
`)J+=`
|
|
185
|
+
`;F+=1,Q=D[F+1]}if(!J)J=" ";return{fold:J,offset:F}}var N3D={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
186
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function T3D(D,F,J,Q){let $=D.substr(F,J),X=$.length===J&&/^[0-9a-fA-F]+$/.test($)?parseInt($,16):NaN;if(isNaN(X)){let Y=D.substr(F-2,J+2);return Q(F-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),Y}return String.fromCodePoint(X)}L3D.resolveFlowScalar=E3D});var Zx=R((f3D)=>{var j3=WD(),$x=rD(),j3D=OV(),S3D=EV();function x3D(D,F,J,Q){let{value:$,type:Z,comment:X,range:Y}=F.type==="block-scalar"?j3D.resolveBlockScalar(D,F,Q):S3D.resolveFlowScalar(F,D.options.strict,Q),q=J?D.directives.tagName(J.source,(B)=>Q(J,"TAG_RESOLVE_FAILED",B)):null,G;if(D.options.stringKeys&&D.atKey)G=D.schema[j3.SCALAR];else if(q)G=k3D(D.schema,$,q,J,Q);else if(F.type==="scalar")G=y3D(D,$,F,Q);else G=D.schema[j3.SCALAR];let W;try{let B=G.resolve($,(K)=>Q(J??F,"TAG_RESOLVE_FAILED",K),D.options);W=j3.isScalar(B)?B:new $x.Scalar(B)}catch(B){let K=B instanceof Error?B.message:String(B);Q(J??F,"TAG_RESOLVE_FAILED",K),W=new $x.Scalar($)}if(W.range=Y,W.source=$,Z)W.type=Z;if(q)W.tag=q;if(G.format)W.format=G.format;if(X)W.comment=X;return W}function k3D(D,F,J,Q,$){if(J==="!")return D[j3.SCALAR];let Z=[];for(let Y of D.tags)if(!Y.collection&&Y.tag===J)if(Y.default&&Y.test)Z.push(Y);else return Y;for(let Y of Z)if(Y.test?.test(F))return Y;let X=D.knownTags[J];if(X&&!X.collection)return D.tags.push(Object.assign({},X,{default:!1,test:void 0})),X;return $(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,J!=="tag:yaml.org,2002:str"),D[j3.SCALAR]}function y3D({atKey:D,directives:F,schema:J},Q,$,Z){let X=J.tags.find((Y)=>(Y.default===!0||D&&Y.default==="key")&&Y.test?.test(Q))||J[j3.SCALAR];if(J.compat){let Y=J.compat.find((q)=>q.default&&q.test?.test(Q))??J[j3.SCALAR];if(X.tag!==Y.tag){let q=F.tagString(X.tag),G=F.tagString(Y.tag),W=`Value may be parsed as either ${q} or ${G}`;Z($,"TAG_RESOLVE_FAILED",W,!0)}}return X}f3D.composeScalar=x3D});var Xx=R((v3D)=>{function b3D(D,F,J){if(F){J??(J=F.length);for(let Q=J-1;Q>=0;--Q){let $=F[Q];switch($.type){case"space":case"comment":case"newline":D-=$.source.length;continue}$=F[++Q];while($?.type==="space")D+=$.source.length,$=F[++Q];break}}return D}v3D.emptyScalarPosition=b3D});var Gx=R((i3D)=>{var g3D=X5(),m3D=WD(),d3D=Jx(),Yx=Zx(),p3D=e7(),l3D=Xx(),c3D={composeNode:qx,composeEmptyNode:RV};function qx(D,F,J,Q){let $=D.atKey,{spaceBefore:Z,comment:X,anchor:Y,tag:q}=J,G,W=!0;switch(F.type){case"alias":if(G=n3D(D,F,Q),Y||q)Q(F,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=Yx.composeScalar(D,F,q,Q),Y)G.anchor=Y.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=d3D.composeCollection(c3D,D,F,J,Q),Y)G.anchor=Y.source.substring(1);break;default:{let B=F.type==="error"?F.message:`Unsupported token (type: ${F.type})`;Q(F,"UNEXPECTED_TOKEN",B),G=RV(D,F.offset,void 0,null,J,Q),W=!1}}if(Y&&G.anchor==="")Q(Y,"BAD_ALIAS","Anchor cannot be an empty string");if($&&D.options.stringKeys&&(!m3D.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))Q(q??F,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Z)G.spaceBefore=!0;if(X)if(F.type==="scalar"&&F.source==="")G.comment=X;else G.commentBefore=X;if(D.options.keepSourceTokens&&W)G.srcToken=F;return G}function RV(D,F,J,Q,{spaceBefore:$,comment:Z,anchor:X,tag:Y,end:q},G){let W={type:"scalar",offset:l3D.emptyScalarPosition(F,J,Q),indent:-1,source:""},B=Yx.composeScalar(D,W,Y,G);if(X){if(B.anchor=X.source.substring(1),B.anchor==="")G(X,"BAD_ALIAS","Anchor cannot be an empty string")}if($)B.spaceBefore=!0;if(Z)B.comment=Z,B.range[2]=q;return B}function n3D({options:D},{offset:F,source:J,end:Q},$){let Z=new g3D.Alias(J.substring(1));if(Z.source==="")$(F,"BAD_ALIAS","Alias cannot be an empty string");if(Z.source.endsWith(":"))$(F+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let X=F+J.length,Y=p3D.resolveEnd(Q,X,D.strict,$);if(Z.range=[F,X,Y.offset],Y.comment)Z.comment=Y.comment;return Z}i3D.composeEmptyNode=RV;i3D.composeNode=qx});var Bx=R((D6D)=>{var r3D=E5(),Wx=Gx(),s3D=e7(),t3D=A5();function e3D(D,F,{offset:J,start:Q,value:$,end:Z},X){let Y=Object.assign({_directives:F},D),q=new r3D.Document(void 0,Y),G={atKey:!1,atRoot:!0,directives:q.directives,options:q.options,schema:q.schema},W=t3D.resolveProps(Q,{indicator:"doc-start",next:$??Z?.[0],offset:J,onError:X,parentIndent:0,startOnNewline:!0});if(W.found){if(q.directives.docStart=!0,$&&($.type==="block-map"||$.type==="block-seq")&&!W.hasNewline)X(W.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}q.contents=$?Wx.composeNode(G,$,W,X):Wx.composeEmptyNode(G,W.end,Q,null,W,X);let B=q.contents.range[2],K=s3D.resolveEnd(Z,B,!1,X);if(K.comment)q.comment=K.comment;return q.range=[J,B,K.offset],q}D6D.composeDoc=e3D});var AV=R((Y6D)=>{var J6D=r("process"),Q6D=TU(),$6D=E5(),w5=R5(),Kx=WD(),Z6D=Bx(),X6D=e7();function I5(D){if(typeof D==="number")return[D,D+1];if(Array.isArray(D))return D.length===2?D:[D[0],D[1]];let{offset:F,source:J}=D;return[F,F+(typeof J==="string"?J.length:1)]}function Ux(D){let F="",J=!1,Q=!1;for(let $=0;$<D.length;++$){let Z=D[$];switch(Z[0]){case"#":F+=(F===""?"":Q?`
|
|
187
|
+
|
|
188
|
+
`:`
|
|
189
|
+
`)+(Z.substring(1)||" "),J=!0,Q=!1;break;case"%":if(D[$+1]?.[0]!=="#")$+=1;J=!1;break;default:if(!J)Q=!0;J=!1}}return{comment:F,afterEmptyLine:Q}}class Vx{constructor(D={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(F,J,Q,$)=>{let Z=I5(F);if($)this.warnings.push(new w5.YAMLWarning(Z,J,Q));else this.errors.push(new w5.YAMLParseError(Z,J,Q))},this.directives=new Q6D.Directives({version:D.version||"1.2"}),this.options=D}decorate(D,F){let{comment:J,afterEmptyLine:Q}=Ux(this.prelude);if(J){let $=D.contents;if(F)D.comment=D.comment?`${D.comment}
|
|
190
|
+
${J}`:J;else if(Q||D.directives.docStart||!$)D.commentBefore=J;else if(Kx.isCollection($)&&!$.flow&&$.items.length>0){let Z=$.items[0];if(Kx.isPair(Z))Z=Z.key;let X=Z.commentBefore;Z.commentBefore=X?`${J}
|
|
191
|
+
${X}`:J}else{let Z=$.commentBefore;$.commentBefore=Z?`${J}
|
|
192
|
+
${Z}`:J}}if(F)Array.prototype.push.apply(D.errors,this.errors),Array.prototype.push.apply(D.warnings,this.warnings);else D.errors=this.errors,D.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ux(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(D,F=!1,J=-1){for(let Q of D)yield*this.next(Q);yield*this.end(F,J)}*next(D){if(J6D.env.LOG_STREAM)console.dir(D,{depth:null});switch(D.type){case"directive":this.directives.add(D.source,(F,J,Q)=>{let $=I5(D);$[0]+=F,this.onError($,"BAD_DIRECTIVE",J,Q)}),this.prelude.push(D.source),this.atDirectives=!0;break;case"document":{let F=Z6D.composeDoc(this.options,this.directives,D,this.onError);if(this.atDirectives&&!F.directives.docStart)this.onError(D,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(F,!1),this.doc)yield this.doc;this.doc=F,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(D.source);break;case"error":{let F=D.source?`${D.message}: ${JSON.stringify(D.source)}`:D.message,J=new w5.YAMLParseError(I5(D),"UNEXPECTED_TOKEN",F);if(this.atDirectives||!this.doc)this.errors.push(J);else this.doc.errors.push(J);break}case"doc-end":{if(!this.doc){this.errors.push(new w5.YAMLParseError(I5(D),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let F=X6D.resolveEnd(D.end,D.offset+D.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),F.comment){let J=this.doc.comment;this.doc.comment=J?`${J}
|
|
193
|
+
${F.comment}`:F.comment}this.doc.range[2]=F.offset;break}default:this.errors.push(new w5.YAMLParseError(I5(D),"UNEXPECTED_TOKEN",`Unsupported token ${D.type}`))}}*end(D=!1,F=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(D){let J=Object.assign({_directives:this.directives},this.options),Q=new $6D.Document(void 0,J);if(this.atDirectives)this.onError(F,"MISSING_CHAR","Missing directives-end indicator line");Q.range=[0,F,F],this.decorate(Q,!1),yield Q}}}Y6D.Composer=Vx});var Cx=R((z6D)=>{var G6D=OV(),W6D=EV(),B6D=R5(),Hx=W5();function K6D(D,F=!0,J){if(D){let Q=($,Z,X)=>{let Y=typeof $==="number"?$:Array.isArray($)?$[0]:$.offset;if(J)J(Y,Z,X);else throw new B6D.YAMLParseError([Y,Y+1],Z,X)};switch(D.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return W6D.resolveFlowScalar(D,F,Q);case"block-scalar":return G6D.resolveBlockScalar({options:{strict:F}},D,Q)}}return null}function U6D(D,F){let{implicitKey:J=!1,indent:Q,inFlow:$=!1,offset:Z=-1,type:X="PLAIN"}=F,Y=Hx.stringifyString({type:X,value:D},{implicitKey:J,indent:Q>0?" ".repeat(Q):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}}),q=F.end??[{type:"newline",offset:-1,indent:Q,source:`
|
|
194
|
+
`}];switch(Y[0]){case"|":case">":{let G=Y.indexOf(`
|
|
195
|
+
`),W=Y.substring(0,G),B=Y.substring(G+1)+`
|
|
196
|
+
`,K=[{type:"block-scalar-header",offset:Z,indent:Q,source:W}];if(!zx(K,q))K.push({type:"newline",offset:-1,indent:Q,source:`
|
|
197
|
+
`});return{type:"block-scalar",offset:Z,indent:Q,props:K,source:B}}case'"':return{type:"double-quoted-scalar",offset:Z,indent:Q,source:Y,end:q};case"'":return{type:"single-quoted-scalar",offset:Z,indent:Q,source:Y,end:q};default:return{type:"scalar",offset:Z,indent:Q,source:Y,end:q}}}function V6D(D,F,J={}){let{afterKey:Q=!1,implicitKey:$=!1,inFlow:Z=!1,type:X}=J,Y="indent"in D?D.indent:null;if(Q&&typeof Y==="number")Y+=2;if(!X)switch(D.type){case"single-quoted-scalar":X="QUOTE_SINGLE";break;case"double-quoted-scalar":X="QUOTE_DOUBLE";break;case"block-scalar":{let G=D.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");X=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:X="PLAIN"}let q=Hx.stringifyString({type:X,value:F},{implicitKey:$||Y===null,indent:Y!==null&&Y>0?" ".repeat(Y):"",inFlow:Z,options:{blockQuote:!0,lineWidth:-1}});switch(q[0]){case"|":case">":H6D(D,q);break;case'"':wV(D,q,"double-quoted-scalar");break;case"'":wV(D,q,"single-quoted-scalar");break;default:wV(D,q,"scalar")}}function H6D(D,F){let J=F.indexOf(`
|
|
198
|
+
`),Q=F.substring(0,J),$=F.substring(J+1)+`
|
|
199
|
+
`;if(D.type==="block-scalar"){let Z=D.props[0];if(Z.type!=="block-scalar-header")throw Error("Invalid block scalar header");Z.source=Q,D.source=$}else{let{offset:Z}=D,X="indent"in D?D.indent:-1,Y=[{type:"block-scalar-header",offset:Z,indent:X,source:Q}];if(!zx(Y,"end"in D?D.end:void 0))Y.push({type:"newline",offset:-1,indent:X,source:`
|
|
200
|
+
`});for(let q of Object.keys(D))if(q!=="type"&&q!=="offset")delete D[q];Object.assign(D,{type:"block-scalar",indent:X,props:Y,source:$})}}function zx(D,F){if(F)for(let J of F)switch(J.type){case"space":case"comment":D.push(J);break;case"newline":return D.push(J),!0}return!1}function wV(D,F,J){switch(D.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":D.type=J,D.source=F;break;case"block-scalar":{let Q=D.props.slice(1),$=F.length;if(D.props[0].type==="block-scalar-header")$-=D.props[0].source.length;for(let Z of Q)Z.offset+=$;delete D.props,Object.assign(D,{type:J,source:F,end:Q});break}case"block-map":case"block-seq":{let $={type:"newline",offset:D.offset+F.length,indent:D.indent,source:`
|
|
201
|
+
`};delete D.items,Object.assign(D,{type:J,source:F,end:[$]});break}default:{let Q="indent"in D?D.indent:-1,$="end"in D&&Array.isArray(D.end)?D.end.filter((Z)=>Z.type==="space"||Z.type==="comment"||Z.type==="newline"):[];for(let Z of Object.keys(D))if(Z!=="type"&&Z!=="offset")delete D[Z];Object.assign(D,{type:J,indent:Q,source:F,end:$})}}}z6D.createScalarToken=U6D;z6D.resolveAsScalar=K6D;z6D.setScalarValue=V6D});var _x=R((E6D)=>{var M6D=(D)=>("type"in D)?hX(D):fX(D);function hX(D){switch(D.type){case"block-scalar":{let F="";for(let J of D.props)F+=hX(J);return F+D.source}case"block-map":case"block-seq":{let F="";for(let J of D.items)F+=fX(J);return F}case"flow-collection":{let F=D.start.source;for(let J of D.items)F+=fX(J);for(let J of D.end)F+=J.source;return F}case"document":{let F=fX(D);if(D.end)for(let J of D.end)F+=J.source;return F}default:{let F=D.source;if("end"in D&&D.end)for(let J of D.end)F+=J.source;return F}}}function fX({start:D,key:F,sep:J,value:Q}){let $="";for(let Z of D)$+=Z.source;if(F)$+=hX(F);if(J)for(let Z of J)$+=Z.source;if(Q)$+=hX(Q);return $}E6D.stringify=M6D});var Ex=R((w6D)=>{var IV=Symbol("break visit"),A6D=Symbol("skip children"),Ox=Symbol("remove item");function S3(D,F){if("type"in D&&D.type==="document")D={start:D.start,value:D.value};Mx(Object.freeze([]),D,F)}S3.BREAK=IV;S3.SKIP=A6D;S3.REMOVE=Ox;S3.itemAtPath=(D,F)=>{let J=D;for(let[Q,$]of F){let Z=J?.[Q];if(Z&&"items"in Z)J=Z.items[$];else return}return J};S3.parentCollection=(D,F)=>{let J=S3.itemAtPath(D,F.slice(0,-1)),Q=F[F.length-1][0],$=J?.[Q];if($&&"items"in $)return $;throw Error("Parent collection not found")};function Mx(D,F,J){let Q=J(F,D);if(typeof Q==="symbol")return Q;for(let $ of["key","value"]){let Z=F[$];if(Z&&"items"in Z){for(let X=0;X<Z.items.length;++X){let Y=Mx(Object.freeze(D.concat([[$,X]])),Z.items[X],J);if(typeof Y==="number")X=Y-1;else if(Y===IV)return IV;else if(Y===Ox)Z.items.splice(X,1),X-=1}if(typeof Q==="function"&&$==="key")Q=Q(F,D)}}return typeof Q==="function"?Q(F,D):Q}w6D.visit=S3});var bX=R((x6D)=>{var NV=Cx(),N6D=_x(),T6D=Ex(),TV="\uFEFF",LV="\x02",PV="\x18",jV="\x1F",L6D=(D)=>!!D&&("items"in D),P6D=(D)=>!!D&&(D.type==="scalar"||D.type==="single-quoted-scalar"||D.type==="double-quoted-scalar"||D.type==="block-scalar");function j6D(D){switch(D){case TV:return"<BOM>";case LV:return"<DOC>";case PV:return"<FLOW_END>";case jV:return"<SCALAR>";default:return JSON.stringify(D)}}function S6D(D){switch(D){case TV:return"byte-order-mark";case LV:return"doc-mode";case PV:return"flow-error-end";case jV:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
202
|
+
`:case`\r
|
|
203
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(D[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}x6D.createScalarToken=NV.createScalarToken;x6D.resolveAsScalar=NV.resolveAsScalar;x6D.setScalarValue=NV.setScalarValue;x6D.stringify=N6D.stringify;x6D.visit=T6D.visit;x6D.BOM=TV;x6D.DOCUMENT=LV;x6D.FLOW_END=PV;x6D.SCALAR=jV;x6D.isCollection=L6D;x6D.isScalar=P6D;x6D.prettyToken=j6D;x6D.tokenType=S6D});var xV=R((o6D)=>{var N5=bX();function t8(D){switch(D){case void 0:case" ":case`
|
|
204
|
+
`:case"\r":case"\t":return!0;default:return!1}}var Rx=new Set("0123456789ABCDEFabcdef"),n6D=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),vX=new Set(",[]{}"),i6D=new Set(` ,[]{}
|
|
205
|
+
\r `),SV=(D)=>!D||i6D.has(D);class Ax{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(D,F=!1){if(D){if(typeof D!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+D:D,this.lineEndPos=null}this.atEnd=!F;let J=this.next??"stream";while(J&&(F||this.hasChars(1)))J=yield*this.parseNext(J)}atLineEnd(){let D=this.pos,F=this.buffer[D];while(F===" "||F==="\t")F=this.buffer[++D];if(!F||F==="#"||F===`
|
|
206
|
+
`)return!0;if(F==="\r")return this.buffer[D+1]===`
|
|
207
|
+
`;return!1}charAt(D){return this.buffer[this.pos+D]}continueScalar(D){let F=this.buffer[D];if(this.indentNext>0){let J=0;while(F===" ")F=this.buffer[++J+D];if(F==="\r"){let Q=this.buffer[J+D+1];if(Q===`
|
|
208
|
+
`||!Q&&!this.atEnd)return D+J+1}return F===`
|
|
209
|
+
`||J>=this.indentNext||!F&&!this.atEnd?D+J:-1}if(F==="-"||F==="."){let J=this.buffer.substr(D,3);if((J==="---"||J==="...")&&t8(this.buffer[D+3]))return-1}return D}getLine(){let D=this.lineEndPos;if(typeof D!=="number"||D!==-1&&D<this.pos)D=this.buffer.indexOf(`
|
|
210
|
+
`,this.pos),this.lineEndPos=D;if(D===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[D-1]==="\r")D-=1;return this.buffer.substring(this.pos,D)}hasChars(D){return this.pos+D<=this.buffer.length}setNext(D){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=D,null}peek(D){return this.buffer.substr(this.pos,D)}*parseNext(D){switch(D){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let D=this.getLine();if(D===null)return this.setNext("stream");if(D[0]===N5.BOM)yield*this.pushCount(1),D=D.substring(1);if(D[0]==="%"){let F=D.length,J=D.indexOf("#");while(J!==-1){let $=D[J-1];if($===" "||$==="\t"){F=J-1;break}else J=D.indexOf("#",J+1)}while(!0){let $=D[F-1];if($===" "||$==="\t")F-=1;else break}let Q=(yield*this.pushCount(F))+(yield*this.pushSpaces(!0));return yield*this.pushCount(D.length-Q),this.pushNewline(),"stream"}if(this.atLineEnd()){let F=yield*this.pushSpaces(!0);return yield*this.pushCount(D.length-F),yield*this.pushNewline(),"stream"}return yield N5.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let D=this.charAt(0);if(!D&&!this.atEnd)return this.setNext("line-start");if(D==="-"||D==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let F=this.peek(3);if((F==="---"||F==="...")&&t8(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,F==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!t8(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[D,F]=this.peek(2);if(!F&&!this.atEnd)return this.setNext("block-start");if((D==="-"||D==="?"||D===":")&&t8(F)){let J=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=J,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let D=this.getLine();if(D===null)return this.setNext("doc");let F=yield*this.pushIndicators();switch(D[F]){case"#":yield*this.pushCount(D.length-F);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(SV),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return F+=yield*this.parseBlockScalarHeader(),F+=yield*this.pushSpaces(!0),yield*this.pushCount(D.length-F),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let D,F,J=-1;do{if(D=yield*this.pushNewline(),D>0)F=yield*this.pushSpaces(!1),this.indentValue=J=F;else F=0;F+=yield*this.pushSpaces(!0)}while(D+F>0);let Q=this.getLine();if(Q===null)return this.setNext("flow");if(J!==-1&&J<this.indentNext&&Q[0]!=="#"||J===0&&(Q.startsWith("---")||Q.startsWith("..."))&&t8(Q[3])){if(!(J===this.indentNext-1&&this.flowLevel===1&&(Q[0]==="]"||Q[0]==="}")))return this.flowLevel=0,yield N5.FLOW_END,yield*this.parseLineStart()}let $=0;while(Q[$]===",")$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0),this.flowKey=!1;switch($+=yield*this.pushIndicators(),Q[$]){case void 0:return"flow";case"#":return yield*this.pushCount(Q.length-$),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(SV),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Z=this.charAt(1);if(this.flowKey||t8(Z)||Z===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let D=this.charAt(0),F=this.buffer.indexOf(D,this.pos+1);if(D==="'")while(F!==-1&&this.buffer[F+1]==="'")F=this.buffer.indexOf("'",F+2);else while(F!==-1){let $=0;while(this.buffer[F-1-$]==="\\")$+=1;if($%2===0)break;F=this.buffer.indexOf('"',F+1)}let J=this.buffer.substring(0,F),Q=J.indexOf(`
|
|
211
|
+
`,this.pos);if(Q!==-1){while(Q!==-1){let $=this.continueScalar(Q+1);if($===-1)break;Q=J.indexOf(`
|
|
212
|
+
`,$)}if(Q!==-1)F=Q-(J[Q-1]==="\r"?2:1)}if(F===-1){if(!this.atEnd)return this.setNext("quoted-scalar");F=this.buffer.length}return yield*this.pushToIndex(F+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let D=this.pos;while(!0){let F=this.buffer[++D];if(F==="+")this.blockScalarKeep=!0;else if(F>"0"&&F<="9")this.blockScalarIndent=Number(F)-1;else if(F!=="-")break}return yield*this.pushUntil((F)=>t8(F)||F==="#")}*parseBlockScalar(){let D=this.pos-1,F=0,J;D:for(let $=this.pos;J=this.buffer[$];++$)switch(J){case" ":F+=1;break;case`
|
|
213
|
+
`:D=$,F=0;break;case"\r":{let Z=this.buffer[$+1];if(!Z&&!this.atEnd)return this.setNext("block-scalar");if(Z===`
|
|
214
|
+
`)break}default:break D}if(!J&&!this.atEnd)return this.setNext("block-scalar");if(F>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=F;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let $=this.continueScalar(D+1);if($===-1)break;D=this.buffer.indexOf(`
|
|
215
|
+
`,$)}while(D!==-1);if(D===-1){if(!this.atEnd)return this.setNext("block-scalar");D=this.buffer.length}}let Q=D+1;J=this.buffer[Q];while(J===" ")J=this.buffer[++Q];if(J==="\t"){while(J==="\t"||J===" "||J==="\r"||J===`
|
|
216
|
+
`)J=this.buffer[++Q];D=Q-1}else if(!this.blockScalarKeep)do{let $=D-1,Z=this.buffer[$];if(Z==="\r")Z=this.buffer[--$];let X=$;while(Z===" ")Z=this.buffer[--$];if(Z===`
|
|
217
|
+
`&&$>=this.pos&&$+1+F>X)D=$;else break}while(!0);return yield N5.SCALAR,yield*this.pushToIndex(D+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let D=this.flowLevel>0,F=this.pos-1,J=this.pos-1,Q;while(Q=this.buffer[++J])if(Q===":"){let $=this.buffer[J+1];if(t8($)||D&&vX.has($))break;F=J}else if(t8(Q)){let $=this.buffer[J+1];if(Q==="\r")if($===`
|
|
218
|
+
`)J+=1,Q=`
|
|
219
|
+
`,$=this.buffer[J+1];else F=J;if($==="#"||D&&vX.has($))break;if(Q===`
|
|
220
|
+
`){let Z=this.continueScalar(J+1);if(Z===-1)break;J=Math.max(J,Z-2)}}else{if(D&&vX.has(Q))break;F=J}if(!Q&&!this.atEnd)return this.setNext("plain-scalar");return yield N5.SCALAR,yield*this.pushToIndex(F+1,!0),D?"flow":"doc"}*pushCount(D){if(D>0)return yield this.buffer.substr(this.pos,D),this.pos+=D,D;return 0}*pushToIndex(D,F){let J=this.buffer.slice(this.pos,D);if(J)return yield J,this.pos+=J.length,J.length;else if(F)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(SV))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let D=this.flowLevel>0,F=this.charAt(1);if(t8(F)||D&&vX.has(F)){if(!D)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let D=this.pos+2,F=this.buffer[D];while(!t8(F)&&F!==">")F=this.buffer[++D];return yield*this.pushToIndex(F===">"?D+1:D,!1)}else{let D=this.pos+1,F=this.buffer[D];while(F)if(n6D.has(F))F=this.buffer[++D];else if(F==="%"&&Rx.has(this.buffer[D+1])&&Rx.has(this.buffer[D+2]))F=this.buffer[D+=3];else break;return yield*this.pushToIndex(D,!1)}}*pushNewline(){let D=this.buffer[this.pos];if(D===`
|
|
221
|
+
`)return yield*this.pushCount(1);else if(D==="\r"&&this.charAt(1)===`
|
|
222
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(D){let F=this.pos-1,J;do J=this.buffer[++F];while(J===" "||D&&J==="\t");let Q=F-this.pos;if(Q>0)yield this.buffer.substr(this.pos,Q),this.pos=F;return Q}*pushUntil(D){let F=this.pos,J=this.buffer[F];while(!D(J))J=this.buffer[++F];return yield*this.pushToIndex(F,!1)}}o6D.Lexer=Ax});var kV=R((r6D)=>{class wx{constructor(){this.lineStarts=[],this.addNewLine=(D)=>this.lineStarts.push(D),this.linePos=(D)=>{let F=0,J=this.lineStarts.length;while(F<J){let $=F+J>>1;if(this.lineStarts[$]<D)F=$+1;else J=$}if(this.lineStarts[F]===D)return{line:F+1,col:1};if(F===0)return{line:0,col:D};let Q=this.lineStarts[F-1];return{line:F,col:D-Q+1}}}}r6D.LineCounter=wx});var yV=R((D7D)=>{var t6D=r("process"),Ix=bX(),e6D=xV();function EF(D,F){for(let J=0;J<D.length;++J)if(D[J].type===F)return!0;return!1}function Nx(D){for(let F=0;F<D.length;++F)switch(D[F].type){case"space":case"comment":case"newline":break;default:return F}return-1}function Lx(D){switch(D?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function uX(D){switch(D.type){case"document":return D.start;case"block-map":{let F=D.items[D.items.length-1];return F.sep??F.start}case"block-seq":return D.items[D.items.length-1].start;default:return[]}}function D9(D){if(D.length===0)return[];let F=D.length;D:while(--F>=0)switch(D[F].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break D}while(D[++F]?.type==="space");return D.splice(F,D.length)}function Tx(D){if(D.start.type==="flow-seq-start"){for(let F of D.items)if(F.sep&&!F.value&&!EF(F.start,"explicit-key-ind")&&!EF(F.sep,"map-value-ind")){if(F.key)F.value=F.key;if(delete F.key,Lx(F.value))if(F.value.end)Array.prototype.push.apply(F.value.end,F.sep);else F.value.end=F.sep;else Array.prototype.push.apply(F.start,F.sep);delete F.sep}}}class Px{constructor(D){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new e6D.Lexer,this.onNewLine=D}*parse(D,F=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex(D,F))yield*this.next(J);if(!F)yield*this.end()}*next(D){if(this.source=D,t6D.env.LOG_TOKENS)console.log("|",Ix.prettyToken(D));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=D.length;return}let F=Ix.tokenType(D);if(!F){let J=`Not a YAML token: ${D}`;yield*this.pop({type:"error",offset:this.offset,message:J,source:D}),this.offset+=D.length}else if(F==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=F,yield*this.step(),F){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+D.length);break;case"space":if(this.atNewLine&&D[0]===" ")this.indent+=D.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=D.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=D.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let D=this.peek(1);if(this.type==="doc-end"&&D?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!D)return yield*this.stream();switch(D.type){case"document":return yield*this.document(D);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(D);case"block-scalar":return yield*this.blockScalar(D);case"block-map":return yield*this.blockMap(D);case"block-seq":return yield*this.blockSequence(D);case"flow-collection":return yield*this.flowCollection(D);case"doc-end":return yield*this.documentEnd(D)}yield*this.pop()}peek(D){return this.stack[this.stack.length-D]}*pop(D){let F=D??this.stack.pop();if(!F)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield F;else{let J=this.peek(1);if(F.type==="block-scalar")F.indent="indent"in J?J.indent:0;else if(F.type==="flow-collection"&&J.type==="document")F.indent=0;if(F.type==="flow-collection")Tx(F);switch(J.type){case"document":J.value=F;break;case"block-scalar":J.props.push(F);break;case"block-map":{let Q=J.items[J.items.length-1];if(Q.value){J.items.push({start:[],key:F,sep:[]}),this.onKeyLine=!0;return}else if(Q.sep)Q.value=F;else{Object.assign(Q,{key:F,sep:[]}),this.onKeyLine=!Q.explicitKey;return}break}case"block-seq":{let Q=J.items[J.items.length-1];if(Q.value)J.items.push({start:[],value:F});else Q.value=F;break}case"flow-collection":{let Q=J.items[J.items.length-1];if(!Q||Q.value)J.items.push({start:[],key:F,sep:[]});else if(Q.sep)Q.value=F;else Object.assign(Q,{key:F,sep:[]});return}default:yield*this.pop(),yield*this.pop(F)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(F.type==="block-map"||F.type==="block-seq")){let Q=F.items[F.items.length-1];if(Q&&!Q.sep&&!Q.value&&Q.start.length>0&&Nx(Q.start)===-1&&(F.indent===0||Q.start.every(($)=>$.type!=="comment"||$.indent<F.indent))){if(J.type==="document")J.end=Q.start;else J.items.push({start:Q.start});F.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let D={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")D.start.push(this.sourceToken);this.stack.push(D);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(D){if(D.value)return yield*this.lineEnd(D);switch(this.type){case"doc-start":{if(Nx(D.start)!==-1)yield*this.pop(),yield*this.step();else D.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":D.start.push(this.sourceToken);return}let F=this.startBlockValue(D);if(F)this.stack.push(F);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(D){if(this.type==="map-value-ind"){let F=uX(this.peek(2)),J=D9(F),Q;if(D.end)Q=D.end,Q.push(this.sourceToken),delete D.end;else Q=[this.sourceToken];let $={type:"block-map",offset:D.offset,indent:D.indent,items:[{start:J,key:D,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=$}else yield*this.lineEnd(D)}*blockScalar(D){switch(this.type){case"space":case"comment":case"newline":D.props.push(this.sourceToken);return;case"scalar":if(D.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let F=this.source.indexOf(`
|
|
223
|
+
`)+1;while(F!==0)this.onNewLine(this.offset+F),F=this.source.indexOf(`
|
|
224
|
+
`,F)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(D){let F=D.items[D.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,F.value){let J="end"in F.value?F.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else D.items.push({start:[this.sourceToken]})}else if(F.sep)F.sep.push(this.sourceToken);else F.start.push(this.sourceToken);return;case"space":case"comment":if(F.value)D.items.push({start:[this.sourceToken]});else if(F.sep)F.sep.push(this.sourceToken);else{if(this.atIndentedComment(F.start,D.indent)){let Q=D.items[D.items.length-2]?.value?.end;if(Array.isArray(Q)){Array.prototype.push.apply(Q,F.start),Q.push(this.sourceToken),D.items.pop();return}}F.start.push(this.sourceToken)}return}if(this.indent>=D.indent){let J=!this.onKeyLine&&this.indent===D.indent,Q=J&&(F.sep||F.explicitKey)&&this.type!=="seq-item-ind",$=[];if(Q&&F.sep&&!F.value){let Z=[];for(let X=0;X<F.sep.length;++X){let Y=F.sep[X];switch(Y.type){case"newline":Z.push(X);break;case"space":break;case"comment":if(Y.indent>D.indent)Z.length=0;break;default:Z.length=0}}if(Z.length>=2)$=F.sep.splice(Z[1])}switch(this.type){case"anchor":case"tag":if(Q||F.value)$.push(this.sourceToken),D.items.push({start:$}),this.onKeyLine=!0;else if(F.sep)F.sep.push(this.sourceToken);else F.start.push(this.sourceToken);return;case"explicit-key-ind":if(!F.sep&&!F.explicitKey)F.start.push(this.sourceToken),F.explicitKey=!0;else if(Q||F.value)$.push(this.sourceToken),D.items.push({start:$,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(F.explicitKey)if(!F.sep)if(EF(F.start,"newline"))Object.assign(F,{key:null,sep:[this.sourceToken]});else{let Z=D9(F.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]})}else if(F.value)D.items.push({start:[],key:null,sep:[this.sourceToken]});else if(EF(F.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]});else if(Lx(F.key)&&!EF(F.sep,"newline")){let Z=D9(F.start),X=F.key,Y=F.sep;Y.push(this.sourceToken),delete F.key,delete F.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:X,sep:Y}]})}else if($.length>0)F.sep=F.sep.concat($,this.sourceToken);else F.sep.push(this.sourceToken);else if(!F.sep)Object.assign(F,{key:null,sep:[this.sourceToken]});else if(F.value||Q)D.items.push({start:$,key:null,sep:[this.sourceToken]});else if(EF(F.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else F.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Z=this.flowScalar(this.type);if(Q||F.value)D.items.push({start:$,key:Z,sep:[]}),this.onKeyLine=!0;else if(F.sep)this.stack.push(Z);else Object.assign(F,{key:Z,sep:[]}),this.onKeyLine=!0;return}default:{let Z=this.startBlockValue(D);if(Z){if(Z.type==="block-seq"){if(!F.explicitKey&&F.sep&&!EF(F.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(J)D.items.push({start:$});this.stack.push(Z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(D){let F=D.items[D.items.length-1];switch(this.type){case"newline":if(F.value){let J="end"in F.value?F.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else D.items.push({start:[this.sourceToken]})}else F.start.push(this.sourceToken);return;case"space":case"comment":if(F.value)D.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(F.start,D.indent)){let Q=D.items[D.items.length-2]?.value?.end;if(Array.isArray(Q)){Array.prototype.push.apply(Q,F.start),Q.push(this.sourceToken),D.items.pop();return}}F.start.push(this.sourceToken)}return;case"anchor":case"tag":if(F.value||this.indent<=D.indent)break;F.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==D.indent)break;if(F.value||EF(F.start,"seq-item-ind"))D.items.push({start:[this.sourceToken]});else F.start.push(this.sourceToken);return}if(this.indent>D.indent){let J=this.startBlockValue(D);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection(D){let F=D.items[D.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if(D.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!F||F.sep)D.items.push({start:[this.sourceToken]});else F.start.push(this.sourceToken);return;case"map-value-ind":if(!F||F.value)D.items.push({start:[],key:null,sep:[this.sourceToken]});else if(F.sep)F.sep.push(this.sourceToken);else Object.assign(F,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!F||F.value)D.items.push({start:[this.sourceToken]});else if(F.sep)F.sep.push(this.sourceToken);else F.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(!F||F.value)D.items.push({start:[],key:Q,sep:[]});else if(F.sep)this.stack.push(Q);else Object.assign(F,{key:Q,sep:[]});return}case"flow-map-end":case"flow-seq-end":D.end.push(this.sourceToken);return}let J=this.startBlockValue(D);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===D.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let Q=uX(J),$=D9(Q);Tx(D);let Z=D.end.splice(1,D.end.length);Z.push(this.sourceToken);let X={type:"block-map",offset:D.offset,indent:D.indent,items:[{start:$,key:D,sep:Z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd(D)}}flowScalar(D){if(this.onNewLine){let F=this.source.indexOf(`
|
|
225
|
+
`)+1;while(F!==0)this.onNewLine(this.offset+F),F=this.source.indexOf(`
|
|
226
|
+
`,F)+1}return{type:D,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(D){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let F=uX(D),J=D9(F);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let F=uX(D),J=D9(F);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(D,F){if(this.type!=="comment")return!1;if(this.indent<=F)return!1;return D.every((J)=>J.type==="newline"||J.type==="space")}*documentEnd(D){if(this.type!=="doc-mode"){if(D.end)D.end.push(this.sourceToken);else D.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(D){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(D.end)D.end.push(this.sourceToken);else D.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}D7D.Parser=Px});var yx=R((G7D)=>{var jx=AV(),J7D=E5(),T5=R5(),Q7D=kU(),$7D=WD(),Z7D=kV(),Sx=yV();function xx(D){let F=D.prettyErrors!==!1;return{lineCounter:D.lineCounter||F&&new Z7D.LineCounter||null,prettyErrors:F}}function X7D(D,F={}){let{lineCounter:J,prettyErrors:Q}=xx(F),$=new Sx.Parser(J?.addNewLine),Z=new jx.Composer(F),X=Array.from(Z.compose($.parse(D)));if(Q&&J)for(let Y of X)Y.errors.forEach(T5.prettifyError(D,J)),Y.warnings.forEach(T5.prettifyError(D,J));if(X.length>0)return X;return Object.assign([],{empty:!0},Z.streamInfo())}function kx(D,F={}){let{lineCounter:J,prettyErrors:Q}=xx(F),$=new Sx.Parser(J?.addNewLine),Z=new jx.Composer(F),X=null;for(let Y of Z.compose($.parse(D),!0,D.length))if(!X)X=Y;else if(X.options.logLevel!=="silent"){X.errors.push(new T5.YAMLParseError(Y.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Q&&J)X.errors.forEach(T5.prettifyError(D,J)),X.warnings.forEach(T5.prettifyError(D,J));return X}function Y7D(D,F,J){let Q=void 0;if(typeof F==="function")Q=F;else if(J===void 0&&F&&typeof F==="object")J=F;let $=kx(D,J);if(!$)return null;if($.warnings.forEach((Z)=>Q7D.warn($.options.logLevel,Z)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:Q},J))}function q7D(D,F,J){let Q=null;if(typeof F==="function"||Array.isArray(F))Q=F;else if(J===void 0&&F)J=F;if(typeof J==="string")J=J.length;if(typeof J==="number"){let $=Math.round(J);J=$<1?void 0:$>8?{indent:8}:{indent:$}}if(D===void 0){let{keepUndefined:$}=J??F??{};if(!$)return}if($7D.isDocument(D)&&!Q)return D.toString(J);return new J7D.Document(D,Q,J).toString(J)}G7D.parse=Y7D;G7D.parseAllDocuments=X7D;G7D.parseDocument=kx;G7D.stringify=q7D});var Y0=R((L9D)=>{L9D.fromCallback=function(D){return Object.defineProperty(function(...F){if(typeof F[F.length-1]==="function")D.apply(this,F);else return new Promise((J,Q)=>{F.push(($,Z)=>$!=null?Q($):J(Z)),D.apply(this,F)})},"name",{value:D.name})};L9D.fromPromise=function(D){return Object.defineProperty(function(...F){let J=F[F.length-1];if(typeof J!=="function")return D.apply(this,F);else F.pop(),D.apply(this,F).then((Q)=>J(null,Q),J)},"name",{value:D.name})}});var Xk=R((IsD,Zk)=>{var wF=r("constants"),S9D=process.cwd,nX=null,x9D=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!nX)nX=S9D.call(process);return nX};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(iX=process.chdir,process.chdir=function(D){nX=null,iX.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,iX)}var iX;Zk.exports=k9D;function k9D(D){if(wF.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)J(D);if(D.chown=Z(D.chown),D.fchown=Z(D.fchown),D.lchown=Z(D.lchown),D.chmod=Q(D.chmod),D.fchmod=Q(D.fchmod),D.lchmod=Q(D.lchmod),D.chownSync=X(D.chownSync),D.fchownSync=X(D.fchownSync),D.lchownSync=X(D.lchownSync),D.chmodSync=$(D.chmodSync),D.fchmodSync=$(D.fchmodSync),D.lchmodSync=$(D.lchmodSync),D.stat=Y(D.stat),D.fstat=Y(D.fstat),D.lstat=Y(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(W,B,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(W,B,K,U){if(U)process.nextTick(U)},D.lchownSync=function(){};if(x9D==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(W){function B(K,U,V){var H=Date.now(),z=0;W(K,U,function _(M){if(M&&(M.code==="EACCES"||M.code==="EPERM"||M.code==="EBUSY")&&Date.now()-H<60000){if(setTimeout(function(){D.stat(U,function(C,O){if(C&&C.code==="ENOENT")W(K,U,_);else V(M)})},z),z<100)z+=10;return}if(V)V(M)})}if(Object.setPrototypeOf)Object.setPrototypeOf(B,W);return B}(D.rename);D.read=typeof D.read!=="function"?D.read:function(W){function B(K,U,V,H,z,_){var M;if(_&&typeof _==="function"){var C=0;M=function(O,E,A){if(O&&O.code==="EAGAIN"&&C<10)return C++,W.call(D,K,U,V,H,z,M);_.apply(this,arguments)}}return W.call(D,K,U,V,H,z,M)}if(Object.setPrototypeOf)Object.setPrototypeOf(B,W);return B}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(W){return function(B,K,U,V,H){var z=0;while(!0)try{return W.call(D,B,K,U,V,H)}catch(_){if(_.code==="EAGAIN"&&z<10){z++;continue}throw _}}}(D.readSync);function F(W){W.lchmod=function(B,K,U){W.open(B,wF.O_WRONLY|wF.O_SYMLINK,K,function(V,H){if(V){if(U)U(V);return}W.fchmod(H,K,function(z){W.close(H,function(_){if(U)U(z||_)})})})},W.lchmodSync=function(B,K){var U=W.openSync(B,wF.O_WRONLY|wF.O_SYMLINK,K),V=!0,H;try{H=W.fchmodSync(U,K),V=!1}finally{if(V)try{W.closeSync(U)}catch(z){}else W.closeSync(U)}return H}}function J(W){if(wF.hasOwnProperty("O_SYMLINK")&&W.futimes)W.lutimes=function(B,K,U,V){W.open(B,wF.O_SYMLINK,function(H,z){if(H){if(V)V(H);return}W.futimes(z,K,U,function(_){W.close(z,function(M){if(V)V(_||M)})})})},W.lutimesSync=function(B,K,U){var V=W.openSync(B,wF.O_SYMLINK),H,z=!0;try{H=W.futimesSync(V,K,U),z=!1}finally{if(z)try{W.closeSync(V)}catch(_){}else W.closeSync(V)}return H};else if(W.futimes)W.lutimes=function(B,K,U,V){if(V)process.nextTick(V)},W.lutimesSync=function(){}}function Q(W){if(!W)return W;return function(B,K,U){return W.call(D,B,K,function(V){if(G(V))V=null;if(U)U.apply(this,arguments)})}}function $(W){if(!W)return W;return function(B,K){try{return W.call(D,B,K)}catch(U){if(!G(U))throw U}}}function Z(W){if(!W)return W;return function(B,K,U,V){return W.call(D,B,K,U,function(H){if(G(H))H=null;if(V)V.apply(this,arguments)})}}function X(W){if(!W)return W;return function(B,K,U){try{return W.call(D,B,K,U)}catch(V){if(!G(V))throw V}}}function Y(W){if(!W)return W;return function(B,K,U){if(typeof K==="function")U=K,K=null;function V(H,z){if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}if(U)U.apply(this,arguments)}return K?W.call(D,B,K,V):W.call(D,B,V)}}function q(W){if(!W)return W;return function(B,K){var U=K?W.call(D,B,K):W.call(D,B);if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}return U}}function G(W){if(!W)return!0;if(W.code==="ENOSYS")return!0;var B=!process.getuid||process.getuid()!==0;if(B){if(W.code==="EINVAL"||W.code==="EPERM")return!0}return!1}}});var Gk=R((NsD,qk)=>{var Yk=r("stream").Stream;qk.exports=y9D;function y9D(D){return{ReadStream:F,WriteStream:J};function F(Q,$){if(!(this instanceof F))return new F(Q,$);Yk.call(this);var Z=this;this.path=Q,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,$=$||{};var X=Object.keys($);for(var Y=0,q=X.length;Y<q;Y++){var G=X[Y];this[G]=$[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Z._read()});return}D.open(this.path,this.flags,this.mode,function(W,B){if(W){Z.emit("error",W),Z.readable=!1;return}Z.fd=B,Z.emit("open",B),Z._read()})}function J(Q,$){if(!(this instanceof J))return new J(Q,$);Yk.call(this),this.path=Q,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,$=$||{};var Z=Object.keys($);for(var X=0,Y=Z.length;X<Y;X++){var q=Z[X];this[q]=$[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var Bk=R((TsD,Wk)=>{Wk.exports=h9D;var f9D=Object.getPrototypeOf||function(D){return D.__proto__};function h9D(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:f9D(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(J){Object.defineProperty(F,J,Object.getOwnPropertyDescriptor(D,J))}),F}});var Q9=R((LsD,cV)=>{var hD=r("fs"),b9D=Xk(),v9D=Gk(),u9D=Bk(),oX=r("util"),V0,rX;if(typeof Symbol==="function"&&typeof Symbol.for==="function")V0=Symbol.for("graceful-fs.queue"),rX=Symbol.for("graceful-fs.previous");else V0="___graceful-fs.queue",rX="___graceful-fs.previous";function g9D(){}function Uk(D,F){Object.defineProperty(D,V0,{get:function(){return F}})}var k3=g9D;if(oX.debuglog)k3=oX.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))k3=function(){var D=oX.format.apply(oX,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
227
|
+
GFS4: `),console.error(D)};if(!hD[V0]){if(dV=global[V0]||[],Uk(hD,dV),hD.close=function(D){function F(J,Q){return D.call(hD,J,function($){if(!$)Kk();if(typeof Q==="function")Q.apply(this,arguments)})}return Object.defineProperty(F,rX,{value:D}),F}(hD.close),hD.closeSync=function(D){function F(J){D.apply(hD,arguments),Kk()}return Object.defineProperty(F,rX,{value:D}),F}(hD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){k3(hD[V0]),r("assert").equal(hD[V0].length,0)})}var dV;if(!global[V0])Uk(global,hD[V0]);cV.exports=pV(u9D(hD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!hD.__patched)cV.exports=pV(hD),hD.__patched=!0;function pV(D){b9D(D),D.gracefulify=pV,D.createReadStream=E,D.createWriteStream=A;var F=D.readFile;D.readFile=J;function J(T,I,S){if(typeof I==="function")S=I,I=null;return L(T,I,S);function L(y,m,j,h){return F(y,m,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))J9([L,[y,m,j],g,h||Date.now(),Date.now()]);else if(typeof j==="function")j.apply(this,arguments)})}}var Q=D.writeFile;D.writeFile=$;function $(T,I,S,L){if(typeof S==="function")L=S,S=null;return y(T,I,S,L);function y(m,j,h,g,v){return Q(m,j,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))J9([y,[m,j,h,g],u,v||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var Z=D.appendFile;if(Z)D.appendFile=X;function X(T,I,S,L){if(typeof S==="function")L=S,S=null;return y(T,I,S,L);function y(m,j,h,g,v){return Z(m,j,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))J9([y,[m,j,h,g],u,v||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var Y=D.copyFile;if(Y)D.copyFile=q;function q(T,I,S,L){if(typeof S==="function")L=S,S=0;return y(T,I,S,L);function y(m,j,h,g,v){return Y(m,j,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))J9([y,[m,j,h,g],u,v||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var G=D.readdir;D.readdir=B;var W=/^v[0-5]\./;function B(T,I,S){if(typeof I==="function")S=I,I=null;var L=W.test(process.version)?function(j,h,g,v){return G(j,y(j,h,g,v))}:function(j,h,g,v){return G(j,h,y(j,h,g,v))};return L(T,I,S);function y(m,j,h,g){return function(v,u){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))J9([L,[m,j,h],v,g||Date.now(),Date.now()]);else{if(u&&u.sort)u.sort();if(typeof h==="function")h.call(this,v,u)}}}}if(process.version.substr(0,4)==="v0.8"){var K=v9D(D);_=K.ReadStream,C=K.WriteStream}var U=D.ReadStream;if(U)_.prototype=Object.create(U.prototype),_.prototype.open=M;var V=D.WriteStream;if(V)C.prototype=Object.create(V.prototype),C.prototype.open=O;Object.defineProperty(D,"ReadStream",{get:function(){return _},set:function(T){_=T},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return C},set:function(T){C=T},enumerable:!0,configurable:!0});var H=_;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(T){H=T},enumerable:!0,configurable:!0});var z=C;Object.defineProperty(D,"FileWriteStream",{get:function(){return z},set:function(T){z=T},enumerable:!0,configurable:!0});function _(T,I){if(this instanceof _)return U.apply(this,arguments),this;else return _.apply(Object.create(_.prototype),arguments)}function M(){var T=this;w(T.path,T.flags,T.mode,function(I,S){if(I){if(T.autoClose)T.destroy();T.emit("error",I)}else T.fd=S,T.emit("open",S),T.read()})}function C(T,I){if(this instanceof C)return V.apply(this,arguments),this;else return C.apply(Object.create(C.prototype),arguments)}function O(){var T=this;w(T.path,T.flags,T.mode,function(I,S){if(I)T.destroy(),T.emit("error",I);else T.fd=S,T.emit("open",S)})}function E(T,I){return new D.ReadStream(T,I)}function A(T,I){return new D.WriteStream(T,I)}var N=D.open;D.open=w;function w(T,I,S,L){if(typeof S==="function")L=S,S=null;return y(T,I,S,L);function y(m,j,h,g,v){return N(m,j,h,function(u,o){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))J9([y,[m,j,h,g],u,v||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}return D}function J9(D){k3("ENQUEUE",D[0].name,D[1]),hD[V0].push(D),lV()}var aX;function Kk(){var D=Date.now();for(var F=0;F<hD[V0].length;++F)if(hD[V0][F].length>2)hD[V0][F][3]=D,hD[V0][F][4]=D;lV()}function lV(){if(clearTimeout(aX),aX=void 0,hD[V0].length===0)return;var D=hD[V0].shift(),F=D[0],J=D[1],Q=D[2],$=D[3],Z=D[4];if($===void 0)k3("RETRY",F.name,J),F.apply(null,J);else if(Date.now()-$>=60000){k3("TIMEOUT",F.name,J);var X=J.pop();if(typeof X==="function")X.call(null,Q)}else{var Y=Date.now()-Z,q=Math.max(Z-$,1),G=Math.min(q*1.2,100);if(Y>=G)k3("RETRY",F.name,J),F.apply(null,J.concat([$]));else hD[V0].push(D)}if(aX===void 0)aX=setTimeout(lV,0)}});var h0=R((nV)=>{var Vk=Y0().fromCallback,f0=Q9(),m9D=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((D)=>{return typeof f0[D]==="function"});Object.assign(nV,f0);m9D.forEach((D)=>{nV[D]=Vk(f0[D])});nV.exists=function(D,F){if(typeof F==="function")return f0.exists(D,F);return new Promise((J)=>{return f0.exists(D,J)})};nV.read=function(D,F,J,Q,$,Z){if(typeof Z==="function")return f0.read(D,F,J,Q,$,Z);return new Promise((X,Y)=>{f0.read(D,F,J,Q,$,(q,G,W)=>{if(q)return Y(q);X({bytesRead:G,buffer:W})})})};nV.write=function(D,F,...J){if(typeof J[J.length-1]==="function")return f0.write(D,F,...J);return new Promise((Q,$)=>{f0.write(D,F,...J,(Z,X,Y)=>{if(Z)return $(Z);Q({bytesWritten:X,buffer:Y})})})};nV.readv=function(D,F,...J){if(typeof J[J.length-1]==="function")return f0.readv(D,F,...J);return new Promise((Q,$)=>{f0.readv(D,F,...J,(Z,X,Y)=>{if(Z)return $(Z);Q({bytesRead:X,buffers:Y})})})};nV.writev=function(D,F,...J){if(typeof J[J.length-1]==="function")return f0.writev(D,F,...J);return new Promise((Q,$)=>{f0.writev(D,F,...J,(Z,X,Y)=>{if(Z)return $(Z);Q({bytesWritten:X,buffers:Y})})})};if(typeof f0.realpath.native==="function")nV.realpath.native=Vk(f0.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var zk=R((o9D,Hk)=>{var i9D=r("path");o9D.checkPath=function(F){if(process.platform==="win32"){if(/[<>:"|?*]/.test(F.replace(i9D.parse(F).root,""))){let Q=Error(`Path contains invalid characters: ${F}`);throw Q.code="EINVAL",Q}}}});var Mk=R((r9D,iV)=>{var Ck=h0(),{checkPath:_k}=zk(),Ok=(D)=>{let F={mode:511};if(typeof D==="number")return D;return{...F,...D}.mode};r9D.makeDir=async(D,F)=>{return _k(D),Ck.mkdir(D,{mode:Ok(F),recursive:!0})};r9D.makeDirSync=(D,F)=>{return _k(D),Ck.mkdirSync(D,{mode:Ok(F),recursive:!0})}});var e8=R((SsD,Ek)=>{var e9D=Y0().fromPromise,{makeDir:D4D,makeDirSync:oV}=Mk(),aV=e9D(D4D);Ek.exports={mkdirs:aV,mkdirsSync:oV,mkdirp:aV,mkdirpSync:oV,ensureDir:aV,ensureDirSync:oV}});var IF=R((xsD,Ak)=>{var F4D=Y0().fromPromise,Rk=h0();function J4D(D){return Rk.access(D).then(()=>!0).catch(()=>!1)}Ak.exports={pathExists:F4D(J4D),pathExistsSync:Rk.existsSync}});var rV=R((ksD,wk)=>{var $9=h0(),Q4D=Y0().fromPromise;async function $4D(D,F,J){let Q=await $9.open(D,"r+"),$=null;try{await $9.futimes(Q,F,J)}finally{try{await $9.close(Q)}catch(Z){$=Z}}if($)throw $}function Z4D(D,F,J){let Q=$9.openSync(D,"r+");return $9.futimesSync(Q,F,J),$9.closeSync(Q)}wk.exports={utimesMillis:Q4D($4D),utimesMillisSync:Z4D}});var y3=R((ysD,Lk)=>{var Z9=h0(),q0=r("path"),Ik=Y0().fromPromise;function X4D(D,F,J){let Q=J.dereference?($)=>Z9.stat($,{bigint:!0}):($)=>Z9.lstat($,{bigint:!0});return Promise.all([Q(D),Q(F).catch(($)=>{if($.code==="ENOENT")return null;throw $})]).then(([$,Z])=>({srcStat:$,destStat:Z}))}function Y4D(D,F,J){let Q,$=J.dereference?(X)=>Z9.statSync(X,{bigint:!0}):(X)=>Z9.lstatSync(X,{bigint:!0}),Z=$(D);try{Q=$(F)}catch(X){if(X.code==="ENOENT")return{srcStat:Z,destStat:null};throw X}return{srcStat:Z,destStat:Q}}async function q4D(D,F,J,Q){let{srcStat:$,destStat:Z}=await X4D(D,F,Q);if(Z){if(L5($,Z)){let X=q0.basename(D),Y=q0.basename(F);if(J==="move"&&X!==Y&&X.toLowerCase()===Y.toLowerCase())return{srcStat:$,destStat:Z,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if($.isDirectory()&&!Z.isDirectory())throw Error(`Cannot overwrite non-directory '${F}' with directory '${D}'.`);if(!$.isDirectory()&&Z.isDirectory())throw Error(`Cannot overwrite directory '${F}' with non-directory '${D}'.`)}if($.isDirectory()&&sV(D,F))throw Error(sX(D,F,J));return{srcStat:$,destStat:Z}}function G4D(D,F,J,Q){let{srcStat:$,destStat:Z}=Y4D(D,F,Q);if(Z){if(L5($,Z)){let X=q0.basename(D),Y=q0.basename(F);if(J==="move"&&X!==Y&&X.toLowerCase()===Y.toLowerCase())return{srcStat:$,destStat:Z,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if($.isDirectory()&&!Z.isDirectory())throw Error(`Cannot overwrite non-directory '${F}' with directory '${D}'.`);if(!$.isDirectory()&&Z.isDirectory())throw Error(`Cannot overwrite directory '${F}' with non-directory '${D}'.`)}if($.isDirectory()&&sV(D,F))throw Error(sX(D,F,J));return{srcStat:$,destStat:Z}}async function Nk(D,F,J,Q){let $=q0.resolve(q0.dirname(D)),Z=q0.resolve(q0.dirname(J));if(Z===$||Z===q0.parse(Z).root)return;let X;try{X=await Z9.stat(Z,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(L5(F,X))throw Error(sX(D,J,Q));return Nk(D,F,Z,Q)}function Tk(D,F,J,Q){let $=q0.resolve(q0.dirname(D)),Z=q0.resolve(q0.dirname(J));if(Z===$||Z===q0.parse(Z).root)return;let X;try{X=Z9.statSync(Z,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(L5(F,X))throw Error(sX(D,J,Q));return Tk(D,F,Z,Q)}function L5(D,F){return F.ino!==void 0&&F.dev!==void 0&&F.ino===D.ino&&F.dev===D.dev}function sV(D,F){let J=q0.resolve(D).split(q0.sep).filter(($)=>$),Q=q0.resolve(F).split(q0.sep).filter(($)=>$);return J.every(($,Z)=>Q[Z]===$)}function sX(D,F,J){return`Cannot ${J} '${D}' to a subdirectory of itself, '${F}'.`}Lk.exports={checkPaths:Ik(q4D),checkPathsSync:G4D,checkParentPaths:Ik(Nk),checkParentPathsSync:Tk,isSrcSubdir:sV,areIdentical:L5}});var jk=R((fsD,Pk)=>{async function W4D(D,F){let J=[];for await(let Q of D)J.push(F(Q).then(()=>null,($)=>$??Error("unknown error")));await Promise.all(J.map((Q)=>Q.then(($)=>{if($!==null)throw $})))}Pk.exports={asyncIteratorConcurrentProcess:W4D}});var fk=R((hsD,yk)=>{var I0=h0(),P5=r("path"),{mkdirs:B4D}=e8(),{pathExists:K4D}=IF(),{utimesMillis:U4D}=rV(),j5=y3(),{asyncIteratorConcurrentProcess:V4D}=jk();async function H4D(D,F,J={}){if(typeof J==="function")J={filter:J};if(J.clobber="clobber"in J?!!J.clobber:!0,J.overwrite="overwrite"in J?!!J.overwrite:J.clobber,J.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
228
|
+
|
|
229
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:Q,destStat:$}=await j5.checkPaths(D,F,"copy",J);if(await j5.checkParentPaths(D,Q,F,"copy"),!await xk(D,F,J))return;let X=P5.dirname(F);if(!await K4D(X))await B4D(X);await kk($,D,F,J)}async function xk(D,F,J){if(!J.filter)return!0;return J.filter(D,F)}async function kk(D,F,J,Q){let Z=await(Q.dereference?I0.stat:I0.lstat)(F);if(Z.isDirectory())return O4D(Z,D,F,J,Q);if(Z.isFile()||Z.isCharacterDevice()||Z.isBlockDevice())return z4D(Z,D,F,J,Q);if(Z.isSymbolicLink())return M4D(D,F,J,Q);if(Z.isSocket())throw Error(`Cannot copy a socket file: ${F}`);if(Z.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${F}`);throw Error(`Unknown file: ${F}`)}async function z4D(D,F,J,Q,$){if(!F)return Sk(D,J,Q,$);if($.overwrite)return await I0.unlink(Q),Sk(D,J,Q,$);if($.errorOnExist)throw Error(`'${Q}' already exists`)}async function Sk(D,F,J,Q){if(await I0.copyFile(F,J),Q.preserveTimestamps){if(C4D(D.mode))await _4D(J,D.mode);let $=await I0.stat(F);await U4D(J,$.atime,$.mtime)}return I0.chmod(J,D.mode)}function C4D(D){return(D&128)===0}function _4D(D,F){return I0.chmod(D,F|128)}async function O4D(D,F,J,Q,$){if(!F)await I0.mkdir(Q);if(await V4D(await I0.opendir(J),async(Z)=>{let X=P5.join(J,Z.name),Y=P5.join(Q,Z.name);if(await xk(X,Y,$)){let{destStat:G}=await j5.checkPaths(X,Y,"copy",$);await kk(G,X,Y,$)}}),!F)await I0.chmod(Q,D.mode)}async function M4D(D,F,J,Q){let $=await I0.readlink(F);if(Q.dereference)$=P5.resolve(process.cwd(),$);if(!D)return I0.symlink($,J);let Z=null;try{Z=await I0.readlink(J)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return I0.symlink($,J);throw X}if(Q.dereference)Z=P5.resolve(process.cwd(),Z);if($!==Z){if(j5.isSrcSubdir($,Z))throw Error(`Cannot copy '${$}' to a subdirectory of itself, '${Z}'.`);if(j5.isSrcSubdir(Z,$))throw Error(`Cannot overwrite '${Z}' with '${$}'.`)}return await I0.unlink(J),I0.symlink($,J)}yk.exports=H4D});var gk=R((bsD,uk)=>{var b0=Q9(),S5=r("path"),E4D=e8().mkdirsSync,R4D=rV().utimesMillisSync,x5=y3();function A4D(D,F,J){if(typeof J==="function")J={filter:J};if(J=J||{},J.clobber="clobber"in J?!!J.clobber:!0,J.overwrite="overwrite"in J?!!J.overwrite:J.clobber,J.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
230
|
+
|
|
231
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:Q,destStat:$}=x5.checkPathsSync(D,F,"copy",J);if(x5.checkParentPathsSync(D,Q,F,"copy"),J.filter&&!J.filter(D,F))return;let Z=S5.dirname(F);if(!b0.existsSync(Z))E4D(Z);return hk($,D,F,J)}function hk(D,F,J,Q){let Z=(Q.dereference?b0.statSync:b0.lstatSync)(F);if(Z.isDirectory())return j4D(Z,D,F,J,Q);else if(Z.isFile()||Z.isCharacterDevice()||Z.isBlockDevice())return w4D(Z,D,F,J,Q);else if(Z.isSymbolicLink())return k4D(D,F,J,Q);else if(Z.isSocket())throw Error(`Cannot copy a socket file: ${F}`);else if(Z.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${F}`);throw Error(`Unknown file: ${F}`)}function w4D(D,F,J,Q,$){if(!F)return bk(D,J,Q,$);return I4D(D,J,Q,$)}function I4D(D,F,J,Q){if(Q.overwrite)return b0.unlinkSync(J),bk(D,F,J,Q);else if(Q.errorOnExist)throw Error(`'${J}' already exists`)}function bk(D,F,J,Q){if(b0.copyFileSync(F,J),Q.preserveTimestamps)N4D(D.mode,F,J);return tV(J,D.mode)}function N4D(D,F,J){if(T4D(D))L4D(J,D);return P4D(F,J)}function T4D(D){return(D&128)===0}function L4D(D,F){return tV(D,F|128)}function tV(D,F){return b0.chmodSync(D,F)}function P4D(D,F){let J=b0.statSync(D);return R4D(F,J.atime,J.mtime)}function j4D(D,F,J,Q,$){if(!F)return S4D(D.mode,J,Q,$);return vk(J,Q,$)}function S4D(D,F,J,Q){return b0.mkdirSync(J),vk(F,J,Q),tV(J,D)}function vk(D,F,J){let Q=b0.opendirSync(D);try{let $;while(($=Q.readSync())!==null)x4D($.name,D,F,J)}finally{Q.closeSync()}}function x4D(D,F,J,Q){let $=S5.join(F,D),Z=S5.join(J,D);if(Q.filter&&!Q.filter($,Z))return;let{destStat:X}=x5.checkPathsSync($,Z,"copy",Q);return hk(X,$,Z,Q)}function k4D(D,F,J,Q){let $=b0.readlinkSync(F);if(Q.dereference)$=S5.resolve(process.cwd(),$);if(!D)return b0.symlinkSync($,J);else{let Z;try{Z=b0.readlinkSync(J)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return b0.symlinkSync($,J);throw X}if(Q.dereference)Z=S5.resolve(process.cwd(),Z);if($!==Z){if(x5.isSrcSubdir($,Z))throw Error(`Cannot copy '${$}' to a subdirectory of itself, '${Z}'.`);if(x5.isSrcSubdir(Z,$))throw Error(`Cannot overwrite '${Z}' with '${$}'.`)}return y4D($,J)}}function y4D(D,F){return b0.unlinkSync(F),b0.symlinkSync(D,F)}uk.exports=A4D});var tX=R((vsD,mk)=>{var f4D=Y0().fromPromise;mk.exports={copy:f4D(fk()),copySync:gk()}});var k5=R((usD,pk)=>{var dk=Q9(),h4D=Y0().fromCallback;function b4D(D,F){dk.rm(D,{recursive:!0,force:!0},F)}function v4D(D){dk.rmSync(D,{recursive:!0,force:!0})}pk.exports={remove:h4D(b4D),removeSync:v4D}});var sk=R((gsD,rk)=>{var u4D=Y0().fromPromise,nk=h0(),ik=r("path"),ok=e8(),ak=k5(),lk=u4D(async function(F){let J;try{J=await nk.readdir(F)}catch{return ok.mkdirs(F)}return Promise.all(J.map((Q)=>ak.remove(ik.join(F,Q))))});function ck(D){let F;try{F=nk.readdirSync(D)}catch{return ok.mkdirsSync(D)}F.forEach((J)=>{J=ik.join(D,J),ak.removeSync(J)})}rk.exports={emptyDirSync:ck,emptydirSync:ck,emptyDir:lk,emptydir:lk}});var Fy=R((msD,Dy)=>{var g4D=Y0().fromPromise,tk=r("path"),E1=h0(),ek=e8();async function m4D(D){let F;try{F=await E1.stat(D)}catch{}if(F&&F.isFile())return;let J=tk.dirname(D),Q=null;try{Q=await E1.stat(J)}catch($){if($.code==="ENOENT"){await ek.mkdirs(J),await E1.writeFile(D,"");return}else throw $}if(Q.isDirectory())await E1.writeFile(D,"");else await E1.readdir(J)}function d4D(D){let F;try{F=E1.statSync(D)}catch{}if(F&&F.isFile())return;let J=tk.dirname(D);try{if(!E1.statSync(J).isDirectory())E1.readdirSync(J)}catch(Q){if(Q&&Q.code==="ENOENT")ek.mkdirsSync(J);else throw Q}E1.writeFileSync(D,"")}Dy.exports={createFile:g4D(m4D),createFileSync:d4D}});var Xy=R((dsD,Zy)=>{var p4D=Y0().fromPromise,Jy=r("path"),NF=h0(),Qy=e8(),{pathExists:l4D}=IF(),{areIdentical:$y}=y3();async function c4D(D,F){let J;try{J=await NF.lstat(F)}catch{}let Q;try{Q=await NF.lstat(D)}catch(X){throw X.message=X.message.replace("lstat","ensureLink"),X}if(J&&$y(Q,J))return;let $=Jy.dirname(F);if(!await l4D($))await Qy.mkdirs($);await NF.link(D,F)}function n4D(D,F){let J;try{J=NF.lstatSync(F)}catch{}try{let Z=NF.lstatSync(D);if(J&&$y(Z,J))return}catch(Z){throw Z.message=Z.message.replace("lstat","ensureLink"),Z}let Q=Jy.dirname(F);if(NF.existsSync(Q))return NF.linkSync(D,F);return Qy.mkdirsSync(Q),NF.linkSync(D,F)}Zy.exports={createLink:p4D(c4D),createLinkSync:n4D}});var qy=R((psD,Yy)=>{var TF=r("path"),y5=h0(),{pathExists:i4D}=IF(),o4D=Y0().fromPromise;async function a4D(D,F){if(TF.isAbsolute(D)){try{await y5.lstat(D)}catch(Z){throw Z.message=Z.message.replace("lstat","ensureSymlink"),Z}return{toCwd:D,toDst:D}}let J=TF.dirname(F),Q=TF.join(J,D);if(await i4D(Q))return{toCwd:Q,toDst:D};try{await y5.lstat(D)}catch(Z){throw Z.message=Z.message.replace("lstat","ensureSymlink"),Z}return{toCwd:D,toDst:TF.relative(J,D)}}function r4D(D,F){if(TF.isAbsolute(D)){if(!y5.existsSync(D))throw Error("absolute srcpath does not exist");return{toCwd:D,toDst:D}}let J=TF.dirname(F),Q=TF.join(J,D);if(y5.existsSync(Q))return{toCwd:Q,toDst:D};if(!y5.existsSync(D))throw Error("relative srcpath does not exist");return{toCwd:D,toDst:TF.relative(J,D)}}Yy.exports={symlinkPaths:o4D(a4D),symlinkPathsSync:r4D}});var By=R((lsD,Wy)=>{var Gy=h0(),s4D=Y0().fromPromise;async function t4D(D,F){if(F)return F;let J;try{J=await Gy.lstat(D)}catch{return"file"}return J&&J.isDirectory()?"dir":"file"}function e4D(D,F){if(F)return F;let J;try{J=Gy.lstatSync(D)}catch{return"file"}return J&&J.isDirectory()?"dir":"file"}Wy.exports={symlinkType:s4D(t4D),symlinkTypeSync:e4D}});var Hy=R((csD,Vy)=>{var D5D=Y0().fromPromise,Ky=r("path"),b2=h0(),{mkdirs:F5D,mkdirsSync:J5D}=e8(),{symlinkPaths:Q5D,symlinkPathsSync:$5D}=qy(),{symlinkType:Z5D,symlinkTypeSync:X5D}=By(),{pathExists:Y5D}=IF(),{areIdentical:Uy}=y3();async function q5D(D,F,J){let Q;try{Q=await b2.lstat(F)}catch{}if(Q&&Q.isSymbolicLink()){let[Y,q]=await Promise.all([b2.stat(D),b2.stat(F)]);if(Uy(Y,q))return}let $=await Q5D(D,F);D=$.toDst;let Z=await Z5D($.toCwd,J),X=Ky.dirname(F);if(!await Y5D(X))await F5D(X);return b2.symlink(D,F,Z)}function G5D(D,F,J){let Q;try{Q=b2.lstatSync(F)}catch{}if(Q&&Q.isSymbolicLink()){let Y=b2.statSync(D),q=b2.statSync(F);if(Uy(Y,q))return}let $=$5D(D,F);D=$.toDst,J=X5D($.toCwd,J);let Z=Ky.dirname(F);if(b2.existsSync(Z))return b2.symlinkSync(D,F,J);return J5D(Z),b2.symlinkSync(D,F,J)}Vy.exports={createSymlink:D5D(q5D),createSymlinkSync:G5D}});var Ay=R((nsD,Ry)=>{var{createFile:zy,createFileSync:Cy}=Fy(),{createLink:_y,createLinkSync:Oy}=Xy(),{createSymlink:My,createSymlinkSync:Ey}=Hy();Ry.exports={createFile:zy,createFileSync:Cy,ensureFile:zy,ensureFileSync:Cy,createLink:_y,createLinkSync:Oy,ensureLink:_y,ensureLinkSync:Oy,createSymlink:My,createSymlinkSync:Ey,ensureSymlink:My,ensureSymlinkSync:Ey}});var eX=R((isD,wy)=>{function W5D(D,{EOL:F=`
|
|
232
|
+
`,finalEOL:J=!0,replacer:Q=null,spaces:$}={}){let Z=J?F:"";return JSON.stringify(D,Q,$).replace(/\n/g,F)+Z}function B5D(D){if(Buffer.isBuffer(D))D=D.toString("utf8");return D.replace(/^\uFEFF/,"")}wy.exports={stringify:W5D,stripBom:B5D}});var Ly=R((osD,Ty)=>{var X9;try{X9=Q9()}catch(D){X9=r("fs")}var DY=Y0(),{stringify:Iy,stripBom:Ny}=eX();async function K5D(D,F={}){if(typeof F==="string")F={encoding:F};let J=F.fs||X9,Q="throws"in F?F.throws:!0,$=await DY.fromCallback(J.readFile)(D,F);$=Ny($);let Z;try{Z=JSON.parse($,F?F.reviver:null)}catch(X){if(Q)throw X.message=`${D}: ${X.message}`,X;else return null}return Z}var U5D=DY.fromPromise(K5D);function V5D(D,F={}){if(typeof F==="string")F={encoding:F};let J=F.fs||X9,Q="throws"in F?F.throws:!0;try{let $=J.readFileSync(D,F);return $=Ny($),JSON.parse($,F.reviver)}catch($){if(Q)throw $.message=`${D}: ${$.message}`,$;else return null}}async function H5D(D,F,J={}){let Q=J.fs||X9,$=Iy(F,J);await DY.fromCallback(Q.writeFile)(D,$,J)}var z5D=DY.fromPromise(H5D);function C5D(D,F,J={}){let Q=J.fs||X9,$=Iy(F,J);return Q.writeFileSync(D,$,J)}Ty.exports={readFile:U5D,readFileSync:V5D,writeFile:z5D,writeFileSync:C5D}});var jy=R((asD,Py)=>{var FY=Ly();Py.exports={readJson:FY.readFile,readJsonSync:FY.readFileSync,writeJson:FY.writeFile,writeJsonSync:FY.writeFileSync}});var JY=R((rsD,ky)=>{var _5D=Y0().fromPromise,eV=h0(),Sy=r("path"),xy=e8(),O5D=IF().pathExists;async function M5D(D,F,J="utf-8"){let Q=Sy.dirname(D);if(!await O5D(Q))await xy.mkdirs(Q);return eV.writeFile(D,F,J)}function E5D(D,...F){let J=Sy.dirname(D);if(!eV.existsSync(J))xy.mkdirsSync(J);eV.writeFileSync(D,...F)}ky.exports={outputFile:_5D(M5D),outputFileSync:E5D}});var fy=R((ssD,yy)=>{var{stringify:R5D}=eX(),{outputFile:A5D}=JY();async function w5D(D,F,J={}){let Q=R5D(F,J);await A5D(D,Q,J)}yy.exports=w5D});var by=R((tsD,hy)=>{var{stringify:I5D}=eX(),{outputFileSync:N5D}=JY();function T5D(D,F,J){let Q=I5D(F,J);N5D(D,Q,J)}hy.exports=T5D});var uy=R((esD,vy)=>{var L5D=Y0().fromPromise,v0=jy();v0.outputJson=L5D(fy());v0.outputJsonSync=by();v0.outputJSON=v0.outputJson;v0.outputJSONSync=v0.outputJsonSync;v0.writeJSON=v0.writeJson;v0.writeJSONSync=v0.writeJsonSync;v0.readJSON=v0.readJson;v0.readJSONSync=v0.readJsonSync;vy.exports=v0});var ly=R((DtD,py)=>{var P5D=h0(),gy=r("path"),{copy:j5D}=tX(),{remove:dy}=k5(),{mkdirp:S5D}=e8(),{pathExists:x5D}=IF(),my=y3();async function k5D(D,F,J={}){let Q=J.overwrite||J.clobber||!1,{srcStat:$,isChangingCase:Z=!1}=await my.checkPaths(D,F,"move",J);await my.checkParentPaths(D,$,F,"move");let X=gy.dirname(F);if(gy.parse(X).root!==X)await S5D(X);return y5D(D,F,Q,Z)}async function y5D(D,F,J,Q){if(!Q){if(J)await dy(F);else if(await x5D(F))throw Error("dest already exists.")}try{await P5D.rename(D,F)}catch($){if($.code!=="EXDEV")throw $;await f5D(D,F,J)}}async function f5D(D,F,J){return await j5D(D,F,{overwrite:J,errorOnExist:!0,preserveTimestamps:!0}),dy(D)}py.exports=k5D});var ay=R((FtD,oy)=>{var ny=Q9(),FH=r("path"),h5D=tX().copySync,iy=k5().removeSync,b5D=e8().mkdirpSync,cy=y3();function v5D(D,F,J){J=J||{};let Q=J.overwrite||J.clobber||!1,{srcStat:$,isChangingCase:Z=!1}=cy.checkPathsSync(D,F,"move",J);if(cy.checkParentPathsSync(D,$,F,"move"),!u5D(F))b5D(FH.dirname(F));return g5D(D,F,Q,Z)}function u5D(D){let F=FH.dirname(D);return FH.parse(F).root===F}function g5D(D,F,J,Q){if(Q)return DH(D,F,J);if(J)return iy(F),DH(D,F,J);if(ny.existsSync(F))throw Error("dest already exists.");return DH(D,F,J)}function DH(D,F,J){try{ny.renameSync(D,F)}catch(Q){if(Q.code!=="EXDEV")throw Q;return m5D(D,F,J)}}function m5D(D,F,J){return h5D(D,F,{overwrite:J,errorOnExist:!0,preserveTimestamps:!0}),iy(D)}oy.exports=v5D});var sy=R((JtD,ry)=>{var d5D=Y0().fromPromise;ry.exports={move:d5D(ly()),moveSync:ay()}});var v2=R((QtD,ty)=>{ty.exports={...h0(),...tX(),...sk(),...Ay(),...uy(),...e8(),...sy(),...JY(),...IF(),...k5()}});var Uf=R((YJD,R1)=>{/*!
|
|
233
|
+
* Tmp
|
|
234
|
+
*
|
|
235
|
+
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
|
236
|
+
*
|
|
237
|
+
* MIT Licensed
|
|
238
|
+
*/var _D=r("fs"),$Y=r("os"),H0=r("path"),ey=r("crypto"),u2={fs:_D.constants,os:$Y.constants},Qf=/XXXXXX/,$f=(u2.O_CREAT||u2.fs.O_CREAT)|(u2.O_EXCL||u2.fs.O_EXCL)|(u2.O_RDWR||u2.fs.O_RDWR),p5D=$Y.platform()==="win32",l5D=u2.EBADF||u2.os.errno.EBADF,c5D=u2.ENOENT||u2.os.errno.ENOENT,Y9=[],Zf=_D.rmdirSync.bind(_D),Xf=!1;function n5D(D,F){return _D.rm(D,{recursive:!0},F)}function Yf(D){return _D.rmSync(D,{recursive:!0})}function $H(D,F){let J=q9(D,F),Q=J[0],$=J[1];JJD(Q,function(Z,X){if(Z)return $(Z);let Y=X.tries;(function q(){try{let G=Gf(X);_D.stat(G,function(W){if(!W){if(Y-- >0)return q();return $(Error("Could not get a unique tmp filename, max tries reached "+G))}$(null,G)})}catch(G){$(G)}})()})}function ZH(D){let F=q9(D),J=F[0],Q=QJD(J),$=Q.tries;do{let Z=Gf(Q);try{_D.statSync(Z)}catch(X){return Z}}while($-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function i5D(D,F){let J=q9(D,F),Q=J[0],$=J[1];$H(Q,function(X,Y){if(X)return $(X);_D.open(Y,$f,Q.mode||384,function(G,W){if(G)return $(G);if(Q.discardDescriptor)return _D.close(W,function(K){return $(K,Y,void 0,JH(Y,-1,Q,!1))});else{let B=Q.discardDescriptor||Q.detachDescriptor;$(null,Y,W,JH(Y,B?-1:W,Q,!1))}})})}function o5D(D){let F=q9(D),J=F[0],Q=J.discardDescriptor||J.detachDescriptor,$=ZH(J),Z=_D.openSync($,$f,J.mode||384);if(J.discardDescriptor)_D.closeSync(Z),Z=void 0;return{name:$,fd:Z,removeCallback:JH($,Q?-1:Z,J,!0)}}function a5D(D,F){let J=q9(D,F),Q=J[0],$=J[1];$H(Q,function(X,Y){if(X)return $(X);_D.mkdir(Y,Q.mode||448,function(G){if(G)return $(G);$(null,Y,qf(Y,Q,!1))})})}function r5D(D){let F=q9(D),J=F[0],Q=ZH(J);return _D.mkdirSync(Q,J.mode||448),{name:Q,removeCallback:qf(Q,J,!0)}}function s5D(D,F){let J=function(Q){if(Q&&!QH(Q))return F(Q);F()};if(0<=D[0])_D.close(D[0],function(){_D.unlink(D[1],J)});else _D.unlink(D[1],J)}function t5D(D){let F=null;try{if(0<=D[0])_D.closeSync(D[0])}catch(J){if(!$JD(J)&&!QH(J))throw J}finally{try{_D.unlinkSync(D[1])}catch(J){if(!QH(J))F=J}}if(F!==null)throw F}function JH(D,F,J,Q){let $=QY(t5D,[F,D],Q),Z=QY(s5D,[F,D],Q,$);if(!J.keep)Y9.unshift($);return Q?$:Z}function qf(D,F,J){let Q=F.unsafeCleanup?n5D:_D.rmdir.bind(_D),$=F.unsafeCleanup?Yf:Zf,Z=QY($,D,J),X=QY(Q,D,J,Z);if(!F.keep)Y9.unshift(Z);return J?Z:X}function QY(D,F,J,Q){let $=!1;return function Z(X){if(!$){let Y=Q||Z,q=Y9.indexOf(Y);if(q>=0)Y9.splice(q,1);if($=!0,J||D===Zf||D===Yf)return D(F);else return D(F,X||function(){})}}}function e5D(){if(!Xf)return;while(Y9.length)try{Y9[0]()}catch(D){}}function Df(D){let F=[],J=null;try{J=ey.randomBytes(D)}catch(Q){J=ey.pseudoRandomBytes(D)}for(let Q=0;Q<D;Q++)F.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[J[Q]%62]);return F.join("")}function W8(D){return typeof D>"u"}function q9(D,F){if(typeof D==="function")return[{},D];if(W8(D))return[{},F];let J={};for(let Q of Object.getOwnPropertyNames(D))J[Q]=D[Q];return[J,F]}function DJD(D,F,J){let Q=H0.isAbsolute(D)?D:H0.join(F,D);_D.stat(Q,function($){if($)_D.realpath(H0.dirname(Q),function(Z,X){if(Z)return J(Z);J(null,H0.join(X,H0.basename(Q)))});else _D.realpath(Q,J)})}function FJD(D,F){let J=H0.isAbsolute(D)?D:H0.join(F,D);try{return _D.statSync(J),_D.realpathSync(J)}catch(Q){let $=_D.realpathSync(H0.dirname(J));return H0.join($,H0.basename(J))}}function Gf(D){let F=D.tmpdir;if(!W8(D.name))return H0.join(F,D.dir,D.name);if(!W8(D.template))return H0.join(F,D.dir,D.template).replace(Qf,Df(6));let J=[D.prefix?D.prefix:"tmp","-",process.pid,"-",Df(12),D.postfix?"-"+D.postfix:""].join("");return H0.join(F,D.dir,J)}function Wf(D){if(!W8(D.name)){let F=D.name;if(H0.isAbsolute(F))throw Error(`name option must not contain an absolute path, found "${F}".`);let J=H0.basename(F);if(J===".."||J==="."||J!==F)throw Error(`name option must not contain a path, found "${F}".`)}if(!W8(D.template)&&!D.template.match(Qf))throw Error(`Invalid template, found "${D.template}".`);if(!W8(D.tries)&&isNaN(D.tries)||D.tries<0)throw Error(`Invalid tries, found "${D.tries}".`);D.tries=W8(D.name)?D.tries||3:1,D.keep=!!D.keep,D.detachDescriptor=!!D.detachDescriptor,D.discardDescriptor=!!D.discardDescriptor,D.unsafeCleanup=!!D.unsafeCleanup,D.prefix=W8(D.prefix)?"":D.prefix,D.postfix=W8(D.postfix)?"":D.postfix}function Ff(D,F,J,Q){if(W8(F))return Q(null);DJD(F,J,function($,Z){if($)return Q($);let X=H0.relative(J,Z);if(!Z.startsWith(J))return Q(Error(`${D} option must be relative to "${J}", found "${X}".`));Q(null,X)})}function Jf(D,F,J){if(W8(F))return;let Q=FJD(F,J),$=H0.relative(J,Q);if(!Q.startsWith(J))throw Error(`${D} option must be relative to "${J}", found "${$}".`);return $}function JJD(D,F){XJD(D,function(J,Q){if(J)return F(J);D.tmpdir=Q;try{Wf(D,Q)}catch($){return F($)}Ff("dir",D.dir,Q,function($,Z){if($)return F($);D.dir=W8(Z)?"":Z,Ff("template",D.template,Q,function(X,Y){if(X)return F(X);D.template=Y,F(null,D)})})})}function QJD(D){let F=D.tmpdir=Kf(D);Wf(D,F);let J=Jf("dir",D.dir,F);return D.dir=W8(J)?"":J,D.template=Jf("template",D.template,F),D}function $JD(D){return Bf(D,-l5D,"EBADF")}function QH(D){return Bf(D,-c5D,"ENOENT")}function Bf(D,F,J){return p5D?D.code===J:D.code===J&&D.errno===F}function ZJD(){Xf=!0}function XJD(D,F){return _D.realpath(D&&D.tmpdir||$Y.tmpdir(),F)}function Kf(D){return _D.realpathSync(D&&D.tmpdir||$Y.tmpdir())}process.addListener("exit",e5D);Object.defineProperty(YJD,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return Kf()}});YJD.dir=a5D;YJD.dirSync=r5D;YJD.file=i5D;YJD.fileSync=o5D;YJD.tmpName=$H;YJD.tmpNameSync=ZH;YJD.setGracefulCleanup=ZJD});var f5=R(($tD,Vf)=>{var HJD=Number.MAX_SAFE_INTEGER||9007199254740991,zJD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Vf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:HJD,RELEASE_TYPES:zJD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var h5=R((ZtD,Hf)=>{var CJD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};Hf.exports=CJD});var G9=R((g2,zf)=>{var{MAX_SAFE_COMPONENT_LENGTH:XH,MAX_SAFE_BUILD_LENGTH:_JD,MAX_LENGTH:OJD}=f5(),MJD=h5();g2=zf.exports={};var EJD=g2.re=[],RJD=g2.safeRe=[],p=g2.src=[],AJD=g2.safeSrc=[],l=g2.t={},wJD=0,YH="[a-zA-Z0-9-]",IJD=[["\\s",1],["\\d",OJD],[YH,_JD]],NJD=(D)=>{for(let[F,J]of IJD)D=D.split(`${F}*`).join(`${F}{0,${J}}`).split(`${F}+`).join(`${F}{1,${J}}`);return D},t=(D,F,J)=>{let Q=NJD(F),$=wJD++;MJD(D,$,F),l[D]=$,p[$]=F,AJD[$]=Q,EJD[$]=new RegExp(F,J?"g":void 0),RJD[$]=new RegExp(Q,J?"g":void 0)};t("NUMERICIDENTIFIER","0|[1-9]\\d*");t("NUMERICIDENTIFIERLOOSE","\\d+");t("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${YH}*`);t("MAINVERSION",`(${p[l.NUMERICIDENTIFIER]})\\.(${p[l.NUMERICIDENTIFIER]})\\.(${p[l.NUMERICIDENTIFIER]})`);t("MAINVERSIONLOOSE",`(${p[l.NUMERICIDENTIFIERLOOSE]})\\.(${p[l.NUMERICIDENTIFIERLOOSE]})\\.(${p[l.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASEIDENTIFIER",`(?:${p[l.NONNUMERICIDENTIFIER]}|${p[l.NUMERICIDENTIFIER]})`);t("PRERELEASEIDENTIFIERLOOSE",`(?:${p[l.NONNUMERICIDENTIFIER]}|${p[l.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASE",`(?:-(${p[l.PRERELEASEIDENTIFIER]}(?:\\.${p[l.PRERELEASEIDENTIFIER]})*))`);t("PRERELEASELOOSE",`(?:-?(${p[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[l.PRERELEASEIDENTIFIERLOOSE]})*))`);t("BUILDIDENTIFIER",`${YH}+`);t("BUILD",`(?:\\+(${p[l.BUILDIDENTIFIER]}(?:\\.${p[l.BUILDIDENTIFIER]})*))`);t("FULLPLAIN",`v?${p[l.MAINVERSION]}${p[l.PRERELEASE]}?${p[l.BUILD]}?`);t("FULL",`^${p[l.FULLPLAIN]}$`);t("LOOSEPLAIN",`[v=\\s]*${p[l.MAINVERSIONLOOSE]}${p[l.PRERELEASELOOSE]}?${p[l.BUILD]}?`);t("LOOSE",`^${p[l.LOOSEPLAIN]}$`);t("GTLT","((?:<|>)?=?)");t("XRANGEIDENTIFIERLOOSE",`${p[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);t("XRANGEIDENTIFIER",`${p[l.NUMERICIDENTIFIER]}|x|X|\\*`);t("XRANGEPLAIN",`[v=\\s]*(${p[l.XRANGEIDENTIFIER]})(?:\\.(${p[l.XRANGEIDENTIFIER]})(?:\\.(${p[l.XRANGEIDENTIFIER]})(?:${p[l.PRERELEASE]})?${p[l.BUILD]}?)?)?`);t("XRANGEPLAINLOOSE",`[v=\\s]*(${p[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[l.XRANGEIDENTIFIERLOOSE]})(?:${p[l.PRERELEASELOOSE]})?${p[l.BUILD]}?)?)?`);t("XRANGE",`^${p[l.GTLT]}\\s*${p[l.XRANGEPLAIN]}$`);t("XRANGELOOSE",`^${p[l.GTLT]}\\s*${p[l.XRANGEPLAINLOOSE]}$`);t("COERCEPLAIN",`(^|[^\\d])(\\d{1,${XH}})(?:\\.(\\d{1,${XH}}))?(?:\\.(\\d{1,${XH}}))?`);t("COERCE",`${p[l.COERCEPLAIN]}(?:$|[^\\d])`);t("COERCEFULL",p[l.COERCEPLAIN]+`(?:${p[l.PRERELEASE]})?(?:${p[l.BUILD]})?(?:$|[^\\d])`);t("COERCERTL",p[l.COERCE],!0);t("COERCERTLFULL",p[l.COERCEFULL],!0);t("LONETILDE","(?:~>?)");t("TILDETRIM",`(\\s*)${p[l.LONETILDE]}\\s+`,!0);g2.tildeTrimReplace="$1~";t("TILDE",`^${p[l.LONETILDE]}${p[l.XRANGEPLAIN]}$`);t("TILDELOOSE",`^${p[l.LONETILDE]}${p[l.XRANGEPLAINLOOSE]}$`);t("LONECARET","(?:\\^)");t("CARETTRIM",`(\\s*)${p[l.LONECARET]}\\s+`,!0);g2.caretTrimReplace="$1^";t("CARET",`^${p[l.LONECARET]}${p[l.XRANGEPLAIN]}$`);t("CARETLOOSE",`^${p[l.LONECARET]}${p[l.XRANGEPLAINLOOSE]}$`);t("COMPARATORLOOSE",`^${p[l.GTLT]}\\s*(${p[l.LOOSEPLAIN]})$|^$`);t("COMPARATOR",`^${p[l.GTLT]}\\s*(${p[l.FULLPLAIN]})$|^$`);t("COMPARATORTRIM",`(\\s*)${p[l.GTLT]}\\s*(${p[l.LOOSEPLAIN]}|${p[l.XRANGEPLAIN]})`,!0);g2.comparatorTrimReplace="$1$2$3";t("HYPHENRANGE",`^\\s*(${p[l.XRANGEPLAIN]})\\s+-\\s+(${p[l.XRANGEPLAIN]})\\s*$`);t("HYPHENRANGELOOSE",`^\\s*(${p[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[l.XRANGEPLAINLOOSE]})\\s*$`);t("STAR","(<|>)?=?\\s*\\*");t("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");t("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ZY=R((XtD,Cf)=>{var TJD=Object.freeze({loose:!0}),LJD=Object.freeze({}),PJD=(D)=>{if(!D)return LJD;if(typeof D!=="object")return TJD;return D};Cf.exports=PJD});var qH=R((YtD,Mf)=>{var _f=/^[0-9]+$/,Of=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let J=_f.test(D),Q=_f.test(F);if(J&&Q)D=+D,F=+F;return D===F?0:J&&!Q?-1:Q&&!J?1:D<F?-1:1},jJD=(D,F)=>Of(F,D);Mf.exports={compareIdentifiers:Of,rcompareIdentifiers:jJD}});var N0=R((qtD,Rf)=>{var XY=h5(),{MAX_LENGTH:Ef,MAX_SAFE_INTEGER:YY}=f5(),{safeRe:qY,t:GY}=G9(),SJD=ZY(),{compareIdentifiers:GH}=qH();class D2{constructor(D,F){if(F=SJD(F),D instanceof D2)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>Ef)throw TypeError(`version is longer than ${Ef} characters`);XY("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let J=D.trim().match(F.loose?qY[GY.LOOSE]:qY[GY.FULL]);if(!J)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+J[1],this.minor=+J[2],this.patch=+J[3],this.major>YY||this.major<0)throw TypeError("Invalid major version");if(this.minor>YY||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>YY||this.patch<0)throw TypeError("Invalid patch version");if(!J[4])this.prerelease=[];else this.prerelease=J[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let $=+Q;if($>=0&&$<YY)return $}return Q});this.build=J[5]?J[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(XY("SemVer.compare",this.version,this.options,D),!(D instanceof D2)){if(typeof D==="string"&&D===this.version)return 0;D=new D2(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof D2))D=new D2(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof D2))D=new D2(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let J=this.prerelease[F],Q=D.prerelease[F];if(XY("prerelease compare",F,J,Q),J===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(J===void 0)return-1;else if(J===Q)continue;else return GH(J,Q)}while(++F)}compareBuild(D){if(!(D instanceof D2))D=new D2(D,this.options);let F=0;do{let J=this.build[F],Q=D.build[F];if(XY("build compare",F,J,Q),J===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(J===void 0)return-1;else if(J===Q)continue;else return GH(J,Q)}while(++F)}inc(D,F,J){if(D.startsWith("pre")){if(!F&&J===!1)throw Error("invalid increment argument: identifier is empty");if(F){let Q=`-${F}`.match(this.options.loose?qY[GY.PRERELEASELOOSE]:qY[GY.PRERELEASE]);if(!Q||Q[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,J);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,J);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,J),this.inc("pre",F,J);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,J);this.inc("pre",F,J);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(J)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let $=this.prerelease.length;while(--$>=0)if(typeof this.prerelease[$]==="number")this.prerelease[$]++,$=-2;if($===-1){if(F===this.prerelease.join(".")&&J===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(F){let $=[F,Q];if(J===!1)$=[F];if(GH(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=$}else this.prerelease=$}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Rf.exports=D2});var f3=R((GtD,wf)=>{var Af=N0(),xJD=(D,F,J=!1)=>{if(D instanceof Af)return D;try{return new Af(D,F)}catch(Q){if(!J)return null;throw Q}};wf.exports=xJD});var Nf=R((WtD,If)=>{var kJD=f3(),yJD=(D,F)=>{let J=kJD(D,F);return J?J.version:null};If.exports=yJD});var Lf=R((BtD,Tf)=>{var fJD=f3(),hJD=(D,F)=>{let J=fJD(D.trim().replace(/^[=v]+/,""),F);return J?J.version:null};Tf.exports=hJD});var Sf=R((KtD,jf)=>{var Pf=N0(),bJD=(D,F,J,Q,$)=>{if(typeof J==="string")$=Q,Q=J,J=void 0;try{return new Pf(D instanceof Pf?D.version:D,J).inc(F,Q,$).version}catch(Z){return null}};jf.exports=bJD});var yf=R((UtD,kf)=>{var xf=f3(),vJD=(D,F)=>{let J=xf(D,null,!0),Q=xf(F,null,!0),$=J.compare(Q);if($===0)return null;let Z=$>0,X=Z?J:Q,Y=Z?Q:J,q=!!X.prerelease.length;if(!!Y.prerelease.length&&!q){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(X)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let W=q?"pre":"";if(J.major!==Q.major)return W+"major";if(J.minor!==Q.minor)return W+"minor";if(J.patch!==Q.patch)return W+"patch";return"prerelease"};kf.exports=vJD});var hf=R((VtD,ff)=>{var uJD=N0(),gJD=(D,F)=>new uJD(D,F).major;ff.exports=gJD});var vf=R((HtD,bf)=>{var mJD=N0(),dJD=(D,F)=>new mJD(D,F).minor;bf.exports=dJD});var gf=R((ztD,uf)=>{var pJD=N0(),lJD=(D,F)=>new pJD(D,F).patch;uf.exports=lJD});var df=R((CtD,mf)=>{var cJD=f3(),nJD=(D,F)=>{let J=cJD(D,F);return J&&J.prerelease.length?J.prerelease:null};mf.exports=nJD});var L8=R((_tD,lf)=>{var pf=N0(),iJD=(D,F,J)=>new pf(D,J).compare(new pf(F,J));lf.exports=iJD});var nf=R((OtD,cf)=>{var oJD=L8(),aJD=(D,F,J)=>oJD(F,D,J);cf.exports=aJD});var af=R((MtD,of)=>{var rJD=L8(),sJD=(D,F)=>rJD(D,F,!0);of.exports=sJD});var WY=R((EtD,sf)=>{var rf=N0(),tJD=(D,F,J)=>{let Q=new rf(D,J),$=new rf(F,J);return Q.compare($)||Q.compareBuild($)};sf.exports=tJD});var ef=R((RtD,tf)=>{var eJD=WY(),DQD=(D,F)=>D.sort((J,Q)=>eJD(J,Q,F));tf.exports=DQD});var Fh=R((AtD,Dh)=>{var FQD=WY(),JQD=(D,F)=>D.sort((J,Q)=>FQD(Q,J,F));Dh.exports=JQD});var b5=R((wtD,Jh)=>{var QQD=L8(),$QD=(D,F,J)=>QQD(D,F,J)>0;Jh.exports=$QD});var BY=R((ItD,Qh)=>{var ZQD=L8(),XQD=(D,F,J)=>ZQD(D,F,J)<0;Qh.exports=XQD});var WH=R((NtD,$h)=>{var YQD=L8(),qQD=(D,F,J)=>YQD(D,F,J)===0;$h.exports=qQD});var BH=R((TtD,Zh)=>{var GQD=L8(),WQD=(D,F,J)=>GQD(D,F,J)!==0;Zh.exports=WQD});var KY=R((LtD,Xh)=>{var BQD=L8(),KQD=(D,F,J)=>BQD(D,F,J)>=0;Xh.exports=KQD});var UY=R((PtD,Yh)=>{var UQD=L8(),VQD=(D,F,J)=>UQD(D,F,J)<=0;Yh.exports=VQD});var KH=R((jtD,qh)=>{var HQD=WH(),zQD=BH(),CQD=b5(),_QD=KY(),OQD=BY(),MQD=UY(),EQD=(D,F,J,Q)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof J==="object")J=J.version;return D===J;case"!==":if(typeof D==="object")D=D.version;if(typeof J==="object")J=J.version;return D!==J;case"":case"=":case"==":return HQD(D,J,Q);case"!=":return zQD(D,J,Q);case">":return CQD(D,J,Q);case">=":return _QD(D,J,Q);case"<":return OQD(D,J,Q);case"<=":return MQD(D,J,Q);default:throw TypeError(`Invalid operator: ${F}`)}};qh.exports=EQD});var Wh=R((StD,Gh)=>{var RQD=N0(),AQD=f3(),{safeRe:VY,t:HY}=G9(),wQD=(D,F)=>{if(D instanceof RQD)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let J=null;if(!F.rtl)J=D.match(F.includePrerelease?VY[HY.COERCEFULL]:VY[HY.COERCE]);else{let q=F.includePrerelease?VY[HY.COERCERTLFULL]:VY[HY.COERCERTL],G;while((G=q.exec(D))&&(!J||J.index+J[0].length!==D.length)){if(!J||G.index+G[0].length!==J.index+J[0].length)J=G;q.lastIndex=G.index+G[1].length+G[2].length}q.lastIndex=-1}if(J===null)return null;let Q=J[2],$=J[3]||"0",Z=J[4]||"0",X=F.includePrerelease&&J[5]?`-${J[5]}`:"",Y=F.includePrerelease&&J[6]?`+${J[6]}`:"";return AQD(`${Q}.${$}.${Z}${X}${Y}`,F)};Gh.exports=wQD});var Uh=R((xtD,Kh)=>{class Bh{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set(D,F)}return this}}Kh.exports=Bh});var P8=R((ktD,Ch)=>{var IQD=/\s+/g;class v5{constructor(D,F){if(F=TQD(F),D instanceof v5)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new v5(D.raw,F);if(D instanceof UH)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(IQD," "),this.set=this.raw.split("||").map((J)=>this.parseRange(J.trim())).filter((J)=>J.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let J=this.set[0];if(this.set=this.set.filter((Q)=>!Hh(Q[0])),this.set.length===0)this.set=[J];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&yQD(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let J=0;J<F.length;J++){if(J>0)this.formatted+=" ";this.formatted+=F[J].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let J=((this.options.includePrerelease&&xQD)|(this.options.loose&&kQD))+":"+D,Q=Vh.get(J);if(Q)return Q;let $=this.options.loose,Z=$?u0[T0.HYPHENRANGELOOSE]:u0[T0.HYPHENRANGE];D=D.replace(Z,lQD(this.options.includePrerelease)),wD("hyphen replace",D),D=D.replace(u0[T0.COMPARATORTRIM],PQD),wD("comparator trim",D),D=D.replace(u0[T0.TILDETRIM],jQD),wD("tilde trim",D),D=D.replace(u0[T0.CARETTRIM],SQD),wD("caret trim",D);let X=D.split(" ").map((W)=>fQD(W,this.options)).join(" ").split(/\s+/).map((W)=>pQD(W,this.options));if($)X=X.filter((W)=>{return wD("loose invalid filter",W,this.options),!!W.match(u0[T0.COMPARATORLOOSE])});wD("range list",X);let Y=new Map,q=X.map((W)=>new UH(W,this.options));for(let W of q){if(Hh(W))return[W];Y.set(W.value,W)}if(Y.size>1&&Y.has(""))Y.delete("");let G=[...Y.values()];return Vh.set(J,G),G}intersects(D,F){if(!(D instanceof v5))throw TypeError("a Range is required");return this.set.some((J)=>{return zh(J,F)&&D.set.some((Q)=>{return zh(Q,F)&&J.every(($)=>{return Q.every((Z)=>{return $.intersects(Z,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new LQD(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(cQD(this.set[F],D,this.options))return!0;return!1}}Ch.exports=v5;var NQD=Uh(),Vh=new NQD,TQD=ZY(),UH=u5(),wD=h5(),LQD=N0(),{safeRe:u0,t:T0,comparatorTrimReplace:PQD,tildeTrimReplace:jQD,caretTrimReplace:SQD}=G9(),{FLAG_INCLUDE_PRERELEASE:xQD,FLAG_LOOSE:kQD}=f5(),Hh=(D)=>D.value==="<0.0.0-0",yQD=(D)=>D.value==="",zh=(D,F)=>{let J=!0,Q=D.slice(),$=Q.pop();while(J&&Q.length)J=Q.every((Z)=>{return $.intersects(Z,F)}),$=Q.pop();return J},fQD=(D,F)=>{return D=D.replace(u0[T0.BUILD],""),wD("comp",D,F),D=vQD(D,F),wD("caret",D),D=hQD(D,F),wD("tildes",D),D=gQD(D,F),wD("xrange",D),D=dQD(D,F),wD("stars",D),D},g0=(D)=>!D||D.toLowerCase()==="x"||D==="*",hQD=(D,F)=>{return D.trim().split(/\s+/).map((J)=>bQD(J,F)).join(" ")},bQD=(D,F)=>{let J=F.loose?u0[T0.TILDELOOSE]:u0[T0.TILDE];return D.replace(J,(Q,$,Z,X,Y)=>{wD("tilde",D,Q,$,Z,X,Y);let q;if(g0($))q="";else if(g0(Z))q=`>=${$}.0.0 <${+$+1}.0.0-0`;else if(g0(X))q=`>=${$}.${Z}.0 <${$}.${+Z+1}.0-0`;else if(Y)wD("replaceTilde pr",Y),q=`>=${$}.${Z}.${X}-${Y} <${$}.${+Z+1}.0-0`;else q=`>=${$}.${Z}.${X} <${$}.${+Z+1}.0-0`;return wD("tilde return",q),q})},vQD=(D,F)=>{return D.trim().split(/\s+/).map((J)=>uQD(J,F)).join(" ")},uQD=(D,F)=>{wD("caret",D,F);let J=F.loose?u0[T0.CARETLOOSE]:u0[T0.CARET],Q=F.includePrerelease?"-0":"";return D.replace(J,($,Z,X,Y,q)=>{wD("caret",D,$,Z,X,Y,q);let G;if(g0(Z))G="";else if(g0(X))G=`>=${Z}.0.0${Q} <${+Z+1}.0.0-0`;else if(g0(Y))if(Z==="0")G=`>=${Z}.${X}.0${Q} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.0${Q} <${+Z+1}.0.0-0`;else if(q)if(wD("replaceCaret pr",q),Z==="0")if(X==="0")G=`>=${Z}.${X}.${Y}-${q} <${Z}.${X}.${+Y+1}-0`;else G=`>=${Z}.${X}.${Y}-${q} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.${Y}-${q} <${+Z+1}.0.0-0`;else if(wD("no pr"),Z==="0")if(X==="0")G=`>=${Z}.${X}.${Y}${Q} <${Z}.${X}.${+Y+1}-0`;else G=`>=${Z}.${X}.${Y}${Q} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.${Y} <${+Z+1}.0.0-0`;return wD("caret return",G),G})},gQD=(D,F)=>{return wD("replaceXRanges",D,F),D.split(/\s+/).map((J)=>mQD(J,F)).join(" ")},mQD=(D,F)=>{D=D.trim();let J=F.loose?u0[T0.XRANGELOOSE]:u0[T0.XRANGE];return D.replace(J,(Q,$,Z,X,Y,q)=>{wD("xRange",D,Q,$,Z,X,Y,q);let G=g0(Z),W=G||g0(X),B=W||g0(Y),K=B;if($==="="&&K)$="";if(q=F.includePrerelease?"-0":"",G)if($===">"||$==="<")Q="<0.0.0-0";else Q="*";else if($&&K){if(W)X=0;if(Y=0,$===">")if($=">=",W)Z=+Z+1,X=0,Y=0;else X=+X+1,Y=0;else if($==="<=")if($="<",W)Z=+Z+1;else X=+X+1;if($==="<")q="-0";Q=`${$+Z}.${X}.${Y}${q}`}else if(W)Q=`>=${Z}.0.0${q} <${+Z+1}.0.0-0`;else if(B)Q=`>=${Z}.${X}.0${q} <${Z}.${+X+1}.0-0`;return wD("xRange return",Q),Q})},dQD=(D,F)=>{return wD("replaceStars",D,F),D.trim().replace(u0[T0.STAR],"")},pQD=(D,F)=>{return wD("replaceGTE0",D,F),D.trim().replace(u0[F.includePrerelease?T0.GTE0PRE:T0.GTE0],"")},lQD=(D)=>(F,J,Q,$,Z,X,Y,q,G,W,B,K)=>{if(g0(Q))J="";else if(g0($))J=`>=${Q}.0.0${D?"-0":""}`;else if(g0(Z))J=`>=${Q}.${$}.0${D?"-0":""}`;else if(X)J=`>=${J}`;else J=`>=${J}${D?"-0":""}`;if(g0(G))q="";else if(g0(W))q=`<${+G+1}.0.0-0`;else if(g0(B))q=`<${G}.${+W+1}.0-0`;else if(K)q=`<=${G}.${W}.${B}-${K}`;else if(D)q=`<${G}.${W}.${+B+1}-0`;else q=`<=${q}`;return`${J} ${q}`.trim()},cQD=(D,F,J)=>{for(let Q=0;Q<D.length;Q++)if(!D[Q].test(F))return!1;if(F.prerelease.length&&!J.includePrerelease){for(let Q=0;Q<D.length;Q++){if(wD(D[Q].semver),D[Q].semver===UH.ANY)continue;if(D[Q].semver.prerelease.length>0){let $=D[Q].semver;if($.major===F.major&&$.minor===F.minor&&$.patch===F.patch)return!0}}return!1}return!0}});var u5=R((ytD,Ah)=>{var g5=Symbol("SemVer ANY");class zY{static get ANY(){return g5}constructor(D,F){if(F=_h(F),D instanceof zY)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),HH("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===g5)this.value="";else this.value=this.operator+this.semver.version;HH("comp",this)}parse(D){let F=this.options.loose?Oh[Mh.COMPARATORLOOSE]:Oh[Mh.COMPARATOR],J=D.match(F);if(!J)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=J[1]!==void 0?J[1]:"",this.operator==="=")this.operator="";if(!J[2])this.semver=g5;else this.semver=new Eh(J[2],this.options.loose)}toString(){return this.value}test(D){if(HH("Comparator.test",D,this.options.loose),this.semver===g5||D===g5)return!0;if(typeof D==="string")try{D=new Eh(D,this.options)}catch(F){return!1}return VH(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof zY))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Rh(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new Rh(this.value,F).test(D.semver)}if(F=_h(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(VH(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(VH(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}Ah.exports=zY;var _h=ZY(),{safeRe:Oh,t:Mh}=G9(),VH=KH(),HH=h5(),Eh=N0(),Rh=P8()});var m5=R((ftD,wh)=>{var nQD=P8(),iQD=(D,F,J)=>{try{F=new nQD(F,J)}catch(Q){return!1}return F.test(D)};wh.exports=iQD});var Nh=R((htD,Ih)=>{var oQD=P8(),aQD=(D,F)=>new oQD(D,F).set.map((J)=>J.map((Q)=>Q.value).join(" ").trim().split(" "));Ih.exports=aQD});var Lh=R((btD,Th)=>{var rQD=N0(),sQD=P8(),tQD=(D,F,J)=>{let Q=null,$=null,Z=null;try{Z=new sQD(F,J)}catch(X){return null}return D.forEach((X)=>{if(Z.test(X)){if(!Q||$.compare(X)===-1)Q=X,$=new rQD(Q,J)}}),Q};Th.exports=tQD});var jh=R((vtD,Ph)=>{var eQD=N0(),D$D=P8(),F$D=(D,F,J)=>{let Q=null,$=null,Z=null;try{Z=new D$D(F,J)}catch(X){return null}return D.forEach((X)=>{if(Z.test(X)){if(!Q||$.compare(X)===1)Q=X,$=new eQD(Q,J)}}),Q};Ph.exports=F$D});var kh=R((utD,xh)=>{var zH=N0(),J$D=P8(),Sh=b5(),Q$D=(D,F)=>{D=new J$D(D,F);let J=new zH("0.0.0");if(D.test(J))return J;if(J=new zH("0.0.0-0"),D.test(J))return J;J=null;for(let Q=0;Q<D.set.length;++Q){let $=D.set[Q],Z=null;if($.forEach((X)=>{let Y=new zH(X.semver.version);switch(X.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!Z||Sh(Y,Z))Z=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${X.operator}`)}}),Z&&(!J||Sh(J,Z)))J=Z}if(J&&D.test(J))return J;return null};xh.exports=Q$D});var fh=R((gtD,yh)=>{var $$D=P8(),Z$D=(D,F)=>{try{return new $$D(D,F).range||"*"}catch(J){return null}};yh.exports=Z$D});var CY=R((mtD,uh)=>{var X$D=N0(),vh=u5(),{ANY:Y$D}=vh,q$D=P8(),G$D=m5(),hh=b5(),bh=BY(),W$D=UY(),B$D=KY(),K$D=(D,F,J,Q)=>{D=new X$D(D,Q),F=new q$D(F,Q);let $,Z,X,Y,q;switch(J){case">":$=hh,Z=W$D,X=bh,Y=">",q=">=";break;case"<":$=bh,Z=B$D,X=hh,Y="<",q="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(G$D(D,F,Q))return!1;for(let G=0;G<F.set.length;++G){let W=F.set[G],B=null,K=null;if(W.forEach((U)=>{if(U.semver===Y$D)U=new vh(">=0.0.0");if(B=B||U,K=K||U,$(U.semver,B.semver,Q))B=U;else if(X(U.semver,K.semver,Q))K=U}),B.operator===Y||B.operator===q)return!1;if((!K.operator||K.operator===Y)&&Z(D,K.semver))return!1;else if(K.operator===q&&X(D,K.semver))return!1}return!0};uh.exports=K$D});var mh=R((dtD,gh)=>{var U$D=CY(),V$D=(D,F,J)=>U$D(D,F,">",J);gh.exports=V$D});var ph=R((ptD,dh)=>{var H$D=CY(),z$D=(D,F,J)=>H$D(D,F,"<",J);dh.exports=z$D});var nh=R((ltD,ch)=>{var lh=P8(),C$D=(D,F,J)=>{return D=new lh(D,J),F=new lh(F,J),D.intersects(F,J)};ch.exports=C$D});var oh=R((ctD,ih)=>{var _$D=m5(),O$D=L8();ih.exports=(D,F,J)=>{let Q=[],$=null,Z=null,X=D.sort((W,B)=>O$D(W,B,J));for(let W of X)if(_$D(W,F,J)){if(Z=W,!$)$=W}else{if(Z)Q.push([$,Z]);Z=null,$=null}if($)Q.push([$,null]);let Y=[];for(let[W,B]of Q)if(W===B)Y.push(W);else if(!B&&W===X[0])Y.push("*");else if(!B)Y.push(`>=${W}`);else if(W===X[0])Y.push(`<=${B}`);else Y.push(`${W} - ${B}`);let q=Y.join(" || "),G=typeof F.raw==="string"?F.raw:String(F);return q.length<G.length?q:F}});var Db=R((ntD,eh)=>{var ah=P8(),_H=u5(),{ANY:CH}=_H,d5=m5(),OH=L8(),M$D=(D,F,J={})=>{if(D===F)return!0;D=new ah(D,J),F=new ah(F,J);let Q=!1;D:for(let $ of D.set){for(let Z of F.set){let X=R$D($,Z,J);if(Q=Q||X!==null,X)continue D}if(Q)return!1}return!0},E$D=[new _H(">=0.0.0-0")],rh=[new _H(">=0.0.0")],R$D=(D,F,J)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===CH)if(F.length===1&&F[0].semver===CH)return!0;else if(J.includePrerelease)D=E$D;else D=rh;if(F.length===1&&F[0].semver===CH)if(J.includePrerelease)return!0;else F=rh;let Q=new Set,$,Z;for(let U of D)if(U.operator===">"||U.operator===">=")$=sh($,U,J);else if(U.operator==="<"||U.operator==="<=")Z=th(Z,U,J);else Q.add(U.semver);if(Q.size>1)return null;let X;if($&&Z){if(X=OH($.semver,Z.semver,J),X>0)return null;else if(X===0&&($.operator!==">="||Z.operator!=="<="))return null}for(let U of Q){if($&&!d5(U,String($),J))return null;if(Z&&!d5(U,String(Z),J))return null;for(let V of F)if(!d5(U,String(V),J))return!1;return!0}let Y,q,G,W,B=Z&&!J.includePrerelease&&Z.semver.prerelease.length?Z.semver:!1,K=$&&!J.includePrerelease&&$.semver.prerelease.length?$.semver:!1;if(B&&B.prerelease.length===1&&Z.operator==="<"&&B.prerelease[0]===0)B=!1;for(let U of F){if(W=W||U.operator===">"||U.operator===">=",G=G||U.operator==="<"||U.operator==="<=",$){if(K){if(U.semver.prerelease&&U.semver.prerelease.length&&U.semver.major===K.major&&U.semver.minor===K.minor&&U.semver.patch===K.patch)K=!1}if(U.operator===">"||U.operator===">="){if(Y=sh($,U,J),Y===U&&Y!==$)return!1}else if($.operator===">="&&!d5($.semver,String(U),J))return!1}if(Z){if(B){if(U.semver.prerelease&&U.semver.prerelease.length&&U.semver.major===B.major&&U.semver.minor===B.minor&&U.semver.patch===B.patch)B=!1}if(U.operator==="<"||U.operator==="<="){if(q=th(Z,U,J),q===U&&q!==Z)return!1}else if(Z.operator==="<="&&!d5(Z.semver,String(U),J))return!1}if(!U.operator&&(Z||$)&&X!==0)return!1}if($&&G&&!Z&&X!==0)return!1;if(Z&&W&&!$&&X!==0)return!1;if(K||B)return!1;return!0},sh=(D,F,J)=>{if(!D)return F;let Q=OH(D.semver,F.semver,J);return Q>0?D:Q<0?F:F.operator===">"&&D.operator===">="?F:D},th=(D,F,J)=>{if(!D)return F;let Q=OH(D.semver,F.semver,J);return Q<0?D:Q>0?F:F.operator==="<"&&D.operator==="<="?F:D};eh.exports=M$D});var p5=R((itD,Qb)=>{var MH=G9(),Fb=f5(),A$D=N0(),Jb=qH(),w$D=f3(),I$D=Nf(),N$D=Lf(),T$D=Sf(),L$D=yf(),P$D=hf(),j$D=vf(),S$D=gf(),x$D=df(),k$D=L8(),y$D=nf(),f$D=af(),h$D=WY(),b$D=ef(),v$D=Fh(),u$D=b5(),g$D=BY(),m$D=WH(),d$D=BH(),p$D=KY(),l$D=UY(),c$D=KH(),n$D=Wh(),i$D=u5(),o$D=P8(),a$D=m5(),r$D=Nh(),s$D=Lh(),t$D=jh(),e$D=kh(),DZD=fh(),FZD=CY(),JZD=mh(),QZD=ph(),$ZD=nh(),ZZD=oh(),XZD=Db();Qb.exports={parse:w$D,valid:I$D,clean:N$D,inc:T$D,diff:L$D,major:P$D,minor:j$D,patch:S$D,prerelease:x$D,compare:k$D,rcompare:y$D,compareLoose:f$D,compareBuild:h$D,sort:b$D,rsort:v$D,gt:u$D,lt:g$D,eq:m$D,neq:d$D,gte:p$D,lte:l$D,cmp:c$D,coerce:n$D,Comparator:i$D,Range:o$D,satisfies:a$D,toComparators:r$D,maxSatisfying:s$D,minSatisfying:t$D,minVersion:e$D,validRange:DZD,outside:FZD,gtr:JZD,ltr:QZD,intersects:$ZD,simplifyRange:ZZD,subset:XZD,SemVer:A$D,re:MH.re,src:MH.src,tokens:MH.t,SEMVER_SPEC_VERSION:Fb.SEMVER_SPEC_VERSION,RELEASE_TYPES:Fb.RELEASE_TYPES,compareIdentifiers:Jb.compareIdentifiers,rcompareIdentifiers:Jb.rcompareIdentifiers}});var db=R((X00,mb)=>{mb.exports=UXD;function KXD(D){let F={defaultWidth:0,output:process.stdout,tty:r("tty")};if(!D)return F;return Object.keys(F).forEach(function(J){if(!D[J])D[J]=F[J]}),D}function UXD(D){let F=KXD(D);if(F.output.getWindowSize)return F.output.getWindowSize()[0]||F.defaultWidth;if(F.tty.getWindowSize)return F.tty.getWindowSize()[1]||F.defaultWidth;if(F.output.columns)return F.output.columns;if(process.env.CLI_WIDTH){let J=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(J)&&J!==0)return J}return F.defaultWidth}});var nb=R((U00,cb)=>{var HXD=r("stream");class lb extends HXD{#F=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#J(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#F!==null)return this.#F;return this.#J("isTTY",!1)}set isTTY(D){this.#F=D}get rows(){return this.#J("rows")}get columns(){return this.#J("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}cb.exports=lb});var _z=ID(Cz(),1),{program:XYD,createCommand:YYD,createArgument:qYD,createOption:GYD,CommanderError:WYD,InvalidArgumentError:Eu,InvalidOptionArgumentError:BYD,Command:ZD,Argument:KYD,Option:m0,Help:UYD}=_z.default;import{createRequire as nXD}from"node:module";var Qk=ID(Xq(),1);function uD(D){if(typeof D!=="object"||D===null)return!1;let F=Object.getPrototypeOf(D);return(F===null||F===Object.prototype||Object.getPrototypeOf(F)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)}import{fileURLToPath as Zg}from"node:url";var s3=(D,F)=>{let J=qq(Xg(D));if(typeof J!=="string")throw TypeError(`${F} must be a string or a file URL: ${J}.`);return J},Xg=(D)=>Yq(D)?D.toString():D,Yq=(D)=>typeof D!=="string"&&D&&Object.getPrototypeOf(D)===String.prototype,qq=(D)=>D instanceof URL?Zg(D):D;var BJ=(D,F=[],J={})=>{let Q=s3(D,"First argument"),[$,Z]=uD(F)?[[],F]:[F,J];if(!Array.isArray($))throw TypeError(`Second argument must be either an array of arguments or an options object: ${$}`);if($.some((q)=>typeof q==="object"&&q!==null))throw TypeError(`Second argument must be an array of strings: ${$}`);let X=$.map(String),Y=X.find((q)=>q.includes("\x00"));if(Y!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${Y}`);if(!uD(Z))throw TypeError(`Last argument must be an options object: ${Z}`);return[Q,X,Z]};import{ChildProcess as Ug}from"node:child_process";import{StringDecoder as Yg}from"node:string_decoder";var{toString:zC}=Object.prototype,CC=(D)=>zC.call(D)==="[object ArrayBuffer]",tD=(D)=>zC.call(D)==="[object Uint8Array]",n2=(D)=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength),qg=new TextEncoder,_C=(D)=>qg.encode(D),Gg=new TextDecoder,KJ=(D)=>Gg.decode(D),OC=(D,F)=>{return Wg(D,F).join("")},Wg=(D,F)=>{if(F==="utf8"&&D.every((Z)=>typeof Z==="string"))return D;let J=new Yg(F),Q=D.map((Z)=>typeof Z==="string"?_C(Z):Z).map((Z)=>J.write(Z)),$=J.end();return $===""?Q:[...Q,$]},R9=(D)=>{if(D.length===1&&tD(D[0]))return D[0];return Gq(Bg(D))},Bg=(D)=>D.map((F)=>typeof F==="string"?_C(F):F),Gq=(D)=>{let F=new Uint8Array(Kg(D)),J=0;for(let Q of D)F.set(Q,J),J+=Q.length;return F},Kg=(D)=>{let F=0;for(let J of D)F+=J.length;return F};var AC=(D)=>Array.isArray(D)&&Array.isArray(D.raw),wC=(D,F)=>{let J=[];for(let[Z,X]of D.entries())J=Vg({templates:D,expressions:F,tokens:J,index:Z,template:X});if(J.length===0)throw TypeError("Template script must not be empty");let[Q,...$]=J;return[Q,$,{}]},Vg=({templates:D,expressions:F,tokens:J,index:Q,template:$})=>{if($===void 0)throw TypeError(`Invalid backslash sequence: ${D.raw[Q]}`);let{nextTokens:Z,leadingWhitespaces:X,trailingWhitespaces:Y}=Hg($,D.raw[Q]),q=EC(J,Z,X);if(Q===F.length)return q;let G=F[Q],W=Array.isArray(G)?G.map((B)=>RC(B)):[RC(G)];return EC(q,W,Y)},Hg=(D,F)=>{if(F.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let J=[],Q=0,$=MC.has(F[0]);for(let X=0,Y=0;X<D.length;X+=1,Y+=1){let q=F[Y];if(MC.has(q)){if(Q!==X)J.push(D.slice(Q,X));Q=X+1}else if(q==="\\"){let G=F[Y+1];if(G===`
|
|
239
|
+
`)X-=1,Y+=1;else if(G==="u"&&F[Y+2]==="{")Y=F.indexOf("}",Y+3);else Y+=zg[G]??1}}let Z=Q===D.length;if(!Z)J.push(D.slice(Q));return{nextTokens:J,leadingWhitespaces:$,trailingWhitespaces:Z}},MC=new Set([" ","\t","\r",`
|
|
240
|
+
`]),zg={x:3,u:5},EC=(D,F,J)=>J||D.length===0||F.length===0?[...D,...F]:[...D.slice(0,-1),`${D.at(-1)}${F[0]}`,...F.slice(1)],RC=(D)=>{let F=typeof D;if(F==="string")return D;if(F==="number")return String(D);if(uD(D)&&(("stdout"in D)||("isMaxBuffer"in D)))return Cg(D);if(D instanceof Ug||Object.prototype.toString.call(D)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${F}" in template expression`)},Cg=({stdout:D})=>{if(typeof D==="string")return D;if(tD(D))return KJ(D);if(D===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof D}" stdout in template expression`)};import{spawnSync as wc}from"node:child_process";import{debuglog as _g}from"node:util";import Wq from"node:process";var k8=(D)=>UJ.includes(D),UJ=[Wq.stdin,Wq.stdout,Wq.stderr],U8=["stdin","stdout","stderr"],VJ=(D)=>U8[D]??`stdio[${D}]`;var NC=(D)=>{let F={...D};for(let J of Uq)F[J]=Bq(D,J);return F},Bq=(D,F)=>{let J=Array.from({length:Og(D)+1}),Q=Mg(D[F],J,F);return Ig(Q,F)},Og=({stdio:D})=>Array.isArray(D)?Math.max(D.length,U8.length):U8.length,Mg=(D,F,J)=>uD(D)?Eg(D,F,J):F.fill(D),Eg=(D,F,J)=>{for(let Q of Object.keys(D).sort(Rg))for(let $ of Ag(Q,J,F))F[$]=D[Q];return F},Rg=(D,F)=>IC(D)<IC(F)?1:-1,IC=(D)=>{if(D==="stdout"||D==="stderr")return 0;return D==="all"?2:1},Ag=(D,F,J)=>{if(D==="ipc")return[J.length-1];let Q=Kq(D);if(Q===void 0||Q===0)throw TypeError(`"${F}.${D}" is invalid.
|
|
241
|
+
It must be "${F}.stdout", "${F}.stderr", "${F}.all", "${F}.ipc", or "${F}.fd3", "${F}.fd4" (and so on).`);if(Q>=J.length)throw TypeError(`"${F}.${D}" is invalid: that file descriptor does not exist.
|
|
242
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return Q==="all"?[1,2]:[Q]},Kq=(D)=>{if(D==="all")return D;if(U8.includes(D))return U8.indexOf(D);let F=wg.exec(D);if(F!==null)return Number(F[1])},wg=/^fd(\d+)$/,Ig=(D,F)=>D.map((J)=>J===void 0?Tg[F]:J),Ng=_g("execa").enabled?"full":"none",Tg={lines:!1,buffer:!0,maxBuffer:1e8,verbose:Ng,stripFinalNewline:!0},Uq=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],i2=(D,F)=>F==="ipc"?D.at(-1):D[F];var t3=({verbose:D},F)=>Vq(D,F)!=="none",e3=({verbose:D},F)=>!["none","short"].includes(Vq(D,F)),TC=({verbose:D},F)=>{let J=Vq(D,F);return HJ(J)?J:void 0},Vq=(D,F)=>F===void 0?Lg(D):i2(D,F),Lg=(D)=>D.find((F)=>HJ(F))??zJ.findLast((F)=>D.includes(F)),HJ=(D)=>typeof D==="function",zJ=["none","short","full"];import{inspect as rg}from"node:util";import{platform as Pg}from"node:process";import{stripVTControlCharacters as jg}from"node:util";var LC=(D,F)=>{let J=[D,...F],Q=J.join(" "),$=J.map((Z)=>hg(PC(Z))).join(" ");return{command:Q,escapedCommand:$}},A9=(D)=>jg(D).split(`
|
|
243
|
+
`).map((F)=>PC(F)).join(`
|
|
244
|
+
`),PC=(D)=>D.replaceAll(kg,(F)=>Sg(F)),Sg=(D)=>{let F=yg[D];if(F!==void 0)return F;let J=D.codePointAt(0),Q=J.toString(16);return J<=fg?`\\u${Q.padStart(4,"0")}`:`\\U${Q}`},xg=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},kg=xg(),yg={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},fg=65535,hg=(D)=>{if(bg.test(D))return D;return Pg==="win32"?`"${D.replaceAll('"','""')}"`:`'${D.replaceAll("'","'\\''")}'`},bg=/^[\w./-]+$/;import jC from"node:process";function xF(){let{env:D}=jC,{TERM:F,TERM_PROGRAM:J}=D;if(jC.platform!=="win32")return F!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||J==="Terminus-Sublime"||J==="vscode"||F==="xterm-256color"||F==="alacritty"||F==="rxvt-unicode"||F==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var SC={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},xC={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},vg={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},ug={...SC,...xC},gg={...SC,...vg},mg=xF(),dg=mg?ug:gg,CJ=dg,GqD=Object.entries(xC);import pg from"node:tty";var lg=pg?.WriteStream?.prototype?.hasColors?.()??!1,DD=(D,F)=>{if(!lg)return($)=>$;let J=`\x1B[${D}m`,Q=`\x1B[${F}m`;return($)=>{let Z=$+"",X=Z.indexOf(Q);if(X===-1)return J+Z+Q;let Y=J,q=0,W=(F===22?Q:"")+J;while(X!==-1)Y+=Z.slice(q,X)+W,q=X+Q.length,X=Z.indexOf(Q,q);return Y+=Z.slice(q)+Q,Y}},KqD=DD(0,0),kC=DD(1,22),UqD=DD(2,22),VqD=DD(3,23),HqD=DD(4,24),zqD=DD(53,55),CqD=DD(7,27),_qD=DD(8,28),OqD=DD(9,29),MqD=DD(30,39),yC=DD(31,39),fC=DD(32,39),hC=DD(33,39),bC=DD(34,39),EqD=DD(35,39),RqD=DD(36,39),AqD=DD(37,39),_J=DD(90,39),wqD=DD(40,49),IqD=DD(41,49),NqD=DD(42,49),TqD=DD(43,49),LqD=DD(44,49),PqD=DD(45,49),jqD=DD(46,49),SqD=DD(47,49),xqD=DD(100,49),vC=DD(91,39),kqD=DD(92,39),uC=DD(93,39),yqD=DD(94,39),fqD=DD(95,39),hqD=DD(96,39),bqD=DD(97,39),vqD=DD(101,49),uqD=DD(102,49),gqD=DD(103,49),mqD=DD(104,49),dqD=DD(105,49),pqD=DD(106,49),lqD=DD(107,49);var dC=({type:D,message:F,timestamp:J,piped:Q,commandId:$,result:{failed:Z=!1}={},options:{reject:X=!0}})=>{let Y=cg(J),q=ng[D]({failed:Z,reject:X,piped:Q}),G=ig[D]({reject:X});return`${_J(`[${Y}]`)} ${_J(`[${$}]`)} ${G(q)} ${G(F)}`},cg=(D)=>`${OJ(D.getHours(),2)}:${OJ(D.getMinutes(),2)}:${OJ(D.getSeconds(),2)}.${OJ(D.getMilliseconds(),3)}`,OJ=(D,F)=>String(D).padStart(F,"0"),gC=({failed:D,reject:F})=>{if(!D)return CJ.tick;return F?CJ.cross:CJ.warning},ng={command:({piped:D})=>D?"|":"$",output:()=>" ",ipc:()=>"*",error:gC,duration:gC},mC=(D)=>D,ig={command:()=>kC,output:()=>mC,ipc:()=>mC,error:({reject:D})=>D?vC:uC,duration:()=>_J};var pC=(D,F,J)=>{let Q=TC(F,J);return D.map(({verboseLine:$,verboseObject:Z})=>og($,Z,Q)).filter(($)=>$!==void 0).map(($)=>ag($)).join("")},og=(D,F,J)=>{if(J===void 0)return D;let Q=J(D,F);if(typeof Q==="string")return Q},ag=(D)=>D.endsWith(`
|
|
245
|
+
`)?D:`${D}
|
|
246
|
+
`;var Z2=({type:D,verboseMessage:F,fdNumber:J,verboseInfo:Q,result:$})=>{let Z=sg({type:D,result:$,verboseInfo:Q}),X=tg(F,Z),Y=pC(X,Q,J);if(Y!=="")console.warn(Y.slice(0,-1))},sg=({type:D,result:F,verboseInfo:{escapedCommand:J,commandId:Q,rawOptions:{piped:$=!1,...Z}}})=>({type:D,escapedCommand:J,commandId:`${Q}`,timestamp:new Date,piped:$,result:F,options:Z}),tg=(D,F)=>D.split(`
|
|
247
|
+
`).map((J)=>eg({...F,message:J})),eg=(D)=>{return{verboseLine:dC(D),verboseObject:D}},MJ=(D)=>{let F=typeof D==="string"?D:rg(D);return A9(F).replaceAll("\t"," ".repeat(Dm))},Dm=2;var lC=(D,F)=>{if(!t3(F))return;Z2({type:"command",verboseMessage:D,verboseInfo:F})};var cC=(D,F,J)=>{Qm(D);let Q=Fm(D);return{verbose:D,escapedCommand:F,commandId:Q,rawOptions:J}},Fm=(D)=>t3({verbose:D})?Jm++:void 0,Jm=0n,Qm=(D)=>{for(let F of D){if(F===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(F===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!zJ.includes(F)&&!HJ(F)){let J=zJ.map((Q)=>`'${Q}'`).join(", ");throw TypeError(`The "verbose" option must not be ${F}. Allowed values are: ${J} or a function.`)}}};import{hrtime as nC}from"node:process";var EJ=()=>nC.bigint(),Hq=(D)=>Number(nC.bigint()-D)/1e6;var RJ=(D,F,J)=>{let Q=EJ(),{command:$,escapedCommand:Z}=LC(D,F),X=Bq(J,"verbose"),Y=cC(X,Z,{...J});return lC(Z,Y),{command:$,escapedCommand:Z,startTime:Q,verboseInfo:Y}};var lO=ID(y_(),1);import pd from"node:path";import pO from"node:process";import NJ from"node:process";import kF from"node:path";function wJ(D={}){let{env:F=process.env,platform:J=process.platform}=D;if(J!=="win32")return"PATH";return Object.keys(F).reverse().find((Q)=>Q.toUpperCase()==="PATH")||"Path"}import{promisify as km}from"node:util";import{execFile as ym,execFileSync as SGD}from"node:child_process";import f_ from"node:path";import{fileURLToPath as fm}from"node:url";var yGD=km(ym);function IJ(D){return D instanceof URL?fm(D):D}function h_(D){return{*[Symbol.iterator](){let F=f_.resolve(IJ(D)),J;while(J!==F)yield F,J=F,F=f_.resolve(F,"..")}}}var hm=({cwd:D=NJ.cwd(),path:F=NJ.env[wJ()],preferLocal:J=!0,execPath:Q=NJ.execPath,addExecPath:$=!0}={})=>{let Z=kF.resolve(IJ(D)),X=[],Y=F.split(kF.delimiter);if(J)bm(X,Y,Z);if($)vm(X,Y,Q,Z);return F===""||F===kF.delimiter?`${X.join(kF.delimiter)}${F}`:[...X,F].join(kF.delimiter)},bm=(D,F,J)=>{for(let Q of h_(J)){let $=kF.join(Q,"node_modules/.bin");if(!F.includes($))D.push($)}},vm=(D,F,J,Q)=>{let $=kF.resolve(Q,IJ(J),"..");if(!F.includes($))D.push($)},b_=({env:D=NJ.env,...F}={})=>{D={...D};let J=wJ({env:D});return F.path=D[J],D[J]=hm(F),D};import{setTimeout as em}from"node:timers/promises";var v_=(D,F,J)=>{let Q=J?w9:V8,$=D instanceof X2?{}:{cause:D};return new Q(F,$)};class X2 extends Error{}var u_=(D,F)=>{Object.defineProperty(D.prototype,"name",{value:F,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,m_,{value:!0,writable:!1,enumerable:!1,configurable:!1})},g_=(D)=>TJ(D)&&(m_ in D),m_=Symbol("isExecaError"),TJ=(D)=>Object.prototype.toString.call(D)==="[object Error]";class V8 extends Error{}u_(V8,V8.name);class w9 extends Error{}u_(w9,w9.name);import{constants as I9}from"node:os";import{constants as dm}from"node:os";var d_=()=>{let D=Iq-p_+1;return Array.from({length:D},um)},um=(D,F)=>({name:`SIGRT${F+1}`,number:p_+F,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),p_=34,Iq=64;import{constants as gm}from"node:os";var l_=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Nq=()=>{let D=d_();return[...l_,...D].map(mm)},mm=({name:D,number:F,description:J,action:Q,forced:$=!1,standard:Z})=>{let{signals:{[D]:X}}=gm,Y=X!==void 0;return{name:D,number:Y?X:F,description:J,supported:Y,action:Q,forced:$,standard:Z}};var pm=()=>{let D=Nq();return Object.fromEntries(D.map(lm))},lm=({name:D,number:F,description:J,supported:Q,action:$,forced:Z,standard:X})=>[D,{name:D,number:F,description:J,supported:Q,action:$,forced:Z,standard:X}],c_=pm(),cm=()=>{let D=Nq(),F=Iq+1,J=Array.from({length:F},(Q,$)=>nm($,D));return Object.assign({},...J)},nm=(D,F)=>{let J=im(D,F);if(J===void 0)return{};let{name:Q,description:$,supported:Z,action:X,forced:Y,standard:q}=J;return{[D]:{name:Q,number:D,description:$,supported:Z,action:X,forced:Y,standard:q}}},im=(D,F)=>{let J=F.find(({name:Q})=>dm.signals[Q]===D);if(J!==void 0)return J;return F.find((Q)=>Q.number===D)},tGD=cm();var i_=(D)=>{if(D===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return a_(D,"option `killSignal`")},o_=(D)=>D===0?D:a_(D,"`subprocess.kill()`'s argument"),a_=(D,F)=>{if(Number.isInteger(D))return om(D,F);if(typeof D==="string")return rm(D,F);throw TypeError(`Invalid ${F} ${String(D)}: it must be a string or an integer.
|
|
248
|
+
${Tq()}`)},om=(D,F)=>{if(n_.has(D))return n_.get(D);throw TypeError(`Invalid ${F} ${D}: this signal integer does not exist.
|
|
249
|
+
${Tq()}`)},am=()=>new Map(Object.entries(I9.signals).reverse().map(([D,F])=>[F,D])),n_=am(),rm=(D,F)=>{if(D in I9.signals)return D;if(D.toUpperCase()in I9.signals)throw TypeError(`Invalid ${F} '${D}': please rename it to '${D.toUpperCase()}'.`);throw TypeError(`Invalid ${F} '${D}': this signal name does not exist.
|
|
250
|
+
${Tq()}`)},Tq=()=>`Available signal names: ${sm()}.
|
|
251
|
+
Available signal numbers: ${tm()}.`,sm=()=>Object.keys(I9.signals).sort().map((D)=>`'${D}'`).join(", "),tm=()=>[...new Set(Object.values(I9.signals).sort((D,F)=>D-F))].join(", "),LJ=(D)=>c_[D].description;var r_=(D)=>{if(D===!1)return D;if(D===!0)return Dd;if(!Number.isFinite(D)||D<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${D}\` (${typeof D})`);return D},Dd=5000,s_=({kill:D,options:{forceKillAfterDelay:F,killSignal:J},onInternalError:Q,context:$,controller:Z},X,Y)=>{let{signal:q,error:G}=Fd(X,Y,J);Jd(G,Q);let W=D(q);return Qd({kill:D,signal:q,forceKillAfterDelay:F,killSignal:J,killResult:W,context:$,controller:Z}),W},Fd=(D,F,J)=>{let[Q=J,$]=TJ(D)?[void 0,D]:[D,F];if(typeof Q!=="string"&&!Number.isInteger(Q))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(Q)}`);if($!==void 0&&!TJ($))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${$}`);return{signal:o_(Q),error:$}},Jd=(D,F)=>{if(D!==void 0)F.reject(D)},Qd=async({kill:D,signal:F,forceKillAfterDelay:J,killSignal:Q,killResult:$,context:Z,controller:X})=>{if(F===Q&&$)Lq({kill:D,forceKillAfterDelay:J,context:Z,controllerSignal:X.signal})},Lq=async({kill:D,forceKillAfterDelay:F,context:J,controllerSignal:Q})=>{if(F===!1)return;try{if(await em(F,void 0,{signal:Q}),D("SIGKILL"))J.isForcefullyTerminated??=!0}catch{}};import{once as $d}from"node:events";var PJ=async(D,F)=>{if(!D.aborted)await $d(D,"abort",{signal:F})};var t_=({cancelSignal:D})=>{if(D!==void 0&&Object.prototype.toString.call(D)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(D)}`)},e_=({subprocess:D,cancelSignal:F,gracefulCancel:J,context:Q,controller:$})=>F===void 0||J?[]:[Zd(D,F,Q,$)],Zd=async(D,F,J,{signal:Q})=>{throw await PJ(F,Q),J.terminationReason??="cancel",D.kill(),F.reason};import{scheduler as Nd}from"node:timers/promises";import{promisify as Ad}from"node:util";var J6=({methodName:D,isSubprocess:F,ipc:J,isConnected:Q})=>{Xd(D,F,J),Pq(D,F,Q)},Xd=(D,F,J)=>{if(!J)throw Error(`${y8(D,F)} can only be used if the \`ipc\` option is \`true\`.`)},Pq=(D,F,J)=>{if(!J)throw Error(`${y8(D,F)} cannot be used: the ${S1(F)} has already exited or disconnected.`)},DO=(D)=>{throw Error(`${y8("getOneMessage",D)} could not complete: the ${S1(D)} exited or disconnected.`)},FO=(D)=>{throw Error(`${y8("sendMessage",D)} failed: the ${S1(D)} is sending a message too, instead of listening to incoming messages.
|
|
252
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
253
|
+
|
|
254
|
+
const [receivedMessage] = await Promise.all([
|
|
255
|
+
${y8("getOneMessage",D)},
|
|
256
|
+
${y8("sendMessage",D,"message, {strict: true}")},
|
|
257
|
+
]);`)},jJ=(D,F)=>Error(`${y8("sendMessage",F)} failed when sending an acknowledgment response to the ${S1(F)}.`,{cause:D}),JO=(D)=>{throw Error(`${y8("sendMessage",D)} failed: the ${S1(D)} is not listening to incoming messages.`)},QO=(D)=>{throw Error(`${y8("sendMessage",D)} failed: the ${S1(D)} exited without listening to incoming messages.`)},$O=()=>Error(`\`cancelSignal\` aborted: the ${S1(!0)} disconnected.`),ZO=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},XO=({error:D,methodName:F,isSubprocess:J})=>{if(D.code==="EPIPE")throw Error(`${y8(F,J)} cannot be used: the ${S1(J)} is disconnecting.`,{cause:D})},YO=({error:D,methodName:F,isSubprocess:J,message:Q})=>{if(Yd(D))throw Error(`${y8(F,J)}'s argument type is invalid: the message cannot be serialized: ${String(Q)}.`,{cause:D})},Yd=({code:D,message:F})=>qd.has(D)||Gd.some((J)=>F.includes(J)),qd=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Gd=["could not be cloned","circular structure","call stack size exceeded"],y8=(D,F,J="")=>D==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Wd(F)}${D}(${J})`,Wd=(D)=>D?"":"subprocess.",S1=(D)=>D?"parent process":"subprocess",Q6=(D)=>{if(D.connected)D.disconnect()};var Y2=()=>{let D={},F=new Promise((J,Q)=>{Object.assign(D,{resolve:J,reject:Q})});return Object.assign(F,D)};var xJ=(D,F="stdin")=>{let{options:Q,fileDescriptors:$}=q2.get(D),Z=qO($,F,!0),X=D.stdio[Z];if(X===null)throw TypeError(GO(Z,F,Q,!0));return X},$6=(D,F="stdout")=>{let{options:Q,fileDescriptors:$}=q2.get(D),Z=qO($,F,!1),X=Z==="all"?D.all:D.stdio[Z];if(X===null||X===void 0)throw TypeError(GO(Z,F,Q,!1));return X},q2=new WeakMap,qO=(D,F,J)=>{let Q=Bd(F,J);return Kd(Q,F,J,D),Q},Bd=(D,F)=>{let J=Kq(D);if(J!==void 0)return J;let{validOptions:Q,defaultValue:$}=F?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${N9(F)}" must not be "${D}".
|
|
258
|
+
It must be ${Q} or "fd3", "fd4" (and so on).
|
|
259
|
+
It is optional and defaults to "${$}".`)},Kd=(D,F,J,Q)=>{let $=Q[WO(D)];if($===void 0)throw TypeError(`"${N9(J)}" must not be ${F}. That file descriptor does not exist.
|
|
260
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if($.direction==="input"&&!J)throw TypeError(`"${N9(J)}" must not be ${F}. It must be a readable stream, not writable.`);if($.direction!=="input"&&J)throw TypeError(`"${N9(J)}" must not be ${F}. It must be a writable stream, not readable.`)},GO=(D,F,J,Q)=>{if(D==="all"&&!J.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:$,optionValue:Z}=Ud(D,J);return`The "${$}: ${SJ(Z)}" option is incompatible with using "${N9(Q)}: ${SJ(F)}".
|
|
261
|
+
Please set this option with "pipe" instead.`},Ud=(D,{stdin:F,stdout:J,stderr:Q,stdio:$})=>{let Z=WO(D);if(Z===0&&F!==void 0)return{optionName:"stdin",optionValue:F};if(Z===1&&J!==void 0)return{optionName:"stdout",optionValue:J};if(Z===2&&Q!==void 0)return{optionName:"stderr",optionValue:Q};return{optionName:`stdio[${Z}]`,optionValue:$[Z]}},WO=(D)=>D==="all"?1:D,N9=(D)=>D?"to":"from",SJ=(D)=>{if(typeof D==="string")return`'${D}'`;return typeof D==="number"?`${D}`:"Stream"};import{once as Od}from"node:events";import{addAbortListener as Vd}from"node:events";var yF=(D,F,J)=>{let Q=D.getMaxListeners();if(Q===0||Q===Number.POSITIVE_INFINITY)return;D.setMaxListeners(Q+F),Vd(J,()=>{D.setMaxListeners(D.getMaxListeners()-F)})};import{EventEmitter as Cd}from"node:events";import{once as Hd}from"node:events";import{scheduler as zd}from"node:timers/promises";var kJ=(D,F)=>{if(F)jq(D)},jq=(D)=>{D.refCounted()},yJ=(D,F)=>{if(F)Sq(D)},Sq=(D)=>{D.unrefCounted()},BO=(D,F)=>{if(F)Sq(D),Sq(D)},KO=(D,F)=>{if(F)jq(D),jq(D)};var UO=async({anyProcess:D,channel:F,isSubprocess:J,ipcEmitter:Q},$)=>{if(zO($)||_O($))return;if(!fJ.has(D))fJ.set(D,[]);let Z=fJ.get(D);if(Z.push($),Z.length>1)return;while(Z.length>0){await CO(D,Q,$),await zd.yield();let X=await HO({wrappedMessage:Z[0],anyProcess:D,channel:F,isSubprocess:J,ipcEmitter:Q});Z.shift(),Q.emit("message",X),Q.emit("message:done")}},VO=async({anyProcess:D,channel:F,isSubprocess:J,ipcEmitter:Q,boundOnMessage:$})=>{xq();let Z=fJ.get(D);while(Z?.length>0)await Hd(Q,"message:done");D.removeListener("message",$),KO(F,J),Q.connected=!1,Q.emit("disconnect")},fJ=new WeakMap;var x1=(D,F,J)=>{if(hJ.has(D))return hJ.get(D);let Q=new Cd;return Q.connected=!0,hJ.set(D,Q),_d({ipcEmitter:Q,anyProcess:D,channel:F,isSubprocess:J}),Q},hJ=new WeakMap,_d=({ipcEmitter:D,anyProcess:F,channel:J,isSubprocess:Q})=>{let $=UO.bind(void 0,{anyProcess:F,channel:J,isSubprocess:Q,ipcEmitter:D});F.on("message",$),F.once("disconnect",VO.bind(void 0,{anyProcess:F,channel:J,isSubprocess:Q,ipcEmitter:D,boundOnMessage:$})),BO(J,Q)},bJ=(D)=>{let F=hJ.get(D);return F===void 0?D.channel!==null:F.connected};var OO=({anyProcess:D,channel:F,isSubprocess:J,message:Q,strict:$})=>{if(!$)return Q;let Z=x1(D,F,J),X=gJ(D,Z);return{id:Md++,type:uJ,message:Q,hasListeners:X}},Md=0n,MO=(D,F)=>{if(F?.type!==uJ||F.hasListeners)return;for(let{id:J}of D)if(J!==void 0)vJ[J].resolve({isDeadlock:!0,hasListeners:!1})},HO=async({wrappedMessage:D,anyProcess:F,channel:J,isSubprocess:Q,ipcEmitter:$})=>{if(D?.type!==uJ||!F.connected)return D;let{id:Z,message:X}=D,Y={id:Z,type:RO,message:gJ(F,$)};try{await mJ({anyProcess:F,channel:J,isSubprocess:Q,ipc:!0},Y)}catch(q){$.emit("strict:error",q)}return X},zO=(D)=>{if(D?.type!==RO)return!1;let{id:F,message:J}=D;return vJ[F]?.resolve({isDeadlock:!1,hasListeners:J}),!0},EO=async(D,F,J)=>{if(D?.type!==uJ)return;let Q=Y2();vJ[D.id]=Q;let $=new AbortController;try{let{isDeadlock:Z,hasListeners:X}=await Promise.race([Q,Ed(F,J,$)]);if(Z)FO(J);if(!X)JO(J)}finally{$.abort(),delete vJ[D.id]}},vJ={},Ed=async(D,F,{signal:J})=>{yF(D,1,J),await Od(D,"disconnect",{signal:J}),QO(F)},uJ="execa:ipc:request",RO="execa:ipc:response";var AO=(D,F,J)=>{if(!T9.has(D))T9.set(D,new Set);let Q=T9.get(D),$=Y2(),Z=J?F.id:void 0,X={onMessageSent:$,id:Z};return Q.add(X),{outgoingMessages:Q,outgoingMessage:X}},wO=({outgoingMessages:D,outgoingMessage:F})=>{D.delete(F),F.onMessageSent.resolve()},CO=async(D,F,J)=>{while(!gJ(D,F)&&T9.get(D)?.size>0){let Q=[...T9.get(D)];MO(Q,J),await Promise.all(Q.map(({onMessageSent:$})=>$))}},T9=new WeakMap,gJ=(D,F)=>F.listenerCount("message")>Rd(D),Rd=(D)=>q2.has(D)&&!i2(q2.get(D).options.buffer,"ipc")?1:0;var mJ=({anyProcess:D,channel:F,isSubprocess:J,ipc:Q},$,{strict:Z=!1}={})=>{return J6({methodName:"sendMessage",isSubprocess:J,ipc:Q,isConnected:D.connected}),wd({anyProcess:D,channel:F,methodName:"sendMessage",isSubprocess:J,message:$,strict:Z})},wd=async({anyProcess:D,channel:F,methodName:J,isSubprocess:Q,message:$,strict:Z})=>{let X=OO({anyProcess:D,channel:F,isSubprocess:Q,message:$,strict:Z}),Y=AO(D,X,Z);try{await yq({anyProcess:D,methodName:J,isSubprocess:Q,wrappedMessage:X,message:$})}catch(q){throw Q6(D),q}finally{wO(Y)}},yq=async({anyProcess:D,methodName:F,isSubprocess:J,wrappedMessage:Q,message:$})=>{let Z=Id(D);try{await Promise.all([EO(Q,D,J),Z(Q)])}catch(X){throw XO({error:X,methodName:F,isSubprocess:J}),YO({error:X,methodName:F,isSubprocess:J,message:$}),X}},Id=(D)=>{if(kq.has(D))return kq.get(D);let F=Ad(D.send.bind(D));return kq.set(D,F),F},kq=new WeakMap;var NO=(D,F)=>{return Pq("cancelSignal",!1,D.connected),yq({anyProcess:D,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:LO,message:F},message:F})},TO=async({anyProcess:D,channel:F,isSubprocess:J,ipc:Q})=>{return await Td({anyProcess:D,channel:F,isSubprocess:J,ipc:Q}),fq.signal},Td=async({anyProcess:D,channel:F,isSubprocess:J,ipc:Q})=>{if(IO)return;if(IO=!0,!Q){ZO();return}if(F===null){xq();return}x1(D,F,J),await Nd.yield()},IO=!1,_O=(D)=>{if(D?.type!==LO)return!1;return fq.abort(D.message),!0},LO="execa:ipc:cancel",xq=()=>{fq.abort($O())},fq=new AbortController;var PO=({gracefulCancel:D,cancelSignal:F,ipc:J,serialization:Q})=>{if(!D)return;if(F===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!J)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(Q==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},jO=({subprocess:D,cancelSignal:F,gracefulCancel:J,forceKillAfterDelay:Q,context:$,controller:Z})=>J?[Ld({subprocess:D,cancelSignal:F,forceKillAfterDelay:Q,context:$,controller:Z})]:[],Ld=async({subprocess:D,cancelSignal:F,forceKillAfterDelay:J,context:Q,controller:{signal:$}})=>{await PJ(F,$);let Z=Pd(F);throw await NO(D,Z),Lq({kill:D.kill,forceKillAfterDelay:J,context:Q,controllerSignal:$}),Q.terminationReason??="gracefulCancel",F.reason},Pd=({reason:D})=>{if(!(D instanceof DOMException))return D;let F=Error(D.message);return Object.defineProperty(F,"stack",{value:D.stack,enumerable:!1,configurable:!0,writable:!0}),F};import{setTimeout as jd}from"node:timers/promises";var SO=({timeout:D})=>{if(D!==void 0&&(!Number.isFinite(D)||D<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${D}\` (${typeof D})`)},xO=(D,F,J,Q)=>F===0||F===void 0?[]:[Sd(D,F,J,Q)],Sd=async(D,F,J,{signal:Q})=>{throw await jd(F,void 0,{signal:Q}),J.terminationReason??="timeout",D.kill(),new X2};import{execPath as xd,execArgv as kd}from"node:process";import kO from"node:path";var yO=({options:D})=>{if(D.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...D,node:!0}}},fO=(D,F,{node:J=!1,nodePath:Q=xd,nodeOptions:$=kd.filter((q)=>!q.startsWith("--inspect")),cwd:Z,execPath:X,...Y})=>{if(X!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let q=s3(Q,'The "nodePath" option'),G=kO.resolve(Z,q),W={...Y,nodePath:G,node:J,cwd:Z};if(!J)return[D,F,W];if(kO.basename(D,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[G,[...$,D,...F],{ipc:!0,...W,shell:!1}]};import{serialize as yd}from"node:v8";var hO=({ipcInput:D,ipc:F,serialization:J})=>{if(D===void 0)return;if(!F)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");bd[J](D)},fd=(D)=>{try{yd(D)}catch(F){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:F})}},hd=(D)=>{try{JSON.stringify(D)}catch(F){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:F})}},bd={advanced:fd,json:hd},bO=async(D,F)=>{if(F===void 0)return;await D.sendMessage(F)};var uO=({encoding:D})=>{if(hq.has(D))return;let F=ud(D);if(F!==void 0)throw TypeError(`Invalid option \`encoding: ${dJ(D)}\`.
|
|
262
|
+
Please rename it to ${dJ(F)}.`);let J=[...hq].map((Q)=>dJ(Q)).join(", ");throw TypeError(`Invalid option \`encoding: ${dJ(D)}\`.
|
|
263
|
+
Please rename it to one of: ${J}.`)},vd=new Set(["utf8","utf16le"]),J8=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),hq=new Set([...vd,...J8]),ud=(D)=>{if(D===null)return"buffer";if(typeof D!=="string")return;let F=D.toLowerCase();if(F in vO)return vO[F];if(hq.has(F))return F},vO={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},dJ=(D)=>typeof D==="string"?`"${D}"`:String(D);import{statSync as gd}from"node:fs";import md from"node:path";import dd from"node:process";var gO=(D=mO())=>{let F=s3(D,'The "cwd" option');return md.resolve(F)},mO=()=>{try{return dd.cwd()}catch(D){throw D.message=`The current directory does not exist.
|
|
264
|
+
${D.message}`,D}},dO=(D,F)=>{if(F===mO())return D;let J;try{J=gd(F)}catch(Q){return`The "cwd" option is invalid: ${F}.
|
|
265
|
+
${Q.message}
|
|
266
|
+
${D}`}if(!J.isDirectory())return`The "cwd" option is not a directory: ${F}.
|
|
267
|
+
${D}`;return D};var pJ=(D,F,J)=>{J.cwd=gO(J.cwd);let[Q,$,Z]=fO(D,F,J),{command:X,args:Y,options:q}=lO.default._parse(Q,$,Z),G=NC(q),W=ld(G);if(SO(W),uO(W),hO(W),t_(W),PO(W),W.shell=qq(W.shell),W.env=cd(W),W.killSignal=i_(W.killSignal),W.forceKillAfterDelay=r_(W.forceKillAfterDelay),W.lines=W.lines.map((B,K)=>B&&!J8.has(W.encoding)&&W.buffer[K]),pO.platform==="win32"&&pd.basename(X,".exe")==="cmd")Y.unshift("/q");return{file:X,commandArguments:Y,options:W}},ld=({extendEnv:D=!0,preferLocal:F=!1,cwd:J,localDir:Q=J,encoding:$="utf8",reject:Z=!0,cleanup:X=!0,all:Y=!1,windowsHide:q=!0,killSignal:G="SIGTERM",forceKillAfterDelay:W=!0,gracefulCancel:B=!1,ipcInput:K,ipc:U=K!==void 0||B,serialization:V="advanced",...H})=>({...H,extendEnv:D,preferLocal:F,cwd:J,localDirectory:Q,encoding:$,reject:Z,cleanup:X,all:Y,windowsHide:q,killSignal:G,forceKillAfterDelay:W,gracefulCancel:B,ipcInput:K,ipc:U,serialization:V}),cd=({env:D,extendEnv:F,preferLocal:J,node:Q,localDirectory:$,nodePath:Z})=>{let X=F?{...pO.env,...D}:D;if(J||Q)return b_({env:X,cwd:$,execPath:Z,preferLocal:J,addExecPath:Q});return X};var lJ=(D,F,J)=>J.shell&&F.length>0?[[D,...F].join(" "),[],J]:[D,F,J];import{inspect as Ip}from"node:util";function Z6(D){if(typeof D==="string")return nd(D);if(!(ArrayBuffer.isView(D)&&D.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return id(D)}var nd=(D)=>D.at(-1)===cO?D.slice(0,D.at(-2)===nO?-2:-1):D,id=(D)=>D.at(-1)===od?D.subarray(0,D.at(-2)===ad?-2:-1):D,cO=`
|
|
268
|
+
`,od=cO.codePointAt(0),nO="\r",ad=nO.codePointAt(0);import{on as Ep}from"node:events";import{finished as Rp}from"node:stream/promises";function f8(D,{checkOpen:F=!0}={}){return D!==null&&typeof D==="object"&&(D.writable||D.readable||!F||D.writable===void 0&&D.readable===void 0)&&typeof D.pipe==="function"}function bq(D,{checkOpen:F=!0}={}){return f8(D,{checkOpen:F})&&(D.writable||!F)&&typeof D.write==="function"&&typeof D.end==="function"&&typeof D.writable==="boolean"&&typeof D.writableObjectMode==="boolean"&&typeof D.destroy==="function"&&typeof D.destroyed==="boolean"}function fF(D,{checkOpen:F=!0}={}){return f8(D,{checkOpen:F})&&(D.readable||!F)&&typeof D.read==="function"&&typeof D.readable==="boolean"&&typeof D.readableObjectMode==="boolean"&&typeof D.destroy==="function"&&typeof D.destroyed==="boolean"}function vq(D,F){return bq(D,F)&&fF(D,F)}var rd=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class iO{#F;#J;#D=!1;#Q=void 0;constructor(D,F){this.#F=D,this.#J=F}next(){let D=()=>this.#Y();return this.#Q=this.#Q?this.#Q.then(D,D):D(),this.#Q}return(D){let F=()=>this.#X(D);return this.#Q?this.#Q.then(F,F):F()}async#Y(){if(this.#D)return{done:!0,value:void 0};let D;try{D=await this.#F.read()}catch(F){throw this.#Q=void 0,this.#D=!0,this.#F.releaseLock(),F}return D.done&&(this.#Q=void 0,this.#D=!0,this.#F.releaseLock()),D}async#X(D){if(this.#D)return{done:!0,value:D};if(this.#D=!0,!this.#J){let F=this.#F.cancel(D);return this.#F.releaseLock(),await F,{done:!0,value:D}}return this.#F.releaseLock(),{done:!0,value:D}}}var uq=Symbol();function oO(){return this[uq].next()}Object.defineProperty(oO,"name",{value:"next"});function aO(D){return this[uq].return(D)}Object.defineProperty(aO,"name",{value:"return"});var sd=Object.create(rd,{next:{enumerable:!0,configurable:!0,writable:!0,value:oO},return:{enumerable:!0,configurable:!0,writable:!0,value:aO}});function gq({preventCancel:D=!1}={}){let F=this.getReader(),J=new iO(F,D),Q=Object.create(sd);return Q[uq]=J,Q}var rO=(D)=>{if(fF(D,{checkOpen:!1})&&L9.on!==void 0)return ed(D);if(typeof D?.[Symbol.asyncIterator]==="function")return D;if(td.call(D)==="[object ReadableStream]")return gq.call(D);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:td}=Object.prototype,ed=async function*(D){let F=new AbortController,J={};Dp(D,F,J);try{for await(let[Q]of L9.on(D,"data",{signal:F.signal}))yield Q}catch(Q){if(J.error!==void 0)throw J.error;else if(!F.signal.aborted)throw Q}finally{D.destroy()}},Dp=async(D,F,J)=>{try{await L9.finished(D,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Q){J.error=Q}finally{F.abort()}},L9={};var X6=async(D,{init:F,convertChunk:J,getSize:Q,truncateChunk:$,addChunk:Z,getFinalChunk:X,finalize:Y},{maxBuffer:q=Number.POSITIVE_INFINITY}={})=>{let G=rO(D),W=F();W.length=0;try{for await(let B of G){let K=Jp(B),U=J[K](B,W);eO({convertedChunk:U,state:W,getSize:Q,truncateChunk:$,addChunk:Z,maxBuffer:q})}return Fp({state:W,convertChunk:J,getSize:Q,truncateChunk:$,addChunk:Z,getFinalChunk:X,maxBuffer:q}),Y(W)}catch(B){let K=typeof B==="object"&&B!==null?B:Error(B);throw K.bufferedData=Y(W),K}},Fp=({state:D,getSize:F,truncateChunk:J,addChunk:Q,getFinalChunk:$,maxBuffer:Z})=>{let X=$(D);if(X!==void 0)eO({convertedChunk:X,state:D,getSize:F,truncateChunk:J,addChunk:Q,maxBuffer:Z})},eO=({convertedChunk:D,state:F,getSize:J,truncateChunk:Q,addChunk:$,maxBuffer:Z})=>{let X=J(D),Y=F.length+X;if(Y<=Z){sO(D,F,$,Y);return}let q=Q(D,Z-F.length);if(q!==void 0)sO(q,F,$,Z);throw new o2},sO=(D,F,J,Q)=>{F.contents=J(D,F,Q),F.length=Q},Jp=(D)=>{let F=typeof D;if(F==="string")return"string";if(F!=="object"||D===null)return"others";if(globalThis.Buffer?.isBuffer(D))return"buffer";let J=tO.call(D);if(J==="[object ArrayBuffer]")return"arrayBuffer";if(J==="[object DataView]")return"dataView";if(Number.isInteger(D.byteLength)&&Number.isInteger(D.byteOffset)&&tO.call(D.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:tO}=Object.prototype;class o2 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var a2=(D)=>D,P9=()=>{return},cJ=({contents:D})=>D,nJ=(D)=>{throw Error(`Streams in object mode are not supported: ${String(D)}`)},iJ=(D)=>D.length;async function oJ(D,F){return X6(D,Xp,F)}var Qp=()=>({contents:[]}),$p=()=>1,Zp=(D,{contents:F})=>{return F.push(D),F},Xp={init:Qp,convertChunk:{string:a2,buffer:a2,arrayBuffer:a2,dataView:a2,typedArray:a2,others:a2},getSize:$p,truncateChunk:P9,addChunk:Zp,getFinalChunk:P9,finalize:cJ};async function aJ(D,F){return X6(D,Hp,F)}var Yp=()=>({contents:new ArrayBuffer(0)}),qp=(D)=>Gp.encode(D),Gp=new TextEncoder,DM=(D)=>new Uint8Array(D),FM=(D)=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength),Wp=(D,F)=>D.slice(0,F),Bp=(D,{contents:F,length:J},Q)=>{let $=$M()?Up(F,Q):Kp(F,Q);return new Uint8Array($).set(D,J),$},Kp=(D,F)=>{if(F<=D.byteLength)return D;let J=new ArrayBuffer(QM(F));return new Uint8Array(J).set(new Uint8Array(D),0),J},Up=(D,F)=>{if(F<=D.maxByteLength)return D.resize(F),D;let J=new ArrayBuffer(F,{maxByteLength:QM(F)});return new Uint8Array(J).set(new Uint8Array(D),0),J},QM=(D)=>JM**Math.ceil(Math.log(D)/Math.log(JM)),JM=2,Vp=({contents:D,length:F})=>$M()?D:D.slice(0,F),$M=()=>("resize"in ArrayBuffer.prototype),Hp={init:Yp,convertChunk:{string:qp,buffer:DM,arrayBuffer:DM,dataView:FM,typedArray:FM,others:nJ},getSize:iJ,truncateChunk:Wp,addChunk:Bp,getFinalChunk:P9,finalize:Vp};async function sJ(D,F){return X6(D,Mp,F)}var zp=()=>({contents:"",textDecoder:new TextDecoder}),rJ=(D,{textDecoder:F})=>F.decode(D,{stream:!0}),Cp=(D,{contents:F})=>F+D,_p=(D,F)=>D.slice(0,F),Op=({textDecoder:D})=>{let F=D.decode();return F===""?void 0:F},Mp={init:zp,convertChunk:{string:a2,buffer:rJ,arrayBuffer:rJ,dataView:rJ,typedArray:rJ,others:nJ},getSize:iJ,truncateChunk:_p,addChunk:Cp,getFinalChunk:Op,finalize:cJ};Object.assign(L9,{on:Ep,finished:Rp});var ZM=({error:D,stream:F,readableObjectMode:J,lines:Q,encoding:$,fdNumber:Z})=>{if(!(D instanceof o2))throw D;if(Z==="all")return D;let X=Ap(J,Q,$);throw D.maxBufferInfo={fdNumber:Z,unit:X},F.destroy(),D},Ap=(D,F,J)=>{if(D)return"objects";if(F)return"lines";if(J==="buffer")return"bytes";return"characters"},XM=(D,F,J)=>{if(F.length!==J)return;let Q=new o2;throw Q.maxBufferInfo={fdNumber:"ipc"},Q},YM=(D,F)=>{let{streamName:J,threshold:Q,unit:$}=wp(D,F);return`Command's ${J} was larger than ${Q} ${$}`},wp=(D,F)=>{if(D?.maxBufferInfo===void 0)return{streamName:"output",threshold:F[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:J,unit:Q}}=D;delete D.maxBufferInfo;let $=i2(F,J);if(J==="ipc")return{streamName:"IPC output",threshold:$,unit:"messages"};return{streamName:VJ(J),threshold:$,unit:Q}},qM=(D,F,J)=>D?.code==="ENOBUFS"&&F!==null&&F.some((Q)=>Q!==null&&Q.length>tJ(J)),GM=(D,F,J)=>{if(!F)return D;let Q=tJ(J);return D.length>Q?D.slice(0,Q):D},tJ=([,D])=>D;var BM=({stdio:D,all:F,ipcOutput:J,originalError:Q,signal:$,signalDescription:Z,exitCode:X,escapedCommand:Y,timedOut:q,isCanceled:G,isGracefullyCanceled:W,isMaxBuffer:B,isForcefullyTerminated:K,forceKillAfterDelay:U,killSignal:V,maxBuffer:H,timeout:z,cwd:_})=>{let M=Q?.code,C=Np({originalError:Q,timedOut:q,timeout:z,isMaxBuffer:B,maxBuffer:H,errorCode:M,signal:$,signalDescription:Z,exitCode:X,isCanceled:G,isGracefullyCanceled:W,isForcefullyTerminated:K,forceKillAfterDelay:U,killSignal:V}),O=Lp(Q,_),E=O===void 0?"":`
|
|
269
|
+
${O}`,A=`${C}: ${Y}${E}`,N=F===void 0?[D[2],D[1]]:[F],w=[A,...N,...D.slice(3),J.map((T)=>Pp(T)).join(`
|
|
270
|
+
`)].map((T)=>A9(Z6(jp(T)))).filter(Boolean).join(`
|
|
271
|
+
|
|
272
|
+
`);return{originalMessage:O,shortMessage:A,message:w}},Np=({originalError:D,timedOut:F,timeout:J,isMaxBuffer:Q,maxBuffer:$,errorCode:Z,signal:X,signalDescription:Y,exitCode:q,isCanceled:G,isGracefullyCanceled:W,isForcefullyTerminated:B,forceKillAfterDelay:K,killSignal:U})=>{let V=Tp(B,K);if(F)return`Command timed out after ${J} milliseconds${V}`;if(W){if(X===void 0)return`Command was gracefully canceled with exit code ${q}`;return B?`Command was gracefully canceled${V}`:`Command was gracefully canceled with ${X} (${Y})`}if(G)return`Command was canceled${V}`;if(Q)return`${YM(D,$)}${V}`;if(Z!==void 0)return`Command failed with ${Z}${V}`;if(B)return`Command was killed with ${U} (${LJ(U)})${V}`;if(X!==void 0)return`Command was killed with ${X} (${Y})`;if(q!==void 0)return`Command failed with exit code ${q}`;return"Command failed"},Tp=(D,F)=>D?` and was forcefully terminated after ${F} milliseconds`:"",Lp=(D,F)=>{if(D instanceof X2)return;let J=g_(D)?D.originalMessage:String(D?.message??D),Q=A9(dO(J,F));return Q===""?void 0:Q},Pp=(D)=>typeof D==="string"?D:Ip(D),jp=(D)=>Array.isArray(D)?D.map((F)=>Z6(WM(F))).filter(Boolean).join(`
|
|
273
|
+
`):WM(D),WM=(D)=>{if(typeof D==="string")return D;if(tD(D))return KJ(D);return""};var eJ=({command:D,escapedCommand:F,stdio:J,all:Q,ipcOutput:$,options:{cwd:Z},startTime:X})=>KM({command:D,escapedCommand:F,cwd:Z,durationMs:Hq(X),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:J[1],stderr:J[2],all:Q,stdio:J,ipcOutput:$,pipedFrom:[]}),Y6=({error:D,command:F,escapedCommand:J,fileDescriptors:Q,options:$,startTime:Z,isSync:X})=>j9({error:D,command:F,escapedCommand:J,startTime:Z,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:Q.length}),ipcOutput:[],options:$,isSync:X}),j9=({error:D,command:F,escapedCommand:J,startTime:Q,timedOut:$,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:W,stdio:B,all:K,ipcOutput:U,options:{timeoutDuration:V,timeout:H=V,forceKillAfterDelay:z,killSignal:_,cwd:M,maxBuffer:C},isSync:O})=>{let{exitCode:E,signal:A,signalDescription:N}=xp(G,W),{originalMessage:w,shortMessage:T,message:I}=BM({stdio:B,all:K,ipcOutput:U,originalError:D,signal:A,signalDescription:N,exitCode:E,escapedCommand:J,timedOut:$,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,forceKillAfterDelay:z,killSignal:_,maxBuffer:C,timeout:H,cwd:M}),S=v_(D,I,O);return Object.assign(S,Sp({error:S,command:F,escapedCommand:J,startTime:Q,timedOut:$,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:E,signal:A,signalDescription:N,stdio:B,all:K,ipcOutput:U,cwd:M,originalMessage:w,shortMessage:T})),S},Sp=({error:D,command:F,escapedCommand:J,startTime:Q,timedOut:$,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:W,signalDescription:B,stdio:K,all:U,ipcOutput:V,cwd:H,originalMessage:z,shortMessage:_})=>KM({shortMessage:_,originalMessage:z,command:F,escapedCommand:J,cwd:H,durationMs:Hq(Q),failed:!0,timedOut:$,isCanceled:Z,isGracefullyCanceled:X,isTerminated:W!==void 0,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:W,signalDescription:B,code:D.cause?.code,stdout:K[1],stderr:K[2],all:U,stdio:K,ipcOutput:V,pipedFrom:[]}),KM=(D)=>Object.fromEntries(Object.entries(D).filter(([,F])=>F!==void 0)),xp=(D,F)=>{let J=D===null?void 0:D,Q=F===null?void 0:F,$=Q===void 0?void 0:LJ(F);return{exitCode:J,signal:Q,signalDescription:$}};var UM=(D)=>Number.isFinite(D)?D:0;function kp(D){return{days:Math.trunc(D/86400000),hours:Math.trunc(D/3600000%24),minutes:Math.trunc(D/60000%60),seconds:Math.trunc(D/1000%60),milliseconds:Math.trunc(D%1000),microseconds:Math.trunc(UM(D*1000)%1000),nanoseconds:Math.trunc(UM(D*1e6)%1000)}}function yp(D){return{days:D/86400000n,hours:D/3600000n%24n,minutes:D/60000n%60n,seconds:D/1000n%60n,milliseconds:D%1000n,microseconds:0n,nanoseconds:0n}}function mq(D){switch(typeof D){case"number":{if(Number.isFinite(D))return kp(D);break}case"bigint":return yp(D)}throw TypeError("Expected a finite number or bigint")}var fp=(D)=>D===0||D===0n,hp=(D,F)=>F===1||F===1n?D:`${D}s`,bp=0.0000001,vp=24n*60n*60n*1000n;function dq(D,F){let J=typeof D==="bigint";if(!J&&!Number.isFinite(D))throw TypeError("Expected a finite number or bigint");F={...F};let Q=D<0?"-":"";if(D=D<0?-D:D,F.colonNotation)F.compact=!1,F.formatSubMilliseconds=!1,F.separateMilliseconds=!1,F.verbose=!1;if(F.compact)F.unitCount=1,F.secondsDecimalDigits=0,F.millisecondsDecimalDigits=0;let $=[],Z=(W,B)=>{let K=Math.floor(W*10**B+bp);return(Math.round(K)/10**B).toFixed(B)},X=(W,B,K,U)=>{if(($.length===0||!F.colonNotation)&&fp(W)&&!(F.colonNotation&&K==="m"))return;if(U??=String(W),F.colonNotation){let V=U.includes(".")?U.split(".")[0].length:U.length,H=$.length>0?2:1;U="0".repeat(Math.max(0,H-V))+U}else U+=F.verbose?" "+hp(B,W):K;$.push(U)},Y=mq(D),q=BigInt(Y.days);if(F.hideYearAndDays)X(BigInt(q)*24n+BigInt(Y.hours),"hour","h");else{if(F.hideYear)X(q,"day","d");else X(q/365n,"year","y"),X(q%365n,"day","d");X(Number(Y.hours),"hour","h")}if(X(Number(Y.minutes),"minute","m"),!F.hideSeconds)if(F.separateMilliseconds||F.formatSubMilliseconds||!F.colonNotation&&D<1000&&!F.subSecondsAsDecimals){let W=Number(Y.seconds),B=Number(Y.milliseconds),K=Number(Y.microseconds),U=Number(Y.nanoseconds);if(X(W,"second","s"),F.formatSubMilliseconds)X(B,"millisecond","ms"),X(K,"microsecond","µs"),X(U,"nanosecond","ns");else{let V=B+K/1000+U/1e6,H=typeof F.millisecondsDecimalDigits==="number"?F.millisecondsDecimalDigits:0,z=V>=1?Math.round(V):Math.ceil(V),_=H?V.toFixed(H):z;X(Number.parseFloat(_),"millisecond","ms",_)}}else{let W=(J?Number(D%vp):D)/1000%60,B=typeof F.secondsDecimalDigits==="number"?F.secondsDecimalDigits:1,K=Z(W,B),U=F.keepDecimalsOnWholeSeconds?K:K.replace(/\.0+$/,"");X(Number.parseFloat(U),"second","s",U)}if($.length===0)return Q+"0"+(F.verbose?" milliseconds":"ms");let G=F.colonNotation?":":" ";if(typeof F.unitCount==="number")$=$.slice(0,Math.max(F.unitCount,1));return Q+$.join(G)}var VM=(D,F)=>{if(D.failed)Z2({type:"error",verboseMessage:D.shortMessage,verboseInfo:F,result:D})};var HM=(D,F)=>{if(!t3(F))return;VM(D,F),up(D,F)},up=(D,F)=>{let J=`(done in ${dq(D.durationMs)})`;Z2({type:"duration",verboseMessage:J,verboseInfo:F,result:D})};var q6=(D,F,{reject:J})=>{if(HM(D,F),D.failed&&J)throw D;return D};import{readFileSync as dM}from"node:fs";var _M=(D,F)=>{if(hF(D))return"asyncGenerator";if(EM(D))return"generator";if(DQ(D))return"fileUrl";if(lp(D))return"filePath";if(ip(D))return"webStream";if(f8(D,{checkOpen:!1}))return"native";if(tD(D))return"uint8Array";if(op(D))return"asyncIterable";if(ap(D))return"iterable";if(cq(D))return OM({transform:D},F);if(pp(D))return gp(D,F);return"native"},gp=(D,F)=>{if(vq(D.transform,{checkOpen:!1}))return mp(D,F);if(cq(D.transform))return OM(D,F);return dp(D,F)},mp=(D,F)=>{return MM(D,F,"Duplex stream"),"duplex"},OM=(D,F)=>{return MM(D,F,"web TransformStream"),"webTransform"},MM=({final:D,binary:F,objectMode:J},Q,$)=>{zM(D,`${Q}.final`,$),zM(F,`${Q}.binary`,$),pq(J,`${Q}.objectMode`)},zM=(D,F,J)=>{if(D!==void 0)throw TypeError(`The \`${F}\` option can only be defined when using a generator, not a ${J}.`)},dp=({transform:D,final:F,binary:J,objectMode:Q},$)=>{if(D!==void 0&&!CM(D))throw TypeError(`The \`${$}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(vq(F,{checkOpen:!1}))throw TypeError(`The \`${$}.final\` option must not be a Duplex stream.`);if(cq(F))throw TypeError(`The \`${$}.final\` option must not be a web TransformStream.`);if(F!==void 0&&!CM(F))throw TypeError(`The \`${$}.final\` option must be a generator.`);return pq(J,`${$}.binary`),pq(Q,`${$}.objectMode`),hF(D)||hF(F)?"asyncGenerator":"generator"},pq=(D,F)=>{if(D!==void 0&&typeof D!=="boolean")throw TypeError(`The \`${F}\` option must use a boolean.`)},CM=(D)=>hF(D)||EM(D),hF=(D)=>Object.prototype.toString.call(D)==="[object AsyncGeneratorFunction]",EM=(D)=>Object.prototype.toString.call(D)==="[object GeneratorFunction]",pp=(D)=>uD(D)&&(D.transform!==void 0||D.final!==void 0),DQ=(D)=>Object.prototype.toString.call(D)==="[object URL]",RM=(D)=>DQ(D)&&D.protocol!=="file:",lp=(D)=>uD(D)&&Object.keys(D).length>0&&Object.keys(D).every((F)=>cp.has(F))&&lq(D.file),cp=new Set(["file","append"]),lq=(D)=>typeof D==="string",AM=(D,F)=>D==="native"&&typeof F==="string"&&!np.has(F),np=new Set(["ipc","ignore","inherit","overlapped","pipe"]),wM=(D)=>Object.prototype.toString.call(D)==="[object ReadableStream]",FQ=(D)=>Object.prototype.toString.call(D)==="[object WritableStream]",ip=(D)=>wM(D)||FQ(D),cq=(D)=>wM(D?.readable)&&FQ(D?.writable),op=(D)=>IM(D)&&typeof D[Symbol.asyncIterator]==="function",ap=(D)=>IM(D)&&typeof D[Symbol.iterator]==="function",IM=(D)=>typeof D==="object"&&D!==null,H8=new Set(["generator","asyncGenerator","duplex","webTransform"]),JQ=new Set(["fileUrl","filePath","fileNumber"]),nq=new Set(["fileUrl","filePath"]),NM=new Set([...nq,"webStream","nodeStream"]),TM=new Set(["webTransform","duplex"]),k1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var iq=(D,F,J,Q)=>Q==="output"?rp(D,F,J):sp(D,F,J),rp=(D,F,J)=>{let Q=F!==0&&J[F-1].value.readableObjectMode;return{writableObjectMode:Q,readableObjectMode:D??Q}},sp=(D,F,J)=>{let Q=F===0?D===!0:J[F-1].value.readableObjectMode,$=F!==J.length-1&&(D??Q);return{writableObjectMode:Q,readableObjectMode:$}},LM=(D,F)=>{let J=D.findLast(({type:Q})=>H8.has(Q));if(J===void 0)return!1;return F==="input"?J.value.writableObjectMode:J.value.readableObjectMode};var PM=(D,F,J,Q)=>[...D.filter(({type:$})=>!H8.has($)),...tp(D,F,J,Q)],tp=(D,F,J,{encoding:Q})=>{let $=D.filter(({type:X})=>H8.has(X)),Z=Array.from({length:$.length});for(let[X,Y]of Object.entries($))Z[X]=ep({stdioItem:Y,index:Number(X),newTransforms:Z,optionName:F,direction:J,encoding:Q});return Ql(Z,J)},ep=({stdioItem:D,stdioItem:{type:F},index:J,newTransforms:Q,optionName:$,direction:Z,encoding:X})=>{if(F==="duplex")return Dl({stdioItem:D,optionName:$});if(F==="webTransform")return Fl({stdioItem:D,index:J,newTransforms:Q,direction:Z});return Jl({stdioItem:D,index:J,newTransforms:Q,direction:Z,encoding:X})},Dl=({stdioItem:D,stdioItem:{value:{transform:F,transform:{writableObjectMode:J,readableObjectMode:Q},objectMode:$=Q}},optionName:Z})=>{if($&&!Q)throw TypeError(`The \`${Z}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!$&&Q)throw TypeError(`The \`${Z}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...D,value:{transform:F,writableObjectMode:J,readableObjectMode:Q}}},Fl=({stdioItem:D,stdioItem:{value:F},index:J,newTransforms:Q,direction:$})=>{let{transform:Z,objectMode:X}=uD(F)?F:{transform:F},{writableObjectMode:Y,readableObjectMode:q}=iq(X,J,Q,$);return{...D,value:{transform:Z,writableObjectMode:Y,readableObjectMode:q}}},Jl=({stdioItem:D,stdioItem:{value:F},index:J,newTransforms:Q,direction:$,encoding:Z})=>{let{transform:X,final:Y,binary:q=!1,preserveNewlines:G=!1,objectMode:W}=uD(F)?F:{transform:F},B=q||J8.has(Z),{writableObjectMode:K,readableObjectMode:U}=iq(W,J,Q,$);return{...D,value:{transform:X,final:Y,binary:B,preserveNewlines:G,writableObjectMode:K,readableObjectMode:U}}},Ql=(D,F)=>F==="input"?D.reverse():D;import oq from"node:process";var jM=(D,F,J)=>{let Q=D.map(($)=>$l($,F));if(Q.includes("input")&&Q.includes("output"))throw TypeError(`The \`${J}\` option must not be an array of both readable and writable values.`);return Q.find(Boolean)??Yl},$l=({type:D,value:F},J)=>Zl[J]??SM[D](F),Zl=["input","output","output"],G6=()=>{return},aq=()=>"input",SM={generator:G6,asyncGenerator:G6,fileUrl:G6,filePath:G6,iterable:aq,asyncIterable:aq,uint8Array:aq,webStream:(D)=>FQ(D)?"output":"input",nodeStream(D){if(!fF(D,{checkOpen:!1}))return"output";return bq(D,{checkOpen:!1})?void 0:"input"},webTransform:G6,duplex:G6,native(D){let F=Xl(D);if(F!==void 0)return F;if(f8(D,{checkOpen:!1}))return SM.nodeStream(D)}},Xl=(D)=>{if([0,oq.stdin].includes(D))return"input";if([1,2,oq.stdout,oq.stderr].includes(D))return"output"},Yl="output";var xM=(D,F)=>F&&!D.includes("ipc")?[...D,"ipc"]:D;var kM=({stdio:D,ipc:F,buffer:J,...Q},$,Z)=>{let X=ql(D,Q).map((Y,q)=>yM(Y,q));return Z?Wl(X,J,$):xM(X,F)},ql=(D,F)=>{if(D===void 0)return U8.map((Q)=>F[Q]);if(Gl(F))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${U8.map((Q)=>`\`${Q}\``).join(", ")}`);if(typeof D==="string")return[D,D,D];if(!Array.isArray(D))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof D}\``);let J=Math.max(D.length,U8.length);return Array.from({length:J},(Q,$)=>D[$])},Gl=(D)=>U8.some((F)=>D[F]!==void 0),yM=(D,F)=>{if(Array.isArray(D))return D.map((J)=>yM(J,F));if(D===null||D===void 0)return F>=U8.length?"ignore":"pipe";return D},Wl=(D,F,J)=>D.map((Q,$)=>!F[$]&&$!==0&&!e3(J,$)&&Bl(Q)?"ignore":Q),Bl=(D)=>D==="pipe"||Array.isArray(D)&&D.every((F)=>F==="pipe");import{readFileSync as Kl}from"node:fs";import Ul from"node:tty";var hM=({stdioItem:D,stdioItem:{type:F},isStdioArray:J,fdNumber:Q,direction:$,isSync:Z})=>{if(!J||F!=="native")return D;return Z?Vl({stdioItem:D,fdNumber:Q,direction:$}):Cl({stdioItem:D,fdNumber:Q})},Vl=({stdioItem:D,stdioItem:{value:F,optionName:J},fdNumber:Q,direction:$})=>{let Z=Hl({value:F,optionName:J,fdNumber:Q,direction:$});if(Z!==void 0)return Z;if(f8(F,{checkOpen:!1}))throw TypeError(`The \`${J}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return D},Hl=({value:D,optionName:F,fdNumber:J,direction:Q})=>{let $=zl(D,J);if($===void 0)return;if(Q==="output")return{type:"fileNumber",value:$,optionName:F};if(Ul.isatty($))throw TypeError(`The \`${F}: ${SJ(D)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:n2(Kl($)),optionName:F}},zl=(D,F)=>{if(D==="inherit")return F;if(typeof D==="number")return D;let J=UJ.indexOf(D);if(J!==-1)return J},Cl=({stdioItem:D,stdioItem:{value:F,optionName:J},fdNumber:Q})=>{if(F==="inherit")return{type:"nodeStream",value:fM(Q,F,J),optionName:J};if(typeof F==="number")return{type:"nodeStream",value:fM(F,F,J),optionName:J};if(f8(F,{checkOpen:!1}))return{type:"nodeStream",value:F,optionName:J};return D},fM=(D,F,J)=>{let Q=UJ[D];if(Q===void 0)throw TypeError(`The \`${J}: ${F}\` option is invalid: no such standard stream.`);return Q};var bM=({input:D,inputFile:F},J)=>J===0?[..._l(D),...Ml(F)]:[],_l=(D)=>D===void 0?[]:[{type:Ol(D),value:D,optionName:"input"}],Ol=(D)=>{if(fF(D,{checkOpen:!1}))return"nodeStream";if(typeof D==="string")return"string";if(tD(D))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Ml=(D)=>D===void 0?[]:[{...El(D),optionName:"inputFile"}],El=(D)=>{if(DQ(D))return{type:"fileUrl",value:D};if(lq(D))return{type:"filePath",value:{file:D}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var vM=(D)=>D.filter((F,J)=>D.every((Q,$)=>F.value!==Q.value||J>=$||F.type==="generator"||F.type==="asyncGenerator")),uM=({stdioItem:{type:D,value:F,optionName:J},direction:Q,fileDescriptors:$,isSync:Z})=>{let X=Rl($,D);if(X.length===0)return;if(Z){Al({otherStdioItems:X,type:D,value:F,optionName:J,direction:Q});return}if(NM.has(D))return gM({otherStdioItems:X,type:D,value:F,optionName:J,direction:Q});if(TM.has(D))Il({otherStdioItems:X,type:D,value:F,optionName:J})},Rl=(D,F)=>D.flatMap(({direction:J,stdioItems:Q})=>Q.filter(($)=>$.type===F).map(($)=>({...$,direction:J}))),Al=({otherStdioItems:D,type:F,value:J,optionName:Q,direction:$})=>{if(nq.has(F))gM({otherStdioItems:D,type:F,value:J,optionName:Q,direction:$})},gM=({otherStdioItems:D,type:F,value:J,optionName:Q,direction:$})=>{let Z=D.filter((Y)=>wl(Y,J));if(Z.length===0)return;let X=Z.find((Y)=>Y.direction!==$);return mM(X,Q,F),$==="output"?Z[0].stream:void 0},wl=({type:D,value:F},J)=>{if(D==="filePath")return F.file===J.file;if(D==="fileUrl")return F.href===J.href;return F===J},Il=({otherStdioItems:D,type:F,value:J,optionName:Q})=>{let $=D.find(({value:{transform:Z}})=>Z===J.transform);mM($,Q,F)},mM=(D,F,J)=>{if(D!==void 0)throw TypeError(`The \`${D.optionName}\` and \`${F}\` options must not target ${k1[J]} that is the same.`)};var QQ=(D,F,J,Q)=>{let Z=kM(F,J,Q).map((Y,q)=>Nl({stdioOption:Y,fdNumber:q,options:F,isSync:Q})),X=yl({initialFileDescriptors:Z,addProperties:D,options:F,isSync:Q});return F.stdio=X.map(({stdioItems:Y})=>bl(Y)),X},Nl=({stdioOption:D,fdNumber:F,options:J,isSync:Q})=>{let $=VJ(F),{stdioItems:Z,isStdioArray:X}=Tl({stdioOption:D,fdNumber:F,options:J,optionName:$}),Y=jM(Z,F,$),q=Z.map((B)=>hM({stdioItem:B,isStdioArray:X,fdNumber:F,direction:Y,isSync:Q})),G=PM(q,$,Y,J),W=LM(G,Y);return kl(G,W),{direction:Y,objectMode:W,stdioItems:G}},Tl=({stdioOption:D,fdNumber:F,options:J,optionName:Q})=>{let Z=[...(Array.isArray(D)?D:[D]).map((q)=>Ll(q,Q)),...bM(J,F)],X=vM(Z),Y=X.length>1;return Pl(X,Y,Q),Sl(X),{stdioItems:X,isStdioArray:Y}},Ll=(D,F)=>({type:_M(D,F),value:D,optionName:F}),Pl=(D,F,J)=>{if(D.length===0)throw TypeError(`The \`${J}\` option must not be an empty array.`);if(!F)return;for(let{value:Q,optionName:$}of D)if(jl.has(Q))throw Error(`The \`${$}\` option must not include \`${Q}\`.`)},jl=new Set(["ignore","ipc"]),Sl=(D)=>{for(let F of D)xl(F)},xl=({type:D,value:F,optionName:J})=>{if(RM(F))throw TypeError(`The \`${J}: URL\` option must use the \`file:\` scheme.
|
|
274
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(AM(D,F))throw TypeError(`The \`${J}: { file: '...' }\` option must be used instead of \`${J}: '...'\`.`)},kl=(D,F)=>{if(!F)return;let J=D.find(({type:Q})=>JQ.has(Q));if(J!==void 0)throw TypeError(`The \`${J.optionName}\` option cannot use both files and transforms in objectMode.`)},yl=({initialFileDescriptors:D,addProperties:F,options:J,isSync:Q})=>{let $=[];try{for(let Z of D)$.push(fl({fileDescriptor:Z,fileDescriptors:$,addProperties:F,options:J,isSync:Q}));return $}catch(Z){throw rq($),Z}},fl=({fileDescriptor:{direction:D,objectMode:F,stdioItems:J},fileDescriptors:Q,addProperties:$,options:Z,isSync:X})=>{let Y=J.map((q)=>hl({stdioItem:q,addProperties:$,direction:D,options:Z,fileDescriptors:Q,isSync:X}));return{direction:D,objectMode:F,stdioItems:Y}},hl=({stdioItem:D,addProperties:F,direction:J,options:Q,fileDescriptors:$,isSync:Z})=>{let X=uM({stdioItem:D,direction:J,fileDescriptors:$,isSync:Z});if(X!==void 0)return{...D,stream:X};return{...D,...F[J][D.type](D,Q)}},rq=(D)=>{for(let{stdioItems:F}of D)for(let{stream:J}of F)if(J!==void 0&&!k8(J))J.destroy()},bl=(D)=>{if(D.length>1)return D.some(({value:Q})=>Q==="overlapped")?"overlapped":"pipe";let[{type:F,value:J}]=D;return F==="native"?J:"pipe"};var lM=(D,F)=>QQ(ul,D,F,!0),G2=({type:D,optionName:F})=>{cM(F,k1[D])},vl=({optionName:D,value:F})=>{if(F==="ipc"||F==="overlapped")cM(D,`"${F}"`);return{}},cM=(D,F)=>{throw TypeError(`The \`${D}\` option cannot be ${F} with synchronous methods.`)},pM={generator(){},asyncGenerator:G2,webStream:G2,nodeStream:G2,webTransform:G2,duplex:G2,asyncIterable:G2,native:vl},ul={input:{...pM,fileUrl:({value:D})=>({contents:[n2(dM(D))]}),filePath:({value:{file:D}})=>({contents:[n2(dM(D))]}),fileNumber:G2,iterable:({value:D})=>({contents:[...D]}),string:({value:D})=>({contents:[D]}),uint8Array:({value:D})=>({contents:[D]})},output:{...pM,fileUrl:({value:D})=>({path:D}),filePath:({value:{file:D,append:F}})=>({path:D,append:F}),fileNumber:({value:D})=>({path:D}),iterable:G2,string:G2,uint8Array:G2}};var r2=(D,{stripFinalNewline:F},J)=>sq(F,J)&&D!==void 0&&!Array.isArray(D)?Z6(D):D,sq=(D,F)=>F==="all"?D[1]||D[2]:D[F];import{Transform as Xc,getDefaultHighWaterMark as JE}from"node:stream";var $Q=(D,F,J,Q)=>D||J?void 0:iM(F,Q),eq=(D,F,J)=>J?D.flatMap((Q)=>nM(Q,F)):nM(D,F),nM=(D,F)=>{let{transform:J,final:Q}=iM(F,{});return[...J(D),...Q()]},iM=(D,F)=>{return F.previousChunks="",{transform:gl.bind(void 0,F,D),final:dl.bind(void 0,F)}},gl=function*(D,F,J){if(typeof J!=="string"){yield J;return}let{previousChunks:Q}=D,$=-1;for(let Z=0;Z<J.length;Z+=1)if(J[Z]===`
|
|
275
|
+
`){let X=ml(J,Z,F,D),Y=J.slice($+1,Z+1-X);if(Q.length>0)Y=tq(Q,Y),Q="";yield Y,$=Z}if($!==J.length-1)Q=tq(Q,J.slice($+1));D.previousChunks=Q},ml=(D,F,J,Q)=>{if(J)return 0;return Q.isWindowsNewline=F!==0&&D[F-1]==="\r",Q.isWindowsNewline?2:1},dl=function*({previousChunks:D}){if(D.length>0)yield D},oM=({binary:D,preserveNewlines:F,readableObjectMode:J,state:Q})=>D||F||J?void 0:{transform:pl.bind(void 0,Q)},pl=function*({isWindowsNewline:D=!1},F){let{unixNewline:J,windowsNewline:Q,LF:$,concatBytes:Z}=typeof F==="string"?ll:nl;if(F.at(-1)===$){yield F;return}yield Z(F,D?Q:J)},tq=(D,F)=>`${D}${F}`,ll={windowsNewline:`\r
|
|
276
|
+
`,unixNewline:`
|
|
277
|
+
`,LF:`
|
|
278
|
+
`,concatBytes:tq},cl=(D,F)=>{let J=new Uint8Array(D.length+F.length);return J.set(D,0),J.set(F,D.length),J},nl={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:cl};import{Buffer as il}from"node:buffer";var aM=(D,F)=>D?void 0:ol.bind(void 0,F),ol=function*(D,F){if(typeof F!=="string"&&!tD(F)&&!il.isBuffer(F))throw TypeError(`The \`${D}\` option's transform must use "objectMode: true" to receive as input: ${typeof F}.`);yield F},rM=(D,F)=>D?al.bind(void 0,F):rl.bind(void 0,F),al=function*(D,F){sM(D,F),yield F},rl=function*(D,F){if(sM(D,F),typeof F!=="string"&&!tD(F))throw TypeError(`The \`${D}\` option's function must yield a string or an Uint8Array, not ${typeof F}.`);yield F},sM=(D,F)=>{if(F===null||F===void 0)throw TypeError(`The \`${D}\` option's function must not call \`yield ${F}\`.
|
|
279
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
280
|
+
if (condition) { yield value; }`)};import{Buffer as sl}from"node:buffer";import{StringDecoder as tl}from"node:string_decoder";var ZQ=(D,F,J)=>{if(J)return;if(D)return{transform:el.bind(void 0,new TextEncoder)};let Q=new tl(F);return{transform:Dc.bind(void 0,Q),final:Fc.bind(void 0,Q)}},el=function*(D,F){if(sl.isBuffer(F))yield n2(F);else if(typeof F==="string")yield D.encode(F);else yield F},Dc=function*(D,F){yield tD(F)?D.write(F):F},Fc=function*(D){let F=D.end();if(F!=="")yield F};import{callbackify as tM}from"node:util";var DG=tM(async(D,F,J,Q)=>{F.currentIterable=D(...J);try{for await(let $ of F.currentIterable)Q.push($)}finally{delete F.currentIterable}}),XQ=async function*(D,F,J){if(J===F.length){yield D;return}let{transform:Q=Qc}=F[J];for await(let $ of Q(D))yield*XQ($,F,J+1)},eM=async function*(D){for(let[F,{final:J}]of Object.entries(D))yield*Jc(J,Number(F),D)},Jc=async function*(D,F,J){if(D===void 0)return;for await(let Q of D())yield*XQ(Q,J,F+1)},DE=tM(async({currentIterable:D},F)=>{if(D!==void 0){await(F?D.throw(F):D.return());return}if(F)throw F}),Qc=function*(D){yield D};var FG=(D,F,J,Q)=>{try{for(let $ of D(...F))J.push($);Q()}catch($){Q($)}},FE=(D,F)=>[...F.flatMap((J)=>[...bF(J,D,0)]),...S9(D)],bF=function*(D,F,J){if(J===F.length){yield D;return}let{transform:Q=Zc}=F[J];for(let $ of Q(D))yield*bF($,F,J+1)},S9=function*(D){for(let[F,{final:J}]of Object.entries(D))yield*$c(J,Number(F),D)},$c=function*(D,F,J){if(D===void 0)return;for(let Q of D())yield*bF(Q,J,F+1)},Zc=function*(D){yield D};var JG=({value:D,value:{transform:F,final:J,writableObjectMode:Q,readableObjectMode:$},optionName:Z},{encoding:X})=>{let Y={},q=QE(D,X,Z),G=hF(F),W=hF(J),B=G?DG.bind(void 0,XQ,Y):FG.bind(void 0,bF),K=G||W?DG.bind(void 0,eM,Y):FG.bind(void 0,S9),U=G||W?DE.bind(void 0,Y):void 0;return{stream:new Xc({writableObjectMode:Q,writableHighWaterMark:JE(Q),readableObjectMode:$,readableHighWaterMark:JE($),transform(H,z,_){B([H,q,0],this,_)},flush(H){K([q],this,H)},destroy:U})}},YQ=(D,F,J,Q)=>{let $=F.filter(({type:X})=>X==="generator"),Z=Q?$.reverse():$;for(let{value:X,optionName:Y}of Z){let q=QE(X,J,Y);D=FE(q,D)}return D},QE=({transform:D,final:F,binary:J,writableObjectMode:Q,readableObjectMode:$,preserveNewlines:Z},X,Y)=>{let q={};return[{transform:aM(Q,Y)},ZQ(J,X,Q),$Q(J,Z,Q,q),{transform:D,final:F},{transform:rM($,Y)},oM({binary:J,preserveNewlines:Z,readableObjectMode:$,state:q})].filter(Boolean)};var $E=(D,F)=>{for(let J of Yc(D))qc(D,J,F)},Yc=(D)=>new Set(Object.entries(D).filter(([,{direction:F}])=>F==="input").map(([F])=>Number(F))),qc=(D,F,J)=>{let{stdioItems:Q}=D[F],$=Q.filter(({contents:Y})=>Y!==void 0);if($.length===0)return;if(F!==0){let[{type:Y,optionName:q}]=$;throw TypeError(`Only the \`stdin\` option, not \`${q}\`, can be ${k1[Y]} with synchronous methods.`)}let X=$.map(({contents:Y})=>Y).map((Y)=>Gc(Y,Q));J.input=R9(X)},Gc=(D,F)=>{let J=YQ(D,F,"utf8",!0);return Wc(J),R9(J)},Wc=(D)=>{let F=D.find((J)=>typeof J!=="string"&&!tD(J));if(F!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${F}.`)};import{writeFileSync as Vc,appendFileSync as Hc}from"node:fs";var qQ=({stdioItems:D,encoding:F,verboseInfo:J,fdNumber:Q})=>Q!=="all"&&e3(J,Q)&&!J8.has(F)&&Bc(Q)&&(D.some(({type:$,value:Z})=>$==="native"&&Kc.has(Z))||D.every(({type:$})=>H8.has($))),Bc=(D)=>D===1||D===2,Kc=new Set(["pipe","overlapped"]),ZE=async(D,F,J,Q)=>{for await(let $ of D)if(!Uc(F))YE($,J,Q)},XE=(D,F,J)=>{for(let Q of D)YE(Q,F,J)},Uc=(D)=>D._readableState.pipes.length>0,YE=(D,F,J)=>{let Q=MJ(D);Z2({type:"output",verboseMessage:Q,fdNumber:F,verboseInfo:J})};var qE=({fileDescriptors:D,syncResult:{output:F},options:J,isMaxBuffer:Q,verboseInfo:$})=>{if(F===null)return{output:Array.from({length:3})};let Z={},X=new Set([]);return{output:F.map((q,G)=>zc({result:q,fileDescriptors:D,fdNumber:G,state:Z,outputFiles:X,isMaxBuffer:Q,verboseInfo:$},J)),...Z}},zc=({result:D,fileDescriptors:F,fdNumber:J,state:Q,outputFiles:$,isMaxBuffer:Z,verboseInfo:X},{buffer:Y,encoding:q,lines:G,stripFinalNewline:W,maxBuffer:B})=>{if(D===null)return;let K=GM(D,Z,B),U=n2(K),{stdioItems:V,objectMode:H}=F[J],z=Cc([U],V,q,Q),{serializedResult:_,finalResult:M=_}=_c({chunks:z,objectMode:H,encoding:q,lines:G,stripFinalNewline:W,fdNumber:J});Oc({serializedResult:_,fdNumber:J,state:Q,verboseInfo:X,encoding:q,stdioItems:V,objectMode:H});let C=Y[J]?M:void 0;try{if(Q.error===void 0)Mc(_,V,$);return C}catch(O){return Q.error=O,C}},Cc=(D,F,J,Q)=>{try{return YQ(D,F,J,!1)}catch($){return Q.error=$,D}},_c=({chunks:D,objectMode:F,encoding:J,lines:Q,stripFinalNewline:$,fdNumber:Z})=>{if(F)return{serializedResult:D};if(J==="buffer")return{serializedResult:R9(D)};let X=OC(D,J);if(Q[Z])return{serializedResult:X,finalResult:eq(X,!$[Z],F)};return{serializedResult:X}},Oc=({serializedResult:D,fdNumber:F,state:J,verboseInfo:Q,encoding:$,stdioItems:Z,objectMode:X})=>{if(!qQ({stdioItems:Z,encoding:$,verboseInfo:Q,fdNumber:F}))return;let Y=eq(D,!1,X);try{XE(Y,F,Q)}catch(q){J.error??=q}},Mc=(D,F,J)=>{for(let{path:Q,append:$}of F.filter(({type:Z})=>JQ.has(Z))){let Z=typeof Q==="string"?Q:Q.toString();if($||J.has(Z))Hc(Q,D);else J.add(Z),Vc(Q,D)}};var GE=([,D,F],J)=>{if(!J.all)return;if(D===void 0)return F;if(F===void 0)return D;if(Array.isArray(D))return Array.isArray(F)?[...D,...F]:[...D,r2(F,J,"all")];if(Array.isArray(F))return[r2(D,J,"all"),...F];if(tD(D)&&tD(F))return Gq([D,F]);return`${D}${F}`};import{once as QG}from"node:events";var WE=async(D,F)=>{let[J,Q]=await Ec(D);return F.isForcefullyTerminated??=!1,[J,Q]},Ec=async(D)=>{let[F,J]=await Promise.allSettled([QG(D,"spawn"),QG(D,"exit")]);if(F.status==="rejected")return[];return J.status==="rejected"?BE(D):J.value},BE=async(D)=>{try{return await QG(D,"exit")}catch{return BE(D)}},KE=async(D)=>{let[F,J]=await D;if(!Rc(F,J)&&$G(F,J))throw new X2;return[F,J]},Rc=(D,F)=>D===void 0&&F===void 0,$G=(D,F)=>D!==0||F!==null;var UE=({error:D,status:F,signal:J,output:Q},{maxBuffer:$})=>{let Z=Ac(D,F,J),X=Z?.code==="ETIMEDOUT",Y=qM(Z,Q,$);return{resultError:Z,exitCode:F,signal:J,timedOut:X,isMaxBuffer:Y}},Ac=(D,F,J)=>{if(D!==void 0)return D;return $G(F,J)?new X2:void 0};var VE=(D,F,J)=>{let{file:Q,commandArguments:$,command:Z,escapedCommand:X,startTime:Y,verboseInfo:q,options:G,fileDescriptors:W}=Ic(D,F,J),B=Lc({file:Q,commandArguments:$,options:G,command:Z,escapedCommand:X,verboseInfo:q,fileDescriptors:W,startTime:Y});return q6(B,q,G)},Ic=(D,F,J)=>{let{command:Q,escapedCommand:$,startTime:Z,verboseInfo:X}=RJ(D,F,J),Y=Nc(J),{file:q,commandArguments:G,options:W}=pJ(D,F,Y);Tc(W);let B=lM(W,X);return{file:q,commandArguments:G,command:Q,escapedCommand:$,startTime:Z,verboseInfo:X,options:W,fileDescriptors:B}},Nc=(D)=>D.node&&!D.ipc?{...D,ipc:!1}:D,Tc=({ipc:D,ipcInput:F,detached:J,cancelSignal:Q})=>{if(F)GQ("ipcInput");if(D)GQ("ipc: true");if(J)GQ("detached: true");if(Q)GQ("cancelSignal")},GQ=(D)=>{throw TypeError(`The "${D}" option cannot be used with synchronous methods.`)},Lc=({file:D,commandArguments:F,options:J,command:Q,escapedCommand:$,verboseInfo:Z,fileDescriptors:X,startTime:Y})=>{let q=Pc({file:D,commandArguments:F,options:J,command:Q,escapedCommand:$,fileDescriptors:X,startTime:Y});if(q.failed)return q;let{resultError:G,exitCode:W,signal:B,timedOut:K,isMaxBuffer:U}=UE(q,J),{output:V,error:H=G}=qE({fileDescriptors:X,syncResult:q,options:J,isMaxBuffer:U,verboseInfo:Z}),z=V.map((M,C)=>r2(M,J,C)),_=r2(GE(V,J),J,"all");return Sc({error:H,exitCode:W,signal:B,timedOut:K,isMaxBuffer:U,stdio:z,all:_,options:J,command:Q,escapedCommand:$,startTime:Y})},Pc=({file:D,commandArguments:F,options:J,command:Q,escapedCommand:$,fileDescriptors:Z,startTime:X})=>{try{$E(Z,J);let Y=jc(J);return wc(...lJ(D,F,Y))}catch(Y){return Y6({error:Y,command:Q,escapedCommand:$,fileDescriptors:Z,options:J,startTime:X,isSync:!0})}},jc=({encoding:D,maxBuffer:F,...J})=>({...J,encoding:"buffer",maxBuffer:tJ(F)}),Sc=({error:D,exitCode:F,signal:J,timedOut:Q,isMaxBuffer:$,stdio:Z,all:X,options:Y,command:q,escapedCommand:G,startTime:W})=>D===void 0?eJ({command:q,escapedCommand:G,stdio:Z,all:X,ipcOutput:[],options:Y,startTime:W}):j9({error:D,command:q,escapedCommand:G,timedOut:Q,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:$,isForcefullyTerminated:!1,exitCode:F,signal:J,stdio:Z,all:X,ipcOutput:[],options:Y,startTime:W,isSync:!0});import{setMaxListeners as Oi}from"node:events";import{spawn as Mi}from"node:child_process";import OE from"node:process";import{once as ZG,on as xc}from"node:events";var HE=({anyProcess:D,channel:F,isSubprocess:J,ipc:Q},{reference:$=!0,filter:Z}={})=>{return J6({methodName:"getOneMessage",isSubprocess:J,ipc:Q,isConnected:bJ(D)}),kc({anyProcess:D,channel:F,isSubprocess:J,filter:Z,reference:$})},kc=async({anyProcess:D,channel:F,isSubprocess:J,filter:Q,reference:$})=>{kJ(F,$);let Z=x1(D,F,J),X=new AbortController;try{return await Promise.race([yc(Z,Q,X),fc(Z,J,X),hc(Z,J,X)])}catch(Y){throw Q6(D),Y}finally{X.abort(),yJ(F,$)}},yc=async(D,F,{signal:J})=>{if(F===void 0){let[Q]=await ZG(D,"message",{signal:J});return Q}for await(let[Q]of xc(D,"message",{signal:J}))if(F(Q))return Q},fc=async(D,F,{signal:J})=>{await ZG(D,"disconnect",{signal:J}),DO(F)},hc=async(D,F,{signal:J})=>{let[Q]=await ZG(D,"strict:error",{signal:J});throw jJ(Q,F)};import{once as CE,on as bc}from"node:events";var _E=({anyProcess:D,channel:F,isSubprocess:J,ipc:Q},{reference:$=!0}={})=>XG({anyProcess:D,channel:F,isSubprocess:J,ipc:Q,shouldAwait:!J,reference:$}),XG=({anyProcess:D,channel:F,isSubprocess:J,ipc:Q,shouldAwait:$,reference:Z})=>{J6({methodName:"getEachMessage",isSubprocess:J,ipc:Q,isConnected:bJ(D)}),kJ(F,Z);let X=x1(D,F,J),Y=new AbortController,q={};return vc(D,X,Y),uc({ipcEmitter:X,isSubprocess:J,controller:Y,state:q}),gc({anyProcess:D,channel:F,ipcEmitter:X,isSubprocess:J,shouldAwait:$,controller:Y,state:q,reference:Z})},vc=async(D,F,J)=>{try{await CE(F,"disconnect",{signal:J.signal}),J.abort()}catch{}},uc=async({ipcEmitter:D,isSubprocess:F,controller:J,state:Q})=>{try{let[$]=await CE(D,"strict:error",{signal:J.signal});Q.error=jJ($,F),J.abort()}catch{}},gc=async function*({anyProcess:D,channel:F,ipcEmitter:J,isSubprocess:Q,shouldAwait:$,controller:Z,state:X,reference:Y}){try{for await(let[q]of bc(J,"message",{signal:Z.signal}))zE(X),yield q}catch{zE(X)}finally{if(Z.abort(),yJ(F,Y),!Q)Q6(D);if($)await D}},zE=({error:D})=>{if(D)throw D};var ME=(D,{ipc:F})=>{Object.assign(D,RE(D,!1,F))},EE=()=>{let D=OE,F=!0,J=OE.channel!==void 0;return{...RE(D,!0,J),getCancelSignal:TO.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:!0,ipc:J})}},RE=(D,F,J)=>({sendMessage:mJ.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:J}),getOneMessage:HE.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:J}),getEachMessage:_E.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:J})});import{ChildProcess as mc}from"node:child_process";import{PassThrough as dc,Readable as pc,Writable as lc,Duplex as cc}from"node:stream";var AE=({error:D,command:F,escapedCommand:J,fileDescriptors:Q,options:$,startTime:Z,verboseInfo:X})=>{rq(Q);let Y=new mc;nc(Y,Q),Object.assign(Y,{readable:ic,writable:oc,duplex:ac});let q=Y6({error:D,command:F,escapedCommand:J,fileDescriptors:Q,options:$,startTime:Z,isSync:!1}),G=rc(q,X,$);return{subprocess:Y,promise:G}},nc=(D,F)=>{let J=x9(),Q=x9(),$=x9(),Z=Array.from({length:F.length-3},x9),X=x9(),Y=[J,Q,$,...Z];Object.assign(D,{stdin:J,stdout:Q,stderr:$,all:X,stdio:Y})},x9=()=>{let D=new dc;return D.end(),D},ic=()=>new pc({read(){}}),oc=()=>new lc({write(){}}),ac=()=>new cc({read(){},write(){}}),rc=async(D,F,J)=>q6(D,F,J);import{createReadStream as wE,createWriteStream as IE}from"node:fs";import{Buffer as sc}from"node:buffer";import{Readable as k9,Writable as tc,Duplex as ec}from"node:stream";var TE=(D,F)=>QQ(Dn,D,F,!1),y9=({type:D,optionName:F})=>{throw TypeError(`The \`${F}\` option cannot be ${k1[D]}.`)},NE={fileNumber:y9,generator:JG,asyncGenerator:JG,nodeStream:({value:D})=>({stream:D}),webTransform({value:{transform:D,writableObjectMode:F,readableObjectMode:J}}){let Q=F||J;return{stream:ec.fromWeb(D,{objectMode:Q})}},duplex:({value:{transform:D}})=>({stream:D}),native(){}},Dn={input:{...NE,fileUrl:({value:D})=>({stream:wE(D)}),filePath:({value:{file:D}})=>({stream:wE(D)}),webStream:({value:D})=>({stream:k9.fromWeb(D)}),iterable:({value:D})=>({stream:k9.from(D)}),asyncIterable:({value:D})=>({stream:k9.from(D)}),string:({value:D})=>({stream:k9.from(D)}),uint8Array:({value:D})=>({stream:k9.from(sc.from(D))})},output:{...NE,fileUrl:({value:D})=>({stream:IE(D)}),filePath:({value:{file:D,append:F}})=>({stream:IE(D,F?{flags:"a"}:{})}),webStream:({value:D})=>({stream:tc.fromWeb(D)}),iterable:y9,asyncIterable:y9,string:y9,uint8Array:y9}};import{on as Fn,once as LE}from"node:events";import{PassThrough as Jn,getDefaultHighWaterMark as Qn}from"node:stream";import{finished as SE}from"node:stream/promises";function vF(D){if(!Array.isArray(D))throw TypeError(`Expected an array, got \`${typeof D}\`.`);for(let $ of D)YG($);let F=D.some(({readableObjectMode:$})=>$),J=$n(D,F),Q=new xE({objectMode:F,writableHighWaterMark:J,readableHighWaterMark:J});for(let $ of D)Q.add($);return Q}var $n=(D,F)=>{if(D.length===0)return Qn(F);let J=D.filter(({readableObjectMode:Q})=>Q===F).map(({readableHighWaterMark:Q})=>Q);return Math.max(...J)};class xE extends Jn{#F=new Set([]);#J=new Set([]);#D=new Set([]);#Q;#Y=Symbol("unpipe");#X=new WeakMap;add(D){if(YG(D),this.#F.has(D))return;this.#F.add(D),this.#Q??=Zn(this,this.#F,this.#Y);let F=qn({passThroughStream:this,stream:D,streams:this.#F,ended:this.#J,aborted:this.#D,onFinished:this.#Q,unpipeEvent:this.#Y});this.#X.set(D,F),D.pipe(this,{end:!1})}async remove(D){if(YG(D),!this.#F.has(D))return!1;let F=this.#X.get(D);if(F===void 0)return!1;return this.#X.delete(D),D.unpipe(this),await F,!0}}var Zn=async(D,F,J)=>{WQ(D,PE);let Q=new AbortController;try{await Promise.race([Xn(D,Q),Yn(D,F,J,Q)])}finally{Q.abort(),WQ(D,-PE)}},Xn=async(D,{signal:F})=>{try{await SE(D,{signal:F,cleanup:!0})}catch(J){throw kE(D,J),J}},Yn=async(D,F,J,{signal:Q})=>{for await(let[$]of Fn(D,"unpipe",{signal:Q}))if(F.has($))$.emit(J)},YG=(D)=>{if(typeof D?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof D}\`.`)},qn=async({passThroughStream:D,stream:F,streams:J,ended:Q,aborted:$,onFinished:Z,unpipeEvent:X})=>{WQ(D,jE);let Y=new AbortController;try{await Promise.race([Gn(Z,F,Y),Wn({passThroughStream:D,stream:F,streams:J,ended:Q,aborted:$,controller:Y}),Bn({stream:F,streams:J,ended:Q,aborted:$,unpipeEvent:X,controller:Y})])}finally{Y.abort(),WQ(D,-jE)}if(J.size>0&&J.size===Q.size+$.size)if(Q.size===0&&$.size>0)qG(D);else Kn(D)},Gn=async(D,F,{signal:J})=>{try{if(await D,!J.aborted)qG(F)}catch(Q){if(!J.aborted)kE(F,Q)}},Wn=async({passThroughStream:D,stream:F,streams:J,ended:Q,aborted:$,controller:{signal:Z}})=>{try{if(await SE(F,{signal:Z,cleanup:!0,readable:!0,writable:!1}),J.has(F))Q.add(F)}catch(X){if(Z.aborted||!J.has(F))return;if(yE(X))$.add(F);else fE(D,X)}},Bn=async({stream:D,streams:F,ended:J,aborted:Q,unpipeEvent:$,controller:{signal:Z}})=>{if(await LE(D,$,{signal:Z}),!D.readable)return LE(Z,"abort",{signal:Z});F.delete(D),J.delete(D),Q.delete(D)},Kn=(D)=>{if(D.writable)D.end()},kE=(D,F)=>{if(yE(F))qG(D);else fE(D,F)},yE=(D)=>D?.code==="ERR_STREAM_PREMATURE_CLOSE",qG=(D)=>{if(D.readable||D.writable)D.destroy()},fE=(D,F)=>{if(!D.destroyed)D.once("error",Un),D.destroy(F)},Un=()=>{},WQ=(D,F)=>{let J=D.getMaxListeners();if(J!==0&&J!==Number.POSITIVE_INFINITY)D.setMaxListeners(J+F)},PE=2,jE=1;import{finished as hE}from"node:stream/promises";var W6=(D,F)=>{D.pipe(F),Vn(D,F),Hn(D,F)},Vn=async(D,F)=>{if(k8(D)||k8(F))return;try{await hE(D,{cleanup:!0,readable:!0,writable:!1})}catch{}GG(F)},GG=(D)=>{if(D.writable)D.end()},Hn=async(D,F)=>{if(k8(D)||k8(F))return;try{await hE(F,{cleanup:!0,readable:!1,writable:!0})}catch{}WG(D)},WG=(D)=>{if(D.readable)D.destroy()};var bE=(D,F,J)=>{let Q=new Map;for(let[$,{stdioItems:Z,direction:X}]of Object.entries(F)){for(let{stream:Y}of Z.filter(({type:q})=>H8.has(q)))zn(D,Y,X,$);for(let{stream:Y}of Z.filter(({type:q})=>!H8.has(q)))_n({subprocess:D,stream:Y,direction:X,fdNumber:$,pipeGroups:Q,controller:J})}for(let[$,Z]of Q.entries()){let X=Z.length===1?Z[0]:vF(Z);W6(X,$)}},zn=(D,F,J,Q)=>{if(J==="output")W6(D.stdio[Q],F);else W6(F,D.stdio[Q]);let $=Cn[Q];if($!==void 0)D[$]=F;D.stdio[Q]=F},Cn=["stdin","stdout","stderr"],_n=({subprocess:D,stream:F,direction:J,fdNumber:Q,pipeGroups:$,controller:Z})=>{if(F===void 0)return;On(F,Z);let[X,Y]=J==="output"?[F,D.stdio[Q]]:[D.stdio[Q],F],q=$.get(X)??[];$.set(X,[...q,Y])},On=(D,{signal:F})=>{if(k8(D))yF(D,Mn,F)},Mn=2;KQ();import{addAbortListener as An}from"node:events";var dE=(D,{cleanup:F,detached:J},{signal:Q})=>{if(!F||J)return;let $=B6(()=>{D.kill()});An(Q,()=>{$()})};var lE=({source:D,sourcePromise:F,boundOptions:J,createNested:Q},...$)=>{let Z=EJ(),{destination:X,destinationStream:Y,destinationError:q,from:G,unpipeSignal:W}=wn(J,Q,$),{sourceStream:B,sourceError:K}=Nn(D,G),{options:U,fileDescriptors:V}=q2.get(D);return{sourcePromise:F,sourceStream:B,sourceOptions:U,sourceError:K,destination:X,destinationStream:Y,destinationError:q,unpipeSignal:W,fileDescriptors:V,startTime:Z}},wn=(D,F,J)=>{try{let{destination:Q,pipeOptions:{from:$,to:Z,unpipeSignal:X}={}}=In(D,F,...J),Y=xJ(Q,Z);return{destination:Q,destinationStream:Y,from:$,unpipeSignal:X}}catch(Q){return{destinationError:Q}}},In=(D,F,J,...Q)=>{if(Array.isArray(J))return{destination:F(pE,D)(J,...Q),pipeOptions:D};if(typeof J==="string"||J instanceof URL||Yq(J)){if(Object.keys(D).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[$,Z,X]=BJ(J,...Q);return{destination:F(pE)($,Z,X),pipeOptions:X}}if(q2.has(J)){if(Object.keys(D).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:J,pipeOptions:Q[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${J}`)},pE=({options:D})=>({options:{...D,stdin:"pipe",piped:!0}}),Nn=(D,F)=>{try{return{sourceStream:$6(D,F)}}catch(J){return{sourceError:J}}};var nE=({sourceStream:D,sourceError:F,destinationStream:J,destinationError:Q,fileDescriptors:$,sourceOptions:Z,startTime:X})=>{let Y=Tn({sourceStream:D,sourceError:F,destinationStream:J,destinationError:Q});if(Y!==void 0)throw HG({error:Y,fileDescriptors:$,sourceOptions:Z,startTime:X})},Tn=({sourceStream:D,sourceError:F,destinationStream:J,destinationError:Q})=>{if(F!==void 0&&Q!==void 0)return Q;if(Q!==void 0)return WG(D),Q;if(F!==void 0)return GG(J),F},HG=({error:D,fileDescriptors:F,sourceOptions:J,startTime:Q})=>Y6({error:D,command:cE,escapedCommand:cE,fileDescriptors:F,options:J,startTime:Q,isSync:!1}),cE="source.pipe(destination)";var iE=async(D)=>{let[{status:F,reason:J,value:Q=J},{status:$,reason:Z,value:X=Z}]=await D;if(!X.pipedFrom.includes(Q))X.pipedFrom.push(Q);if($==="rejected")throw X;if(F==="rejected")throw Q;return X};import{finished as Ln}from"node:stream/promises";var oE=(D,F,J)=>{let Q=UQ.has(F)?jn(D,F):Pn(D,F);return yF(D,xn,J.signal),yF(F,kn,J.signal),Sn(F),Q},Pn=(D,F)=>{let J=vF([D]);return W6(J,F),UQ.set(F,J),J},jn=(D,F)=>{let J=UQ.get(F);return J.add(D),J},Sn=async(D)=>{try{await Ln(D,{cleanup:!0,readable:!1,writable:!0})}catch{}UQ.delete(D)},UQ=new WeakMap,xn=2,kn=1;import{aborted as yn}from"node:util";var aE=(D,F)=>D===void 0?[]:[fn(D,F)],fn=async(D,{sourceStream:F,mergedStream:J,fileDescriptors:Q,sourceOptions:$,startTime:Z})=>{await yn(D,F),await J.remove(F);let X=Error("Pipe canceled by `unpipeSignal` option.");throw HG({error:X,fileDescriptors:Q,sourceOptions:$,startTime:Z})};var VQ=(D,...F)=>{if(uD(F[0]))return VQ.bind(void 0,{...D,boundOptions:{...D.boundOptions,...F[0]}});let{destination:J,...Q}=lE(D,...F),$=hn({...Q,destination:J});return $.pipe=VQ.bind(void 0,{...D,source:J,sourcePromise:$,boundOptions:{}}),$},hn=async({sourcePromise:D,sourceStream:F,sourceOptions:J,sourceError:Q,destination:$,destinationStream:Z,destinationError:X,unpipeSignal:Y,fileDescriptors:q,startTime:G})=>{let W=bn(D,$);nE({sourceStream:F,sourceError:Q,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:J,startTime:G});let B=new AbortController;try{let K=oE(F,Z,B);return await Promise.race([iE(W),...aE(Y,{sourceStream:F,mergedStream:K,sourceOptions:J,fileDescriptors:q,startTime:G})])}finally{B.abort()}},bn=(D,F)=>Promise.allSettled([D,F]);import{setImmediate as ln}from"node:timers/promises";import{on as vn}from"node:events";import{getDefaultHighWaterMark as un}from"node:stream";var HQ=({subprocessStdout:D,subprocess:F,binary:J,shouldEncode:Q,encoding:$,preserveNewlines:Z})=>{let X=new AbortController;return gn(F,X),sE({stream:D,controller:X,binary:J,shouldEncode:!D.readableObjectMode&&Q,encoding:$,shouldSplit:!D.readableObjectMode,preserveNewlines:Z})},gn=async(D,F)=>{try{await D}catch{}finally{F.abort()}},zG=({stream:D,onStreamEnd:F,lines:J,encoding:Q,stripFinalNewline:$,allMixed:Z})=>{let X=new AbortController;mn(F,X,D);let Y=D.readableObjectMode&&!Z;return sE({stream:D,controller:X,binary:Q==="buffer",shouldEncode:!Y,encoding:Q,shouldSplit:!Y&&J,preserveNewlines:!$})},mn=async(D,F,J)=>{try{await D}catch{J.destroy()}finally{F.abort()}},sE=({stream:D,controller:F,binary:J,shouldEncode:Q,encoding:$,shouldSplit:Z,preserveNewlines:X})=>{let Y=vn(D,"data",{signal:F.signal,highWaterMark:rE,highWatermark:rE});return dn({onStdoutChunk:Y,controller:F,binary:J,shouldEncode:Q,encoding:$,shouldSplit:Z,preserveNewlines:X})},CG=un(!0),rE=CG,dn=async function*({onStdoutChunk:D,controller:F,binary:J,shouldEncode:Q,encoding:$,shouldSplit:Z,preserveNewlines:X}){let Y=pn({binary:J,shouldEncode:Q,encoding:$,shouldSplit:Z,preserveNewlines:X});try{for await(let[q]of D)yield*bF(q,Y,0)}catch(q){if(!F.signal.aborted)throw q}finally{yield*S9(Y)}},pn=({binary:D,shouldEncode:F,encoding:J,shouldSplit:Q,preserveNewlines:$})=>[ZQ(D,J,!F),$Q(D,$,!Q,{})].filter(Boolean);var tE=async({stream:D,onStreamEnd:F,fdNumber:J,encoding:Q,buffer:$,maxBuffer:Z,lines:X,allMixed:Y,stripFinalNewline:q,verboseInfo:G,streamInfo:W})=>{let B=cn({stream:D,onStreamEnd:F,fdNumber:J,encoding:Q,allMixed:Y,verboseInfo:G,streamInfo:W});if(!$){await Promise.all([nn(D),B]);return}let K=sq(q,J),U=zG({stream:D,onStreamEnd:F,lines:X,encoding:Q,stripFinalNewline:K,allMixed:Y}),[V]=await Promise.all([on({stream:D,iterable:U,fdNumber:J,encoding:Q,maxBuffer:Z,lines:X}),B]);return V},cn=async({stream:D,onStreamEnd:F,fdNumber:J,encoding:Q,allMixed:$,verboseInfo:Z,streamInfo:{fileDescriptors:X}})=>{if(!qQ({stdioItems:X[J]?.stdioItems,encoding:Q,verboseInfo:Z,fdNumber:J}))return;let Y=zG({stream:D,onStreamEnd:F,lines:!0,encoding:Q,stripFinalNewline:!0,allMixed:$});await ZE(Y,D,J,Z)},nn=async(D)=>{if(await ln(),D.readableFlowing===null)D.resume()},on=async({stream:D,stream:{readableObjectMode:F},iterable:J,fdNumber:Q,encoding:$,maxBuffer:Z,lines:X})=>{try{if(F||X)return await oJ(J,{maxBuffer:Z});if($==="buffer")return new Uint8Array(await aJ(J,{maxBuffer:Z}));return await sJ(J,{maxBuffer:Z})}catch(Y){return eE(ZM({error:Y,stream:D,readableObjectMode:F,lines:X,encoding:$,fdNumber:Q}))}},_G=async(D)=>{try{return await D}catch(F){return eE(F)}},eE=({bufferedData:D})=>CC(D)?new Uint8Array(D):D;import{finished as an}from"node:stream/promises";var f9=async(D,F,J,{isSameDirection:Q,stopOnExit:$=!1}={})=>{let Z=rn(D,J),X=new AbortController;try{await Promise.race([...$?[J.exitPromise]:[],an(D,{cleanup:!0,signal:X.signal})])}catch(Y){if(!Z.stdinCleanedUp)en(Y,F,J,Q)}finally{X.abort()}},rn=(D,{originalStreams:[F],subprocess:J})=>{let Q={stdinCleanedUp:!1};if(D===F)sn(D,J,Q);return Q},sn=(D,F,J)=>{let{_destroy:Q}=D;D._destroy=(...$)=>{tn(F,J),Q.call(D,...$)}},tn=({exitCode:D,signalCode:F},J)=>{if(D!==null||F!==null)J.stdinCleanedUp=!0},en=(D,F,J,Q)=>{if(!Di(D,F,J,Q))throw D},Di=(D,F,J,Q=!0)=>{if(J.propagating)return DR(D)||zQ(D);return J.propagating=!0,OG(J,F)===Q?DR(D):zQ(D)},OG=({fileDescriptors:D},F)=>F!=="all"&&D[F].direction==="input",zQ=(D)=>D?.code==="ERR_STREAM_PREMATURE_CLOSE",DR=(D)=>D?.code==="EPIPE";var FR=({subprocess:D,encoding:F,buffer:J,maxBuffer:Q,lines:$,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})=>D.stdio.map((q,G)=>MG({stream:q,fdNumber:G,encoding:F,buffer:J[G],maxBuffer:Q[G],lines:$[G],allMixed:!1,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})),MG=async({stream:D,fdNumber:F,encoding:J,buffer:Q,maxBuffer:$,lines:Z,allMixed:X,stripFinalNewline:Y,verboseInfo:q,streamInfo:G})=>{if(!D)return;let W=f9(D,F,G);if(OG(G,F)){await W;return}let[B]=await Promise.all([tE({stream:D,onStreamEnd:W,fdNumber:F,encoding:J,buffer:Q,maxBuffer:$,lines:Z,allMixed:X,stripFinalNewline:Y,verboseInfo:q,streamInfo:G}),W]);return B};var JR=({stdout:D,stderr:F},{all:J})=>J&&(D||F)?vF([D,F].filter(Boolean)):void 0,QR=({subprocess:D,encoding:F,buffer:J,maxBuffer:Q,lines:$,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})=>MG({...Fi(D,J),fdNumber:"all",encoding:F,maxBuffer:Q[1]+Q[2],lines:$[1]||$[2],allMixed:Ji(D),stripFinalNewline:Z,verboseInfo:X,streamInfo:Y}),Fi=({stdout:D,stderr:F,all:J},[,Q,$])=>{let Z=Q||$;if(!Z)return{stream:J,buffer:Z};if(!Q)return{stream:F,buffer:Z};if(!$)return{stream:D,buffer:Z};return{stream:J,buffer:Z}},Ji=({all:D,stdout:F,stderr:J})=>D&&F&&J&&F.readableObjectMode!==J.readableObjectMode;import{once as Qi}from"node:events";var $R=(D)=>e3(D,"ipc"),ZR=(D,F)=>{let J=MJ(D);Z2({type:"ipc",verboseMessage:J,fdNumber:"ipc",verboseInfo:F})};var XR=async({subprocess:D,buffer:F,maxBuffer:J,ipc:Q,ipcOutput:$,verboseInfo:Z})=>{if(!Q)return $;let X=$R(Z),Y=i2(F,"ipc"),q=i2(J,"ipc");for await(let G of XG({anyProcess:D,channel:D.channel,isSubprocess:!1,ipc:Q,shouldAwait:!1,reference:!0})){if(Y)XM(D,$,q),$.push(G);if(X)ZR(G,Z)}return $},YR=async(D,F)=>{return await Promise.allSettled([D]),F};var qR=async({subprocess:D,options:{encoding:F,buffer:J,maxBuffer:Q,lines:$,timeoutDuration:Z,cancelSignal:X,gracefulCancel:Y,forceKillAfterDelay:q,stripFinalNewline:G,ipc:W,ipcInput:B},context:K,verboseInfo:U,fileDescriptors:V,originalStreams:H,onInternalError:z,controller:_})=>{let M=WE(D,K),C={originalStreams:H,fileDescriptors:V,subprocess:D,exitPromise:M,propagating:!1},O=FR({subprocess:D,encoding:F,buffer:J,maxBuffer:Q,lines:$,stripFinalNewline:G,verboseInfo:U,streamInfo:C}),E=QR({subprocess:D,encoding:F,buffer:J,maxBuffer:Q,lines:$,stripFinalNewline:G,verboseInfo:U,streamInfo:C}),A=[],N=XR({subprocess:D,buffer:J,maxBuffer:Q,ipc:W,ipcOutput:A,verboseInfo:U}),w=$i(H,D,C),T=Zi(V,C);try{return await Promise.race([Promise.all([{},KE(M),Promise.all(O),E,N,bO(D,B),...w,...T]),z,Xi(D,_),...xO(D,Z,K,_),...e_({subprocess:D,cancelSignal:X,gracefulCancel:Y,context:K,controller:_}),...jO({subprocess:D,cancelSignal:X,gracefulCancel:Y,forceKillAfterDelay:q,context:K,controller:_})])}catch(I){return K.terminationReason??="other",Promise.all([{error:I},M,Promise.all(O.map((S)=>_G(S))),_G(E),YR(N,A),Promise.allSettled(w),Promise.allSettled(T)])}},$i=(D,F,J)=>D.map((Q,$)=>Q===F.stdio[$]?void 0:f9(Q,$,J)),Zi=(D,F)=>D.flatMap(({stdioItems:J},Q)=>J.filter(({value:$,stream:Z=$})=>f8(Z,{checkOpen:!1})&&!k8(Z)).map(({type:$,value:Z,stream:X=Z})=>f9(X,Q,F,{isSameDirection:H8.has($),stopOnExit:$==="native"}))),Xi=async(D,{signal:F})=>{let[J]=await Qi(D,"error",{signal:F});throw J};var GR=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),h9=(D,F,J)=>{let Q=D[J];if(!Q.has(F))Q.set(F,[]);let $=Q.get(F),Z=Y2();return $.push(Z),{resolve:Z.resolve.bind(Z),promises:$}},K6=async({resolve:D,promises:F},J)=>{D();let[Q]=await Promise.race([Promise.allSettled([!0,J]),Promise.all([!1,...F])]);return!Q};import{Readable as Yi}from"node:stream";import{callbackify as qi}from"node:util";import{finished as WR}from"node:stream/promises";var EG=async(D)=>{if(D===void 0)return;try{await RG(D)}catch{}},BR=async(D)=>{if(D===void 0)return;try{await AG(D)}catch{}},RG=async(D)=>{await WR(D,{cleanup:!0,readable:!1,writable:!0})},AG=async(D)=>{await WR(D,{cleanup:!0,readable:!0,writable:!1})},CQ=async(D,F)=>{if(await D,F)throw F},_Q=(D,F,J)=>{if(J&&!zQ(J))D.destroy(J);else if(F)D.destroy()};var KR=({subprocess:D,concurrentStreams:F,encoding:J},{from:Q,binary:$=!0,preserveNewlines:Z=!0}={})=>{let X=$||J8.has(J),{subprocessStdout:Y,waitReadableDestroy:q}=wG(D,Q,F),{readableEncoding:G,readableObjectMode:W,readableHighWaterMark:B}=IG(Y,X),{read:K,onStdoutDataDone:U}=NG({subprocessStdout:Y,subprocess:D,binary:X,encoding:J,preserveNewlines:Z}),V=new Yi({read:K,destroy:qi(LG.bind(void 0,{subprocessStdout:Y,subprocess:D,waitReadableDestroy:q})),highWaterMark:B,objectMode:W,encoding:G});return TG({subprocessStdout:Y,onStdoutDataDone:U,readable:V,subprocess:D}),V},wG=(D,F,J)=>{let Q=$6(D,F),$=h9(J,Q,"readableDestroy");return{subprocessStdout:Q,waitReadableDestroy:$}},IG=({readableEncoding:D,readableObjectMode:F,readableHighWaterMark:J},Q)=>Q?{readableEncoding:D,readableObjectMode:F,readableHighWaterMark:J}:{readableEncoding:D,readableObjectMode:!0,readableHighWaterMark:CG},NG=({subprocessStdout:D,subprocess:F,binary:J,encoding:Q,preserveNewlines:$})=>{let Z=Y2(),X=HQ({subprocessStdout:D,subprocess:F,binary:J,shouldEncode:!J,encoding:Q,preserveNewlines:$});return{read(){Gi(this,X,Z)},onStdoutDataDone:Z}},Gi=async(D,F,J)=>{try{let{value:Q,done:$}=await F.next();if($)J.resolve();else D.push(Q)}catch{}},TG=async({subprocessStdout:D,onStdoutDataDone:F,readable:J,subprocess:Q,subprocessStdin:$})=>{try{if(await AG(D),await Q,await EG($),await F,J.readable)J.push(null)}catch(Z){await EG($),UR(J,Z)}},LG=async({subprocessStdout:D,subprocess:F,waitReadableDestroy:J},Q)=>{if(await K6(J,F))UR(D,Q),await CQ(F,Q)},UR=(D,F)=>{_Q(D,D.readable,F)};import{Writable as Wi}from"node:stream";import{callbackify as VR}from"node:util";var HR=({subprocess:D,concurrentStreams:F},{to:J}={})=>{let{subprocessStdin:Q,waitWritableFinal:$,waitWritableDestroy:Z}=PG(D,J,F),X=new Wi({...jG(Q,D,$),destroy:VR(xG.bind(void 0,{subprocessStdin:Q,subprocess:D,waitWritableFinal:$,waitWritableDestroy:Z})),highWaterMark:Q.writableHighWaterMark,objectMode:Q.writableObjectMode});return SG(Q,X),X},PG=(D,F,J)=>{let Q=xJ(D,F),$=h9(J,Q,"writableFinal"),Z=h9(J,Q,"writableDestroy");return{subprocessStdin:Q,waitWritableFinal:$,waitWritableDestroy:Z}},jG=(D,F,J)=>({write:Bi.bind(void 0,D),final:VR(Ki.bind(void 0,D,F,J))}),Bi=(D,F,J,Q)=>{if(D.write(F,J))Q();else D.once("drain",Q)},Ki=async(D,F,J)=>{if(await K6(J,F)){if(D.writable)D.end();await F}},SG=async(D,F,J)=>{try{if(await RG(D),F.writable)F.end()}catch(Q){await BR(J),zR(F,Q)}},xG=async({subprocessStdin:D,subprocess:F,waitWritableFinal:J,waitWritableDestroy:Q},$)=>{if(await K6(J,F),await K6(Q,F))zR(D,$),await CQ(F,$)},zR=(D,F)=>{_Q(D,D.writable,F)};import{Duplex as Ui}from"node:stream";import{callbackify as Vi}from"node:util";var CR=({subprocess:D,concurrentStreams:F,encoding:J},{from:Q,to:$,binary:Z=!0,preserveNewlines:X=!0}={})=>{let Y=Z||J8.has(J),{subprocessStdout:q,waitReadableDestroy:G}=wG(D,Q,F),{subprocessStdin:W,waitWritableFinal:B,waitWritableDestroy:K}=PG(D,$,F),{readableEncoding:U,readableObjectMode:V,readableHighWaterMark:H}=IG(q,Y),{read:z,onStdoutDataDone:_}=NG({subprocessStdout:q,subprocess:D,binary:Y,encoding:J,preserveNewlines:X}),M=new Ui({read:z,...jG(W,D,B),destroy:Vi(Hi.bind(void 0,{subprocessStdout:q,subprocessStdin:W,subprocess:D,waitReadableDestroy:G,waitWritableFinal:B,waitWritableDestroy:K})),readableHighWaterMark:H,writableHighWaterMark:W.writableHighWaterMark,readableObjectMode:V,writableObjectMode:W.writableObjectMode,encoding:U});return TG({subprocessStdout:q,onStdoutDataDone:_,readable:M,subprocess:D,subprocessStdin:W}),SG(W,M,q),M},Hi=async({subprocessStdout:D,subprocessStdin:F,subprocess:J,waitReadableDestroy:Q,waitWritableFinal:$,waitWritableDestroy:Z},X)=>{await Promise.all([LG({subprocessStdout:D,subprocess:J,waitReadableDestroy:Q},X),xG({subprocessStdin:F,subprocess:J,waitWritableFinal:$,waitWritableDestroy:Z},X)])};var kG=(D,F,{from:J,binary:Q=!1,preserveNewlines:$=!1}={})=>{let Z=Q||J8.has(F),X=$6(D,J),Y=HQ({subprocessStdout:X,subprocess:D,binary:Z,shouldEncode:!0,encoding:F,preserveNewlines:$});return zi(Y,X,D)},zi=async function*(D,F,J){try{yield*D}finally{if(F.readable)F.destroy();await J}};var _R=(D,{encoding:F})=>{let J=GR();D.readable=KR.bind(void 0,{subprocess:D,concurrentStreams:J,encoding:F}),D.writable=HR.bind(void 0,{subprocess:D,concurrentStreams:J}),D.duplex=CR.bind(void 0,{subprocess:D,concurrentStreams:J,encoding:F}),D.iterable=kG.bind(void 0,D,F),D[Symbol.asyncIterator]=kG.bind(void 0,D,F,{})};var OR=(D,F)=>{for(let[J,Q]of _i){let $=Q.value.bind(F);Reflect.defineProperty(D,J,{...Q,value:$})}},Ci=(async()=>{})().constructor.prototype,_i=["then","catch","finally"].map((D)=>[D,Reflect.getOwnPropertyDescriptor(Ci,D)]);var MR=(D,F,J,Q)=>{let{file:$,commandArguments:Z,command:X,escapedCommand:Y,startTime:q,verboseInfo:G,options:W,fileDescriptors:B}=Ei(D,F,J),{subprocess:K,promise:U}=Ai({file:$,commandArguments:Z,options:W,startTime:q,verboseInfo:G,command:X,escapedCommand:Y,fileDescriptors:B});return K.pipe=VQ.bind(void 0,{source:K,sourcePromise:U,boundOptions:{},createNested:Q}),OR(K,U),q2.set(K,{options:W,fileDescriptors:B}),K},Ei=(D,F,J)=>{let{command:Q,escapedCommand:$,startTime:Z,verboseInfo:X}=RJ(D,F,J),{file:Y,commandArguments:q,options:G}=pJ(D,F,J),W=Ri(G),B=TE(W,X);return{file:Y,commandArguments:q,command:Q,escapedCommand:$,startTime:Z,verboseInfo:X,options:W,fileDescriptors:B}},Ri=({timeout:D,signal:F,...J})=>{if(F!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...J,timeoutDuration:D}},Ai=({file:D,commandArguments:F,options:J,startTime:Q,verboseInfo:$,command:Z,escapedCommand:X,fileDescriptors:Y})=>{let q;try{q=Mi(...lJ(D,F,J))}catch(V){return AE({error:V,command:Z,escapedCommand:X,fileDescriptors:Y,options:J,startTime:Q,verboseInfo:$})}let G=new AbortController;Oi(Number.POSITIVE_INFINITY,G.signal);let W=[...q.stdio];bE(q,Y,G),dE(q,J,G);let B={},K=Y2();q.kill=s_.bind(void 0,{kill:q.kill.bind(q),options:J,onInternalError:K,context:B,controller:G}),q.all=JR(q,J),_R(q,J),ME(q,J);let U=wi({subprocess:q,options:J,startTime:Q,verboseInfo:$,fileDescriptors:Y,originalStreams:W,command:Z,escapedCommand:X,context:B,onInternalError:K,controller:G});return{subprocess:q,promise:U}},wi=async({subprocess:D,options:F,startTime:J,verboseInfo:Q,fileDescriptors:$,originalStreams:Z,command:X,escapedCommand:Y,context:q,onInternalError:G,controller:W})=>{let[B,[K,U],V,H,z]=await qR({subprocess:D,options:F,context:q,verboseInfo:Q,fileDescriptors:$,originalStreams:Z,onInternalError:G,controller:W});W.abort(),G.resolve();let _=V.map((O,E)=>r2(O,F,E)),M=r2(H,F,"all"),C=Ii({errorInfo:B,exitCode:K,signal:U,stdio:_,all:M,ipcOutput:z,context:q,options:F,command:X,escapedCommand:Y,startTime:J});return q6(C,Q,F)},Ii=({errorInfo:D,exitCode:F,signal:J,stdio:Q,all:$,ipcOutput:Z,context:X,options:Y,command:q,escapedCommand:G,startTime:W})=>("error"in D)?j9({error:D.error,command:q,escapedCommand:G,timedOut:X.terminationReason==="timeout",isCanceled:X.terminationReason==="cancel"||X.terminationReason==="gracefulCancel",isGracefullyCanceled:X.terminationReason==="gracefulCancel",isMaxBuffer:D.error instanceof o2,isForcefullyTerminated:X.isForcefullyTerminated,exitCode:F,signal:J,stdio:Q,all:$,ipcOutput:Z,options:Y,startTime:W,isSync:!1}):eJ({command:q,escapedCommand:G,stdio:Q,all:$,ipcOutput:Z,options:Y,startTime:W});var OQ=(D,F)=>{let J=Object.fromEntries(Object.entries(F).map(([Q,$])=>[Q,Ni(Q,D[Q],$)]));return{...D,...J}},Ni=(D,F,J)=>{if(Ti.has(D)&&uD(F)&&uD(J))return{...F,...J};return J},Ti=new Set(["env",...Uq]);var y1=(D,F,J,Q)=>{let $=(X,Y,q)=>y1(X,Y,J,q),Z=(...X)=>Li({mapArguments:D,deepOptions:J,boundOptions:F,setBoundExeca:Q,createNested:$},...X);if(Q!==void 0)Q(Z,$,F);return Z},Li=({mapArguments:D,deepOptions:F={},boundOptions:J={},setBoundExeca:Q,createNested:$},Z,...X)=>{if(uD(Z))return $(D,OQ(J,Z),Q);let{file:Y,commandArguments:q,options:G,isSync:W}=Pi({mapArguments:D,firstArgument:Z,nextArguments:X,deepOptions:F,boundOptions:J});return W?VE(Y,q,G):MR(Y,q,G,$)},Pi=({mapArguments:D,firstArgument:F,nextArguments:J,deepOptions:Q,boundOptions:$})=>{let Z=AC(F)?wC(F,J):[F,...J],[X,Y,q]=BJ(...Z),G=OQ(OQ(Q,$),q),{file:W=X,commandArguments:B=Y,options:K=G,isSync:U=!1}=D({file:X,commandArguments:Y,options:G});return{file:W,commandArguments:B,options:K,isSync:U}};var ER=({file:D,commandArguments:F})=>AR(D,F),RR=({file:D,commandArguments:F})=>({...AR(D,F),isSync:!0}),AR=(D,F)=>{if(F.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${D} ${F}.`);let[J,...Q]=ji(D);return{file:J,commandArguments:Q}},ji=(D)=>{if(typeof D!=="string")throw TypeError(`The command must be a string: ${String(D)}.`);let F=D.trim();if(F==="")return[];let J=[];for(let Q of F.split(Si)){let $=J.at(-1);if($&&$.endsWith("\\"))J[J.length-1]=`${$.slice(0,-1)} ${Q}`;else J.push(Q)}return J},Si=/ +/g;var wR=(D,F,J)=>{D.sync=F(xi,J),D.s=D.sync},IR=({options:D})=>NR(D),xi=({options:D})=>({...NR(D),isSync:!0}),NR=(D)=>({options:{...ki(D),...D}}),ki=({input:D,inputFile:F,stdio:J})=>D===void 0&&F===void 0&&J===void 0?{stdin:"inherit"}:{},TR={preferLocal:!0};var ND=y1(()=>({})),I_D=y1(()=>({isSync:!0})),N_D=y1(ER),T_D=y1(RR),L_D=y1(yO),P_D=y1(IR,{},TR,wR),{sendMessage:j_D,getOneMessage:S_D,getEachMessage:x_D,getCancelSignal:k_D}=EE();import pX from"node:fs";import Dk from"node:path";C6();function f(D,F,J){let Q=D[F.name];if(typeof Q==="function")return Q;let $=D[J];if(typeof $==="function")return $;return(Z)=>F(D,Z)}gD();s();class JW extends P{constructor(D){super(`Filter type "${D}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}B0();g8();r9();_2();t2();g1();var fA="/docs/contract/encodeEventTopics";function M2(D){let{abi:F,eventName:J,args:Q}=D,$=F[0];if(J){let q=l0({abi:F,name:J});if(!q)throw new mQ(J,{docsPath:fA});$=q}if($.type!=="event")throw new mQ(void 0,{docsPath:fA});let Z=eD($),X=u1(Z),Y=[];if(Q&&"inputs"in $){let q=$.inputs?.filter((W)=>("indexed"in W)&&W.indexed),G=Array.isArray(Q)?Q:Object.values(Q).length>0?q?.map((W)=>Q[W.name])??[]:[];if(G.length>0)Y=q?.map((W,B)=>{if(Array.isArray(G[B]))return G[B].map((K,U)=>hA({param:W,value:G[B][U]}));return typeof G[B]<"u"&&G[B]!==null?hA({param:W,value:G[B]}):null})??[]}return[X,...Y]}function hA({param:D,value:F}){if(D.type==="string"||D.type==="bytes")return MD(C8(F));if(D.type==="tuple"||D.type.match(/^(.*)\[(\d+)?\]$/))throw new JW(D.type);return iD([D],[F])}c();function m1(D,{method:F}){let J={};if(D.transport.type==="fallback")D.transport.onResponse?.(({method:Q,response:$,status:Z,transport:X})=>{if(Z==="success"&&F===Q)J[$]=X.request});return(Q)=>J[Q]||D.request}async function $$(D,F){let{address:J,abi:Q,args:$,eventName:Z,fromBlock:X,strict:Y,toBlock:q}=F,G=m1(D,{method:"eth_newFilter"}),W=Z?M2({abi:Q,args:$,eventName:Z}):void 0,B=await D.request({method:"eth_newFilter",params:[{address:J,fromBlock:typeof X==="bigint"?k(X):X,toBlock:typeof q==="bigint"?k(q):q,topics:W}]});return{abi:Q,args:$,eventName:Z,id:B,request:G(B),strict:Boolean(Y),type:"event"}}X8();gD();s();Z1();tF();p6();var fo=3;function Y8(D,{abi:F,address:J,args:Q,docsPath:$,functionName:Z,sender:X}){let Y=D instanceof w2?D:D instanceof P?D.walk((V)=>("data"in V))||D.walk():{},{code:q,data:G,details:W,message:B,shortMessage:K}=Y,U=(()=>{if(D instanceof b8)return new B$({functionName:Z});if([fo,X1.code].includes(q)&&(G||W||B||K)||q===_8.code&&W==="execution reverted"&&G)return new A2({abi:F,data:typeof G==="object"?G.data:G,functionName:Z,message:Y instanceof sF?W:K??B});return D})();return new w6(U,{abi:F,args:Q,contractAddress:J,docsPath:$,functionName:Z,sender:X})}s();Q1();g8();function eA(D){let F=MD(`0x${D.substring(4)}`).substring(26);return H2(`0x${F}`)}z8();D0();c();async function dw({hash:D,signature:F}){let J=e(D)?D:cD(D),{secp256k1:Q}=await Promise.resolve().then(() => (M$(),gw));return`0x${(()=>{if(typeof F==="object"&&"r"in F&&"s"in F){let{r:G,s:W,v:B,yParity:K}=F,U=Number(K??B),V=mw(U);return new Q.Signature(kD(G),kD(W)).addRecoveryBit(V)}let X=e(F)?F:cD(F);if(GD(X)!==65)throw Error("invalid signature length");let Y=OD(`0x${X.slice(130)}`),q=mw(Y);return Q.Signature.fromCompact(X.substring(2,130)).addRecoveryBit(q)})().recoverPublicKey(J.substring(2)).toHex(!1)}`}function mw(D){if(D===0||D===1)return D;if(D===27)return 0;if(D===28)return 1;throw Error("Invalid yParityOrV value")}async function E$({hash:D,signature:F}){return eA(await dw({hash:D,signature:F}))}B0();c();s();q$();B0();c();function pw(D,F="hex"){let J=lw(D),Q=O6(new Uint8Array(J.length));if(J.encode(Q),F==="hex")return BD(Q.bytes);return Q.bytes}function lw(D){if(Array.isArray(D))return Ka(D.map((F)=>lw(F)));return Ua(D)}function Ka(D){let F=D.reduce(($,Z)=>$+Z.length,0),J=cw(F);return{length:(()=>{if(F<=55)return 1+F;return 1+J+F})(),encode($){if(F<=55)$.pushByte(192+F);else if($.pushByte(247+J),J===1)$.pushUint8(F);else if(J===2)$.pushUint16(F);else if(J===3)$.pushUint24(F);else $.pushUint32(F);for(let{encode:Z}of D)Z($)}}}function Ua(D){let F=typeof D==="string"?W0(D):D,J=cw(F.length);return{length:(()=>{if(F.length===1&&F[0]<128)return 1;if(F.length<=55)return 1+F.length;return 1+J+F.length})(),encode($){if(F.length===1&&F[0]<128)$.pushBytes(F);else if(F.length<=55)$.pushByte(128+F.length),$.pushBytes(F);else{if($.pushByte(183+J),J===1)$.pushUint8(F.length);else if(J===2)$.pushUint16(F.length);else if(J===3)$.pushUint24(F.length);else $.pushUint32(F.length);$.pushBytes(F)}}}}function cw(D){if(D<256)return 1;if(D<65536)return 2;if(D<16777216)return 3;if(D<4294967296)return 4;throw new P("Length is too large.")}g8();function nw(D){let{chainId:F,nonce:J,to:Q}=D,$=D.contractAddress??D.address,Z=MD(m8(["0x05",pw([F?k(F):"0x",$,J?k(J):"0x"])]));if(Q==="bytes")return W0(Z);return Z}async function a1(D){let{authorization:F,signature:J}=D;return E$({hash:nw(F),signature:J??F})}c();W$();R6();s();R2();class XB extends P{constructor(D,{account:F,docsPath:J,chain:Q,data:$,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:W,value:B}){let K=aF({from:F?.address,to:W,value:typeof B<"u"&&`${E6(B)} ${Q?.nativeCurrency?.symbol||"ETH"}`,data:$,gas:Z,gasPrice:typeof X<"u"&&`${F0(X)} gwei`,maxFeePerGas:typeof Y<"u"&&`${F0(Y)} gwei`,maxPriorityFeePerGas:typeof q<"u"&&`${F0(q)} gwei`,nonce:G});super(D.shortMessage,{cause:D,docsPath:J,metaMessages:[...D.metaMessages?[...D.metaMessages," "]:[],"Estimate Gas Arguments:",K].filter(Boolean),name:"EstimateGasExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=D}}Y3();M4();function iw(D,{docsPath:F,...J}){let Q=(()=>{let $=s1(D,J);if($ instanceof c8)return D;return $})();return new XB(Q,{docsPath:F,...J})}N2();R$();T2();R6();s();class E4 extends P{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class q3 extends P{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class YB extends P{constructor({maxPriorityFeePerGas:D}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${F0(D)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}D0();s();class R4 extends P{constructor({blockHash:D,blockNumber:F}){let J="Block";if(D)J=`Block at hash "${D}"`;if(F)J=`Block at number "${F}"`;super(`${J} could not be found.`,{name:"BlockNotFoundError"})}}c();D0();var qB={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function s6(D,F){let J={...D,blockHash:D.blockHash?D.blockHash:null,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,chainId:D.chainId?OD(D.chainId):void 0,gas:D.gas?BigInt(D.gas):void 0,gasPrice:D.gasPrice?BigInt(D.gasPrice):void 0,maxFeePerBlobGas:D.maxFeePerBlobGas?BigInt(D.maxFeePerBlobGas):void 0,maxFeePerGas:D.maxFeePerGas?BigInt(D.maxFeePerGas):void 0,maxPriorityFeePerGas:D.maxPriorityFeePerGas?BigInt(D.maxPriorityFeePerGas):void 0,nonce:D.nonce?OD(D.nonce):void 0,to:D.to?D.to:null,transactionIndex:D.transactionIndex?Number(D.transactionIndex):null,type:D.type?qB[D.type]:void 0,typeHex:D.type?D.type:void 0,value:D.value?BigInt(D.value):void 0,v:D.v?BigInt(D.v):void 0};if(D.authorizationList)J.authorizationList=Ca(D.authorizationList);if(J.yParity=(()=>{if(D.yParity)return Number(D.yParity);if(typeof J.v==="bigint"){if(J.v===0n||J.v===27n)return 0;if(J.v===1n||J.v===28n)return 1;if(J.v>=35n)return J.v%2n===0n?1:0}return})(),J.type==="legacy")delete J.accessList,delete J.maxFeePerBlobGas,delete J.maxFeePerGas,delete J.maxPriorityFeePerGas,delete J.yParity;if(J.type==="eip2930")delete J.maxFeePerBlobGas,delete J.maxFeePerGas,delete J.maxPriorityFeePerGas;if(J.type==="eip1559")delete J.maxFeePerBlobGas;return J}function Ca(D){return D.map((F)=>({address:F.address,chainId:Number(F.chainId),nonce:Number(F.nonce),r:F.r,s:F.s,yParity:Number(F.yParity)}))}function A$(D,F){let J=(D.transactions??[]).map((Q)=>{if(typeof Q==="string")return Q;return s6(Q)});return{...D,baseFeePerGas:D.baseFeePerGas?BigInt(D.baseFeePerGas):null,blobGasUsed:D.blobGasUsed?BigInt(D.blobGasUsed):void 0,difficulty:D.difficulty?BigInt(D.difficulty):void 0,excessBlobGas:D.excessBlobGas?BigInt(D.excessBlobGas):void 0,gasLimit:D.gasLimit?BigInt(D.gasLimit):void 0,gasUsed:D.gasUsed?BigInt(D.gasUsed):void 0,hash:D.hash?D.hash:null,logsBloom:D.logsBloom?D.logsBloom:null,nonce:D.nonce?D.nonce:null,number:D.number?BigInt(D.number):null,size:D.size?BigInt(D.size):void 0,timestamp:D.timestamp?BigInt(D.timestamp):void 0,transactions:J,totalDifficulty:D.totalDifficulty?BigInt(D.totalDifficulty):null}}async function Z0(D,{blockHash:F,blockNumber:J,blockTag:Q=D.experimental_blockTag??"latest",includeTransactions:$}={}){let Z=$??!1,X=J!==void 0?k(J):void 0,Y=null;if(F)Y=await D.request({method:"eth_getBlockByHash",params:[F,Z]},{dedupe:!0});else Y=await D.request({method:"eth_getBlockByNumber",params:[X||Q,Z]},{dedupe:Boolean(X)});if(!Y)throw new R4({blockHash:F,blockNumber:J});return(D.chain?.formatters?.block?.format||A$)(Y,"getBlock")}async function t6(D){let F=await D.request({method:"eth_gasPrice"});return BigInt(F)}async function sw(D,F){return GB(D,F)}async function GB(D,F){let{block:J,chain:Q=D.chain,request:$}=F||{};try{let Z=Q?.fees?.maxPriorityFeePerGas??Q?.fees?.defaultPriorityFee;if(typeof Z==="function"){let Y=J||await f(D,Z0,"getBlock")({}),q=await Z({block:Y,client:D,request:$});if(q===null)throw Error();return q}if(typeof Z<"u")return Z;let X=await D.request({method:"eth_maxPriorityFeePerGas"});return kD(X)}catch{let[Z,X]=await Promise.all([J?Promise.resolve(J):f(D,Z0,"getBlock")({}),f(D,t6,"getGasPrice")({})]);if(typeof Z.baseFeePerGas!=="bigint")throw new q3;let Y=X-Z.baseFeePerGas;if(Y<0n)return 0n;return Y}}async function tw(D,F){return w$(D,F)}async function w$(D,F){let{block:J,chain:Q=D.chain,request:$,type:Z="eip1559"}=F||{},X=await(async()=>{if(typeof Q?.fees?.baseFeeMultiplier==="function")return Q.fees.baseFeeMultiplier({block:J,client:D,request:$});return Q?.fees?.baseFeeMultiplier??1.2})();if(X<1)throw new E4;let q=10**(X.toString().split(".")[1]?.length??0),G=(K)=>K*BigInt(Math.ceil(X*q))/BigInt(q),W=J?J:await f(D,Z0,"getBlock")({});if(typeof Q?.fees?.estimateFeesPerGas==="function"){let K=await Q.fees.estimateFeesPerGas({block:J,client:D,multiply:G,request:$,type:Z});if(K!==null)return K}if(Z==="eip1559"){if(typeof W.baseFeePerGas!=="bigint")throw new q3;let K=typeof $?.maxPriorityFeePerGas==="bigint"?$.maxPriorityFeePerGas:await GB(D,{block:W,chain:Q,request:$}),U=G(W.baseFeePerGas);return{maxFeePerGas:$?.maxFeePerGas??U+K,maxPriorityFeePerGas:K}}return{gasPrice:$?.gasPrice??G(await f(D,t6,"getGasPrice")({}))}}D0();c();async function e6(D,{address:F,blockTag:J="latest",blockNumber:Q}){let $=await D.request({method:"eth_getTransactionCount",params:[F,typeof Q==="bigint"?k(Q):J]},{dedupe:Boolean(Q)});return OD($)}B0();c();function I$(D){let{kzg:F}=D,J=D.to??(typeof D.blobs[0]==="string"?"hex":"bytes"),Q=typeof D.blobs[0]==="string"?D.blobs.map((Z)=>W0(Z)):D.blobs,$=[];for(let Z of Q)$.push(Uint8Array.from(F.blobToKzgCommitment(Z)));return J==="bytes"?$:$.map((Z)=>BD(Z))}B0();c();function N$(D){let{kzg:F}=D,J=D.to??(typeof D.blobs[0]==="string"?"hex":"bytes"),Q=typeof D.blobs[0]==="string"?D.blobs.map((X)=>W0(X)):D.blobs,$=typeof D.commitments[0]==="string"?D.commitments.map((X)=>W0(X)):D.commitments,Z=[];for(let X=0;X<Q.length;X++){let Y=Q[X],q=$[X];Z.push(Uint8Array.from(F.computeBlobKzgProof(Y,q)))}return J==="bytes"?Z:Z.map((X)=>BD(X))}c();xW();var ew=F3;B0();c();function DI(D,F){let J=F||"hex",Q=ew(e(D,{strict:!1})?C8(D):D);if(J==="bytes")return Q;return cD(Q)}function FI(D){let{commitment:F,version:J=1}=D,Q=D.to??(typeof F==="string"?"hex":"bytes"),$=DI(F,"bytes");return $.set([J],0),Q==="bytes"?$:BD($)}function JI(D){let{commitments:F,version:J}=D,Q=D.to??(typeof F[0]==="string"?"hex":"bytes"),$=[];for(let Z of F)$.push(FI({commitment:Z,to:Q,version:J}));return $}var QI=32,$I=4096,ZI=131072,WB=761855;s();class BB extends P{constructor({maxSize:D,size:F}){super("Blob size is too large.",{metaMessages:[`Max: ${D} bytes`,`Given: ${F} bytes`],name:"BlobSizeTooLargeError"})}}class KB extends P{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}q$();z8();B0();c();function XI(D){let F=D.to??(typeof D.data==="string"?"hex":"bytes"),J=typeof D.data==="string"?W0(D.data):D.data,Q=GD(J);if(!Q)throw new KB;if(Q>WB)throw new BB({maxSize:WB,size:Q});let $=[],Z=!0,X=0;while(Z){let Y=O6(new Uint8Array(ZI)),q=0;while(q<$I){let G=J.slice(X,X+(QI-1));if(Y.pushByte(0),Y.pushBytes(G),G.length<31){Y.pushByte(128),Z=!1;break}q++,X+=31}$.push(Y)}return F==="bytes"?$.map((Y)=>Y.bytes):$.map((Y)=>BD(Y.bytes))}function YI(D){let{data:F,kzg:J,to:Q}=D,$=D.blobs??XI({data:F,to:Q}),Z=D.commitments??I$({blobs:$,kzg:J,to:Q}),X=D.proofs??N$({blobs:$,commitments:Z,kzg:J,to:Q}),Y=[];for(let q=0;q<$.length;q++)Y.push({blob:$[q],commitment:Z[q],proof:X[q]});return Y}iF();T2();R2();function qI(D){if(D.type)return D.type;if(typeof D.authorizationList<"u")return"eip7702";if(typeof D.blobs<"u"||typeof D.blobVersionedHashes<"u"||typeof D.maxFeePerBlobGas<"u"||typeof D.sidecars<"u")return"eip4844";if(typeof D.maxFeePerGas<"u"||typeof D.maxPriorityFeePerGas<"u")return"eip1559";if(typeof D.gasPrice<"u"){if(typeof D.accessList<"u")return"eip2930";return"legacy"}throw new NW({transaction:D})}Y3();R2();M4();function t1(D,{docsPath:F,...J}){let Q=(()=>{let $=s1(D,J);if($ instanceof c8)return D;return $})();return new TW(Q,{docsPath:F,...J})}N2();T2();D0();async function M0(D){let F=await D.request({method:"eth_chainId"},{dedupe:!0});return OD(F)}async function D7(D,F){let{account:J=D.account,accessList:Q,authorizationList:$,chain:Z=D.chain,blobVersionedHashes:X,blobs:Y,data:q,gas:G,gasPrice:W,maxFeePerBlobGas:B,maxFeePerGas:K,maxPriorityFeePerGas:U,nonce:V,nonceManager:H,to:z,type:_,value:M,...C}=F,O=await(async()=>{if(!J)return V;if(!H)return V;if(typeof V<"u")return V;let w=i(J),T=Z?Z.id:await f(D,M0,"getChainId")({});return await H.consume({address:w.address,chainId:T,client:D})})();$0(F);let E=Z?.formatters?.transactionRequest?.format,N=(E||Q0)({...i0(C,{format:E}),account:J?i(J):void 0,accessList:Q,authorizationList:$,blobs:Y,blobVersionedHashes:X,data:q,gas:G,gasPrice:W,maxFeePerBlobGas:B,maxFeePerGas:K,maxPriorityFeePerGas:U,nonce:O,to:z,type:_,value:M},"fillTransaction");try{let w=await D.request({method:"eth_fillTransaction",params:[N]}),I=(Z?.formatters?.transaction?.format||s6)(w.tx);if(delete I.blockHash,delete I.blockNumber,delete I.r,delete I.s,delete I.transactionIndex,delete I.v,delete I.yParity,I.data=I.input,I.gas)I.gas=F.gas??I.gas;if(I.gasPrice)I.gasPrice=F.gasPrice??I.gasPrice;if(I.maxFeePerBlobGas)I.maxFeePerBlobGas=F.maxFeePerBlobGas??I.maxFeePerBlobGas;if(I.maxFeePerGas)I.maxFeePerGas=F.maxFeePerGas??I.maxFeePerGas;if(I.maxPriorityFeePerGas)I.maxPriorityFeePerGas=F.maxPriorityFeePerGas??I.maxPriorityFeePerGas;if(I.nonce)I.nonce=F.nonce??I.nonce;let S=await(async()=>{if(typeof Z?.fees?.baseFeeMultiplier==="function"){let j=await f(D,Z0,"getBlock")({});return Z.fees.baseFeeMultiplier({block:j,client:D,request:F})}return Z?.fees?.baseFeeMultiplier??1.2})();if(S<1)throw new E4;let y=10**(S.toString().split(".")[1]?.length??0),m=(j)=>j*BigInt(Math.ceil(S*y))/BigInt(y);if(I.maxFeePerGas&&!F.maxFeePerGas)I.maxFeePerGas=m(I.maxFeePerGas);if(I.gasPrice&&!F.gasPrice)I.gasPrice=m(I.gasPrice);return{raw:w.raw,transaction:{from:N.from,...I}}}catch(w){throw t1(w,{...F,chain:D.chain})}}var A4=["blobVersionedHashes","chainId","fees","gas","nonce","type"],GI=new Map,UB=new Z8(128);async function L2(D,F){let J=F;J.account??=D.account,J.parameters??=A4;let{account:Q,chain:$=D.chain,nonceManager:Z,parameters:X}=J,Y=(()=>{if(typeof $?.prepareTransactionRequest==="function")return{fn:$.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray($?.prepareTransactionRequest))return{fn:$.prepareTransactionRequest[0],runAt:$.prepareTransactionRequest[1].runAt};return})(),q;async function G(){if(q)return q;if(typeof J.chainId<"u")return J.chainId;if($)return $.id;return q=await f(D,M0,"getChainId")({}),q}let W=Q?i(Q):Q,B=J.nonce;if(X.includes("nonce")&&typeof B>"u"&&W&&Z){let O=await G();B=await Z.consume({address:W.address,chainId:O,client:D})}if(Y?.fn&&Y.runAt?.includes("beforeFillTransaction"))J=await Y.fn({...J,chain:$},{phase:"beforeFillTransaction"}),B??=J.nonce;let U=(()=>{if((X.includes("blobVersionedHashes")||X.includes("sidecars"))&&J.kzg&&J.blobs)return!1;if(UB.get(D.uid)===!1)return!1;if(!["fees","gas"].some((E)=>X.includes(E)))return!1;if(X.includes("chainId")&&typeof J.chainId!=="number")return!0;if(X.includes("nonce")&&typeof B!=="number")return!0;if(X.includes("fees")&&typeof J.gasPrice!=="bigint"&&(typeof J.maxFeePerGas!=="bigint"||typeof J.maxPriorityFeePerGas!=="bigint"))return!0;if(X.includes("gas")&&typeof J.gas!=="bigint")return!0;return!1})()?await f(D,D7,"fillTransaction")({...J,nonce:B}).then((O)=>{let{chainId:E,from:A,gas:N,gasPrice:w,nonce:T,maxFeePerBlobGas:I,maxFeePerGas:S,maxPriorityFeePerGas:L,type:y,...m}=O.transaction;return UB.set(D.uid,!0),{...J,...A?{from:A}:{},...y?{type:y}:{},...typeof E<"u"?{chainId:E}:{},...typeof N<"u"?{gas:N}:{},...typeof w<"u"?{gasPrice:w}:{},...typeof T<"u"?{nonce:T}:{},...typeof I<"u"?{maxFeePerBlobGas:I}:{},...typeof S<"u"?{maxFeePerGas:S}:{},...typeof L<"u"?{maxPriorityFeePerGas:L}:{},..."nonceKey"in m&&typeof m.nonceKey<"u"?{nonceKey:m.nonceKey}:{}}}).catch((O)=>{let E=O;if(E.name!=="TransactionExecutionError")return J;if(E.walk?.((N)=>{let w=N;return w.name==="MethodNotFoundRpcError"||w.name==="MethodNotSupportedRpcError"}))UB.set(D.uid,!1);return J}):J;B??=U.nonce,J={...U,...W?{from:W?.address}:{},...B?{nonce:B}:{}};let{blobs:V,gas:H,kzg:z,type:_}=J;if(Y?.fn&&Y.runAt?.includes("beforeFillParameters"))J=await Y.fn({...J,chain:$},{phase:"beforeFillParameters"});let M;async function C(){if(M)return M;return M=await f(D,Z0,"getBlock")({blockTag:"latest"}),M}if(X.includes("nonce")&&typeof B>"u"&&W&&!Z)J.nonce=await f(D,e6,"getTransactionCount")({address:W.address,blockTag:"pending"});if((X.includes("blobVersionedHashes")||X.includes("sidecars"))&&V&&z){let O=I$({blobs:V,kzg:z});if(X.includes("blobVersionedHashes")){let E=JI({commitments:O,to:"hex"});J.blobVersionedHashes=E}if(X.includes("sidecars")){let E=N$({blobs:V,commitments:O,kzg:z}),A=YI({blobs:V,commitments:O,proofs:E,to:"hex"});J.sidecars=A}}if(X.includes("chainId"))J.chainId=await G();if((X.includes("fees")||X.includes("type"))&&typeof _>"u")try{J.type=qI(J)}catch{let O=GI.get(D.uid);if(typeof O>"u")O=typeof(await C())?.baseFeePerGas==="bigint",GI.set(D.uid,O);J.type=O?"eip1559":"legacy"}if(X.includes("fees"))if(J.type!=="legacy"&&J.type!=="eip2930"){if(typeof J.maxFeePerGas>"u"||typeof J.maxPriorityFeePerGas>"u"){let O=await C(),{maxFeePerGas:E,maxPriorityFeePerGas:A}=await w$(D,{block:O,chain:$,request:J});if(typeof J.maxPriorityFeePerGas>"u"&&J.maxFeePerGas&&J.maxFeePerGas<A)throw new YB({maxPriorityFeePerGas:A});J.maxPriorityFeePerGas=A,J.maxFeePerGas=E}}else{if(typeof J.maxFeePerGas<"u"||typeof J.maxPriorityFeePerGas<"u")throw new q3;if(typeof J.gasPrice>"u"){let O=await C(),{gasPrice:E}=await w$(D,{block:O,chain:$,request:J,type:"legacy"});J.gasPrice=E}}if(X.includes("gas")&&typeof H>"u")J.gas=await f(D,F7,"estimateGas")({...J,account:W,prepare:W?.type==="local"?[]:["blobVersionedHashes"]});if(Y?.fn&&Y.runAt?.includes("afterFillParameters"))J=await Y.fn({...J,chain:$},{phase:"afterFillParameters"});return $0(J),delete J.parameters,J}async function F7(D,F){let{account:J=D.account,prepare:Q=!0}=F,$=J?i(J):void 0,Z=(()=>{if(Array.isArray(Q))return Q;if($?.type!=="local")return["blobVersionedHashes"];return})();try{let X=await(async()=>{if(F.to)return F.to;if(F.authorizationList&&F.authorizationList.length>0)return await a1({authorization:F.authorizationList[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`")});return})(),{accessList:Y,authorizationList:q,blobs:G,blobVersionedHashes:W,blockNumber:B,blockTag:K,data:U,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:M,nonce:C,value:O,stateOverride:E,...A}=Q?await L2(D,{...F,parameters:Z,to:X}):F;if(V&&F.gas!==V)return V;let w=(typeof B==="bigint"?k(B):void 0)||K,T=r6(E);$0(F);let I=D.chain?.formatters?.transactionRequest?.format,L=(I||Q0)({...i0(A,{format:I}),account:$,accessList:Y,authorizationList:q,blobs:G,blobVersionedHashes:W,data:U,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:M,nonce:C,to:X,value:O},"estimateGas");return BigInt(await D.request({method:"eth_estimateGas",params:T?[L,w??D.experimental_blockTag??"latest",T]:w?[L,w]:[L]}))}catch(X){throw iw(X,{...F,account:$,chain:D.chain})}}async function WI(D,F){let{abi:J,address:Q,args:$,functionName:Z,dataSuffix:X,...Y}=F,q=AD({abi:J,args:$,functionName:Z});try{return await f(D,F7,"estimateGas")({data:`${q}${X?X.replace("0x",""):""}`,to:Q,...Y})}catch(G){let W=Y.account?i(Y.account):void 0;throw Y8(G,{abi:J,address:Q,args:$,docsPath:"/docs/contract/estimateContractGas",functionName:Z,sender:W?.address})}}g1();G3();B0();g8();r9();gD();_W();z8();r9();e9();t2();var BI="/docs/contract/decodeEventLog";function W3(D){let{abi:F,data:J,strict:Q,topics:$}=D,Z=Q??!0,[X,...Y]=$;if(!X)throw new aG({docsPath:BI});let q=F.find((H)=>H.type==="event"&&X===u1(eD(H)));if(!(q&&("name"in q))||q.type!=="event")throw new rG(X,{docsPath:BI});let{name:G,inputs:W}=q,B=W?.some((H)=>!(("name"in H)&&H.name)),K=B?[]:{},U=W.map((H,z)=>[H,z]).filter(([H])=>("indexed"in H)&&H.indexed);for(let H=0;H<U.length;H++){let[z,_]=U[H],M=Y[H];if(!M)throw new mF({abiItem:q,param:z});K[B?_:z.name||_]=_a({param:z,value:M})}let V=W.filter((H)=>!(("indexed"in H)&&H.indexed));if(V.length>0){if(J&&J!=="0x")try{let H=$1(V,J);if(H)if(B)for(let z=0;z<W.length;z++)K[z]=K[z]??H.shift();else for(let z=0;z<V.length;z++)K[V[z].name]=H[z]}catch(H){if(Z){if(H instanceof d9||H instanceof s9)throw new h1({abiItem:q,data:J,params:V,size:GD(J)});throw H}}else if(Z)throw new h1({abiItem:q,data:"0x",params:V,size:0})}return{eventName:G,args:Object.values(K).length>0?K:void 0}}function _a({param:D,value:F}){if(D.type==="string"||D.type==="bytes"||D.type==="tuple"||D.type.match(/^(.*)\[(\d+)?\]$/))return F;return($1([D],F)||[])[0]}function J7(D){let{abi:F,args:J,logs:Q,strict:$=!0}=D,Z=(()=>{if(!D.eventName)return;if(Array.isArray(D.eventName))return D.eventName;return[D.eventName]})();return Q.map((X)=>{let Y=F.filter((W)=>W.type==="event"&&X.topics[0]===u1(W));if(Y.length===0)return null;let q,G;for(let W of Y)try{q=W3({...X,abi:[W],strict:!0}),G=W;break}catch{}if(!q&&!$){G=Y[0];try{q=W3({...X,abi:[G],strict:!1})}catch{let W=G.inputs?.some((B)=>!(("name"in B)&&B.name));return{...X,args:W?[]:{},eventName:G.name}}}if(!q||!G)return null;if(Z&&!Z.includes(q.eventName))return null;if(!Oa({args:q.args,inputs:G.inputs,matchArgs:J}))return null;return{...q,...X}}).filter(Boolean)}function Oa(D){let{args:F,inputs:J,matchArgs:Q}=D;if(!Q)return!0;if(!F)return!1;function $(Z,X,Y){try{if(Z.type==="address")return O8(X,Y);if(Z.type==="string"||Z.type==="bytes")return MD(C8(X))===Y;return X===Y}catch{return!1}}if(Array.isArray(F)&&Array.isArray(Q))return Q.every((Z,X)=>{if(Z===null||Z===void 0)return!0;let Y=J[X];if(!Y)return!1;return(Array.isArray(Z)?Z:[Z]).some((G)=>$(Y,G,F[X]))});if(typeof F==="object"&&!Array.isArray(F)&&typeof Q==="object"&&!Array.isArray(Q))return Object.entries(Q).every(([Z,X])=>{if(X===null||X===void 0)return!0;let Y=J.find((G)=>G.name===Z);if(!Y)return!1;return(Array.isArray(X)?X:[X]).some((G)=>$(Y,G,F[Z]))});return!1}c();function E0(D,{args:F,eventName:J}={}){return{...D,blockHash:D.blockHash?D.blockHash:null,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,blockTimestamp:D.blockTimestamp?BigInt(D.blockTimestamp):D.blockTimestamp===null?null:void 0,logIndex:D.logIndex?Number(D.logIndex):null,transactionHash:D.transactionHash?D.transactionHash:null,transactionIndex:D.transactionIndex?Number(D.transactionIndex):null,...J?{args:F,eventName:J}:{}}}async function Q7(D,{address:F,blockHash:J,fromBlock:Q,toBlock:$,event:Z,events:X,args:Y,strict:q}={}){let G=q??!1,W=X??(Z?[Z]:void 0),B=[];if(W){if(B=[W.flatMap((H)=>M2({abi:[H],eventName:H.name,args:X?void 0:Y}))],Z)B=B[0]}let K;if(J)K=await D.request({method:"eth_getLogs",params:[{address:F,topics:B,blockHash:J}]});else K=await D.request({method:"eth_getLogs",params:[{address:F,topics:B,fromBlock:typeof Q==="bigint"?k(Q):Q,toBlock:typeof $==="bigint"?k($):$}]});let U=K.map((V)=>E0(V));if(!W)return U;return J7({abi:W,args:Y,logs:U,strict:G})}async function T$(D,F){let{abi:J,address:Q,args:$,blockHash:Z,eventName:X,fromBlock:Y,toBlock:q,strict:G}=F,W=X?l0({abi:J,name:X}):void 0,B=!W?J.filter((K)=>K.type==="event"):void 0;return f(D,Q7,"getLogs")({address:Q,args:$,blockHash:Z,event:W,events:B,fromBlock:Y,toBlock:q,strict:G})}e1();X8();U7();async function aD(D,F){let{abi:J,address:Q,args:$,functionName:Z,...X}=F,Y=AD({abi:J,args:$,functionName:Z});try{let{data:q}=await f(D,S2,"call")({...X,data:Y,to:Q});return o0({abi:J,args:$,functionName:Z,data:q||"0x"})}catch(q){throw Y8(q,{abi:J,address:Q,args:$,docsPath:"/docs/contract/readContract",functionName:Z})}}e1();X8();U7();async function sI(D,F){let{abi:J,address:Q,args:$,dataSuffix:Z,functionName:X,...Y}=F,q=Y.account?i(Y.account):D.account,G=AD({abi:J,args:$,functionName:X});try{let{data:W}=await f(D,S2,"call")({batch:!1,data:`${G}${Z?Z.replace("0x",""):""}`,to:Q,...Y,account:q}),B=o0({abi:J,args:$,functionName:X,data:W||"0x"}),K=J.filter((U)=>("name"in U)&&U.name===F.functionName);return{result:B,request:{abi:K,address:Q,args:$,dataSuffix:Z,functionName:X,...Y,account:q}}}catch(W){throw Y8(W,{abi:J,address:Q,args:$,docsPath:"/docs/contract/simulateContract",functionName:X,sender:q?.address})}}gD();p6();var cB=new Map,tI=new Map,va=0;function R0(D,F,J){let Q=++va,$=()=>cB.get(D)||[],Z=()=>{let W=$();cB.set(D,W.filter((B)=>B.id!==Q))},X=()=>{let W=$();if(!W.some((K)=>K.id===Q))return;let B=tI.get(D);if(W.length===1&&B){let K=B();if(K instanceof Promise)K.catch(()=>{})}Z()},Y=$();if(cB.set(D,[...Y,{id:Q,fns:F}]),Y&&Y.length>0)return X;let q={};for(let W in F)q[W]=(...B)=>{let K=$();if(K.length===0)return;for(let U of K)U.fns[W]?.(...B)};let G=J(q);if(typeof G==="function")tI.set(D,G);return X}async function L4(D){return new Promise((F)=>setTimeout(F,D))}function R8(D,{emitOnBegin:F,initialWaitTime:J,interval:Q}){let $=!0,Z=()=>$=!1;return(async()=>{let Y;if(F)Y=await D({unpoll:Z});let q=await J?.(Y)??Q;await L4(q);let G=async()=>{if(!$)return;await D({unpoll:Z}),await L4(Q),G()};G()})(),Z}var ua=new Map,ga=new Map;function eI(D){let F=($,Z)=>({clear:()=>Z.delete($),get:()=>Z.get($),set:(X)=>Z.set($,X)}),J=F(D,ua),Q=F(D,ga);return{clear:()=>{J.clear(),Q.clear()},promise:J,response:Q}}async function DN(D,{cacheKey:F,cacheTime:J=Number.POSITIVE_INFINITY}){let Q=eI(F),$=Q.response.get();if($&&J>0){if(Date.now()-$.created.getTime()<J)return $.data}let Z=Q.promise.get();if(!Z)Z=D(),Q.promise.set(Z);try{let X=await Z;return Q.response.set({created:new Date,data:X}),X}finally{Q.promise.clear()}}var ma=(D)=>`blockNumber.${D}`;async function x2(D,{cacheTime:F=D.cacheTime}={}){let J=await DN(()=>D.request({method:"eth_blockNumber"}),{cacheKey:ma(D.uid),cacheTime:F});return BigInt(J)}async function QF(D,{filter:F}){let J="strict"in F&&F.strict,Q=await F.request({method:"eth_getFilterChanges",params:[F.id]});if(typeof Q[0]==="string")return Q;let $=Q.map((Z)=>E0(Z));if(!("abi"in F)||!F.abi)return $;return J7({abi:F.abi,logs:$,strict:J})}async function $F(D,{filter:F}){return F.request({method:"eth_uninstallFilter",params:[F.id]})}function FN(D,F){let{abi:J,address:Q,args:$,batch:Z=!0,eventName:X,fromBlock:Y,onError:q,onLogs:G,poll:W,pollingInterval:B=D.pollingInterval,strict:K}=F;return(()=>{if(typeof W<"u")return W;if(typeof Y==="bigint")return!0;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})()?(()=>{let z=K??!1,_=qD(["watchContractEvent",Q,$,Z,D.uid,X,B,z,Y]);return R0(_,{onLogs:G,onError:q},(M)=>{let C;if(Y!==void 0)C=Y-1n;let O,E=!1,A=R8(async()=>{if(!E){try{O=await f(D,$$,"createContractEventFilter")({abi:J,address:Q,args:$,eventName:X,strict:z,fromBlock:Y})}catch{}E=!0;return}try{let N;if(O)N=await f(D,QF,"getFilterChanges")({filter:O});else{let w=await f(D,x2,"getBlockNumber")({});if(C&&C<w)N=await f(D,T$,"getContractEvents")({abi:J,address:Q,args:$,eventName:X,fromBlock:C+1n,toBlock:w,strict:z});else N=[];C=w}if(N.length===0)return;if(Z)M.onLogs(N);else for(let w of N)M.onLogs([w])}catch(N){if(O&&N instanceof _8)E=!1;M.onError?.(N)}},{emitOnBegin:!0,interval:B});return async()=>{if(O)await f(D,$F,"uninstallFilter")({filter:O});A()}})})():(()=>{let z=K??!1,_=qD(["watchContractEvent",Q,$,Z,D.uid,X,B,z]),M=!0,C=()=>M=!1;return R0(_,{onLogs:G,onError:q},(O)=>{return(async()=>{try{let E=(()=>{if(D.transport.type==="fallback"){let w=D.transport.transports.find((T)=>T.config.type==="webSocket"||T.config.type==="ipc");if(!w)return D.transport;return w.value}return D.transport})(),A=X?M2({abi:J,eventName:X,args:$}):[],{unsubscribe:N}=await E.subscribe({params:["logs",{address:Q,topics:A}],onData(w){if(!M)return;let T=w.result;try{let{eventName:I,args:S}=W3({abi:J,data:T.data,topics:T.topics,strict:K}),L=E0(T,{args:S,eventName:I});O.onLogs([L])}catch(I){let S,L;if(I instanceof h1||I instanceof mF){if(K)return;S=I.abiItem.name,L=I.abiItem.inputs?.some((m)=>!(("name"in m)&&m.name))}let y=E0(T,{args:L?[]:{},eventName:S});O.onLogs([y])}},onError(w){O.onError?.(w)}});if(C=N,!M)C()}catch(E){q?.(E)}})(),()=>C()})})()}s();class U0 extends P{constructor({docsPath:D}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
|
|
281
|
+
`),{docsPath:D,docsSlug:"account",name:"AccountNotFoundError"})}}class n8 extends P{constructor({docsPath:D,metaMessages:F,type:J}){super(`Account type "${J}" is not supported.`,{docsPath:D,metaMessages:F,name:"AccountTypeNotSupportedError"})}}X8();s();g$();function V7({chain:D,currentChainId:F}){if(!D)throw new kB;if(F!==D.id)throw new xB({chain:D,currentChainId:F})}N2();iF();T2();async function H7(D,{serializedTransaction:F}){return D.request({method:"eth_sendRawTransaction",params:[F]},{retryCount:0})}var nB=new Z8(128);async function ZF(D,F){let{account:J=D.account,chain:Q=D.chain,accessList:$,authorizationList:Z,blobs:X,data:Y,gas:q,gasPrice:G,maxFeePerBlobGas:W,maxFeePerGas:B,maxPriorityFeePerGas:K,nonce:U,type:V,value:H,...z}=F;if(typeof J>"u")throw new U0({docsPath:"/docs/actions/wallet/sendTransaction"});let _=J?i(J):null;try{$0(F);let M=await(async()=>{if(F.to)return F.to;if(F.to===null)return;if(Z&&Z.length>0)return await a1({authorization:Z[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`.")});return})();if(_?.type==="json-rpc"||_===null){let C;if(Q!==null)C=await f(D,M0,"getChainId")({}),V7({currentChainId:C,chain:Q});let O=D.chain?.formatters?.transactionRequest?.format,A=(O||Q0)({...i0(z,{format:O}),accessList:$,account:_,authorizationList:Z,blobs:X,chainId:C,data:Y,gas:q,gasPrice:G,maxFeePerBlobGas:W,maxFeePerGas:B,maxPriorityFeePerGas:K,nonce:U,to:M,type:V,value:H},"sendTransaction"),N=nB.get(D.uid),w=N?"wallet_sendTransaction":"eth_sendTransaction";try{return await D.request({method:w,params:[A]},{retryCount:0})}catch(T){if(N===!1)throw T;let I=T;if(I.name==="InvalidInputRpcError"||I.name==="InvalidParamsRpcError"||I.name==="MethodNotFoundRpcError"||I.name==="MethodNotSupportedRpcError")return await D.request({method:"wallet_sendTransaction",params:[A]},{retryCount:0}).then((S)=>{return nB.set(D.uid,!0),S}).catch((S)=>{let L=S;if(L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")throw nB.set(D.uid,!1),I;throw L});throw I}}if(_?.type==="local"){let C=await f(D,L2,"prepareTransactionRequest")({account:_,accessList:$,authorizationList:Z,blobs:X,chain:Q,data:Y,gas:q,gasPrice:G,maxFeePerBlobGas:W,maxFeePerGas:B,maxPriorityFeePerGas:K,nonce:U,nonceManager:_.nonceManager,parameters:[...A4,"sidecars"],type:V,value:H,...z,to:M}),O=Q?.serializers?.transaction,E=await _.signTransaction(C,{serializer:O});return await f(D,H7,"sendRawTransaction")({serializedTransaction:E})}if(_?.type==="smart")throw new n8({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new n8({docsPath:"/docs/actions/wallet/sendTransaction",type:_?.type})}catch(M){if(M instanceof n8)throw M;throw t1(M,{...F,account:_,chain:F.chain||void 0})}}async function V3(D,F){return V3.internal(D,ZF,"sendTransaction",F)}(function(D){async function F(J,Q,$,Z){let{abi:X,account:Y=J.account,address:q,args:G,dataSuffix:W,functionName:B,...K}=Z;if(typeof Y>"u")throw new U0({docsPath:"/docs/contract/writeContract"});let U=Y?i(Y):null,V=AD({abi:X,args:G,functionName:B});try{return await f(J,Q,$)({data:`${V}${W?W.replace("0x",""):""}`,to:q,account:U,...K})}catch(H){throw Y8(H,{abi:X,address:q,args:G,docsPath:"/docs/contract/writeContract",functionName:B,sender:U?.address})}}D.internal=F})(V3||(V3={}));s();s();class iB extends P{constructor(D){super(`Call bundle failed with status: ${D.statusCode}`,{name:"BundleFailedError"});Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=D}}function H3(D,{delay:F=100,retryCount:J=2,shouldRetry:Q=()=>!0}={}){return new Promise(($,Z)=>{let X=async({count:Y=0}={})=>{let q=async({error:G})=>{let W=typeof F==="function"?F({count:Y,error:G}):F;if(W)await L4(W);X({count:Y+1})};try{let G=await D();$(G)}catch(G){if(Y<J&&await Q({count:Y,error:G}))return q({error:G});Z(G)}};X()})}oF();D0();D0();var oB={"0x0":"reverted","0x1":"success"};function l$(D,F){let J={...D,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,contractAddress:D.contractAddress?D.contractAddress:null,cumulativeGasUsed:D.cumulativeGasUsed?BigInt(D.cumulativeGasUsed):null,effectiveGasPrice:D.effectiveGasPrice?BigInt(D.effectiveGasPrice):null,gasUsed:D.gasUsed?BigInt(D.gasUsed):null,logs:D.logs?D.logs.map((Q)=>E0(Q)):null,to:D.to?D.to:null,transactionIndex:D.transactionIndex?OD(D.transactionIndex):null,status:D.status?oB[D.status]:null,type:D.type?qB[D.type]||D.type:null};if(D.blobGasPrice)J.blobGasPrice=BigInt(D.blobGasPrice);if(D.blobGasUsed)J.blobGasUsed=BigInt(D.blobGasUsed);return J}s();p6();X8();D0();c();var aB="0x5792579257925792579257925792579257925792579257925792579257925792",rB=k(0,{size:32});async function c$(D,F){let{account:J=D.account,capabilities:Q,chain:$=D.chain,experimental_fallback:Z,experimental_fallbackDelay:X=32,forceAtomic:Y=!1,id:q,version:G="2.0.0"}=F,W=J?i(J):null,B=F.calls.map((K)=>{let U=K,V=U.abi?AD({abi:U.abi,functionName:U.functionName,args:U.args}):U.data;return{data:U.dataSuffix&&V?nD([V,U.dataSuffix]):V,to:U.to,value:U.value?k(U.value):void 0}});try{let K=await D.request({method:"wallet_sendCalls",params:[{atomicRequired:Y,calls:B,capabilities:Q,chainId:k($.id),from:W?.address,id:q,version:G}]},{retryCount:0});if(typeof K==="string")return{id:K};return K}catch(K){let U=K;if(Z&&(U.name==="MethodNotFoundRpcError"||U.name==="MethodNotSupportedRpcError"||U.name==="UnknownRpcError"||U.details.toLowerCase().includes("does not exist / is not available")||U.details.toLowerCase().includes("missing or invalid. request()")||U.details.toLowerCase().includes("did not match any variant of untagged enum")||U.details.toLowerCase().includes("account upgraded to unsupported contract")||U.details.toLowerCase().includes("eip-7702 not supported")||U.details.toLowerCase().includes("unsupported wc_ method")||U.details.toLowerCase().includes("feature toggled misconfigured")||U.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(Q){if(Object.values(Q).some((M)=>!M.optional))throw new p1(new P("non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.",{details:"non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`."}))}if(Y&&B.length>1)throw new l1(new P("`forceAtomic` is not supported on fallback to `eth_sendTransaction`.",{details:"`forceAtomic` is not supported on fallback to `eth_sendTransaction`."}));let V=[];for(let _ of B){let M=ZF(D,{account:W,chain:$,data:_.data,to:_.to,value:_.value?kD(_.value):void 0});if(V.push(M),X>0)await new Promise((C)=>setTimeout(C,X))}let H=await Promise.allSettled(V);if(H.every((_)=>_.status==="rejected"))throw H[0].reason;let z=H.map((_)=>{if(_.status==="fulfilled")return _.value;return rB});return{id:nD([...z,k($.id,{size:32}),aB])}}throw t1(K,{...F,account:W,chain:F.chain})}}async function n$(D,F){async function J(W){if(W.endsWith(aB.slice(2))){let K=$8(F$(W,-64,-32)),U=F$(W,0,-64).slice(2).match(/.{1,64}/g),V=await Promise.all(U.map((z)=>rB.slice(2)!==z?D.request({method:"eth_getTransactionReceipt",params:[`0x${z}`]},{dedupe:!0}):void 0)),H=(()=>{if(V.some((z)=>z===null))return 100;if(V.every((z)=>z?.status==="0x1"))return 200;if(V.every((z)=>z?.status==="0x0"))return 500;return 600})();return{atomic:!1,chainId:OD(K),receipts:V.filter(Boolean),status:H,version:"2.0.0"}}return D.request({method:"wallet_getCallsStatus",params:[W]})}let{atomic:Q=!1,chainId:$,receipts:Z,version:X="2.0.0",...Y}=await J(F.id),[q,G]=(()=>{let W=Y.status;if(W>=100&&W<200)return["pending",W];if(W>=200&&W<300)return["success",W];if(W>=300&&W<700)return["failure",W];if(W==="CONFIRMED")return["success",200];if(W==="PENDING")return["pending",100];return[void 0,W]})();return{...Y,atomic:Q,chainId:$?OD($):void 0,receipts:Z?.map((W)=>({...W,blockNumber:kD(W.blockNumber),gasUsed:kD(W.gasUsed),status:oB[W.status]}))??[],statusCode:G,status:q,version:X}}async function i$(D,F){let{id:J,pollingInterval:Q=D.pollingInterval,status:$=({statusCode:H})=>H===200||H>=300,retryCount:Z=4,retryDelay:X=({count:H})=>~~(1<<H)*200,timeout:Y=60000,throwOnFailure:q=!1}=F,G=qD(["waitForCallsStatus",D.uid,J]),{promise:W,resolve:B,reject:K}=K7(),U,V=R0(G,{resolve:B,reject:K},(H)=>{let z=R8(async()=>{let _=(M)=>{clearTimeout(U),z(),M(),V()};try{let M=await H3(async()=>{let C=await f(D,n$,"getCallsStatus")({id:J});if(q&&C.status==="failure")throw new iB(C);return C},{retryCount:Z,delay:X});if(!$(M))return;_(()=>H.resolve(M))}catch(M){_(()=>H.reject(M))}},{interval:Q,emitOnBegin:!0});return z});return U=Y?setTimeout(()=>{V(),clearTimeout(U),K(new JN({id:J}))},Y):void 0,await W}class JN extends P{constructor({id:D}){super(`Timed out while waiting for call bundle with id "${D}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}var o$=256,a$;function r$(D=11){if(!a$||o$+D>512){a$="",o$=0;for(let F=0;F<256;F++)a$+=(256+Math.random()*256|0).toString(16).substring(1)}return a$.substring(o$,o$+++D)}function QN(D){let{batch:F,chain:J,ccipRead:Q,key:$="base",name:Z="Base Client",type:X="base"}=D,Y=D.experimental_blockTag??(typeof J?.experimental_preconfirmationTime==="number"?"pending":void 0),q=J?.blockTime??12000,G=Math.min(Math.max(Math.floor(q/2),500),4000),W=D.pollingInterval??G,B=D.cacheTime??W,K=D.account?i(D.account):void 0,{config:U,request:V,value:H}=D.transport({account:K,chain:J,pollingInterval:W}),z={...U,...H},_={account:K,batch:F,cacheTime:B,ccipRead:Q,chain:J,key:$,name:Z,pollingInterval:W,request:V,transport:z,type:X,uid:r$(),...Y?{experimental_blockTag:Y}:{}};function M(C){return(O)=>{let E=O(C);for(let N in _)delete E[N];let A={...C,...E};return Object.assign(A,{extend:M(A)})}}return Object.assign(_,{extend:M(_)})}z1();e1();X8();U3();c();s();Z1();function z7(D){if(!(D instanceof P))return!1;let F=D.walk((J)=>J instanceof A2);if(!(F instanceof A2))return!1;if(F.data?.errorName==="HttpError")return!0;if(F.data?.errorName==="ResolverError")return!0;if(F.data?.errorName==="ResolverNotContract")return!0;if(F.data?.errorName==="ResolverNotFound")return!0;if(F.data?.errorName==="ReverseAddressMismatch")return!0;if(F.data?.errorName==="UnsupportedResolverProfile")return!0;return!1}T4();B0();c();g8();function s$(D){if(D.length!==66)return null;if(D.indexOf("[")!==0)return null;if(D.indexOf("]")!==65)return null;let F=`0x${D.slice(1,65)}`;if(!e(F))return null;return F}function P4(D){let F=new Uint8Array(32).fill(0);if(!D)return BD(F);let J=D.split(".");for(let Q=J.length-1;Q>=0;Q-=1){let $=s$(J[Q]),Z=$?C8($):MD(v8(J[Q]),"bytes");F=MD(nD([F,Z]),"bytes")}return BD(F)}B0();function $N(D){return`[${D.slice(2)}]`}B0();c();g8();function ZN(D){let F=new Uint8Array(32).fill(0);if(!D)return BD(F);return s$(D)||MD(v8(D))}function C7(D){let F=D.replace(/^\.|\.$/gm,"");if(F.length===0)return new Uint8Array(1);let J=new Uint8Array(v8(F).byteLength+2),Q=0,$=F.split(".");for(let Z=0;Z<$.length;Z++){let X=v8($[Z]);if(X.byteLength>255)X=v8($N(ZN($[Z])));J[Q]=X.length,J.set(X,Q+1),Q+=X.length+1}if(J.byteLength!==Q+1)return J.slice(0,Q+1);return J}async function XN(D,F){let{blockNumber:J,blockTag:Q,coinType:$,name:Z,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E8({blockNumber:J,chain:q,contract:"ensUniversalResolver"})})(),W=q?.ensTlds;if(W&&!W.some((K)=>Z.endsWith(K)))return null;let B=(()=>{if($!=null)return[P4(Z),BigInt($)];return[P4(Z)]})();try{let K=AD({abi:jB,functionName:"addr",args:B}),U={address:G,abi:h$,functionName:"resolveWithGateways",args:[cD(C7(Z)),K,X??[C1]],blockNumber:J,blockTag:Q},H=await f(D,aD,"readContract")(U);if(H[0]==="0x")return null;let z=o0({abi:jB,args:B,functionName:"addr",data:H[0]});if(z==="0x")return null;if($8(z)==="0x00")return null;return z}catch(K){if(Y)throw K;if(z7(K))return null;throw K}}s();class sB extends P{constructor({data:D}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(D)}`],name:"EnsAvatarInvalidMetadataError"})}}class z3 extends P{constructor({reason:D}){super(`ENS NFT avatar URI is invalid. ${D}`,{name:"EnsAvatarInvalidNftUriError"})}}class j4 extends P{constructor({uri:D}){super(`Unable to resolve ENS avatar URI "${D}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class tB extends P{constructor({namespace:D}){super(`ENS NFT avatar namespace "${D}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}var da=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,pa=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,la=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ca=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function na(D){try{let F=await fetch(D,{method:"HEAD"});if(F.status===200)return F.headers.get("content-type")?.startsWith("image/");return!1}catch(F){if(typeof F==="object"&&typeof F.response<"u")return!1;if(!Object.hasOwn(globalThis,"Image"))return!1;return new Promise((J)=>{let Q=new Image;Q.onload=()=>{J(!0)},Q.onerror=()=>{J(!1)},Q.src=D})}}function YN(D,F){if(!D)return F;if(D.endsWith("/"))return D.slice(0,-1);return D}function eB({uri:D,gatewayUrls:F}){let J=la.test(D);if(J)return{uri:D,isOnChain:!0,isEncoded:J};let Q=YN(F?.ipfs,"https://ipfs.io"),$=YN(F?.arweave,"https://arweave.net"),Z=D.match(da),{protocol:X,subpath:Y,target:q,subtarget:G=""}=Z?.groups||{},W=X==="ipns:/"||Y==="ipns/",B=X==="ipfs:/"||Y==="ipfs/"||pa.test(D);if(D.startsWith("http")&&!W&&!B){let U=D;if(F?.arweave)U=D.replace(/https:\/\/arweave.net/g,F?.arweave);return{uri:U,isOnChain:!1,isEncoded:!1}}if((W||B)&&q)return{uri:`${Q}/${W?"ipns":"ipfs"}/${q}${G}`,isOnChain:!1,isEncoded:!1};if(X==="ar:/"&&q)return{uri:`${$}/${q}${G||""}`,isOnChain:!1,isEncoded:!1};let K=D.replace(ca,"");if(K.startsWith("<svg"))K=`data:image/svg+xml;base64,${btoa(K)}`;if(K.startsWith("data:")||K.startsWith("{"))return{uri:K,isOnChain:!0,isEncoded:!1};throw new j4({uri:D})}function DK(D){if(typeof D!=="object"||!("image"in D)&&!("image_url"in D)&&!("image_data"in D))throw new sB({data:D});return D.image||D.image_url||D.image_data}async function qN({gatewayUrls:D,uri:F}){try{let J=await fetch(F).then(($)=>$.json());return await t$({gatewayUrls:D,uri:DK(J)})}catch{throw new j4({uri:F})}}async function t$({gatewayUrls:D,uri:F}){let{uri:J,isOnChain:Q}=eB({uri:F,gatewayUrls:D});if(Q)return J;if(await na(J))return J;throw new j4({uri:F})}function GN(D){let F=D;if(F.startsWith("did:nft:"))F=F.replace("did:nft:","").replace(/_/g,"/");let[J,Q,$]=F.split("/"),[Z,X]=J.split(":"),[Y,q]=Q.split(":");if(!Z||Z.toLowerCase()!=="eip155")throw new z3({reason:"Only EIP-155 supported"});if(!X)throw new z3({reason:"Chain ID not found"});if(!q)throw new z3({reason:"Contract address not found"});if(!$)throw new z3({reason:"Token ID not found"});if(!Y)throw new z3({reason:"ERC namespace not found"});return{chainID:Number.parseInt(X,10),namespace:Y.toLowerCase(),contractAddress:q,tokenID:$}}async function WN(D,{nft:F}){if(F.namespace==="erc721")return aD(D,{address:F.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(F.tokenID)]});if(F.namespace==="erc1155")return aD(D,{address:F.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(F.tokenID)]});throw new tB({namespace:F.namespace})}async function BN(D,{gatewayUrls:F,record:J}){if(/eip155:/i.test(J))return ia(D,{gatewayUrls:F,record:J});return t$({uri:J,gatewayUrls:F})}async function ia(D,{gatewayUrls:F,record:J}){let Q=GN(J),$=await WN(D,{nft:Q}),{uri:Z,isOnChain:X,isEncoded:Y}=eB({uri:$,gatewayUrls:F});if(X&&(Z.includes("data:application/json;base64,")||Z.startsWith("{"))){let G=Y?atob(Z.replace("data:application/json;base64,","")):Z,W=JSON.parse(G);return t$({uri:DK(W),gatewayUrls:F})}let q=Q.tokenID;if(Q.namespace==="erc1155")q=q.replace("0x","").padStart(64,"0");return qN({gatewayUrls:F,uri:Z.replace(/(?:0x)?{id}/,q)})}z1();e1();X8();U3();c();T4();async function e$(D,F){let{blockNumber:J,blockTag:Q,key:$,name:Z,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E8({blockNumber:J,chain:q,contract:"ensUniversalResolver"})})(),W=q?.ensTlds;if(W&&!W.some((B)=>Z.endsWith(B)))return null;try{let B={address:G,abi:h$,args:[cD(C7(Z)),AD({abi:PB,functionName:"text",args:[P4(Z),$]}),X??[C1]],functionName:"resolveWithGateways",blockNumber:J,blockTag:Q},U=await f(D,aD,"readContract")(B);if(U[0]==="0x")return null;let V=o0({abi:PB,functionName:"text",data:U[0]});return V===""?null:V}catch(B){if(Y)throw B;if(z7(B))return null;throw B}}async function KN(D,{blockNumber:F,blockTag:J,assetGatewayUrls:Q,name:$,gatewayUrls:Z,strict:X,universalResolverAddress:Y}){let q=await f(D,e$,"getEnsText")({blockNumber:F,blockTag:J,key:"avatar",name:$,universalResolverAddress:Y,gatewayUrls:Z,strict:X});if(!q)return null;try{return await BN(D,{record:q,gatewayUrls:Q})}catch{return null}}z1();U3();T4();async function UN(D,F){let{address:J,blockNumber:Q,blockTag:$,coinType:Z=60n,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E8({blockNumber:Q,chain:q,contract:"ensUniversalResolver"})})();try{let W={address:G,abi:hI,args:[J,Z,X??[C1]],functionName:"reverseWithGateways",blockNumber:Q,blockTag:$},B=f(D,aD,"readContract"),[K]=await B(W);return K||null}catch(W){if(Y)throw W;if(z7(W))return null;throw W}}U3();c();async function VN(D,F){let{blockNumber:J,blockTag:Q,name:$}=F,{chain:Z}=D,X=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!Z)throw Error("client chain not configured. universalResolverAddress is required.");return E8({blockNumber:J,chain:Z,contract:"ensUniversalResolver"})})(),Y=Z?.ensTlds;if(Y&&!Y.some((G)=>$.endsWith(G)))throw Error(`${$} is not a valid ENS TLD (${Y?.join(", ")}) for chain "${Z.name}" (id: ${Z.id}).`);let[q]=await f(D,aD,"readContract")({address:X,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[cD(C7($))],blockNumber:J,blockTag:Q});return q}U7();c();fB();N2();T2();async function DZ(D,F){let{account:J=D.account,blockNumber:Q,blockTag:$="latest",blobs:Z,data:X,gas:Y,gasPrice:q,maxFeePerBlobGas:G,maxFeePerGas:W,maxPriorityFeePerGas:B,to:K,value:U,...V}=F,H=J?i(J):void 0;try{$0(F);let _=(typeof Q==="bigint"?k(Q):void 0)||$,M=D.chain?.formatters?.transactionRequest?.format,O=(M||Q0)({...i0(V,{format:M}),account:H,blobs:Z,data:X,gas:Y,gasPrice:q,maxFeePerBlobGas:G,maxFeePerGas:W,maxPriorityFeePerGas:B,to:K,value:U},"createAccessList"),E=await D.request({method:"eth_createAccessList",params:[O,_]});return{accessList:E.accessList,gasUsed:BigInt(E.gasUsed)}}catch(z){throw d$(z,{...F,account:H,chain:D.chain})}}async function HN(D){let F=m1(D,{method:"eth_newBlockFilter"}),J=await D.request({method:"eth_newBlockFilter"});return{id:J,request:F(J),type:"block"}}c();async function FZ(D,{address:F,args:J,event:Q,events:$,fromBlock:Z,strict:X,toBlock:Y}={}){let q=$??(Q?[Q]:void 0),G=m1(D,{method:"eth_newFilter"}),W=[];if(q){if(W=[q.flatMap((U)=>M2({abi:[U],eventName:U.name,args:J}))],Q)W=W[0]}let B=await D.request({method:"eth_newFilter",params:[{address:F,fromBlock:typeof Z==="bigint"?k(Z):Z,toBlock:typeof Y==="bigint"?k(Y):Y,...W.length?{topics:W}:{}}]});return{abi:q,args:J,eventName:Q?Q.name:void 0,fromBlock:Z,id:B,request:G(B),strict:Boolean(X),toBlock:Y,type:"event"}}async function JZ(D){let F=m1(D,{method:"eth_newPendingTransactionFilter"}),J=await D.request({method:"eth_newPendingTransactionFilter"});return{id:J,request:F(J),type:"transaction"}}c();async function zN(D,{address:F,blockNumber:J,blockTag:Q=D.experimental_blockTag??"latest"}){let $=typeof J==="bigint"?k(J):void 0,Z=await D.request({method:"eth_getBalance",params:[F,$||Q]});return BigInt(Z)}async function CN(D){let F=await D.request({method:"eth_blobBaseFee"});return BigInt(F)}D0();c();async function _N(D,{blockHash:F,blockNumber:J,blockTag:Q="latest"}={}){let $=J!==void 0?k(J):void 0,Z;if(F)Z=await D.request({method:"eth_getBlockTransactionCountByHash",params:[F]},{dedupe:!0});else Z=await D.request({method:"eth_getBlockTransactionCountByNumber",params:[$||Q]},{dedupe:Boolean($)});return OD(Z)}c();async function S4(D,{address:F,blockNumber:J,blockTag:Q="latest"}){let $=J!==void 0?k(J):void 0,Z=await D.request({method:"eth_getCode",params:[F,$||Q]},{dedupe:Boolean($)});if(Z==="0x")return;return Z}s();class FK extends P{constructor({address:D}){super(`No EIP-712 domain found on contract "${D}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${D}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function ON(D,F){let{address:J,factory:Q,factoryData:$}=F;try{let[Z,X,Y,q,G,W,B]=await f(D,aD,"readContract")({abi:oa,address:J,functionName:"eip712Domain",factory:Q,factoryData:$});return{domain:{name:X,version:Y,chainId:Number(q),verifyingContract:G,salt:W},extensions:B,fields:Z}}catch(Z){let X=Z;if(X.name==="ContractFunctionExecutionError"&&X.cause.name==="ContractFunctionZeroDataError")throw new FK({address:J});throw X}}var oa=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];c();function MN(D){return{baseFeePerGas:D.baseFeePerGas.map((F)=>BigInt(F)),gasUsedRatio:D.gasUsedRatio,oldestBlock:BigInt(D.oldestBlock),reward:D.reward?.map((F)=>F.map((J)=>BigInt(J)))}}async function EN(D,{blockCount:F,blockNumber:J,blockTag:Q="latest",rewardPercentiles:$}){let Z=typeof J==="bigint"?k(J):void 0,X=await D.request({method:"eth_feeHistory",params:[k(F),Z||Q,$]},{dedupe:Boolean(Z)});return MN(X)}async function RN(D,{filter:F}){let J=F.strict??!1,$=(await F.request({method:"eth_getFilterLogs",params:[F.id]})).map((Z)=>E0(Z));if(!F.abi)return $;return J7({abi:F.abi,logs:$,strict:J})}c();Q1();G3();async function AN({address:D,authorization:F,signature:J}){return O8(RD(D),await a1({authorization:F,signature:J}))}s();tF();p6();c();iF();var QZ=new Z8(8192);function wN(D,{enabled:F=!0,id:J}){if(!F||!J)return D();if(QZ.get(J))return QZ.get(J);let Q=D().finally(()=>QZ.delete(J));return QZ.set(J,Q),Q}function IN(D,F={}){return async(J,Q={})=>{let{dedupe:$=!1,methods:Z,retryDelay:X=150,retryCount:Y=3,uid:q}={...F,...Q},{method:G}=J;if(Z?.exclude?.includes(G))throw new d1(Error("method not supported"),{method:G});if(Z?.include&&!Z.include.includes(G))throw new d1(Error("method not supported"),{method:G});let W=$?G0(`${q}.${qD(J)}`):void 0;return wN(()=>H3(async()=>{try{return await D(J)}catch(B){let K=B;switch(K.code){case I6.code:throw new I6(K);case N6.code:throw new N6(K);case T6.code:throw new T6(K,{method:J.method});case L6.code:throw new L6(K);case X1.code:throw new X1(K);case _8.code:throw new _8(K);case P6.code:throw new P6(K);case j6.code:throw new j6(K);case S6.code:throw new S6(K);case d1.code:throw new d1(K,{method:J.method});case eF.code:throw new eF(K);case x6.code:throw new x6(K);case D3.code:throw new D3(K);case k6.code:throw new k6(K);case y6.code:throw new y6(K);case f6.code:throw new f6(K);case h6.code:throw new h6(K);case b6.code:throw new b6(K);case p1.code:throw new p1(K);case v6.code:throw new v6(K);case u6.code:throw new u6(K);case g6.code:throw new g6(K);case m6.code:throw new m6(K);case d6.code:throw new d6(K);case l1.code:throw new l1(K);case 5000:throw new D3(K);default:if(B instanceof P)throw B;throw new PW(K)}}},{delay:({count:B,error:K})=>{if(K&&K instanceof p8){let U=K?.headers?.get("Retry-After");if(U?.match(/\d/))return Number.parseInt(U,10)*1000}return~~(1<<B)*X},retryCount:Y,shouldRetry:({error:B})=>aa(B)}),{enabled:$,id:W})}}function aa(D){if("code"in D&&typeof D.code==="number"){if(D.code===-1)return!0;if(D.code===eF.code)return!0;if(D.code===X1.code)return!0;return!1}if(D instanceof p8&&D.status){if(D.status===403)return!0;if(D.status===408)return!0;if(D.status===413)return!0;if(D.status===429)return!0;if(D.status===500)return!0;if(D.status===502)return!0;if(D.status===503)return!0;if(D.status===504)return!0;return!1}return!0}function x4(D){let F={formatters:void 0,fees:void 0,serializers:void 0,...D};function J(Q){return($)=>{let Z=typeof $==="function"?$(Q):$,X={...Q,...Z};return Object.assign(X,{extend:J(X)})}}return Object.assign(F,{extend:J(F)})}D0();c();z8();function JK(D){return e(D)&&GD(D)===32}tF();function NN(D,{errorInstance:F=Error("timed out"),timeout:J,signal:Q}){return new Promise(($,Z)=>{(async()=>{let X;try{let Y=new AbortController;if(J>0)X=setTimeout(()=>{if(Q)Y.abort();else Z(F)},J);$(await D({signal:Y?.signal||null}))}catch(Y){if(Y?.name==="AbortError")Z(F);Z(Y)}finally{clearTimeout(X)}})()})}function ra(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var QK=ra();function TN(D,F={}){return{async request(J){let{body:Q,fetchFn:$=F.fetchFn??fetch,onRequest:Z=F.onRequest,onResponse:X=F.onResponse,timeout:Y=F.timeout??1e4}=J,q={...F.fetchOptions??{},...J.fetchOptions??{}},{headers:G,method:W,signal:B}=q;try{let K=await NN(async({signal:V})=>{let H={...q,body:Array.isArray(Q)?qD(Q.map((C)=>({jsonrpc:"2.0",id:C.id??QK.take(),...C}))):qD({jsonrpc:"2.0",id:Q.id??QK.take(),...Q}),headers:{"Content-Type":"application/json",...G},method:W||"POST",signal:B||(Y>0?V:null)},z=new Request(D,H),_=await Z?.(z,H)??{...H,url:D};return await $(_.url??D,_)},{errorInstance:new U$({body:Q,url:D}),timeout:Y,signal:!0});if(X)await X(K);let U;if(K.headers.get("Content-Type")?.startsWith("application/json"))U=await K.json();else{U=await K.text();try{U=JSON.parse(U||"{}")}catch(V){if(K.ok)throw V;U={error:U}}}if(!K.ok)throw new p8({body:Q,details:qD(U.error)||K.statusText,headers:K.headers,status:K.status,url:D});return U}catch(K){if(K instanceof p8)throw K;if(K instanceof U$)throw K;throw new p8({body:Q,cause:K,url:D})}}}}g8();var LN=`\x19Ethereum Signed Message:
|
|
282
|
+
`;z8();c();function PN(D){let F=(()=>{if(typeof D==="string")return G0(D);if(typeof D.raw==="string")return D.raw;return BD(D.raw)})(),J=G0(`${LN}${GD(F)}`);return nD([J,F])}function $Z(D,F){return MD(PN(D),F)}_2();c();g8();gD();nF();s();class $K extends P{constructor({domain:D}){super(`Invalid domain "${qD(D)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class ZK extends P{constructor({primaryType:D,types:F}){super(`Invalid primary type \`${D}\` must be one of \`${JSON.stringify(Object.keys(F))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class XK extends P{constructor({type:D}){super(`Struct type "${D}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}z2();z8();c();UW();function jN(D){let{domain:F,message:J,primaryType:Q,types:$}=D,Z=(q,G)=>{let W={...G};for(let B of q){let{name:K,type:U}=B;if(U==="address")W[K]=W[K].toLowerCase()}return W},X=(()=>{if(!$.EIP712Domain)return{};if(!F)return{};return Z($.EIP712Domain,F)})(),Y=(()=>{if(Q==="EIP712Domain")return;return Z($[Q],J)})();return qD({domain:X,message:Y,primaryType:Q,types:$})}function ZZ(D){let{domain:F,message:J,primaryType:Q,types:$}=D,Z=(X,Y)=>{for(let q of X){let{name:G,type:W}=q,B=Y[G],K=W.match(J$);if(K&&(typeof B==="number"||typeof B==="bigint")){let[H,z,_]=K;k(B,{signed:z==="int",size:Number.parseInt(_,10)/8})}if(W==="address"&&typeof B==="string"&&!FD(B))throw new j0({address:B});let U=W.match(kA);if(U){let[H,z]=U;if(z&&GD(B)!==Number.parseInt(z,10))throw new eG({expectedSize:Number.parseInt(z,10),givenSize:GD(B)})}let V=$[W];if(V)sa(W),Z(V,B)}};if($.EIP712Domain&&F){if(typeof F!=="object")throw new $K({domain:F});Z($.EIP712Domain,F)}if(Q!=="EIP712Domain")if($[Q])Z($[Q],J);else throw new ZK({primaryType:Q,types:$})}function XZ({domain:D}){return[typeof D?.name==="string"&&{name:"name",type:"string"},D?.version&&{name:"version",type:"string"},(typeof D?.chainId==="number"||typeof D?.chainId==="bigint")&&{name:"chainId",type:"uint256"},D?.verifyingContract&&{name:"verifyingContract",type:"address"},D?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function sa(D){if(D==="address"||D==="bool"||D==="string"||D.startsWith("bytes")||D.startsWith("uint")||D.startsWith("int"))throw new XK({type:D})}function SN(D){let{domain:F={},message:J,primaryType:Q}=D,$={EIP712Domain:XZ({domain:F}),...D.types};ZZ({domain:F,message:J,primaryType:Q,types:$});let Z=["0x1901"];if(F)Z.push(ta({domain:F,types:$}));if(Q!=="EIP712Domain")Z.push(xN({data:J,primaryType:Q,types:$}));return MD(nD(Z))}function ta({domain:D,types:F}){return xN({data:D,primaryType:"EIP712Domain",types:F})}function xN({data:D,primaryType:F,types:J}){let Q=kN({data:D,primaryType:F,types:J});return MD(Q)}function kN({data:D,primaryType:F,types:J}){let Q=[{type:"bytes32"}],$=[ea({primaryType:F,types:J})];for(let Z of J[F]){let[X,Y]=fN({types:J,name:Z.name,type:Z.type,value:D[Z.name]});Q.push(X),$.push(Y)}return iD(Q,$)}function ea({primaryType:D,types:F}){let J=cD(Dr({primaryType:D,types:F}));return MD(J)}function Dr({primaryType:D,types:F}){let J="",Q=yN({primaryType:D,types:F});Q.delete(D);let $=[D,...Array.from(Q).sort()];for(let Z of $)J+=`${Z}(${F[Z].map(({name:X,type:Y})=>`${Y} ${X}`).join(",")})`;return J}function yN({primaryType:D,types:F},J=new Set){let $=D.match(/^\w*/u)?.[0];if(J.has($)||F[$]===void 0)return J;J.add($);for(let Z of F[$])yN({primaryType:Z.type,types:F},J);return J}function fN({types:D,name:F,type:J,value:Q}){if(D[J]!==void 0)return[{type:"bytes32"},MD(kN({data:Q,primaryType:J,types:D}))];if(J==="bytes")return[{type:"bytes32"},MD(Q)];if(J==="string")return[{type:"bytes32"},MD(cD(Q))];if(J.lastIndexOf("]")===J.length-1){let $=J.slice(0,J.lastIndexOf("[")),Z=Q.map((X)=>fN({name:F,type:$,types:D,value:X}));return[{type:"bytes32"},MD(iD(Z.map(([X])=>X),Z.map(([,X])=>X)))]}return[{type:J},Q]}var b4={};K8(b4,{wrap:()=>hr,validate:()=>br,unwrap:()=>zT,suffixParameters:()=>NK,magicBytes:()=>IK,from:()=>fr,assert:()=>CZ,InvalidWrappedSignatureError:()=>TK});C6();DF();class YK extends Map{constructor(D){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=D}get(D){let F=super.get(D);if(super.has(D)&&F!==void 0)this.delete(D),super.set(D,F);return F}set(D,F){if(super.set(D,F),this.maxSize&&this.size>this.maxSize){let J=this.keys().next().value;if(J)this.delete(J)}return this}}var Fr={checksum:new YK(8192)},YZ=Fr.checksum;a0();qW();DF();X0();function C3(D,F={}){let{as:J=typeof D==="string"?"Hex":"Bytes"}=F,Q=eQ(wI(D));if(J==="Bytes")return Q;return dD(Q)}DF();a0();X0();function hN(D,F={}){let{compressed:J}=F,{prefix:Q,x:$,y:Z}=D;if(J===!1||typeof $==="bigint"&&typeof Z==="bigint"){if(Q!==4)throw new GK({prefix:Q,cause:new mN});return}if(J===!0||typeof $==="bigint"&&typeof Z>"u"){if(Q!==3&&Q!==2)throw new GK({prefix:Q,cause:new gN});return}throw new uN({publicKey:D})}function bN(D){let F=(()=>{if(I4(D))return vN(D);if(jI(D))return Qr(D);let{prefix:J,x:Q,y:$}=D;if(typeof Q==="bigint"&&typeof $==="bigint")return{prefix:J??4,x:Q,y:$};return{prefix:J,x:Q}})();return hN(F),F}function Qr(D){return vN(dD(D))}function vN(D){if(D.length!==132&&D.length!==130&&D.length!==68)throw new dN({publicKey:D});if(D.length===130){let Q=BigInt(LD(D,0,32)),$=BigInt(LD(D,32,64));return{prefix:4,x:Q,y:$}}if(D.length===132){let Q=Number(LD(D,0,1)),$=BigInt(LD(D,1,33)),Z=BigInt(LD(D,33,65));return{prefix:Q,x:$,y:Z}}let F=Number(LD(D,0,1)),J=BigInt(LD(D,1,33));return{prefix:F,x:J}}function WK(D,F={}){hN(D);let{prefix:J,x:Q,y:$}=D,{includePrefix:Z=!0}=F;return yD(Z?KD(J,{size:1}):"0x",KD(Q,{size:32}),typeof $==="bigint"?KD($,{size:32}):"0x")}class uN extends d{constructor({publicKey:D}){super(`Value \`${FF(D)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class GK extends d{constructor({prefix:D,cause:F}){super(`Prefix "${D}" is invalid.`,{cause:F});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class gN extends d{constructor(){super("Prefix must be 2 or 3 for compressed public keys.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class mN extends d{constructor(){super("Prefix must be 4 for uncompressed public keys.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class dN extends d{constructor({publicKey:D}){super(`Value \`${D}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${TD(Y7(D))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}var $r=/^0x[a-fA-F0-9]{40}$/;function _3(D,F={}){let{strict:J=!0}=F;if(!$r.test(D))throw new BK({address:D,cause:new cN});if(J){if(D.toLowerCase()===D)return;if(qZ(D)!==D)throw new BK({address:D,cause:new nN})}}function qZ(D){if(YZ.has(D))return YZ.get(D);_3(D,{strict:!1});let F=D.substring(2).toLowerCase(),J=C3(II(F),{as:"Bytes"}),Q=F.split("");for(let Z=0;Z<40;Z+=2){if(J[Z>>1]>>4>=8&&Q[Z])Q[Z]=Q[Z].toUpperCase();if((J[Z>>1]&15)>=8&&Q[Z+1])Q[Z+1]=Q[Z+1].toUpperCase()}let $=`0x${Q.join("")}`;return YZ.set(D,$),$}function Zr(D,F={}){let{checksum:J=!1}=F;if(_3(D),J)return qZ(D);return D}function lN(D,F={}){let J=C3(`0x${WK(D).slice(4)}`).substring(26);return Zr(`0x${J}`,F)}function GZ(D,F={}){let{strict:J=!0}=F??{};try{return _3(D,{strict:J}),!0}catch{return!1}}class BK extends d{constructor({address:D,cause:F}){super(`Address "${D}" is invalid.`,{cause:F});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class cN extends d{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class nN extends d{constructor(){super("Address does not match its checksum counterpart.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}DF();a0();X0();DF();a0();X0();var iN=/^(.*)\[([0-9]*)\]$/,oN=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,BZ=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,tfD=2n**(8n-1n)-1n,efD=2n**(16n-1n)-1n,DhD=2n**(24n-1n)-1n,FhD=2n**(32n-1n)-1n,JhD=2n**(40n-1n)-1n,QhD=2n**(48n-1n)-1n,$hD=2n**(56n-1n)-1n,ZhD=2n**(64n-1n)-1n,XhD=2n**(72n-1n)-1n,YhD=2n**(80n-1n)-1n,qhD=2n**(88n-1n)-1n,GhD=2n**(96n-1n)-1n,WhD=2n**(104n-1n)-1n,BhD=2n**(112n-1n)-1n,KhD=2n**(120n-1n)-1n,UhD=2n**(128n-1n)-1n,VhD=2n**(136n-1n)-1n,HhD=2n**(144n-1n)-1n,zhD=2n**(152n-1n)-1n,ChD=2n**(160n-1n)-1n,_hD=2n**(168n-1n)-1n,OhD=2n**(176n-1n)-1n,MhD=2n**(184n-1n)-1n,EhD=2n**(192n-1n)-1n,RhD=2n**(200n-1n)-1n,AhD=2n**(208n-1n)-1n,whD=2n**(216n-1n)-1n,IhD=2n**(224n-1n)-1n,NhD=2n**(232n-1n)-1n,ThD=2n**(240n-1n)-1n,LhD=2n**(248n-1n)-1n,PhD=2n**(256n-1n)-1n,jhD=-(2n**(8n-1n)),ShD=-(2n**(16n-1n)),xhD=-(2n**(24n-1n)),khD=-(2n**(32n-1n)),yhD=-(2n**(40n-1n)),fhD=-(2n**(48n-1n)),hhD=-(2n**(56n-1n)),bhD=-(2n**(64n-1n)),vhD=-(2n**(72n-1n)),uhD=-(2n**(80n-1n)),ghD=-(2n**(88n-1n)),mhD=-(2n**(96n-1n)),dhD=-(2n**(104n-1n)),phD=-(2n**(112n-1n)),lhD=-(2n**(120n-1n)),chD=-(2n**(128n-1n)),nhD=-(2n**(136n-1n)),ihD=-(2n**(144n-1n)),ohD=-(2n**(152n-1n)),ahD=-(2n**(160n-1n)),rhD=-(2n**(168n-1n)),shD=-(2n**(176n-1n)),thD=-(2n**(184n-1n)),ehD=-(2n**(192n-1n)),DbD=-(2n**(200n-1n)),FbD=-(2n**(208n-1n)),JbD=-(2n**(216n-1n)),QbD=-(2n**(224n-1n)),$bD=-(2n**(232n-1n)),ZbD=-(2n**(240n-1n)),XbD=-(2n**(248n-1n)),YbD=-(2n**(256n-1n)),qbD=2n**8n-1n,GbD=2n**16n-1n,WbD=2n**24n-1n,BbD=2n**32n-1n,KbD=2n**40n-1n,UbD=2n**48n-1n,VbD=2n**56n-1n,HbD=2n**64n-1n,zbD=2n**72n-1n,CbD=2n**80n-1n,_bD=2n**88n-1n,ObD=2n**96n-1n,MbD=2n**104n-1n,EbD=2n**112n-1n,RbD=2n**120n-1n,AbD=2n**128n-1n,wbD=2n**136n-1n,IbD=2n**144n-1n,NbD=2n**152n-1n,TbD=2n**160n-1n,LbD=2n**168n-1n,PbD=2n**176n-1n,jbD=2n**184n-1n,SbD=2n**192n-1n,xbD=2n**200n-1n,kbD=2n**208n-1n,ybD=2n**216n-1n,fbD=2n**224n-1n,hbD=2n**232n-1n,bbD=2n**240n-1n,vbD=2n**248n-1n,KK=2n**256n-1n;function O3(D,F,J){let{checksumAddress:Q,staticPosition:$}=J,Z=HK(F.type);if(Z){let[X,Y]=Z;return Yr(D,{...F,type:Y},{checksumAddress:Q,length:X,staticPosition:$})}if(F.type==="tuple")return Br(D,F,{checksumAddress:Q,staticPosition:$});if(F.type==="address")return Xr(D,{checksum:Q});if(F.type==="bool")return qr(D);if(F.type.startsWith("bytes"))return Gr(D,F,{staticPosition:$});if(F.type.startsWith("uint")||F.type.startsWith("int"))return Wr(D,F);if(F.type==="string")return Kr(D,{staticPosition:$});throw new y4(F.type)}var rN=32,UK=32;function Xr(D,F={}){let{checksum:J=!1}=F,Q=D.readBytes(32);return[((Z)=>J?qZ(Z):Z)(dD(NI(Q,-20))),32]}function Yr(D,F,J){let{checksumAddress:Q,length:$,staticPosition:Z}=J;if(!$){let q=P2(D.readBytes(UK)),G=Z+q,W=G+rN;D.setPosition(G);let B=P2(D.readBytes(rN)),K=k4(F),U=0,V=[];for(let H=0;H<B;++H){D.setPosition(W+(K?H*32:U));let[z,_]=O3(D,F,{checksumAddress:Q,staticPosition:W});U+=_,V.push(z)}return D.setPosition(Z+32),[V,32]}if(k4(F)){let q=P2(D.readBytes(UK)),G=Z+q,W=[];for(let B=0;B<$;++B){D.setPosition(G+B*32);let[K]=O3(D,F,{checksumAddress:Q,staticPosition:G});W.push(K)}return D.setPosition(Z+32),[W,32]}let X=0,Y=[];for(let q=0;q<$;++q){let[G,W]=O3(D,F,{checksumAddress:Q,staticPosition:Z+X});X+=W,Y.push(G)}return[Y,X]}function qr(D){return[LI(D.readBytes(32),{size:32}),32]}function Gr(D,F,{staticPosition:J}){let[Q,$]=F.type.split("bytes");if(!$){let X=P2(D.readBytes(32));D.setPosition(J+X);let Y=P2(D.readBytes(32));if(Y===0)return D.setPosition(J+32),["0x",32];let q=D.readBytes(Y);return D.setPosition(J+32),[dD(q),32]}return[dD(D.readBytes(Number.parseInt($,10),32)),32]}function Wr(D,F){let J=F.type.startsWith("int"),Q=Number.parseInt(F.type.split("int")[1]||"256",10),$=D.readBytes(32);return[Q>48?TI($,{signed:J}):P2($,{signed:J}),32]}function Br(D,F,J){let{checksumAddress:Q,staticPosition:$}=J,Z=F.components.length===0||F.components.some(({name:q})=>!q),X=Z?[]:{},Y=0;if(k4(F)){let q=P2(D.readBytes(UK)),G=$+q;for(let W=0;W<F.components.length;++W){let B=F.components[W];D.setPosition(G+Y);let[K,U]=O3(D,B,{checksumAddress:Q,staticPosition:G});Y+=U,X[Z?W:B?.name]=K}return D.setPosition($+32),[X,32]}for(let q=0;q<F.components.length;++q){let G=F.components[q],[W,B]=O3(D,G,{checksumAddress:Q,staticPosition:$});X[Z?q:G?.name]=W,Y+=B}return[X,Y]}function Kr(D,{staticPosition:F}){let J=P2(D.readBytes(32)),Q=F+J;D.setPosition(Q);let $=P2(D.readBytes(32));if($===0)return D.setPosition(F+32),["",32];let Z=D.readBytes($,32),X=PI(AB(Z));return D.setPosition(F+32),[X,32]}function sN({checksumAddress:D,parameters:F,values:J}){let Q=[];for(let $=0;$<F.length;$++)Q.push(VK({checksumAddress:D,parameter:F[$],value:J[$]}));return Q}function VK({checksumAddress:D=!1,parameter:F,value:J}){let Q=F,$=HK(Q.type);if($){let[Z,X]=$;return Vr(J,{checksumAddress:D,length:Z,parameter:{...Q,type:X}})}if(Q.type==="tuple")return Or(J,{checksumAddress:D,parameter:Q});if(Q.type==="address")return Ur(J,{checksum:D});if(Q.type==="bool")return zr(J);if(Q.type.startsWith("uint")||Q.type.startsWith("int")){let Z=Q.type.startsWith("int"),[,,X="256"]=BZ.exec(Q.type)??[];return Cr(J,{signed:Z,size:Number(X)})}if(Q.type.startsWith("bytes"))return Hr(J,{type:Q.type});if(Q.type==="string")return _r(J);throw new y4(Q.type)}function KZ(D){let F=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)F+=32;else F+=TD(Y)}let J=[],Q=[],$=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)J.push(KD(F+$,{size:32})),Q.push(Y),$+=TD(Y);else J.push(Y)}return yD(...J,...Q)}function Ur(D,F){let{checksum:J=!1}=F;return _3(D,{strict:J}),{dynamic:!1,encoded:H1(D.toLowerCase())}}function Vr(D,F){let{checksumAddress:J,length:Q,parameter:$}=F,Z=Q===null;if(!Array.isArray(D))throw new CK(D);if(!Z&&D.length!==Q)throw new zK({expectedLength:Q,givenLength:D.length,type:`${$.type}[${Q}]`});let X=!1,Y=[];for(let q=0;q<D.length;q++){let G=VK({checksumAddress:J,parameter:$,value:D[q]});if(G.dynamic)X=!0;Y.push(G)}if(Z||X){let q=KZ(Y);if(Z){let G=KD(Y.length,{size:32});return{dynamic:!0,encoded:Y.length>0?yD(G,q):G}}if(X)return{dynamic:!0,encoded:q}}return{dynamic:!1,encoded:yD(...Y.map(({encoded:q})=>q))}}function Hr(D,{type:F}){let[,J]=F.split("bytes"),Q=TD(D);if(!J){let $=D;if(Q%32!==0)$=j2($,Math.ceil((D.length-2)/2/32)*32);return{dynamic:!0,encoded:yD(H1(KD(Q,{size:32})),$)}}if(Q!==Number.parseInt(J,10))throw new UZ({expectedSize:Number.parseInt(J,10),value:D});return{dynamic:!1,encoded:j2(D)}}function zr(D){if(typeof D!=="boolean")throw new d(`Invalid boolean value: "${D}" (type: ${typeof D}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:H1(x$(D))}}function Cr(D,{signed:F,size:J}){if(typeof J==="number"){let Q=2n**(BigInt(J)-(F?1n:0n))-1n,$=F?-Q-1n:0n;if(D>Q||D<$)throw new k$({max:Q.toString(),min:$.toString(),signed:F,size:J/8,value:D.toString()})}return{dynamic:!1,encoded:KD(D,{size:32,signed:F})}}function _r(D){let F=q7(D),J=Math.ceil(TD(F)/32),Q=[];for(let $=0;$<J;$++)Q.push(j2(LD(F,$*32,($+1)*32)));return{dynamic:!0,encoded:yD(j2(KD(TD(F),{size:32})),...Q)}}function Or(D,F){let{checksumAddress:J,parameter:Q}=F,$=!1,Z=[];for(let X=0;X<Q.components.length;X++){let Y=Q.components[X],q=Array.isArray(D)?X:Y.name,G=VK({checksumAddress:J,parameter:Y,value:D[q]});if(Z.push(G),G.dynamic)$=!0}return{dynamic:$,encoded:$?KZ(Z):yD(...Z.map(({encoded:X})=>X))}}function HK(D){let F=D.match(/^(.*)\[(\d+)?\]$/);return F?[F[2]?Number(F[2]):null,F[1]]:void 0}function k4(D){let{type:F}=D;if(F==="string")return!0;if(F==="bytes")return!0;if(F.endsWith("[]"))return!0;if(F==="tuple")return D.components?.some(k4);let J=HK(D.type);if(J&&k4({...D,type:J[1]}))return!0;return!1}a0();var Er={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new eN({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(D){if(D<0||D>this.bytes.length-1)throw new tN({length:this.bytes.length,position:D})},decrementPosition(D){if(D<0)throw new _K({offset:D});let F=this.position-D;this.assertPosition(F),this.position=F},getReadCount(D){return this.positionReadCount.get(D||this.position)||0},incrementPosition(D){if(D<0)throw new _K({offset:D});let F=this.position+D;this.assertPosition(F),this.position=F},inspectByte(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectBytes(D,F){let J=F??this.position;return this.assertPosition(J+D-1),this.bytes.subarray(J,J+D)},inspectUint8(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectUint16(D){let F=D??this.position;return this.assertPosition(F+1),this.dataView.getUint16(F)},inspectUint24(D){let F=D??this.position;return this.assertPosition(F+2),(this.dataView.getUint16(F)<<8)+this.dataView.getUint8(F+2)},inspectUint32(D){let F=D??this.position;return this.assertPosition(F+3),this.dataView.getUint32(F)},pushByte(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushBytes(D){this.assertPosition(this.position+D.length-1),this.bytes.set(D,this.position),this.position+=D.length},pushUint8(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushUint16(D){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,D),this.position+=2},pushUint24(D){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,D>>8),this.dataView.setUint8(this.position+2,D&255),this.position+=3},pushUint32(D){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,D),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let D=this.inspectByte();return this.position++,D},readBytes(D,F){this.assertReadLimit(),this._touch();let J=this.inspectBytes(D);return this.position+=F??D,J},readUint8(){this.assertReadLimit(),this._touch();let D=this.inspectUint8();return this.position+=1,D},readUint16(){this.assertReadLimit(),this._touch();let D=this.inspectUint16();return this.position+=2,D},readUint24(){this.assertReadLimit(),this._touch();let D=this.inspectUint24();return this.position+=3,D},readUint32(){this.assertReadLimit(),this._touch();let D=this.inspectUint32();return this.position+=4,D},get remaining(){return this.bytes.length-this.position},setPosition(D){let F=this.position;return this.assertPosition(D),this.position=D,()=>this.position=F},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let D=this.getReadCount();if(this.positionReadCount.set(this.position,D+1),D>0)this.recursiveReadCount++}};function VZ(D,{recursiveReadLimit:F=8192}={}){let J=Object.create(Er);return J.bytes=D,J.dataView=new DataView(D.buffer,D.byteOffset,D.byteLength),J.positionReadCount=new Map,J.recursiveReadLimit=F,J}class _K extends d{constructor({offset:D}){super(`Offset \`${D}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class tN extends d{constructor({length:D,position:F}){super(`Position \`${F}\` is out of bounds (\`0 < position < ${D}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class eN extends d{constructor({count:D,limit:F}){super(`Recursive read limit of \`${F}\` exceeded (recursive read count: \`${D}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function _7(D,F,J={}){let{as:Q="Array",checksumAddress:$=!1}=J,Z=typeof F==="string"?X7(F):F,X=VZ(Z);if(M8(Z)===0&&D.length>0)throw new JT;if(M8(Z)&&M8(Z)<32)throw new FT({data:typeof F==="string"?F:dD(F),parameters:D,size:M8(Z)});let Y=0,q=Q==="Array"?[]:{};for(let G=0;G<D.length;++G){let W=D[G];X.setPosition(Y);let[B,K]=O3(X,W,{checksumAddress:$,staticPosition:0});if(Y+=K,Q==="Array")q.push(B);else q[W.name??G]=B}return q}function XF(D,F,J){let{checksumAddress:Q=!1}=J??{};if(D.length!==F.length)throw new MK({expectedLength:D.length,givenLength:F.length});let $=sN({checksumAddress:Q,parameters:D,values:F}),Z=KZ($);if(Z.length===0)return"0x";return Z}function OK(D,F){if(D.length!==F.length)throw new MK({expectedLength:D.length,givenLength:F.length});let J=[];for(let Q=0;Q<D.length;Q++){let $=D[Q],Z=F[Q];J.push(OK.encode($,Z))}return yD(...J)}(function(D){function F(J,Q,$=!1){if(J==="address"){let q=Q;return _3(q),H1(q.toLowerCase(),$?32:0)}if(J==="string")return q7(Q);if(J==="bytes")return Q;if(J==="bool")return H1(x$(Q),$?32:1);let Z=J.match(BZ);if(Z){let[q,G,W="256"]=Z,B=Number.parseInt(W,10)/8;return KD(Q,{size:$?32:B,signed:G==="int"})}let X=J.match(oN);if(X){let[q,G]=X;if(Number.parseInt(G,10)!==(Q.length-2)/2)throw new UZ({expectedSize:Number.parseInt(G,10),value:Q});return j2(Q,$?32:0)}let Y=J.match(iN);if(Y&&Array.isArray(Q)){let[q,G]=Y,W=[];for(let B=0;B<Q.length;B++)W.push(F(G,Q[B],!0));if(W.length===0)return"0x";return yD(...W)}throw new y4(J)}D.encode=F})(OK||(OK={}));function h4(D){if(Array.isArray(D)&&typeof D[0]==="string")return B2(D);if(typeof D==="string")return B2(D);return D}class FT extends d{constructor({data:D,parameters:F,size:J}){super(`Data size of ${J} bytes is too small for given parameters.`,{metaMessages:[`Params: (${s2(F)})`,`Data: ${D} (${J} bytes)`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class JT extends d{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.');Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class zK extends d{constructor({expectedLength:D,givenLength:F,type:J}){super(`Array length mismatch for type \`${J}\`. Expected: \`${D}\`. Given: \`${F}\`.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class UZ extends d{constructor({expectedSize:D,value:F}){super(`Size of bytes "${F}" (bytes${TD(F)}) does not match expected size (bytes${D}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class MK extends d{constructor({expectedLength:D,givenLength:F}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${D}`,`Given length (values): ${F}`].join(`
|
|
283
|
+
`));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class CK extends d{constructor(D){super(`Value \`${D}\` is not a valid array.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class y4 extends d{constructor(D){super(`Type \`${D}\` is not a valid ABI Type.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}X0();DF();a0();X0();function Rr(D,F){let{as:J}=F,Q=$T(D),$=VZ(new Uint8Array(Q.length));if(Q.encode($),J==="Hex")return dD($.bytes);return $.bytes}function QT(D,F={}){let{as:J="Hex"}=F;return Rr(D,{as:J})}function $T(D){if(Array.isArray(D))return Ar(D.map((F)=>$T(F)));return wr(D)}function Ar(D){let F=D.reduce(($,Z)=>$+Z.length,0),J=ZT(F);return{length:(()=>{if(F<=55)return 1+F;return 1+J+F})(),encode($){if(F<=55)$.pushByte(192+F);else if($.pushByte(247+J),J===1)$.pushUint8(F);else if(J===2)$.pushUint16(F);else if(J===3)$.pushUint24(F);else $.pushUint32(F);for(let{encode:Z}of D)Z($)}}}function wr(D){let F=typeof D==="string"?X7(D):D,J=ZT(F.length);return{length:(()=>{if(F.length===1&&F[0]<128)return 1;if(F.length<=55)return 1+F.length;return 1+J+F.length})(),encode($){if(F.length===1&&F[0]<128)$.pushBytes(F);else if(F.length<=55)$.pushByte(128+F.length),$.pushBytes(F);else{if($.pushByte(183+J),J===1)$.pushUint8(F.length);else if(J===2)$.pushUint16(F.length);else if(J===3)$.pushUint24(F.length);else $.pushUint32(F.length);$.pushBytes(F)}}}}function ZT(D){if(D<=255)return 1;if(D<=65535)return 2;if(D<=16777215)return 3;if(D<=4294967295)return 4;throw new d("Length is too large.")}a0();X0();function EK(D,F={}){let{recovered:J}=F;if(typeof D.r>"u")throw new HZ({signature:D});if(typeof D.s>"u")throw new HZ({signature:D});if(J&&typeof D.yParity>"u")throw new HZ({signature:D});if(D.r<0n||D.r>KK)throw new GT({value:D.r});if(D.s<0n||D.s>KK)throw new WT({value:D.s});if(typeof D.yParity==="number"&&D.yParity!==0&&D.yParity!==1)throw new zZ({value:D.yParity})}function Nr(D){return XT(dD(D))}function XT(D){if(D.length!==130&&D.length!==132)throw new qT({signature:D});let F=BigInt(LD(D,0,32)),J=BigInt(LD(D,32,64)),Q=(()=>{let $=Number(`0x${D.slice(130)}`);if(Number.isNaN($))return;try{return wK($)}catch{throw new zZ({value:$})}})();if(typeof Q>"u")return{r:F,s:J};return{r:F,s:J,yParity:Q}}function RK(D){if(typeof D.r>"u")return;if(typeof D.s>"u")return;return AK(D)}function AK(D){let F=(()=>{if(typeof D==="string")return XT(D);if(D instanceof Uint8Array)return Nr(D);if(typeof D.r==="string")return Lr(D);if(D.v)return Tr(D);return{r:D.r,s:D.s,...typeof D.yParity<"u"?{yParity:D.yParity}:{}}})();return EK(F),F}function Tr(D){return{r:D.r,s:D.s,yParity:wK(D.v)}}function Lr(D){let F=(()=>{let J=D.v?Number(D.v):void 0,Q=D.yParity?Number(D.yParity):void 0;if(typeof J==="number"&&typeof Q!=="number")Q=wK(J);if(typeof Q!=="number")throw new zZ({value:D.yParity});return Q})();return{r:BigInt(D.r),s:BigInt(D.s),yParity:F}}function YT(D){let{r:F,s:J,yParity:Q}=D;return[Q?"0x01":"0x",F===0n?"0x":TB(KD(F)),J===0n?"0x":TB(KD(J))]}function wK(D){if(D===0||D===27)return 0;if(D===1||D===28)return 1;if(D>=35)return D%2===0?1:0;throw new BT({value:D})}class qT extends d{constructor({signature:D}){super(`Value \`${D}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${TD(Y7(D))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class HZ extends d{constructor({signature:D}){super(`Signature \`${FF(D)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class GT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid r value. r must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class WT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid s value. s must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class zZ extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class BT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid v value. v must be 27, 28 or >=35.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function UT(D,F={}){if(typeof D.chainId==="string")return Pr(D);return{...D,...F.signature}}function Pr(D){let{address:F,chainId:J,nonce:Q}=D,$=RK(D);return{address:F,chainId:Number(J),nonce:BigInt(Q),...$}}function VT(D){return jr(D,{presign:!0})}function jr(D,F={}){let{presign:J}=F;return C3(yD("0x05",QT(Sr(J?{address:D.address,chainId:D.chainId,nonce:D.nonce}:D))))}function Sr(D){let{address:F,chainId:J,nonce:Q}=D,$=RK(D);return[J?KD(J):"0x",F,Q?KD(Q):"0x",...$?YT($):[]]}a0();X0();M$();X0();function HT(D){return lN(kr(D))}function kr(D){let{payload:F,signature:J}=D,{r:Q,s:$,yParity:Z}=J,Y=new U1.Signature(BigInt(Q),BigInt($)).addRecoveryBit(Z).recoverPublicKey(Y7(F).substring(2));return bN(Y)}var IK="0x8010801080108010801080108010801080108010801080108010801080108010",NK=h4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function CZ(D){if(typeof D==="string"){if(LD(D,-32)!==IK)throw new TK(D)}else EK(D.authorization)}function fr(D){if(typeof D==="string")return zT(D);return D}function zT(D){CZ(D);let F=S$(LD(D,-64,-32)),J=LD(D,-F-64,-64),Q=LD(D,0,-F-64),[$,Z,X]=_7(NK,J);return{authorization:UT({address:$.delegation,chainId:Number($.chainId),nonce:$.nonce,yParity:$.yParity,r:$.r,s:$.s}),signature:Q,...X&&X!=="0x"?{data:X,to:Z}:{}}}function hr(D){let{data:F,signature:J}=D;CZ(D);let Q=HT({payload:VT(D.authorization),signature:AK(D.authorization)}),$=XF(NK,[{...D.authorization,delegation:D.authorization.address,chainId:BigInt(D.authorization.chainId)},D.to??Q,F??"0x"]),Z=KD(TD($),{size:32});return yD(J,$,Z,IK)}function br(D){try{return CZ(D),!0}catch{return!1}}class TK extends d{constructor(D){super(`Value \`${D}\` is an invalid ERC-8010 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}s();class LK extends P{constructor({value:D}){super(`Number \`${D}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function M3(D,F){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(D))throw new LK({value:D});let[J,Q="0"]=D.split("."),$=J.startsWith("-");if($)J=J.slice(1);if(Q=Q.replace(/(0+)$/,""),F===0){if(Math.round(Number(`.${Q}`))===1)J=`${BigInt(J)+1n}`;Q=""}else if(Q.length>F){let[Z,X,Y]=[Q.slice(0,F-1),Q.slice(F-1,F),Q.slice(F)],q=Math.round(Number(`${X}.${Y}`));if(q>9)Q=`${BigInt(Z)+BigInt(1)}0`.padStart(Z.length+1,"0");else Q=`${Z}${q}`;if(Q.length>F)Q=Q.slice(1),J=`${BigInt(J)+1n}`;Q=Q.slice(0,F)}else Q=Q.padEnd(F,"0");return BigInt(`${$?"-":""}${J}${Q}`)}function gr(D){return D.map((F)=>({...F,value:BigInt(F.value)}))}function CT(D){return{...D,balance:D.balance?BigInt(D.balance):void 0,nonce:D.nonce?OD(D.nonce):void 0,storageProof:D.storageProof?gr(D.storageProof):void 0}}async function _T(D,{address:F,blockNumber:J,blockTag:Q,storageKeys:$}){let Z=Q??"latest",X=J!==void 0?k(J):void 0,Y=await D.request({method:"eth_getProof",params:[F,$,X||Z]});return CT(Y)}c();async function OT(D,{address:F,blockNumber:J,blockTag:Q="latest",slot:$}){let Z=J!==void 0?k(J):void 0;return await D.request({method:"eth_getStorageAt",params:[F,$,Z||Q]})}R2();c();async function O7(D,{blockHash:F,blockNumber:J,blockTag:Q,hash:$,index:Z,sender:X,nonce:Y}){let q=Q||"latest",G=J!==void 0?k(J):void 0,W=null;if($)W=await D.request({method:"eth_getTransactionByHash",params:[$]},{dedupe:!0});else if(F)W=await D.request({method:"eth_getTransactionByBlockHashAndIndex",params:[F,k(Z)]},{dedupe:!0});else if((G||q)&&typeof Z==="number")W=await D.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[G||q,k(Z)]},{dedupe:Boolean(G)});else if(X&&typeof Y==="number")W=await D.request({method:"eth_getTransactionBySenderAndNonce",params:[X,k(Y)]},{dedupe:!0});if(!W)throw new D4({blockHash:F,blockNumber:J,blockTag:q,hash:$,index:Z});return(D.chain?.formatters?.transaction?.format||s6)(W,"getTransaction")}async function MT(D,{hash:F,transactionReceipt:J}){let[Q,$]=await Promise.all([f(D,x2,"getBlockNumber")({}),F?f(D,O7,"getTransaction")({hash:F}):void 0]),Z=J?.blockNumber||$?.blockNumber;if(!Z)return 0n;return Q-Z+1n}R2();async function M7(D,{hash:F}){let J=await D.request({method:"eth_getTransactionReceipt",params:[F]},{dedupe:!0});if(!J)throw new F4({hash:F});return(D.chain?.formatters?.transactionReceipt?.format||l$)(J,"getTransactionReceipt")}z1();gD();s();Z1();e1();X8();U3();async function ET(D,F){let{account:J,authorizationList:Q,allowFailure:$=!0,blockNumber:Z,blockOverrides:X,blockTag:Y,stateOverride:q}=F,G=F.contracts,{batchSize:W=F.batchSize??1024,deployless:B=F.deployless??!1}=typeof D.batch?.multicall==="object"?D.batch.multicall:{},K=(()=>{if(F.multicallAddress)return F.multicallAddress;if(B)return null;if(D.chain)return E8({blockNumber:Z,chain:D.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),U=[[]],V=0,H=0;for(let M=0;M<G.length;M++){let{abi:C,address:O,args:E,functionName:A}=G[M];try{let N=AD({abi:C,args:E,functionName:A});if(H+=(N.length-2)/2,W>0&&H>W&&U[V].length>0)V++,H=(N.length-2)/2,U[V]=[];U[V]=[...U[V],{allowFailure:!0,callData:N,target:O}]}catch(N){let w=Y8(N,{abi:C,address:O,args:E,docsPath:"/docs/contract/multicall",functionName:A,sender:J});if(!$)throw w;U[V]=[...U[V],{allowFailure:!0,callData:"0x",target:O}]}}let z=await Promise.allSettled(U.map((M)=>f(D,aD,"readContract")({...K===null?{code:W7}:{address:K},abi:JF,account:J,args:[M],authorizationList:Q,blockNumber:Z,blockOverrides:X,blockTag:Y,functionName:"aggregate3",stateOverride:q}))),_=[];for(let M=0;M<z.length;M++){let C=z[M];if(C.status==="rejected"){if(!$)throw C.reason;for(let E=0;E<U[M].length;E++)_.push({status:"failure",error:C.reason,result:void 0});continue}let O=C.value;for(let E=0;E<O.length;E++){let{returnData:A,success:N}=O[E],{callData:w}=U[M][E],{abi:T,address:I,functionName:S,args:L}=G[_.length];try{if(w==="0x")throw new b8;if(!N)throw new w2({data:A});let y=o0({abi:T,args:L,data:A,functionName:S});_.push($?{result:y,status:"success"}:y)}catch(y){let m=Y8(y,{abi:T,address:I,args:L,docsPath:"/docs/contract/multicall",functionName:S});if(!$)throw m;_.push({error:m,result:void 0,status:"failure"})}}}if(_.length!==G.length)throw new P("multicall results mismatch");return _}LB();gD();Z1();Y3();e1();X8();c();M4();N2();R$();T2();async function v4(D,F){let{blockNumber:J,blockTag:Q=D.experimental_blockTag??"latest",blocks:$,returnFullTransactions:Z,traceTransfers:X,validation:Y}=F;try{let q=[];for(let K of $){let U=K.blockOverrides?y$(K.blockOverrides):void 0,V=K.calls.map((z)=>{let _=z,M=_.account?i(_.account):void 0,C=_.abi?AD(_):_.data,O={..._,account:M,data:_.dataSuffix?nD([C||"0x",_.dataSuffix]):C,from:_.from??M?.address};return $0(O),Q0(O)}),H=K.stateOverrides?r6(K.stateOverrides):void 0;q.push({blockOverrides:U,calls:V,stateOverrides:H})}let W=(typeof J==="bigint"?k(J):void 0)||Q;return(await D.request({method:"eth_simulateV1",params:[{blockStateCalls:q,returnFullTransactions:Z,traceTransfers:X,validation:Y},W]})).map((K,U)=>({...A$(K),calls:K.calls.map((V,H)=>{let{abi:z,args:_,functionName:M,to:C}=$[U].calls[H],O=V.error?.data??V.returnData,E=BigInt(V.gasUsed),A=V.logs?.map((I)=>E0(I)),N=V.status==="0x1"?"success":"failure",w=z&&N==="success"&&O!=="0x"?o0({abi:z,data:O,functionName:M}):null,T=(()=>{if(N==="success")return;let I;if(V.error?.data==="0x")I=new b8;else if(V.error)I=new w2(V.error);if(!I)return;return Y8(I,{abi:z??[],address:C??"0x",args:_,functionName:M??"<unknown>"})})();return{data:O,gasUsed:E,logs:A,status:N,...N==="success"?{result:w}:{error:T}}})}))}catch(q){let G=q,W=s1(G,{});if(W instanceof c8)throw G;throw W}}C6();a0();X0();a0();function OZ(D){let F=!0,J="",Q=0,$="",Z=!1;for(let X=0;X<D.length;X++){let Y=D[X];if(["(",")",","].includes(Y))F=!0;if(Y==="(")Q++;if(Y===")")Q--;if(!F)continue;if(Q===0){if(Y===" "&&["event","function","error",""].includes($))$="";else if($+=Y,Y===")"){Z=!0;break}continue}if(Y===" "){if(D[X-1]!==","&&J!==","&&J!==",(")J="",F=!1;continue}$+=Y,J+=Y}if(!Z)throw new d("Unable to normalize signature.");return $}function _Z(D,F){let J=typeof D,Q=F.type;switch(Q){case"address":return GZ(D,{strict:!1});case"bool":return J==="boolean";case"function":return J==="string";case"string":return J==="string";default:{if(Q==="tuple"&&"components"in F)return Object.values(F.components).every(($,Z)=>{return _Z(Object.values(D)[Z],$)});if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(Q))return J==="number"||J==="bigint";if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(Q))return J==="string"||D instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(Q))return Array.isArray(D)&&D.every(($)=>_Z($,{...F,type:Q.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}}function PK(D,F,J){for(let Q in D){let $=D[Q],Z=F[Q];if($.type==="tuple"&&Z.type==="tuple"&&"components"in $&&"components"in Z)return PK($.components,Z.components,J[Q]);let X=[$.type,Z.type];if((()=>{if(X.includes("address")&&X.includes("bytes20"))return!0;if(X.includes("address")&&X.includes("string"))return GZ(J[Q],{strict:!1});if(X.includes("address")&&X.includes("bytes"))return GZ(J[Q],{strict:!1});return!1})())return X}return}function MZ(D,F={}){let{prepare:J=!0}=F,Q=(()=>{if(Array.isArray(D))return g9(D);if(typeof D==="string")return g9(D);return D})();return{...Q,...J?{hash:E7(Q)}:{}}}function u4(D,F,J){let{args:Q=[],prepare:$=!0}=J??{},Z=I4(F,{strict:!1}),X=D.filter((G)=>{if(Z){if(G.type==="function"||G.type==="error")return jK(G)===LD(F,0,4);if(G.type==="event")return E7(G)===F;return!1}return"name"in G&&G.name===F});if(X.length===0)throw new E3({name:F});if(X.length===1)return{...X[0],...$?{hash:E7(X[0])}:{}};let Y;for(let G of X){if(!("inputs"in G))continue;if(!Q||Q.length===0){if(!G.inputs||G.inputs.length===0)return{...G,...$?{hash:E7(G)}:{}};continue}if(!G.inputs)continue;if(G.inputs.length===0)continue;if(G.inputs.length!==Q.length)continue;if(Q.every((B,K)=>{let U="inputs"in G&&G.inputs[K];if(!U)return!1;return _Z(B,U)})){if(Y&&"inputs"in Y&&Y.inputs){let B=PK(G.inputs,Y.inputs,Q);if(B)throw new RT({abiItem:G,type:B[0]},{abiItem:Y,type:B[1]})}Y=G}}let q=(()=>{if(Y)return Y;let[G,...W]=X;return{...G,overloads:W}})();if(!q)throw new E3({name:F});return{...q,...$?{hash:E7(q)}:{}}}function jK(...D){let F=(()=>{if(Array.isArray(D[0])){let[J,Q]=D;return u4(J,Q)}return D[0]})();return LD(E7(F),0,4)}function dr(...D){let F=(()=>{if(Array.isArray(D[0])){let[Q,$]=D;return u4(Q,$)}return D[0]})(),J=(()=>{if(typeof F==="string")return F;return gF(F)})();return OZ(J)}function E7(...D){let F=(()=>{if(Array.isArray(D[0])){let[J,Q]=D;return u4(J,Q)}return D[0]})();if(typeof F!=="string"&&"hash"in F&&F.hash)return F.hash;return C3(q7(dr(F)))}class RT extends d{constructor(D,F){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${D.type}\` in \`${OZ(gF(D.abiItem))}\`, and`,`\`${F.type}\` in \`${OZ(gF(F.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class E3 extends d{constructor({name:D,data:F,type:J="item"}){let Q=(()=>{if(D)return` with name "${D}"`;if(F)return` with data "${F}"`;return""})();super(`ABI ${J}${Q} not found.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}X0();function wT(...D){let[F,J]=(()=>{if(Array.isArray(D[0])){let[Z,X]=D;return[pr(Z),X]}return D})(),{bytecode:Q,args:$}=J;return yD(Q,F.inputs?.length&&$?.length?XF(F.inputs,$):"0x")}function IT(D){return MZ(D)}function pr(D){let F=D.find((J)=>J.type==="constructor");if(!F)throw new E3({name:"constructor"});return F}X0();function TT(...D){let[F,J=[]]=(()=>{if(Array.isArray(D[0])){let[G,W,B]=D;return[NT(G,W,{args:B}),B]}let[Y,q]=D;return[Y,q]})(),{overloads:Q}=F,$=Q?NT([F,...Q],F.name,{args:J}):F,Z=cr($),X=J.length>0?XF($.inputs,J):void 0;return X?yD(Z,X):Z}function R3(D,F={}){return MZ(D,F)}function NT(D,F,J){let Q=u4(D,F,J);if(Q.type!=="function")throw new E3({name:F,type:"function"});return Q}function cr(D){return jK(D)}var LT="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",i8="0x0000000000000000000000000000000000000000";s();X8();var ir="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function PT(D,F){let{blockNumber:J,blockTag:Q,calls:$,stateOverrides:Z,traceAssetChanges:X,traceTransfers:Y,validation:q}=F,G=F.account?i(F.account):void 0;if(X&&!G)throw new P("`account` is required when `traceAssetChanges` is true");let W=G?wT(IT("constructor(bytes, bytes)"),{bytecode:v$,args:[ir,TT(R3("function getBalance(address)"),[G.address])]}):void 0,B=X?await Promise.all(F.calls.map(async(v)=>{if(!v.data&&!v.abi)return;let{accessList:u}=await DZ(D,{account:G.address,...v,data:v.abi?AD(v):v.data});return u.map(({address:o,storageKeys:lD})=>lD.length>0?o:null)})).then((v)=>v.flat().filter(Boolean)):[],K=await v4(D,{blockNumber:J,blockTag:Q,blocks:[...X?[{calls:[{data:W}],stateOverrides:Z},{calls:B.map((v,u)=>({abi:[R3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[G.address],to:v,from:i8,nonce:u})),stateOverrides:[{address:i8,nonce:0}]}]:[],{calls:[...$,{}].map((v)=>({...v,from:G?.address})),stateOverrides:Z},...X?[{calls:[{data:W}]},{calls:B.map((v,u)=>({abi:[R3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[G.address],to:v,from:i8,nonce:u})),stateOverrides:[{address:i8,nonce:0}]},{calls:B.map((v,u)=>({to:v,abi:[R3("function decimals() returns (uint256)")],functionName:"decimals",from:i8,nonce:u})),stateOverrides:[{address:i8,nonce:0}]},{calls:B.map((v,u)=>({to:v,abi:[R3("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:i8,nonce:u})),stateOverrides:[{address:i8,nonce:0}]},{calls:B.map((v,u)=>({to:v,abi:[R3("function symbol() returns (string)")],functionName:"symbol",from:i8,nonce:u})),stateOverrides:[{address:i8,nonce:0}]}]:[]],traceTransfers:Y,validation:q}),U=X?K[2]:K[0],[V,H,,z,_,M,C,O]=X?K:[],{calls:E,...A}=U,N=E.slice(0,-1)??[],w=V?.calls??[],T=H?.calls??[],I=[...w,...T].map((v)=>v.status==="success"?kD(v.data):null),S=z?.calls??[],L=_?.calls??[],y=[...S,...L].map((v)=>v.status==="success"?kD(v.data):null),m=(M?.calls??[]).map((v)=>v.status==="success"?v.result:null),j=(O?.calls??[]).map((v)=>v.status==="success"?v.result:null),h=(C?.calls??[]).map((v)=>v.status==="success"?v.result:null),g=[];for(let[v,u]of y.entries()){let o=I[v];if(typeof u!=="bigint")continue;if(typeof o!=="bigint")continue;let lD=m[v-1],ED=j[v-1],B8=h[v-1],e0=(()=>{if(v===0)return{address:LT,decimals:18,symbol:"ETH"};return{address:B[v-1],decimals:B8||lD?Number(lD??1):void 0,symbol:ED??void 0}})();if(g.some((C0)=>C0.token.address===e0.address))continue;g.push({token:e0,value:{pre:o,post:u,diff:u-o}})}return{assetChanges:g,block:A,results:N}}var g4={};K8(g4,{wrap:()=>sr,validate:()=>tr,unwrap:()=>jT,universalSignatureValidatorBytecode:()=>or,universalSignatureValidatorAbi:()=>ar,magicBytes:()=>SK,from:()=>rr,assert:()=>xK,InvalidWrappedSignatureError:()=>kK});a0();X0();var SK="0x6492649264926492649264926492649264926492649264926492649264926492",or="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",ar=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function xK(D){if(LD(D,-32)!==SK)throw new kK(D)}function rr(D){if(typeof D==="string")return jT(D);return D}function jT(D){xK(D);let[F,J,Q]=_7(h4("address, bytes, bytes"),D);return{data:J,signature:Q,to:F}}function sr(D){let{data:F,signature:J,to:Q}=D;return yD(XF(h4("address, bytes, bytes"),[Q,F,J]),SK)}function tr(D){try{return xK(D),!0}catch{return!1}}class kK extends d{constructor(D){super(`Value \`${D}\` is an invalid ERC-6492 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}z1();Z1();m$();X8();Q1();G3();D0();c();M$();D0();B0();function ST({r:D,s:F,to:J="hex",v:Q,yParity:$}){let Z=(()=>{if($===0||$===1)return $;if(Q&&(Q===27n||Q===28n||Q>=35n))return Q%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),X=`0x${new U1.Signature(kD(D),kD(F)).toCompactHex()}${Z===0?"1b":"1c"}`;if(J==="hex")return X;return W0(X)}U7();async function qF(D,F){let{address:J,chain:Q=D.chain,hash:$,erc6492VerifierAddress:Z=F.universalSignatureVerifierAddress??Q?.contracts?.erc6492Verifier?.address,multicallAddress:X=F.multicallAddress??Q?.contracts?.multicall3?.address}=F;if(Q?.verifyHash)return await Q.verifyHash(D,F);let Y=(()=>{let q=F.signature;if(e(q))return q;if(typeof q==="object"&&"r"in q&&"s"in q)return ST(q);return BD(q)})();try{if(b4.validate(Y))return await er(D,{...F,multicallAddress:X,signature:Y});return await Ds(D,{...F,verifierAddress:Z,signature:Y})}catch(q){try{if(O8(RD(J),await E$({hash:$,signature:Y})))return!0}catch{}if(q instanceof YF)return!1;throw q}}async function er(D,F){let{address:J,blockNumber:Q,blockTag:$,hash:Z,multicallAddress:X}=F,{authorization:Y,data:q,signature:G,to:W}=b4.unwrap(F.signature);if(await S4(D,{address:J,blockNumber:Q,blockTag:$})===m8(["0xef0100",Y.address]))return await Fs(D,{address:J,blockNumber:Q,blockTag:$,hash:Z,signature:G});let K={address:Y.address,chainId:Number(Y.chainId),nonce:Number(Y.nonce),r:k(Y.r,{size:32}),s:k(Y.s,{size:32}),yParity:Y.yParity};if(!await AN({address:J,authorization:K}))throw new YF;let V=await f(D,aD,"readContract")({...X?{address:X}:{code:W7},authorizationList:[K],abi:JF,blockNumber:Q,blockTag:"pending",functionName:"aggregate3",args:[[...q?[{allowFailure:!0,target:W??J,callData:q}]:[],{allowFailure:!0,target:J,callData:AD({abi:SB,functionName:"isValidSignature",args:[Z,G]})}]]});if(V[V.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new YF}async function Ds(D,F){let{address:J,factory:Q,factoryData:$,hash:Z,signature:X,verifierAddress:Y,...q}=F,G=await(async()=>{if(!Q&&!$)return X;if(g4.validate(X))return X;return g4.wrap({data:$,signature:X,to:Q})})(),W=Y?{to:Y,data:AD({abi:N4,functionName:"isValidSig",args:[J,Z,G]}),...q}:{data:K3({abi:N4,args:[J,Z,G],bytecode:uI}),...q},{data:B}=await f(D,S2,"call")(W).catch((K)=>{if(K instanceof A6)throw new YF;throw K});if(iQ(B??"0x0"))return!0;throw new YF}async function Fs(D,F){let{address:J,blockNumber:Q,blockTag:$,hash:Z,signature:X}=F;if((await f(D,aD,"readContract")({address:J,abi:SB,args:[Z,X],blockNumber:Q,blockTag:$,functionName:"isValidSignature"}).catch((q)=>{if(q instanceof w6)throw new YF;throw q})).startsWith("0x1626ba7e"))return!0;throw new YF}class YF extends Error{}async function xT(D,{address:F,message:J,factory:Q,factoryData:$,signature:Z,...X}){let Y=$Z(J);return f(D,qF,"verifyHash")({address:F,factory:Q,factoryData:$,hash:Y,signature:Z,...X})}async function kT(D,F){let{address:J,factory:Q,factoryData:$,signature:Z,message:X,primaryType:Y,types:q,domain:G,...W}=F,B=SN({message:X,primaryType:Y,types:q,domain:G});return f(D,qF,"verifyHash")({address:J,factory:Q,factoryData:$,hash:B,signature:Z,...W})}R2();D0();function EZ(D,{emitOnBegin:F=!1,emitMissed:J=!1,onBlockNumber:Q,onError:$,poll:Z,pollingInterval:X=D.pollingInterval}){let Y=(()=>{if(typeof Z<"u")return Z;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),q;return Y?(()=>{let B=qD(["watchBlockNumber",D.uid,F,J,X]);return R0(B,{onBlockNumber:Q,onError:$},(K)=>R8(async()=>{try{let U=await f(D,x2,"getBlockNumber")({cacheTime:0});if(q!==void 0){if(U===q)return;if(U-q>1&&J)for(let V=q+1n;V<U;V++)K.onBlockNumber(V,q),q=V}if(q===void 0||U>q)K.onBlockNumber(U,q),q=U}catch(U){K.onError?.(U)}},{emitOnBegin:F,interval:X}))})():(()=>{let B=qD(["watchBlockNumber",D.uid,F,J]);return R0(B,{onBlockNumber:Q,onError:$},(K)=>{let U=!0,V=()=>U=!1;return(async()=>{try{let H=(()=>{if(D.transport.type==="fallback"){let _=D.transport.transports.find((M)=>M.config.type==="webSocket"||M.config.type==="ipc");if(!_)return D.transport;return _.value}return D.transport})(),{unsubscribe:z}=await H.subscribe({params:["newHeads"],onData(_){if(!U)return;let M=kD(_.result?.number);K.onBlockNumber(M,q),q=M},onError(_){K.onError?.(_)}});if(V=z,!U)V()}catch(H){$?.(H)}})(),()=>V()})})()}async function RZ(D,F){let{checkReplacement:J=!0,confirmations:Q=1,hash:$,onReplaced:Z,retryCount:X=6,retryDelay:Y=({count:E})=>~~(1<<E)*200,timeout:q=180000}=F,G=qD(["waitForTransactionReceipt",D.uid,$]),W=(()=>{if(F.pollingInterval)return F.pollingInterval;if(D.chain?.experimental_preconfirmationTime)return D.chain.experimental_preconfirmationTime;return D.pollingInterval})(),B,K,U,V=!1,H,z,{promise:_,resolve:M,reject:C}=K7(),O=q?setTimeout(()=>{z?.(),H?.(),C(new LW({hash:$}))},q):void 0;return H=R0(G,{onReplaced:Z,resolve:M,reject:C},async(E)=>{if(U=await f(D,M7,"getTransactionReceipt")({hash:$}).catch(()=>{return}),U&&Q<=1){clearTimeout(O),E.resolve(U),H?.();return}z=f(D,EZ,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:W,async onBlockNumber(A){let N=(T)=>{clearTimeout(O),z?.(),T(),H?.()},w=A;if(V)return;try{if(U){if(Q>1&&(!U.blockNumber||w-U.blockNumber+1n<Q))return;N(()=>E.resolve(U));return}if(J&&!B)V=!0,await H3(async()=>{if(B=await f(D,O7,"getTransaction")({hash:$}),B.blockNumber)w=B.blockNumber},{delay:Y,retryCount:X}),V=!1;if(U=await f(D,M7,"getTransactionReceipt")({hash:$}),Q>1&&(!U.blockNumber||w-U.blockNumber+1n<Q))return;N(()=>E.resolve(U))}catch(T){if(T instanceof D4||T instanceof F4){if(!B){V=!1;return}try{K=B,V=!0;let I=await H3(()=>f(D,Z0,"getBlock")({blockNumber:w,includeTransactions:!0}),{delay:Y,retryCount:X,shouldRetry:({error:y})=>y instanceof R4});V=!1;let S=I.transactions.find(({from:y,nonce:m})=>y===K.from&&m===K.nonce);if(!S)return;if(U=await f(D,M7,"getTransactionReceipt")({hash:S.hash}),Q>1&&(!U.blockNumber||w-U.blockNumber+1n<Q))return;let L="replaced";if(S.to===K.to&&S.value===K.value&&S.input===K.input)L="repriced";else if(S.from===S.to&&S.value===0n)L="cancelled";N(()=>{E.onReplaced?.({reason:L,replacedTransaction:K,transaction:S,transactionReceipt:U}),E.resolve(U)})}catch(I){N(()=>E.reject(I))}}else N(()=>E.reject(T))}}})}),_}function yT(D,{blockTag:F=D.experimental_blockTag??"latest",emitMissed:J=!1,emitOnBegin:Q=!1,onBlock:$,onError:Z,includeTransactions:X,poll:Y,pollingInterval:q=D.pollingInterval}){let G=(()=>{if(typeof Y<"u")return Y;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),W=X??!1,B;return G?(()=>{let V=qD(["watchBlocks",D.uid,F,J,Q,W,q]);return R0(V,{onBlock:$,onError:Z},(H)=>R8(async()=>{try{let z=await f(D,Z0,"getBlock")({blockTag:F,includeTransactions:W});if(z.number!==null&&B?.number!=null){if(z.number===B.number)return;if(z.number-B.number>1&&J)for(let _=B?.number+1n;_<z.number;_++){let M=await f(D,Z0,"getBlock")({blockNumber:_,includeTransactions:W});H.onBlock(M,B),B=M}}if(B?.number==null||F==="pending"&&z?.number==null||z.number!==null&&z.number>B.number)H.onBlock(z,B),B=z}catch(z){H.onError?.(z)}},{emitOnBegin:Q,interval:q}))})():(()=>{let V=!0,H=!0,z=()=>V=!1;return(async()=>{try{if(Q)f(D,Z0,"getBlock")({blockTag:F,includeTransactions:W}).then((C)=>{if(!V)return;if(!H)return;$(C,void 0),H=!1}).catch(Z);let _=(()=>{if(D.transport.type==="fallback"){let C=D.transport.transports.find((O)=>O.config.type==="webSocket"||O.config.type==="ipc");if(!C)return D.transport;return C.value}return D.transport})(),{unsubscribe:M}=await _.subscribe({params:["newHeads"],async onData(C){if(!V)return;let O=await f(D,Z0,"getBlock")({blockNumber:C.result?.number,includeTransactions:W}).catch(()=>{});if(!V)return;$(O,B),H=!1,B=O},onError(C){Z?.(C)}});if(z=M,!V)z()}catch(_){Z?.(_)}})(),()=>z()})()}gD();p6();function fT(D,{address:F,args:J,batch:Q=!0,event:$,events:Z,fromBlock:X,onError:Y,onLogs:q,poll:G,pollingInterval:W=D.pollingInterval,strict:B}){let K=(()=>{if(typeof G<"u")return G;if(typeof X==="bigint")return!0;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),U=B??!1;return K?(()=>{let z=qD(["watchEvent",F,J,Q,D.uid,$,W,X]);return R0(z,{onLogs:q,onError:Y},(_)=>{let M;if(X!==void 0)M=X-1n;let C,O=!1,E=R8(async()=>{if(!O){try{C=await f(D,FZ,"createEventFilter")({address:F,args:J,event:$,events:Z,strict:U,fromBlock:X})}catch{}O=!0;return}try{let A;if(C)A=await f(D,QF,"getFilterChanges")({filter:C});else{let N=await f(D,x2,"getBlockNumber")({});if(M&&M!==N)A=await f(D,Q7,"getLogs")({address:F,args:J,event:$,events:Z,fromBlock:M+1n,toBlock:N});else A=[];M=N}if(A.length===0)return;if(Q)_.onLogs(A);else for(let N of A)_.onLogs([N])}catch(A){if(C&&A instanceof _8)O=!1;_.onError?.(A)}},{emitOnBegin:!0,interval:W});return async()=>{if(C)await f(D,$F,"uninstallFilter")({filter:C});E()}})})():(()=>{let z=!0,_=()=>z=!1;return(async()=>{try{let M=(()=>{if(D.transport.type==="fallback"){let A=D.transport.transports.find((N)=>N.config.type==="webSocket"||N.config.type==="ipc");if(!A)return D.transport;return A.value}return D.transport})(),C=Z??($?[$]:void 0),O=[];if(C){if(O=[C.flatMap((N)=>M2({abi:[N],eventName:N.name,args:J}))],$)O=O[0]}let{unsubscribe:E}=await M.subscribe({params:["logs",{address:F,topics:O}],onData(A){if(!z)return;let N=A.result;try{let{eventName:w,args:T}=W3({abi:C??[],data:N.data,topics:N.topics,strict:U}),I=E0(N,{args:T,eventName:w});q([I])}catch(w){let T,I;if(w instanceof h1||w instanceof mF){if(B)return;T=w.abiItem.name,I=w.abiItem.inputs?.some((L)=>!(("name"in L)&&L.name))}let S=E0(N,{args:I?[]:{},eventName:T});q([S])}},onError(A){Y?.(A)}});if(_=E,!z)_()}catch(M){Y?.(M)}})(),()=>_()})()}function hT(D,{batch:F=!0,onError:J,onTransactions:Q,poll:$,pollingInterval:Z=D.pollingInterval}){return(typeof $<"u"?$:D.transport.type!=="webSocket"&&D.transport.type!=="ipc")?(()=>{let G=qD(["watchPendingTransactions",D.uid,F,Z]);return R0(G,{onTransactions:Q,onError:J},(W)=>{let B,K=R8(async()=>{try{if(!B)try{B=await f(D,JZ,"createPendingTransactionFilter")({});return}catch(V){throw K(),V}let U=await f(D,QF,"getFilterChanges")({filter:B});if(U.length===0)return;if(F)W.onTransactions(U);else for(let V of U)W.onTransactions([V])}catch(U){W.onError?.(U)}},{emitOnBegin:!0,interval:Z});return async()=>{if(B)await f(D,$F,"uninstallFilter")({filter:B});K()}})})():(()=>{let G=!0,W=()=>G=!1;return(async()=>{try{let{unsubscribe:B}=await D.transport.subscribe({params:["newPendingTransactions"],onData(K){if(!G)return;let U=K.result;Q([U])},onError(K){J?.(K)}});if(W=B,!G)W()}catch(B){J?.(B)}})(),()=>W()})()}function bT(D){let{scheme:F,statement:J,...Q}=D.match(Js)?.groups??{},{chainId:$,expirationTime:Z,issuedAt:X,notBefore:Y,requestId:q,...G}=D.match(Qs)?.groups??{},W=D.split("Resources:")[1]?.split(`
|
|
284
|
+
- `).slice(1);return{...Q,...G,...$?{chainId:Number($)}:{},...Z?{expirationTime:new Date(Z)}:{},...X?{issuedAt:new Date(X)}:{},...Y?{notBefore:new Date(Y)}:{},...q?{requestId:q}:{},...W?{resources:W}:{},...F?{scheme:F}:{},...J?{statement:J}:{}}}var Js=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Qs=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;z2();G3();function vT(D){let{address:F,domain:J,message:Q,nonce:$,scheme:Z,time:X=new Date}=D;if(J&&Q.domain!==J)return!1;if($&&Q.nonce!==$)return!1;if(Z&&Q.scheme!==Z)return!1;if(Q.expirationTime&&X>=Q.expirationTime)return!1;if(Q.notBefore&&X<Q.notBefore)return!1;try{if(!Q.address)return!1;if(!FD(Q.address,{strict:!1}))return!1;if(F&&!O8(Q.address,F))return!1}catch{return!1}return!0}async function uT(D,F){let{address:J,domain:Q,message:$,nonce:Z,scheme:X,signature:Y,time:q=new Date,...G}=F,W=bT($);if(!W.address)return!1;if(!vT({address:J,domain:Q,message:W,nonce:Z,scheme:X,time:q}))return!1;let K=$Z($);return qF(D,{address:W.address,hash:K,signature:Y,...G})}R2();async function R7(D,{serializedTransaction:F,throwOnReceiptRevert:J,timeout:Q}){let $=await D.request({method:"eth_sendRawTransactionSync",params:Q?[F,k(Q)]:[F]},{retryCount:0}),X=(D.chain?.formatters?.transactionReceipt?.format||l$)($);if(X.status==="reverted"&&J)throw new J4({receipt:X});return X}function yK(D){return{call:(F)=>S2(D,F),createAccessList:(F)=>DZ(D,F),createBlockFilter:()=>HN(D),createContractEventFilter:(F)=>$$(D,F),createEventFilter:(F)=>FZ(D,F),createPendingTransactionFilter:()=>JZ(D),estimateContractGas:(F)=>WI(D,F),estimateGas:(F)=>F7(D,F),getBalance:(F)=>zN(D,F),getBlobBaseFee:()=>CN(D),getBlock:(F)=>Z0(D,F),getBlockNumber:(F)=>x2(D,F),getBlockTransactionCount:(F)=>_N(D,F),getBytecode:(F)=>S4(D,F),getChainId:()=>M0(D),getCode:(F)=>S4(D,F),getContractEvents:(F)=>T$(D,F),getEip712Domain:(F)=>ON(D,F),getEnsAddress:(F)=>XN(D,F),getEnsAvatar:(F)=>KN(D,F),getEnsName:(F)=>UN(D,F),getEnsResolver:(F)=>VN(D,F),getEnsText:(F)=>e$(D,F),getFeeHistory:(F)=>EN(D,F),estimateFeesPerGas:(F)=>tw(D,F),getFilterChanges:(F)=>QF(D,F),getFilterLogs:(F)=>RN(D,F),getGasPrice:()=>t6(D),getLogs:(F)=>Q7(D,F),getProof:(F)=>_T(D,F),estimateMaxPriorityFeePerGas:(F)=>sw(D,F),fillTransaction:(F)=>D7(D,F),getStorageAt:(F)=>OT(D,F),getTransaction:(F)=>O7(D,F),getTransactionConfirmations:(F)=>MT(D,F),getTransactionCount:(F)=>e6(D,F),getTransactionReceipt:(F)=>M7(D,F),multicall:(F)=>ET(D,F),prepareTransactionRequest:(F)=>L2(D,F),readContract:(F)=>aD(D,F),sendRawTransaction:(F)=>H7(D,F),sendRawTransactionSync:(F)=>R7(D,F),simulate:(F)=>v4(D,F),simulateBlocks:(F)=>v4(D,F),simulateCalls:(F)=>PT(D,F),simulateContract:(F)=>sI(D,F),verifyHash:(F)=>qF(D,F),verifyMessage:(F)=>xT(D,F),verifySiweMessage:(F)=>uT(D,F),verifyTypedData:(F)=>kT(D,F),uninstallFilter:(F)=>$F(D,F),waitForTransactionReceipt:(F)=>RZ(D,F),watchBlocks:(F)=>yT(D,F),watchBlockNumber:(F)=>EZ(D,F),watchContractEvent:(F)=>FN(D,F),watchEvent:(F)=>fT(D,F),watchPendingTransactions:(F)=>hT(D,F)}}async function gT(D,{hash:F}){await D.request({method:`${D.mode}_dropTransaction`,params:[F]})}async function mT(D){return D.request({method:`${D.mode}_dumpState`})}async function dT(D){if(D.mode==="ganache")return await D.request({method:"eth_mining"});return await D.request({method:`${D.mode}_getAutomine`})}async function pT(D){return await D.request({method:"txpool_content"})}D0();async function lT(D){let{pending:F,queued:J}=await D.request({method:"txpool_status"});return{pending:OD(F),queued:OD(J)}}async function cT(D,{address:F}){await D.request({method:`${D.mode}_impersonateAccount`,params:[F]})}c();async function nT(D,{seconds:F}){return await D.request({method:"evm_increaseTime",params:[k(F)]})}async function iT(D){return await D.request({method:"txpool_inspect"})}async function oT(D,{state:F}){await D.request({method:`${D.mode}_loadState`,params:[F]})}c();async function aT(D,{blocks:F,interval:J}){if(D.mode==="ganache")await D.request({method:"evm_mine",params:[{blocks:k(F)}]});else await D.request({method:`${D.mode}_mine`,params:[k(F),k(J||0)]})}async function rT(D){await D.request({method:`${D.mode}_removeBlockTimestampInterval`})}async function sT(D,{blockNumber:F,jsonRpcUrl:J}={}){await D.request({method:`${D.mode}_reset`,params:[{forking:{blockNumber:Number(F),jsonRpcUrl:J}}]})}async function tT(D,{id:F}){await D.request({method:"evm_revert",params:[F]})}N2();async function eT(D,F){let{accessList:J,data:Q,from:$,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:W,value:B,...K}=F,U=D.chain?.formatters?.transactionRequest?.format,H=(U||Q0)({...i0(K,{format:U}),accessList:J,data:Q,from:$,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:W,value:B},"sendUnsignedTransaction");return await D.request({method:"eth_sendUnsignedTransaction",params:[H]})}async function DL(D,F){if(D.mode==="ganache")if(F)await D.request({method:"miner_start"});else await D.request({method:"miner_stop"});else await D.request({method:"evm_setAutomine",params:[F]})}c();async function FL(D,{address:F,value:J}){if(D.mode==="ganache")await D.request({method:"evm_setAccountBalance",params:[F,k(J)]});else await D.request({method:`${D.mode}_setBalance`,params:[F,k(J)]})}c();async function JL(D,{gasLimit:F}){await D.request({method:"evm_setBlockGasLimit",params:[k(F)]})}async function QL(D,{interval:F}){let J=(()=>{if(D.mode==="hardhat")return F*1000;return F})();await D.request({method:`${D.mode}_setBlockTimestampInterval`,params:[J]})}async function $L(D,{address:F,bytecode:J}){if(D.mode==="ganache")await D.request({method:"evm_setAccountCode",params:[F,J]});else await D.request({method:`${D.mode}_setCode`,params:[F,J]})}async function ZL(D,{address:F}){await D.request({method:`${D.mode}_setCoinbase`,params:[F]})}async function XL(D,{interval:F}){let J=(()=>{if(D.mode==="hardhat")return F*1000;return F})();await D.request({method:"evm_setIntervalMining",params:[J]})}async function YL(D,F){await D.request({method:`${D.mode}_setLoggingEnabled`,params:[F]})}c();async function qL(D,{gasPrice:F}){await D.request({method:`${D.mode}_setMinGasPrice`,params:[k(F)]})}c();async function GL(D,{baseFeePerGas:F}){await D.request({method:`${D.mode}_setNextBlockBaseFeePerGas`,params:[k(F)]})}c();async function WL(D,{timestamp:F}){await D.request({method:"evm_setNextBlockTimestamp",params:[k(F)]})}c();async function BL(D,{address:F,nonce:J}){await D.request({method:`${D.mode}_setNonce`,params:[F,k(J)]})}async function KL(D,F){await D.request({method:`${D.mode}_setRpcUrl`,params:[F]})}c();async function UL(D,{address:F,index:J,value:Q}){await D.request({method:`${D.mode}_setStorageAt`,params:[F,typeof J==="number"?k(J):J,Q]})}async function VL(D){return await D.request({method:"evm_snapshot"})}async function HL(D,{address:F}){await D.request({method:`${D.mode}_stopImpersonatingAccount`,params:[F]})}function zL({mode:D}){return(F)=>{let J=F.extend(()=>({mode:D}));return{dropTransaction:(Q)=>gT(J,Q),dumpState:()=>mT(J),getAutomine:()=>dT(J),getTxpoolContent:()=>pT(J),getTxpoolStatus:()=>lT(J),impersonateAccount:(Q)=>cT(J,Q),increaseTime:(Q)=>nT(J,Q),inspectTxpool:()=>iT(J),loadState:(Q)=>oT(J,Q),mine:(Q)=>aT(J,Q),removeBlockTimestampInterval:()=>rT(J),reset:(Q)=>sT(J,Q),revert:(Q)=>tT(J,Q),sendUnsignedTransaction:(Q)=>eT(J,Q),setAutomine:(Q)=>DL(J,Q),setBalance:(Q)=>FL(J,Q),setBlockGasLimit:(Q)=>JL(J,Q),setBlockTimestampInterval:(Q)=>QL(J,Q),setCode:(Q)=>$L(J,Q),setCoinbase:(Q)=>ZL(J,Q),setIntervalMining:(Q)=>XL(J,Q),setLoggingEnabled:(Q)=>YL(J,Q),setMinGasPrice:(Q)=>qL(J,Q),setNextBlockBaseFeePerGas:(Q)=>GL(J,Q),setNextBlockTimestamp:(Q)=>WL(J,Q),setNonce:(Q)=>BL(J,Q),setRpcUrl:(Q)=>KL(J,Q),setStorageAt:(Q)=>UL(J,Q),snapshot:()=>VL(J),stopImpersonatingAccount:(Q)=>HL(J,Q)}}}function fK(D){let{key:F="test",name:J="Test Client",mode:Q}=D;return QN({...D,key:F,name:J,type:"testClient"}).extend((Z)=>({mode:Q,...zL({mode:Q})(Z)}))}c();async function CL(D,{chain:F}){let{id:J,name:Q,nativeCurrency:$,rpcUrls:Z,blockExplorers:X}=F;await D.request({method:"wallet_addEthereumChain",params:[{chainId:k(J),chainName:Q,nativeCurrency:$,rpcUrls:Z.default.http,blockExplorerUrls:X?Object.values(X).map(({url:Y})=>Y):void 0}]},{dedupe:!0,retryCount:0})}m$();function _L(D,F){let{abi:J,args:Q,bytecode:$,...Z}=F,X=K3({abi:J,args:Q,bytecode:$});return ZF(D,{...Z,...Z.authorizationList?{to:null}:{},data:X})}Q1();async function OL(D){if(D.account?.type==="local")return[D.account.address];return(await D.request({method:"eth_accounts"},{dedupe:!0})).map((J)=>H2(J))}c();async function ML(D,F={}){let{account:J=D.account,chainId:Q}=F,$=J?i(J):void 0,Z=Q?[$?.address,[k(Q)]]:[$?.address],X=await D.request({method:"wallet_getCapabilities",params:Z}),Y={};for(let[q,G]of Object.entries(X)){Y[Number(q)]={};for(let[W,B]of Object.entries(G)){if(W==="addSubAccount")W="unstable_addSubAccount";Y[Number(q)][W]=B}}return typeof Q==="number"?Y[Q]:Y}async function EL(D){return await D.request({method:"wallet_getPermissions"},{dedupe:!0})}G3();async function AZ(D,F){let{account:J=D.account,chainId:Q,nonce:$}=F;if(!J)throw new U0({docsPath:"/docs/eip7702/prepareAuthorization"});let Z=i(J),X=(()=>{if(!F.executor)return;if(F.executor==="self")return F.executor;return i(F.executor)})(),Y={address:F.contractAddress??F.address,chainId:Q,nonce:$};if(typeof Y.chainId>"u")Y.chainId=D.chain?.id??await f(D,M0,"getChainId")({});if(typeof Y.nonce>"u"){if(Y.nonce=await f(D,e6,"getTransactionCount")({address:Z.address,blockTag:"pending"}),X==="self"||X?.address&&O8(X.address,Z.address))Y.nonce+=1}return Y}Q1();async function RL(D){return(await D.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map((J)=>RD(J))}async function AL(D,F){return D.request({method:"wallet_requestPermissions",params:[F]},{retryCount:0})}async function wL(D,F){let{chain:J=D.chain}=F,Q=F.timeout??Math.max((J?.blockTime??0)*3,5000),$=await c$(D,F);return await i$(D,{...F,id:$.id,timeout:Q})}s();R2();N2();iF();T2();var hK=new Z8(128);async function wZ(D,F){let{account:J=D.account,chain:Q=D.chain,accessList:$,authorizationList:Z,blobs:X,data:Y,gas:q,gasPrice:G,maxFeePerBlobGas:W,maxFeePerGas:B,maxPriorityFeePerGas:K,nonce:U,pollingInterval:V,throwOnReceiptRevert:H,type:z,value:_,...M}=F,C=F.timeout??Math.max((Q?.blockTime??0)*3,5000);if(typeof J>"u")throw new U0({docsPath:"/docs/actions/wallet/sendTransactionSync"});let O=J?i(J):null;try{$0(F);let E=await(async()=>{if(F.to)return F.to;if(F.to===null)return;if(Z&&Z.length>0)return await a1({authorization:Z[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`.")});return})();if(O?.type==="json-rpc"||O===null){let A;if(Q!==null)A=await f(D,M0,"getChainId")({}),V7({currentChainId:A,chain:Q});let N=D.chain?.formatters?.transactionRequest?.format,T=(N||Q0)({...i0(M,{format:N}),accessList:$,account:O,authorizationList:Z,blobs:X,chainId:A,data:Y,gas:q,gasPrice:G,maxFeePerBlobGas:W,maxFeePerGas:B,maxPriorityFeePerGas:K,nonce:U,to:E,type:z,value:_},"sendTransaction"),I=hK.get(D.uid),S=I?"wallet_sendTransaction":"eth_sendTransaction",L=await(async()=>{try{return await D.request({method:S,params:[T]},{retryCount:0})}catch(m){if(I===!1)throw m;let j=m;if(j.name==="InvalidInputRpcError"||j.name==="InvalidParamsRpcError"||j.name==="MethodNotFoundRpcError"||j.name==="MethodNotSupportedRpcError")return await D.request({method:"wallet_sendTransaction",params:[T]},{retryCount:0}).then((h)=>{return hK.set(D.uid,!0),h}).catch((h)=>{let g=h;if(g.name==="MethodNotFoundRpcError"||g.name==="MethodNotSupportedRpcError")throw hK.set(D.uid,!1),j;throw g});throw j}})(),y=await f(D,RZ,"waitForTransactionReceipt")({checkReplacement:!1,hash:L,pollingInterval:V,timeout:C});if(H&&y.status==="reverted")throw new J4({receipt:y});return y}if(O?.type==="local"){let A=await f(D,L2,"prepareTransactionRequest")({account:O,accessList:$,authorizationList:Z,blobs:X,chain:Q,data:Y,gas:q,gasPrice:G,maxFeePerBlobGas:W,maxFeePerGas:B,maxPriorityFeePerGas:K,nonce:U,nonceManager:O.nonceManager,parameters:[...A4,"sidecars"],type:z,value:_,...M,to:E}),N=Q?.serializers?.transaction,w=await O.signTransaction(A,{serializer:N});return await f(D,R7,"sendRawTransactionSync")({serializedTransaction:w,throwOnReceiptRevert:H})}if(O?.type==="smart")throw new n8({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new n8({docsPath:"/docs/actions/wallet/sendTransactionSync",type:O?.type})}catch(E){if(E instanceof n8)throw E;throw t1(E,{...F,account:O,chain:F.chain||void 0})}}async function IL(D,F){let{id:J}=F;await D.request({method:"wallet_showCallsStatus",params:[J]});return}async function NL(D,F){let{account:J=D.account}=F;if(!J)throw new U0({docsPath:"/docs/eip7702/signAuthorization"});let Q=i(J);if(!Q.signAuthorization)throw new n8({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:Q.type});let $=await AZ(D,F);return Q.signAuthorization($)}c();async function TL(D,{account:F=D.account,message:J}){if(!F)throw new U0({docsPath:"/docs/actions/wallet/signMessage"});let Q=i(F);if(Q.signMessage)return Q.signMessage({message:J});let $=(()=>{if(typeof J==="string")return G0(J);if(J.raw instanceof Uint8Array)return cD(J.raw);return J.raw})();return D.request({method:"personal_sign",params:[$,Q.address]},{retryCount:0})}c();N2();T2();async function LL(D,F){let{account:J=D.account,chain:Q=D.chain,...$}=F;if(!J)throw new U0({docsPath:"/docs/actions/wallet/signTransaction"});let Z=i(J);$0({account:Z,...F});let X=await f(D,M0,"getChainId")({});if(Q!==null)V7({currentChainId:X,chain:Q});let q=(Q?.formatters||D.chain?.formatters)?.transactionRequest?.format||Q0;if(Z.signTransaction)return Z.signTransaction({...$,chainId:X},{serializer:D.chain?.serializers?.transaction});return await D.request({method:"eth_signTransaction",params:[{...q({...$,account:Z},"signTransaction"),chainId:k(X),from:Z.address}]},{retryCount:0})}async function PL(D,F){let{account:J=D.account,domain:Q,message:$,primaryType:Z}=F;if(!J)throw new U0({docsPath:"/docs/actions/wallet/signTypedData"});let X=i(J),Y={EIP712Domain:XZ({domain:Q}),...F.types};if(ZZ({domain:Q,message:$,primaryType:Z,types:Y}),X.signTypedData)return X.signTypedData({domain:Q,message:$,primaryType:Z,types:Y});let q=jN({domain:Q,message:$,primaryType:Z,types:Y});return D.request({method:"eth_signTypedData_v4",params:[X.address,q]},{retryCount:0})}c();async function jL(D,{id:F}){await D.request({method:"wallet_switchEthereumChain",params:[{chainId:k(F)}]},{retryCount:0})}async function SL(D,F){return await D.request({method:"wallet_watchAsset",params:F},{retryCount:0})}async function xL(D,F){return V3.internal(D,wZ,"sendTransactionSync",F)}function bK(D){return{addChain:(F)=>CL(D,F),deployContract:(F)=>_L(D,F),fillTransaction:(F)=>D7(D,F),getAddresses:()=>OL(D),getCallsStatus:(F)=>n$(D,F),getCapabilities:(F)=>ML(D,F),getChainId:()=>M0(D),getPermissions:()=>EL(D),prepareAuthorization:(F)=>AZ(D,F),prepareTransactionRequest:(F)=>L2(D,F),requestAddresses:()=>RL(D),requestPermissions:(F)=>AL(D,F),sendCalls:(F)=>c$(D,F),sendCallsSync:(F)=>wL(D,F),sendRawTransaction:(F)=>H7(D,F),sendRawTransactionSync:(F)=>R7(D,F),sendTransaction:(F)=>ZF(D,F),sendTransactionSync:(F)=>wZ(D,F),showCallsStatus:(F)=>IL(D,F),signAuthorization:(F)=>NL(D,F),signMessage:(F)=>TL(D,F),signTransaction:(F)=>LL(D,F),signTypedData:(F)=>PL(D,F),switchChain:(F)=>jL(D,F),waitForCallsStatus:(F)=>i$(D,F),watchAsset:(F)=>SL(D,F),writeContract:(F)=>V3(D,F),writeContractSync:(F)=>xL(D,F)}}function kL({key:D,methods:F,name:J,request:Q,retryCount:$=3,retryDelay:Z=150,timeout:X,type:Y},q){let G=r$();return{config:{key:D,methods:F,name:J,request:Q,retryCount:$,retryDelay:Z,timeout:X,type:Y},request:IN(Q,{methods:F,retryCount:$,retryDelay:Z,uid:G}),value:q}}tF();s();class vK extends P{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}bB();function uK(D,F={}){let{batch:J,fetchFn:Q,fetchOptions:$,key:Z="http",methods:X,name:Y="HTTP JSON-RPC",onFetchRequest:q,onFetchResponse:G,retryDelay:W,raw:B}=F;return({chain:K,retryCount:U,timeout:V})=>{let{batchSize:H=1000,wait:z=0}=typeof J==="object"?J:{},_=F.retryCount??U,M=V??F.timeout??1e4,C=D||K?.rpcUrls.default.http[0];if(!C)throw new vK;let O=TN(C,{fetchFn:Q,fetchOptions:$,onRequest:q,onResponse:G,timeout:M});return kL({key:Z,methods:X,name:Y,async request({method:E,params:A}){let N={method:E,params:A},{schedule:w}=p$({id:C,wait:z,shouldSplitBatch(L){return L.length>H},fn:(L)=>O.request({body:L}),sort:(L,y)=>L.id-y.id}),T=async(L)=>J?w(L):[await O.request({body:L})],[{error:I,result:S}]=await T(N);if(B)return{error:I,result:S};if(I)throw new sF({body:N,error:I,url:C});return S},retryCount:_,retryDelay:W,timeout:M,type:"http"},{fetchOptions:$,url:C})}}z1();s();Z1();_2();Q1();z2();D0();c();var lL=ID(hL(),1);import{extname as _s}from"node:path";/*!
|
|
285
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
286
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
287
|
+
*
|
|
288
|
+
* Redistribution and use in source and binary forms, with or without
|
|
289
|
+
* modification, are permitted provided that the following conditions are met:
|
|
290
|
+
*
|
|
291
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
292
|
+
* list of conditions and the following disclaimer.
|
|
293
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
294
|
+
* this list of conditions and the following disclaimer in the
|
|
295
|
+
* documentation and/or other materials provided with the distribution.
|
|
296
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
297
|
+
* may be used to endorse or promote products derived from this software without
|
|
298
|
+
* specific prior written permission.
|
|
299
|
+
*
|
|
300
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
301
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
302
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
303
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
304
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
305
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
306
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
307
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
308
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
309
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
310
|
+
*/function qs(D,F){let J=D.slice(0,F).split(/\r\n|\n|\r/g);return[J.length,J.pop().length+1]}function Gs(D,F,J){let Q=D.split(/\r\n|\n|\r/g),$="",Z=(Math.log10(F+1)|0)+1;for(let X=F-1;X<=F+1;X++){let Y=Q[X-1];if(!Y)continue;if($+=X.toString().padEnd(Z," "),$+=": ",$+=Y,$+=`
|
|
311
|
+
`,X===F)$+=" ".repeat(Z+J+2),$+=`^
|
|
312
|
+
`}return $}class $D extends Error{line;column;codeblock;constructor(D,F){let[J,Q]=qs(F.toml,F.ptr),$=Gs(F.toml,J,Q);super(`Invalid TOML document: ${D}
|
|
313
|
+
|
|
314
|
+
${$}`,F);this.line=J,this.column=Q,this.codeblock=$}}/*!
|
|
315
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
316
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
317
|
+
*
|
|
318
|
+
* Redistribution and use in source and binary forms, with or without
|
|
319
|
+
* modification, are permitted provided that the following conditions are met:
|
|
320
|
+
*
|
|
321
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
322
|
+
* list of conditions and the following disclaimer.
|
|
323
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
324
|
+
* this list of conditions and the following disclaimer in the
|
|
325
|
+
* documentation and/or other materials provided with the distribution.
|
|
326
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
327
|
+
* may be used to endorse or promote products derived from this software without
|
|
328
|
+
* specific prior written permission.
|
|
329
|
+
*
|
|
330
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
331
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
332
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
333
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
334
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
335
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
336
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
337
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
338
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
339
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
340
|
+
*/function Ws(D,F){let J=0;while(D[F-++J]==="\\");return--J&&J%2}function NZ(D,F=0,J=D.length){let Q=D.indexOf(`
|
|
341
|
+
`,F);if(D[Q-1]==="\r")Q--;return Q<=J?Q:-1}function A7(D,F){for(let J=F;J<D.length;J++){let Q=D[J];if(Q===`
|
|
342
|
+
`)return J;if(Q==="\r"&&D[J+1]===`
|
|
343
|
+
`)return J+1;if(Q<" "&&Q!=="\t"||Q==="")throw new $D("control characters are not allowed in comments",{toml:D,ptr:F})}return D.length}function r0(D,F,J,Q){let $;while(($=D[F])===" "||$==="\t"||!J&&($===`
|
|
344
|
+
`||$==="\r"&&D[F+1]===`
|
|
345
|
+
`))F++;return Q||$!=="#"?F:r0(D,A7(D,F),J)}function bL(D,F,J,Q,$=!1){if(!Q)return F=NZ(D,F),F<0?D.length:F;for(let Z=F;Z<D.length;Z++){let X=D[Z];if(X==="#")Z=NZ(D,Z);else if(X===J)return Z+1;else if(X===Q||$&&(X===`
|
|
346
|
+
`||X==="\r"&&D[Z+1]===`
|
|
347
|
+
`))return Z}throw new $D("cannot find end of structure",{toml:D,ptr:F})}function TZ(D,F){let J=D[F],Q=J===D[F+1]&&D[F+1]===D[F+2]?D.slice(F,F+3):J;F+=Q.length-1;do F=D.indexOf(Q,++F);while(F>-1&&J!=="'"&&Ws(D,F));if(F>-1){if(F+=Q.length,Q.length>1){if(D[F]===J)F++;if(D[F]===J)F++}}return F}/*!
|
|
348
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
349
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
350
|
+
*
|
|
351
|
+
* Redistribution and use in source and binary forms, with or without
|
|
352
|
+
* modification, are permitted provided that the following conditions are met:
|
|
353
|
+
*
|
|
354
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
355
|
+
* list of conditions and the following disclaimer.
|
|
356
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
357
|
+
* this list of conditions and the following disclaimer in the
|
|
358
|
+
* documentation and/or other materials provided with the distribution.
|
|
359
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
360
|
+
* may be used to endorse or promote products derived from this software without
|
|
361
|
+
* specific prior written permission.
|
|
362
|
+
*
|
|
363
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
364
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
365
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
366
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
367
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
368
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
369
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
370
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
371
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
372
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
373
|
+
*/var Bs=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class WF extends Date{#F=!1;#J=!1;#D=null;constructor(D){let F=!0,J=!0,Q="Z";if(typeof D==="string"){let $=D.match(Bs);if($){if(!$[1])F=!1,D=`0000-01-01T${D}`;if(J=!!$[2],J&&D[10]===" "&&(D=D.replace(" ","T")),$[2]&&+$[2]>23)D="";else if(Q=$[3]||null,D=D.toUpperCase(),!Q&&J)D+="Z"}else D=""}super(D);if(!isNaN(this.getTime()))this.#F=F,this.#J=J,this.#D=Q}isDateTime(){return this.#F&&this.#J}isLocal(){return!this.#F||!this.#J||!this.#D}isDate(){return this.#F&&!this.#J}isTime(){return this.#J&&!this.#F}isValid(){return this.#F||this.#J}toISOString(){let D=super.toISOString();if(this.isDate())return D.slice(0,10);if(this.isTime())return D.slice(11,23);if(this.#D===null)return D.slice(0,-1);if(this.#D==="Z")return D;let F=+this.#D.slice(1,3)*60+ +this.#D.slice(4,6);return F=this.#D[0]==="-"?F:-F,new Date(this.getTime()-F*60000).toISOString().slice(0,-1)+this.#D}static wrapAsOffsetDateTime(D,F="Z"){let J=new WF(D);return J.#D=F,J}static wrapAsLocalDateTime(D){let F=new WF(D);return F.#D=null,F}static wrapAsLocalDate(D){let F=new WF(D);return F.#J=!1,F.#D=null,F}static wrapAsLocalTime(D){let F=new WF(D);return F.#F=!1,F.#D=null,F}}/*!
|
|
374
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
375
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
376
|
+
*
|
|
377
|
+
* Redistribution and use in source and binary forms, with or without
|
|
378
|
+
* modification, are permitted provided that the following conditions are met:
|
|
379
|
+
*
|
|
380
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
381
|
+
* list of conditions and the following disclaimer.
|
|
382
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
383
|
+
* this list of conditions and the following disclaimer in the
|
|
384
|
+
* documentation and/or other materials provided with the distribution.
|
|
385
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
386
|
+
* may be used to endorse or promote products derived from this software without
|
|
387
|
+
* specific prior written permission.
|
|
388
|
+
*
|
|
389
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
390
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
391
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
392
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
393
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
394
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
395
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
396
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
397
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
398
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
399
|
+
*/var Ks=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Us=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Vs=/^[+-]?0[0-9_]/,Hs=/^[0-9a-f]{2,8}$/i,vL={b:"\b",t:"\t",n:`
|
|
400
|
+
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function LZ(D,F=0,J=D.length){let Q=D[F]==="'",$=D[F++]===D[F]&&D[F]===D[F+1];if($){if(J-=2,D[F+=2]==="\r")F++;if(D[F]===`
|
|
401
|
+
`)F++}let Z=0,X,Y="",q=F;while(F<J-1){let G=D[F++];if(G===`
|
|
402
|
+
`||G==="\r"&&D[F]===`
|
|
403
|
+
`){if(!$)throw new $D("newlines are not allowed in strings",{toml:D,ptr:F-1})}else if(G<" "&&G!=="\t"||G==="")throw new $D("control characters are not allowed in strings",{toml:D,ptr:F-1});if(X){if(X=!1,G==="x"||G==="u"||G==="U"){let W=D.slice(F,F+=G==="x"?2:G==="u"?4:8);if(!Hs.test(W))throw new $D("invalid unicode escape",{toml:D,ptr:Z});try{Y+=String.fromCodePoint(parseInt(W,16))}catch{throw new $D("invalid unicode escape",{toml:D,ptr:Z})}}else if($&&(G===`
|
|
404
|
+
`||G===" "||G==="\t"||G==="\r")){if(F=r0(D,F-1,!0),D[F]!==`
|
|
405
|
+
`&&D[F]!=="\r")throw new $D("invalid escape: only line-ending whitespace may be escaped",{toml:D,ptr:Z});F=r0(D,F)}else if(G in vL)Y+=vL[G];else throw new $D("unrecognized escape sequence",{toml:D,ptr:Z});q=F}else if(!Q&&G==="\\")Z=F-1,X=!0,Y+=D.slice(q,Z)}return Y+D.slice(q,J-1)}function uL(D,F,J,Q){if(D==="true")return!0;if(D==="false")return!1;if(D==="-inf")return-1/0;if(D==="inf"||D==="+inf")return 1/0;if(D==="nan"||D==="+nan"||D==="-nan")return NaN;if(D==="-0")return Q?0n:0;let $=Ks.test(D);if($||Us.test(D)){if(Vs.test(D))throw new $D("leading zeroes are not allowed",{toml:F,ptr:J});D=D.replace(/_/g,"");let X=+D;if(isNaN(X))throw new $D("invalid number",{toml:F,ptr:J});if($){if(($=!Number.isSafeInteger(X))&&!Q)throw new $D("integer value cannot be represented losslessly",{toml:F,ptr:J});if($||Q===!0)X=BigInt(D)}return X}let Z=new WF(D);if(!Z.isValid())throw new $D("invalid value",{toml:F,ptr:J});return Z}/*!
|
|
406
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
407
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
408
|
+
*
|
|
409
|
+
* Redistribution and use in source and binary forms, with or without
|
|
410
|
+
* modification, are permitted provided that the following conditions are met:
|
|
411
|
+
*
|
|
412
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
413
|
+
* list of conditions and the following disclaimer.
|
|
414
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
415
|
+
* this list of conditions and the following disclaimer in the
|
|
416
|
+
* documentation and/or other materials provided with the distribution.
|
|
417
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
418
|
+
* may be used to endorse or promote products derived from this software without
|
|
419
|
+
* specific prior written permission.
|
|
420
|
+
*
|
|
421
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
422
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
423
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
424
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
425
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
426
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
427
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
428
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
429
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
430
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
431
|
+
*/function zs(D,F,J){let Q=D.slice(F,J),$=Q.indexOf("#");if($>-1)A7(D,$),Q=Q.slice(0,$);return[Q.trimEnd(),$]}function m4(D,F,J,Q,$){if(Q===0)throw new $D("document contains excessively nested structures. aborting.",{toml:D,ptr:F});let Z=D[F];if(Z==="["||Z==="{"){let[q,G]=Z==="["?mL(D,F,Q,$):gL(D,F,Q,$);if(J){if(G=r0(D,G),D[G]===",")G++;else if(D[G]!==J)throw new $D("expected comma or end of structure",{toml:D,ptr:G})}return[q,G]}let X;if(Z==='"'||Z==="'"){X=TZ(D,F);let q=LZ(D,F,X);if(J){if(X=r0(D,X),D[X]&&D[X]!==","&&D[X]!==J&&D[X]!==`
|
|
432
|
+
`&&D[X]!=="\r")throw new $D("unexpected character encountered",{toml:D,ptr:X});X+=+(D[X]===",")}return[q,X]}X=bL(D,F,",",J);let Y=zs(D,F,X-+(D[X-1]===","));if(!Y[0])throw new $D("incomplete key-value declaration: no value specified",{toml:D,ptr:F});if(J&&Y[1]>-1)X=r0(D,F+Y[1]),X+=+(D[X]===",");return[uL(Y[0],D,F,$),X]}/*!
|
|
433
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
434
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
435
|
+
*
|
|
436
|
+
* Redistribution and use in source and binary forms, with or without
|
|
437
|
+
* modification, are permitted provided that the following conditions are met:
|
|
438
|
+
*
|
|
439
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
440
|
+
* list of conditions and the following disclaimer.
|
|
441
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
442
|
+
* this list of conditions and the following disclaimer in the
|
|
443
|
+
* documentation and/or other materials provided with the distribution.
|
|
444
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
445
|
+
* may be used to endorse or promote products derived from this software without
|
|
446
|
+
* specific prior written permission.
|
|
447
|
+
*
|
|
448
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
449
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
450
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
451
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
452
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
453
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
454
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
455
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
456
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
457
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
458
|
+
*/var Cs=/^[a-zA-Z0-9-_]+[ \t]*$/;function PZ(D,F,J="="){let Q=F-1,$=[],Z=D.indexOf(J,F);if(Z<0)throw new $D("incomplete key-value: cannot find end of key",{toml:D,ptr:F});do{let X=D[F=++Q];if(X!==" "&&X!=="\t")if(X==='"'||X==="'"){if(X===D[F+1]&&X===D[F+2])throw new $D("multiline strings are not allowed in keys",{toml:D,ptr:F});let Y=TZ(D,F);if(Y<0)throw new $D("unfinished string encountered",{toml:D,ptr:F});Q=D.indexOf(".",Y);let q=D.slice(Y,Q<0||Q>Z?Z:Q),G=NZ(q);if(G>-1)throw new $D("newlines are not allowed in keys",{toml:D,ptr:F+Q+G});if(q.trimStart())throw new $D("found extra tokens after the string part",{toml:D,ptr:Y});if(Z<Y){if(Z=D.indexOf(J,Y),Z<0)throw new $D("incomplete key-value: cannot find end of key",{toml:D,ptr:F})}$.push(LZ(D,F,Y))}else{Q=D.indexOf(".",F);let Y=D.slice(F,Q<0||Q>Z?Z:Q);if(!Cs.test(Y))throw new $D("only letter, numbers, dashes and underscores are allowed in keys",{toml:D,ptr:F});$.push(Y.trimEnd())}}while(Q+1&&Q<Z);return[$,r0(D,Z+1,!0,!0)]}function gL(D,F,J,Q){let $={},Z=new Set,X;F++;while((X=D[F++])!=="}"&&X)if(X===",")throw new $D("expected value, found comma",{toml:D,ptr:F-1});else if(X==="#")F=A7(D,F);else if(X!==" "&&X!=="\t"&&X!==`
|
|
459
|
+
`&&X!=="\r"){let Y,q=$,G=!1,[W,B]=PZ(D,F-1);for(let V=0;V<W.length;V++){if(V)q=G?q[Y]:q[Y]={};if(Y=W[V],(G=Object.hasOwn(q,Y))&&(typeof q[Y]!=="object"||Z.has(q[Y])))throw new $D("trying to redefine an already defined value",{toml:D,ptr:F});if(!G&&Y==="__proto__")Object.defineProperty(q,Y,{enumerable:!0,configurable:!0,writable:!0})}if(G)throw new $D("trying to redefine an already defined value",{toml:D,ptr:F});let[K,U]=m4(D,B,"}",J-1,Q);Z.add(K),q[Y]=K,F=U}if(!X)throw new $D("unfinished table encountered",{toml:D,ptr:F});return[$,F]}function mL(D,F,J,Q){let $=[],Z;F++;while((Z=D[F++])!=="]"&&Z)if(Z===",")throw new $D("expected value, found comma",{toml:D,ptr:F-1});else if(Z==="#")F=A7(D,F);else if(Z!==" "&&Z!=="\t"&&Z!==`
|
|
460
|
+
`&&Z!=="\r"){let X=m4(D,F-1,"]",J-1,Q);$.push(X[0]),F=X[1]}if(!Z)throw new $D("unfinished array encountered",{toml:D,ptr:F});return[$,F]}/*!
|
|
461
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
462
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
463
|
+
*
|
|
464
|
+
* Redistribution and use in source and binary forms, with or without
|
|
465
|
+
* modification, are permitted provided that the following conditions are met:
|
|
466
|
+
*
|
|
467
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
468
|
+
* list of conditions and the following disclaimer.
|
|
469
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
470
|
+
* this list of conditions and the following disclaimer in the
|
|
471
|
+
* documentation and/or other materials provided with the distribution.
|
|
472
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
473
|
+
* may be used to endorse or promote products derived from this software without
|
|
474
|
+
* specific prior written permission.
|
|
475
|
+
*
|
|
476
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
477
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
478
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
479
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
480
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
481
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
482
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
483
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
484
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
485
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
486
|
+
*/function dL(D,F,J,Q){let $=F,Z=J,X,Y=!1,q;for(let G=0;G<D.length;G++){if(G){if($=Y?$[X]:$[X]={},Z=(q=Z[X]).c,Q===0&&(q.t===1||q.t===2))return null;if(q.t===2){let W=$.length-1;$=$[W],Z=Z[W].c}}if(X=D[G],(Y=Object.hasOwn($,X))&&Z[X]?.t===0&&Z[X]?.d)return null;if(!Y){if(X==="__proto__")Object.defineProperty($,X,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(Z,X,{enumerable:!0,configurable:!0,writable:!0});Z[X]={t:G<D.length-1&&Q===2?3:Q,d:!1,i:0,c:{}}}}if(q=Z[X],q.t!==Q&&!(Q===1&&q.t===3))return null;if(Q===2){if(!q.d)q.d=!0,$[X]=[];$[X].push($={}),q.c[q.i++]=q={t:1,d:!1,i:0,c:{}}}if(q.d)return null;if(q.d=!0,Q===1)$=Y?$[X]:$[X]={};else if(Q===0&&Y)return null;return[X,$,q.c]}function gK(D,{maxDepth:F=1000,integersAsBigInt:J}={}){let Q={},$={},Z=Q,X=$;for(let Y=r0(D,0);Y<D.length;){if(D[Y]==="["){let q=D[++Y]==="[",G=PZ(D,Y+=+q,"]");if(q){if(D[G[1]-1]!=="]")throw new $D("expected end of table declaration",{toml:D,ptr:G[1]-1});G[1]++}let W=dL(G[0],Q,$,q?2:1);if(!W)throw new $D("trying to redefine an already defined table or value",{toml:D,ptr:Y});X=W[2],Z=W[1],Y=G[1]}else{let q=PZ(D,Y),G=dL(q[0],Z,X,0);if(!G)throw new $D("trying to redefine an already defined table or value",{toml:D,ptr:Y});let W=m4(D,q[1],void 0,F,J);G[1][G[0]]=W[0],Y=W[1]}if(Y=r0(D,Y,!0),D[Y]&&D[Y]!==`
|
|
487
|
+
`&&D[Y]!=="\r")throw new $D("each key-value declaration must be followed by an end-of-line",{toml:D,ptr:Y});Y=r0(D,Y)}return Q}/*!
|
|
488
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
489
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
490
|
+
*
|
|
491
|
+
* Redistribution and use in source and binary forms, with or without
|
|
492
|
+
* modification, are permitted provided that the following conditions are met:
|
|
493
|
+
*
|
|
494
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
495
|
+
* list of conditions and the following disclaimer.
|
|
496
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
497
|
+
* this list of conditions and the following disclaimer in the
|
|
498
|
+
* documentation and/or other materials provided with the distribution.
|
|
499
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
500
|
+
* may be used to endorse or promote products derived from this software without
|
|
501
|
+
* specific prior written permission.
|
|
502
|
+
*
|
|
503
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
504
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
505
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
506
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
507
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
508
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
509
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
510
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
511
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
512
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
513
|
+
*//*!
|
|
514
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
515
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
516
|
+
*
|
|
517
|
+
* Redistribution and use in source and binary forms, with or without
|
|
518
|
+
* modification, are permitted provided that the following conditions are met:
|
|
519
|
+
*
|
|
520
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
521
|
+
* list of conditions and the following disclaimer.
|
|
522
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
523
|
+
* this list of conditions and the following disclaimer in the
|
|
524
|
+
* documentation and/or other materials provided with the distribution.
|
|
525
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
526
|
+
* may be used to endorse or promote products derived from this software without
|
|
527
|
+
* specific prior written permission.
|
|
528
|
+
*
|
|
529
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
530
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
531
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
532
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
533
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
534
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
535
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
536
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
537
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
538
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
539
|
+
*/class cL extends Error{constructor(D){super(`Invalid builder: ${D}`);this.name="InvalidBuilder"}}class cK extends Error{constructor(D){super(`Invalid drive format: ${D}`);this.name="InvalidDriveFormatError"}}class nL extends Error{constructor(D){super(`Invalid empty drive format: ${D}`);this.name="InvalidEmptyDriveFormatError"}}class I7 extends Error{constructor(D){super(`Invalid string value: ${D}`);this.name="InvalidStringValueError"}}class nK extends Error{constructor(D){super(`Invalid boolean value: ${D}`);this.name="InvalidBooleanValueError"}}class iL extends Error{constructor(D){super(`Invalid number value: ${D}`);this.name="InvalidNumberValueError"}}class oL extends Error{constructor(D){super(`Invalid bytes value: ${D}`);this.name="InvalidBytesValueError"}}class aL extends Error{constructor(D){super(`Missing required field: ${D}`);this.name="RequiredFieldError"}}class rL extends Error{constructor(){super("Invalid string array");this.name="InvalidStringArrayError"}}var iK="ext2",sL="128Mi",oK="0.12.0-alpha.27",Os="cartesi/sdk",p4=6751,Ms=()=>({builder:"docker",buildArgs:[],context:".",dockerfile:"Dockerfile",extraSize:0,format:iK,tags:[]}),Es=()=>({assertRollingTemplate:void 0,bootargs:[],entrypoint:void 0,maxMCycle:void 0,noRollup:void 0,ramLength:sL,useDockerEnv:!0,useDockerWorkdir:!0,user:void 0});var mK=(D,F)=>{if(D===void 0)return F;if(typeof D==="boolean")return D;throw new nK(D)},w7=(D)=>{if(D===void 0)return;if(typeof D==="boolean")return D;throw new nK(D)},SZ=(D,F)=>{if(D===void 0)return F;if(typeof D==="string")return D;throw new I7(D)},lK=(D)=>{if(D===void 0)return[];if(typeof D==="string")return[D];if(typeof D==="object"&&Array.isArray(D))return D.map((F)=>{if(typeof F==="string")return F;throw new I7(F)});throw new rL},dK=(D,F)=>{if(D===void 0)throw new aL(F);if(typeof D==="string")return D;throw new I7(D)},k2=(D)=>{if(D===void 0)return;if(typeof D==="string")return D;throw new I7(D)},d4=(D)=>{if(D===void 0)return;if(typeof D==="string")return D;if(typeof D==="boolean")return D;throw new I7(D)},Rs=(D)=>{if(D===void 0)return;if(typeof D==="bigint")return D;if(typeof D==="number")return BigInt(D);throw new iL(D)},jZ=(D,F)=>{if(D===void 0)return F;if(typeof D==="bigint")return Number(D);if(typeof D==="number"||typeof D==="string"){let J=lL.default.parse(D);if(J!==null)return J}throw new oL(D)},As=(D)=>{if(D===void 0)return"docker";if(typeof D==="string")switch(D){case"directory":return"directory";case"docker":return"docker";case"empty":return"empty";case"none":return"none";case"tar":return"tar"}throw new cL(D)},pK=(D)=>{if(D===void 0)return iK;if(typeof D==="string")switch(D){case"ext2":return"ext2";case"sqfs":return"sqfs"}throw new cK(D)},ws=(D)=>{if(D===void 0)return iK;if(typeof D==="string")switch(D){case"ext2":return"ext2";case"raw":return"raw"}throw new nL(D)},Is=(D)=>{if(D===void 0)return Es();if(typeof D!=="object")throw Error(`Invalid machine configuration: ${D}`);let F=D;return{assertRollingTemplate:w7(F.assert_rolling_template),bootargs:lK(F.boot_args),entrypoint:k2(F.entrypoint),maxMCycle:Rs(F.max_mcycle),noRollup:mK(F.no_rollup,!1),ramLength:SZ(F.ram_length,sL),ramImage:k2(F.ram_image),useDockerEnv:mK(F.use_docker_env,!0),useDockerWorkdir:mK(F.use_docker_workdir,!0),user:k2(F.user)}},aK=(D)=>{let F=_s(D);switch(F){case".ext2":return"ext2";case".sqfs":return"sqfs";default:throw new cK(F)}},Ns=(D)=>{switch(As(D.builder)){case"directory":{let{extra_size:J,format:Q,mount:$,directory:Z,shared:X,user:Y}=D;return{builder:"directory",extraSize:jZ(J,0),format:pK(Q),mount:d4($),directory:dK(Z,"directory"),shared:w7(X),user:k2(Y)}}case"docker":{let{build_args:J,context:Q,dockerfile:$,extra_size:Z,format:X,image:Y,mount:q,shared:G,tags:W,target:B,user:K}=D;return{builder:"docker",buildArgs:lK(J),image:k2(Y),context:SZ(Q,"."),dockerfile:SZ($,"Dockerfile"),extraSize:jZ(Z,0),format:pK(X),mount:d4(q),shared:w7(G),user:k2(K),tags:lK(W),target:k2(B)}}case"empty":{let{format:J,mount:Q,size:$,shared:Z,user:X}=D;return{builder:"empty",format:ws(J),mount:d4(Q),shared:w7(Z),size:jZ($,0),user:k2(X)}}case"tar":{let{extra_size:J,filename:Q,format:$,mount:Z,shared:X,user:Y}=D;return{builder:"tar",extraSize:jZ(J,0),filename:dK(Q,"filename"),format:pK($),mount:d4(Z),shared:w7(X),user:k2(Y)}}case"none":{let{shared:J,mount:Q,user:$}=D,Z=dK(D.filename,"filename"),X=aK(Z);return{builder:"none",filename:Z,format:X,mount:d4(Q),shared:w7(J),user:k2($)}}}},Ts=(D)=>{let F=Object.entries(D??{}).reduce((Q,[$,Z])=>{return Q[$]=Ns(Z),Q},{});if(F.root===void 0)F.root=Ms();return F},tL=(D)=>{let F={};for(let Q of D)F=eL(F,gK(Q));return{drives:Ts(F.drives),machine:Is(F.machine),sdk:SZ(F.sdk,`${Os}:${oK}`)}};function pL(D){return typeof D==="object"&&D!==null&&!Array.isArray(D)&&!("toISOString"in D)}function eL(D,F){let J={...D};for(let[Q,$]of Object.entries(F)){let Z=J[Q];if(pL(Z)&&pL($))J[Q]=eL(Z,$);else J[Q]=$}return J}var DP="0x26E758238CB6eC5aB70ce0dd52aF2d7b82e1972E";var FP="0x5a3368b30174d389aFd205a46bAd35BBE6709b8a";var xZ="0x96cD319eBD67DF6b753766ec000fe639dFba9F6b";var JP=[{type:"constructor",inputs:[{name:"inputBox",internalType:"contract IInputBox",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"token",internalType:"contract IERC1155",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"tokenIds",internalType:"uint256[]",type:"uint256[]"},{name:"values",internalType:"uint256[]",type:"uint256[]"},{name:"baseLayerData",internalType:"bytes",type:"bytes"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositBatchERC1155Token",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getInputBox",outputs:[{name:"",internalType:"contract IInputBox",type:"address"}],stateMutability:"view"}],N7="0xe246Abb974B307490d9C6932F48EbE79de72338A";var QP=[{type:"constructor",inputs:[{name:"inputBox",internalType:"contract IInputBox",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"token",internalType:"contract IERC1155",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"},{name:"baseLayerData",internalType:"bytes",type:"bytes"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositSingleERC1155Token",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getInputBox",outputs:[{name:"",internalType:"contract IInputBox",type:"address"}],stateMutability:"view"}],T7="0x18558398Dd1a8cE20956287a4Da7B76aE7A96662";var $P=[{type:"constructor",inputs:[{name:"inputBox",internalType:"contract IInputBox",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"token",internalType:"contract IERC20",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositERC20Tokens",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getInputBox",outputs:[{name:"",internalType:"contract IInputBox",type:"address"}],stateMutability:"view"},{type:"error",inputs:[],name:"ERC20TransferFailed"}],L7="0xACA6586A0Cf05bD831f2501E7B4aea550dA6562D";var ZP=[{type:"constructor",inputs:[{name:"inputBox",internalType:"contract IInputBox",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"token",internalType:"contract IERC721",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"baseLayerData",internalType:"bytes",type:"bytes"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositERC721Token",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getInputBox",outputs:[{name:"",internalType:"contract IInputBox",type:"address"}],stateMutability:"view"}],P7="0x9E8851dadb2b77103928518846c4678d48b5e371";var XP=[{type:"constructor",inputs:[{name:"inputBox",internalType:"contract IInputBox",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositEther",outputs:[],stateMutability:"payable"},{type:"function",inputs:[],name:"getInputBox",outputs:[{name:"",internalType:"contract IInputBox",type:"address"}],stateMutability:"view"},{type:"error",inputs:[],name:"EtherTransferFailed"}],kZ="0xA632c5c05812c6a6149B7af5C56117d1D2603828";var YP=[{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"payload",internalType:"bytes",type:"bytes"}],name:"addInput",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getDeploymentBlockNumber",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"index",internalType:"uint256",type:"uint256"}],name:"getInputHash",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"getNumberOfInputs",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"event",anonymous:!1,inputs:[{name:"appContract",internalType:"address",type:"address",indexed:!0},{name:"index",internalType:"uint256",type:"uint256",indexed:!0},{name:"input",internalType:"bytes",type:"bytes",indexed:!1}],name:"InputAdded"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"inputLength",internalType:"uint256",type:"uint256"},{name:"maxInputLength",internalType:"uint256",type:"uint256"}],name:"InputTooLarge"}],j7="0x1b51e2992A2755Ba4D6F7094032DF91991a0Cfac";var yZ="0x870240e83b1181b419f18303D4ccC56574De2931";var rK=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"id",internalType:"uint256",type:"uint256"}],name:"balanceOf",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"accounts",internalType:"address[]",type:"address[]"},{name:"ids",internalType:"uint256[]",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{name:"",internalType:"uint256[]",type:"uint256[]"}],stateMutability:"view"},{type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"operator",internalType:"address",type:"address"}],name:"isApprovedForAll",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"ids",internalType:"uint256[]",type:"uint256[]"},{name:"values",internalType:"uint256[]",type:"uint256[]"},{name:"data",internalType:"bytes",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"id",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"approved",internalType:"bool",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"",internalType:"uint256",type:"uint256"}],name:"uri",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"event",anonymous:!1,inputs:[{name:"account",internalType:"address",type:"address",indexed:!0},{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"approved",internalType:"bool",type:"bool",indexed:!1}],name:"ApprovalForAll"},{type:"event",anonymous:!1,inputs:[{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"ids",internalType:"uint256[]",type:"uint256[]",indexed:!1},{name:"values",internalType:"uint256[]",type:"uint256[]",indexed:!1}],name:"TransferBatch"},{type:"event",anonymous:!1,inputs:[{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"id",internalType:"uint256",type:"uint256",indexed:!1},{name:"value",internalType:"uint256",type:"uint256",indexed:!1}],name:"TransferSingle"},{type:"event",anonymous:!1,inputs:[{name:"value",internalType:"string",type:"string",indexed:!1},{name:"id",internalType:"uint256",type:"uint256",indexed:!0}],name:"URI"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"},{name:"balance",internalType:"uint256",type:"uint256"},{name:"needed",internalType:"uint256",type:"uint256"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ERC1155InsufficientBalance"},{type:"error",inputs:[{name:"approver",internalType:"address",type:"address"}],name:"ERC1155InvalidApprover"},{type:"error",inputs:[{name:"idsLength",internalType:"uint256",type:"uint256"},{name:"valuesLength",internalType:"uint256",type:"uint256"}],name:"ERC1155InvalidArrayLength"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"}],name:"ERC1155InvalidOperator"},{type:"error",inputs:[{name:"receiver",internalType:"address",type:"address"}],name:"ERC1155InvalidReceiver"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"}],name:"ERC1155InvalidSender"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"owner",internalType:"address",type:"address"}],name:"ERC1155MissingApprovalForAll"}],fZ="0x684B8713722a2Dc82b983Ddd2177AA6F143F04B2";var qP=[{type:"constructor",inputs:[{name:"initialOwner",internalType:"address",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"balanceOf",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"getApproved",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"},{name:"operator",internalType:"address",type:"address"}],name:"isApprovedForAll",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[],name:"name",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[],name:"owner",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ownerOf",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"uri",internalType:"string",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"approved",internalType:"bool",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[],name:"symbol",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"tokenURI",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"newOwner",internalType:"address",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable"},{type:"event",anonymous:!1,inputs:[{name:"owner",internalType:"address",type:"address",indexed:!0},{name:"approved",internalType:"address",type:"address",indexed:!0},{name:"tokenId",internalType:"uint256",type:"uint256",indexed:!0}],name:"Approval"},{type:"event",anonymous:!1,inputs:[{name:"owner",internalType:"address",type:"address",indexed:!0},{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"approved",internalType:"bool",type:"bool",indexed:!1}],name:"ApprovalForAll"},{type:"event",anonymous:!1,inputs:[{name:"_fromTokenId",internalType:"uint256",type:"uint256",indexed:!1},{name:"_toTokenId",internalType:"uint256",type:"uint256",indexed:!1}],name:"BatchMetadataUpdate"},{type:"event",anonymous:!1,inputs:[{name:"_tokenId",internalType:"uint256",type:"uint256",indexed:!1}],name:"MetadataUpdate"},{type:"event",anonymous:!1,inputs:[{name:"previousOwner",internalType:"address",type:"address",indexed:!0},{name:"newOwner",internalType:"address",type:"address",indexed:!0}],name:"OwnershipTransferred"},{type:"event",anonymous:!1,inputs:[{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"tokenId",internalType:"uint256",type:"uint256",indexed:!0}],name:"Transfer"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"owner",internalType:"address",type:"address"}],name:"ERC721IncorrectOwner"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ERC721InsufficientApproval"},{type:"error",inputs:[{name:"approver",internalType:"address",type:"address"}],name:"ERC721InvalidApprover"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"}],name:"ERC721InvalidOperator"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"ERC721InvalidOwner"},{type:"error",inputs:[{name:"receiver",internalType:"address",type:"address"}],name:"ERC721InvalidReceiver"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"}],name:"ERC721InvalidSender"},{type:"error",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ERC721NonexistentToken"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"OwnableInvalidOwner"},{type:"error",inputs:[{name:"account",internalType:"address",type:"address"}],name:"OwnableUnauthorizedAccount"}],l4="0x1c5AB37576Af4e6BEeCB66Fa6a9FdBc608F44B78";var hZ="0x5138f529B77B4e0a7c84B77E79c4335D31938fed";var GP=(D=0)=>(F)=>`\x1B[${F+D}m`,WP=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,BP=(D=0)=>(F,J,Q)=>`\x1B[${38+D};2;${F};${J};${Q}m`,PD={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]}},RnD=Object.keys(PD.modifier),Ls=Object.keys(PD.color),Ps=Object.keys(PD.bgColor),AnD=[...Ls,...Ps];function js(){let D=new Map;for(let[F,J]of Object.entries(PD)){for(let[Q,$]of Object.entries(J))PD[Q]={open:`\x1B[${$[0]}m`,close:`\x1B[${$[1]}m`},J[Q]=PD[Q],D.set($[0],$[1]);Object.defineProperty(PD,F,{value:J,enumerable:!1})}return Object.defineProperty(PD,"codes",{value:D,enumerable:!1}),PD.color.close="\x1B[39m",PD.bgColor.close="\x1B[49m",PD.color.ansi=GP(),PD.color.ansi256=WP(),PD.color.ansi16m=BP(),PD.bgColor.ansi=GP(10),PD.bgColor.ansi256=WP(10),PD.bgColor.ansi16m=BP(10),Object.defineProperties(PD,{rgbToAnsi256:{value(F,J,Q){if(F===J&&J===Q){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(J/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value(F){let J=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!J)return[0,0,0];let[Q]=J;if(Q.length===3)Q=[...Q].map((Z)=>Z+Z).join("");let $=Number.parseInt(Q,16);return[$>>16&255,$>>8&255,$&255]},enumerable:!1},hexToAnsi256:{value:(F)=>PD.rgbToAnsi256(...PD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let J,Q,$;if(F>=232)J=((F-232)*10+8)/255,Q=J,$=J;else{F-=16;let Y=F%36;J=Math.floor(F/36)/5,Q=Math.floor(Y/6)/5,$=Y%6/5}let Z=Math.max(J,Q,$)*2;if(Z===0)return 30;let X=30+(Math.round($)<<2|Math.round(Q)<<1|Math.round(J));if(Z===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:(F,J,Q)=>PD.ansi256ToAnsi(PD.rgbToAnsi256(F,J,Q)),enumerable:!1},hexToAnsi:{value:(F)=>PD.ansi256ToAnsi(PD.hexToAnsi256(F)),enumerable:!1}}),PD}var Ss=js(),o8=Ss;import sK from"node:process";import xs from"node:os";import KP from"node:tty";function A8(D,F=globalThis.Deno?globalThis.Deno.args:sK.argv){let J=D.startsWith("-")?"":D.length===1?"-":"--",Q=F.indexOf(J+D),$=F.indexOf("--");return Q!==-1&&($===-1||Q<$)}var{env:jD}=sK,bZ;if(A8("no-color")||A8("no-colors")||A8("color=false")||A8("color=never"))bZ=0;else if(A8("color")||A8("colors")||A8("color=true")||A8("color=always"))bZ=1;function ks(){if("FORCE_COLOR"in jD){if(jD.FORCE_COLOR==="true")return 1;if(jD.FORCE_COLOR==="false")return 0;return jD.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(jD.FORCE_COLOR,10),3)}}function ys(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function fs(D,{streamIsTTY:F,sniffFlags:J=!0}={}){let Q=ks();if(Q!==void 0)bZ=Q;let $=J?bZ:Q;if($===0)return 0;if(J){if(A8("color=16m")||A8("color=full")||A8("color=truecolor"))return 3;if(A8("color=256"))return 2}if("TF_BUILD"in jD&&"AGENT_NAME"in jD)return 1;if(D&&!F&&$===void 0)return 0;let Z=$||0;if(jD.TERM==="dumb")return Z;if(sK.platform==="win32"){let X=xs.release().split(".");if(Number(X[0])>=10&&Number(X[2])>=10586)return Number(X[2])>=14931?3:2;return 1}if("CI"in jD){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((X)=>(X in jD)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((X)=>(X in jD))||jD.CI_NAME==="codeship")return 1;return Z}if("TEAMCITY_VERSION"in jD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(jD.TEAMCITY_VERSION)?1:0;if(jD.COLORTERM==="truecolor")return 3;if(jD.TERM==="xterm-kitty")return 3;if(jD.TERM==="xterm-ghostty")return 3;if(jD.TERM==="wezterm")return 3;if("TERM_PROGRAM"in jD){let X=Number.parseInt((jD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(jD.TERM_PROGRAM){case"iTerm.app":return X>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(jD.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(jD.TERM))return 1;if("COLORTERM"in jD)return 1;return Z}function UP(D,F={}){let J=fs(D,{streamIsTTY:D&&D.isTTY,...F});return ys(J)}var hs={stdout:UP({isTTY:KP.isatty(1)}),stderr:UP({isTTY:KP.isatty(2)})},VP=hs;function HP(D,F,J){let Q=D.indexOf(F);if(Q===-1)return D;let $=F.length,Z=0,X="";do X+=D.slice(Z,Q)+F+J,Z=Q+$,Q=D.indexOf(F,Z);while(Q!==-1);return X+=D.slice(Z),X}function zP(D,F,J,Q){let $=0,Z="";do{let X=D[Q-1]==="\r";Z+=D.slice($,X?Q-1:Q)+F+(X?`\r
|
|
540
|
+
`:`
|
|
541
|
+
`)+J,$=Q+1,Q=D.indexOf(`
|
|
542
|
+
`,$)}while(Q!==-1);return Z+=D.slice($),Z}var{stdout:CP,stderr:_P}=VP,tK=Symbol("GENERATOR"),S7=Symbol("STYLER"),c4=Symbol("IS_EMPTY"),OP=["ansi","ansi","ansi256","ansi16m"],x7=Object.create(null),bs=(D,F={})=>{if(F.level&&!(Number.isInteger(F.level)&&F.level>=0&&F.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let J=CP?CP.level:0;D.level=F.level===void 0?J:F.level};var vs=(D)=>{let F=(...J)=>J.join(" ");return bs(F,D),Object.setPrototypeOf(F,n4.prototype),F};function n4(D){return vs(D)}Object.setPrototypeOf(n4.prototype,Function.prototype);for(let[D,F]of Object.entries(o8))x7[D]={get(){let J=vZ(this,DU(F.open,F.close,this[S7]),this[c4]);return Object.defineProperty(this,D,{value:J}),J}};x7.visible={get(){let D=vZ(this,this[S7],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var eK=(D,F,J,...Q)=>{if(D==="rgb"){if(F==="ansi16m")return o8[J].ansi16m(...Q);if(F==="ansi256")return o8[J].ansi256(o8.rgbToAnsi256(...Q));return o8[J].ansi(o8.rgbToAnsi(...Q))}if(D==="hex")return eK("rgb",F,J,...o8.hexToRgb(...Q));return o8[J][D](...Q)},us=["rgb","hex","ansi256"];for(let D of us){x7[D]={get(){let{level:J}=this;return function(...Q){let $=DU(eK(D,OP[J],"color",...Q),o8.color.close,this[S7]);return vZ(this,$,this[c4])}}};let F="bg"+D[0].toUpperCase()+D.slice(1);x7[F]={get(){let{level:J}=this;return function(...Q){let $=DU(eK(D,OP[J],"bgColor",...Q),o8.bgColor.close,this[S7]);return vZ(this,$,this[c4])}}}}var gs=Object.defineProperties(()=>{},{...x7,level:{enumerable:!0,get(){return this[tK].level},set(D){this[tK].level=D}}}),DU=(D,F,J)=>{let Q,$;if(J===void 0)Q=D,$=F;else Q=J.openAll+D,$=F+J.closeAll;return{open:D,close:F,openAll:Q,closeAll:$,parent:J}},vZ=(D,F,J)=>{let Q=(...$)=>ms(Q,$.length===1?""+$[0]:$.join(" "));return Object.setPrototypeOf(Q,gs),Q[tK]=D,Q[S7]=F,Q[c4]=J,Q},ms=(D,F)=>{if(D.level<=0||!F)return D[c4]?"":F;let J=D[S7];if(J===void 0)return F;let{openAll:Q,closeAll:$}=J;if(F.includes("\x1B"))while(J!==void 0)F=HP(F,J.close,J.open),J=J.parent;let Z=F.indexOf(`
|
|
543
|
+
`);if(Z!==-1)F=zP(F,$,Q,Z);return Q+F+$};Object.defineProperties(n4.prototype,x7);var ds=n4(),knD=n4({level:_P?_P.level:0});var b=ds;var RP=ID(EP(),1);var AP=RP.default;import*as gZ from"tty";var{env:BF={},argv:IP=[],platform:cs=""}=typeof process>"u"?{}:process,ns="NO_COLOR"in BF||IP.includes("--no-color"),is="FORCE_COLOR"in BF||IP.includes("--color"),os=cs==="win32",NP=BF.TERM==="dumb",as=gZ&&gZ.isatty&&gZ.isatty(1)&&BF.TERM&&!NP,rs="CI"in BF&&(("GITHUB_ACTIONS"in BF)||("GITLAB_CI"in BF)||("CIRCLECI"in BF)),ss=!ns&&(is||os&&!NP||as||rs),TP=(D,F,J,Q,$=F.substring(0,D)+Q,Z=F.substring(D+J.length),X=Z.indexOf(J))=>$+(X<0?Z:TP(X,Z,J,Q)),ts=(D,F,J,Q,$)=>D<0?J+F+Q:J+TP(D,F,Q,$)+Q,es=(D,F,J=D,Q=D.length+1)=>($)=>$||!($===""||$===void 0)?ts((""+$).indexOf(F,Q),$,D,F,J):"",JD=(D,F,J)=>es(`\x1B[${D}m`,`\x1B[${F}m`,J),wP={reset:JD(0,0),bold:JD(1,22,"\x1B[22m\x1B[1m"),dim:JD(2,22,"\x1B[22m\x1B[2m"),italic:JD(3,23),underline:JD(4,24),inverse:JD(7,27),hidden:JD(8,28),strikethrough:JD(9,29),black:JD(30,39),red:JD(31,39),green:JD(32,39),yellow:JD(33,39),blue:JD(34,39),magenta:JD(35,39),cyan:JD(36,39),white:JD(37,39),gray:JD(90,39),bgBlack:JD(40,49),bgRed:JD(41,49),bgGreen:JD(42,49),bgYellow:JD(43,49),bgBlue:JD(44,49),bgMagenta:JD(45,49),bgCyan:JD(46,49),bgWhite:JD(47,49),blackBright:JD(90,39),redBright:JD(91,39),greenBright:JD(92,39),yellowBright:JD(93,39),blueBright:JD(94,39),magentaBright:JD(95,39),cyanBright:JD(96,39),whiteBright:JD(97,39),bgBlackBright:JD(100,49),bgRedBright:JD(101,49),bgGreenBright:JD(102,49),bgYellowBright:JD(103,49),bgBlueBright:JD(104,49),bgMagentaBright:JD(105,49),bgCyanBright:JD(106,49),bgWhiteBright:JD(107,49)},JU=({useColor:D=ss}={})=>D?wP:Object.keys(wP).reduce((F,J)=>({...F,[J]:String}),{}),{reset:bnD,bold:vnD,dim:unD,italic:gnD,underline:mnD,inverse:dnD,hidden:pnD,strikethrough:lnD,black:cnD,red:nnD,green:inD,yellow:onD,blue:anD,magenta:rnD,cyan:snD,white:tnD,gray:enD,bgBlack:DiD,bgRed:FiD,bgGreen:JiD,bgYellow:QiD,bgBlue:$iD,bgMagenta:ZiD,bgCyan:XiD,bgWhite:YiD,blackBright:qiD,redBright:GiD,greenBright:WiD,yellowBright:BiD,blueBright:KiD,magentaBright:UiD,cyanBright:ViD,whiteBright:HiD,bgBlackBright:ziD,bgRedBright:CiD,bgGreenBright:_iD,bgYellowBright:OiD,bgBlueBright:MiD,bgMagentaBright:EiD,bgCyanBright:RiD,bgWhiteBright:AiD}=JU();var Ej=ID(PP(),1);import{format as Re}from"util";import{EOL as y2}from"os";import{StringDecoder as Ae}from"string_decoder";import{Writable as we}from"stream";import{randomUUID as Ie}from"crypto";var Uj="\x1B[",Vj={CURSOR_HIDE:Uj+"?25l",CURSOR_SHOW:Uj+"?25h"},MU=function(D){return D.FORCE_UNICODE="LISTR_FORCE_UNICODE",D.FORCE_TTY="LISTR_FORCE_TTY",D.DISABLE_COLOR="NO_COLOR",D.FORCE_COLOR="FORCE_COLOR",D}({}),D5=function(D){return D.WILL_RETRY="WILL_RETRY",D.WILL_ROLLBACK="WILL_ROLLBACK",D.HAS_FAILED_TO_ROLLBACK="HAS_FAILED_TO_ROLLBACK",D.HAS_FAILED="HAS_FAILED",D.HAS_FAILED_WITHOUT_ERROR="HAS_FAILED_WITHOUT_ERROR",D}({}),UF=function(D){return D.SHOULD_REFRESH_RENDER="SHOUD_REFRESH_RENDER",D}({}),F5=function(D){return D.PRIMARY="PRIMARY",D.SECONDARY="SECONDARY",D.SILENT="SILENT",D}({}),QD=function(D){return D.TITLE="TITLE",D.STATE="STATE",D.ENABLED="ENABLED",D.SUBTASK="SUBTASK",D.PROMPT="PROMPT",D.OUTPUT="OUTPUT",D.MESSAGE="MESSAGE",D.CLOSED="CLOSED",D}({}),XD=function(D){return D.WAITING="WAITING",D.STARTED="STARTED",D.COMPLETED="COMPLETED",D.FAILED="FAILED",D.SKIPPED="SKIPPED",D.ROLLING_BACK="ROLLING_BACK",D.ROLLED_BACK="ROLLED_BACK",D.RETRY="RETRY",D.PAUSED="PAUSED",D.PROMPT="PROMPT",D.PROMPT_COMPLETED="PROMPT_COMPLETED",D.PROMPT_FAILED="PROMPT_FAILED",D}({}),Rj=class{emitter=new AP;emit(D,F){this.emitter.emit(D,F)}on(D,F){this.emitter.addListener(D,F)}once(D,F){this.emitter.once(D,F)}off(D,F){this.emitter.off(D,F)}complete(){this.emitter.removeAllListeners()}};function Ne(D){return!!D&&typeof D==="object"&&typeof D.subscribe==="function"}function Te(D){return!!D&&typeof D==="object"&&D.readable===!0&&typeof D.read==="function"&&typeof D.on==="function"}function Aj(){return!!process.env[MU.FORCE_UNICODE]||process.platform!=="win32"||!!process.env.CI||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}var Le="(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+",Pe=/\u0007/;function Q5(D){return String(D).replace(new RegExp(Le,"gmi"),"").replace(new RegExp(Pe,"gmi"),"").trim()}var zD=JU();function Hj(D,F){return D.replace(/^(?!\s*$)/gm," ".repeat(F))}var wj={warning:"⚠",cross:"✖",arrowDown:"↓",tick:"✔",arrowRight:"→",pointer:"❯",checkboxOn:"☒",arrowLeft:"←",squareSmallFilled:"◼",pointerSmall:"›"},je={...wj,warning:"‼",cross:"×",tick:"√",pointer:">",checkboxOn:"[×]",squareSmallFilled:"■"},xD=Aj()?wj:je;function J5(D,...F){return Re(String(D),...F)}var n=function(D){return D.STARTED="STARTED",D.COMPLETED="COMPLETED",D.FAILED="FAILED",D.SKIPPED="SKIPPED",D.OUTPUT="OUTPUT",D.TITLE="TITLE",D.ROLLBACK="ROLLBACK",D.RETRY="RETRY",D.PROMPT="PROMPT",D.PAUSED="PAUSED",D}({}),sZ={icon:{[n.STARTED]:xD.pointer,[n.FAILED]:xD.cross,[n.SKIPPED]:xD.arrowDown,[n.COMPLETED]:xD.tick,[n.OUTPUT]:xD.pointerSmall,[n.TITLE]:xD.arrowRight,[n.RETRY]:xD.warning,[n.ROLLBACK]:xD.arrowLeft,[n.PAUSED]:xD.squareSmallFilled},color:{[n.STARTED]:zD.yellow,[n.FAILED]:zD.red,[n.SKIPPED]:zD.yellow,[n.COMPLETED]:zD.green,[n.RETRY]:zD.yellowBright,[n.ROLLBACK]:zD.redBright,[n.PAUSED]:zD.yellowBright}},Ij=[n.RETRY,n.ROLLBACK,n.FAILED],tZ=class{process;constructor(D){this.options=D,this.options={useIcons:!0,toStderr:[],...D??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new Se}log(D,F,J){let Q=this.format(D,F,J);if(this.options.toStderr.includes(D)){this.process.toStderr(Q);return}this.process.toStdout(Q)}toStdout(D,F,J=!0){this.process.toStdout(this.format(null,D,F),J)}toStderr(D,F,J=!0){this.process.toStderr(this.format(null,D,F),J)}wrap(D,F){if(!D)return D;return this.applyFormat(`[${D}]`,F)}splat(...D){let F=D.shift()??"";return D.length===0?F:J5(F,D)}suffix(D,...F){return F.filter(Boolean).forEach((J)=>{if(D+=this.spacing(D),typeof J==="string")D+=this.wrap(J);else if(typeof J==="object"){if(J.args??=[],typeof J.condition==="function"?!J.condition(...J.args):!(J.condition??!0))return D;D+=this.wrap(typeof J.field==="function"?J.field(...J.args):J.field,{format:J?.format(...J.args)})}}),D}prefix(D,...F){return F.filter(Boolean).forEach((J)=>{if(D=this.spacing(D)+D,typeof J==="string")D=this.wrap(J)+D;else if(typeof J==="object"){if(J.args??=[],typeof J.condition==="function"?!J.condition(...J.args):!(J.condition??!0))return D;D=this.wrap(typeof J.field==="function"?J.field(...J.args):J.field,{format:J?.format()})+D}}),D}fields(D,F){if(this.options?.fields?.prefix)D=this.prefix(D,...this.options.fields.prefix);if(F?.prefix)D=this.prefix(D,...F.prefix);if(F?.suffix)D=this.suffix(D,...F.suffix);if(this.options?.fields?.suffix)D=this.suffix(D,...this.options.fields.suffix);return D}icon(D,F){if(!D)return null;if(!F){let Q=this.options.icon?.[D];F=typeof Q==="function"?Q():Q}let J=this.options.color?.[D];if(F&&J)F=J(F);return F}format(D,F,J){if(!Array.isArray(F))F=[F];return F=this.splat(F.shift(),...F).toString().split(y2).filter((Q)=>!Q||Q.trim()!=="").map((Q)=>{return this.style(D,this.fields(Q,{prefix:Array.isArray(J?.prefix)?J.prefix:[J?.prefix],suffix:Array.isArray(J?.suffix)?J.suffix:[J?.suffix]}))}).join(y2),F}style(D,F){if(!D||!F)return F;let J=this.icon(D,!this.options.useIcons&&this.wrap(D));if(J)F=J+" "+F;return F}applyFormat(D,F){if(F?.format)return F.format(D);return D}spacing(D){return typeof D>"u"||D.trim()===""?"":" "}},EU=class{buffer=[];decoder=new Ae;constructor(D){this.options=D}get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(D,...F){let J=F[F.length-1];if(this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write(typeof D==="string"?Buffer.from(D,typeof F[0]==="string"?F[0]:void 0):Buffer.from(D))}),this.options?.limit)this.buffer=this.buffer.slice(-this.options.limit);if(typeof J==="function")J();return!0}reset(){this.buffer=[]}},zj=class{method;buffer;constructor(D){this.stream=D,this.method=D.write,this.buffer=new EU({stream:D})}get out(){return Object.assign({},this.stream,{write:this.write.bind(this)})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;let D=[...this.buffer.all];return this.buffer.reset(),D}write(...D){return this.method.apply(this.stream,D)}},Se=class{stream;active;constructor(D,F,J){this.options=J,this.stream={stdout:new zj(D??process.stdout),stderr:new zj(F??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...J}}get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(Vj.CURSOR_HIDE),Object.values(this.stream).forEach((D)=>D.hijack()),this.active=!0}release(){let D=Object.entries(this.stream).map(([F,J])=>({name:F,buffer:J.release()})).filter((F)=>this.options.dump.includes(F.name)).flatMap((F)=>F.buffer).sort((F,J)=>F.time-J.time).map((F)=>{return{...F,entry:Q5(F.entry)}}).filter((F)=>F.entry);if(D.length>0){if(this.options.leaveEmptyLine)this.stdout.write(y2);D.forEach((F)=>{(F.stream??this.stdout).write(F.entry+y2)})}this.stream.stdout.write(Vj.CURSOR_SHOW),this.active=!1}toStdout(D,F=!0){if(F)D=D+y2;return this.stream.stdout.write(D)}toStderr(D,F=!0){if(F)D=D+y2;return this.stream.stderr.write(D)}};function xe(D){let F=new we;return F.rows=1/0,F.columns=1/0,F.write=(J)=>{return D(J.toString()),!0},F}var ke=class{spinner=!Aj()?["-","\\","|","/"]:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];id;spinnerPosition=0;spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(D,F=100){this.id=setInterval(()=>{if(this.spin(),D)D()},F)}stop(){clearInterval(this.id)}},a=function(D){return D.SKIPPED_WITH_COLLAPSE="SKIPPED_WITH_COLLAPSE",D.SKIPPED_WITHOUT_COLLAPSE="SKIPPED_WITHOUT_COLLAPSE",D.OUTPUT="OUTPUT",D.OUTPUT_WITH_BOTTOMBAR="OUTPUT_WITH_BOTTOMBAR",D.PENDING="PENDING",D.COMPLETED="COMPLETED",D.COMPLETED_WITH_FAILED_SUBTASKS="COMPLETED_WITH_FAILED_SUBTASKS",D.COMPLETED_WITH_FAILED_SISTER_TASKS="COMPLETED_WITH_SISTER_TASKS_FAILED",D.RETRY="RETRY",D.ROLLING_BACK="ROLLING_BACK",D.ROLLED_BACK="ROLLED_BACK",D.FAILED="FAILED",D.FAILED_WITH_FAILED_SUBTASKS="FAILED_WITH_SUBTASKS",D.WAITING="WAITING",D.PAUSED="PAUSED",D}({}),Cj={icon:{[a.SKIPPED_WITH_COLLAPSE]:xD.arrowDown,[a.SKIPPED_WITHOUT_COLLAPSE]:xD.warning,[a.OUTPUT]:xD.pointerSmall,[a.OUTPUT_WITH_BOTTOMBAR]:xD.pointerSmall,[a.PENDING]:xD.pointer,[a.COMPLETED]:xD.tick,[a.COMPLETED_WITH_FAILED_SUBTASKS]:xD.warning,[a.COMPLETED_WITH_FAILED_SISTER_TASKS]:xD.squareSmallFilled,[a.RETRY]:xD.warning,[a.ROLLING_BACK]:xD.warning,[a.ROLLED_BACK]:xD.arrowLeft,[a.FAILED]:xD.cross,[a.FAILED_WITH_FAILED_SUBTASKS]:xD.pointer,[a.WAITING]:xD.squareSmallFilled,[a.PAUSED]:xD.squareSmallFilled},color:{[a.SKIPPED_WITH_COLLAPSE]:zD.yellow,[a.SKIPPED_WITHOUT_COLLAPSE]:zD.yellow,[a.PENDING]:zD.yellow,[a.COMPLETED]:zD.green,[a.COMPLETED_WITH_FAILED_SUBTASKS]:zD.yellow,[a.COMPLETED_WITH_FAILED_SISTER_TASKS]:zD.red,[a.RETRY]:zD.yellowBright,[a.ROLLING_BACK]:zD.redBright,[a.ROLLED_BACK]:zD.redBright,[a.FAILED]:zD.red,[a.FAILED_WITH_FAILED_SUBTASKS]:zD.red,[a.WAITING]:zD.dim,[a.PAUSED]:zD.yellowBright}};function ye(D){let F=Math.floor(D/1000),J=Math.floor(F/60),Q;if(F===0&&J===0)Q=`0.${Math.floor(D/100)}s`;if(F>0)Q=`${F%60}s`;if(J>0)Q=`${J}m${Q}`;return Q}var RU={condition:!0,field:ye,format:()=>zD.dim};var fe=class D{static nonTTY=!1;static rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{...RU,format:()=>zD.yellowBright}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};constructor(F,J,Q){this.tasks=F,this.options=J,this.events=Q,this.options={...D.rendererOptions,...this.options,icon:{...Cj.icon,...J?.icon??{}},color:{...Cj.color,...J?.color??{}}},this.spinner=this.options.spinner??new ke,this.logger=this.options.logger??new tZ({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}async render(){let{createLogUpdate:F}=await Promise.resolve().then(() => (Gj(),qj)),{default:J}=await Promise.resolve().then(() => (Kj(),Bj)),{default:Q}=await Promise.resolve().then(() => (oZ(),$j));if(this.updater=F(this.logger.process.stdout),this.truncate=J,this.wrap=Q,this.logger.process.hijack(),!this.options?.lazy)this.spinner.start(()=>{this.update()});this.events.on(UF.SHOULD_REFRESH_RENDER,()=>{this.update()})}update(){this.updater(this.create())}end(){if(this.spinner.stop(),this.updater.clear(),this.updater.done(),!this.options.clearOutput)this.logger.process.toStdout(this.create({prompt:!1}));this.logger.process.release()}create(F){F={tasks:!0,bottomBar:!0,prompt:!0,...F};let J=[],Q=this.renderer(this.tasks),$=this.renderBottomBar(),Z=this.renderPrompt();if(F.tasks&&Q.length>0)J.push(...Q);if(F.bottomBar&&$.length>0){if(J.length>0)J.push("");J.push(...$)}if(F.prompt&&Z.length>0){if(J.length>0)J.push("");J.push(...Z)}return J.join(y2)}style(F,J=!1){let Q=this.cache.rendererOptions.get(F.id);if(F.isSkipped()){if(J||Q.collapseSkips)return this.logger.icon(a.SKIPPED_WITH_COLLAPSE);else if(Q.collapseSkips===!1)return this.logger.icon(a.SKIPPED_WITHOUT_COLLAPSE)}if(J){if(this.shouldOutputToBottomBar(F))return this.logger.icon(a.OUTPUT_WITH_BOTTOMBAR);return this.logger.icon(a.OUTPUT)}if(F.hasSubtasks()){if(F.isStarted()||F.isPrompt()&&Q.showSubtasks!==!1&&!F.subtasks.every(($)=>!$.hasTitle()))return this.logger.icon(a.PENDING);else if(F.isCompleted()&&F.subtasks.some(($)=>$.hasFailed()))return this.logger.icon(a.COMPLETED_WITH_FAILED_SUBTASKS);else if(F.hasFailed())return this.logger.icon(a.FAILED_WITH_FAILED_SUBTASKS)}if(F.isStarted()||F.isPrompt())return this.logger.icon(a.PENDING,!this.options?.lazy&&this.spinner.fetch());else if(F.isCompleted())return this.logger.icon(a.COMPLETED);else if(F.isRetrying())return this.logger.icon(a.RETRY,!this.options?.lazy&&this.spinner.fetch());else if(F.isRollingBack())return this.logger.icon(a.ROLLING_BACK,!this.options?.lazy&&this.spinner.fetch());else if(F.hasRolledBack())return this.logger.icon(a.ROLLED_BACK);else if(F.hasFailed())return this.logger.icon(a.FAILED);else if(F.isPaused())return this.logger.icon(a.PAUSED);return this.logger.icon(a.WAITING)}format(F,J,Q){if(F.trim()==="")return[];if(J)F=J+" "+F;let $,Z=(process.stdout.columns??80)-Q*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":$=F.split(y2).map((X,Y)=>{return this.truncate(this.indent(X,Y),Z)});break;case"wrap":$=this.wrap(F,Z,{hard:!0,trim:!1}).split(y2).map((X,Y)=>this.indent(X,Y));break;default:throw new Oj("Format option for the renderer is wrong.")}if(this.options.removeEmptyLines)$=$.filter(Boolean);return $.map((X)=>Hj(X,Q*this.options.indentation))}shouldOutputToOutputBar(F){let J=this.cache.rendererTaskOptions.get(F.id).outputBar;return typeof J==="number"&&J!==0||typeof J==="boolean"&&J!==!1}shouldOutputToBottomBar(F){let J=this.cache.rendererTaskOptions.get(F.id).bottomBar;return typeof J==="number"&&J!==0||typeof J==="boolean"&&J!==!1||!F.hasTitle()}renderer(F,J=0){return F.flatMap((Q)=>{if(!Q.isEnabled())return[];if(this.cache.render.has(Q.id))return this.cache.render.get(Q.id);this.calculate(Q),this.setupBuffer(Q);let $=this.cache.rendererOptions.get(Q.id),Z=this.cache.rendererTaskOptions.get(Q.id),X=[];if(Q.isPrompt()){if(this.activePrompt&&this.activePrompt!==Q.id)throw new Oj("Only one prompt can be active at the given time, please re-evaluate your task design.");else if(!this.activePrompt)Q.on(QD.PROMPT,(Y)=>{let q=Q5(Y);if(q)this.prompt=q}),Q.on(QD.STATE,(Y)=>{if(Y===XD.PROMPT_COMPLETED||Q.hasFinalized()||Q.hasReset())this.prompt=null,this.activePrompt=null,Q.off(QD.PROMPT)}),this.activePrompt=Q.id}if(Q.hasTitle())if(!(F.some((Y)=>Y.hasFailed())&&!Q.hasFailed()&&Q.options.exitOnError!==!1&&!(Q.isCompleted()||Q.isSkipped())))if(Q.hasFailed()&&$.collapseErrors)X.push(...this.format(!Q.hasSubtasks()&&Q.message.error&&$.showErrorMessage?Q.message.error:Q.title,this.style(Q),J));else if(Q.isSkipped()&&$.collapseSkips)X.push(...this.format(this.logger.suffix(Q.message.skip&&$.showSkipMessage?Q.message.skip:Q.title,{field:n.SKIPPED,condition:$.suffixSkips,format:()=>zD.dim}),this.style(Q),J));else if(Q.isRetrying())X.push(...this.format(this.logger.suffix(Q.title,{field:`${n.RETRY}:${Q.message.retry.count}`,format:()=>zD.yellow,condition:$.suffixRetries}),this.style(Q),J));else if(Q.isCompleted()&&Q.hasTitle()&&d7(Z.timer?.condition,Q.message.duration))X.push(...this.format(this.logger.suffix(Q?.title,{...Z.timer,args:[Q.message.duration]}),this.style(Q),J));else if(Q.isPaused())X.push(...this.format(this.logger.suffix(Q.title,{...$.pausedTimer,args:[Q.message.paused-Date.now()]}),this.style(Q),J));else X.push(...this.format(Q.title,this.style(Q),J));else X.push(...this.format(Q.title,this.logger.icon(a.COMPLETED_WITH_FAILED_SISTER_TASKS),J));if(!Q.hasSubtasks()||!$.showSubtasks){if(Q.hasFailed()&&$.collapseErrors===!1&&($.showErrorMessage||!$.showSubtasks))X.push(...this.dump(Q,J,n.FAILED));else if(Q.isSkipped()&&$.collapseSkips===!1&&($.showSkipMessage||!$.showSubtasks))X.push(...this.dump(Q,J,n.SKIPPED))}if(Q.isPending()||Z.persistentOutput)X.push(...this.renderOutputBar(Q,J));if($.showSubtasks!==!1&&Q.hasSubtasks()&&(Q.isPending()||Q.hasFinalized()&&!Q.hasTitle()||Q.isCompleted()&&$.collapseSubtasks===!1&&!Q.subtasks.some((Y)=>this.cache.rendererOptions.get(Y.id)?.collapseSubtasks===!0)||Q.subtasks.some((Y)=>this.cache.rendererOptions.get(Y.id)?.collapseSubtasks===!1)||Q.subtasks.some((Y)=>Y.hasFailed())||Q.subtasks.some((Y)=>Y.hasRolledBack()))){let Y=!Q.hasTitle()?J:J+1,q=this.renderer(Q.subtasks,Y);X.push(...q)}if(Q.hasFinalized()){if(!Z.persistentOutput)this.buffer.bottom.delete(Q.id),this.buffer.output.delete(Q.id)}if(Q.isClosed())this.cache.render.set(Q.id,X),this.reset(Q);return X})}renderOutputBar(F,J){let Q=this.buffer.output.get(F.id);if(!Q)return[];return Q.all.flatMap(($)=>this.dump(F,J,n.OUTPUT,$.entry))}renderBottomBar(){if(this.buffer.bottom.size===0)return[];return Array.from(this.buffer.bottom.values()).flatMap((F)=>F.all).sort((F,J)=>F.time-J.time).map((F)=>F.entry)}renderPrompt(){if(!this.prompt)return[];return[this.prompt]}calculate(F){if(this.cache.rendererOptions.has(F.id)&&this.cache.rendererTaskOptions.has(F.id))return;let J={...this.options,...F.rendererOptions};this.cache.rendererOptions.set(F.id,J),this.cache.rendererTaskOptions.set(F.id,{...D.rendererTaskOptions,timer:J.timer,...F.rendererTaskOptions})}setupBuffer(F){if(this.buffer.bottom.has(F.id)||this.buffer.output.has(F.id))return;let J=this.cache.rendererTaskOptions.get(F.id);if(this.shouldOutputToBottomBar(F)&&!this.buffer.bottom.has(F.id))this.buffer.bottom.set(F.id,new EU({limit:typeof J.bottomBar==="number"?J.bottomBar:1})),F.on(QD.OUTPUT,(Q)=>{let $=this.dump(F,-1,n.OUTPUT,Q);this.buffer.bottom.get(F.id).write($.join(y2))}),F.on(QD.STATE,(Q)=>{switch(Q){case(XD.RETRY||XD.ROLLING_BACK):this.buffer.bottom.delete(F.id);break}});else if(this.shouldOutputToOutputBar(F)&&!this.buffer.output.has(F.id))this.buffer.output.set(F.id,new EU({limit:typeof J.outputBar==="number"?J.outputBar:1})),F.on(QD.OUTPUT,(Q)=>{this.buffer.output.get(F.id).write(Q)}),F.on(QD.STATE,(Q)=>{switch(Q){case(XD.RETRY||XD.ROLLING_BACK):this.buffer.output.delete(F.id);break}})}reset(F){this.cache.rendererOptions.delete(F.id),this.cache.rendererTaskOptions.delete(F.id),this.buffer.output.delete(F.id)}dump(F,J,Q=n.OUTPUT,$){if(!$)switch(Q){case n.OUTPUT:$=F.output;break;case n.SKIPPED:$=F.message.skip;break;case n.FAILED:$=F.message.error;break}if(F.hasTitle()&&Q===n.FAILED&&$===F.title||typeof $!=="string")return[];if(Q===n.OUTPUT)$=Q5($);return this.format($,this.style(F,!0),J+1)}indent(F,J){return J>0?Hj(F.trimEnd(),this.options.indentation):F.trimEnd()}},he=class{static nonTTY=!0;static rendererOptions;static rendererTaskOptions;constructor(D,F){this.tasks=D,this.options=F}render(){}end(){}},be=class D{static nonTTY=!0;static rendererOptions={pausedTimer:{...RU,field:(F)=>`${n.PAUSED}:${F}`,format:()=>zD.yellowBright}};static rendererTaskOptions={};logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};constructor(F,J){if(this.tasks=F,this.options=J,this.options={...D.rendererOptions,...J,icon:{...sZ.icon,...J?.icon??{}},color:{...sZ.color,...J?.color??{}}},this.logger=this.options.logger??new tZ({useIcons:!0,toStderr:Ij}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp)this.logger.options.fields.prefix.unshift(this.options.timestamp)}end(){}render(){this.renderer(this.tasks)}renderer(F){F.forEach((J)=>{this.calculate(J),J.once(QD.CLOSED,()=>{this.reset(J)});let Q=this.cache.rendererOptions.get(J.id),$=this.cache.rendererTaskOptions.get(J.id);J.on(QD.SUBTASK,(Z)=>{this.renderer(Z)}),J.on(QD.STATE,(Z)=>{if(!J.hasTitle())return;if(Z===XD.STARTED)this.logger.log(n.STARTED,J.title);else if(Z===XD.COMPLETED){let X=$?.timer;this.logger.log(n.COMPLETED,J.title,X&&{suffix:{...X,condition:!!J.message?.duration&&X.condition,args:[J.message.duration]}})}else if(Z===XD.PROMPT)this.logger.process.hijack(),J.on(QD.PROMPT,(X)=>{this.logger.process.toStderr(X,!1)});else if(Z===XD.PROMPT_COMPLETED)J.off(QD.PROMPT),this.logger.process.release()}),J.on(QD.OUTPUT,(Z)=>{this.logger.log(n.OUTPUT,Z)}),J.on(QD.MESSAGE,(Z)=>{if(Z.error)this.logger.log(n.FAILED,J.title,{suffix:{field:`${n.FAILED}: ${Z.error}`,format:()=>zD.red}});else if(Z.skip)this.logger.log(n.SKIPPED,J.title,{suffix:{field:`${n.SKIPPED}: ${Z.skip}`,format:()=>zD.yellow}});else if(Z.rollback)this.logger.log(n.ROLLBACK,J.title,{suffix:{field:`${n.ROLLBACK}: ${Z.rollback}`,format:()=>zD.red}});else if(Z.retry)this.logger.log(n.RETRY,J.title,{suffix:{field:`${n.RETRY}:${Z.retry.count}`,format:()=>zD.red}});else if(Z.paused){let X=Q?.pausedTimer;this.logger.log(n.PAUSED,J.title,X&&{suffix:{...X,condition:!!Z?.paused&&X.condition,args:[Z.paused-Date.now()]}})}})})}calculate(F){if(this.cache.rendererOptions.has(F.id)&&this.cache.rendererTaskOptions.has(F.id))return;let J={...this.options,...F.rendererOptions};this.cache.rendererOptions.set(F.id,J),this.cache.rendererTaskOptions.set(F.id,{...D.rendererTaskOptions,timer:J.timer,...F.rendererTaskOptions})}reset(F){this.cache.rendererOptions.delete(F.id),this.cache.rendererTaskOptions.delete(F.id)}},ve=class{constructor(D){this.options=D}serialize(D,F,J){return JSON.stringify(this.generate(D,F,J))}generate(D,F,J){let Q={event:D,data:F};if(typeof this.options?.task!=="boolean"){let $=Object.fromEntries(this.options.task.map((Z)=>{let X=J[Z];if(typeof X==="function")return[Z,X.call(J)];return[Z,X]}));if(Object.keys(J).length>0)Q.task=$}return Q}},ue=class D{static nonTTY=!0;static rendererOptions={subtasks:!0,state:Object.values(XD),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isSkipped","isStarted","hasFailed","isEnabled","isRetrying","path"]};static rendererTaskOptions;logger;serializer;constructor(F,J){this.tasks=F,this.options=J,this.options={...D.rendererOptions,...this.options},this.logger=this.options.logger??new tZ({useIcons:!1}),this.serializer=new ve(this.options)}render(){this.renderer(this.tasks)}end(){}renderer(F){F.forEach((J)=>{if(this.options.subtasks)J.on(QD.SUBTASK,(Q)=>{this.renderer(Q)});if(this.options.state)J.on(QD.STATE,(Q)=>{this.logger.toStdout(this.serializer.serialize(QD.STATE,Q,J))});if(this.options.output)J.on(QD.OUTPUT,(Q)=>{this.logger.toStdout(this.serializer.serialize(QD.OUTPUT,Q,J))});if(this.options.prompt)J.on(QD.PROMPT,(Q)=>{this.logger.toStdout(this.serializer.serialize(QD.PROMPT,Q,J))});if(this.options.title)J.on(QD.TITLE,(Q)=>{this.logger.toStdout(this.serializer.serialize(QD.TITLE,Q,J))});J.on(QD.MESSAGE,(Q)=>{let $=Object.fromEntries(Object.entries(Q).map(([Z,X])=>{if(this.options.messages.includes(Z))return[Z,X]}).filter(Boolean));if(Object.keys($).length>0){let Z=this.serializer.serialize(QD.MESSAGE,$,J);if(this.options.messagesToStderr.some((X)=>Object.keys($).includes(X)))this.logger.toStderr(Z);else this.logger.toStdout(Z)}})})}},ge=class D{static nonTTY=!0;static rendererOptions={logTitleChange:!1,pausedTimer:{...RU,format:()=>zD.yellowBright}};static rendererTaskOptions;logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};constructor(F,J){if(this.tasks=F,this.options=J,this.options={...D.rendererOptions,...this.options,icon:{...sZ.icon,...J?.icon??{}},color:{...sZ.color,...J?.color??{}}},this.logger=this.options.logger??new tZ({useIcons:!1,toStderr:Ij}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp)this.logger.options.fields.prefix.unshift(this.options.timestamp)}render(){this.renderer(this.tasks)}end(){}renderer(F){F.forEach((J)=>{this.calculate(J),J.once(QD.CLOSED,()=>{this.reset(J)});let Q=this.cache.rendererOptions.get(J.id),$=this.cache.rendererTaskOptions.get(J.id);if(J.on(QD.SUBTASK,(Z)=>{this.renderer(Z)}),J.on(QD.STATE,(Z)=>{if(!J.hasTitle())return;if(Z===XD.STARTED)this.logger.log(n.STARTED,J.title);else if(Z===XD.COMPLETED){let X=$.timer;this.logger.log(n.COMPLETED,J.title,X&&{suffix:{...X,condition:!!J.message?.duration&&X.condition,args:[J.message.duration]}})}}),J.on(QD.OUTPUT,(Z)=>{this.logger.log(n.OUTPUT,Z)}),J.on(QD.PROMPT,(Z)=>{let X=Q5(Z);if(X)this.logger.log(n.PROMPT,X)}),this.options?.logTitleChange!==!1)J.on(QD.TITLE,(Z)=>{this.logger.log(n.TITLE,Z)});J.on(QD.MESSAGE,(Z)=>{if(Z?.error)this.logger.log(n.FAILED,Z.error);else if(Z?.skip)this.logger.log(n.SKIPPED,Z.skip);else if(Z?.rollback)this.logger.log(n.ROLLBACK,Z.rollback);else if(Z?.retry)this.logger.log(n.RETRY,J.title,{suffix:Z.retry.count.toString()});else if(Z?.paused){let X=Q?.pausedTimer;this.logger.log(n.PAUSED,J.title,X&&{suffix:{...X,condition:!!Z?.paused&&X.condition,args:[Z.paused-Date.now()]}})}})})}calculate(F){if(this.cache.rendererOptions.has(F.id)&&this.cache.rendererTaskOptions.has(F.id))return;let J={...this.options,...F.rendererOptions};this.cache.rendererOptions.set(F.id,J),this.cache.rendererTaskOptions.set(F.id,{...D.rendererTaskOptions,timer:J.timer,...F.rendererTaskOptions})}reset(F){this.cache.rendererOptions.delete(F.id),this.cache.rendererTaskOptions.delete(F.id)}},OU={default:fe,simple:be,verbose:ge,test:ue,silent:he};function me(D){return process.stdout.isTTY===!0||D.nonTTY===!0}function rZ(D){if(typeof D==="string")return OU[D]??OU.default;return typeof D==="function"?D:OU.default}function de(D){if(d7(D?.silentRendererCondition))return{renderer:rZ("silent"),selection:F5.SILENT};let F={renderer:rZ(D.renderer),options:D.rendererOptions,selection:F5.PRIMARY};if(!me(F.renderer)||d7(D?.fallbackRendererCondition))return{renderer:rZ(D.fallbackRenderer),options:D.fallbackRendererOptions,selection:F5.SECONDARY};return F}function d7(D,...F){if(typeof D==="function")return D(...F);else return D}var pe=Ej.default({circles:!0});function _j(D){return pe(D)}var le=class{concurrency;count;queue;constructor(D){this.concurrency=D.concurrency,this.count=0,this.queue=new Set}add(D){if(this.count<this.concurrency)return this.run(D);return new Promise((F)=>{let J=()=>F(this.run(D));this.queue.add(J)})}flush(){for(let D of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(D),D()}}run(D){this.count++;let F=D(),J=()=>{this.count--,this.flush()};return F.then(J,()=>{this.queue.clear()}),F}};function ce(D){return new Promise((F)=>{setTimeout(F,D)})}var ne=class extends Error{path;ctx;constructor(D,F,J){super(D.message);if(this.error=D,this.type=F,this.task=J,this.name="ListrError",this.path=J.path,J?.options.collectErrors==="full")this.task=_j(J),this.ctx=_j(J.listr.ctx);this.stack=D?.stack}},Oj=class extends Error{},ie=class extends Error{},oe=class{constructor(D){this.task=D}get title(){return this.task.title}set title(D){D=Array.isArray(D)?D:[D],this.task.title$=J5(D.shift(),...D)}get output(){return this.task.output}set output(D){D=Array.isArray(D)?D:[D],this.task.output$=J5(D.shift(),...D)}set promptOutput(D){this.task.promptOutput$=D}newListr(D,F){let J;if(typeof D==="function")J=D(this);else J=D;return new p7(J,F,this.task)}report(D,F){if(this.task.options.collectErrors!==!1)this.task.listr.errors.push(new ne(D,F,this.task));this.task.message$={error:D.message??this.task?.title}}skip(D,...F){if(this.task.state$=XD.SKIPPED,D)this.task.message$={skip:D?J5(D,...F):this.task?.title}}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}prompt(D){if(this.task.prompt)return this.task.prompt;return new D(this.task,this)}stdout(D){return xe((F)=>{switch(D){case QD.PROMPT:this.promptOutput=F;break;default:this.output=F}})}run(D){return this.task.run(D,this)}},ae=class extends Rj{},re=class extends ae{id=Ie();state=XD.WAITING;subtasks;title;initialTitle;output;retry;message={};prompt;parent;enabled;taskFn;closed;constructor(D,F,J,Q,$){super();if(this.listr=D,this.task=F,this.options=J,this.rendererOptions=Q,this.rendererTaskOptions=$,F.title){let Z=Array.isArray(F?.title)?F.title:[F.title];this.title=J5(Z.shift(),...Z),this.initialTitle=this.title}this.taskFn=F.task,this.parent=D.parentTask}set state$(D){if(this.state=D,this.emit(QD.STATE,D),this.hasSubtasks()&&this.hasFailed()){for(let F of this.subtasks)if(F.state===XD.STARTED)F.state$=XD.FAILED}this.listr.events.emit(UF.SHOULD_REFRESH_RENDER)}set output$(D){this.output=D,this.emit(QD.OUTPUT,D),this.listr.events.emit(UF.SHOULD_REFRESH_RENDER)}set promptOutput$(D){if(this.emit(QD.PROMPT,D),Q5(D))this.listr.events.emit(UF.SHOULD_REFRESH_RENDER)}set message$(D){this.message={...this.message,...D},this.emit(QD.MESSAGE,D),this.listr.events.emit(UF.SHOULD_REFRESH_RENDER)}set title$(D){this.title=D,this.emit(QD.TITLE,D),this.listr.events.emit(UF.SHOULD_REFRESH_RENDER)}get path(){return[...this.listr.path,this.initialTitle]}async check(D){if(this.state===XD.WAITING)this.enabled=await d7(this.task?.enabled??!0,D),this.emit(QD.ENABLED,this.enabled),this.listr.events.emit(UF.SHOULD_REFRESH_RENDER);return this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return this.state===XD.STARTED}isSkipped(){return this.state===XD.SKIPPED}isCompleted(){return this.state===XD.COMPLETED}hasFailed(){return this.state===XD.FAILED}isRollingBack(){return this.state===XD.ROLLING_BACK}hasRolledBack(){return this.state===XD.ROLLED_BACK}isRetrying(){return this.state===XD.RETRY}hasReset(){return this.state===XD.RETRY||this.state===XD.ROLLING_BACK}isEnabled(){return this.enabled}hasTitle(){return typeof this?.title==="string"}isPrompt(){return this.state===XD.PROMPT}isPaused(){return this.state===XD.PAUSED}isClosed(){return this.closed}async pause(D){let F=this.state;this.state$=XD.PAUSED,this.message$={paused:Date.now()+D},await ce(D),this.state$=F,this.message$={paused:null}}async run(D,F){let J=(Z)=>{if(Z instanceof p7)Z.options={...this.options,...Z.options},Z.rendererClass=rZ("silent"),this.subtasks=Z.tasks,Z.errors=this.listr.errors,this.emit(QD.SUBTASK,this.subtasks),Z=Z.run(D);else if(Z instanceof Promise)Z=Z.then(J);else if(Te(Z))Z=new Promise((X,Y)=>{Z.on("data",(q)=>{this.output$=q.toString()}),Z.on("error",(q)=>Y(q)),Z.on("end",()=>X(null))});else if(Ne(Z))Z=new Promise((X,Y)=>{Z.subscribe({next:(q)=>{this.output$=q},error:Y,complete:X})});return Z},Q=Date.now();this.state$=XD.STARTED;let $=await d7(this.task?.skip??!1,D);if($){if(typeof $==="string")this.message$={skip:$};else if(this.hasTitle())this.message$={skip:this.title};else this.message$={skip:"Skipped task without a title."};this.state$=XD.SKIPPED;return}try{let Z=typeof this.task?.retry==="number"&&this.task.retry>0?this.task.retry+1:typeof this.task?.retry==="object"&&this.task.retry.tries>0?this.task.retry.tries+1:1,X=typeof this.task.retry==="object"&&this.task.retry.delay;for(let Y=1;Y<=Z;Y++)try{await J(this.taskFn(D,F));break}catch(q){if(Y!==Z){if(this.retry={count:Y,error:q},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,F.report(q,D5.WILL_RETRY),this.state$=XD.RETRY,X)await this.pause(X)}else throw q}if(this.isStarted()||this.isRetrying())this.message$={duration:Date.now()-Q},this.state$=XD.COMPLETED}catch(Z){if(this.prompt instanceof ie)Z=this.prompt;if(this.task?.rollback){F.report(Z,D5.WILL_ROLLBACK);try{this.state$=XD.ROLLING_BACK,await this.task.rollback(D,F),this.message$={rollback:this.title},this.state$=XD.ROLLED_BACK}catch(X){throw this.state$=XD.FAILED,F.report(X,D5.HAS_FAILED_TO_ROLLBACK),this.close(),X}if(this.listr.options?.exitAfterRollback!==!1)throw this.close(),Z}else if(this.state$=XD.FAILED,this.listr.options.exitOnError!==!1&&await d7(this.task?.exitOnError,D)!==!1)throw F.report(Z,D5.HAS_FAILED),this.close(),Z;else if(!this.hasSubtasks())F.report(Z,D5.HAS_FAILED_WITHOUT_ERROR)}finally{this.close()}}close(){this.emit(QD.CLOSED),this.listr.events.emit(UF.SHOULD_REFRESH_RENDER),this.complete()}},Mj=class extends Rj{},p7=class{tasks=[];errors=[];ctx;events;path=[];rendererClass;rendererClassOptions;rendererSelection;boundSignalHandler;concurrency;renderer;constructor(D,F,J){if(this.task=D,this.options=F,this.parentTask=J,this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...F},this.options.concurrent===!0)this.options.concurrent=1/0;else if(typeof this.options.concurrent!=="number")this.options.concurrent=1;if(this.concurrency=new le({concurrency:this.options.concurrent}),J)this.path=[...J.listr.path,J.title],this.errors=J.listr.errors;if(this.parentTask?.listr.events instanceof Mj)this.events=this.parentTask.listr.events;else this.events=new Mj;if(this.options?.forceTTY||process.env[MU.FORCE_TTY])process.stdout.isTTY=!0,process.stderr.isTTY=!0;if(this.options?.forceUnicode)process.env[MU.FORCE_UNICODE]="1";let Q=de({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});if(this.rendererClass=Q.renderer,this.rendererClassOptions=Q.options,this.rendererSelection=Q.selection,this.add(D??[]),this.options.registerSignalListeners)this.boundSignalHandler=this.signalHandler.bind(this),process.once("SIGINT",this.boundSignalHandler).setMaxListeners(0)}isRoot(){return!this.parentTask}isSubtask(){return!!this.parentTask}add(D){this.tasks.push(...this.generate(D))}async run(D){if(!this.renderer)this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events);await this.renderer.render(),this.ctx=this.options?.ctx??D??{};try{await Promise.all(this.tasks.map((F)=>F.check(this.ctx))),await Promise.all(this.tasks.map((F)=>this.concurrency.add(()=>this.runTask(F)))),this.renderer.end(),this.removeSignalHandler()}catch(F){if(this.options.exitOnError!==!1)throw this.renderer.end(F),this.removeSignalHandler(),F}return this.ctx}generate(D){return D=Array.isArray(D)?D:[D],D.map((F)=>{let J;if(this.rendererSelection===F5.PRIMARY)J=F.rendererOptions;else if(this.rendererSelection===F5.SECONDARY)J=F.fallbackRendererOptions;return new re(this,F,this.options,this.rendererClassOptions,J)})}async runTask(D){if(!await D.check(this.ctx))return;return new oe(D).run(this.ctx)}signalHandler(){if(this.tasks?.forEach(async(D)=>{if(D.isPending())D.state$=XD.FAILED}),this.isRoot())this.renderer?.end(Error("Interrupted.")),process.exit(127)}removeSignalHandler(){if(this.boundSignalHandler)process.removeListener("SIGINT",this.boundSignalHandler)}};var se=Object.prototype.toString,te=(D)=>se.call(D)==="[object Error]",ee=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function AU(D){if(!(D&&te(D)&&D.name==="TypeError"&&typeof D.message==="string"))return!1;let{message:J,stack:Q}=D;if(J==="Load failed")return Q===void 0||"__sentry_captured__"in D;if(J.startsWith("error sending request for url"))return!0;return ee.has(J)}function DDD(D){if(typeof D==="number"){if(D<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(D))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(D!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function eZ(D,F,{min:J=0,allowInfinity:Q=!1}={}){if(F===void 0)return;if(typeof F!=="number"||Number.isNaN(F))throw TypeError(`Expected \`${D}\` to be a number${Q?" or Infinity":""}.`);if(!Q&&!Number.isFinite(F))throw TypeError(`Expected \`${D}\` to be a finite number.`);if(F<J)throw TypeError(`Expected \`${D}\` to be ≥ ${J}.`)}class Tj extends Error{constructor(D){super();if(D instanceof Error)this.originalError=D,{message:D}=D;else this.originalError=Error(D),this.originalError.stack=this.stack;this.name="AbortError",this.message=D}}function FDD(D,F){let J=Math.max(1,D+1),Q=F.randomize?Math.random()+1:1,$=Math.round(Q*F.minTimeout*F.factor**(J-1));return $=Math.min($,F.maxTimeout),$}function Nj(D,F){if(!Number.isFinite(F))return F;return F-(performance.now()-D)}async function JDD({error:D,attemptNumber:F,retriesConsumed:J,startTime:Q,options:$}){let Z=D instanceof Error?D:TypeError(`Non-error was thrown: "${D}". You should only throw errors.`);if(Z instanceof Tj)throw Z.originalError;let X=Number.isFinite($.retries)?Math.max(0,$.retries-J):$.retries,Y=$.maxRetryTime??Number.POSITIVE_INFINITY,q=Object.freeze({error:Z,attemptNumber:F,retriesLeft:X,retriesConsumed:J});if(await $.onFailedAttempt(q),Nj(Q,Y)<=0)throw Z;let G=await $.shouldConsumeRetry(q),W=Nj(Q,Y);if(W<=0||X<=0)throw Z;if(Z instanceof TypeError&&!AU(Z)){if(G)throw Z;return $.signal?.throwIfAborted(),!1}if(!await $.shouldRetry(q))throw Z;if(!G)return $.signal?.throwIfAborted(),!1;let B=FDD(J,$),K=Math.min(B,W);if($.signal?.throwIfAborted(),K>0)await new Promise((U,V)=>{let H=()=>{clearTimeout(z),$.signal?.removeEventListener("abort",H),V($.signal.reason)},z=setTimeout(()=>{$.signal?.removeEventListener("abort",H),U()},K);if($.unref)z.unref?.();$.signal?.addEventListener("abort",H,{once:!0})});return $.signal?.throwIfAborted(),!0}async function wU(D,F={}){if(F={...F},DDD(F.retries),Object.hasOwn(F,"forever"))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");if(F.retries??=10,F.factor??=2,F.minTimeout??=1000,F.maxTimeout??=Number.POSITIVE_INFINITY,F.maxRetryTime??=Number.POSITIVE_INFINITY,F.randomize??=!1,F.onFailedAttempt??=()=>{},F.shouldRetry??=()=>!0,F.shouldConsumeRetry??=()=>!0,eZ("factor",F.factor,{min:0,allowInfinity:!1}),eZ("minTimeout",F.minTimeout,{min:0,allowInfinity:!1}),eZ("maxTimeout",F.maxTimeout,{min:0,allowInfinity:!0}),eZ("maxRetryTime",F.maxRetryTime,{min:0,allowInfinity:!0}),!(F.factor>0))F.factor=1;F.signal?.throwIfAborted();let J=0,Q=0,$=performance.now();while(Number.isFinite(F.retries)?Q<=F.retries:!0){J++;try{F.signal?.throwIfAborted();let Z=await D(J);return F.signal?.throwIfAborted(),Z}catch(Z){if(await JDD({error:Z,attemptNumber:J,retriesConsumed:Q,startTime:$,options:F}))Q++}}throw Error("Retry attempts exhausted without throwing an error.")}var V7D=AV(),H7D=E5(),z7D=YV(),fV=R5(),C7D=X5(),RF=WD(),_7D=CF(),O7D=rD(),M7D=OF(),E7D=MF(),TrD=bX(),R7D=xV(),A7D=kV(),w7D=yV(),gX=yx(),fx=$5();var I7D=V7D.Composer,N7D=H7D.Document,T7D=z7D.Schema,L7D=fV.YAMLError,P7D=fV.YAMLParseError,j7D=fV.YAMLWarning,S7D=C7D.Alias,x7D=RF.isAlias,k7D=RF.isCollection,y7D=RF.isDocument,f7D=RF.isMap,h7D=RF.isNode,b7D=RF.isPair,v7D=RF.isScalar,u7D=RF.isSeq,g7D=_7D.Pair,m7D=O7D.Scalar,d7D=M7D.YAMLMap,p7D=E7D.YAMLSeq;var l7D=R7D.Lexer,c7D=A7D.LineCounter,n7D=w7D.Parser,i7D=gX.parse,o7D=gX.parseAllDocuments,a7D=gX.parseDocument,mX=gX.stringify,r7D=fx.visit,s7D=fx.visitAsync;var w0={start_period:"10s",start_interval:"200ms",interval:"10s",timeout:"1s",retries:5};var t7D=(D)=>{let F=D?.blockTime??2;return{image:`cartesi/sdk:${D?.imageTag??"latest"}`,command:["devnet","--block-time",F.toString()],healthcheck:{...w0,test:["CMD","eth_isready"]},environment:{ANVIL_IP_ADDR:"0.0.0.0"}}},e7D=()=>({name:"anvil-proxy",content:`http:
|
|
544
|
+
routers:
|
|
545
|
+
anvil:
|
|
546
|
+
rule: "PathPrefix(\`/anvil\`)"
|
|
547
|
+
middlewares:
|
|
548
|
+
- "remove-anvil-prefix"
|
|
549
|
+
service: anvil
|
|
550
|
+
middlewares:
|
|
551
|
+
remove-anvil-prefix:
|
|
552
|
+
replacePathRegex:
|
|
553
|
+
regex: "^/anvil(.*)"
|
|
554
|
+
replacement: "$1"
|
|
555
|
+
services:
|
|
556
|
+
anvil:
|
|
557
|
+
loadBalancer:
|
|
558
|
+
servers:
|
|
559
|
+
- url: "http://anvil:8545"`}),hx=(D)=>({configs:{anvil_proxy:e7D()},services:{anvil:t7D(D),proxy:{configs:[{source:"anvil_proxy",target:"/etc/traefik/conf.d/anvil.yaml"}]}}});var bx=(D)=>{if(D.length===0)return{};return D.reduce((F,J)=>{return D9D(F,J)},{})};function D9D(D,F){let J={...D};if(F.name!==void 0)J.name=F.name;if(F.include)J.include=T8(D.include,F.include);if(F.services)J.services=F9(D.services||{},F.services,(Q,$)=>F9D(Q,$));if(F.networks)J.networks=F9(D.networks||{},F.networks,(Q,$)=>X9D(Q,$));if(F.volumes)J.volumes=F9(D.volumes||{},F.volumes,(Q,$)=>Y9D(Q,$));if(F.secrets)J.secrets=F9(D.secrets||{},F.secrets,(Q,$)=>q9D(Q,$));if(F.configs)J.configs=F9(D.configs||{},F.configs,(Q,$)=>G9D(Q,$));if(F.models)J.models=F9(D.models||{},F.models,(Q,$)=>({...Q,...$}));return J}function F9(D,F,J){let Q={...D};for(let[$,Z]of Object.entries(F)){let X=Q[$];if(X!==void 0)Q[$]=J(X,Z);else Q[$]=Z}return Q}function F9D(D,F){let J={...D};if(F.command!==void 0)J.command=F.command;if(F.entrypoint!==void 0)J.entrypoint=F.entrypoint;if(F.healthcheck?.test!==void 0)J.healthcheck={...D.healthcheck,test:F.healthcheck.test};if(F.healthcheck)J.healthcheck={...D.healthcheck,...F.healthcheck,test:F.healthcheck.test??D.healthcheck?.test};if(F.ports)J.ports=J9D(D.ports||[],F.ports);if(F.volumes)J.volumes=Q9D(D.volumes||[],F.volumes);if(F.secrets)J.secrets=$9D(D.secrets||[],F.secrets);if(F.configs)J.configs=Z9D(D.configs||[],F.configs);if(F.expose)J.expose=T8(D.expose,F.expose);if(F.depends_on)if(Array.isArray(F.depends_on))J.depends_on=T8(Array.isArray(D.depends_on)?D.depends_on:[],F.depends_on);else J.depends_on={...typeof D.depends_on==="object"&&!Array.isArray(D.depends_on)?D.depends_on:{},...F.depends_on};if(F.dns)J.dns=T8(Array.isArray(D.dns)?D.dns:D.dns?[D.dns]:[],Array.isArray(F.dns)?F.dns:[F.dns]);if(F.dns_search)J.dns_search=T8(Array.isArray(D.dns_search)?D.dns_search:D.dns_search?[D.dns_search]:[],Array.isArray(F.dns_search)?F.dns_search:[F.dns_search]);if(F.dns_opt)J.dns_opt=T8(D.dns_opt||[],F.dns_opt);if(F.env_file){let $=Array.isArray(D.env_file)?D.env_file:D.env_file?[D.env_file]:[],Z=Array.isArray(F.env_file)?F.env_file:[F.env_file];J.env_file=[...$,...Z]}if(F.labels)if(Array.isArray(F.labels))J.labels=T8(Array.isArray(D.labels)?D.labels:[],F.labels);else J.labels={...typeof D.labels==="object"&&!Array.isArray(D.labels)?D.labels:{},...F.labels};if(F.extra_hosts)if(Array.isArray(F.extra_hosts))J.extra_hosts=T8(Array.isArray(D.extra_hosts)?D.extra_hosts:[],F.extra_hosts);else J.extra_hosts={...typeof D.extra_hosts==="object"&&!Array.isArray(D.extra_hosts)?D.extra_hosts:{},...F.extra_hosts};if(F.sysctls)if(Array.isArray(F.sysctls))J.sysctls=T8(Array.isArray(D.sysctls)?D.sysctls:[],F.sysctls);else J.sysctls={...typeof D.sysctls==="object"&&!Array.isArray(D.sysctls)?D.sysctls:{},...F.sysctls};if(F.environment)if(Array.isArray(F.environment))J.environment=T8(Array.isArray(D.environment)?D.environment:[],F.environment);else J.environment={...typeof D.environment==="object"&&!Array.isArray(D.environment)?D.environment:{},...F.environment};if(F.networks)if(Array.isArray(F.networks))J.networks=T8(Array.isArray(D.networks)?D.networks:[],F.networks);else J.networks={...typeof D.networks==="object"&&!Array.isArray(D.networks)?D.networks:{},...F.networks};let Q=["image","build","restart","container_name","hostname","network_mode","pid","ipc","deploy","develop","working_dir","user","cap_add","cap_drop","devices","external_links","gpus","group_add","mem_limit","mem_reservation","memswap_limit","oom_kill_disable","oom_score_adj","privileged","read_only","shm_size","stdin_open","tty","ulimits","volumes_from","cpus","cpuset","cpu_shares","cpu_quota","cpu_period","cpu_count","cpu_percent","annotations","cgroup","cgroup_parent","domainname","init","isolation","links","mac_address","platform","security_opt","stop_grace_period","stop_signal","tmpfs","attach","extends","provider","blkio_config","credential_spec","device_cgroup_rules","logging"];for(let $ of Q)if(F[$]!==void 0)J[$]=F[$];return J}function T8(D,F){return[...D||[],...F]}function J9D(D,F){let J=[...D],Q=new Set;for(let $ of D)Q.add(hV($));for(let $ of F){let Z=hV($);if(!Q.has(Z))J.push($),Q.add(Z);else{let X=J.findIndex((Y)=>hV(Y)===Z);if(X!==-1)J[X]=$}}return J}function hV(D){if(typeof D==="string"){let Z=D.split(":"),X=Z[1]||"",[Y,q]=X.split("/");return`${Z[0]||""}:${Y||""}:${q||"tcp"}`}let F=D.host_ip||"",J=D.target.toString(),Q=D.published?.toString()||"",$=D.protocol||"tcp";return`${F}:${J}:${Q}:${$}`}function Q9D(D,F){let J=[...D],Q=new Set;for(let $ of D)Q.add(bV($));for(let $ of F){let Z=bV($);if(!Q.has(Z))J.push($),Q.add(Z);else{let X=J.findIndex((Y)=>bV(Y)===Z);if(X!==-1)J[X]=$}}return J}function bV(D){if(typeof D==="string"){let F=D.split(":");return F[F.length-1]||D}return D.target}function $9D(D,F){let J=[...D],Q=new Set;for(let $ of D)Q.add(vV($));for(let $ of F){let Z=vV($);if(!Q.has(Z))J.push($),Q.add(Z);else{let X=J.findIndex((Y)=>vV(Y)===Z);if(X!==-1)J[X]=$}}return J}function vV(D){if(typeof D==="string")return D;return D.target||D.source}function Z9D(D,F){let J=[...D],Q=new Set;for(let $ of D)Q.add(uV($));for(let $ of F){let Z=uV($);if(!Q.has(Z))J.push($),Q.add(Z);else{let X=J.findIndex((Y)=>uV(Y)===Z);if(X!==-1)J[X]=$}}return J}function uV(D){if(typeof D==="string")return D;return D.target||D.source}function X9D(D,F){return{...D,...F,ipam:F.ipam?{...D.ipam,...F.ipam,config:F.ipam.config?T8(D.ipam?.config,F.ipam.config):D.ipam?.config}:D.ipam,external:F.external!==void 0?F.external:D.external}}function Y9D(D,F){return{...D,...F,external:F.external!==void 0?F.external:D.external}}function q9D(D,F){return{...D,...F,external:F.external!==void 0?F.external:D.external}}function G9D(D,F){return{...D,...F,external:F.external!==void 0?F.external:D.external}}var W9D=(D)=>{return{image:`cartesi/sdk:${D.imageTag??"latest"}`,command:["alto","--entrypoints","0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789,0x0000000071727De22E5E9d8BAf0edAc6f37da032","--log-level","info","--rpc-url","http://anvil:8545","--min-executor-balance","0","--utility-private-key","0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97","--executor-private-keys","0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6,0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356,0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e,0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba,0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a","--safe-mode","false","--port","4337","--public-client-log-level","error","--wallet-client-log-level","error","--enable-debug-endpoints"],healthcheck:{...w0,test:["CMD","curl","-fsS","http://127.0.0.1:4337/health"]}}},B9D=()=>{return{name:"bundler-proxy",content:`http:
|
|
560
|
+
routers:
|
|
561
|
+
bundler:
|
|
562
|
+
rule: "PathPrefix(\`/bundler\`)"
|
|
563
|
+
middlewares:
|
|
564
|
+
- "cors"
|
|
565
|
+
- "remove-bundler-prefix"
|
|
566
|
+
service: bundler
|
|
567
|
+
middlewares:
|
|
568
|
+
cors:
|
|
569
|
+
headers:
|
|
570
|
+
accessControlAllowMethods:
|
|
571
|
+
- GET
|
|
572
|
+
- OPTIONS
|
|
573
|
+
- PUT
|
|
574
|
+
accessControlAllowHeaders: "*"
|
|
575
|
+
accessControlAllowOriginList:
|
|
576
|
+
- "*"
|
|
577
|
+
accessControlMaxAge: 100
|
|
578
|
+
addVaryHeader: true
|
|
579
|
+
remove-bundler-prefix:
|
|
580
|
+
replacePathRegex:
|
|
581
|
+
regex: "^/bundler/(.*)"
|
|
582
|
+
replacement: "/$1"
|
|
583
|
+
services:
|
|
584
|
+
bundler:
|
|
585
|
+
loadBalancer:
|
|
586
|
+
servers:
|
|
587
|
+
- url: "http://bundler:4337"`}},vx=(D)=>({configs:{bundler_proxy:B9D()},services:{bundler:W9D(D),proxy:{configs:[{source:"bundler_proxy",target:"/etc/traefik/conf.d/bundler.yaml"}]}}});var K9D=(D)=>{return{image:`cartesi/rollups-database:${D?.imageTag??"latest"}`,healthcheck:{...w0,test:["CMD-SHELL","pg_isready -U postgres || exit 1"]},environment:{POSTGRES_PASSWORD:D?.password}}},ux=(D)=>({services:{database:K9D(D)}});var U9D=(D)=>{let F=D.apiTag??"latest",J=D.databasePassword,Q=D.databaseHost??"database",$=D.databasePort??5432;return{image:`cartesi/rollups-explorer-api:${F}`,environment:{DB_PORT:$.toString(),DB_HOST:Q,DB_PASS:J,DB_NAME:"explorer",GQL_PORT:4350},expose:["4350"],command:["sqd","serve:prod"],healthcheck:{...w0,test:["CMD","wget","--spider","-q","http://127.0.0.1:4350/graphql?query=%7B__typename%7D"]},depends_on:{database:{condition:"service_healthy"}}}},V9D=()=>{return{name:"explorer-api-proxy",content:`http:
|
|
588
|
+
routers:
|
|
589
|
+
explorer-api:
|
|
590
|
+
rule: "PathPrefix(\`/explorer-api\`)"
|
|
591
|
+
middlewares:
|
|
592
|
+
- "remove-explorer-api-prefix"
|
|
593
|
+
service: explorer_api
|
|
594
|
+
middlewares:
|
|
595
|
+
remove-explorer-api-prefix:
|
|
596
|
+
replacePathRegex:
|
|
597
|
+
regex: "^/explorer-api/(.*)"
|
|
598
|
+
replacement: "/$1"
|
|
599
|
+
services:
|
|
600
|
+
explorer_api:
|
|
601
|
+
loadBalancer:
|
|
602
|
+
servers:
|
|
603
|
+
- url: "http://explorer_api:4350"
|
|
604
|
+
`}},H9D=(D)=>{let F=D.apiTag??"latest",J=D.databasePassword,Q=D.databaseHost??"database",$=D.databasePort??5432;return{image:`cartesi/rollups-explorer-api:${F}`,environment:{DB_HOST:Q,DB_NAME:"explorer",DB_PASS:J,DB_PORT:$.toString(),CHAIN_IDS:"13370",RPC_URL_13370:"http://anvil:8545",BLOCK_CONFIRMATIONS_13370:0,GENESIS_BLOCK_13370:1},command:["sqd","process:prod"],depends_on:{database:{condition:"service_healthy"}}}},z9D=(D)=>{let F=D.imageTag??"latest",J=D.port??6571,Q=`http://127.0.0.1:${J}/anvil`,$=`http://127.0.0.1:${J}/explorer-api/graphql`;return{image:`cartesi/rollups-explorer:${F}`,environment:{NODE_RPC_URL:Q,EXPLORER_API_URL:$},expose:["3000"],depends_on:{database:{condition:"service_healthy"}}}},C9D=()=>{return{name:"explorer-proxy",content:`http:
|
|
605
|
+
routers:
|
|
606
|
+
explorer:
|
|
607
|
+
rule: "PathPrefix(\`/explorer\`)"
|
|
608
|
+
service: explorer
|
|
609
|
+
services:
|
|
610
|
+
explorer:
|
|
611
|
+
loadBalancer:
|
|
612
|
+
servers:
|
|
613
|
+
- url: "http://explorer:3000"`}},gx=(D)=>({configs:{explorer_api_proxy:V9D(),explorer_proxy:C9D()},services:{explorer_api:U9D(D),explorer:z9D(D),squid_processor:H9D(D),proxy:{configs:[{source:"explorer_proxy",target:"/etc/traefik/conf.d/explorer.yaml"},{source:"explorer_api_proxy",target:"/etc/traefik/conf.d/explorer-api.yaml"}]}}});var _9D=(D)=>{let F=D.databasePassword,J=D.databaseHost??"database",Q=D.databasePort??5432,$=D.defaultBlock??"latest",Z=D.imageTag??"latest",X=D.logLevel??"info",Y=D.mnemonic??"test test test test test test test test test test test junk";return{image:`cartesi/rollups-runtime:${Z}`,depends_on:{database:{condition:"service_healthy"},anvil:{condition:"service_healthy"}},deploy:{resources:{limits:{cpus:D.cpus!==void 0?D.cpus.toString():void 0,memory:D.memory!==void 0?`${D.memory.toString()}M`:void 0}}},expose:["10000","10011","10012"],healthcheck:{...w0,test:["CMD","curl","-fsS","http://127.0.0.1:10000/livez"]},command:["cartesi-rollups-node"],environment:{CARTESI_AUTH_MNEMONIC:Y,CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:$,CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:"http://anvil:8545",CARTESI_BLOCKCHAIN_ID:"13370",CARTESI_BLOCKCHAIN_WS_ENDPOINT:"ws://anvil:8545",CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS:xZ,CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:j7,CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS:yZ,CARTESI_DATABASE_CONNECTION:`postgres://postgres:${F}@${J}:${Q}/rollupsdb?sslmode=disable`,CARTESI_LOG_LEVEL:X,CARTESI_SNAPSHOTS_DIR:"/var/lib/cartesi-rollups-node/snapshots"},volumes:["./.cartesi:/var/lib/cartesi-rollups-node/snapshots:ro"]}},O9D=()=>{return{name:"rollups-node-proxy",content:`
|
|
614
|
+
http:
|
|
615
|
+
routers:
|
|
616
|
+
inspect_server:
|
|
617
|
+
rule: "PathPrefix(\`/inspect\`)"
|
|
618
|
+
service: inspect_server
|
|
619
|
+
rpc_server:
|
|
620
|
+
rule: "PathPrefix(\`/rpc\`)"
|
|
621
|
+
service: rpc_server
|
|
622
|
+
services:
|
|
623
|
+
inspect_server:
|
|
624
|
+
loadBalancer:
|
|
625
|
+
servers:
|
|
626
|
+
- url: "http://rollups_node:10012"
|
|
627
|
+
rpc_server:
|
|
628
|
+
loadBalancer:
|
|
629
|
+
servers:
|
|
630
|
+
- url: "http://rollups_node:10011"
|
|
631
|
+
`}},mx=(D)=>({services:{proxy:{configs:[{source:"rollups_node_proxy",target:"/etc/traefik/conf.d/rollups-node.yaml"}]},rollups_node:_9D(D)},configs:{rollups_node_proxy:O9D()}});var M9D=(D)=>{return{image:`cartesi/sdk:${D.imageTag??"latest"}`,command:["passkey-server"],healthcheck:{...w0,test:["CMD","curl","-fsS","http://127.0.0.1:3000/health"]}}},E9D=()=>{return{name:"passkey-proxy",content:`http:
|
|
632
|
+
routers:
|
|
633
|
+
passkey_server:
|
|
634
|
+
rule: "PathPrefix(\`/passkey\`)"
|
|
635
|
+
middlewares:
|
|
636
|
+
- "remove-passkey-server-prefix"
|
|
637
|
+
service: passkey_server
|
|
638
|
+
middlewares:
|
|
639
|
+
remove-passkey-server-prefix:
|
|
640
|
+
replacePathRegex:
|
|
641
|
+
regex: "^/passkey/(.*)"
|
|
642
|
+
replacement: "/$1"
|
|
643
|
+
services:
|
|
644
|
+
passkey_server:
|
|
645
|
+
loadBalancer:
|
|
646
|
+
servers:
|
|
647
|
+
- url: "http://passkey_server:3000"`}},dx=(D)=>({configs:{passkey_server_proxy:E9D()},services:{passkey_server:M9D(D),proxy:{configs:[{source:"passkey_server_proxy",target:"/etc/traefik/conf.d/passkey_server.yaml"}]}}});var R9D=(D)=>{return{image:`cartesi/sdk:${D.imageTag??"latest"}`,command:"mock-verifying-paymaster",environment:{ALTO_RPC:"http://bundler:4337",ANVIL_RPC:"http://anvil:8545"},healthcheck:{...w0,test:["CMD","curl","-fsS","http://127.0.0.1:3000/ping"]}}},A9D=()=>{return{name:"paymaster-proxy",content:`http:
|
|
648
|
+
routers:
|
|
649
|
+
paymaster:
|
|
650
|
+
rule: "PathPrefix(\`/paymaster\`)"
|
|
651
|
+
middlewares:
|
|
652
|
+
- "remove-paymaster-prefix"
|
|
653
|
+
service: paymaster
|
|
654
|
+
middlewares:
|
|
655
|
+
remove-paymaster-prefix:
|
|
656
|
+
replacePathRegex:
|
|
657
|
+
regex: "^/paymaster/(.*)"
|
|
658
|
+
replacement: "/$1"
|
|
659
|
+
services:
|
|
660
|
+
paymaster:
|
|
661
|
+
loadBalancer:
|
|
662
|
+
servers:
|
|
663
|
+
- url: "http://paymaster:3000"`}},px=(D)=>({configs:{paymaster_proxy:A9D()},services:{paymaster:R9D(D),proxy:{configs:[{source:"paymaster_proxy",target:"/etc/traefik/conf.d/paymaster.yaml"}]}}});var w9D=(D)=>{let F=D.imageTag??"latest",J=D.port??6751;return{image:`traefik:${F}`,healthcheck:{...w0,test:["CMD","traefik","healthcheck","--ping"]},command:["--ping=true","--entryPoints.web.address=:8088","--entryPoints.traefik.address=:8080","--metrics.prometheus=true","--metrics.prometheus.addServicesLabels=true","--providers.file.directory=/etc/traefik/conf.d","--providers.file.watch=true","--log","--log.level=INFO"],ports:[`${J}:8088`]}},lx=(D)=>({services:{proxy:w9D(D)}});var cx=(D)=>({address:D.iapplication_address,consensus:D.iconsensus_address,epochLength:OD(D.epoch_length),name:D.name,state:D.state,templateHash:D.template_hash}),mV=async(D)=>{try{let{stdout:F}=await ND("docker",["compose","--project-name",D.projectName,"exec","rollups_node","cartesi-rollups-cli","app","list"]);return JSON.parse(F).map(cx)}catch{return[]}},I9D=async(D)=>{let F=x3();if(!F)return;return(await mV(D)).find((Q)=>Q.templateHash===F)},dX=async(D)=>{let F=fD(D??{});return(await I9D({projectName:F}))?.address},AF="http://127.0.0.1",N9D=[{name:"anvil",healthySemaphore:"anvil",healthyTitle:(D)=>`${b.cyan("anvil")} service ready at ${b.cyan(`${AF}:${D}/anvil`)}`,waitTitle:`${b.cyan("anvil")} service starting...`,errorTitle:`${b.red("anvil")} service failed`},{name:"proxy"},{name:"database"},{name:"rpc",healthySemaphore:"rollups_node",healthyTitle:(D)=>`${b.cyan("rpc")} service ready at ${b.cyan(`${AF}:${D}/rpc`)}`,waitTitle:`${b.cyan("rpc")} service starting...`,errorTitle:`${b.red("rpc")} service failed`},{name:"inspect",healthySemaphore:"rollups_node",healthyTitle:(D,F)=>`${b.cyan("inspect")} service ready at ${b.cyan(`${AF}:${D}/inspect/${F??"<application_address>"}`)}`,waitTitle:`${b.cyan("inspect")} service starting...`,errorTitle:`${b.red("inspect")} service failed`}],gV=[{name:"bundler",healthySemaphore:"bundler",healthyTitle:(D)=>`${b.cyan("bundler")} service ready at ${b.cyan(`${AF}:${D}/bundler/rpc`)}`,waitTitle:`${b.cyan("bundler")} service starting...`,errorTitle:`${b.red("bundler")} service failed`},{name:"explorer",healthySemaphore:"explorer_api",healthyTitle:(D)=>`${b.cyan("explorer")} service ready at ${b.cyan(`${AF}:${D}/explorer`)}`,waitTitle:`${b.cyan("explorer")} service starting...`,errorTitle:`${b.red("explorer")} service failed`},{name:"paymaster",healthySemaphore:"paymaster",healthyTitle:(D)=>`${b.cyan("paymaster")} service ready at ${b.cyan(`${AF}:${D}/paymaster`)}`,waitTitle:`${b.cyan("paymaster")} service starting...`,errorTitle:`${b.red("paymaster")} service failed`},{name:"passkey",healthySemaphore:"passkey_server",healthyTitle:(D)=>`${b.cyan("passkey")} service ready at ${b.cyan(`${AF}:${D}/passkey`)}`,waitTitle:`${b.cyan("passkey")} service starting...`,errorTitle:`${b.red("passkey")} service failed`}],nx=gV.map(({name:D})=>D),T9D=(D)=>{let{errorTitle:F,healthyTitle:J,service:Q,waitTitle:$}=D;return{task:async(Z,X)=>{await wU(async()=>{if(await ex(D)!=="healthy")throw Error(F??`Service ${b.cyan(Q)} is not healthy`)},{retries:100,minTimeout:500,factor:1.1}),X.title=J??`Service ${b.cyan(Q)} is ready`},title:$??`Starting ${b.cyan(Q)}...`}},ix=async(D)=>{let{blockTime:F,cpus:J,defaultBlock:Q,dryRun:$,memory:Z,port:X,projectName:Y,runtimeVersion:q,services:G,verbose:W}=D,B=`${AF}:${X}`,K={CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:Q,CARTESI_LISTEN_PORT:X.toString(),CARTESI_LOG_LEVEL:W?"debug":"info"},U=[hx({blockTime:F,imageTag:q}),ux({imageTag:q,password:"password"}),mx({cpus:J,databasePassword:"password",defaultBlock:Q,imageTag:q,logLevel:W?"debug":"info",memory:Z}),lx({imageTag:"v3.3.4",port:X})];if(G.includes("explorer"))U.push(gx({imageTag:"1.4.0",apiTag:"1.1.0",databasePassword:"password",port:X}));if(G.includes("bundler"))U.push(vx({imageTag:q}));if(G.includes("paymaster"))U.push(px({imageTag:q}));if(G.includes("passkey"))U.push(dx({imageTag:q}));let V=["compose","-f","-","--project-directory","."],H=["--detach"],z=bx([{name:Y},...U]);if($){let{stdout:_}=await ND("docker",[...V,"config","--format","yaml"],{env:K,input:mX(z,{lineWidth:0,indent:2})});return{address:B,config:_}}return await ND("docker",[...V,"up",...H],{env:K,input:mX(z,{lineWidth:0,indent:2})}),{address:B}},ox=async(D)=>{let{name:F,port:J,projectName:Q,services:$}=D,Z=$.length===1&&$[0]==="all"?gV:gV.filter(({name:q})=>$.includes(q)),X=[...N9D,...Z].filter(({healthySemaphore:q})=>!!q).map((q)=>{let G=typeof q.healthyTitle==="function"?q.healthyTitle(J,F):q.healthyTitle;return T9D({projectName:Q,service:q.healthySemaphore,errorTitle:q.errorTitle,waitTitle:q.waitTitle,healthyTitle:G})});await new p7(X,{concurrent:!0}).run()};var ax=async(D)=>{let{projectName:F}=D;return ND("docker",["compose","--project-name",F,"down","--volumes"])};var rx=async(D)=>{let{consensus:F,epochLength:J,name:Q,projectName:$,prt:Z,salt:X,snapshotPath:Y}=D,q=[Q,Y];if(F)q.push("--consensus",F);else q.push("--epoch-length",J.toString());if(X)q.push("--salt",X);if(Z)q.push("--prt");q.push("--json");let{stdout:G}=await ND("docker",["compose","--project-name",$,"exec","rollups_node","cartesi-rollups-cli","deploy","application",...q]),W=G?cx(JSON.parse(G)):void 0;if(W)return W;throw Error("Failed to deploy application")},sx=async(D)=>{let{application:F,force:J,projectName:Q}=D;await ND("docker",["compose","--project-name",Q,"exec","rollups_node","cartesi-rollups-cli","app","status",F,"disabled"]);let $=[F];if(J)$.push("--force");return ND("docker",["compose","--project-name",Q,"exec","rollups_node","cartesi-rollups-cli","app","remove",...$])},tx=async(D)=>{let{projectName:F}=D,{stdout:J}=await ND("docker",["compose","--project-name",F,"port","proxy","8088"]);return J};var M1=(...D)=>{return Dk.join(".cartesi",...D)},x3=()=>{let D=M1("image","hash");if(pX.existsSync(D)){let F=pX.readFileSync(D).toString("hex");if(JK(`0x${F}`))return`0x${F}`}return},lX=(D)=>{let F=D.map((J)=>{if(pX.existsSync(J))return pX.readFileSync(J).toString();if(J==="cartesi.toml")return"";throw Error(`Config file ${J} does not exist`)});return tL(F)},fD=(D)=>{return D.projectName??Dk.basename(process.cwd())},Fk=async(D)=>{let F=await dX(D),J={ApplicationFactory:DP,AuthorityFactory:FP,DaveAppFactory:xZ,EntryPointV06:"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",EntryPointV07:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",ERC1155BatchPortal:N7,ERC1155SinglePortal:T7,ERC20Portal:L7,ERC721Portal:P7,EtherPortal:kZ,InputBox:j7,LightAccountFactory:"0x00004EC70002a32400f8ae005A26081065620D20",SelfHostedApplicationFactory:yZ,SimpleAccountFactory:"0x9406Cc6185a346906296840746125a0E44976454",SmartAccountFactory:"0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5",KernelFactoryV2:"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",KernelFactoryV3:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",KernelFactoryV3_1:"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",TestToken:hZ,TestNFT:l4,TestMultiToken:fZ,VerifyingPaymasterV06:"0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",VerifyingPaymasterV07:"0xc5c97885C67F7361aBAfD2B95067a5bBdA603608"};if(F)J.Application=F;return J},cX=async(D)=>{let{projectName:F,service:J}=D,{stdout:Q}=await ND("docker",["compose","--project-name",F,"ps",J,"--format","json"]);return Q?JSON.parse(Q):void 0},Jk=async(D)=>{return(await cX(D))?.State},ex=async(D)=>{return(await cX(D))?.Health};var $k=()=>{return new ZD("address-book").description("Prints the addresses of all smart contracts deployed to the runtime environment of the application.").option("--json","Format output as json.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").action(async(D)=>{let{json:F}=D,J=fD(D),Q=await Fk({projectName:J});if(!F){let $=new Qk.default({head:["Contract","Address"],chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});$.push(...Object.entries(Q)),console.log($.toString())}else process.stdout.write(JSON.stringify(Q))})};var NH=ID(v2(),1);var Ub=ID(Uf(),1);import Kb from"node:path";var RY=ID(v2(),1);import EZD from"node:path";var OY={};K8(OY,{version:()=>WZD,requiredVersion:()=>qZD,boot:()=>GZD});var _Y=ID(p5(),1);import YZD from"node:os";var j8=async(D,F,J)=>{try{if(J.forceDocker){let Q=new V8;throw Q.code="ENOENT",Q}return await ND(D,F,J)}catch(Q){if(Q instanceof V8){if(Q.code==="ENOENT"&&J.image){let $=YZD.userInfo(),Z=["--volume",`${J.cwd}:/work`,"--workdir","/work","--interactive","--rm","--user",`${$.uid}:${$.gid}`];return await ND("docker",["run",...Z,J.image,D,...F],J)}}throw Q}};var qZD=new _Y.Range("^0.19.0"),GZD=(D,F)=>j8("cartesi-machine",D,F),WZD=async(D)=>{let{image:F}=D||{};try{let{stdout:J}=await j8("cartesi-machine",["--version-json"],{image:F});if(typeof J==="string"){let Q=JSON.parse(J);return _Y.parse(Q.version)}return null}catch{return null}};var m2={};K8(m2,{version:()=>HZD,requiredVersion:()=>BZD,fromTar:()=>VZD,fromDirectory:()=>UZD,empty:()=>KZD});var MY=ID(p5(),1);var l5=4096,BZD=new MY.Range("^1.5.6"),$b=(D)=>["--block-size",l5.toString(),"--faketime","--readjustment",`+${D.extraBlocks}`],KZD=(D)=>{let{size:F,output:J}=D,Q=Math.ceil(F/l5);return j8("xgenext2fs",["--block-size",l5.toString(),"--faketime","--size-in-blocks",Q.toString(),J],D)},UZD=(D)=>{let{cwd:F,extraSize:J,image:Q,input:$,output:Z}=D,X=Math.ceil(J/l5);return j8("xgenext2fs",[...$b({extraBlocks:X}),"--root",$,Z],{cwd:F,image:Q})},VZD=(D)=>{let{cwd:F,extraSize:J,image:Q,input:$,output:Z}=D,X=Math.ceil(J/l5);return j8("xgenext2fs",[...$b({extraBlocks:X}),"--tarball",$,Z],{cwd:F,image:Q})},HZD=async(D)=>{let{stdout:F}=await j8("xgenext2fs",["--version"],D||{});if(typeof F==="string"){let J=/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/,Q=F.match(J);if(Q?.[0])return MY.parse(Q[0])}return null};var LF={};K8(LF,{version:()=>MZD,requiredVersion:()=>CZD,fromTar:()=>OZD,fromDirectory:()=>_ZD});var EY=ID(p5(),1);var zZD="lzo",CZD=new EY.Range("^4.5.1"),Zb=()=>["-all-time","0","-mkfs-time","0","-all-root","-noappend","-comp",zZD,"-no-progress"],_ZD=(D)=>{let{cwd:F,image:J,input:Q,output:$}=D;return j8("mksquashfs",[Q,$,...Zb()],{cwd:F,image:J})},OZD=(D)=>{let{cwd:F,image:J,input:Q,output:$}=D;return j8("mksquashfs",["-",$,"-tar",...Zb()],{cwd:F,image:J,inputFile:Q})},MZD=async(D)=>{try{let{stdout:F}=await j8("mksquashfs",["-version"],D||{});if(typeof F==="string"){let J=/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/gm,Q=F.match(J);if(Q?.[0])return EY.parse(Q[0])}}catch(F){return console.error(F),null}return null};var EH=async(D,F,J,Q,$)=>{let Z=`${D}.${F.format}`,X=EZD.join(Q,D);await RY.default.mkdirp(X),await RY.default.copy(F.directory,X);try{switch(F.format){case"ext2":{await m2.fromDirectory({extraSize:F.extraSize,input:D,output:Z,cwd:Q,image:J});break}case"sqfs":{await LF.fromDirectory({input:D,output:Z,cwd:Q,image:J});break}}}finally{if(!$)await RY.default.remove(X)}};var Yb=ID(v2(),1);import AY from"node:path";var Xb=async(D)=>{let{buildArgs:F,context:J,destination:Q,dockerfile:$,dockerfileContent:Z,tags:X,target:Y}=D,q=["buildx","build","--platform","linux/riscv64","--file",Z?"-":$,"--output","type=docker","--output",`type=tar,dest=${Q}`,"--progress","quiet"];if(q.push(...X.flatMap((W)=>["--tag",W])),q.push(...F.flatMap((W)=>["--build-arg",W])),Y)q.push("--target",Y);q.push(J);let{stdout:G}=await ND("docker",q,{input:Z});return G},RZD=async(D)=>{let{stdout:F}=await ND("docker",["image","inspect",D]),[J]=JSON.parse(F);if(J.Architecture!=="riscv64")throw Error(`Invalid image Architecture: ${J.Architecture}. Expected riscv64`);return{cmd:J.Config.Cmd??[],entrypoint:J.Config.Entrypoint??[],env:J.Config.Env||[],workdir:J.Config.WorkingDir}},RH=async(D,F,J,Q,$)=>{let{format:Z}=F,X=`${D}.tar`,Y=`${D}.${Z}`,q;if(F.image)q=await Xb({...F,destination:AY.join(Q,X),dockerfileContent:`FROM ${F.image}`});else q=await Xb({...F,destination:AY.join(Q,X)});let G=await RZD(q);try{switch(Z){case"ext2":{await m2.fromTar({extraSize:F.extraSize,input:X,output:Y,cwd:Q,image:J});break}case"sqfs":{await LF.fromTar({input:AY.join(Q,X),output:Y,cwd:Q,image:J});break}}}finally{if(!$)await Yb.default.remove(AY.join(Q,X))}return G};var qb=ID(v2(),1);import AZD from"node:path";var AH=async(D,F,J,Q)=>{let $=`${D}.${F.format}`;switch(F.format){case"ext2":{await m2.empty({output:$,size:F.size,cwd:Q,image:J});break}case"raw":{await qb.default.writeFile(AZD.join(Q,$),Buffer.alloc(F.size));break}}};var Gb=ID(v2(),1);import wZD from"node:path";var wH=async(D,F,J)=>{let Q=F.filename,$=aK(Q),Z=wZD.join(J,`${D}.${$}`);await Gb.default.copyFile(Q,Z)};var Bb=ID(v2(),1);import Wb from"node:path";var IH=async(D,F,J,Q)=>{let $=`${D}.tar`,Z=`${D}.${F.format}`;switch(await Bb.default.copy(F.filename,Wb.join(Q,$)),F.format){case"ext2":{await m2.fromTar({extraSize:F.extraSize,input:$,output:Z,cwd:Q,image:J});break}case"sqfs":{await LF.fromTar({input:Wb.join(Q,$),output:Z,cwd:Q,image:J});break}}};var IZD=(D,F)=>{let{format:J,mount:Q,shared:$,user:Z}=F,X=`${D}.${J}`,Y=[`label:${D}`,`filename:${X}`];if(Q!==void 0)Y.push(`mount:${Q}`);if(Z)Y.push(`user:${Z}`);if($)Y.push("shared");return`--flash-drive=${Y.join(",")}`},wY=(D,F,J,Q)=>{let{machine:$}=D,{assertRollingTemplate:Z,maxMCycle:X,noRollup:Y,ramLength:q,ramImage:G,useDockerEnv:W,useDockerWorkdir:B,user:K}=$,V=(W?F?.env??[]:[]).map((O)=>{let[E,A]=O.split("=");return`--env=${E}="${A}"`});if(D.drives.root?.format==="sqfs"){if(!D.machine.bootargs.find((E)=>E.startsWith("rootfstype=")))D.machine.bootargs.push("rootfstype=squashfs")}let z=$.bootargs.map((O)=>`--append-bootargs="${O}"`),_;if($.entrypoint)_=$.entrypoint;else if(F&&(F.entrypoint.length>0||F.cmd.length>0))_=[...F.entrypoint,...F.cmd].join(" ");if(!_)throw Error("Undefined machine entrypoint. Please define an entrypoint in your cartesi.toml config or in your Dockerfile.");let M=Object.entries(D.drives).map(([O,E])=>IZD(O,E)),C=[...z,...V,...M,`--ram-length=${q}`];if(G)C.push(`--ram-image=${G}`);if(Z)C.push("--assert-rolling-template");if(J.finalHash)C.push("--final-hash");if(B&&F?.workdir)C.push(`--workdir="${F.workdir}"`);if(J.interactive)C.push("-it");if(Y)C.push("--no-rollup");if(X)C.push(`--max-mcycle=${X.toString()}`);if(J.store)C.push(`--store=${J.store}`);if(K)C.push(`--user=${K}`);return C.push("--"),C.push(_),OY.boot(C,{image:D.sdk,...Q})};var NZD=(D,F)=>({title:`Building drive ${b.cyan(D)}`,task:async(J,Q)=>{let{config:$,debug:Z,destination:X}=J,Y=$.sdk;switch(F.builder){case"directory":{await EH(D,F,Y,X,Z);break}case"docker":{let q=await RH(D,F,Y,X,Z);if(q&&D==="root")J.imageInfo=q;break}case"empty":{await AH(D,F,Y,X);break}case"tar":{await IH(D,F,Y,X);break}case"none":{await wH(D,F,X);break}}Q.title=`Build drive ${b.cyan(D)}`}}),Vb=()=>{return new ZD("build").description("Build application by building Cartesi machine drives, configuring a machine and booting it.").option("-c, --config <config>","path to the configuration file",(D,F)=>F.concat([D]),["cartesi.toml"]).addOption(new m0("--debug","enable debug mode (do not remove intermediate files)").default(!1).hideHelp()).option("-d, --drives-only","only build drives, do not boot machine").option("-v, --verbose","verbose output",!1).action(async(D)=>{let{debug:F,drivesOnly:J,verbose:Q}=D;Ub.default.setGracefulCleanup();let $=lX(D.config),Z=Kb.resolve(M1());await NH.default.emptyDir(Z);let X={config:$,debug:F,destination:Z,imageInfo:void 0},Y=Object.entries($.drives).map(([W,B])=>NZD(W,B)),G=await new p7([{title:"Build drives",task:async(W,B)=>{return B.newListr(Y,{concurrent:!0,rendererOptions:{collapseSubtasks:!1},ctx:X})}}],{ctx:X,renderer:Q?"verbose":"default"}).run();if(J)return;await wY($,G.imageInfo,{finalHash:!0,store:"image"},{cwd:Z,stdio:"inherit"}),await NH.default.chmod(Kb.join(Z,"image"),493)})};var Hb=ID(v2(),1);var zb=()=>{return new ZD("clean").description("Deletes all cached build artifacts of application.").action(async()=>{await Hb.default.emptyDir(M1())})};import NY from"node:process";XU();var TH={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots14:{interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},dotsCircle:{interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}};var c5=TH,veD=Object.keys(TH);var h3={};K8(h3,{warning:()=>jZD,success:()=>PZD,info:()=>LZD,error:()=>SZD});var IY=xF(),LZD=bC(IY?"ℹ":"i"),PZD=fC(IY?"✔":"√"),jZD=hC(IY?"⚠":"‼"),SZD=yC(IY?"✖":"×");g7();_U();function LH({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import d2 from"node:process";var xZD=3;class Cb{#F=0;start(){if(this.#F++,this.#F===1)this.#J()}stop(){if(this.#F<=0)throw Error("`stop` called more times than `start`");if(this.#F--,this.#F===0)this.#D()}#J(){if(d2.platform==="win32"||!d2.stdin.isTTY)return;d2.stdin.setRawMode(!0),d2.stdin.on("data",this.#Q),d2.stdin.resume()}#D(){if(!d2.stdin.isTTY)return;d2.stdin.off("data",this.#Q),d2.stdin.pause(),d2.stdin.setRawMode(!1)}#Q(D){if(D[0]===xZD)d2.emit("SIGINT")}}var kZD=new Cb,PH=kZD;class _b{#F=0;#J=!1;#D=0;#Q=-1;#Y=0;#X=0;#$;#q;#Z;#V;#C;#G;#U;#W;#H;#B;#K;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#$={color:"cyan",stream:NY.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#$.color,this.spinner=this.#$.spinner,this.#C=this.#$.interval,this.#Z=this.#$.stream,this.#G=typeof this.#$.isEnabled==="boolean"?this.#$.isEnabled:LH({stream:this.#Z}),this.#U=typeof this.#$.isSilent==="boolean"?this.#$.isSilent:!1,this.text=this.#$.text,this.prefixText=this.#$.prefixText,this.suffixText=this.#$.suffixText,this.indent=this.#$.indent,NY.env.NODE_ENV==="test")this._stream=this.#Z,this._isEnabled=this.#G,Object.defineProperty(this,"_linesToClear",{get(){return this.#F},set(F){this.#F=F}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#Q}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#W}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#W=D,this.#z()}get interval(){return this.#C??this.#q.interval??100}get spinner(){return this.#q}set spinner(D){if(this.#Q=-1,this.#C=void 0,typeof D==="object"){if(!Array.isArray(D.frames)||D.frames.length===0||D.frames.some((F)=>typeof F!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if(D.interval!==void 0&&!(Number.isInteger(D.interval)&&D.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#q=D}else if(!xF())this.#q=c5.line;else if(D===void 0)this.#q=c5.dots;else if(D!=="default"&&c5[D])this.#q=c5[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#H}set text(D=""){this.#H=D,this.#z()}get prefixText(){return this.#B}set prefixText(D=""){this.#B=D,this.#z()}get suffixText(){return this.#K}set suffixText(D=""){this.#K=D,this.#z()}get isSpinning(){return this.#V!==void 0}#E(D,F,J=!1){let Q=typeof D==="function"?D():D;if(typeof Q==="string"&&Q!=="")return J?F+Q:Q+F;return""}#_(D=this.#B,F=" "){return this.#E(D,F,!1)}#O(D=this.#K,F=" "){return this.#E(D,F,!0)}#M(D,F){let J=0;for(let Q of a8(D).split(`
|
|
664
|
+
`))J+=Math.max(1,Math.ceil(KF(Q)/F));return J}#z(){let D=this.#Z.columns??80,F=typeof this.#B==="function"?"":this.#B,J=typeof this.#K==="function"?"":this.#K,Q=typeof F==="string"&&F!==""?F+" ":"",$=typeof J==="string"&&J!==""?" "+J:"",Z="-",X=" ".repeat(this.#W)+Q+"-"+(typeof this.#H==="string"?" "+this.#H:"")+$;this.#D=this.#M(X,D)}get isEnabled(){return this.#G&&!this.#U}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#G=D}get isSilent(){return this.#U}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#U=D}frame(){let D=Date.now();if(this.#Q===-1||D-this.#Y>=this.interval)this.#Q=++this.#Q%this.#q.frames.length,this.#Y=D;let{frames:F}=this.#q,J=F[this.#Q];if(this.color)J=b[this.color](J);let Q=this.#_(this.#B," "),$=typeof this.text==="string"?" "+this.text:"",Z=this.#O(this.#K," ");return Q+J+$+Z}clear(){if(!this.#G||!this.#Z.isTTY)return this;this.#Z.cursorTo(0);for(let D=0;D<this.#F;D++){if(D>0)this.#Z.moveCursor(0,-1);this.#Z.clearLine(1)}if(this.#W||this.#X!==this.#W)this.#Z.cursorTo(this.#W);return this.#X=this.#W,this.#F=0,this}render(){if(!this.#G||this.#U)return this;this.clear();let D=this.frame(),F=this.#Z.columns??80,J=this.#M(D,F),Q=this.#Z.rows;if(Q&&Q>1&&J>Q){let $=D.split(`
|
|
665
|
+
`),Z=Q-1;D=[...$.slice(0,Z),"... (content truncated to fit terminal)"].join(`
|
|
666
|
+
`)}return this.#Z.write(D),this.#F=this.#M(D,F),this}start(D){if(D)this.text=D;if(this.#U)return this;if(!this.#G){let F=" ".repeat(this.#W)+this.#_(this.#B," ")+(this.text?`- ${this.text}`:"")+this.#O(this.#K," ");if(F.trim()!=="")this.#Z.write(F+`
|
|
667
|
+
`);return this}if(this.isSpinning)return this;if(this.#$.hideCursor)u7.hide(this.#Z);if(this.#$.discardStdin&&NY.stdin.isTTY)this.#J=!0,PH.start();return this.render(),this.#V=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#V),this.#V=void 0,this.#Q=0,this.#G){if(this.clear(),this.#$.hideCursor)u7.show(this.#Z)}if(this.#$.discardStdin&&NY.stdin.isTTY&&this.#J)PH.stop(),this.#J=!1;return this}succeed(D){return this.stopAndPersist({symbol:h3.success,text:D})}fail(D){return this.stopAndPersist({symbol:h3.error,text:D})}warn(D){return this.stopAndPersist({symbol:h3.warning,text:D})}info(D){return this.stopAndPersist({symbol:h3.info,text:D})}stopAndPersist(D={}){if(this.#U)return this;let F=D.prefixText??this.#B,J=this.#_(F," "),Q=D.symbol??" ",$=D.text??this.text,X=typeof $==="string"?(Q?" ":"")+$:"",Y=D.suffixText??this.#K,q=this.#O(Y," "),G=J+Q+X+q+`
|
|
668
|
+
`;return this.stop(),this.#Z.write(G),this}}function sD(D){return new _b(D)}var Lb=ID(v2(),1);var xH="file",kH="link",yH="symlink",b3="directory";var yZD={"0":"file","1":"link","2":"symlink","3":"character-device","4":"block-device","5":"directory","6":"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},QD0=new Uint8Array(512),jH=new Uint8Array(0);var fZD=new TextDecoder;function A1(D,F,J){let Q=D.indexOf(0,F),$=Q===-1||Q>F+J?F+J:Q;return fZD.decode(D.subarray(F,$))}function fH(D,F,J){let Q=0,$=F+J;for(let Z=F;Z<$;Z++){let X=D[Z];if(X===0)break;if(X===32)continue;Q=Q*8+(X-48)}return Q}function TY(D,F,J){if(D[F]&128){let Q=0;Q=D[F]&127;for(let $=1;$<J;$++)Q=Q*256+D[F+$];if(!Number.isSafeInteger(Q))throw Error("TAR number too large");return Q}return fH(D,F,J)}function Eb(D,F){let{strip:J,filter:Q,map:$}=F;if(!J&&!Q&&!$)return D;let Z={...D};if(J&&J>0){let Y=Z.name.split("/").filter(Boolean);if(J>=Y.length)return null;let q=Y.slice(J).join("/");if(Z.name=Z.type==="directory"&&!q.endsWith("/")?`${q}/`:q,Z.linkname?.startsWith("/")){let G=Z.linkname.split("/").filter(Boolean);Z.linkname=J>=G.length?"/":`/${G.slice(J).join("/")}`}}if(Q?.(Z)===!1)return null;let X=$?$(Z):Z;if(X&&(!X.name||!X.name.trim()||X.name==="."||X.name==="/"))return null;return X}var hZD=32;function bZD(D){let F=fH(D,148,8),J=0;for(let Q=0;Q<D.length;Q++)if(Q>=148&&Q<156)J+=hZD;else J+=D[Q];return F===J}function vZD(D,F){if(F&&!bZD(D))throw Error("Invalid tar header checksum.");let J=A1(D,156,1),Q={name:A1(D,0,100),mode:fH(D,100,8),uid:TY(D,108,8),gid:TY(D,116,8),size:TY(D,124,12),mtime:new Date(TY(D,136,12)*1000),type:yZD[J]||"file",linkname:A1(D,157,100)},$=A1(D,257,6);if($.trim()==="ustar")Q.uname=A1(D,265,32),Q.gname=A1(D,297,32);if($==="ustar")Q.prefix=A1(D,345,155);return Q}var uZD={path:["name",(D)=>D],linkpath:["linkname",(D)=>D],size:["size",(D)=>parseInt(D,10)],mtime:["mtime",parseFloat],uid:["uid",(D)=>parseInt(D,10)],gid:["gid",(D)=>parseInt(D,10)],uname:["uname",(D)=>D],gname:["gname",(D)=>D]};function gZD(D){let F=new TextDecoder("utf-8"),J={},Q={},$=0;while($<D.length){let Z=D.indexOf(32,$);if(Z===-1)break;let X=parseInt(F.decode(D.subarray($,Z)),10);if(Number.isNaN(X)||X===0)break;let Y=$+X,[q,G]=F.decode(D.subarray(Z+1,Y-1)).split("=",2);if(q&&G!==void 0){Q[q]=G;let W=uZD[q];if(W){let[B,K]=W,U=K(G);if(typeof U==="string"||!Number.isNaN(U))J[B]=U}}$=Y}if(Object.keys(Q).length>0)J.pax=Q;return J}function Ob(D,F){if(F.name!==void 0)D.name=F.name;if(F.linkname!==void 0)D.linkname=F.linkname;if(F.size!==void 0)D.size=F.size;if(F.mtime!==void 0)D.mtime=new Date(F.mtime*1000);if(F.uid!==void 0)D.uid=F.uid;if(F.gid!==void 0)D.gid=F.gid;if(F.uname!==void 0)D.uname=F.uname;if(F.gname!==void 0)D.gname=F.gname;if(F.pax)D.pax=Object.assign({},D.pax??{},F.pax)}function mZD(D){switch(D){case"pax-global-header":case"pax-header":return gZD;case"gnu-long-name":return(F)=>({name:A1(F,0,F.length)});case"gnu-long-link-name":return(F)=>({linkname:A1(F,0,F.length)});default:return}}var $D0=new Uint8Array(1024);var LY=256;function dZD(){let D=Array(LY),F=D.length-1,J=0,Q=0,$=0,Z=(Y)=>{let q=D[J];if(Y===q.length)D[J]=jH,J=J+1&F;else D[J]=q.subarray(Y);if($-=Y,$===0&&D.length>LY)D=Array(LY),F=LY-1,J=0,Q=0};function X(Y,q){if(q){let U=0,V=Math.min(Y,$);while(V>0){let H=D[J],z=Math.min(V,H.length),_=z===H.length?H:H.subarray(0,z);if(Z(z),V-=z,U+=z,!q(_))break}return U}if($<Y)return null;if(Y===0)return jH;let G=D[J];if(G.length>=Y){let U=G.length===Y?G:G.subarray(0,Y);return Z(Y),U}let W=new Uint8Array(Y),B=0,K=Y;while(K>0){let U=D[J],V=Math.min(K,U.length);W.set(V===U.length?U:U.subarray(0,V),B),B+=V,K-=V,Z(V)}return W}return{push:(Y)=>{if(Y.length===0)return;let q=Q+1&F;if(q===J){let G=D.length,W=G*2,B=Array(W),K=Q-J+G&G-1;if(J<Q)for(let U=0;U<K;U++)B[U]=D[J+U];else if(K>0){let U=G-J;for(let V=0;V<U;V++)B[V]=D[J+V];for(let V=0;V<Q;V++)B[U+V]=D[V]}D=B,F=W-1,J=0,Q=K,q=Q+1&F}D[Q]=Y,Q=q,$+=Y.length},available:()=>$,peek:(Y)=>{if($<Y)return null;if(Y===0)return jH;let q=D[J];if(q.length>=Y)return q.length===Y?q:q.subarray(0,Y);let G=new Uint8Array(Y),W=0,B=J;while(W<Y){let K=D[B],U=Math.min(Y-W,K.length);if(U===K.length)G.set(K,W);else G.set(K.subarray(0,U),W);W+=U,B=B+1&F}return G},discard:(Y)=>{if(Y>$)throw Error("Too many bytes consumed");if(Y===0)return;let q=Y;while(q>0){let G=D[J],W=Math.min(q,G.length);Z(W),q-=W}},pull:X}}var SH=0,n5=1,PY=Error("Tar archive is truncated.");function Rb(D={}){let F=D.strict??!1,{available:J,peek:Q,push:$,discard:Z,pull:X}=dZD(),Y=SH,q=!1,G=!1,W=!1,B=null,K={},U={},V={isEntryActive:()=>Y===n5,isBodyComplete:()=>!B||B.remaining===0,write(H){if(q)throw Error("Archive already ended.");$(H)},end(){q=!0},readHeader(){if(Y!==SH)throw Error("Cannot read header while an entry is active");if(G)return;while(!G){if(J()<512){if(q){if(J()>0&&F)throw PY;G=!0;return}return null}let H=Q(512);if(Mb(H)){if(J()<1024){if(q){if(F)throw PY;G=!0;return}return null}if(Mb(Q(1024).subarray(512))){Z(1024),G=!0,W=!0;return}if(F)throw Error("Invalid tar header.");Z(512);continue}let z;try{z=vZD(H,F)}catch(C){if(F)throw C;Z(512);continue}let _=mZD(z.type);if(_){let C=z.size+511&-512;if(J()<512+C){if(q&&F)throw PY;return null}Z(512);let O=_(X(C).subarray(0,z.size)),E=z.type==="pax-global-header"?K:U;for(let A in O)E[A]=O[A];continue}Z(512);let M=z;if(z.prefix)M.name=`${z.prefix}/${M.name}`;return Ob(M,K),Ob(M,U),U={},B={header:M,remaining:M.size,padding:-M.size&511},Y=n5,M}},streamBody(H){if(Y!==n5||!B||B.remaining===0)return 0;let z=Math.min(B.remaining,J());if(z===0)return 0;let _=X(z,H);return B.remaining-=_,_},skipPadding(){if(Y!==n5||!B)return!0;if(B.remaining>0)throw Error("Body not fully consumed");if(J()<B.padding)return!1;return Z(B.padding),B=null,Y=SH,!0},skipEntry(){if(Y!==n5||!B)return!0;let H=Math.min(B.remaining,J());if(H>0)Z(H),B.remaining-=H;if(B.remaining>0)return!1;return V.skipPadding()},validateEOF(){if(F){if(!W)throw PY;if(J()>0){if(X(J()).some((H)=>H!==0))throw Error("Invalid EOF.")}}}};return V}function Mb(D){if(D.byteOffset%8===0){let F=new BigUint64Array(D.buffer,D.byteOffset,D.length/8);for(let J=0;J<F.length;J++)if(F[J]!==0n)return!1;return!0}for(let F=0;F<D.length;F++)if(D[F]!==0)return!1;return!0}import*as bD from"node:fs/promises";import{cpus as pZD}from"node:os";import*as pD from"node:path";import{Readable as BD0,Writable as lZD}from"node:stream";import*as L0 from"node:fs";var jY=()=>{let D=new Map;return{get(F){let J=D.get(F);if(D.delete(F))D.set(F,J);return J},set(F,J){if(D.set(F,J).size>1e4)D.delete(D.keys().next().value)}}},Ab=jY(),SY=(D)=>{for(let F=0;F<D.length;F++)if(D.charCodeAt(F)>=128){let J=Ab.get(D);if(J!==void 0)return J;let Q=D.normalize("NFD");return Ab.set(D,Q),Q}return D};function v3(D,F,J){let Q=SY(pD.resolve(D)),$=pD.resolve(F);if(Q!==$&&!Q.startsWith($+pD.sep))throw Error(J)}var cZD={":":"","<":"",">":"","|":"","?":"","*":"",'"':""};function nZD(D){let F=D.replace(/\\/g,"/");if(F.split("/").includes("..")||/^[a-zA-Z]:\.\./.test(F))throw Error(`${D} points outside extraction directory`);let J=F;if(/^[a-zA-Z]:/.test(J))J=J.replace(/^[a-zA-Z]:[/\\]?/,"");else if(J.startsWith("/"))J=J.replace(/^\/+/,"");if(process.platform==="win32")return J.replace(/[<>:"|?*]/g,(Q)=>cZD[Q]);return J}var iZD=(D)=>SY(nZD(D.replace(/\/+$/,"")));var oZD=(D)=>{let F=0,J=[],Q=0,$=null,Z=null,X=()=>$??=new Promise((q)=>Z=q),Y=()=>{while(F<D&&Q<J.length){let q=J[Q++];F++,q().finally(()=>{F--,Y()})}if(Q===J.length){if(J.length=0,Q=0,F===0&&Z)Z(),$=null,Z=null}};return{add(q){let G=F===0&&Q===J.length;return new Promise((W,B)=>{if(J.push(()=>Promise.resolve().then(q).then(W,B)),G)X();Y()})},onIdle(){return F===0&&Q===J.length?Promise.resolve():X()}}},W9=262144,wb=0,hH=1,u3=2,i5=3,Ib=4,Nb=Promise.resolve();function aZD(D,{mode:F=438,mtime:J}={}){let Q=wb,$=!1,Z=null,X=[],Y=[],q=0,G=null,W=null,B=null,K=null,U=[],V=[],H=()=>{if(U.length===0)return;for(let L=0;L<U.length;L++)U[L]();U.length=0,V.length=0},z=(L)=>{if(V.length===0)return;for(let y=0;y<V.length;y++)V[y](L);V.length=0,U.length=0},_=()=>{q=0,X.length=0,Y.length=0},M=()=>{Q=i5,B?.(),H()},C=()=>{let L=X;return X=Y,Y=L,X.length=0,L},O=(L)=>{if(G)return;G=L,Q=Ib,_(),$=!1;let y=Z;if(Z=null,y!==null)L0.ftruncate(y,0,()=>L0.close(y));K?.(L),z(L)},E=()=>{if(Z===null){M();return}let L=Z;if(Z=null,J)L0.futimes(L,J,J,(y)=>{if(y)return O(y);L0.close(L,(m)=>{if(m)O(m);else M()})});else L0.close(L,(y)=>{if(y)O(y);else M()})},A=()=>{if($||X.length===0||Q!==u3)return;$=!0;let L=C(),y=(m,j=0)=>{if(m)return O(m);if($=!1,q-=j,Y.length=0,q<W9)H();if(X.length>0)A();else if(B)E()};if(L.length===1){let m=L[0];L0.write(Z,m,0,m.length,null,y)}else L0.writev(Z,L,y)},N=()=>{if(Q!==wb)return;Q=hH,L0.open(D,"w",F,(L,y)=>{if(L)return O(L);if(Q===i5||Q===Ib){L0.close(y);return}if(Z=y,Q=u3,B)if(X.length>0)A();else E();else if(q>=W9&&!$)A();else H()})};return{write:(L)=>{if(G||Q>=i5||B)return!1;if(Q!==u3&&Q!==hH)N();let y=Buffer.isBuffer(L)?L:L instanceof Uint8Array?Buffer.from(L.buffer,L.byteOffset,L.byteLength):Buffer.from(L);if(y.length===0)return q<W9;if(X.push(y),q+=y.length,Q===u3&&!$&&q>=W9)A();return q<W9},end:()=>{if(Q>=i5)return Nb;if(G)return Promise.reject(G);if(W)return W;return W=new Promise((L,y)=>{if(B=L,K=y,Q!==u3&&Q!==hH)N();else if(Q===u3&&!$)if(X.length>0)A();else E()}),W},destroy:(L)=>{if(L){O(L);return}if(Q>=i5||G)return;if(_(),$=!1,Z!==null){let y=Z;Z=null,L0.close(y)}M()},waitDrain:()=>{if(q<W9||Q!==u3)return Nb;return new Promise((L,y)=>{U.push(L),V.push(y)})}}}var o5="ENOENT",rZD=(D,F)=>{let J=jY(),Q=jY(),$=[],Z=jY(),Y=(async(W)=>{let B=SY(pD.resolve(W));try{await bD.mkdir(B,{recursive:!0})}catch(K){if(K.code===o5){let U=pD.dirname(B);if(U===B)throw K;await bD.mkdir(U,{recursive:!0}),await bD.mkdir(B,{recursive:!0})}else throw K}try{return{symbolic:B,real:await bD.realpath(B)}}catch(K){if(K.code===o5)return{symbolic:B,real:B};throw K}})(D);Y.catch(()=>{});let q=async(W,B)=>{let K=await Y;if(W===K.symbolic)return v3(K.real,K.real,B),K.real;let U=Z.get(W);if(!U)U=bD.realpath(W).then((H)=>{return v3(H,K.real,B),H}),Z.set(W,U);let V=await U;return v3(V,K.real,B),V},G=async(W,B)=>{let K=J.get(W);if(K)return K;return K=(async()=>{if(W===(await Y).symbolic)return;await G(pD.dirname(W));try{let U=await bD.lstat(W);if(U.isDirectory())return;if(U.isSymbolicLink())try{let V=await q(W,`Symlink "${W}" points outside the extraction directory.`);if((await bD.stat(V)).isDirectory())return}catch(V){if(V.code===o5)throw Error(`Symlink "${W}" points outside the extraction directory.`);throw V}throw Error(`"${W}" is not a valid directory component.`)}catch(U){if(U.code===o5){await bD.mkdir(W,{mode:B??F.dmode});return}throw U}})(),J.set(W,K),K};return{async ready(){await Y},async preparePath(W){let{name:B,linkname:K,type:U,mode:V,mtime:H}=W,{maxDepth:z=1024,dmode:_}=F,M=iZD(B),C=await Y,O=pD.join(C.symbolic,M);if(v3(O,C.symbolic,`Entry "${B}" points outside the extraction directory.`),z!==1/0){let N=1;for(let w of M)if(w==="/"&&++N>z)throw Error("Tar exceeds max specified depth.")}let E=Q.get(M);if(E){if(E===b3&&U!==b3||E!==b3&&U===b3)throw Error(`Path conflict ${U} over existing ${E} at "${B}"`);return}let A=pD.dirname(O);switch(U){case b3:if(Q.set(M,b3),await G(O,_??V),H)await bD.lutimes(O,H,H).catch(()=>{});return;case xH:return Q.set(M,xH),await G(A),O;case yH:if(Q.set(M,yH),!K)return;if(await G(A),v3(pD.resolve(A,K),C.symbolic,`Symlink "${K}" points outside the extraction directory.`),await bD.symlink(K,O),H)await bD.lutimes(O,H,H).catch(()=>{});return;case kH:{if(Q.set(M,kH),!K)return;let N=SY(K);if(pD.isAbsolute(N))throw Error(`Hardlink "${K}" points outside the extraction directory.`);let w=pD.join(C.symbolic,N);v3(w,C.symbolic,`Hardlink "${K}" points outside the extraction directory.`),await G(pD.dirname(w));let T=await q(pD.dirname(w),`Hardlink "${K}" points outside the extraction directory.`);if(v3(pD.join(T,pD.basename(w)),C.real,`Hardlink "${K}" points outside the extraction directory.`),w!==O)await G(A),$.push({linkTarget:w,outPath:O});return}default:return}},async applyLinks(){for(let{linkTarget:W,outPath:B}of $)try{await bD.link(W,B)}catch(K){if(K.code===o5)throw Error(`Hardlink target "${W}" does not exist for link at "${B}".`);throw K}}}};function Tb(D,F={}){let J=Rb(F),Q=oZD(F.concurrency||pZD().length||8),$=rZD(D,F),Z=null,X=null;return new lZD({async write(Y,q,G){try{if(J.write(Y),J.isEntryActive()){if(Z&&X){let W=!1,B=X;while(!J.isBodyComplete())if(W=!1,J.streamBody(B)===0)if(W)await Z.waitDrain();else{G();return}while(!J.skipPadding()){G();return}let K=Z;if(K)Q.add(()=>K.end());Z=null,X=null}else if(!J.skipEntry()){G();return}}while(!0){let W=J.readHeader();if(W===void 0||W===null){G();return}let B=Eb(W,F);if(!B){if(!J.skipEntry()){G();return}continue}let K=await Q.add(()=>$.preparePath(B));if(K){let U=aZD(K,{mode:F.fmode??B.mode??void 0,mtime:B.mtime??void 0}),V=!1,H=(z)=>{let _=U.write(z);if(!_)V=!0;return _};while(!J.isBodyComplete())if(V=!1,J.streamBody(H)===0)if(V)await U.waitDrain();else{Z=U,X=H,G();return}while(!J.skipPadding()){Z=U,X=H,G();return}Q.add(()=>U.end())}else if(!J.skipEntry()){G();return}}}catch(W){G(W)}},async final(Y){try{J.end(),J.validateEOF(),await $.ready(),await Q.onIdle(),await $.applyLinks(),Y()}catch(q){Y(q)}},destroy(Y,q){(async()=>{if(Z)Z.destroy(Y??void 0),Z=null,X=null;await Q.onIdle()})().then(()=>q(Y??null),(G)=>q(Y??(G instanceof Error?G:Error("Stream destroyed"))))}})}import sZD from"node:path";import{pipeline as tZD}from"node:stream/promises";import{createGunzip as eZD}from"node:zlib";var Pb=async(D,F,J)=>{let $=`https://codeload.github.com/cartesi/application-templates/tar.gz/refs/heads/${F}`;await Lb.ensureDir(J);let Z=await fetch($);if(!Z.ok)throw Error(`Failed to download template: ${Z.statusText}`);let X=Tb(J,{filter:(Y)=>{return Y.name.split("/").splice(1).join("/").startsWith(D)},map:(Y)=>{let q=Y.name.split("/").splice(1).join("/");return Y.name=sZD.relative(D,q),Y}});return await tZD(Z.body,eZD(),X),{dir:J,source:"https://github.com/cartesi/application-templates"}};var DXD="prerelease/sdk-12",FXD=["cpp","cpp-low-level","go","java","javascript","lua","python","ruby","rust","typescript"],jb=()=>{return new ZD("create").argument("<name>","application and directory name").addOption(new m0("-t, --template <template>","template name to use").choices(FXD).makeOptionMandatory()).option("-b, --branch <branch>","cartesi/application-templates repository branch name to use",DXD).action(async(D,{branch:F,template:J})=>{let Q=sD("Creating application...").start();try{let{dir:$}=await Pb(J,F,D);Q.succeed(`Application created at ${b.cyan($)}`)}catch($){Q.fail($ instanceof Error?`Error creating application: ${b.red($.message)}`:String($))}})};var Sb=()=>{return new ZD("build").description("DEPRECATED: Package the application in a Docker image ready to be deployed.").action(async()=>{console.warn(b.yellow("deploy build command is deprecated"))})};var xb=()=>{let D=new ZD("deploy").description("DEPRECATED: Package and deploy the application to a supported live network.").action(async()=>{console.warn(b.yellow("deploy command is deprecated, use 'cartesi-rollups-cli' directly instead"))});return D.addCommand(Sb(),{hidden:!0}),D};var a5=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",xY=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var r5=(D)=>D.name==="backspace",s5=(D)=>D.name==="tab",bH=(D)=>"1234567890".includes(D.name),g3=(D)=>D.name==="enter"||D.name==="return";class vH extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class uH extends Error{name="CancelPromptError";message="Prompt was canceled"}class B9 extends Error{name="ExitPromptError"}class gH extends Error{name="HookError"}class t5 extends Error{name="ValidationError"}import{AsyncResource as ZXD}from"node:async_hooks";import{AsyncLocalStorage as JXD,AsyncResource as QXD}from"node:async_hooks";var kb=new JXD;function $XD(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function yb(D,F){let J=$XD(D);return kb.run(J,()=>{function Q($){J.handleChange=()=>{J.index=0,$()},J.handleChange()}return F(Q)})}function m3(){let D=kb.getStore();if(!D)throw new gH("[Inquirer] Hook functions can only be called from within a prompt");return D}function mH(){return m3().rl}function dH(D){let F=(...J)=>{let Q=m3(),$=!1,Z=Q.handleChange;Q.handleChange=()=>{$=!0};let X=D(...J);if($)Z();return Q.handleChange=Z,X};return QXD.bind(F)}function K9(D){let F=m3(),{index:J}=F,Q={get(){return F.hooks[J]},set(Z){F.hooks[J]=Z},initialized:J in F.hooks},$=D(Q);return F.index++,$}function fb(){m3().handleChange()}var d3={queue(D){let F=m3(),{index:J}=F;F.hooksEffect.push(()=>{F.hooksCleanup[J]?.();let Q=D(mH());if(Q!=null&&typeof Q!=="function")throw new t5("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[J]=Q})},run(){let D=m3();dH(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=m3();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function z0(D){return K9((F)=>{let J=ZXD.bind(function(Z){if(F.get()!==Z)F.set(Z),fb()});if(F.initialized)return[F.get(),J];let Q=typeof D==="function"?D():D;return F.set(Q),[Q,J]})}function w1(D,F){K9((J)=>{let Q=J.get();if(!Array.isArray(Q)||F.some((Z,X)=>!Object.is(Z,Q[X])))d3.queue(D);J.set(F)})}import{styleText as F2}from"node:util";import p2 from"node:process";function XXD(){if(p2.platform!=="win32")return p2.env.TERM!=="linux";return Boolean(p2.env.WT_SESSION)||Boolean(p2.env.TERMINUS_SUBLIME)||p2.env.ConEmuTask==="{cmd::Cmder}"||p2.env.TERM_PROGRAM==="Terminus-Sublime"||p2.env.TERM_PROGRAM==="vscode"||p2.env.TERM==="xterm-256color"||p2.env.TERM==="alacritty"||p2.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var hb={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},bb={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},YXD={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},qXD={...hb,...bb},GXD={...hb,...YXD},WXD=XXD(),BXD=WXD?qXD:GXD,U9=BXD,mD0=Object.entries(bb);var vb={prefix:{idle:F2("blue","?"),done:F2("green",U9.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>F2("yellow",D))},style:{answer:(D)=>F2("cyan",D),message:(D)=>F2("bold",D),error:(D)=>F2("red",`> ${D}`),defaultAnswer:(D)=>F2("dim",`(${D})`),help:(D)=>F2("dim",D),highlight:(D)=>F2("cyan",D),key:(D)=>F2("cyan",F2("bold",`<${D}>`))}};function ub(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function gb(...D){let F={};for(let J of D)for(let[Q,$]of Object.entries(J)){let Z=F[Q];F[Q]=ub(Z)&&ub($)?gb(Z,$):$}return F}function I1(...D){let F=[vb,...D.filter((J)=>J!=null)];return gb(...F)}function p3({status:D="idle",theme:F}){let[J,Q]=z0(!1),[$,Z]=z0(0),{prefix:X,spinner:Y}=I1(F);if(w1(()=>{if(D==="loading"){let G,W=-1,B=setTimeout(()=>{Q(!0),G=setInterval(()=>{W=W+1,Z(W%Y.frames.length)},Y.interval)},300);return()=>{clearTimeout(B),clearInterval(G)}}else Q(!1)},[D]),J)return Y.frames[$];return typeof X==="string"?X:X[D==="loading"?"idle":D]??X.idle}function e5(D,F){return K9((J)=>{let Q=J.get();if(!Q||Q.dependencies.length!==F.length||Q.dependencies.some(($,Z)=>$!==F[Z])){let $=D();return J.set({value:$,dependencies:F}),$}return Q.value})}function l3(D){return z0({current:D})[0]}function N1(D){let F=l3(D);F.current=D,w1((J)=>{let Q=!1,$=dH((Z,X)=>{if(Q)return;F.current(X,J)});return J.input.on("keypress",$),()=>{Q=!0,J.input.removeListener("keypress",$)}},[])}oZ();var pb=ID(db(),1);function DJ(D,F){return D.split(`
|
|
669
|
+
`).flatMap((J)=>m7(J,F,{trim:!1,hard:!0}).split(`
|
|
670
|
+
`).map((Q)=>Q.trimEnd())).join(`
|
|
671
|
+
`)}function kY(){return pb.default({defaultWidth:80,output:mH().output})}function VXD({active:D,renderedItems:F,pageSize:J,loop:Q}){let $=l3({lastPointer:D,lastActive:void 0}),{lastPointer:Z,lastActive:X}=$.current,Y=Math.floor(J/2),q=F.reduce((B,K)=>B+K.length,0),G=F.slice(0,D).reduce((B,K)=>B+K.length,0),W=G;if(q>J)if(Q){if(W=Z,X!=null&&X<D&&D-X<J)W=Math.min(Y,Math.abs(D-X)===1?Math.min(Z+(F[X]?.length??0),Math.max(G,Z)):Z+D-X)}else{let B=F.slice(D).reduce((K,U)=>K+U.length,0);W=B<J-Y?J-B:Math.min(G,Y)}return $.current.lastPointer=W,$.current.lastActive=D,W}function pH({items:D,active:F,renderItem:J,pageSize:Q,loop:$=!0}){let Z=kY(),X=(_)=>(_%D.length+D.length)%D.length,Y=D.map((_,M)=>{if(_==null)return[];return DJ(J({item:_,index:M,isActive:M===F}),Z).split(`
|
|
672
|
+
`)}),q=Y.reduce((_,M)=>_+M.length,0),G=(_)=>Y[_]??[],W=VXD({active:F,renderedItems:Y,pageSize:Q,loop:$}),B=G(F).slice(0,Q),K=W+B.length<=Q?W:Q-B.length,U=Array.from({length:Q});U.splice(K,B.length,...B);let V=new Set([F]),H=K+B.length,z=X(F+1);while(H<Q&&!V.has(z)&&($&&q>Q?z!==F:z>F)){let M=G(z).slice(0,Q-H);U.splice(H,M.length,...M),V.add(z),H+=M.length,z=X(z+1)}H=K-1,z=X(F-1);while(H>=0&&!V.has(z)&&($&&q>Q?z!==F:z<F)){let _=G(z),M=_.slice(Math.max(0,_.length-H-1));U.splice(H-M.length+1,M.length,...M),V.add(z),H-=M.length,z=X(z-1)}return U.filter((_)=>typeof _==="string").join(`
|
|
673
|
+
`)}KQ();var tb=ID(nb(),1);import*as sb from"node:readline";import{AsyncResource as OXD}from"node:async_hooks";import{stripVTControlCharacters as CXD}from"node:util";var zXD="\x1B[G",ob="\x1B[?25l",ab="\x1B[?25h",lH=(D=1)=>D>0?`\x1B[${D}A`:"",cH=(D=1)=>D>0?`\x1B[${D}B`:"",nH=(D,F)=>{if(typeof F==="number"&&!Number.isNaN(F))return`\x1B[${F+1};${D+1}H`;return`\x1B[${D+1}G`},ib="\x1B[2K",iH=(D)=>D>0?(ib+lH(1)).repeat(D-1)+ib+zXD:"";var rb=(D)=>D.split(`
|
|
674
|
+
`).length,_XD=(D)=>D.split(`
|
|
675
|
+
`).pop()??"";class yY{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(D){this.rl=D,this.cursorPos=D.getCursorPos()}write(D){this.rl.output.unmute(),this.rl.output.write(D),this.rl.output.mute()}render(D,F=""){let J=_XD(D),Q=CXD(J),$=Q;if(this.rl.line.length>0)$=$.slice(0,-this.rl.line.length);this.rl.setPrompt($),this.cursorPos=this.rl.getCursorPos();let Z=kY();if(D=DJ(D,Z),F=DJ(F,Z),Q.length%Z===0)D+=`
|
|
676
|
+
`;let X=D+(F?`
|
|
677
|
+
`+F:""),q=Math.floor(Q.length/Z)-this.cursorPos.rows+(F?rb(F):0);if(q>0)X+=lH(q);X+=nH(this.cursorPos.cols),this.write(cH(this.extraLinesUnderPrompt)+iH(this.height)+X),this.extraLinesUnderPrompt=q,this.height=rb(X)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(nH(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=cH(this.extraLinesUnderPrompt);F+=D?iH(this.height):`
|
|
678
|
+
`,F+=ab,this.write(F),this.rl.close()}}class oH extends Promise{static withResolver(){let D,F;return{promise:new Promise((Q,$)=>{D=Q,F=$}),resolve:D,reject:F}}}function MXD(){let D=Error.prepareStackTrace,F=[];try{Error.prepareStackTrace=(J,Q)=>{let $=Q.slice(1);return F=$,$},Error().stack}catch{return F}return Error.prepareStackTrace=D,F}function T1(D){let F=MXD();return(Q,$={})=>{let{input:Z=process.stdin,signal:X}=$,Y=new Set,q=new tb.default;q.pipe($.output??process.stdout);let G=sb.createInterface({terminal:!0,input:Z,output:q}),W=new yY(G),{promise:B,resolve:K,reject:U}=oH.withResolver(),V=()=>U(new uH);if(X){let _=()=>U(new vH({cause:X.reason}));if(X.aborted)return _(),Object.assign(B,{cancel:V});X.addEventListener("abort",_),Y.add(()=>X.removeEventListener("abort",_))}Y.add(B6((_,M)=>{U(new B9(`User force closed the prompt with ${_} ${M}`))}));let H=()=>U(new B9("User force closed the prompt with SIGINT"));G.on("SIGINT",H),Y.add(()=>G.removeListener("SIGINT",H));let z=()=>W.checkCursorPos();return G.input.on("keypress",z),Y.add(()=>G.input.removeListener("keypress",z)),yb(G,(_)=>{let M=OXD.bind(()=>d3.clearAll());return G.on("close",M),Y.add(()=>G.removeListener("close",M)),_(()=>{try{let C=D(Q,(A)=>{setImmediate(()=>K(A))});if(C===void 0){let A=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
|
|
679
|
+
at ${A}`)}let[O,E]=typeof C==="string"?[C]:C;W.render(O,E),d3.run()}catch(C){U(C)}}),Object.assign(B.then((C)=>{return d3.clearAll(),C},(C)=>{throw d3.clearAll(),C}).finally(()=>{Y.forEach((C)=>C()),W.done({clearContent:Boolean($.clearPromptOnDone)}),q.end()}).then(()=>B),{cancel:V})})}}import{styleText as EXD}from"node:util";class L1{separator=EXD("dim",Array.from({length:15}).join(U9.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}import{styleText as FJ}from"node:util";var RXD={icon:{cursor:U9.pointer},style:{disabled:(D)=>FJ("dim",`- ${D}`),description:(D)=>FJ("cyan",D),keysHelpTip:(D)=>D.map(([F,J])=>`${FJ("bold",F)} ${FJ("dim",J)}`).join(FJ("dim"," • "))},indexMode:"hidden",keybindings:[]};function V9(D){return!L1.isSeparator(D)&&!D.disabled}function AXD(D){return D.map((F)=>{if(L1.isSeparator(F))return F;if(typeof F!=="object"||F===null||!("value"in F)){let $=String(F);return{value:F,name:$,short:$,disabled:!1}}let J=F.name??String(F.value),Q={value:F.value,name:J,short:F.short??J,disabled:F.disabled??!1};if(F.description)Q.description=F.description;return Q})}var fY=T1((D,F)=>{let{loop:J=!0,pageSize:Q=7}=D,$=I1(RXD,D.theme),{keybindings:Z}=$,[X,Y]=z0("idle"),q=p3({status:X,theme:$}),G=l3(),W=!Z.includes("vim"),B=e5(()=>AXD(D.choices),[D.choices]),K=e5(()=>{let N=B.findIndex(V9),w=B.findLastIndex(V9);if(N===-1)throw new t5("[select prompt] No selectable choices. All choices are disabled.");return{first:N,last:w}},[B]),U=e5(()=>{if(!("default"in D))return-1;return B.findIndex((N)=>V9(N)&&N.value===D.default)},[D.default,B]),[V,H]=z0(U===-1?K.first:U),z=B[V];N1((N,w)=>{if(clearTimeout(G.current),g3(N))Y("done"),F(z.value);else if(a5(N,Z)||xY(N,Z)){if(w.clearLine(0),J||a5(N,Z)&&V!==K.first||xY(N,Z)&&V!==K.last){let T=a5(N,Z)?-1:1,I=V;do I=(I+T+B.length)%B.length;while(!V9(B[I]));H(I)}}else if(bH(N)&&!Number.isNaN(Number(w.line))){let T=Number(w.line)-1,I=-1,S=B.findIndex((y)=>{if(L1.isSeparator(y))return!1;return I++,I===T}),L=B[S];if(L!=null&&V9(L))H(S);G.current=setTimeout(()=>{w.clearLine(0)},700)}else if(r5(N))w.clearLine(0);else if(W){let T=w.line.toLowerCase(),I=B.findIndex((S)=>{if(L1.isSeparator(S)||!V9(S))return!1;return S.name.toLowerCase().startsWith(T)});if(I!==-1)H(I);G.current=setTimeout(()=>{w.clearLine(0)},700)}}),w1(()=>()=>{clearTimeout(G.current)},[]);let _=$.style.message(D.message,X),M=$.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]),C=0,O=pH({items:B,active:V,renderItem({item:N,isActive:w,index:T}){if(L1.isSeparator(N))return C++,` ${N.separator}`;let I=$.indexMode==="number"?`${T+1-C}. `:"";if(N.disabled){let y=typeof N.disabled==="string"?N.disabled:"(disabled)";return $.style.disabled(`${I}${N.name} ${y}`)}let S=w?$.style.highlight:(y)=>y,L=w?$.icon.cursor:" ";return S(`${L} ${I}${N.name}`)},pageSize:Q,loop:J});if(X==="done")return[q,_,$.style.answer(z.short)].filter(Boolean).join(" ");let{description:E}=z;return`${[[q,_].filter(Boolean).join(" "),O," ",E?$.style.description(E):"",M].filter(Boolean).join(`
|
|
680
|
+
`).trimEnd()}${ob}`});var wXD={validationFailureMode:"keep"},t0=T1((D,F)=>{let{prefill:J="tab"}=D,Q=I1(wXD,D.theme),[$,Z]=z0("idle"),[X="",Y]=z0(D.default),[q,G]=z0(),[W,B]=z0(""),K=p3({status:$,theme:Q});async function U(M){let{required:C,pattern:O,patternError:E="Invalid input"}=D;if(C&&!M)return"You must provide a value";if(O&&!O.test(M))return E;if(typeof D.validate==="function")return await D.validate(M)||"You must provide a valid value";return!0}N1(async(M,C)=>{if($!=="idle")return;if(g3(M)){let O=W||X;Z("loading");let E=await U(O);if(E===!0)B(O),Z("done"),F(O);else{if(Q.validationFailureMode==="clear")B("");else C.write(W);G(E),Z("idle")}}else if(r5(M)&&!W)Y(void 0);else if(s5(M)&&!W)Y(void 0),C.clearLine(0),C.write(X),B(X);else B(C.line),G(void 0)}),w1((M)=>{if(J==="editable"&&X)M.write(X),B(X)},[]);let V=Q.style.message(D.message,$),H=W;if(typeof D.transformer==="function")H=D.transformer(W,{isFinal:$==="done"});else if($==="done")H=Q.style.answer(W);let z;if(X&&$!=="done"&&!W)z=Q.style.defaultAnswer(X);let _="";if(q)_=Q.style.error(q);return[[K,V,z,H].filter((M)=>M!==void 0).join(" "),_]});function eb(D,F){let J=F!==!1;if(/^(y|yes)/i.test(D))J=!0;else if(/^(n|no)/i.test(D))J=!1;return J}function Dv(D){return D?"Yes":"No"}var Fv=T1((D,F)=>{let{transformer:J=Dv}=D,[Q,$]=z0("idle"),[Z,X]=z0(""),Y=I1(D.theme),q=p3({status:Q,theme:Y});N1((K,U)=>{if(Q!=="idle")return;if(g3(K)){let V=eb(Z,D.default);X(J(V)),$("done"),F(V)}else if(s5(K)){let V=Dv(!eb(Z,D.default));U.clearLine(0),U.write(V),X(V)}else X(U.line)});let G=Z,W="";if(Q==="done")G=Y.style.answer(Z);else W=` ${Y.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let B=Y.style.message(D.message,Q);return`${q} ${B}${W} ${G}`});var c3=async(D)=>{let F=await t0({...D,validate:(J)=>FD(J)||"Enter a valid address"});return RD(F)},IXD=async(D)=>{return await t0({...D,validate:(J)=>e(J)||"Enter a valid hex value"})},P1=async(D)=>{let F=D.default!==void 0?d8(D.default,D.decimals):void 0,J=await t0({...D,default:F});return M3(J,D.decimals)},aH=async(D)=>{let F=D.encoding??await fY({...D,choices:[{value:"string",name:"String encoding",description:"Convert UTF-8 string to bytes"},{value:"hex",name:"Hex string encoding",description:"Convert a hex string to bytes (must start with 0x)"},{value:"abi",name:"ABI encoding",description:"Input as ABI encoding parameters https://abitype.dev/api/human#parseabiparameters"}]});switch(F){case"hex":return await IXD({...D,default:"0x",message:`${D.message} (as hex-string)`});case"string":{let J=await t0({...D,message:`${D.message} (as string)`});return G0(J)}case"abi":return await NXD(D);default:throw Error(`Unsupported encoding ${F}`)}},NXD=async(D)=>{let F=await t0({message:`${D.message} (as ABI encoded https://abitype.dev/api/human#parseabiparameters )`,validate:($)=>{try{return B2($),!0}catch{return"Invalid ABI parameters"}}}),J=B2(F),Q=[];for(let $ of J){let Z=`${D.message} -> ${$.type} ${$.name??""}`;switch($.type){case"string":Q.push(await t0({message:Z}));break;case"bool":Q.push(await Fv({message:Z}));break;case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":Q.push(await t0({message:Z,validate:(X)=>{try{return BigInt(X),!0}catch{return"Invalid number"}}}));break;case"bytes":Q.push(await aH({message:Z}));break;case"address":Q.push(await t0({message:Z,validate:(X)=>FD(X)||"Invalid address"}));break;default:throw Error(`Unsupported type ${$.type}`)}}return iD(J,Q)};var Jv=T1((D,F)=>{let J=D.choices,Q=D.separator??"\t",$=J.map((Z)=>`(${b.cyan(Z.value)}) ${Z.name??""}`).join(Q);return N1((Z)=>{let X=J.find((Y)=>Y.value===Z.name);if(X)F(X.value)}),`${$} `}),J2=async(D)=>{let{application:F,projectName:J}=D;if(F&&FD(F))return F;let Q=await dX({projectName:J});if(Q)return Q;return await c3({message:"Application address"})};var rH=x4({id:13370,name:"Cannon",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}});var TXD=x4({...rH,name:"Cartesi Devnet",testnet:!0}),LXD=async(D)=>{if(D.rpcUrl)return D.rpcUrl;try{let F=fD(D);return`http://${await tx({projectName:F})}/anvil`}catch{return await t0({message:"RPC URL",default:`http://127.0.0.1:${p4}/anvil`})}},Q2=async(D)=>{let F=await LXD(D);return fK({chain:TXD,mode:"anvil",transport:uK(F)}).extend(yK).extend(bK)};var Qv=async(D)=>{return{address:D.token&&FD(D.token)?RD(D.token):await c3({message:"Token address",default:fZ}),name:"TestMultiToken"}},$v=()=>{return new ZD("erc1155-single").description("Deposits an ERC1155 token to the application").configureHelp({showGlobalOptions:!0}).argument("[token-id]","token ID").argument("[amount]","amount to send").option("--token <address>","ERC1155 token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,J,Q)=>{let{from:$}=Q.optsWithGlobals(),Z=await Q2(Q.optsWithGlobals()),X=await Qv({token:J.token}),Y=D?BigInt(D):await P1({decimals:0,message:"Token ID"}),q=fD(Q.optsWithGlobals()),G=await J2({...Q.optsWithGlobals(),projectName:q}),W=$&&FD($)?RD($):(await Z.getAddresses())[0],B=F?BigInt(F):await P1({message:`Amount of token ID ${Y}`,decimals:0});if(B<=BigInt(0)){console.error(b.red("Amount of tokens to be deposited, must be greater than zero."));return}let K=rK,U=e(J.baseLayerData)?J.baseLayerData:"0x",V=e(J.execLayerData)?J.execLayerData:"0x",H=sD();if(await Z.readContract({abi:K,address:X.address,functionName:"balanceOf",args:[W,Y]})<B){H.fail("Insufficient balance");return}if(await Z.readContract({abi:K,address:X.address,functionName:"isApprovedForAll",args:[W,T7]})===!1){H.start("Approving ERC1155Portal...");let{request:E}=await Z.simulateContract({abi:K,account:W,address:X.address,functionName:"setApprovalForAll",args:[T7,!0]}),A=await Z.writeContract(E);await Z.waitForTransactionReceipt({hash:A}),H.succeed("Approved ERC1155Portal")}let{request:M}=await Z.simulateContract({abi:QP,account:W,address:T7,functionName:"depositSingleERC1155Token",args:[X.address,G,Y,B,U,V]}),C=`${b.cyan(B)} units of token id ${Y}`;H.start(`Depositing ${C} to ${b.cyan(G)}...`);let O=await Z.writeContract(M);await Z.waitForTransactionReceipt({hash:O}),H.succeed(`Deposited ${C} to ${b.cyan(G)}`)})},Zv=()=>{return new ZD("erc1155-batch").description("Deposits multiple ERC1155 tokens to the application").configureHelp({showGlobalOptions:!0}).argument("[token-ids]","token IDs separated by comma").argument("[amounts]","amounts separated by comma").option("--token <address>","ERC1155 token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,J,Q)=>{let{from:$}=Q.optsWithGlobals(),Z=await Q2(Q.optsWithGlobals()),X=await Qv({token:J.token}),Y;if(D)Y=D.split(",").map((O)=>BigInt(O.trim()));else Y=(await t0({message:"Token IDs (comma separated)"})).split(",").map((E)=>BigInt(E.trim()));let q;if(F)q=F.split(",").map((O)=>BigInt(O.trim()));else q=(await t0({message:"Amounts (comma separated)"})).split(",").map((E)=>BigInt(E.trim()));if(Y.length!==q.length){console.error(b.red("Token IDs and amounts must have the same length."));return}for(let O=0;O<q.length;O++)if(q[O]<=BigInt(0)){console.error(b.red(`Amount of token Id: ${Y[O]} to be deposited, must be greater than zero.`));return}let G=fD(Q.optsWithGlobals()),W=await J2({...Q.optsWithGlobals(),projectName:G}),B=$&&FD($)?RD($):(await Z.getAddresses())[0],K=rK,U=e(J.baseLayerData)?J.baseLayerData:"0x",V=e(J.execLayerData)?J.execLayerData:"0x",H=sD();for(let O=0;O<Y.length;O++)if(await Z.readContract({abi:K,address:X.address,functionName:"balanceOf",args:[B,Y[O]]})<q[O]){H.fail(`Insufficient balance for token ID ${Y[O]}`);return}if(await Z.readContract({abi:K,address:X.address,functionName:"isApprovedForAll",args:[B,N7]})===!1){H.start("Approving ERC1155Portal...");let{request:O}=await Z.simulateContract({abi:K,account:B,address:X.address,functionName:"setApprovalForAll",args:[N7,!0]}),E=await Z.writeContract(O);await Z.waitForTransactionReceipt({hash:E}),H.succeed("Approved ERC1155Portal")}let{request:_}=await Z.simulateContract({abi:JP,account:B,address:N7,functionName:"depositBatchERC1155Token",args:[X.address,W,Y,q,U,V]}),M=Y.map((O,E)=>`${b.cyan(q[E])} units of token id ${O}`).join(", ");H.start(`Depositing tokens to ${b.cyan(W)}...`);let C=await Z.writeContract(_);await Z.waitForTransactionReceipt({hash:C}),H.succeed(`Deposited ${M} to ${b.cyan(W)}`)})};var PXD=async(D,F)=>{let J={abi:G7,address:F},Q=await D.readContract({...J,functionName:"symbol"}),$=await D.readContract({...J,functionName:"name"}),Z=await D.readContract({...J,functionName:"decimals"});return{address:F,name:$,symbol:Q,decimals:Z}},jXD=async(D)=>{let{testClient:F}=D,J=D.token&&FD(D.token)?RD(D.token):await c3({message:"Token address",default:hZ});return PXD(F,J)},Xv=()=>{return new ZD("erc20").description("Deposit ERC-20 to the application").configureHelp({showGlobalOptions:!0}).argument("[amount]","amount to send").option("--token <address>","token address").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,J)=>{let{from:Q}=J.optsWithGlobals(),$=fD(J.optsWithGlobals()),Z=await Q2(J.optsWithGlobals()),X=Q&&FD(Q)?RD(Q):(await Z.getAddresses())[0],Y=await jXD({testClient:Z,token:F.token}),q=await J2({...J.optsWithGlobals(),projectName:$}),{decimals:G,symbol:W}=Y,B=D?M3(D,G):await P1({message:`Amount (${W})`,decimals:G}),K=e(F.execLayerData)?F.execLayerData:"0x",U=sD();if(await Z.readContract({abi:G7,address:Y.address,functionName:"balanceOf",args:[X]})<B){U.fail("Insufficient balance");return}let H=await Z.readContract({abi:G7,address:Y.address,functionName:"allowance",args:[X,L7]}),z=`${b.cyan(d8(B,G))} ${W}`;if(H<B){U.start(`Approving ${z}...`);let{request:C}=await Z.simulateContract({abi:G7,account:X,address:Y.address,functionName:"approve",args:[L7,B]}),O=await Z.writeContract(C);await Z.waitForTransactionReceipt({hash:O}),U.succeed(`Approved ${z}`)}let{request:_}=await Z.simulateContract({abi:$P,account:X,address:L7,functionName:"depositERC20Tokens",args:[Y.address,q,B,K]});U.start(`Depositing ${z} to ${b.cyan(q)}...`);let M=await Z.writeContract(_);await Z.waitForTransactionReceipt({hash:M}),U.succeed(`Deposited ${z} to ${b.cyan(q)}`)})};var SXD=async(D,F)=>{let J={abi:b$,address:F},Q=await D.readContract({...J,functionName:"symbol"}),$=await D.readContract({...J,functionName:"name"});return{address:F,name:$,symbol:Q}},xXD=async(D)=>{let{testClient:F}=D,J=D.token&&FD(D.token)?RD(D.token):await c3({message:"Token address",default:l4});return SXD(F,J)},Yv=()=>{return new ZD("erc721").description("Deposit ERC-721 to the application").configureHelp({showGlobalOptions:!0}).argument("[token-id]","token ID").option("--token <address>","token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,J)=>{let{from:Q}=J.optsWithGlobals(),$=D?BigInt(D):await P1({decimals:0,message:"Token ID"}),Z=fD(J.optsWithGlobals()),X=await Q2(J.optsWithGlobals()),Y=Q&&FD(Q)?RD(Q):(await X.getAddresses())[0],q=await xXD({testClient:X,token:F.token}),G=q.address===l4?qP:b$,W=await J2({...J.optsWithGlobals(),projectName:Z}),{symbol:B}=q,K=e(F.baseLayerData)?F.baseLayerData:"0x",U=e(F.execLayerData)?F.execLayerData:"0x",V=sD();try{if(await X.readContract({abi:G,address:q.address,args:[$],functionName:"ownerOf"})!==Y){V.fail("Insufficient balance");return}}catch(C){if(C instanceof P){let O=C.walk((E)=>E instanceof A2);if(O instanceof A2){if((O.data?.errorName??"")==="ERC721NonexistentToken"){V.fail(`Token ${D} does not exist`);return}}V.fail("Failed to check ownership")}}let H=await X.readContract({abi:G,address:q.address,args:[$],functionName:"getApproved"}),z=`${b.cyan(D)} ${B}`;if(H!==P7){V.start(`Approving ${z}...`);let{request:C}=await X.simulateContract({abi:G,account:Y,address:q.address,functionName:"approve",args:[P7,$]}),O=await X.writeContract(C);await X.waitForTransactionReceipt({hash:O}),V.succeed(`Approved ${z}`)}let{request:_}=await X.simulateContract({abi:ZP,account:Y,address:P7,functionName:"depositERC721Token",args:[q.address,W,$,K,U]});V.start(`Depositing ${z} to ${b.cyan(W)}...`);let M=await X.writeContract(_);await X.waitForTransactionReceipt({hash:M}),V.succeed(`Deposited ${z} to ${b.cyan(W)}`)})};var qv=()=>{return new ZD("ether").description("Deposit ether to the application").configureHelp({showGlobalOptions:!0}).argument("[amount]","amount, in ETH units").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,J)=>{let{from:Q}=J.optsWithGlobals(),$=fD(J.optsWithGlobals()),Z=await Q2(J.optsWithGlobals()),X=Q&&FD(Q)?RD(Q):(await Z.getAddresses())[0],Y=await J2({...J.optsWithGlobals(),projectName:$}),{decimals:q,symbol:G}=Z.chain.nativeCurrency,W=D?M3(D,q):await P1({message:`Amount (${G})`,decimals:q}),B=e(F.execLayerData)?F.execLayerData:"0x",K=sD(),U=`${b.cyan(d8(W,q))} ${G}`;if(await Z.getBalance({address:X})<W){K.fail("Insufficient balance");return}let{request:H}=await Z.simulateContract({abi:XP,account:X,address:kZ,args:[Y,B],functionName:"depositEther",value:W});K.start(`Depositing ${U} to ${b.cyan(Y)}...`);let z=await Z.writeContract(H);await Z.waitForTransactionReceipt({hash:z}),K.succeed(`Deposited ${U} to ${b.cyan(Y)}`)})};var Gv=()=>{let D=new ZD("deposit").description("Deposits an asset to the application").configureHelp({showGlobalOptions:!0}).option("--from <address>","input sender address").option("--application <address>","application address").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(F,J)=>{let $=J.commands.map((X)=>({name:X.name(),value:X,description:X.description()}));(await fY({choices:$,message:"Select type of asset to deposit"})).parseAsync(J.args)});return D.addCommand(qv()),D.addCommand(Xv()),D.addCommand(Yv()),D.addCommand($v()),D.addCommand(Zv()),D};var n3=ID(p5(),1),Wv="23.0.0",Bv="2.21.0",Kv="0.13.0",kXD=async(D)=>{try{D.start("Checking Docker Engine version...");let{stdout:F}=await ND("docker",["version","--format","{{json .Client.Version}}"]),J=n3.default.coerce(F);if(J!==null&&!n3.default.gte(J,Wv))throw Error(`Unsupported Docker version. Minimum required version is ${Wv}. Installed version is ${J}.`);D.succeed(`Docker Engine ${b.cyan(J)}`)}catch(F){if(F instanceof Error&&F.code==="ENOENT")throw Error("Docker not found");throw F}return!0},yXD=async(D)=>{try{D.start("Checking Docker Compose version...");let{stdout:F}=await ND("docker",["compose","version","--short"]),J=n3.default.coerce(F);if(J!==null&&!n3.default.gte(J,Bv))throw Error(`Unsupported Docker Compose version. Minimum required version is ${Bv}. Installed version is ${J}.`);D.succeed(`Docker Compose ${b.cyan(F)}`)}catch(F){if(F instanceof Error&&F.exitCode===125)throw Error("Docker Compose is required but not installed or the command execution failed. Please refer to the Docker Compose documentation for installation instructions: https://docs.docker.com/compose/install/");throw F}return!0},fXD=async(D)=>{try{D.start("Checking Docker Buildx version...");let{stdout:F}=await ND("docker",["buildx","version"]),J=n3.default.coerce(F);if(J!==null&&!n3.default.gte(J,Kv))throw Error(`Unsupported Docker Buildx version. Minimum required version is ${Kv}. Installed version is ${J}.`);D.succeed(`Docker Buildx ${b.cyan(J)}`),D.start("Checking Docker RISC-V support...");let{stdout:Q}=await ND("docker",["buildx","ls","--format","{{.Platforms}}"]);if(!Q.split(",").map((Z)=>Z.trim()).includes("linux/riscv64"))throw Error("Your system does not support riscv64 architecture. Run `docker run --privileged --rm tonistiigi/binfmt:riscv` to enable riscv64 support.");D.succeed(`Docker RISC-V support ${b.cyan("linux/riscv64")}`)}catch(F){if(F instanceof Error&&F.exitCode===125)throw Error("Docker Buildx is required but not installed. Please refer to the Docker Desktop documentation for installation instructions: https://docs.docker.com/desktop/");throw F}return!0},Uv=()=>{return new ZD("doctor").action(async()=>{let D=sD();try{await kXD(D),await yXD(D),await fXD(D),D.succeed("Your system is ready.")}catch(F){D.fail(F.message),process.exit(1)}})};var Vv=()=>{return new ZD("hash").description("Converts the binary generated by the build command to hexadecimal and prints out the result to console.").option("--json","Format output as json.").action(async({json:D},F)=>{let J=x3();if(J)if(!D)console.log(`${b.green("?")} Cartesi machine templateHash ${b.cyan(J)}
|
|
681
|
+
`);else process.stdout.write(JSON.stringify({hash:J}));else F.error("Cartesi machine snapshot not found, run 'build'")})};var Hv=()=>{return new ZD("logs").description("Show logs of a local environment.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("-f, --follow","Follow log output").option("--since <string>","Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").option("-n, --tail <string>","Number of lines to show from the end of the logs","all").option("--until <string>","Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").configureHelp({showGlobalOptions:!0}).action(async(D)=>{let{follow:F,since:J,tail:Q,until:$}=D,Z=fD(D),X=[];if(F)X.push("--follow");if(J)X.push("--since",J);if(Q)X.push("--tail",Q);if($)X.push("--until",$);let Y=await cX({projectName:Z,service:"rollups_node"});if(!Y)throw Error("service rollups_node not found");await ND("docker",["container","logs",...X,Y.ID],{stdio:"inherit"})})};import hXD from"node:net";import bXD from"node:os";class sH extends Error{constructor(D){super(`${D} is locked`)}}var H9={old:new Set,young:new Set},vXD=15000,hY=1024,bY=65535,JJ,uXD=()=>{let D=bXD.networkInterfaces(),F=new Set([void 0,"0.0.0.0"]);for(let J of Object.values(D))for(let Q of J)F.add(Q.address);return F},zv=(D)=>new Promise((F,J)=>{let Q=hXD.createServer();Q.unref(),Q.on("error",J),Q.listen(D,()=>{let{port:$}=Q.address();Q.close(()=>{F($)})})}),Cv=async(D,F)=>{if(D.host||D.port===0)return zv(D);for(let J of F)try{await zv({port:D.port,host:J})}catch(Q){if(!["EADDRNOTAVAIL","EINVAL"].includes(Q.code))throw Q}return D.port},gXD=function*(D){if(D)yield*D;yield 0};async function tH(D){let F,J=new Set;if(D){if(D.port)F=typeof D.port==="number"?[D.port]:D.port;if(D.exclude){let $=D.exclude;if(typeof $[Symbol.iterator]!=="function")throw TypeError("The `exclude` option must be an iterable.");for(let Z of $){if(typeof Z!=="number")throw TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(Z))throw TypeError(`Number ${Z} in the exclude option is not a safe integer and can't be used`)}J=new Set($)}}if(JJ===void 0){if(JJ=setTimeout(()=>{JJ=void 0,H9.old=H9.young,H9.young=new Set},vXD),JJ.unref)JJ.unref()}let Q=uXD();for(let $ of gXD(F))try{if(J.has($))continue;let Z=await Cv({...D,port:$},Q);while(H9.old.has(Z)||H9.young.has(Z)){if($!==0)throw new sH($);Z=await Cv({...D,port:$},Q)}return H9.young.add(Z),Z}catch(Z){if(!["EADDRINUSE","EACCES"].includes(Z.code)&&!(Z instanceof sH))throw Z}throw Error("No available ports found")}function _v(D,F){if(!Number.isInteger(D)||!Number.isInteger(F))throw TypeError("`from` and `to` must be integer numbers");if(D<hY||D>bY)throw RangeError(`'from' must be between ${hY} and ${bY}`);if(F<hY||F>bY)throw RangeError(`'to' must be between ${hY} and ${bY}`);if(D>F)throw RangeError("`to` must be greater than or equal to `from`");return function*(Q,$){for(let Z=Q;Z<=$;Z++)yield Z}(D,F)}var mXD=(D)=>D.split(","),dXD=async(D)=>{let{build:F,epochLength:J,log:Q,projectName:$,prt:Z}=D,X,Y=0,q=x3();if(q)X=await Ov({epochLength:J,hash:q,projectName:$,prt:Z,salt:k(Y++,{size:32})});else console.warn(b.yellow("machine snapshot not found, waiting for build"));while(!0)try{switch(await Jv({choices:[{name:"View logs",value:"l"},{name:"Build and redeploy",value:"b"},{name:"Quit",value:"q"}]},{})){case"l":{try{await Q?.parseAsync(["--project-name",$,"--follow"],{from:"user"})}catch(W){if(W instanceof V8){if(W.exitCode===130)break;throw W}}break}case"b":{await F?.parseAsync([],{from:"user"});let W=x3();if(W){if(X)await pXD({projectName:$});X=await Ov({consensus:X?.consensus,epochLength:J,hash:W,projectName:$,prt:Z,salt:k(Y++,{size:32})})}break}case"q":return}}catch(G){if(G instanceof B9)return;throw G}},pXD=async(D)=>{let{projectName:F}=D,J=sD(`${b.cyan(F)} undeploying...`).start();await sx({application:F,force:!0,projectName:F}),J.succeed(`${b.cyan(F)} undeployed`)},Ov=async(D)=>{let{consensus:F,epochLength:J,hash:Q,projectName:$,prt:Z,salt:X}=D,Y=sD(`deploying ${b.cyan(Q)} as ${b.cyan($)}`),q=await rx({consensus:F,epochLength:J,name:$,projectName:$,prt:Z,salt:X,snapshotPath:"/var/lib/cartesi-rollups-node/snapshots/image"});return Y.succeed(`${b.cyan($)} machine hash is ${b.cyan(Q)}`),Y.succeed(`${b.cyan($)} contract deployed at ${b.cyan(q.address)}`),q},Mv=()=>{return new ZD("run").description("Run a local cartesi node for the application.").addOption(new m0("--authority","deploy application with authority consensus").default(!1)).addOption(new m0("--block-time <number>","interval between blocks (in seconds)").argParser(Number).default(2)).addOption(new m0("--cpus <number>","number of cpu limits for the rollups-node").argParser(Number)).addOption(new m0("--default-block <string>","default block to be used when fetching new blocks.").choices(["latest","safe","pending","finalized"]).default("latest")).option("--dry-run","show the docker compose configuration",!1).addOption(new m0("--memory <number>","memory limit for the rollups-node in MB").argParser(Number)).addOption(new m0("--epoch-length <number>","length of an epoch (in blocks)").argParser(Number).default(720)).option("-p, --port <number>","port to listen on",Number).addOption(new m0("--runtime-version <version>","version for Cartesi Rollups Runtime to use").default(oK).hideHelp()).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--services <string>",`optional services to start, comma separated list from [${nx.join(", ")}]`,mXD,[]).option("-v, --verbose","verbose output",!1).action(async(D,F)=>{let{authority:J,blockTime:Q,cpus:$,defaultBlock:Z,dryRun:X,epochLength:Y,memory:q,runtimeVersion:G,services:W,verbose:B}=D,K=sD();if(Z!=="finalized")console.warn(b.yellow(`WARNING: default block is set to '${Z}', production configuration will likely use 'finalized'`));let U=fD(D),V=D.port||await tH({port:_v(p4,p4+10)}),{address:H,config:z}=await ix({blockTime:Q,cpus:$,defaultBlock:Z,dryRun:X,memory:q,port:V,projectName:U,runtimeVersion:G,services:W,verbose:B});if(X&&z){process.stdout.write(z);return}K.succeed(`${b.cyan(U)} starting at ${b.cyan(`${H}`)}`),await ox({name:U,port:V,projectName:U,services:W});let _=async()=>{K.start(`${b.cyan(U)} stopping...`);try{await ax({projectName:U}),K.succeed(`${b.cyan(U)} stopped`)}catch(O){K.fail(O instanceof Error?O.message:"Unknown error")}process.exit(0)};process.on("SIGINT",()=>{}),process.on("SIGTERM",()=>{});let M=F.parent?.commands.find((O)=>O.name()==="logs"),C=F.parent?.commands.find((O)=>O.name()==="build");await dXD({build:C,epochLength:Y,log:M,projectName:U,prt:!J}),await _()})};var lXD=async(D,F)=>{let{encoding:J}=F;if(D){if(J==="hex"){if(!e(D))throw Error("input encoded as hex must start with 0x");return D}if(J==="string")return G0(D);if(J==="abi"){let Q=F.abiParams;if(!Q)throw Error("Undefined input-abi-params");let $=B2(Q),Z=D.split(",").map((X,Y)=>{if(Y>=$.length)throw Error(`Too many values, expected ${$.length} values based on --input-abi-params '${Q}', parsing value at index ${Y} from input '${D}'`);let q=$[Y];switch(q.type){case"string":return X;case"bool":if(X==="true")return!0;if(X==="false")return!1;throw Error(`Invalid boolean value: ${X}`);case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":try{return BigInt(X)}catch{throw Error(`Invalid uint value: ${X}`)}case"bytes":if(e(X))return X;throw Error(`Invalid bytes value: ${X}`);case"address":if(FD(X))return RD(X);throw Error(`Invalid address value: ${X}`);default:throw Error(`Unsupported type ${q.type}`)}});if(Z.length!==$.length)throw Error(`Not enough values, expected ${$.length} values based on --input-abi-params '${Q}', parsed ${Z.length} values from input '${D}'`);return iD($,Z)}if(e(D))return D;return G0(D)}return},Ev=()=>{return new ZD("send").description("Send input to the application").argument("[input]","input payload").option("--from <address>","input sender address").option("--application <address>","application address").addOption(new m0("--encoding <encoding>","input encoding").choices(["hex","string","abi"])).option("--abi-params <abi-params>","input abi params").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(F,J)=>{let{application:Q,from:$}=J,Z=fD(J),X=await Q2(J),Y=$&&FD($)?RD($):(await X.getAddresses())[0],q=await J2({application:Q,projectName:Z}),G=await lXD(F,J)||await aH({encoding:J.encoding,message:"Input"}),{request:W}=await X.simulateContract({address:j7,abi:YP,account:Y,args:[q,G],functionName:"addInput"}),B=await X.writeContract(W),K=sD("Sending input...").start();await X.waitForTransactionReceipt({hash:B}),K.succeed(`Input sent: ${B}`)})};var Rv=ID(v2(),1);import cXD from"node:path";var Av=()=>{return new ZD("shell").option("--command <command>","shell command to run","/bin/sh").option("-c, --config <config>","path to the configuration file",(D,F)=>F.concat([D]),["cartesi.toml"]).option("--run-as-root","run as root user",!1).action(async(D)=>{let{command:F,runAsRoot:J}=D,Q=lX(D.config),$=cXD.resolve(M1());for(let[Z,X]of Object.entries(Q.drives)){let Y=`${Z}.${X.format}`,q=M1(Y);if(!Rv.default.existsSync(q))throw Error(`drive '${Z}' not built, run 'build'`)}Q.machine.entrypoint=F,Q.machine.user=J?"root":void 0;try{await wY(Q,void 0,{interactive:!0},{cwd:$,stdio:"inherit"})}catch(Z){if(Z instanceof V8){if(Z.exitCode===130)return;throw Z}}})};var wv=ID(Xq(),1);var Iv=()=>{return new ZD("status").description("Shows the status of a local environment.").configureHelp({showGlobalOptions:!0}).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--json","output in JSON format").action(async(D)=>{let{json:F}=D,J=fD(D),Q=await Jk({projectName:J,service:"rollups_node"}),$=await mV({projectName:J});if(F)process.stdout.write(JSON.stringify({status:Q,deployments:$}));else if(console.log(`${b.cyan(J)} is ${Q==="running"?b.green("running"):b.red("not running")}`),Q==="running")if($.length===0)console.log(b.red("no applications deployed"));else{let Z=new wv.default({head:["Machine","Address","State"],style:{border:[],head:[]}});Z.push(...$.map((X)=>[X.templateHash,X.address,X.state])),console.log(Z.toString())}})};var iXD=nXD(import.meta.url),oXD=iXD("../package.json"),aXD=String.raw` .
|
|
21
682
|
/ \
|
|
22
683
|
/ \
|
|
23
684
|
\---/---\ /----\
|
|
@@ -25,33 +686,7 @@ const splash = String.raw ` .
|
|
|
25
686
|
\----/ \---/---\
|
|
26
687
|
\ / CARTESI
|
|
27
688
|
\ / CLI
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.addHelpText("before", splash)
|
|
33
|
-
.addCommand(createAddressBookCommand())
|
|
34
|
-
.addCommand(createBuildCommand())
|
|
35
|
-
.addCommand(createCleanCommand())
|
|
36
|
-
.addCommand(createCreateCommand())
|
|
37
|
-
.addCommand(createDeployCommand(), { hidden: true })
|
|
38
|
-
.addCommand(createDepositCommand())
|
|
39
|
-
.addCommand(createDoctorCommand())
|
|
40
|
-
.addCommand(createLogsCommand())
|
|
41
|
-
.addCommand(createHashCommand())
|
|
42
|
-
.addCommand(createRunCommand())
|
|
43
|
-
.addCommand(createSendCommand())
|
|
44
|
-
.addCommand(createShellCommand())
|
|
45
|
-
.addCommand(createStatusCommand());
|
|
46
|
-
// Global error handling
|
|
47
|
-
process.on("uncaughtException", (err) => {
|
|
48
|
-
if (process.env.NODE_ENV === "development") {
|
|
49
|
-
console.error(err);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// in production, only print the error message, not the stack trace
|
|
53
|
-
console.error(err.message);
|
|
54
|
-
}
|
|
55
|
-
process.exit(1);
|
|
56
|
-
});
|
|
57
|
-
program.parse();
|
|
689
|
+
'`,rXD=new ZD().name("cartesi").version(oXD.version).addHelpText("before",aXD).addCommand($k()).addCommand(Vb()).addCommand(zb()).addCommand(jb()).addCommand(xb(),{hidden:!0}).addCommand(Gv()).addCommand(Uv()).addCommand(Hv()).addCommand(Vv()).addCommand(Mv()).addCommand(Ev()).addCommand(Av()).addCommand(Iv());process.on("uncaughtException",(D)=>{console.error(D),process.exit(1)});rXD.parse();
|
|
690
|
+
|
|
691
|
+
//# debugId=71CDC594E20FD6B964756E2164756E21
|
|
692
|
+
//# sourceMappingURL=index.js.map
|