shopify 3.93.2 → 3.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/assets/dev-console/extensions/dev-console/assets/index-Bm_GpKQW.js +51 -0
  2. package/dist/assets/dev-console/index.html +1 -1
  3. package/dist/assets/hydrogen/starter/CHANGELOG.md +0 -64
  4. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +2 -4
  5. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +3 -6
  6. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +23 -117
  7. package/dist/assets/hydrogen/starter/app/components/Header.tsx +3 -3
  8. package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +4 -24
  9. package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +1 -1
  10. package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +53 -14
  11. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +4 -11
  12. package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +1 -1
  13. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +2 -2
  14. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +1 -1
  15. package/dist/assets/hydrogen/starter/app/routes/api.$version.[graphql.json].tsx +14 -0
  16. package/dist/assets/hydrogen/starter/package.json +5 -5
  17. package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +11 -0
  18. package/dist/assets/hydrogen/starter/vite.config.ts +1 -1
  19. package/dist/assets/hydrogen/vite/vite.config.js +1 -1
  20. package/dist/chunk-52KHWFYF.js +1 -0
  21. package/dist/chunk-7F3HZJH4.js +3 -0
  22. package/dist/{chunk-4VZV4LQX.js → chunk-7JFIBCHH.js} +66 -66
  23. package/dist/{chunk-MX6WWR5F.js → chunk-AQOYGO3U.js} +16 -16
  24. package/dist/{chunk-IG47ZDRU.js → chunk-DBDY2YEY.js} +1 -1
  25. package/dist/chunk-DEW5QFGH.js +415 -0
  26. package/dist/chunk-FU2Y2M3M.js +5 -0
  27. package/dist/chunk-JBSYWYIP.js +2 -0
  28. package/dist/chunk-QYR5VPQA.js +4 -0
  29. package/dist/{chunk-5FCKEHCK.js → chunk-R6N4NGU6.js} +154 -154
  30. package/dist/{chunk-XVFYDYZA.js → chunk-SVA22NZQ.js} +209 -211
  31. package/dist/cli/commands/config/autoupgrade/constants.d.ts +5 -0
  32. package/dist/cli/commands/config/autoupgrade/constants.js +6 -0
  33. package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -0
  34. package/dist/cli/commands/config/autoupgrade/off.js +22 -0
  35. package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -0
  36. package/dist/cli/commands/config/autoupgrade/on.js +22 -0
  37. package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -0
  38. package/dist/cli/commands/config/autoupgrade/status.js +30 -0
  39. package/dist/cli/commands/docs/generate.d.ts +1 -1
  40. package/dist/cli/commands/docs/generate.js +6 -3
  41. package/dist/cli/commands/upgrade.js +3 -1
  42. package/dist/cli/services/kitchen-sink/static.js +1 -1
  43. package/dist/configs/all.yml +3 -0
  44. package/dist/configs/recommended.yml +3 -0
  45. package/dist/data/filters.json +30 -0
  46. package/dist/data/objects.json +17 -1
  47. package/dist/data/setting.json +25 -0
  48. package/dist/data/shopify_system_translations.json +29 -6
  49. package/dist/error-handler-JHFQZGYG.js +1 -0
  50. package/dist/hooks/postrun.js +1 -1
  51. package/dist/hooks/prerun.js +1 -1
  52. package/dist/{http-proxy-node16-DSQMBVDI.js → http-proxy-node16-TTURN6MD.js} +1 -1
  53. package/dist/index.js +1117 -1121
  54. package/dist/lib-3WHF5XD3.js +1 -0
  55. package/dist/{local-WHQ3ZS4K.js → local-4PW2CHVR.js} +1 -1
  56. package/dist/{morph-Q32V442A.js → morph-DQREIZD2.js} +1 -1
  57. package/dist/node-package-manager-NTQEYCSE.js +1 -0
  58. package/dist/path-HUAU3YBW.js +1 -0
  59. package/dist/tsconfig.tsbuildinfo +1 -1
  60. package/dist/{ui-GZ7DOSHP.js → ui-7Z2HOOEO.js} +1 -1
  61. package/dist/{workerd-LJU6AVMQ.js → workerd-VL54JTEU.js} +1 -1
  62. package/oclif.manifest.json +65 -4
  63. package/package.json +8 -7
  64. package/dist/assets/dev-console/extensions/dev-console/assets/index-BnXVL6nA.js +0 -78
  65. package/dist/chunk-4QL77VYJ.js +0 -415
  66. package/dist/chunk-DDTYWTF2.js +0 -1
  67. package/dist/chunk-FYQIRCLV.js +0 -5
  68. package/dist/chunk-NOSKVZWJ.js +0 -2
  69. package/dist/chunk-QJEBL3WX.js +0 -4
  70. package/dist/cli/commands/store/auth.d.ts +0 -15
  71. package/dist/cli/commands/store/auth.js +0 -46
  72. package/dist/cli/commands/store/execute.d.ts +0 -21
  73. package/dist/cli/commands/store/execute.js +0 -89
  74. package/dist/cli/services/store/auth/callback.d.ts +0 -8
  75. package/dist/cli/services/store/auth/callback.js +0 -140
  76. package/dist/cli/services/store/auth/config.d.ts +0 -6
  77. package/dist/cli/services/store/auth/config.js +0 -15
  78. package/dist/cli/services/store/auth/existing-scopes.d.ts +0 -5
  79. package/dist/cli/services/store/auth/existing-scopes.js +0 -40
  80. package/dist/cli/services/store/auth/index.d.ts +0 -18
  81. package/dist/cli/services/store/auth/index.js +0 -88
  82. package/dist/cli/services/store/auth/pkce.d.ts +0 -36
  83. package/dist/cli/services/store/auth/pkce.js +0 -49
  84. package/dist/cli/services/store/auth/recovery.d.ts +0 -4
  85. package/dist/cli/services/store/auth/recovery.js +0 -17
  86. package/dist/cli/services/store/auth/result.d.ts +0 -24
  87. package/dist/cli/services/store/auth/result.js +0 -39
  88. package/dist/cli/services/store/auth/scopes.d.ts +0 -4
  89. package/dist/cli/services/store/auth/scopes.js +0 -53
  90. package/dist/cli/services/store/auth/session-lifecycle.d.ts +0 -3
  91. package/dist/cli/services/store/auth/session-lifecycle.js +0 -69
  92. package/dist/cli/services/store/auth/session-store.d.ts +0 -32
  93. package/dist/cli/services/store/auth/session-store.js +0 -127
  94. package/dist/cli/services/store/auth/token-client.d.ts +0 -40
  95. package/dist/cli/services/store/auth/token-client.js +0 -95
  96. package/dist/cli/services/store/execute/admin-context.d.ts +0 -11
  97. package/dist/cli/services/store/execute/admin-context.js +0 -41
  98. package/dist/cli/services/store/execute/admin-transport.d.ts +0 -6
  99. package/dist/cli/services/store/execute/admin-transport.js +0 -42
  100. package/dist/cli/services/store/execute/index.d.ts +0 -13
  101. package/dist/cli/services/store/execute/index.js +0 -22
  102. package/dist/cli/services/store/execute/request.d.ts +0 -21
  103. package/dist/cli/services/store/execute/request.js +0 -88
  104. package/dist/cli/services/store/execute/result.d.ts +0 -3
  105. package/dist/cli/services/store/execute/result.js +0 -29
  106. package/dist/cli/services/store/execute/targets.d.ts +0 -18
  107. package/dist/cli/services/store/execute/targets.js +0 -21
  108. package/dist/error-handler-GZ2I7BG5.js +0 -1
  109. package/dist/lib-GGVLMXY5.js +0 -1
  110. package/dist/node-package-manager-6XMPTNUI.js +0 -1
  111. package/dist/path-IT7KPARG.js +0 -1
@@ -1,36 +1,36 @@
1
- import{$a as uu,Ba as Oi,Ed as Ae,Fb as Zn,Jc as ht,Lc as es,Sc as mu,Vc as xi,Wa as Ti,Xa as Xn,Ya as dt,b as au,bb as lu,c as cu,ed as yu,fb as fu,hb as du,qb as hu,sb as pu,va as Pi,wd as pt,yd as ve}from"./chunk-4QL77VYJ.js";import{a as ki}from"./chunk-XVFYDYZA.js";import{b as Ie,g as Rt}from"./chunk-NOSKVZWJ.js";import{a as R,c as v,e as Oe,g as u}from"./chunk-VPRTJUIN.js";var Gr=v(V=>{"use strict";u();Object.defineProperty(V,"__esModule",{value:!0});V.regexpCode=V.getEsmExportName=V.getProperty=V.safeStringify=V.stringify=V.strConcat=V.addCodeArg=V.str=V._=V.nil=V._Code=V.Name=V.IDENTIFIER=V._CodeOrName=void 0;var Vr=class{};V._CodeOrName=Vr;V.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var At=class extends Vr{constructor(e){if(super(),!V.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};V.Name=At;var qe=class extends Vr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof At&&(r[n.str]=(r[n.str]||0)+1),r),{})}};V._Code=qe;V.nil=new qe("");function qu(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Ui(r,e[n]),r.push(t[++n]);return new qe(r)}V._=qu;var zi=new qe("+");function Du(t,...e){let r=[Br(t[0])],n=0;for(;n<e.length;)r.push(zi),Ui(r,e[n]),r.push(zi,Br(t[++n]));return ty(r),new qe(r)}V.str=Du;function Ui(t,e){e instanceof qe?t.push(...e._items):e instanceof At?t.push(e):t.push(sy(e))}V.addCodeArg=Ui;function ty(t){let e=1;for(;e<t.length-1;){if(t[e]===zi){let r=ry(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function ry(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof At||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof At))return`"${t}${e.slice(1)}`}function ny(t,e){return e.emptyStr()?t:t.emptyStr()?e:Du`${t}${e}`}V.strConcat=ny;function sy(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Br(Array.isArray(t)?t.join(","):t)}function iy(t){return new qe(Br(t))}V.stringify=iy;function Br(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V.safeStringify=Br;function oy(t){return typeof t=="string"&&V.IDENTIFIER.test(t)?new qe(`.${t}`):qu`[${t}]`}V.getProperty=oy;function ay(t){if(typeof t=="string"&&V.IDENTIFIER.test(t))return new qe(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}V.getEsmExportName=ay;function cy(t){return new qe(t.toString())}V.regexpCode=cy});var Bi=v(xe=>{"use strict";u();Object.defineProperty(xe,"__esModule",{value:!0});xe.ValueScope=xe.ValueScopeName=xe.Scope=xe.varKinds=xe.UsedValueState=void 0;var ke=Gr(),Hi=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ss;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ss||(xe.UsedValueState=ss={}));xe.varKinds={const:new ke.Name("const"),let:new ke.Name("let"),var:new ke.Name("var")};var is=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ke.Name?e:this.name(e)}name(e){return new ke.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};xe.Scope=is;var os=class extends ke.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ke._)`.${new ke.Name(r)}[${n}]`}};xe.ValueScopeName=os;var uy=(0,ke._)`\n`,Vi=class extends is{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?uy:ke.nil}}get(){return this._scope}name(e){return new os(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let f=a.get(o);if(f)return f}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:i,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ke._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=ke.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,ss.Started);let f=r(l);if(f){let d=this.opts.es5?xe.varKinds.var:xe.varKinds.const;i=(0,ke._)`${i}${d} ${l} = ${f};${this.opts._n}`}else if(f=s?.(l))i=(0,ke._)`${i}${f}${this.opts._n}`;else throw new Hi(l);c.set(l,ss.Completed)})}return i}};xe.ValueScope=Vi});var I=v(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.or=q.and=q.not=q.CodeGen=q.operators=q.varKinds=q.ValueScopeName=q.ValueScope=q.Scope=q.Name=q.regexpCode=q.stringify=q.getProperty=q.nil=q.strConcat=q.str=q._=void 0;var F=Gr(),Ve=Bi(),mt=Gr();Object.defineProperty(q,"_",{enumerable:!0,get:function(){return mt._}});Object.defineProperty(q,"str",{enumerable:!0,get:function(){return mt.str}});Object.defineProperty(q,"strConcat",{enumerable:!0,get:function(){return mt.strConcat}});Object.defineProperty(q,"nil",{enumerable:!0,get:function(){return mt.nil}});Object.defineProperty(q,"getProperty",{enumerable:!0,get:function(){return mt.getProperty}});Object.defineProperty(q,"stringify",{enumerable:!0,get:function(){return mt.stringify}});Object.defineProperty(q,"regexpCode",{enumerable:!0,get:function(){return mt.regexpCode}});Object.defineProperty(q,"Name",{enumerable:!0,get:function(){return mt.Name}});var ls=Bi();Object.defineProperty(q,"Scope",{enumerable:!0,get:function(){return ls.Scope}});Object.defineProperty(q,"ValueScope",{enumerable:!0,get:function(){return ls.ValueScope}});Object.defineProperty(q,"ValueScopeName",{enumerable:!0,get:function(){return ls.ValueScopeName}});Object.defineProperty(q,"varKinds",{enumerable:!0,get:function(){return ls.varKinds}});q.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};var nt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Gi=class extends nt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ve.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=or(this.rhs,e,r)),this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}},as=class extends nt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof F.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=or(this.rhs,e,r),this}get names(){let e=this.lhs instanceof F.Name?{}:{...this.lhs.names};return us(e,this.rhs)}},Wi=class extends as{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ki=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ji=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yi=class extends nt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Qi=class extends nt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=or(this.code,e,r),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}},Wr=class extends nt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(ly(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>qt(e,r.names),{})}},st=class extends Wr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Xi=class extends Wr{},ir=class extends st{};ir.kind="else";var jt=class t extends st{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ir(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mu(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=or(this.condition,e,r),this}get names(){let e=super.names;return us(e,this.condition),this.else&&qt(e,this.else.names),e}};jt.kind="if";var It=class extends st{};It.kind="for";var Zi=class extends It{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=or(this.iteration,e,r),this}get names(){return qt(super.names,this.iteration.names)}},eo=class extends It{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ve.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=us(super.names,this.from);return us(e,this.to)}},cs=class extends It{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=or(this.iterable,e,r),this}get names(){return qt(super.names,this.iterable.names)}},Kr=class extends st{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Kr.kind="func";var Jr=class extends Wr{render(e){return"return "+super.render(e)}};Jr.kind="return";var to=class extends st{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&qt(e,this.catch.names),this.finally&&qt(e,this.finally.names),e}},Yr=class extends st{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yr.kind="catch";var Qr=class extends st{render(e){return"finally"+super.render(e)}};Qr.kind="finally";var ro=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
- `:""},this._extScope=e,this._scope=new Ve.Scope({parent:e}),this._nodes=[new Xi]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Gi(e,i,n)),i}const(e,r,n){return this._def(Ve.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ve.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ve.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new as(e,r,n))}add(e,r){return this._leafNode(new Wi(e,q.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==F.nil&&this._leafNode(new Qi(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,F.addCodeArg)(r,s));return r.push("}"),new F._Code(r)}if(e,r,n){if(this._blockNode(new jt(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new jt(e))}else(){return this._elseNode(new ir)}endIf(){return this._endBlockNode(jt,ir)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Zi(e),r)}forRange(e,r,n,s,i=this.opts.es5?Ve.varKinds.var:Ve.varKinds.let){let o=this._scope.toName(e);return this._for(new eo(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Ve.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof F.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,F._)`${o}.length`,a=>{this.var(i,(0,F._)`${o}[${a}]`),n(i)})}return this._for(new cs("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Ve.varKinds.var:Ve.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,F._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new cs("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(It)}label(e){return this._leafNode(new Ki(e))}break(e){return this._leafNode(new Ji(e))}return(e){let r=new Jr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Jr)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new to;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Yr(i),r(i)}return n&&(this._currNode=s.finally=new Qr,this.code(n)),this._endBlockNode(Yr,Qr)}throw(e){return this._leafNode(new Yi(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=F.nil,n,s){return this._blockNode(new Kr(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Kr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof jt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};q.CodeGen=ro;function qt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function us(t,e){return e instanceof F._CodeOrName?qt(t,e.names):t}function or(t,e,r){if(t instanceof F.Name)return n(t);if(!s(t))return t;return new F._Code(t._items.reduce((i,o)=>(o instanceof F.Name&&(o=n(o)),o instanceof F._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof F._Code&&i._items.some(o=>o instanceof F.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function ly(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Mu(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,F._)`!${no(t)}`}q.not=Mu;var fy=Lu(q.operators.AND);function dy(...t){return t.reduce(fy)}q.and=dy;var hy=Lu(q.operators.OR);function py(...t){return t.reduce(hy)}q.or=py;function Lu(t){return(e,r)=>e===F.nil?r:r===F.nil?e:(0,F._)`${no(e)} ${t} ${no(r)}`}function no(t){return t instanceof F.Name?t:(0,F._)`(${t})`}});var z=v(M=>{"use strict";u();Object.defineProperty(M,"__esModule",{value:!0});M.checkStrictMode=M.getErrorPath=M.Type=M.useFunc=M.setEvaluated=M.evaluatedPropsToName=M.mergeEvaluated=M.eachItem=M.unescapeJsonPointer=M.escapeJsonPointer=M.escapeFragment=M.unescapeFragment=M.schemaRefOrVal=M.schemaHasRulesButRef=M.schemaHasRules=M.checkUnknownRules=M.alwaysValidSchema=M.toHash=void 0;var W=I(),my=Gr();function yy(t){let e={};for(let r of t)e[r]=!0;return e}M.toHash=yy;function gy(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Uu(t,e),!Hu(e,t.self.RULES.all))}M.alwaysValidSchema=gy;function Uu(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||Gu(t,`unknown keyword: "${i}"`)}M.checkUnknownRules=Uu;function Hu(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}M.schemaHasRules=Hu;function _y(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}M.schemaHasRulesButRef=_y;function wy({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,W._)`${r}`}return(0,W._)`${t}${e}${(0,W.getProperty)(n)}`}M.schemaRefOrVal=wy;function by(t){return Vu(decodeURIComponent(t))}M.unescapeFragment=by;function vy(t){return encodeURIComponent(io(t))}M.escapeFragment=vy;function io(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}M.escapeJsonPointer=io;function Vu(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}M.unescapeJsonPointer=Vu;function Ey(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}M.eachItem=Ey;function Fu({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof W.Name?(i instanceof W.Name?t(s,i,o):e(s,i,o),o):i instanceof W.Name?(e(s,o,i),i):r(i,o);return a===W.Name&&!(c instanceof W.Name)?n(s,c):c}}M.mergeEvaluated={props:Fu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,W._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,W._)`${r} || {}`).code((0,W._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,W._)`${r} || {}`),oo(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Bu}),items:Fu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,W._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,W._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Bu(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,W._)`{}`);return e!==void 0&&oo(t,r,e),r}M.evaluatedPropsToName=Bu;function oo(t,e,r){Object.keys(r).forEach(n=>t.assign((0,W._)`${e}${(0,W.getProperty)(n)}`,!0))}M.setEvaluated=oo;var zu={};function Sy(t,e){return t.scopeValue("func",{ref:e,code:zu[e.code]||(zu[e.code]=new my._Code(e.code))})}M.useFunc=Sy;var so;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(so||(M.Type=so={}));function $y(t,e,r){if(t instanceof W.Name){let n=e===so.Num;return r?n?(0,W._)`"[" + ${t} + "]"`:(0,W._)`"['" + ${t} + "']"`:n?(0,W._)`"/" + ${t}`:(0,W._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,W.getProperty)(t).toString():"/"+io(t)}M.getErrorPath=$y;function Gu(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}M.checkStrictMode=Gu});var it=v(ao=>{"use strict";u();Object.defineProperty(ao,"__esModule",{value:!0});var ye=I(),Py={data:new ye.Name("data"),valCxt:new ye.Name("valCxt"),instancePath:new ye.Name("instancePath"),parentData:new ye.Name("parentData"),parentDataProperty:new ye.Name("parentDataProperty"),rootData:new ye.Name("rootData"),dynamicAnchors:new ye.Name("dynamicAnchors"),vErrors:new ye.Name("vErrors"),errors:new ye.Name("errors"),this:new ye.Name("this"),self:new ye.Name("self"),scope:new ye.Name("scope"),json:new ye.Name("json"),jsonPos:new ye.Name("jsonPos"),jsonLen:new ye.Name("jsonLen"),jsonPart:new ye.Name("jsonPart")};ao.default=Py});var Xr=v(ge=>{"use strict";u();Object.defineProperty(ge,"__esModule",{value:!0});ge.extendErrors=ge.resetErrorsCount=ge.reportExtraError=ge.reportError=ge.keyword$DataError=ge.keywordError=void 0;var U=I(),fs=z(),Ee=it();ge.keywordError={message:({keyword:t})=>(0,U.str)`must pass "${t}" keyword validation`};ge.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,U.str)`"${t}" keyword must be ${e} ($data)`:(0,U.str)`"${t}" keyword is invalid ($data)`};function Oy(t,e=ge.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,c=Ju(t,e,r);n??(o||a)?Wu(i,c):Ku(s,(0,U._)`[${c}]`)}ge.reportError=Oy;function Ty(t,e=ge.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=Ju(t,e,r);Wu(s,a),i||o||Ku(n,Ee.default.vErrors)}ge.reportExtraError=Ty;function ky(t,e){t.assign(Ee.default.errors,e),t.if((0,U._)`${Ee.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,U._)`${Ee.default.vErrors}.length`,e),()=>t.assign(Ee.default.vErrors,null)))}ge.resetErrorsCount=ky;function xy({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,Ee.default.errors,a=>{t.const(o,(0,U._)`${Ee.default.vErrors}[${a}]`),t.if((0,U._)`${o}.instancePath === undefined`,()=>t.assign((0,U._)`${o}.instancePath`,(0,U.strConcat)(Ee.default.instancePath,i.errorPath))),t.assign((0,U._)`${o}.schemaPath`,(0,U.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,U._)`${o}.schema`,r),t.assign((0,U._)`${o}.data`,n))})}ge.extendErrors=xy;function Wu(t,e){let r=t.const("err",e);t.if((0,U._)`${Ee.default.vErrors} === null`,()=>t.assign(Ee.default.vErrors,(0,U._)`[${r}]`),(0,U._)`${Ee.default.vErrors}.push(${r})`),t.code((0,U._)`${Ee.default.errors}++`)}function Ku(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,U._)`new ${t.ValidationError}(${e})`):(r.assign((0,U._)`${n}.errors`,e),r.return(!1))}var Dt={keyword:new U.Name("keyword"),schemaPath:new U.Name("schemaPath"),params:new U.Name("params"),propertyName:new U.Name("propertyName"),message:new U.Name("message"),schema:new U.Name("schema"),parentSchema:new U.Name("parentSchema")};function Ju(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,U._)`{}`:Ry(t,e,r)}function Ry(t,e,r={}){let{gen:n,it:s}=t,i=[Cy(s,r),Ny(t,r)];return Ay(t,e,i),n.object(...i)}function Cy({errorPath:t},{instancePath:e}){let r=e?(0,U.str)`${t}${(0,fs.getErrorPath)(e,fs.Type.Str)}`:t;return[Ee.default.instancePath,(0,U.strConcat)(Ee.default.instancePath,r)]}function Ny({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,U.str)`${e}/${t}`;return r&&(s=(0,U.str)`${s}${(0,fs.getErrorPath)(r,fs.Type.Str)}`),[Dt.schemaPath,s]}function Ay(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:f,schemaPath:d}=a;n.push([Dt.keyword,s],[Dt.params,typeof e=="function"?e(t):e||(0,U._)`{}`]),c.messages&&n.push([Dt.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Dt.schema,o],[Dt.parentSchema,(0,U._)`${f}${d}`],[Ee.default.data,i]),l&&n.push([Dt.propertyName,l])}});var Qu=v(ar=>{"use strict";u();Object.defineProperty(ar,"__esModule",{value:!0});ar.boolOrEmptySchema=ar.topBoolOrEmptySchema=void 0;var jy=Xr(),Iy=I(),qy=it(),Dy={message:"boolean schema is false"};function My(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Yu(t,!1):typeof r=="object"&&r.$async===!0?e.return(qy.default.data):(e.assign((0,Iy._)`${n}.errors`,null),e.return(!0))}ar.topBoolOrEmptySchema=My;function Ly(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Yu(t)):r.var(e,!0)}ar.boolOrEmptySchema=Ly;function Yu(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,jy.reportError)(s,Dy,void 0,e)}});var co=v(cr=>{"use strict";u();Object.defineProperty(cr,"__esModule",{value:!0});cr.getRules=cr.isJSONType=void 0;var Fy=["string","number","integer","boolean","null","object","array"],zy=new Set(Fy);function Uy(t){return typeof t=="string"&&zy.has(t)}cr.isJSONType=Uy;function Hy(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}cr.getRules=Hy});var uo=v(yt=>{"use strict";u();Object.defineProperty(yt,"__esModule",{value:!0});yt.shouldUseRule=yt.shouldUseGroup=yt.schemaHasRulesForType=void 0;function Vy({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Xu(t,n)}yt.schemaHasRulesForType=Vy;function Xu(t,e){return e.rules.some(r=>Zu(t,r))}yt.shouldUseGroup=Xu;function Zu(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}yt.shouldUseRule=Zu});var Zr=v(_e=>{"use strict";u();Object.defineProperty(_e,"__esModule",{value:!0});_e.reportTypeError=_e.checkDataTypes=_e.checkDataType=_e.coerceAndCheckDataType=_e.getJSONTypes=_e.getSchemaTypes=_e.DataType=void 0;var By=co(),Gy=uo(),Wy=Xr(),j=I(),el=z(),ur;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ur||(_e.DataType=ur={}));function Ky(t){let e=tl(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}_e.getSchemaTypes=Ky;function tl(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(By.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}_e.getJSONTypes=tl;function Jy(t,e){let{gen:r,data:n,opts:s}=t,i=Yy(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,Gy.schemaHasRulesForType)(t,e[0]));if(o){let a=fo(e,n,s.strictNumbers,ur.Wrong);r.if(a,()=>{i.length?Qy(t,e,i):ho(t)})}return o}_e.coerceAndCheckDataType=Jy;var rl=new Set(["string","number","integer","boolean","null"]);function Yy(t,e){return e?t.filter(r=>rl.has(r)||e==="array"&&r==="array"):[]}function Qy(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,j._)`typeof ${s}`),a=n.let("coerced",(0,j._)`undefined`);i.coerceTypes==="array"&&n.if((0,j._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,j._)`${s}[0]`).assign(o,(0,j._)`typeof ${s}`).if(fo(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,j._)`${a} !== undefined`);for(let l of r)(rl.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),ho(t),n.endIf(),n.if((0,j._)`${a} !== undefined`,()=>{n.assign(s,a),Xy(t,a)});function c(l){switch(l){case"string":n.elseIf((0,j._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,j._)`"" + ${s}`).elseIf((0,j._)`${s} === null`).assign(a,(0,j._)`""`);return;case"number":n.elseIf((0,j._)`${o} == "boolean" || ${s} === null
1
+ import{$a as fu,Ba as Ti,Ed as je,Fb as es,Jc as ht,Lc as ts,Uc as Ri,Wa as ki,Xa as Xn,Ya as Zn,Za as Rt,b as uu,bb as du,c as lu,ed as gu,fb as hu,hb as pu,qb as mu,sb as yu,va as Oi,wd as pt,yd as ve}from"./chunk-DEW5QFGH.js";import{a as xi}from"./chunk-SVA22NZQ.js";import{c as Te,h as dt}from"./chunk-JBSYWYIP.js";import{a as R,c as v,e as Oe,g as u}from"./chunk-VPRTJUIN.js";var Gr=v(V=>{"use strict";u();Object.defineProperty(V,"__esModule",{value:!0});V.regexpCode=V.getEsmExportName=V.getProperty=V.safeStringify=V.stringify=V.strConcat=V.addCodeArg=V.str=V._=V.nil=V._Code=V.Name=V.IDENTIFIER=V._CodeOrName=void 0;var Vr=class{};V._CodeOrName=Vr;V.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var At=class extends Vr{constructor(e){if(super(),!V.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};V.Name=At;var qe=class extends Vr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof At&&(r[n.str]=(r[n.str]||0)+1),r),{})}};V._Code=qe;V.nil=new qe("");function Du(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Hi(r,e[n]),r.push(t[++n]);return new qe(r)}V._=Du;var Ui=new qe("+");function Mu(t,...e){let r=[Br(t[0])],n=0;for(;n<e.length;)r.push(Ui),Hi(r,e[n]),r.push(Ui,Br(t[++n]));return ny(r),new qe(r)}V.str=Mu;function Hi(t,e){e instanceof qe?t.push(...e._items):e instanceof At?t.push(e):t.push(oy(e))}V.addCodeArg=Hi;function ny(t){let e=1;for(;e<t.length-1;){if(t[e]===Ui){let r=sy(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function sy(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof At||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof At))return`"${t}${e.slice(1)}`}function iy(t,e){return e.emptyStr()?t:t.emptyStr()?e:Mu`${t}${e}`}V.strConcat=iy;function oy(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Br(Array.isArray(t)?t.join(","):t)}function ay(t){return new qe(Br(t))}V.stringify=ay;function Br(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V.safeStringify=Br;function cy(t){return typeof t=="string"&&V.IDENTIFIER.test(t)?new qe(`.${t}`):Du`[${t}]`}V.getProperty=cy;function uy(t){if(typeof t=="string"&&V.IDENTIFIER.test(t))return new qe(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}V.getEsmExportName=uy;function ly(t){return new qe(t.toString())}V.regexpCode=ly});var Gi=v(Re=>{"use strict";u();Object.defineProperty(Re,"__esModule",{value:!0});Re.ValueScope=Re.ValueScopeName=Re.Scope=Re.varKinds=Re.UsedValueState=void 0;var xe=Gr(),Vi=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},is;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(is||(Re.UsedValueState=is={}));Re.varKinds={const:new xe.Name("const"),let:new xe.Name("let"),var:new xe.Name("var")};var os=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof xe.Name?e:this.name(e)}name(e){return new xe.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Re.Scope=os;var as=class extends xe.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,xe._)`.${new xe.Name(r)}[${n}]`}};Re.ValueScopeName=as;var fy=(0,xe._)`\n`,Bi=class extends os{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?fy:xe.nil}}get(){return this._scope}name(e){return new as(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let f=a.get(o);if(f)return f}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:i,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,xe._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=xe.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,is.Started);let f=r(l);if(f){let d=this.opts.es5?Re.varKinds.var:Re.varKinds.const;i=(0,xe._)`${i}${d} ${l} = ${f};${this.opts._n}`}else if(f=s?.(l))i=(0,xe._)`${i}${f}${this.opts._n}`;else throw new Vi(l);c.set(l,is.Completed)})}return i}};Re.ValueScope=Bi});var I=v(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.or=q.and=q.not=q.CodeGen=q.operators=q.varKinds=q.ValueScopeName=q.ValueScope=q.Scope=q.Name=q.regexpCode=q.stringify=q.getProperty=q.nil=q.strConcat=q.str=q._=void 0;var F=Gr(),Ve=Gi(),mt=Gr();Object.defineProperty(q,"_",{enumerable:!0,get:function(){return mt._}});Object.defineProperty(q,"str",{enumerable:!0,get:function(){return mt.str}});Object.defineProperty(q,"strConcat",{enumerable:!0,get:function(){return mt.strConcat}});Object.defineProperty(q,"nil",{enumerable:!0,get:function(){return mt.nil}});Object.defineProperty(q,"getProperty",{enumerable:!0,get:function(){return mt.getProperty}});Object.defineProperty(q,"stringify",{enumerable:!0,get:function(){return mt.stringify}});Object.defineProperty(q,"regexpCode",{enumerable:!0,get:function(){return mt.regexpCode}});Object.defineProperty(q,"Name",{enumerable:!0,get:function(){return mt.Name}});var fs=Gi();Object.defineProperty(q,"Scope",{enumerable:!0,get:function(){return fs.Scope}});Object.defineProperty(q,"ValueScope",{enumerable:!0,get:function(){return fs.ValueScope}});Object.defineProperty(q,"ValueScopeName",{enumerable:!0,get:function(){return fs.ValueScopeName}});Object.defineProperty(q,"varKinds",{enumerable:!0,get:function(){return fs.varKinds}});q.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};var nt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Wi=class extends nt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ve.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=or(this.rhs,e,r)),this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}},cs=class extends nt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof F.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=or(this.rhs,e,r),this}get names(){let e=this.lhs instanceof F.Name?{}:{...this.lhs.names};return ls(e,this.rhs)}},Ki=class extends cs{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ji=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Yi=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Qi=class extends nt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Xi=class extends nt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=or(this.code,e,r),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}},Wr=class extends nt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(dy(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>qt(e,r.names),{})}},st=class extends Wr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Zi=class extends Wr{},ir=class extends st{};ir.kind="else";var jt=class t extends st{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ir(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Lu(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=or(this.condition,e,r),this}get names(){let e=super.names;return ls(e,this.condition),this.else&&qt(e,this.else.names),e}};jt.kind="if";var It=class extends st{};It.kind="for";var eo=class extends It{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=or(this.iteration,e,r),this}get names(){return qt(super.names,this.iteration.names)}},to=class extends It{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ve.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=ls(super.names,this.from);return ls(e,this.to)}},us=class extends It{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=or(this.iterable,e,r),this}get names(){return qt(super.names,this.iterable.names)}},Kr=class extends st{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Kr.kind="func";var Jr=class extends Wr{render(e){return"return "+super.render(e)}};Jr.kind="return";var ro=class extends st{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&qt(e,this.catch.names),this.finally&&qt(e,this.finally.names),e}},Yr=class extends st{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yr.kind="catch";var Qr=class extends st{render(e){return"finally"+super.render(e)}};Qr.kind="finally";var no=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
+ `:""},this._extScope=e,this._scope=new Ve.Scope({parent:e}),this._nodes=[new Zi]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Wi(e,i,n)),i}const(e,r,n){return this._def(Ve.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ve.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ve.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new cs(e,r,n))}add(e,r){return this._leafNode(new Ki(e,q.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==F.nil&&this._leafNode(new Xi(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,F.addCodeArg)(r,s));return r.push("}"),new F._Code(r)}if(e,r,n){if(this._blockNode(new jt(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new jt(e))}else(){return this._elseNode(new ir)}endIf(){return this._endBlockNode(jt,ir)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new eo(e),r)}forRange(e,r,n,s,i=this.opts.es5?Ve.varKinds.var:Ve.varKinds.let){let o=this._scope.toName(e);return this._for(new to(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Ve.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof F.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,F._)`${o}.length`,a=>{this.var(i,(0,F._)`${o}[${a}]`),n(i)})}return this._for(new us("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Ve.varKinds.var:Ve.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,F._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new us("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(It)}label(e){return this._leafNode(new Ji(e))}break(e){return this._leafNode(new Yi(e))}return(e){let r=new Jr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Jr)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new ro;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Yr(i),r(i)}return n&&(this._currNode=s.finally=new Qr,this.code(n)),this._endBlockNode(Yr,Qr)}throw(e){return this._leafNode(new Qi(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=F.nil,n,s){return this._blockNode(new Kr(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Kr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof jt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};q.CodeGen=no;function qt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function ls(t,e){return e instanceof F._CodeOrName?qt(t,e.names):t}function or(t,e,r){if(t instanceof F.Name)return n(t);if(!s(t))return t;return new F._Code(t._items.reduce((i,o)=>(o instanceof F.Name&&(o=n(o)),o instanceof F._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof F._Code&&i._items.some(o=>o instanceof F.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function dy(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Lu(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,F._)`!${so(t)}`}q.not=Lu;var hy=Fu(q.operators.AND);function py(...t){return t.reduce(hy)}q.and=py;var my=Fu(q.operators.OR);function yy(...t){return t.reduce(my)}q.or=yy;function Fu(t){return(e,r)=>e===F.nil?r:r===F.nil?e:(0,F._)`${so(e)} ${t} ${so(r)}`}function so(t){return t instanceof F.Name?t:(0,F._)`(${t})`}});var z=v(M=>{"use strict";u();Object.defineProperty(M,"__esModule",{value:!0});M.checkStrictMode=M.getErrorPath=M.Type=M.useFunc=M.setEvaluated=M.evaluatedPropsToName=M.mergeEvaluated=M.eachItem=M.unescapeJsonPointer=M.escapeJsonPointer=M.escapeFragment=M.unescapeFragment=M.schemaRefOrVal=M.schemaHasRulesButRef=M.schemaHasRules=M.checkUnknownRules=M.alwaysValidSchema=M.toHash=void 0;var W=I(),gy=Gr();function _y(t){let e={};for(let r of t)e[r]=!0;return e}M.toHash=_y;function wy(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Hu(t,e),!Vu(e,t.self.RULES.all))}M.alwaysValidSchema=wy;function Hu(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||Wu(t,`unknown keyword: "${i}"`)}M.checkUnknownRules=Hu;function Vu(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}M.schemaHasRules=Vu;function by(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}M.schemaHasRulesButRef=by;function vy({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,W._)`${r}`}return(0,W._)`${t}${e}${(0,W.getProperty)(n)}`}M.schemaRefOrVal=vy;function Ey(t){return Bu(decodeURIComponent(t))}M.unescapeFragment=Ey;function Sy(t){return encodeURIComponent(oo(t))}M.escapeFragment=Sy;function oo(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}M.escapeJsonPointer=oo;function Bu(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}M.unescapeJsonPointer=Bu;function $y(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}M.eachItem=$y;function zu({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof W.Name?(i instanceof W.Name?t(s,i,o):e(s,i,o),o):i instanceof W.Name?(e(s,o,i),i):r(i,o);return a===W.Name&&!(c instanceof W.Name)?n(s,c):c}}M.mergeEvaluated={props:zu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,W._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,W._)`${r} || {}`).code((0,W._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,W._)`${r} || {}`),ao(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Gu}),items:zu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,W._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,W._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Gu(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,W._)`{}`);return e!==void 0&&ao(t,r,e),r}M.evaluatedPropsToName=Gu;function ao(t,e,r){Object.keys(r).forEach(n=>t.assign((0,W._)`${e}${(0,W.getProperty)(n)}`,!0))}M.setEvaluated=ao;var Uu={};function Py(t,e){return t.scopeValue("func",{ref:e,code:Uu[e.code]||(Uu[e.code]=new gy._Code(e.code))})}M.useFunc=Py;var io;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(io||(M.Type=io={}));function Oy(t,e,r){if(t instanceof W.Name){let n=e===io.Num;return r?n?(0,W._)`"[" + ${t} + "]"`:(0,W._)`"['" + ${t} + "']"`:n?(0,W._)`"/" + ${t}`:(0,W._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,W.getProperty)(t).toString():"/"+oo(t)}M.getErrorPath=Oy;function Wu(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}M.checkStrictMode=Wu});var it=v(co=>{"use strict";u();Object.defineProperty(co,"__esModule",{value:!0});var ye=I(),Ty={data:new ye.Name("data"),valCxt:new ye.Name("valCxt"),instancePath:new ye.Name("instancePath"),parentData:new ye.Name("parentData"),parentDataProperty:new ye.Name("parentDataProperty"),rootData:new ye.Name("rootData"),dynamicAnchors:new ye.Name("dynamicAnchors"),vErrors:new ye.Name("vErrors"),errors:new ye.Name("errors"),this:new ye.Name("this"),self:new ye.Name("self"),scope:new ye.Name("scope"),json:new ye.Name("json"),jsonPos:new ye.Name("jsonPos"),jsonLen:new ye.Name("jsonLen"),jsonPart:new ye.Name("jsonPart")};co.default=Ty});var Xr=v(ge=>{"use strict";u();Object.defineProperty(ge,"__esModule",{value:!0});ge.extendErrors=ge.resetErrorsCount=ge.reportExtraError=ge.reportError=ge.keyword$DataError=ge.keywordError=void 0;var U=I(),ds=z(),Ee=it();ge.keywordError={message:({keyword:t})=>(0,U.str)`must pass "${t}" keyword validation`};ge.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,U.str)`"${t}" keyword must be ${e} ($data)`:(0,U.str)`"${t}" keyword is invalid ($data)`};function ky(t,e=ge.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,c=Yu(t,e,r);n??(o||a)?Ku(i,c):Ju(s,(0,U._)`[${c}]`)}ge.reportError=ky;function xy(t,e=ge.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=Yu(t,e,r);Ku(s,a),i||o||Ju(n,Ee.default.vErrors)}ge.reportExtraError=xy;function Ry(t,e){t.assign(Ee.default.errors,e),t.if((0,U._)`${Ee.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,U._)`${Ee.default.vErrors}.length`,e),()=>t.assign(Ee.default.vErrors,null)))}ge.resetErrorsCount=Ry;function Cy({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,Ee.default.errors,a=>{t.const(o,(0,U._)`${Ee.default.vErrors}[${a}]`),t.if((0,U._)`${o}.instancePath === undefined`,()=>t.assign((0,U._)`${o}.instancePath`,(0,U.strConcat)(Ee.default.instancePath,i.errorPath))),t.assign((0,U._)`${o}.schemaPath`,(0,U.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,U._)`${o}.schema`,r),t.assign((0,U._)`${o}.data`,n))})}ge.extendErrors=Cy;function Ku(t,e){let r=t.const("err",e);t.if((0,U._)`${Ee.default.vErrors} === null`,()=>t.assign(Ee.default.vErrors,(0,U._)`[${r}]`),(0,U._)`${Ee.default.vErrors}.push(${r})`),t.code((0,U._)`${Ee.default.errors}++`)}function Ju(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,U._)`new ${t.ValidationError}(${e})`):(r.assign((0,U._)`${n}.errors`,e),r.return(!1))}var Dt={keyword:new U.Name("keyword"),schemaPath:new U.Name("schemaPath"),params:new U.Name("params"),propertyName:new U.Name("propertyName"),message:new U.Name("message"),schema:new U.Name("schema"),parentSchema:new U.Name("parentSchema")};function Yu(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,U._)`{}`:Ny(t,e,r)}function Ny(t,e,r={}){let{gen:n,it:s}=t,i=[Ay(s,r),jy(t,r)];return Iy(t,e,i),n.object(...i)}function Ay({errorPath:t},{instancePath:e}){let r=e?(0,U.str)`${t}${(0,ds.getErrorPath)(e,ds.Type.Str)}`:t;return[Ee.default.instancePath,(0,U.strConcat)(Ee.default.instancePath,r)]}function jy({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,U.str)`${e}/${t}`;return r&&(s=(0,U.str)`${s}${(0,ds.getErrorPath)(r,ds.Type.Str)}`),[Dt.schemaPath,s]}function Iy(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:f,schemaPath:d}=a;n.push([Dt.keyword,s],[Dt.params,typeof e=="function"?e(t):e||(0,U._)`{}`]),c.messages&&n.push([Dt.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Dt.schema,o],[Dt.parentSchema,(0,U._)`${f}${d}`],[Ee.default.data,i]),l&&n.push([Dt.propertyName,l])}});var Xu=v(ar=>{"use strict";u();Object.defineProperty(ar,"__esModule",{value:!0});ar.boolOrEmptySchema=ar.topBoolOrEmptySchema=void 0;var qy=Xr(),Dy=I(),My=it(),Ly={message:"boolean schema is false"};function Fy(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Qu(t,!1):typeof r=="object"&&r.$async===!0?e.return(My.default.data):(e.assign((0,Dy._)`${n}.errors`,null),e.return(!0))}ar.topBoolOrEmptySchema=Fy;function zy(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Qu(t)):r.var(e,!0)}ar.boolOrEmptySchema=zy;function Qu(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,qy.reportError)(s,Ly,void 0,e)}});var uo=v(cr=>{"use strict";u();Object.defineProperty(cr,"__esModule",{value:!0});cr.getRules=cr.isJSONType=void 0;var Uy=["string","number","integer","boolean","null","object","array"],Hy=new Set(Uy);function Vy(t){return typeof t=="string"&&Hy.has(t)}cr.isJSONType=Vy;function By(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}cr.getRules=By});var lo=v(yt=>{"use strict";u();Object.defineProperty(yt,"__esModule",{value:!0});yt.shouldUseRule=yt.shouldUseGroup=yt.schemaHasRulesForType=void 0;function Gy({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Zu(t,n)}yt.schemaHasRulesForType=Gy;function Zu(t,e){return e.rules.some(r=>el(t,r))}yt.shouldUseGroup=Zu;function el(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}yt.shouldUseRule=el});var Zr=v(_e=>{"use strict";u();Object.defineProperty(_e,"__esModule",{value:!0});_e.reportTypeError=_e.checkDataTypes=_e.checkDataType=_e.coerceAndCheckDataType=_e.getJSONTypes=_e.getSchemaTypes=_e.DataType=void 0;var Wy=uo(),Ky=lo(),Jy=Xr(),j=I(),tl=z(),ur;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ur||(_e.DataType=ur={}));function Yy(t){let e=rl(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}_e.getSchemaTypes=Yy;function rl(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Wy.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}_e.getJSONTypes=rl;function Qy(t,e){let{gen:r,data:n,opts:s}=t,i=Xy(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,Ky.schemaHasRulesForType)(t,e[0]));if(o){let a=ho(e,n,s.strictNumbers,ur.Wrong);r.if(a,()=>{i.length?Zy(t,e,i):po(t)})}return o}_e.coerceAndCheckDataType=Qy;var nl=new Set(["string","number","integer","boolean","null"]);function Xy(t,e){return e?t.filter(r=>nl.has(r)||e==="array"&&r==="array"):[]}function Zy(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,j._)`typeof ${s}`),a=n.let("coerced",(0,j._)`undefined`);i.coerceTypes==="array"&&n.if((0,j._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,j._)`${s}[0]`).assign(o,(0,j._)`typeof ${s}`).if(ho(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,j._)`${a} !== undefined`);for(let l of r)(nl.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),po(t),n.endIf(),n.if((0,j._)`${a} !== undefined`,()=>{n.assign(s,a),eg(t,a)});function c(l){switch(l){case"string":n.elseIf((0,j._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,j._)`"" + ${s}`).elseIf((0,j._)`${s} === null`).assign(a,(0,j._)`""`);return;case"number":n.elseIf((0,j._)`${o} == "boolean" || ${s} === null
3
3
  || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,j._)`+${s}`);return;case"integer":n.elseIf((0,j._)`${o} === "boolean" || ${s} === null
4
4
  || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,j._)`+${s}`);return;case"boolean":n.elseIf((0,j._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,j._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,j._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,j._)`${o} === "string" || ${o} === "number"
5
- || ${o} === "boolean" || ${s} === null`).assign(a,(0,j._)`[${s}]`)}}}function Xy({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,j._)`${e} !== undefined`,()=>t.assign((0,j._)`${e}[${r}]`,n))}function lo(t,e,r,n=ur.Correct){let s=n===ur.Correct?j.operators.EQ:j.operators.NEQ,i;switch(t){case"null":return(0,j._)`${e} ${s} null`;case"array":i=(0,j._)`Array.isArray(${e})`;break;case"object":i=(0,j._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,j._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,j._)`typeof ${e} ${s} ${t}`}return n===ur.Correct?i:(0,j.not)(i);function o(a=j.nil){return(0,j.and)((0,j._)`typeof ${e} == "number"`,a,r?(0,j._)`isFinite(${e})`:j.nil)}}_e.checkDataType=lo;function fo(t,e,r,n){if(t.length===1)return lo(t[0],e,r,n);let s,i=(0,el.toHash)(t);if(i.array&&i.object){let o=(0,j._)`typeof ${e} != "object"`;s=i.null?o:(0,j._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=j.nil;i.number&&delete i.integer;for(let o in i)s=(0,j.and)(s,lo(o,e,r,n));return s}_e.checkDataTypes=fo;var Zy={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,j._)`{type: ${t}}`:(0,j._)`{type: ${e}}`};function ho(t){let e=eg(t);(0,Wy.reportError)(e,Zy)}_e.reportTypeError=ho;function eg(t){let{gen:e,data:r,schema:n}=t,s=(0,el.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var sl=v(ds=>{"use strict";u();Object.defineProperty(ds,"__esModule",{value:!0});ds.assignDefaults=void 0;var lr=I(),tg=z();function rg(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)nl(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>nl(t,i,s.default))}ds.assignDefaults=rg;function nl(t,e,r){let{gen:n,compositeRule:s,data:i,opts:o}=t;if(r===void 0)return;let a=(0,lr._)`${i}${(0,lr.getProperty)(e)}`;if(s){(0,tg.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,lr._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,lr._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,lr._)`${a} = ${(0,lr.stringify)(r)}`)}});var De=v(B=>{"use strict";u();Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;var J=I(),po=z(),gt=it(),ng=z();function sg(t,e){let{gen:r,data:n,it:s}=t;r.if(yo(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,J._)`${e}`},!0),t.error()})}B.checkReportMissingProp=sg;function ig({gen:t,data:e,it:{opts:r}},n,s){return(0,J.or)(...n.map(i=>(0,J.and)(yo(t,e,i,r.ownProperties),(0,J._)`${s} = ${i}`)))}B.checkMissingProp=ig;function og(t,e){t.setParams({missingProperty:e},!0),t.error()}B.reportMissingProp=og;function il(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,J._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=il;function mo(t,e,r){return(0,J._)`${il(t)}.call(${e}, ${r})`}B.isOwnProperty=mo;function ag(t,e,r,n){let s=(0,J._)`${e}${(0,J.getProperty)(r)} !== undefined`;return n?(0,J._)`${s} && ${mo(t,e,r)}`:s}B.propertyInData=ag;function yo(t,e,r,n){let s=(0,J._)`${e}${(0,J.getProperty)(r)} === undefined`;return n?(0,J.or)(s,(0,J.not)(mo(t,e,r))):s}B.noPropertyInData=yo;function ol(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}B.allSchemaProperties=ol;function cg(t,e){return ol(e).filter(r=>!(0,po.alwaysValidSchema)(t,e[r]))}B.schemaProperties=cg;function ug({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,l){let f=l?(0,J._)`${t}, ${e}, ${n}${s}`:e,d=[[gt.default.instancePath,(0,J.strConcat)(gt.default.instancePath,i)],[gt.default.parentData,o.parentData],[gt.default.parentDataProperty,o.parentDataProperty],[gt.default.rootData,gt.default.rootData]];o.opts.dynamicRef&&d.push([gt.default.dynamicAnchors,gt.default.dynamicAnchors]);let p=(0,J._)`${f}, ${r.object(...d)}`;return c!==J.nil?(0,J._)`${a}.call(${c}, ${p})`:(0,J._)`${a}(${p})`}B.callValidateCode=ug;var lg=(0,J._)`new RegExp`;function fg({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,J._)`${s.code==="new RegExp"?lg:(0,ng.useFunc)(t,s)}(${r}, ${n})`})}B.usePattern=fg;function dg(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,J._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:po.Type.Num},i),e.if((0,J.not)(i),a)})}}B.validateArray=dg;function hg(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,po.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let f=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,J._)`${o} || ${a}`),t.mergeValidEvaluated(f,a)||e.if((0,J.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}B.validateUnion=hg});var ul=v(Xe=>{"use strict";u();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.validateKeywordUsage=Xe.validSchemaType=Xe.funcKeywordCode=Xe.macroKeywordCode=void 0;var Se=I(),Mt=it(),pg=De(),mg=Xr();function yg(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),c=cl(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Se.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Xe.macroKeywordCode=yg;function gg(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=t;wg(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,f=cl(n,s,l),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&al(t),b(()=>t.error());else{let w=e.async?y():g();e.modifying&&al(t),b(()=>_g(t,w))}}function y(){let w=n.let("ruleErrs",null);return n.try(()=>h((0,Se._)`await `),P=>n.assign(d,!1).if((0,Se._)`${P} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,Se._)`${P}.errors`),()=>n.throw(P))),w}function g(){let w=(0,Se._)`${f}.errors`;return n.assign(w,null),h(Se.nil),w}function h(w=e.async?(0,Se._)`await `:Se.nil){let P=c.opts.passContext?Mt.default.this:Mt.default.self,E=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Se._)`${w}${(0,pg.callValidateCode)(t,f,P,E)}`,e.modifying)}function b(w){var P;n.if((0,Se.not)((P=e.valid)!==null&&P!==void 0?P:d),w)}}Xe.funcKeywordCode=gg;function al(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Se._)`${n.parentData}[${n.parentDataProperty}]`))}function _g(t,e){let{gen:r}=t;r.if((0,Se._)`Array.isArray(${e})`,()=>{r.assign(Mt.default.vErrors,(0,Se._)`${Mt.default.vErrors} === null ? ${e} : ${Mt.default.vErrors}.concat(${e})`).assign(Mt.default.errors,(0,Se._)`${Mt.default.vErrors}.length`),(0,mg.extendErrors)(t)},()=>t.error())}function wg({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function cl(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Se.stringify)(r)})}function bg(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Xe.validSchemaType=bg;function vg({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Xe.validateKeywordUsage=vg});var fl=v(_t=>{"use strict";u();Object.defineProperty(_t,"__esModule",{value:!0});_t.extendSubschemaMode=_t.extendSubschemaData=_t.getSubschema=void 0;var Ze=I(),ll=z();function Eg(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ze._)`${t.schemaPath}${(0,Ze.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ze._)`${t.schemaPath}${(0,Ze.getProperty)(e)}${(0,Ze.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,ll.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}_t.getSubschema=Eg;function Sg(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:f,opts:d}=e,p=a.let("data",(0,Ze._)`${e.data}${(0,Ze.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Ze.str)`${l}${(0,ll.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ze._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(s!==void 0){let l=s instanceof Ze.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}_t.extendSubschemaData=Sg;function $g(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}_t.extendSubschemaMode=$g});var go=v((TT,dl)=>{"use strict";u();dl.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var pl=v((xT,hl)=>{"use strict";u();var wt=hl.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};hs(e,n,s,t,"",t)};wt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};wt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};wt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};wt.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function hs(t,e,r,n,s,i,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,c,l);for(var f in n){var d=n[f];if(Array.isArray(d)){if(f in wt.arrayKeywords)for(var p=0;p<d.length;p++)hs(t,e,r,d[p],s+"/"+f+"/"+p,i,s,f,n,p)}else if(f in wt.propsKeywords){if(d&&typeof d=="object")for(var y in d)hs(t,e,r,d[y],s+"/"+f+"/"+Pg(y),i,s,f,n,y)}else(f in wt.keywords||t.allKeys&&!(f in wt.skipKeywords))&&hs(t,e,r,d,s+"/"+f,i,s,f,n)}r(n,s,i,o,a,c,l)}}function Pg(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var en=v(Re=>{"use strict";u();Object.defineProperty(Re,"__esModule",{value:!0});Re.getSchemaRefs=Re.resolveUrl=Re.normalizeId=Re._getFullPath=Re.getFullPath=Re.inlineRef=void 0;var Og=z(),Tg=go(),kg=pl(),xg=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Rg(t,e=!0){return typeof t=="boolean"?!0:e===!0?!_o(t):e?ml(t)<=e:!1}Re.inlineRef=Rg;var Cg=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _o(t){for(let e in t){if(Cg.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(_o)||typeof r=="object"&&_o(r))return!0}return!1}function ml(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!xg.has(r)&&(typeof t[r]=="object"&&(0,Og.eachItem)(t[r],n=>e+=ml(n)),e===1/0))return 1/0}return e}function yl(t,e="",r){r!==!1&&(e=fr(e));let n=t.parse(e);return gl(t,n)}Re.getFullPath=yl;function gl(t,e){return t.serialize(e).split("#")[0]+"#"}Re._getFullPath=gl;var Ng=/#\/?$/;function fr(t){return t?t.replace(Ng,""):""}Re.normalizeId=fr;function Ag(t,e,r){return r=fr(r),t.resolve(e,r)}Re.resolveUrl=Ag;var jg=/^[a-z_][-a-z0-9._]*$/i;function Ig(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=fr(t[r]||e),i={"":s},o=yl(n,s,!1),a={},c=new Set;return kg(t,{allKeys:!0},(d,p,y,g)=>{if(g===void 0)return;let h=o+p,b=i[g];typeof d[r]=="string"&&(b=w.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),i[p]=b;function w(E){let S=this.opts.uriResolver.resolve;if(E=fr(b?S(b,E):E),c.has(E))throw f(E);c.add(E);let T=this.refs[E];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?l(d,T.schema,E):E!==fr(h)&&(E[0]==="#"?(l(d,a[E],E),a[E]=d):this.refs[E]=h),E}function P(E){if(typeof E=="string"){if(!jg.test(E))throw new Error(`invalid anchor "${E}"`);w.call(this,`#${E}`)}}}),a;function l(d,p,y){if(p!==void 0&&!Tg(d,p))throw f(y)}function f(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Re.getSchemaRefs=Ig});var nn=v(bt=>{"use strict";u();Object.defineProperty(bt,"__esModule",{value:!0});bt.getData=bt.KeywordCxt=bt.validateFunctionCode=void 0;var El=Qu(),_l=Zr(),bo=uo(),ps=Zr(),qg=sl(),rn=ul(),wo=fl(),x=I(),N=it(),Dg=en(),ot=z(),tn=Xr();function Mg(t){if(Pl(t)&&(Ol(t),$l(t))){zg(t);return}Sl(t,()=>(0,El.topBoolOrEmptySchema)(t))}bt.validateFunctionCode=Mg;function Sl({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,x._)`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code((0,x._)`"use strict"; ${wl(r,s)}`),Fg(t,s),t.code(i)}):t.func(e,(0,x._)`${N.default.data}, ${Lg(s)}`,n.$async,()=>t.code(wl(r,s)).code(i))}function Lg(t){return(0,x._)`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?(0,x._)`, ${N.default.dynamicAnchors}={}`:x.nil}}={}`}function Fg(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,(0,x._)`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,(0,x._)`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,(0,x._)`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,(0,x._)`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,x._)`${N.default.valCxt}.${N.default.dynamicAnchors}`)},()=>{t.var(N.default.instancePath,(0,x._)`""`),t.var(N.default.parentData,(0,x._)`undefined`),t.var(N.default.parentDataProperty,(0,x._)`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,x._)`{}`)})}function zg(t){let{schema:e,opts:r,gen:n}=t;Sl(t,()=>{r.$comment&&e.$comment&&kl(t),Gg(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&Ug(t),Tl(t),Jg(t)})}function Ug(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,x._)`${r}.evaluated`),e.if((0,x._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,x._)`${t.evaluated}.props`,(0,x._)`undefined`)),e.if((0,x._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,x._)`${t.evaluated}.items`,(0,x._)`undefined`))}function wl(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,x._)`/*# sourceURL=${r} */`:x.nil}function Hg(t,e){if(Pl(t)&&(Ol(t),$l(t))){Vg(t,e);return}(0,El.boolOrEmptySchema)(t,e)}function $l({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Pl(t){return typeof t.schema!="boolean"}function Vg(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&kl(t),Wg(t),Kg(t);let i=n.const("_errs",N.default.errors);Tl(t,i),n.var(e,(0,x._)`${i} === ${N.default.errors}`)}function Ol(t){(0,ot.checkUnknownRules)(t),Bg(t)}function Tl(t,e){if(t.opts.jtd)return bl(t,[],!1,e);let r=(0,_l.getSchemaTypes)(t.schema),n=(0,_l.coerceAndCheckDataType)(t,r);bl(t,r,!n,e)}function Bg(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,ot.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Gg(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ot.checkStrictMode)(t,"default is ignored in the schema root")}function Wg(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Dg.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Kg(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function kl({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,x._)`${N.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,x.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,x._)`${N.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function Jg(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,x._)`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw((0,x._)`new ${s}(${N.default.vErrors})`)):(e.assign((0,x._)`${n}.errors`,N.default.vErrors),i.unevaluated&&Yg(t),e.return((0,x._)`${N.default.errors} === 0`))}function Yg({gen:t,evaluated:e,props:r,items:n}){r instanceof x.Name&&t.assign((0,x._)`${e}.props`,r),n instanceof x.Name&&t.assign((0,x._)`${e}.items`,n)}function bl(t,e,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=t,{RULES:f}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,ot.schemaHasRulesButRef)(i,f))){s.block(()=>Rl(t,"$ref",f.all.$ref.definition));return}c.jtd||Qg(t,e),s.block(()=>{for(let p of f.rules)d(p);d(f.post)});function d(p){(0,bo.shouldUseGroup)(i,p)&&(p.type?(s.if((0,ps.checkDataType)(p.type,o,c.strictNumbers)),vl(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,ps.reportTypeError)(t)),s.endIf()):vl(t,p),a||s.if((0,x._)`${N.default.errors} === ${n||0}`))}}function vl(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,qg.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,bo.shouldUseRule)(n,i)&&Rl(t,i.keyword,i.definition,e.type)})}function Qg(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Xg(t,e),t.opts.allowUnionTypes||Zg(t,e),e_(t,t.dataTypes))}function Xg(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{xl(t.dataTypes,r)||vo(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),r_(t,e)}}function Zg(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&vo(t,"use allowUnionTypes to allow union type keyword")}function e_(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,bo.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>t_(e,o))&&vo(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function t_(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function xl(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function r_(t,e){let r=[];for(let n of t.dataTypes)xl(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function vo(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ot.checkStrictMode)(t,e,t.opts.strictTypes)}var ms=class{constructor(e,r,n){if((0,rn.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ot.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Cl(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,rn.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",N.default.errors))}result(e,r,n){this.failResult((0,x.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,x.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,x._)`${r} !== undefined && (${(0,x.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?tn.reportExtraError:tn.reportError)(this,this.def.error,r)}$dataError(){(0,tn.reportError)(this,this.def.$dataError||tn.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,tn.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=x.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=x.nil,r=x.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,x.or)((0,x._)`${s} === undefined`,r)),e!==x.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==x.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,x.or)(o(),a());function o(){if(n.length){if(!(r instanceof x.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,x._)`${(0,ps.checkDataTypes)(c,r,i.opts.strictNumbers,ps.DataType.Wrong)}`}return x.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,x._)`!${c}(${r})`}return x.nil}}subschema(e,r){let n=(0,wo.getSubschema)(this.it,e);(0,wo.extendSubschemaData)(n,this.it,e),(0,wo.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return Hg(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ot.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=ot.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,x.Name)),!0}};bt.KeywordCxt=ms;function Rl(t,e,r,n){let s=new ms(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,rn.funcKeywordCode)(s,r):"macro"in r?(0,rn.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,rn.funcKeywordCode)(s,r)}var n_=/^\/(?:[^~]|~0|~1)*$/,s_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Cl(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!n_.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=N.default.rootData}else{let l=s_.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+l[1];if(s=l[2],s==="#"){if(f>=e)throw new Error(c("property/index",f));return n[e-f]}if(f>e)throw new Error(c("data",f));if(i=r[e-f],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,x._)`${i}${(0,x.getProperty)((0,ot.unescapeJsonPointer)(l))}`,o=(0,x._)`${o} && ${i}`);return o;function c(l,f){return`Cannot access ${l} ${f} levels up, current level is ${e}`}}bt.getData=Cl});var ys=v(So=>{"use strict";u();Object.defineProperty(So,"__esModule",{value:!0});var Eo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};So.default=Eo});var sn=v(Oo=>{"use strict";u();Object.defineProperty(Oo,"__esModule",{value:!0});var $o=en(),Po=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,$o.resolveUrl)(e,r,n),this.missingSchema=(0,$o.normalizeId)((0,$o.getFullPath)(e,this.missingRef))}};Oo.default=Po});var _s=v(Me=>{"use strict";u();Object.defineProperty(Me,"__esModule",{value:!0});Me.resolveSchema=Me.getCompilingSchema=Me.resolveRef=Me.compileSchema=Me.SchemaEnv=void 0;var Be=I(),i_=ys(),Lt=it(),Ge=en(),Nl=z(),o_=nn(),dr=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Ge.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Me.SchemaEnv=dr;function ko(t){let e=Al.call(this,t);if(e)return e;let r=(0,Ge.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Be.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:i_.default,code:(0,Be._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Lt.default.data,parentData:Lt.default.parentData,parentDataProperty:Lt.default.parentDataProperty,dataNames:[Lt.default.data],dataPathArr:[Be.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Be.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Be.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Be._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,o_.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();f=`${o.scopeRefs(Lt.default.scope)}return ${d}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let y=new Function(`${Lt.default.self}`,`${Lt.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:y}),y.errors=null,y.schema=t.schema,y.schemaEnv=t,t.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:h}=l;y.evaluated={props:g instanceof Be.Name?void 0:g,items:h instanceof Be.Name?void 0:h,dynamicProps:g instanceof Be.Name,dynamicItems:h instanceof Be.Name},y.source&&(y.source.evaluated=(0,Be.stringify)(y.evaluated))}return t.validate=y,t}catch(d){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),d}finally{this._compilations.delete(t)}}Me.compileSchema=ko;function a_(t,e,r){var n;r=(0,Ge.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=l_.call(this,t,r);if(i===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new dr({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=c_.call(this,i)}Me.resolveRef=a_;function c_(t){return(0,Ge.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ko.call(this,t)}function Al(t){for(let e of this._compilations)if(u_(e,t))return e}Me.getCompilingSchema=Al;function u_(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function l_(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||gs.call(this,t,e)}function gs(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Ge._getFullPath)(this.opts.uriResolver,r),s=(0,Ge.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return To.call(this,r,t);let i=(0,Ge.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=gs.call(this,t,o);return typeof a?.schema!="object"?void 0:To.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||ko.call(this,o),i===(0,Ge.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Ge.resolveUrl)(this.opts.uriResolver,s,l)),new dr({schema:a,schemaId:c,root:t,baseId:s})}return To.call(this,r,o)}}Me.resolveSchema=gs;var f_=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function To(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Nl.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!f_.has(a)&&l&&(e=(0,Ge.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Nl.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ge.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=gs.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new dr({schema:r,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var jl=v((zT,d_)=>{d_.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ro=v((UT,Ml)=>{"use strict";u();var h_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ql=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function xo(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var p_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Il(t){return t.length=0,!0}function m_(t,e,r){if(t.length){let n=xo(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function y_(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=m_;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(o=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(i=!0),n.push(":");continue}else if(l==="%"){if(!a(s,n,r))break;a=Il}else{s.push(l);continue}}return s.length&&(a===Il?r.zone=s.join(""):o?n.push(s.join("")):n.push(xo(s))),r.address=n.join(""),r}function Dl(t){if(g_(t,":")<2)return{host:t,isIPV6:!1};let e=y_(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function g_(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function __(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function w_(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function b_(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!ql(r)){let n=Dl(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}Ml.exports={nonSimpleDomain:p_,recomposeAuthority:b_,normalizeComponentEncoding:w_,removeDotSegments:__,isIPv4:ql,isUUID:h_,normalizeIPv6:Dl,stringArrayToHexStripped:xo}});var Hl=v((VT,Ul)=>{"use strict";u();var{isUUID:v_}=Ro(),E_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S_=["http","https","ws","wss","urn","urn:uuid"];function $_(t){return S_.indexOf(t)!==-1}function Co(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Ll(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Fl(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function P_(t){return t.secure=Co(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function O_(t){if((t.port===(Co(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function T_(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(E_);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=No(s);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function k_(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=No(s);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function x_(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!v_(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function R_(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var zl={scheme:"http",domainHost:!0,parse:Ll,serialize:Fl},C_={scheme:"https",domainHost:zl.domainHost,parse:Ll,serialize:Fl},ws={scheme:"ws",domainHost:!0,parse:P_,serialize:O_},N_={scheme:"wss",domainHost:ws.domainHost,parse:ws.parse,serialize:ws.serialize},A_={scheme:"urn",parse:T_,serialize:k_,skipNormalize:!0},j_={scheme:"urn:uuid",parse:x_,serialize:R_,skipNormalize:!0},bs={http:zl,https:C_,ws,wss:N_,urn:A_,"urn:uuid":j_};Object.setPrototypeOf(bs,null);function No(t){return t&&(bs[t]||bs[t.toLowerCase()])||void 0}Ul.exports={wsIsSecure:Co,SCHEMES:bs,isValidSchemeName:$_,getSchemeHandler:No}});var Gl=v((GT,Es)=>{"use strict";u();var{normalizeIPv6:I_,removeDotSegments:on,recomposeAuthority:q_,normalizeComponentEncoding:vs,isIPv4:D_,nonSimpleDomain:M_}=Ro(),{SCHEMES:L_,getSchemeHandler:Vl}=Hl();function F_(t,e){return typeof t=="string"?t=et(at(t,e),e):typeof t=="object"&&(t=at(et(t,e),e)),t}function z_(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=Bl(at(t,n),at(e,n),n,!0);return n.skipEscape=!0,et(s,n)}function Bl(t,e,r,n){let s={};return n||(t=at(et(t,r),r),e=at(et(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=on(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=on(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=on(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=on(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function U_(t,e,r){return typeof t=="string"?(t=unescape(t),t=et(vs(at(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=et(vs(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=et(vs(at(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=et(vs(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function et(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],i=Vl(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=q_(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=on(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var H_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function at(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(H_);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(D_(n.host)===!1){let c=I_(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=Vl(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&M_(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var Ao={SCHEMES:L_,normalize:F_,resolve:z_,resolveComponent:Bl,equal:U_,serialize:et,parse:at};Es.exports=Ao;Es.exports.default=Ao;Es.exports.fastUri=Ao});var Kl=v(jo=>{"use strict";u();Object.defineProperty(jo,"__esModule",{value:!0});var Wl=Gl();Wl.code='require("ajv/dist/runtime/uri").default';jo.default=Wl});var rf=v(fe=>{"use strict";u();Object.defineProperty(fe,"__esModule",{value:!0});fe.CodeGen=fe.Name=fe.nil=fe.stringify=fe.str=fe._=fe.KeywordCxt=void 0;var V_=nn();Object.defineProperty(fe,"KeywordCxt",{enumerable:!0,get:function(){return V_.KeywordCxt}});var hr=I();Object.defineProperty(fe,"_",{enumerable:!0,get:function(){return hr._}});Object.defineProperty(fe,"str",{enumerable:!0,get:function(){return hr.str}});Object.defineProperty(fe,"stringify",{enumerable:!0,get:function(){return hr.stringify}});Object.defineProperty(fe,"nil",{enumerable:!0,get:function(){return hr.nil}});Object.defineProperty(fe,"Name",{enumerable:!0,get:function(){return hr.Name}});Object.defineProperty(fe,"CodeGen",{enumerable:!0,get:function(){return hr.CodeGen}});var B_=ys(),Zl=sn(),G_=co(),an=_s(),W_=I(),cn=en(),Ss=Zr(),qo=z(),Jl=jl(),K_=Kl(),ef=(t,e)=>new RegExp(t,e);ef.code="new RegExp";var J_=["removeAdditional","useDefaults","coerceTypes"],Y_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Q_={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},X_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Yl=200;function Z_(t){var e,r,n,s,i,o,a,c,l,f,d,p,y,g,h,b,w,P,E,S,T,D,C,be,k;let A=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,ie=L===!0||L===void 0?1:L||0,oe=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:ef,ae=(s=t.uriResolver)!==null&&s!==void 0?s:K_.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:A)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:A)!==null&&c!==void 0?c:!0,strictTypes:(f=(l=t.strictTypes)!==null&&l!==void 0?l:A)!==null&&f!==void 0?f:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:A)!==null&&p!==void 0?p:"log",strictRequired:(g=(y=t.strictRequired)!==null&&y!==void 0?y:A)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:ie,regExp:oe}:{optimize:ie,regExp:oe},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Yl,loopEnum:(b=t.loopEnum)!==null&&b!==void 0?b:Yl,meta:(w=t.meta)!==null&&w!==void 0?w:!0,messages:(P=t.messages)!==null&&P!==void 0?P:!0,inlineRefs:(E=t.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(T=t.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(D=t.validateSchema)!==null&&D!==void 0?D:!0,validateFormats:(C=t.validateFormats)!==null&&C!==void 0?C:!0,unicodeRegExp:(be=t.unicodeRegExp)!==null&&be!==void 0?be:!0,int32range:(k=t.int32range)!==null&&k!==void 0?k:!0,uriResolver:ae}}var un=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Z_(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new W_.ValueScope({scope:{},prefixes:Y_,es5:r,lines:n}),this.logger=iw(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,G_.getRules)(),Ql.call(this,Q_,e,"NOT SUPPORTED"),Ql.call(this,X_,e,"DEPRECATED","warn"),this._metaOpts=nw.call(this),e.formats&&tw.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&rw.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),ew.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=Jl;n==="id"&&(s={...Jl},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(f,d){await i.call(this,f.$schema);let p=this._addSchema(f,d);return p.validate||o.call(this,p)}async function i(f){f&&!this.getSchema(f)&&await s.call(this,{$ref:f},!0)}async function o(f){try{return this._compileSchemaEnv(f)}catch(d){if(!(d instanceof Zl.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,f)}}function a({missingSchema:f,missingRef:d}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${d} cannot be resolved`)}async function c(f){let d=await l.call(this,f);this.refs[f]||await i.call(this,d.$schema),this.refs[f]||this.addSchema(d,f,r)}async function l(f){let d=this._loading[f];if(d)return d;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return r=(0,cn.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=Xl.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new an.SchemaEnv({schema:{},schemaId:n});if(r=an.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Xl.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,cn.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(aw.call(this,n,r),!r)return(0,qo.eachItem)(n,i=>Io.call(this,i)),this;uw.call(this,r);let s={...r,type:(0,Ss.getJSONTypes)(r.type),schemaType:(0,Ss.getJSONTypes)(r.schemaType)};return(0,qo.eachItem)(n,s.type.length===0?i=>Io.call(this,i,s):i=>s.type.forEach(o=>Io.call(this,i,s,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,f=o[a];l&&f&&(o[a]=tf(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,cn.normalizeId)(o||n);let l=cn.getSchemaRefs.call(this,e,n);return c=new an.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):an.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{an.compileSchema.call(this,e)}finally{this.opts=r}}};un.ValidationError=B_.default;un.MissingRefError=Zl.default;fe.default=un;function Ql(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}function Xl(t){return t=(0,cn.normalizeId)(t),this.schemas[t]||this.refs[t]}function ew(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function tw(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function rw(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function nw(){let t={...this.opts};for(let e of J_)delete t[e];return t}var sw={log(){},warn(){},error(){}};function iw(t){if(t===!1)return sw;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var ow=/^[a-z_$][a-z0-9_$:-]*$/i;function aw(t,e){let{RULES:r}=this;if((0,qo.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!ow.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Io(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Ss.getJSONTypes)(e.type),schemaType:(0,Ss.getJSONTypes)(e.schemaType)}};e.before?cw.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function cw(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function uw(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=tf(e)),t.validateSchema=this.compile(e,!0))}var lw={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function tf(t){return{anyOf:[t,lw]}}});var nf=v(Do=>{"use strict";u();Object.defineProperty(Do,"__esModule",{value:!0});var fw={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Do.default=fw});var cf=v(Ft=>{"use strict";u();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.callRef=Ft.getValidate=void 0;var dw=sn(),sf=De(),Ce=I(),pr=it(),of=_s(),$s=z(),hw={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:l}=i;if((r==="#"||r==="#/")&&s===l.baseId)return d();let f=of.resolveRef.call(c,l,s,r);if(f===void 0)throw new dw.default(n.opts.uriResolver,s,r);if(f instanceof of.SchemaEnv)return p(f);return y(f);function d(){if(i===l)return Ps(t,o,i,i.$async);let g=e.scopeValue("root",{ref:l});return Ps(t,(0,Ce._)`${g}.validate`,l,l.$async)}function p(g){let h=af(t,g);Ps(t,h,g,g.$async)}function y(g){let h=e.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,Ce.stringify)(g)}:{ref:g}),b=e.name("valid"),w=t.subschema({schema:g,dataTypes:[],schemaPath:Ce.nil,topSchemaRef:h,errSchemaPath:r},b);t.mergeEvaluated(w),t.ok(b)}}};function af(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ce._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ft.getValidate=af;function Ps(t,e,r,n){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?pr.default.this:Ce.nil;n?f():d();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");let g=s.let("valid");s.try(()=>{s.code((0,Ce._)`await ${(0,sf.callValidateCode)(t,e,l)}`),y(e),o||s.assign(g,!0)},h=>{s.if((0,Ce._)`!(${h} instanceof ${i.ValidationError})`,()=>s.throw(h)),p(h),o||s.assign(g,!1)}),t.ok(g)}function d(){t.result((0,sf.callValidateCode)(t,e,l),()=>y(e),()=>p(e))}function p(g){let h=(0,Ce._)`${g}.errors`;s.assign(pr.default.vErrors,(0,Ce._)`${pr.default.vErrors} === null ? ${h} : ${pr.default.vErrors}.concat(${h})`),s.assign(pr.default.errors,(0,Ce._)`${pr.default.vErrors}.length`)}function y(g){var h;if(!i.opts.unevaluated)return;let b=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=$s.mergeEvaluated.props(s,b.props,i.props));else{let w=s.var("props",(0,Ce._)`${g}.evaluated.props`);i.props=$s.mergeEvaluated.props(s,w,i.props,Ce.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=$s.mergeEvaluated.items(s,b.items,i.items));else{let w=s.var("items",(0,Ce._)`${g}.evaluated.items`);i.items=$s.mergeEvaluated.items(s,w,i.items,Ce.Name)}}}Ft.callRef=Ps;Ft.default=hw});var uf=v(Mo=>{"use strict";u();Object.defineProperty(Mo,"__esModule",{value:!0});var pw=nf(),mw=cf(),yw=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",pw.default,mw.default];Mo.default=yw});var lf=v(Lo=>{"use strict";u();Object.defineProperty(Lo,"__esModule",{value:!0});var Os=I(),vt=Os.operators,Ts={maximum:{okStr:"<=",ok:vt.LTE,fail:vt.GT},minimum:{okStr:">=",ok:vt.GTE,fail:vt.LT},exclusiveMaximum:{okStr:"<",ok:vt.LT,fail:vt.GTE},exclusiveMinimum:{okStr:">",ok:vt.GT,fail:vt.LTE}},gw={message:({keyword:t,schemaCode:e})=>(0,Os.str)`must be ${Ts[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Os._)`{comparison: ${Ts[t].okStr}, limit: ${e}}`},_w={keyword:Object.keys(Ts),type:"number",schemaType:"number",$data:!0,error:gw,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Os._)`${r} ${Ts[e].fail} ${n} || isNaN(${r})`)}};Lo.default=_w});var ff=v(Fo=>{"use strict";u();Object.defineProperty(Fo,"__esModule",{value:!0});var ln=I(),ww={message:({schemaCode:t})=>(0,ln.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ln._)`{multipleOf: ${t}}`},bw={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ww,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,ln._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,ln._)`${o} !== parseInt(${o})`;t.fail$data((0,ln._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Fo.default=bw});var hf=v(zo=>{"use strict";u();Object.defineProperty(zo,"__esModule",{value:!0});function df(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}zo.default=df;df.code='require("ajv/dist/runtime/ucs2length").default'});var pf=v(Uo=>{"use strict";u();Object.defineProperty(Uo,"__esModule",{value:!0});var zt=I(),vw=z(),Ew=hf(),Sw={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,zt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,zt._)`{limit: ${t}}`},$w={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Sw,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?zt.operators.GT:zt.operators.LT,o=s.opts.unicode===!1?(0,zt._)`${r}.length`:(0,zt._)`${(0,vw.useFunc)(t.gen,Ew.default)}(${r})`;t.fail$data((0,zt._)`${o} ${i} ${n}`)}};Uo.default=$w});var mf=v(Ho=>{"use strict";u();Object.defineProperty(Ho,"__esModule",{value:!0});var Pw=De(),Ow=z(),mr=I(),Tw={message:({schemaCode:t})=>(0,mr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,mr._)`{pattern: ${t}}`},kw={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Tw,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?(0,mr._)`new RegExp`:(0,Ow.useFunc)(e,c),f=e.let("valid");e.try(()=>e.assign(f,(0,mr._)`${l}(${i}, ${a}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,mr._)`!${f}`)}else{let c=(0,Pw.usePattern)(t,s);t.fail$data((0,mr._)`!${c}.test(${r})`)}}};Ho.default=kw});var yf=v(Vo=>{"use strict";u();Object.defineProperty(Vo,"__esModule",{value:!0});var fn=I(),xw={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,fn.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,fn._)`{limit: ${t}}`},Rw={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:xw,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?fn.operators.GT:fn.operators.LT;t.fail$data((0,fn._)`Object.keys(${r}).length ${s} ${n}`)}};Vo.default=Rw});var gf=v(Bo=>{"use strict";u();Object.defineProperty(Bo,"__esModule",{value:!0});var dn=De(),hn=I(),Cw=z(),Nw={message:({params:{missingProperty:t}})=>(0,hn.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,hn._)`{missingProperty: ${t}}`},Aw={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Nw,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():f(),a.strictRequired){let y=t.parentSchema.properties,{definedProperties:g}=t.it;for(let h of r)if(y?.[h]===void 0&&!g.has(h)){let b=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${h}" is not defined at "${b}" (strictRequired)`;(0,Cw.checkStrictMode)(o,w,o.opts.strictRequired)}}function l(){if(c||i)t.block$data(hn.nil,d);else for(let y of r)(0,dn.checkReportMissingProp)(t,y)}function f(){let y=e.let("missing");if(c||i){let g=e.let("valid",!0);t.block$data(g,()=>p(y,g)),t.ok(g)}else e.if((0,dn.checkMissingProp)(t,r,y)),(0,dn.reportMissingProp)(t,y),e.else()}function d(){e.forOf("prop",n,y=>{t.setParams({missingProperty:y}),e.if((0,dn.noPropertyInData)(e,s,y,a.ownProperties),()=>t.error())})}function p(y,g){t.setParams({missingProperty:y}),e.forOf(y,n,()=>{e.assign(g,(0,dn.propertyInData)(e,s,y,a.ownProperties)),e.if((0,hn.not)(g),()=>{t.error(),e.break()})},hn.nil)}}};Bo.default=Aw});var _f=v(Go=>{"use strict";u();Object.defineProperty(Go,"__esModule",{value:!0});var pn=I(),jw={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,pn.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,pn._)`{limit: ${t}}`},Iw={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:jw,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?pn.operators.GT:pn.operators.LT;t.fail$data((0,pn._)`${r}.length ${s} ${n}`)}};Go.default=Iw});var ks=v(Wo=>{"use strict";u();Object.defineProperty(Wo,"__esModule",{value:!0});var wf=go();wf.code='require("ajv/dist/runtime/equal").default';Wo.default=wf});var bf=v(Jo=>{"use strict";u();Object.defineProperty(Jo,"__esModule",{value:!0});var Ko=Zr(),de=I(),qw=z(),Dw=ks(),Mw={message:({params:{i:t,j:e}})=>(0,de.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,de._)`{i: ${t}, j: ${e}}`},Lw={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Mw,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!n&&!s)return;let c=e.let("valid"),l=i.items?(0,Ko.getSchemaTypes)(i.items):[];t.block$data(c,f,(0,de._)`${o} === false`),t.ok(c);function f(){let g=e.let("i",(0,de._)`${r}.length`),h=e.let("j");t.setParams({i:g,j:h}),e.assign(c,!0),e.if((0,de._)`${g} > 1`,()=>(d()?p:y)(g,h))}function d(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}function p(g,h){let b=e.name("item"),w=(0,Ko.checkDataTypes)(l,b,a.opts.strictNumbers,Ko.DataType.Wrong),P=e.const("indices",(0,de._)`{}`);e.for((0,de._)`;${g}--;`,()=>{e.let(b,(0,de._)`${r}[${g}]`),e.if(w,(0,de._)`continue`),l.length>1&&e.if((0,de._)`typeof ${b} == "string"`,(0,de._)`${b} += "_"`),e.if((0,de._)`typeof ${P}[${b}] == "number"`,()=>{e.assign(h,(0,de._)`${P}[${b}]`),t.error(),e.assign(c,!1).break()}).code((0,de._)`${P}[${b}] = ${g}`)})}function y(g,h){let b=(0,qw.useFunc)(e,Dw.default),w=e.name("outer");e.label(w).for((0,de._)`;${g}--;`,()=>e.for((0,de._)`${h} = ${g}; ${h}--;`,()=>e.if((0,de._)`${b}(${r}[${g}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(w)})))}}};Jo.default=Lw});var vf=v(Qo=>{"use strict";u();Object.defineProperty(Qo,"__esModule",{value:!0});var Yo=I(),Fw=z(),zw=ks(),Uw={message:"must be equal to constant",params:({schemaCode:t})=>(0,Yo._)`{allowedValue: ${t}}`},Hw={keyword:"const",$data:!0,error:Uw,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Yo._)`!${(0,Fw.useFunc)(e,zw.default)}(${r}, ${s})`):t.fail((0,Yo._)`${i} !== ${r}`)}};Qo.default=Hw});var Ef=v(Xo=>{"use strict";u();Object.defineProperty(Xo,"__esModule",{value:!0});var mn=I(),Vw=z(),Bw=ks(),Gw={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,mn._)`{allowedValues: ${t}}`},Ww={keyword:"enum",schemaType:"array",$data:!0,error:Gw,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,Vw.useFunc)(e,Bw.default)),f;if(a||n)f=e.let("valid"),t.block$data(f,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let y=e.const("vSchema",i);f=(0,mn.or)(...s.map((g,h)=>p(y,h)))}t.pass(f);function d(){e.assign(f,!1),e.forOf("v",i,y=>e.if((0,mn._)`${l()}(${r}, ${y})`,()=>e.assign(f,!0).break()))}function p(y,g){let h=s[g];return typeof h=="object"&&h!==null?(0,mn._)`${l()}(${r}, ${y}[${g}])`:(0,mn._)`${r} === ${h}`}}};Xo.default=Ww});var Sf=v(Zo=>{"use strict";u();Object.defineProperty(Zo,"__esModule",{value:!0});var Kw=lf(),Jw=ff(),Yw=pf(),Qw=mf(),Xw=yf(),Zw=gf(),eb=_f(),tb=bf(),rb=vf(),nb=Ef(),sb=[Kw.default,Jw.default,Yw.default,Qw.default,Xw.default,Zw.default,eb.default,tb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},rb.default,nb.default];Zo.default=sb});var ta=v(yn=>{"use strict";u();Object.defineProperty(yn,"__esModule",{value:!0});yn.validateAdditionalItems=void 0;var Ut=I(),ea=z(),ib={message:({params:{len:t}})=>(0,Ut.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ut._)`{limit: ${t}}`},ob={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ib,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,ea.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}$f(t,n)}};function $f(t,e){let{gen:r,schema:n,data:s,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,Ut._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ut._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,ea.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,Ut._)`${a} <= ${e.length}`);r.if((0,Ut.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,f=>{t.subschema({keyword:i,dataProp:f,dataPropType:ea.Type.Num},l),o.allErrors||r.if((0,Ut.not)(l),()=>r.break())})}}yn.validateAdditionalItems=$f;yn.default=ob});var ra=v(gn=>{"use strict";u();Object.defineProperty(gn,"__esModule",{value:!0});gn.validateTuple=void 0;var Pf=I(),xs=z(),ab=De(),cb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Of(t,"additionalItems",e);r.items=!0,!(0,xs.alwaysValidSchema)(r,e)&&t.ok((0,ab.validateArray)(t))}};function Of(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=t;f(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=xs.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,Pf._)`${i}.length`);r.forEach((d,p)=>{(0,xs.alwaysValidSchema)(a,d)||(n.if((0,Pf._)`${l} > ${p}`,()=>t.subschema({keyword:o,schemaProp:p,dataProp:p},c)),t.ok(c))});function f(d){let{opts:p,errSchemaPath:y}=a,g=r.length,h=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let b=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${y}"`;(0,xs.checkStrictMode)(a,b,p.strictTuples)}}}gn.validateTuple=Of;gn.default=cb});var Tf=v(na=>{"use strict";u();Object.defineProperty(na,"__esModule",{value:!0});var ub=ra(),lb={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,ub.validateTuple)(t,"items")};na.default=lb});var xf=v(sa=>{"use strict";u();Object.defineProperty(sa,"__esModule",{value:!0});var kf=I(),fb=z(),db=De(),hb=ta(),pb={message:({params:{len:t}})=>(0,kf.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,kf._)`{limit: ${t}}`},mb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:pb,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,fb.alwaysValidSchema)(n,e)&&(s?(0,hb.validateAdditionalItems)(t,s):t.ok((0,db.validateArray)(t)))}};sa.default=mb});var Rf=v(ia=>{"use strict";u();Object.defineProperty(ia,"__esModule",{value:!0});var Le=I(),Rs=z(),yb={message:({params:{min:t,max:e}})=>e===void 0?(0,Le.str)`must contain at least ${t} valid item(s)`:(0,Le.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Le._)`{minContains: ${t}}`:(0,Le._)`{minContains: ${t}, maxContains: ${e}}`},gb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yb,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,o,a,{minContains:c,maxContains:l}=n;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let f=e.const("len",(0,Le._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,Rs.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Rs.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Rs.alwaysValidSchema)(i,r)){let h=(0,Le._)`${f} >= ${o}`;a!==void 0&&(h=(0,Le._)`${h} && ${f} <= ${a}`),t.pass(h);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?y(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,Le._)`${s}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),b=e.let("count",0);y(h,()=>e.if(h,()=>g(b)))}function y(h,b){e.forRange("i",0,f,w=>{t.subschema({keyword:"contains",dataProp:w,dataPropType:Rs.Type.Num,compositeRule:!0},h),b()})}function g(h){e.code((0,Le._)`${h}++`),a===void 0?e.if((0,Le._)`${h} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Le._)`${h} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Le._)`${h} >= ${o}`,()=>e.assign(d,!0)))}}};ia.default=gb});var Af=v(tt=>{"use strict";u();Object.defineProperty(tt,"__esModule",{value:!0});tt.validateSchemaDeps=tt.validatePropertyDeps=tt.error=void 0;var oa=I(),_b=z(),_n=De();tt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,oa.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,oa._)`{property: ${t},
5
+ || ${o} === "boolean" || ${s} === null`).assign(a,(0,j._)`[${s}]`)}}}function eg({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,j._)`${e} !== undefined`,()=>t.assign((0,j._)`${e}[${r}]`,n))}function fo(t,e,r,n=ur.Correct){let s=n===ur.Correct?j.operators.EQ:j.operators.NEQ,i;switch(t){case"null":return(0,j._)`${e} ${s} null`;case"array":i=(0,j._)`Array.isArray(${e})`;break;case"object":i=(0,j._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,j._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,j._)`typeof ${e} ${s} ${t}`}return n===ur.Correct?i:(0,j.not)(i);function o(a=j.nil){return(0,j.and)((0,j._)`typeof ${e} == "number"`,a,r?(0,j._)`isFinite(${e})`:j.nil)}}_e.checkDataType=fo;function ho(t,e,r,n){if(t.length===1)return fo(t[0],e,r,n);let s,i=(0,tl.toHash)(t);if(i.array&&i.object){let o=(0,j._)`typeof ${e} != "object"`;s=i.null?o:(0,j._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=j.nil;i.number&&delete i.integer;for(let o in i)s=(0,j.and)(s,fo(o,e,r,n));return s}_e.checkDataTypes=ho;var tg={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,j._)`{type: ${t}}`:(0,j._)`{type: ${e}}`};function po(t){let e=rg(t);(0,Jy.reportError)(e,tg)}_e.reportTypeError=po;function rg(t){let{gen:e,data:r,schema:n}=t,s=(0,tl.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var il=v(hs=>{"use strict";u();Object.defineProperty(hs,"__esModule",{value:!0});hs.assignDefaults=void 0;var lr=I(),ng=z();function sg(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)sl(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>sl(t,i,s.default))}hs.assignDefaults=sg;function sl(t,e,r){let{gen:n,compositeRule:s,data:i,opts:o}=t;if(r===void 0)return;let a=(0,lr._)`${i}${(0,lr.getProperty)(e)}`;if(s){(0,ng.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,lr._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,lr._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,lr._)`${a} = ${(0,lr.stringify)(r)}`)}});var De=v(B=>{"use strict";u();Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;var J=I(),mo=z(),gt=it(),ig=z();function og(t,e){let{gen:r,data:n,it:s}=t;r.if(go(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,J._)`${e}`},!0),t.error()})}B.checkReportMissingProp=og;function ag({gen:t,data:e,it:{opts:r}},n,s){return(0,J.or)(...n.map(i=>(0,J.and)(go(t,e,i,r.ownProperties),(0,J._)`${s} = ${i}`)))}B.checkMissingProp=ag;function cg(t,e){t.setParams({missingProperty:e},!0),t.error()}B.reportMissingProp=cg;function ol(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,J._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=ol;function yo(t,e,r){return(0,J._)`${ol(t)}.call(${e}, ${r})`}B.isOwnProperty=yo;function ug(t,e,r,n){let s=(0,J._)`${e}${(0,J.getProperty)(r)} !== undefined`;return n?(0,J._)`${s} && ${yo(t,e,r)}`:s}B.propertyInData=ug;function go(t,e,r,n){let s=(0,J._)`${e}${(0,J.getProperty)(r)} === undefined`;return n?(0,J.or)(s,(0,J.not)(yo(t,e,r))):s}B.noPropertyInData=go;function al(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}B.allSchemaProperties=al;function lg(t,e){return al(e).filter(r=>!(0,mo.alwaysValidSchema)(t,e[r]))}B.schemaProperties=lg;function fg({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,l){let f=l?(0,J._)`${t}, ${e}, ${n}${s}`:e,d=[[gt.default.instancePath,(0,J.strConcat)(gt.default.instancePath,i)],[gt.default.parentData,o.parentData],[gt.default.parentDataProperty,o.parentDataProperty],[gt.default.rootData,gt.default.rootData]];o.opts.dynamicRef&&d.push([gt.default.dynamicAnchors,gt.default.dynamicAnchors]);let p=(0,J._)`${f}, ${r.object(...d)}`;return c!==J.nil?(0,J._)`${a}.call(${c}, ${p})`:(0,J._)`${a}(${p})`}B.callValidateCode=fg;var dg=(0,J._)`new RegExp`;function hg({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,J._)`${s.code==="new RegExp"?dg:(0,ig.useFunc)(t,s)}(${r}, ${n})`})}B.usePattern=hg;function pg(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,J._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:mo.Type.Num},i),e.if((0,J.not)(i),a)})}}B.validateArray=pg;function mg(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,mo.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let f=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,J._)`${o} || ${a}`),t.mergeValidEvaluated(f,a)||e.if((0,J.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}B.validateUnion=mg});var ll=v(Xe=>{"use strict";u();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.validateKeywordUsage=Xe.validSchemaType=Xe.funcKeywordCode=Xe.macroKeywordCode=void 0;var Se=I(),Mt=it(),yg=De(),gg=Xr();function _g(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),c=ul(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Se.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Xe.macroKeywordCode=_g;function wg(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=t;vg(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,f=ul(n,s,l),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&cl(t),b(()=>t.error());else{let w=e.async?y():g();e.modifying&&cl(t),b(()=>bg(t,w))}}function y(){let w=n.let("ruleErrs",null);return n.try(()=>h((0,Se._)`await `),P=>n.assign(d,!1).if((0,Se._)`${P} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,Se._)`${P}.errors`),()=>n.throw(P))),w}function g(){let w=(0,Se._)`${f}.errors`;return n.assign(w,null),h(Se.nil),w}function h(w=e.async?(0,Se._)`await `:Se.nil){let P=c.opts.passContext?Mt.default.this:Mt.default.self,E=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Se._)`${w}${(0,yg.callValidateCode)(t,f,P,E)}`,e.modifying)}function b(w){var P;n.if((0,Se.not)((P=e.valid)!==null&&P!==void 0?P:d),w)}}Xe.funcKeywordCode=wg;function cl(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Se._)`${n.parentData}[${n.parentDataProperty}]`))}function bg(t,e){let{gen:r}=t;r.if((0,Se._)`Array.isArray(${e})`,()=>{r.assign(Mt.default.vErrors,(0,Se._)`${Mt.default.vErrors} === null ? ${e} : ${Mt.default.vErrors}.concat(${e})`).assign(Mt.default.errors,(0,Se._)`${Mt.default.vErrors}.length`),(0,gg.extendErrors)(t)},()=>t.error())}function vg({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function ul(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Se.stringify)(r)})}function Eg(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Xe.validSchemaType=Eg;function Sg({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Xe.validateKeywordUsage=Sg});var dl=v(_t=>{"use strict";u();Object.defineProperty(_t,"__esModule",{value:!0});_t.extendSubschemaMode=_t.extendSubschemaData=_t.getSubschema=void 0;var Ze=I(),fl=z();function $g(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ze._)`${t.schemaPath}${(0,Ze.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ze._)`${t.schemaPath}${(0,Ze.getProperty)(e)}${(0,Ze.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,fl.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}_t.getSubschema=$g;function Pg(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:f,opts:d}=e,p=a.let("data",(0,Ze._)`${e.data}${(0,Ze.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Ze.str)`${l}${(0,fl.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ze._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(s!==void 0){let l=s instanceof Ze.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}_t.extendSubschemaData=Pg;function Og(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}_t.extendSubschemaMode=Og});var _o=v((CT,hl)=>{"use strict";u();hl.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var ml=v((AT,pl)=>{"use strict";u();var wt=pl.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};ps(e,n,s,t,"",t)};wt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};wt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};wt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};wt.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ps(t,e,r,n,s,i,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,c,l);for(var f in n){var d=n[f];if(Array.isArray(d)){if(f in wt.arrayKeywords)for(var p=0;p<d.length;p++)ps(t,e,r,d[p],s+"/"+f+"/"+p,i,s,f,n,p)}else if(f in wt.propsKeywords){if(d&&typeof d=="object")for(var y in d)ps(t,e,r,d[y],s+"/"+f+"/"+Tg(y),i,s,f,n,y)}else(f in wt.keywords||t.allKeys&&!(f in wt.skipKeywords))&&ps(t,e,r,d,s+"/"+f,i,s,f,n)}r(n,s,i,o,a,c,l)}}function Tg(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var en=v(Ce=>{"use strict";u();Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getSchemaRefs=Ce.resolveUrl=Ce.normalizeId=Ce._getFullPath=Ce.getFullPath=Ce.inlineRef=void 0;var kg=z(),xg=_o(),Rg=ml(),Cg=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ng(t,e=!0){return typeof t=="boolean"?!0:e===!0?!wo(t):e?yl(t)<=e:!1}Ce.inlineRef=Ng;var Ag=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function wo(t){for(let e in t){if(Ag.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(wo)||typeof r=="object"&&wo(r))return!0}return!1}function yl(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Cg.has(r)&&(typeof t[r]=="object"&&(0,kg.eachItem)(t[r],n=>e+=yl(n)),e===1/0))return 1/0}return e}function gl(t,e="",r){r!==!1&&(e=fr(e));let n=t.parse(e);return _l(t,n)}Ce.getFullPath=gl;function _l(t,e){return t.serialize(e).split("#")[0]+"#"}Ce._getFullPath=_l;var jg=/#\/?$/;function fr(t){return t?t.replace(jg,""):""}Ce.normalizeId=fr;function Ig(t,e,r){return r=fr(r),t.resolve(e,r)}Ce.resolveUrl=Ig;var qg=/^[a-z_][-a-z0-9._]*$/i;function Dg(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=fr(t[r]||e),i={"":s},o=gl(n,s,!1),a={},c=new Set;return Rg(t,{allKeys:!0},(d,p,y,g)=>{if(g===void 0)return;let h=o+p,b=i[g];typeof d[r]=="string"&&(b=w.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),i[p]=b;function w(E){let S=this.opts.uriResolver.resolve;if(E=fr(b?S(b,E):E),c.has(E))throw f(E);c.add(E);let T=this.refs[E];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?l(d,T.schema,E):E!==fr(h)&&(E[0]==="#"?(l(d,a[E],E),a[E]=d):this.refs[E]=h),E}function P(E){if(typeof E=="string"){if(!qg.test(E))throw new Error(`invalid anchor "${E}"`);w.call(this,`#${E}`)}}}),a;function l(d,p,y){if(p!==void 0&&!xg(d,p))throw f(y)}function f(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ce.getSchemaRefs=Dg});var nn=v(bt=>{"use strict";u();Object.defineProperty(bt,"__esModule",{value:!0});bt.getData=bt.KeywordCxt=bt.validateFunctionCode=void 0;var Sl=Xu(),wl=Zr(),vo=lo(),ms=Zr(),Mg=il(),rn=ll(),bo=dl(),x=I(),N=it(),Lg=en(),ot=z(),tn=Xr();function Fg(t){if(Ol(t)&&(Tl(t),Pl(t))){Hg(t);return}$l(t,()=>(0,Sl.topBoolOrEmptySchema)(t))}bt.validateFunctionCode=Fg;function $l({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,x._)`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code((0,x._)`"use strict"; ${bl(r,s)}`),Ug(t,s),t.code(i)}):t.func(e,(0,x._)`${N.default.data}, ${zg(s)}`,n.$async,()=>t.code(bl(r,s)).code(i))}function zg(t){return(0,x._)`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?(0,x._)`, ${N.default.dynamicAnchors}={}`:x.nil}}={}`}function Ug(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,(0,x._)`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,(0,x._)`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,(0,x._)`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,(0,x._)`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,x._)`${N.default.valCxt}.${N.default.dynamicAnchors}`)},()=>{t.var(N.default.instancePath,(0,x._)`""`),t.var(N.default.parentData,(0,x._)`undefined`),t.var(N.default.parentDataProperty,(0,x._)`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,x._)`{}`)})}function Hg(t){let{schema:e,opts:r,gen:n}=t;$l(t,()=>{r.$comment&&e.$comment&&xl(t),Kg(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&Vg(t),kl(t),Qg(t)})}function Vg(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,x._)`${r}.evaluated`),e.if((0,x._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,x._)`${t.evaluated}.props`,(0,x._)`undefined`)),e.if((0,x._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,x._)`${t.evaluated}.items`,(0,x._)`undefined`))}function bl(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,x._)`/*# sourceURL=${r} */`:x.nil}function Bg(t,e){if(Ol(t)&&(Tl(t),Pl(t))){Gg(t,e);return}(0,Sl.boolOrEmptySchema)(t,e)}function Pl({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Ol(t){return typeof t.schema!="boolean"}function Gg(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&xl(t),Jg(t),Yg(t);let i=n.const("_errs",N.default.errors);kl(t,i),n.var(e,(0,x._)`${i} === ${N.default.errors}`)}function Tl(t){(0,ot.checkUnknownRules)(t),Wg(t)}function kl(t,e){if(t.opts.jtd)return vl(t,[],!1,e);let r=(0,wl.getSchemaTypes)(t.schema),n=(0,wl.coerceAndCheckDataType)(t,r);vl(t,r,!n,e)}function Wg(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,ot.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Kg(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ot.checkStrictMode)(t,"default is ignored in the schema root")}function Jg(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Lg.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Yg(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function xl({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,x._)`${N.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,x.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,x._)`${N.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function Qg(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,x._)`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw((0,x._)`new ${s}(${N.default.vErrors})`)):(e.assign((0,x._)`${n}.errors`,N.default.vErrors),i.unevaluated&&Xg(t),e.return((0,x._)`${N.default.errors} === 0`))}function Xg({gen:t,evaluated:e,props:r,items:n}){r instanceof x.Name&&t.assign((0,x._)`${e}.props`,r),n instanceof x.Name&&t.assign((0,x._)`${e}.items`,n)}function vl(t,e,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=t,{RULES:f}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,ot.schemaHasRulesButRef)(i,f))){s.block(()=>Cl(t,"$ref",f.all.$ref.definition));return}c.jtd||Zg(t,e),s.block(()=>{for(let p of f.rules)d(p);d(f.post)});function d(p){(0,vo.shouldUseGroup)(i,p)&&(p.type?(s.if((0,ms.checkDataType)(p.type,o,c.strictNumbers)),El(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,ms.reportTypeError)(t)),s.endIf()):El(t,p),a||s.if((0,x._)`${N.default.errors} === ${n||0}`))}}function El(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Mg.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,vo.shouldUseRule)(n,i)&&Cl(t,i.keyword,i.definition,e.type)})}function Zg(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(e_(t,e),t.opts.allowUnionTypes||t_(t,e),r_(t,t.dataTypes))}function e_(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Rl(t.dataTypes,r)||Eo(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),s_(t,e)}}function t_(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Eo(t,"use allowUnionTypes to allow union type keyword")}function r_(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,vo.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>n_(e,o))&&Eo(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function n_(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Rl(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function s_(t,e){let r=[];for(let n of t.dataTypes)Rl(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Eo(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ot.checkStrictMode)(t,e,t.opts.strictTypes)}var ys=class{constructor(e,r,n){if((0,rn.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ot.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Nl(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,rn.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",N.default.errors))}result(e,r,n){this.failResult((0,x.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,x.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,x._)`${r} !== undefined && (${(0,x.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?tn.reportExtraError:tn.reportError)(this,this.def.error,r)}$dataError(){(0,tn.reportError)(this,this.def.$dataError||tn.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,tn.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=x.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=x.nil,r=x.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,x.or)((0,x._)`${s} === undefined`,r)),e!==x.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==x.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,x.or)(o(),a());function o(){if(n.length){if(!(r instanceof x.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,x._)`${(0,ms.checkDataTypes)(c,r,i.opts.strictNumbers,ms.DataType.Wrong)}`}return x.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,x._)`!${c}(${r})`}return x.nil}}subschema(e,r){let n=(0,bo.getSubschema)(this.it,e);(0,bo.extendSubschemaData)(n,this.it,e),(0,bo.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return Bg(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ot.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=ot.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,x.Name)),!0}};bt.KeywordCxt=ys;function Cl(t,e,r,n){let s=new ys(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,rn.funcKeywordCode)(s,r):"macro"in r?(0,rn.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,rn.funcKeywordCode)(s,r)}var i_=/^\/(?:[^~]|~0|~1)*$/,o_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Nl(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!i_.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=N.default.rootData}else{let l=o_.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+l[1];if(s=l[2],s==="#"){if(f>=e)throw new Error(c("property/index",f));return n[e-f]}if(f>e)throw new Error(c("data",f));if(i=r[e-f],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,x._)`${i}${(0,x.getProperty)((0,ot.unescapeJsonPointer)(l))}`,o=(0,x._)`${o} && ${i}`);return o;function c(l,f){return`Cannot access ${l} ${f} levels up, current level is ${e}`}}bt.getData=Nl});var gs=v($o=>{"use strict";u();Object.defineProperty($o,"__esModule",{value:!0});var So=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};$o.default=So});var sn=v(To=>{"use strict";u();Object.defineProperty(To,"__esModule",{value:!0});var Po=en(),Oo=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Po.resolveUrl)(e,r,n),this.missingSchema=(0,Po.normalizeId)((0,Po.getFullPath)(e,this.missingRef))}};To.default=Oo});var ws=v(Me=>{"use strict";u();Object.defineProperty(Me,"__esModule",{value:!0});Me.resolveSchema=Me.getCompilingSchema=Me.resolveRef=Me.compileSchema=Me.SchemaEnv=void 0;var Be=I(),a_=gs(),Lt=it(),Ge=en(),Al=z(),c_=nn(),dr=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Ge.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Me.SchemaEnv=dr;function xo(t){let e=jl.call(this,t);if(e)return e;let r=(0,Ge.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Be.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:a_.default,code:(0,Be._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Lt.default.data,parentData:Lt.default.parentData,parentDataProperty:Lt.default.parentDataProperty,dataNames:[Lt.default.data],dataPathArr:[Be.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Be.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Be.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Be._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,c_.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();f=`${o.scopeRefs(Lt.default.scope)}return ${d}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let y=new Function(`${Lt.default.self}`,`${Lt.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:y}),y.errors=null,y.schema=t.schema,y.schemaEnv=t,t.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:h}=l;y.evaluated={props:g instanceof Be.Name?void 0:g,items:h instanceof Be.Name?void 0:h,dynamicProps:g instanceof Be.Name,dynamicItems:h instanceof Be.Name},y.source&&(y.source.evaluated=(0,Be.stringify)(y.evaluated))}return t.validate=y,t}catch(d){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),d}finally{this._compilations.delete(t)}}Me.compileSchema=xo;function u_(t,e,r){var n;r=(0,Ge.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=d_.call(this,t,r);if(i===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new dr({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=l_.call(this,i)}Me.resolveRef=u_;function l_(t){return(0,Ge.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:xo.call(this,t)}function jl(t){for(let e of this._compilations)if(f_(e,t))return e}Me.getCompilingSchema=jl;function f_(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function d_(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||_s.call(this,t,e)}function _s(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Ge._getFullPath)(this.opts.uriResolver,r),s=(0,Ge.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return ko.call(this,r,t);let i=(0,Ge.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=_s.call(this,t,o);return typeof a?.schema!="object"?void 0:ko.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||xo.call(this,o),i===(0,Ge.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Ge.resolveUrl)(this.opts.uriResolver,s,l)),new dr({schema:a,schemaId:c,root:t,baseId:s})}return ko.call(this,r,o)}}Me.resolveSchema=_s;var h_=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ko(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Al.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!h_.has(a)&&l&&(e=(0,Ge.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Al.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ge.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=_s.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new dr({schema:r,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var Il=v((BT,p_)=>{p_.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Co=v((GT,Ll)=>{"use strict";u();var m_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Dl=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Ro(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var y_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function ql(t){return t.length=0,!0}function g_(t,e,r){if(t.length){let n=Ro(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function __(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=g_;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(o=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(i=!0),n.push(":");continue}else if(l==="%"){if(!a(s,n,r))break;a=ql}else{s.push(l);continue}}return s.length&&(a===ql?r.zone=s.join(""):o?n.push(s.join("")):n.push(Ro(s))),r.address=n.join(""),r}function Ml(t){if(w_(t,":")<2)return{host:t,isIPV6:!1};let e=__(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function w_(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function b_(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function v_(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function E_(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!Dl(r)){let n=Ml(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}Ll.exports={nonSimpleDomain:y_,recomposeAuthority:E_,normalizeComponentEncoding:v_,removeDotSegments:b_,isIPv4:Dl,isUUID:m_,normalizeIPv6:Ml,stringArrayToHexStripped:Ro}});var Vl=v((KT,Hl)=>{"use strict";u();var{isUUID:S_}=Co(),$_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,P_=["http","https","ws","wss","urn","urn:uuid"];function O_(t){return P_.indexOf(t)!==-1}function No(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Fl(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function zl(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function T_(t){return t.secure=No(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function k_(t){if((t.port===(No(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function x_(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match($_);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=Ao(s);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function R_(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=Ao(s);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function C_(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!S_(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function N_(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Ul={scheme:"http",domainHost:!0,parse:Fl,serialize:zl},A_={scheme:"https",domainHost:Ul.domainHost,parse:Fl,serialize:zl},bs={scheme:"ws",domainHost:!0,parse:T_,serialize:k_},j_={scheme:"wss",domainHost:bs.domainHost,parse:bs.parse,serialize:bs.serialize},I_={scheme:"urn",parse:x_,serialize:R_,skipNormalize:!0},q_={scheme:"urn:uuid",parse:C_,serialize:N_,skipNormalize:!0},vs={http:Ul,https:A_,ws:bs,wss:j_,urn:I_,"urn:uuid":q_};Object.setPrototypeOf(vs,null);function Ao(t){return t&&(vs[t]||vs[t.toLowerCase()])||void 0}Hl.exports={wsIsSecure:No,SCHEMES:vs,isValidSchemeName:O_,getSchemeHandler:Ao}});var Wl=v((YT,Ss)=>{"use strict";u();var{normalizeIPv6:D_,removeDotSegments:on,recomposeAuthority:M_,normalizeComponentEncoding:Es,isIPv4:L_,nonSimpleDomain:F_}=Co(),{SCHEMES:z_,getSchemeHandler:Bl}=Vl();function U_(t,e){return typeof t=="string"?t=et(at(t,e),e):typeof t=="object"&&(t=at(et(t,e),e)),t}function H_(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=Gl(at(t,n),at(e,n),n,!0);return n.skipEscape=!0,et(s,n)}function Gl(t,e,r,n){let s={};return n||(t=at(et(t,r),r),e=at(et(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=on(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=on(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=on(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=on(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function V_(t,e,r){return typeof t=="string"?(t=unescape(t),t=et(Es(at(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=et(Es(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=et(Es(at(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=et(Es(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function et(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],i=Bl(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=M_(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=on(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var B_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function at(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(B_);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(L_(n.host)===!1){let c=D_(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=Bl(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&F_(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var jo={SCHEMES:z_,normalize:U_,resolve:H_,resolveComponent:Gl,equal:V_,serialize:et,parse:at};Ss.exports=jo;Ss.exports.default=jo;Ss.exports.fastUri=jo});var Jl=v(Io=>{"use strict";u();Object.defineProperty(Io,"__esModule",{value:!0});var Kl=Wl();Kl.code='require("ajv/dist/runtime/uri").default';Io.default=Kl});var nf=v(fe=>{"use strict";u();Object.defineProperty(fe,"__esModule",{value:!0});fe.CodeGen=fe.Name=fe.nil=fe.stringify=fe.str=fe._=fe.KeywordCxt=void 0;var G_=nn();Object.defineProperty(fe,"KeywordCxt",{enumerable:!0,get:function(){return G_.KeywordCxt}});var hr=I();Object.defineProperty(fe,"_",{enumerable:!0,get:function(){return hr._}});Object.defineProperty(fe,"str",{enumerable:!0,get:function(){return hr.str}});Object.defineProperty(fe,"stringify",{enumerable:!0,get:function(){return hr.stringify}});Object.defineProperty(fe,"nil",{enumerable:!0,get:function(){return hr.nil}});Object.defineProperty(fe,"Name",{enumerable:!0,get:function(){return hr.Name}});Object.defineProperty(fe,"CodeGen",{enumerable:!0,get:function(){return hr.CodeGen}});var W_=gs(),ef=sn(),K_=uo(),an=ws(),J_=I(),cn=en(),$s=Zr(),Do=z(),Yl=Il(),Y_=Jl(),tf=(t,e)=>new RegExp(t,e);tf.code="new RegExp";var Q_=["removeAdditional","useDefaults","coerceTypes"],X_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Z_={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},ew={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ql=200;function tw(t){var e,r,n,s,i,o,a,c,l,f,d,p,y,g,h,b,w,P,E,S,T,D,C,be,k;let A=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,ie=L===!0||L===void 0?1:L||0,oe=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:tf,ae=(s=t.uriResolver)!==null&&s!==void 0?s:Y_.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:A)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:A)!==null&&c!==void 0?c:!0,strictTypes:(f=(l=t.strictTypes)!==null&&l!==void 0?l:A)!==null&&f!==void 0?f:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:A)!==null&&p!==void 0?p:"log",strictRequired:(g=(y=t.strictRequired)!==null&&y!==void 0?y:A)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:ie,regExp:oe}:{optimize:ie,regExp:oe},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Ql,loopEnum:(b=t.loopEnum)!==null&&b!==void 0?b:Ql,meta:(w=t.meta)!==null&&w!==void 0?w:!0,messages:(P=t.messages)!==null&&P!==void 0?P:!0,inlineRefs:(E=t.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(T=t.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(D=t.validateSchema)!==null&&D!==void 0?D:!0,validateFormats:(C=t.validateFormats)!==null&&C!==void 0?C:!0,unicodeRegExp:(be=t.unicodeRegExp)!==null&&be!==void 0?be:!0,int32range:(k=t.int32range)!==null&&k!==void 0?k:!0,uriResolver:ae}}var un=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...tw(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new J_.ValueScope({scope:{},prefixes:X_,es5:r,lines:n}),this.logger=aw(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,K_.getRules)(),Xl.call(this,Z_,e,"NOT SUPPORTED"),Xl.call(this,ew,e,"DEPRECATED","warn"),this._metaOpts=iw.call(this),e.formats&&nw.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&sw.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rw.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=Yl;n==="id"&&(s={...Yl},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(f,d){await i.call(this,f.$schema);let p=this._addSchema(f,d);return p.validate||o.call(this,p)}async function i(f){f&&!this.getSchema(f)&&await s.call(this,{$ref:f},!0)}async function o(f){try{return this._compileSchemaEnv(f)}catch(d){if(!(d instanceof ef.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,f)}}function a({missingSchema:f,missingRef:d}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${d} cannot be resolved`)}async function c(f){let d=await l.call(this,f);this.refs[f]||await i.call(this,d.$schema),this.refs[f]||this.addSchema(d,f,r)}async function l(f){let d=this._loading[f];if(d)return d;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return r=(0,cn.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=Zl.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new an.SchemaEnv({schema:{},schemaId:n});if(r=an.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Zl.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,cn.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(uw.call(this,n,r),!r)return(0,Do.eachItem)(n,i=>qo.call(this,i)),this;fw.call(this,r);let s={...r,type:(0,$s.getJSONTypes)(r.type),schemaType:(0,$s.getJSONTypes)(r.schemaType)};return(0,Do.eachItem)(n,s.type.length===0?i=>qo.call(this,i,s):i=>s.type.forEach(o=>qo.call(this,i,s,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,f=o[a];l&&f&&(o[a]=rf(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,cn.normalizeId)(o||n);let l=cn.getSchemaRefs.call(this,e,n);return c=new an.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):an.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{an.compileSchema.call(this,e)}finally{this.opts=r}}};un.ValidationError=W_.default;un.MissingRefError=ef.default;fe.default=un;function Xl(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}function Zl(t){return t=(0,cn.normalizeId)(t),this.schemas[t]||this.refs[t]}function rw(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function nw(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function sw(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function iw(){let t={...this.opts};for(let e of Q_)delete t[e];return t}var ow={log(){},warn(){},error(){}};function aw(t){if(t===!1)return ow;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var cw=/^[a-z_$][a-z0-9_$:-]*$/i;function uw(t,e){let{RULES:r}=this;if((0,Do.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!cw.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function qo(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,$s.getJSONTypes)(e.type),schemaType:(0,$s.getJSONTypes)(e.schemaType)}};e.before?lw.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function lw(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function fw(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=rf(e)),t.validateSchema=this.compile(e,!0))}var dw={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function rf(t){return{anyOf:[t,dw]}}});var sf=v(Mo=>{"use strict";u();Object.defineProperty(Mo,"__esModule",{value:!0});var hw={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Mo.default=hw});var uf=v(Ft=>{"use strict";u();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.callRef=Ft.getValidate=void 0;var pw=sn(),of=De(),Ne=I(),pr=it(),af=ws(),Ps=z(),mw={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:l}=i;if((r==="#"||r==="#/")&&s===l.baseId)return d();let f=af.resolveRef.call(c,l,s,r);if(f===void 0)throw new pw.default(n.opts.uriResolver,s,r);if(f instanceof af.SchemaEnv)return p(f);return y(f);function d(){if(i===l)return Os(t,o,i,i.$async);let g=e.scopeValue("root",{ref:l});return Os(t,(0,Ne._)`${g}.validate`,l,l.$async)}function p(g){let h=cf(t,g);Os(t,h,g,g.$async)}function y(g){let h=e.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,Ne.stringify)(g)}:{ref:g}),b=e.name("valid"),w=t.subschema({schema:g,dataTypes:[],schemaPath:Ne.nil,topSchemaRef:h,errSchemaPath:r},b);t.mergeEvaluated(w),t.ok(b)}}};function cf(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ne._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ft.getValidate=cf;function Os(t,e,r,n){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?pr.default.this:Ne.nil;n?f():d();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");let g=s.let("valid");s.try(()=>{s.code((0,Ne._)`await ${(0,of.callValidateCode)(t,e,l)}`),y(e),o||s.assign(g,!0)},h=>{s.if((0,Ne._)`!(${h} instanceof ${i.ValidationError})`,()=>s.throw(h)),p(h),o||s.assign(g,!1)}),t.ok(g)}function d(){t.result((0,of.callValidateCode)(t,e,l),()=>y(e),()=>p(e))}function p(g){let h=(0,Ne._)`${g}.errors`;s.assign(pr.default.vErrors,(0,Ne._)`${pr.default.vErrors} === null ? ${h} : ${pr.default.vErrors}.concat(${h})`),s.assign(pr.default.errors,(0,Ne._)`${pr.default.vErrors}.length`)}function y(g){var h;if(!i.opts.unevaluated)return;let b=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=Ps.mergeEvaluated.props(s,b.props,i.props));else{let w=s.var("props",(0,Ne._)`${g}.evaluated.props`);i.props=Ps.mergeEvaluated.props(s,w,i.props,Ne.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=Ps.mergeEvaluated.items(s,b.items,i.items));else{let w=s.var("items",(0,Ne._)`${g}.evaluated.items`);i.items=Ps.mergeEvaluated.items(s,w,i.items,Ne.Name)}}}Ft.callRef=Os;Ft.default=mw});var lf=v(Lo=>{"use strict";u();Object.defineProperty(Lo,"__esModule",{value:!0});var yw=sf(),gw=uf(),_w=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yw.default,gw.default];Lo.default=_w});var ff=v(Fo=>{"use strict";u();Object.defineProperty(Fo,"__esModule",{value:!0});var Ts=I(),vt=Ts.operators,ks={maximum:{okStr:"<=",ok:vt.LTE,fail:vt.GT},minimum:{okStr:">=",ok:vt.GTE,fail:vt.LT},exclusiveMaximum:{okStr:"<",ok:vt.LT,fail:vt.GTE},exclusiveMinimum:{okStr:">",ok:vt.GT,fail:vt.LTE}},ww={message:({keyword:t,schemaCode:e})=>(0,Ts.str)`must be ${ks[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ts._)`{comparison: ${ks[t].okStr}, limit: ${e}}`},bw={keyword:Object.keys(ks),type:"number",schemaType:"number",$data:!0,error:ww,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Ts._)`${r} ${ks[e].fail} ${n} || isNaN(${r})`)}};Fo.default=bw});var df=v(zo=>{"use strict";u();Object.defineProperty(zo,"__esModule",{value:!0});var ln=I(),vw={message:({schemaCode:t})=>(0,ln.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ln._)`{multipleOf: ${t}}`},Ew={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vw,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,ln._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,ln._)`${o} !== parseInt(${o})`;t.fail$data((0,ln._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};zo.default=Ew});var pf=v(Uo=>{"use strict";u();Object.defineProperty(Uo,"__esModule",{value:!0});function hf(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Uo.default=hf;hf.code='require("ajv/dist/runtime/ucs2length").default'});var mf=v(Ho=>{"use strict";u();Object.defineProperty(Ho,"__esModule",{value:!0});var zt=I(),Sw=z(),$w=pf(),Pw={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,zt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,zt._)`{limit: ${t}}`},Ow={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Pw,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?zt.operators.GT:zt.operators.LT,o=s.opts.unicode===!1?(0,zt._)`${r}.length`:(0,zt._)`${(0,Sw.useFunc)(t.gen,$w.default)}(${r})`;t.fail$data((0,zt._)`${o} ${i} ${n}`)}};Ho.default=Ow});var yf=v(Vo=>{"use strict";u();Object.defineProperty(Vo,"__esModule",{value:!0});var Tw=De(),kw=z(),mr=I(),xw={message:({schemaCode:t})=>(0,mr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,mr._)`{pattern: ${t}}`},Rw={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xw,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?(0,mr._)`new RegExp`:(0,kw.useFunc)(e,c),f=e.let("valid");e.try(()=>e.assign(f,(0,mr._)`${l}(${i}, ${a}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,mr._)`!${f}`)}else{let c=(0,Tw.usePattern)(t,s);t.fail$data((0,mr._)`!${c}.test(${r})`)}}};Vo.default=Rw});var gf=v(Bo=>{"use strict";u();Object.defineProperty(Bo,"__esModule",{value:!0});var fn=I(),Cw={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,fn.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,fn._)`{limit: ${t}}`},Nw={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Cw,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?fn.operators.GT:fn.operators.LT;t.fail$data((0,fn._)`Object.keys(${r}).length ${s} ${n}`)}};Bo.default=Nw});var _f=v(Go=>{"use strict";u();Object.defineProperty(Go,"__esModule",{value:!0});var dn=De(),hn=I(),Aw=z(),jw={message:({params:{missingProperty:t}})=>(0,hn.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,hn._)`{missingProperty: ${t}}`},Iw={keyword:"required",type:"object",schemaType:"array",$data:!0,error:jw,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():f(),a.strictRequired){let y=t.parentSchema.properties,{definedProperties:g}=t.it;for(let h of r)if(y?.[h]===void 0&&!g.has(h)){let b=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${h}" is not defined at "${b}" (strictRequired)`;(0,Aw.checkStrictMode)(o,w,o.opts.strictRequired)}}function l(){if(c||i)t.block$data(hn.nil,d);else for(let y of r)(0,dn.checkReportMissingProp)(t,y)}function f(){let y=e.let("missing");if(c||i){let g=e.let("valid",!0);t.block$data(g,()=>p(y,g)),t.ok(g)}else e.if((0,dn.checkMissingProp)(t,r,y)),(0,dn.reportMissingProp)(t,y),e.else()}function d(){e.forOf("prop",n,y=>{t.setParams({missingProperty:y}),e.if((0,dn.noPropertyInData)(e,s,y,a.ownProperties),()=>t.error())})}function p(y,g){t.setParams({missingProperty:y}),e.forOf(y,n,()=>{e.assign(g,(0,dn.propertyInData)(e,s,y,a.ownProperties)),e.if((0,hn.not)(g),()=>{t.error(),e.break()})},hn.nil)}}};Go.default=Iw});var wf=v(Wo=>{"use strict";u();Object.defineProperty(Wo,"__esModule",{value:!0});var pn=I(),qw={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,pn.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,pn._)`{limit: ${t}}`},Dw={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:qw,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?pn.operators.GT:pn.operators.LT;t.fail$data((0,pn._)`${r}.length ${s} ${n}`)}};Wo.default=Dw});var xs=v(Ko=>{"use strict";u();Object.defineProperty(Ko,"__esModule",{value:!0});var bf=_o();bf.code='require("ajv/dist/runtime/equal").default';Ko.default=bf});var vf=v(Yo=>{"use strict";u();Object.defineProperty(Yo,"__esModule",{value:!0});var Jo=Zr(),de=I(),Mw=z(),Lw=xs(),Fw={message:({params:{i:t,j:e}})=>(0,de.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,de._)`{i: ${t}, j: ${e}}`},zw={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Fw,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!n&&!s)return;let c=e.let("valid"),l=i.items?(0,Jo.getSchemaTypes)(i.items):[];t.block$data(c,f,(0,de._)`${o} === false`),t.ok(c);function f(){let g=e.let("i",(0,de._)`${r}.length`),h=e.let("j");t.setParams({i:g,j:h}),e.assign(c,!0),e.if((0,de._)`${g} > 1`,()=>(d()?p:y)(g,h))}function d(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}function p(g,h){let b=e.name("item"),w=(0,Jo.checkDataTypes)(l,b,a.opts.strictNumbers,Jo.DataType.Wrong),P=e.const("indices",(0,de._)`{}`);e.for((0,de._)`;${g}--;`,()=>{e.let(b,(0,de._)`${r}[${g}]`),e.if(w,(0,de._)`continue`),l.length>1&&e.if((0,de._)`typeof ${b} == "string"`,(0,de._)`${b} += "_"`),e.if((0,de._)`typeof ${P}[${b}] == "number"`,()=>{e.assign(h,(0,de._)`${P}[${b}]`),t.error(),e.assign(c,!1).break()}).code((0,de._)`${P}[${b}] = ${g}`)})}function y(g,h){let b=(0,Mw.useFunc)(e,Lw.default),w=e.name("outer");e.label(w).for((0,de._)`;${g}--;`,()=>e.for((0,de._)`${h} = ${g}; ${h}--;`,()=>e.if((0,de._)`${b}(${r}[${g}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(w)})))}}};Yo.default=zw});var Ef=v(Xo=>{"use strict";u();Object.defineProperty(Xo,"__esModule",{value:!0});var Qo=I(),Uw=z(),Hw=xs(),Vw={message:"must be equal to constant",params:({schemaCode:t})=>(0,Qo._)`{allowedValue: ${t}}`},Bw={keyword:"const",$data:!0,error:Vw,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Qo._)`!${(0,Uw.useFunc)(e,Hw.default)}(${r}, ${s})`):t.fail((0,Qo._)`${i} !== ${r}`)}};Xo.default=Bw});var Sf=v(Zo=>{"use strict";u();Object.defineProperty(Zo,"__esModule",{value:!0});var mn=I(),Gw=z(),Ww=xs(),Kw={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,mn._)`{allowedValues: ${t}}`},Jw={keyword:"enum",schemaType:"array",$data:!0,error:Kw,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,Gw.useFunc)(e,Ww.default)),f;if(a||n)f=e.let("valid"),t.block$data(f,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let y=e.const("vSchema",i);f=(0,mn.or)(...s.map((g,h)=>p(y,h)))}t.pass(f);function d(){e.assign(f,!1),e.forOf("v",i,y=>e.if((0,mn._)`${l()}(${r}, ${y})`,()=>e.assign(f,!0).break()))}function p(y,g){let h=s[g];return typeof h=="object"&&h!==null?(0,mn._)`${l()}(${r}, ${y}[${g}])`:(0,mn._)`${r} === ${h}`}}};Zo.default=Jw});var $f=v(ea=>{"use strict";u();Object.defineProperty(ea,"__esModule",{value:!0});var Yw=ff(),Qw=df(),Xw=mf(),Zw=yf(),eb=gf(),tb=_f(),rb=wf(),nb=vf(),sb=Ef(),ib=Sf(),ob=[Yw.default,Qw.default,Xw.default,Zw.default,eb.default,tb.default,rb.default,nb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},sb.default,ib.default];ea.default=ob});var ra=v(yn=>{"use strict";u();Object.defineProperty(yn,"__esModule",{value:!0});yn.validateAdditionalItems=void 0;var Ut=I(),ta=z(),ab={message:({params:{len:t}})=>(0,Ut.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ut._)`{limit: ${t}}`},cb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ab,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,ta.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Pf(t,n)}};function Pf(t,e){let{gen:r,schema:n,data:s,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,Ut._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ut._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,ta.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,Ut._)`${a} <= ${e.length}`);r.if((0,Ut.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,f=>{t.subschema({keyword:i,dataProp:f,dataPropType:ta.Type.Num},l),o.allErrors||r.if((0,Ut.not)(l),()=>r.break())})}}yn.validateAdditionalItems=Pf;yn.default=cb});var na=v(gn=>{"use strict";u();Object.defineProperty(gn,"__esModule",{value:!0});gn.validateTuple=void 0;var Of=I(),Rs=z(),ub=De(),lb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Tf(t,"additionalItems",e);r.items=!0,!(0,Rs.alwaysValidSchema)(r,e)&&t.ok((0,ub.validateArray)(t))}};function Tf(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=t;f(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Rs.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,Of._)`${i}.length`);r.forEach((d,p)=>{(0,Rs.alwaysValidSchema)(a,d)||(n.if((0,Of._)`${l} > ${p}`,()=>t.subschema({keyword:o,schemaProp:p,dataProp:p},c)),t.ok(c))});function f(d){let{opts:p,errSchemaPath:y}=a,g=r.length,h=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let b=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${y}"`;(0,Rs.checkStrictMode)(a,b,p.strictTuples)}}}gn.validateTuple=Tf;gn.default=lb});var kf=v(sa=>{"use strict";u();Object.defineProperty(sa,"__esModule",{value:!0});var fb=na(),db={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,fb.validateTuple)(t,"items")};sa.default=db});var Rf=v(ia=>{"use strict";u();Object.defineProperty(ia,"__esModule",{value:!0});var xf=I(),hb=z(),pb=De(),mb=ra(),yb={message:({params:{len:t}})=>(0,xf.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,xf._)`{limit: ${t}}`},gb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:yb,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,hb.alwaysValidSchema)(n,e)&&(s?(0,mb.validateAdditionalItems)(t,s):t.ok((0,pb.validateArray)(t)))}};ia.default=gb});var Cf=v(oa=>{"use strict";u();Object.defineProperty(oa,"__esModule",{value:!0});var Le=I(),Cs=z(),_b={message:({params:{min:t,max:e}})=>e===void 0?(0,Le.str)`must contain at least ${t} valid item(s)`:(0,Le.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Le._)`{minContains: ${t}}`:(0,Le._)`{minContains: ${t}, maxContains: ${e}}`},wb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:_b,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,o,a,{minContains:c,maxContains:l}=n;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let f=e.const("len",(0,Le._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,Cs.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Cs.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Cs.alwaysValidSchema)(i,r)){let h=(0,Le._)`${f} >= ${o}`;a!==void 0&&(h=(0,Le._)`${h} && ${f} <= ${a}`),t.pass(h);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?y(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,Le._)`${s}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),b=e.let("count",0);y(h,()=>e.if(h,()=>g(b)))}function y(h,b){e.forRange("i",0,f,w=>{t.subschema({keyword:"contains",dataProp:w,dataPropType:Cs.Type.Num,compositeRule:!0},h),b()})}function g(h){e.code((0,Le._)`${h}++`),a===void 0?e.if((0,Le._)`${h} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Le._)`${h} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Le._)`${h} >= ${o}`,()=>e.assign(d,!0)))}}};oa.default=wb});var jf=v(tt=>{"use strict";u();Object.defineProperty(tt,"__esModule",{value:!0});tt.validateSchemaDeps=tt.validatePropertyDeps=tt.error=void 0;var aa=I(),bb=z(),_n=De();tt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,aa.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,aa._)`{property: ${t},
6
6
  missingProperty: ${n},
7
7
  depsCount: ${e},
8
- deps: ${r}}`};var wb={keyword:"dependencies",type:"object",schemaType:"object",error:tt.error,code(t){let[e,r]=bb(t);Cf(t,e),Nf(t,r)}};function bb({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Cf(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,_n.propertyInData)(r,n,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(c,()=>{for(let l of a)(0,_n.checkReportMissingProp)(t,l)}):(r.if((0,oa._)`${c} && (${(0,_n.checkMissingProp)(t,a,i)})`),(0,_n.reportMissingProp)(t,i),r.else())}}tt.validatePropertyDeps=Cf;function Nf(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,o=r.name("valid");for(let a in e)(0,_b.alwaysValidSchema)(i,e[a])||(r.if((0,_n.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}tt.validateSchemaDeps=Nf;tt.default=wb});var If=v(aa=>{"use strict";u();Object.defineProperty(aa,"__esModule",{value:!0});var jf=I(),vb=z(),Eb={message:"property name must be valid",params:({params:t})=>(0,jf._)`{propertyName: ${t.propertyName}}`},Sb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Eb,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,vb.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,jf.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};aa.default=Sb});var ua=v(ca=>{"use strict";u();Object.defineProperty(ca,"__esModule",{value:!0});var Cs=De(),We=I(),$b=it(),Ns=z(),Pb={message:"must NOT have additional properties",params:({params:t})=>(0,We._)`{additionalProperty: ${t.additionalProperty}}`},Ob={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Pb,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Ns.alwaysValidSchema)(o,r))return;let l=(0,Cs.allSchemaProperties)(n.properties),f=(0,Cs.allSchemaProperties)(n.patternProperties);d(),t.ok((0,We._)`${i} === ${$b.default.errors}`);function d(){e.forIn("key",s,b=>{!l.length&&!f.length?g(b):e.if(p(b),()=>g(b))})}function p(b){let w;if(l.length>8){let P=(0,Ns.schemaRefOrVal)(o,n.properties,"properties");w=(0,Cs.isOwnProperty)(e,P,b)}else l.length?w=(0,We.or)(...l.map(P=>(0,We._)`${b} === ${P}`)):w=We.nil;return f.length&&(w=(0,We.or)(w,...f.map(P=>(0,We._)`${(0,Cs.usePattern)(t,P)}.test(${b})`))),(0,We.not)(w)}function y(b){e.code((0,We._)`delete ${s}[${b}]`)}function g(b){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){y(b);return}if(r===!1){t.setParams({additionalProperty:b}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Ns.alwaysValidSchema)(o,r)){let w=e.name("valid");c.removeAdditional==="failing"?(h(b,w,!1),e.if((0,We.not)(w),()=>{t.reset(),y(b)})):(h(b,w),a||e.if((0,We.not)(w),()=>e.break()))}}function h(b,w,P){let E={keyword:"additionalProperties",dataProp:b,dataPropType:Ns.Type.Str};P===!1&&Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(E,w)}}};ca.default=Ob});var Mf=v(fa=>{"use strict";u();Object.defineProperty(fa,"__esModule",{value:!0});var Tb=nn(),qf=De(),la=z(),Df=ua(),kb={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Df.default.code(new Tb.KeywordCxt(i,Df.default,"additionalProperties"));let o=(0,qf.allSchemaProperties)(r);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=la.mergeEvaluated.props(e,(0,la.toHash)(o),i.props));let a=o.filter(d=>!(0,la.alwaysValidSchema)(i,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?f(d):(e.if((0,qf.propertyInData)(e,s,d,i.opts.ownProperties)),f(d),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function f(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};fa.default=kb});var Uf=v(da=>{"use strict";u();Object.defineProperty(da,"__esModule",{value:!0});var Lf=De(),As=I(),Ff=z(),zf=z(),xb={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,Lf.allSchemaProperties)(r),c=a.filter(h=>(0,Ff.alwaysValidSchema)(i,r[h]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,f=e.name("valid");i.props!==!0&&!(i.props instanceof As.Name)&&(i.props=(0,zf.evaluatedPropsToName)(e,i.props));let{props:d}=i;p();function p(){for(let h of a)l&&y(h),i.allErrors?g(h):(e.var(f,!0),g(h),e.if(f))}function y(h){for(let b in l)new RegExp(h).test(b)&&(0,Ff.checkStrictMode)(i,`property ${b} matches pattern ${h} (use allowMatchingProperties)`)}function g(h){e.forIn("key",n,b=>{e.if((0,As._)`${(0,Lf.usePattern)(t,h)}.test(${b})`,()=>{let w=c.includes(h);w||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:b,dataPropType:zf.Type.Str},f),i.opts.unevaluated&&d!==!0?e.assign((0,As._)`${d}[${b}]`,!0):!w&&!i.allErrors&&e.if((0,As.not)(f),()=>e.break())})})}}};da.default=xb});var Hf=v(ha=>{"use strict";u();Object.defineProperty(ha,"__esModule",{value:!0});var Rb=z(),Cb={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Rb.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};ha.default=Cb});var Vf=v(pa=>{"use strict";u();Object.defineProperty(pa,"__esModule",{value:!0});var Nb=De(),Ab={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Nb.validateUnion,error:{message:"must match a schema in anyOf"}};pa.default=Ab});var Bf=v(ma=>{"use strict";u();Object.defineProperty(ma,"__esModule",{value:!0});var js=I(),jb=z(),Ib={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,js._)`{passingSchemas: ${t.passing}}`},qb={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ib,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){i.forEach((f,d)=>{let p;(0,jb.alwaysValidSchema)(s,f)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,js._)`${c} && ${o}`).assign(o,!1).assign(a,(0,js._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),p&&t.mergeEvaluated(p,js.Name)})})}}};ma.default=qb});var Gf=v(ya=>{"use strict";u();Object.defineProperty(ya,"__esModule",{value:!0});var Db=z(),Mb={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,o)=>{if((0,Db.alwaysValidSchema)(n,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};ya.default=Mb});var Jf=v(ga=>{"use strict";u();Object.defineProperty(ga,"__esModule",{value:!0});var Is=I(),Kf=z(),Lb={message:({params:t})=>(0,Is.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Is._)`{failingKeyword: ${t.ifClause}}`},Fb={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Lb,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Kf.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Wf(n,"then"),i=Wf(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),s&&i){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(a,l("then",f),l("else",f))}else s?e.if(a,l("then")):e.if((0,Is.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(f)}function l(f,d){return()=>{let p=t.subschema({keyword:f},a);e.assign(o,a),t.mergeValidEvaluated(p,o),d?e.assign(d,(0,Is._)`${f}`):t.setParams({ifClause:f})}}}};function Wf(t,e){let r=t.schema[e];return r!==void 0&&!(0,Kf.alwaysValidSchema)(t,r)}ga.default=Fb});var Yf=v(_a=>{"use strict";u();Object.defineProperty(_a,"__esModule",{value:!0});var zb=z(),Ub={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,zb.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};_a.default=Ub});var Qf=v(wa=>{"use strict";u();Object.defineProperty(wa,"__esModule",{value:!0});var Hb=ta(),Vb=Tf(),Bb=ra(),Gb=xf(),Wb=Rf(),Kb=Af(),Jb=If(),Yb=ua(),Qb=Mf(),Xb=Uf(),Zb=Hf(),e0=Vf(),t0=Bf(),r0=Gf(),n0=Jf(),s0=Yf();function i0(t=!1){let e=[Zb.default,e0.default,t0.default,r0.default,n0.default,s0.default,Jb.default,Yb.default,Kb.default,Qb.default,Xb.default];return t?e.push(Vb.default,Gb.default):e.push(Hb.default,Bb.default),e.push(Wb.default),e}wa.default=i0});var Xf=v(ba=>{"use strict";u();Object.defineProperty(ba,"__esModule",{value:!0});var se=I(),o0={message:({schemaCode:t})=>(0,se.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,se._)`{format: ${t}}`},a0={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:o0,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:f,self:d}=a;if(!c.validateFormats)return;s?p():y();function p(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,se._)`${g}[${o}]`),b=r.let("fType"),w=r.let("format");r.if((0,se._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(b,(0,se._)`${h}.type || "string"`).assign(w,(0,se._)`${h}.validate`),()=>r.assign(b,(0,se._)`"string"`).assign(w,h)),t.fail$data((0,se.or)(P(),E()));function P(){return c.strictSchema===!1?se.nil:(0,se._)`${o} && !${w}`}function E(){let S=f.$async?(0,se._)`(${h}.async ? await ${w}(${n}) : ${w}(${n}))`:(0,se._)`${w}(${n})`,T=(0,se._)`(typeof ${w} == "function" ? ${S} : ${w}.test(${n}))`;return(0,se._)`${w} && ${w} !== true && ${b} === ${e} && !${T}`}}function y(){let g=d.formats[i];if(!g){P();return}if(g===!0)return;let[h,b,w]=E(g);h===e&&t.pass(S());function P(){if(c.strictSchema===!1){d.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function E(T){let D=T instanceof RegExp?(0,se.regexpCode)(T):c.code.formats?(0,se._)`${c.code.formats}${(0,se.getProperty)(i)}`:void 0,C=r.scopeValue("formats",{key:i,ref:T,code:D});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,se._)`${C}.validate`]:["string",T,C]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!f.$async)throw new Error("async format in sync schema");return(0,se._)`await ${w}(${n})`}return typeof b=="function"?(0,se._)`${w}(${n})`:(0,se._)`${w}.test(${n})`}}}};ba.default=a0});var Zf=v(va=>{"use strict";u();Object.defineProperty(va,"__esModule",{value:!0});var c0=Xf(),u0=[c0.default];va.default=u0});var ed=v(yr=>{"use strict";u();Object.defineProperty(yr,"__esModule",{value:!0});yr.contentVocabulary=yr.metadataVocabulary=void 0;yr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];yr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var rd=v(Ea=>{"use strict";u();Object.defineProperty(Ea,"__esModule",{value:!0});var l0=uf(),f0=Sf(),d0=Qf(),h0=Zf(),td=ed(),p0=[l0.default,f0.default,(0,d0.default)(),h0.default,td.metadataVocabulary,td.contentVocabulary];Ea.default=p0});var sd=v(qs=>{"use strict";u();Object.defineProperty(qs,"__esModule",{value:!0});qs.DiscrError=void 0;var nd;(function(t){t.Tag="tag",t.Mapping="mapping"})(nd||(qs.DiscrError=nd={}))});var od=v($a=>{"use strict";u();Object.defineProperty($a,"__esModule",{value:!0});var gr=I(),Sa=sd(),id=_s(),m0=sn(),y0=z(),g0={message:({params:{discrError:t,tagName:e}})=>t===Sa.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,gr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},_0={keyword:"discriminator",type:"object",schemaType:"object",error:g0,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,gr._)`${r}${(0,gr.getProperty)(a)}`);e.if((0,gr._)`typeof ${l} == "string"`,()=>f(),()=>t.error(!1,{discrError:Sa.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function f(){let y=p();e.if(!1);for(let g in y)e.elseIf((0,gr._)`${l} === ${g}`),e.assign(c,d(y[g]));e.else(),t.error(!1,{discrError:Sa.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(y){let g=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:y},g);return t.mergeEvaluated(h,gr.Name),g}function p(){var y;let g={},h=w(s),b=!0;for(let S=0;S<o.length;S++){let T=o[S];if(T?.$ref&&!(0,y0.schemaHasRulesButRef)(T,i.self.RULES)){let C=T.$ref;if(T=id.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,C),T instanceof id.SchemaEnv&&(T=T.schema),T===void 0)throw new m0.default(i.opts.uriResolver,i.baseId,C)}let D=(y=T?.properties)===null||y===void 0?void 0:y[a];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);b=b&&(h||w(T)),P(D,S)}if(!b)throw new Error(`discriminator: "${a}" must be required`);return g;function w({required:S}){return Array.isArray(S)&&S.includes(a)}function P(S,T){if(S.const)E(S.const,T);else if(S.enum)for(let D of S.enum)E(D,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function E(S,T){if(typeof S!="string"||S in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[S]=T}}}};$a.default=_0});var ad=v((Ex,w0)=>{w0.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Oa=v((Y,Pa)=>{"use strict";u();Object.defineProperty(Y,"__esModule",{value:!0});Y.MissingRefError=Y.ValidationError=Y.CodeGen=Y.Name=Y.nil=Y.stringify=Y.str=Y._=Y.KeywordCxt=Y.Ajv=void 0;var b0=rf(),v0=rd(),E0=od(),cd=ad(),S0=["/properties"],Ds="http://json-schema.org/draft-07/schema",_r=class extends b0.default{_addVocabularies(){super._addVocabularies(),v0.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(E0.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(cd,S0):cd;this.addMetaSchema(e,Ds,!1),this.refs["http://json-schema.org/schema"]=Ds}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ds)?Ds:void 0)}};Y.Ajv=_r;Pa.exports=Y=_r;Pa.exports.Ajv=_r;Object.defineProperty(Y,"__esModule",{value:!0});Y.default=_r;var $0=nn();Object.defineProperty(Y,"KeywordCxt",{enumerable:!0,get:function(){return $0.KeywordCxt}});var wr=I();Object.defineProperty(Y,"_",{enumerable:!0,get:function(){return wr._}});Object.defineProperty(Y,"str",{enumerable:!0,get:function(){return wr.str}});Object.defineProperty(Y,"stringify",{enumerable:!0,get:function(){return wr.stringify}});Object.defineProperty(Y,"nil",{enumerable:!0,get:function(){return wr.nil}});Object.defineProperty(Y,"Name",{enumerable:!0,get:function(){return wr.Name}});Object.defineProperty(Y,"CodeGen",{enumerable:!0,get:function(){return wr.CodeGen}});var P0=ys();Object.defineProperty(Y,"ValidationError",{enumerable:!0,get:function(){return P0.default}});var O0=sn();Object.defineProperty(Y,"MissingRefError",{enumerable:!0,get:function(){return O0.default}})});var pd=v(rt=>{"use strict";u();Object.defineProperty(rt,"__esModule",{value:!0});rt.formatNames=rt.fastFormats=rt.fullFormats=void 0;function br(t,e){return{validate:t,compare:e}}rt.fullFormats={date:br(fd,xa),time:br(dd,Ra),"date-time":br(R0,hd),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:A0,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F0,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j0,int32:{type:"number",validate:D0},int64:{type:"number",validate:M0},float:{type:"number",validate:ld},double:{type:"number",validate:ld},password:!0,binary:!0};rt.fastFormats={...rt.fullFormats,date:br(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xa),time:br(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ra),"date-time":br(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,hd),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};rt.formatNames=Object.keys(rt.fullFormats);function T0(t){return t%4===0&&(t%100!==0||t%400===0)}var k0=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,x0=[0,31,28,31,30,31,30,31,31,30,31,30,31];function fd(t){let e=k0.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&T0(r)?29:x0[n])}function xa(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Ta=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function dd(t,e){let r=Ta.exec(t);if(!r)return!1;let n=+r[1],s=+r[2],i=+r[3],o=r[5];return(n<=23&&s<=59&&i<=59||n===23&&s===59&&i===60)&&(!e||o!=="")}function Ra(t,e){if(!(t&&e))return;let r=Ta.exec(t),n=Ta.exec(e);if(r&&n)return t=r[1]+r[2]+r[3]+(r[4]||""),e=n[1]+n[2]+n[3]+(n[4]||""),t>e?1:t<e?-1:0}var ka=/t|\s/i;function R0(t){let e=t.split(ka);return e.length===2&&fd(e[0])&&dd(e[1],!0)}function hd(t,e){if(!(t&&e))return;let[r,n]=t.split(ka),[s,i]=e.split(ka),o=xa(r,s);if(o!==void 0)return o||Ra(n,i)}var C0=/\/|:/,N0=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function A0(t){return C0.test(t)&&N0.test(t)}var ud=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j0(t){return ud.lastIndex=0,ud.test(t)}var I0=-(2**31),q0=2**31-1;function D0(t){return Number.isInteger(t)&&t<=q0&&t>=I0}function M0(t){return Number.isInteger(t)}function ld(){return!0}var L0=/[^\\]\\Z/;function F0(t){if(L0.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var md=v(vr=>{"use strict";u();Object.defineProperty(vr,"__esModule",{value:!0});vr.formatLimitDefinition=void 0;var z0=Oa(),Ke=I(),Et=Ke.operators,Ms={formatMaximum:{okStr:"<=",ok:Et.LTE,fail:Et.GT},formatMinimum:{okStr:">=",ok:Et.GTE,fail:Et.LT},formatExclusiveMaximum:{okStr:"<",ok:Et.LT,fail:Et.GTE},formatExclusiveMinimum:{okStr:">",ok:Et.GT,fail:Et.LTE}},U0={message:({keyword:t,schemaCode:e})=>Ke.str`should be ${Ms[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Ke._`{comparison: ${Ms[t].okStr}, limit: ${e}}`};vr.formatLimitDefinition={keyword:Object.keys(Ms),type:"string",schemaType:"string",$data:!0,error:U0,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let c=new z0.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?l():f();function l(){let p=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),y=e.const("fmt",Ke._`${p}[${c.schemaCode}]`);t.fail$data(Ke.or(Ke._`typeof ${y} != "object"`,Ke._`${y} instanceof RegExp`,Ke._`typeof ${y}.compare != "function"`,d(y)))}function f(){let p=c.schema,y=a.formats[p];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${s}": format "${p}" does not define "compare" function`);let g=e.scopeValue("formats",{key:p,ref:y,code:o.code.formats?Ke._`${o.code.formats}${Ke.getProperty(p)}`:void 0});t.fail$data(d(g))}function d(p){return Ke._`${p}.compare(${r}, ${n}) ${Ms[s].fail} 0`}},dependencies:["format"]};var H0=t=>(t.addKeyword(vr.formatLimitDefinition),t);vr.default=H0});var wd=v((wn,_d)=>{"use strict";u();Object.defineProperty(wn,"__esModule",{value:!0});var Er=pd(),V0=md(),Ca=I(),yd=new Ca.Name("fullFormats"),B0=new Ca.Name("fastFormats"),Na=(t,e={keywords:!0})=>{if(Array.isArray(e))return gd(t,e,Er.fullFormats,yd),t;let[r,n]=e.mode==="fast"?[Er.fastFormats,B0]:[Er.fullFormats,yd],s=e.formats||Er.formatNames;return gd(t,s,r,n),e.keywords&&V0.default(t),t};Na.get=(t,e="full")=>{let n=(e==="fast"?Er.fastFormats:Er.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function gd(t,e,r,n){var s,i;(s=(i=t.opts.code).formats)!==null&&s!==void 0||(i.formats=Ca._`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}_d.exports=wn=Na;Object.defineProperty(wn,"__esModule",{value:!0});wn.default=Na});var Rd=v((Ua,Ha)=>{"use strict";u();Object.defineProperty(Ua,"__esModule",{value:!0});function pv(t){return t.encrypted}var za=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let n=typeof r.connect=="function",s=typeof r.secureConnect=="function",i=typeof r.close=="function",o=()=>{n&&r.connect(),pv(t)&&s&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),i&&t.once("close",r.close)};t.writable&&!t.connecting?o():t.connecting?t.once("connect",o):t.destroyed&&i&&r.close(t._hadError)};Ua.default=za;Ha.exports=za;Ha.exports.default=za});var jd=v((AR,Ad)=>{"use strict";u();var Sv=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),$v=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),Pv=new Set([500,502,503,504]),Ov={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},Tv={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function ct(t){let e=parseInt(t,10);return isFinite(e)?e:0}function kv(t){return t?Pv.has(t.status):!0}function Ga(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[s,i]=n.split(/=/,2);e[s.trim()]=i===void 0?!0:i.trim().replace(/^"|"$/g,"")}return e}function xv(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}Ad.exports=class{constructor(e,r,{shared:n,cacheHeuristic:s,immutableMinTimeToLive:i,ignoreCargoCult:o,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._ignoreCargoCult=!!o,this._cacheHeuristic=s!==void 0?s:.1,this._immutableMinTtl=i!==void 0?i:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=Ga(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=Ga(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":xv(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&$v.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||Sv.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,r){return{synchronous:r,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let r=Ga(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):r["max-age"]&&this.age()>ct(r["max-age"])?this._evaluateRequestMissResult(e):r["min-fresh"]&&this.maxAge()-this.age()<ct(r["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in r&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,r){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)Ov[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let s of n)delete r[s]}if(r.warning){let n=r.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return ct(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return ct(this._rescc["s-maxage"])}if(this._rescc["max-age"])return ct(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<r?0:Math.max(e,(n-r)/1e3)}if(this._resHeaders["last-modified"]){let n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&r>n)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+ct(this._rescc["stale-if-error"]),n=e+ct(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,r,n)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+ct(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=ct(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let s=r["if-none-match"].split(/,/).filter(i=>!/^\s*W\//.test(i));s.length?r["if-none-match"]=s.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&kv(r))return{policy:this,modified:!1,matches:!0};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!n)return{policy:new this.constructor(e,r,s),modified:r.status!=304,matches:!1};let i={};for(let a in this._resHeaders)i[a]=a in r.headers&&!Tv[a]?r.headers[a]:this._resHeaders[a];let o=Object.assign({},r,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,o,s),modified:!1,matches:!0}}}});var Id=v(Wa=>{u();Wa.stringify=function t(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",n=Array.isArray(e);r=n?"[":"{";var s=!0;for(var i in e){var o=typeof e[i]=="function"||!n&&typeof e[i]>"u";Object.hasOwnProperty.call(e,i)&&!o&&(s||(r+=","),s=!1,n?e[i]==null?r+="null":r+=t(e[i]):e[i]!==void 0&&(r+=t(i)+":"+t(e[i])))}return r+=n?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};Wa.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var Ld=v((HR,Md)=>{"use strict";u();var Cv=R("events"),qd=Id(),Nv=t=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(R(e[r]))(t)}return new Map},Dd=["sqlite","postgres","mysql","mongo","redis","tiered"],Ka=class extends Cv{constructor(e,{emitErrors:r=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:qd.stringify,deserialize:qd.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){let i={...this.opts};this.opts.store=Nv(i)}if(this.opts.compression){let i=this.opts.compression;this.opts.serialize=i.serialize.bind(i),this.opts.deserialize=i.deserialize.bind(i)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",i=>this.emit("error",i)),this.opts.store.namespace=this.opts.namespace;let s=i=>async function*(){for await(let[o,a]of typeof i=="function"?i(this.opts.store.namespace):i){let c=await this.opts.deserialize(a);if(!(this.opts.store.namespace&&!o.includes(this.opts.store.namespace))){if(typeof c.expires=="number"&&Date.now()>c.expires){this.delete(o);continue}yield[this._getKeyUnprefix(o),c.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=s(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=s(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return Dd.includes(this.opts.store.opts.dialect)||Dd.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){let{store:n}=this.opts,s=Array.isArray(e),i=s?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(s&&n.getMany===void 0){let o=[];for(let a of i)o.push(Promise.resolve().then(()=>n.get(a)).then(c=>typeof c=="string"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(a).then(()=>{}):r&&r.raw?c:c.value}));return Promise.allSettled(o).then(a=>{let c=[];for(let l of a)c.push(l.value);return c})}return Promise.resolve().then(()=>s?n.getMany(i):n.get(i)).then(o=>typeof o=="string"?this.opts.deserialize(o):this.opts.compression?this.opts.deserialize(o):o).then(o=>{if(o!=null)return s?o.map((a,c)=>{if(typeof a=="string"&&(a=this.opts.deserialize(a)),a!=null){if(typeof a.expires=="number"&&Date.now()>a.expires){this.delete(e[c]).then(()=>{});return}return r&&r.raw?a:a.value}}):typeof o.expires=="number"&&Date.now()>o.expires?this.delete(e).then(()=>{}):r&&r.raw?o:o.value})}set(e,r,n){let s=this._getKeyPrefix(e);typeof n>"u"&&(n=this.opts.ttl),n===0&&(n=void 0);let{store:i}=this.opts;return Promise.resolve().then(()=>{let o=typeof n=="number"?Date.now()+n:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:o},this.opts.serialize(r)}).then(o=>i.set(s,o,n)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let s=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let i=[];for(let o of s)i.push(r.delete(o));return Promise.allSettled(i).then(o=>o.every(a=>a.value===!0))}return Promise.resolve().then(()=>r.deleteMany(s))}let n=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(n))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(r):await n.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};Md.exports=Ka});var Vd=v((aC,Hd)=>{"use strict";u();var zv=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];Hd.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(zv)),n={};for(let s of r)s in e||(n[s]={get(){let i=t[s];return typeof i=="function"?i.bind(t):i},set(i){t[s]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var Gd=v((uC,Bd)=>{"use strict";u();var{Transform:Uv,PassThrough:Hv}=R("stream"),Xa=R("zlib"),Vv=Vd();Bd.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof Xa.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let n=!0,s=new Uv({transform(a,c,l){n=!1,l(null,a)},flush(a){a()}}),i=new Hv({autoDestroy:!1,destroy(a,c){t.destroy(),c(a)}}),o=r?Xa.createBrotliDecompress():Xa.createUnzip();return o.once("error",a=>{if(n&&!t.readable){i.end();return}i.destroy(a)}),Vv(t,i),t.pipe(s).pipe(o).pipe(i),i}});var lc=v((gN,ah)=>{"use strict";u();var uc=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[n,s]of this.oldCache.entries())this.onEviction(n,s);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};ah.exports=uc});var fc=v((wN,ch)=>{"use strict";u();ch.exports=t=>{if(t.listenerCount("error")!==0)return t;t.__destroy=t._destroy,t._destroy=(...r)=>{let n=r.pop();t.__destroy(...r,async s=>{await Promise.resolve(),n(s)})};let e=r=>{Promise.resolve().then(()=>{t.emit("error",r)})};return t.once("error",e),Promise.resolve().then(()=>{t.off("error",e)}),t}});var Wt=v((vN,ph)=>{"use strict";u();var{URL:uh}=R("url"),fE=R("events"),dE=R("tls"),hE=R("http2"),pE=lc(),mE=fc(),$e=Symbol("currentStreamCount"),lh=Symbol("request"),Pe=Symbol("cachedOriginSet"),kt=Symbol("gracefullyClosing"),ti=Symbol("length"),fh=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],yE=(t,e,r)=>{let n=0,s=t.length;for(;n<s;){let i=n+s>>>1;r(t[i],e)?n=i+1:s=i}return n},gE=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,dc=(t,e)=>{for(let r=0;r<t.length;r++){let n=t[r];n[Pe].length>0&&n[Pe].length<e[Pe].length&&n[Pe].every(s=>e[Pe].includes(s))&&n[$e]+e[$e]<=e.remoteSettings.maxConcurrentStreams&&hh(n)}},dh=(t,e)=>{for(let r=0;r<t.length;r++){let n=t[r];if(e[Pe].length>0&&e[Pe].length<n[Pe].length&&e[Pe].every(s=>n[Pe].includes(s))&&e[$e]+n[$e]<=n.remoteSettings.maxConcurrentStreams)return hh(e),!0}return!1},hh=t=>{t[kt]=!0,t[$e]===0&&t.close()},Rr=class t extends fE{constructor({timeout:e=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:n=10,maxCachedTlsSessions:s=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxEmptySessions=n,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new pE({maxSize:s})}get protocol(){return"https:"}normalizeOptions(e){let r="";for(let n=0;n<fh.length;n++){let s=fh[n];r+=":",e&&e[s]!==void 0&&(r+=e[s])}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let e in this.queue)for(let r in this.queue[e]){let n=this.queue[e][r];n.completed||(n.completed=!0,n())}}_isBetterSession(e,r){return e>r}_accept(e,r,n,s){let i=0;for(;i<r.length&&e[$e]<e.remoteSettings.maxConcurrentStreams;)r[i].resolve(e),i++;r.splice(0,i),r.length>0&&(this.getSession(n,s,r),r.length=0)}getSession(e,r,n){return new Promise((s,i)=>{Array.isArray(n)&&n.length>0?(n=[...n],s()):n=[{resolve:s,reject:i}];try{if(typeof e=="string")e=new uh(e);else if(!(e instanceof uh))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(r){let{servername:f}=r,{hostname:d}=e;if(f&&d!==f)throw new Error(`Origin ${d} differs from servername ${f}`)}}catch(f){for(let d=0;d<n.length;d++)n[d].reject(f);return}let o=this.normalizeOptions(r),a=e.origin;if(o in this.sessions){let f=this.sessions[o],d=-1,p=-1,y;for(let g=0;g<f.length;g++){let h=f[g],b=h.remoteSettings.maxConcurrentStreams;if(b<d)break;if(!h[Pe].includes(a))continue;let w=h[$e];w>=b||h[kt]||h.destroyed||(y||(d=b),this._isBetterSession(w,p)&&(y=h,p=w))}if(y){this._accept(y,n,a,r);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...n);return}}else this.queue[o]={[ti]:0};let c=()=>{o in this.queue&&this.queue[o][a]===l&&(delete this.queue[o][a],--this.queue[o][ti]===0&&delete this.queue[o])},l=async()=>{this._sessionCount++;let f=`${a}:${o}`,d=!1,p;try{let y={...r};y.settings===void 0&&(y.settings=this.settings),y.session===void 0&&(y.session=this.tlsSessionCache.get(f)),p=await(y.createConnection||this.createConnection).call(this,e,y),y.createConnection=()=>p;let h=hE.connect(e,y);h[$e]=0,h[kt]=!1;let b=()=>{let{socket:E}=h,S;return E.servername===!1?(E.servername=E.remoteAddress,S=h.originSet,E.servername=!1):S=h.originSet,S},w=()=>h[$e]<h.remoteSettings.maxConcurrentStreams;h.socket.once("session",E=>{this.tlsSessionCache.set(f,E)}),h.once("error",E=>{for(let S=0;S<n.length;S++)n[S].reject(E);this.tlsSessionCache.delete(f)}),h.setTimeout(this.timeout,()=>{h.destroy()}),h.once("close",()=>{if(this._sessionCount--,d){this._emptySessionCount--;let E=this.sessions[o];E.length===1?delete this.sessions[o]:E.splice(E.indexOf(h),1)}else{c();let E=new Error("Session closed without receiving a SETTINGS frame");E.code="HTTP2WRAPPER_NOSETTINGS";for(let S=0;S<n.length;S++)n[S].reject(E)}this._processQueue()});let P=()=>{let E=this.queue[o];if(!E)return;let S=h[Pe];for(let T=0;T<S.length;T++){let D=S[T];if(D in E){let{listeners:C,completed:be}=E[D],k=0;for(;k<C.length&&w();)C[k].resolve(h),k++;if(E[D].listeners.splice(0,k),E[D].listeners.length===0&&!be&&(delete E[D],--E[ti]===0)){delete this.queue[o];break}if(!w())break}}};h.on("origin",()=>{h[Pe]=b()||[],h[kt]=!1,dh(this.sessions[o],h),!(h[kt]||!w())&&(P(),w()&&dc(this.sessions[o],h))}),h.once("remoteSettings",()=>{if(l.destroyed){let E=new Error("Agent has been destroyed");for(let S=0;S<n.length;S++)n[S].reject(E);h.destroy();return}if(h.setLocalWindowSize&&h.setLocalWindowSize(1024*1024*4),h[Pe]=b()||[],h.socket.encrypted){let E=h[Pe][0];if(E!==a){let S=new Error(`Requested origin ${a} does not match server ${E}`);for(let T=0;T<n.length;T++)n[T].reject(S);h.destroy();return}}c();{let E=this.sessions;if(o in E){let S=E[o];S.splice(yE(S,h,gE),0,h)}else E[o]=[h]}d=!0,this._emptySessionCount++,this.emit("session",h),this._accept(h,n,a,r),h[$e]===0&&this._emptySessionCount>this.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),h.on("remoteSettings",()=>{w()&&(P(),w()&&dc(this.sessions[o],h))})}),h[lh]=h.request,h.request=(E,S)=>{if(h[kt])throw new Error("The session is gracefully closing. No new streams are allowed.");let T=h[lh](E,S);return h.ref(),h[$e]++===0&&this._emptySessionCount--,T.once("close",()=>{if(--h[$e]===0&&(this._emptySessionCount++,h.unref(),this._emptySessionCount>this.maxEmptySessions||h[kt])){h.close();return}h.destroyed||h.closed||w()&&!dh(this.sessions[o],h)&&(dc(this.sessions[o],h),P(),h[$e]===0&&this._processQueue())}),T}}catch(y){c(),this._sessionCount--;for(let g=0;g<n.length;g++)n[g].reject(y)}};l.listeners=n,l.completed=!1,l.destroyed=!1,this.queue[o][a]=l,this.queue[o][ti]++,this._processQueue()})}request(e,r,n,s){return new Promise((i,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{let c=a.request(n,s);mE(c),i(c)}catch(c){o(c)}}}])})}async createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let n=e.port||443,s=e.hostname;typeof r.servername>"u"&&(r.servername=s);let i=dE.connect(n,s,r);return r.socket&&(i._peername={family:void 0,address:void 0,port:n}),i}closeEmptySessions(e=Number.POSITIVE_INFINITY){let r=0,{sessions:n}=this;for(let s in n){let i=n[s];for(let o=0;o<i.length;o++){let a=i[o];if(a[$e]===0&&(r++,a.close(),r>=e))return r}}return r}destroy(e){let{sessions:r,queue:n}=this;for(let s in r){let i=r[s];for(let o=0;o<i.length;o++)i[o].destroy(e)}for(let s in n){let i=n[s];for(let o in i)i[o].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};Rr.kCurrentStreamCount=$e;Rr.kGracefullyClosing=kt;ph.exports={Agent:Rr,globalAgent:new Rr}});var pc=v((SN,mh)=>{"use strict";u();var{Readable:_E}=R("stream"),hc=class extends _E{constructor(e,r){super({emitClose:!1,autoDestroy:!0,highWaterMark:r}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this._dumped=!1}get connection(){return this.socket}set connection(e){this.socket=e}_destroy(e,r){this.readableEnded||(this.aborted=!0),r(),this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};mh.exports=hc});var gh=v((PN,yh)=>{"use strict";u();yh.exports=(t,e,r)=>{for(let n of r)t.on(n,(...s)=>e.emit(n,...s))}});var Mn=v((kN,_h)=>{"use strict";u();var Kt=(t,e,r)=>{_h.exports[e]=class extends t{constructor(...s){super(typeof r=="string"?r:r(s)),this.name=`${super.name} [${e}]`,this.code=e}}};Kt(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let e=t[0].includes(".")?"property":"argument",r=t[1],n=Array.isArray(r);return n&&(r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`),`The "${t[0]}" ${e} must be ${n?"one of":"of"} type ${r}. Received ${typeof t[2]}`});Kt(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`);Kt(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`);Kt(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);Kt(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`);Kt(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`);Kt(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")});var bh=v((RN,wh)=>{"use strict";u();wh.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var mc=v((NN,vh)=>{"use strict";u();var{ERR_INVALID_HTTP_TOKEN:wE}=Mn(),bE=bh(),vE=/^[\^`\-\w!#$%&*+.|~]+$/;vh.exports=t=>{if(typeof t!="string"||!vE.test(t)&&!bE(t))throw new wE("Header name",t)}});var yc=v((jN,Eh)=>{"use strict";u();var{ERR_HTTP_INVALID_HEADER_VALUE:EE,ERR_INVALID_CHAR:SE}=Mn(),$E=/[^\t\u0020-\u007E\u0080-\u00FF]/;Eh.exports=(t,e)=>{if(typeof e>"u")throw new EE(e,t);if($E.test(e))throw new SE("header content",t)}});var Ph=v((qN,$h)=>{"use strict";u();var{ERR_HTTP2_NO_SOCKET_MANIPULATION:Sh}=Mn(),PE={has(t,e){let r=t.session===void 0?t:t.session.socket;return e in t||e in r},get(t,e){switch(e){case"on":case"once":case"end":case"emit":case"destroy":return t[e].bind(t);case"writable":case"destroyed":return t[e];case"readable":return t.destroyed?!1:t.readable;case"setTimeout":{let{session:r}=t;return r!==void 0?r.setTimeout.bind(r):t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new Sh;default:{let r=t.session===void 0?t:t.session.socket,n=r[e];return typeof n=="function"?n.bind(r):n}}},getPrototypeOf(t){return t.session!==void 0?Reflect.getPrototypeOf(t.session.socket):Reflect.getPrototypeOf(t)},set(t,e,r){switch(e){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return t[e]=r,!0;case"setTimeout":{let{session:n}=t;return n===void 0?t.setTimeout=r:n.setTimeout=r,!0}case"write":case"read":case"pause":case"resume":throw new Sh;default:{let n=t.session===void 0?t:t.session.socket;return n[e]=r,!0}}}};$h.exports=PE});var bc=v((MN,Ch)=>{"use strict";u();var{URL:gc,urlToHttpOptions:Oh}=R("url"),OE=R("http2"),{Writable:TE}=R("stream"),{Agent:kE,globalAgent:xE}=Wt(),RE=pc(),CE=gh(),{ERR_INVALID_ARG_TYPE:ri,ERR_INVALID_PROTOCOL:NE,ERR_HTTP_HEADERS_SENT:Th}=Mn(),AE=mc(),jE=yc(),IE=Ph(),{HTTP2_HEADER_STATUS:kh,HTTP2_HEADER_METHOD:xh,HTTP2_HEADER_PATH:Rh,HTTP2_HEADER_AUTHORITY:Ln,HTTP2_METHOD_CONNECT:qE}=OE.constants,he=Symbol("headers"),Cr=Symbol("origin"),Fn=Symbol("session"),_c=Symbol("options"),ni=Symbol("flushedHeaders"),Nr=Symbol("jobs"),zn=Symbol("pendingAgentPromise"),wc=class extends TE{constructor(e,r,n){if(super({autoDestroy:!1,emitClose:!1}),typeof e=="string"?e=Oh(new gc(e)):e instanceof gc?e=Oh(e):e={...e},typeof r=="function"||r===void 0?(n=r,r=e):r=Object.assign(e,r),r.h2session){if(this[Fn]=r.h2session,this[Fn].destroyed)throw new Error("The session has been closed already");this.protocol=this[Fn].socket.encrypted?"https:":"http:"}else if(r.agent===!1)this.agent=new kE({maxEmptySessions:0});else if(typeof r.agent>"u"||r.agent===null)this.agent=xE;else if(typeof r.agent.request=="function")this.agent=r.agent;else throw new ri("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent);if(this.agent&&(this.protocol=this.agent.protocol),r.protocol&&r.protocol!==this.protocol)throw new NE(r.protocol,this.protocol);r.port||(r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443),r.host=r.hostname||r.host||"localhost",delete r.hostname;let{timeout:s}=r;r.timeout=void 0,this[he]=Object.create(null),this[Nr]=[],this[zn]=void 0,this.socket=null,this.connection=null,this.method=r.method||"GET",this.method==="CONNECT"&&(r.path==="/"||r.path===void 0)||(this.path=r.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:i}=r;if(i)for(let a in i)this.setHeader(a,i[a]);r.auth&&!("authorization"in this[he])&&(this[he].authorization="Basic "+Buffer.from(r.auth).toString("base64")),r.session=r.tlsSession,r.path=r.socketPath,this[_c]=r,this[Cr]=new gc(`${this.protocol}//${r.servername||r.host}:${r.port}`);let o=r._reuseSocket;o&&(r.createConnection=(...a)=>o.destroyed?this.agent.createConnection(...a):o,this.agent.getSession(this[Cr],this[_c]).catch(()=>{})),s&&this.setTimeout(s),n&&this.once("response",n),this[ni]=!1}get method(){return this[he][xh]}set method(e){e&&(this[he][xh]=e.toUpperCase())}get path(){let e=this.method==="CONNECT"?Ln:Rh;return this[he][e]}set path(e){if(e){let r=this.method==="CONNECT"?Ln:Rh;this[he][r]=e}}get host(){return this[Cr].hostname}set host(e){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,r,n){if(this._mustNotHaveABody){n(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let s=()=>this._request.write(e,r,n);this._request?s():this[Nr].push(s)}_final(e){this.flushHeaders();let r=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){e();return}this._request.end(e)};this._request?r():this[Nr].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(e,r){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[zn]}catch(n){this.aborted&&(e=n)}r(e)}async flushHeaders(){if(this[ni]||this.destroyed)return;this[ni]=!0;let e=this.method===qE,r=n=>{if(this._request=n,this.destroyed){n.destroy();return}e||CE(n,this,["timeout","continue"]),n.once("error",i=>{this.destroy(i)}),n.once("aborted",()=>{let{res:i}=this;i?(i.aborted=!0,i.emit("aborted"),i.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let s=(i,o,a)=>{let c=new RE(this.socket,n.readableHighWaterMark);this.res=c,c.url=`${this[Cr].origin}${this.path}`,c.req=this,c.statusCode=i[kh],c.headers=i,c.rawHeaders=a,c.once("end",()=>{c.complete=!0,c.socket=null,c.connection=null}),e?(c.upgrade=!0,this.emit("connect",c,n,Buffer.alloc(0))?this.emit("close"):n.destroy()):(n.on("data",l=>{!c._dumped&&!c.push(l)&&n.pause()}),n.once("end",()=>{this.aborted||c.push(null)}),this.emit("response",c)||c._dump())};n.once("response",s),n.once("headers",i=>this.emit("information",{statusCode:i[kh]})),n.once("trailers",(i,o,a)=>{let{res:c}=this;if(c===null){s(i,o,a);return}c.trailers=i,c.rawTrailers=a}),n.once("close",()=>{let{aborted:i,res:o}=this;if(o){i&&(o.aborted=!0,o.emit("aborted"),o.destroy());let a=()=>{o.emit("close"),this.destroy(),this.emit("close")};o.readable?o.once("end",a):a();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(n,IE);for(let i of this[Nr])i();this[Nr].length=0,this.emit("socket",this.socket)};if(!(Ln in this[he])&&!e&&(this[he][Ln]=this[Cr].host),this[Fn])try{r(this[Fn].request(this[he]))}catch(n){this.destroy(n)}else{this.reusedSocket=!0;try{let n=this.agent.request(this[Cr],this[_c],this[he]);this[zn]=n,r(await n),this[zn]=!1}catch(n){this[zn]=!1,this.destroy(n)}}}get connection(){return this.socket}set connection(e){this.socket=e}getHeaderNames(){return Object.keys(this[he])}hasHeader(e){if(typeof e!="string")throw new ri("name","string",e);return!!this[he][e.toLowerCase()]}getHeader(e){if(typeof e!="string")throw new ri("name","string",e);return this[he][e.toLowerCase()]}get headersSent(){return this[ni]}removeHeader(e){if(typeof e!="string")throw new ri("name","string",e);if(this.headersSent)throw new Th("remove");delete this[he][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new Th("set");AE(e),jE(e,r);let n=e.toLowerCase();if(n==="connection"){if(r.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${r}`)}n==="host"&&this.method==="CONNECT"?this[he][Ln]=r:this[he][n]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let n=()=>this._request.setTimeout(e,r);return this._request?n():this[Nr].push(n),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Ch.exports=wc});var Ah=v((FN,Nh)=>{"use strict";u();var DE=R("tls");Nh.exports=(t={},e=DE.connect)=>new Promise((r,n)=>{let s=!1,i,o=async()=>{await c,i.off("timeout",a),i.off("error",n),t.resolveSocket?(r({alpnProtocol:i.alpnProtocol,socket:i,timeout:s}),s&&(await Promise.resolve(),i.emit("timeout"))):(i.destroy(),r({alpnProtocol:i.alpnProtocol,timeout:s}))},a=async()=>{s=!0,o()},c=(async()=>{try{i=await e(t,o),i.on("error",n),i.once("timeout",a)}catch(l){n(l)}})()})});var Ih=v((UN,jh)=>{"use strict";u();var{isIP:ME}=R("net"),LE=R("assert"),FE=t=>{if(t[0]==="["){let r=t.indexOf("]");return LE(r!==-1),t.slice(1,r)}let e=t.indexOf(":");return e===-1?t:t.slice(0,e)};jh.exports=t=>{let e=FE(t);return ME(e)?"":e}});var Hh=v((VN,Un)=>{"use strict";u();var{URL:qh,urlToHttpOptions:Dh}=R("url"),Mh=R("http"),vc=R("https"),zE=Ah(),UE=lc(),{Agent:HE,globalAgent:VE}=Wt(),BE=bc(),GE=Ih(),Lh=fc(),Fh=new UE({maxSize:100}),WE=new Map,KE=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let n=()=>{t.emit("free",e,r)};e.on("free",n);let s=()=>{t.removeSocket(e,r)};e.on("close",s);let i=()=>{let{freeSockets:a}=t;for(let c of Object.values(a))if(c.includes(e)){e.destroy();return}};e.on("timeout",i);let o=()=>{t.removeSocket(e,r),e.off("close",s),e.off("free",n),e.off("timeout",i),e.off("agentRemove",o)};e.on("agentRemove",o),t.emit("free",e,r)},zh=(t,e=new Map,r=void 0)=>async n=>{let s=`${n.host}:${n.port}:${n.ALPNProtocols.sort()}`;if(!t.has(s)){if(e.has(s))return{alpnProtocol:(await e.get(s)).alpnProtocol};let{path:i}=n;n.path=n.socketPath;let o=zE(n,r);e.set(s,o);try{let a=await o;return t.set(s,a.alpnProtocol),e.delete(s),n.path=i,a}catch(a){throw e.delete(s),n.path=i,a}}return{alpnProtocol:t.get(s)}},Uh=zh(Fh,WE);Un.exports=async(t,e,r)=>{if(typeof t=="string"?t=Dh(new qh(t)):t instanceof qh?t=Dh(t):t={...t},typeof e=="function"||e===void 0?(r=e,e=t):e=Object.assign(t,e),e.ALPNProtocols=e.ALPNProtocols||["h2","http/1.1"],!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let n=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||GE(e.headers&&e.headers.host||e.host),e.port=e.port||(n?443:80),e._defaultAgent=n?vc.globalAgent:Mh.globalAgent;let s=e.resolveProtocol||Uh,{agent:i}=e;if(i!==void 0&&i!==!1&&i.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(n){e.resolveSocket=!0;let{socket:o,alpnProtocol:a,timeout:c}=await s(e);if(c){o&&o.destroy();let f=new Error(`Timed out resolving ALPN: ${e.timeout} ms`);throw f.code="ETIMEDOUT",f.ms=e.timeout,f}o&&e.createConnection&&(o.destroy(),o=void 0),delete e.resolveSocket;let l=a==="h2";if(i&&(i=l?i.http2:i.https,e.agent=i),i===void 0&&(i=l?VE:vc.globalAgent),o)if(i===!1)o.destroy();else{let f=(l?HE:vc.Agent).prototype.createConnection;i.createConnection===f?l?e._reuseSocket=o:KE(i,o,e):o.destroy()}if(l)return Lh(new BE(e,r))}else i&&(e.agent=i.http);return e.headers&&(e.headers={...e.headers},e.headers[":authority"]&&(e.headers.host||(e.headers.host=e.headers[":authority"]),delete e.headers[":authority"]),delete e.headers[":method"],delete e.headers[":scheme"],delete e.headers[":path"]),Lh(Mh.request(e,r))};Un.exports.protocolCache=Fh;Un.exports.resolveProtocol=Uh;Un.exports.createResolveProtocol=zh});var Ec=v((GN,Vh)=>{"use strict";u();var JE=R("stream"),YE=R("tls"),QE=new YE.TLSSocket(new JE.PassThrough)._handle._parentWrap.constructor;Vh.exports=QE});var $c=v((KN,Bh)=>{"use strict";u();var Sc=class extends Error{constructor(e,r=""){super(`The proxy server rejected the request with status code ${e} (${r||"empty status message"})`),this.statusCode=e,this.statusMessage=r}};Bh.exports=Sc});var Wh=v((YN,Gh)=>{"use strict";u();var XE=(t,e,r)=>{if(!r.some(s=>typeof s==="string"?typeof e===s:e instanceof s)){let s=r.map(i=>typeof i=="string"?i:i.name);throw new TypeError(`Expected '${t}' to be a type of ${s.join(" or ")}, got ${typeof e}`)}};Gh.exports=XE});var Pc=v((XN,Jh)=>{"use strict";u();var{URL:Kh}=R("url"),si=Wh();Jh.exports=(t,e)=>{si("proxyOptions",e,["object"]),si("proxyOptions.headers",e.headers,["object","undefined"]),si("proxyOptions.raw",e.raw,["boolean","undefined"]),si("proxyOptions.url",e.url,[Kh,"string"]);let r=new Kh(e.url);t.proxyOptions={raw:!0,...e,headers:{...e.headers},url:r}}});var ii=v((eA,Yh)=>{"use strict";u();Yh.exports=t=>{let{username:e,password:r}=t.proxyOptions.url;if(e||r){let n=`${e}:${r}`,s=`Basic ${Buffer.from(n).toString("base64")}`;return{"proxy-authorization":s,authorization:s}}return{}}});var tp=v((rA,ep)=>{"use strict";u();var ZE=R("tls"),eS=R("http"),Qh=R("https"),tS=Ec(),{globalAgent:rS}=Wt(),nS=$c(),Xh=Pc(),sS=ii(),Zh=(t,e,r)=>{(async()=>{try{let{proxyOptions:n}=t,{url:s,headers:i,raw:o}=n,a=await rS.request(s,n,{...sS(t),...i,":method":"CONNECT",":authority":`${e.host}:${e.port}`});a.once("error",r),a.once("response",c=>{let l=c[":status"];if(l!==200){r(new nS(l,""));return}let f=t instanceof Qh.Agent;if(o&&f){e.socket=a;let p=ZE.connect(e);p.once("close",()=>{a.destroy()}),r(null,p);return}let d=new tS(a);d.encrypted=!1,d._handle.getpeername=p=>{p.family=void 0,p.address=void 0,p.port=void 0},r(null,d)})}catch(n){r(n)}})()},Oc=class extends eS.Agent{constructor(e){super(e),Xh(this,e.proxyOptions)}createConnection(e,r){Zh(this,e,r)}},Tc=class extends Qh.Agent{constructor(e){super(e),Xh(this,e.proxyOptions)}createConnection(e,r){Zh(this,e,r)}};ep.exports={HttpOverHttp2:Oc,HttpsOverHttp2:Tc}});var xc=v((sA,rp)=>{"use strict";u();var{Agent:iS}=Wt(),oS=Ec(),aS=$c(),cS=Pc(),kc=class extends iS{constructor(e){super(e),cS(this,e.proxyOptions)}async createConnection(e,r){let n=`${e.hostname}:${e.port||443}`,[s,i,o]=await this._getProxyStream(n);if(i!==200)throw new aS(i,o);if(this.proxyOptions.raw)r.socket=s;else{let a=new oS(s);return a.encrypted=!1,a._handle.getpeername=c=>{c.family=void 0,c.address=void 0,c.port=void 0},a}return super.createConnection(e,r)}};rp.exports=kc});var sp=v((oA,np)=>{"use strict";u();var{globalAgent:uS}=Wt(),lS=xc(),fS=ii(),dS=t=>new Promise((e,r)=>{t.once("error",r),t.once("response",n=>{t.off("error",r),e(n[":status"])})}),Rc=class extends lS{async _getProxyStream(e){let{proxyOptions:r}=this,n={...fS(this),...r.headers,":method":"CONNECT",":authority":e},s=await uS.request(r.url,r,n),i=await dS(s);return[s,i,""]}};np.exports=Rc});var op=v((cA,ip)=>{"use strict";u();var hS=R("http"),pS=R("https"),mS=xc(),yS=ii(),gS=t=>new Promise((e,r)=>{let n=(s,i,o)=>{i.unshift(o),t.off("error",r),e([i,s.statusCode,s.statusMessage])};t.once("error",r),t.once("connect",n)}),oi=class extends mS{async _getProxyStream(e){let{proxyOptions:r}=this,{url:n,headers:s}=this.proxyOptions,o=(n.protocol==="https:"?pS:hS).request({...r,hostname:n.hostname,port:n.port,path:e,headers:{...yS(this),...s,host:e},method:"CONNECT"}).end();return gS(o)}};ip.exports={Http2OverHttp:oi,Http2OverHttps:oi}});var cp=v((lA,ap)=>{"use strict";u();var _S=R("http2"),{Agent:wS,globalAgent:bS}=Wt(),Cc=bc(),vS=pc(),ES=Hh(),{HttpOverHttp2:SS,HttpsOverHttp2:$S}=tp(),PS=sp(),{Http2OverHttp:OS,Http2OverHttps:TS}=op(),kS=mc(),xS=yc(),RS=(t,e,r)=>new Cc(t,e,r),CS=(t,e,r)=>{let n=new Cc(t,e,r);return n.end(),n};ap.exports={..._S,ClientRequest:Cc,IncomingMessage:vS,Agent:wS,globalAgent:bS,request:RS,get:CS,auto:ES,proxies:{HttpOverHttp2:SS,HttpsOverHttp2:$S,Http2OverHttp2:PS,Http2OverHttp:OS,Http2OverHttps:TS},validateHeaderName:kS,validateHeaderValue:xS}});var Dc=v(Yt=>{u();Yt.parse=Yt.decode=c$;Yt.stringify=Yt.encode=Ep;Yt.safe=jr;Yt.unsafe=hi;var qc=typeof process<"u"&&process.platform==="win32"?`\r
8
+ deps: ${r}}`};var vb={keyword:"dependencies",type:"object",schemaType:"object",error:tt.error,code(t){let[e,r]=Eb(t);Nf(t,e),Af(t,r)}};function Eb({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Nf(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,_n.propertyInData)(r,n,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(c,()=>{for(let l of a)(0,_n.checkReportMissingProp)(t,l)}):(r.if((0,aa._)`${c} && (${(0,_n.checkMissingProp)(t,a,i)})`),(0,_n.reportMissingProp)(t,i),r.else())}}tt.validatePropertyDeps=Nf;function Af(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,o=r.name("valid");for(let a in e)(0,bb.alwaysValidSchema)(i,e[a])||(r.if((0,_n.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}tt.validateSchemaDeps=Af;tt.default=vb});var qf=v(ca=>{"use strict";u();Object.defineProperty(ca,"__esModule",{value:!0});var If=I(),Sb=z(),$b={message:"property name must be valid",params:({params:t})=>(0,If._)`{propertyName: ${t.propertyName}}`},Pb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:$b,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,Sb.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,If.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};ca.default=Pb});var la=v(ua=>{"use strict";u();Object.defineProperty(ua,"__esModule",{value:!0});var Ns=De(),We=I(),Ob=it(),As=z(),Tb={message:"must NOT have additional properties",params:({params:t})=>(0,We._)`{additionalProperty: ${t.additionalProperty}}`},kb={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Tb,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,As.alwaysValidSchema)(o,r))return;let l=(0,Ns.allSchemaProperties)(n.properties),f=(0,Ns.allSchemaProperties)(n.patternProperties);d(),t.ok((0,We._)`${i} === ${Ob.default.errors}`);function d(){e.forIn("key",s,b=>{!l.length&&!f.length?g(b):e.if(p(b),()=>g(b))})}function p(b){let w;if(l.length>8){let P=(0,As.schemaRefOrVal)(o,n.properties,"properties");w=(0,Ns.isOwnProperty)(e,P,b)}else l.length?w=(0,We.or)(...l.map(P=>(0,We._)`${b} === ${P}`)):w=We.nil;return f.length&&(w=(0,We.or)(w,...f.map(P=>(0,We._)`${(0,Ns.usePattern)(t,P)}.test(${b})`))),(0,We.not)(w)}function y(b){e.code((0,We._)`delete ${s}[${b}]`)}function g(b){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){y(b);return}if(r===!1){t.setParams({additionalProperty:b}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,As.alwaysValidSchema)(o,r)){let w=e.name("valid");c.removeAdditional==="failing"?(h(b,w,!1),e.if((0,We.not)(w),()=>{t.reset(),y(b)})):(h(b,w),a||e.if((0,We.not)(w),()=>e.break()))}}function h(b,w,P){let E={keyword:"additionalProperties",dataProp:b,dataPropType:As.Type.Str};P===!1&&Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(E,w)}}};ua.default=kb});var Lf=v(da=>{"use strict";u();Object.defineProperty(da,"__esModule",{value:!0});var xb=nn(),Df=De(),fa=z(),Mf=la(),Rb={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Mf.default.code(new xb.KeywordCxt(i,Mf.default,"additionalProperties"));let o=(0,Df.allSchemaProperties)(r);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=fa.mergeEvaluated.props(e,(0,fa.toHash)(o),i.props));let a=o.filter(d=>!(0,fa.alwaysValidSchema)(i,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?f(d):(e.if((0,Df.propertyInData)(e,s,d,i.opts.ownProperties)),f(d),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function f(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};da.default=Rb});var Hf=v(ha=>{"use strict";u();Object.defineProperty(ha,"__esModule",{value:!0});var Ff=De(),js=I(),zf=z(),Uf=z(),Cb={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,Ff.allSchemaProperties)(r),c=a.filter(h=>(0,zf.alwaysValidSchema)(i,r[h]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,f=e.name("valid");i.props!==!0&&!(i.props instanceof js.Name)&&(i.props=(0,Uf.evaluatedPropsToName)(e,i.props));let{props:d}=i;p();function p(){for(let h of a)l&&y(h),i.allErrors?g(h):(e.var(f,!0),g(h),e.if(f))}function y(h){for(let b in l)new RegExp(h).test(b)&&(0,zf.checkStrictMode)(i,`property ${b} matches pattern ${h} (use allowMatchingProperties)`)}function g(h){e.forIn("key",n,b=>{e.if((0,js._)`${(0,Ff.usePattern)(t,h)}.test(${b})`,()=>{let w=c.includes(h);w||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:b,dataPropType:Uf.Type.Str},f),i.opts.unevaluated&&d!==!0?e.assign((0,js._)`${d}[${b}]`,!0):!w&&!i.allErrors&&e.if((0,js.not)(f),()=>e.break())})})}}};ha.default=Cb});var Vf=v(pa=>{"use strict";u();Object.defineProperty(pa,"__esModule",{value:!0});var Nb=z(),Ab={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Nb.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};pa.default=Ab});var Bf=v(ma=>{"use strict";u();Object.defineProperty(ma,"__esModule",{value:!0});var jb=De(),Ib={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jb.validateUnion,error:{message:"must match a schema in anyOf"}};ma.default=Ib});var Gf=v(ya=>{"use strict";u();Object.defineProperty(ya,"__esModule",{value:!0});var Is=I(),qb=z(),Db={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Is._)`{passingSchemas: ${t.passing}}`},Mb={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Db,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){i.forEach((f,d)=>{let p;(0,qb.alwaysValidSchema)(s,f)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Is._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Is._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Is.Name)})})}}};ya.default=Mb});var Wf=v(ga=>{"use strict";u();Object.defineProperty(ga,"__esModule",{value:!0});var Lb=z(),Fb={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,o)=>{if((0,Lb.alwaysValidSchema)(n,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};ga.default=Fb});var Yf=v(_a=>{"use strict";u();Object.defineProperty(_a,"__esModule",{value:!0});var qs=I(),Jf=z(),zb={message:({params:t})=>(0,qs.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,qs._)`{failingKeyword: ${t.ifClause}}`},Ub={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:zb,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Jf.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Kf(n,"then"),i=Kf(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),s&&i){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(a,l("then",f),l("else",f))}else s?e.if(a,l("then")):e.if((0,qs.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(f)}function l(f,d){return()=>{let p=t.subschema({keyword:f},a);e.assign(o,a),t.mergeValidEvaluated(p,o),d?e.assign(d,(0,qs._)`${f}`):t.setParams({ifClause:f})}}}};function Kf(t,e){let r=t.schema[e];return r!==void 0&&!(0,Jf.alwaysValidSchema)(t,r)}_a.default=Ub});var Qf=v(wa=>{"use strict";u();Object.defineProperty(wa,"__esModule",{value:!0});var Hb=z(),Vb={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Hb.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};wa.default=Vb});var Xf=v(ba=>{"use strict";u();Object.defineProperty(ba,"__esModule",{value:!0});var Bb=ra(),Gb=kf(),Wb=na(),Kb=Rf(),Jb=Cf(),Yb=jf(),Qb=qf(),Xb=la(),Zb=Lf(),e0=Hf(),t0=Vf(),r0=Bf(),n0=Gf(),s0=Wf(),i0=Yf(),o0=Qf();function a0(t=!1){let e=[t0.default,r0.default,n0.default,s0.default,i0.default,o0.default,Qb.default,Xb.default,Yb.default,Zb.default,e0.default];return t?e.push(Gb.default,Kb.default):e.push(Bb.default,Wb.default),e.push(Jb.default),e}ba.default=a0});var Zf=v(va=>{"use strict";u();Object.defineProperty(va,"__esModule",{value:!0});var se=I(),c0={message:({schemaCode:t})=>(0,se.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,se._)`{format: ${t}}`},u0={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:c0,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:f,self:d}=a;if(!c.validateFormats)return;s?p():y();function p(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,se._)`${g}[${o}]`),b=r.let("fType"),w=r.let("format");r.if((0,se._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(b,(0,se._)`${h}.type || "string"`).assign(w,(0,se._)`${h}.validate`),()=>r.assign(b,(0,se._)`"string"`).assign(w,h)),t.fail$data((0,se.or)(P(),E()));function P(){return c.strictSchema===!1?se.nil:(0,se._)`${o} && !${w}`}function E(){let S=f.$async?(0,se._)`(${h}.async ? await ${w}(${n}) : ${w}(${n}))`:(0,se._)`${w}(${n})`,T=(0,se._)`(typeof ${w} == "function" ? ${S} : ${w}.test(${n}))`;return(0,se._)`${w} && ${w} !== true && ${b} === ${e} && !${T}`}}function y(){let g=d.formats[i];if(!g){P();return}if(g===!0)return;let[h,b,w]=E(g);h===e&&t.pass(S());function P(){if(c.strictSchema===!1){d.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function E(T){let D=T instanceof RegExp?(0,se.regexpCode)(T):c.code.formats?(0,se._)`${c.code.formats}${(0,se.getProperty)(i)}`:void 0,C=r.scopeValue("formats",{key:i,ref:T,code:D});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,se._)`${C}.validate`]:["string",T,C]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!f.$async)throw new Error("async format in sync schema");return(0,se._)`await ${w}(${n})`}return typeof b=="function"?(0,se._)`${w}(${n})`:(0,se._)`${w}.test(${n})`}}}};va.default=u0});var ed=v(Ea=>{"use strict";u();Object.defineProperty(Ea,"__esModule",{value:!0});var l0=Zf(),f0=[l0.default];Ea.default=f0});var td=v(yr=>{"use strict";u();Object.defineProperty(yr,"__esModule",{value:!0});yr.contentVocabulary=yr.metadataVocabulary=void 0;yr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];yr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var nd=v(Sa=>{"use strict";u();Object.defineProperty(Sa,"__esModule",{value:!0});var d0=lf(),h0=$f(),p0=Xf(),m0=ed(),rd=td(),y0=[d0.default,h0.default,(0,p0.default)(),m0.default,rd.metadataVocabulary,rd.contentVocabulary];Sa.default=y0});var id=v(Ds=>{"use strict";u();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.DiscrError=void 0;var sd;(function(t){t.Tag="tag",t.Mapping="mapping"})(sd||(Ds.DiscrError=sd={}))});var ad=v(Pa=>{"use strict";u();Object.defineProperty(Pa,"__esModule",{value:!0});var gr=I(),$a=id(),od=ws(),g0=sn(),_0=z(),w0={message:({params:{discrError:t,tagName:e}})=>t===$a.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,gr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},b0={keyword:"discriminator",type:"object",schemaType:"object",error:w0,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,gr._)`${r}${(0,gr.getProperty)(a)}`);e.if((0,gr._)`typeof ${l} == "string"`,()=>f(),()=>t.error(!1,{discrError:$a.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function f(){let y=p();e.if(!1);for(let g in y)e.elseIf((0,gr._)`${l} === ${g}`),e.assign(c,d(y[g]));e.else(),t.error(!1,{discrError:$a.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(y){let g=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:y},g);return t.mergeEvaluated(h,gr.Name),g}function p(){var y;let g={},h=w(s),b=!0;for(let S=0;S<o.length;S++){let T=o[S];if(T?.$ref&&!(0,_0.schemaHasRulesButRef)(T,i.self.RULES)){let C=T.$ref;if(T=od.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,C),T instanceof od.SchemaEnv&&(T=T.schema),T===void 0)throw new g0.default(i.opts.uriResolver,i.baseId,C)}let D=(y=T?.properties)===null||y===void 0?void 0:y[a];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);b=b&&(h||w(T)),P(D,S)}if(!b)throw new Error(`discriminator: "${a}" must be required`);return g;function w({required:S}){return Array.isArray(S)&&S.includes(a)}function P(S,T){if(S.const)E(S.const,T);else if(S.enum)for(let D of S.enum)E(D,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function E(S,T){if(typeof S!="string"||S in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[S]=T}}}};Pa.default=b0});var cd=v((Ox,v0)=>{v0.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ta=v((Y,Oa)=>{"use strict";u();Object.defineProperty(Y,"__esModule",{value:!0});Y.MissingRefError=Y.ValidationError=Y.CodeGen=Y.Name=Y.nil=Y.stringify=Y.str=Y._=Y.KeywordCxt=Y.Ajv=void 0;var E0=nf(),S0=nd(),$0=ad(),ud=cd(),P0=["/properties"],Ms="http://json-schema.org/draft-07/schema",_r=class extends E0.default{_addVocabularies(){super._addVocabularies(),S0.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword($0.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ud,P0):ud;this.addMetaSchema(e,Ms,!1),this.refs["http://json-schema.org/schema"]=Ms}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ms)?Ms:void 0)}};Y.Ajv=_r;Oa.exports=Y=_r;Oa.exports.Ajv=_r;Object.defineProperty(Y,"__esModule",{value:!0});Y.default=_r;var O0=nn();Object.defineProperty(Y,"KeywordCxt",{enumerable:!0,get:function(){return O0.KeywordCxt}});var wr=I();Object.defineProperty(Y,"_",{enumerable:!0,get:function(){return wr._}});Object.defineProperty(Y,"str",{enumerable:!0,get:function(){return wr.str}});Object.defineProperty(Y,"stringify",{enumerable:!0,get:function(){return wr.stringify}});Object.defineProperty(Y,"nil",{enumerable:!0,get:function(){return wr.nil}});Object.defineProperty(Y,"Name",{enumerable:!0,get:function(){return wr.Name}});Object.defineProperty(Y,"CodeGen",{enumerable:!0,get:function(){return wr.CodeGen}});var T0=gs();Object.defineProperty(Y,"ValidationError",{enumerable:!0,get:function(){return T0.default}});var k0=sn();Object.defineProperty(Y,"MissingRefError",{enumerable:!0,get:function(){return k0.default}})});var md=v(rt=>{"use strict";u();Object.defineProperty(rt,"__esModule",{value:!0});rt.formatNames=rt.fastFormats=rt.fullFormats=void 0;function br(t,e){return{validate:t,compare:e}}rt.fullFormats={date:br(dd,Ra),time:br(hd,Ca),"date-time":br(N0,pd),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:I0,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:U0,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:q0,int32:{type:"number",validate:L0},int64:{type:"number",validate:F0},float:{type:"number",validate:fd},double:{type:"number",validate:fd},password:!0,binary:!0};rt.fastFormats={...rt.fullFormats,date:br(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ra),time:br(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ca),"date-time":br(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,pd),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};rt.formatNames=Object.keys(rt.fullFormats);function x0(t){return t%4===0&&(t%100!==0||t%400===0)}var R0=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,C0=[0,31,28,31,30,31,30,31,31,30,31,30,31];function dd(t){let e=R0.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&x0(r)?29:C0[n])}function Ra(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ka=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function hd(t,e){let r=ka.exec(t);if(!r)return!1;let n=+r[1],s=+r[2],i=+r[3],o=r[5];return(n<=23&&s<=59&&i<=59||n===23&&s===59&&i===60)&&(!e||o!=="")}function Ca(t,e){if(!(t&&e))return;let r=ka.exec(t),n=ka.exec(e);if(r&&n)return t=r[1]+r[2]+r[3]+(r[4]||""),e=n[1]+n[2]+n[3]+(n[4]||""),t>e?1:t<e?-1:0}var xa=/t|\s/i;function N0(t){let e=t.split(xa);return e.length===2&&dd(e[0])&&hd(e[1],!0)}function pd(t,e){if(!(t&&e))return;let[r,n]=t.split(xa),[s,i]=e.split(xa),o=Ra(r,s);if(o!==void 0)return o||Ca(n,i)}var A0=/\/|:/,j0=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function I0(t){return A0.test(t)&&j0.test(t)}var ld=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function q0(t){return ld.lastIndex=0,ld.test(t)}var D0=-(2**31),M0=2**31-1;function L0(t){return Number.isInteger(t)&&t<=M0&&t>=D0}function F0(t){return Number.isInteger(t)}function fd(){return!0}var z0=/[^\\]\\Z/;function U0(t){if(z0.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var yd=v(vr=>{"use strict";u();Object.defineProperty(vr,"__esModule",{value:!0});vr.formatLimitDefinition=void 0;var H0=Ta(),Ke=I(),Et=Ke.operators,Ls={formatMaximum:{okStr:"<=",ok:Et.LTE,fail:Et.GT},formatMinimum:{okStr:">=",ok:Et.GTE,fail:Et.LT},formatExclusiveMaximum:{okStr:"<",ok:Et.LT,fail:Et.GTE},formatExclusiveMinimum:{okStr:">",ok:Et.GT,fail:Et.LTE}},V0={message:({keyword:t,schemaCode:e})=>Ke.str`should be ${Ls[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Ke._`{comparison: ${Ls[t].okStr}, limit: ${e}}`};vr.formatLimitDefinition={keyword:Object.keys(Ls),type:"string",schemaType:"string",$data:!0,error:V0,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let c=new H0.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?l():f();function l(){let p=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),y=e.const("fmt",Ke._`${p}[${c.schemaCode}]`);t.fail$data(Ke.or(Ke._`typeof ${y} != "object"`,Ke._`${y} instanceof RegExp`,Ke._`typeof ${y}.compare != "function"`,d(y)))}function f(){let p=c.schema,y=a.formats[p];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${s}": format "${p}" does not define "compare" function`);let g=e.scopeValue("formats",{key:p,ref:y,code:o.code.formats?Ke._`${o.code.formats}${Ke.getProperty(p)}`:void 0});t.fail$data(d(g))}function d(p){return Ke._`${p}.compare(${r}, ${n}) ${Ls[s].fail} 0`}},dependencies:["format"]};var B0=t=>(t.addKeyword(vr.formatLimitDefinition),t);vr.default=B0});var bd=v((wn,wd)=>{"use strict";u();Object.defineProperty(wn,"__esModule",{value:!0});var Er=md(),G0=yd(),Na=I(),gd=new Na.Name("fullFormats"),W0=new Na.Name("fastFormats"),Aa=(t,e={keywords:!0})=>{if(Array.isArray(e))return _d(t,e,Er.fullFormats,gd),t;let[r,n]=e.mode==="fast"?[Er.fastFormats,W0]:[Er.fullFormats,gd],s=e.formats||Er.formatNames;return _d(t,s,r,n),e.keywords&&G0.default(t),t};Aa.get=(t,e="full")=>{let n=(e==="fast"?Er.fastFormats:Er.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function _d(t,e,r,n){var s,i;(s=(i=t.opts.code).formats)!==null&&s!==void 0||(i.formats=Na._`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}wd.exports=wn=Aa;Object.defineProperty(wn,"__esModule",{value:!0});wn.default=Aa});var Cd=v((Ha,Va)=>{"use strict";u();Object.defineProperty(Ha,"__esModule",{value:!0});function yv(t){return t.encrypted}var Ua=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let n=typeof r.connect=="function",s=typeof r.secureConnect=="function",i=typeof r.close=="function",o=()=>{n&&r.connect(),yv(t)&&s&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),i&&t.once("close",r.close)};t.writable&&!t.connecting?o():t.connecting?t.once("connect",o):t.destroyed&&i&&r.close(t._hadError)};Ha.default=Ua;Va.exports=Ua;Va.exports.default=Ua});var Id=v((DR,jd)=>{"use strict";u();var Pv=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),Ov=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),Tv=new Set([500,502,503,504]),kv={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},xv={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function ct(t){let e=parseInt(t,10);return isFinite(e)?e:0}function Rv(t){return t?Tv.has(t.status):!0}function Wa(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[s,i]=n.split(/=/,2);e[s.trim()]=i===void 0?!0:i.trim().replace(/^"|"$/g,"")}return e}function Cv(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}jd.exports=class{constructor(e,r,{shared:n,cacheHeuristic:s,immutableMinTimeToLive:i,ignoreCargoCult:o,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._ignoreCargoCult=!!o,this._cacheHeuristic=s!==void 0?s:.1,this._immutableMinTtl=i!==void 0?i:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=Wa(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=Wa(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":Cv(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&Ov.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||Pv.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,r){return{synchronous:r,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let r=Wa(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):r["max-age"]&&this.age()>ct(r["max-age"])?this._evaluateRequestMissResult(e):r["min-fresh"]&&this.maxAge()-this.age()<ct(r["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in r&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,r){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)kv[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let s of n)delete r[s]}if(r.warning){let n=r.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return ct(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return ct(this._rescc["s-maxage"])}if(this._rescc["max-age"])return ct(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<r?0:Math.max(e,(n-r)/1e3)}if(this._resHeaders["last-modified"]){let n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&r>n)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+ct(this._rescc["stale-if-error"]),n=e+ct(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,r,n)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+ct(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=ct(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let s=r["if-none-match"].split(/,/).filter(i=>!/^\s*W\//.test(i));s.length?r["if-none-match"]=s.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&Rv(r))return{policy:this,modified:!1,matches:!0};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!n)return{policy:new this.constructor(e,r,s),modified:r.status!=304,matches:!1};let i={};for(let a in this._resHeaders)i[a]=a in r.headers&&!xv[a]?r.headers[a]:this._resHeaders[a];let o=Object.assign({},r,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,o,s),modified:!1,matches:!0}}}});var qd=v(Ka=>{u();Ka.stringify=function t(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",n=Array.isArray(e);r=n?"[":"{";var s=!0;for(var i in e){var o=typeof e[i]=="function"||!n&&typeof e[i]>"u";Object.hasOwnProperty.call(e,i)&&!o&&(s||(r+=","),s=!1,n?e[i]==null?r+="null":r+=t(e[i]):e[i]!==void 0&&(r+=t(i)+":"+t(e[i])))}return r+=n?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};Ka.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var Fd=v((WR,Ld)=>{"use strict";u();var Av=R("events"),Dd=qd(),jv=t=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(R(e[r]))(t)}return new Map},Md=["sqlite","postgres","mysql","mongo","redis","tiered"],Ja=class extends Av{constructor(e,{emitErrors:r=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:Dd.stringify,deserialize:Dd.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){let i={...this.opts};this.opts.store=jv(i)}if(this.opts.compression){let i=this.opts.compression;this.opts.serialize=i.serialize.bind(i),this.opts.deserialize=i.deserialize.bind(i)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",i=>this.emit("error",i)),this.opts.store.namespace=this.opts.namespace;let s=i=>async function*(){for await(let[o,a]of typeof i=="function"?i(this.opts.store.namespace):i){let c=await this.opts.deserialize(a);if(!(this.opts.store.namespace&&!o.includes(this.opts.store.namespace))){if(typeof c.expires=="number"&&Date.now()>c.expires){this.delete(o);continue}yield[this._getKeyUnprefix(o),c.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=s(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=s(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return Md.includes(this.opts.store.opts.dialect)||Md.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){let{store:n}=this.opts,s=Array.isArray(e),i=s?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(s&&n.getMany===void 0){let o=[];for(let a of i)o.push(Promise.resolve().then(()=>n.get(a)).then(c=>typeof c=="string"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(a).then(()=>{}):r&&r.raw?c:c.value}));return Promise.allSettled(o).then(a=>{let c=[];for(let l of a)c.push(l.value);return c})}return Promise.resolve().then(()=>s?n.getMany(i):n.get(i)).then(o=>typeof o=="string"?this.opts.deserialize(o):this.opts.compression?this.opts.deserialize(o):o).then(o=>{if(o!=null)return s?o.map((a,c)=>{if(typeof a=="string"&&(a=this.opts.deserialize(a)),a!=null){if(typeof a.expires=="number"&&Date.now()>a.expires){this.delete(e[c]).then(()=>{});return}return r&&r.raw?a:a.value}}):typeof o.expires=="number"&&Date.now()>o.expires?this.delete(e).then(()=>{}):r&&r.raw?o:o.value})}set(e,r,n){let s=this._getKeyPrefix(e);typeof n>"u"&&(n=this.opts.ttl),n===0&&(n=void 0);let{store:i}=this.opts;return Promise.resolve().then(()=>{let o=typeof n=="number"?Date.now()+n:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:o},this.opts.serialize(r)}).then(o=>i.set(s,o,n)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let s=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let i=[];for(let o of s)i.push(r.delete(o));return Promise.allSettled(i).then(o=>o.every(a=>a.value===!0))}return Promise.resolve().then(()=>r.deleteMany(s))}let n=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(n))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(r):await n.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};Ld.exports=Ja});var Bd=v((fC,Vd)=>{"use strict";u();var Hv=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];Vd.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(Hv)),n={};for(let s of r)s in e||(n[s]={get(){let i=t[s];return typeof i=="function"?i.bind(t):i},set(i){t[s]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var Wd=v((hC,Gd)=>{"use strict";u();var{Transform:Vv,PassThrough:Bv}=R("stream"),Za=R("zlib"),Gv=Bd();Gd.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof Za.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let n=!0,s=new Vv({transform(a,c,l){n=!1,l(null,a)},flush(a){a()}}),i=new Bv({autoDestroy:!1,destroy(a,c){t.destroy(),c(a)}}),o=r?Za.createBrotliDecompress():Za.createUnzip();return o.once("error",a=>{if(n&&!t.readable){i.end();return}i.destroy(a)}),Gv(t,i),t.pipe(s).pipe(o).pipe(i),i}});var fc=v((vN,ch)=>{"use strict";u();var lc=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[n,s]of this.oldCache.entries())this.onEviction(n,s);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};ch.exports=lc});var dc=v((SN,uh)=>{"use strict";u();uh.exports=t=>{if(t.listenerCount("error")!==0)return t;t.__destroy=t._destroy,t._destroy=(...r)=>{let n=r.pop();t.__destroy(...r,async s=>{await Promise.resolve(),n(s)})};let e=r=>{Promise.resolve().then(()=>{t.emit("error",r)})};return t.once("error",e),Promise.resolve().then(()=>{t.off("error",e)}),t}});var Wt=v((PN,mh)=>{"use strict";u();var{URL:lh}=R("url"),hE=R("events"),pE=R("tls"),mE=R("http2"),yE=fc(),gE=dc(),$e=Symbol("currentStreamCount"),fh=Symbol("request"),Pe=Symbol("cachedOriginSet"),kt=Symbol("gracefullyClosing"),ri=Symbol("length"),dh=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],_E=(t,e,r)=>{let n=0,s=t.length;for(;n<s;){let i=n+s>>>1;r(t[i],e)?n=i+1:s=i}return n},wE=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,hc=(t,e)=>{for(let r=0;r<t.length;r++){let n=t[r];n[Pe].length>0&&n[Pe].length<e[Pe].length&&n[Pe].every(s=>e[Pe].includes(s))&&n[$e]+e[$e]<=e.remoteSettings.maxConcurrentStreams&&ph(n)}},hh=(t,e)=>{for(let r=0;r<t.length;r++){let n=t[r];if(e[Pe].length>0&&e[Pe].length<n[Pe].length&&e[Pe].every(s=>n[Pe].includes(s))&&e[$e]+n[$e]<=n.remoteSettings.maxConcurrentStreams)return ph(e),!0}return!1},ph=t=>{t[kt]=!0,t[$e]===0&&t.close()},Rr=class t extends hE{constructor({timeout:e=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:n=10,maxCachedTlsSessions:s=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxEmptySessions=n,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new yE({maxSize:s})}get protocol(){return"https:"}normalizeOptions(e){let r="";for(let n=0;n<dh.length;n++){let s=dh[n];r+=":",e&&e[s]!==void 0&&(r+=e[s])}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let e in this.queue)for(let r in this.queue[e]){let n=this.queue[e][r];n.completed||(n.completed=!0,n())}}_isBetterSession(e,r){return e>r}_accept(e,r,n,s){let i=0;for(;i<r.length&&e[$e]<e.remoteSettings.maxConcurrentStreams;)r[i].resolve(e),i++;r.splice(0,i),r.length>0&&(this.getSession(n,s,r),r.length=0)}getSession(e,r,n){return new Promise((s,i)=>{Array.isArray(n)&&n.length>0?(n=[...n],s()):n=[{resolve:s,reject:i}];try{if(typeof e=="string")e=new lh(e);else if(!(e instanceof lh))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(r){let{servername:f}=r,{hostname:d}=e;if(f&&d!==f)throw new Error(`Origin ${d} differs from servername ${f}`)}}catch(f){for(let d=0;d<n.length;d++)n[d].reject(f);return}let o=this.normalizeOptions(r),a=e.origin;if(o in this.sessions){let f=this.sessions[o],d=-1,p=-1,y;for(let g=0;g<f.length;g++){let h=f[g],b=h.remoteSettings.maxConcurrentStreams;if(b<d)break;if(!h[Pe].includes(a))continue;let w=h[$e];w>=b||h[kt]||h.destroyed||(y||(d=b),this._isBetterSession(w,p)&&(y=h,p=w))}if(y){this._accept(y,n,a,r);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...n);return}}else this.queue[o]={[ri]:0};let c=()=>{o in this.queue&&this.queue[o][a]===l&&(delete this.queue[o][a],--this.queue[o][ri]===0&&delete this.queue[o])},l=async()=>{this._sessionCount++;let f=`${a}:${o}`,d=!1,p;try{let y={...r};y.settings===void 0&&(y.settings=this.settings),y.session===void 0&&(y.session=this.tlsSessionCache.get(f)),p=await(y.createConnection||this.createConnection).call(this,e,y),y.createConnection=()=>p;let h=mE.connect(e,y);h[$e]=0,h[kt]=!1;let b=()=>{let{socket:E}=h,S;return E.servername===!1?(E.servername=E.remoteAddress,S=h.originSet,E.servername=!1):S=h.originSet,S},w=()=>h[$e]<h.remoteSettings.maxConcurrentStreams;h.socket.once("session",E=>{this.tlsSessionCache.set(f,E)}),h.once("error",E=>{for(let S=0;S<n.length;S++)n[S].reject(E);this.tlsSessionCache.delete(f)}),h.setTimeout(this.timeout,()=>{h.destroy()}),h.once("close",()=>{if(this._sessionCount--,d){this._emptySessionCount--;let E=this.sessions[o];E.length===1?delete this.sessions[o]:E.splice(E.indexOf(h),1)}else{c();let E=new Error("Session closed without receiving a SETTINGS frame");E.code="HTTP2WRAPPER_NOSETTINGS";for(let S=0;S<n.length;S++)n[S].reject(E)}this._processQueue()});let P=()=>{let E=this.queue[o];if(!E)return;let S=h[Pe];for(let T=0;T<S.length;T++){let D=S[T];if(D in E){let{listeners:C,completed:be}=E[D],k=0;for(;k<C.length&&w();)C[k].resolve(h),k++;if(E[D].listeners.splice(0,k),E[D].listeners.length===0&&!be&&(delete E[D],--E[ri]===0)){delete this.queue[o];break}if(!w())break}}};h.on("origin",()=>{h[Pe]=b()||[],h[kt]=!1,hh(this.sessions[o],h),!(h[kt]||!w())&&(P(),w()&&hc(this.sessions[o],h))}),h.once("remoteSettings",()=>{if(l.destroyed){let E=new Error("Agent has been destroyed");for(let S=0;S<n.length;S++)n[S].reject(E);h.destroy();return}if(h.setLocalWindowSize&&h.setLocalWindowSize(1024*1024*4),h[Pe]=b()||[],h.socket.encrypted){let E=h[Pe][0];if(E!==a){let S=new Error(`Requested origin ${a} does not match server ${E}`);for(let T=0;T<n.length;T++)n[T].reject(S);h.destroy();return}}c();{let E=this.sessions;if(o in E){let S=E[o];S.splice(_E(S,h,wE),0,h)}else E[o]=[h]}d=!0,this._emptySessionCount++,this.emit("session",h),this._accept(h,n,a,r),h[$e]===0&&this._emptySessionCount>this.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),h.on("remoteSettings",()=>{w()&&(P(),w()&&hc(this.sessions[o],h))})}),h[fh]=h.request,h.request=(E,S)=>{if(h[kt])throw new Error("The session is gracefully closing. No new streams are allowed.");let T=h[fh](E,S);return h.ref(),h[$e]++===0&&this._emptySessionCount--,T.once("close",()=>{if(--h[$e]===0&&(this._emptySessionCount++,h.unref(),this._emptySessionCount>this.maxEmptySessions||h[kt])){h.close();return}h.destroyed||h.closed||w()&&!hh(this.sessions[o],h)&&(hc(this.sessions[o],h),P(),h[$e]===0&&this._processQueue())}),T}}catch(y){c(),this._sessionCount--;for(let g=0;g<n.length;g++)n[g].reject(y)}};l.listeners=n,l.completed=!1,l.destroyed=!1,this.queue[o][a]=l,this.queue[o][ri]++,this._processQueue()})}request(e,r,n,s){return new Promise((i,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{let c=a.request(n,s);gE(c),i(c)}catch(c){o(c)}}}])})}async createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let n=e.port||443,s=e.hostname;typeof r.servername>"u"&&(r.servername=s);let i=pE.connect(n,s,r);return r.socket&&(i._peername={family:void 0,address:void 0,port:n}),i}closeEmptySessions(e=Number.POSITIVE_INFINITY){let r=0,{sessions:n}=this;for(let s in n){let i=n[s];for(let o=0;o<i.length;o++){let a=i[o];if(a[$e]===0&&(r++,a.close(),r>=e))return r}}return r}destroy(e){let{sessions:r,queue:n}=this;for(let s in r){let i=r[s];for(let o=0;o<i.length;o++)i[o].destroy(e)}for(let s in n){let i=n[s];for(let o in i)i[o].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};Rr.kCurrentStreamCount=$e;Rr.kGracefullyClosing=kt;mh.exports={Agent:Rr,globalAgent:new Rr}});var mc=v((TN,yh)=>{"use strict";u();var{Readable:bE}=R("stream"),pc=class extends bE{constructor(e,r){super({emitClose:!1,autoDestroy:!0,highWaterMark:r}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this._dumped=!1}get connection(){return this.socket}set connection(e){this.socket=e}_destroy(e,r){this.readableEnded||(this.aborted=!0),r(),this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};yh.exports=pc});var _h=v((xN,gh)=>{"use strict";u();gh.exports=(t,e,r)=>{for(let n of r)t.on(n,(...s)=>e.emit(n,...s))}});var Mn=v((NN,wh)=>{"use strict";u();var Kt=(t,e,r)=>{wh.exports[e]=class extends t{constructor(...s){super(typeof r=="string"?r:r(s)),this.name=`${super.name} [${e}]`,this.code=e}}};Kt(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let e=t[0].includes(".")?"property":"argument",r=t[1],n=Array.isArray(r);return n&&(r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`),`The "${t[0]}" ${e} must be ${n?"one of":"of"} type ${r}. Received ${typeof t[2]}`});Kt(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`);Kt(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`);Kt(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);Kt(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`);Kt(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`);Kt(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")});var vh=v((jN,bh)=>{"use strict";u();bh.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var yc=v((qN,Eh)=>{"use strict";u();var{ERR_INVALID_HTTP_TOKEN:vE}=Mn(),EE=vh(),SE=/^[\^`\-\w!#$%&*+.|~]+$/;Eh.exports=t=>{if(typeof t!="string"||!SE.test(t)&&!EE(t))throw new vE("Header name",t)}});var gc=v((MN,Sh)=>{"use strict";u();var{ERR_HTTP_INVALID_HEADER_VALUE:$E,ERR_INVALID_CHAR:PE}=Mn(),OE=/[^\t\u0020-\u007E\u0080-\u00FF]/;Sh.exports=(t,e)=>{if(typeof e>"u")throw new $E(e,t);if(OE.test(e))throw new PE("header content",t)}});var Oh=v((FN,Ph)=>{"use strict";u();var{ERR_HTTP2_NO_SOCKET_MANIPULATION:$h}=Mn(),TE={has(t,e){let r=t.session===void 0?t:t.session.socket;return e in t||e in r},get(t,e){switch(e){case"on":case"once":case"end":case"emit":case"destroy":return t[e].bind(t);case"writable":case"destroyed":return t[e];case"readable":return t.destroyed?!1:t.readable;case"setTimeout":{let{session:r}=t;return r!==void 0?r.setTimeout.bind(r):t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new $h;default:{let r=t.session===void 0?t:t.session.socket,n=r[e];return typeof n=="function"?n.bind(r):n}}},getPrototypeOf(t){return t.session!==void 0?Reflect.getPrototypeOf(t.session.socket):Reflect.getPrototypeOf(t)},set(t,e,r){switch(e){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return t[e]=r,!0;case"setTimeout":{let{session:n}=t;return n===void 0?t.setTimeout=r:n.setTimeout=r,!0}case"write":case"read":case"pause":case"resume":throw new $h;default:{let n=t.session===void 0?t:t.session.socket;return n[e]=r,!0}}}};Ph.exports=TE});var vc=v((UN,Nh)=>{"use strict";u();var{URL:_c,urlToHttpOptions:Th}=R("url"),kE=R("http2"),{Writable:xE}=R("stream"),{Agent:RE,globalAgent:CE}=Wt(),NE=mc(),AE=_h(),{ERR_INVALID_ARG_TYPE:ni,ERR_INVALID_PROTOCOL:jE,ERR_HTTP_HEADERS_SENT:kh}=Mn(),IE=yc(),qE=gc(),DE=Oh(),{HTTP2_HEADER_STATUS:xh,HTTP2_HEADER_METHOD:Rh,HTTP2_HEADER_PATH:Ch,HTTP2_HEADER_AUTHORITY:Ln,HTTP2_METHOD_CONNECT:ME}=kE.constants,he=Symbol("headers"),Cr=Symbol("origin"),Fn=Symbol("session"),wc=Symbol("options"),si=Symbol("flushedHeaders"),Nr=Symbol("jobs"),zn=Symbol("pendingAgentPromise"),bc=class extends xE{constructor(e,r,n){if(super({autoDestroy:!1,emitClose:!1}),typeof e=="string"?e=Th(new _c(e)):e instanceof _c?e=Th(e):e={...e},typeof r=="function"||r===void 0?(n=r,r=e):r=Object.assign(e,r),r.h2session){if(this[Fn]=r.h2session,this[Fn].destroyed)throw new Error("The session has been closed already");this.protocol=this[Fn].socket.encrypted?"https:":"http:"}else if(r.agent===!1)this.agent=new RE({maxEmptySessions:0});else if(typeof r.agent>"u"||r.agent===null)this.agent=CE;else if(typeof r.agent.request=="function")this.agent=r.agent;else throw new ni("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent);if(this.agent&&(this.protocol=this.agent.protocol),r.protocol&&r.protocol!==this.protocol)throw new jE(r.protocol,this.protocol);r.port||(r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443),r.host=r.hostname||r.host||"localhost",delete r.hostname;let{timeout:s}=r;r.timeout=void 0,this[he]=Object.create(null),this[Nr]=[],this[zn]=void 0,this.socket=null,this.connection=null,this.method=r.method||"GET",this.method==="CONNECT"&&(r.path==="/"||r.path===void 0)||(this.path=r.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:i}=r;if(i)for(let a in i)this.setHeader(a,i[a]);r.auth&&!("authorization"in this[he])&&(this[he].authorization="Basic "+Buffer.from(r.auth).toString("base64")),r.session=r.tlsSession,r.path=r.socketPath,this[wc]=r,this[Cr]=new _c(`${this.protocol}//${r.servername||r.host}:${r.port}`);let o=r._reuseSocket;o&&(r.createConnection=(...a)=>o.destroyed?this.agent.createConnection(...a):o,this.agent.getSession(this[Cr],this[wc]).catch(()=>{})),s&&this.setTimeout(s),n&&this.once("response",n),this[si]=!1}get method(){return this[he][Rh]}set method(e){e&&(this[he][Rh]=e.toUpperCase())}get path(){let e=this.method==="CONNECT"?Ln:Ch;return this[he][e]}set path(e){if(e){let r=this.method==="CONNECT"?Ln:Ch;this[he][r]=e}}get host(){return this[Cr].hostname}set host(e){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,r,n){if(this._mustNotHaveABody){n(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let s=()=>this._request.write(e,r,n);this._request?s():this[Nr].push(s)}_final(e){this.flushHeaders();let r=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){e();return}this._request.end(e)};this._request?r():this[Nr].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(e,r){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[zn]}catch(n){this.aborted&&(e=n)}r(e)}async flushHeaders(){if(this[si]||this.destroyed)return;this[si]=!0;let e=this.method===ME,r=n=>{if(this._request=n,this.destroyed){n.destroy();return}e||AE(n,this,["timeout","continue"]),n.once("error",i=>{this.destroy(i)}),n.once("aborted",()=>{let{res:i}=this;i?(i.aborted=!0,i.emit("aborted"),i.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let s=(i,o,a)=>{let c=new NE(this.socket,n.readableHighWaterMark);this.res=c,c.url=`${this[Cr].origin}${this.path}`,c.req=this,c.statusCode=i[xh],c.headers=i,c.rawHeaders=a,c.once("end",()=>{c.complete=!0,c.socket=null,c.connection=null}),e?(c.upgrade=!0,this.emit("connect",c,n,Buffer.alloc(0))?this.emit("close"):n.destroy()):(n.on("data",l=>{!c._dumped&&!c.push(l)&&n.pause()}),n.once("end",()=>{this.aborted||c.push(null)}),this.emit("response",c)||c._dump())};n.once("response",s),n.once("headers",i=>this.emit("information",{statusCode:i[xh]})),n.once("trailers",(i,o,a)=>{let{res:c}=this;if(c===null){s(i,o,a);return}c.trailers=i,c.rawTrailers=a}),n.once("close",()=>{let{aborted:i,res:o}=this;if(o){i&&(o.aborted=!0,o.emit("aborted"),o.destroy());let a=()=>{o.emit("close"),this.destroy(),this.emit("close")};o.readable?o.once("end",a):a();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(n,DE);for(let i of this[Nr])i();this[Nr].length=0,this.emit("socket",this.socket)};if(!(Ln in this[he])&&!e&&(this[he][Ln]=this[Cr].host),this[Fn])try{r(this[Fn].request(this[he]))}catch(n){this.destroy(n)}else{this.reusedSocket=!0;try{let n=this.agent.request(this[Cr],this[wc],this[he]);this[zn]=n,r(await n),this[zn]=!1}catch(n){this[zn]=!1,this.destroy(n)}}}get connection(){return this.socket}set connection(e){this.socket=e}getHeaderNames(){return Object.keys(this[he])}hasHeader(e){if(typeof e!="string")throw new ni("name","string",e);return!!this[he][e.toLowerCase()]}getHeader(e){if(typeof e!="string")throw new ni("name","string",e);return this[he][e.toLowerCase()]}get headersSent(){return this[si]}removeHeader(e){if(typeof e!="string")throw new ni("name","string",e);if(this.headersSent)throw new kh("remove");delete this[he][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new kh("set");IE(e),qE(e,r);let n=e.toLowerCase();if(n==="connection"){if(r.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${r}`)}n==="host"&&this.method==="CONNECT"?this[he][Ln]=r:this[he][n]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let n=()=>this._request.setTimeout(e,r);return this._request?n():this[Nr].push(n),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Nh.exports=bc});var jh=v((VN,Ah)=>{"use strict";u();var LE=R("tls");Ah.exports=(t={},e=LE.connect)=>new Promise((r,n)=>{let s=!1,i,o=async()=>{await c,i.off("timeout",a),i.off("error",n),t.resolveSocket?(r({alpnProtocol:i.alpnProtocol,socket:i,timeout:s}),s&&(await Promise.resolve(),i.emit("timeout"))):(i.destroy(),r({alpnProtocol:i.alpnProtocol,timeout:s}))},a=async()=>{s=!0,o()},c=(async()=>{try{i=await e(t,o),i.on("error",n),i.once("timeout",a)}catch(l){n(l)}})()})});var qh=v((GN,Ih)=>{"use strict";u();var{isIP:FE}=R("net"),zE=R("assert"),UE=t=>{if(t[0]==="["){let r=t.indexOf("]");return zE(r!==-1),t.slice(1,r)}let e=t.indexOf(":");return e===-1?t:t.slice(0,e)};Ih.exports=t=>{let e=UE(t);return FE(e)?"":e}});var Vh=v((KN,Un)=>{"use strict";u();var{URL:Dh,urlToHttpOptions:Mh}=R("url"),Lh=R("http"),Ec=R("https"),HE=jh(),VE=fc(),{Agent:BE,globalAgent:GE}=Wt(),WE=vc(),KE=qh(),Fh=dc(),zh=new VE({maxSize:100}),JE=new Map,YE=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let n=()=>{t.emit("free",e,r)};e.on("free",n);let s=()=>{t.removeSocket(e,r)};e.on("close",s);let i=()=>{let{freeSockets:a}=t;for(let c of Object.values(a))if(c.includes(e)){e.destroy();return}};e.on("timeout",i);let o=()=>{t.removeSocket(e,r),e.off("close",s),e.off("free",n),e.off("timeout",i),e.off("agentRemove",o)};e.on("agentRemove",o),t.emit("free",e,r)},Uh=(t,e=new Map,r=void 0)=>async n=>{let s=`${n.host}:${n.port}:${n.ALPNProtocols.sort()}`;if(!t.has(s)){if(e.has(s))return{alpnProtocol:(await e.get(s)).alpnProtocol};let{path:i}=n;n.path=n.socketPath;let o=HE(n,r);e.set(s,o);try{let a=await o;return t.set(s,a.alpnProtocol),e.delete(s),n.path=i,a}catch(a){throw e.delete(s),n.path=i,a}}return{alpnProtocol:t.get(s)}},Hh=Uh(zh,JE);Un.exports=async(t,e,r)=>{if(typeof t=="string"?t=Mh(new Dh(t)):t instanceof Dh?t=Mh(t):t={...t},typeof e=="function"||e===void 0?(r=e,e=t):e=Object.assign(t,e),e.ALPNProtocols=e.ALPNProtocols||["h2","http/1.1"],!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let n=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||KE(e.headers&&e.headers.host||e.host),e.port=e.port||(n?443:80),e._defaultAgent=n?Ec.globalAgent:Lh.globalAgent;let s=e.resolveProtocol||Hh,{agent:i}=e;if(i!==void 0&&i!==!1&&i.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(n){e.resolveSocket=!0;let{socket:o,alpnProtocol:a,timeout:c}=await s(e);if(c){o&&o.destroy();let f=new Error(`Timed out resolving ALPN: ${e.timeout} ms`);throw f.code="ETIMEDOUT",f.ms=e.timeout,f}o&&e.createConnection&&(o.destroy(),o=void 0),delete e.resolveSocket;let l=a==="h2";if(i&&(i=l?i.http2:i.https,e.agent=i),i===void 0&&(i=l?GE:Ec.globalAgent),o)if(i===!1)o.destroy();else{let f=(l?BE:Ec.Agent).prototype.createConnection;i.createConnection===f?l?e._reuseSocket=o:YE(i,o,e):o.destroy()}if(l)return Fh(new WE(e,r))}else i&&(e.agent=i.http);return e.headers&&(e.headers={...e.headers},e.headers[":authority"]&&(e.headers.host||(e.headers.host=e.headers[":authority"]),delete e.headers[":authority"]),delete e.headers[":method"],delete e.headers[":scheme"],delete e.headers[":path"]),Fh(Lh.request(e,r))};Un.exports.protocolCache=zh;Un.exports.resolveProtocol=Hh;Un.exports.createResolveProtocol=Uh});var Sc=v((YN,Bh)=>{"use strict";u();var QE=R("stream"),XE=R("tls"),ZE=new XE.TLSSocket(new QE.PassThrough)._handle._parentWrap.constructor;Bh.exports=ZE});var Pc=v((XN,Gh)=>{"use strict";u();var $c=class extends Error{constructor(e,r=""){super(`The proxy server rejected the request with status code ${e} (${r||"empty status message"})`),this.statusCode=e,this.statusMessage=r}};Gh.exports=$c});var Kh=v((e1,Wh)=>{"use strict";u();var eS=(t,e,r)=>{if(!r.some(s=>typeof s==="string"?typeof e===s:e instanceof s)){let s=r.map(i=>typeof i=="string"?i:i.name);throw new TypeError(`Expected '${t}' to be a type of ${s.join(" or ")}, got ${typeof e}`)}};Wh.exports=eS});var Oc=v((r1,Yh)=>{"use strict";u();var{URL:Jh}=R("url"),ii=Kh();Yh.exports=(t,e)=>{ii("proxyOptions",e,["object"]),ii("proxyOptions.headers",e.headers,["object","undefined"]),ii("proxyOptions.raw",e.raw,["boolean","undefined"]),ii("proxyOptions.url",e.url,[Jh,"string"]);let r=new Jh(e.url);t.proxyOptions={raw:!0,...e,headers:{...e.headers},url:r}}});var oi=v((s1,Qh)=>{"use strict";u();Qh.exports=t=>{let{username:e,password:r}=t.proxyOptions.url;if(e||r){let n=`${e}:${r}`,s=`Basic ${Buffer.from(n).toString("base64")}`;return{"proxy-authorization":s,authorization:s}}return{}}});var rp=v((o1,tp)=>{"use strict";u();var tS=R("tls"),rS=R("http"),Xh=R("https"),nS=Sc(),{globalAgent:sS}=Wt(),iS=Pc(),Zh=Oc(),oS=oi(),ep=(t,e,r)=>{(async()=>{try{let{proxyOptions:n}=t,{url:s,headers:i,raw:o}=n,a=await sS.request(s,n,{...oS(t),...i,":method":"CONNECT",":authority":`${e.host}:${e.port}`});a.once("error",r),a.once("response",c=>{let l=c[":status"];if(l!==200){r(new iS(l,""));return}let f=t instanceof Xh.Agent;if(o&&f){e.socket=a;let p=tS.connect(e);p.once("close",()=>{a.destroy()}),r(null,p);return}let d=new nS(a);d.encrypted=!1,d._handle.getpeername=p=>{p.family=void 0,p.address=void 0,p.port=void 0},r(null,d)})}catch(n){r(n)}})()},Tc=class extends rS.Agent{constructor(e){super(e),Zh(this,e.proxyOptions)}createConnection(e,r){ep(this,e,r)}},kc=class extends Xh.Agent{constructor(e){super(e),Zh(this,e.proxyOptions)}createConnection(e,r){ep(this,e,r)}};tp.exports={HttpOverHttp2:Tc,HttpsOverHttp2:kc}});var Rc=v((c1,np)=>{"use strict";u();var{Agent:aS}=Wt(),cS=Sc(),uS=Pc(),lS=Oc(),xc=class extends aS{constructor(e){super(e),lS(this,e.proxyOptions)}async createConnection(e,r){let n=`${e.hostname}:${e.port||443}`,[s,i,o]=await this._getProxyStream(n);if(i!==200)throw new uS(i,o);if(this.proxyOptions.raw)r.socket=s;else{let a=new cS(s);return a.encrypted=!1,a._handle.getpeername=c=>{c.family=void 0,c.address=void 0,c.port=void 0},a}return super.createConnection(e,r)}};np.exports=xc});var ip=v((l1,sp)=>{"use strict";u();var{globalAgent:fS}=Wt(),dS=Rc(),hS=oi(),pS=t=>new Promise((e,r)=>{t.once("error",r),t.once("response",n=>{t.off("error",r),e(n[":status"])})}),Cc=class extends dS{async _getProxyStream(e){let{proxyOptions:r}=this,n={...hS(this),...r.headers,":method":"CONNECT",":authority":e},s=await fS.request(r.url,r,n),i=await pS(s);return[s,i,""]}};sp.exports=Cc});var ap=v((d1,op)=>{"use strict";u();var mS=R("http"),yS=R("https"),gS=Rc(),_S=oi(),wS=t=>new Promise((e,r)=>{let n=(s,i,o)=>{i.unshift(o),t.off("error",r),e([i,s.statusCode,s.statusMessage])};t.once("error",r),t.once("connect",n)}),ai=class extends gS{async _getProxyStream(e){let{proxyOptions:r}=this,{url:n,headers:s}=this.proxyOptions,o=(n.protocol==="https:"?yS:mS).request({...r,hostname:n.hostname,port:n.port,path:e,headers:{..._S(this),...s,host:e},method:"CONNECT"}).end();return wS(o)}};op.exports={Http2OverHttp:ai,Http2OverHttps:ai}});var up=v((p1,cp)=>{"use strict";u();var bS=R("http2"),{Agent:vS,globalAgent:ES}=Wt(),Nc=vc(),SS=mc(),$S=Vh(),{HttpOverHttp2:PS,HttpsOverHttp2:OS}=rp(),TS=ip(),{Http2OverHttp:kS,Http2OverHttps:xS}=ap(),RS=yc(),CS=gc(),NS=(t,e,r)=>new Nc(t,e,r),AS=(t,e,r)=>{let n=new Nc(t,e,r);return n.end(),n};cp.exports={...bS,ClientRequest:Nc,IncomingMessage:SS,Agent:vS,globalAgent:ES,request:NS,get:AS,auto:$S,proxies:{HttpOverHttp2:PS,HttpsOverHttp2:OS,Http2OverHttp2:TS,Http2OverHttp:kS,Http2OverHttps:xS},validateHeaderName:RS,validateHeaderValue:CS}});var Mc=v(Yt=>{u();Yt.parse=Yt.decode=l$;Yt.stringify=Yt.encode=Sp;Yt.safe=jr;Yt.unsafe=pi;var Dc=typeof process<"u"&&process.platform==="win32"?`\r
9
9
  `:`
10
- `;function Ep(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var s=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(i,o,a){var c=t[i];c&&Array.isArray(c)?c.forEach(function(l){n+=jr(i+"[]")+s+jr(l)+`
11
- `}):c&&typeof c=="object"?r.push(i):n+=jr(i)+s+jr(c)+qc}),e.section&&n.length&&(n="["+jr(e.section)+"]"+qc+n),r.forEach(function(i,o,a){var c=Sp(i).join("\\."),l=(e.section?e.section+".":"")+c,f=Ep(t[i],{section:l,whitespace:e.whitespace});n.length&&f.length&&(n+=qc),n+=f}),n}function Sp(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function c$(t){var e={},r=e,n=null,s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,i=t.split(/[\r\n]+/g);return i.forEach(function(o,a,c){if(!(!o||o.match(/^\s*[;#]/))){var l=o.match(s);if(l){if(l[1]!==void 0){if(n=hi(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var f=hi(l[2]);if(f!=="__proto__"){var d=l[3]?hi(l[4]):!0;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(f.length>2&&f.slice(-2)==="[]"){if(f=f.substring(0,f.length-2),f==="__proto__")return;r[f]?Array.isArray(r[f])||(r[f]=[r[f]]):r[f]=[]}Array.isArray(r[f])?r[f].push(d):r[f]=d}}}}),Object.keys(e).filter(function(o,a,c){if(!e[o]||typeof e[o]!="object"||Array.isArray(e[o]))return!1;var l=Sp(o),f=e,d=l.pop(),p=d.replace(/\\\./g,".");return l.forEach(function(y,g,h){y!=="__proto__"&&((!f[y]||typeof f[y]!="object")&&(f[y]={}),f=f[y])}),f===e&&p===d?!1:(f[p]=e[o],!0)}).forEach(function(o,a,c){delete e[o]}),e}function $p(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function jr(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&$p(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function hi(t,e){if(t=(t||"").trim(),$p(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",s=0,i=t.length;s<i;s++){var o=t.charAt(s);if(r)"\\;#".indexOf(o)!==-1?n+=o:n+="\\"+o,r=!1;else{if(";#".indexOf(o)!==-1)break;o==="\\"?r=!0:n+=o}}return r&&(n+="\\"),n.trim()}return t}});var Tp=v((j1,Op)=>{"use strict";u();var Mc=1,Pp=2;function u$(){return""}function l$(t,e,r){return t.slice(e,r).replace(/\S/g," ")}Op.exports=function(t,e){e=e||{};for(var r,n,s=!1,i=!1,o=0,a="",c=e.whitespace===!1?u$:l$,l=0;l<t.length;l++){if(r=t[l],n=t[l+1],!i&&r==='"'){var f=t[l-1]==="\\"&&t[l-2]!=="\\";f||(s=!s)}if(!s){if(!i&&r+n==="//")a+=t.slice(o,l),o=l,i=Mc,l++;else if(i===Mc&&r+n===`\r
12
- `){l++,i=!1,a+=c(t,o,l),o=l;continue}else if(i===Mc&&r===`
13
- `)i=!1,a+=c(t,o,l),o=l;else if(!i&&r+n==="/*"){a+=t.slice(o,l),o=l,i=Pp,l++;continue}else if(i===Pp&&r+n==="*/"){l++,i=!1,a+=c(t,o,l+1),o=l+1;continue}}}return a+(i?c(t.substr(o)):t.substr(o))}});var xp=v(Ir=>{"use strict";u();var kp=R("fs"),f$=Dc(),Vn=R("path"),d$=Tp(),h$=Ir.parse=function(t){return/^\s*{/.test(t)?JSON.parse(d$(t)):f$.parse(t)},p$=Ir.file=function(){var t=[].slice.call(arguments).filter(function(s){return s!=null});for(var e in t)if(typeof t[e]!="string")return;var r=Vn.join.apply(null,t),n;try{return kp.readFileSync(r,"utf-8")}catch{return}},q1=Ir.json=function(){var t=p$.apply(null,arguments);return t?h$(t):null},D1=Ir.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var s in e)if(s.toLowerCase().indexOf(t.toLowerCase())===0){for(var i=s.substring(n).split("__"),o;(o=i.indexOf(""))>-1;)i.splice(o,1);var a=r;i.forEach(function(l,f){!l||typeof a!="object"||(f===i.length-1&&(a[l]=e[s]),a[l]===void 0&&(a[l]={}),a=a[l])})}return r},M1=Ir.find=function(){var t=Vn.join.apply(null,[].slice.call(arguments));function e(r,n){var s=Vn.join(r,n);try{return kp.statSync(s),s}catch{if(Vn.dirname(r)!==r)return e(Vn.dirname(r),n)}}return e(process.cwd(),t)}});var Ip=v((z1,jp)=>{"use strict";u();function Cp(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Np(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Ap(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Ap(r):Cp(r)?e[n]=Np(r):e[n]=Lc({},r):e[n]=r}),e}function Rp(t,e){return e==="__proto__"?void 0:t[e]}var Lc=jp.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,s;return e.forEach(function(i){typeof i!="object"||i===null||Array.isArray(i)||Object.keys(i).forEach(function(o){if(n=Rp(t,o),r=Rp(i,o),r!==t)if(typeof r!="object"||r===null){t[o]=r;return}else if(Array.isArray(r)){t[o]=Ap(r);return}else if(Cp(r)){t[o]=Np(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[o]=Lc({},r);return}else{t[o]=Lc(n,r);return}})}),t}});var Lp=v((H1,Mp)=>{"use strict";u();function m$(t,e){var r=t;e.slice(0,-1).forEach(function(s){r=r[s]||{}});var n=e[e.length-1];return n in r}function qp(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Dp(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Mp.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(S){r.bools[S]=!0});var n={};function s(S){return n[S].some(function(T){return r.bools[T]})}Object.keys(e.alias||{}).forEach(function(S){n[S]=[].concat(e.alias[S]),n[S].forEach(function(T){n[T]=[S].concat(n[S].filter(function(D){return T!==D}))})}),[].concat(e.string).filter(Boolean).forEach(function(S){r.strings[S]=!0,n[S]&&[].concat(n[S]).forEach(function(T){r.strings[T]=!0})});var i=e.default||{},o={_:[]};function a(S,T){return r.allBools&&/^--[^=]+$/.test(T)||r.strings[S]||r.bools[S]||n[S]}function c(S,T,D){for(var C=S,be=0;be<T.length-1;be++){var k=T[be];if(Dp(C,k))return;C[k]===void 0&&(C[k]={}),(C[k]===Object.prototype||C[k]===Number.prototype||C[k]===String.prototype)&&(C[k]={}),C[k]===Array.prototype&&(C[k]=[]),C=C[k]}var A=T[T.length-1];Dp(C,A)||((C===Object.prototype||C===Number.prototype||C===String.prototype)&&(C={}),C===Array.prototype&&(C=[]),C[A]===void 0||r.bools[A]||typeof C[A]=="boolean"?C[A]=D:Array.isArray(C[A])?C[A].push(D):C[A]=[C[A],D])}function l(S,T,D){if(!(D&&r.unknownFn&&!a(S,D)&&r.unknownFn(D)===!1)){var C=!r.strings[S]&&qp(T)?Number(T):T;c(o,S.split("."),C),(n[S]||[]).forEach(function(be){c(o,be.split("."),C)})}}Object.keys(r.bools).forEach(function(S){l(S,i[S]===void 0?!1:i[S])});var f=[];t.indexOf("--")!==-1&&(f=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var d=0;d<t.length;d++){var p=t[d],y,g;if(/^--.+=/.test(p)){var h=p.match(/^--([^=]+)=([\s\S]*)$/);y=h[1];var b=h[2];r.bools[y]&&(b=b!=="false"),l(y,b,p)}else if(/^--no-.+/.test(p))y=p.match(/^--no-(.+)/)[1],l(y,!1,p);else if(/^--.+/.test(p))y=p.match(/^--(.+)/)[1],g=t[d+1],g!==void 0&&!/^(-|--)[^-]/.test(g)&&!r.bools[y]&&!r.allBools&&(!n[y]||!s(y))?(l(y,g,p),d+=1):/^(true|false)$/.test(g)?(l(y,g==="true",p),d+=1):l(y,r.strings[y]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var w=p.slice(1,-1).split(""),P=!1,E=0;E<w.length;E++){if(g=p.slice(E+2),g==="-"){l(w[E],g,p);continue}if(/[A-Za-z]/.test(w[E])&&g[0]==="="){l(w[E],g.slice(1),p),P=!0;break}if(/[A-Za-z]/.test(w[E])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){l(w[E],g,p),P=!0;break}if(w[E+1]&&w[E+1].match(/\W/)){l(w[E],p.slice(E+2),p),P=!0;break}else l(w[E],r.strings[w[E]]?"":!0,p)}y=p.slice(-1)[0],!P&&y!=="-"&&(t[d+1]&&!/^(-|--)[^-]/.test(t[d+1])&&!r.bools[y]&&(!n[y]||!s(y))?(l(y,t[d+1],p),d+=1):t[d+1]&&/^(true|false)$/.test(t[d+1])?(l(y,t[d+1]==="true",p),d+=1):l(y,r.strings[y]?"":!0,p))}else if((!r.unknownFn||r.unknownFn(p)!==!1)&&o._.push(r.strings._||!qp(p)?p:Number(p)),e.stopEarly){o._.push.apply(o._,t.slice(d+1));break}}return Object.keys(i).forEach(function(S){m$(o,S.split("."))||(c(o,S.split("."),i[S]),(n[S]||[]).forEach(function(T){c(o,T.split("."),i[S])}))}),e["--"]?o["--"]=f.slice():f.forEach(function(S){o._.push(S)}),o}});var Hp=v((B1,Up)=>{u();var Bn=xp(),qr=R("path").join,y$=Ip(),Fp="/etc",zp=process.platform==="win32",Gn=zp?process.env.USERPROFILE:process.env.HOME;Up.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Lp()(process.argv.slice(2))),e=(typeof e=="string"?Bn.json(e):e)||{},n=n||Bn.parse;var s=Bn.env(t+"_"),i=[e],o=[];function a(c){if(!(o.indexOf(c)>=0)){var l=Bn.file(c);l&&(i.push(n(l)),o.push(c))}}return zp||[qr(Fp,t,"config"),qr(Fp,t+"rc")].forEach(a),Gn&&[qr(Gn,".config",t,"config"),qr(Gn,".config",t),qr(Gn,"."+t,"config"),qr(Gn,"."+t+"rc")].forEach(a),a(Bn.find("."+t+"rc")),s.config&&a(s.config),r.config&&a(r.config),y$.apply(null,i.concat([s,r,o.length?{configs:o,config:o[o.length-1]}:void 0]))}});var Gp=v((J1,Bp)=>{u();var xt=R("constants"),g$=process.cwd,pi=null,_$=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return pi||(pi=g$.call(process)),pi};try{process.cwd()}catch{}typeof process.chdir=="function"&&(zc=process.chdir,process.chdir=function(t){pi=null,zc.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,zc));var zc;Bp.exports=w$;function w$(t){xt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,d,p){p&&process.nextTick(p)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,d,p,y){y&&process.nextTick(y)},t.lchownSync=function(){}),_$==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function d(p,y,g){var h=Date.now(),b=0;f(p,y,function w(P){if(P&&(P.code==="EACCES"||P.code==="EPERM")&&Date.now()-h<6e4){setTimeout(function(){t.stat(y,function(E,S){E&&E.code==="ENOENT"?f(p,y,w):g(P)})},b),b<100&&(b+=10);return}g&&g(P)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function d(p,y,g,h,b,w){var P;if(w&&typeof w=="function"){var E=0;P=function(S,T,D){if(S&&S.code==="EAGAIN"&&E<10)return E++,f.call(t,p,y,g,h,b,P);w.apply(this,arguments)}}return f.call(t,p,y,g,h,b,P)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(d,p,y,g,h){for(var b=0;;)try{return f.call(t,d,p,y,g,h)}catch(w){if(w.code==="EAGAIN"&&b<10){b++;continue}throw w}}})(t.readSync);function e(f){f.lchmod=function(d,p,y){f.open(d,xt.O_WRONLY|xt.O_SYMLINK,p,function(g,h){if(g){y&&y(g);return}f.fchmod(h,p,function(b){f.close(h,function(w){y&&y(b||w)})})})},f.lchmodSync=function(d,p){var y=f.openSync(d,xt.O_WRONLY|xt.O_SYMLINK,p),g=!0,h;try{h=f.fchmodSync(y,p),g=!1}finally{if(g)try{f.closeSync(y)}catch{}else f.closeSync(y)}return h}}function r(f){xt.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,p,y,g){f.open(d,xt.O_SYMLINK,function(h,b){if(h){g&&g(h);return}f.futimes(b,p,y,function(w){f.close(b,function(P){g&&g(w||P)})})})},f.lutimesSync=function(d,p,y){var g=f.openSync(d,xt.O_SYMLINK),h,b=!0;try{h=f.futimesSync(g,p,y),b=!1}finally{if(b)try{f.closeSync(g)}catch{}else f.closeSync(g)}return h}):f.futimes&&(f.lutimes=function(d,p,y,g){g&&process.nextTick(g)},f.lutimesSync=function(){})}function n(f){return f&&function(d,p,y){return f.call(t,d,p,function(g){l(g)&&(g=null),y&&y.apply(this,arguments)})}}function s(f){return f&&function(d,p){try{return f.call(t,d,p)}catch(y){if(!l(y))throw y}}}function i(f){return f&&function(d,p,y,g){return f.call(t,d,p,y,function(h){l(h)&&(h=null),g&&g.apply(this,arguments)})}}function o(f){return f&&function(d,p,y){try{return f.call(t,d,p,y)}catch(g){if(!l(g))throw g}}}function a(f){return f&&function(d,p,y){typeof p=="function"&&(y=p,p=null);function g(h,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),y&&y.apply(this,arguments)}return p?f.call(t,d,p,g):f.call(t,d,g)}}function c(f){return f&&function(d,p){var y=p?f.call(t,d,p):f.call(t,d);return y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),y}}function l(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}}});var Jp=v((Q1,Kp)=>{u();var Wp=R("stream").Stream;Kp.exports=b$;function b$(t){return{ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Wp.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),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 new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}t.open(this.path,this.flags,this.mode,function(f,d){if(f){i.emit("error",f),i.readable=!1;return}i.fd=d,i.emit("open",d),i._read()})}function r(n,s){if(!(this instanceof r))return new r(n,s);Wp.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,a=i.length;o<a;o++){var c=i[o];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Qp=v((Z1,Yp)=>{"use strict";u();Yp.exports=E$;var v$=Object.getPrototypeOf||function(t){return t.__proto__};function E$(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:v$(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var tm=v((tj,Vc)=>{u();var re=R("fs"),S$=Gp(),$$=Jp(),P$=Qp(),mi=R("util"),pe,gi;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),gi=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",gi="___graceful-fs.previous");function O$(){}function em(t,e){Object.defineProperty(t,pe,{get:function(){return e}})}var Qt=O$;mi.debuglog?Qt=mi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Qt=function(){var t=mi.format.apply(mi,arguments);t="GFS4: "+t.split(/\n/).join(`
14
- GFS4: `),console.error(t)});re[pe]||(Xp=global[pe]||[],em(re,Xp),re.close=(function(t){function e(r,n){return t.call(re,r,function(s){s||Zp(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,gi,{value:t}),e})(re.close),re.closeSync=(function(t){function e(r){t.apply(re,arguments),Zp()}return Object.defineProperty(e,gi,{value:t}),e})(re.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Qt(re[pe]),R("assert").equal(re[pe].length,0)}));var Xp;global[pe]||em(global,re[pe]);Vc.exports=Uc(P$(re));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!re.__patched&&(Vc.exports=Uc(re),re.__patched=!0);function Uc(t){S$(t),t.gracefulify=Uc,t.createReadStream=T,t.createWriteStream=D;var e=t.readFile;t.readFile=r;function r(k,A,L){return typeof A=="function"&&(L=A,A=null),ie(k,A,L);function ie(oe,ae,ee,ne){return e(oe,ae,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Dr([ie,[oe,ae,ee],K,ne||Date.now(),Date.now()]):typeof ee=="function"&&ee.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=s;function s(k,A,L,ie){return typeof L=="function"&&(ie=L,L=null),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return n(ae,ee,ne,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,A,L,ie){return typeof L=="function"&&(ie=L,L=null),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return i(ae,ee,ne,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(k,A,L,ie){return typeof L=="function"&&(ie=L,L=0),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return a(ae,ee,ne,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var f=/^v[0-5]\./;function d(k,A,L){typeof A=="function"&&(L=A,A=null);var ie=f.test(process.version)?function(ee,ne,K,ue){return l(ee,oe(ee,ne,K,ue))}:function(ee,ne,K,ue){return l(ee,ne,oe(ee,ne,K,ue))};return ie(k,A,L);function oe(ae,ee,ne,K){return function(ue,X){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?Dr([ie,[ae,ee,ne],ue,K||Date.now(),Date.now()]):(X&&X.sort&&X.sort(),typeof ne=="function"&&ne.call(this,ue,X))}}}if(process.version.substr(0,4)==="v0.8"){var p=$$(t);w=p.ReadStream,E=p.WriteStream}var y=t.ReadStream;y&&(w.prototype=Object.create(y.prototype),w.prototype.open=P);var g=t.WriteStream;g&&(E.prototype=Object.create(g.prototype),E.prototype.open=S),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(k){w=k},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return E},set:function(k){E=k},enumerable:!0,configurable:!0});var h=w;Object.defineProperty(t,"FileReadStream",{get:function(){return h},set:function(k){h=k},enumerable:!0,configurable:!0});var b=E;Object.defineProperty(t,"FileWriteStream",{get:function(){return b},set:function(k){b=k},enumerable:!0,configurable:!0});function w(k,A){return this instanceof w?(y.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function P(){var k=this;be(k.path,k.flags,k.mode,function(A,L){A?(k.autoClose&&k.destroy(),k.emit("error",A)):(k.fd=L,k.emit("open",L),k.read())})}function E(k,A){return this instanceof E?(g.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function S(){var k=this;be(k.path,k.flags,k.mode,function(A,L){A?(k.destroy(),k.emit("error",A)):(k.fd=L,k.emit("open",L))})}function T(k,A){return new t.ReadStream(k,A)}function D(k,A){return new t.WriteStream(k,A)}var C=t.open;t.open=be;function be(k,A,L,ie){return typeof L=="function"&&(ie=L,L=null),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return C(ae,ee,ne,function(X,xP){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}return t}function Dr(t){Qt("ENQUEUE",t[0].name,t[1]),re[pe].push(t),Hc()}var yi;function Zp(){for(var t=Date.now(),e=0;e<re[pe].length;++e)re[pe][e].length>2&&(re[pe][e][3]=t,re[pe][e][4]=t);Hc()}function Hc(){if(clearTimeout(yi),yi=void 0,re[pe].length!==0){var t=re[pe].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Qt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Qt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n)}else{var a=Date.now()-i,c=Math.max(i-s,1),l=Math.min(c*1.2,100);a>=l?(Qt("RETRY",e.name,r),e.apply(null,r.concat([s]))):re[pe].push(t)}yi===void 0&&(yi=setTimeout(Hc,0))}}});var rm=v(Mr=>{"use strict";u();var T$=Mr&&Mr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.readCAFileSync=void 0;var k$=T$(tm());function x$(t){try{let e=k$.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(s=>!!s.trim()).map(s=>`${s.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}Mr.readCAFileSync=x$});var nm=v(Xt=>{"use strict";u();var R$=Xt&&Xt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C$=Xt&&Xt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&R$(e,t,r)};Object.defineProperty(Xt,"__esModule",{value:!0});C$(rm(),Xt)});var om=v((aj,im)=>{u();im.exports=sm;function Zt(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function sm(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&Zt(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}sm.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&Zt(this.list[this.list.length-1],t),Zt(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&Zt(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return Zt(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&Zt(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)Zt(this.list[e],this.list[e+1]||this.root);return t}}});var lm=v((lt,um)=>{u();var am=om(),Wn=R("path"),_i=R("fs"),Bc=Dc(),Gc=R("events").EventEmitter,N$=R("url"),A$=R("http"),lt=um.exports=function(){for(var t=[].slice.call(arguments),e=new we;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?I$(r):r)}return e},uj=lt.find=function(){var t=Wn.join.apply(null,[].slice.call(arguments));function e(r,n){var s=Wn.join(r,n);try{return _i.statSync(s),s}catch{if(Wn.dirname(r)!==r)return e(Wn.dirname(r),n)}}return e(__dirname,t)},j$=lt.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return Bc.parse(t);else try{return JSON.parse(t)}catch{return Bc.parse(t)}},I$=lt.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Wn.join.apply(null,t),r;try{r=_i.readFileSync(e,"utf-8")}catch{return}return j$(r,e,"json")},lj=lt.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var s in e)s.indexOf(t)===0&&(r[s.substring(n)]=e[s]);return r};lt.ConfigChain=we;function we(){Gc.apply(this),am.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var cm={constructor:{value:we}};Object.keys(Gc.prototype).forEach(function(t){cm[t]=Object.getOwnPropertyDescriptor(Gc.prototype,t)});we.prototype=Object.create(am.prototype,cm);we.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,s=this.list.length;n<s;n++)delete this.list[n][t];return this};we.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};we.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};we.prototype.save=function(t,i,r){typeof i=="function"&&(r=i,i=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var s=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[s+a]=n.data[a]}),this}var i=i||n.type,o=n.data;return n.type==="json"?o=JSON.stringify(o):o=Bc.stringify(o),this._saving++,_i.writeFile(n.path,o,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};we.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),_i.readFile(t,"utf8",function(s,i){s&&this.emit("error",s),this.addString(i,t,e,n)}.bind(this)),this};we.prototype.addEnv=function(t,e,r){r=r||"env";var n=lt.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};we.prototype.addUrl=function(t,e,r){this._await();var n=N$.format(t);r=r||n;var s={__source__:r};return this.sources[r]={href:n,type:e},this.push(s),A$.request(t,function(i){var o=[],a=i.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,s.type=e),i.on("data",o.push.bind(o)).on("end",function(){this.addString(Buffer.concat(o),n,e,s)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};we.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};we.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};we.prototype.parse=lt.parse;we.prototype._await=function(){this._awaiting++};we.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var hm=v((dj,dm)=>{u();dm.exports=function(t){let e=t.indexOf(":");if(e===-1)return fm(t);let r=t.substr(0,e),n=t.substr(e+1);return`${r}:${fm(n)}`};function fm(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var pm=v(wi=>{"use strict";u();Object.defineProperty(wi,"__esModule",{value:!0});wi.envReplace=void 0;var q$=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function D$(t,e){return t.replace(q$,M$.bind(null,e))}wi.envReplace=D$;function M$(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let s=F$(t,n);if(s===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${s}`}var L$=/([^:-]+)(:?)-(.+)/;function F$(t,e){let r=e.match(L$);if(!r)return t[e];let[,n,s,i]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&s?i:t[n]:i}});var mm=v(bi=>{"use strict";u();Object.defineProperty(bi,"__esModule",{value:!0});bi.envReplace=void 0;var z$=pm();Object.defineProperty(bi,"envReplace",{enumerable:!0,get:function(){return z$.envReplace}})});var ym=v(Kn=>{"use strict";u();var U$=R("fs"),er=R("path"),{envReplace:Wc}=mm(),H$=t=>typeof t!="string"?t:Wc(t,process.env),V$=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),s=n.indexOf(er)!==-1,i=n.indexOf(Boolean)!==-1,o=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(i&&!o&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}let c=Wc(e,process.env);if((r.endsWith(":tokenHelper")||r==="tokenHelper")&&c!==e)throw new Error(`It is not allowed to use environment variables in the value of the ${r} setting.`);return e=c,s&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=er.resolve(process.env.HOME,e.substr(2))),e=er.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},B$=t=>{t=er.resolve(t);let e=!1;for(;er.basename(t)==="node_modules";)t=er.dirname(t),e=!0;if(e)return t;let r=(n,s)=>{let i=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&i.test(n))return s;try{let o=U$.readdirSync(n);if(o.includes("node_modules")||o.includes("package.json")||o.includes("package.json5")||o.includes("package.yaml")||o.includes("pnpm-workspace.yaml"))return n;let a=er.dirname(n);return a===n?s:r(a,s)}catch(o){if(n===s){if(o.code==="ENOENT")return s;throw o}return s}};return r(t,t)};Kn.envReplace=Wc;Kn.findPrefix=B$;Kn.parseField=V$;Kn.parseKey=H$});var wm=v(_m=>{"use strict";u();var tr=R("path"),G$=R("stream").Stream,vi=R("url"),W$=()=>{},K$=()=>[],gm=()=>{};_m.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:tr,cache:tr,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:tr,"global-style":Boolean,group:[Number,String],"https-proxy":[null,vi],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":tr,"init-author-name":String,"init-author-email":String,"init-author-url":["",vi],"init-license":String,"init-version":gm,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":K$(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:G$,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,gm],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:tr,production:Boolean,progress:Boolean,proxy:[null,!1,vi],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,vi],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:tr,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:tr,umask:W$,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Em=v((Ej,vm)=>{"use strict";u();var{readCAFileSync:J$}=nm(),bm=R("fs"),Kc=R("path"),{ConfigChain:Y$}=lm(),Q$=hm(),Jc=ym(),Yc=class extends Y${constructor(e,r){super(e),this.root=e,this._parseField=Jc.parseField.bind(null,r||wm())}add(e,r){try{for(let[n,s]of Object.entries(e)){let i=Jc.parseKey(n);i!==n&&delete e[n],e[i]=this._parseField(s,i)}}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let s=bm.readFileSync(e,"utf8");this.addString(s,e,"ini",n)}catch(s){if(s.code==="ENOENT")this.add({},n);else if(s.code!=="EISDIR")return`Issue while reading "${e}". ${s.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{if(!e[n])return;let s=Q$(n.substr(11)),i=e[n];r[s]=X$(s,i)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let s=this.get("global");this[s?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>Kc.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=Kc.resolve(e.prefix);else try{r=Jc.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=J$(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=Kc.resolve(this.get("prefix"));try{let n=bm.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};function X$(t,e){function r(n){return n.indexOf(`
10
+ `;function Sp(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var s=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(i,o,a){var c=t[i];c&&Array.isArray(c)?c.forEach(function(l){n+=jr(i+"[]")+s+jr(l)+`
11
+ `}):c&&typeof c=="object"?r.push(i):n+=jr(i)+s+jr(c)+Dc}),e.section&&n.length&&(n="["+jr(e.section)+"]"+Dc+n),r.forEach(function(i,o,a){var c=$p(i).join("\\."),l=(e.section?e.section+".":"")+c,f=Sp(t[i],{section:l,whitespace:e.whitespace});n.length&&f.length&&(n+=Dc),n+=f}),n}function $p(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function l$(t){var e={},r=e,n=null,s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,i=t.split(/[\r\n]+/g);return i.forEach(function(o,a,c){if(!(!o||o.match(/^\s*[;#]/))){var l=o.match(s);if(l){if(l[1]!==void 0){if(n=pi(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var f=pi(l[2]);if(f!=="__proto__"){var d=l[3]?pi(l[4]):!0;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(f.length>2&&f.slice(-2)==="[]"){if(f=f.substring(0,f.length-2),f==="__proto__")return;r[f]?Array.isArray(r[f])||(r[f]=[r[f]]):r[f]=[]}Array.isArray(r[f])?r[f].push(d):r[f]=d}}}}),Object.keys(e).filter(function(o,a,c){if(!e[o]||typeof e[o]!="object"||Array.isArray(e[o]))return!1;var l=$p(o),f=e,d=l.pop(),p=d.replace(/\\\./g,".");return l.forEach(function(y,g,h){y!=="__proto__"&&((!f[y]||typeof f[y]!="object")&&(f[y]={}),f=f[y])}),f===e&&p===d?!1:(f[p]=e[o],!0)}).forEach(function(o,a,c){delete e[o]}),e}function Pp(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function jr(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&Pp(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function pi(t,e){if(t=(t||"").trim(),Pp(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",s=0,i=t.length;s<i;s++){var o=t.charAt(s);if(r)"\\;#".indexOf(o)!==-1?n+=o:n+="\\"+o,r=!1;else{if(";#".indexOf(o)!==-1)break;o==="\\"?r=!0:n+=o}}return r&&(n+="\\"),n.trim()}return t}});var kp=v((MA,Tp)=>{"use strict";u();var Lc=1,Op=2;function f$(){return""}function d$(t,e,r){return t.slice(e,r).replace(/\S/g," ")}Tp.exports=function(t,e){e=e||{};for(var r,n,s=!1,i=!1,o=0,a="",c=e.whitespace===!1?f$:d$,l=0;l<t.length;l++){if(r=t[l],n=t[l+1],!i&&r==='"'){var f=t[l-1]==="\\"&&t[l-2]!=="\\";f||(s=!s)}if(!s){if(!i&&r+n==="//")a+=t.slice(o,l),o=l,i=Lc,l++;else if(i===Lc&&r+n===`\r
12
+ `){l++,i=!1,a+=c(t,o,l),o=l;continue}else if(i===Lc&&r===`
13
+ `)i=!1,a+=c(t,o,l),o=l;else if(!i&&r+n==="/*"){a+=t.slice(o,l),o=l,i=Op,l++;continue}else if(i===Op&&r+n==="*/"){l++,i=!1,a+=c(t,o,l+1),o=l+1;continue}}}return a+(i?c(t.substr(o)):t.substr(o))}});var Rp=v(Ir=>{"use strict";u();var xp=R("fs"),h$=Mc(),Vn=R("path"),p$=kp(),m$=Ir.parse=function(t){return/^\s*{/.test(t)?JSON.parse(p$(t)):h$.parse(t)},y$=Ir.file=function(){var t=[].slice.call(arguments).filter(function(s){return s!=null});for(var e in t)if(typeof t[e]!="string")return;var r=Vn.join.apply(null,t),n;try{return xp.readFileSync(r,"utf-8")}catch{return}},FA=Ir.json=function(){var t=y$.apply(null,arguments);return t?m$(t):null},zA=Ir.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var s in e)if(s.toLowerCase().indexOf(t.toLowerCase())===0){for(var i=s.substring(n).split("__"),o;(o=i.indexOf(""))>-1;)i.splice(o,1);var a=r;i.forEach(function(l,f){!l||typeof a!="object"||(f===i.length-1&&(a[l]=e[s]),a[l]===void 0&&(a[l]={}),a=a[l])})}return r},UA=Ir.find=function(){var t=Vn.join.apply(null,[].slice.call(arguments));function e(r,n){var s=Vn.join(r,n);try{return xp.statSync(s),s}catch{if(Vn.dirname(r)!==r)return e(Vn.dirname(r),n)}}return e(process.cwd(),t)}});var qp=v((BA,Ip)=>{"use strict";u();function Np(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Ap(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function jp(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=jp(r):Np(r)?e[n]=Ap(r):e[n]=Fc({},r):e[n]=r}),e}function Cp(t,e){return e==="__proto__"?void 0:t[e]}var Fc=Ip.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,s;return e.forEach(function(i){typeof i!="object"||i===null||Array.isArray(i)||Object.keys(i).forEach(function(o){if(n=Cp(t,o),r=Cp(i,o),r!==t)if(typeof r!="object"||r===null){t[o]=r;return}else if(Array.isArray(r)){t[o]=jp(r);return}else if(Np(r)){t[o]=Ap(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[o]=Fc({},r);return}else{t[o]=Fc(n,r);return}})}),t}});var Fp=v((WA,Lp)=>{"use strict";u();function g$(t,e){var r=t;e.slice(0,-1).forEach(function(s){r=r[s]||{}});var n=e[e.length-1];return n in r}function Dp(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Mp(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Lp.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(S){r.bools[S]=!0});var n={};function s(S){return n[S].some(function(T){return r.bools[T]})}Object.keys(e.alias||{}).forEach(function(S){n[S]=[].concat(e.alias[S]),n[S].forEach(function(T){n[T]=[S].concat(n[S].filter(function(D){return T!==D}))})}),[].concat(e.string).filter(Boolean).forEach(function(S){r.strings[S]=!0,n[S]&&[].concat(n[S]).forEach(function(T){r.strings[T]=!0})});var i=e.default||{},o={_:[]};function a(S,T){return r.allBools&&/^--[^=]+$/.test(T)||r.strings[S]||r.bools[S]||n[S]}function c(S,T,D){for(var C=S,be=0;be<T.length-1;be++){var k=T[be];if(Mp(C,k))return;C[k]===void 0&&(C[k]={}),(C[k]===Object.prototype||C[k]===Number.prototype||C[k]===String.prototype)&&(C[k]={}),C[k]===Array.prototype&&(C[k]=[]),C=C[k]}var A=T[T.length-1];Mp(C,A)||((C===Object.prototype||C===Number.prototype||C===String.prototype)&&(C={}),C===Array.prototype&&(C=[]),C[A]===void 0||r.bools[A]||typeof C[A]=="boolean"?C[A]=D:Array.isArray(C[A])?C[A].push(D):C[A]=[C[A],D])}function l(S,T,D){if(!(D&&r.unknownFn&&!a(S,D)&&r.unknownFn(D)===!1)){var C=!r.strings[S]&&Dp(T)?Number(T):T;c(o,S.split("."),C),(n[S]||[]).forEach(function(be){c(o,be.split("."),C)})}}Object.keys(r.bools).forEach(function(S){l(S,i[S]===void 0?!1:i[S])});var f=[];t.indexOf("--")!==-1&&(f=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var d=0;d<t.length;d++){var p=t[d],y,g;if(/^--.+=/.test(p)){var h=p.match(/^--([^=]+)=([\s\S]*)$/);y=h[1];var b=h[2];r.bools[y]&&(b=b!=="false"),l(y,b,p)}else if(/^--no-.+/.test(p))y=p.match(/^--no-(.+)/)[1],l(y,!1,p);else if(/^--.+/.test(p))y=p.match(/^--(.+)/)[1],g=t[d+1],g!==void 0&&!/^(-|--)[^-]/.test(g)&&!r.bools[y]&&!r.allBools&&(!n[y]||!s(y))?(l(y,g,p),d+=1):/^(true|false)$/.test(g)?(l(y,g==="true",p),d+=1):l(y,r.strings[y]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var w=p.slice(1,-1).split(""),P=!1,E=0;E<w.length;E++){if(g=p.slice(E+2),g==="-"){l(w[E],g,p);continue}if(/[A-Za-z]/.test(w[E])&&g[0]==="="){l(w[E],g.slice(1),p),P=!0;break}if(/[A-Za-z]/.test(w[E])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){l(w[E],g,p),P=!0;break}if(w[E+1]&&w[E+1].match(/\W/)){l(w[E],p.slice(E+2),p),P=!0;break}else l(w[E],r.strings[w[E]]?"":!0,p)}y=p.slice(-1)[0],!P&&y!=="-"&&(t[d+1]&&!/^(-|--)[^-]/.test(t[d+1])&&!r.bools[y]&&(!n[y]||!s(y))?(l(y,t[d+1],p),d+=1):t[d+1]&&/^(true|false)$/.test(t[d+1])?(l(y,t[d+1]==="true",p),d+=1):l(y,r.strings[y]?"":!0,p))}else if((!r.unknownFn||r.unknownFn(p)!==!1)&&o._.push(r.strings._||!Dp(p)?p:Number(p)),e.stopEarly){o._.push.apply(o._,t.slice(d+1));break}}return Object.keys(i).forEach(function(S){g$(o,S.split("."))||(c(o,S.split("."),i[S]),(n[S]||[]).forEach(function(T){c(o,T.split("."),i[S])}))}),e["--"]?o["--"]=f.slice():f.forEach(function(S){o._.push(S)}),o}});var Vp=v((JA,Hp)=>{u();var Bn=Rp(),qr=R("path").join,_$=qp(),zp="/etc",Up=process.platform==="win32",Gn=Up?process.env.USERPROFILE:process.env.HOME;Hp.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Fp()(process.argv.slice(2))),e=(typeof e=="string"?Bn.json(e):e)||{},n=n||Bn.parse;var s=Bn.env(t+"_"),i=[e],o=[];function a(c){if(!(o.indexOf(c)>=0)){var l=Bn.file(c);l&&(i.push(n(l)),o.push(c))}}return Up||[qr(zp,t,"config"),qr(zp,t+"rc")].forEach(a),Gn&&[qr(Gn,".config",t,"config"),qr(Gn,".config",t),qr(Gn,"."+t,"config"),qr(Gn,"."+t+"rc")].forEach(a),a(Bn.find("."+t+"rc")),s.config&&a(s.config),r.config&&a(r.config),_$.apply(null,i.concat([s,r,o.length?{configs:o,config:o[o.length-1]}:void 0]))}});var Wp=v((ZA,Gp)=>{u();var xt=R("constants"),w$=process.cwd,mi=null,b$=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return mi||(mi=w$.call(process)),mi};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Uc=process.chdir,process.chdir=function(t){mi=null,Uc.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Uc));var Uc;Gp.exports=v$;function v$(t){xt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,d,p){p&&process.nextTick(p)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,d,p,y){y&&process.nextTick(y)},t.lchownSync=function(){}),b$==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function d(p,y,g){var h=Date.now(),b=0;f(p,y,function w(P){if(P&&(P.code==="EACCES"||P.code==="EPERM")&&Date.now()-h<6e4){setTimeout(function(){t.stat(y,function(E,S){E&&E.code==="ENOENT"?f(p,y,w):g(P)})},b),b<100&&(b+=10);return}g&&g(P)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function d(p,y,g,h,b,w){var P;if(w&&typeof w=="function"){var E=0;P=function(S,T,D){if(S&&S.code==="EAGAIN"&&E<10)return E++,f.call(t,p,y,g,h,b,P);w.apply(this,arguments)}}return f.call(t,p,y,g,h,b,P)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(d,p,y,g,h){for(var b=0;;)try{return f.call(t,d,p,y,g,h)}catch(w){if(w.code==="EAGAIN"&&b<10){b++;continue}throw w}}})(t.readSync);function e(f){f.lchmod=function(d,p,y){f.open(d,xt.O_WRONLY|xt.O_SYMLINK,p,function(g,h){if(g){y&&y(g);return}f.fchmod(h,p,function(b){f.close(h,function(w){y&&y(b||w)})})})},f.lchmodSync=function(d,p){var y=f.openSync(d,xt.O_WRONLY|xt.O_SYMLINK,p),g=!0,h;try{h=f.fchmodSync(y,p),g=!1}finally{if(g)try{f.closeSync(y)}catch{}else f.closeSync(y)}return h}}function r(f){xt.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,p,y,g){f.open(d,xt.O_SYMLINK,function(h,b){if(h){g&&g(h);return}f.futimes(b,p,y,function(w){f.close(b,function(P){g&&g(w||P)})})})},f.lutimesSync=function(d,p,y){var g=f.openSync(d,xt.O_SYMLINK),h,b=!0;try{h=f.futimesSync(g,p,y),b=!1}finally{if(b)try{f.closeSync(g)}catch{}else f.closeSync(g)}return h}):f.futimes&&(f.lutimes=function(d,p,y,g){g&&process.nextTick(g)},f.lutimesSync=function(){})}function n(f){return f&&function(d,p,y){return f.call(t,d,p,function(g){l(g)&&(g=null),y&&y.apply(this,arguments)})}}function s(f){return f&&function(d,p){try{return f.call(t,d,p)}catch(y){if(!l(y))throw y}}}function i(f){return f&&function(d,p,y,g){return f.call(t,d,p,y,function(h){l(h)&&(h=null),g&&g.apply(this,arguments)})}}function o(f){return f&&function(d,p,y){try{return f.call(t,d,p,y)}catch(g){if(!l(g))throw g}}}function a(f){return f&&function(d,p,y){typeof p=="function"&&(y=p,p=null);function g(h,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),y&&y.apply(this,arguments)}return p?f.call(t,d,p,g):f.call(t,d,g)}}function c(f){return f&&function(d,p){var y=p?f.call(t,d,p):f.call(t,d);return y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),y}}function l(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}}});var Yp=v((tj,Jp)=>{u();var Kp=R("stream").Stream;Jp.exports=E$;function E$(t){return{ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Kp.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),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 new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}t.open(this.path,this.flags,this.mode,function(f,d){if(f){i.emit("error",f),i.readable=!1;return}i.fd=d,i.emit("open",d),i._read()})}function r(n,s){if(!(this instanceof r))return new r(n,s);Kp.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,a=i.length;o<a;o++){var c=i[o];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Xp=v((nj,Qp)=>{"use strict";u();Qp.exports=$$;var S$=Object.getPrototypeOf||function(t){return t.__proto__};function $$(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:S$(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var rm=v((ij,Bc)=>{u();var re=R("fs"),P$=Wp(),O$=Yp(),T$=Xp(),yi=R("util"),pe,_i;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),_i=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",_i="___graceful-fs.previous");function k$(){}function tm(t,e){Object.defineProperty(t,pe,{get:function(){return e}})}var Qt=k$;yi.debuglog?Qt=yi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Qt=function(){var t=yi.format.apply(yi,arguments);t="GFS4: "+t.split(/\n/).join(`
14
+ GFS4: `),console.error(t)});re[pe]||(Zp=global[pe]||[],tm(re,Zp),re.close=(function(t){function e(r,n){return t.call(re,r,function(s){s||em(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,_i,{value:t}),e})(re.close),re.closeSync=(function(t){function e(r){t.apply(re,arguments),em()}return Object.defineProperty(e,_i,{value:t}),e})(re.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Qt(re[pe]),R("assert").equal(re[pe].length,0)}));var Zp;global[pe]||tm(global,re[pe]);Bc.exports=Hc(T$(re));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!re.__patched&&(Bc.exports=Hc(re),re.__patched=!0);function Hc(t){P$(t),t.gracefulify=Hc,t.createReadStream=T,t.createWriteStream=D;var e=t.readFile;t.readFile=r;function r(k,A,L){return typeof A=="function"&&(L=A,A=null),ie(k,A,L);function ie(oe,ae,ee,ne){return e(oe,ae,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Dr([ie,[oe,ae,ee],K,ne||Date.now(),Date.now()]):typeof ee=="function"&&ee.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=s;function s(k,A,L,ie){return typeof L=="function"&&(ie=L,L=null),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return n(ae,ee,ne,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,A,L,ie){return typeof L=="function"&&(ie=L,L=null),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return i(ae,ee,ne,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(k,A,L,ie){return typeof L=="function"&&(ie=L,L=0),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return a(ae,ee,ne,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var f=/^v[0-5]\./;function d(k,A,L){typeof A=="function"&&(L=A,A=null);var ie=f.test(process.version)?function(ee,ne,K,ue){return l(ee,oe(ee,ne,K,ue))}:function(ee,ne,K,ue){return l(ee,ne,oe(ee,ne,K,ue))};return ie(k,A,L);function oe(ae,ee,ne,K){return function(ue,X){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?Dr([ie,[ae,ee,ne],ue,K||Date.now(),Date.now()]):(X&&X.sort&&X.sort(),typeof ne=="function"&&ne.call(this,ue,X))}}}if(process.version.substr(0,4)==="v0.8"){var p=O$(t);w=p.ReadStream,E=p.WriteStream}var y=t.ReadStream;y&&(w.prototype=Object.create(y.prototype),w.prototype.open=P);var g=t.WriteStream;g&&(E.prototype=Object.create(g.prototype),E.prototype.open=S),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(k){w=k},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return E},set:function(k){E=k},enumerable:!0,configurable:!0});var h=w;Object.defineProperty(t,"FileReadStream",{get:function(){return h},set:function(k){h=k},enumerable:!0,configurable:!0});var b=E;Object.defineProperty(t,"FileWriteStream",{get:function(){return b},set:function(k){b=k},enumerable:!0,configurable:!0});function w(k,A){return this instanceof w?(y.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function P(){var k=this;be(k.path,k.flags,k.mode,function(A,L){A?(k.autoClose&&k.destroy(),k.emit("error",A)):(k.fd=L,k.emit("open",L),k.read())})}function E(k,A){return this instanceof E?(g.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function S(){var k=this;be(k.path,k.flags,k.mode,function(A,L){A?(k.destroy(),k.emit("error",A)):(k.fd=L,k.emit("open",L))})}function T(k,A){return new t.ReadStream(k,A)}function D(k,A){return new t.WriteStream(k,A)}var C=t.open;t.open=be;function be(k,A,L,ie){return typeof L=="function"&&(ie=L,L=null),oe(k,A,L,ie);function oe(ae,ee,ne,K,ue){return C(ae,ee,ne,function(X,AP){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Dr([oe,[ae,ee,ne,K],X,ue||Date.now(),Date.now()]):typeof K=="function"&&K.apply(this,arguments)})}}return t}function Dr(t){Qt("ENQUEUE",t[0].name,t[1]),re[pe].push(t),Vc()}var gi;function em(){for(var t=Date.now(),e=0;e<re[pe].length;++e)re[pe][e].length>2&&(re[pe][e][3]=t,re[pe][e][4]=t);Vc()}function Vc(){if(clearTimeout(gi),gi=void 0,re[pe].length!==0){var t=re[pe].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Qt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Qt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n)}else{var a=Date.now()-i,c=Math.max(i-s,1),l=Math.min(c*1.2,100);a>=l?(Qt("RETRY",e.name,r),e.apply(null,r.concat([s]))):re[pe].push(t)}gi===void 0&&(gi=setTimeout(Vc,0))}}});var nm=v(Mr=>{"use strict";u();var x$=Mr&&Mr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.readCAFileSync=void 0;var R$=x$(rm());function C$(t){try{let e=R$.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(s=>!!s.trim()).map(s=>`${s.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}Mr.readCAFileSync=C$});var sm=v(Xt=>{"use strict";u();var N$=Xt&&Xt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A$=Xt&&Xt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N$(e,t,r)};Object.defineProperty(Xt,"__esModule",{value:!0});A$(nm(),Xt)});var am=v((fj,om)=>{u();om.exports=im;function Zt(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function im(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&Zt(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}im.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&Zt(this.list[this.list.length-1],t),Zt(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&Zt(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return Zt(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&Zt(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)Zt(this.list[e],this.list[e+1]||this.root);return t}}});var fm=v((lt,lm)=>{u();var cm=am(),Wn=R("path"),wi=R("fs"),Gc=Mc(),Wc=R("events").EventEmitter,j$=R("url"),I$=R("http"),lt=lm.exports=function(){for(var t=[].slice.call(arguments),e=new we;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?D$(r):r)}return e},hj=lt.find=function(){var t=Wn.join.apply(null,[].slice.call(arguments));function e(r,n){var s=Wn.join(r,n);try{return wi.statSync(s),s}catch{if(Wn.dirname(r)!==r)return e(Wn.dirname(r),n)}}return e(__dirname,t)},q$=lt.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return Gc.parse(t);else try{return JSON.parse(t)}catch{return Gc.parse(t)}},D$=lt.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Wn.join.apply(null,t),r;try{r=wi.readFileSync(e,"utf-8")}catch{return}return q$(r,e,"json")},pj=lt.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var s in e)s.indexOf(t)===0&&(r[s.substring(n)]=e[s]);return r};lt.ConfigChain=we;function we(){Wc.apply(this),cm.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var um={constructor:{value:we}};Object.keys(Wc.prototype).forEach(function(t){um[t]=Object.getOwnPropertyDescriptor(Wc.prototype,t)});we.prototype=Object.create(cm.prototype,um);we.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,s=this.list.length;n<s;n++)delete this.list[n][t];return this};we.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};we.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};we.prototype.save=function(t,i,r){typeof i=="function"&&(r=i,i=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var s=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[s+a]=n.data[a]}),this}var i=i||n.type,o=n.data;return n.type==="json"?o=JSON.stringify(o):o=Gc.stringify(o),this._saving++,wi.writeFile(n.path,o,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};we.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),wi.readFile(t,"utf8",function(s,i){s&&this.emit("error",s),this.addString(i,t,e,n)}.bind(this)),this};we.prototype.addEnv=function(t,e,r){r=r||"env";var n=lt.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};we.prototype.addUrl=function(t,e,r){this._await();var n=j$.format(t);r=r||n;var s={__source__:r};return this.sources[r]={href:n,type:e},this.push(s),I$.request(t,function(i){var o=[],a=i.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,s.type=e),i.on("data",o.push.bind(o)).on("end",function(){this.addString(Buffer.concat(o),n,e,s)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};we.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};we.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};we.prototype.parse=lt.parse;we.prototype._await=function(){this._awaiting++};we.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var pm=v((yj,hm)=>{u();hm.exports=function(t){let e=t.indexOf(":");if(e===-1)return dm(t);let r=t.substr(0,e),n=t.substr(e+1);return`${r}:${dm(n)}`};function dm(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var mm=v(bi=>{"use strict";u();Object.defineProperty(bi,"__esModule",{value:!0});bi.envReplace=void 0;var M$=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function L$(t,e){return t.replace(M$,F$.bind(null,e))}bi.envReplace=L$;function F$(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let s=U$(t,n);if(s===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${s}`}var z$=/([^:-]+)(:?)-(.+)/;function U$(t,e){let r=e.match(z$);if(!r)return t[e];let[,n,s,i]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&s?i:t[n]:i}});var ym=v(vi=>{"use strict";u();Object.defineProperty(vi,"__esModule",{value:!0});vi.envReplace=void 0;var H$=mm();Object.defineProperty(vi,"envReplace",{enumerable:!0,get:function(){return H$.envReplace}})});var gm=v(Kn=>{"use strict";u();var V$=R("fs"),er=R("path"),{envReplace:Kc}=ym(),B$=t=>typeof t!="string"?t:Kc(t,process.env),G$=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),s=n.indexOf(er)!==-1,i=n.indexOf(Boolean)!==-1,o=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(i&&!o&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}let c=Kc(e,process.env);if((r.endsWith(":tokenHelper")||r==="tokenHelper")&&c!==e)throw new Error(`It is not allowed to use environment variables in the value of the ${r} setting.`);return e=c,s&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=er.resolve(process.env.HOME,e.substr(2))),e=er.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},W$=t=>{t=er.resolve(t);let e=!1;for(;er.basename(t)==="node_modules";)t=er.dirname(t),e=!0;if(e)return t;let r=(n,s)=>{let i=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&i.test(n))return s;try{let o=V$.readdirSync(n);if(o.includes("node_modules")||o.includes("package.json")||o.includes("package.json5")||o.includes("package.yaml")||o.includes("pnpm-workspace.yaml"))return n;let a=er.dirname(n);return a===n?s:r(a,s)}catch(o){if(n===s){if(o.code==="ENOENT")return s;throw o}return s}};return r(t,t)};Kn.envReplace=Kc;Kn.findPrefix=W$;Kn.parseField=G$;Kn.parseKey=B$});var bm=v(wm=>{"use strict";u();var tr=R("path"),K$=R("stream").Stream,Ei=R("url"),J$=()=>{},Y$=()=>[],_m=()=>{};wm.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:tr,cache:tr,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:tr,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Ei],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":tr,"init-author-name":String,"init-author-email":String,"init-author-url":["",Ei],"init-license":String,"init-version":_m,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":Y$(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:K$,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,_m],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:tr,production:Boolean,progress:Boolean,proxy:[null,!1,Ei],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Ei],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:tr,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:tr,umask:J$,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Sm=v((Oj,Em)=>{"use strict";u();var{readCAFileSync:Q$}=sm(),vm=R("fs"),Jc=R("path"),{ConfigChain:X$}=fm(),Z$=pm(),Yc=gm(),Qc=class extends X${constructor(e,r){super(e),this.root=e,this._parseField=Yc.parseField.bind(null,r||bm())}add(e,r){try{for(let[n,s]of Object.entries(e)){let i=Yc.parseKey(n);i!==n&&delete e[n],e[i]=this._parseField(s,i)}}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let s=vm.readFileSync(e,"utf8");this.addString(s,e,"ini",n)}catch(s){if(s.code==="ENOENT")this.add({},n);else if(s.code!=="EISDIR")return`Issue while reading "${e}". ${s.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{if(!e[n])return;let s=Z$(n.substr(11)),i=e[n];r[s]=eP(s,i)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let s=this.get("global");this[s?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>Jc.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=Jc.resolve(e.prefix);else try{r=Yc.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=Q$(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=Jc.resolve(this.get("prefix"));try{let n=vm.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};function eP(t,e){function r(n){return n.indexOf(`
15
15
 
16
16
  `)?n.split(`
17
17
 
18
- `):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}vm.exports=Yc});var km=v(Tm=>{"use strict";u();var Pm=R("os"),ft=R("path"),Om=Pm.tmpdir(),Z$=process.getuid?process.getuid():process.pid,eP=()=>!0,Sm=process.platform==="win32",$m={editor:()=>process.env.EDITOR||process.env.VISUAL||(Sm?"notepad.exe":"vi"),shell:()=>Sm?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},tP={fromString:()=>process.umask()},Lr=Pm.homedir();Lr?process.env.HOME=Lr:Lr=ft.resolve(Om,"npm-"+Z$);var rP=process.platform==="win32"?"npm-cache":".npm",nP=process.platform==="win32"&&process.env.APPDATA||Lr,sP=ft.resolve(nP,rP),Ei,rr;Object.defineProperty(Tm,"defaults",{get:function(){return Ei||(process.env.PREFIX?rr=process.env.PREFIX:process.platform==="win32"?rr=ft.dirname(process.execPath):(rr=ft.dirname(ft.dirname(process.execPath)),process.env.DESTDIR&&(rr=ft.join(process.env.DESTDIR,rr))),Ei={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:sP,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:$m.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:ft.resolve(rr,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":ft.resolve(Lr,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:rr,production:!1,progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:$m.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Om,unicode:eP(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:ft.resolve(Lr,".npmrc"),umask:process.umask?process.umask():tP.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Ei)}})});var Rm=v((Oj,Qc)=>{"use strict";u();var nr=R("path"),iP=Em(),xm=km();Qc.exports=(t,e,r)=>{let n=new iP(Object.assign({},xm.defaults,r),e);n.add(Object.assign({},t),"cli");let s=[],i=!1;if(R.resolve.paths){let l=R.resolve.paths("npm"),f;try{f=R.resolve("npm",{paths:l.slice(-1)})}catch{i=!0}f&&s.push(n.addFile(nr.resolve(nr.dirname(f),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let o=nr.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&o!==a?s.push(n.addFile(o,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==o){let l=nr.resolve(n.get("workspace-prefix"),".npmrc");s.push(n.addFile(l,"workspace"))}if(s.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let l=nr.resolve(n.get("prefix"),"etc");n.root.globalconfig=nr.resolve(l,"npmrc"),n.root.globalignorefile=nr.resolve(l,"npmignore")}s.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let c=n.get("cafile");return c&&n.loadCAFile(c),{config:n,warnings:s.filter(Boolean),failedToLoadBuiltInConfig:i}};Object.defineProperty(Qc.exports,"defaults",{get(){return xm.defaults},enumerable:!0})});var Mm=v((xj,Dm)=>{u();var Cm=Rm(),Nm=":_authToken",Am=":_auth",jm=":username",Im=":_password";Dm.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:s=>n[s]}}:Cm()).config,e=e||r.npmrc.get("registry")||Cm.defaults.registry,qm(e,r)||aP(r.npmrc)};function oP(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:n,search:s,hash:i}=r;return n+s+i}return r.toString()}function qm(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let s="//"+r.host+n.replace(/\/$/,""),i=uP(s,e.npmrc);if(i)return i;if(!e.recursive)return/\/$/.test(t)?void 0:qm(new URL("./",r),e);r.pathname=oP(cP(n),"..")||"/"}}function aP(t){return t.get("_auth")?{token:Si(t.get("_auth")),type:"Basic"}:void 0}function cP(t){return t[t.length-1]==="/"?t:t+"/"}function uP(t,e){let r=lP(e.get(t+Nm)||e.get(t+"/"+Nm));if(r)return r;let n=e.get(t+jm)||e.get(t+"/"+jm),s=e.get(t+Im)||e.get(t+"/"+Im),i=fP(n,s);if(i)return i;let o=dP(e.get(t+Am)||e.get(t+"/"+Am));if(o)return o}function Si(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function lP(t){return t?{token:Si(t),type:"Bearer"}:void 0}function fP(t,e){if(!t||!e)return;let r=Buffer.from(Si(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function dP(t){return t?{token:Si(t),type:"Basic"}:void 0}});u();u();u();var Fr;(function(t){t.Local="local",t.Production="production"})(Fr||(Fr={}));function Vm(t=process.env){return t[cu.serviceEnv]==="local"?Fr.Local:Fr.Production}function Ri(t=process.env){return Vm(t)===Fr.Local}u();u();import{isDeepStrictEqual as W0}from"node:util";import bd from"node:process";import{Buffer as bn}from"node:buffer";import Vt from"node:fs";import vd from"node:path";import vn from"node:crypto";import K0 from"node:assert";import{EventEmitter as J0}from"node:events";u();var Ct=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")},Ci=new Set(["__proto__","prototype","constructor"]),Bm=new Set("0123456789");function ts(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break;case".":if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(Ci.has(r))return[];e.push(r),r="",n="property";break;case"[":if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(Ci.has(r))return[];e.push(r),r=""}n="index";break;case"]":if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index");default:if(n==="index"&&!Bm.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i}switch(s&&(r+="\\"),n){case"property":{if(Ci.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Ni(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function gu(t,e){if(Ni(t,e))throw new Error("Cannot use string index")}function _u(t,e,r){if(!Ct(t)||typeof e!="string")return r===void 0?t:r;let n=ts(e);if(n.length===0)return r;for(let s=0;s<n.length;s++){let i=n[s];if(Ni(t,i)?t=s===n.length-1?void 0:null:t=t[i],t==null){if(s!==n.length-1)return r;break}}return t===void 0?r:t}function Ai(t,e,r){if(!Ct(t)||typeof e!="string")return t;let n=t,s=ts(e);for(let i=0;i<s.length;i++){let o=s[i];gu(t,o),i===s.length-1?t[o]=r:Ct(t[o])||(t[o]=typeof s[i+1]=="number"?[]:{}),t=t[o]}return n}function wu(t,e){if(!Ct(t)||typeof e!="string")return!1;let r=ts(e);for(let n=0;n<r.length;n++){let s=r[n];if(gu(t,s),n===r.length-1)return delete t[s],!0;if(t=t[s],!Ct(t))return!1}}function bu(t,e){if(!Ct(t)||typeof e!="string")return!1;let r=ts(e);if(r.length===0)return!1;for(let n of r){if(!Ct(t)||!(n in t)||Ni(t,n))return!1;t=t[n]}return!0}u();import ey from"node:path";u();import H from"node:fs";import{promisify as me}from"node:util";u();u();var Gm=(t,e)=>{let{onError:r}=e;return function(...s){return t.apply(void 0,s).catch(r)}},Je=Gm;u();var Wm=(t,e)=>{let{onError:r}=e;return function(...s){try{return t.apply(void 0,s)}catch(i){return r(i)}}},He=Wm;u();u();var Jm=(t,e)=>{let{isRetriable:r}=e;return function(s){let{timeout:i}=s,o=s.interval??250,a=Date.now()+i;return function c(...l){return t.apply(void 0,l).catch(f=>{if(!r(f)||Date.now()>=a)throw f;let d=Math.round(o*Math.random());return d>0?new Promise(y=>setTimeout(y,d)).then(()=>c.apply(void 0,l)):c.apply(void 0,l)})}}},Ye=Jm;u();var Ym=(t,e)=>{let{isRetriable:r}=e;return function(s){let{timeout:i}=s,o=Date.now()+i;return function(...c){for(;;)try{return t.apply(void 0,c)}catch(l){if(!r(l)||Date.now()>=o)throw l;continue}}}},Qe=Ym;u();import Eu from"node:process";u();var zr={isChangeErrorOk:t=>{if(!zr.isNodeError(t))return!1;let{code:e}=t;return e==="ENOSYS"||!vu&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!zr.isNodeError(t))return!1;let{code:e}=t;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!zr.isNodeError(t))throw t;if(!zr.isChangeErrorOk(t))throw t}},ji=zr;var Ur={onError:ji.onChangeError},Te={onError:()=>{}},vu=Eu.getuid?!Eu.getuid():!1,le={isRetriable:ji.isRetriableError};var Qm={attempt:{chmod:Je(me(H.chmod),Ur),chown:Je(me(H.chown),Ur),close:Je(me(H.close),Te),fsync:Je(me(H.fsync),Te),mkdir:Je(me(H.mkdir),Te),realpath:Je(me(H.realpath),Te),stat:Je(me(H.stat),Te),unlink:Je(me(H.unlink),Te),chmodSync:He(H.chmodSync,Ur),chownSync:He(H.chownSync,Ur),closeSync:He(H.closeSync,Te),existsSync:He(H.existsSync,Te),fsyncSync:He(H.fsync,Te),mkdirSync:He(H.mkdirSync,Te),realpathSync:He(H.realpathSync,Te),statSync:He(H.statSync,Te),unlinkSync:He(H.unlinkSync,Te)},retry:{close:Ye(me(H.close),le),fsync:Ye(me(H.fsync),le),open:Ye(me(H.open),le),readFile:Ye(me(H.readFile),le),rename:Ye(me(H.rename),le),stat:Ye(me(H.stat),le),write:Ye(me(H.write),le),writeFile:Ye(me(H.writeFile),le),closeSync:Qe(H.closeSync,le),fsyncSync:Qe(H.fsyncSync,le),openSync:Qe(H.openSync,le),readFileSync:Qe(H.readFileSync,le),renameSync:Qe(H.renameSync,le),statSync:Qe(H.statSync,le),writeSync:Qe(H.writeSync,le),writeFileSync:Qe(H.writeFileSync,le)}},ce=Qm;u();import Nt from"node:process";var Su="utf8",Ii=438,$u=511;var Pu={},Ou=Nt.geteuid?Nt.geteuid():-1,Tu=Nt.getegid?Nt.getegid():-1;var ku=1e3,xu=!!Nt.getuid,hO=Nt.getuid?!Nt.getuid():!1,qi=128;u();var Ru=t=>t instanceof Error&&"code"in t;var Di=t=>typeof t=="string",rs=t=>t===void 0;u();u();import Zm from"node:path";u();u();import sr from"node:process";u();import Cu from"node:process";var Nu=Cu.platform==="linux",ns=Cu.platform==="win32";u();var Mi=["SIGHUP","SIGINT","SIGTERM"];ns||Mi.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Nu&&Mi.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Au=Mi;var Li=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(let r of this.callbacks)r();e&&(ns&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?sr.kill(sr.pid,"SIGTERM"):sr.kill(sr.pid,e))}},this.hook=()=>{sr.once("exit",()=>this.exit());for(let e of Au)try{sr.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},ju=new Li;var Xm=ju.register,Iu=Xm;var je={store:{},create:t=>{let e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),s=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${s}`},get:(t,e,r=!0)=>{let n=je.truncate(e(t));return n in je.store?je.get(t,e,r):(je.store[n]=r,[n,()=>delete je.store[n]])},purge:t=>{je.store[t]&&(delete je.store[t],ce.attempt.unlink(t))},purgeSync:t=>{je.store[t]&&(delete je.store[t],ce.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(let t in je.store)je.purgeSync(t)},truncate:t=>{let e=Zm.basename(t);if(e.length<=qi)return t;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;let n=e.length-qi;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Iu(je.purgeSyncAll);var Hr=je;function Fi(t,e,r=Pu){if(Di(r))return Fi(t,e,{encoding:r});let s={timeout:r.timeout??ku},i=null,o=null,a=null;try{let c=ce.attempt.realpathSync(t),l=!!c;t=c||t,[o,i]=Hr.get(t,r.tmpCreate||Hr.create,r.tmpPurge!==!1);let f=xu&&rs(r.chown),d=rs(r.mode);if(l&&(f||d)){let p=ce.attempt.statSync(t);p&&(r={...r},f&&(r.chown={uid:p.uid,gid:p.gid}),d&&(r.mode=p.mode))}if(!l){let p=ey.dirname(t);ce.attempt.mkdirSync(p,{mode:$u,recursive:!0})}a=ce.retry.openSync(s)(o,"w",r.mode||Ii),r.tmpCreated&&r.tmpCreated(o),Di(e)?ce.retry.writeSync(s)(a,e,0,r.encoding||Su):rs(e)||ce.retry.writeSync(s)(a,e,0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?ce.retry.fsyncSync(s)(a):ce.attempt.fsync(a)),ce.retry.closeSync(s)(a),a=null,r.chown&&(r.chown.uid!==Ou||r.chown.gid!==Tu)&&ce.attempt.chownSync(o,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Ii&&ce.attempt.chmodSync(o,r.mode);try{ce.retry.renameSync(s)(o,t)}catch(p){if(!Ru(p)||p.code!=="ENAMETOOLONG")throw p;ce.retry.renameSync(s)(o,Hr.truncate(t))}i(),o=null}finally{a&&ce.attempt.closeSync(a),o&&Hr.purge(o)}}var Sd=Oe(Oa(),1),$d=Oe(wd(),1);u();var G0=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:i=!0}=e;if(!s&&!i)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,c,l=function(...f){let d=this,p=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),i&&(c=t.apply(d,f))},y=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),i&&(c=t.apply(d,f))},g=s&&!o;return clearTimeout(o),o=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(y,n)),g&&(c=t.apply(d,f)),c};return du(l,t),l.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},l},Aa=G0;var Bt=Oe(ki(),1),Ls=function(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r},te=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ht,St,Fe,$t,Y0=Sd.default.default,Q0=$d.default.default,Ed="aes-256-cbc",Sr=()=>Object.create(null),X0=t=>t!=null,Z0=(t,e)=>{let r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},Fs="__internal__",ja=`${Fs}.migrations.version`,En=class{constructor(e={}){Object.defineProperty(this,"path",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ht.set(this,void 0),St.set(this,void 0),Fe.set(this,void 0),$t.set(this,{}),Object.defineProperty(this,"_deserialize",{enumerable:!0,configurable:!0,writable:!0,value:o=>JSON.parse(o)}),Object.defineProperty(this,"_serialize",{enumerable:!0,configurable:!0,writable:!0,value:o=>JSON.stringify(o,void 0," ")});let r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=au(r.projectName,{suffix:r.projectSuffix}).config}if(Ls(this,Fe,r,"f"),r.schema){if(typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");let o=new Y0({allErrors:!0,useDefaults:!0});Q0(o);let a={type:"object",properties:r.schema};Ls(this,Ht,o.compile(a),"f");for(let[c,l]of Object.entries(r.schema))l?.default&&(te(this,$t,"f")[c]=l.default)}r.defaults&&Ls(this,$t,{...te(this,$t,"f"),...r.defaults},"f"),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new J0,Ls(this,St,r.encryptionKey,"f");let n=r.fileExtension?`.${r.fileExtension}`:"";this.path=vd.resolve(r.cwd,`${r.configName??"config"}${n}`);let s=this.store,i=Object.assign(Sr(),r.defaults,s);this._validate(i);try{K0.deepEqual(s,i)}catch{this.store=i}if(r.watch&&this._watch(),r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}}get(e,r){if(te(this,Fe,"f").accessPropertiesByDotNotation)return this._get(e,r);let{store:n}=this;return e in n?n[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${Fs} key, as it's used to manage this module internal operations.`);let{store:n}=this,s=(i,o)=>{Z0(i,o),te(this,Fe,"f").accessPropertiesByDotNotation?Ai(n,i,o):n[i]=o};if(typeof e=="object"){let i=e;for(let[o,a]of Object.entries(i))s(o,a)}else s(e,r);this.store=n}has(e){return te(this,Fe,"f").accessPropertiesByDotNotation?bu(this.store,e):e in this.store}reset(...e){for(let r of e)X0(te(this,$t,"f")[r])&&this.set(r,te(this,$t,"f")[r])}delete(e){let{store:r}=this;te(this,Fe,"f").accessPropertiesByDotNotation?wu(r,e):delete r[e],this.store=r}clear(){this.store=Sr();for(let e of Object.keys(te(this,$t,"f")))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=Vt.readFileSync(this.path,te(this,St,"f")?null:"utf8"),r=this._encryptData(e),n=this._deserialize(r);return this._validate(n),Object.assign(Sr(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Sr();if(te(this,Fe,"f").clearInvalidConfig&&e.name==="SyntaxError")return Sr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.emit("change")}*[(Ht=new WeakMap,St=new WeakMap,Fe=new WeakMap,$t=new WeakMap,Symbol.iterator)](){for(let[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!te(this,St,"f"))return e.toString();try{let r=e.slice(0,16),n=vn.pbkdf2Sync(te(this,St,"f"),r.toString(),1e4,32,"sha512"),s=vn.createDecipheriv(Ed,n,r);return bn.concat([s.update(bn.from(e.slice(17))),s.final()]).toString("utf8")}catch{}return e.toString()}_handleChange(e,r){let n=e(),s=()=>{let i=n,o=e();W0(o,i)||(n=o,r.call(this,o,i))};return this.events.on("change",s),()=>this.events.removeListener("change",s)}_validate(e){if(!te(this,Ht,"f")||te(this,Ht,"f").call(this,e)||!te(this,Ht,"f").errors)return;let n=te(this,Ht,"f").errors.map(({instancePath:s,message:i=""})=>`\`${s.slice(1)}\` ${i}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){Vt.mkdirSync(vd.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(te(this,St,"f")){let n=vn.randomBytes(16),s=vn.pbkdf2Sync(te(this,St,"f"),n.toString(),1e4,32,"sha512"),i=vn.createCipheriv(Ed,s,n);r=bn.concat([n,bn.from(":"),i.update(bn.from(r)),i.final()])}if(bd.env.SNAP)Vt.writeFileSync(this.path,r,{mode:te(this,Fe,"f").configFileMode});else try{Fi(this.path,r,{mode:te(this,Fe,"f").configFileMode})}catch(n){if(n?.code==="EXDEV"){Vt.writeFileSync(this.path,r,{mode:te(this,Fe,"f").configFileMode});return}throw n}}_watch(){this._ensureDirectory(),Vt.existsSync(this.path)||this._write(Sr()),bd.platform==="win32"?Vt.watch(this.path,{persistent:!1},Aa(()=>{this.events.emit("change")},{wait:100})):Vt.watchFile(this.path,{persistent:!1},Aa(()=>{this.events.emit("change")},{wait:5e3}))}_migrate(e,r,n){let s=this._get(ja,"0.0.0"),i=Object.keys(e).filter(a=>this._shouldPerformMigration(a,s,r)),o={...this.store};for(let a of i)try{n&&n(this,{fromVersion:s,toVersion:a,finalVersion:r,versions:i});let c=e[a];c?.(this),this._set(ja,a),s=a,o={...this.store}}catch(c){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(s)||!Bt.default.eq(s,r))&&this._set(ja,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Fs?!0:typeof e!="string"?!1:te(this,Fe,"f").accessPropertiesByDotNotation?!!e.startsWith(`${Fs}.`):!1}_isVersionInRangeFormat(e){return Bt.default.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Bt.default.satisfies(r,e)?!1:Bt.default.satisfies(n,e):!(Bt.default.lte(e,r)||Bt.default.gt(e,n))}_get(e,r){return _u(this.store,e,r)}_set(e,r){let{store:n}=this;Ai(n,e,r),this.store=n}};var zs=class{constructor(e){this.config=new En(e)}get(e){try{return this.config.get(e)}catch(r){this.handleError(r,"get")}}set(e,r){try{this.config.set(e,r)}catch(n){this.handleError(n,"set")}}delete(e){try{this.config.delete(e)}catch(r){this.handleError(r,"delete")}}clear(){try{this.config.clear()}catch(e){this.handleError(e,"clear")}}handleError(e,r){throw this.isPermissionError()?new ht(`Failed to access local storage (${r}): ${e}`,this.tryMessage()):new es(`Unexpected error while accessing local storage at ${this.config.path} (${r}): ${e}`)}isPermissionError(){let e=Ti(this.config.path),r=Ti(Rt(this.config.path)),n=Xn(this.config.path);return!e||!r||n===!1}tryMessage(){let e=Xn(this.config.path),r=Xn(Rt(this.config.path)),n=["Check that you have write permissions for",{filePath:this.config.path}];return(e===!1||r===!1)&&n.push("- The file is owned by a different user. This typically happens when Shopify CLI was previously run with elevated permissions (e.g., sudo)."),n.push(`
18
+ `):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}Em.exports=Qc});var xm=v(km=>{"use strict";u();var Om=R("os"),ft=R("path"),Tm=Om.tmpdir(),tP=process.getuid?process.getuid():process.pid,rP=()=>!0,$m=process.platform==="win32",Pm={editor:()=>process.env.EDITOR||process.env.VISUAL||($m?"notepad.exe":"vi"),shell:()=>$m?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},nP={fromString:()=>process.umask()},Lr=Om.homedir();Lr?process.env.HOME=Lr:Lr=ft.resolve(Tm,"npm-"+tP);var sP=process.platform==="win32"?"npm-cache":".npm",iP=process.platform==="win32"&&process.env.APPDATA||Lr,oP=ft.resolve(iP,sP),Si,rr;Object.defineProperty(km,"defaults",{get:function(){return Si||(process.env.PREFIX?rr=process.env.PREFIX:process.platform==="win32"?rr=ft.dirname(process.execPath):(rr=ft.dirname(ft.dirname(process.execPath)),process.env.DESTDIR&&(rr=ft.join(process.env.DESTDIR,rr))),Si={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:oP,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:Pm.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:ft.resolve(rr,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":ft.resolve(Lr,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:rr,production:!1,progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:Pm.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Tm,unicode:rP(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:ft.resolve(Lr,".npmrc"),umask:process.umask?process.umask():nP.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Si)}})});var Cm=v((Rj,Xc)=>{"use strict";u();var nr=R("path"),aP=Sm(),Rm=xm();Xc.exports=(t,e,r)=>{let n=new aP(Object.assign({},Rm.defaults,r),e);n.add(Object.assign({},t),"cli");let s=[],i=!1;if(R.resolve.paths){let l=R.resolve.paths("npm"),f;try{f=R.resolve("npm",{paths:l.slice(-1)})}catch{i=!0}f&&s.push(n.addFile(nr.resolve(nr.dirname(f),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let o=nr.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&o!==a?s.push(n.addFile(o,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==o){let l=nr.resolve(n.get("workspace-prefix"),".npmrc");s.push(n.addFile(l,"workspace"))}if(s.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let l=nr.resolve(n.get("prefix"),"etc");n.root.globalconfig=nr.resolve(l,"npmrc"),n.root.globalignorefile=nr.resolve(l,"npmignore")}s.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let c=n.get("cafile");return c&&n.loadCAFile(c),{config:n,warnings:s.filter(Boolean),failedToLoadBuiltInConfig:i}};Object.defineProperty(Xc.exports,"defaults",{get(){return Rm.defaults},enumerable:!0})});var Lm=v((Aj,Mm)=>{u();var Nm=Cm(),Am=":_authToken",jm=":_auth",Im=":username",qm=":_password";Mm.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:s=>n[s]}}:Nm()).config,e=e||r.npmrc.get("registry")||Nm.defaults.registry,Dm(e,r)||uP(r.npmrc)};function cP(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:n,search:s,hash:i}=r;return n+s+i}return r.toString()}function Dm(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let s="//"+r.host+n.replace(/\/$/,""),i=fP(s,e.npmrc);if(i)return i;if(!e.recursive)return/\/$/.test(t)?void 0:Dm(new URL("./",r),e);r.pathname=cP(lP(n),"..")||"/"}}function uP(t){return t.get("_auth")?{token:$i(t.get("_auth")),type:"Basic"}:void 0}function lP(t){return t[t.length-1]==="/"?t:t+"/"}function fP(t,e){let r=dP(e.get(t+Am)||e.get(t+"/"+Am));if(r)return r;let n=e.get(t+Im)||e.get(t+"/"+Im),s=e.get(t+qm)||e.get(t+"/"+qm),i=hP(n,s);if(i)return i;let o=pP(e.get(t+jm)||e.get(t+"/"+jm));if(o)return o}function $i(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function dP(t){return t?{token:$i(t),type:"Bearer"}:void 0}function hP(t,e){if(!t||!e)return;let r=Buffer.from($i(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function pP(t){return t?{token:$i(t),type:"Basic"}:void 0}});u();u();u();var Fr;(function(t){t.Local="local",t.Production="production"})(Fr||(Fr={}));function Gm(t=process.env){return t[lu.serviceEnv]==="local"?Fr.Local:Fr.Production}function Ci(t=process.env){return Gm(t)===Fr.Local}u();u();import{isDeepStrictEqual as J0}from"node:util";import vd from"node:process";import{Buffer as bn}from"node:buffer";import Vt from"node:fs";import Ed from"node:path";import vn from"node:crypto";import Y0 from"node:assert";import{EventEmitter as Q0}from"node:events";u();var Ct=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")},Ni=new Set(["__proto__","prototype","constructor"]),Wm=new Set("0123456789");function rs(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break;case".":if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(Ni.has(r))return[];e.push(r),r="",n="property";break;case"[":if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(Ni.has(r))return[];e.push(r),r=""}n="index";break;case"]":if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index");default:if(n==="index"&&!Wm.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i}switch(s&&(r+="\\"),n){case"property":{if(Ni.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Ai(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function _u(t,e){if(Ai(t,e))throw new Error("Cannot use string index")}function wu(t,e,r){if(!Ct(t)||typeof e!="string")return r===void 0?t:r;let n=rs(e);if(n.length===0)return r;for(let s=0;s<n.length;s++){let i=n[s];if(Ai(t,i)?t=s===n.length-1?void 0:null:t=t[i],t==null){if(s!==n.length-1)return r;break}}return t===void 0?r:t}function ji(t,e,r){if(!Ct(t)||typeof e!="string")return t;let n=t,s=rs(e);for(let i=0;i<s.length;i++){let o=s[i];_u(t,o),i===s.length-1?t[o]=r:Ct(t[o])||(t[o]=typeof s[i+1]=="number"?[]:{}),t=t[o]}return n}function bu(t,e){if(!Ct(t)||typeof e!="string")return!1;let r=rs(e);for(let n=0;n<r.length;n++){let s=r[n];if(_u(t,s),n===r.length-1)return delete t[s],!0;if(t=t[s],!Ct(t))return!1}}function vu(t,e){if(!Ct(t)||typeof e!="string")return!1;let r=rs(e);if(r.length===0)return!1;for(let n of r){if(!Ct(t)||!(n in t)||Ai(t,n))return!1;t=t[n]}return!0}u();import ry from"node:path";u();import H from"node:fs";import{promisify as me}from"node:util";u();u();var Km=(t,e)=>{let{onError:r}=e;return function(...s){return t.apply(void 0,s).catch(r)}},Je=Km;u();var Jm=(t,e)=>{let{onError:r}=e;return function(...s){try{return t.apply(void 0,s)}catch(i){return r(i)}}},He=Jm;u();u();var Qm=(t,e)=>{let{isRetriable:r}=e;return function(s){let{timeout:i}=s,o=s.interval??250,a=Date.now()+i;return function c(...l){return t.apply(void 0,l).catch(f=>{if(!r(f)||Date.now()>=a)throw f;let d=Math.round(o*Math.random());return d>0?new Promise(y=>setTimeout(y,d)).then(()=>c.apply(void 0,l)):c.apply(void 0,l)})}}},Ye=Qm;u();var Xm=(t,e)=>{let{isRetriable:r}=e;return function(s){let{timeout:i}=s,o=Date.now()+i;return function(...c){for(;;)try{return t.apply(void 0,c)}catch(l){if(!r(l)||Date.now()>=o)throw l;continue}}}},Qe=Xm;u();import Su from"node:process";u();var zr={isChangeErrorOk:t=>{if(!zr.isNodeError(t))return!1;let{code:e}=t;return e==="ENOSYS"||!Eu&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!zr.isNodeError(t))return!1;let{code:e}=t;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!zr.isNodeError(t))throw t;if(!zr.isChangeErrorOk(t))throw t}},Ii=zr;var Ur={onError:Ii.onChangeError},ke={onError:()=>{}},Eu=Su.getuid?!Su.getuid():!1,le={isRetriable:Ii.isRetriableError};var Zm={attempt:{chmod:Je(me(H.chmod),Ur),chown:Je(me(H.chown),Ur),close:Je(me(H.close),ke),fsync:Je(me(H.fsync),ke),mkdir:Je(me(H.mkdir),ke),realpath:Je(me(H.realpath),ke),stat:Je(me(H.stat),ke),unlink:Je(me(H.unlink),ke),chmodSync:He(H.chmodSync,Ur),chownSync:He(H.chownSync,Ur),closeSync:He(H.closeSync,ke),existsSync:He(H.existsSync,ke),fsyncSync:He(H.fsync,ke),mkdirSync:He(H.mkdirSync,ke),realpathSync:He(H.realpathSync,ke),statSync:He(H.statSync,ke),unlinkSync:He(H.unlinkSync,ke)},retry:{close:Ye(me(H.close),le),fsync:Ye(me(H.fsync),le),open:Ye(me(H.open),le),readFile:Ye(me(H.readFile),le),rename:Ye(me(H.rename),le),stat:Ye(me(H.stat),le),write:Ye(me(H.write),le),writeFile:Ye(me(H.writeFile),le),closeSync:Qe(H.closeSync,le),fsyncSync:Qe(H.fsyncSync,le),openSync:Qe(H.openSync,le),readFileSync:Qe(H.readFileSync,le),renameSync:Qe(H.renameSync,le),statSync:Qe(H.statSync,le),writeSync:Qe(H.writeSync,le),writeFileSync:Qe(H.writeFileSync,le)}},ce=Zm;u();import Nt from"node:process";var $u="utf8",qi=438,Pu=511;var Ou={},Tu=Nt.geteuid?Nt.geteuid():-1,ku=Nt.getegid?Nt.getegid():-1;var xu=1e3,Ru=!!Nt.getuid,gO=Nt.getuid?!Nt.getuid():!1,Di=128;u();var Cu=t=>t instanceof Error&&"code"in t;var Mi=t=>typeof t=="string",ns=t=>t===void 0;u();u();import ty from"node:path";u();u();import sr from"node:process";u();import Nu from"node:process";var Au=Nu.platform==="linux",ss=Nu.platform==="win32";u();var Li=["SIGHUP","SIGINT","SIGTERM"];ss||Li.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Au&&Li.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ju=Li;var Fi=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(let r of this.callbacks)r();e&&(ss&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?sr.kill(sr.pid,"SIGTERM"):sr.kill(sr.pid,e))}},this.hook=()=>{sr.once("exit",()=>this.exit());for(let e of ju)try{sr.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Iu=new Fi;var ey=Iu.register,qu=ey;var Ie={store:{},create:t=>{let e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),s=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${s}`},get:(t,e,r=!0)=>{let n=Ie.truncate(e(t));return n in Ie.store?Ie.get(t,e,r):(Ie.store[n]=r,[n,()=>delete Ie.store[n]])},purge:t=>{Ie.store[t]&&(delete Ie.store[t],ce.attempt.unlink(t))},purgeSync:t=>{Ie.store[t]&&(delete Ie.store[t],ce.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(let t in Ie.store)Ie.purgeSync(t)},truncate:t=>{let e=ty.basename(t);if(e.length<=Di)return t;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;let n=e.length-Di;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};qu(Ie.purgeSyncAll);var Hr=Ie;function zi(t,e,r=Ou){if(Mi(r))return zi(t,e,{encoding:r});let s={timeout:r.timeout??xu},i=null,o=null,a=null;try{let c=ce.attempt.realpathSync(t),l=!!c;t=c||t,[o,i]=Hr.get(t,r.tmpCreate||Hr.create,r.tmpPurge!==!1);let f=Ru&&ns(r.chown),d=ns(r.mode);if(l&&(f||d)){let p=ce.attempt.statSync(t);p&&(r={...r},f&&(r.chown={uid:p.uid,gid:p.gid}),d&&(r.mode=p.mode))}if(!l){let p=ry.dirname(t);ce.attempt.mkdirSync(p,{mode:Pu,recursive:!0})}a=ce.retry.openSync(s)(o,"w",r.mode||qi),r.tmpCreated&&r.tmpCreated(o),Mi(e)?ce.retry.writeSync(s)(a,e,0,r.encoding||$u):ns(e)||ce.retry.writeSync(s)(a,e,0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?ce.retry.fsyncSync(s)(a):ce.attempt.fsync(a)),ce.retry.closeSync(s)(a),a=null,r.chown&&(r.chown.uid!==Tu||r.chown.gid!==ku)&&ce.attempt.chownSync(o,r.chown.uid,r.chown.gid),r.mode&&r.mode!==qi&&ce.attempt.chmodSync(o,r.mode);try{ce.retry.renameSync(s)(o,t)}catch(p){if(!Cu(p)||p.code!=="ENAMETOOLONG")throw p;ce.retry.renameSync(s)(o,Hr.truncate(t))}i(),o=null}finally{a&&ce.attempt.closeSync(a),o&&Hr.purge(o)}}var $d=Oe(Ta(),1),Pd=Oe(bd(),1);u();var K0=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:i=!0}=e;if(!s&&!i)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,c,l=function(...f){let d=this,p=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),i&&(c=t.apply(d,f))},y=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),i&&(c=t.apply(d,f))},g=s&&!o;return clearTimeout(o),o=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(y,n)),g&&(c=t.apply(d,f)),c};return pu(l,t),l.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},l},ja=K0;var Bt=Oe(xi(),1),Fs=function(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r},te=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ht,St,Fe,$t,X0=$d.default.default,Z0=Pd.default.default,Sd="aes-256-cbc",Sr=()=>Object.create(null),ev=t=>t!=null,tv=(t,e)=>{let r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},zs="__internal__",Ia=`${zs}.migrations.version`,En=class{constructor(e={}){Object.defineProperty(this,"path",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ht.set(this,void 0),St.set(this,void 0),Fe.set(this,void 0),$t.set(this,{}),Object.defineProperty(this,"_deserialize",{enumerable:!0,configurable:!0,writable:!0,value:o=>JSON.parse(o)}),Object.defineProperty(this,"_serialize",{enumerable:!0,configurable:!0,writable:!0,value:o=>JSON.stringify(o,void 0," ")});let r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=uu(r.projectName,{suffix:r.projectSuffix}).config}if(Fs(this,Fe,r,"f"),r.schema){if(typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");let o=new X0({allErrors:!0,useDefaults:!0});Z0(o);let a={type:"object",properties:r.schema};Fs(this,Ht,o.compile(a),"f");for(let[c,l]of Object.entries(r.schema))l?.default&&(te(this,$t,"f")[c]=l.default)}r.defaults&&Fs(this,$t,{...te(this,$t,"f"),...r.defaults},"f"),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new Q0,Fs(this,St,r.encryptionKey,"f");let n=r.fileExtension?`.${r.fileExtension}`:"";this.path=Ed.resolve(r.cwd,`${r.configName??"config"}${n}`);let s=this.store,i=Object.assign(Sr(),r.defaults,s);this._validate(i);try{Y0.deepEqual(s,i)}catch{this.store=i}if(r.watch&&this._watch(),r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}}get(e,r){if(te(this,Fe,"f").accessPropertiesByDotNotation)return this._get(e,r);let{store:n}=this;return e in n?n[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${zs} key, as it's used to manage this module internal operations.`);let{store:n}=this,s=(i,o)=>{tv(i,o),te(this,Fe,"f").accessPropertiesByDotNotation?ji(n,i,o):n[i]=o};if(typeof e=="object"){let i=e;for(let[o,a]of Object.entries(i))s(o,a)}else s(e,r);this.store=n}has(e){return te(this,Fe,"f").accessPropertiesByDotNotation?vu(this.store,e):e in this.store}reset(...e){for(let r of e)ev(te(this,$t,"f")[r])&&this.set(r,te(this,$t,"f")[r])}delete(e){let{store:r}=this;te(this,Fe,"f").accessPropertiesByDotNotation?bu(r,e):delete r[e],this.store=r}clear(){this.store=Sr();for(let e of Object.keys(te(this,$t,"f")))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=Vt.readFileSync(this.path,te(this,St,"f")?null:"utf8"),r=this._encryptData(e),n=this._deserialize(r);return this._validate(n),Object.assign(Sr(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Sr();if(te(this,Fe,"f").clearInvalidConfig&&e.name==="SyntaxError")return Sr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.emit("change")}*[(Ht=new WeakMap,St=new WeakMap,Fe=new WeakMap,$t=new WeakMap,Symbol.iterator)](){for(let[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!te(this,St,"f"))return e.toString();try{let r=e.slice(0,16),n=vn.pbkdf2Sync(te(this,St,"f"),r.toString(),1e4,32,"sha512"),s=vn.createDecipheriv(Sd,n,r);return bn.concat([s.update(bn.from(e.slice(17))),s.final()]).toString("utf8")}catch{}return e.toString()}_handleChange(e,r){let n=e(),s=()=>{let i=n,o=e();J0(o,i)||(n=o,r.call(this,o,i))};return this.events.on("change",s),()=>this.events.removeListener("change",s)}_validate(e){if(!te(this,Ht,"f")||te(this,Ht,"f").call(this,e)||!te(this,Ht,"f").errors)return;let n=te(this,Ht,"f").errors.map(({instancePath:s,message:i=""})=>`\`${s.slice(1)}\` ${i}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){Vt.mkdirSync(Ed.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(te(this,St,"f")){let n=vn.randomBytes(16),s=vn.pbkdf2Sync(te(this,St,"f"),n.toString(),1e4,32,"sha512"),i=vn.createCipheriv(Sd,s,n);r=bn.concat([n,bn.from(":"),i.update(bn.from(r)),i.final()])}if(vd.env.SNAP)Vt.writeFileSync(this.path,r,{mode:te(this,Fe,"f").configFileMode});else try{zi(this.path,r,{mode:te(this,Fe,"f").configFileMode})}catch(n){if(n?.code==="EXDEV"){Vt.writeFileSync(this.path,r,{mode:te(this,Fe,"f").configFileMode});return}throw n}}_watch(){this._ensureDirectory(),Vt.existsSync(this.path)||this._write(Sr()),vd.platform==="win32"?Vt.watch(this.path,{persistent:!1},ja(()=>{this.events.emit("change")},{wait:100})):Vt.watchFile(this.path,{persistent:!1},ja(()=>{this.events.emit("change")},{wait:5e3}))}_migrate(e,r,n){let s=this._get(Ia,"0.0.0"),i=Object.keys(e).filter(a=>this._shouldPerformMigration(a,s,r)),o={...this.store};for(let a of i)try{n&&n(this,{fromVersion:s,toVersion:a,finalVersion:r,versions:i});let c=e[a];c?.(this),this._set(Ia,a),s=a,o={...this.store}}catch(c){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(s)||!Bt.default.eq(s,r))&&this._set(Ia,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===zs?!0:typeof e!="string"?!1:te(this,Fe,"f").accessPropertiesByDotNotation?!!e.startsWith(`${zs}.`):!1}_isVersionInRangeFormat(e){return Bt.default.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Bt.default.satisfies(r,e)?!1:Bt.default.satisfies(n,e):!(Bt.default.lte(e,r)||Bt.default.gt(e,n))}_get(e,r){return wu(this.store,e,r)}_set(e,r){let{store:n}=this;ji(n,e,r),this.store=n}};var Us=class{constructor(e){this.config=new En(e)}get(e){try{return this.config.get(e)}catch(r){this.handleError(r,"get")}}set(e,r){try{this.config.set(e,r)}catch(n){this.handleError(n,"set")}}delete(e){try{this.config.delete(e)}catch(r){this.handleError(r,"delete")}}clear(){try{this.config.clear()}catch(e){this.handleError(e,"clear")}}handleError(e,r){throw this.isPermissionError()?new ht(`Failed to access local storage (${r}): ${e}`,this.tryMessage()):new ts(`Unexpected error while accessing local storage at ${this.config.path} (${r}): ${e}`)}isPermissionError(){let e=ki(this.config.path),r=ki(dt(this.config.path)),n=Xn(this.config.path);return!e||!r||n===!1}tryMessage(){let e=Xn(this.config.path),r=Xn(dt(this.config.path)),n=["Check that you have write permissions for",{filePath:this.config.path}];return(e===!1||r===!1)&&n.push("- The file is owned by a different user. This typically happens when Shopify CLI was previously run with elevated permissions (e.g., sudo)."),n.push(`
19
19
 
20
- To resolve this, remove the Shopify CLI preferences folder:`),n.push({command:`rm -rf ${Rt(this.config.path)}`}),n}};var Ia;function Ne(){return Ia??(Ia=new zs({projectName:`shopify-cli-kit${yu()?"-test":""}`})),Ia}function qa(){return Ri()?"devSessionStore":"sessionStore"}function Da(){return Ri()?"currentDevSessionId":"currentSessionId"}function rR(t=Ne()){return Ae(ve`Getting session store...`),t.get(qa())}function nR(t,e=Ne()){Ae(ve`Setting session store...`),e.set(qa(),t)}function sR(t=Ne()){Ae(ve`Removing session store...`),t.delete(qa())}function iR(t=Ne()){return Ae(ve`Getting current session ID...`),t.get(Da())}function oR(t,e=Ne()){Ae(ve`Setting current session ID...`),e.set(Da(),t)}function aR(t=Ne()){Ae(ve`Removing current session ID...`),t.delete(Da())}async function Pd(t,e,r,n=Ne()){let s=Ma(t,n);if(s?.value!==void 0&&(r===void 0||Date.now()-s.timestamp<r))return s.value;let i=await e();return ev(t,i,n),i}function ev(t,e,r=Ne()){let n=r.get("cache")??{};n[t]={value:e,timestamp:Date.now()},r.set("cache",n)}function Ma(t,e=Ne()){return(e.get("cache")??{})[t]}function cR(t=Ne()){t.delete("cache")}function Od({days:t=0,hours:e=0,minutes:r=0,seconds:n=0}){return(t*24*60*60+e*60*60+r*60+n)*1e3}async function uR(t,e,r,n=Ne()){let s=n.get("cache")??{},i=`most-recent-occurrence-${t}`,o=s[i];return o?.value!==void 0&&Date.now()-o.timestamp<Od(e)?!1:(await r(),s[i]={value:!0,timestamp:Date.now()},n.set("cache",s),!0)}async function lR(t,e=Ne()){let{key:r,limit:n,timeout:s,task:i}=t,o=e.get("cache")??{},a=`rate-limited-occurrences-${r}`,c=o[a],l=Date.now();if(c?.value){let f=l-Od(s),d=c.value.filter(p=>p>=f);if(d.length>=n)return o[a]={value:d,timestamp:Date.now()},e.set("cache",o),!1;await i(),o[a]={value:[...d,l],timestamp:l}}else await i(),o[a]={value:[l],timestamp:l};return e.set("cache",o),!0}function fR(t=Ne()){return t.get("autoUpgradeEnabled")}function dR(t,e=Ne()){e.set("autoUpgradeEnabled",t)}u();function La(t,e){try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:String(r),s=e?` from ${e}`:"";throw new ht(`Failed to parse JSON${s}.
21
- ${n}`)}}u();u();import{Agent as hP}from"node:http";import{Agent as pP}from"node:https";u();u();u();var Td=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function tv(t){return Td.includes(t)}var rv=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Td];function nv(t){return rv.includes(t)}var sv=["null","undefined","string","number","bigint","boolean","symbol"];function iv(t){return sv.includes(t)}function $r(t){return e=>typeof e===t}var{toString:ov}=Object.prototype,Sn=t=>{let e=ov.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&m.domElement(t))return"HTMLElement";if(nv(e))return e},G=t=>e=>Sn(e)===t;function m(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(m.observable(t))return"Observable";if(m.array(t))return"Array";if(m.buffer(t))return"Buffer";let e=Sn(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}m.undefined=$r("undefined");m.string=$r("string");var av=$r("number");m.number=t=>av(t)&&!m.nan(t);m.positiveNumber=t=>m.number(t)&&t>0;m.negativeNumber=t=>m.number(t)&&t<0;m.bigint=$r("bigint");m.function_=$r("function");m.null_=t=>t===null;m.class_=t=>m.function_(t)&&t.toString().startsWith("class ");m.boolean=t=>t===!0||t===!1;m.symbol=$r("symbol");m.numericString=t=>m.string(t)&&!m.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));m.array=(t,e)=>Array.isArray(t)?m.function_(e)?t.every(r=>e(r)):!0:!1;m.buffer=t=>t?.constructor?.isBuffer?.(t)??!1;m.blob=t=>G("Blob")(t);m.nullOrUndefined=t=>m.null_(t)||m.undefined(t);m.object=t=>!m.null_(t)&&(typeof t=="object"||m.function_(t));m.iterable=t=>m.function_(t?.[Symbol.iterator]);m.asyncIterable=t=>m.function_(t?.[Symbol.asyncIterator]);m.generator=t=>m.iterable(t)&&m.function_(t?.next)&&m.function_(t?.throw);m.asyncGenerator=t=>m.asyncIterable(t)&&m.function_(t.next)&&m.function_(t.throw);m.nativePromise=t=>G("Promise")(t);var cv=t=>m.function_(t?.then)&&m.function_(t?.catch);m.promise=t=>m.nativePromise(t)||cv(t);m.generatorFunction=G("GeneratorFunction");m.asyncGeneratorFunction=t=>Sn(t)==="AsyncGeneratorFunction";m.asyncFunction=t=>Sn(t)==="AsyncFunction";m.boundFunction=t=>m.function_(t)&&!t.hasOwnProperty("prototype");m.regExp=G("RegExp");m.date=G("Date");m.error=G("Error");m.map=t=>G("Map")(t);m.set=t=>G("Set")(t);m.weakMap=t=>G("WeakMap")(t);m.weakSet=t=>G("WeakSet")(t);m.weakRef=t=>G("WeakRef")(t);m.int8Array=G("Int8Array");m.uint8Array=G("Uint8Array");m.uint8ClampedArray=G("Uint8ClampedArray");m.int16Array=G("Int16Array");m.uint16Array=G("Uint16Array");m.int32Array=G("Int32Array");m.uint32Array=G("Uint32Array");m.float32Array=G("Float32Array");m.float64Array=G("Float64Array");m.bigInt64Array=G("BigInt64Array");m.bigUint64Array=G("BigUint64Array");m.arrayBuffer=G("ArrayBuffer");m.sharedArrayBuffer=G("SharedArrayBuffer");m.dataView=G("DataView");m.enumCase=(t,e)=>Object.values(e).includes(t);m.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;m.urlInstance=t=>G("URL")(t);m.urlString=t=>{if(!m.string(t))return!1;try{return new URL(t),!0}catch{return!1}};m.truthy=t=>!!t;m.falsy=t=>!t;m.nan=t=>Number.isNaN(t);m.primitive=t=>m.null_(t)||iv(typeof t);m.integer=t=>Number.isInteger(t);m.safeInteger=t=>Number.isSafeInteger(t);m.plainObject=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};m.typedArray=t=>tv(Sn(t));var uv=t=>m.safeInteger(t)&&t>=0;m.arrayLike=t=>!m.nullOrUndefined(t)&&!m.function_(t)&&uv(t.length);m.tupleLike=(t,e)=>m.array(e)&&m.array(t)&&e.length===t.length?e.every((r,n)=>r(t[n])):!1;m.inRange=(t,e)=>{if(m.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(m.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var lv=1,fv=["innerHTML","ownerDocument","style","attributes","nodeValue"];m.domElement=t=>m.object(t)&&t.nodeType===lv&&m.string(t.nodeName)&&!m.plainObject(t)&&fv.every(e=>e in t);m.observable=t=>t?t===t[Symbol.observable]?.()||t===t["@@observable"]?.():!1;m.nodeStream=t=>m.object(t)&&m.function_(t.pipe)&&!m.observable(t);m.infinite=t=>t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY;var kd=t=>e=>m.integer(e)&&Math.abs(e%2)===t;m.evenInteger=kd(0);m.oddInteger=kd(1);m.emptyArray=t=>m.array(t)&&t.length===0;m.nonEmptyArray=t=>m.array(t)&&t.length>0;m.emptyString=t=>m.string(t)&&t.length===0;var dv=t=>m.string(t)&&!/\S/.test(t);m.emptyStringOrWhitespace=t=>m.emptyString(t)||dv(t);m.nonEmptyString=t=>m.string(t)&&t.length>0;m.nonEmptyStringAndNotWhitespace=t=>m.string(t)&&!m.emptyStringOrWhitespace(t);m.emptyObject=t=>m.object(t)&&!m.map(t)&&!m.set(t)&&Object.keys(t).length===0;m.nonEmptyObject=t=>m.object(t)&&!m.map(t)&&!m.set(t)&&Object.keys(t).length>0;m.emptySet=t=>m.set(t)&&t.size===0;m.nonEmptySet=t=>m.set(t)&&t.size>0;m.emptyMap=t=>m.map(t)&&t.size===0;m.nonEmptyMap=t=>m.map(t)&&t.size>0;m.propertyKey=t=>m.any([m.string,m.number,m.symbol],t);m.formData=t=>G("FormData")(t);m.urlSearchParams=t=>G("URLSearchParams")(t);var xd=(t,e,r)=>{if(!m.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};m.any=(t,...e)=>(m.array(t)?t:[t]).some(n=>xd(Array.prototype.some,n,e));m.all=(t,...e)=>xd(Array.prototype.every,t,e);var O=(t,e,r,n={})=>{if(!t){let{multipleValues:s}=n,i=s?`received values of types ${[...new Set(r.map(o=>`\`${m(o)}\``))].join(", ")}`:`received value of type \`${m(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${i}.`)}},$={undefined:t=>O(m.undefined(t),"undefined",t),string:t=>O(m.string(t),"string",t),number:t=>O(m.number(t),"number",t),positiveNumber:t=>O(m.positiveNumber(t),"positive number",t),negativeNumber:t=>O(m.negativeNumber(t),"negative number",t),bigint:t=>O(m.bigint(t),"bigint",t),function_:t=>O(m.function_(t),"Function",t),null_:t=>O(m.null_(t),"null",t),class_:t=>O(m.class_(t),"Class",t),boolean:t=>O(m.boolean(t),"boolean",t),symbol:t=>O(m.symbol(t),"symbol",t),numericString:t=>O(m.numericString(t),"string with a number",t),array:(t,e)=>{O(m.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>O(m.buffer(t),"Buffer",t),blob:t=>O(m.blob(t),"Blob",t),nullOrUndefined:t=>O(m.nullOrUndefined(t),"null or undefined",t),object:t=>O(m.object(t),"Object",t),iterable:t=>O(m.iterable(t),"Iterable",t),asyncIterable:t=>O(m.asyncIterable(t),"AsyncIterable",t),generator:t=>O(m.generator(t),"Generator",t),asyncGenerator:t=>O(m.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>O(m.nativePromise(t),"native Promise",t),promise:t=>O(m.promise(t),"Promise",t),generatorFunction:t=>O(m.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>O(m.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>O(m.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>O(m.boundFunction(t),"Function",t),regExp:t=>O(m.regExp(t),"RegExp",t),date:t=>O(m.date(t),"Date",t),error:t=>O(m.error(t),"Error",t),map:t=>O(m.map(t),"Map",t),set:t=>O(m.set(t),"Set",t),weakMap:t=>O(m.weakMap(t),"WeakMap",t),weakSet:t=>O(m.weakSet(t),"WeakSet",t),weakRef:t=>O(m.weakRef(t),"WeakRef",t),int8Array:t=>O(m.int8Array(t),"Int8Array",t),uint8Array:t=>O(m.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>O(m.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>O(m.int16Array(t),"Int16Array",t),uint16Array:t=>O(m.uint16Array(t),"Uint16Array",t),int32Array:t=>O(m.int32Array(t),"Int32Array",t),uint32Array:t=>O(m.uint32Array(t),"Uint32Array",t),float32Array:t=>O(m.float32Array(t),"Float32Array",t),float64Array:t=>O(m.float64Array(t),"Float64Array",t),bigInt64Array:t=>O(m.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>O(m.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>O(m.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>O(m.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>O(m.dataView(t),"DataView",t),enumCase:(t,e)=>O(m.enumCase(t,e),"EnumCase",t),urlInstance:t=>O(m.urlInstance(t),"URL",t),urlString:t=>O(m.urlString(t),"string with a URL",t),truthy:t=>O(m.truthy(t),"truthy",t),falsy:t=>O(m.falsy(t),"falsy",t),nan:t=>O(m.nan(t),"NaN",t),primitive:t=>O(m.primitive(t),"primitive",t),integer:t=>O(m.integer(t),"integer",t),safeInteger:t=>O(m.safeInteger(t),"integer",t),plainObject:t=>O(m.plainObject(t),"plain object",t),typedArray:t=>O(m.typedArray(t),"TypedArray",t),arrayLike:t=>O(m.arrayLike(t),"array-like",t),tupleLike:(t,e)=>O(m.tupleLike(t,e),"tuple-like",t),domElement:t=>O(m.domElement(t),"HTMLElement",t),observable:t=>O(m.observable(t),"Observable",t),nodeStream:t=>O(m.nodeStream(t),"Node.js Stream",t),infinite:t=>O(m.infinite(t),"infinite number",t),emptyArray:t=>O(m.emptyArray(t),"empty array",t),nonEmptyArray:t=>O(m.nonEmptyArray(t),"non-empty array",t),emptyString:t=>O(m.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>O(m.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>O(m.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>O(m.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>O(m.emptyObject(t),"empty object",t),nonEmptyObject:t=>O(m.nonEmptyObject(t),"non-empty object",t),emptySet:t=>O(m.emptySet(t),"empty set",t),nonEmptySet:t=>O(m.nonEmptySet(t),"non-empty set",t),emptyMap:t=>O(m.emptyMap(t),"empty map",t),nonEmptyMap:t=>O(m.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>O(m.propertyKey(t),"PropertyKey",t),formData:t=>O(m.formData(t),"FormData",t),urlSearchParams:t=>O(m.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>O(m.evenInteger(t),"even integer",t),oddInteger:t=>O(m.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>O(m.directInstanceOf(t,e),"T",t),inRange:(t,e)=>O(m.inRange(t,e),"in range",t),any:(t,...e)=>O(m.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>O(m.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(m,{class:{value:m.class_},function:{value:m.function_},null:{value:m.null_}});Object.defineProperties($,{class:{value:$.class_},function:{value:$.function_},null:{value:$.null_}});var _=m;u();import{EventEmitter as t$}from"node:events";u();var Fa=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Pr=class t{static fn(e){return(...r)=>new t((n,s,i)=>{r.push(i),e(...r).then(n,s)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,n)=>{this._reject=n;let s=a=>{(!this._isCanceled||!o.shouldReject)&&(this._isPending=!1,r(a))},i=a=>{this._isPending=!1,n(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(s,i,o)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new Fa(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Pr.prototype,Promise.prototype);u();function hv(t){return _.object(t)&&"_onResponse"in t}var Z=class extends Error{constructor(e,r,n){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code??"ERR_GOT_REQUEST_ERROR",this.input=r.input,hv(n)?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),this.options=n.options):this.options=n,this.timings=this.request?.timings,_.string(r.stack)&&_.string(this.stack)){let s=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(s).split(`
20
+ To resolve this, remove the Shopify CLI preferences folder:`),n.push({command:`rm -rf ${dt(this.config.path)}`}),n}};var qa;function Ae(){return qa??(qa=new Us({projectName:`shopify-cli-kit${gu()?"-test":""}`})),qa}function Da(){return Ci()?"devSessionStore":"sessionStore"}function Ma(){return Ci()?"currentDevSessionId":"currentSessionId"}function oR(t=Ae()){return je(ve`Getting session store...`),t.get(Da())}function aR(t,e=Ae()){je(ve`Setting session store...`),e.set(Da(),t)}function cR(t=Ae()){je(ve`Removing session store...`),t.delete(Da())}function uR(t=Ae()){return je(ve`Getting current session ID...`),t.get(Ma())}function lR(t,e=Ae()){je(ve`Setting current session ID...`),e.set(Ma(),t)}function fR(t=Ae()){je(ve`Removing current session ID...`),t.delete(Ma())}async function Od(t,e,r,n=Ae()){let s=La(t,n);if(s?.value!==void 0&&(r===void 0||Date.now()-s.timestamp<r))return s.value;let i=await e();return rv(t,i,n),i}function rv(t,e,r=Ae()){let n=r.get("cache")??{};n[t]={value:e,timestamp:Date.now()},r.set("cache",n)}function La(t,e=Ae()){return(e.get("cache")??{})[t]}function dR(t=Ae()){t.delete("cache")}function Td({days:t=0,hours:e=0,minutes:r=0,seconds:n=0}){return(t*24*60*60+e*60*60+r*60+n)*1e3}async function hR(t,e,r,n=Ae()){let s=n.get("cache")??{},i=`most-recent-occurrence-${t}`,o=s[i];return o?.value!==void 0&&Date.now()-o.timestamp<Td(e)?!1:(await r(),s[i]={value:!0,timestamp:Date.now()},n.set("cache",s),!0)}async function pR(t,e=Ae()){let{key:r,limit:n,timeout:s,task:i}=t,o=e.get("cache")??{},a=`rate-limited-occurrences-${r}`,c=o[a],l=Date.now();if(c?.value){let f=l-Td(s),d=c.value.filter(p=>p>=f);if(d.length>=n)return o[a]={value:d,timestamp:Date.now()},e.set("cache",o),!1;await i(),o[a]={value:[...d,l],timestamp:l}}else await i(),o[a]={value:[l],timestamp:l};return e.set("cache",o),!0}function mR(t=Ae()){return t.get("autoUpgradeEnabled")}function yR(t,e=Ae()){e.set("autoUpgradeEnabled",t)}u();function Fa(t,e){try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:String(r),s=e?` from ${e}`:"";throw new ht(`Failed to parse JSON${s}.
21
+ ${n}`)}}u();u();import{Agent as mP}from"node:http";import{Agent as yP}from"node:https";u();u();u();var kd=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function nv(t){return kd.includes(t)}var sv=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...kd];function iv(t){return sv.includes(t)}var ov=["null","undefined","string","number","bigint","boolean","symbol"];function av(t){return ov.includes(t)}function $r(t){return e=>typeof e===t}var{toString:cv}=Object.prototype,Sn=t=>{let e=cv.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&m.domElement(t))return"HTMLElement";if(iv(e))return e},G=t=>e=>Sn(e)===t;function m(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(m.observable(t))return"Observable";if(m.array(t))return"Array";if(m.buffer(t))return"Buffer";let e=Sn(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}m.undefined=$r("undefined");m.string=$r("string");var uv=$r("number");m.number=t=>uv(t)&&!m.nan(t);m.positiveNumber=t=>m.number(t)&&t>0;m.negativeNumber=t=>m.number(t)&&t<0;m.bigint=$r("bigint");m.function_=$r("function");m.null_=t=>t===null;m.class_=t=>m.function_(t)&&t.toString().startsWith("class ");m.boolean=t=>t===!0||t===!1;m.symbol=$r("symbol");m.numericString=t=>m.string(t)&&!m.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));m.array=(t,e)=>Array.isArray(t)?m.function_(e)?t.every(r=>e(r)):!0:!1;m.buffer=t=>t?.constructor?.isBuffer?.(t)??!1;m.blob=t=>G("Blob")(t);m.nullOrUndefined=t=>m.null_(t)||m.undefined(t);m.object=t=>!m.null_(t)&&(typeof t=="object"||m.function_(t));m.iterable=t=>m.function_(t?.[Symbol.iterator]);m.asyncIterable=t=>m.function_(t?.[Symbol.asyncIterator]);m.generator=t=>m.iterable(t)&&m.function_(t?.next)&&m.function_(t?.throw);m.asyncGenerator=t=>m.asyncIterable(t)&&m.function_(t.next)&&m.function_(t.throw);m.nativePromise=t=>G("Promise")(t);var lv=t=>m.function_(t?.then)&&m.function_(t?.catch);m.promise=t=>m.nativePromise(t)||lv(t);m.generatorFunction=G("GeneratorFunction");m.asyncGeneratorFunction=t=>Sn(t)==="AsyncGeneratorFunction";m.asyncFunction=t=>Sn(t)==="AsyncFunction";m.boundFunction=t=>m.function_(t)&&!t.hasOwnProperty("prototype");m.regExp=G("RegExp");m.date=G("Date");m.error=G("Error");m.map=t=>G("Map")(t);m.set=t=>G("Set")(t);m.weakMap=t=>G("WeakMap")(t);m.weakSet=t=>G("WeakSet")(t);m.weakRef=t=>G("WeakRef")(t);m.int8Array=G("Int8Array");m.uint8Array=G("Uint8Array");m.uint8ClampedArray=G("Uint8ClampedArray");m.int16Array=G("Int16Array");m.uint16Array=G("Uint16Array");m.int32Array=G("Int32Array");m.uint32Array=G("Uint32Array");m.float32Array=G("Float32Array");m.float64Array=G("Float64Array");m.bigInt64Array=G("BigInt64Array");m.bigUint64Array=G("BigUint64Array");m.arrayBuffer=G("ArrayBuffer");m.sharedArrayBuffer=G("SharedArrayBuffer");m.dataView=G("DataView");m.enumCase=(t,e)=>Object.values(e).includes(t);m.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;m.urlInstance=t=>G("URL")(t);m.urlString=t=>{if(!m.string(t))return!1;try{return new URL(t),!0}catch{return!1}};m.truthy=t=>!!t;m.falsy=t=>!t;m.nan=t=>Number.isNaN(t);m.primitive=t=>m.null_(t)||av(typeof t);m.integer=t=>Number.isInteger(t);m.safeInteger=t=>Number.isSafeInteger(t);m.plainObject=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};m.typedArray=t=>nv(Sn(t));var fv=t=>m.safeInteger(t)&&t>=0;m.arrayLike=t=>!m.nullOrUndefined(t)&&!m.function_(t)&&fv(t.length);m.tupleLike=(t,e)=>m.array(e)&&m.array(t)&&e.length===t.length?e.every((r,n)=>r(t[n])):!1;m.inRange=(t,e)=>{if(m.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(m.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var dv=1,hv=["innerHTML","ownerDocument","style","attributes","nodeValue"];m.domElement=t=>m.object(t)&&t.nodeType===dv&&m.string(t.nodeName)&&!m.plainObject(t)&&hv.every(e=>e in t);m.observable=t=>t?t===t[Symbol.observable]?.()||t===t["@@observable"]?.():!1;m.nodeStream=t=>m.object(t)&&m.function_(t.pipe)&&!m.observable(t);m.infinite=t=>t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY;var xd=t=>e=>m.integer(e)&&Math.abs(e%2)===t;m.evenInteger=xd(0);m.oddInteger=xd(1);m.emptyArray=t=>m.array(t)&&t.length===0;m.nonEmptyArray=t=>m.array(t)&&t.length>0;m.emptyString=t=>m.string(t)&&t.length===0;var pv=t=>m.string(t)&&!/\S/.test(t);m.emptyStringOrWhitespace=t=>m.emptyString(t)||pv(t);m.nonEmptyString=t=>m.string(t)&&t.length>0;m.nonEmptyStringAndNotWhitespace=t=>m.string(t)&&!m.emptyStringOrWhitespace(t);m.emptyObject=t=>m.object(t)&&!m.map(t)&&!m.set(t)&&Object.keys(t).length===0;m.nonEmptyObject=t=>m.object(t)&&!m.map(t)&&!m.set(t)&&Object.keys(t).length>0;m.emptySet=t=>m.set(t)&&t.size===0;m.nonEmptySet=t=>m.set(t)&&t.size>0;m.emptyMap=t=>m.map(t)&&t.size===0;m.nonEmptyMap=t=>m.map(t)&&t.size>0;m.propertyKey=t=>m.any([m.string,m.number,m.symbol],t);m.formData=t=>G("FormData")(t);m.urlSearchParams=t=>G("URLSearchParams")(t);var Rd=(t,e,r)=>{if(!m.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};m.any=(t,...e)=>(m.array(t)?t:[t]).some(n=>Rd(Array.prototype.some,n,e));m.all=(t,...e)=>Rd(Array.prototype.every,t,e);var O=(t,e,r,n={})=>{if(!t){let{multipleValues:s}=n,i=s?`received values of types ${[...new Set(r.map(o=>`\`${m(o)}\``))].join(", ")}`:`received value of type \`${m(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${i}.`)}},$={undefined:t=>O(m.undefined(t),"undefined",t),string:t=>O(m.string(t),"string",t),number:t=>O(m.number(t),"number",t),positiveNumber:t=>O(m.positiveNumber(t),"positive number",t),negativeNumber:t=>O(m.negativeNumber(t),"negative number",t),bigint:t=>O(m.bigint(t),"bigint",t),function_:t=>O(m.function_(t),"Function",t),null_:t=>O(m.null_(t),"null",t),class_:t=>O(m.class_(t),"Class",t),boolean:t=>O(m.boolean(t),"boolean",t),symbol:t=>O(m.symbol(t),"symbol",t),numericString:t=>O(m.numericString(t),"string with a number",t),array:(t,e)=>{O(m.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>O(m.buffer(t),"Buffer",t),blob:t=>O(m.blob(t),"Blob",t),nullOrUndefined:t=>O(m.nullOrUndefined(t),"null or undefined",t),object:t=>O(m.object(t),"Object",t),iterable:t=>O(m.iterable(t),"Iterable",t),asyncIterable:t=>O(m.asyncIterable(t),"AsyncIterable",t),generator:t=>O(m.generator(t),"Generator",t),asyncGenerator:t=>O(m.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>O(m.nativePromise(t),"native Promise",t),promise:t=>O(m.promise(t),"Promise",t),generatorFunction:t=>O(m.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>O(m.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>O(m.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>O(m.boundFunction(t),"Function",t),regExp:t=>O(m.regExp(t),"RegExp",t),date:t=>O(m.date(t),"Date",t),error:t=>O(m.error(t),"Error",t),map:t=>O(m.map(t),"Map",t),set:t=>O(m.set(t),"Set",t),weakMap:t=>O(m.weakMap(t),"WeakMap",t),weakSet:t=>O(m.weakSet(t),"WeakSet",t),weakRef:t=>O(m.weakRef(t),"WeakRef",t),int8Array:t=>O(m.int8Array(t),"Int8Array",t),uint8Array:t=>O(m.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>O(m.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>O(m.int16Array(t),"Int16Array",t),uint16Array:t=>O(m.uint16Array(t),"Uint16Array",t),int32Array:t=>O(m.int32Array(t),"Int32Array",t),uint32Array:t=>O(m.uint32Array(t),"Uint32Array",t),float32Array:t=>O(m.float32Array(t),"Float32Array",t),float64Array:t=>O(m.float64Array(t),"Float64Array",t),bigInt64Array:t=>O(m.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>O(m.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>O(m.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>O(m.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>O(m.dataView(t),"DataView",t),enumCase:(t,e)=>O(m.enumCase(t,e),"EnumCase",t),urlInstance:t=>O(m.urlInstance(t),"URL",t),urlString:t=>O(m.urlString(t),"string with a URL",t),truthy:t=>O(m.truthy(t),"truthy",t),falsy:t=>O(m.falsy(t),"falsy",t),nan:t=>O(m.nan(t),"NaN",t),primitive:t=>O(m.primitive(t),"primitive",t),integer:t=>O(m.integer(t),"integer",t),safeInteger:t=>O(m.safeInteger(t),"integer",t),plainObject:t=>O(m.plainObject(t),"plain object",t),typedArray:t=>O(m.typedArray(t),"TypedArray",t),arrayLike:t=>O(m.arrayLike(t),"array-like",t),tupleLike:(t,e)=>O(m.tupleLike(t,e),"tuple-like",t),domElement:t=>O(m.domElement(t),"HTMLElement",t),observable:t=>O(m.observable(t),"Observable",t),nodeStream:t=>O(m.nodeStream(t),"Node.js Stream",t),infinite:t=>O(m.infinite(t),"infinite number",t),emptyArray:t=>O(m.emptyArray(t),"empty array",t),nonEmptyArray:t=>O(m.nonEmptyArray(t),"non-empty array",t),emptyString:t=>O(m.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>O(m.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>O(m.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>O(m.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>O(m.emptyObject(t),"empty object",t),nonEmptyObject:t=>O(m.nonEmptyObject(t),"non-empty object",t),emptySet:t=>O(m.emptySet(t),"empty set",t),nonEmptySet:t=>O(m.nonEmptySet(t),"non-empty set",t),emptyMap:t=>O(m.emptyMap(t),"empty map",t),nonEmptyMap:t=>O(m.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>O(m.propertyKey(t),"PropertyKey",t),formData:t=>O(m.formData(t),"FormData",t),urlSearchParams:t=>O(m.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>O(m.evenInteger(t),"even integer",t),oddInteger:t=>O(m.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>O(m.directInstanceOf(t,e),"T",t),inRange:(t,e)=>O(m.inRange(t,e),"in range",t),any:(t,...e)=>O(m.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>O(m.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(m,{class:{value:m.class_},function:{value:m.function_},null:{value:m.null_}});Object.defineProperties($,{class:{value:$.class_},function:{value:$.function_},null:{value:$.null_}});var _=m;u();import{EventEmitter as n$}from"node:events";u();var za=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Pr=class t{static fn(e){return(...r)=>new t((n,s,i)=>{r.push(i),e(...r).then(n,s)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,n)=>{this._reject=n;let s=a=>{(!this._isCanceled||!o.shouldReject)&&(this._isPending=!1,r(a))},i=a=>{this._isPending=!1,n(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(s,i,o)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new za(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Pr.prototype,Promise.prototype);u();function mv(t){return _.object(t)&&"_onResponse"in t}var Z=class extends Error{constructor(e,r,n){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code??"ERR_GOT_REQUEST_ERROR",this.input=r.input,mv(n)?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),this.options=n.options):this.options=n,this.timings=this.request?.timings,_.string(r.stack)&&_.string(this.stack)){let s=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(s).split(`
22
22
  `).reverse(),o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
23
23
  `).reverse();for(;o.length>0&&o[0]===i[0];)i.shift();this.stack=`${this.stack.slice(0,s)}${i.reverse().join(`
24
24
  `)}${o.reverse().join(`
25
- `)}`}}},Us=class extends Z{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Pt=class extends Z{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},Hs=class extends Z{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},$n=class extends Z{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},Vs=class extends Z{constructor(e,r,n){super(e.message,e,n),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=r}},Pn=class extends Z{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},Bs=class extends Z{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},Gs=class extends Z{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}};u();import yp from"node:process";import{Buffer as jc}from"node:buffer";import{Duplex as GS}from"node:stream";import{URL as WS,URLSearchParams as KS}from"node:url";import JS,{ServerResponse as mp}from"node:http";u();var Cd=Oe(Rd(),1);import{errorMonitor as mv}from"events";import{types as yv}from"util";var gv=t=>{if(t.timings)return t.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=o=>{o.once(mv,()=>{e.error=Date.now(),e.phases.total=e.error-e.start})};r(t);let n=()=>{e.abort=Date.now(),e.phases.total=e.abort-e.start};t.prependOnceListener("abort",n);let s=o=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,yv.isProxy(o))return;let a=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};o.prependOnceListener("lookup",a),(0,Cd.default)(o,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(o.removeListener("lookup",a),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?s(t.socket):t.prependOnceListener("socket",s);let i=()=>{e.upload=Date.now(),e.phases.request=e.upload-(e.secureConnect??e.connect)};return t.writableFinished?i():t.prependOnceListener("finish",i),t.prependOnceListener("response",o=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,o.timings=e,r(o),o.prependOnceListener("end",()=>{t.off("abort",n),o.off("aborted",n),!e.phases.total&&(e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start)}),o.prependOnceListener("aborted",n)}),e},Nd=gv;u();import jv from"node:events";import Ks from"node:url";import Iv from"node:crypto";import qv,{PassThrough as Dv}from"node:stream";u();var _v="text/plain",wv="us-ascii",Va=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),bv=new Set(["https:","http:","file:"]),vv=t=>{try{let{protocol:e}=new URL(t);return e.endsWith(":")&&!e.includes(".")&&!bv.has(e)}catch{return!1}},Ev=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:s,hash:i}=r.groups,o=n.split(";"),a=o.at(-1)==="base64";a&&o.pop();let c=o.shift()?.toLowerCase()??"",f=[...o.map(p=>{let[y,g=""]=p.split("=").map(h=>h.trim());return y==="charset"&&(g=g.toLowerCase(),g===wv)?"":`${y}${g?`=${g}`:""}`}).filter(Boolean)];a&&f.push("base64"),(f.length>0||c&&c!==_v)&&f.unshift(c);let d=e||!i?"":`#${i}`;return`data:${f.join(";")},${a?s.trim():s}${d}`};function Ba(t,e){if(e={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,removePath:!1,transformPath:!1,...e},typeof e.defaultProtocol=="string"&&!e.defaultProtocol.endsWith(":")&&(e.defaultProtocol=`${e.defaultProtocol}:`),t=t.trim(),/^data:/i.test(t))return Ev(t,e);if(vv(t))return t;let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let s=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&s.protocol==="https:"&&(s.protocol="http:"),e.forceHttps&&s.protocol==="http:"&&(s.protocol="https:"),e.stripAuthentication&&(s.username="",s.password=""),e.stripHash?s.hash="":e.stripTextFragment&&(s.hash=s.hash.replace(/#?:~:text.*?$/i,"")),s.pathname){let o=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,a=0,c="";for(;;){let f=o.exec(s.pathname);if(!f)break;let d=f[0],p=f.index,y=s.pathname.slice(a,p);c+=y.replace(/\/{2,}/g,"/"),c+=d,a=p+d.length}let l=s.pathname.slice(a,s.pathname.length);c+=l.replace(/\/{2,}/g,"/"),s.pathname=c}if(s.pathname)try{s.pathname=decodeURI(s.pathname).replace(/\\/g,"%5C")}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let o=s.pathname.split("/").filter(Boolean),a=o.at(-1);a&&Va(a,e.removeDirectoryIndex)&&(o.pop(),s.pathname=o.length>0?`/${o.join("/")}/`:"/")}if(e.removePath&&(s.pathname="/"),e.transformPath&&typeof e.transformPath=="function"){let o=s.pathname.split("/").filter(Boolean),a=e.transformPath(o);s.pathname=a?.length>0?`/${a.join("/")}`:"/"}if(s.hostname&&(s.hostname=s.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(s.hostname)&&(s.hostname=s.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...s.searchParams.keys()])Va(o,e.removeQueryParameters)&&s.searchParams.delete(o);if(!Array.isArray(e.keepQueryParameters)&&e.removeQueryParameters===!0&&(s.search=""),Array.isArray(e.keepQueryParameters)&&e.keepQueryParameters.length>0)for(let o of[...s.searchParams.keys()])Va(o,e.keepQueryParameters)||s.searchParams.delete(o);if(e.sortQueryParameters){let o=s.search;s.searchParams.sort();try{s.search=decodeURIComponent(s.search)}catch{}let a=o.slice(1).split("&").filter(c=>c&&!c.includes("="));for(let c of a){let l=decodeURIComponent(c);s.search=s.search.replace(`?${l}=`,`?${l}`).replace(`&${l}=`,`&${l}`)}}e.removeTrailingSlash&&(s.pathname=s.pathname.replace(/\/$/,"")),e.removeExplicitPort&&s.port&&(s.port="");let i=t;return t=s.toString(),!e.removeSingleSlash&&s.pathname==="/"&&!i.endsWith("/")&&s.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||s.pathname==="/")&&s.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}var zd=Oe(pu(),1),Js=Oe(jd(),1);u();import{Readable as Rv}from"node:stream";u();function Or(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLowerCase(),r]))}var Tr=class extends Rv{statusCode;headers;body;url;constructor({statusCode:e,headers:r,body:n,url:s}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof s!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(n),this.push(null)}}),this.statusCode=e,this.headers=Or(r),this.body=n,this.url=s}};var On=Oe(Ld(),1);u();var Av=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function Ja(t,e){if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set([...Object.keys(t),...Av]),n={};for(let s of r)s in e||(n[s]={get(){let i=t[s];return typeof i=="function"?i.bind(t):i},set(i){t[s]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}u();var Ws=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},ut=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}};var Qa=class{constructor(e,r){this.hooks=new Map,this.request=()=>(n,s)=>{let i;if(typeof n=="string")i=Ya(Ks.parse(n)),n={};else if(n instanceof Ks.URL)i=Ya(Ks.parse(n.toString())),n={};else{let[p,...y]=(n.path??"").split("?"),g=y.length>0?`?${y.join("?")}`:"";i=Ya({...n,pathname:p,search:g})}n={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...n,...Fv(i)},n.headers=Object.fromEntries(Mv(n.headers).map(([p,y])=>[p.toLowerCase(),y]));let o=new jv,a=Ba(Ks.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),c=`${n.method}:${a}`;n.body&&n.method!==void 0&&["POST","PATCH","PUT"].includes(n.method)&&(n.body instanceof qv.Readable?n.cache=!1:c+=`:${Iv.createHash("md5").update(n.body).digest("hex")}`);let l=!1,f=!1,d=p=>{f=!0;let y=!1,g=()=>{},h=new Promise(w=>{g=()=>{y||(y=!0,w())}}),b=async w=>{if(l){w.status=w.statusCode;let E=Js.default.fromObject(l.cachePolicy).revalidatedPolicy(p,w);if(!E.modified){w.resume(),await new Promise(T=>{w.once("end",T)});let S=Fd(E.policy.responseHeaders());w=new Tr({statusCode:l.statusCode,headers:S,body:l.body,url:l.url}),w.cachePolicy=E.policy,w.fromCache=!0}}w.fromCache||(w.cachePolicy=new Js.default(p,w,p),w.fromCache=!1);let P;p.cache&&w.cachePolicy.storable()?(P=Lv(w),(async()=>{try{let E=zd.default.buffer(w);await Promise.race([h,new Promise(C=>w.once("end",C)),new Promise(C=>w.once("close",C))]);let S=await E,T={url:w.url,statusCode:w.fromCache?l.statusCode:w.statusCode,body:S,cachePolicy:w.cachePolicy.toObject()},D=p.strictTtl?w.cachePolicy.timeToLive():void 0;if(p.maxTtl&&(D=D?Math.min(D,p.maxTtl):p.maxTtl),this.hooks.size>0)for(let C of this.hooks.keys())T=await this.runHook(C,T,w);await this.cache.set(c,T,D)}catch(E){o.emit("error",new ut(E))}})()):p.cache&&l&&(async()=>{try{await this.cache.delete(c)}catch(E){o.emit("error",new ut(E))}})(),o.emit("response",P??w),typeof s=="function"&&s(P??w)};try{let w=this.cacheRequest(p,b);w.once("error",g),w.once("abort",g),w.once("destroy",g),o.emit("request",w)}catch(w){o.emit("error",new Ws(w))}};return(async()=>{let p=async g=>{await Promise.resolve();let h=g.cache?await this.cache.get(c):void 0;if(h===void 0&&!g.forceRefresh){d(g);return}let b=Js.default.fromObject(h.cachePolicy);if(b.satisfiesWithoutRevalidation(g)&&!g.forceRefresh){let w=Fd(b.responseHeaders()),P=new Tr({statusCode:h.statusCode,headers:w,body:h.body,url:h.url});P.cachePolicy=b,P.fromCache=!0,o.emit("response",P),typeof s=="function"&&s(P)}else b.satisfiesWithoutRevalidation(g)&&Date.now()>=b.timeToLive()&&g.forceRefresh?(await this.cache.delete(c),g.headers=b.revalidationHeaders(g),d(g)):(l=h,g.headers=b.revalidationHeaders(g),d(g))},y=g=>o.emit("error",new ut(g));if(this.cache instanceof On.default){let g=this.cache;g.once("error",y),o.on("error",()=>g.removeListener("error",y)),o.on("response",()=>g.removeListener("error",y))}try{await p(n)}catch(g){n.automaticFailover&&!f&&d(n),o.emit("error",new ut(g))}})(),o},this.addHook=(n,s)=>{this.hooks.has(n)||this.hooks.set(n,s)},this.removeHook=n=>this.hooks.delete(n),this.getHook=n=>this.hooks.get(n),this.runHook=async(n,...s)=>this.hooks.get(n)?.(...s),r instanceof On.default?this.cache=r:typeof r=="string"?this.cache=new On.default({uri:r,namespace:"cacheable-request"}):this.cache=new On.default({store:r,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},Mv=Object.entries,Lv=t=>{let e=new Dv({autoDestroy:!1});return Ja(t,e),t.pipe(e)},Fv=t=>{let e={...t};return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e},Ya=t=>({protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}),Fd=t=>{let e=[];for(let r of Object.keys(t))e[r.toLowerCase()]=t[r];return e},Ud=Qa;var gp=Oe(Gd(),1);var _p=Oe(pu(),1);u();u();u();var ze=t=>typeof t=="function";var Bv=t=>ze(t[Symbol.asyncIterator]);async function*Gv(t){let e=t.getReader();for(;;){let{done:r,value:n}=await e.read();if(r)break;yield n}}var Wd=t=>{if(Bv(t))return t;if(ze(t.getReader))return Gv(t);throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")};u();var Kd="abcdefghijklmnopqrstuvwxyz0123456789";function Jd(){let t=16,e="";for(;t--;)e+=Kd[Math.random()*Kd.length<<0];return e}u();var Za=t=>String(t).replace(/\r|\n/g,(e,r,n)=>e==="\r"&&n[r+1]!==`
25
+ `)}`}}},Hs=class extends Z{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Pt=class extends Z{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},Vs=class extends Z{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},$n=class extends Z{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},Bs=class extends Z{constructor(e,r,n){super(e.message,e,n),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=r}},Pn=class extends Z{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},Gs=class extends Z{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},Ws=class extends Z{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}};u();import gp from"node:process";import{Buffer as Ic}from"node:buffer";import{Duplex as KS}from"node:stream";import{URL as JS,URLSearchParams as YS}from"node:url";import QS,{ServerResponse as yp}from"node:http";u();var Nd=Oe(Cd(),1);import{errorMonitor as gv}from"events";import{types as _v}from"util";var wv=t=>{if(t.timings)return t.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=o=>{o.once(gv,()=>{e.error=Date.now(),e.phases.total=e.error-e.start})};r(t);let n=()=>{e.abort=Date.now(),e.phases.total=e.abort-e.start};t.prependOnceListener("abort",n);let s=o=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,_v.isProxy(o))return;let a=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};o.prependOnceListener("lookup",a),(0,Nd.default)(o,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(o.removeListener("lookup",a),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?s(t.socket):t.prependOnceListener("socket",s);let i=()=>{e.upload=Date.now(),e.phases.request=e.upload-(e.secureConnect??e.connect)};return t.writableFinished?i():t.prependOnceListener("finish",i),t.prependOnceListener("response",o=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,o.timings=e,r(o),o.prependOnceListener("end",()=>{t.off("abort",n),o.off("aborted",n),!e.phases.total&&(e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start)}),o.prependOnceListener("aborted",n)}),e},Ad=wv;u();import qv from"node:events";import Js from"node:url";import Dv from"node:crypto";import Mv,{PassThrough as Lv}from"node:stream";u();var bv="text/plain",vv="us-ascii",Ba=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Ev=new Set(["https:","http:","file:"]),Sv=t=>{try{let{protocol:e}=new URL(t);return e.endsWith(":")&&!e.includes(".")&&!Ev.has(e)}catch{return!1}},$v=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:s,hash:i}=r.groups,o=n.split(";"),a=o.at(-1)==="base64";a&&o.pop();let c=o.shift()?.toLowerCase()??"",f=[...o.map(p=>{let[y,g=""]=p.split("=").map(h=>h.trim());return y==="charset"&&(g=g.toLowerCase(),g===vv)?"":`${y}${g?`=${g}`:""}`}).filter(Boolean)];a&&f.push("base64"),(f.length>0||c&&c!==bv)&&f.unshift(c);let d=e||!i?"":`#${i}`;return`data:${f.join(";")},${a?s.trim():s}${d}`};function Ga(t,e){if(e={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,removePath:!1,transformPath:!1,...e},typeof e.defaultProtocol=="string"&&!e.defaultProtocol.endsWith(":")&&(e.defaultProtocol=`${e.defaultProtocol}:`),t=t.trim(),/^data:/i.test(t))return $v(t,e);if(Sv(t))return t;let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let s=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&s.protocol==="https:"&&(s.protocol="http:"),e.forceHttps&&s.protocol==="http:"&&(s.protocol="https:"),e.stripAuthentication&&(s.username="",s.password=""),e.stripHash?s.hash="":e.stripTextFragment&&(s.hash=s.hash.replace(/#?:~:text.*?$/i,"")),s.pathname){let o=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,a=0,c="";for(;;){let f=o.exec(s.pathname);if(!f)break;let d=f[0],p=f.index,y=s.pathname.slice(a,p);c+=y.replace(/\/{2,}/g,"/"),c+=d,a=p+d.length}let l=s.pathname.slice(a,s.pathname.length);c+=l.replace(/\/{2,}/g,"/"),s.pathname=c}if(s.pathname)try{s.pathname=decodeURI(s.pathname).replace(/\\/g,"%5C")}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let o=s.pathname.split("/").filter(Boolean),a=o.at(-1);a&&Ba(a,e.removeDirectoryIndex)&&(o.pop(),s.pathname=o.length>0?`/${o.join("/")}/`:"/")}if(e.removePath&&(s.pathname="/"),e.transformPath&&typeof e.transformPath=="function"){let o=s.pathname.split("/").filter(Boolean),a=e.transformPath(o);s.pathname=a?.length>0?`/${a.join("/")}`:"/"}if(s.hostname&&(s.hostname=s.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(s.hostname)&&(s.hostname=s.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...s.searchParams.keys()])Ba(o,e.removeQueryParameters)&&s.searchParams.delete(o);if(!Array.isArray(e.keepQueryParameters)&&e.removeQueryParameters===!0&&(s.search=""),Array.isArray(e.keepQueryParameters)&&e.keepQueryParameters.length>0)for(let o of[...s.searchParams.keys()])Ba(o,e.keepQueryParameters)||s.searchParams.delete(o);if(e.sortQueryParameters){let o=s.search;s.searchParams.sort();try{s.search=decodeURIComponent(s.search)}catch{}let a=o.slice(1).split("&").filter(c=>c&&!c.includes("="));for(let c of a){let l=decodeURIComponent(c);s.search=s.search.replace(`?${l}=`,`?${l}`).replace(`&${l}=`,`&${l}`)}}e.removeTrailingSlash&&(s.pathname=s.pathname.replace(/\/$/,"")),e.removeExplicitPort&&s.port&&(s.port="");let i=t;return t=s.toString(),!e.removeSingleSlash&&s.pathname==="/"&&!i.endsWith("/")&&s.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||s.pathname==="/")&&s.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}var Ud=Oe(yu(),1),Ys=Oe(Id(),1);u();import{Readable as Nv}from"node:stream";u();function Or(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLowerCase(),r]))}var Tr=class extends Nv{statusCode;headers;body;url;constructor({statusCode:e,headers:r,body:n,url:s}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof s!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(n),this.push(null)}}),this.statusCode=e,this.headers=Or(r),this.body=n,this.url=s}};var On=Oe(Fd(),1);u();var Iv=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function Ya(t,e){if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set([...Object.keys(t),...Iv]),n={};for(let s of r)s in e||(n[s]={get(){let i=t[s];return typeof i=="function"?i.bind(t):i},set(i){t[s]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}u();var Ks=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},ut=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}};var Xa=class{constructor(e,r){this.hooks=new Map,this.request=()=>(n,s)=>{let i;if(typeof n=="string")i=Qa(Js.parse(n)),n={};else if(n instanceof Js.URL)i=Qa(Js.parse(n.toString())),n={};else{let[p,...y]=(n.path??"").split("?"),g=y.length>0?`?${y.join("?")}`:"";i=Qa({...n,pathname:p,search:g})}n={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...n,...Uv(i)},n.headers=Object.fromEntries(Fv(n.headers).map(([p,y])=>[p.toLowerCase(),y]));let o=new qv,a=Ga(Js.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),c=`${n.method}:${a}`;n.body&&n.method!==void 0&&["POST","PATCH","PUT"].includes(n.method)&&(n.body instanceof Mv.Readable?n.cache=!1:c+=`:${Dv.createHash("md5").update(n.body).digest("hex")}`);let l=!1,f=!1,d=p=>{f=!0;let y=!1,g=()=>{},h=new Promise(w=>{g=()=>{y||(y=!0,w())}}),b=async w=>{if(l){w.status=w.statusCode;let E=Ys.default.fromObject(l.cachePolicy).revalidatedPolicy(p,w);if(!E.modified){w.resume(),await new Promise(T=>{w.once("end",T)});let S=zd(E.policy.responseHeaders());w=new Tr({statusCode:l.statusCode,headers:S,body:l.body,url:l.url}),w.cachePolicy=E.policy,w.fromCache=!0}}w.fromCache||(w.cachePolicy=new Ys.default(p,w,p),w.fromCache=!1);let P;p.cache&&w.cachePolicy.storable()?(P=zv(w),(async()=>{try{let E=Ud.default.buffer(w);await Promise.race([h,new Promise(C=>w.once("end",C)),new Promise(C=>w.once("close",C))]);let S=await E,T={url:w.url,statusCode:w.fromCache?l.statusCode:w.statusCode,body:S,cachePolicy:w.cachePolicy.toObject()},D=p.strictTtl?w.cachePolicy.timeToLive():void 0;if(p.maxTtl&&(D=D?Math.min(D,p.maxTtl):p.maxTtl),this.hooks.size>0)for(let C of this.hooks.keys())T=await this.runHook(C,T,w);await this.cache.set(c,T,D)}catch(E){o.emit("error",new ut(E))}})()):p.cache&&l&&(async()=>{try{await this.cache.delete(c)}catch(E){o.emit("error",new ut(E))}})(),o.emit("response",P??w),typeof s=="function"&&s(P??w)};try{let w=this.cacheRequest(p,b);w.once("error",g),w.once("abort",g),w.once("destroy",g),o.emit("request",w)}catch(w){o.emit("error",new Ks(w))}};return(async()=>{let p=async g=>{await Promise.resolve();let h=g.cache?await this.cache.get(c):void 0;if(h===void 0&&!g.forceRefresh){d(g);return}let b=Ys.default.fromObject(h.cachePolicy);if(b.satisfiesWithoutRevalidation(g)&&!g.forceRefresh){let w=zd(b.responseHeaders()),P=new Tr({statusCode:h.statusCode,headers:w,body:h.body,url:h.url});P.cachePolicy=b,P.fromCache=!0,o.emit("response",P),typeof s=="function"&&s(P)}else b.satisfiesWithoutRevalidation(g)&&Date.now()>=b.timeToLive()&&g.forceRefresh?(await this.cache.delete(c),g.headers=b.revalidationHeaders(g),d(g)):(l=h,g.headers=b.revalidationHeaders(g),d(g))},y=g=>o.emit("error",new ut(g));if(this.cache instanceof On.default){let g=this.cache;g.once("error",y),o.on("error",()=>g.removeListener("error",y)),o.on("response",()=>g.removeListener("error",y))}try{await p(n)}catch(g){n.automaticFailover&&!f&&d(n),o.emit("error",new ut(g))}})(),o},this.addHook=(n,s)=>{this.hooks.has(n)||this.hooks.set(n,s)},this.removeHook=n=>this.hooks.delete(n),this.getHook=n=>this.hooks.get(n),this.runHook=async(n,...s)=>this.hooks.get(n)?.(...s),r instanceof On.default?this.cache=r:typeof r=="string"?this.cache=new On.default({uri:r,namespace:"cacheable-request"}):this.cache=new On.default({store:r,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},Fv=Object.entries,zv=t=>{let e=new Lv({autoDestroy:!1});return Ya(t,e),t.pipe(e)},Uv=t=>{let e={...t};return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e},Qa=t=>({protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}),zd=t=>{let e=[];for(let r of Object.keys(t))e[r.toLowerCase()]=t[r];return e},Hd=Xa;var _p=Oe(Wd(),1);var wp=Oe(yu(),1);u();u();u();var ze=t=>typeof t=="function";var Wv=t=>ze(t[Symbol.asyncIterator]);async function*Kv(t){let e=t.getReader();for(;;){let{done:r,value:n}=await e.read();if(r)break;yield n}}var Kd=t=>{if(Wv(t))return t;if(ze(t.getReader))return Kv(t);throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")};u();var Jd="abcdefghijklmnopqrstuvwxyz0123456789";function Yd(){let t=16,e="";for(;t--;)e+=Jd[Math.random()*Jd.length<<0];return e}u();var ec=t=>String(t).replace(/\r|\n/g,(e,r,n)=>e==="\r"&&n[r+1]!==`
26
26
  `||e===`
27
27
  `&&n[r-1]!=="\r"?`\r
28
- `:e);u();var Wv=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function ec(t){if(Wv(t)!=="object")return!1;let e=Object.getPrototypeOf(t);return e==null?!0:(e.constructor&&e.constructor.toString())===Object.toString()}u();function Yd(t,e){if(typeof e=="string"){for(let[r,n]of Object.entries(t))if(e.toLowerCase()===r.toLowerCase())return n}}var Qd=t=>new Proxy(t,{get:(e,r)=>Yd(e,r),has:(e,r)=>Yd(e,r)!==void 0});u();var kr=t=>!!(t&&ze(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&ze(t.append)&&ze(t.getAll)&&ze(t.entries)&&ze(t[Symbol.iterator]));u();var tc=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");u();var Ot=t=>!!(t&&typeof t=="object"&&ze(t.constructor)&&t[Symbol.toStringTag]==="File"&&ze(t.stream)&&t.name!=null);var Tn=function(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kn,Tt,xn,Ys,Rn,Gt,Cn,Nn,Qs,rc,Xd,Kv={enableAdditionalHeaders:!1},Xs={writable:!1,configurable:!1},Zs=class{constructor(e,r,n){if(kn.add(this),Tt.set(this,`\r
29
- `),xn.set(this,void 0),Ys.set(this,void 0),Rn.set(this,"-".repeat(2)),Gt.set(this,new TextEncoder),Cn.set(this,void 0),Nn.set(this,void 0),Qs.set(this,void 0),!kr(e))throw new TypeError("Expected first argument to be a FormData instance.");let s;if(ec(r)?n=r:s=r,s||(s=Jd()),typeof s!="string")throw new TypeError("Expected boundary argument to be a string.");if(n&&!ec(n))throw new TypeError("Expected options argument to be an object.");Tn(this,Nn,Array.from(e.entries()),"f"),Tn(this,Qs,{...Kv,...n},"f"),Tn(this,xn,Q(this,Gt,"f").encode(Q(this,Tt,"f")),"f"),Tn(this,Ys,Q(this,xn,"f").byteLength,"f"),this.boundary=`form-data-boundary-${s}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,Tn(this,Cn,Q(this,Gt,"f").encode(`${Q(this,Rn,"f")}${this.boundary}${Q(this,Rn,"f")}${Q(this,Tt,"f").repeat(2)}`),"f");let i={"Content-Type":this.contentType},o=Q(this,kn,"m",Xd).call(this);o&&(this.contentLength=o,i["Content-Length"]=o),this.headers=Qd(Object.freeze(i)),Object.defineProperties(this,{boundary:Xs,contentType:Xs,contentLength:Xs,headers:Xs})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,r]of Q(this,Nn,"f")){let n=Ot(r)?r:Q(this,Gt,"f").encode(Za(r));yield Q(this,kn,"m",rc).call(this,e,n),yield n,yield Q(this,xn,"f")}yield Q(this,Cn,"f")}async*encode(){for(let e of this.values())Ot(e)?yield*Wd(e.stream()):yield e}[(Tt=new WeakMap,xn=new WeakMap,Ys=new WeakMap,Rn=new WeakMap,Gt=new WeakMap,Cn=new WeakMap,Nn=new WeakMap,Qs=new WeakMap,kn=new WeakSet,rc=function(r,n){let s="";s+=`${Q(this,Rn,"f")}${this.boundary}${Q(this,Tt,"f")}`,s+=`Content-Disposition: form-data; name="${tc(r)}"`,Ot(n)&&(s+=`; filename="${tc(n.name)}"${Q(this,Tt,"f")}`,s+=`Content-Type: ${n.type||"application/octet-stream"}`);let i=Ot(n)?n.size:n.byteLength;return Q(this,Qs,"f").enableAdditionalHeaders===!0&&i!=null&&!isNaN(i)&&(s+=`${Q(this,Tt,"f")}Content-Length: ${Ot(n)?n.size:n.byteLength}`),Q(this,Gt,"f").encode(`${s}${Q(this,Tt,"f").repeat(2)}`)},Xd=function(){let r=0;for(let[n,s]of Q(this,Nn,"f")){let i=Ot(s)?s:Q(this,Gt,"f").encode(Za(s)),o=Ot(i)?i.size:i.byteLength;if(o==null||isNaN(o))return;r+=Q(this,kn,"m",rc).call(this,n,i).byteLength,r+=o,r+=Q(this,Ys,"f")}return String(r+Q(this,Cn,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};u();import{Buffer as Jv}from"node:buffer";import{promisify as Yv}from"node:util";u();function An(t){return _.nodeStream(t)&&_.function_(t.getBoundary)}async function nc(t,e){if(e&&"content-length"in e)return Number(e["content-length"]);if(!t)return 0;if(_.string(t))return Jv.byteLength(t);if(_.buffer(t))return t.length;if(An(t))return Yv(t.getLength.bind(t))()}u();function jn(t,e,r){let n={};for(let s of r){let i=(...o)=>{e.emit(s,...o)};n[s]=i,t.on(s,i)}return()=>{for(let[s,i]of Object.entries(n))t.off(s,i)}}u();import Qv from"node:net";u();function sc(){let t=[];return{once(e,r,n){e.once(r,n),t.push({origin:e,event:r,fn:n})},unhandleAll(){for(let e of t){let{origin:r,event:n,fn:s}=e;r.removeListener(n,s)}t.length=0}}}var Zd=Symbol("reentry"),Xv=()=>{},In=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function ic(t,e,r){if(Zd in t)return Xv;t[Zd]=!0;let n=[],{once:s,unhandleAll:i}=sc(),o=(h,b,w)=>{let P=setTimeout(b,h,h,w);P.unref?.();let E=()=>{clearTimeout(P)};return n.push(E),E},{host:a,hostname:c}=r,l=(h,b)=>{t.destroy(new In(h,b))},f=()=>{for(let h of n)h();i()};if(t.once("error",h=>{if(f(),t.listenerCount("error")===0)throw h}),typeof e.request<"u"){let h=o(e.request,l,"request");s(t,"response",b=>{s(b,"end",h)})}if(typeof e.socket<"u"){let{socket:h}=e,b=()=>{l(h,"socket")};t.setTimeout(h,b),n.push(()=>{t.removeListener("timeout",b)})}let d=typeof e.lookup<"u",p=typeof e.connect<"u",y=typeof e.secureConnect<"u",g=typeof e.send<"u";return(d||p||y||g)&&s(t,"socket",h=>{let{socketPath:b}=t;if(h.connecting){let w=!!(b??Qv.isIP(c??a??"")!==0);if(d&&!w&&typeof h.address().address>"u"){let P=o(e.lookup,l,"lookup");s(h,"lookup",P)}if(p){let P=()=>o(e.connect,l,"connect");w?s(h,"connect",P()):s(h,"lookup",E=>{E===null&&s(h,"connect",P())})}y&&r.protocol==="https:"&&s(h,"connect",()=>{let P=o(e.secureConnect,l,"secureConnect");s(h,"secureConnect",P)})}if(g){let w=()=>o(e.send,l,"send");h.connecting?s(h,"connect",()=>{s(t,"upload-complete",w())}):s(t,"upload-complete",w())}}),typeof e.response<"u"&&s(t,"upload-complete",()=>{let h=o(e.response,l,"response");s(t,"response",h)}),typeof e.read<"u"&&s(t,"response",h=>{let b=o(e.read,l,"read");s(h,"end",b)}),f}u();function oc(t){t=t;let e={protocol:t.protocol,hostname:_.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return _.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}u();var qn=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};u();var Zv=({attemptCount:t,retryOptions:e,error:r,retryAfter:n,computedValue:s})=>{if(r.name==="RetryError")return 1;if(t>e.limit)return 0;let i=e.methods.includes(r.options.method),o=e.errorCodes.includes(r.code),a=r.response&&e.statusCodes.includes(r.response.statusCode);if(!i||!o&&!a)return 0;if(r.response){if(n)return n>s?0:n;if(r.response.statusCode===413)return 0}let c=Math.random()*e.noise;return Math.min(2**(t-1)*1e3,e.backoffLimit)+c},eh=Zv;u();import NS from"node:process";import{promisify as up,inspect as AS}from"node:util";import{URL as dp,URLSearchParams as Hn}from"node:url";import{checkServerIdentity as jS}from"node:tls";import IS from"node:http";import qS from"node:https";u();import{V4MAPPED as eE,ADDRCONFIG as tE,ALL as oh,promises as rE,lookup as nE}from"node:dns";import{promisify as ac}from"node:util";import sE from"node:os";var{Resolver:th}=rE,xr=Symbol("cacheableLookupCreateConnection"),cc=Symbol("cacheableLookupInstance"),rh=Symbol("expires"),iE=typeof oh=="number",nh=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},oE=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},sh=()=>{let t=!1,e=!1;for(let r of Object.values(sE.networkInterfaces()))for(let n of r)if(!n.internal&&(n.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},aE=t=>Symbol.iterator in t,ei=t=>t.catch(e=>{if(e.code==="ENODATA"||e.code==="ENOTFOUND"||e.code==="ENOENT")return[];throw e}),ih={ttl:!0},cE={all:!0},uE={all:!0,family:4},lE={all:!0,family:6},Dn=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:n=3600,errorTtl:s=.15,resolver:i=new th,lookup:o=nE}={}){if(this.maxTtl=r,this.errorTtl=s,this._cache=e,this._resolver=i,this._dnsLookup=o&&ac(o),this.stats={cache:0,query:0},this._resolver instanceof th?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=ac(this._resolver.resolve4.bind(this._resolver)),this._resolve6=ac(this._resolver.resolve6.bind(this._resolver))),this._iface=sh(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=n,n>0){let a=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);a.unref&&a.unref(),this._fallbackInterval=a}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,n){if(typeof r=="function"?(n=r,r={}):typeof r=="number"&&(r={family:r}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(s=>{r.all?n(null,s):n(null,s.address,s.family,s.expires,s.ttl,s.source)},n)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let n=await this.query(e);if(r.family===6){let s=n.filter(i=>i.family===6);r.hints&eE&&(iE&&r.hints&oh||s.length===0)?oE(n):n=s}else r.family===4&&(n=n.filter(s=>s.family===4));if(r.hints&tE){let{_iface:s}=this;n=n.filter(i=>i.family===6?s.has6:s.has4)}if(n.length===0){let s=new Error(`cacheableLookup ENOTFOUND ${e}`);throw s.code="ENOTFOUND",s.hostname=e,s}return r.all?n:n[0]}async query(e){let r="cache",n=await this._cache.get(e);if(n&&this.stats.cache++,!n){let s=this._pending[e];if(s)this.stats.cache++,n=await s;else{r="query";let i=this.queryAndCache(e);this._pending[e]=i,this.stats.query++;try{n=await i}finally{delete this._pending[e]}}}return n=n.map(s=>({...s,source:r})),n}async _resolve(e){let[r,n]=await Promise.all([ei(this._resolve4(e,ih)),ei(this._resolve6(e,ih))]),s=0,i=0,o=0,a=Date.now();for(let c of r)c.family=4,c.expires=a+c.ttl*1e3,s=Math.max(s,c.ttl);for(let c of n)c.family=6,c.expires=a+c.ttl*1e3,i=Math.max(i,c.ttl);return r.length>0?n.length>0?o=Math.min(s,i):o=s:o=i,{entries:[...r,...n],cacheTtl:o}}async _lookup(e){try{let[r,n]=await Promise.all([ei(this._dnsLookup(e,uE)),ei(this._dnsLookup(e,lE))]);return{entries:[...r,...n],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,r[rh]=Date.now()+n;try{await this._cache.set(e,r,n)}catch(s){this.lookupAsync=async()=>{let i=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw i.cause=s,i}}aE(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,cE);let r=await this._resolve(e);r.entries.length===0&&this._dnsLookup&&(r=await this._lookup(e),r.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let n=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,n),r.entries}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let n=1/0,s=Date.now();for(let[i,o]of this._cache){let a=o[rh];s>=a?this._cache.delete(i):a<n&&(n=a)}n!==1/0&&this._tick(n-s)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(nh(e),xr in e)throw new Error("CacheableLookup has been already installed");e[xr]=e.createConnection,e[cc]=this,e.createConnection=(r,n)=>("lookup"in r||(r.lookup=this.lookup),e[xr](r,n))}uninstall(e){if(nh(e),e[xr]){if(e[cc]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[xr],delete e[xr],delete e[cc]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=sh(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};var hp=Oe(cp(),1);u();function Nc(t){let e=[],r=t.split(",");for(let n of r){let[s,...i]=n.split(";"),o=s.trim();if(o[0]!=="<"||o[o.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${o}`);let a=o.slice(1,-1),c={};if(i.length===0)throw new Error(`Unexpected end of Link header parameters: ${i.join(";")}`);for(let l of i){let f=l.trim(),d=f.indexOf("=");if(d===-1)throw new Error(`Failed to parse Link header: ${t}`);let p=f.slice(0,d).trim(),y=f.slice(d+1).trim();c[p]=y}e.push({reference:a,parameters:c})}return e}var[lp,DS]=NS.versions.node.split(".").map(Number);function MS(t){for(let e in t){let r=t[e];$.any([_.string,_.number,_.boolean,_.null_,_.undefined],r)}}var LS=new Map,ai,FS=()=>ai||(ai=new Dn,ai),zS={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(t){return t.request.options.responseType==="json"?t.body:JSON.parse(t.body)},paginate({response:t}){let e=t.headers.link;if(typeof e!="string"||e.trim()==="")return!1;let n=Nc(e).find(s=>s.parameters.rel==="next"||s.parameters.rel==='"next"');return n?{url:new dp(n.reference,t.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},US=t=>{let{hooks:e,retry:r}=t,n={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...r,errorCodes:[...r.errorCodes],methods:[...r.methods],statusCodes:[...r.statusCodes]},timeout:{...t.timeout},hooks:{init:[...e.init],beforeRequest:[...e.beforeRequest],beforeError:[...e.beforeError],beforeRedirect:[...e.beforeRedirect],beforeRetry:[...e.beforeRetry],afterResponse:[...e.afterResponse]},searchParams:t.searchParams?new Hn(t.searchParams):void 0,pagination:{...t.pagination}};return n.url!==void 0&&(n.prefixUrl=""),n},HS=t=>{let{hooks:e,retry:r}=t,n={...t};return _.object(t.context)&&(n.context={...t.context}),_.object(t.cacheOptions)&&(n.cacheOptions={...t.cacheOptions}),_.object(t.https)&&(n.https={...t.https}),_.object(t.cacheOptions)&&(n.cacheOptions={...n.cacheOptions}),_.object(t.agent)&&(n.agent={...t.agent}),_.object(t.headers)&&(n.headers={...t.headers}),_.object(r)&&(n.retry={...r},_.array(r.errorCodes)&&(n.retry.errorCodes=[...r.errorCodes]),_.array(r.methods)&&(n.retry.methods=[...r.methods]),_.array(r.statusCodes)&&(n.retry.statusCodes=[...r.statusCodes])),_.object(t.timeout)&&(n.timeout={...t.timeout}),_.object(e)&&(n.hooks={...e},_.array(e.init)&&(n.hooks.init=[...e.init]),_.array(e.beforeRequest)&&(n.hooks.beforeRequest=[...e.beforeRequest]),_.array(e.beforeError)&&(n.hooks.beforeError=[...e.beforeError]),_.array(e.beforeRedirect)&&(n.hooks.beforeRedirect=[...e.beforeRedirect]),_.array(e.beforeRetry)&&(n.hooks.beforeRetry=[...e.beforeRetry]),_.array(e.afterResponse)&&(n.hooks.afterResponse=[...e.afterResponse])),_.object(t.pagination)&&(n.pagination={...t.pagination}),n},VS=t=>{let e=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter(r=>typeof r=="number");if(e.length>0)return Math.min(...e)},fp=(t,e,r)=>{let n=t.hooks?.init;if(n)for(let s of n)s(e,r)},Ue=class t{constructor(e,r,n){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),$.any([_.string,_.urlInstance,_.object,_.undefined],e),$.any([_.object,_.undefined],r),$.any([_.object,_.undefined],n),e instanceof t||r instanceof t)throw new TypeError("The defaults must be passed as the third argument");this._internals=US(n?._internals??n??zS),this._init=[...n?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(_.plainObject(e))try{this.merge(e),this.merge(r)}finally{this.url=e.url}else try{this.merge(r)}finally{if(r?.url!==void 0)if(e===void 0)this.url=r.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(s){throw s.options=this,s}}merge(e){if(e){if(e instanceof t){for(let r of e._init)this.merge(r);return}e=HS(e),fp(this,e,this),fp(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let r=!1;for(let n in e)if(!(n==="mutableDefaults"||n==="handlers")&&n!=="url"){if(!(n in this))throw new Error(`Unexpected option: ${n}`);this[n]=e[n],r=!0}r&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){$.any([_.function_,_.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){$.plainObject(e);for(let r in e){if(!(r in this._internals.agent))throw new TypeError(`Unexpected agent option: ${r}`);$.any([_.object,_.undefined],e[r])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){$.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){$.plainObject(e);for(let r in e){if(!(r in this._internals.timeout))throw new Error(`Unexpected timeout option: ${r}`);$.any([_.number,_.undefined],e[r])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if($.any([_.string,_.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:r}=this._internals.url;this._internals.url.href=e+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){$.any([_.string,_.buffer,_.nodeStream,_.generator,_.asyncGenerator,kr,_.undefined],e),_.nodeStream(e)&&$.truthy(e.readable),e!==void 0&&($.undefined(this._internals.form),$.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){$.any([_.plainObject,_.undefined],e),e!==void 0&&($.undefined(this._internals.body),$.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&($.undefined(this._internals.body),$.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if($.any([_.string,_.urlInstance,_.undefined],e),e===void 0){this._internals.url=void 0;return}if(_.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let r=`${this.prefixUrl}${e.toString()}`,n=new dp(r);if(this._internals.url=n,n.protocol==="unix:"&&(n.href=`http://unix${n.pathname}${n.search}`),n.protocol!=="http:"&&n.protocol!=="https:"){let s=new Error(`Unsupported protocol: ${n.protocol}`);throw s.code="ERR_UNSUPPORTED_PROTOCOL",s}if(this._internals.username&&(n.username=this._internals.username,this._internals.username=""),this._internals.password&&(n.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(n.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),n.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let s=/(?<socketPath>.+?):(?<path>.+)/.exec(`${n.pathname}${n.search}`);if(s?.groups){let{socketPath:i,path:o}=s.groups;this._unixOptions={socketPath:i,path:o,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if($.any([_.object,_.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:r,getCookieString:n}=e;$.function_(r),$.function_(n),r.length===4&&n.length===0?(r=up(r.bind(e)),n=up(n.bind(e)),this._internals.cookieJar={setCookie:r,getCookieString:n}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){$.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){$.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new Hn),this._internals.searchParams)}set searchParams(e){$.any([_.string,_.object,_.undefined],e);let r=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,r&&(r.search="");return}let n=this.searchParams,s;if(_.string(e))s=new Hn(e);else if(e instanceof Hn)s=e;else{MS(e),s=new Hn;for(let i in e){let o=e[i];o===null?s.append(i,""):o===void 0?n.delete(i):s.append(i,o)}}if(this._merging){for(let i of s.keys())n.delete(i);for(let[i,o]of s)n.append(i,o)}else r?r.search=n.toString():this._internals.searchParams=n}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){$.any([_.function_,_.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){$.any([_.object,_.boolean,_.undefined],e),e===!0?this._internals.dnsCache=FS():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){$.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){$.object(e);for(let r in e){if(!(r in this._internals.hooks))throw new Error(`Unexpected hook event: ${r}`);let n=r,s=e[n];if($.any([_.array,_.undefined],s),s)for(let i of s)$.function_(i);if(this._merging)s&&this._internals.hooks[n].push(...s);else{if(!s)throw new Error(`Missing hook event: ${r}`);this._internals.hooks[r]=[...s]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){$.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){$.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){$.any([_.object,_.string,_.boolean,_.undefined],e),e===!0?this._internals.cache=LS:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){$.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,r=e?e.username:this._internals.username;return decodeURIComponent(r)}set username(e){$.string(e);let r=this._internals.url,n=encodeURIComponent(e);r?r.username=n:this._internals.username=n}get password(){let e=this._internals.url,r=e?e.password:this._internals.password;return decodeURIComponent(r)}set password(e){$.string(e);let r=this._internals.url,n=encodeURIComponent(e);r?r.password=n:this._internals.password=n}get http2(){return this._internals.http2}set http2(e){$.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){$.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){$.plainObject(e),this._merging?Object.assign(this._internals.headers,Or(e)):this._internals.headers=Or(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){$.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){$.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){$.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if($.plainObject(e),$.any([_.function_,_.undefined],e.calculateDelay),$.any([_.number,_.undefined],e.maxRetryAfter),$.any([_.number,_.undefined],e.limit),$.any([_.array,_.undefined],e.methods),$.any([_.array,_.undefined],e.statusCodes),$.any([_.array,_.undefined],e.errorCodes),$.any([_.number,_.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let n in e)if(!(n in this._internals.retry))throw new Error(`Unexpected retry option: ${n}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:r}=this._internals;r.methods=[...new Set(r.methods.map(n=>n.toUpperCase()))],r.statusCodes=[...new Set(r.statusCodes)],r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){$.any([_.string,_.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){$.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){$.any([_.function_,_.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){$.plainObject(e),$.any([_.boolean,_.undefined],e.shared),$.any([_.number,_.undefined],e.cacheHeuristic),$.any([_.number,_.undefined],e.immutableMinTimeToLive),$.any([_.boolean,_.undefined],e.ignoreCargoCult);for(let r in e)if(!(r in this._internals.cacheOptions))throw new Error(`Cache option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){$.plainObject(e),$.any([_.boolean,_.undefined],e.rejectUnauthorized),$.any([_.function_,_.undefined],e.checkServerIdentity),$.any([_.string,_.object,_.array,_.undefined],e.certificateAuthority),$.any([_.string,_.object,_.array,_.undefined],e.key),$.any([_.string,_.object,_.array,_.undefined],e.certificate),$.any([_.string,_.undefined],e.passphrase),$.any([_.string,_.buffer,_.array,_.undefined],e.pfx),$.any([_.array,_.undefined],e.alpnProtocols),$.any([_.string,_.undefined],e.ciphers),$.any([_.string,_.buffer,_.undefined],e.dhparam),$.any([_.string,_.undefined],e.signatureAlgorithms),$.any([_.string,_.undefined],e.minVersion),$.any([_.string,_.undefined],e.maxVersion),$.any([_.boolean,_.undefined],e.honorCipherOrder),$.any([_.number,_.undefined],e.tlsSessionLifetime),$.any([_.string,_.undefined],e.ecdhCurve),$.any([_.string,_.buffer,_.array,_.undefined],e.certificateRevocationLists);for(let r in e)if(!(r in this._internals.https))throw new Error(`HTTPS option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");$.any([_.string,_.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){$.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){$.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){$.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){$.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){$.any([_.number,_.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){$.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,r){return AS(this._internals,r)}createNativeRequestOptions(){let e=this._internals,r=e.url,n;r.protocol==="https:"?n=e.http2?e.agent:e.agent.https:n=e.agent.http;let{https:s}=e,{pfx:i}=s;return _.array(i)&&_.plainObject(i[0])&&(i=i.map(o=>({buf:o.buffer,passphrase:o.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:s.alpnProtocols,ca:s.certificateAuthority,cert:s.certificate,key:s.key,passphrase:s.passphrase,pfx:s.pfx,rejectUnauthorized:s.rejectUnauthorized,checkServerIdentity:s.checkServerIdentity??jS,ciphers:s.ciphers,honorCipherOrder:s.honorCipherOrder,minVersion:s.minVersion,maxVersion:s.maxVersion,sigalgs:s.signatureAlgorithms,sessionTimeout:s.tlsSessionLifetime,dhparam:s.dhparam,ecdhCurve:s.ecdhCurve,crl:s.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:n,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?VS(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:r}=this._internals;return!r&&e?this.getFallbackRequestFunction():r}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(lp<15||lp===15&&DS<10){let r=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw r.code="EUNSUPPORTED",r}return hp.default.auto}return qS.request}return IS.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}};u();var Ar=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304},ci=class extends Z{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},Ac=(t,e,r,n)=>{let{rawBody:s}=t;try{if(e==="text")return s.toString(n);if(e==="json")return s.length===0?"":r(s.toString(n));if(e==="buffer")return s}catch(i){throw new ci(i,t)}throw new ci({message:`Unknown body type '${e}'`,name:"Error"},t)};u();function BS(t){return t.writable&&!t.writableEnded}var pp=BS;u();function ui(t){return t.protocol==="unix:"||t.hostname==="unix"}var{buffer:YS}=_p.default,QS=_.string(yp.versions.brotli),XS=new Set(["GET","HEAD"]),Ic=new qn,ZS=new Set([300,301,302,303,304,307,308]),e$=["socket","connect","continue","information","upgrade"],li=()=>{},Jt=class t extends GS{constructor(e,r,n){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=li,this._triggerRead=!1,this._cancelTimeouts=li,this._removeListeners=li,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=li,this.on("pipe",i=>{i?.headers&&Object.assign(this.options.headers,i.headers)}),this.on("newListener",i=>{if(i==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new Ue(e,r,n),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(i){let{options:o}=i;o&&(this.options=o),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:s}=this.options;if(_.nodeStream(s)&&s.once("error",i=>{this._flushed?this._beforeError(new $n(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new $n(i,this))}}),this.options.signal){let i=()=>{this.destroy(new Gs(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",i)})}}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:r,options:n}=this,s=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Z||(e=new Z(e.message,e,this));let i=e;(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed&&(r.setEncoding(this.readableEncoding),await this._setRawBody(r)&&(r.body=r.rawBody.toString())),this.listenerCount("retry")!==0){let o;try{let a;r&&"retry-after"in r.headers&&(a=Number(r.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(r.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3);let c=n.retry;o=await c.calculateDelay({attemptCount:s,retryOptions:c,error:i,retryAfter:a,computedValue:eh({attemptCount:s,retryOptions:c,error:i,retryAfter:a,computedValue:c.maxRetryAfter??n.timeout.request??Number.POSITIVE_INFINITY})})}catch(a){this._error(new Z(a.message,a,this));return}if(o){if(await new Promise(a=>{let c=setTimeout(a,o);this._stopRetry=()=>{clearTimeout(c),a()}}),this.destroyed)return;try{for(let a of this.options.hooks.beforeRetry)await a(i,this.retryCount+1)}catch(a){this._error(new Z(a.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,a=>{let c=new t(n.url,a,n);return c.retryCount=this.retryCount+1,yp.nextTick(()=>{c.flush()}),c});return}}this._error(i)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let r;for(;(r=e.read())!==null;){this._downloadedSize+=r.length;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let s=()=>{this._writeRequest(e,r,n)};this._requestInitialized?s():this._jobs.push(s)}_final(e){let r=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(n=>{this._request._writableState?.errored||(n||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(n))})};this._requestInitialized?r():this._jobs.push(r)}_destroy(e,r){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:n}=this.options;_.nodeStream(n)&&n.destroy()}this._request&&this._request.destroy(),e!==null&&!_.undefined(e)&&!(e instanceof Z)&&(e=new Z(e.message,e,this)),r(e)}pipe(e,r){return e instanceof mp&&this._pipedServerResponses.add(e),super.pipe(e,r)}unpipe(e){return e instanceof mp&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!_.undefined(e.form),s=!_.undefined(e.json),i=!_.undefined(e.body),o=XS.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=o,n||s||i){if(o)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let a=!_.string(r["content-type"]);if(i){if(kr(e.body)){let l=new Zs(e.body);a&&(r["content-type"]=l.headers["Content-Type"]),"Content-Length"in l.headers&&(r["content-length"]=l.headers["Content-Length"]),e.body=l.encode()}An(e.body)&&a&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(n){a&&(r["content-type"]="application/x-www-form-urlencoded");let{form:l}=e;e.form=void 0,e.body=new KS(l).toString()}else{a&&(r["content-type"]="application/json");let{json:l}=e;e.json=void 0,e.body=e.stringifyJson(l)}let c=await nc(e.body,e.headers);_.undefined(r["content-length"])&&_.undefined(r["transfer-encoding"])&&!o&&!_.undefined(c)&&(r["content-length"]=String(c))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(r["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:r}=this,{url:n}=r;this._nativeResponse=e,r.decompress&&(e=(0,gp.default)(e));let s=e.statusCode,i=e;i.statusMessage=i.statusMessage??JS.STATUS_CODES[s],i.url=r.url.toString(),i.requestUrl=this.requestUrl,i.redirectUrls=this.redirectUrls,i.request=this,i.isFromCache=this._nativeResponse.fromCache??!1,i.ip=this.ip,i.retryCount=this.retryCount,i.ok=Ar(i),this._isFromCache=i.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=i,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{this._aborted=!0,e.destroy(),this._beforeError(new Pn(a,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Pn({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(_.object(r.cookieJar)&&o){let a=o.map(async c=>r.cookieJar.setCookie(c,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async c=>{try{await c}catch{}}));try{await Promise.all(a)}catch(c){this._beforeError(c);return}}if(!this.isAborted){if(r.followRedirect&&e.headers.location&&ZS.has(s)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=r.maxRedirects){this._beforeError(new Us(this));return}this._request=void 0;let a=new Ue(void 0,void 0,this.options),c=s===303&&a.method!=="GET"&&a.method!=="HEAD",l=s!==307&&s!==308,f=a.methodRewriting&&l;(c||f)&&(a.method="GET",a.body=void 0,a.json=void 0,a.form=void 0,delete a.headers["content-length"]);try{let d=jc.from(e.headers.location,"binary").toString(),p=new WS(d,n);if(!ui(n)&&ui(p)){this._beforeError(new Z("Cannot redirect to UNIX socket",{},this));return}p.hostname!==n.hostname||p.port!==n.port?("host"in a.headers&&delete a.headers.host,"cookie"in a.headers&&delete a.headers.cookie,"authorization"in a.headers&&delete a.headers.authorization,(a.username||a.password)&&(a.username="",a.password="")):(p.username=a.username,p.password=a.password),this.redirectUrls.push(p),a.prefixUrl="",a.url=p;for(let y of a.hooks.beforeRedirect)await y(a,i);this.emit("redirect",a,i),this.options=a,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(r.isStream&&r.throwHttpErrors&&!Ar(i)){this._beforeError(new Pt(i));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let a of this._pipedServerResponses)if(!a.headersSent){for(let c in e.headers){let l=r.decompress?c!=="content-encoding":!0,f=e.headers[c];l&&a.setHeader(c,f)}a.statusCode=s}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let r=await YS(e);if(!this.isAborted)return this.response.rawBody=r,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:s}=r;Nd(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=ic(e,n,s);let i=r.cache?"cacheableResponse":"response";e.once(i,o=>{this._onResponse(o)}),e.once("error",o=>{this._aborted=!0,e.destroy(),o=o instanceof In?new Vs(o,this.timings,this):new Z(o.message,o,this),this._beforeError(o)}),this._unproxyEvents=jn(e,this,e$),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((r,n)=>{super.write(e,s=>{if(s){n(s);return}r()})})}_sendBody(){let{body:e}=this.options,r=this.redirectUrls.length===0?this:this._request??this;_.nodeStream(e)?e.pipe(r):_.generator(e)||_.asyncGenerator(e)?(async()=>{try{for await(let n of e)await this._asyncWrite(n);super.end()}catch(n){this._beforeError(n)}})():_.undefined(e)?(this._cannotHaveBody||this._noPipe)&&r.end():(this._writeRequest(e,void 0,()=>{}),r.end())}_prepareCache(e){if(!Ic.has(e)){let r=new Ud(((n,s)=>{let i=n._request(n,s);return _.promise(i)&&(i.once=(o,a)=>{if(o==="error")(async()=>{try{await i}catch(c){a(c)}})();else if(o==="abort")(async()=>{try{(await i).once("abort",a)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${o}`);return i}),i}),e);Ic.set(e,r.request())}}async _createCacheableRequest(e,r){return new Promise((n,s)=>{Object.assign(r,oc(e));let i,o=Ic.get(r.cache)(r,async a=>{if(a._readableState.autoDestroy=!1,i){let c=()=>{a.req&&(a.complete=a.req.res.complete)};a.prependOnceListener("end",c),c(),(await i).emit("cacheableResponse",a)}n(a)});o.once("error",s),o.once("request",async a=>{i=a,n(i)})})}async _makeRequest(){let{options:e}=this,{headers:r,username:n,password:s}=e,i=e.cookieJar;for(let l in r)if(_.undefined(r[l]))delete r[l];else if(_.null_(r[l]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${l}\` header`);if(e.decompress&&_.undefined(r["accept-encoding"])&&(r["accept-encoding"]=QS?"gzip, deflate, br":"gzip, deflate"),n||s){let l=jc.from(`${n}:${s}`).toString("base64");r.authorization=`Basic ${l}`}if(i){let l=await i.getCookieString(e.url.toString());_.nonEmptyString(l)&&(r.cookie=l)}e.prefixUrl="";let o;for(let l of e.hooks.beforeRequest){let f=await l(e);if(!_.undefined(f)){o=()=>f;break}}o||(o=e.getRequestFunction());let a=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=o,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let c=e.cache?this._createCacheableRequest:o;try{let l=c(a,this._requestOptions);_.promise(l)&&(l=await l),_.undefined(l)&&(l=e.getFallbackRequestFunction()(a,this._requestOptions),_.promise(l)&&(l=await l)),pp(l)?this._onRequest(l):this.writable?(this.once("finish",()=>{this._onResponse(l)}),this._sendBody()):this._onResponse(l)}catch(l){throw l instanceof ut?new Hs(l,this):l}}async _error(e){try{if(!(e instanceof Pt&&!this.options.throwHttpErrors))for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Z(r.message,r,this)}this.destroy(e)}_writeRequest(e,r,n){!this._request||this._request.destroyed||this._request.write(e,r,s=>{if(!s&&!this._request.destroyed){this._uploadedSize+=jc.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}n(s)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}};u();var fi=class extends Z{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};var r$=["request","response","redirect","uploadProgress","downloadProgress"];function di(t){let e,r,n,s=new t$,i=new Pr((a,c,l)=>{l(()=>{e.destroy()}),l.shouldReject=!1,l(()=>{c(new fi(e))});let f=d=>{l(()=>{});let p=t??new Jt(void 0,void 0,n);p.retryCount=d,p._noPipe=!0,e=p,p.once("response",async h=>{let b=(h.headers["content-encoding"]??"").toLowerCase(),w=b==="gzip"||b==="deflate"||b==="br",{options:P}=p;if(w&&!P.decompress)h.body=h.rawBody;else try{h.body=Ac(h,P.responseType,P.parseJson,P.encoding)}catch(E){if(h.body=h.rawBody.toString(),Ar(h)){p._beforeError(E);return}}try{let E=P.hooks.afterResponse;for(let[S,T]of E.entries())if(h=await T(h,async D=>{throw P.merge(D),P.prefixUrl="",D.url&&(P.url=D.url),P.hooks.afterResponse=P.hooks.afterResponse.slice(0,S),new Bs(p)}),!(_.object(h)&&_.number(h.statusCode)&&!_.nullOrUndefined(h.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(E){p._beforeError(E);return}if(r=h,!Ar(h)){p._beforeError(new Pt(h));return}p.destroy(),a(p.options.resolveBodyOnly?h.body:h)});let y=h=>{if(i.isCanceled)return;let{options:b}=p;if(h instanceof Pt&&!b.throwHttpErrors){let{response:w}=h;p.destroy(),a(p.options.resolveBodyOnly?w.body:w);return}c(h)};p.once("error",y);let g=p.options?.body;p.once("retry",(h,b)=>{t=void 0;let w=p.options.body;if(g===w&&_.nodeStream(w)){b.message="Cannot retry with consumed body stream",y(b);return}n=p.options,f(h)}),jn(p,s,r$),_.undefined(t)&&p.flush()};f(0)});i.on=(a,c)=>(s.on(a,c),i),i.off=(a,c)=>(s.off(a,c),i);let o=a=>{let c=(async()=>{await i;let{options:l}=r.request;return Ac(r,a,l.parseJson,l.encoding)})();return Object.defineProperties(c,Object.getOwnPropertyDescriptors(i)),c};return i.json=()=>{if(e.options){let{headers:a}=e.options;!e.writableFinished&&!("accept"in a)&&(a.accept="application/json")}return o("json")},i.buffer=()=>o("buffer"),i.text=()=>o("text"),i}var n$=async t=>new Promise(e=>{setTimeout(e,t)}),s$=t=>_.function_(t),i$=["get","post","put","patch","head","delete"],wp=t=>{t={options:new Ue(void 0,void 0,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults},Object.defineProperty(t,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let e=((n,s,i=t.options)=>{let o=new Jt(n,s,i),a,c=d=>(o.options=d,o._noPipe=!d.isStream,o.flush(),d.isStream?o:(a||(a=di(o)),a)),l=0,f=d=>{let y=(t.handlers[l++]??c)(d,f);if(_.promise(y)&&!o.options.isStream&&(a||(a=di(o)),y!==a)){let g=Object.getOwnPropertyDescriptors(a);for(let h in g)h in y&&delete g[h];Object.defineProperties(y,g),y.cancel=a.cancel}return y};return f(o.options)});e.extend=(...n)=>{let s=new Ue(void 0,void 0,t.options),i=[...t.handlers],o;for(let a of n)s$(a)?(s.merge(a.defaults.options),i.push(...a.defaults.handlers),o=a.defaults.mutableDefaults):(s.merge(a),a.handlers&&i.push(...a.handlers),o=a.mutableDefaults);return wp({options:s,handlers:i,mutableDefaults:!!o})};let r=(async function*(n,s){let i=new Ue(n,s,t.options);i.resolveBodyOnly=!1;let{pagination:o}=i;$.function_(o.transform),$.function_(o.shouldContinue),$.function_(o.filter),$.function_(o.paginate),$.number(o.countLimit),$.number(o.requestLimit),$.number(o.backoff);let a=[],{countLimit:c}=o,l=0;for(;l<o.requestLimit;){l!==0&&await n$(o.backoff);let f=await e(void 0,void 0,i),d=await o.transform(f),p=[];$.array(d);for(let g of d)if(o.filter({item:g,currentItems:p,allItems:a})&&(!o.shouldContinue({item:g,currentItems:p,allItems:a})||(yield g,o.stackAllItems&&a.push(g),p.push(g),--c<=0)))return;let y=o.paginate({response:f,currentItems:p,allItems:a});if(y===!1)return;y===f.request.options?i=f.request.options:(i.merge(y),$.any([_.urlInstance,_.undefined],y.url),y.url!==void 0&&(i.prefixUrl="",i.url=y.url)),l++}});e.paginate=r,e.paginate.all=(async(n,s)=>{let i=[];for await(let o of r(n,s))i.push(o);return i}),e.paginate.each=r,e.stream=((n,s)=>e(n,{...s,isStream:!0}));for(let n of i$)e[n]=((s,i)=>e(s,{...i,method:n})),e.stream[n]=((s,i)=>e(s,{...i,method:n,isStream:!0}));return t.mutableDefaults||(Object.freeze(t.handlers),t.options.freeze()),Object.defineProperty(e,"defaults",{value:t,writable:!1,configurable:!1,enumerable:!0}),e},bp=wp;var o$={options:new Ue,handlers:[],mutableDefaults:!1},a$=bp(o$),vp=a$;u();var Vp=Oe(Hp(),1);function Fc(t){let e=(0,Vp.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var Lm=Oe(Mm(),1),Fm=Oe(ki(),1),zm={keepAlive:!0,maxSockets:50},mP=new hP(zm),yP=new pP(zm),Xc=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Zc=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function eu(t,e){e={version:"latest",...e};let r=t.split("/")[0],n=e.registryUrl||Fc(r),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),i=(0,Lm.default)(n.toString(),{recursive:!0}),o={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete o.accept,i&&(o.authorization=`${i.type} ${i.token}`);let a={headers:o,agent:{http:mP,https:yP}};e.agent&&(a.agent=e.agent);let c;try{c=await vp(s,a).json()}catch(d){throw d?.response?.statusCode===404?new Xc(t):d}if(e.allVersions)return c;let{version:l}=e,f=new Zc(t,l);if(c["dist-tags"][l]){let d=c.time;c=c.versions[c["dist-tags"][l]],c.time=d}else if(l){if(!c.versions[l]){let p=Object.keys(c.versions);if(l=Fm.default.maxSatisfying(p,l),!l)throw f}let d=c.time;if(c=c.versions[l],c.time=d,!c)throw f}return c}async function tu(t,e){let{version:r}=await eu(t.toLowerCase(),e);return r}var Yn=Oe(ki(),1),su="yarn.lock",Um="package-lock.json",iu="pnpm-lock.yaml",ou="bun.lockb",gP="pnpm-workspace.yaml",Qj=[su,iu,Um,ou],Xj={yarn:su,npm:Um,pnpm:iu,bun:ou,homebrew:void 0,unknown:void 0},_P=["yarn","npm","pnpm","bun","homebrew","unknown"],ru=class extends ht{constructor(){super("Unknown package manager")}},$i=class extends ht{constructor(e){super(ve`The directory ${pt.path(e)} doesn't have a package.json.`)}},nu=class extends es{constructor(e){super(ve`Couldn't find a a package.json traversing directories from ${pt.path(e)}`)}};function Hm(t=process.env){return t.npm_config_user_agent?.includes("yarn")?"yarn":t.npm_config_user_agent?.includes("pnpm")?"pnpm":t.npm_config_user_agent?.includes("bun")?"bun":t.npm_config_user_agent?.includes("npm")?"npm":"unknown"}async function wP(t){let e,r;try{e=await mu("npm",["prefix"],{cwd:t}),Ae(ve`Obtaining the dependency manager in directory ${pt.path(e)}...`),r=Ie(e,"package.json")}catch{}if(!e||!r||!await dt(r))return Hm();let n=Ie(e,su),s=Ie(e,iu),i=Ie(e,ou);return await dt(n)?"yarn":await dt(s)?"pnpm":await dt(i)?"bun":"npm"}async function Zj(t){let e=await uu(Ie(t.directory,"**/package.json"),{ignore:[Ie(t.directory,"node_modules/**/package.json")],cwd:t.directory,onlyFiles:!0,deep:t.deep}),r=new fu;try{await Promise.all(e.map(async n=>{let s=Rt(n);await bP({directory:s,packageManager:t.packageManager,stdout:void 0,stderr:void 0,signal:r.signal,args:[]})}))}catch(n){throw r.abort(),n}}async function bP(t){let e={cwd:t.directory,stdin:void 0,stdout:t.stdout,stderr:t.stderr,signal:t.signal},r=["install"];t.args&&(r=r.concat(t.args)),await Zn("cmd_all_timing_network_ms")(async()=>{await xi(t.packageManager,r,e)})}async function eI(t){return(await Qn(t)).name}async function tI(t){return(await Qn(t)).version}async function vP(t){let e=await Qn(t),r=e.dependencies??{},n=e.devDependencies??{};return{...r,...n}}async function rI(t){let e=Ie(t,"package.json"),r=await Qn(e),n=Ie(t,gP);return!!r.workspaces||dt(n)}async function nI(t,e,{cacheExpiryInHours:r=0}={}){let n=async()=>(Ae(ve`Checking if there's a version of ${t} newer than ${e}`),kP(t)),s=`npm-package-${t}`,i;try{i=await Pd(s,n,r*3600*1e3)}catch{return}if(i&&new Yn.SemVer(e).compare(i)<0)return i}function sI(t,e){let r=`npm-package-${t}`,n=Ma(r)?.value;if(n&&new Yn.SemVer(e).compare(n)<0)return n}function iI(t,e){return(0,Yn.satisfies)(t,e)}async function Qn(t){if(!await dt(t))throw new $i(Rt(t));return La(await Pi(t),t)}async function EP(t,e){Ae(ve`Adding the following dependencies if needed:
28
+ `:e);u();var Jv=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function tc(t){if(Jv(t)!=="object")return!1;let e=Object.getPrototypeOf(t);return e==null?!0:(e.constructor&&e.constructor.toString())===Object.toString()}u();function Qd(t,e){if(typeof e=="string"){for(let[r,n]of Object.entries(t))if(e.toLowerCase()===r.toLowerCase())return n}}var Xd=t=>new Proxy(t,{get:(e,r)=>Qd(e,r),has:(e,r)=>Qd(e,r)!==void 0});u();var kr=t=>!!(t&&ze(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&ze(t.append)&&ze(t.getAll)&&ze(t.entries)&&ze(t[Symbol.iterator]));u();var rc=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");u();var Ot=t=>!!(t&&typeof t=="object"&&ze(t.constructor)&&t[Symbol.toStringTag]==="File"&&ze(t.stream)&&t.name!=null);var Tn=function(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kn,Tt,xn,Qs,Rn,Gt,Cn,Nn,Xs,nc,Zd,Yv={enableAdditionalHeaders:!1},Zs={writable:!1,configurable:!1},ei=class{constructor(e,r,n){if(kn.add(this),Tt.set(this,`\r
29
+ `),xn.set(this,void 0),Qs.set(this,void 0),Rn.set(this,"-".repeat(2)),Gt.set(this,new TextEncoder),Cn.set(this,void 0),Nn.set(this,void 0),Xs.set(this,void 0),!kr(e))throw new TypeError("Expected first argument to be a FormData instance.");let s;if(tc(r)?n=r:s=r,s||(s=Yd()),typeof s!="string")throw new TypeError("Expected boundary argument to be a string.");if(n&&!tc(n))throw new TypeError("Expected options argument to be an object.");Tn(this,Nn,Array.from(e.entries()),"f"),Tn(this,Xs,{...Yv,...n},"f"),Tn(this,xn,Q(this,Gt,"f").encode(Q(this,Tt,"f")),"f"),Tn(this,Qs,Q(this,xn,"f").byteLength,"f"),this.boundary=`form-data-boundary-${s}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,Tn(this,Cn,Q(this,Gt,"f").encode(`${Q(this,Rn,"f")}${this.boundary}${Q(this,Rn,"f")}${Q(this,Tt,"f").repeat(2)}`),"f");let i={"Content-Type":this.contentType},o=Q(this,kn,"m",Zd).call(this);o&&(this.contentLength=o,i["Content-Length"]=o),this.headers=Xd(Object.freeze(i)),Object.defineProperties(this,{boundary:Zs,contentType:Zs,contentLength:Zs,headers:Zs})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,r]of Q(this,Nn,"f")){let n=Ot(r)?r:Q(this,Gt,"f").encode(ec(r));yield Q(this,kn,"m",nc).call(this,e,n),yield n,yield Q(this,xn,"f")}yield Q(this,Cn,"f")}async*encode(){for(let e of this.values())Ot(e)?yield*Kd(e.stream()):yield e}[(Tt=new WeakMap,xn=new WeakMap,Qs=new WeakMap,Rn=new WeakMap,Gt=new WeakMap,Cn=new WeakMap,Nn=new WeakMap,Xs=new WeakMap,kn=new WeakSet,nc=function(r,n){let s="";s+=`${Q(this,Rn,"f")}${this.boundary}${Q(this,Tt,"f")}`,s+=`Content-Disposition: form-data; name="${rc(r)}"`,Ot(n)&&(s+=`; filename="${rc(n.name)}"${Q(this,Tt,"f")}`,s+=`Content-Type: ${n.type||"application/octet-stream"}`);let i=Ot(n)?n.size:n.byteLength;return Q(this,Xs,"f").enableAdditionalHeaders===!0&&i!=null&&!isNaN(i)&&(s+=`${Q(this,Tt,"f")}Content-Length: ${Ot(n)?n.size:n.byteLength}`),Q(this,Gt,"f").encode(`${s}${Q(this,Tt,"f").repeat(2)}`)},Zd=function(){let r=0;for(let[n,s]of Q(this,Nn,"f")){let i=Ot(s)?s:Q(this,Gt,"f").encode(ec(s)),o=Ot(i)?i.size:i.byteLength;if(o==null||isNaN(o))return;r+=Q(this,kn,"m",nc).call(this,n,i).byteLength,r+=o,r+=Q(this,Qs,"f")}return String(r+Q(this,Cn,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};u();import{Buffer as Qv}from"node:buffer";import{promisify as Xv}from"node:util";u();function An(t){return _.nodeStream(t)&&_.function_(t.getBoundary)}async function sc(t,e){if(e&&"content-length"in e)return Number(e["content-length"]);if(!t)return 0;if(_.string(t))return Qv.byteLength(t);if(_.buffer(t))return t.length;if(An(t))return Xv(t.getLength.bind(t))()}u();function jn(t,e,r){let n={};for(let s of r){let i=(...o)=>{e.emit(s,...o)};n[s]=i,t.on(s,i)}return()=>{for(let[s,i]of Object.entries(n))t.off(s,i)}}u();import Zv from"node:net";u();function ic(){let t=[];return{once(e,r,n){e.once(r,n),t.push({origin:e,event:r,fn:n})},unhandleAll(){for(let e of t){let{origin:r,event:n,fn:s}=e;r.removeListener(n,s)}t.length=0}}}var eh=Symbol("reentry"),eE=()=>{},In=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function oc(t,e,r){if(eh in t)return eE;t[eh]=!0;let n=[],{once:s,unhandleAll:i}=ic(),o=(h,b,w)=>{let P=setTimeout(b,h,h,w);P.unref?.();let E=()=>{clearTimeout(P)};return n.push(E),E},{host:a,hostname:c}=r,l=(h,b)=>{t.destroy(new In(h,b))},f=()=>{for(let h of n)h();i()};if(t.once("error",h=>{if(f(),t.listenerCount("error")===0)throw h}),typeof e.request<"u"){let h=o(e.request,l,"request");s(t,"response",b=>{s(b,"end",h)})}if(typeof e.socket<"u"){let{socket:h}=e,b=()=>{l(h,"socket")};t.setTimeout(h,b),n.push(()=>{t.removeListener("timeout",b)})}let d=typeof e.lookup<"u",p=typeof e.connect<"u",y=typeof e.secureConnect<"u",g=typeof e.send<"u";return(d||p||y||g)&&s(t,"socket",h=>{let{socketPath:b}=t;if(h.connecting){let w=!!(b??Zv.isIP(c??a??"")!==0);if(d&&!w&&typeof h.address().address>"u"){let P=o(e.lookup,l,"lookup");s(h,"lookup",P)}if(p){let P=()=>o(e.connect,l,"connect");w?s(h,"connect",P()):s(h,"lookup",E=>{E===null&&s(h,"connect",P())})}y&&r.protocol==="https:"&&s(h,"connect",()=>{let P=o(e.secureConnect,l,"secureConnect");s(h,"secureConnect",P)})}if(g){let w=()=>o(e.send,l,"send");h.connecting?s(h,"connect",()=>{s(t,"upload-complete",w())}):s(t,"upload-complete",w())}}),typeof e.response<"u"&&s(t,"upload-complete",()=>{let h=o(e.response,l,"response");s(t,"response",h)}),typeof e.read<"u"&&s(t,"response",h=>{let b=o(e.read,l,"read");s(h,"end",b)}),f}u();function ac(t){t=t;let e={protocol:t.protocol,hostname:_.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return _.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}u();var qn=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};u();var tE=({attemptCount:t,retryOptions:e,error:r,retryAfter:n,computedValue:s})=>{if(r.name==="RetryError")return 1;if(t>e.limit)return 0;let i=e.methods.includes(r.options.method),o=e.errorCodes.includes(r.code),a=r.response&&e.statusCodes.includes(r.response.statusCode);if(!i||!o&&!a)return 0;if(r.response){if(n)return n>s?0:n;if(r.response.statusCode===413)return 0}let c=Math.random()*e.noise;return Math.min(2**(t-1)*1e3,e.backoffLimit)+c},th=tE;u();import jS from"node:process";import{promisify as lp,inspect as IS}from"node:util";import{URL as hp,URLSearchParams as Hn}from"node:url";import{checkServerIdentity as qS}from"node:tls";import DS from"node:http";import MS from"node:https";u();import{V4MAPPED as rE,ADDRCONFIG as nE,ALL as ah,promises as sE,lookup as iE}from"node:dns";import{promisify as cc}from"node:util";import oE from"node:os";var{Resolver:rh}=sE,xr=Symbol("cacheableLookupCreateConnection"),uc=Symbol("cacheableLookupInstance"),nh=Symbol("expires"),aE=typeof ah=="number",sh=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},cE=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},ih=()=>{let t=!1,e=!1;for(let r of Object.values(oE.networkInterfaces()))for(let n of r)if(!n.internal&&(n.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},uE=t=>Symbol.iterator in t,ti=t=>t.catch(e=>{if(e.code==="ENODATA"||e.code==="ENOTFOUND"||e.code==="ENOENT")return[];throw e}),oh={ttl:!0},lE={all:!0},fE={all:!0,family:4},dE={all:!0,family:6},Dn=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:n=3600,errorTtl:s=.15,resolver:i=new rh,lookup:o=iE}={}){if(this.maxTtl=r,this.errorTtl=s,this._cache=e,this._resolver=i,this._dnsLookup=o&&cc(o),this.stats={cache:0,query:0},this._resolver instanceof rh?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=cc(this._resolver.resolve4.bind(this._resolver)),this._resolve6=cc(this._resolver.resolve6.bind(this._resolver))),this._iface=ih(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=n,n>0){let a=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);a.unref&&a.unref(),this._fallbackInterval=a}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,n){if(typeof r=="function"?(n=r,r={}):typeof r=="number"&&(r={family:r}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(s=>{r.all?n(null,s):n(null,s.address,s.family,s.expires,s.ttl,s.source)},n)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let n=await this.query(e);if(r.family===6){let s=n.filter(i=>i.family===6);r.hints&rE&&(aE&&r.hints&ah||s.length===0)?cE(n):n=s}else r.family===4&&(n=n.filter(s=>s.family===4));if(r.hints&nE){let{_iface:s}=this;n=n.filter(i=>i.family===6?s.has6:s.has4)}if(n.length===0){let s=new Error(`cacheableLookup ENOTFOUND ${e}`);throw s.code="ENOTFOUND",s.hostname=e,s}return r.all?n:n[0]}async query(e){let r="cache",n=await this._cache.get(e);if(n&&this.stats.cache++,!n){let s=this._pending[e];if(s)this.stats.cache++,n=await s;else{r="query";let i=this.queryAndCache(e);this._pending[e]=i,this.stats.query++;try{n=await i}finally{delete this._pending[e]}}}return n=n.map(s=>({...s,source:r})),n}async _resolve(e){let[r,n]=await Promise.all([ti(this._resolve4(e,oh)),ti(this._resolve6(e,oh))]),s=0,i=0,o=0,a=Date.now();for(let c of r)c.family=4,c.expires=a+c.ttl*1e3,s=Math.max(s,c.ttl);for(let c of n)c.family=6,c.expires=a+c.ttl*1e3,i=Math.max(i,c.ttl);return r.length>0?n.length>0?o=Math.min(s,i):o=s:o=i,{entries:[...r,...n],cacheTtl:o}}async _lookup(e){try{let[r,n]=await Promise.all([ti(this._dnsLookup(e,fE)),ti(this._dnsLookup(e,dE))]);return{entries:[...r,...n],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,r[nh]=Date.now()+n;try{await this._cache.set(e,r,n)}catch(s){this.lookupAsync=async()=>{let i=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw i.cause=s,i}}uE(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,lE);let r=await this._resolve(e);r.entries.length===0&&this._dnsLookup&&(r=await this._lookup(e),r.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let n=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,n),r.entries}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let n=1/0,s=Date.now();for(let[i,o]of this._cache){let a=o[nh];s>=a?this._cache.delete(i):a<n&&(n=a)}n!==1/0&&this._tick(n-s)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(sh(e),xr in e)throw new Error("CacheableLookup has been already installed");e[xr]=e.createConnection,e[uc]=this,e.createConnection=(r,n)=>("lookup"in r||(r.lookup=this.lookup),e[xr](r,n))}uninstall(e){if(sh(e),e[xr]){if(e[uc]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[xr],delete e[xr],delete e[uc]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=ih(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};var pp=Oe(up(),1);u();function Ac(t){let e=[],r=t.split(",");for(let n of r){let[s,...i]=n.split(";"),o=s.trim();if(o[0]!=="<"||o[o.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${o}`);let a=o.slice(1,-1),c={};if(i.length===0)throw new Error(`Unexpected end of Link header parameters: ${i.join(";")}`);for(let l of i){let f=l.trim(),d=f.indexOf("=");if(d===-1)throw new Error(`Failed to parse Link header: ${t}`);let p=f.slice(0,d).trim(),y=f.slice(d+1).trim();c[p]=y}e.push({reference:a,parameters:c})}return e}var[fp,LS]=jS.versions.node.split(".").map(Number);function FS(t){for(let e in t){let r=t[e];$.any([_.string,_.number,_.boolean,_.null_,_.undefined],r)}}var zS=new Map,ci,US=()=>ci||(ci=new Dn,ci),HS={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(t){return t.request.options.responseType==="json"?t.body:JSON.parse(t.body)},paginate({response:t}){let e=t.headers.link;if(typeof e!="string"||e.trim()==="")return!1;let n=Ac(e).find(s=>s.parameters.rel==="next"||s.parameters.rel==='"next"');return n?{url:new hp(n.reference,t.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},VS=t=>{let{hooks:e,retry:r}=t,n={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...r,errorCodes:[...r.errorCodes],methods:[...r.methods],statusCodes:[...r.statusCodes]},timeout:{...t.timeout},hooks:{init:[...e.init],beforeRequest:[...e.beforeRequest],beforeError:[...e.beforeError],beforeRedirect:[...e.beforeRedirect],beforeRetry:[...e.beforeRetry],afterResponse:[...e.afterResponse]},searchParams:t.searchParams?new Hn(t.searchParams):void 0,pagination:{...t.pagination}};return n.url!==void 0&&(n.prefixUrl=""),n},BS=t=>{let{hooks:e,retry:r}=t,n={...t};return _.object(t.context)&&(n.context={...t.context}),_.object(t.cacheOptions)&&(n.cacheOptions={...t.cacheOptions}),_.object(t.https)&&(n.https={...t.https}),_.object(t.cacheOptions)&&(n.cacheOptions={...n.cacheOptions}),_.object(t.agent)&&(n.agent={...t.agent}),_.object(t.headers)&&(n.headers={...t.headers}),_.object(r)&&(n.retry={...r},_.array(r.errorCodes)&&(n.retry.errorCodes=[...r.errorCodes]),_.array(r.methods)&&(n.retry.methods=[...r.methods]),_.array(r.statusCodes)&&(n.retry.statusCodes=[...r.statusCodes])),_.object(t.timeout)&&(n.timeout={...t.timeout}),_.object(e)&&(n.hooks={...e},_.array(e.init)&&(n.hooks.init=[...e.init]),_.array(e.beforeRequest)&&(n.hooks.beforeRequest=[...e.beforeRequest]),_.array(e.beforeError)&&(n.hooks.beforeError=[...e.beforeError]),_.array(e.beforeRedirect)&&(n.hooks.beforeRedirect=[...e.beforeRedirect]),_.array(e.beforeRetry)&&(n.hooks.beforeRetry=[...e.beforeRetry]),_.array(e.afterResponse)&&(n.hooks.afterResponse=[...e.afterResponse])),_.object(t.pagination)&&(n.pagination={...t.pagination}),n},GS=t=>{let e=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter(r=>typeof r=="number");if(e.length>0)return Math.min(...e)},dp=(t,e,r)=>{let n=t.hooks?.init;if(n)for(let s of n)s(e,r)},Ue=class t{constructor(e,r,n){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),$.any([_.string,_.urlInstance,_.object,_.undefined],e),$.any([_.object,_.undefined],r),$.any([_.object,_.undefined],n),e instanceof t||r instanceof t)throw new TypeError("The defaults must be passed as the third argument");this._internals=VS(n?._internals??n??HS),this._init=[...n?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(_.plainObject(e))try{this.merge(e),this.merge(r)}finally{this.url=e.url}else try{this.merge(r)}finally{if(r?.url!==void 0)if(e===void 0)this.url=r.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(s){throw s.options=this,s}}merge(e){if(e){if(e instanceof t){for(let r of e._init)this.merge(r);return}e=BS(e),dp(this,e,this),dp(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let r=!1;for(let n in e)if(!(n==="mutableDefaults"||n==="handlers")&&n!=="url"){if(!(n in this))throw new Error(`Unexpected option: ${n}`);this[n]=e[n],r=!0}r&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){$.any([_.function_,_.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){$.plainObject(e);for(let r in e){if(!(r in this._internals.agent))throw new TypeError(`Unexpected agent option: ${r}`);$.any([_.object,_.undefined],e[r])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){$.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){$.plainObject(e);for(let r in e){if(!(r in this._internals.timeout))throw new Error(`Unexpected timeout option: ${r}`);$.any([_.number,_.undefined],e[r])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if($.any([_.string,_.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:r}=this._internals.url;this._internals.url.href=e+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){$.any([_.string,_.buffer,_.nodeStream,_.generator,_.asyncGenerator,kr,_.undefined],e),_.nodeStream(e)&&$.truthy(e.readable),e!==void 0&&($.undefined(this._internals.form),$.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){$.any([_.plainObject,_.undefined],e),e!==void 0&&($.undefined(this._internals.body),$.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&($.undefined(this._internals.body),$.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if($.any([_.string,_.urlInstance,_.undefined],e),e===void 0){this._internals.url=void 0;return}if(_.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let r=`${this.prefixUrl}${e.toString()}`,n=new hp(r);if(this._internals.url=n,n.protocol==="unix:"&&(n.href=`http://unix${n.pathname}${n.search}`),n.protocol!=="http:"&&n.protocol!=="https:"){let s=new Error(`Unsupported protocol: ${n.protocol}`);throw s.code="ERR_UNSUPPORTED_PROTOCOL",s}if(this._internals.username&&(n.username=this._internals.username,this._internals.username=""),this._internals.password&&(n.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(n.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),n.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let s=/(?<socketPath>.+?):(?<path>.+)/.exec(`${n.pathname}${n.search}`);if(s?.groups){let{socketPath:i,path:o}=s.groups;this._unixOptions={socketPath:i,path:o,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if($.any([_.object,_.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:r,getCookieString:n}=e;$.function_(r),$.function_(n),r.length===4&&n.length===0?(r=lp(r.bind(e)),n=lp(n.bind(e)),this._internals.cookieJar={setCookie:r,getCookieString:n}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){$.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){$.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new Hn),this._internals.searchParams)}set searchParams(e){$.any([_.string,_.object,_.undefined],e);let r=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,r&&(r.search="");return}let n=this.searchParams,s;if(_.string(e))s=new Hn(e);else if(e instanceof Hn)s=e;else{FS(e),s=new Hn;for(let i in e){let o=e[i];o===null?s.append(i,""):o===void 0?n.delete(i):s.append(i,o)}}if(this._merging){for(let i of s.keys())n.delete(i);for(let[i,o]of s)n.append(i,o)}else r?r.search=n.toString():this._internals.searchParams=n}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){$.any([_.function_,_.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){$.any([_.object,_.boolean,_.undefined],e),e===!0?this._internals.dnsCache=US():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){$.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){$.object(e);for(let r in e){if(!(r in this._internals.hooks))throw new Error(`Unexpected hook event: ${r}`);let n=r,s=e[n];if($.any([_.array,_.undefined],s),s)for(let i of s)$.function_(i);if(this._merging)s&&this._internals.hooks[n].push(...s);else{if(!s)throw new Error(`Missing hook event: ${r}`);this._internals.hooks[r]=[...s]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){$.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){$.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){$.any([_.object,_.string,_.boolean,_.undefined],e),e===!0?this._internals.cache=zS:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){$.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,r=e?e.username:this._internals.username;return decodeURIComponent(r)}set username(e){$.string(e);let r=this._internals.url,n=encodeURIComponent(e);r?r.username=n:this._internals.username=n}get password(){let e=this._internals.url,r=e?e.password:this._internals.password;return decodeURIComponent(r)}set password(e){$.string(e);let r=this._internals.url,n=encodeURIComponent(e);r?r.password=n:this._internals.password=n}get http2(){return this._internals.http2}set http2(e){$.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){$.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){$.plainObject(e),this._merging?Object.assign(this._internals.headers,Or(e)):this._internals.headers=Or(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){$.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){$.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){$.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if($.plainObject(e),$.any([_.function_,_.undefined],e.calculateDelay),$.any([_.number,_.undefined],e.maxRetryAfter),$.any([_.number,_.undefined],e.limit),$.any([_.array,_.undefined],e.methods),$.any([_.array,_.undefined],e.statusCodes),$.any([_.array,_.undefined],e.errorCodes),$.any([_.number,_.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let n in e)if(!(n in this._internals.retry))throw new Error(`Unexpected retry option: ${n}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:r}=this._internals;r.methods=[...new Set(r.methods.map(n=>n.toUpperCase()))],r.statusCodes=[...new Set(r.statusCodes)],r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){$.any([_.string,_.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){$.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){$.any([_.function_,_.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){$.plainObject(e),$.any([_.boolean,_.undefined],e.shared),$.any([_.number,_.undefined],e.cacheHeuristic),$.any([_.number,_.undefined],e.immutableMinTimeToLive),$.any([_.boolean,_.undefined],e.ignoreCargoCult);for(let r in e)if(!(r in this._internals.cacheOptions))throw new Error(`Cache option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){$.plainObject(e),$.any([_.boolean,_.undefined],e.rejectUnauthorized),$.any([_.function_,_.undefined],e.checkServerIdentity),$.any([_.string,_.object,_.array,_.undefined],e.certificateAuthority),$.any([_.string,_.object,_.array,_.undefined],e.key),$.any([_.string,_.object,_.array,_.undefined],e.certificate),$.any([_.string,_.undefined],e.passphrase),$.any([_.string,_.buffer,_.array,_.undefined],e.pfx),$.any([_.array,_.undefined],e.alpnProtocols),$.any([_.string,_.undefined],e.ciphers),$.any([_.string,_.buffer,_.undefined],e.dhparam),$.any([_.string,_.undefined],e.signatureAlgorithms),$.any([_.string,_.undefined],e.minVersion),$.any([_.string,_.undefined],e.maxVersion),$.any([_.boolean,_.undefined],e.honorCipherOrder),$.any([_.number,_.undefined],e.tlsSessionLifetime),$.any([_.string,_.undefined],e.ecdhCurve),$.any([_.string,_.buffer,_.array,_.undefined],e.certificateRevocationLists);for(let r in e)if(!(r in this._internals.https))throw new Error(`HTTPS option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");$.any([_.string,_.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){$.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){$.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){$.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){$.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){$.any([_.number,_.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){$.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,r){return IS(this._internals,r)}createNativeRequestOptions(){let e=this._internals,r=e.url,n;r.protocol==="https:"?n=e.http2?e.agent:e.agent.https:n=e.agent.http;let{https:s}=e,{pfx:i}=s;return _.array(i)&&_.plainObject(i[0])&&(i=i.map(o=>({buf:o.buffer,passphrase:o.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:s.alpnProtocols,ca:s.certificateAuthority,cert:s.certificate,key:s.key,passphrase:s.passphrase,pfx:s.pfx,rejectUnauthorized:s.rejectUnauthorized,checkServerIdentity:s.checkServerIdentity??qS,ciphers:s.ciphers,honorCipherOrder:s.honorCipherOrder,minVersion:s.minVersion,maxVersion:s.maxVersion,sigalgs:s.signatureAlgorithms,sessionTimeout:s.tlsSessionLifetime,dhparam:s.dhparam,ecdhCurve:s.ecdhCurve,crl:s.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:n,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?GS(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:r}=this._internals;return!r&&e?this.getFallbackRequestFunction():r}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(fp<15||fp===15&&LS<10){let r=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw r.code="EUNSUPPORTED",r}return pp.default.auto}return MS.request}return DS.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}};u();var Ar=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304},ui=class extends Z{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},jc=(t,e,r,n)=>{let{rawBody:s}=t;try{if(e==="text")return s.toString(n);if(e==="json")return s.length===0?"":r(s.toString(n));if(e==="buffer")return s}catch(i){throw new ui(i,t)}throw new ui({message:`Unknown body type '${e}'`,name:"Error"},t)};u();function WS(t){return t.writable&&!t.writableEnded}var mp=WS;u();function li(t){return t.protocol==="unix:"||t.hostname==="unix"}var{buffer:XS}=wp.default,ZS=_.string(gp.versions.brotli),e$=new Set(["GET","HEAD"]),qc=new qn,t$=new Set([300,301,302,303,304,307,308]),r$=["socket","connect","continue","information","upgrade"],fi=()=>{},Jt=class t extends KS{constructor(e,r,n){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=fi,this._triggerRead=!1,this._cancelTimeouts=fi,this._removeListeners=fi,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=fi,this.on("pipe",i=>{i?.headers&&Object.assign(this.options.headers,i.headers)}),this.on("newListener",i=>{if(i==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new Ue(e,r,n),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(i){let{options:o}=i;o&&(this.options=o),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:s}=this.options;if(_.nodeStream(s)&&s.once("error",i=>{this._flushed?this._beforeError(new $n(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new $n(i,this))}}),this.options.signal){let i=()=>{this.destroy(new Ws(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",i)})}}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:r,options:n}=this,s=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Z||(e=new Z(e.message,e,this));let i=e;(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed&&(r.setEncoding(this.readableEncoding),await this._setRawBody(r)&&(r.body=r.rawBody.toString())),this.listenerCount("retry")!==0){let o;try{let a;r&&"retry-after"in r.headers&&(a=Number(r.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(r.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3);let c=n.retry;o=await c.calculateDelay({attemptCount:s,retryOptions:c,error:i,retryAfter:a,computedValue:th({attemptCount:s,retryOptions:c,error:i,retryAfter:a,computedValue:c.maxRetryAfter??n.timeout.request??Number.POSITIVE_INFINITY})})}catch(a){this._error(new Z(a.message,a,this));return}if(o){if(await new Promise(a=>{let c=setTimeout(a,o);this._stopRetry=()=>{clearTimeout(c),a()}}),this.destroyed)return;try{for(let a of this.options.hooks.beforeRetry)await a(i,this.retryCount+1)}catch(a){this._error(new Z(a.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,a=>{let c=new t(n.url,a,n);return c.retryCount=this.retryCount+1,gp.nextTick(()=>{c.flush()}),c});return}}this._error(i)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let r;for(;(r=e.read())!==null;){this._downloadedSize+=r.length;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let s=()=>{this._writeRequest(e,r,n)};this._requestInitialized?s():this._jobs.push(s)}_final(e){let r=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(n=>{this._request._writableState?.errored||(n||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(n))})};this._requestInitialized?r():this._jobs.push(r)}_destroy(e,r){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:n}=this.options;_.nodeStream(n)&&n.destroy()}this._request&&this._request.destroy(),e!==null&&!_.undefined(e)&&!(e instanceof Z)&&(e=new Z(e.message,e,this)),r(e)}pipe(e,r){return e instanceof yp&&this._pipedServerResponses.add(e),super.pipe(e,r)}unpipe(e){return e instanceof yp&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!_.undefined(e.form),s=!_.undefined(e.json),i=!_.undefined(e.body),o=e$.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=o,n||s||i){if(o)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let a=!_.string(r["content-type"]);if(i){if(kr(e.body)){let l=new ei(e.body);a&&(r["content-type"]=l.headers["Content-Type"]),"Content-Length"in l.headers&&(r["content-length"]=l.headers["Content-Length"]),e.body=l.encode()}An(e.body)&&a&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(n){a&&(r["content-type"]="application/x-www-form-urlencoded");let{form:l}=e;e.form=void 0,e.body=new YS(l).toString()}else{a&&(r["content-type"]="application/json");let{json:l}=e;e.json=void 0,e.body=e.stringifyJson(l)}let c=await sc(e.body,e.headers);_.undefined(r["content-length"])&&_.undefined(r["transfer-encoding"])&&!o&&!_.undefined(c)&&(r["content-length"]=String(c))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(r["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:r}=this,{url:n}=r;this._nativeResponse=e,r.decompress&&(e=(0,_p.default)(e));let s=e.statusCode,i=e;i.statusMessage=i.statusMessage??QS.STATUS_CODES[s],i.url=r.url.toString(),i.requestUrl=this.requestUrl,i.redirectUrls=this.redirectUrls,i.request=this,i.isFromCache=this._nativeResponse.fromCache??!1,i.ip=this.ip,i.retryCount=this.retryCount,i.ok=Ar(i),this._isFromCache=i.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=i,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{this._aborted=!0,e.destroy(),this._beforeError(new Pn(a,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Pn({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(_.object(r.cookieJar)&&o){let a=o.map(async c=>r.cookieJar.setCookie(c,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async c=>{try{await c}catch{}}));try{await Promise.all(a)}catch(c){this._beforeError(c);return}}if(!this.isAborted){if(r.followRedirect&&e.headers.location&&t$.has(s)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=r.maxRedirects){this._beforeError(new Hs(this));return}this._request=void 0;let a=new Ue(void 0,void 0,this.options),c=s===303&&a.method!=="GET"&&a.method!=="HEAD",l=s!==307&&s!==308,f=a.methodRewriting&&l;(c||f)&&(a.method="GET",a.body=void 0,a.json=void 0,a.form=void 0,delete a.headers["content-length"]);try{let d=Ic.from(e.headers.location,"binary").toString(),p=new JS(d,n);if(!li(n)&&li(p)){this._beforeError(new Z("Cannot redirect to UNIX socket",{},this));return}p.hostname!==n.hostname||p.port!==n.port?("host"in a.headers&&delete a.headers.host,"cookie"in a.headers&&delete a.headers.cookie,"authorization"in a.headers&&delete a.headers.authorization,(a.username||a.password)&&(a.username="",a.password="")):(p.username=a.username,p.password=a.password),this.redirectUrls.push(p),a.prefixUrl="",a.url=p;for(let y of a.hooks.beforeRedirect)await y(a,i);this.emit("redirect",a,i),this.options=a,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(r.isStream&&r.throwHttpErrors&&!Ar(i)){this._beforeError(new Pt(i));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let a of this._pipedServerResponses)if(!a.headersSent){for(let c in e.headers){let l=r.decompress?c!=="content-encoding":!0,f=e.headers[c];l&&a.setHeader(c,f)}a.statusCode=s}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let r=await XS(e);if(!this.isAborted)return this.response.rawBody=r,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:s}=r;Ad(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=oc(e,n,s);let i=r.cache?"cacheableResponse":"response";e.once(i,o=>{this._onResponse(o)}),e.once("error",o=>{this._aborted=!0,e.destroy(),o=o instanceof In?new Bs(o,this.timings,this):new Z(o.message,o,this),this._beforeError(o)}),this._unproxyEvents=jn(e,this,r$),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((r,n)=>{super.write(e,s=>{if(s){n(s);return}r()})})}_sendBody(){let{body:e}=this.options,r=this.redirectUrls.length===0?this:this._request??this;_.nodeStream(e)?e.pipe(r):_.generator(e)||_.asyncGenerator(e)?(async()=>{try{for await(let n of e)await this._asyncWrite(n);super.end()}catch(n){this._beforeError(n)}})():_.undefined(e)?(this._cannotHaveBody||this._noPipe)&&r.end():(this._writeRequest(e,void 0,()=>{}),r.end())}_prepareCache(e){if(!qc.has(e)){let r=new Hd(((n,s)=>{let i=n._request(n,s);return _.promise(i)&&(i.once=(o,a)=>{if(o==="error")(async()=>{try{await i}catch(c){a(c)}})();else if(o==="abort")(async()=>{try{(await i).once("abort",a)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${o}`);return i}),i}),e);qc.set(e,r.request())}}async _createCacheableRequest(e,r){return new Promise((n,s)=>{Object.assign(r,ac(e));let i,o=qc.get(r.cache)(r,async a=>{if(a._readableState.autoDestroy=!1,i){let c=()=>{a.req&&(a.complete=a.req.res.complete)};a.prependOnceListener("end",c),c(),(await i).emit("cacheableResponse",a)}n(a)});o.once("error",s),o.once("request",async a=>{i=a,n(i)})})}async _makeRequest(){let{options:e}=this,{headers:r,username:n,password:s}=e,i=e.cookieJar;for(let l in r)if(_.undefined(r[l]))delete r[l];else if(_.null_(r[l]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${l}\` header`);if(e.decompress&&_.undefined(r["accept-encoding"])&&(r["accept-encoding"]=ZS?"gzip, deflate, br":"gzip, deflate"),n||s){let l=Ic.from(`${n}:${s}`).toString("base64");r.authorization=`Basic ${l}`}if(i){let l=await i.getCookieString(e.url.toString());_.nonEmptyString(l)&&(r.cookie=l)}e.prefixUrl="";let o;for(let l of e.hooks.beforeRequest){let f=await l(e);if(!_.undefined(f)){o=()=>f;break}}o||(o=e.getRequestFunction());let a=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=o,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let c=e.cache?this._createCacheableRequest:o;try{let l=c(a,this._requestOptions);_.promise(l)&&(l=await l),_.undefined(l)&&(l=e.getFallbackRequestFunction()(a,this._requestOptions),_.promise(l)&&(l=await l)),mp(l)?this._onRequest(l):this.writable?(this.once("finish",()=>{this._onResponse(l)}),this._sendBody()):this._onResponse(l)}catch(l){throw l instanceof ut?new Vs(l,this):l}}async _error(e){try{if(!(e instanceof Pt&&!this.options.throwHttpErrors))for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Z(r.message,r,this)}this.destroy(e)}_writeRequest(e,r,n){!this._request||this._request.destroyed||this._request.write(e,r,s=>{if(!s&&!this._request.destroyed){this._uploadedSize+=Ic.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}n(s)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}};u();var di=class extends Z{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};var s$=["request","response","redirect","uploadProgress","downloadProgress"];function hi(t){let e,r,n,s=new n$,i=new Pr((a,c,l)=>{l(()=>{e.destroy()}),l.shouldReject=!1,l(()=>{c(new di(e))});let f=d=>{l(()=>{});let p=t??new Jt(void 0,void 0,n);p.retryCount=d,p._noPipe=!0,e=p,p.once("response",async h=>{let b=(h.headers["content-encoding"]??"").toLowerCase(),w=b==="gzip"||b==="deflate"||b==="br",{options:P}=p;if(w&&!P.decompress)h.body=h.rawBody;else try{h.body=jc(h,P.responseType,P.parseJson,P.encoding)}catch(E){if(h.body=h.rawBody.toString(),Ar(h)){p._beforeError(E);return}}try{let E=P.hooks.afterResponse;for(let[S,T]of E.entries())if(h=await T(h,async D=>{throw P.merge(D),P.prefixUrl="",D.url&&(P.url=D.url),P.hooks.afterResponse=P.hooks.afterResponse.slice(0,S),new Gs(p)}),!(_.object(h)&&_.number(h.statusCode)&&!_.nullOrUndefined(h.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(E){p._beforeError(E);return}if(r=h,!Ar(h)){p._beforeError(new Pt(h));return}p.destroy(),a(p.options.resolveBodyOnly?h.body:h)});let y=h=>{if(i.isCanceled)return;let{options:b}=p;if(h instanceof Pt&&!b.throwHttpErrors){let{response:w}=h;p.destroy(),a(p.options.resolveBodyOnly?w.body:w);return}c(h)};p.once("error",y);let g=p.options?.body;p.once("retry",(h,b)=>{t=void 0;let w=p.options.body;if(g===w&&_.nodeStream(w)){b.message="Cannot retry with consumed body stream",y(b);return}n=p.options,f(h)}),jn(p,s,s$),_.undefined(t)&&p.flush()};f(0)});i.on=(a,c)=>(s.on(a,c),i),i.off=(a,c)=>(s.off(a,c),i);let o=a=>{let c=(async()=>{await i;let{options:l}=r.request;return jc(r,a,l.parseJson,l.encoding)})();return Object.defineProperties(c,Object.getOwnPropertyDescriptors(i)),c};return i.json=()=>{if(e.options){let{headers:a}=e.options;!e.writableFinished&&!("accept"in a)&&(a.accept="application/json")}return o("json")},i.buffer=()=>o("buffer"),i.text=()=>o("text"),i}var i$=async t=>new Promise(e=>{setTimeout(e,t)}),o$=t=>_.function_(t),a$=["get","post","put","patch","head","delete"],bp=t=>{t={options:new Ue(void 0,void 0,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults},Object.defineProperty(t,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let e=((n,s,i=t.options)=>{let o=new Jt(n,s,i),a,c=d=>(o.options=d,o._noPipe=!d.isStream,o.flush(),d.isStream?o:(a||(a=hi(o)),a)),l=0,f=d=>{let y=(t.handlers[l++]??c)(d,f);if(_.promise(y)&&!o.options.isStream&&(a||(a=hi(o)),y!==a)){let g=Object.getOwnPropertyDescriptors(a);for(let h in g)h in y&&delete g[h];Object.defineProperties(y,g),y.cancel=a.cancel}return y};return f(o.options)});e.extend=(...n)=>{let s=new Ue(void 0,void 0,t.options),i=[...t.handlers],o;for(let a of n)o$(a)?(s.merge(a.defaults.options),i.push(...a.defaults.handlers),o=a.defaults.mutableDefaults):(s.merge(a),a.handlers&&i.push(...a.handlers),o=a.mutableDefaults);return bp({options:s,handlers:i,mutableDefaults:!!o})};let r=(async function*(n,s){let i=new Ue(n,s,t.options);i.resolveBodyOnly=!1;let{pagination:o}=i;$.function_(o.transform),$.function_(o.shouldContinue),$.function_(o.filter),$.function_(o.paginate),$.number(o.countLimit),$.number(o.requestLimit),$.number(o.backoff);let a=[],{countLimit:c}=o,l=0;for(;l<o.requestLimit;){l!==0&&await i$(o.backoff);let f=await e(void 0,void 0,i),d=await o.transform(f),p=[];$.array(d);for(let g of d)if(o.filter({item:g,currentItems:p,allItems:a})&&(!o.shouldContinue({item:g,currentItems:p,allItems:a})||(yield g,o.stackAllItems&&a.push(g),p.push(g),--c<=0)))return;let y=o.paginate({response:f,currentItems:p,allItems:a});if(y===!1)return;y===f.request.options?i=f.request.options:(i.merge(y),$.any([_.urlInstance,_.undefined],y.url),y.url!==void 0&&(i.prefixUrl="",i.url=y.url)),l++}});e.paginate=r,e.paginate.all=(async(n,s)=>{let i=[];for await(let o of r(n,s))i.push(o);return i}),e.paginate.each=r,e.stream=((n,s)=>e(n,{...s,isStream:!0}));for(let n of a$)e[n]=((s,i)=>e(s,{...i,method:n})),e.stream[n]=((s,i)=>e(s,{...i,method:n,isStream:!0}));return t.mutableDefaults||(Object.freeze(t.handlers),t.options.freeze()),Object.defineProperty(e,"defaults",{value:t,writable:!1,configurable:!1,enumerable:!0}),e},vp=bp;var c$={options:new Ue,handlers:[],mutableDefaults:!1},u$=vp(c$),Ep=u$;u();var Bp=Oe(Vp(),1);function zc(t){let e=(0,Bp.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var Fm=Oe(Lm(),1),zm=Oe(xi(),1),Um={keepAlive:!0,maxSockets:50},gP=new mP(Um),_P=new yP(Um),Zc=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},eu=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function tu(t,e){e={version:"latest",...e};let r=t.split("/")[0],n=e.registryUrl||zc(r),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),i=(0,Fm.default)(n.toString(),{recursive:!0}),o={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete o.accept,i&&(o.authorization=`${i.type} ${i.token}`);let a={headers:o,agent:{http:gP,https:_P}};e.agent&&(a.agent=e.agent);let c;try{c=await Ep(s,a).json()}catch(d){throw d?.response?.statusCode===404?new Zc(t):d}if(e.allVersions)return c;let{version:l}=e,f=new eu(t,l);if(c["dist-tags"][l]){let d=c.time;c=c.versions[c["dist-tags"][l]],c.time=d}else if(l){if(!c.versions[l]){let p=Object.keys(c.versions);if(l=zm.default.maxSatisfying(p,l),!l)throw f}let d=c.time;if(c=c.versions[l],c.time=d,!c)throw f}return c}async function ru(t,e){let{version:r}=await tu(t.toLowerCase(),e);return r}var Yn=Oe(xi(),1),iu="yarn.lock",ou="package-lock.json",au="pnpm-lock.yaml",cu="bun.lockb",wP="bun.lock",Hm="pnpm-workspace.yaml",tI=[iu,au,ou,cu],rI={yarn:iu,npm:ou,pnpm:au,bun:cu,homebrew:void 0,unknown:void 0},bP=["yarn","npm","pnpm","bun","homebrew","unknown"],nu=class extends ht{constructor(){super("Unknown package manager")}},Pi=class extends ht{constructor(e){super(ve`The directory ${pt.path(e)} doesn't have a package.json.`)}},su=class extends ts{constructor(e){super(ve`Couldn't find a a package.json traversing directories from ${pt.path(e)}`)}};function Vm(t=process.env){return t.npm_config_user_agent?.includes("yarn")?"yarn":t.npm_config_user_agent?.includes("pnpm")?"pnpm":t.npm_config_user_agent?.includes("bun")?"bun":t.npm_config_user_agent?.includes("npm")?"npm":"unknown"}function vP(t){return Rt(Te(t,cu))||Rt(Te(t,wP))}function EP(t){switch(t){case"yarn":case"npm":case"pnpm":case"bun":return t;case"homebrew":case"unknown":return"npm"}}function SP(t,e,...r){switch(t){case"npm":return{command:"npm",args:["exec","--",e,...r]};case"pnpm":return{command:"pnpm",args:["exec",e,...r]};case"yarn":return{command:"yarn",args:["run",e,...r]};case"bun":return{command:"bun",args:["x",e,...r]}}}async function Bm(t){let e=t;for(je(ve`Looking for a lockfile in ${pt.path(e)}...`);;){if(Rt(Te(e,iu)))return"yarn";if(Rt(Te(e,au))||Rt(Te(e,Hm)))return"pnpm";if(vP(e))return"bun";if(Rt(Te(e,ou)))return"npm";let n=dt(e);if(n===e)break;e=n}let r=Vm();return r!=="unknown"?r:"npm"}async function nI(t,e,...r){let n=EP(await Bm(t));return SP(n,e,...r)}async function sI(t){let e=await fu(Te(t.directory,"**/package.json"),{ignore:[Te(t.directory,"node_modules/**/package.json")],cwd:t.directory,onlyFiles:!0,deep:t.deep}),r=new hu;try{await Promise.all(e.map(async n=>{let s=dt(n);await $P({directory:s,packageManager:t.packageManager,stdout:void 0,stderr:void 0,signal:r.signal,args:[]})}))}catch(n){throw r.abort(),n}}async function $P(t){let e={cwd:t.directory,stdin:void 0,stdout:t.stdout,stderr:t.stderr,signal:t.signal},r=["install"];t.args&&(r=r.concat(t.args)),await es("cmd_all_timing_network_ms")(async()=>{await Ri(t.packageManager,r,e)})}async function iI(t){return(await Qn(t)).name}async function oI(t){return(await Qn(t)).version}async function PP(t){let e=await Qn(t),r=e.dependencies??{},n=e.devDependencies??{};return{...r,...n}}async function aI(t){let e=Te(t,"package.json"),r=await Qn(e),n=Te(t,Hm);return!!r.workspaces||Zn(n)}async function cI(t,e,{cacheExpiryInHours:r=0}={}){let n=async()=>(je(ve`Checking if there's a version of ${t} newer than ${e}`),NP(t)),s=`npm-package-${t}`,i;try{i=await Od(s,n,r*3600*1e3)}catch{return}if(i&&new Yn.SemVer(e).compare(i)<0)return i}function uI(t,e){let r=`npm-package-${t}`,n=La(r)?.value;if(n&&new Yn.SemVer(e).compare(n)<0)return n}function lI(t,e){return(0,Yn.satisfies)(t,e)}async function Qn(t){if(!await Zn(t))throw new Pi(dt(t));return Fa(await Oi(t),t)}async function OP(t,e){je(ve`Adding the following dependencies if needed:
30
30
  ${pt.json(t)}
31
31
  With options:
32
32
  ${pt.json(e)}
33
- `);let r=Ie(e.directory,"package.json");if(!await dt(r))throw new $i(e.directory);let n=Object.keys(await vP(r)),s=t.filter(i=>!n.includes(i.name));s.length!==0&&await SP(s,e)}async function SP(t,e){let r=t.map(n=>n.version?`${n.name}@${n.version}`:n.name);switch(e.stdout?.write(`Installing ${[r].join(" ")} with ${e.packageManager}`),e.packageManager){case"npm":for(let n of r)await Jn(e,$P(n,e.type));break;case"yarn":await Jn(e,PP(r,e.type,!!e.addToRootDirectory));break;case"pnpm":await Jn(e,OP(r,e.type,!!e.addToRootDirectory));break;case"bun":await Jn(e,TP(r,e.type)),await Jn(e,["install"]);break;case"homebrew":throw new ht("Homebrew can't be used to install project dependencies. Use npm, yarn, pnpm, or bun.");case"unknown":throw new ru}}async function Jn(t,e){return Zn("cmd_all_timing_network_ms")(async()=>xi(t.packageManager,e,{cwd:t.directory,stdout:t.stdout,stderr:t.stderr,signal:t.signal}))}async function oI(t,e){await EP(t.map(r=>({name:r,version:void 0})),e)}function $P(t,e){let r=["install"];switch(r=r.concat(t),e){case"dev":r.push("--save-dev");break;case"peer":r.push("--save-peer");break;case"prod":r.push("--save-prod");break}return t.match(/@\d/g)&&r.push("--save-exact"),r}function PP(t,e,r=!1){let n=["add"];switch(r&&n.push("-W"),n=n.concat(t),e){case"dev":n.push("--dev");break;case"peer":n.push("--peer");break;case"prod":n.push("--prod");break}return n}function OP(t,e,r=!1){let n=["add"];switch(r&&n.push("-w"),n=n.concat(t),e){case"dev":n.push("--save-dev");break;case"peer":n.push("--save-peer");break;case"prod":n.push("--save-prod");break}return n}function TP(t,e){let r=["add"];switch(r=r.concat(t),e){case"dev":r.push("--development");break;case"peer":r.push("--optional");break;case"prod":break}return r}async function aI(t){let e=await lu("package.json",{cwd:t,type:"file"});if(e){let r=La(await Pi(e),e);return{path:e,content:r}}else throw new nu(t)}async function cI(t,e){let r=await wP(t),n=Ie(t,"package.json"),s=await Qn(n);r==="yarn"&&(s.resolutions=s.resolutions?{...s.resolutions,...e}:e),(r==="npm"||r==="pnpm"||r==="bun")&&(s.overrides=s.overrides?{...s.overrides,...e}:e),await Oi(n,JSON.stringify(s,null,2))}async function kP(t){return Ae(ve`Getting the latest version of NPM package: ${pt.raw(t)}`),Zn("cmd_all_timing_network_ms")(()=>tu(t))}async function uI(t,e){Ae(ve`JSON-encoding and writing content to package.json at ${pt.path(t)}...`);let r=Ie(t,"package.json");await Oi(r,JSON.stringify(e,null,2))}function lI(t,e=process.env){if(t&&_P.includes(t))return t;let r=Hm(e);if(r!=="unknown")return r;let n=hu();return n!=="unknown"?n:"npm"}export{Fr as a,Vm as b,Ri as c,Oa as d,zs as e,rR as f,nR as g,sR as h,iR as i,oR as j,aR as k,Pd as l,ev as m,Ma as n,cR as o,Od as p,uR as q,lR as r,fR as s,dR as t,su as u,Um as v,iu as w,ou as x,gP as y,Qj as z,Xj as A,_P as B,ru as C,$i as D,nu as E,Hm as F,wP as G,Zj as H,bP as I,eI as J,tI as K,vP as L,rI as M,nI as N,sI as O,iI as P,Qn as Q,EP as R,SP as S,oI as T,aI as U,cI as V,uI as W,lI as X};
33
+ `);let r=Te(e.directory,"package.json");if(!await Zn(r))throw new Pi(e.directory);let n=Object.keys(await PP(r)),s=t.filter(i=>!n.includes(i.name));s.length!==0&&await TP(s,e)}async function TP(t,e){let r=t.map(n=>n.version?`${n.name}@${n.version}`:n.name);switch(e.stdout?.write(`Installing ${[r].join(" ")} with ${e.packageManager}`),e.packageManager){case"npm":for(let n of r)await Jn(e,kP(n,e.type));break;case"yarn":await Jn(e,xP(r,e.type,!!e.addToRootDirectory));break;case"pnpm":await Jn(e,RP(r,e.type,!!e.addToRootDirectory));break;case"bun":await Jn(e,CP(r,e.type)),await Jn(e,["install"]);break;case"homebrew":throw new ht("Homebrew can't be used to install project dependencies. Use npm, yarn, pnpm, or bun.");case"unknown":throw new nu}}async function Jn(t,e){return es("cmd_all_timing_network_ms")(async()=>Ri(t.packageManager,e,{cwd:t.directory,stdout:t.stdout,stderr:t.stderr,signal:t.signal}))}async function fI(t,e){await OP(t.map(r=>({name:r,version:void 0})),e)}function kP(t,e){let r=["install"];switch(r=r.concat(t),e){case"dev":r.push("--save-dev");break;case"peer":r.push("--save-peer");break;case"prod":r.push("--save-prod");break}return t.match(/@\d/g)&&r.push("--save-exact"),r}function xP(t,e,r=!1){let n=["add"];switch(r&&n.push("-W"),n=n.concat(t),e){case"dev":n.push("--dev");break;case"peer":n.push("--peer");break;case"prod":n.push("--prod");break}return n}function RP(t,e,r=!1){let n=["add"];switch(r&&n.push("-w"),n=n.concat(t),e){case"dev":n.push("--save-dev");break;case"peer":n.push("--save-peer");break;case"prod":n.push("--save-prod");break}return n}function CP(t,e){let r=["add"];switch(r=r.concat(t),e){case"dev":r.push("--development");break;case"peer":r.push("--optional");break;case"prod":break}return r}async function dI(t){let e=await du("package.json",{cwd:t,type:"file"});if(e){let r=Fa(await Oi(e),e);return{path:e,content:r}}else throw new su(t)}async function hI(t,e){let r=await Bm(t),n=Te(t,"package.json"),s=await Qn(n);r==="yarn"&&(s.resolutions=s.resolutions?{...s.resolutions,...e}:e),(r==="npm"||r==="pnpm"||r==="bun")&&(s.overrides=s.overrides?{...s.overrides,...e}:e),await Ti(n,JSON.stringify(s,null,2))}async function NP(t){return je(ve`Getting the latest version of NPM package: ${pt.raw(t)}`),es("cmd_all_timing_network_ms")(()=>ru(t))}async function pI(t,e){je(ve`JSON-encoding and writing content to package.json at ${pt.path(t)}...`);let r=Te(t,"package.json");await Ti(r,JSON.stringify(e,null,2))}function mI(t,e=process.env){if(t&&bP.includes(t))return t;let r=Vm(e);if(r!=="unknown")return r;let n=mu();return n!=="unknown"?n:"npm"}export{Fr as a,Gm as b,Ci as c,Ta as d,Us as e,oR as f,aR as g,cR as h,uR as i,lR as j,fR as k,Od as l,rv as m,La as n,dR as o,Td as p,hR as q,pR as r,mR as s,yR as t,iu as u,ou as v,au as w,cu as x,Hm as y,tI as z,rI as A,bP as B,nu as C,Pi as D,su as E,Vm as F,Bm as G,nI as H,sI as I,$P as J,iI as K,oI as L,PP as M,aI as N,cI as O,uI as P,lI as Q,Qn as R,OP as S,TP as T,fI as U,dI as V,hI as W,pI as X,mI as Y};
34
34
  /*! Bundled license information:
35
35
 
36
36
  deep-extend/lib/deep-extend.js: