shopify 3.94.0 → 3.94.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DBDY2YEY.js → chunk-2E6Y4J4T.js} +1 -1
- package/dist/{chunk-DEW5QFGH.js → chunk-KVWHPGOA.js} +114 -114
- package/dist/{chunk-AQOYGO3U.js → chunk-LH4VO6EV.js} +1 -1
- package/dist/{chunk-7JFIBCHH.js → chunk-PRNHS74J.js} +3 -3
- package/dist/{chunk-R6N4NGU6.js → chunk-RXF32AET.js} +2 -2
- package/dist/{chunk-7F3HZJH4.js → chunk-YPE4BWWD.js} +2 -2
- package/dist/{error-handler-JHFQZGYG.js → error-handler-CRWXGODM.js} +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/index.js +6 -6
- package/dist/{local-4PW2CHVR.js → local-7MUCLBBI.js} +1 -1
- package/dist/{node-package-manager-NTQEYCSE.js → node-package-manager-GFIGZZ24.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-7Z2HOOEO.js → ui-AOFJCTTO.js} +1 -1
- package/dist/{workerd-VL54JTEU.js → workerd-VBG5LYNX.js} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
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?`
|
|
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-KVWHPGOA.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
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"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as wh,c as Zu,d as A3}from"./chunk-PRKBO42R.js";import{F as L3,G as D1,a as Qr,b as Qt,c as b3,f as S3,g as x3,h as O3,i as x1,j as D3,k as N3,l as C3,p as R3,r as O1,s as P3}from"./chunk-
|
|
1
|
+
import{a as wh,c as Zu,d as A3}from"./chunk-PRKBO42R.js";import{F as L3,G as D1,a as Qr,b as Qt,c as b3,f as S3,g as x3,h as O3,i as x1,j as D3,k as N3,l as C3,p as R3,r as O1,s as P3}from"./chunk-LH4VO6EV.js";import{A as xH,B as OH,Bb as N1,Bd as Wi,C as f3,Cb as ec,D as DH,Db as C1,Dd as i6,E as NH,Eb as M3,Ed as Z,F as m3,Fb as R1,Fc as B3,G as CH,Gc as U3,Hc as k3,Hd as o6,I as h3,Ic as j3,J as RH,Jc as tt,K as v3,Kc as V3,L as Ih,Lc as Lt,M as y3,Mc as q3,N as E3,Nc as G3,O as PH,Oc as $3,P as _3,Pc as K3,Q as IH,Qc as tc,R as wH,Rc as H3,S as LH,T as FH,U as MH,V as g3,Vc as P1,W as T3,Yc as z3,Zc as Y3,a as b1,c as Ti,d as c3,dd as Q3,e as l3,ed as W3,f as p3,fd as Lh,g as S1,gd as J3,hd as X3,i as hH,ib as BH,id as ts,l as d3,nb as I3,nd as Z3,o as vH,od as Fh,p as yH,pd as I1,q as EH,qb as w3,r as _H,rd as e6,s as gH,sd as t6,t as TH,ud as r6,v as AH,w as bH,wd as Ke,x as SH,xd as n6,yb as F3,yd as me,zb as kH}from"./chunk-KVWHPGOA.js";import{t as UH}from"./chunk-SVA22NZQ.js";import{c as Rh,d as Ph,f as a3,g as s3,p as es,r as u3}from"./chunk-JBSYWYIP.js";import{a as oe,b as V,c as h,d as Xu,e as et,f as ue,g as l}from"./chunk-VPRTJUIN.js";var v6=h(ns=>{"use strict";l();Object.defineProperty(ns,"__esModule",{value:!0});ns.versionInfo=ns.version=void 0;var KH="16.10.0";ns.version=KH;var HH=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});ns.versionInfo=HH});var pr=h(kh=>{"use strict";l();Object.defineProperty(kh,"__esModule",{value:!0});kh.devAssert=zH;function zH(t,e){if(!!!t)throw new Error(e)}});var U1=h(jh=>{"use strict";l();Object.defineProperty(jh,"__esModule",{value:!0});jh.isPromise=YH;function YH(t){return typeof t?.then=="function"}});var $n=h(Vh=>{"use strict";l();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isObjectLike=QH;function QH(t){return typeof t=="object"&&t!==null}});var tr=h(qh=>{"use strict";l();Object.defineProperty(qh,"__esModule",{value:!0});qh.invariant=WH;function WH(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}});var k1=h(Gh=>{"use strict";l();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.getLocation=ZH;var JH=tr(),XH=/\r\n|[\n\r]/g;function ZH(t,e){let r=0,o=1;for(let a of t.body.matchAll(XH)){if(typeof a.index=="number"||(0,JH.invariant)(!1),a.index>=e)break;r=a.index+a[0].length,o+=1}return{line:o,column:e+1-r}}});var $h=h(j1=>{"use strict";l();Object.defineProperty(j1,"__esModule",{value:!0});j1.printLocation=tz;j1.printSourceLocation=E6;var ez=k1();function tz(t){return E6(t.source,(0,ez.getLocation)(t.source,t.start))}function E6(t,e){let r=t.locationOffset.column-1,o="".padStart(r)+t.body,a=e.line-1,s=t.locationOffset.line-1,i=e.line+s,n=e.line===1?r:0,u=e.column+n,c=`${t.name}:${i}:${u}
|
|
2
2
|
`,p=o.split(/\r\n|[\n\r]/g),d=p[a];if(d.length>120){let _=Math.floor(u/80),T=u%80,b=[];for(let R=0;R<d.length;R+=80)b.push(d.slice(R,R+80));return c+y6([[`${i} |`,b[0]],...b.slice(1,_+1).map(R=>["|",R]),["|","^".padStart(T)],["|",b[_+1]]])}return c+y6([[`${i-1} |`,p[a-1]],[`${i} |`,d],["|","^".padStart(u)],[`${i+1} |`,p[a+1]]])}function y6(t){let e=t.filter(([o,a])=>a!==void 0),r=Math.max(...e.map(([o])=>o.length));return e.map(([o,a])=>o.padStart(r)+(a?" "+a:"")).join(`
|
|
3
3
|
`)}});var ne=h(is=>{"use strict";l();Object.defineProperty(is,"__esModule",{value:!0});is.GraphQLError=void 0;is.formatError=oz;is.printError=iz;var rz=$n(),_6=k1(),g6=$h();function nz(t){let e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}var Kh=class t extends Error{constructor(e,...r){var o,a,s;let{nodes:i,source:n,positions:u,path:c,originalError:p,extensions:d}=nz(r);super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=p??void 0,this.nodes=T6(Array.isArray(i)?i:i?[i]:void 0);let _=T6((o=this.nodes)===null||o===void 0?void 0:o.map(b=>b.loc).filter(b=>b!=null));this.source=n??(_==null||(a=_[0])===null||a===void 0?void 0:a.source),this.positions=u??_?.map(b=>b.start),this.locations=u&&n?u.map(b=>(0,_6.getLocation)(n,b)):_?.map(b=>(0,_6.getLocation)(b.source,b.start));let T=(0,rz.isObjectLike)(p?.extensions)?p?.extensions:void 0;this.extensions=(s=d??T)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),p!=null&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let r of this.nodes)r.loc&&(e+=`
|
|
4
4
|
|
|
@@ -770,7 +770,7 @@ metadata was removed`},g=le(f,null,null,{redactedPaths:Qb,redactedKeys:E})),g},E
|
|
|
770
770
|
`).slice(3).join(`
|
|
771
771
|
`)},Ja.maybeUseFallbackStack=function(f,E){var g=f.stack.split(`
|
|
772
772
|
`);return(g.length===1||g.length===2&&/at Error \(native\)/.test(g[1]))&&(f.stack=g[0]+`
|
|
773
|
-
`+E),f};var _1={},RK=Ja.getStack;_1={name:"contextualize",load:function(f){var E=function(g,y){var A=RK(),O=bh(f);return O.fallbackStack=A,O.addOnError(y),f._clientContext.run(O,g)};return E}},_1.default=_1;var g1={},PK=Ja.getStack,IK=Ja.maybeUseFallbackStack;g1={name:"intercept",load:function(f){var E=function(g,y){g===void 0&&(g=function(){}),typeof y!="function"&&(y=g,g=function(){});var A=PK();return function(O){if(O){O.stack&&IK(O,A);var C=f.Event.create(O,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);f._notify(C,g);return}for(var j=arguments.length,K=new Array(j>1?j-1:0),_e=1;_e<j;_e++)K[_e-1]=arguments[_e];y.apply(void 0,K)}};return E}},g1.default=g1;function T1(){return T1=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},T1.apply(null,arguments)}var Ju=oe("os"),wK={load:function(f){var E={osName:Ju.platform()+" ("+Ju.arch()+")",osVersion:Ju.release(),totalMemory:Ju.totalmem(),hostname:f._config.hostname,runtimeVersions:{node:process.versions.node}};f._addOnSessionPayload(function(g){g.device=T1({},g.device,E)}),f.addOnError(function(g){g.device=T1({},g.device,E,{freeMemory:Ju.freemem(),time:new Date})},!0)}},r3=oe("path"),LK=r3.join,FK=r3.resolve,n3=function(f){return LK(FK(f),"/")},MK={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){A.inProject=typeof A.file=="string"&&A.file.indexOf(g)===0&&!/\/node_modules\//.test(A.file)})}})}};function Sh(){return Sh=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Sh.apply(null,arguments)}function BK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,xh(f,E)}function xh(f,E){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},xh(f,E)}var i3=3,o3=200,UK=oe("fs"),kK=UK.createReadStream,jK=oe("stream"),VK=jK.Writable,qK=U$(),GK=j$(),$K=oe("path"),KK={load:function(f){if(f._config.sendCode){var E=function(g,y){return new Promise(function(A,O){try{if(!g.lineNumber||!g.file)return A(g);var C=$K.resolve(f._config.projectRoot,g.file),j=C+"@"+g.lineNumber;if(j in y)return g.code=y[j],A(g);HK(C,g.lineNumber,function(K,_e){return K||(g.code=y[j]=_e),A(g)})}catch{return A(g)}})};f.addOnError(function(g){return new Promise(function(y,A){var O=Object.create(null),C=g.errors.reduce(function(j,K){return j.concat(K.stacktrace)},[]);YK(C.map(function(j){return function(){return E(j,O)}})).then(y).catch(A)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(f){return f===!0||f===!1},message:"should be true or false"}}},HK=function(f,E,g){var y=E-i3,A=E+i3,O=kK(f,{encoding:"utf8"}),C=new GK.LineStream({keepEmptyLines:!0}),j=new zK({start:y,end:A});j.on("done",function(){return O.destroy()}),qK(O,C,j,function(K){if(K&&K.message!=="premature close")return g(K);g(null,j.getCode())})},zK=(function(f){function E(y){var A;return A=f.call(this,Sh({},y,{decodeStrings:!1}))||this,A._start=y.start,A._end=y.end,A._n=0,A._code={},A}BK(E,f);var g=E.prototype;return g._write=function(A,O,C){return this._n++,this._n<this._start?C(null):this._n<=this._end?(this._code[String(this._n)]=A.length<=o3?A:A.substr(0,o3),C(null)):(this.emit("done"),C(null))},g.getCode=function(){return this._code},E})(VK),YK=function(f){return new Promise(function(E,g){var y=[];f.reduce(function(A,O){return A.then(function(C){return y.push(C),O()})},Promise.resolve()).then(function(A){y.push(A)}).then(function(){E(y.slice(1))})})},QK=Ja.maybeUseFallbackStack,Oh,WK={load:function(f){f._config.autoDetectErrors&&f._config.enabledErrorTypes.unhandledExceptions&&(Oh=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f;E.stack&&y.fallbackStack&&QK(E,y.fallbackStack);var A=y.Event.create(E,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(O){y._notify(A,function(){},function(C,j){C&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUncaughtException(E,j,y._logger),O()})})},process.prependListener("uncaughtException",Oh))},destroy:function(){process.removeListener("uncaughtException",Oh)}},A1,JK={load:function(f){!f._config.autoDetectErrors||!f._config.enabledErrorTypes.unhandledRejections||(A1=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f,A=!f._config.reportUnhandledPromiseRejectionsAsHandled,O=y.Event.create(E,!1,{severity:"error",unhandled:A,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(C){y._notify(O,function(){},function(j,K){j&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUnhandledRejection(E,K,y._logger),C()})})},process.prependListener?process.prependListener("unhandledRejection",A1):process.on("unhandledRejection",A1))},destroy:function(){process.removeListener("unhandledRejection",A1)}},XK=Dh;function Dh(f){f=f||{},this.ms=f.min||100,this.max=f.max||1e4,this.factor=f.factor||2,this.jitter=f.jitter>0&&f.jitter<=1?f.jitter:0,this.attempts=0}Dh.prototype.duration=function(){var f=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var E=Math.random(),g=Math.floor(E*this.jitter*f);f=(Math.floor(E*10)&1)==0?f-g:f+g}return Math.min(f,this.max)|0},Dh.prototype.reset=function(){this.attempts=0};function ZK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,Nh(f,E)}function Nh(f,E){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},Nh(f,E)}var eH=10*1e3,tH=oe("events").EventEmitter,rH=(function(f){function E(y){var A;return A=f.call(this)||this,A._sessions=new Map,A._interval=null,A._intervalLength=y||eH,A._summarize=A._summarize.bind(A),A}ZK(E,f);var g=E.prototype;return g.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},g.stop=function(){clearInterval(this._interval),this._interval=null},g.track=function(A){var O=nH(A.startedAt),C=this._sessions.get(O);return this._sessions.set(O,typeof C>"u"?1:C+1),A},g._summarize=function(){var A=this,O=[];this._sessions.forEach(function(C,j){O.push({startedAt:j,sessionsStarted:C}),A._sessions.delete(j)}),O.length&&this.emit("summary",O)},E})(tH),nH=function(f){var E=new Date(f);return E.setSeconds(0),E.setMilliseconds(0),E.toISOString()},iH={load:function(f){var E=null;f._sessionDelegate={startSession:function(g,y){return E||(E=new rH(g._config.sessionSummaryInterval),E.on("summary",oH(g)),E.start()),g._session=y,g._pausedSession=null,E.track(g._session),g},pauseSession:function(g){g._pausedSession=g._session,g._session=null},resumeSession:function(g){return g._session?g:g._pausedSession?(g._session=g._pausedSession,g._pausedSession=null,g):g.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(f){return f===void 0||T()(f)},message:"should be a positive integer"}}},oH=function(f){return function(E){if(f._config.enabledReleaseStages!==null&&!f._config.enabledReleaseStages.includes(f._config.releaseStage)){f._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!E.length)return;var g=new XK({min:1e3,max:1e4}),y=10;O(A);function A(C){if(!C){var j=E.reduce(function(K,_e){return K+_e.sessionsStarted},0);return f._logger.debug(j+" session(s) reported")}if(g.attempts===10){f._logger.error("Session delivery failed, max retries exceeded",C);return}f._logger.debug("Session delivery failed, retry #"+(g.attempts+1)+"/"+y,C),setTimeout(function(){return O(A)},g.duration())}function O(C){var j={notifier:f._notifier,device:{},app:{releaseStage:f._config.releaseStage,version:f._config.appVersion,type:f._config.appType},sessionCounts:E},K=vh(f._cbs.sp,j,"onSessionPayload",f._logger);if(K)return f._logger.debug("Session not sent due to onSessionPayload callback"),C(null);f._delivery.sendSession(j,C)}}},aH={load:function(f){f.addOnError(function(E){var g=E.errors.reduce(function(y,A){return y.concat(A.stacktrace)},[]);g.forEach(function(y){typeof y.file=="string"&&(y.file=y.file.replace(/\\/g,"/"))})})}},sH={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){typeof A.file=="string"&&A.file.indexOf(g)===0&&(A.file=A.file.replace(g,""))})}})}},qo={};function Ch(){return Ch=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Ch.apply(null,arguments)}var uH="Bugsnag Node",cH="8.8.0",lH="https://github.com/bugsnag/bugsnag-js",pH=oe("async_hooks"),dH=pH.AsyncLocalStorage;m1.__type="nodejs";var fH=Ch({},I.schema,xK),mH=[CK,KK,MK,sH,iH,wK,WK,JK,g1,_1,aH,Ah],_n={_client:null,createClient:function(f){typeof f=="string"&&(f={apiKey:f}),f||(f={});var E=new y1(f,fH,mH,{name:uH,version:cH,url:lH});return Object.keys(y1.prototype).forEach(function(g){var y=E[g];E[g]=function(){var A=E._clientContext&&typeof E._clientContext.getStore=="function"?E._clientContext.getStore():null,O=A||E,C=A?A[g]:y;O._depth+=1;var j=C.apply(O,arguments);return O._depth-=1,j}}),E._clientContext=new dH,E._setDelivery(TK),E._logger.debug("Loaded!"),E},start:function(f){return _n._client?(_n._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),_n._client):(_n._client=_n.createClient(f),_n._client)},isStarted:function(){return _n._client!=null}};return Object.keys(y1.prototype).forEach(function(f){/^_/.test(f)||(_n[f]=function(){var E=_n._client,g=E&&E._clientContext&&E._clientContext.getStore();if(g&&(E=g),!E)return console.error("Bugsnag."+f+"() was called before Bugsnag.start()");E._depth+=1;var y=E[f].apply(E,arguments);return E._depth-=1,y})}),qo=_n,qo.Client=y1,qo.Event=m1,qo.Session=_h,qo.Breadcrumb=a,qo.default=_n,qo})});var $$=h((gQe,G$)=>{l();G$.exports=q$()});l();l();l();l();l();l();import w1 from"crypto";function a6(t){return w1.createHash("sha1").update(t).digest("hex")}function $4e(t){return w1.createHash("md5").update(t).digest("hex")}function K4e(){return w1.randomUUID()}function Wr(t){return w1.createHash("sha1").update(Buffer.from("6ba7b810-9dad-11d1-80b4-00c04fd430c8".replace(/-/g,""),"hex")).update(t).digest().toString("hex").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function Ji(){return process.env}function Go(){let t=Ji();return t[Ti.appAutomationToken]??t[Ti.partnersToken]}function X4e(){let t=Ji()[c3.backendPort];if(t&&!isNaN(Number(t)))return Number(t)}function s6(){let t=Ji()[Ti.identityToken],e=Ji()[Ti.refreshToken];if(!(!t||!e))return{accessToken:t,refreshToken:e,userId:Wr(t)}}function Z4e(t=Ji()){return u3()||b1(t[Ti.json])}function u6(){return b1(Ji()[Ti.neverUsePartnersApi])}function c6(t=Ji()){return b1(t[Ti.skipNetworkLevelRetry])}function Mh(t=Ji()){let e=t[Ti.maxRequestTimeForNetworkCalls];return e&&!isNaN(Number(e))?Number(e):30*1e3}l();var jH=["access_token","refresh_token","id_token","subject_token","actor_token","device_code","client_secret","code","token"];function rs(t){let e=new URL(t);for(let r of jH)e.searchParams.has(r)&&e.searchParams.set(r,"****");return e.toString()}l();l();var Xi="3.94.0";import VH from"https";var Bh=class extends tt{constructor(e,r){let o=r===403?"Ensure you are using the correct account. You can switch with `shopify auth login`":void 0;super(e,o),this.statusCode=r}},L1=class extends Bh{constructor(e,r,o){super(e,r),this.errors=o,this.stack=void 0}};function Zi(t){let e={},r=["token","authorization","subject_token"];return Object.keys(t).forEach(o=>{r.find(a=>o.toLocaleLowerCase().includes(a))===void 0&&(e[o]=t[o])}),Object.keys(e).map(o=>` - ${o}: ${e[o]}`).join(`
|
|
773
|
+
`+E),f};var _1={},RK=Ja.getStack;_1={name:"contextualize",load:function(f){var E=function(g,y){var A=RK(),O=bh(f);return O.fallbackStack=A,O.addOnError(y),f._clientContext.run(O,g)};return E}},_1.default=_1;var g1={},PK=Ja.getStack,IK=Ja.maybeUseFallbackStack;g1={name:"intercept",load:function(f){var E=function(g,y){g===void 0&&(g=function(){}),typeof y!="function"&&(y=g,g=function(){});var A=PK();return function(O){if(O){O.stack&&IK(O,A);var C=f.Event.create(O,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);f._notify(C,g);return}for(var j=arguments.length,K=new Array(j>1?j-1:0),_e=1;_e<j;_e++)K[_e-1]=arguments[_e];y.apply(void 0,K)}};return E}},g1.default=g1;function T1(){return T1=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},T1.apply(null,arguments)}var Ju=oe("os"),wK={load:function(f){var E={osName:Ju.platform()+" ("+Ju.arch()+")",osVersion:Ju.release(),totalMemory:Ju.totalmem(),hostname:f._config.hostname,runtimeVersions:{node:process.versions.node}};f._addOnSessionPayload(function(g){g.device=T1({},g.device,E)}),f.addOnError(function(g){g.device=T1({},g.device,E,{freeMemory:Ju.freemem(),time:new Date})},!0)}},r3=oe("path"),LK=r3.join,FK=r3.resolve,n3=function(f){return LK(FK(f),"/")},MK={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){A.inProject=typeof A.file=="string"&&A.file.indexOf(g)===0&&!/\/node_modules\//.test(A.file)})}})}};function Sh(){return Sh=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Sh.apply(null,arguments)}function BK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,xh(f,E)}function xh(f,E){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},xh(f,E)}var i3=3,o3=200,UK=oe("fs"),kK=UK.createReadStream,jK=oe("stream"),VK=jK.Writable,qK=U$(),GK=j$(),$K=oe("path"),KK={load:function(f){if(f._config.sendCode){var E=function(g,y){return new Promise(function(A,O){try{if(!g.lineNumber||!g.file)return A(g);var C=$K.resolve(f._config.projectRoot,g.file),j=C+"@"+g.lineNumber;if(j in y)return g.code=y[j],A(g);HK(C,g.lineNumber,function(K,_e){return K||(g.code=y[j]=_e),A(g)})}catch{return A(g)}})};f.addOnError(function(g){return new Promise(function(y,A){var O=Object.create(null),C=g.errors.reduce(function(j,K){return j.concat(K.stacktrace)},[]);YK(C.map(function(j){return function(){return E(j,O)}})).then(y).catch(A)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(f){return f===!0||f===!1},message:"should be true or false"}}},HK=function(f,E,g){var y=E-i3,A=E+i3,O=kK(f,{encoding:"utf8"}),C=new GK.LineStream({keepEmptyLines:!0}),j=new zK({start:y,end:A});j.on("done",function(){return O.destroy()}),qK(O,C,j,function(K){if(K&&K.message!=="premature close")return g(K);g(null,j.getCode())})},zK=(function(f){function E(y){var A;return A=f.call(this,Sh({},y,{decodeStrings:!1}))||this,A._start=y.start,A._end=y.end,A._n=0,A._code={},A}BK(E,f);var g=E.prototype;return g._write=function(A,O,C){return this._n++,this._n<this._start?C(null):this._n<=this._end?(this._code[String(this._n)]=A.length<=o3?A:A.substr(0,o3),C(null)):(this.emit("done"),C(null))},g.getCode=function(){return this._code},E})(VK),YK=function(f){return new Promise(function(E,g){var y=[];f.reduce(function(A,O){return A.then(function(C){return y.push(C),O()})},Promise.resolve()).then(function(A){y.push(A)}).then(function(){E(y.slice(1))})})},QK=Ja.maybeUseFallbackStack,Oh,WK={load:function(f){f._config.autoDetectErrors&&f._config.enabledErrorTypes.unhandledExceptions&&(Oh=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f;E.stack&&y.fallbackStack&&QK(E,y.fallbackStack);var A=y.Event.create(E,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(O){y._notify(A,function(){},function(C,j){C&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUncaughtException(E,j,y._logger),O()})})},process.prependListener("uncaughtException",Oh))},destroy:function(){process.removeListener("uncaughtException",Oh)}},A1,JK={load:function(f){!f._config.autoDetectErrors||!f._config.enabledErrorTypes.unhandledRejections||(A1=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f,A=!f._config.reportUnhandledPromiseRejectionsAsHandled,O=y.Event.create(E,!1,{severity:"error",unhandled:A,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(C){y._notify(O,function(){},function(j,K){j&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUnhandledRejection(E,K,y._logger),C()})})},process.prependListener?process.prependListener("unhandledRejection",A1):process.on("unhandledRejection",A1))},destroy:function(){process.removeListener("unhandledRejection",A1)}},XK=Dh;function Dh(f){f=f||{},this.ms=f.min||100,this.max=f.max||1e4,this.factor=f.factor||2,this.jitter=f.jitter>0&&f.jitter<=1?f.jitter:0,this.attempts=0}Dh.prototype.duration=function(){var f=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var E=Math.random(),g=Math.floor(E*this.jitter*f);f=(Math.floor(E*10)&1)==0?f-g:f+g}return Math.min(f,this.max)|0},Dh.prototype.reset=function(){this.attempts=0};function ZK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,Nh(f,E)}function Nh(f,E){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},Nh(f,E)}var eH=10*1e3,tH=oe("events").EventEmitter,rH=(function(f){function E(y){var A;return A=f.call(this)||this,A._sessions=new Map,A._interval=null,A._intervalLength=y||eH,A._summarize=A._summarize.bind(A),A}ZK(E,f);var g=E.prototype;return g.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},g.stop=function(){clearInterval(this._interval),this._interval=null},g.track=function(A){var O=nH(A.startedAt),C=this._sessions.get(O);return this._sessions.set(O,typeof C>"u"?1:C+1),A},g._summarize=function(){var A=this,O=[];this._sessions.forEach(function(C,j){O.push({startedAt:j,sessionsStarted:C}),A._sessions.delete(j)}),O.length&&this.emit("summary",O)},E})(tH),nH=function(f){var E=new Date(f);return E.setSeconds(0),E.setMilliseconds(0),E.toISOString()},iH={load:function(f){var E=null;f._sessionDelegate={startSession:function(g,y){return E||(E=new rH(g._config.sessionSummaryInterval),E.on("summary",oH(g)),E.start()),g._session=y,g._pausedSession=null,E.track(g._session),g},pauseSession:function(g){g._pausedSession=g._session,g._session=null},resumeSession:function(g){return g._session?g:g._pausedSession?(g._session=g._pausedSession,g._pausedSession=null,g):g.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(f){return f===void 0||T()(f)},message:"should be a positive integer"}}},oH=function(f){return function(E){if(f._config.enabledReleaseStages!==null&&!f._config.enabledReleaseStages.includes(f._config.releaseStage)){f._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!E.length)return;var g=new XK({min:1e3,max:1e4}),y=10;O(A);function A(C){if(!C){var j=E.reduce(function(K,_e){return K+_e.sessionsStarted},0);return f._logger.debug(j+" session(s) reported")}if(g.attempts===10){f._logger.error("Session delivery failed, max retries exceeded",C);return}f._logger.debug("Session delivery failed, retry #"+(g.attempts+1)+"/"+y,C),setTimeout(function(){return O(A)},g.duration())}function O(C){var j={notifier:f._notifier,device:{},app:{releaseStage:f._config.releaseStage,version:f._config.appVersion,type:f._config.appType},sessionCounts:E},K=vh(f._cbs.sp,j,"onSessionPayload",f._logger);if(K)return f._logger.debug("Session not sent due to onSessionPayload callback"),C(null);f._delivery.sendSession(j,C)}}},aH={load:function(f){f.addOnError(function(E){var g=E.errors.reduce(function(y,A){return y.concat(A.stacktrace)},[]);g.forEach(function(y){typeof y.file=="string"&&(y.file=y.file.replace(/\\/g,"/"))})})}},sH={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){typeof A.file=="string"&&A.file.indexOf(g)===0&&(A.file=A.file.replace(g,""))})}})}},qo={};function Ch(){return Ch=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Ch.apply(null,arguments)}var uH="Bugsnag Node",cH="8.8.0",lH="https://github.com/bugsnag/bugsnag-js",pH=oe("async_hooks"),dH=pH.AsyncLocalStorage;m1.__type="nodejs";var fH=Ch({},I.schema,xK),mH=[CK,KK,MK,sH,iH,wK,WK,JK,g1,_1,aH,Ah],_n={_client:null,createClient:function(f){typeof f=="string"&&(f={apiKey:f}),f||(f={});var E=new y1(f,fH,mH,{name:uH,version:cH,url:lH});return Object.keys(y1.prototype).forEach(function(g){var y=E[g];E[g]=function(){var A=E._clientContext&&typeof E._clientContext.getStore=="function"?E._clientContext.getStore():null,O=A||E,C=A?A[g]:y;O._depth+=1;var j=C.apply(O,arguments);return O._depth-=1,j}}),E._clientContext=new dH,E._setDelivery(TK),E._logger.debug("Loaded!"),E},start:function(f){return _n._client?(_n._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),_n._client):(_n._client=_n.createClient(f),_n._client)},isStarted:function(){return _n._client!=null}};return Object.keys(y1.prototype).forEach(function(f){/^_/.test(f)||(_n[f]=function(){var E=_n._client,g=E&&E._clientContext&&E._clientContext.getStore();if(g&&(E=g),!E)return console.error("Bugsnag."+f+"() was called before Bugsnag.start()");E._depth+=1;var y=E[f].apply(E,arguments);return E._depth-=1,y})}),qo=_n,qo.Client=y1,qo.Event=m1,qo.Session=_h,qo.Breadcrumb=a,qo.default=_n,qo})});var $$=h((gQe,G$)=>{l();G$.exports=q$()});l();l();l();l();l();l();import w1 from"crypto";function a6(t){return w1.createHash("sha1").update(t).digest("hex")}function $4e(t){return w1.createHash("md5").update(t).digest("hex")}function K4e(){return w1.randomUUID()}function Wr(t){return w1.createHash("sha1").update(Buffer.from("6ba7b810-9dad-11d1-80b4-00c04fd430c8".replace(/-/g,""),"hex")).update(t).digest().toString("hex").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function Ji(){return process.env}function Go(){let t=Ji();return t[Ti.appAutomationToken]??t[Ti.partnersToken]}function X4e(){let t=Ji()[c3.backendPort];if(t&&!isNaN(Number(t)))return Number(t)}function s6(){let t=Ji()[Ti.identityToken],e=Ji()[Ti.refreshToken];if(!(!t||!e))return{accessToken:t,refreshToken:e,userId:Wr(t)}}function Z4e(t=Ji()){return u3()||b1(t[Ti.json])}function u6(){return b1(Ji()[Ti.neverUsePartnersApi])}function c6(t=Ji()){return b1(t[Ti.skipNetworkLevelRetry])}function Mh(t=Ji()){let e=t[Ti.maxRequestTimeForNetworkCalls];return e&&!isNaN(Number(e))?Number(e):30*1e3}l();var jH=["access_token","refresh_token","id_token","subject_token","actor_token","device_code","client_secret","code","token"];function rs(t){let e=new URL(t);for(let r of jH)e.searchParams.has(r)&&e.searchParams.set(r,"****");return e.toString()}l();l();var Xi="3.94.2";import VH from"https";var Bh=class extends tt{constructor(e,r){let o=r===403?"Ensure you are using the correct account. You can switch with `shopify auth login`":void 0;super(e,o),this.statusCode=r}},L1=class extends Bh{constructor(e,r,o){super(e,r),this.errors=o,this.stack=void 0}};function Zi(t){let e={},r=["token","authorization","subject_token"];return Object.keys(t).forEach(o=>{r.find(a=>o.toLocaleLowerCase().includes(a))===void 0&&(e[o]=t[o])}),Object.keys(e).map(o=>` - ${o}: ${e[o]}`).join(`
|
|
774
774
|
`)}function Uh(t){let r={"User-Agent":`Shopify CLI; v=${Xi}`,"Keep-Alive":"timeout=30","Sec-CH-UA-PLATFORM":process.platform,"Content-Type":"application/json",...ts()&&{"X-Shopify-Cli-Employee":"1"}};if(t){let o=t.match(/^shp(at|ua|ca|tka)/)?t:`Bearer ${t}`;r.authorization=o,r["X-Shopify-Access-Token"]=o}return r}async function F1(){return new VH.Agent({rejectUnauthorized:!0,keepAlive:!0})}l();l();var qH=300,M1=1e4;function GH(t,e,r=M1/3){if(t===0)return 0;let o=2**(t-1);return Math.min(e*o,r)}async function*$H(t,e){let r=0;for(;;){let o=GH(r,e);if(!t(o))return{remainingMs:0,iterations:r};await P1(o/1e3),yield o,r++}}async function*l6(t=M1,e=qH){if(t<=0)return{remainingMs:0,iterations:0};let r=Date.now(),o=$H(i=>Date.now()-r+i<=t,e),a=0;for await(let i of o)yield i,a++;let s=Date.now()-r;return{remainingMs:t-s,iterations:a}}l();l();var B1=JSON;l();var p6=t=>t.toUpperCase(),d6=t=>{let e={};return t.forEach((r,o)=>{e[o]=r}),e};l();var f6=(t,e,r)=>t.document?t:{document:t,variables:e,requestHeaders:r,signal:void 0},m6=(t,e,r)=>t.query?t:{query:t,variables:e,requestHeaders:r,signal:void 0},h6=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};l();var nd=et(T9(),1),A9=t=>{let e,r=t.definitions.filter(o=>o.kind==="OperationDefinition");return r.length===1&&(e=r[0]?.name?.value),e},Ci=t=>{if(typeof t=="string"){let r;try{let o=(0,nd.parse)(t);r=A9(o)}catch{}return{query:t,operationName:r}}let e=A9(t);return{query:(0,nd.print)(t),operationName:e}};l();var Ar=class t extends Error{constructor(e,r){let o=`${t.extractMessage(e)}: ${JSON.stringify({response:e,request:r})}`;super(o),Object.setPrototypeOf(this,t.prototype),this.response=e,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${e.status})`}};var Eo=et(i8(),1);l();var ioe="connection_init",ooe="connection_ack",a8="ping",s8="pong",aoe="subscribe",soe="next",uoe="error",u8="complete",yo=class t{get type(){return this._type}get id(){return this._id}get payload(){return this._payload}constructor(e,r,o){this._type=e,this._payload=r,this._id=o}get text(){let e={type:this.type};return this.id!=null&&this.id!=null&&(e.id=this.id),this.payload!=null&&this.payload!=null&&(e.payload=this.payload),JSON.stringify(e)}static parse(e,r){let{type:o,payload:a,id:s}=JSON.parse(e);return new t(o,r(a),s)}},Ed=class{constructor(e,{onInit:r,onAcknowledged:o,onPing:a,onPong:s}){this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.addEventListener("open",async i=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={},e.send(loe(r?await r():null).text)}),e.addEventListener("close",i=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={}}),e.addEventListener("error",i=>{console.error(i)}),e.addEventListener("message",i=>{try{let n=coe(i.data);switch(n.type){case ooe:{this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,o&&o(n.payload));return}case a8:{a?a(n.payload).then(d=>e.send(o8(d).text)):e.send(o8(null).text);return}case s8:{s&&s(n.payload);return}}if(!this.socketState.acknowledged||n.id===void 0||n.id===null||!this.socketState.subscriptions[n.id])return;let{query:u,variables:c,subscriber:p}=this.socketState.subscriptions[n.id];switch(n.type){case soe:{!n.payload.errors&&n.payload.data&&p.next&&p.next(n.payload.data),n.payload.errors&&p.error&&p.error(new Ar({...n.payload,status:200},{query:u,variables:c}));return}case uoe:{p.error&&p.error(new Ar({errors:n.payload,status:200},{query:u,variables:c}));return}case u8:{p.complete&&p.complete(),delete this.socketState.subscriptions[n.id];return}}}catch(n){console.error(n),e.close(1006)}e.close(4400,"Unknown graphql-ws message.")})}makeSubscribe(e,r,o,a){let s=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[s]={query:e,variables:a,subscriber:o},this.socket.send(doe(s,{query:e,operationName:r,variables:a}).text),()=>{this.socket.send(foe(s).text),delete this.socketState.subscriptions[s]}}rawRequest(e,r){return new Promise((o,a)=>{let s;this.rawSubscribe(e,{next:(i,n)=>s={data:i,extensions:n},error:a,complete:()=>o(s)},r)})}request(e,r){return new Promise((o,a)=>{let s;this.subscribe(e,{next:i=>s=i,error:a,complete:()=>o(s)},r)})}subscribe(e,r,o){let{query:a,operationName:s}=Ci(e);return this.makeSubscribe(a,s,r,o)}rawSubscribe(e,r,o){return this.makeSubscribe(e,void 0,r,o)}ping(e){this.socket.send(poe(e).text)}close(){this.socket.close(1e3)}};Ed.PROTOCOL="graphql-transport-ws";function coe(t,e=r=>r){return yo.parse(t,e)}function loe(t){return new yo(ioe,t)}function poe(t){return new yo(a8,t,void 0)}function o8(t){return new yo(s8,t,void 0)}function doe(t,e){return new yo(aoe,e,t)}function foe(t){return new yo(u8,void 0,t)}var Rs=t=>{let e={};return t&&(typeof Headers<"u"&&t instanceof Headers||Eo&&Eo.Headers&&t instanceof Eo.Headers?e=d6(t):Array.isArray(t)?t.forEach(([r,o])=>{r&&o!==void 0&&(e[r]=o)}):e=t),e},c8=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),moe=t=>{if(!Array.isArray(t.query)){let o=t,a=[`query=${encodeURIComponent(c8(o.query))}`];return t.variables&&a.push(`variables=${encodeURIComponent(o.jsonSerializer.stringify(o.variables))}`),o.operationName&&a.push(`operationName=${encodeURIComponent(o.operationName)}`),a.join("&")}if(typeof t.variables<"u"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");let e=t,r=t.query.reduce((o,a,s)=>(o.push({query:c8(a),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),o),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(r))}`},hoe=t=>async e=>{let{url:r,query:o,variables:a,operationName:s,fetch:i,fetchOptions:n,middleware:u}=e,c={...e.headers},p="",d;t==="POST"?(d=voe(o,a,s,n.jsonSerializer),typeof d=="string"&&(c["Content-Type"]="application/json")):p=moe({query:o,variables:a,operationName:s,jsonSerializer:n.jsonSerializer??B1});let _={method:t,headers:c,body:d,...n},T=r,b=_;if(u){let R=await Promise.resolve(u({..._,url:r,operationName:s,variables:a})),{url:I,...B}=R;T=I,b=B}return p&&(T=`${T}?${p}`),await i(T,b)},_d=class{constructor(e,r={}){this.url=e,this.requestConfig=r,this.rawRequest=async(...o)=>{let[a,s,i]=o,n=m6(a,s,i),{headers:u,fetch:c=Eo.default,method:p="POST",requestMiddleware:d,responseMiddleware:_,...T}=this.requestConfig,{url:b}=this;n.signal!==void 0&&(T.signal=n.signal);let{operationName:R}=Ci(n.query);return t_({url:b,query:n.query,variables:n.variables,headers:{...Rs(r_(u)),...Rs(n.requestHeaders)},operationName:R,fetch:c,method:p,fetchOptions:T,middleware:d}).then(I=>(_&&_(I),I)).catch(I=>{throw _&&_(I),I})}}async request(e,...r){let[o,a]=r,s=f6(e,o,a),{headers:i,fetch:n=Eo.default,method:u="POST",requestMiddleware:c,responseMiddleware:p,...d}=this.requestConfig,{url:_}=this;s.signal!==void 0&&(d.signal=s.signal);let{query:T,operationName:b}=Ci(s.document);return t_({url:_,query:T,variables:s.variables,headers:{...Rs(r_(i)),...Rs(s.requestHeaders)},operationName:b,fetch:n,method:u,fetchOptions:d,middleware:c}).then(R=>(p&&p(R),R.data)).catch(R=>{throw p&&p(R),R})}batchRequests(e,r){let o=h6(e,r),{headers:a,...s}=this.requestConfig;o.signal!==void 0&&(s.signal=o.signal);let i=o.documents.map(({document:u})=>Ci(u).query),n=o.documents.map(({variables:u})=>u);return t_({url:this.url,query:i,variables:n,headers:{...Rs(r_(a)),...Rs(o.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Eo.default,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(u=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u.data)).catch(u=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,r){let{headers:o}=this.requestConfig;return o?o[e]=r:this.requestConfig.headers={[e]:r},this}setEndpoint(e){return this.url=e,this}},t_=async t=>{let{query:e,variables:r,fetchOptions:o}=t,a=hoe(p6(t.method??"post")),s=Array.isArray(t.query),i=await a(t),n=await yoe(i,o.jsonSerializer??B1),u=Array.isArray(n)?!n.some(({data:p})=>!p):!!n.data,c=Array.isArray(n)||!n.errors||Array.isArray(n.errors)&&!n.errors.length||o.errorPolicy==="all"||o.errorPolicy==="ignore";if(i.ok&&c&&u){let{errors:p,...d}=(Array.isArray(n),n),_=o.errorPolicy==="ignore"?d:n;return{...s?{data:_}:_,headers:i.headers,status:i.status}}else{let p=typeof n=="string"?{error:n}:n;throw new Ar({...p,status:i.status,headers:i.headers},{query:e,variables:r})}};var voe=(t,e,r,o)=>{let a=o??B1;if(!Array.isArray(t))return a.stringify({query:t,variables:e,operationName:r});if(typeof e<"u"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");let s=t.reduce((i,n,u)=>(i.push({query:n,variables:e?e[u]:void 0}),i),[]);return a.stringify(s)},yoe=async(t,e)=>{let r;return t.headers.forEach((o,a)=>{a.toLowerCase()==="content-type"&&(r=o)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},r_=t=>typeof t=="function"?t():t,eDe=(t,...e)=>t.reduce((r,o,a)=>`${r}${o}${a in e?String(e[a]):""}`,"");import{performance as n_}from"perf_hooks";var p8=["admin","storefront-renderer","partners","business-platform","app-management"],Eoe=1e3,_oe=10,goe=new Set(["cache-control","content-type","etag","x-request-id","server-timing","retry-after"]);function l8(t){return goe.has(t)}function d8(t){if(t instanceof Error){let e=["socket hang up","econnreset","econnaborted","enotfound","enetunreach","network socket disconnected","etimedout","econnrefused","eai_again","epipe","the operation was aborted","timeout","premature close","getaddrinfo"],r=t.message.toLowerCase(),o=e.some(s=>r.includes(s)),a=/^request to .* failed, reason:\s*$/.test(r);return o||a}return!1}function dDe(t){if(d8(t))return!0;if(t instanceof Error){let e=["certificate","cert","tls","ssl","altnames"],r=t.message.toLowerCase();return e.some(o=>r.includes(o))}return!1}async function Toe(t){if(!t.useNetworkLevelRetry)return t.request();let e;for await(let r of l6(t.maxRetryTimeMs))try{return await t.request()}catch(o){if(e=o,!d8(o))throw o;t.recordCommandRetries&&o_(t.url,`network-retry:${o.message}`),Z(`Retrying request to ${t.url} due to network error ${o}`)}throw e}async function i_(t){let e=n_.now(),r=0,o={},a=rs(t.url),s={};try{s=await Toe(t),s.headers.forEach((n,u)=>{l8(u)&&(o[u]=n)})}catch(n){let u=n_.now();if(r=Math.round(u-e),n instanceof Ar){if(n.response.headers)for(let[p,d]of n.response.headers)l8(p)&&(o[p]=d);let c=Zi(o);if(Aoe(n)){let p;try{p=o["retry-after"]?Number.parseInt(o["retry-after"],10):void 0}catch{}return{status:"can-retry",clientError:n,duration:r,sanitizedHeaders:c,sanitizedUrl:a,requestId:o["x-request-id"],delayMs:p}}else if(n.response.status===401)return{status:"unauthorized",clientError:n,duration:r,sanitizedHeaders:c,sanitizedUrl:a,requestId:o["x-request-id"],delayMs:500};return{status:"client-error",clientError:n,duration:r,sanitizedHeaders:c,sanitizedUrl:a,requestId:o["x-request-id"]}}return{status:"unknown-error",error:n,duration:r,sanitizedHeaders:Zi(o),sanitizedUrl:a,requestId:o["x-request-id"]}}let i=n_.now();return r=Math.round(i-e),{status:"ok",response:s,duration:r,sanitizedHeaders:Zi(o),sanitizedUrl:a,requestId:o["x-request-id"]}}function Aoe(t){return t.response.status===429?!0:typeof t.response.errors=="string"?!1:t.response.errors?.some(e=>e.extensions?.code==="429")??!1}async function f8(t,e){let r=await i_(t);switch(Z(`Request to ${r.sanitizedUrl} completed in ${r.duration} ms
|
|
775
775
|
With response headers:
|
|
776
776
|
${r.sanitizedHeaders}
|
|
@@ -801,7 +801,7 @@ ${Ke.json(e)}
|
|
|
801
801
|
${Ke.json(r)}
|
|
802
802
|
`),e){let a={token:e,storeFqdn:t},s=Al(a)?"theme_access_token":"custom_app_token";return ou(s),iu(Wr(e)),a}return hce(t,r,o)}async function jwe(t=[]){Z(me`Ensuring that the user is authenticated with the Business Platform API with the following scopes:
|
|
803
803
|
${Ke.json(t)}
|
|
804
|
-
`);let e=await Ra({businessPlatformApi:{scopes:t}},process.env);if(!e.businessPlatform)throw new Lt("No business-platform token found after ensuring authenticated");return e.businessPlatform}function qD(){return Tl()}async function Vwe(t,e,r){let o={client_id:e,client_secret:r,grant_type:"client_credentials"},a=await js(`https://${t}/admin/oauth/access_token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)},"slow-request"),s=await a.text();if(a.status===400)throw s.includes("app_not_installed")?new tt(me`App is not installed on ${Ke.green(t)}. Try running ${Ke.genericShellCommand("shopify app dev")} to connect your app to the shop.`):new tt(`Failed to get access token for app ${e} on store ${t}: ${a.statusText}`);try{return{token:JSON.parse(s).access_token,storeFqdn:t}}catch(i){throw i instanceof SyntaxError?new tt(`Received invalid response from admin authentication service (HTTP ${a.status}).`,"The response could not be parsed as JSON. The service may be temporarily unavailable. Please try again."):i}}l();l();function GD(t,e){return Array.from(new Set([...t,...e]))}var HN=et(zD()
|
|
804
|
+
`);let e=await Ra({businessPlatformApi:{scopes:t}},process.env);if(!e.businessPlatform)throw new Lt("No business-platform token found after ensuring authenticated");return e.businessPlatform}function qD(){return Tl()}async function Vwe(t,e,r){let o={client_id:e,client_secret:r,grant_type:"client_credentials"},a=await js(`https://${t}/admin/oauth/access_token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)},"slow-request"),s=await a.text();if(a.status===400)throw s.includes("app_not_installed")?new tt(me`App is not installed on ${Ke.green(t)}. Try running ${Ke.genericShellCommand("shopify app dev")} to connect your app to the shop.`):new tt(`Failed to get access token for app ${e} on store ${t}: ${a.statusText}`);try{return{token:JSON.parse(s).access_token,storeFqdn:t}}catch(i){throw i instanceof SyntaxError?new tt(`Received invalid response from admin authentication service (HTTP ${a.status}).`,"The response could not be parsed as JSON. The service may be temporarily unavailable. Please try again."):i}}l();l();function GD(t,e){return Array.from(new Set([...t,...e]))}var HN=et(zD()),zN=et(hN()),E1e=et(yN()),YN=et(_N()),tg=et(AN()),rg=et(SN()),Sl=et(IN()),ng=et(PH()),QN=et(LN()),_1e=et(qN()),WN=et($N());function zLe(t,e,r=GD){return(0,HN.default)(t,e,{arrayMerge:r})}function YLe(t,e){return(0,zN.default)(t,e)}function KN(t,e){return(0,YN.default)(t,e)}function QLe(t,e){let r=(0,tg.default)((0,Sl.default)(t),(0,Sl.default)(e),KN),o=(0,tg.default)((0,Sl.default)(e),(0,Sl.default)(t),KN);return[(0,rg.default)(r),(0,rg.default)(o)]}function WLe(t,e){return(0,ng.default)(t,e)===void 0?void 0:(0,ng.default)(t,e)}function JLe(t,e,r){return(0,QN.default)(t,e,r)}function JN(t){return(0,WN.default)(t)}function XLe(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>r!=null))}l();l();l();function XN(t,e,r,o,a={}){Z(me`Sending ${Ke.json(t)} GraphQL request:
|
|
805
805
|
${Ke.raw(e.toString().trim())}
|
|
806
806
|
${o?`
|
|
807
807
|
With variables:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as rh,i as ih,o as Iv}from"./chunk-KADPE3PY.js";import{b as Pv}from"./chunk-52KHWFYF.js";import{a as eh,b as th}from"./chunk-
|
|
1
|
+
import{c as rh,i as ih,o as Iv}from"./chunk-KADPE3PY.js";import{b as Pv}from"./chunk-52KHWFYF.js";import{a as eh,b as th}from"./chunk-2E6Y4J4T.js";import{I as An,Na as $l,Qa as ql,X as _l,Z as Sl,_ as Fl,b as Dl,pa as Tl,y as Al,ya as Ml}from"./chunk-PRNHS74J.js";import{F as kl,G as Pl,J as Il,R as Jo,V as Nl,X as Rl}from"./chunk-LH4VO6EV.js";import{$a as Cn,Ad as Zl,Ba as W,Bc as Gl,Bd as ht,Da as En,Db as Hl,Dc as Lr,Eb as Ul,Ed as K,Fa as bn,Fb as Wl,Ja as zo,Jc as F,Ka as Nr,Lc as Fn,Xc as Vl,Ya as $,_c as Yl,a as gl,ad as Xl,bb as Dn,ca as xl,fa as vl,gc as zl,ha as wl,hc as Jl,ic as V,ja as El,ka as bl,nb as Ol,oc as We,qd as Kl,sc as rt,tb as wv,tc as Mr,uc as we,va as U,wb as _n,wc as Sn,wd as X,xc as ct,xd as Ql,ya as Ir,yc as lt,yd as ie}from"./chunk-KVWHPGOA.js";import{b as Ll,d as Bl,e as Go,f as Rr,g as Cv,h as Vo,i as Dv,j as Av,k as jl,l as Yo,n as Sv,o as Fv,p as Xo,q as Tv,s as Ov,t as kv}from"./chunk-SVA22NZQ.js";import{c as bv,d as ut}from"./chunk-FU2Y2M3M.js";import{c as _v}from"./chunk-QYR5VPQA.js";import{b as Ev}from"./chunk-EENHXSWU.js";import{c as N,e as G,f as Bt,h as me,i as jt,j as wn,m as yl,p as _i}from"./chunk-JBSYWYIP.js";import{a as vv,b as Cl}from"./chunk-T4M5CWAO.js";import{a as S,c as w,e as Ct,g as y}from"./chunk-VPRTJUIN.js";var lh=w((sN,ch)=>{"use strict";y();var nr=class e extends Error{constructor(t,r,i){super("[ParserError] "+t,r,i),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},On=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Fi=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new On(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let r;for(;r===!1||this.nextChar();)r=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new nr("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,r){r&&this.next(r),this.stack.push(this.state),this.state=new On(t)}callNow(t,r){return this.call(t,r),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new nr("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new nr("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new nr("Must declare a parseStart method")}};Fi.END=1114112;Fi.Error=nr;ch.exports=Fi});var fh=w((aN,hh)=>{"use strict";y();hh.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var kn=w((cN,ph)=>{"use strict";y();ph.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var mh=w((hN,dh)=>{"use strict";y();var jr=kn(),ea=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${jr(2,this.getUTCMonth()+1)}-${jr(2,this.getUTCDate())}`,r=`${jr(2,this.getUTCHours())}:${jr(2,this.getUTCMinutes())}:${jr(2,this.getUTCSeconds())}.${jr(3,this.getUTCMilliseconds())}`;return`${t}T${r}`}};dh.exports=e=>{let t=new ea(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var xh=w((pN,yh)=>{"use strict";y();var gh=kn(),Hv=global.Date,ta=class extends Hv{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${gh(2,this.getUTCMonth()+1)}-${gh(2,this.getUTCDate())}`}};yh.exports=e=>{let t=new ta(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var wh=w((mN,vh)=>{"use strict";y();var Pn=kn(),ra=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Pn(2,this.getUTCHours())}:${Pn(2,this.getUTCMinutes())}:${Pn(2,this.getUTCSeconds())}.${Pn(3,this.getUTCMilliseconds())}`}};vh.exports=e=>{let t=new ra(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var In=w((exports,module)=>{"use strict";y();module.exports=makeParserClass(lh());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=fh(),createDateTimeFloat=mh(),createDate=xh(),createTime=wh(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
|
|
2
2
|
`,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(i){let n=this.ctx,o=i.key.pop();for(let s of i.key){if(hasKey(n,s)&&(!isTable(n[s])||n[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));n=n[s]=n[s]||Table()}if(hasKey(n,o))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(i.value)||isFloat(i.value)?n[o]=i.value.valueOf():n[o]=i.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(i){return this.state.resultTable?this.state.resultTable.push(i):this.state.resultTable=[i],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(i){return this.returnNow({key:this.state.resultTable,value:i})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(i){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,i)&&(!isTable(this.ctx[i])||this.ctx[i][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[i]=this.ctx[i]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,i))this.ctx=this.ctx[i]=Table();else if(isTable(this.ctx[i]))this.ctx=this.ctx[i];else if(isList(this.ctx[i]))this.ctx=this.ctx[i][this.ctx[i].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(i){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,i)||(this.ctx[i]=List()),isInlineList(this.ctx[i]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[i])){let n=Table();this.ctx[i].push(n),this.ctx=n}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,i))this.ctx=this.ctx[i]=Table();else{if(isInlineList(this.ctx[i]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[i]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[i]))this.ctx=this.ctx[i][this.ctx[i].length-1];else if(isTable(this.ctx[i]))this.ctx=this.ctx[i];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(i){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(i){return this.returnNow(i)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(i){return this.state.buf+=i,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let i="\\u00";return this.char<16&&(i+="0"),i+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${i} instead`))}recordMultiEscapeReplacement(i){return this.state.buf+=i,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(i){try{let n=parseInt(i,16);if(n>=SURROGATE_FIRST&&n<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(n))}catch(n){throw this.error(TomlError.wrap(n))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(i){if(this.state.resultArr){let n=this.state.resultArr[_contentType],o=tomlType(i);if(n!==o)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${n} and ${o}`))}else this.state.resultArr=InlineList(tomlType(i));return isFloat(i)||isInteger(i)?this.state.resultArr.push(i.valueOf()):this.state.resultArr.push(i),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(i){let n=this.state.resultTable,o=i.key.pop();for(let s of i.key){if(hasKey(n,s)&&(!isTable(n[s])||n[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));n=n[s]=n[s]||Table()}if(hasKey(n,o))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(i.value)||isFloat(i.value)?n[o]=i.value.valueOf():n[o]=i.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var Nn=w((xN,Eh)=>{"use strict";y();Eh.exports=Uv;function Uv(e,t){if(e.pos==null||e.line==null)return e;let r=e.message;if(r+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
|
|
3
3
|
`,t&&t.split){let i=t.split(/\n/),n=String(Math.min(i.length,e.line+3)).length,o=" ";for(;o.length<n;)o+=" ";for(let s=Math.max(0,e.line-1);s<Math.min(i.length,e.line+2);++s){let u=String(s+1);if(u.length<n&&(u=" "+u),e.line===s){r+=u+"> "+i[s]+`
|
|
4
4
|
`,r+=o+" ";for(let l=0;l<e.col;++l)r+=" ";r+=`^
|
|
@@ -170,7 +170,7 @@ See more help with --help`,ey.default.getInstance().get("exitCodes")?.failedFlag
|
|
|
170
170
|
`)),r.enqueue(i.encode(`data: ${l}
|
|
171
171
|
|
|
172
172
|
`))};Si.forEach(n),Qo.addListener("request",n);let o=!1;function s(){o||(o=!0,e.signal.removeEventListener("abort",s),Qo.removeListener("request",n),r.close())}if(e.signal.addEventListener("abort",s),e.signal.aborted)return s()}});return Tn(t,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-store",Connection:"keep-alive"}})}function GI(e){return e.method==="DELETE"?$v():qv(e)}y();var eN="/debug-network-server";function tN(){throw new F("Could not load MiniOxygen.","Please make sure you have `@shopify/mini-oxygen` installed.")}function rN({request:e,response:t,meta:r}){try{let i=new URL(e.url);if(!r.durationMs&&r.startTimeMs&&r.endTimeMs&&(r.durationMs=r.endTimeMs-r.startTimeMs),Zo.has(i.pathname)||i.pathname==="/favicon.ico")return;let n=i.searchParams.has("_data"),o=e.url.replace(i.origin,""),s="",u="render";if(n){u=e.method==="GET"?"loader":"action";let m=i.searchParams.get("_data")?.replace("routes/","");o=i.pathname,s=`[${m}]`}let l=t.status<300?X.green:t.status<400?X.cyan:X.errorText;ht(ie`${e.method.padStart(6)} ${l(String(t.status))} ${X.italic(u.padEnd(7," "))} ${o} ${r.durationMs&&r.durationMs>0?V.dim(` ${r.durationMs}ms`):""}${s?" "+V.dim(s):""}${e.headers.purpose==="prefetch"?V.italic(V.dim(" prefetch")):""}`)}catch{e&&t?.status&&ht(`${e.method} ${t.status} ${e.url}`)}}y();y();y();y();y();y();var Ln=Ct(jh(),1);function $h(e){let t=e.replace(/\r\n$/g,`
|
|
173
|
-
`);return Ln.parse(t)}function qh(e){return Ln.stringify(e)}var ca=Ct(zh()
|
|
173
|
+
`);return Ln.parse(t)}function qh(e){return Ln.stringify(e)}var ca=Ct(zh()),Un=class extends Error{constructor(t,r){super(r),this.name="TomlFileError",this.path=t}},Wn=class e{static async read(t){if(!await $(t))throw new Un(t,`TOML file not found: ${t}`);let r=await U(t),i=new e(t,{});return i.content=i.decode(r),i}constructor(t,r){this.errors=[],this.path=t,this.content=r}async patch(t){let r=Jh(t),i=await U(this.path),n=(0,ca.updateTomlValues)(i,r),o=this.decode(n);await W(this.path,n),this.content=o}async remove(t){let r=t.split("."),i=await U(this.path),n=(0,ca.updateTomlValues)(i,[[r,void 0]]),o=this.decode(n);await W(this.path,n),this.content=o}async replace(t){let r=qh(t);this.decode(r),await W(this.path,r),this.content=t}async transformRaw(t){let r=await U(this.path),i=t(r),n=this.decode(i);await W(this.path,i),this.content=n}decode(t){try{return $h(t)}catch(r){if(r.line!==void 0&&r.col!==void 0){let i=String(r.message).split(`
|
|
174
174
|
`)[0]??"Invalid TOML";throw new Un(this.path,`${i} at row ${r.line}, col ${r.col}`)}throw r}}};function Jh(e,t=[]){let r=[];for(let[i,n]of Object.entries(e)){let o=[...t,i];n!==null&&typeof n=="object"&&!Array.isArray(n)?r.push(...Jh(n,o)):r.push([o,n])}return r}function la(e,t){t||we(e)}async function ha(e,t,r){let i=await fa(t,r);if(!i){la({body:"Environment file not found."},r?.silent);return}let s=(await Wn.read(i)).content.environments;if(!s){la({body:["No environments found in",{command:i},{char:"."}]},r?.silent);return}let u=s[e];if(!u){la({body:["Environment",{command:e},"not found."]},r?.silent);return}return await Ul(()=>({environmentFlags:JSON.stringify(u)})),u}async function fa(e,t){let r=t?.from&&t.from!=="."?t.from:_i();return Dn(e,{cwd:r,type:"file"})}var Jn=Ct(kv()),zn=class extends Jn.Command{static descriptionWithoutMarkdown(){return(this.descriptionWithMarkdown??"").replace(/(\[)(.*?)(])(\()(.*?)(\))/gm,'"$2" ($5)')}static analyticsNameOverride(){}static analyticsStopCommand(){}async catch(t){return t.skipOclifErrorHandling=!0,await $l(t,this.config),Jn.Errors.handle(t)}async init(){return this.exitWithTimestampWhenEnvVariablePresent(),eh(this.id??""),Xl()||await ql(this.config),await _w(this.config),this.showNpmFlagWarning(),await th(),super.init()}showNpmFlagWarning(){let t=this.constructor;Object.keys(t.flags||{}).map(n=>`npm_config_${bl(n).replace(/^no_/,"")}`).some(n=>process.env[n]!==void 0)&&we({body:["NPM scripts require an extra",{command:"--"},"separator to pass the flags. Example:",{command:"npm run dev -- --reset"}]})}exitWithTimestampWhenEnvVariablePresent(){gl(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)&&(Zl(`
|
|
175
175
|
SHOPIFY_CLI_TIMESTAMP_START
|
|
176
176
|
{ "timestamp": ${Date.now()} }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Da as F,a as p,sa as M}from"./chunk-
|
|
1
|
+
import{Da as F,a as p,sa as M}from"./chunk-PRNHS74J.js";import{G as E,N as O,O as T,P as b,T as $,V as v,q as f,s as g,t as L}from"./chunk-LH4VO6EV.js";import{Bd as l,Cb as V,Db as y,Eb as N,Ed as r,Fd as m,Uc as G,Yc as _,ad as H,lb as I,mb as P,nb as R,qb as w,rb as x,uc as j,wd as c,yc as J,yd as u}from"./chunk-KVWHPGOA.js";import{o as A,p as D,q as S}from"./chunk-JBSYWYIP.js";import{g as d}from"./chunk-VPRTJUIN.js";d();d();var W=e=>{let t=M();if(t){let a=e.id.includes("theme");ee(t,a)}};function ee(e,t){let o=`Upgrade to the latest CLI version by ${new Intl.DateTimeFormat("default",{year:"numeric",month:"long",day:"numeric"}).format(e)}.`;j({headline:o,body:"This command requires an upgrade to continue working as intended.",nextSteps:[["Run",{command:"upgrade"},"to",{link:{label:"upgrade Shopify CLI",url:t?"https://shopify.dev/docs/themes/tools/cli#upgrade-shopify-cli":"https://shopify.dev/docs/apps/tools/cli#upgrade-shopify-cli"}}]]})}d();function q(){let e=w();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function B(){let e=S()??D(),t=x(e),a=R();if(H()){l("Skipping upgrade in development mode.");return}if(a){let n=q();if(!n)throw new Error("Could not determine the package manager");let[o,...i]=n.split(" ");if(!o)throw new Error("Could not determine the command to run");l(u`Upgrading Shopify CLI by running: ${c.genericShellCommand(n)}...`),await G(o,i,{stdio:"inherit"})}else if(t)await te(t,p);else throw new Error("Could not determine the local project directory")}function K(){let e=p,t=b("@shopify/cli",e);if(!t){r("Auto-upgrade: No newer version available.");return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")return r("Auto-upgrade: Forcing auto-upgrade because of SHOPIFY_CLI_FORCE_AUTO_UPGRADE."),t;if(!g()){r("Auto-upgrade: Skipping because auto-upgrade is not enabled.");return}if(_()){r("Auto-upgrade: Skipping auto-upgrade in CI.");return}if(I(e)){r("Auto-upgrade: Skipping auto-upgrade for pre-release version.");return}return t}async function z(){if(_()||I(p)||g())return;let e=b("@shopify/cli",p);e&&await f("warn-on-available-upgrade",{days:1},async()=>{m(C(e))})}function C(e,t=!1){let a=q(),n=a?u`💡 Version ${e} available! Run ${c.genericShellCommand(a)}`.value:u`💡 Version ${e} available!`.value;if(t){let o=`https://github.com/Shopify/cli/releases/tag/${e}`,i=u`⚠️ This is a major version — review breaking changes before upgrading:\n ${c.link(o,o)}`.value;return`${n}
|
|
2
2
|
|
|
3
|
-
${i}`}return n}async function Ie(){let e=g();if(e!==void 0)return e;let t=await J({message:"Enable automatic updates for Shopify CLI?",confirmationMessage:"Yes, automatically update",cancellationMessage:"No, I'll update manually"});return L(t),t}async function te(e,t){let a=(await v(e)).content,n=a.dependencies??{},o=a.devDependencies??{},s={...n,...o}[await U()];if(!s){r("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}s.slice(0,1).match(/[\^~]/)&&(s=t);let k=await T(await U(),s);k?oe(s,k):ne(s),await Y("prod",n,e),await Y("dev",o,e)}async function Y(e,t,a){let n=[await U(),...await ae()].filter(i=>!!t[i]).map(i=>({name:i,version:"latest"})),o=await O(a);n.length>0&&await $(n,{packageManager:await E(a),type:e,directory:a,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:o})}async function U(){return(await Q()).name}async function ae(){return(await Q())?.oclif?.plugins??[]}var h;async function Q(){if(!h){let e=await v(A(import.meta.url));h=h??e.content}return h}function ne(e){l(u`You're on the latest version, ${c.yellow(e)}, no need to upgrade!`)}function oe(e,t){l(u`Upgrading CLI from ${c.yellow(e)} to ${c.yellow(t)}...`)}var Z=!1;function xe(){return Z}var Ee=async({config:e,Command:t})=>{await ie(t),await F({config:e,exitMode:"ok"}),W(t);let a=t.id.replace(/:/g," ");r(`Completed command ${a}`),Z=!0,!a.includes("notifications")&&!a.includes("upgrade")&&await re()};async function re(){let e=K();if(!e){await z();return}process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1"?await X(e):await f("auto-upgrade",{days:1},async()=>{await X(e)})}async function X(e){if(P(p,e)){m(C(e,!0)),await y(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}try{await B(),await y(()=>({env_auto_upgrade_success:!0}))}catch(t){let a=`Auto-upgrade failed: ${t}`;r(a),m(C(e)),await y(()=>({env_auto_upgrade_success:!1}));let{sendErrorToBugsnag:n}=await import("./error-handler-
|
|
3
|
+
${i}`}return n}async function Ie(){let e=g();if(e!==void 0)return e;let t=await J({message:"Enable automatic updates for Shopify CLI?",confirmationMessage:"Yes, automatically update",cancellationMessage:"No, I'll update manually"});return L(t),t}async function te(e,t){let a=(await v(e)).content,n=a.dependencies??{},o=a.devDependencies??{},s={...n,...o}[await U()];if(!s){r("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}s.slice(0,1).match(/[\^~]/)&&(s=t);let k=await T(await U(),s);k?oe(s,k):ne(s),await Y("prod",n,e),await Y("dev",o,e)}async function Y(e,t,a){let n=[await U(),...await ae()].filter(i=>!!t[i]).map(i=>({name:i,version:"latest"})),o=await O(a);n.length>0&&await $(n,{packageManager:await E(a),type:e,directory:a,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:o})}async function U(){return(await Q()).name}async function ae(){return(await Q())?.oclif?.plugins??[]}var h;async function Q(){if(!h){let e=await v(A(import.meta.url));h=h??e.content}return h}function ne(e){l(u`You're on the latest version, ${c.yellow(e)}, no need to upgrade!`)}function oe(e,t){l(u`Upgrading CLI from ${c.yellow(e)} to ${c.yellow(t)}...`)}var Z=!1;function xe(){return Z}var Ee=async({config:e,Command:t})=>{await ie(t),await F({config:e,exitMode:"ok"}),W(t);let a=t.id.replace(/:/g," ");r(`Completed command ${a}`),Z=!0,!a.includes("notifications")&&!a.includes("upgrade")&&await re()};async function re(){let e=K();if(!e){await z();return}process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1"?await X(e):await f("auto-upgrade",{days:1},async()=>{await X(e)})}async function X(e){if(P(p,e)){m(C(e,!0)),await y(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}try{await B(),await y(()=>({env_auto_upgrade_success:!0}))}catch(t){let a=`Auto-upgrade failed: ${t}`;r(a),m(C(e)),await y(()=>({env_auto_upgrade_success:!1}));let{sendErrorToBugsnag:n}=await import("./error-handler-CRWXGODM.js"),o=Object.assign(new Error(a),{packageManager:w(),platform:process.platform,cliVersion:p});await n(o,"expected_error")}}async function ie(e){let t=new Date().getTime();if(e&&Object.prototype.hasOwnProperty.call(e,"analyticsStopCommand")){let a=e.analyticsStopCommand();if(a){let{commandStartOptions:n}=V();if(!n)return;await N(()=>({commandStartOptions:{...n,startTime:t,startCommand:a}}))}}}export{B as a,Ie as b,xe as c,Ee as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Na as a,Oa as b,Pa as c,Qa as d,Ra as e}from"./chunk-
|
|
1
|
+
import{Na as a,Oa as b,Pa as c,Qa as d,Ra as e}from"./chunk-PRNHS74J.js";import"./chunk-PRKBO42R.js";import"./chunk-LH4VO6EV.js";import"./chunk-KVWHPGOA.js";import"./chunk-SVA22NZQ.js";import"./chunk-FU2Y2M3M.js";import"./chunk-QYR5VPQA.js";import"./chunk-EENHXSWU.js";import"./chunk-JBSYWYIP.js";import"./chunk-T4M5CWAO.js";import"./chunk-PRVQAHWI.js";import"./chunk-QUTQDXSL.js";import"./chunk-VPRTJUIN.js";export{e as addBugsnagMetadata,c as cleanStackFrameFilePath,a as errorHandler,d as registerCleanBugsnagErrorsFromWithinPlugins,b as sendErrorToBugsnag};
|
package/dist/hooks/postrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a}from"../chunk-
|
|
1
|
+
import{d as a}from"../chunk-YPE4BWWD.js";import"../chunk-PRNHS74J.js";import"../chunk-PRKBO42R.js";import"../chunk-LH4VO6EV.js";import"../chunk-KVWHPGOA.js";import"../chunk-SVA22NZQ.js";import"../chunk-FU2Y2M3M.js";import"../chunk-QYR5VPQA.js";import"../chunk-EENHXSWU.js";import"../chunk-JBSYWYIP.js";import"../chunk-T4M5CWAO.js";import"../chunk-PRVQAHWI.js";import"../chunk-QUTQDXSL.js";import{g as o}from"../chunk-VPRTJUIN.js";o();export{a as default};
|
package/dist/hooks/prerun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"../chunk-
|
|
1
|
+
import{e as c}from"../chunk-2E6Y4J4T.js";import{Ca as s,a}from"../chunk-PRNHS74J.js";import"../chunk-PRKBO42R.js";import{O as i}from"../chunk-LH4VO6EV.js";import{Ed as m,lb as t}from"../chunk-KVWHPGOA.js";import"../chunk-SVA22NZQ.js";import"../chunk-FU2Y2M3M.js";import"../chunk-QYR5VPQA.js";import"../chunk-EENHXSWU.js";import"../chunk-JBSYWYIP.js";import"../chunk-T4M5CWAO.js";import"../chunk-PRVQAHWI.js";import"../chunk-QUTQDXSL.js";import{g as e}from"../chunk-VPRTJUIN.js";e();e();var d=async n=>{let r=f({id:n.Command.id,aliases:n.Command.aliases,pluginAlias:n.Command.plugin?.alias}),o=n.argv;h(),m(`Running command ${r.command}`),await s({commandContent:r,args:o,commandClass:n.Command}),c(n.Command.id)};function f(n){let r=p(n.pluginAlias);return r??(r=l(n.id,n.aliases)),r}function l(n,r){return{command:n.replace(/:/g," "),topic:C(n),alias:g(r)}}function p(n){if(n?.startsWith("@shopify/create-"))return{command:n.substring(n.indexOf("/")+1)}}function C(n){if(n.lastIndexOf(":")!==-1)return n.slice(0,n.lastIndexOf(":")).replace(/:/g," ")}function g(n){let r=n.find(o=>o.split(":").every(u=>process.argv.includes(u)));if(r)return r.replace(/:/g," ")}function h(){let n=a;t(n)||i("@shopify/cli",n,{cacheExpiryInHours:24})}export{d as default};
|