@spree/cli 3.0.1 → 3.0.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.
Files changed (27) hide show
  1. package/dist/index.js +126 -126
  2. package/dist/templates/dashboard-starter/AGENTS.md +71 -0
  3. package/dist/templates/dashboard-starter/README.md +112 -1
  4. package/dist/templates/dashboard-starter/package.json +10 -3
  5. package/dist/templates/dashboard-starter/playwright.config.ts +37 -0
  6. package/dist/templates/dashboard-starter/src/hooks/.gitkeep +0 -0
  7. package/dist/templates/dashboard-starter/src/locales/en.json +3 -0
  8. package/dist/templates/dashboard-starter/src/pages/.gitkeep +0 -0
  9. package/dist/templates/dashboard-starter/src/plugins.ts +16 -6
  10. package/dist/templates/dashboard-starter/src/schemas/.gitkeep +0 -0
  11. package/dist/templates/dashboard-starter/src/slots/.gitkeep +0 -0
  12. package/dist/templates/dashboard-starter/src/tables/.gitkeep +0 -0
  13. package/dist/templates/dashboard-starter/tsconfig.json +1 -0
  14. package/dist/templates/dashboard-starter/vitest.config.ts +14 -0
  15. package/dist/templates/seller-dashboard-starter/AGENTS.md +75 -0
  16. package/dist/templates/seller-dashboard-starter/package.json +9 -2
  17. package/dist/templates/seller-dashboard-starter/playwright.config.ts +37 -0
  18. package/dist/templates/seller-dashboard-starter/src/hooks/.gitkeep +0 -0
  19. package/dist/templates/seller-dashboard-starter/src/locales/en.json +3 -0
  20. package/dist/templates/seller-dashboard-starter/src/pages/.gitkeep +0 -0
  21. package/dist/templates/seller-dashboard-starter/src/plugins.ts +7 -3
  22. package/dist/templates/seller-dashboard-starter/src/schemas/.gitkeep +0 -0
  23. package/dist/templates/seller-dashboard-starter/src/slots/.gitkeep +0 -0
  24. package/dist/templates/seller-dashboard-starter/src/tables/.gitkeep +0 -0
  25. package/dist/templates/seller-dashboard-starter/tsconfig.json +1 -0
  26. package/dist/templates/seller-dashboard-starter/vitest.config.ts +14 -0
  27. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,48 +1,48 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
- var sy=Object.create;var So=Object.defineProperty;var ay=Object.getOwnPropertyDescriptor;var oy=Object.getOwnPropertyNames;var py=Object.getPrototypeOf,cy=Object.prototype.hasOwnProperty;var ge=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var dy=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of oy(t))!cy.call(e,n)&&n!==r&&So(e,n,{get:()=>t[n],enumerable:!(i=ay(t,n))||i.enumerable});return e};var D=(e,t,r)=>(r=e!=null?sy(py(e)):{},dy(t||!e||!e.__esModule?So(r,"default",{value:e,enumerable:!0}):r,e));var or=E(Mn=>{"use strict";var Wr=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},zn=class extends Wr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Mn.CommanderError=Wr;Mn.InvalidArgumentError=zn});var Kr=E(Gn=>{"use strict";var{InvalidArgumentError:uy}=or(),Fn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new uy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ly(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Gn.Argument=Fn;Gn.humanReadableArgName=ly});var Hn=E(Nn=>{"use strict";var{humanReadableArgName:my}=Kr(),Un=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>my(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[])}),r.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[]),n.get(a).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(u,l){return r.formatItem(u,i,l,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],o=r.commandDescription(t);o.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(o),n),""]));let p=r.visibleArguments(t).map(u=>s(r.styleArgumentTerm(r.argumentTerm(u)),r.styleArgumentDescription(r.argumentDescription(u))));if(a=a.concat(this.formatItemList("Arguments:",p,r)),this.groupItems(t.options,r.visibleOptions(t),u=>u.helpGroupHeading??"Options:").forEach((u,l)=>{let m=u.map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList(l,m,r))}),r.showGlobalOptions){let u=r.visibleGlobalOptions(t).map(l=>s(r.styleOptionTerm(r.optionTerm(l)),r.styleOptionDescription(r.optionDescription(l))));a=a.concat(this.formatItemList("Global Options:",u,r))}return this.groupItems(t.commands,r.visibleCommands(t),u=>u.helpGroup()||"Commands:").forEach((u,l)=>{let m=u.map(h=>s(r.styleSubcommandTerm(r.subcommandTerm(h)),r.styleSubcommandDescription(r.subcommandDescription(h))));a=a.concat(this.formatItemList(l,m,r))}),a.join(`
5
- `)}displayWidth(t){return $o(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,i,n){let a=" ".repeat(2);if(!i)return a+t;let o=t.padEnd(r+t.length-n.displayWidth(t)),p=2,c=(this.helpWidth??80)-r-p-2,u;return c<this.minWidthToWrap||n.preformatted(i)?u=i:u=n.boxWrap(i,c).replace(/\n/g,`
4
+ var ay=Object.create;var $o=Object.defineProperty;var oy=Object.getOwnPropertyDescriptor;var py=Object.getOwnPropertyNames;var cy=Object.getPrototypeOf,dy=Object.prototype.hasOwnProperty;var ge=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var uy=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of py(t))!dy.call(e,n)&&n!==r&&$o(e,n,{get:()=>t[n],enumerable:!(i=oy(t,n))||i.enumerable});return e};var D=(e,t,r)=>(r=e!=null?ay(cy(e)):{},uy(t||!e||!e.__esModule?$o(r,"default",{value:e,enumerable:!0}):r,e));var or=E(Mn=>{"use strict";var Wr=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},zn=class extends Wr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Mn.CommanderError=Wr;Mn.InvalidArgumentError=zn});var Kr=E(Gn=>{"use strict";var{InvalidArgumentError:ly}=or(),Fn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ly(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function my(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Gn.Argument=Fn;Gn.humanReadableArgName=my});var Hn=E(Nn=>{"use strict";var{humanReadableArgName:hy}=Kr(),Un=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>hy(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[])}),r.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[]),n.get(a).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(u,l){return r.formatItem(u,i,l,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],o=r.commandDescription(t);o.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(o),n),""]));let p=r.visibleArguments(t).map(u=>s(r.styleArgumentTerm(r.argumentTerm(u)),r.styleArgumentDescription(r.argumentDescription(u))));if(a=a.concat(this.formatItemList("Arguments:",p,r)),this.groupItems(t.options,r.visibleOptions(t),u=>u.helpGroupHeading??"Options:").forEach((u,l)=>{let m=u.map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList(l,m,r))}),r.showGlobalOptions){let u=r.visibleGlobalOptions(t).map(l=>s(r.styleOptionTerm(r.optionTerm(l)),r.styleOptionDescription(r.optionDescription(l))));a=a.concat(this.formatItemList("Global Options:",u,r))}return this.groupItems(t.commands,r.visibleCommands(t),u=>u.helpGroup()||"Commands:").forEach((u,l)=>{let m=u.map(h=>s(r.styleSubcommandTerm(r.subcommandTerm(h)),r.styleSubcommandDescription(r.subcommandDescription(h))));a=a.concat(this.formatItemList(l,m,r))}),a.join(`
5
+ `)}displayWidth(t){return Ao(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,i,n){let a=" ".repeat(2);if(!i)return a+t;let o=t.padEnd(r+t.length-n.displayWidth(t)),p=2,c=(this.helpWidth??80)-r-p-2,u;return c<this.minWidthToWrap||n.preformatted(i)?u=i:u=n.boxWrap(i,c).replace(/\n/g,`
6
6
  `+" ".repeat(r+p)),a+o+" ".repeat(p)+u.replace(/\n/g,`
7
7
  ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(a=>{let o=a.match(n);if(o===null){s.push("");return}let p=[o.shift()],d=this.displayWidth(p[0]);o.forEach(c=>{let u=this.displayWidth(c);if(d+u<=r){p.push(c),d+=u;return}s.push(p.join(""));let l=c.trimStart();p=[l],d=this.displayWidth(l)}),s.push(p.join(""))}),s.join(`
8
- `)}};function $o(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Nn.Help=Un;Nn.stripColor=$o});var Yn=E(Kn=>{"use strict";var{InvalidArgumentError:hy}=or(),Vn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=yy(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new hy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ao(this.name().replace(/^no-/,"")):Ao(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Wn=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return r.negate===(s===t)}};function Ao(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function yy(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(r=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let a=s[0],o=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${o}
8
+ `)}};function Ao(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Nn.Help=Un;Nn.stripColor=Ao});var Yn=E(Kn=>{"use strict";var{InvalidArgumentError:yy}=or(),Vn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=gy(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new yy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Eo(this.name().replace(/^no-/,"")):Eo(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Wn=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return r.negate===(s===t)}};function Eo(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function gy(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(r=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let a=s[0],o=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${o}
9
9
  - a short flag is a single dash and a single character
10
10
  - either use a single dash and a single character (for a short flag)
11
11
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(a)?new Error(`${o}
12
12
  - too many short flags`):n.test(a)?new Error(`${o}
13
13
  - too many long flags`):new Error(`${o}
14
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Kn.Option=Vn;Kn.DualOptions=Wn});var Po=E(Eo=>{"use strict";function gy(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=t.length;i++)r[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=e.length;n++){let s=1;e[n-1]===t[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[e.length][t.length]}function fy(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let i=[],n=3,s=.4;return t.forEach(a=>{if(a.length<=1)return;let o=gy(e,a),p=Math.max(e.length,a.length);(p-o)/p>s&&(o<n?(n=o,i=[a]):o===n&&i.push(a))}),i.sort((a,o)=>a.localeCompare(o)),r&&(i=i.map(a=>`--${a}`)),i.length>1?`
14
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Kn.Option=Vn;Kn.DualOptions=Wn});var jo=E(Po=>{"use strict";function fy(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=t.length;i++)r[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=e.length;n++){let s=1;e[n-1]===t[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[e.length][t.length]}function _y(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let i=[],n=3,s=.4;return t.forEach(a=>{if(a.length<=1)return;let o=fy(e,a),p=Math.max(e.length,a.length);(p-o)/p>s&&(o<n?(n=o,i=[a]):o===n&&i.push(a))}),i.sort((a,o)=>a.localeCompare(o)),r&&(i=i.map(a=>`--${a}`)),i.length>1?`
15
15
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
16
- (Did you mean ${i[0]}?)`:""}Eo.suggestSimilar=fy});var Ro=E(es=>{"use strict";var _y=ge("events").EventEmitter,Jn=ge("child_process"),Ye=ge("path"),Yr=ge("fs"),R=ge("process"),{Argument:by,humanReadableArgName:qy}=Kr(),{CommanderError:Xn}=or(),{Help:ky,stripColor:vy}=Hn(),{Option:jo,DualOptions:wy}=Yn(),{suggestSimilar:Co}=Po(),Zn=class e extends _y{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>R.stdout.write(r),writeErr:r=>R.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>R.stdout.isTTY?R.stdout.columns:void 0,getErrHelpWidth:()=>R.stderr.isTTY?R.stderr.columns:void 0,getOutHasColors:()=>Qn()??(R.stdout.isTTY&&R.stdout.hasColors?.()),getErrHasColors:()=>Qn()??(R.stderr.isTTY&&R.stderr.hasColors?.()),stripColor:r=>vy(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,a,o]=t.match(/([^ ]+) *(.*)/),p=this.createCommand(a);return n&&(p.description(n),p._executableHandler=!0),s.isDefault&&(this._defaultCommandName=p._name),p._hidden=!!(s.noHelp||s.hidden),p._executableFile=s.executableFile||null,o&&p.arguments(o),this._registerCommand(p),p.parent=this,p.copyInheritedSettings(this),n?this:p}createCommand(t){return new e(t)}createHelp(){return Object.assign(new ky,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
17
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new by(t,r)}argument(t,r,i,n){let s=this.createArgument(t,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,n,s]=i.match(/([^ ]+) *(.*)/),a=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),a&&o.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=o,(t||r)&&this._initCommandGroup(o),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
18
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,i){this._exitCallback&&this._exitCallback(new Xn(t,r,i)),R.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new jo(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let a=`${n} ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
19
- - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),i=r(t).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),i=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,a,o)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let p=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,p,a):s!==null&&t.variadic&&(s=t._collectValue(s,p)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,o)};return this.on("option:"+r,s=>{let a=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let a=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,a,"env")}),this}_optionEx(t,r,i,n,s){if(typeof r=="object"&&r instanceof jo)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,i);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(s).argParser(n);else if(n instanceof RegExp){let o=n;n=(p,d)=>{let c=o.exec(p);return c?c[0]:d},a.default(s).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,i,n){return this._optionEx({},t,r,i,n)}requiredOption(t,r,i,n){return this._optionEx({mandatory:!0},t,r,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,i){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(r=i.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){R.versions?.electron&&(r.from="electron");let n=R.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=R.argv),this.rawArgs=t.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":R.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return this._parseCommand([],i),this}async parseAsync(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
16
+ (Did you mean ${i[0]}?)`:""}Po.suggestSimilar=_y});var Io=E(es=>{"use strict";var by=ge("events").EventEmitter,Jn=ge("child_process"),Ye=ge("path"),Yr=ge("fs"),R=ge("process"),{Argument:qy,humanReadableArgName:ky}=Kr(),{CommanderError:Xn}=or(),{Help:vy,stripColor:wy}=Hn(),{Option:Co,DualOptions:xy}=Yn(),{suggestSimilar:To}=jo(),Zn=class e extends by{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>R.stdout.write(r),writeErr:r=>R.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>R.stdout.isTTY?R.stdout.columns:void 0,getErrHelpWidth:()=>R.stderr.isTTY?R.stderr.columns:void 0,getOutHasColors:()=>Qn()??(R.stdout.isTTY&&R.stdout.hasColors?.()),getErrHasColors:()=>Qn()??(R.stderr.isTTY&&R.stderr.hasColors?.()),stripColor:r=>wy(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,a,o]=t.match(/([^ ]+) *(.*)/),p=this.createCommand(a);return n&&(p.description(n),p._executableHandler=!0),s.isDefault&&(this._defaultCommandName=p._name),p._hidden=!!(s.noHelp||s.hidden),p._executableFile=s.executableFile||null,o&&p.arguments(o),this._registerCommand(p),p.parent=this,p.copyInheritedSettings(this),n?this:p}createCommand(t){return new e(t)}createHelp(){return Object.assign(new vy,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
17
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new qy(t,r)}argument(t,r,i,n){let s=this.createArgument(t,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,n,s]=i.match(/([^ ]+) *(.*)/),a=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),a&&o.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=o,(t||r)&&this._initCommandGroup(o),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
18
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,i){this._exitCallback&&this._exitCallback(new Xn(t,r,i)),R.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new Co(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let a=`${n} ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
19
+ - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),i=r(t).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),i=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,a,o)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let p=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,p,a):s!==null&&t.variadic&&(s=t._collectValue(s,p)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,o)};return this.on("option:"+r,s=>{let a=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let a=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,a,"env")}),this}_optionEx(t,r,i,n,s){if(typeof r=="object"&&r instanceof Co)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,i);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(s).argParser(n);else if(n instanceof RegExp){let o=n;n=(p,d)=>{let c=o.exec(p);return c?c[0]:d},a.default(s).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,i,n){return this._optionEx({},t,r,i,n)}requiredOption(t,r,i,n){return this._optionEx({mandatory:!0},t,r,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,i){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(r=i.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){R.versions?.electron&&(r.from="electron");let n=R.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=R.argv),this.rawArgs=t.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":R.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return this._parseCommand([],i),this}async parseAsync(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
20
20
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,i){if(Yr.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
21
21
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
22
22
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
23
- - ${n}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(c,u){let l=Ye.resolve(c,u);if(Yr.existsSync(l))return l;if(n.includes(Ye.extname(u)))return;let m=n.find(h=>Yr.existsSync(`${l}${h}`));if(m)return`${l}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=t._executableFile||`${this._name}-${t._name}`,o=this._executableDir||"";if(this._scriptPath){let c;try{c=Yr.realpathSync(this._scriptPath)}catch{c=this._scriptPath}o=Ye.resolve(Ye.dirname(c),o)}if(o){let c=s(o,a);if(!c&&!t._executableFile&&this._scriptPath){let u=Ye.basename(this._scriptPath,Ye.extname(this._scriptPath));u!==this._name&&(c=s(o,`${u}-${t._name}`))}a=c||a}i=n.includes(Ye.extname(a));let p;R.platform!=="win32"?i?(r.unshift(a),r=To(R.execArgv).concat(r),p=Jn.spawn(R.argv[0],r,{stdio:"inherit"})):p=Jn.spawn(a,r,{stdio:"inherit"}):(this._checkForMissingExecutable(a,o,t._name),r.unshift(a),r=To(R.execArgv).concat(r),p=Jn.spawn(R.execPath,r,{stdio:"inherit"})),p.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{R.on(u,()=>{p.killed===!1&&p.exitCode===null&&p.kill(u)})});let d=this._exitCallback;p.on("close",c=>{c=c??1,d?d(new Xn(c,"commander.executeSubCommandAsync","(close)")):R.exit(c)}),p.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(a,o,t._name);else if(c.code==="EACCES")throw new Error(`'${a}' not executable`);if(!d)R.exit(1);else{let u=new Xn(1,"commander.executeSubCommandAsync","(error)");u.nestedError=c,d(u)}}),this.runningCommand=p}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,s)=>{let a=n;if(n!==null&&i.parseArg){let o=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;a=this._callParseArg(i,n,s,o)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((a,o)=>t(i,o,a),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),r[n]=s}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:s,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,r))}),n}_parseCommand(t,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),r=i.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(s,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function s(c){return c.length>1&&c[0]==="-"}let a=c=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c)?!this._getCommandAndAncestors().some(u=>u.options.map(l=>l.short).some(l=>/^-\d$/.test(l))):!1,o=null,p=null,d=0;for(;d<t.length||p;){let c=p??t[d++];if(p=null,c==="--"){n===i&&n.push(c),n.push(...t.slice(d));break}if(o&&(!s(c)||a(c))){this.emit(`option:${o.name()}`,c);continue}if(o=null,s(c)){let u=this._findOption(c);if(u){if(u.required){let l=t[d++];l===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,l)}else if(u.optional){let l=null;d<t.length&&(!s(t[d])||a(t[d]))&&(l=t[d++]),this.emit(`option:${u.name()}`,l)}else this.emit(`option:${u.name()}`);o=u.variadic?u:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let u=this._findOption(`-${c[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,c.slice(2)):(this.emit(`option:${u.name()}`),p=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let u=c.indexOf("="),l=this._findOption(c.slice(0,u));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,c.slice(u+1));continue}}if(n===r&&s(c)&&!(this.commands.length===0&&a(c))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(c)){r.push(c),i.push(...t.slice(d));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c,...t.slice(d));break}else if(this._defaultCommandName){i.push(c,...t.slice(d));break}}if(this._passThroughOptions){n.push(c,...t.slice(d));break}n.push(c)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
23
+ - ${n}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(c,u){let l=Ye.resolve(c,u);if(Yr.existsSync(l))return l;if(n.includes(Ye.extname(u)))return;let m=n.find(h=>Yr.existsSync(`${l}${h}`));if(m)return`${l}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=t._executableFile||`${this._name}-${t._name}`,o=this._executableDir||"";if(this._scriptPath){let c;try{c=Yr.realpathSync(this._scriptPath)}catch{c=this._scriptPath}o=Ye.resolve(Ye.dirname(c),o)}if(o){let c=s(o,a);if(!c&&!t._executableFile&&this._scriptPath){let u=Ye.basename(this._scriptPath,Ye.extname(this._scriptPath));u!==this._name&&(c=s(o,`${u}-${t._name}`))}a=c||a}i=n.includes(Ye.extname(a));let p;R.platform!=="win32"?i?(r.unshift(a),r=Ro(R.execArgv).concat(r),p=Jn.spawn(R.argv[0],r,{stdio:"inherit"})):p=Jn.spawn(a,r,{stdio:"inherit"}):(this._checkForMissingExecutable(a,o,t._name),r.unshift(a),r=Ro(R.execArgv).concat(r),p=Jn.spawn(R.execPath,r,{stdio:"inherit"})),p.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{R.on(u,()=>{p.killed===!1&&p.exitCode===null&&p.kill(u)})});let d=this._exitCallback;p.on("close",c=>{c=c??1,d?d(new Xn(c,"commander.executeSubCommandAsync","(close)")):R.exit(c)}),p.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(a,o,t._name);else if(c.code==="EACCES")throw new Error(`'${a}' not executable`);if(!d)R.exit(1);else{let u=new Xn(1,"commander.executeSubCommandAsync","(error)");u.nestedError=c,d(u)}}),this.runningCommand=p}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,s)=>{let a=n;if(n!==null&&i.parseArg){let o=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;a=this._callParseArg(i,n,s,o)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((a,o)=>t(i,o,a),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),r[n]=s}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:s,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,r))}),n}_parseCommand(t,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),r=i.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(s,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function s(c){return c.length>1&&c[0]==="-"}let a=c=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c)?!this._getCommandAndAncestors().some(u=>u.options.map(l=>l.short).some(l=>/^-\d$/.test(l))):!1,o=null,p=null,d=0;for(;d<t.length||p;){let c=p??t[d++];if(p=null,c==="--"){n===i&&n.push(c),n.push(...t.slice(d));break}if(o&&(!s(c)||a(c))){this.emit(`option:${o.name()}`,c);continue}if(o=null,s(c)){let u=this._findOption(c);if(u){if(u.required){let l=t[d++];l===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,l)}else if(u.optional){let l=null;d<t.length&&(!s(t[d])||a(t[d]))&&(l=t[d++]),this.emit(`option:${u.name()}`,l)}else this.emit(`option:${u.name()}`);o=u.variadic?u:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let u=this._findOption(`-${c[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,c.slice(2)):(this.emit(`option:${u.name()}`),p=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let u=c.indexOf("="),l=this._findOption(c.slice(0,u));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,c.slice(u+1));continue}}if(n===r&&s(c)&&!(this.commands.length===0&&a(c))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(c)){r.push(c),i.push(...t.slice(d));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c,...t.slice(d));break}else if(this._defaultCommandName){i.push(c,...t.slice(d));break}}if(this._passThroughOptions){n.push(c,...t.slice(d));break}n.push(c)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
24
24
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
25
25
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
26
- `),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in R.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,R.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new wy(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=a=>{let o=a.attributeName(),p=this.getOptionValue(o),d=this.options.find(u=>u.negate&&o===u.attributeName()),c=this.options.find(u=>!u.negate&&o===u.attributeName());return d&&(d.presetArg===void 0&&p===!1||d.presetArg!==void 0&&p===d.presetArg)?d:c||a},n=a=>{let o=i(a),p=o.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},s=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(o=>o.long).map(o=>o.long);n=n.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);r=Co(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),r=Co(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
27
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>qy(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Ye.basename(t,Ye.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,s;return r?(i=o=>this._outputConfiguration.writeErr(o),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=o=>this._outputConfiguration.writeOut(o),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:o=>(n||(o=this._outputConfiguration.stripColor(o)),i(o)),hasColors:n,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(R.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ `),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in R.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,R.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new xy(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=a=>{let o=a.attributeName(),p=this.getOptionValue(o),d=this.options.find(u=>u.negate&&o===u.attributeName()),c=this.options.find(u=>!u.negate&&o===u.attributeName());return d&&(d.presetArg===void 0&&p===!1||d.presetArg!==void 0&&p===d.presetArg)?d:c||a},n=a=>{let o=i(a),p=o.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},s=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(o=>o.long).map(o=>o.long);n=n.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);r=To(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),r=To(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
27
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>ky(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Ye.basename(t,Ye.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,s;return r?(i=o=>this._outputConfiguration.writeErr(o),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=o=>this._outputConfiguration.writeOut(o),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:o=>(n||(o=this._outputConfiguration.stripColor(o)),i(o)),hasColors:n,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(R.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
28
28
  Expecting one of '${i.join("', '")}'`);let n=`${t}Help`;return this.on(n,s=>{let a;typeof r=="function"?a=r({error:s.error,command:s.command}):a=r,a&&s.write(`${a}
29
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function To(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function Qn(){if(R.env.NO_COLOR||R.env.FORCE_COLOR==="0"||R.env.FORCE_COLOR==="false")return!1;if(R.env.FORCE_COLOR||R.env.CLICOLOR_FORCE!==void 0)return!0}es.Command=Zn;es.useColor=Qn});var Lo=E(ke=>{"use strict";var{Argument:Io}=Kr(),{Command:ts}=Ro(),{CommanderError:xy,InvalidArgumentError:Oo}=or(),{Help:Sy}=Hn(),{Option:Do}=Yn();ke.program=new ts;ke.createCommand=e=>new ts(e);ke.createOption=(e,t)=>new Do(e,t);ke.createArgument=(e,t)=>new Io(e,t);ke.Command=ts;ke.Option=Do;ke.Argument=Io;ke.Help=Sy;ke.CommanderError=xy;ke.InvalidArgumentError=Oo;ke.InvalidOptionArgumentError=Oo});var K=E((TS,rs)=>{"use strict";var Xr=process||{},Fo=Xr.argv||[],Jr=Xr.env||{},$y=!(Jr.NO_COLOR||Fo.includes("--no-color"))&&(!!Jr.FORCE_COLOR||Fo.includes("--color")||Xr.platform==="win32"||(Xr.stdout||{}).isTTY&&Jr.TERM!=="dumb"||!!Jr.CI),Ay=(e,t,r=e)=>i=>{let n=""+i,s=n.indexOf(t,e.length);return~s?e+Ey(n,t,r,s)+t:e+n+t},Ey=(e,t,r,i)=>{let n="",s=0;do n+=e.substring(s,i)+r,s=i+t.length,i=e.indexOf(t,s);while(~i);return n+e.substring(s)},Go=(e=$y)=>{let t=e?Ay:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};rs.exports=Go();rs.exports.createColors=Go});var os=E((MS,ip)=>{"use strict";var as={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Gy={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},Uy={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?as.up():"");return e&&(t+=as.left),t}};ip.exports={cursor:as,scroll:Gy,erase:Uy,beep:"\x07"}});var Fp=E((sE,Mp)=>{"use strict";Mp.exports=zp;zp.sync=yf;var Lp=ge("fs");function hf(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Bp(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:hf(t,r)}function zp(e,t,r){Lp.stat(e,function(i,n){r(i,i?!1:Bp(n,e,t))})}function yf(e,t){return Bp(Lp.statSync(e),e,t)}});var Vp=E((aE,Hp)=>{"use strict";Hp.exports=Up;Up.sync=gf;var Gp=ge("fs");function Up(e,t,r){Gp.stat(e,function(i,n){r(i,i?!1:Np(n,t))})}function gf(e,t){return Np(Gp.statSync(e),t)}function Np(e,t){return e.isFile()&&ff(e,t)}function ff(e,t){var r=e.mode,i=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),p=parseInt("010",8),d=parseInt("001",8),c=o|p,u=r&d||r&p&&n===a||r&o&&i===s||r&c&&s===0;return u}});var Kp=E((pE,Wp)=>{"use strict";var oE=ge("fs"),Si;process.platform==="win32"||global.TESTING_WINDOWS?Si=Fp():Si=Vp();Wp.exports=Ss;Ss.sync=_f;function Ss(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Ss(e,t||{},function(s,a){s?n(s):i(a)})})}Si(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function _f(e,t){try{return Si.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var tc=E((cE,ec)=>{"use strict";var Ot=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Yp=ge("path"),bf=Ot?";":":",Jp=Kp(),Xp=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Zp=(e,t)=>{let r=t.colon||bf,i=e.match(/\//)||Ot&&e.match(/\\/)?[""]:[...Ot?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=Ot?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ot?n.split(r):[""];return Ot&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},Qp=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:s}=Zp(e,t),a=[],o=d=>new Promise((c,u)=>{if(d===i.length)return t.all&&a.length?c(a):u(Xp(e));let l=i[d],m=/^".*"$/.test(l)?l.slice(1,-1):l,h=Yp.join(m,e),f=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(p(f,d,0))}),p=(d,c,u)=>new Promise((l,m)=>{if(u===n.length)return l(o(c+1));let h=n[u];Jp(d+h,{pathExt:s},(f,w)=>{if(!f&&w)if(t.all)a.push(d+h);else return l(d+h);return l(p(d,c,u+1))})});return r?o(0).then(d=>r(null,d),r):o(0)},qf=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=Zp(e,t),s=[];for(let a=0;a<r.length;a++){let o=r[a],p=/^".*"$/.test(o)?o.slice(1,-1):o,d=Yp.join(p,e),c=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let u=0;u<i.length;u++){let l=c+i[u];try{if(Jp.sync(l,{pathExt:n}))if(t.all)s.push(l);else return l}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Xp(e)};ec.exports=Qp;Qp.sync=qf});var ic=E((dE,$s)=>{"use strict";var rc=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};$s.exports=rc;$s.exports.default=rc});var oc=E((uE,ac)=>{"use strict";var nc=ge("path"),kf=tc(),vf=ic();function sc(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let a;try{a=kf.sync(e.command,{path:r[vf({env:r})],pathExt:t?nc.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return a&&(a=nc.resolve(n?e.options.cwd:"",a)),a}function wf(e){return sc(e)||sc(e,!0)}ac.exports=wf});var pc=E((lE,Es)=>{"use strict";var As=/([()\][%!^"`<>&|;, *?])/g;function xf(e){return e=e.replace(As,"^$1"),e}function Sf(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(As,"^$1"),t&&(e=e.replace(As,"^$1")),e}Es.exports.command=xf;Es.exports.argument=Sf});var dc=E((mE,cc)=>{"use strict";cc.exports=/^#!(.*)/});var lc=E((hE,uc)=>{"use strict";var $f=dc();uc.exports=(e="")=>{let t=e.match($f);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var hc=E((yE,mc)=>{"use strict";var Ps=ge("fs"),Af=lc();function Ef(e){let r=Buffer.alloc(150),i;try{i=Ps.openSync(e,"r"),Ps.readSync(i,r,0,150,0),Ps.closeSync(i)}catch{}return Af(r.toString())}mc.exports=Ef});var _c=E((gE,fc)=>{"use strict";var Pf=ge("path"),yc=oc(),gc=pc(),jf=hc(),Cf=process.platform==="win32",Tf=/\.(?:com|exe)$/i,Rf=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function If(e){e.file=yc(e);let t=e.file&&jf(e.file);return t?(e.args.unshift(e.file),e.command=t,yc(e)):e.file}function Of(e){if(!Cf)return e;let t=If(e),r=!Tf.test(t);if(e.options.forceShell||r){let i=Rf.test(t);e.command=Pf.normalize(e.command),e.command=gc.command(e.command),e.args=e.args.map(s=>gc.argument(s,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Df(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:Of(i)}fc.exports=Df});var kc=E((fE,qc)=>{"use strict";var js=process.platform==="win32";function Cs(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Lf(e,t){if(!js)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let s=bc(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function bc(e,t){return js&&e===1&&!t.file?Cs(t.original,"spawn"):null}function Bf(e,t){return js&&e===1&&!t.file?Cs(t.original,"spawnSync"):null}qc.exports={hookChildProcess:Lf,verifyENOENT:bc,verifyENOENTSync:Bf,notFoundError:Cs}});var xc=E((_E,Dt)=>{"use strict";var vc=ge("child_process"),Ts=_c(),Rs=kc();function wc(e,t,r){let i=Ts(e,t,r),n=vc.spawn(i.command,i.args,i.options);return Rs.hookChildProcess(n,i),n}function zf(e,t,r){let i=Ts(e,t,r),n=vc.spawnSync(i.command,i.args,i.options);return n.error=n.error||Rs.verifyENOENTSync(n.status,i),n}Dt.exports=wc;Dt.exports.spawn=wc;Dt.exports.sync=zf;Dt.exports._parse=Ts;Dt.exports._enoent=Rs});var to=E(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_COLOR_MAP=void 0;Xt.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var eo=class{constructor(t=Xt.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,r){let i=this.colorMap[t];this.text+=i!==void 0?`${i}${r}${this.colorMap.reset}`:r}renderConsole(){return this.text}};Xt.default=eo});var Cr=E(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.DEFAULT_HEADER_ALIGNMENT=Q.DEFAULT_ROW_ALIGNMENT=Q.DEFAULT_HEADER_FONT_COLOR=Q.DEFAULT_ROW_FONT_COLOR=Q.COLORS=Q.ALIGNMENTS=Q.DEFAULT_TABLE_STYLE=Q.DEFAULT_ROW_SEPARATOR=Q.DEFAULT_COLUMN_LEN=void 0;Q.DEFAULT_COLUMN_LEN=20;Q.DEFAULT_ROW_SEPARATOR=!1;Q.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};Q.ALIGNMENTS=["right","left","center"];Q.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];Q.DEFAULT_ROW_FONT_COLOR="white";Q.DEFAULT_HEADER_FONT_COLOR="white_bold";Q.DEFAULT_ROW_ALIGNMENT="right";Q.DEFAULT_HEADER_ALIGNMENT="center"});var jm=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});var ax=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];ro.default=ax});var Cm=E(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});var ox=(e,t,r)=>{let i=0,n,s=r;if(e<t[0].first||e>t[s].last)return 0;for(;s>=i;)if(n=Math.floor((i+s)/2),e>t[n].last)i=n+1;else if(e<t[n].first)s=n-1;else return 1;return 0};io.default=ox});var no=E(Tr=>{"use strict";var Rm=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});var Tm=Rm(jm()),px=Rm(Cm()),cx=e=>e===0?0:e<32||e>=127&&e<160?-1:(0,px.default)(e,Tm.default,Tm.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));Tr.default=cx});var Im=E(Rr=>{"use strict";var dx=Rr&&Rr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rr,"__esModule",{value:!0});var ux=dx(no()),lx=e=>{let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),n=(0,ux.default)(i);if(n<0)return-1;t+=n}return t};Rr.default=lx});var Dm=E(_t=>{"use strict";var Om=_t&&_t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_t,"__esModule",{value:!0});_t.wcswidth=_t.wcwidth=void 0;var mx=Om(Im());_t.wcswidth=mx.default;var hx=Om(no());_t.wcwidth=hx.default});var so=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.findWidthInConsole=Et.stripAnsi=void 0;var yx=Dm(),gx=/\x1b\[\d{1,3}(;\d{1,3})*m/g,fx=e=>e.replace(gx,"");Et.stripAnsi=fx;var _x=(e,t)=>{let r=0;return e=(0,Et.stripAnsi)(e),t&&Object.entries(t).forEach(([i,n])=>{let s=new RegExp(i,"g");r+=(e.match(s)||[]).length*n,e=e.replace(i,"")}),r+=(0,yx.wcswidth)(e),r};Et.findWidthInConsole=_x});var oo=E(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.biggestWordInSentence=Ne.textWithPadding=Ne.splitTextIntoTextsOfMinLen=void 0;var ao=so(),bx=(e,t,r)=>{let i=[];return e.split(/[\n\r]/).forEach(s=>{let a=s.split(" "),o=[],p=0;a.forEach(d=>{let c=(0,ao.findWidthInConsole)(d,r);p+c<=t?(p+=c+1,o.push(d)):(o.length>0&&i.push(o.join(" ")),o=[d],p=c+1)}),i.push(o.join(" "))}),i};Ne.splitTextIntoTextsOfMinLen=bx;var qx=(e,t,r,i)=>{let n=(0,ao.findWidthInConsole)(e,i),s=Math.floor((r-n)/2),a=r-s-n;if(r<n){let o=(0,Ne.splitTextIntoTextsOfMinLen)(e,r);return o.length===1?e:o.map(p=>(0,Ne.textWithPadding)(p,t,r,i)).join(`
30
- `)}switch(t){case"left":return e.concat(" ".repeat(r-n));case"center":return" ".repeat(s).concat(e).concat(" ".repeat(a));default:return" ".repeat(r-n).concat(e)}};Ne.textWithPadding=qx;var kx=(e,t)=>e.split(" ").reduce((r,i)=>Math.max(r,(0,ao.findWidthInConsole)(i,t)),0);Ne.biggestWordInSentence=kx});var Ir=E(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.getWidthLimitedColumnsArray=G.createHeaderAsRow=G.renderTableHorizontalBorders=G.findLenOfColumn=G.createRow=G.createColumFromOnlyName=G.createTableHorizontalBorders=G.convertRawRowOptionsToStandard=G.evaluateCellText=G.cellText=void 0;var Lm=so(),po=oo(),co=Cr(),Zt=(e,t)=>Math.max(e,t),vx=e=>e==null?"":`${e}`;G.cellText=vx;var wx=(e,t)=>t?`${t(e)}`:(0,G.cellText)(e);G.evaluateCellText=wx;var xx=e=>{if(e)return{color:e.color,separator:e.separator||co.DEFAULT_ROW_SEPARATOR}};G.convertRawRowOptionsToStandard=xx;var Sx=({left:e,mid:t,right:r,other:i},n)=>{let s=e;return n.forEach(a=>{s+=i.repeat(a+2),s+=t}),s=s.slice(0,-t.length),s+=r,s};G.createTableHorizontalBorders=Sx;var $x=e=>({name:e,title:e});G.createColumFromOnlyName=$x;var Ax=(e,t,r)=>({color:e,separator:r,text:t});G.createRow=Ax;var Ex=(e,t,r)=>{let i=e.name,n=e.title,s=e.transform,a=Zt(0,e?.minLen||0);return e.maxLen?(a=Zt(a,Zt(e.maxLen,(0,po.biggestWordInSentence)(n,r))),a=t.reduce((o,p)=>Zt(o,(0,po.biggestWordInSentence)((0,G.evaluateCellText)(p.text[i],s),r)),a),a):(a=Zt(a,(0,Lm.findWidthInConsole)(n,r)),t.forEach(o=>{a=Zt(a,(0,Lm.findWidthInConsole)((0,G.evaluateCellText)(o.text[i],s),r))}),a)};G.findLenOfColumn=Ex;var Px=(e,t)=>(0,G.createTableHorizontalBorders)(e,t);G.renderTableHorizontalBorders=Px;var jx=(e,t)=>{let r=co.DEFAULT_HEADER_FONT_COLOR,i=e(r,{},!1);return t.forEach(n=>{i.text[n.name]=n.title}),i};G.createHeaderAsRow=jx;var Cx=(e,t,r)=>{let i={};return e.forEach(n=>{i[n.name]=(0,po.splitTextIntoTextsOfMinLen)((0,G.cellText)(t.text[n.name]),n.length||co.DEFAULT_COLUMN_LEN,r)}),i};G.getWidthLimitedColumnsArray=Cx});var Bm=E(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.rawColumnToInternalColumn=rt.objIfExists=void 0;var Tx=Cr(),Rx=(e,t)=>t?{[e]:t}:{};rt.objIfExists=Rx;var Ix=(e,t)=>{var r;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(r=e.title)!==null&&r!==void 0?r:e.name},(0,rt.objIfExists)("color",e.color||t?.color)),(0,rt.objIfExists)("maxLen",e.maxLen||t?.maxLen)),(0,rt.objIfExists)("minLen",e.minLen||t?.minLen)),{alignment:e.alignment||t?.alignment||Tx.DEFAULT_ROW_ALIGNMENT,transform:e.transform})};rt.rawColumnToInternalColumn=Ix});var zm=E(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.preProcessRows=Qt.preProcessColumns=void 0;var Ox=Ir(),Dx=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.columns.some(i=>i.name===t.name)||(e.addColumn(Object.assign(Object.assign({},t),e.defaultColumnOptions)),e.rows.forEach((i,n,s)=>{let a=s.map(o=>o.text);i.text[t.name]=t.function(i.text,n,a)}))})},Lx=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},Bx=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},zx=e=>{e.columns.forEach(t=>{t.length=(0,Ox.findLenOfColumn)(t,e.rows,e.charLength)})},Mx=e=>{Dx(e),Bx(e),Lx(e),zx(e)};Qt.preProcessColumns=Mx;var Fx=e=>{let t=e.rows.filter(r=>e.filterFunction(r.text)).sort((r,i)=>e.sortFunction(r.text,i.text));e.rows=t};Qt.preProcessRows=Fx});var uo=E(Se=>{"use strict";var Fm=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Se,"__esModule",{value:!0});Se.printSimpleTable=Se.renderSimpleTable=Se.renderTable=void 0;var Gm=Fm(to()),Um=oo(),Te=Cr(),bt=Ir(),Gx=Fm(lo()),Mm=zm(),Ux=(e,t,r,i,n,s,a,o)=>{let p=new Gm.default(a);return p.addCharsWithColor("",e.vertical),t.forEach(d=>{let u=r<i[d.name].length?(0,bt.cellText)(i[d.name][r]):"";p.addCharsWithColor(Te.DEFAULT_ROW_FONT_COLOR," "),p.addCharsWithColor(n&&Te.DEFAULT_HEADER_FONT_COLOR||d.color||s.color,(0,Um.textWithPadding)(u,d.alignment||Te.DEFAULT_ROW_ALIGNMENT,d.length||Te.DEFAULT_COLUMN_LEN,o)),p.addCharsWithColor("",` ${e.vertical}`)}),p.renderConsole()},Nm=(e,t,r,i,n,s)=>{let a=(0,bt.getWidthLimitedColumnsArray)(t,r,s),o=Object.values(a).reduce((d,c)=>Math.max(d,c.length),0),p=[];for(let d=0;d<o;d+=1){let c=Ux(e,t,d,a,n,r,i,s);p.push(c)}return p},Nx=(e,t)=>{let r=JSON.parse(JSON.stringify(e)),i={};return t.filter(n=>!!n.transform).forEach(n=>{i[n.name]=n.transform}),Object.keys(i).forEach(n=>{r.text[n]=i[n](r.text[n])}),r},Hx=(e,t)=>{let r=[],i=Nx(t,e.columns);return r=r.concat(Nm(e.tableStyle,e.columns,i,e.colorMap,void 0,e.charLength)),r},Vx=e=>{let t=[];if(e.title===void 0)return t;let r=()=>{let s=(a,o)=>a+o+2+1;return e.columns.map(a=>a.length||Te.DEFAULT_COLUMN_LEN).reduce(s,1)},i=(0,Um.textWithPadding)(e.title,Te.DEFAULT_HEADER_ALIGNMENT,r()),n=new Gm.default(e.colorMap);return n.addCharsWithColor(Te.DEFAULT_HEADER_FONT_COLOR,i),t.push(n.renderConsole()),t},Wx=e=>{let t=[];t.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(i=>i.length||Te.DEFAULT_COLUMN_LEN)));let r=(0,bt.createHeaderAsRow)(bt.createRow,e.columns);return t=t.concat(Nm(e.tableStyle,e.columns,r,e.colorMap,!0)),t.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(i=>i.length||Te.DEFAULT_COLUMN_LEN))),t},Kx=e=>{let t=[];return t.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(r=>r.length||Te.DEFAULT_COLUMN_LEN))),t},Yx=(e,t)=>{let r=[],i=e.rows.length-1;return e.rows.indexOf(t)!==i&&t.separator&&r.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(s=>s.length||Te.DEFAULT_COLUMN_LEN))),r},Jx=e=>{(0,Mm.preProcessColumns)(e),(0,Mm.preProcessRows)(e);let t=[];return Vx(e).forEach(r=>t.push(r)),Wx(e).forEach(r=>t.push(r)),e.rows.forEach(r=>{Hx(e,r).forEach(i=>t.push(i)),Yx(e,r).forEach(i=>t.push(i))}),Kx(e).forEach(r=>t.push(r)),t.join(`
31
- `)};Se.renderTable=Jx;var Xx=(e,t)=>{let r=new Gx.default(t);return r.addRows(e),(0,Se.renderTable)(r)};Se.renderSimpleTable=Xx;var Zx=(e,t)=>{console.log((0,Se.renderSimpleTable)(e,t))};Se.printSimpleTable=Zx});var lo=E(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});var Qx=to(),Pn=Cr(),mo=Ir(),ho=Bm(),e0=uo(),t0=()=>0,r0=()=>!0,yo=class{initSimple(t){this.columns=t.map(r=>({name:r,title:r,alignment:Pn.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var r;this.title=t?.title||this.title,this.tableStyle=Object.assign(Object.assign({},this.tableStyle),t?.style),this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((r=t?.columns)===null||r===void 0?void 0:r.map(i=>(0,ho.rawColumnToInternalColumn)(i,t?.defaultColumnOptions)))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,this.defaultColumnOptions=t?.defaultColumnOptions||this.defaultColumnOptions,t?.shouldDisableColors?this.colorMap={}:t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Pn.DEFAULT_TABLE_STYLE,this.filterFunction=r0,this.sortFunction=t0,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Pn.DEFAULT_ROW_SEPARATOR,this.colorMap=Qx.DEFAULT_COLOR_MAP,this.charLength={},this.defaultColumnOptions=void 0,this.transforms={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let r=this.columns.map(i=>i.name);Object.keys(t).forEach(i=>{r.includes(i)||this.columns.push((0,ho.rawColumnToInternalColumn)((0,mo.createColumFromOnlyName)(i),this.defaultColumnOptions))})}addColumn(t){let r=typeof t=="string"?(0,mo.createColumFromOnlyName)(t):t;this.columns.push((0,ho.rawColumnToInternalColumn)(r,this.defaultColumnOptions))}addColumns(t){t.forEach(r=>{this.addColumn(r)})}addRow(t,r){this.createColumnFromRow(t),this.rows.push((0,mo.createRow)(r?.color||Pn.DEFAULT_ROW_FONT_COLOR,t,r?.separator!==void 0?r?.separator:this.rowSeparator))}addRows(t,r){t.forEach(i=>{this.addRow(i,r)})}renderTable(){return(0,e0.renderTable)(this)}};go.default=yo});var Vm=E(Or=>{"use strict";var i0=Or&&Or.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Or,"__esModule",{value:!0});var n0=i0(lo()),Hm=Ir(),fo=class{constructor(t){this.table=new n0.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,r){return this.table.addRow(t,(0,Hm.convertRawRowOptionsToStandard)(r)),this}addRows(t,r){return this.table.addRows(t,(0,Hm.convertRawRowOptionsToStandard)(r)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Or.default=fo});var Dr=E(He=>{"use strict";var s0=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(He,"__esModule",{value:!0});He.renderTable=He.printTable=He.Table=void 0;var a0=s0(Vm());He.Table=a0.default;var Wm=uo();Object.defineProperty(He,"printTable",{enumerable:!0,get:function(){return Wm.printSimpleTable}});Object.defineProperty(He,"renderTable",{enumerable:!0,get:function(){return Wm.renderSimpleTable}})});var Bo=D(Lo(),1),{program:vS,createCommand:wS,createArgument:xS,createOption:SS,CommanderError:$S,InvalidArgumentError:AS,InvalidOptionArgumentError:ES,Command:zo,Argument:PS,Option:Mo,Help:jS}=Bo.default;var ry=D(K(),1);import de from"fs";import ae from"path";import{fileURLToPath as Ww}from"url";import{styleText as ps}from"util";import{stdout as ds,stdin as sp}from"process";import*as st from"readline";import Ny from"readline";var Uo=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),No=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Ho=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var Py=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,jy=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Vo=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Cy=/\t{1,1000}/y,Wo=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Ty=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ry=new RegExp("\\p{M}+","gu"),Iy={limit:1/0,ellipsis:""},Ko=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?Ko(n,Iy,r).width:0),a=0,o=r.controlWidth??0,p=r.tabWidth??8,d=r.emojiWidth??2,c=2,u=r.regularWidth??1,l=r.wideWidth??c,m=[[Ty,u],[Py,a],[jy,o],[Cy,p],[Wo,d],[Vo,l]],h=0,f=0,w=e.length,k=0,x=!1,_=w,T=Math.max(0,i-s),S=0,F=0,O=0,B=0;e:for(;;){if(F>S||f>=w&&f>h){let U=e.slice(S,F)||e.slice(h,f);k=0;for(let W of U.replaceAll(Ry,"")){let $=W.codePointAt(0)||0;if(No($)?B=c:Ho($)?B=l:B=u,O+B>T&&(_=Math.min(_,Math.max(S,h)+k)),O+B>i){x=!0;break e}k+=W.length,O+=B}S=F=0}if(f>=w)break e;for(let U=0,W=m.length;U<W;U++){let[$,Ve]=m[U];if($.lastIndex=f,$.test(e)){if(k=$===Vo?Uo(e.slice(f,$.lastIndex)):$===Wo?1:$.lastIndex-f,B=k*Ve,O+B>T&&(_=Math.min(_,f+Math.floor((T-O)/Ve))),O+B>i){x=!0;break e}O+=B,S=h,F=f,f=h=$.lastIndex;continue e}}f+=1}return{width:x?T:O,index:x?_:w,truncated:x,ellipsed:x&&i>=s}},Yo=Ko;var Oy={limit:1/0,ellipsis:"",ellipsisWidth:0},Dy=(e,t={})=>Yo(e,Oy,t).width,ce=Dy;var Zr="\x1B",ep="\x9B",Ly=39,ns="\x07",tp="[",By="]",rp="m",ss=`${By}8;;`,Jo=new RegExp(`(?:\\${tp}(?<code>\\d+)m|\\${ss}(?<uri>.*)${ns})`,"y"),Xo=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Zo=e=>`${Zr}${tp}${e}${rp}`,Qo=e=>`${Zr}${ss}${e}${ns}`,is=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,a=e.at(-1),o=a===void 0?0:ce(a),p=i.next(),d=i.next(),c=0;for(;!p.done;){let u=p.value,l=ce(u);o+l<=r?e[e.length-1]+=u:(e.push(u),o=0),(u===Zr||u===ep)&&(n=!0,s=t.startsWith(ss,c+1)),n?s?u===ns&&(n=!1,s=!1):u===rp&&(n=!1):(o+=l,o===r&&!d.done&&(e.push(""),o=0)),p=d,d=i.next(),c+=u.length}a=e.at(-1),!o&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},zy=e=>{let t=e.split(" "),r=t.length;for(;r&&!ce(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},My=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,a=e.split(" "),o=[""],p=0;for(let u=0;u<a.length;u++){let l=a[u];if(r.trim!==!1){let h=o.at(-1)??"",f=h.trimStart();h.length!==f.length&&(o[o.length-1]=f,p=ce(f))}u!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),p=0),(p||r.trim===!1)&&(o[o.length-1]+=" ",p++));let m=ce(l);if(r.hard&&m>t){let h=t-p,f=1+Math.floor((m-h-1)/t);Math.floor((m-1)/t)<f&&o.push(""),is(o,l,t),p=ce(o.at(-1)??"");continue}if(p+m>t&&p&&m){if(r.wordWrap===!1&&p<t){is(o,l,t),p=ce(o.at(-1)??"");continue}o.push(""),p=0}if(p+m>t&&r.wordWrap===!1){is(o,l,t),p=ce(o.at(-1)??"");continue}o[o.length-1]+=l,p+=m}r.trim!==!1&&(o=o.map(u=>zy(u)));let d=o.join(`
32
- `),c=!1;for(let u=0;u<d.length;u++){let l=d[u];if(i+=l,c)c=!1;else if(c=l>="\uD800"&&l<="\uDBFF",c)continue;if(l===Zr||l===ep){Jo.lastIndex=u+1;let h=Jo.exec(d)?.groups;if(h?.code!==void 0){let f=Number.parseFloat(h.code);n=f===Ly?void 0:f}else h?.uri!==void 0&&(s=h.uri.length===0?void 0:h.uri)}if(d[u+1]===`
33
- `){s&&(i+=Qo(""));let m=n?Xo(n):void 0;n&&m&&(i+=Zo(m))}else l===`
34
- `&&(n&&Xo(n)&&(i+=Zo(n)),s&&(i+=Qo(s)))}return i},Fy=/\r?\n/;function Oe(e,t,r){return String(e).normalize().split(Fy).map(i=>My(i,t,r)).join(`
35
- `)}var se=D(os(),1);import{ReadStream as np}from"tty";function ei(e,t,r){if(!r.some(a=>!a.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),s=i<0?n:i>n?0:i;return r[s].disabled?ei(s,t<0?-1:1,r):s}var Hy=["up","down","left","right","space","enter","cancel"],Vy=["January","February","March","April","May","June","July","August","September","October","November","December"],re={actions:new Set(Hy),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Vy],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function us(e,t){if(typeof e=="string")return re.aliases.get(e)===t;for(let r of e)if(r!==void 0&&us(r,t))return!0;return!1}function Wy(e,t){if(e===t)return;let r=e.split(`
29
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ro(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function Qn(){if(R.env.NO_COLOR||R.env.FORCE_COLOR==="0"||R.env.FORCE_COLOR==="false")return!1;if(R.env.FORCE_COLOR||R.env.CLICOLOR_FORCE!==void 0)return!0}es.Command=Zn;es.useColor=Qn});var Bo=E(ke=>{"use strict";var{Argument:Oo}=Kr(),{Command:ts}=Io(),{CommanderError:Sy,InvalidArgumentError:Do}=or(),{Help:$y}=Hn(),{Option:Lo}=Yn();ke.program=new ts;ke.createCommand=e=>new ts(e);ke.createOption=(e,t)=>new Lo(e,t);ke.createArgument=(e,t)=>new Oo(e,t);ke.Command=ts;ke.Option=Lo;ke.Argument=Oo;ke.Help=$y;ke.CommanderError=Sy;ke.InvalidArgumentError=Do;ke.InvalidOptionArgumentError=Do});var K=E((RS,rs)=>{"use strict";var Xr=process||{},Go=Xr.argv||[],Jr=Xr.env||{},Ay=!(Jr.NO_COLOR||Go.includes("--no-color"))&&(!!Jr.FORCE_COLOR||Go.includes("--color")||Xr.platform==="win32"||(Xr.stdout||{}).isTTY&&Jr.TERM!=="dumb"||!!Jr.CI),Ey=(e,t,r=e)=>i=>{let n=""+i,s=n.indexOf(t,e.length);return~s?e+Py(n,t,r,s)+t:e+n+t},Py=(e,t,r,i)=>{let n="",s=0;do n+=e.substring(s,i)+r,s=i+t.length,i=e.indexOf(t,s);while(~i);return n+e.substring(s)},Uo=(e=Ay)=>{let t=e?Ey:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};rs.exports=Uo();rs.exports.createColors=Uo});var os=E((FS,np)=>{"use strict";var as={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Uy={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},Ny={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?as.up():"");return e&&(t+=as.left),t}};np.exports={cursor:as,scroll:Uy,erase:Ny,beep:"\x07"}});var Gp=E((aE,Fp)=>{"use strict";Fp.exports=Mp;Mp.sync=gf;var Bp=ge("fs");function yf(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function zp(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:yf(t,r)}function Mp(e,t,r){Bp.stat(e,function(i,n){r(i,i?!1:zp(n,e,t))})}function gf(e,t){return zp(Bp.statSync(e),e,t)}});var Wp=E((oE,Vp)=>{"use strict";Vp.exports=Np;Np.sync=ff;var Up=ge("fs");function Np(e,t,r){Up.stat(e,function(i,n){r(i,i?!1:Hp(n,t))})}function ff(e,t){return Hp(Up.statSync(e),t)}function Hp(e,t){return e.isFile()&&_f(e,t)}function _f(e,t){var r=e.mode,i=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),p=parseInt("010",8),d=parseInt("001",8),c=o|p,u=r&d||r&p&&n===a||r&o&&i===s||r&c&&s===0;return u}});var Yp=E((cE,Kp)=>{"use strict";var pE=ge("fs"),Si;process.platform==="win32"||global.TESTING_WINDOWS?Si=Gp():Si=Wp();Kp.exports=Ss;Ss.sync=bf;function Ss(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Ss(e,t||{},function(s,a){s?n(s):i(a)})})}Si(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function bf(e,t){try{return Si.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var rc=E((dE,tc)=>{"use strict";var Ot=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Jp=ge("path"),qf=Ot?";":":",Xp=Yp(),Zp=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Qp=(e,t)=>{let r=t.colon||qf,i=e.match(/\//)||Ot&&e.match(/\\/)?[""]:[...Ot?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=Ot?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ot?n.split(r):[""];return Ot&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},ec=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:s}=Qp(e,t),a=[],o=d=>new Promise((c,u)=>{if(d===i.length)return t.all&&a.length?c(a):u(Zp(e));let l=i[d],m=/^".*"$/.test(l)?l.slice(1,-1):l,h=Jp.join(m,e),f=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(p(f,d,0))}),p=(d,c,u)=>new Promise((l,m)=>{if(u===n.length)return l(o(c+1));let h=n[u];Xp(d+h,{pathExt:s},(f,w)=>{if(!f&&w)if(t.all)a.push(d+h);else return l(d+h);return l(p(d,c,u+1))})});return r?o(0).then(d=>r(null,d),r):o(0)},kf=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=Qp(e,t),s=[];for(let a=0;a<r.length;a++){let o=r[a],p=/^".*"$/.test(o)?o.slice(1,-1):o,d=Jp.join(p,e),c=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let u=0;u<i.length;u++){let l=c+i[u];try{if(Xp.sync(l,{pathExt:n}))if(t.all)s.push(l);else return l}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Zp(e)};tc.exports=ec;ec.sync=kf});var nc=E((uE,$s)=>{"use strict";var ic=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};$s.exports=ic;$s.exports.default=ic});var pc=E((lE,oc)=>{"use strict";var sc=ge("path"),vf=rc(),wf=nc();function ac(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let a;try{a=vf.sync(e.command,{path:r[wf({env:r})],pathExt:t?sc.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return a&&(a=sc.resolve(n?e.options.cwd:"",a)),a}function xf(e){return ac(e)||ac(e,!0)}oc.exports=xf});var cc=E((mE,Es)=>{"use strict";var As=/([()\][%!^"`<>&|;, *?])/g;function Sf(e){return e=e.replace(As,"^$1"),e}function $f(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(As,"^$1"),t&&(e=e.replace(As,"^$1")),e}Es.exports.command=Sf;Es.exports.argument=$f});var uc=E((hE,dc)=>{"use strict";dc.exports=/^#!(.*)/});var mc=E((yE,lc)=>{"use strict";var Af=uc();lc.exports=(e="")=>{let t=e.match(Af);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var yc=E((gE,hc)=>{"use strict";var Ps=ge("fs"),Ef=mc();function Pf(e){let r=Buffer.alloc(150),i;try{i=Ps.openSync(e,"r"),Ps.readSync(i,r,0,150,0),Ps.closeSync(i)}catch{}return Ef(r.toString())}hc.exports=Pf});var bc=E((fE,_c)=>{"use strict";var jf=ge("path"),gc=pc(),fc=cc(),Cf=yc(),Tf=process.platform==="win32",Rf=/\.(?:com|exe)$/i,If=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Of(e){e.file=gc(e);let t=e.file&&Cf(e.file);return t?(e.args.unshift(e.file),e.command=t,gc(e)):e.file}function Df(e){if(!Tf)return e;let t=Of(e),r=!Rf.test(t);if(e.options.forceShell||r){let i=If.test(t);e.command=jf.normalize(e.command),e.command=fc.command(e.command),e.args=e.args.map(s=>fc.argument(s,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Lf(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:Df(i)}_c.exports=Lf});var vc=E((_E,kc)=>{"use strict";var js=process.platform==="win32";function Cs(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Bf(e,t){if(!js)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let s=qc(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function qc(e,t){return js&&e===1&&!t.file?Cs(t.original,"spawn"):null}function zf(e,t){return js&&e===1&&!t.file?Cs(t.original,"spawnSync"):null}kc.exports={hookChildProcess:Bf,verifyENOENT:qc,verifyENOENTSync:zf,notFoundError:Cs}});var Sc=E((bE,Dt)=>{"use strict";var wc=ge("child_process"),Ts=bc(),Rs=vc();function xc(e,t,r){let i=Ts(e,t,r),n=wc.spawn(i.command,i.args,i.options);return Rs.hookChildProcess(n,i),n}function Mf(e,t,r){let i=Ts(e,t,r),n=wc.spawnSync(i.command,i.args,i.options);return n.error=n.error||Rs.verifyENOENTSync(n.status,i),n}Dt.exports=xc;Dt.exports.spawn=xc;Dt.exports.sync=Mf;Dt.exports._parse=Ts;Dt.exports._enoent=Rs});var ro=E(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_COLOR_MAP=void 0;Xt.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var to=class{constructor(t=Xt.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,r){let i=this.colorMap[t];this.text+=i!==void 0?`${i}${r}${this.colorMap.reset}`:r}renderConsole(){return this.text}};Xt.default=to});var Cr=E(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.DEFAULT_HEADER_ALIGNMENT=Q.DEFAULT_ROW_ALIGNMENT=Q.DEFAULT_HEADER_FONT_COLOR=Q.DEFAULT_ROW_FONT_COLOR=Q.COLORS=Q.ALIGNMENTS=Q.DEFAULT_TABLE_STYLE=Q.DEFAULT_ROW_SEPARATOR=Q.DEFAULT_COLUMN_LEN=void 0;Q.DEFAULT_COLUMN_LEN=20;Q.DEFAULT_ROW_SEPARATOR=!1;Q.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};Q.ALIGNMENTS=["right","left","center"];Q.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];Q.DEFAULT_ROW_FONT_COLOR="white";Q.DEFAULT_HEADER_FONT_COLOR="white_bold";Q.DEFAULT_ROW_ALIGNMENT="right";Q.DEFAULT_HEADER_ALIGNMENT="center"});var Cm=E(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});var ox=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];io.default=ox});var Tm=E(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var px=(e,t,r)=>{let i=0,n,s=r;if(e<t[0].first||e>t[s].last)return 0;for(;s>=i;)if(n=Math.floor((i+s)/2),e>t[n].last)i=n+1;else if(e<t[n].first)s=n-1;else return 1;return 0};no.default=px});var so=E(Tr=>{"use strict";var Im=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});var Rm=Im(Cm()),cx=Im(Tm()),dx=e=>e===0?0:e<32||e>=127&&e<160?-1:(0,cx.default)(e,Rm.default,Rm.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));Tr.default=dx});var Om=E(Rr=>{"use strict";var ux=Rr&&Rr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rr,"__esModule",{value:!0});var lx=ux(so()),mx=e=>{let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),n=(0,lx.default)(i);if(n<0)return-1;t+=n}return t};Rr.default=mx});var Lm=E(_t=>{"use strict";var Dm=_t&&_t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_t,"__esModule",{value:!0});_t.wcswidth=_t.wcwidth=void 0;var hx=Dm(Om());_t.wcswidth=hx.default;var yx=Dm(so());_t.wcwidth=yx.default});var ao=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.findWidthInConsole=Et.stripAnsi=void 0;var gx=Lm(),fx=/\x1b\[\d{1,3}(;\d{1,3})*m/g,_x=e=>e.replace(fx,"");Et.stripAnsi=_x;var bx=(e,t)=>{let r=0;return e=(0,Et.stripAnsi)(e),t&&Object.entries(t).forEach(([i,n])=>{let s=new RegExp(i,"g");r+=(e.match(s)||[]).length*n,e=e.replace(i,"")}),r+=(0,gx.wcswidth)(e),r};Et.findWidthInConsole=bx});var po=E(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.biggestWordInSentence=Ne.textWithPadding=Ne.splitTextIntoTextsOfMinLen=void 0;var oo=ao(),qx=(e,t,r)=>{let i=[];return e.split(/[\n\r]/).forEach(s=>{let a=s.split(" "),o=[],p=0;a.forEach(d=>{let c=(0,oo.findWidthInConsole)(d,r);p+c<=t?(p+=c+1,o.push(d)):(o.length>0&&i.push(o.join(" ")),o=[d],p=c+1)}),i.push(o.join(" "))}),i};Ne.splitTextIntoTextsOfMinLen=qx;var kx=(e,t,r,i)=>{let n=(0,oo.findWidthInConsole)(e,i),s=Math.floor((r-n)/2),a=r-s-n;if(r<n){let o=(0,Ne.splitTextIntoTextsOfMinLen)(e,r);return o.length===1?e:o.map(p=>(0,Ne.textWithPadding)(p,t,r,i)).join(`
30
+ `)}switch(t){case"left":return e.concat(" ".repeat(r-n));case"center":return" ".repeat(s).concat(e).concat(" ".repeat(a));default:return" ".repeat(r-n).concat(e)}};Ne.textWithPadding=kx;var vx=(e,t)=>e.split(" ").reduce((r,i)=>Math.max(r,(0,oo.findWidthInConsole)(i,t)),0);Ne.biggestWordInSentence=vx});var Ir=E(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.getWidthLimitedColumnsArray=G.createHeaderAsRow=G.renderTableHorizontalBorders=G.findLenOfColumn=G.createRow=G.createColumFromOnlyName=G.createTableHorizontalBorders=G.convertRawRowOptionsToStandard=G.evaluateCellText=G.cellText=void 0;var Bm=ao(),co=po(),uo=Cr(),Zt=(e,t)=>Math.max(e,t),wx=e=>e==null?"":`${e}`;G.cellText=wx;var xx=(e,t)=>t?`${t(e)}`:(0,G.cellText)(e);G.evaluateCellText=xx;var Sx=e=>{if(e)return{color:e.color,separator:e.separator||uo.DEFAULT_ROW_SEPARATOR}};G.convertRawRowOptionsToStandard=Sx;var $x=({left:e,mid:t,right:r,other:i},n)=>{let s=e;return n.forEach(a=>{s+=i.repeat(a+2),s+=t}),s=s.slice(0,-t.length),s+=r,s};G.createTableHorizontalBorders=$x;var Ax=e=>({name:e,title:e});G.createColumFromOnlyName=Ax;var Ex=(e,t,r)=>({color:e,separator:r,text:t});G.createRow=Ex;var Px=(e,t,r)=>{let i=e.name,n=e.title,s=e.transform,a=Zt(0,e?.minLen||0);return e.maxLen?(a=Zt(a,Zt(e.maxLen,(0,co.biggestWordInSentence)(n,r))),a=t.reduce((o,p)=>Zt(o,(0,co.biggestWordInSentence)((0,G.evaluateCellText)(p.text[i],s),r)),a),a):(a=Zt(a,(0,Bm.findWidthInConsole)(n,r)),t.forEach(o=>{a=Zt(a,(0,Bm.findWidthInConsole)((0,G.evaluateCellText)(o.text[i],s),r))}),a)};G.findLenOfColumn=Px;var jx=(e,t)=>(0,G.createTableHorizontalBorders)(e,t);G.renderTableHorizontalBorders=jx;var Cx=(e,t)=>{let r=uo.DEFAULT_HEADER_FONT_COLOR,i=e(r,{},!1);return t.forEach(n=>{i.text[n.name]=n.title}),i};G.createHeaderAsRow=Cx;var Tx=(e,t,r)=>{let i={};return e.forEach(n=>{i[n.name]=(0,co.splitTextIntoTextsOfMinLen)((0,G.cellText)(t.text[n.name]),n.length||uo.DEFAULT_COLUMN_LEN,r)}),i};G.getWidthLimitedColumnsArray=Tx});var zm=E(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.rawColumnToInternalColumn=rt.objIfExists=void 0;var Rx=Cr(),Ix=(e,t)=>t?{[e]:t}:{};rt.objIfExists=Ix;var Ox=(e,t)=>{var r;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(r=e.title)!==null&&r!==void 0?r:e.name},(0,rt.objIfExists)("color",e.color||t?.color)),(0,rt.objIfExists)("maxLen",e.maxLen||t?.maxLen)),(0,rt.objIfExists)("minLen",e.minLen||t?.minLen)),{alignment:e.alignment||t?.alignment||Rx.DEFAULT_ROW_ALIGNMENT,transform:e.transform})};rt.rawColumnToInternalColumn=Ox});var Mm=E(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.preProcessRows=Qt.preProcessColumns=void 0;var Dx=Ir(),Lx=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.columns.some(i=>i.name===t.name)||(e.addColumn(Object.assign(Object.assign({},t),e.defaultColumnOptions)),e.rows.forEach((i,n,s)=>{let a=s.map(o=>o.text);i.text[t.name]=t.function(i.text,n,a)}))})},Bx=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},zx=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},Mx=e=>{e.columns.forEach(t=>{t.length=(0,Dx.findLenOfColumn)(t,e.rows,e.charLength)})},Fx=e=>{Lx(e),zx(e),Bx(e),Mx(e)};Qt.preProcessColumns=Fx;var Gx=e=>{let t=e.rows.filter(r=>e.filterFunction(r.text)).sort((r,i)=>e.sortFunction(r.text,i.text));e.rows=t};Qt.preProcessRows=Gx});var lo=E(Se=>{"use strict";var Gm=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Se,"__esModule",{value:!0});Se.printSimpleTable=Se.renderSimpleTable=Se.renderTable=void 0;var Um=Gm(ro()),Nm=po(),Te=Cr(),bt=Ir(),Ux=Gm(mo()),Fm=Mm(),Nx=(e,t,r,i,n,s,a,o)=>{let p=new Um.default(a);return p.addCharsWithColor("",e.vertical),t.forEach(d=>{let u=r<i[d.name].length?(0,bt.cellText)(i[d.name][r]):"";p.addCharsWithColor(Te.DEFAULT_ROW_FONT_COLOR," "),p.addCharsWithColor(n&&Te.DEFAULT_HEADER_FONT_COLOR||d.color||s.color,(0,Nm.textWithPadding)(u,d.alignment||Te.DEFAULT_ROW_ALIGNMENT,d.length||Te.DEFAULT_COLUMN_LEN,o)),p.addCharsWithColor("",` ${e.vertical}`)}),p.renderConsole()},Hm=(e,t,r,i,n,s)=>{let a=(0,bt.getWidthLimitedColumnsArray)(t,r,s),o=Object.values(a).reduce((d,c)=>Math.max(d,c.length),0),p=[];for(let d=0;d<o;d+=1){let c=Nx(e,t,d,a,n,r,i,s);p.push(c)}return p},Hx=(e,t)=>{let r=JSON.parse(JSON.stringify(e)),i={};return t.filter(n=>!!n.transform).forEach(n=>{i[n.name]=n.transform}),Object.keys(i).forEach(n=>{r.text[n]=i[n](r.text[n])}),r},Vx=(e,t)=>{let r=[],i=Hx(t,e.columns);return r=r.concat(Hm(e.tableStyle,e.columns,i,e.colorMap,void 0,e.charLength)),r},Wx=e=>{let t=[];if(e.title===void 0)return t;let r=()=>{let s=(a,o)=>a+o+2+1;return e.columns.map(a=>a.length||Te.DEFAULT_COLUMN_LEN).reduce(s,1)},i=(0,Nm.textWithPadding)(e.title,Te.DEFAULT_HEADER_ALIGNMENT,r()),n=new Um.default(e.colorMap);return n.addCharsWithColor(Te.DEFAULT_HEADER_FONT_COLOR,i),t.push(n.renderConsole()),t},Kx=e=>{let t=[];t.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(i=>i.length||Te.DEFAULT_COLUMN_LEN)));let r=(0,bt.createHeaderAsRow)(bt.createRow,e.columns);return t=t.concat(Hm(e.tableStyle,e.columns,r,e.colorMap,!0)),t.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(i=>i.length||Te.DEFAULT_COLUMN_LEN))),t},Yx=e=>{let t=[];return t.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(r=>r.length||Te.DEFAULT_COLUMN_LEN))),t},Jx=(e,t)=>{let r=[],i=e.rows.length-1;return e.rows.indexOf(t)!==i&&t.separator&&r.push((0,bt.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(s=>s.length||Te.DEFAULT_COLUMN_LEN))),r},Xx=e=>{(0,Fm.preProcessColumns)(e),(0,Fm.preProcessRows)(e);let t=[];return Wx(e).forEach(r=>t.push(r)),Kx(e).forEach(r=>t.push(r)),e.rows.forEach(r=>{Vx(e,r).forEach(i=>t.push(i)),Jx(e,r).forEach(i=>t.push(i))}),Yx(e).forEach(r=>t.push(r)),t.join(`
31
+ `)};Se.renderTable=Xx;var Zx=(e,t)=>{let r=new Ux.default(t);return r.addRows(e),(0,Se.renderTable)(r)};Se.renderSimpleTable=Zx;var Qx=(e,t)=>{console.log((0,Se.renderSimpleTable)(e,t))};Se.printSimpleTable=Qx});var mo=E(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});var e0=ro(),Pn=Cr(),ho=Ir(),yo=zm(),t0=lo(),r0=()=>0,i0=()=>!0,go=class{initSimple(t){this.columns=t.map(r=>({name:r,title:r,alignment:Pn.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var r;this.title=t?.title||this.title,this.tableStyle=Object.assign(Object.assign({},this.tableStyle),t?.style),this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((r=t?.columns)===null||r===void 0?void 0:r.map(i=>(0,yo.rawColumnToInternalColumn)(i,t?.defaultColumnOptions)))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,this.defaultColumnOptions=t?.defaultColumnOptions||this.defaultColumnOptions,t?.shouldDisableColors?this.colorMap={}:t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Pn.DEFAULT_TABLE_STYLE,this.filterFunction=i0,this.sortFunction=r0,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Pn.DEFAULT_ROW_SEPARATOR,this.colorMap=e0.DEFAULT_COLOR_MAP,this.charLength={},this.defaultColumnOptions=void 0,this.transforms={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let r=this.columns.map(i=>i.name);Object.keys(t).forEach(i=>{r.includes(i)||this.columns.push((0,yo.rawColumnToInternalColumn)((0,ho.createColumFromOnlyName)(i),this.defaultColumnOptions))})}addColumn(t){let r=typeof t=="string"?(0,ho.createColumFromOnlyName)(t):t;this.columns.push((0,yo.rawColumnToInternalColumn)(r,this.defaultColumnOptions))}addColumns(t){t.forEach(r=>{this.addColumn(r)})}addRow(t,r){this.createColumnFromRow(t),this.rows.push((0,ho.createRow)(r?.color||Pn.DEFAULT_ROW_FONT_COLOR,t,r?.separator!==void 0?r?.separator:this.rowSeparator))}addRows(t,r){t.forEach(i=>{this.addRow(i,r)})}renderTable(){return(0,t0.renderTable)(this)}};fo.default=go});var Wm=E(Or=>{"use strict";var n0=Or&&Or.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Or,"__esModule",{value:!0});var s0=n0(mo()),Vm=Ir(),_o=class{constructor(t){this.table=new s0.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,r){return this.table.addRow(t,(0,Vm.convertRawRowOptionsToStandard)(r)),this}addRows(t,r){return this.table.addRows(t,(0,Vm.convertRawRowOptionsToStandard)(r)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Or.default=_o});var Dr=E(He=>{"use strict";var a0=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(He,"__esModule",{value:!0});He.renderTable=He.printTable=He.Table=void 0;var o0=a0(Wm());He.Table=o0.default;var Km=lo();Object.defineProperty(He,"printTable",{enumerable:!0,get:function(){return Km.printSimpleTable}});Object.defineProperty(He,"renderTable",{enumerable:!0,get:function(){return Km.renderSimpleTable}})});var zo=D(Bo(),1),{program:wS,createCommand:xS,createArgument:SS,createOption:$S,CommanderError:AS,InvalidArgumentError:ES,InvalidOptionArgumentError:PS,Command:Mo,Argument:jS,Option:Fo,Help:CS}=zo.default;var iy=D(K(),1);import de from"fs";import ae from"path";import{fileURLToPath as Kw}from"url";import{styleText as ps}from"util";import{stdout as ds,stdin as ap}from"process";import*as st from"readline";import Hy from"readline";var No=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),Ho=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Vo=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var jy=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Cy=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Wo=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Ty=/\t{1,1000}/y,Ko=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Ry=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Iy=new RegExp("\\p{M}+","gu"),Oy={limit:1/0,ellipsis:""},Yo=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?Yo(n,Oy,r).width:0),a=0,o=r.controlWidth??0,p=r.tabWidth??8,d=r.emojiWidth??2,c=2,u=r.regularWidth??1,l=r.wideWidth??c,m=[[Ry,u],[jy,a],[Cy,o],[Ty,p],[Ko,d],[Wo,l]],h=0,f=0,w=e.length,v=0,x=!1,_=w,T=Math.max(0,i-s),S=0,F=0,O=0,B=0;e:for(;;){if(F>S||f>=w&&f>h){let U=e.slice(S,F)||e.slice(h,f);v=0;for(let W of U.replaceAll(Iy,"")){let $=W.codePointAt(0)||0;if(Ho($)?B=c:Vo($)?B=l:B=u,O+B>T&&(_=Math.min(_,Math.max(S,h)+v)),O+B>i){x=!0;break e}v+=W.length,O+=B}S=F=0}if(f>=w)break e;for(let U=0,W=m.length;U<W;U++){let[$,Ve]=m[U];if($.lastIndex=f,$.test(e)){if(v=$===Wo?No(e.slice(f,$.lastIndex)):$===Ko?1:$.lastIndex-f,B=v*Ve,O+B>T&&(_=Math.min(_,f+Math.floor((T-O)/Ve))),O+B>i){x=!0;break e}O+=B,S=h,F=f,f=h=$.lastIndex;continue e}}f+=1}return{width:x?T:O,index:x?_:w,truncated:x,ellipsed:x&&i>=s}},Jo=Yo;var Dy={limit:1/0,ellipsis:"",ellipsisWidth:0},Ly=(e,t={})=>Jo(e,Dy,t).width,ce=Ly;var Zr="\x1B",tp="\x9B",By=39,ns="\x07",rp="[",zy="]",ip="m",ss=`${zy}8;;`,Xo=new RegExp(`(?:\\${rp}(?<code>\\d+)m|\\${ss}(?<uri>.*)${ns})`,"y"),Zo=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Qo=e=>`${Zr}${rp}${e}${ip}`,ep=e=>`${Zr}${ss}${e}${ns}`,is=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,a=e.at(-1),o=a===void 0?0:ce(a),p=i.next(),d=i.next(),c=0;for(;!p.done;){let u=p.value,l=ce(u);o+l<=r?e[e.length-1]+=u:(e.push(u),o=0),(u===Zr||u===tp)&&(n=!0,s=t.startsWith(ss,c+1)),n?s?u===ns&&(n=!1,s=!1):u===ip&&(n=!1):(o+=l,o===r&&!d.done&&(e.push(""),o=0)),p=d,d=i.next(),c+=u.length}a=e.at(-1),!o&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},My=e=>{let t=e.split(" "),r=t.length;for(;r&&!ce(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Fy=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,a=e.split(" "),o=[""],p=0;for(let u=0;u<a.length;u++){let l=a[u];if(r.trim!==!1){let h=o.at(-1)??"",f=h.trimStart();h.length!==f.length&&(o[o.length-1]=f,p=ce(f))}u!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),p=0),(p||r.trim===!1)&&(o[o.length-1]+=" ",p++));let m=ce(l);if(r.hard&&m>t){let h=t-p,f=1+Math.floor((m-h-1)/t);Math.floor((m-1)/t)<f&&o.push(""),is(o,l,t),p=ce(o.at(-1)??"");continue}if(p+m>t&&p&&m){if(r.wordWrap===!1&&p<t){is(o,l,t),p=ce(o.at(-1)??"");continue}o.push(""),p=0}if(p+m>t&&r.wordWrap===!1){is(o,l,t),p=ce(o.at(-1)??"");continue}o[o.length-1]+=l,p+=m}r.trim!==!1&&(o=o.map(u=>My(u)));let d=o.join(`
32
+ `),c=!1;for(let u=0;u<d.length;u++){let l=d[u];if(i+=l,c)c=!1;else if(c=l>="\uD800"&&l<="\uDBFF",c)continue;if(l===Zr||l===tp){Xo.lastIndex=u+1;let h=Xo.exec(d)?.groups;if(h?.code!==void 0){let f=Number.parseFloat(h.code);n=f===By?void 0:f}else h?.uri!==void 0&&(s=h.uri.length===0?void 0:h.uri)}if(d[u+1]===`
33
+ `){s&&(i+=ep(""));let m=n?Zo(n):void 0;n&&m&&(i+=Qo(m))}else l===`
34
+ `&&(n&&Zo(n)&&(i+=Qo(n)),s&&(i+=ep(s)))}return i},Gy=/\r?\n/;function Oe(e,t,r){return String(e).normalize().split(Gy).map(i=>Fy(i,t,r)).join(`
35
+ `)}var ne=D(os(),1);import{ReadStream as sp}from"tty";function ei(e,t,r){if(!r.some(a=>!a.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),s=i<0?n:i>n?0:i;return r[s].disabled?ei(s,t<0?-1:1,r):s}var Vy=["up","down","left","right","space","enter","cancel"],Wy=["January","February","March","April","May","June","July","August","September","October","November","December"],re={actions:new Set(Vy),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Wy],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function us(e,t){if(typeof e=="string")return re.aliases.get(e)===t;for(let r of e)if(r!==void 0&&us(r,t))return!0;return!1}function Ky(e,t){if(e===t)return;let r=e.split(`
36
36
  `),i=t.split(`
37
- `),n=Math.max(r.length,i.length),s=[];for(let a=0;a<n;a++)r[a]!==i[a]&&s.push(a);return{lines:s,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var Ky=globalThis.process.platform.startsWith("win"),cs=Symbol("clack:cancel");function L(e){return e===cs}function Qr(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function ap({input:e=sp,output:t=ds,overwrite:r=!0,hideCursor:i=!0}={}){let n=st.createInterface({input:e,output:t,prompt:"",tabSize:1});st.emitKeypressEvents(e,n),e instanceof np&&e.isTTY&&e.setRawMode(!0);let s=(a,{name:o,sequence:p})=>{let d=String(a);if(us([d,o,p],"cancel")){i&&t.write(se.cursor.show),process.exit(0);return}if(!r)return;st.moveCursor(t,o==="return"?0:-1,o==="return"?-1:0,()=>{st.clearLine(t,1,()=>{e.once("keypress",s)})})};return i&&t.write(se.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),i&&t.write(se.cursor.show),e instanceof np&&e.isTTY&&!Ky&&e.setRawMode(!1),n.terminal=!1,n.close()}}var pr=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,ls=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function cr(e,t,r,i=r,n){let s=pr(e??ds);return Oe(t,s-r.length,{hard:!0,trim:!1}).split(`
37
+ `),n=Math.max(r.length,i.length),s=[];for(let a=0;a<n;a++)r[a]!==i[a]&&s.push(a);return{lines:s,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var Yy=globalThis.process.platform.startsWith("win"),cs=Symbol("clack:cancel");function L(e){return e===cs}function Qr(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function op({input:e=ap,output:t=ds,overwrite:r=!0,hideCursor:i=!0}={}){let n=st.createInterface({input:e,output:t,prompt:"",tabSize:1});st.emitKeypressEvents(e,n),e instanceof sp&&e.isTTY&&e.setRawMode(!0);let s=(a,{name:o,sequence:p})=>{let d=String(a);if(us([d,o,p],"cancel")){i&&t.write(ne.cursor.show),process.exit(0);return}if(!r)return;st.moveCursor(t,o==="return"?0:-1,o==="return"?-1:0,()=>{st.clearLine(t,1,()=>{e.once("keypress",s)})})};return i&&t.write(ne.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),i&&t.write(ne.cursor.show),e instanceof sp&&e.isTTY&&!Yy&&e.setRawMode(!1),n.terminal=!1,n.close()}}var pr=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,ls=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function cr(e,t,r,i=r,n){let s=pr(e??ds);return Oe(t,s-r.length,{hard:!0,trim:!1}).split(`
38
38
  `).map((a,o)=>{let p=n?n(a,o):a;return`${o===0?i:r}${p}`}).join(`
39
- `)}var si=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:r=sp,output:i=ds,render:n,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=t,this._abortSignal=s,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let r=this._subscribers.get(e)??[],i=[];for(let n of r)n.cb(...t),n.once&&i.push(()=>r.splice(r.indexOf(n),1));for(let n of i)n()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(cs);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Ny.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Qr(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(se.cursor.show),this.output.off("resize",this.render),Qr(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(se.cursor.show),this.output.off("resize",this.render),Qr(this.input,!1),e(cs)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&re.aliases.has(t.name)&&this.emit("cursor",re.aliases.get(t.name)),re.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}us([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
39
+ `)}var si=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:r=ap,output:i=ds,render:n,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=t,this._abortSignal=s,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let r=this._subscribers.get(e)??[],i=[];for(let n of r)n.cb(...t),n.once&&i.push(()=>r.splice(r.indexOf(n),1));for(let n of i)n()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(cs);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Hy.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Qr(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(ne.cursor.show),this.output.off("resize",this.render),Qr(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(ne.cursor.show),this.output.off("resize",this.render),Qr(this.input,!1),e(cs)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&re.aliases.has(t.name)&&this.emit("cursor",re.aliases.get(t.name)),re.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}us([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
40
40
  `),Qr(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Oe(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
41
- `).length-1;this.output.write(se.cursor.move(-999,e*-1))}render(){let e=Oe(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(se.cursor.hide);else{let t=Wy(this._prevFrame,e),r=ls(this.output);if(this.restoreCursor(),t){let i=Math.max(0,t.numLinesAfter-r),n=Math.max(0,t.numLinesBefore-r),s=t.lines.find(a=>a>=i);if(s===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(se.cursor.move(0,s-n)),this.output.write(se.erase.lines(1));let a=e.split(`
42
- `);this.output.write(a[s]),this._prevFrame=e,this.output.write(se.cursor.move(0,a.length-s-1));return}else if(t.lines.length>1){if(i<n)s=i;else{let o=s-n;o>0&&this.output.write(se.cursor.move(0,o))}this.output.write(se.erase.down());let a=e.split(`
41
+ `).length-1;this.output.write(ne.cursor.move(-999,e*-1))}render(){let e=Oe(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(ne.cursor.hide);else{let t=Ky(this._prevFrame,e),r=ls(this.output);if(this.restoreCursor(),t){let i=Math.max(0,t.numLinesAfter-r),n=Math.max(0,t.numLinesBefore-r),s=t.lines.find(a=>a>=i);if(s===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(ne.cursor.move(0,s-n)),this.output.write(ne.erase.lines(1));let a=e.split(`
42
+ `);this.output.write(a[s]),this._prevFrame=e,this.output.write(ne.cursor.move(0,a.length-s-1));return}else if(t.lines.length>1){if(i<n)s=i;else{let o=s-n;o>0&&this.output.write(ne.cursor.move(0,o))}this.output.write(ne.erase.down());let a=e.split(`
43
43
  `).slice(s);this.output.write(a.join(`
44
- `)),this._prevFrame=e;return}}this.output.write(se.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var ti=class extends si{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(se.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var ri=class extends si{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${ps(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${ps("inverse",n[0])}${n.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...r}){super(r),this._mask=t??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},ii=class extends si{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let r=this.options.findIndex(({value:n})=>n===t.initialValue),i=r===-1?0:r;this.cursor=this.options[i].disabled?ei(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=ei(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ei(this.cursor,1,this.options);break}this.changeValue()})}};var ni=class extends si{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[i,...n]=t.slice(this.cursor);return`${r}${ps("inverse",i)}${n.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as g,stripVTControlCharacters as i$}from"util";import ve from"process";var dr=D(os(),1);import{existsSync as p$,lstatSync as c$,readdirSync as d$}from"fs";import{dirname as l$,join as m$}from"path";function Yy(){return ve.platform!=="win32"?ve.env.TERM!=="linux":!!ve.env.CI||!!ve.env.WT_SESSION||!!ve.env.TERMINUS_SUBLIME||ve.env.ConEmuTask==="{cmd::Cmder}"||ve.env.TERM_PROGRAM==="Terminus-Sublime"||ve.env.TERM_PROGRAM==="vscode"||ve.env.TERM==="xterm-256color"||ve.env.TERM==="alacritty"||ve.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ms=Yy(),Jy=()=>process.env.CI==="true";var z=(e,t)=>ms?e:t,Xy=z("\u25C6","*"),pp=z("\u25A0","x"),cp=z("\u25B2","x"),pi=z("\u25C7","o"),Zy=z("\u250C","T"),P=z("\u2502","|"),at=z("\u2514","\u2014"),h$=z("\u2510","T"),y$=z("\u2518","\u2014"),hs=z("\u25CF",">"),oi=z("\u25CB"," "),g$=z("\u25FB","[\u2022]"),f$=z("\u25FC","[+]"),_$=z("\u25FB","[ ]"),Qy=z("\u25AA","\u2022"),op=z("\u2500","-"),eg=z("\u256E","+"),tg=z("\u251C","+"),rg=z("\u256F","+"),ig=z("\u2570","+"),b$=z("\u256D","+"),ng=z("\u25CF","\u2022"),sg=z("\u25C6","*"),ag=z("\u25B2","!"),og=z("\u25A0","x"),ci=e=>{switch(e){case"initial":case"active":return g("cyan",Xy);case"cancel":return g("red",pp);case"error":return g("yellow",cp);case"submit":return g("green",pi)}},pg=e=>{switch(e){case"initial":case"active":return g("cyan",P);case"cancel":return g("red",P);case"error":return g("yellow",P);case"submit":return g("green",P)}},cg=(e,t,r,i,n)=>{let s=t,a=0;for(let o=r;o<i;o++){let p=e[o];if(s=s-p.length,a++,s<=n)break}return{lineCount:s,removals:a}},dg=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{let o=pr(i)-s,p=ls(i),d=g("dim","..."),c=Math.max(p-a,0),u=Math.max(Math.min(n,c),5),l=0;e>=u-3&&(l=Math.max(Math.min(e-u+3,t.length-u),0));let m=u<t.length&&l>0,h=u<t.length&&l+u<t.length,f=Math.min(l+u,t.length),w=[],k=0;m&&k++,h&&k++;let x=l+(m?1:0),_=f-(h?1:0);for(let S=x;S<_;S++){let F=Oe(r(t[S],S===e),o,{hard:!0,trim:!1}).split(`
45
- `);w.push(F),k+=F.length}if(k>c){let S=0,F=0,O=k,B=e-x,U=(W,$)=>cg(w,O,W,$,c);m?({lineCount:O,removals:S}=U(0,B),O>c&&({lineCount:O,removals:F}=U(B+1,w.length))):({lineCount:O,removals:F}=U(B+1,w.length),O>c&&({lineCount:O,removals:S}=U(0,B))),S>0&&(m=!0,w.splice(0,S)),F>0&&(h=!0,w.splice(w.length-F,F))}let T=[];m&&T.push(d);for(let S of w)for(let F of S)T.push(F);return h&&T.push(d),T};var Je=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new ti({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??re.withGuide,n=`${ci(this.state)} `,s=i?`${g("gray",P)} `:"",a=cr(e.output,e.message,s,n),o=`${i?`${g("gray",P)}
44
+ `)),this._prevFrame=e;return}}this.output.write(ne.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var ti=class extends si{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(ne.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var ri=class extends si{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${ps(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${ps("inverse",n[0])}${n.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...r}){super(r),this._mask=t??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},ii=class extends si{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let r=this.options.findIndex(({value:n})=>n===t.initialValue),i=r===-1?0:r;this.cursor=this.options[i].disabled?ei(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=ei(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ei(this.cursor,1,this.options);break}this.changeValue()})}};var ni=class extends si{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[i,...n]=t.slice(this.cursor);return`${r}${ps("inverse",i)}${n.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as g,stripVTControlCharacters as n$}from"util";import ve from"process";var dr=D(os(),1);import{existsSync as c$,lstatSync as d$,readdirSync as u$}from"fs";import{dirname as m$,join as h$}from"path";function Jy(){return ve.platform!=="win32"?ve.env.TERM!=="linux":!!ve.env.CI||!!ve.env.WT_SESSION||!!ve.env.TERMINUS_SUBLIME||ve.env.ConEmuTask==="{cmd::Cmder}"||ve.env.TERM_PROGRAM==="Terminus-Sublime"||ve.env.TERM_PROGRAM==="vscode"||ve.env.TERM==="xterm-256color"||ve.env.TERM==="alacritty"||ve.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ms=Jy(),Xy=()=>process.env.CI==="true";var z=(e,t)=>ms?e:t,Zy=z("\u25C6","*"),cp=z("\u25A0","x"),dp=z("\u25B2","x"),pi=z("\u25C7","o"),Qy=z("\u250C","T"),P=z("\u2502","|"),at=z("\u2514","\u2014"),y$=z("\u2510","T"),g$=z("\u2518","\u2014"),hs=z("\u25CF",">"),oi=z("\u25CB"," "),f$=z("\u25FB","[\u2022]"),_$=z("\u25FC","[+]"),b$=z("\u25FB","[ ]"),eg=z("\u25AA","\u2022"),pp=z("\u2500","-"),tg=z("\u256E","+"),rg=z("\u251C","+"),ig=z("\u256F","+"),ng=z("\u2570","+"),q$=z("\u256D","+"),sg=z("\u25CF","\u2022"),ag=z("\u25C6","*"),og=z("\u25B2","!"),pg=z("\u25A0","x"),ci=e=>{switch(e){case"initial":case"active":return g("cyan",Zy);case"cancel":return g("red",cp);case"error":return g("yellow",dp);case"submit":return g("green",pi)}},cg=e=>{switch(e){case"initial":case"active":return g("cyan",P);case"cancel":return g("red",P);case"error":return g("yellow",P);case"submit":return g("green",P)}},dg=(e,t,r,i,n)=>{let s=t,a=0;for(let o=r;o<i;o++){let p=e[o];if(s=s-p.length,a++,s<=n)break}return{lineCount:s,removals:a}},ug=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{let o=pr(i)-s,p=ls(i),d=g("dim","..."),c=Math.max(p-a,0),u=Math.max(Math.min(n,c),5),l=0;e>=u-3&&(l=Math.max(Math.min(e-u+3,t.length-u),0));let m=u<t.length&&l>0,h=u<t.length&&l+u<t.length,f=Math.min(l+u,t.length),w=[],v=0;m&&v++,h&&v++;let x=l+(m?1:0),_=f-(h?1:0);for(let S=x;S<_;S++){let F=Oe(r(t[S],S===e),o,{hard:!0,trim:!1}).split(`
45
+ `);w.push(F),v+=F.length}if(v>c){let S=0,F=0,O=v,B=e-x,U=(W,$)=>dg(w,O,W,$,c);m?({lineCount:O,removals:S}=U(0,B),O>c&&({lineCount:O,removals:F}=U(B+1,w.length))):({lineCount:O,removals:F}=U(B+1,w.length),O>c&&({lineCount:O,removals:S}=U(0,B))),S>0&&(m=!0,w.splice(0,S)),F>0&&(h=!0,w.splice(w.length-F,F))}let T=[];m&&T.push(d);for(let S of w)for(let F of S)T.push(F);return h&&T.push(d),T};var Je=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new ti({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??re.withGuide,n=`${ci(this.state)} `,s=i?`${g("gray",P)} `:"",a=cr(e.output,e.message,s,n),o=`${i?`${g("gray",P)}
46
46
  `:""}${a}
47
47
  `,p=this.value?t:r;switch(this.state){case"submit":{let d=i?`${g("gray",P)} `:"";return`${o}${d}${g("dim",p)}`}case"cancel":{let d=i?`${g("gray",P)} `:"";return`${o}${d}${g(["strikethrough","dim"],p)}${i?`
48
48
  ${g("gray",P)}`:""}`}default:{let d=i?`${g("cyan",P)} `:"",c=i?g("cyan",at):"";return`${o}${d}${this.value?`${g("green",hs)} ${t}`:`${g("dim",oi)} ${g("dim",t)}`}${e.vertical?i?`
@@ -52,20 +52,20 @@ ${c}
52
52
  `}}}}).prompt()};var q={message:(e=[],{symbol:t=g("gray",P),secondarySymbol:r=g("gray",P),output:i=process.stdout,spacing:n=1,withGuide:s}={})=>{let a=[],o=s??re.withGuide,p=o?r:"",d=o?`${t} `:"",c=o?`${r} `:"";for(let l=0;l<n;l++)a.push(p);let u=Array.isArray(e)?e:e.split(`
53
53
  `);if(u.length>0){let[l,...m]=u;l.length>0?a.push(`${d}${l}`):a.push(o?t:"");for(let h of m)h.length>0?a.push(`${c}${h}`):a.push(o?r:"")}i.write(`${a.join(`
54
54
  `)}
55
- `)},info:(e,t)=>{q.message(e,{...t,symbol:g("blue",ng)})},success:(e,t)=>{q.message(e,{...t,symbol:g("green",sg)})},step:(e,t)=>{q.message(e,{...t,symbol:g("green",pi)})},warn:(e,t)=>{q.message(e,{...t,symbol:g("yellow",ag)})},warning:(e,t)=>{q.warn(e,t)},error:(e,t)=>{q.message(e,{...t,symbol:g("red",og)})}},j=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??re.withGuide?`${g("gray",at)} `:"";r.write(`${i}${g("red",e)}
55
+ `)},info:(e,t)=>{q.message(e,{...t,symbol:g("blue",sg)})},success:(e,t)=>{q.message(e,{...t,symbol:g("green",ag)})},step:(e,t)=>{q.message(e,{...t,symbol:g("green",pi)})},warn:(e,t)=>{q.message(e,{...t,symbol:g("yellow",og)})},warning:(e,t)=>{q.warn(e,t)},error:(e,t)=>{q.message(e,{...t,symbol:g("red",pg)})}},j=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??re.withGuide?`${g("gray",at)} `:"";r.write(`${i}${g("red",e)}
56
56
 
57
- `)},di=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??re.withGuide?`${g("gray",Zy)} `:"";r.write(`${i}${e}
57
+ `)},di=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??re.withGuide?`${g("gray",Qy)} `:"";r.write(`${i}${e}
58
58
  `)},Ct=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??re.withGuide?`${g("gray",P)}
59
59
  ${g("gray",at)} `:"";r.write(`${i}${e}
60
60
 
61
- `)};var ug=e=>g("dim",e),lg=(e,t,r)=>{let i={hard:!0,trim:!1},n=Oe(e,t,i).split(`
62
- `),s=n.reduce((p,d)=>Math.max(ce(d),p),0),a=n.map(r).reduce((p,d)=>Math.max(ce(d),p),0),o=t-(a-s);return Oe(e,o,i)},V=(e="",t="",r)=>{let i=r?.output??ve.stdout,n=r?.withGuide??re.withGuide,s=r?.format??ug,a=["",...lg(e,pr(i)-6,s).split(`
61
+ `)};var lg=e=>g("dim",e),mg=(e,t,r)=>{let i={hard:!0,trim:!1},n=Oe(e,t,i).split(`
62
+ `),s=n.reduce((p,d)=>Math.max(ce(d),p),0),a=n.map(r).reduce((p,d)=>Math.max(ce(d),p),0),o=t-(a-s);return Oe(e,o,i)},V=(e="",t="",r)=>{let i=r?.output??ve.stdout,n=r?.withGuide??re.withGuide,s=r?.format??lg,a=["",...mg(e,pr(i)-6,s).split(`
63
63
  `).map(s),""],o=ce(t),p=Math.max(a.reduce((l,m)=>{let h=ce(m);return h>l?h:l},0),o)+2,d=a.map(l=>`${g("gray",P)} ${l}${" ".repeat(p-ce(l))}${g("gray",P)}`).join(`
64
64
  `),c=n?`${g("gray",P)}
65
- `:"",u=n?tg:ig;i.write(`${c}${g("green",pi)} ${g("reset",t)} ${g("gray",op.repeat(Math.max(p-o-1,1))+eg)}
65
+ `:"",u=n?rg:ng;i.write(`${c}${g("green",pi)} ${g("reset",t)} ${g("gray",pp.repeat(Math.max(p-o-1,1))+tg)}
66
66
  ${d}
67
- ${g("gray",u+op.repeat(p+2)+rg)}
68
- `)},ui=e=>new ri({validate:e.validate,mask:e.mask??Qy,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??re.withGuide,r=`${t?`${g("gray",P)}
67
+ ${g("gray",u+pp.repeat(p+2)+ig)}
68
+ `)},ui=e=>new ri({validate:e.validate,mask:e.mask??eg,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??re.withGuide,r=`${t?`${g("gray",P)}
69
69
  `:""}${ci(this.state)} ${e.message}
70
70
  `,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let s=t?`${g("yellow",P)} `:"",a=t?`${g("yellow",at)} `:"",o=n??"";return e.clearOnError&&this.clear(),`${r.trim()}
71
71
  ${s}${o}
@@ -73,22 +73,22 @@ ${a}${g("yellow",this.error)}
73
73
  `}case"submit":{let s=t?`${g("gray",P)} `:"",a=n?g("dim",n):"";return`${r}${s}${a}`}case"cancel":{let s=t?`${g("gray",P)} `:"",a=n?g(["strikethrough","dim"],n):"";return`${r}${s}${a}${n&&t?`
74
74
  ${g("gray",P)}`:""}`}default:{let s=t?`${g("cyan",P)} `:"",a=t?g("cyan",at):"";return`${r}${s}${i}
75
75
  ${a}
76
- `}}}}).prompt();var mg=e=>g("magenta",e),I=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:i,errorMessage:n,frames:s=ms?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=ms?80:120,signal:o,...p}={})=>{let d=Jy(),c,u,l=!1,m=!1,h="",f,w=performance.now(),k=pr(r),x=p?.styleFrame??mg,_=H=>{let ue=H>1?n??re.messages.error:i??re.messages.cancel;m=H===1,l&&($e(ue,H),m&&typeof t=="function"&&t())},T=()=>_(2),S=()=>_(1),F=()=>{process.on("uncaughtExceptionMonitor",T),process.on("unhandledRejection",T),process.on("SIGINT",S),process.on("SIGTERM",S),process.on("exit",_),o&&o.addEventListener("abort",S)},O=()=>{process.removeListener("uncaughtExceptionMonitor",T),process.removeListener("unhandledRejection",T),process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S),process.removeListener("exit",_),o&&o.removeEventListener("abort",S)},B=()=>{if(f===void 0)return;d&&r.write(`
77
- `);let H=Oe(f,k,{hard:!0,trim:!1}).split(`
78
- `);H.length>1&&r.write(dr.cursor.up(H.length-1)),r.write(dr.cursor.to(0)),r.write(dr.erase.down())},U=H=>H.replace(/\.+$/,""),W=H=>{let ue=(performance.now()-H)/1e3,We=Math.floor(ue/60),Ke=Math.floor(ue%60);return We>0?`[${We}m ${Ke}s]`:`[${Ke}s]`},$=p.withGuide??re.withGuide,Ve=(H="")=>{l=!0,c=ap({output:r}),h=U(H),w=performance.now(),$&&r.write(`${g("gray",P)}
79
- `);let ue=0,We=0;F(),u=setInterval(()=>{if(d&&h===f)return;B(),f=h;let Ke=x(s[ue]),Vr;if(d)Vr=`${Ke} ${h}...`;else if(e==="timer")Vr=`${Ke} ${h} ${W(w)}`;else{let ny=".".repeat(Math.floor(We)).slice(0,3);Vr=`${Ke} ${h}${ny}`}let iy=Oe(Vr,k,{hard:!0,trim:!1});r.write(iy),ue=ue+1<s.length?ue+1:0,We=We<4?We+.125:0},a)},$e=(H="",ue=0,We=!1)=>{if(!l)return;l=!1,clearInterval(u),B();let Ke=ue===0?g("green",pi):ue===1?g("red",pp):g("red",cp);h=H??h,We||(e==="timer"?r.write(`${Ke} ${h} ${W(w)}
76
+ `}}}}).prompt();var hg=e=>g("magenta",e),I=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:i,errorMessage:n,frames:s=ms?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=ms?80:120,signal:o,...p}={})=>{let d=Xy(),c,u,l=!1,m=!1,h="",f,w=performance.now(),v=pr(r),x=p?.styleFrame??hg,_=H=>{let ue=H>1?n??re.messages.error:i??re.messages.cancel;m=H===1,l&&($e(ue,H),m&&typeof t=="function"&&t())},T=()=>_(2),S=()=>_(1),F=()=>{process.on("uncaughtExceptionMonitor",T),process.on("unhandledRejection",T),process.on("SIGINT",S),process.on("SIGTERM",S),process.on("exit",_),o&&o.addEventListener("abort",S)},O=()=>{process.removeListener("uncaughtExceptionMonitor",T),process.removeListener("unhandledRejection",T),process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S),process.removeListener("exit",_),o&&o.removeEventListener("abort",S)},B=()=>{if(f===void 0)return;d&&r.write(`
77
+ `);let H=Oe(f,v,{hard:!0,trim:!1}).split(`
78
+ `);H.length>1&&r.write(dr.cursor.up(H.length-1)),r.write(dr.cursor.to(0)),r.write(dr.erase.down())},U=H=>H.replace(/\.+$/,""),W=H=>{let ue=(performance.now()-H)/1e3,We=Math.floor(ue/60),Ke=Math.floor(ue%60);return We>0?`[${We}m ${Ke}s]`:`[${Ke}s]`},$=p.withGuide??re.withGuide,Ve=(H="")=>{l=!0,c=op({output:r}),h=U(H),w=performance.now(),$&&r.write(`${g("gray",P)}
79
+ `);let ue=0,We=0;F(),u=setInterval(()=>{if(d&&h===f)return;B(),f=h;let Ke=x(s[ue]),Vr;if(d)Vr=`${Ke} ${h}...`;else if(e==="timer")Vr=`${Ke} ${h} ${W(w)}`;else{let sy=".".repeat(Math.floor(We)).slice(0,3);Vr=`${Ke} ${h}${sy}`}let ny=Oe(Vr,v,{hard:!0,trim:!1});r.write(ny),ue=ue+1<s.length?ue+1:0,We=We<4?We+.125:0},a)},$e=(H="",ue=0,We=!1)=>{if(!l)return;l=!1,clearInterval(u),B();let Ke=ue===0?g("green",pi):ue===1?g("red",cp):g("red",dp);h=H??h,We||(e==="timer"?r.write(`${Ke} ${h} ${W(w)}
80
80
  `):r.write(`${Ke} ${h}
81
- `)),O(),c()};return{start:Ve,stop:(H="")=>$e(H,0),message:(H="")=>{h=U(H??h)},cancel:(H="")=>$e(H,1),error:(H="")=>$e(H,2),clear:()=>$e("",0,!0),get isCancelled(){return m}}},q$={light:z("\u2500","-"),heavy:z("\u2501","="),block:z("\u2588","#")};var ai=(e,t)=>e.includes(`
81
+ `)),O(),c()};return{start:Ve,stop:(H="")=>$e(H,0),message:(H="")=>{h=U(H??h)},cancel:(H="")=>$e(H,1),error:(H="")=>$e(H,2),clear:()=>$e("",0,!0),get isCancelled(){return m}}},k$={light:z("\u2500","-"),heavy:z("\u2501","="),block:z("\u2588","#")};var ai=(e,t)=>e.includes(`
82
82
  `)?e.split(`
83
83
  `).map(r=>t(r)).join(`
84
- `):t(e),li=e=>{let t=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${g("gray",oi)} ${ai(n,s=>g("gray",s))}${r.hint?` ${g("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${ai(n,s=>g("dim",s))}`;case"active":return`${g("green",hs)} ${n}${r.hint?` ${g("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${ai(n,s=>g(["strikethrough","dim"],s))}`;default:return`${g("dim",oi)} ${ai(n,s=>g("dim",s))}`}};return new ii({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??re.withGuide,i=`${ci(this.state)} `,n=`${pg(this.state)} `,s=cr(e.output,e.message,n,i),a=`${r?`${g("gray",P)}
84
+ `):t(e),li=e=>{let t=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${g("gray",oi)} ${ai(n,s=>g("gray",s))}${r.hint?` ${g("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${ai(n,s=>g("dim",s))}`;case"active":return`${g("green",hs)} ${n}${r.hint?` ${g("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${ai(n,s=>g(["strikethrough","dim"],s))}`;default:return`${g("dim",oi)} ${ai(n,s=>g("dim",s))}`}};return new ii({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??re.withGuide,i=`${ci(this.state)} `,n=`${cg(this.state)} `,s=cr(e.output,e.message,n,i),a=`${r?`${g("gray",P)}
85
85
  `:""}${s}
86
86
  `;switch(this.state){case"submit":{let o=r?`${g("gray",P)} `:"",p=cr(e.output,t(this.options[this.cursor],"selected"),o);return`${a}${p}`}case"cancel":{let o=r?`${g("gray",P)} `:"",p=cr(e.output,t(this.options[this.cursor],"cancelled"),o);return`${a}${p}${r?`
87
87
  ${g("gray",P)}`:""}`}default:{let o=r?`${g("cyan",P)} `:"",p=r?g("cyan",at):"",d=a.split(`
88
- `).length,c=r?2:1;return`${a}${o}${dg({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:o.length,rowPadding:d+c,style:(u,l)=>t(u,u.disabled?"disabled":l?"active":"inactive")}).join(`
88
+ `).length,c=r?2:1;return`${a}${o}${ug({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:o.length,rowPadding:d+c,style:(u,l)=>t(u,u.disabled?"disabled":l?"active":"inactive")}).join(`
89
89
  ${o}`)}
90
90
  ${p}
91
- `}}}}).prompt()};var k$=`${g("gray",P)} `;var le=e=>new ni({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??re.withGuide,r=`${`${t?`${g("gray",P)}
91
+ `}}}}).prompt()};var v$=`${g("gray",P)} `;var le=e=>new ni({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??re.withGuide,r=`${`${t?`${g("gray",P)}
92
92
  `:""}${ci(this.state)} `}${e.message}
93
93
  `,i=e.placeholder?g("inverse",e.placeholder[0])+g("dim",e.placeholder.slice(1)):g(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,s=this.value??"";switch(this.state){case"error":{let a=this.error?` ${g("yellow",this.error)}`:"",o=t?`${g("yellow",P)} `:"",p=t?g("yellow",at):"";return`${r.trim()}
94
94
  ${o}${n}
@@ -96,80 +96,80 @@ ${p}${a}
96
96
  `}case"submit":{let a=s?` ${g("dim",s)}`:"",o=t?g("gray",P):"";return`${r}${o}${a}`}case"cancel":{let a=s?` ${g(["strikethrough","dim"],s)}`:"",o=t?g("gray",P):"";return`${r}${o}${a}${s.trim()?`
97
97
  ${o}`:""}`}default:{let a=t?`${g("cyan",P)} `:"",o=t?g("cyan",at):"";return`${r}${a}${n}
98
98
  ${o}
99
- `}}}}).prompt();function Y(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}import{fileURLToPath as hg}from"url";var Tt=(e,t)=>{let r=gs(yg(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},yg=e=>ys(e)?e.toString():e,ys=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,gs=e=>e instanceof URL?hg(e):e;var mi=(e,t=[],r={})=>{let i=Tt(e,"First argument"),[n,s]=Y(t)?[[],t]:[t,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(p=>typeof p=="object"&&p!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let a=n.map(String),o=a.find(p=>p.includes("\0"));if(o!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${o}`);if(!Y(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[i,a,s]};import{ChildProcess as vg}from"child_process";import{StringDecoder as gg}from"string_decoder";var{toString:dp}=Object.prototype,up=e=>dp.call(e)==="[object ArrayBuffer]",ee=e=>dp.call(e)==="[object Uint8Array]",Xe=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),fg=new TextEncoder,lp=e=>fg.encode(e),_g=new TextDecoder,hi=e=>_g.decode(e),mp=(e,t)=>bg(e,t).join(""),bg=(e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;let r=new gg(t),i=e.map(s=>typeof s=="string"?lp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},ur=e=>e.length===1&&ee(e[0])?e[0]:fs(qg(e)),qg=e=>e.map(t=>typeof t=="string"?lp(t):t),fs=e=>{let t=new Uint8Array(kg(e)),r=0;for(let i of e)t.set(i,r),r+=i.length;return t},kg=e=>{let t=0;for(let r of e)t+=r.length;return t};var fp=e=>Array.isArray(e)&&Array.isArray(e.raw),_p=(e,t)=>{let r=[];for(let[s,a]of e.entries())r=wg({templates:e,expressions:t,tokens:r,index:s,template:a});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return[i,n,{}]},wg=({templates:e,expressions:t,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[i]}`);let{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:o}=xg(n,e.raw[i]),p=yp(r,s,a);if(i===t.length)return p;let d=t[i],c=Array.isArray(d)?d.map(u=>gp(u)):[gp(d)];return yp(p,c,o)},xg=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],i=0,n=hp.has(t[0]);for(let a=0,o=0;a<e.length;a+=1,o+=1){let p=t[o];if(hp.has(p))i!==a&&r.push(e.slice(i,a)),i=a+1;else if(p==="\\"){let d=t[o+1];d===`
100
- `?(a-=1,o+=1):d==="u"&&t[o+2]==="{"?o=t.indexOf("}",o+3):o+=Sg[d]??1}}let s=i===e.length;return s||r.push(e.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},hp=new Set([" "," ","\r",`
101
- `]),Sg={x:3,u:5},yp=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],gp=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(Y(e)&&("stdout"in e||"isMaxBuffer"in e))return $g(e);throw e instanceof vg||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},$g=({stdout:e})=>{if(typeof e=="string")return e;if(ee(e))return hi(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};import{spawnSync as Ck}from"child_process";import{debuglog as Ag}from"util";import _s from"process";var Ae=e=>yi.includes(e),yi=[_s.stdin,_s.stdout,_s.stderr],we=["stdin","stdout","stderr"],gi=e=>we[e]??`stdio[${e}]`;var qp=e=>{let t={...e};for(let r of ks)t[r]=bs(e,r);return t},bs=(e,t)=>{let r=Array.from({length:Eg(e)+1}),i=Pg(e[t],r,t);return Ig(i,t)},Eg=({stdio:e})=>Array.isArray(e)?Math.max(e.length,we.length):we.length,Pg=(e,t,r)=>Y(e)?jg(e,t,r):t.fill(e),jg=(e,t,r)=>{for(let i of Object.keys(e).sort(Cg))for(let n of Tg(i,r,t))t[n]=e[i];return t},Cg=(e,t)=>bp(e)<bp(t)?1:-1,bp=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,Tg=(e,t,r)=>{if(e==="ipc")return[r.length-1];let i=qs(e);if(i===void 0||i===0)throw new TypeError(`"${t}.${e}" is invalid.
99
+ `}}}}).prompt();function Y(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}import{fileURLToPath as yg}from"url";var Tt=(e,t)=>{let r=gs(gg(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},gg=e=>ys(e)?e.toString():e,ys=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,gs=e=>e instanceof URL?yg(e):e;var mi=(e,t=[],r={})=>{let i=Tt(e,"First argument"),[n,s]=Y(t)?[[],t]:[t,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(p=>typeof p=="object"&&p!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let a=n.map(String),o=a.find(p=>p.includes("\0"));if(o!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${o}`);if(!Y(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[i,a,s]};import{ChildProcess as wg}from"child_process";import{StringDecoder as fg}from"string_decoder";var{toString:up}=Object.prototype,lp=e=>up.call(e)==="[object ArrayBuffer]",ee=e=>up.call(e)==="[object Uint8Array]",Xe=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),_g=new TextEncoder,mp=e=>_g.encode(e),bg=new TextDecoder,hi=e=>bg.decode(e),hp=(e,t)=>qg(e,t).join(""),qg=(e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;let r=new fg(t),i=e.map(s=>typeof s=="string"?mp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},ur=e=>e.length===1&&ee(e[0])?e[0]:fs(kg(e)),kg=e=>e.map(t=>typeof t=="string"?mp(t):t),fs=e=>{let t=new Uint8Array(vg(e)),r=0;for(let i of e)t.set(i,r),r+=i.length;return t},vg=e=>{let t=0;for(let r of e)t+=r.length;return t};var _p=e=>Array.isArray(e)&&Array.isArray(e.raw),bp=(e,t)=>{let r=[];for(let[s,a]of e.entries())r=xg({templates:e,expressions:t,tokens:r,index:s,template:a});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return[i,n,{}]},xg=({templates:e,expressions:t,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[i]}`);let{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:o}=Sg(n,e.raw[i]),p=gp(r,s,a);if(i===t.length)return p;let d=t[i],c=Array.isArray(d)?d.map(u=>fp(u)):[fp(d)];return gp(p,c,o)},Sg=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],i=0,n=yp.has(t[0]);for(let a=0,o=0;a<e.length;a+=1,o+=1){let p=t[o];if(yp.has(p))i!==a&&r.push(e.slice(i,a)),i=a+1;else if(p==="\\"){let d=t[o+1];d===`
100
+ `?(a-=1,o+=1):d==="u"&&t[o+2]==="{"?o=t.indexOf("}",o+3):o+=$g[d]??1}}let s=i===e.length;return s||r.push(e.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},yp=new Set([" "," ","\r",`
101
+ `]),$g={x:3,u:5},gp=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],fp=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(Y(e)&&("stdout"in e||"isMaxBuffer"in e))return Ag(e);throw e instanceof wg||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},Ag=({stdout:e})=>{if(typeof e=="string")return e;if(ee(e))return hi(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};import{spawnSync as Tk}from"child_process";import{debuglog as Eg}from"util";import _s from"process";var Ae=e=>yi.includes(e),yi=[_s.stdin,_s.stdout,_s.stderr],we=["stdin","stdout","stderr"],gi=e=>we[e]??`stdio[${e}]`;var kp=e=>{let t={...e};for(let r of ks)t[r]=bs(e,r);return t},bs=(e,t)=>{let r=Array.from({length:Pg(e)+1}),i=jg(e[t],r,t);return Og(i,t)},Pg=({stdio:e})=>Array.isArray(e)?Math.max(e.length,we.length):we.length,jg=(e,t,r)=>Y(e)?Cg(e,t,r):t.fill(e),Cg=(e,t,r)=>{for(let i of Object.keys(e).sort(Tg))for(let n of Rg(i,r,t))t[n]=e[i];return t},Tg=(e,t)=>qp(e)<qp(t)?1:-1,qp=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,Rg=(e,t,r)=>{if(e==="ipc")return[r.length-1];let i=qs(e);if(i===void 0||i===0)throw new TypeError(`"${t}.${e}" is invalid.
102
102
  It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(i>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
103
- Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},qs=e=>{if(e==="all")return e;if(we.includes(e))return we.indexOf(e);let t=Rg.exec(e);if(t!==null)return Number(t[1])},Rg=/^fd(\d+)$/,Ig=(e,t)=>e.map(r=>r===void 0?Dg[t]:r),Og=Ag("execa").enabled?"full":"none",Dg={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Og,stripFinalNewline:!0},ks=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ze=(e,t)=>t==="ipc"?e.at(-1):e[t];var Rt=({verbose:e},t)=>vs(e,t)!=="none",It=({verbose:e},t)=>!["none","short"].includes(vs(e,t)),kp=({verbose:e},t)=>{let r=vs(e,t);return fi(r)?r:void 0},vs=(e,t)=>t===void 0?Lg(e):Ze(e,t),Lg=e=>e.find(t=>fi(t))??_i.findLast(t=>e.includes(t)),fi=e=>typeof e=="function",_i=["none","short","full"];import{inspect as af}from"util";import{platform as Bg}from"process";import{stripVTControlCharacters as zg}from"util";var vp=(e,t)=>{let r=[e,...t],i=r.join(" "),n=r.map(s=>Hg(wp(s))).join(" ");return{command:i,escapedCommand:n}},lr=e=>zg(e).split(`
104
- `).map(t=>wp(t)).join(`
105
- `),wp=e=>e.replaceAll(Gg,t=>Mg(t)),Mg=e=>{let t=Ug[e];if(t!==void 0)return t;let r=e.codePointAt(0),i=r.toString(16);return r<=Ng?`\\u${i.padStart(4,"0")}`:`\\U${i}`},Fg=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Gg=Fg(),Ug={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Ng=65535,Hg=e=>Vg.test(e)?e:Bg==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,Vg=/^[\w./-]+$/;import xp from"process";function ws(){let{env:e}=xp,{TERM:t,TERM_PROGRAM:r}=e;return xp.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Sp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},$p={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Wg={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Kg={...Sp,...$p},Yg={...Sp,...Wg},Jg=ws(),Xg=Jg?Kg:Yg,bi=Xg,Y$=Object.entries($p);import Zg from"tty";var Qg=Zg?.WriteStream?.prototype?.hasColors?.()??!1,A=(e,t)=>{if(!Qg)return n=>n;let r=`\x1B[${e}m`,i=`\x1B[${t}m`;return n=>{let s=n+"",a=s.indexOf(i);if(a===-1)return r+s+i;let o=r,p=0,c=(t===22?i:"")+r;for(;a!==-1;)o+=s.slice(p,a)+c,p=a+i.length,a=s.indexOf(i,p);return o+=s.slice(p)+i,o}},Z$=A(0,0),Ap=A(1,22),Q$=A(2,22),eA=A(3,23),tA=A(4,24),rA=A(53,55),iA=A(7,27),nA=A(8,28),sA=A(9,29),aA=A(30,39),oA=A(31,39),pA=A(32,39),cA=A(33,39),dA=A(34,39),uA=A(35,39),lA=A(36,39),mA=A(37,39),qi=A(90,39),hA=A(40,49),yA=A(41,49),gA=A(42,49),fA=A(43,49),_A=A(44,49),bA=A(45,49),qA=A(46,49),kA=A(47,49),vA=A(100,49),Ep=A(91,39),wA=A(92,39),Pp=A(93,39),xA=A(94,39),SA=A(95,39),$A=A(96,39),AA=A(97,39),EA=A(101,49),PA=A(102,49),jA=A(103,49),CA=A(104,49),TA=A(105,49),RA=A(106,49),IA=A(107,49);var Tp=({type:e,message:t,timestamp:r,piped:i,commandId:n,result:{failed:s=!1}={},options:{reject:a=!0}})=>{let o=ef(r),p=tf[e]({failed:s,reject:a,piped:i}),d=rf[e]({reject:a});return`${qi(`[${o}]`)} ${qi(`[${n}]`)} ${d(p)} ${d(t)}`},ef=e=>`${ki(e.getHours(),2)}:${ki(e.getMinutes(),2)}:${ki(e.getSeconds(),2)}.${ki(e.getMilliseconds(),3)}`,ki=(e,t)=>String(e).padStart(t,"0"),jp=({failed:e,reject:t})=>e?t?bi.cross:bi.warning:bi.tick,tf={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:jp,duration:jp},Cp=e=>e,rf={command:()=>Ap,output:()=>Cp,ipc:()=>Cp,error:({reject:e})=>e?Ep:Pp,duration:()=>qi};var Rp=(e,t,r)=>{let i=kp(t,r);return e.map(({verboseLine:n,verboseObject:s})=>nf(n,s,i)).filter(n=>n!==void 0).map(n=>sf(n)).join("")},nf=(e,t,r)=>{if(r===void 0)return e;let i=r(e,t);if(typeof i=="string")return i},sf=e=>e.endsWith(`
103
+ Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},qs=e=>{if(e==="all")return e;if(we.includes(e))return we.indexOf(e);let t=Ig.exec(e);if(t!==null)return Number(t[1])},Ig=/^fd(\d+)$/,Og=(e,t)=>e.map(r=>r===void 0?Lg[t]:r),Dg=Eg("execa").enabled?"full":"none",Lg={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Dg,stripFinalNewline:!0},ks=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ze=(e,t)=>t==="ipc"?e.at(-1):e[t];var Rt=({verbose:e},t)=>vs(e,t)!=="none",It=({verbose:e},t)=>!["none","short"].includes(vs(e,t)),vp=({verbose:e},t)=>{let r=vs(e,t);return fi(r)?r:void 0},vs=(e,t)=>t===void 0?Bg(e):Ze(e,t),Bg=e=>e.find(t=>fi(t))??_i.findLast(t=>e.includes(t)),fi=e=>typeof e=="function",_i=["none","short","full"];import{inspect as of}from"util";import{platform as zg}from"process";import{stripVTControlCharacters as Mg}from"util";var wp=(e,t)=>{let r=[e,...t],i=r.join(" "),n=r.map(s=>Vg(xp(s))).join(" ");return{command:i,escapedCommand:n}},lr=e=>Mg(e).split(`
104
+ `).map(t=>xp(t)).join(`
105
+ `),xp=e=>e.replaceAll(Ug,t=>Fg(t)),Fg=e=>{let t=Ng[e];if(t!==void 0)return t;let r=e.codePointAt(0),i=r.toString(16);return r<=Hg?`\\u${i.padStart(4,"0")}`:`\\U${i}`},Gg=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Ug=Gg(),Ng={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Hg=65535,Vg=e=>Wg.test(e)?e:zg==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,Wg=/^[\w./-]+$/;import Sp from"process";function ws(){let{env:e}=Sp,{TERM:t,TERM_PROGRAM:r}=e;return Sp.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var $p={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Ap={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Kg={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Yg={...$p,...Ap},Jg={...$p,...Kg},Xg=ws(),Zg=Xg?Yg:Jg,bi=Zg,J$=Object.entries(Ap);import Qg from"tty";var ef=Qg?.WriteStream?.prototype?.hasColors?.()??!1,A=(e,t)=>{if(!ef)return n=>n;let r=`\x1B[${e}m`,i=`\x1B[${t}m`;return n=>{let s=n+"",a=s.indexOf(i);if(a===-1)return r+s+i;let o=r,p=0,c=(t===22?i:"")+r;for(;a!==-1;)o+=s.slice(p,a)+c,p=a+i.length,a=s.indexOf(i,p);return o+=s.slice(p)+i,o}},Q$=A(0,0),Ep=A(1,22),eA=A(2,22),tA=A(3,23),rA=A(4,24),iA=A(53,55),nA=A(7,27),sA=A(8,28),aA=A(9,29),oA=A(30,39),pA=A(31,39),cA=A(32,39),dA=A(33,39),uA=A(34,39),lA=A(35,39),mA=A(36,39),hA=A(37,39),qi=A(90,39),yA=A(40,49),gA=A(41,49),fA=A(42,49),_A=A(43,49),bA=A(44,49),qA=A(45,49),kA=A(46,49),vA=A(47,49),wA=A(100,49),Pp=A(91,39),xA=A(92,39),jp=A(93,39),SA=A(94,39),$A=A(95,39),AA=A(96,39),EA=A(97,39),PA=A(101,49),jA=A(102,49),CA=A(103,49),TA=A(104,49),RA=A(105,49),IA=A(106,49),OA=A(107,49);var Rp=({type:e,message:t,timestamp:r,piped:i,commandId:n,result:{failed:s=!1}={},options:{reject:a=!0}})=>{let o=tf(r),p=rf[e]({failed:s,reject:a,piped:i}),d=nf[e]({reject:a});return`${qi(`[${o}]`)} ${qi(`[${n}]`)} ${d(p)} ${d(t)}`},tf=e=>`${ki(e.getHours(),2)}:${ki(e.getMinutes(),2)}:${ki(e.getSeconds(),2)}.${ki(e.getMilliseconds(),3)}`,ki=(e,t)=>String(e).padStart(t,"0"),Cp=({failed:e,reject:t})=>e?t?bi.cross:bi.warning:bi.tick,rf={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Cp,duration:Cp},Tp=e=>e,nf={command:()=>Ep,output:()=>Tp,ipc:()=>Tp,error:({reject:e})=>e?Pp:jp,duration:()=>qi};var Ip=(e,t,r)=>{let i=vp(t,r);return e.map(({verboseLine:n,verboseObject:s})=>sf(n,s,i)).filter(n=>n!==void 0).map(n=>af(n)).join("")},sf=(e,t,r)=>{if(r===void 0)return e;let i=r(e,t);if(typeof i=="string")return i},af=e=>e.endsWith(`
106
106
  `)?e:`${e}
107
- `;var De=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:i,result:n})=>{let s=of({type:e,result:n,verboseInfo:i}),a=pf(t,s),o=Rp(a,i,r);o!==""&&console.warn(o.slice(0,-1))},of=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=!1,...s}}})=>({type:e,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:t,options:s}),pf=(e,t)=>e.split(`
108
- `).map(r=>cf({...t,message:r})),cf=e=>({verboseLine:Tp(e),verboseObject:e}),vi=e=>{let t=typeof e=="string"?e:af(e);return lr(t).replaceAll(" "," ".repeat(df))},df=2;var Ip=(e,t)=>{Rt(t)&&De({type:"command",verboseMessage:e,verboseInfo:t})};var Op=(e,t,r)=>{mf(e);let i=uf(e);return{verbose:e,escapedCommand:t,commandId:i,rawOptions:r}},uf=e=>Rt({verbose:e})?lf++:void 0,lf=0n,mf=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!_i.includes(t)&&!fi(t)){let r=_i.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};import{hrtime as Dp}from"process";var wi=()=>Dp.bigint(),xs=e=>Number(Dp.bigint()-e)/1e6;var xi=(e,t,r)=>{let i=wi(),{command:n,escapedCommand:s}=vp(e,t),a=bs(r,"verbose"),o=Op(a,s,{...r});return Ip(s,o),{command:n,escapedCommand:s,startTime:i,verboseInfo:o}};var Od=D(xc(),1);import J_ from"path";import Id from"process";import Ei from"process";import qt from"path";function $i(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}import{promisify as Mf}from"util";import{execFile as Ff,execFileSync as vE}from"child_process";import Sc from"path";import{fileURLToPath as Gf}from"url";var SE=Mf(Ff);function Ai(e){return e instanceof URL?Gf(e):e}function $c(e){return{*[Symbol.iterator](){let t=Sc.resolve(Ai(e)),r;for(;r!==t;)yield t,r=t,t=Sc.resolve(t,"..")}}}var $E=10*1024*1024;var Uf=({cwd:e=Ei.cwd(),path:t=Ei.env[$i()],preferLocal:r=!0,execPath:i=Ei.execPath,addExecPath:n=!0}={})=>{let s=qt.resolve(Ai(e)),a=[],o=t.split(qt.delimiter);return r&&Nf(a,o,s),n&&Hf(a,o,i,s),t===""||t===qt.delimiter?`${a.join(qt.delimiter)}${t}`:[...a,t].join(qt.delimiter)},Nf=(e,t,r)=>{for(let i of $c(r)){let n=qt.join(i,"node_modules/.bin");t.includes(n)||e.push(n)}},Hf=(e,t,r,i)=>{let n=qt.resolve(i,Ai(r),"..");t.includes(n)||e.push(n)},Ac=({env:e=Ei.env,...t}={})=>{e={...e};let r=$i({env:e});return t.path=e[r],e[r]=Uf(t),e};import{setTimeout as a_}from"timers/promises";var Ec=(e,t,r)=>{let i=r?hr:mr,n=e instanceof Ee?{}:{cause:e};return new i(t,n)},Ee=class extends Error{},Pc=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Cc,{value:!0,writable:!1,enumerable:!1,configurable:!1})},jc=e=>Pi(e)&&Cc in e,Cc=Symbol("isExecaError"),Pi=e=>Object.prototype.toString.call(e)==="[object Error]",mr=class extends Error{};Pc(mr,mr.name);var hr=class extends Error{};Pc(hr,hr.name);import{constants as yr}from"os";import{constants as Yf}from"os";var Tc=()=>{let e=Ic-Rc+1;return Array.from({length:e},Vf)},Vf=(e,t)=>({name:`SIGRT${t+1}`,number:Rc+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Rc=34,Ic=64;import{constants as Wf}from"os";var Oc=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Is=()=>{let e=Tc();return[...Oc,...e].map(Kf)},Kf=({name:e,number:t,description:r,action:i,forced:n=!1,standard:s})=>{let{signals:{[e]:a}}=Wf,o=a!==void 0;return{name:e,number:o?a:t,description:r,supported:o,action:i,forced:n,standard:s}};var Jf=()=>{let e=Is();return Object.fromEntries(e.map(Xf))},Xf=({name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a})=>[e,{name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a}],Dc=Jf(),Zf=()=>{let e=Is(),t=65,r=Array.from({length:t},(i,n)=>Qf(n,e));return Object.assign({},...r)},Qf=(e,t)=>{let r=e_(e,t);if(r===void 0)return{};let{name:i,description:n,supported:s,action:a,forced:o,standard:p}=r;return{[e]:{name:i,number:e,description:n,supported:s,action:a,forced:o,standard:p}}},e_=(e,t)=>{let r=t.find(({name:i})=>Yf.signals[i]===e);return r!==void 0?r:t.find(i=>i.number===e)},UE=Zf();var Bc=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Mc(e,t)},zc=e=>e===0?e:Mc(e,"`subprocess.kill()`'s argument"),Mc=(e,t)=>{if(Number.isInteger(e))return t_(e,t);if(typeof e=="string")return i_(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
109
- ${Os()}`)},t_=(e,t)=>{if(Lc.has(e))return Lc.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
110
- ${Os()}`)},r_=()=>new Map(Object.entries(yr.signals).reverse().map(([e,t])=>[t,e])),Lc=r_(),i_=(e,t)=>{if(e in yr.signals)return e;throw e.toUpperCase()in yr.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
111
- ${Os()}`)},Os=()=>`Available signal names: ${n_()}.
112
- Available signal numbers: ${s_()}.`,n_=()=>Object.keys(yr.signals).sort().map(e=>`'${e}'`).join(", "),s_=()=>[...new Set(Object.values(yr.signals).sort((e,t)=>e-t))].join(", "),ji=e=>Dc[e].description;var Fc=e=>{if(e===!1)return e;if(e===!0)return o_;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},o_=1e3*5,Gc=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:i,context:n,controller:s},a,o)=>{let{signal:p,error:d}=p_(a,o,r);c_(d,i);let c=e(p);return d_({kill:e,signal:p,forceKillAfterDelay:t,killSignal:r,killResult:c,context:n,controller:s}),c},p_=(e,t,r)=>{let[i=r,n]=Pi(e)?[void 0,e]:[e,t];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Pi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return{signal:zc(i),error:n}},c_=(e,t)=>{e!==void 0&&t.reject(e)},d_=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:a})=>{t===i&&n&&Ds({kill:e,forceKillAfterDelay:r,context:s,controllerSignal:a.signal})},Ds=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:i})=>{if(t!==!1)try{await a_(t,void 0,{signal:i}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as u_}from"events";var Ci=async(e,t)=>{e.aborted||await u_(e,"abort",{signal:t})};var Uc=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Nc=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:i,controller:n})=>t===void 0||r?[]:[l_(e,t,i,n)],l_=async(e,t,r,{signal:i})=>{throw await Ci(t,i),r.terminationReason??="cancel",e.kill(),t.reason};import{scheduler as R_}from"timers/promises";import{promisify as j_}from"util";var Lt=({methodName:e,isSubprocess:t,ipc:r,isConnected:i})=>{m_(e,t,r),Ls(e,t,i)},m_=(e,t,r)=>{if(!r)throw new Error(`${Pe(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Ls=(e,t,r)=>{if(!r)throw new Error(`${Pe(e,t)} cannot be used: the ${ot(t)} has already exited or disconnected.`)},Hc=e=>{throw new Error(`${Pe("getOneMessage",e)} could not complete: the ${ot(e)} exited or disconnected.`)},Vc=e=>{throw new Error(`${Pe("sendMessage",e)} failed: the ${ot(e)} is sending a message too, instead of listening to incoming messages.
107
+ `;var De=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:i,result:n})=>{let s=pf({type:e,result:n,verboseInfo:i}),a=cf(t,s),o=Ip(a,i,r);o!==""&&console.warn(o.slice(0,-1))},pf=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=!1,...s}}})=>({type:e,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:t,options:s}),cf=(e,t)=>e.split(`
108
+ `).map(r=>df({...t,message:r})),df=e=>({verboseLine:Rp(e),verboseObject:e}),vi=e=>{let t=typeof e=="string"?e:of(e);return lr(t).replaceAll(" "," ".repeat(uf))},uf=2;var Op=(e,t)=>{Rt(t)&&De({type:"command",verboseMessage:e,verboseInfo:t})};var Dp=(e,t,r)=>{hf(e);let i=lf(e);return{verbose:e,escapedCommand:t,commandId:i,rawOptions:r}},lf=e=>Rt({verbose:e})?mf++:void 0,mf=0n,hf=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!_i.includes(t)&&!fi(t)){let r=_i.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};import{hrtime as Lp}from"process";var wi=()=>Lp.bigint(),xs=e=>Number(Lp.bigint()-e)/1e6;var xi=(e,t,r)=>{let i=wi(),{command:n,escapedCommand:s}=wp(e,t),a=bs(r,"verbose"),o=Dp(a,s,{...r});return Op(s,o),{command:n,escapedCommand:s,startTime:i,verboseInfo:o}};var Dd=D(Sc(),1);import X_ from"path";import Od from"process";import Ei from"process";import qt from"path";function $i(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}import{promisify as Ff}from"util";import{execFile as Gf,execFileSync as wE}from"child_process";import $c from"path";import{fileURLToPath as Uf}from"url";var $E=Ff(Gf);function Ai(e){return e instanceof URL?Uf(e):e}function Ac(e){return{*[Symbol.iterator](){let t=$c.resolve(Ai(e)),r;for(;r!==t;)yield t,r=t,t=$c.resolve(t,"..")}}}var AE=10*1024*1024;var Nf=({cwd:e=Ei.cwd(),path:t=Ei.env[$i()],preferLocal:r=!0,execPath:i=Ei.execPath,addExecPath:n=!0}={})=>{let s=qt.resolve(Ai(e)),a=[],o=t.split(qt.delimiter);return r&&Hf(a,o,s),n&&Vf(a,o,i,s),t===""||t===qt.delimiter?`${a.join(qt.delimiter)}${t}`:[...a,t].join(qt.delimiter)},Hf=(e,t,r)=>{for(let i of Ac(r)){let n=qt.join(i,"node_modules/.bin");t.includes(n)||e.push(n)}},Vf=(e,t,r,i)=>{let n=qt.resolve(i,Ai(r),"..");t.includes(n)||e.push(n)},Ec=({env:e=Ei.env,...t}={})=>{e={...e};let r=$i({env:e});return t.path=e[r],e[r]=Nf(t),e};import{setTimeout as o_}from"timers/promises";var Pc=(e,t,r)=>{let i=r?hr:mr,n=e instanceof Ee?{}:{cause:e};return new i(t,n)},Ee=class extends Error{},jc=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Tc,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Cc=e=>Pi(e)&&Tc in e,Tc=Symbol("isExecaError"),Pi=e=>Object.prototype.toString.call(e)==="[object Error]",mr=class extends Error{};jc(mr,mr.name);var hr=class extends Error{};jc(hr,hr.name);import{constants as yr}from"os";import{constants as Jf}from"os";var Rc=()=>{let e=Oc-Ic+1;return Array.from({length:e},Wf)},Wf=(e,t)=>({name:`SIGRT${t+1}`,number:Ic+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ic=34,Oc=64;import{constants as Kf}from"os";var Dc=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Is=()=>{let e=Rc();return[...Dc,...e].map(Yf)},Yf=({name:e,number:t,description:r,action:i,forced:n=!1,standard:s})=>{let{signals:{[e]:a}}=Kf,o=a!==void 0;return{name:e,number:o?a:t,description:r,supported:o,action:i,forced:n,standard:s}};var Xf=()=>{let e=Is();return Object.fromEntries(e.map(Zf))},Zf=({name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a})=>[e,{name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a}],Lc=Xf(),Qf=()=>{let e=Is(),t=65,r=Array.from({length:t},(i,n)=>e_(n,e));return Object.assign({},...r)},e_=(e,t)=>{let r=t_(e,t);if(r===void 0)return{};let{name:i,description:n,supported:s,action:a,forced:o,standard:p}=r;return{[e]:{name:i,number:e,description:n,supported:s,action:a,forced:o,standard:p}}},t_=(e,t)=>{let r=t.find(({name:i})=>Jf.signals[i]===e);return r!==void 0?r:t.find(i=>i.number===e)},NE=Qf();var zc=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Fc(e,t)},Mc=e=>e===0?e:Fc(e,"`subprocess.kill()`'s argument"),Fc=(e,t)=>{if(Number.isInteger(e))return r_(e,t);if(typeof e=="string")return n_(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
109
+ ${Os()}`)},r_=(e,t)=>{if(Bc.has(e))return Bc.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
110
+ ${Os()}`)},i_=()=>new Map(Object.entries(yr.signals).reverse().map(([e,t])=>[t,e])),Bc=i_(),n_=(e,t)=>{if(e in yr.signals)return e;throw e.toUpperCase()in yr.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
111
+ ${Os()}`)},Os=()=>`Available signal names: ${s_()}.
112
+ Available signal numbers: ${a_()}.`,s_=()=>Object.keys(yr.signals).sort().map(e=>`'${e}'`).join(", "),a_=()=>[...new Set(Object.values(yr.signals).sort((e,t)=>e-t))].join(", "),ji=e=>Lc[e].description;var Gc=e=>{if(e===!1)return e;if(e===!0)return p_;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},p_=1e3*5,Uc=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:i,context:n,controller:s},a,o)=>{let{signal:p,error:d}=c_(a,o,r);d_(d,i);let c=e(p);return u_({kill:e,signal:p,forceKillAfterDelay:t,killSignal:r,killResult:c,context:n,controller:s}),c},c_=(e,t,r)=>{let[i=r,n]=Pi(e)?[void 0,e]:[e,t];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Pi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return{signal:Mc(i),error:n}},d_=(e,t)=>{e!==void 0&&t.reject(e)},u_=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:a})=>{t===i&&n&&Ds({kill:e,forceKillAfterDelay:r,context:s,controllerSignal:a.signal})},Ds=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:i})=>{if(t!==!1)try{await o_(t,void 0,{signal:i}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as l_}from"events";var Ci=async(e,t)=>{e.aborted||await l_(e,"abort",{signal:t})};var Nc=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Hc=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:i,controller:n})=>t===void 0||r?[]:[m_(e,t,i,n)],m_=async(e,t,r,{signal:i})=>{throw await Ci(t,i),r.terminationReason??="cancel",e.kill(),t.reason};import{scheduler as I_}from"timers/promises";import{promisify as C_}from"util";var Lt=({methodName:e,isSubprocess:t,ipc:r,isConnected:i})=>{h_(e,t,r),Ls(e,t,i)},h_=(e,t,r)=>{if(!r)throw new Error(`${Pe(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Ls=(e,t,r)=>{if(!r)throw new Error(`${Pe(e,t)} cannot be used: the ${ot(t)} has already exited or disconnected.`)},Vc=e=>{throw new Error(`${Pe("getOneMessage",e)} could not complete: the ${ot(e)} exited or disconnected.`)},Wc=e=>{throw new Error(`${Pe("sendMessage",e)} failed: the ${ot(e)} is sending a message too, instead of listening to incoming messages.
113
113
  This can be fixed by both sending a message and listening to incoming messages at the same time:
114
114
 
115
115
  const [receivedMessage] = await Promise.all([
116
116
  ${Pe("getOneMessage",e)},
117
117
  ${Pe("sendMessage",e,"message, {strict: true}")},
118
- ]);`)},Ti=(e,t)=>new Error(`${Pe("sendMessage",t)} failed when sending an acknowledgment response to the ${ot(t)}.`,{cause:e}),Wc=e=>{throw new Error(`${Pe("sendMessage",e)} failed: the ${ot(e)} is not listening to incoming messages.`)},Kc=e=>{throw new Error(`${Pe("sendMessage",e)} failed: the ${ot(e)} exited without listening to incoming messages.`)},Yc=()=>new Error(`\`cancelSignal\` aborted: the ${ot(!0)} disconnected.`),Jc=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Xc=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${Pe(t,r)} cannot be used: the ${ot(r)} is disconnecting.`,{cause:e})},Zc=({error:e,methodName:t,isSubprocess:r,message:i})=>{if(h_(e))throw new Error(`${Pe(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:e})},h_=({code:e,message:t})=>y_.has(e)||g_.some(r=>t.includes(r)),y_=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),g_=["could not be cloned","circular structure","call stack size exceeded"],Pe=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${f_(t)}${e}(${r})`,f_=e=>e?"":"subprocess.",ot=e=>e?"parent process":"subprocess",Bt=e=>{e.connected&&e.disconnect()};var Le=()=>{let e={},t=new Promise((r,i)=>{Object.assign(e,{resolve:r,reject:i})});return Object.assign(t,e)};var Ii=(e,t="stdin")=>{let{options:i,fileDescriptors:n}=Be.get(e),s=Qc(n,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(ed(s,t,i,!0));return a},zt=(e,t="stdout")=>{let{options:i,fileDescriptors:n}=Be.get(e),s=Qc(n,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(ed(s,t,i,!1));return a},Be=new WeakMap,Qc=(e,t,r)=>{let i=__(t,r);return b_(i,t,r,e),i},__=(e,t)=>{let r=qs(e);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${gr(t)}" must not be "${e}".
118
+ ]);`)},Ti=(e,t)=>new Error(`${Pe("sendMessage",t)} failed when sending an acknowledgment response to the ${ot(t)}.`,{cause:e}),Kc=e=>{throw new Error(`${Pe("sendMessage",e)} failed: the ${ot(e)} is not listening to incoming messages.`)},Yc=e=>{throw new Error(`${Pe("sendMessage",e)} failed: the ${ot(e)} exited without listening to incoming messages.`)},Jc=()=>new Error(`\`cancelSignal\` aborted: the ${ot(!0)} disconnected.`),Xc=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Zc=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${Pe(t,r)} cannot be used: the ${ot(r)} is disconnecting.`,{cause:e})},Qc=({error:e,methodName:t,isSubprocess:r,message:i})=>{if(y_(e))throw new Error(`${Pe(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:e})},y_=({code:e,message:t})=>g_.has(e)||f_.some(r=>t.includes(r)),g_=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),f_=["could not be cloned","circular structure","call stack size exceeded"],Pe=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${__(t)}${e}(${r})`,__=e=>e?"":"subprocess.",ot=e=>e?"parent process":"subprocess",Bt=e=>{e.connected&&e.disconnect()};var Le=()=>{let e={},t=new Promise((r,i)=>{Object.assign(e,{resolve:r,reject:i})});return Object.assign(t,e)};var Ii=(e,t="stdin")=>{let{options:i,fileDescriptors:n}=Be.get(e),s=ed(n,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(td(s,t,i,!0));return a},zt=(e,t="stdout")=>{let{options:i,fileDescriptors:n}=Be.get(e),s=ed(n,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(td(s,t,i,!1));return a},Be=new WeakMap,ed=(e,t,r)=>{let i=b_(t,r);return q_(i,t,r,e),i},b_=(e,t)=>{let r=qs(e);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${gr(t)}" must not be "${e}".
119
119
  It must be ${i} or "fd3", "fd4" (and so on).
120
- It is optional and defaults to "${n}".`)},b_=(e,t,r,i)=>{let n=i[td(e)];if(n===void 0)throw new TypeError(`"${gr(r)}" must not be ${t}. That file descriptor does not exist.
121
- Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${gr(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${gr(r)}" must not be ${t}. It must be a writable stream, not readable.`)},ed=(e,t,r,i)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=q_(e,r);return`The "${n}: ${Ri(s)}" option is incompatible with using "${gr(i)}: ${Ri(t)}".
122
- Please set this option with "pipe" instead.`},q_=(e,{stdin:t,stdout:r,stderr:i,stdio:n})=>{let s=td(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},td=e=>e==="all"?1:e,gr=e=>e?"to":"from",Ri=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";import{once as $_}from"events";import{addAbortListener as k_}from"events";var kt=(e,t,r)=>{let i=e.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(e.setMaxListeners(i+t),k_(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};import{EventEmitter as x_}from"events";import{once as v_}from"events";import{scheduler as w_}from"timers/promises";var Oi=(e,t)=>{t&&Bs(e)},Bs=e=>{e.refCounted()},Di=(e,t)=>{t&&zs(e)},zs=e=>{e.unrefCounted()},rd=(e,t)=>{t&&(zs(e),zs(e))},id=(e,t)=>{t&&(Bs(e),Bs(e))};var nd=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i},n)=>{if(od(n)||cd(n))return;Li.has(e)||Li.set(e,[]);let s=Li.get(e);if(s.push(n),!(s.length>1))for(;s.length>0;){await pd(e,i,n),await w_.yield();let a=await ad({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",a),i.emit("message:done")}},sd=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Ms();let s=Li.get(e);for(;s?.length>0;)await v_(i,"message:done");e.removeListener("message",n),id(t,r),i.connected=!1,i.emit("disconnect")},Li=new WeakMap;var pt=(e,t,r)=>{if(Bi.has(e))return Bi.get(e);let i=new x_;return i.connected=!0,Bi.set(e,i),S_({ipcEmitter:i,anyProcess:e,channel:t,isSubprocess:r}),i},Bi=new WeakMap,S_=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:i})=>{let n=nd.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e});t.on("message",n),t.once("disconnect",sd.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e,boundOnMessage:n})),rd(r,i)},zi=e=>{let t=Bi.get(e);return t===void 0?e.channel!==null:t.connected};var dd=({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=pt(e,t,r),a=Gi(e,s);return{id:A_++,type:Fi,message:i,hasListeners:a}},A_=0n,ud=(e,t)=>{if(!(t?.type!==Fi||t.hasListeners))for(let{id:r}of e)r!==void 0&&Mi[r].resolve({isDeadlock:!0,hasListeners:!1})},ad=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(e?.type!==Fi||!t.connected)return e;let{id:s,message:a}=e,o={id:s,type:md,message:Gi(t,n)};try{await Ui({anyProcess:t,channel:r,isSubprocess:i,ipc:!0},o)}catch(p){n.emit("strict:error",p)}return a},od=e=>{if(e?.type!==md)return!1;let{id:t,message:r}=e;return Mi[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},ld=async(e,t,r)=>{if(e?.type!==Fi)return;let i=Le();Mi[e.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:a}=await Promise.race([i,E_(t,r,n)]);s&&Vc(r),a||Wc(r)}finally{n.abort(),delete Mi[e.id]}},Mi={},E_=async(e,t,{signal:r})=>{kt(e,1,r),await $_(e,"disconnect",{signal:r}),Kc(t)},Fi="execa:ipc:request",md="execa:ipc:response";var hd=(e,t,r)=>{fr.has(e)||fr.set(e,new Set);let i=fr.get(e),n=Le(),s=r?t.id:void 0,a={onMessageSent:n,id:s};return i.add(a),{outgoingMessages:i,outgoingMessage:a}},yd=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},pd=async(e,t,r)=>{for(;!Gi(e,t)&&fr.get(e)?.size>0;){let i=[...fr.get(e)];ud(i,r),await Promise.all(i.map(({onMessageSent:n})=>n))}},fr=new WeakMap,Gi=(e,t)=>t.listenerCount("message")>P_(e),P_=e=>Be.has(e)&&!Ze(Be.get(e).options.buffer,"ipc")?1:0;var Ui=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},n,{strict:s=!1}={})=>{let a="sendMessage";return Lt({methodName:a,isSubprocess:r,ipc:i,isConnected:e.connected}),C_({anyProcess:e,channel:t,methodName:a,isSubprocess:r,message:n,strict:s})},C_=async({anyProcess:e,channel:t,methodName:r,isSubprocess:i,message:n,strict:s})=>{let a=dd({anyProcess:e,channel:t,isSubprocess:i,message:n,strict:s}),o=hd(e,a,s);try{await Gs({anyProcess:e,methodName:r,isSubprocess:i,wrappedMessage:a,message:n})}catch(p){throw Bt(e),p}finally{yd(o)}},Gs=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=T_(e);try{await Promise.all([ld(i,e,r),s(i)])}catch(a){throw Xc({error:a,methodName:t,isSubprocess:r}),Zc({error:a,methodName:t,isSubprocess:r,message:n}),a}},T_=e=>{if(Fs.has(e))return Fs.get(e);let t=j_(e.send.bind(e));return Fs.set(e,t),t},Fs=new WeakMap;var fd=(e,t)=>{let r="cancelSignal";return Ls(r,!1,e.connected),Gs({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:bd,message:t},message:t})},_d=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>(await I_({anyProcess:e,channel:t,isSubprocess:r,ipc:i}),Us.signal),I_=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>{if(!gd){if(gd=!0,!i){Jc();return}if(t===null){Ms();return}pt(e,t,r),await R_.yield()}},gd=!1,cd=e=>e?.type!==bd?!1:(Us.abort(e.message),!0),bd="execa:ipc:cancel",Ms=()=>{Us.abort(Yc())},Us=new AbortController;var qd=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:i})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},kd=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[O_({subprocess:e,cancelSignal:t,forceKillAfterDelay:i,context:n,controller:s})]:[],O_=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Ci(t,n);let s=D_(t);throw await fd(e,s),Ds({kill:e.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",t.reason},D_=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};import{setTimeout as L_}from"timers/promises";var vd=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},wd=(e,t,r,i)=>t===0||t===void 0?[]:[B_(e,t,r,i)],B_=async(e,t,r,{signal:i})=>{throw await L_(t,void 0,{signal:i}),r.terminationReason??="timeout",e.kill(),new Ee};import{execPath as z_,execArgv as M_}from"process";import xd from"path";var Sd=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},$d=(e,t,{node:r=!1,nodePath:i=z_,nodeOptions:n=M_.filter(p=>!p.startsWith("--inspect")),cwd:s,execPath:a,...o})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let p=Tt(i,'The "nodePath" option'),d=xd.resolve(s,p),c={...o,nodePath:d,node:r,cwd:s};if(!r)return[e,t,c];if(xd.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...n,e,...t],{ipc:!0,...c,shell:!1}]};import{serialize as F_}from"v8";var Ad=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");N_[r](e)}},G_=e=>{try{F_(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},U_=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},N_={advanced:G_,json:U_},Ed=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};var jd=({encoding:e})=>{if(Ns.has(e))return;let t=V_(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ni(e)}\`.
120
+ It is optional and defaults to "${n}".`)},q_=(e,t,r,i)=>{let n=i[rd(e)];if(n===void 0)throw new TypeError(`"${gr(r)}" must not be ${t}. That file descriptor does not exist.
121
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${gr(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${gr(r)}" must not be ${t}. It must be a writable stream, not readable.`)},td=(e,t,r,i)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=k_(e,r);return`The "${n}: ${Ri(s)}" option is incompatible with using "${gr(i)}: ${Ri(t)}".
122
+ Please set this option with "pipe" instead.`},k_=(e,{stdin:t,stdout:r,stderr:i,stdio:n})=>{let s=rd(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},rd=e=>e==="all"?1:e,gr=e=>e?"to":"from",Ri=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";import{once as A_}from"events";import{addAbortListener as v_}from"events";var kt=(e,t,r)=>{let i=e.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(e.setMaxListeners(i+t),v_(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};import{EventEmitter as S_}from"events";import{once as w_}from"events";import{scheduler as x_}from"timers/promises";var Oi=(e,t)=>{t&&Bs(e)},Bs=e=>{e.refCounted()},Di=(e,t)=>{t&&zs(e)},zs=e=>{e.unrefCounted()},id=(e,t)=>{t&&(zs(e),zs(e))},nd=(e,t)=>{t&&(Bs(e),Bs(e))};var sd=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i},n)=>{if(pd(n)||dd(n))return;Li.has(e)||Li.set(e,[]);let s=Li.get(e);if(s.push(n),!(s.length>1))for(;s.length>0;){await cd(e,i,n),await x_.yield();let a=await od({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",a),i.emit("message:done")}},ad=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Ms();let s=Li.get(e);for(;s?.length>0;)await w_(i,"message:done");e.removeListener("message",n),nd(t,r),i.connected=!1,i.emit("disconnect")},Li=new WeakMap;var pt=(e,t,r)=>{if(Bi.has(e))return Bi.get(e);let i=new S_;return i.connected=!0,Bi.set(e,i),$_({ipcEmitter:i,anyProcess:e,channel:t,isSubprocess:r}),i},Bi=new WeakMap,$_=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:i})=>{let n=sd.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e});t.on("message",n),t.once("disconnect",ad.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e,boundOnMessage:n})),id(r,i)},zi=e=>{let t=Bi.get(e);return t===void 0?e.channel!==null:t.connected};var ud=({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=pt(e,t,r),a=Gi(e,s);return{id:E_++,type:Fi,message:i,hasListeners:a}},E_=0n,ld=(e,t)=>{if(!(t?.type!==Fi||t.hasListeners))for(let{id:r}of e)r!==void 0&&Mi[r].resolve({isDeadlock:!0,hasListeners:!1})},od=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(e?.type!==Fi||!t.connected)return e;let{id:s,message:a}=e,o={id:s,type:hd,message:Gi(t,n)};try{await Ui({anyProcess:t,channel:r,isSubprocess:i,ipc:!0},o)}catch(p){n.emit("strict:error",p)}return a},pd=e=>{if(e?.type!==hd)return!1;let{id:t,message:r}=e;return Mi[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},md=async(e,t,r)=>{if(e?.type!==Fi)return;let i=Le();Mi[e.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:a}=await Promise.race([i,P_(t,r,n)]);s&&Wc(r),a||Kc(r)}finally{n.abort(),delete Mi[e.id]}},Mi={},P_=async(e,t,{signal:r})=>{kt(e,1,r),await A_(e,"disconnect",{signal:r}),Yc(t)},Fi="execa:ipc:request",hd="execa:ipc:response";var yd=(e,t,r)=>{fr.has(e)||fr.set(e,new Set);let i=fr.get(e),n=Le(),s=r?t.id:void 0,a={onMessageSent:n,id:s};return i.add(a),{outgoingMessages:i,outgoingMessage:a}},gd=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},cd=async(e,t,r)=>{for(;!Gi(e,t)&&fr.get(e)?.size>0;){let i=[...fr.get(e)];ld(i,r),await Promise.all(i.map(({onMessageSent:n})=>n))}},fr=new WeakMap,Gi=(e,t)=>t.listenerCount("message")>j_(e),j_=e=>Be.has(e)&&!Ze(Be.get(e).options.buffer,"ipc")?1:0;var Ui=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},n,{strict:s=!1}={})=>{let a="sendMessage";return Lt({methodName:a,isSubprocess:r,ipc:i,isConnected:e.connected}),T_({anyProcess:e,channel:t,methodName:a,isSubprocess:r,message:n,strict:s})},T_=async({anyProcess:e,channel:t,methodName:r,isSubprocess:i,message:n,strict:s})=>{let a=ud({anyProcess:e,channel:t,isSubprocess:i,message:n,strict:s}),o=yd(e,a,s);try{await Gs({anyProcess:e,methodName:r,isSubprocess:i,wrappedMessage:a,message:n})}catch(p){throw Bt(e),p}finally{gd(o)}},Gs=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=R_(e);try{await Promise.all([md(i,e,r),s(i)])}catch(a){throw Zc({error:a,methodName:t,isSubprocess:r}),Qc({error:a,methodName:t,isSubprocess:r,message:n}),a}},R_=e=>{if(Fs.has(e))return Fs.get(e);let t=C_(e.send.bind(e));return Fs.set(e,t),t},Fs=new WeakMap;var _d=(e,t)=>{let r="cancelSignal";return Ls(r,!1,e.connected),Gs({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:qd,message:t},message:t})},bd=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>(await O_({anyProcess:e,channel:t,isSubprocess:r,ipc:i}),Us.signal),O_=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>{if(!fd){if(fd=!0,!i){Xc();return}if(t===null){Ms();return}pt(e,t,r),await I_.yield()}},fd=!1,dd=e=>e?.type!==qd?!1:(Us.abort(e.message),!0),qd="execa:ipc:cancel",Ms=()=>{Us.abort(Jc())},Us=new AbortController;var kd=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:i})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},vd=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[D_({subprocess:e,cancelSignal:t,forceKillAfterDelay:i,context:n,controller:s})]:[],D_=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Ci(t,n);let s=L_(t);throw await _d(e,s),Ds({kill:e.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",t.reason},L_=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};import{setTimeout as B_}from"timers/promises";var wd=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},xd=(e,t,r,i)=>t===0||t===void 0?[]:[z_(e,t,r,i)],z_=async(e,t,r,{signal:i})=>{throw await B_(t,void 0,{signal:i}),r.terminationReason??="timeout",e.kill(),new Ee};import{execPath as M_,execArgv as F_}from"process";import Sd from"path";var $d=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Ad=(e,t,{node:r=!1,nodePath:i=M_,nodeOptions:n=F_.filter(p=>!p.startsWith("--inspect")),cwd:s,execPath:a,...o})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let p=Tt(i,'The "nodePath" option'),d=Sd.resolve(s,p),c={...o,nodePath:d,node:r,cwd:s};if(!r)return[e,t,c];if(Sd.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...n,e,...t],{ipc:!0,...c,shell:!1}]};import{serialize as G_}from"v8";var Ed=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");H_[r](e)}},U_=e=>{try{G_(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},N_=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},H_={advanced:U_,json:N_},Pd=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};var Cd=({encoding:e})=>{if(Ns.has(e))return;let t=W_(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ni(e)}\`.
123
123
  Please rename it to ${Ni(t)}.`);let r=[...Ns].map(i=>Ni(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ni(e)}\`.
124
- Please rename it to one of: ${r}.`)},H_=new Set(["utf8","utf16le"]),fe=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ns=new Set([...H_,...fe]),V_=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Pd)return Pd[t];if(Ns.has(t))return t},Pd={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ni=e=>typeof e=="string"?`"${e}"`:String(e);import{statSync as W_}from"fs";import K_ from"path";import Y_ from"process";var Cd=(e=Td())=>{let t=Tt(e,'The "cwd" option');return K_.resolve(t)},Td=()=>{try{return Y_.cwd()}catch(e){throw e.message=`The current directory does not exist.
125
- ${e.message}`,e}},Rd=(e,t)=>{if(t===Td())return e;let r;try{r=W_(t)}catch(i){return`The "cwd" option is invalid: ${t}.
124
+ Please rename it to one of: ${r}.`)},V_=new Set(["utf8","utf16le"]),fe=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ns=new Set([...V_,...fe]),W_=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in jd)return jd[t];if(Ns.has(t))return t},jd={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ni=e=>typeof e=="string"?`"${e}"`:String(e);import{statSync as K_}from"fs";import Y_ from"path";import J_ from"process";var Td=(e=Rd())=>{let t=Tt(e,'The "cwd" option');return Y_.resolve(t)},Rd=()=>{try{return J_.cwd()}catch(e){throw e.message=`The current directory does not exist.
125
+ ${e.message}`,e}},Id=(e,t)=>{if(t===Rd())return e;let r;try{r=K_(t)}catch(i){return`The "cwd" option is invalid: ${t}.
126
126
  ${i.message}
127
127
  ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
128
- ${e}`};var Hi=(e,t,r)=>{r.cwd=Cd(r.cwd);let[i,n,s]=$d(e,t,r),{command:a,args:o,options:p}=Od.default._parse(i,n,s),d=qp(p),c=X_(d);return vd(c),jd(c),Ad(c),Uc(c),qd(c),c.shell=gs(c.shell),c.env=Z_(c),c.killSignal=Bc(c.killSignal),c.forceKillAfterDelay=Fc(c.forceKillAfterDelay),c.lines=c.lines.map((u,l)=>u&&!fe.has(c.encoding)&&c.buffer[l]),Id.platform==="win32"&&J_.basename(a,".exe")==="cmd"&&o.unshift("/q"),{file:a,commandArguments:o,options:c}},X_=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=!0,cleanup:a=!0,all:o=!1,windowsHide:p=!0,killSignal:d="SIGTERM",forceKillAfterDelay:c=!0,gracefulCancel:u=!1,ipcInput:l,ipc:m=l!==void 0||u,serialization:h="advanced",...f})=>({...f,extendEnv:e,preferLocal:t,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:a,all:o,windowsHide:p,killSignal:d,forceKillAfterDelay:c,gracefulCancel:u,ipcInput:l,ipc:m,serialization:h}),Z_=({env:e,extendEnv:t,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let a=t?{...Id.env,...e}:e;return r||i?Ac({env:a,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):a};var Vi=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];import{inspect as Tb}from"util";function Mt(e){if(typeof e=="string")return Q_(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return eb(e)}var Q_=e=>e.at(-1)===Dd?e.slice(0,e.at(-2)===Ld?-2:-1):e,eb=e=>e.at(-1)===tb?e.subarray(0,e.at(-2)===rb?-2:-1):e,Dd=`
129
- `,tb=Dd.codePointAt(0),Ld="\r",rb=Ld.codePointAt(0);import{on as Eb}from"events";import{finished as Pb}from"stream/promises";function je(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function Hs(e,{checkOpen:t=!0}={}){return je(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function vt(e,{checkOpen:t=!0}={}){return je(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function Vs(e,t){return Hs(e,t)&&vt(e,t)}var ib=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Ws=class{#t;#r;#e=!1;#i=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#s();return this.#i=this.#i?this.#i.then(t,t):t(),this.#i}return(t){let r=()=>this.#n(t);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#i=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#i=void 0,this.#e=!0,this.#t.releaseLock()),t}async#n(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},Ks=Symbol();function Bd(){return this[Ks].next()}Object.defineProperty(Bd,"name",{value:"next"});function zd(e){return this[Ks].return(e)}Object.defineProperty(zd,"name",{value:"return"});var nb=Object.create(ib,{next:{enumerable:!0,configurable:!0,writable:!0,value:Bd},return:{enumerable:!0,configurable:!0,writable:!0,value:zd}});function Ys({preventCancel:e=!1}={}){let t=this.getReader(),r=new Ws(t,e),i=Object.create(nb);return i[Ks]=r,i}var Md=e=>{if(vt(e,{checkOpen:!1})&&_r.on!==void 0)return ab(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(sb.call(e)==="[object ReadableStream]")return Ys.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:sb}=Object.prototype,ab=async function*(e){let t=new AbortController,r={};ob(e,t,r);try{for await(let[i]of _r.on(e,"data",{signal:t.signal}))yield i}catch(i){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw i}finally{e.destroy()}},ob=async(e,t,r)=>{try{await _r.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(i){r.error=i}finally{t.abort()}},_r={};var Ft=async(e,{init:t,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,finalize:o},{maxBuffer:p=Number.POSITIVE_INFINITY}={})=>{let d=Md(e),c=t();c.length=0;try{for await(let u of d){let l=cb(u),m=r[l](u,c);Ud({convertedChunk:m,state:c,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:p})}return pb({state:c,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,maxBuffer:p}),o(c)}catch(u){let l=typeof u=="object"&&u!==null?u:new Error(u);throw l.bufferedData=o(c),l}},pb=({state:e,getSize:t,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let a=n(e);a!==void 0&&Ud({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:i,maxBuffer:s})},Ud=({convertedChunk:e,state:t,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let a=r(e),o=t.length+a;if(o<=s){Fd(e,t,n,o);return}let p=i(e,s-t.length);throw p!==void 0&&Fd(p,t,n,s),new ze},Fd=(e,t,r,i)=>{t.contents=r(e,t,i),t.length=i},cb=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=Gd.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Gd.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Gd}=Object.prototype,ze=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var Qe=e=>e,br=()=>{},Wi=({contents:e})=>e,Ki=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Yi=e=>e.length;async function Ji(e,t){return Ft(e,mb,t)}var db=()=>({contents:[]}),ub=()=>1,lb=(e,{contents:t})=>(t.push(e),t),mb={init:db,convertChunk:{string:Qe,buffer:Qe,arrayBuffer:Qe,dataView:Qe,typedArray:Qe,others:Qe},getSize:ub,truncateChunk:br,addChunk:lb,getFinalChunk:br,finalize:Wi};async function Xi(e,t){return Ft(e,vb,t)}var hb=()=>({contents:new ArrayBuffer(0)}),yb=e=>gb.encode(e),gb=new TextEncoder,Nd=e=>new Uint8Array(e),Hd=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),fb=(e,t)=>e.slice(0,t),_b=(e,{contents:t,length:r},i)=>{let n=Kd()?qb(t,i):bb(t,i);return new Uint8Array(n).set(e,r),n},bb=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(Wd(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},qb=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:Wd(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},Wd=e=>Vd**Math.ceil(Math.log(e)/Math.log(Vd)),Vd=2,kb=({contents:e,length:t})=>Kd()?e:e.slice(0,t),Kd=()=>"resize"in ArrayBuffer.prototype,vb={init:hb,convertChunk:{string:yb,buffer:Nd,arrayBuffer:Nd,dataView:Hd,typedArray:Hd,others:Ki},getSize:Yi,truncateChunk:fb,addChunk:_b,getFinalChunk:br,finalize:kb};async function Qi(e,t){return Ft(e,Ab,t)}var wb=()=>({contents:"",textDecoder:new TextDecoder}),Zi=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),xb=(e,{contents:t})=>t+e,Sb=(e,t)=>e.slice(0,t),$b=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},Ab={init:wb,convertChunk:{string:Qe,buffer:Zi,arrayBuffer:Zi,dataView:Zi,typedArray:Zi,others:Ki},getSize:Yi,truncateChunk:Sb,addChunk:xb,getFinalChunk:$b,finalize:Wi};Object.assign(_r,{on:Eb,finished:Pb});var Yd=({error:e,stream:t,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(e instanceof ze))throw e;if(s==="all")return e;let a=jb(r,i,n);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},jb=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",Jd=(e,t,r)=>{if(t.length!==r)return;let i=new ze;throw i.maxBufferInfo={fdNumber:"ipc"},i},Xd=(e,t)=>{let{streamName:r,threshold:i,unit:n}=Cb(e,t);return`Command's ${r} was larger than ${i} ${n}`},Cb=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=e;delete e.maxBufferInfo;let n=Ze(t,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:gi(r),threshold:n,unit:i}},Zd=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(i=>i!==null&&i.length>en(r)),Qd=(e,t,r)=>{if(!t)return e;let i=en(r);return e.length>i?e.slice(0,i):e},en=([,e])=>e;var tu=({stdio:e,all:t,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:a,escapedCommand:o,timedOut:p,isCanceled:d,isGracefullyCanceled:c,isMaxBuffer:u,isForcefullyTerminated:l,forceKillAfterDelay:m,killSignal:h,maxBuffer:f,timeout:w,cwd:k})=>{let x=i?.code,_=Rb({originalError:i,timedOut:p,timeout:w,isMaxBuffer:u,maxBuffer:f,errorCode:x,signal:n,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:c,isForcefullyTerminated:l,forceKillAfterDelay:m,killSignal:h}),T=Ob(i,k),S=T===void 0?"":`
130
- ${T}`,F=`${_}: ${o}${S}`,O=t===void 0?[e[2],e[1]]:[t],B=[F,...O,...e.slice(3),r.map(U=>Db(U)).join(`
131
- `)].map(U=>lr(Mt(Lb(U)))).filter(Boolean).join(`
132
-
133
- `);return{originalMessage:T,shortMessage:F,message:B}},Rb=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:a,signalDescription:o,exitCode:p,isCanceled:d,isGracefullyCanceled:c,isForcefullyTerminated:u,forceKillAfterDelay:l,killSignal:m})=>{let h=Ib(u,l);return t?`Command timed out after ${r} milliseconds${h}`:c?a===void 0?`Command was gracefully canceled with exit code ${p}`:u?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${a} (${o})`:d?`Command was canceled${h}`:i?`${Xd(e,n)}${h}`:s!==void 0?`Command failed with ${s}${h}`:u?`Command was killed with ${m} (${ji(m)})${h}`:a!==void 0?`Command was killed with ${a} (${o})`:p!==void 0?`Command failed with exit code ${p}`:"Command failed"},Ib=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Ob=(e,t)=>{if(e instanceof Ee)return;let r=jc(e)?e.originalMessage:String(e?.message??e),i=lr(Rd(r,t));return i===""?void 0:i},Db=e=>typeof e=="string"?e:Tb(e),Lb=e=>Array.isArray(e)?e.map(t=>Mt(eu(t))).filter(Boolean).join(`
134
- `):eu(e),eu=e=>typeof e=="string"?e:ee(e)?hi(e):"";var tn=({command:e,escapedCommand:t,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:a})=>ru({command:e,escapedCommand:t,cwd:s,durationMs:xs(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Gt=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:a})=>qr({error:e,command:t,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:a}),qr=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:d,signal:c,stdio:u,all:l,ipcOutput:m,options:{timeoutDuration:h,timeout:f=h,forceKillAfterDelay:w,killSignal:k,cwd:x,maxBuffer:_},isSync:T})=>{let{exitCode:S,signal:F,signalDescription:O}=zb(d,c),{originalMessage:B,shortMessage:U,message:W}=tu({stdio:u,all:l,ipcOutput:m,originalError:e,signal:F,signalDescription:O,exitCode:S,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,forceKillAfterDelay:w,killSignal:k,maxBuffer:_,timeout:f,cwd:x}),$=Ec(e,W,T);return Object.assign($,Bb({error:$,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:S,signal:F,signalDescription:O,stdio:u,all:l,ipcOutput:m,cwd:x,originalMessage:B,shortMessage:U})),$},Bb=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:d,signal:c,signalDescription:u,stdio:l,all:m,ipcOutput:h,cwd:f,originalMessage:w,shortMessage:k})=>ru({shortMessage:k,originalMessage:w,command:t,escapedCommand:r,cwd:f,durationMs:xs(i),failed:!0,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isTerminated:c!==void 0,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:d,signal:c,signalDescription:u,code:e.cause?.code,stdout:l[1],stderr:l[2],all:m,stdio:l,ipcOutput:h,pipedFrom:[]}),ru=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),zb=(e,t)=>{let r=e===null?void 0:e,i=t===null?void 0:t,n=i===void 0?void 0:ji(t);return{exitCode:r,signal:i,signalDescription:n}};var iu=e=>Number.isFinite(e)?e:0;function Mb(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(iu(e*1e3)%1e3),nanoseconds:Math.trunc(iu(e*1e6)%1e3)}}function Fb(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function Js(e){switch(typeof e){case"number":{if(Number.isFinite(e))return Mb(e);break}case"bigint":return Fb(e)}throw new TypeError("Expected a finite number or bigint")}var Gb=e=>e===0||e===0n,Ub=(e,t)=>t===1||t===1n?e:`${e}s`,Nb=1e-7,Hb=24n*60n*60n*1000n;function Xs(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let i=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let n=[],s=(c,u)=>{let l=Math.floor(c*10**u+Nb);return(Math.round(l)/10**u).toFixed(u)},a=(c,u,l,m)=>{if(!((n.length===0||!t.colonNotation)&&Gb(c)&&!(t.colonNotation&&l==="m"))){if(m??=String(c),t.colonNotation){let h=m.includes(".")?m.split(".")[0].length:m.length,f=n.length>0?2:1;m="0".repeat(Math.max(0,f-h))+m}else m+=t.verbose?" "+Ub(u,c):l;n.push(m)}},o=Js(e),p=BigInt(o.days);if(t.hideYearAndDays?a(BigInt(p)*24n+BigInt(o.hours),"hour","h"):(t.hideYear?a(p,"day","d"):(a(p/365n,"year","y"),a(p%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let c=Number(o.seconds),u=Number(o.milliseconds),l=Number(o.microseconds),m=Number(o.nanoseconds);if(a(c,"second","s"),t.formatSubMilliseconds)a(u,"millisecond","ms"),a(l,"microsecond","\xB5s"),a(m,"nanosecond","ns");else{let h=u+l/1e3+m/1e6,f=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,w=h>=1?Math.round(h):Math.ceil(h),k=f?h.toFixed(f):w;a(Number.parseFloat(k),"millisecond","ms",k)}}else{let c=(r?Number(e%Hb):e)/1e3%60,u=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,l=s(c,u),m=t.keepDecimalsOnWholeSeconds?l:l.replace(/\.0+$/,"");a(Number.parseFloat(m),"second","s",m)}if(n.length===0)return i+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(n=n.slice(0,Math.max(t.unitCount,1))),i+n.join(d)}var nu=(e,t)=>{e.failed&&De({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var su=(e,t)=>{Rt(t)&&(nu(e,t),Vb(e,t))},Vb=(e,t)=>{let r=`(done in ${Xs(e.durationMs)})`;De({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var Ut=(e,t,{reject:r})=>{if(su(e,t),e.failed&&r)throw e;return e};import{readFileSync as Tu}from"fs";var pu=(e,t)=>wt(e)?"asyncGenerator":uu(e)?"generator":rn(e)?"fileUrl":Xb(e)?"filePath":eq(e)?"webStream":je(e,{checkOpen:!1})?"native":ee(e)?"uint8Array":tq(e)?"asyncIterable":rq(e)?"iterable":ea(e)?cu({transform:e},t):Jb(e)?Wb(e,t):"native",Wb=(e,t)=>Vs(e.transform,{checkOpen:!1})?Kb(e,t):ea(e.transform)?cu(e,t):Yb(e,t),Kb=(e,t)=>(du(e,t,"Duplex stream"),"duplex"),cu=(e,t)=>(du(e,t,"web TransformStream"),"webTransform"),du=({final:e,binary:t,objectMode:r},i,n)=>{au(e,`${i}.final`,n),au(t,`${i}.binary`,n),Zs(r,`${i}.objectMode`)},au=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Yb=({transform:e,final:t,binary:r,objectMode:i},n)=>{if(e!==void 0&&!ou(e))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Vs(t,{checkOpen:!1}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(ea(t))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!ou(t))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Zs(r,`${n}.binary`),Zs(i,`${n}.objectMode`),wt(e)||wt(t)?"asyncGenerator":"generator"},Zs=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},ou=e=>wt(e)||uu(e),wt=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",uu=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",Jb=e=>Y(e)&&(e.transform!==void 0||e.final!==void 0),rn=e=>Object.prototype.toString.call(e)==="[object URL]",lu=e=>rn(e)&&e.protocol!=="file:",Xb=e=>Y(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Zb.has(t))&&Qs(e.file),Zb=new Set(["file","append"]),Qs=e=>typeof e=="string",mu=(e,t)=>e==="native"&&typeof t=="string"&&!Qb.has(t),Qb=new Set(["ipc","ignore","inherit","overlapped","pipe"]),hu=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",nn=e=>Object.prototype.toString.call(e)==="[object WritableStream]",eq=e=>hu(e)||nn(e),ea=e=>hu(e?.readable)&&nn(e?.writable),tq=e=>yu(e)&&typeof e[Symbol.asyncIterator]=="function",rq=e=>yu(e)&&typeof e[Symbol.iterator]=="function",yu=e=>typeof e=="object"&&e!==null,xe=new Set(["generator","asyncGenerator","duplex","webTransform"]),sn=new Set(["fileUrl","filePath","fileNumber"]),ta=new Set(["fileUrl","filePath"]),gu=new Set([...ta,"webStream","nodeStream"]),fu=new Set(["webTransform","duplex"]),ct={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var ra=(e,t,r,i)=>i==="output"?iq(e,t,r):nq(e,t,r),iq=(e,t,r)=>{let i=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:i,readableObjectMode:e??i}},nq=(e,t,r)=>{let i=t===0?e===!0:r[t-1].value.readableObjectMode,n=t!==r.length-1&&(e??i);return{writableObjectMode:i,readableObjectMode:n}},_u=(e,t)=>{let r=e.findLast(({type:i})=>xe.has(i));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var bu=(e,t,r,i)=>[...e.filter(({type:n})=>!xe.has(n)),...sq(e,t,r,i)],sq=(e,t,r,{encoding:i})=>{let n=e.filter(({type:a})=>xe.has(a)),s=Array.from({length:n.length});for(let[a,o]of Object.entries(n))s[a]=aq({stdioItem:o,index:Number(a),newTransforms:s,optionName:t,direction:r,encoding:i});return dq(s,r)},aq=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:i,optionName:n,direction:s,encoding:a})=>t==="duplex"?oq({stdioItem:e,optionName:n}):t==="webTransform"?pq({stdioItem:e,index:r,newTransforms:i,direction:s}):cq({stdioItem:e,index:r,newTransforms:i,direction:s,encoding:a}),oq=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:i}}},pq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:a}=Y(t)?t:{transform:t},{writableObjectMode:o,readableObjectMode:p}=ra(a,r,i,n);return{...e,value:{transform:s,writableObjectMode:o,readableObjectMode:p}}},cq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:a,final:o,binary:p=!1,preserveNewlines:d=!1,objectMode:c}=Y(t)?t:{transform:t},u=p||fe.has(s),{writableObjectMode:l,readableObjectMode:m}=ra(c,r,i,n);return{...e,value:{transform:a,final:o,binary:u,preserveNewlines:d,writableObjectMode:l,readableObjectMode:m}}},dq=(e,t)=>t==="input"?e.reverse():e;import ia from"process";var qu=(e,t,r)=>{let i=e.map(n=>uq(n,t));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??hq},uq=({type:e,value:t},r)=>lq[r]??ku[e](t),lq=["input","output","output"],Nt=()=>{},na=()=>"input",ku={generator:Nt,asyncGenerator:Nt,fileUrl:Nt,filePath:Nt,iterable:na,asyncIterable:na,uint8Array:na,webStream:e=>nn(e)?"output":"input",nodeStream(e){return vt(e,{checkOpen:!1})?Hs(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Nt,duplex:Nt,native(e){let t=mq(e);if(t!==void 0)return t;if(je(e,{checkOpen:!1}))return ku.nodeStream(e)}},mq=e=>{if([0,ia.stdin].includes(e))return"input";if([1,2,ia.stdout,ia.stderr].includes(e))return"output"},hq="output";var vu=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var wu=({stdio:e,ipc:t,buffer:r,...i},n,s)=>{let a=yq(e,i).map((o,p)=>xu(o,p));return s?fq(a,r,n):vu(a,t)},yq=(e,t)=>{if(e===void 0)return we.map(i=>t[i]);if(gq(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${we.map(i=>`\`${i}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,we.length);return Array.from({length:r},(i,n)=>e[n])},gq=e=>we.some(t=>e[t]!==void 0),xu=(e,t)=>Array.isArray(e)?e.map(r=>xu(r,t)):e??(t>=we.length?"ignore":"pipe"),fq=(e,t,r)=>e.map((i,n)=>!t[n]&&n!==0&&!It(r,n)&&_q(i)?"ignore":i),_q=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");import{readFileSync as bq}from"fs";import qq from"tty";var $u=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||t!=="native"?e:s?kq({stdioItem:e,fdNumber:i,direction:n}):xq({stdioItem:e,fdNumber:i}),kq=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i,direction:n})=>{let s=vq({value:t,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(je(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},vq=({value:e,optionName:t,fdNumber:r,direction:i})=>{let n=wq(e,r);if(n!==void 0){if(i==="output")return{type:"fileNumber",value:n,optionName:t};if(qq.isatty(n))throw new TypeError(`The \`${t}: ${Ri(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Xe(bq(n)),optionName:t}}},wq=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=yi.indexOf(e);if(r!==-1)return r},xq=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i})=>t==="inherit"?{type:"nodeStream",value:Su(i,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:Su(t,t,r),optionName:r}:je(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,Su=(e,t,r)=>{let i=yi[e];if(i===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return i};var Au=({input:e,inputFile:t},r)=>r===0?[...Sq(e),...Aq(t)]:[],Sq=e=>e===void 0?[]:[{type:$q(e),value:e,optionName:"input"}],$q=e=>{if(vt(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(ee(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Aq=e=>e===void 0?[]:[{...Eq(e),optionName:"inputFile"}],Eq=e=>{if(rn(e))return{type:"fileUrl",value:e};if(Qs(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Eu=e=>e.filter((t,r)=>e.every((i,n)=>t.value!==i.value||r>=n||t.type==="generator"||t.type==="asyncGenerator")),Pu=({stdioItem:{type:e,value:t,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let a=Pq(n,e);if(a.length!==0){if(s){jq({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});return}if(gu.has(e))return ju({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});fu.has(e)&&Tq({otherStdioItems:a,type:e,value:t,optionName:r})}},Pq=(e,t)=>e.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===t).map((n=>({...n,direction:r})))),jq=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{ta.has(t)&&ju({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})},ju=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{let s=e.filter(o=>Cq(o,r));if(s.length===0)return;let a=s.find(o=>o.direction!==n);return Cu(a,i,t),n==="output"?s[0].stream:void 0},Cq=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,Tq=({otherStdioItems:e,type:t,value:r,optionName:i})=>{let n=e.find(({value:{transform:s}})=>s===r.transform);Cu(n,i,t)},Cu=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ct[r]} that is the same.`)};var an=(e,t,r,i)=>{let s=wu(t,r,i).map((o,p)=>Rq({stdioOption:o,fdNumber:p,options:t,isSync:i})),a=Fq({initialFileDescriptors:s,addProperties:e,options:t,isSync:i});return t.stdio=a.map(({stdioItems:o})=>Nq(o)),a},Rq=({stdioOption:e,fdNumber:t,options:r,isSync:i})=>{let n=gi(t),{stdioItems:s,isStdioArray:a}=Iq({stdioOption:e,fdNumber:t,options:r,optionName:n}),o=qu(s,t,n),p=s.map(u=>$u({stdioItem:u,isStdioArray:a,fdNumber:t,direction:o,isSync:i})),d=bu(p,n,o,r),c=_u(d,o);return Mq(d,c),{direction:o,objectMode:c,stdioItems:d}},Iq=({stdioOption:e,fdNumber:t,options:r,optionName:i})=>{let s=[...(Array.isArray(e)?e:[e]).map(p=>Oq(p,i)),...Au(r,t)],a=Eu(s),o=a.length>1;return Dq(a,o,i),Bq(a),{stdioItems:a,isStdioArray:o}},Oq=(e,t)=>({type:pu(e,t),value:e,optionName:t}),Dq=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:i,optionName:n}of e)if(Lq.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},Lq=new Set(["ignore","ipc"]),Bq=e=>{for(let t of e)zq(t)},zq=({type:e,value:t,optionName:r})=>{if(lu(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
135
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(mu(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Mq=(e,t)=>{if(!t)return;let r=e.find(({type:i})=>sn.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Fq=({initialFileDescriptors:e,addProperties:t,options:r,isSync:i})=>{let n=[];try{for(let s of e)n.push(Gq({fileDescriptor:s,fileDescriptors:n,addProperties:t,options:r,isSync:i}));return n}catch(s){throw sa(n),s}},Gq=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:a})=>{let o=r.map(p=>Uq({stdioItem:p,addProperties:n,direction:e,options:s,fileDescriptors:i,isSync:a}));return{direction:e,objectMode:t,stdioItems:o}},Uq=({stdioItem:e,addProperties:t,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let a=Pu({stdioItem:e,direction:r,fileDescriptors:n,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[r][e.type](e,i)}},sa=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!Ae(r)&&r.destroy()},Nq=e=>{if(e.length>1)return e.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var Iu=(e,t)=>an(Vq,e,t,!0),Me=({type:e,optionName:t})=>{Ou(t,ct[e])},Hq=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&Ou(e,`"${t}"`),{}),Ou=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Ru={generator(){},asyncGenerator:Me,webStream:Me,nodeStream:Me,webTransform:Me,duplex:Me,asyncIterable:Me,native:Hq},Vq={input:{...Ru,fileUrl:({value:e})=>({contents:[Xe(Tu(e))]}),filePath:({value:{file:e}})=>({contents:[Xe(Tu(e))]}),fileNumber:Me,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Ru,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:Me,string:Me,uint8Array:Me}};var et=(e,{stripFinalNewline:t},r)=>aa(t,r)&&e!==void 0&&!Array.isArray(e)?Mt(e):e,aa=(e,t)=>t==="all"?e[1]||e[2]:e[t];import{Transform as mk,getDefaultHighWaterMark as Vu}from"stream";var on=(e,t,r,i)=>e||r?void 0:Lu(t,i),pa=(e,t,r)=>r?e.flatMap(i=>Du(i,t)):Du(e,t),Du=(e,t)=>{let{transform:r,final:i}=Lu(t,{});return[...r(e),...i()]},Lu=(e,t)=>(t.previousChunks="",{transform:Wq.bind(void 0,t,e),final:Yq.bind(void 0,t)}),Wq=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=e,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
136
- `){let a=Kq(r,s,t,e),o=r.slice(n+1,s+1-a);i.length>0&&(o=oa(i,o),i=""),yield o,n=s}n!==r.length-1&&(i=oa(i,r.slice(n+1))),e.previousChunks=i},Kq=(e,t,r,i)=>r?0:(i.isWindowsNewline=t!==0&&e[t-1]==="\r",i.isWindowsNewline?2:1),Yq=function*({previousChunks:e}){e.length>0&&(yield e)},Bu=({binary:e,preserveNewlines:t,readableObjectMode:r,state:i})=>e||t||r?void 0:{transform:Jq.bind(void 0,i)},Jq=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof t=="string"?Xq:Qq;if(t.at(-1)===n){yield t;return}yield s(t,e?i:r)},oa=(e,t)=>`${e}${t}`,Xq={windowsNewline:`\r
128
+ ${e}`};var Hi=(e,t,r)=>{r.cwd=Td(r.cwd);let[i,n,s]=Ad(e,t,r),{command:a,args:o,options:p}=Dd.default._parse(i,n,s),d=kp(p),c=Z_(d);return wd(c),Cd(c),Ed(c),Nc(c),kd(c),c.shell=gs(c.shell),c.env=Q_(c),c.killSignal=zc(c.killSignal),c.forceKillAfterDelay=Gc(c.forceKillAfterDelay),c.lines=c.lines.map((u,l)=>u&&!fe.has(c.encoding)&&c.buffer[l]),Od.platform==="win32"&&X_.basename(a,".exe")==="cmd"&&o.unshift("/q"),{file:a,commandArguments:o,options:c}},Z_=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=!0,cleanup:a=!0,all:o=!1,windowsHide:p=!0,killSignal:d="SIGTERM",forceKillAfterDelay:c=!0,gracefulCancel:u=!1,ipcInput:l,ipc:m=l!==void 0||u,serialization:h="advanced",...f})=>({...f,extendEnv:e,preferLocal:t,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:a,all:o,windowsHide:p,killSignal:d,forceKillAfterDelay:c,gracefulCancel:u,ipcInput:l,ipc:m,serialization:h}),Q_=({env:e,extendEnv:t,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let a=t?{...Od.env,...e}:e;return r||i?Ec({env:a,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):a};var Vi=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];import{inspect as Rb}from"util";function Mt(e){if(typeof e=="string")return eb(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return tb(e)}var eb=e=>e.at(-1)===Ld?e.slice(0,e.at(-2)===Bd?-2:-1):e,tb=e=>e.at(-1)===rb?e.subarray(0,e.at(-2)===ib?-2:-1):e,Ld=`
129
+ `,rb=Ld.codePointAt(0),Bd="\r",ib=Bd.codePointAt(0);import{on as Pb}from"events";import{finished as jb}from"stream/promises";function je(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function Hs(e,{checkOpen:t=!0}={}){return je(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function vt(e,{checkOpen:t=!0}={}){return je(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function Vs(e,t){return Hs(e,t)&&vt(e,t)}var nb=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Ws=class{#t;#r;#e=!1;#i=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#s();return this.#i=this.#i?this.#i.then(t,t):t(),this.#i}return(t){let r=()=>this.#n(t);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#i=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#i=void 0,this.#e=!0,this.#t.releaseLock()),t}async#n(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},Ks=Symbol();function zd(){return this[Ks].next()}Object.defineProperty(zd,"name",{value:"next"});function Md(e){return this[Ks].return(e)}Object.defineProperty(Md,"name",{value:"return"});var sb=Object.create(nb,{next:{enumerable:!0,configurable:!0,writable:!0,value:zd},return:{enumerable:!0,configurable:!0,writable:!0,value:Md}});function Ys({preventCancel:e=!1}={}){let t=this.getReader(),r=new Ws(t,e),i=Object.create(sb);return i[Ks]=r,i}var Fd=e=>{if(vt(e,{checkOpen:!1})&&_r.on!==void 0)return ob(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(ab.call(e)==="[object ReadableStream]")return Ys.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:ab}=Object.prototype,ob=async function*(e){let t=new AbortController,r={};pb(e,t,r);try{for await(let[i]of _r.on(e,"data",{signal:t.signal}))yield i}catch(i){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw i}finally{e.destroy()}},pb=async(e,t,r)=>{try{await _r.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(i){r.error=i}finally{t.abort()}},_r={};var Ft=async(e,{init:t,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,finalize:o},{maxBuffer:p=Number.POSITIVE_INFINITY}={})=>{let d=Fd(e),c=t();c.length=0;try{for await(let u of d){let l=db(u),m=r[l](u,c);Nd({convertedChunk:m,state:c,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:p})}return cb({state:c,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,maxBuffer:p}),o(c)}catch(u){let l=typeof u=="object"&&u!==null?u:new Error(u);throw l.bufferedData=o(c),l}},cb=({state:e,getSize:t,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let a=n(e);a!==void 0&&Nd({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:i,maxBuffer:s})},Nd=({convertedChunk:e,state:t,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let a=r(e),o=t.length+a;if(o<=s){Gd(e,t,n,o);return}let p=i(e,s-t.length);throw p!==void 0&&Gd(p,t,n,s),new ze},Gd=(e,t,r,i)=>{t.contents=r(e,t,i),t.length=i},db=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=Ud.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Ud.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Ud}=Object.prototype,ze=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var Qe=e=>e,br=()=>{},Wi=({contents:e})=>e,Ki=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Yi=e=>e.length;async function Ji(e,t){return Ft(e,hb,t)}var ub=()=>({contents:[]}),lb=()=>1,mb=(e,{contents:t})=>(t.push(e),t),hb={init:ub,convertChunk:{string:Qe,buffer:Qe,arrayBuffer:Qe,dataView:Qe,typedArray:Qe,others:Qe},getSize:lb,truncateChunk:br,addChunk:mb,getFinalChunk:br,finalize:Wi};async function Xi(e,t){return Ft(e,wb,t)}var yb=()=>({contents:new ArrayBuffer(0)}),gb=e=>fb.encode(e),fb=new TextEncoder,Hd=e=>new Uint8Array(e),Vd=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),_b=(e,t)=>e.slice(0,t),bb=(e,{contents:t,length:r},i)=>{let n=Yd()?kb(t,i):qb(t,i);return new Uint8Array(n).set(e,r),n},qb=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(Kd(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},kb=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:Kd(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},Kd=e=>Wd**Math.ceil(Math.log(e)/Math.log(Wd)),Wd=2,vb=({contents:e,length:t})=>Yd()?e:e.slice(0,t),Yd=()=>"resize"in ArrayBuffer.prototype,wb={init:yb,convertChunk:{string:gb,buffer:Hd,arrayBuffer:Hd,dataView:Vd,typedArray:Vd,others:Ki},getSize:Yi,truncateChunk:_b,addChunk:bb,getFinalChunk:br,finalize:vb};async function Qi(e,t){return Ft(e,Eb,t)}var xb=()=>({contents:"",textDecoder:new TextDecoder}),Zi=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Sb=(e,{contents:t})=>t+e,$b=(e,t)=>e.slice(0,t),Ab=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},Eb={init:xb,convertChunk:{string:Qe,buffer:Zi,arrayBuffer:Zi,dataView:Zi,typedArray:Zi,others:Ki},getSize:Yi,truncateChunk:$b,addChunk:Sb,getFinalChunk:Ab,finalize:Wi};Object.assign(_r,{on:Pb,finished:jb});var Jd=({error:e,stream:t,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(e instanceof ze))throw e;if(s==="all")return e;let a=Cb(r,i,n);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},Cb=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",Xd=(e,t,r)=>{if(t.length!==r)return;let i=new ze;throw i.maxBufferInfo={fdNumber:"ipc"},i},Zd=(e,t)=>{let{streamName:r,threshold:i,unit:n}=Tb(e,t);return`Command's ${r} was larger than ${i} ${n}`},Tb=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=e;delete e.maxBufferInfo;let n=Ze(t,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:gi(r),threshold:n,unit:i}},Qd=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(i=>i!==null&&i.length>en(r)),eu=(e,t,r)=>{if(!t)return e;let i=en(r);return e.length>i?e.slice(0,i):e},en=([,e])=>e;var ru=({stdio:e,all:t,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:a,escapedCommand:o,timedOut:p,isCanceled:d,isGracefullyCanceled:c,isMaxBuffer:u,isForcefullyTerminated:l,forceKillAfterDelay:m,killSignal:h,maxBuffer:f,timeout:w,cwd:v})=>{let x=i?.code,_=Ib({originalError:i,timedOut:p,timeout:w,isMaxBuffer:u,maxBuffer:f,errorCode:x,signal:n,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:c,isForcefullyTerminated:l,forceKillAfterDelay:m,killSignal:h}),T=Db(i,v),S=T===void 0?"":`
130
+ ${T}`,F=`${_}: ${o}${S}`,O=t===void 0?[e[2],e[1]]:[t],B=[F,...O,...e.slice(3),r.map(U=>Lb(U)).join(`
131
+ `)].map(U=>lr(Mt(Bb(U)))).filter(Boolean).join(`
132
+
133
+ `);return{originalMessage:T,shortMessage:F,message:B}},Ib=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:a,signalDescription:o,exitCode:p,isCanceled:d,isGracefullyCanceled:c,isForcefullyTerminated:u,forceKillAfterDelay:l,killSignal:m})=>{let h=Ob(u,l);return t?`Command timed out after ${r} milliseconds${h}`:c?a===void 0?`Command was gracefully canceled with exit code ${p}`:u?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${a} (${o})`:d?`Command was canceled${h}`:i?`${Zd(e,n)}${h}`:s!==void 0?`Command failed with ${s}${h}`:u?`Command was killed with ${m} (${ji(m)})${h}`:a!==void 0?`Command was killed with ${a} (${o})`:p!==void 0?`Command failed with exit code ${p}`:"Command failed"},Ob=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Db=(e,t)=>{if(e instanceof Ee)return;let r=Cc(e)?e.originalMessage:String(e?.message??e),i=lr(Id(r,t));return i===""?void 0:i},Lb=e=>typeof e=="string"?e:Rb(e),Bb=e=>Array.isArray(e)?e.map(t=>Mt(tu(t))).filter(Boolean).join(`
134
+ `):tu(e),tu=e=>typeof e=="string"?e:ee(e)?hi(e):"";var tn=({command:e,escapedCommand:t,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:a})=>iu({command:e,escapedCommand:t,cwd:s,durationMs:xs(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Gt=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:a})=>qr({error:e,command:t,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:a}),qr=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:d,signal:c,stdio:u,all:l,ipcOutput:m,options:{timeoutDuration:h,timeout:f=h,forceKillAfterDelay:w,killSignal:v,cwd:x,maxBuffer:_},isSync:T})=>{let{exitCode:S,signal:F,signalDescription:O}=Mb(d,c),{originalMessage:B,shortMessage:U,message:W}=ru({stdio:u,all:l,ipcOutput:m,originalError:e,signal:F,signalDescription:O,exitCode:S,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,forceKillAfterDelay:w,killSignal:v,maxBuffer:_,timeout:f,cwd:x}),$=Pc(e,W,T);return Object.assign($,zb({error:$,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:S,signal:F,signalDescription:O,stdio:u,all:l,ipcOutput:m,cwd:x,originalMessage:B,shortMessage:U})),$},zb=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:d,signal:c,signalDescription:u,stdio:l,all:m,ipcOutput:h,cwd:f,originalMessage:w,shortMessage:v})=>iu({shortMessage:v,originalMessage:w,command:t,escapedCommand:r,cwd:f,durationMs:xs(i),failed:!0,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isTerminated:c!==void 0,isMaxBuffer:o,isForcefullyTerminated:p,exitCode:d,signal:c,signalDescription:u,code:e.cause?.code,stdout:l[1],stderr:l[2],all:m,stdio:l,ipcOutput:h,pipedFrom:[]}),iu=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),Mb=(e,t)=>{let r=e===null?void 0:e,i=t===null?void 0:t,n=i===void 0?void 0:ji(t);return{exitCode:r,signal:i,signalDescription:n}};var nu=e=>Number.isFinite(e)?e:0;function Fb(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(nu(e*1e3)%1e3),nanoseconds:Math.trunc(nu(e*1e6)%1e3)}}function Gb(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function Js(e){switch(typeof e){case"number":{if(Number.isFinite(e))return Fb(e);break}case"bigint":return Gb(e)}throw new TypeError("Expected a finite number or bigint")}var Ub=e=>e===0||e===0n,Nb=(e,t)=>t===1||t===1n?e:`${e}s`,Hb=1e-7,Vb=24n*60n*60n*1000n;function Xs(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let i=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let n=[],s=(c,u)=>{let l=Math.floor(c*10**u+Hb);return(Math.round(l)/10**u).toFixed(u)},a=(c,u,l,m)=>{if(!((n.length===0||!t.colonNotation)&&Ub(c)&&!(t.colonNotation&&l==="m"))){if(m??=String(c),t.colonNotation){let h=m.includes(".")?m.split(".")[0].length:m.length,f=n.length>0?2:1;m="0".repeat(Math.max(0,f-h))+m}else m+=t.verbose?" "+Nb(u,c):l;n.push(m)}},o=Js(e),p=BigInt(o.days);if(t.hideYearAndDays?a(BigInt(p)*24n+BigInt(o.hours),"hour","h"):(t.hideYear?a(p,"day","d"):(a(p/365n,"year","y"),a(p%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let c=Number(o.seconds),u=Number(o.milliseconds),l=Number(o.microseconds),m=Number(o.nanoseconds);if(a(c,"second","s"),t.formatSubMilliseconds)a(u,"millisecond","ms"),a(l,"microsecond","\xB5s"),a(m,"nanosecond","ns");else{let h=u+l/1e3+m/1e6,f=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,w=h>=1?Math.round(h):Math.ceil(h),v=f?h.toFixed(f):w;a(Number.parseFloat(v),"millisecond","ms",v)}}else{let c=(r?Number(e%Vb):e)/1e3%60,u=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,l=s(c,u),m=t.keepDecimalsOnWholeSeconds?l:l.replace(/\.0+$/,"");a(Number.parseFloat(m),"second","s",m)}if(n.length===0)return i+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(n=n.slice(0,Math.max(t.unitCount,1))),i+n.join(d)}var su=(e,t)=>{e.failed&&De({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var au=(e,t)=>{Rt(t)&&(su(e,t),Wb(e,t))},Wb=(e,t)=>{let r=`(done in ${Xs(e.durationMs)})`;De({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var Ut=(e,t,{reject:r})=>{if(au(e,t),e.failed&&r)throw e;return e};import{readFileSync as Ru}from"fs";var cu=(e,t)=>wt(e)?"asyncGenerator":lu(e)?"generator":rn(e)?"fileUrl":Zb(e)?"filePath":tq(e)?"webStream":je(e,{checkOpen:!1})?"native":ee(e)?"uint8Array":rq(e)?"asyncIterable":iq(e)?"iterable":ea(e)?du({transform:e},t):Xb(e)?Kb(e,t):"native",Kb=(e,t)=>Vs(e.transform,{checkOpen:!1})?Yb(e,t):ea(e.transform)?du(e,t):Jb(e,t),Yb=(e,t)=>(uu(e,t,"Duplex stream"),"duplex"),du=(e,t)=>(uu(e,t,"web TransformStream"),"webTransform"),uu=({final:e,binary:t,objectMode:r},i,n)=>{ou(e,`${i}.final`,n),ou(t,`${i}.binary`,n),Zs(r,`${i}.objectMode`)},ou=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Jb=({transform:e,final:t,binary:r,objectMode:i},n)=>{if(e!==void 0&&!pu(e))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Vs(t,{checkOpen:!1}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(ea(t))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!pu(t))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Zs(r,`${n}.binary`),Zs(i,`${n}.objectMode`),wt(e)||wt(t)?"asyncGenerator":"generator"},Zs=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},pu=e=>wt(e)||lu(e),wt=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",lu=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",Xb=e=>Y(e)&&(e.transform!==void 0||e.final!==void 0),rn=e=>Object.prototype.toString.call(e)==="[object URL]",mu=e=>rn(e)&&e.protocol!=="file:",Zb=e=>Y(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Qb.has(t))&&Qs(e.file),Qb=new Set(["file","append"]),Qs=e=>typeof e=="string",hu=(e,t)=>e==="native"&&typeof t=="string"&&!eq.has(t),eq=new Set(["ipc","ignore","inherit","overlapped","pipe"]),yu=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",nn=e=>Object.prototype.toString.call(e)==="[object WritableStream]",tq=e=>yu(e)||nn(e),ea=e=>yu(e?.readable)&&nn(e?.writable),rq=e=>gu(e)&&typeof e[Symbol.asyncIterator]=="function",iq=e=>gu(e)&&typeof e[Symbol.iterator]=="function",gu=e=>typeof e=="object"&&e!==null,xe=new Set(["generator","asyncGenerator","duplex","webTransform"]),sn=new Set(["fileUrl","filePath","fileNumber"]),ta=new Set(["fileUrl","filePath"]),fu=new Set([...ta,"webStream","nodeStream"]),_u=new Set(["webTransform","duplex"]),ct={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var ra=(e,t,r,i)=>i==="output"?nq(e,t,r):sq(e,t,r),nq=(e,t,r)=>{let i=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:i,readableObjectMode:e??i}},sq=(e,t,r)=>{let i=t===0?e===!0:r[t-1].value.readableObjectMode,n=t!==r.length-1&&(e??i);return{writableObjectMode:i,readableObjectMode:n}},bu=(e,t)=>{let r=e.findLast(({type:i})=>xe.has(i));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var qu=(e,t,r,i)=>[...e.filter(({type:n})=>!xe.has(n)),...aq(e,t,r,i)],aq=(e,t,r,{encoding:i})=>{let n=e.filter(({type:a})=>xe.has(a)),s=Array.from({length:n.length});for(let[a,o]of Object.entries(n))s[a]=oq({stdioItem:o,index:Number(a),newTransforms:s,optionName:t,direction:r,encoding:i});return uq(s,r)},oq=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:i,optionName:n,direction:s,encoding:a})=>t==="duplex"?pq({stdioItem:e,optionName:n}):t==="webTransform"?cq({stdioItem:e,index:r,newTransforms:i,direction:s}):dq({stdioItem:e,index:r,newTransforms:i,direction:s,encoding:a}),pq=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:i}}},cq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:a}=Y(t)?t:{transform:t},{writableObjectMode:o,readableObjectMode:p}=ra(a,r,i,n);return{...e,value:{transform:s,writableObjectMode:o,readableObjectMode:p}}},dq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:a,final:o,binary:p=!1,preserveNewlines:d=!1,objectMode:c}=Y(t)?t:{transform:t},u=p||fe.has(s),{writableObjectMode:l,readableObjectMode:m}=ra(c,r,i,n);return{...e,value:{transform:a,final:o,binary:u,preserveNewlines:d,writableObjectMode:l,readableObjectMode:m}}},uq=(e,t)=>t==="input"?e.reverse():e;import ia from"process";var ku=(e,t,r)=>{let i=e.map(n=>lq(n,t));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??yq},lq=({type:e,value:t},r)=>mq[r]??vu[e](t),mq=["input","output","output"],Nt=()=>{},na=()=>"input",vu={generator:Nt,asyncGenerator:Nt,fileUrl:Nt,filePath:Nt,iterable:na,asyncIterable:na,uint8Array:na,webStream:e=>nn(e)?"output":"input",nodeStream(e){return vt(e,{checkOpen:!1})?Hs(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Nt,duplex:Nt,native(e){let t=hq(e);if(t!==void 0)return t;if(je(e,{checkOpen:!1}))return vu.nodeStream(e)}},hq=e=>{if([0,ia.stdin].includes(e))return"input";if([1,2,ia.stdout,ia.stderr].includes(e))return"output"},yq="output";var wu=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var xu=({stdio:e,ipc:t,buffer:r,...i},n,s)=>{let a=gq(e,i).map((o,p)=>Su(o,p));return s?_q(a,r,n):wu(a,t)},gq=(e,t)=>{if(e===void 0)return we.map(i=>t[i]);if(fq(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${we.map(i=>`\`${i}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,we.length);return Array.from({length:r},(i,n)=>e[n])},fq=e=>we.some(t=>e[t]!==void 0),Su=(e,t)=>Array.isArray(e)?e.map(r=>Su(r,t)):e??(t>=we.length?"ignore":"pipe"),_q=(e,t,r)=>e.map((i,n)=>!t[n]&&n!==0&&!It(r,n)&&bq(i)?"ignore":i),bq=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");import{readFileSync as qq}from"fs";import kq from"tty";var Au=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||t!=="native"?e:s?vq({stdioItem:e,fdNumber:i,direction:n}):Sq({stdioItem:e,fdNumber:i}),vq=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i,direction:n})=>{let s=wq({value:t,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(je(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},wq=({value:e,optionName:t,fdNumber:r,direction:i})=>{let n=xq(e,r);if(n!==void 0){if(i==="output")return{type:"fileNumber",value:n,optionName:t};if(kq.isatty(n))throw new TypeError(`The \`${t}: ${Ri(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Xe(qq(n)),optionName:t}}},xq=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=yi.indexOf(e);if(r!==-1)return r},Sq=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i})=>t==="inherit"?{type:"nodeStream",value:$u(i,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:$u(t,t,r),optionName:r}:je(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,$u=(e,t,r)=>{let i=yi[e];if(i===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return i};var Eu=({input:e,inputFile:t},r)=>r===0?[...$q(e),...Eq(t)]:[],$q=e=>e===void 0?[]:[{type:Aq(e),value:e,optionName:"input"}],Aq=e=>{if(vt(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(ee(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Eq=e=>e===void 0?[]:[{...Pq(e),optionName:"inputFile"}],Pq=e=>{if(rn(e))return{type:"fileUrl",value:e};if(Qs(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Pu=e=>e.filter((t,r)=>e.every((i,n)=>t.value!==i.value||r>=n||t.type==="generator"||t.type==="asyncGenerator")),ju=({stdioItem:{type:e,value:t,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let a=jq(n,e);if(a.length!==0){if(s){Cq({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});return}if(fu.has(e))return Cu({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});_u.has(e)&&Rq({otherStdioItems:a,type:e,value:t,optionName:r})}},jq=(e,t)=>e.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===t).map((n=>({...n,direction:r})))),Cq=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{ta.has(t)&&Cu({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})},Cu=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{let s=e.filter(o=>Tq(o,r));if(s.length===0)return;let a=s.find(o=>o.direction!==n);return Tu(a,i,t),n==="output"?s[0].stream:void 0},Tq=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,Rq=({otherStdioItems:e,type:t,value:r,optionName:i})=>{let n=e.find(({value:{transform:s}})=>s===r.transform);Tu(n,i,t)},Tu=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ct[r]} that is the same.`)};var an=(e,t,r,i)=>{let s=xu(t,r,i).map((o,p)=>Iq({stdioOption:o,fdNumber:p,options:t,isSync:i})),a=Gq({initialFileDescriptors:s,addProperties:e,options:t,isSync:i});return t.stdio=a.map(({stdioItems:o})=>Hq(o)),a},Iq=({stdioOption:e,fdNumber:t,options:r,isSync:i})=>{let n=gi(t),{stdioItems:s,isStdioArray:a}=Oq({stdioOption:e,fdNumber:t,options:r,optionName:n}),o=ku(s,t,n),p=s.map(u=>Au({stdioItem:u,isStdioArray:a,fdNumber:t,direction:o,isSync:i})),d=qu(p,n,o,r),c=bu(d,o);return Fq(d,c),{direction:o,objectMode:c,stdioItems:d}},Oq=({stdioOption:e,fdNumber:t,options:r,optionName:i})=>{let s=[...(Array.isArray(e)?e:[e]).map(p=>Dq(p,i)),...Eu(r,t)],a=Pu(s),o=a.length>1;return Lq(a,o,i),zq(a),{stdioItems:a,isStdioArray:o}},Dq=(e,t)=>({type:cu(e,t),value:e,optionName:t}),Lq=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:i,optionName:n}of e)if(Bq.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},Bq=new Set(["ignore","ipc"]),zq=e=>{for(let t of e)Mq(t)},Mq=({type:e,value:t,optionName:r})=>{if(mu(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
135
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(hu(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Fq=(e,t)=>{if(!t)return;let r=e.find(({type:i})=>sn.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Gq=({initialFileDescriptors:e,addProperties:t,options:r,isSync:i})=>{let n=[];try{for(let s of e)n.push(Uq({fileDescriptor:s,fileDescriptors:n,addProperties:t,options:r,isSync:i}));return n}catch(s){throw sa(n),s}},Uq=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:a})=>{let o=r.map(p=>Nq({stdioItem:p,addProperties:n,direction:e,options:s,fileDescriptors:i,isSync:a}));return{direction:e,objectMode:t,stdioItems:o}},Nq=({stdioItem:e,addProperties:t,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let a=ju({stdioItem:e,direction:r,fileDescriptors:n,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[r][e.type](e,i)}},sa=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!Ae(r)&&r.destroy()},Hq=e=>{if(e.length>1)return e.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var Ou=(e,t)=>an(Wq,e,t,!0),Me=({type:e,optionName:t})=>{Du(t,ct[e])},Vq=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&Du(e,`"${t}"`),{}),Du=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Iu={generator(){},asyncGenerator:Me,webStream:Me,nodeStream:Me,webTransform:Me,duplex:Me,asyncIterable:Me,native:Vq},Wq={input:{...Iu,fileUrl:({value:e})=>({contents:[Xe(Ru(e))]}),filePath:({value:{file:e}})=>({contents:[Xe(Ru(e))]}),fileNumber:Me,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Iu,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:Me,string:Me,uint8Array:Me}};var et=(e,{stripFinalNewline:t},r)=>aa(t,r)&&e!==void 0&&!Array.isArray(e)?Mt(e):e,aa=(e,t)=>t==="all"?e[1]||e[2]:e[t];import{Transform as hk,getDefaultHighWaterMark as Wu}from"stream";var on=(e,t,r,i)=>e||r?void 0:Bu(t,i),pa=(e,t,r)=>r?e.flatMap(i=>Lu(i,t)):Lu(e,t),Lu=(e,t)=>{let{transform:r,final:i}=Bu(t,{});return[...r(e),...i()]},Bu=(e,t)=>(t.previousChunks="",{transform:Kq.bind(void 0,t,e),final:Jq.bind(void 0,t)}),Kq=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=e,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
136
+ `){let a=Yq(r,s,t,e),o=r.slice(n+1,s+1-a);i.length>0&&(o=oa(i,o),i=""),yield o,n=s}n!==r.length-1&&(i=oa(i,r.slice(n+1))),e.previousChunks=i},Yq=(e,t,r,i)=>r?0:(i.isWindowsNewline=t!==0&&e[t-1]==="\r",i.isWindowsNewline?2:1),Jq=function*({previousChunks:e}){e.length>0&&(yield e)},zu=({binary:e,preserveNewlines:t,readableObjectMode:r,state:i})=>e||t||r?void 0:{transform:Xq.bind(void 0,i)},Xq=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof t=="string"?Zq:ek;if(t.at(-1)===n){yield t;return}yield s(t,e?i:r)},oa=(e,t)=>`${e}${t}`,Zq={windowsNewline:`\r
137
137
  `,unixNewline:`
138
138
  `,LF:`
139
- `,concatBytes:oa},Zq=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},Qq={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Zq};import{Buffer as ek}from"buffer";var zu=(e,t)=>e?void 0:tk.bind(void 0,t),tk=function*(e,t){if(typeof t!="string"&&!ee(t)&&!ek.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Mu=(e,t)=>e?rk.bind(void 0,t):ik.bind(void 0,t),rk=function*(e,t){Fu(e,t),yield t},ik=function*(e,t){if(Fu(e,t),typeof t!="string"&&!ee(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Fu=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
139
+ `,concatBytes:oa},Qq=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},ek={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Qq};import{Buffer as tk}from"buffer";var Mu=(e,t)=>e?void 0:rk.bind(void 0,t),rk=function*(e,t){if(typeof t!="string"&&!ee(t)&&!tk.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Fu=(e,t)=>e?ik.bind(void 0,t):nk.bind(void 0,t),ik=function*(e,t){Gu(e,t),yield t},nk=function*(e,t){if(Gu(e,t),typeof t!="string"&&!ee(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Gu=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
140
140
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
141
- if (condition) { yield value; }`)};import{Buffer as nk}from"buffer";import{StringDecoder as sk}from"string_decoder";var pn=(e,t,r)=>{if(r)return;if(e)return{transform:ak.bind(void 0,new TextEncoder)};let i=new sk(t);return{transform:ok.bind(void 0,i),final:pk.bind(void 0,i)}},ak=function*(e,t){nk.isBuffer(t)?yield Xe(t):typeof t=="string"?yield e.encode(t):yield t},ok=function*(e,t){yield ee(t)?e.write(t):t},pk=function*(e){let t=e.end();t!==""&&(yield t)};import{callbackify as Gu}from"util";var ca=Gu(async(e,t,r,i)=>{t.currentIterable=e(...r);try{for await(let n of t.currentIterable)i.push(n)}finally{delete t.currentIterable}}),cn=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=dk}=t[r];for await(let n of i(e))yield*cn(n,t,r+1)},Uu=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*ck(r,Number(t),e)},ck=async function*(e,t,r){if(e!==void 0)for await(let i of e())yield*cn(i,r,t+1)},Nu=Gu(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),dk=function*(e){yield e};var da=(e,t,r,i)=>{try{for(let n of e(...t))r.push(n);i()}catch(n){i(n)}},Hu=(e,t)=>[...t.flatMap(r=>[...xt(r,e,0)]),...kr(e)],xt=function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=lk}=t[r];for(let n of i(e))yield*xt(n,t,r+1)},kr=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*uk(r,Number(t),e)},uk=function*(e,t,r){if(e!==void 0)for(let i of e())yield*xt(i,r,t+1)},lk=function*(e){yield e};var ua=({value:e,value:{transform:t,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:a})=>{let o={},p=Wu(e,a,s),d=wt(t),c=wt(r),u=d?ca.bind(void 0,cn,o):da.bind(void 0,xt),l=d||c?ca.bind(void 0,Uu,o):da.bind(void 0,kr),m=d||c?Nu.bind(void 0,o):void 0;return{stream:new mk({writableObjectMode:i,writableHighWaterMark:Vu(i),readableObjectMode:n,readableHighWaterMark:Vu(n),transform(f,w,k){u([f,p,0],this,k)},flush(f){l([p],this,f)},destroy:m})}},dn=(e,t,r,i)=>{let n=t.filter(({type:a})=>a==="generator"),s=i?n.reverse():n;for(let{value:a,optionName:o}of s){let p=Wu(a,r,o);e=Hu(p,e)}return e},Wu=({transform:e,final:t,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},a,o)=>{let p={};return[{transform:zu(i,o)},pn(r,a,i),on(r,s,i,p),{transform:e,final:t},{transform:Mu(n,o)},Bu({binary:r,preserveNewlines:s,readableObjectMode:n,state:p})].filter(Boolean)};var Ku=(e,t)=>{for(let r of hk(e))yk(e,r,t)},hk=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),yk=(e,t,r)=>{let{stdioItems:i}=e[t],n=i.filter(({contents:o})=>o!==void 0);if(n.length===0)return;if(t!==0){let[{type:o,optionName:p}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${p}\`, can be ${ct[o]} with synchronous methods.`)}let a=n.map(({contents:o})=>o).map(o=>gk(o,i));r.input=ur(a)},gk=(e,t)=>{let r=dn(e,t,"utf8",!0);return fk(r),ur(r)},fk=e=>{let t=e.find(r=>typeof r!="string"&&!ee(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};import{writeFileSync as kk,appendFileSync as vk}from"fs";var un=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:i})=>i!=="all"&&It(r,i)&&!fe.has(t)&&_k(i)&&(e.some(({type:n,value:s})=>n==="native"&&bk.has(s))||e.every(({type:n})=>xe.has(n))),_k=e=>e===1||e===2,bk=new Set(["pipe","overlapped"]),Yu=async(e,t,r,i)=>{for await(let n of e)qk(t)||Xu(n,r,i)},Ju=(e,t,r)=>{for(let i of e)Xu(i,t,r)},qk=e=>e._readableState.pipes.length>0,Xu=(e,t,r)=>{let i=vi(e);De({type:"output",verboseMessage:i,fdNumber:t,verboseInfo:r})};var Zu=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(t===null)return{output:Array.from({length:3})};let s={},a=new Set([]);return{output:t.map((p,d)=>wk({result:p,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:i,verboseInfo:n},r)),...s}},wk=({result:e,fileDescriptors:t,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:a},{buffer:o,encoding:p,lines:d,stripFinalNewline:c,maxBuffer:u})=>{if(e===null)return;let l=Qd(e,s,u),m=Xe(l),{stdioItems:h,objectMode:f}=t[r],w=xk([m],h,p,i),{serializedResult:k,finalResult:x=k}=Sk({chunks:w,objectMode:f,encoding:p,lines:d,stripFinalNewline:c,fdNumber:r});$k({serializedResult:k,fdNumber:r,state:i,verboseInfo:a,encoding:p,stdioItems:h,objectMode:f});let _=o[r]?x:void 0;try{return i.error===void 0&&Ak(k,h,n),_}catch(T){return i.error=T,_}},xk=(e,t,r,i)=>{try{return dn(e,t,r,!1)}catch(n){return i.error=n,e}},Sk=({chunks:e,objectMode:t,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:ur(e)};let a=mp(e,r);return i[s]?{serializedResult:a,finalResult:pa(a,!n[s],t)}:{serializedResult:a}},$k=({serializedResult:e,fdNumber:t,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:a})=>{if(!un({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:t}))return;let o=pa(e,!1,a);try{Ju(o,t,i)}catch(p){r.error??=p}},Ak=(e,t,r)=>{for(let{path:i,append:n}of t.filter(({type:s})=>sn.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?vk(i,e):(r.add(s),kk(i,e))}};var Qu=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,et(t,r,"all")]:Array.isArray(t)?[et(e,r,"all"),...t]:ee(e)&&ee(t)?fs([e,t]):`${e}${t}`};import{once as la}from"events";var el=async(e,t)=>{let[r,i]=await Ek(e);return t.isForcefullyTerminated??=!1,[r,i]},Ek=async e=>{let[t,r]=await Promise.allSettled([la(e,"spawn"),la(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?tl(e):r.value},tl=async e=>{try{return await la(e,"exit")}catch{return tl(e)}},rl=async e=>{let[t,r]=await e;if(!Pk(t,r)&&ma(t,r))throw new Ee;return[t,r]},Pk=(e,t)=>e===void 0&&t===void 0,ma=(e,t)=>e!==0||t!==null;var il=({error:e,status:t,signal:r,output:i},{maxBuffer:n})=>{let s=jk(e,t,r),a=s?.code==="ETIMEDOUT",o=Zd(s,i,n);return{resultError:s,exitCode:t,signal:r,timedOut:a,isMaxBuffer:o}},jk=(e,t,r)=>e!==void 0?e:ma(t,r)?new Ee:void 0;var nl=(e,t,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:a,startTime:o,verboseInfo:p,options:d,fileDescriptors:c}=Tk(e,t,r),u=Ok({file:i,commandArguments:n,options:d,command:s,escapedCommand:a,verboseInfo:p,fileDescriptors:c,startTime:o});return Ut(u,p,d)},Tk=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=xi(e,t,r),o=Rk(r),{file:p,commandArguments:d,options:c}=Hi(e,t,o);Ik(c);let u=Iu(c,a);return{file:p,commandArguments:d,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:c,fileDescriptors:u}},Rk=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Ik=({ipc:e,ipcInput:t,detached:r,cancelSignal:i})=>{t&&ln("ipcInput"),e&&ln("ipc: true"),r&&ln("detached: true"),i&&ln("cancelSignal")},ln=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Ok=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:a,startTime:o})=>{let p=Dk({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:a,startTime:o});if(p.failed)return p;let{resultError:d,exitCode:c,signal:u,timedOut:l,isMaxBuffer:m}=il(p,r),{output:h,error:f=d}=Zu({fileDescriptors:a,syncResult:p,options:r,isMaxBuffer:m,verboseInfo:s}),w=h.map((x,_)=>et(x,r,_)),k=et(Qu(h,r),r,"all");return Bk({error:f,exitCode:c,signal:u,timedOut:l,isMaxBuffer:m,stdio:w,all:k,options:r,command:i,escapedCommand:n,startTime:o})},Dk=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:a})=>{try{Ku(s,r);let o=Lk(r);return Ck(...Vi(e,t,o))}catch(o){return Gt({error:o,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:a,isSync:!0})}},Lk=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:en(t)}),Bk=({error:e,exitCode:t,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:a,options:o,command:p,escapedCommand:d,startTime:c})=>e===void 0?tn({command:p,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:o,startTime:c}):qr({error:e,command:p,escapedCommand:d,timedOut:i,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:n,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:s,all:a,ipcOutput:[],options:o,startTime:c,isSync:!0});import{setMaxListeners as Sw}from"events";import{spawn as $w}from"child_process";import cl from"process";import{once as ha,on as zk}from"events";var sl=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0,filter:s}={})=>(Lt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:zi(e)}),Mk({anyProcess:e,channel:t,isSubprocess:r,filter:s,reference:n})),Mk=async({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:n})=>{Oi(t,n);let s=pt(e,t,r),a=new AbortController;try{return await Promise.race([Fk(s,i,a),Gk(s,r,a),Uk(s,r,a)])}catch(o){throw Bt(e),o}finally{a.abort(),Di(t,n)}},Fk=async(e,t,{signal:r})=>{if(t===void 0){let[i]=await ha(e,"message",{signal:r});return i}for await(let[i]of zk(e,"message",{signal:r}))if(t(i))return i},Gk=async(e,t,{signal:r})=>{await ha(e,"disconnect",{signal:r}),Hc(t)},Uk=async(e,t,{signal:r})=>{let[i]=await ha(e,"strict:error",{signal:r});throw Ti(i,t)};import{once as ol,on as Nk}from"events";var pl=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0}={})=>ya({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),ya=({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Lt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:zi(e)}),Oi(t,s);let a=pt(e,t,r),o=new AbortController,p={};return Hk(e,a,o),Vk({ipcEmitter:a,isSubprocess:r,controller:o,state:p}),Wk({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:r,shouldAwait:n,controller:o,state:p,reference:s})},Hk=async(e,t,r)=>{try{await ol(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Vk=async({ipcEmitter:e,isSubprocess:t,controller:r,state:i})=>{try{let[n]=await ol(e,"strict:error",{signal:r.signal});i.error=Ti(n,t),r.abort()}catch{}},Wk=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:a,reference:o}){try{for await(let[p]of Nk(r,"message",{signal:s.signal}))al(a),yield p}catch{al(a)}finally{s.abort(),Di(t,o),i||Bt(e),n&&await e}},al=({error:e})=>{if(e)throw e};var dl=(e,{ipc:t})=>{Object.assign(e,ll(e,!1,t))},ul=()=>{let e=cl,t=!0,r=cl.channel!==void 0;return{...ll(e,t,r),getCancelSignal:_d.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},ll=(e,t,r)=>({sendMessage:Ui.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:sl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:pl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});import{ChildProcess as Kk}from"child_process";import{PassThrough as Yk,Readable as Jk,Writable as Xk,Duplex as Zk}from"stream";var ml=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:a})=>{sa(i);let o=new Kk;Qk(o,i),Object.assign(o,{readable:ev,writable:tv,duplex:rv});let p=Gt({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:!1}),d=iv(p,a,n);return{subprocess:o,promise:d}},Qk=(e,t)=>{let r=vr(),i=vr(),n=vr(),s=Array.from({length:t.length-3},vr),a=vr(),o=[r,i,n,...s];Object.assign(e,{stdin:r,stdout:i,stderr:n,all:a,stdio:o})},vr=()=>{let e=new Yk;return e.end(),e},ev=()=>new Jk({read(){}}),tv=()=>new Xk({write(){}}),rv=()=>new Zk({read(){},write(){}}),iv=async(e,t,r)=>Ut(e,t,r);import{createReadStream as hl,createWriteStream as yl}from"fs";import{Buffer as nv}from"buffer";import{Readable as wr,Writable as sv,Duplex as av}from"stream";var fl=(e,t)=>an(ov,e,t,!1),xr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ct[e]}.`)},gl={fileNumber:xr,generator:ua,asyncGenerator:ua,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let i=t||r;return{stream:av.fromWeb(e,{objectMode:i})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ov={input:{...gl,fileUrl:({value:e})=>({stream:hl(e)}),filePath:({value:{file:e}})=>({stream:hl(e)}),webStream:({value:e})=>({stream:wr.fromWeb(e)}),iterable:({value:e})=>({stream:wr.from(e)}),asyncIterable:({value:e})=>({stream:wr.from(e)}),string:({value:e})=>({stream:wr.from(e)}),uint8Array:({value:e})=>({stream:wr.from(nv.from(e))})},output:{...gl,fileUrl:({value:e})=>({stream:yl(e)}),filePath:({value:{file:e,append:t}})=>({stream:yl(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:sv.fromWeb(e)}),iterable:xr,asyncIterable:xr,string:xr,uint8Array:xr}};import{on as pv,once as _l}from"events";import{PassThrough as cv,getDefaultHighWaterMark as dv}from"stream";import{finished as kl}from"stream/promises";function St(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let n of e)fa(n);let t=e.some(({readableObjectMode:n})=>n),r=uv(e,t),i=new ga({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of e)i.add(n);return i}var uv=(e,t)=>{if(e.length===0)return dv(t);let r=e.filter(({readableObjectMode:i})=>i===t).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ga=class extends cv{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(t){if(fa(t),this.#t.has(t))return;this.#t.add(t),this.#i??=lv(this,this.#t,this.#s);let r=yv({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(fa(t),!this.#t.has(t))return!1;let r=this.#n.get(t);return r===void 0?!1:(this.#n.delete(t),t.unpipe(this),await r,!0)}},lv=async(e,t,r)=>{mn(e,bl);let i=new AbortController;try{await Promise.race([mv(e,i),hv(e,t,r,i)])}finally{i.abort(),mn(e,-bl)}},mv=async(e,{signal:t})=>{try{await kl(e,{signal:t,cleanup:!0})}catch(r){throw vl(e,r),r}},hv=async(e,t,r,{signal:i})=>{for await(let[n]of pv(e,"unpipe",{signal:i}))t.has(n)&&n.emit(r)},fa=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},yv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:a})=>{mn(e,ql);let o=new AbortController;try{await Promise.race([gv(s,t,o),fv({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:o}),_v({stream:t,streams:r,ended:i,aborted:n,unpipeEvent:a,controller:o})])}finally{o.abort(),mn(e,-ql)}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?_a(e):bv(e))},gv=async(e,t,{signal:r})=>{try{await e,r.aborted||_a(t)}catch(i){r.aborted||vl(t,i)}},fv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await kl(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&i.add(t)}catch(a){if(s.aborted||!r.has(t))return;wl(a)?n.add(t):xl(e,a)}},_v=async({stream:e,streams:t,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await _l(e,n,{signal:s}),!e.readable)return _l(s,"abort",{signal:s});t.delete(e),r.delete(e),i.delete(e)},bv=e=>{e.writable&&e.end()},vl=(e,t)=>{wl(t)?_a(e):xl(e,t)},wl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",_a=e=>{(e.readable||e.writable)&&e.destroy()},xl=(e,t)=>{e.destroyed||(e.once("error",qv),e.destroy(t))},qv=()=>{},mn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},bl=2,ql=1;import{finished as Sl}from"stream/promises";var Ht=(e,t)=>{e.pipe(t),kv(e,t),vv(e,t)},kv=async(e,t)=>{if(!(Ae(e)||Ae(t))){try{await Sl(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ba(t)}},ba=e=>{e.writable&&e.end()},vv=async(e,t)=>{if(!(Ae(e)||Ae(t))){try{await Sl(t,{cleanup:!0,readable:!1,writable:!0})}catch{}qa(e)}},qa=e=>{e.readable&&e.destroy()};var $l=(e,t,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:a}]of Object.entries(t)){for(let{stream:o}of s.filter(({type:p})=>xe.has(p)))wv(e,o,a,n);for(let{stream:o}of s.filter(({type:p})=>!xe.has(p)))Sv({subprocess:e,stream:o,direction:a,fdNumber:n,pipeGroups:i,controller:r})}for(let[n,s]of i.entries()){let a=s.length===1?s[0]:St(s);Ht(a,n)}},wv=(e,t,r,i)=>{r==="output"?Ht(e.stdio[i],t):Ht(t,e.stdio[i]);let n=xv[i];n!==void 0&&(e[n]=t),e.stdio[i]=t},xv=["stdin","stdout","stderr"],Sv=({subprocess:e,stream:t,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(t===void 0)return;$v(t,s);let[a,o]=r==="output"?[t,e.stdio[i]]:[e.stdio[i],t],p=n.get(a)??[];n.set(a,[...p,o])},$v=(e,{signal:t})=>{Ae(e)&&kt(e,Av,t)},Av=2;import{addAbortListener as jv}from"events";var $t=[];$t.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&$t.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$t.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hn=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",ka=Symbol.for("signal-exit emitter"),va=globalThis,Ev=Object.defineProperty.bind(Object),wa=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(va[ka])return va[ka];Ev(va,ka,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let i=this.listeners[t],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(t,r,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let s of this.listeners[t])n=s(r,i)===!0||n;return t==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},yn=class{},Pv=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),xa=class extends yn{onExit(){return()=>{}}load(){}unload(){}},Sa=class extends yn{#t=$a.platform==="win32"?"SIGINT":"SIGHUP";#r=new wa;#e;#i;#s;#n={};#a=!1;constructor(t){super(),this.#e=t,this.#n={};for(let r of $t)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||t.kill(t.pid,o)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,r){if(!hn(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,t),()=>{this.#r.removeListener(i,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let t of $t)try{let r=this.#n[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#o(t)}}unload(){this.#a&&(this.#a=!1,$t.forEach(t=>{let r=this.#n[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1)}#o(t){return hn(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let i=this.#i;if(t==="exit"&&hn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,t,...r)}},$a=globalThis.process,{onExit:Al,load:$I,unload:AI}=Pv(hn($a)?new Sa($a):new xa);var El=(e,{cleanup:t,detached:r},{signal:i})=>{if(!t||r)return;let n=Al(()=>{e.kill()});jv(i,()=>{n()})};var jl=({source:e,sourcePromise:t,boundOptions:r,createNested:i},...n)=>{let s=wi(),{destination:a,destinationStream:o,destinationError:p,from:d,unpipeSignal:c}=Cv(r,i,n),{sourceStream:u,sourceError:l}=Rv(e,d),{options:m,fileDescriptors:h}=Be.get(e);return{sourcePromise:t,sourceStream:u,sourceOptions:m,sourceError:l,destination:a,destinationStream:o,destinationError:p,unpipeSignal:c,fileDescriptors:h,startTime:s}},Cv=(e,t,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:a}={}}=Tv(e,t,...r),o=Ii(i,s);return{destination:i,destinationStream:o,from:n,unpipeSignal:a}}catch(i){return{destinationError:i}}},Tv=(e,t,r,...i)=>{if(Array.isArray(r))return{destination:t(Pl,e)(r,...i),pipeOptions:e};if(typeof r=="string"||r instanceof URL||ys(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,a]=mi(r,...i);return{destination:t(Pl)(n,s,a),pipeOptions:a}}if(Be.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Pl=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),Rv=(e,t)=>{try{return{sourceStream:zt(e,t)}}catch(r){return{sourceError:r}}};var Tl=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:a})=>{let o=Iv({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i});if(o!==void 0)throw Aa({error:o,fileDescriptors:n,sourceOptions:s,startTime:a})},Iv=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i})=>{if(t!==void 0&&i!==void 0)return i;if(i!==void 0)return qa(e),i;if(t!==void 0)return ba(r),t},Aa=({error:e,fileDescriptors:t,sourceOptions:r,startTime:i})=>Gt({error:e,command:Cl,escapedCommand:Cl,fileDescriptors:t,options:r,startTime:i,isSync:!1}),Cl="source.pipe(destination)";var Rl=async e=>{let[{status:t,reason:r,value:i=r},{status:n,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(i)||a.pipedFrom.push(i),n==="rejected")throw a;if(t==="rejected")throw i;return a};import{finished as Ov}from"stream/promises";var Il=(e,t,r)=>{let i=gn.has(t)?Lv(e,t):Dv(e,t);return kt(e,zv,r.signal),kt(t,Mv,r.signal),Bv(t),i},Dv=(e,t)=>{let r=St([e]);return Ht(r,t),gn.set(t,r),r},Lv=(e,t)=>{let r=gn.get(t);return r.add(e),r},Bv=async e=>{try{await Ov(e,{cleanup:!0,readable:!1,writable:!0})}catch{}gn.delete(e)},gn=new WeakMap,zv=2,Mv=1;import{aborted as Fv}from"util";var Ol=(e,t)=>e===void 0?[]:[Gv(e,t)],Gv=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await Fv(e,t),await r.remove(t);let a=new Error("Pipe canceled by `unpipeSignal` option.");throw Aa({error:a,fileDescriptors:i,sourceOptions:n,startTime:s})};var fn=(e,...t)=>{if(Y(t[0]))return fn.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...i}=jl(e,...t),n=Uv({...i,destination:r});return n.pipe=fn.bind(void 0,{...e,source:r,sourcePromise:n,boundOptions:{}}),n},Uv=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:a,unpipeSignal:o,fileDescriptors:p,startTime:d})=>{let c=Nv(e,n);Tl({sourceStream:t,sourceError:i,destinationStream:s,destinationError:a,fileDescriptors:p,sourceOptions:r,startTime:d});let u=new AbortController;try{let l=Il(t,s,u);return await Promise.race([Rl(c),...Ol(o,{sourceStream:t,mergedStream:l,sourceOptions:r,fileDescriptors:p,startTime:d})])}finally{u.abort()}},Nv=(e,t)=>Promise.allSettled([e,t]);import{setImmediate as Xv}from"timers/promises";import{on as Hv}from"events";import{getDefaultHighWaterMark as Vv}from"stream";var _n=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let a=new AbortController;return Wv(t,a),Ll({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&i,encoding:n,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},Wv=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ea=({stream:e,onStreamEnd:t,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let a=new AbortController;Kv(t,a,e);let o=e.readableObjectMode&&!s;return Ll({stream:e,controller:a,binary:i==="buffer",shouldEncode:!o,encoding:i,shouldSplit:!o&&r,preserveNewlines:!n})},Kv=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},Ll=({stream:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})=>{let o=Hv(e,"data",{signal:t.signal,highWaterMark:Dl,highWatermark:Dl});return Yv({onStdoutChunk:o,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})},Pa=Vv(!0),Dl=Pa,Yv=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a}){let o=Jv({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a});try{for await(let[p]of e)yield*xt(p,o,0)}catch(p){if(!t.signal.aborted)throw p}finally{yield*kr(o)}},Jv=({binary:e,shouldEncode:t,encoding:r,shouldSplit:i,preserveNewlines:n})=>[pn(e,r,!t),on(e,n,!i,{})].filter(Boolean);var Bl=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:a,allMixed:o,stripFinalNewline:p,verboseInfo:d,streamInfo:c})=>{let u=Zv({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:o,verboseInfo:d,streamInfo:c});if(!n){await Promise.all([Qv(e),u]);return}let l=aa(p,r),m=Ea({stream:e,onStreamEnd:t,lines:a,encoding:i,stripFinalNewline:l,allMixed:o}),[h]=await Promise.all([ew({stream:e,iterable:m,fdNumber:r,encoding:i,maxBuffer:s,lines:a}),u]);return h},Zv=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!un({stdioItems:a[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let o=Ea({stream:e,onStreamEnd:t,lines:!0,encoding:i,stripFinalNewline:!0,allMixed:n});await Yu(o,e,r,s)},Qv=async e=>{await Xv(),e.readableFlowing===null&&e.resume()},ew=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:a})=>{try{return t||a?await Ji(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await Xi(r,{maxBuffer:s})):await Qi(r,{maxBuffer:s})}catch(o){return zl(Yd({error:o,stream:e,readableObjectMode:t,lines:a,encoding:n,fdNumber:i}))}},ja=async e=>{try{return await e}catch(t){return zl(t)}},zl=({bufferedData:e})=>up(e)?new Uint8Array(e):e;import{finished as tw}from"stream/promises";var Sr=async(e,t,r,{isSameDirection:i,stopOnExit:n=!1}={})=>{let s=rw(e,r),a=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],tw(e,{cleanup:!0,signal:a.signal})])}catch(o){s.stdinCleanedUp||sw(o,t,r,i)}finally{a.abort()}},rw=(e,{originalStreams:[t],subprocess:r})=>{let i={stdinCleanedUp:!1};return e===t&&iw(e,r,i),i},iw=(e,t,r)=>{let{_destroy:i}=e;e._destroy=(...n)=>{nw(t,r),i.call(e,...n)}},nw=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},sw=(e,t,r,i)=>{if(!aw(e,t,r,i))throw e},aw=(e,t,r,i=!0)=>r.propagating?Ml(e)||bn(e):(r.propagating=!0,Ca(r,t)===i?Ml(e):bn(e)),Ca=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",bn=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Ml=e=>e?.code==="EPIPE";var Fl=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>e.stdio.map((p,d)=>Ta({stream:p,fdNumber:d,encoding:t,buffer:r[d],maxBuffer:i[d],lines:n[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:o})),Ta=async({stream:e,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:p,streamInfo:d})=>{if(!e)return;let c=Sr(e,t,d);if(Ca(d,t)){await c;return}let[u]=await Promise.all([Bl({stream:e,onStreamEnd:c,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:p,streamInfo:d}),c]);return u};var Gl=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?St([e,t].filter(Boolean)):void 0,Ul=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>Ta({...ow(e,r),fdNumber:"all",encoding:t,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:pw(e),stripFinalNewline:s,verboseInfo:a,streamInfo:o}),ow=({stdout:e,stderr:t,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:r,buffer:s}},pw=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;import{once as cw}from"events";var Nl=e=>It(e,"ipc"),Hl=(e,t)=>{let r=vi(e);De({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var Vl=async({subprocess:e,buffer:t,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let a=Nl(s),o=Ze(t,"ipc"),p=Ze(r,"ipc");for await(let d of ya({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:i,shouldAwait:!1,reference:!0}))o&&(Jd(e,n,p),n.push(d)),a&&Hl(d,s);return n},Wl=async(e,t)=>(await Promise.allSettled([e]),t);var Kl=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:p,stripFinalNewline:d,ipc:c,ipcInput:u},context:l,verboseInfo:m,fileDescriptors:h,originalStreams:f,onInternalError:w,controller:k})=>{let x=el(e,l),_={originalStreams:f,fileDescriptors:h,subprocess:e,exitPromise:x,propagating:!1},T=Fl({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:m,streamInfo:_}),S=Ul({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:m,streamInfo:_}),F=[],O=Vl({subprocess:e,buffer:r,maxBuffer:i,ipc:c,ipcOutput:F,verboseInfo:m}),B=dw(f,e,_),U=uw(h,_);try{return await Promise.race([Promise.all([{},rl(x),Promise.all(T),S,O,Ed(e,u),...B,...U]),w,lw(e,k),...wd(e,s,l,k),...Nc({subprocess:e,cancelSignal:a,gracefulCancel:o,context:l,controller:k}),...kd({subprocess:e,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:p,context:l,controller:k})])}catch(W){return l.terminationReason??="other",Promise.all([{error:W},x,Promise.all(T.map($=>ja($))),ja(S),Wl(O,F),Promise.allSettled(B),Promise.allSettled(U)])}},dw=(e,t,r)=>e.map((i,n)=>i===t.stdio[n]?void 0:Sr(i,n,r)),uw=(e,t)=>e.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>je(s,{checkOpen:!1})&&!Ae(s)).map(({type:n,value:s,stream:a=s})=>Sr(a,i,t,{isSameDirection:xe.has(n),stopOnExit:n==="native"}))),lw=async(e,{signal:t})=>{let[r]=await cw(e,"error",{signal:t});throw r};var Yl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),$r=(e,t,r)=>{let i=e[r];i.has(t)||i.set(t,[]);let n=i.get(t),s=Le();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Vt=async({resolve:e,promises:t},r)=>{e();let[i]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!i};import{Readable as mw}from"stream";import{callbackify as hw}from"util";import{finished as Jl}from"stream/promises";var Ra=async e=>{if(e!==void 0)try{await Ia(e)}catch{}},Xl=async e=>{if(e!==void 0)try{await Oa(e)}catch{}},Ia=async e=>{await Jl(e,{cleanup:!0,readable:!1,writable:!0})},Oa=async e=>{await Jl(e,{cleanup:!0,readable:!0,writable:!1})},qn=async(e,t)=>{if(await e,t)throw t},kn=(e,t,r)=>{r&&!bn(r)?e.destroy(r):t&&e.destroy()};var Zl=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,binary:n=!0,preserveNewlines:s=!0}={})=>{let a=n||fe.has(r),{subprocessStdout:o,waitReadableDestroy:p}=Da(e,i,t),{readableEncoding:d,readableObjectMode:c,readableHighWaterMark:u}=La(o,a),{read:l,onStdoutDataDone:m}=Ba({subprocessStdout:o,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),h=new mw({read:l,destroy:hw(Ma.bind(void 0,{subprocessStdout:o,subprocess:e,waitReadableDestroy:p})),highWaterMark:u,objectMode:c,encoding:d});return za({subprocessStdout:o,onStdoutDataDone:m,readable:h,subprocess:e}),h},Da=(e,t,r)=>{let i=zt(e,t),n=$r(r,i,"readableDestroy");return{subprocessStdout:i,waitReadableDestroy:n}},La=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},i)=>i?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Pa},Ba=({subprocessStdout:e,subprocess:t,binary:r,encoding:i,preserveNewlines:n})=>{let s=Le(),a=_n({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return{read(){yw(this,a,s)},onStdoutDataDone:s}},yw=async(e,t,r)=>{try{let{value:i,done:n}=await t.next();n?r.resolve():e.push(i)}catch{}},za=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Oa(e),await i,await Ra(n),await t,r.readable&&r.push(null)}catch(s){await Ra(n),Ql(r,s)}},Ma=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},i)=>{await Vt(r,t)&&(Ql(e,i),await qn(t,i))},Ql=(e,t)=>{kn(e,e.readable,t)};import{Writable as gw}from"stream";import{callbackify as em}from"util";var tm=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=Fa(e,r,t),a=new gw({...Ga(i,e,n),destroy:em(Na.bind(void 0,{subprocessStdin:i,subprocess:e,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Ua(i,a),a},Fa=(e,t,r)=>{let i=Ii(e,t),n=$r(r,i,"writableFinal"),s=$r(r,i,"writableDestroy");return{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},Ga=(e,t,r)=>({write:fw.bind(void 0,e),final:em(_w.bind(void 0,e,t,r))}),fw=(e,t,r,i)=>{e.write(t,r)?i():e.once("drain",i)},_w=async(e,t,r)=>{await Vt(r,t)&&(e.writable&&e.end(),await t)},Ua=async(e,t,r)=>{try{await Ia(e),t.writable&&t.end()}catch(i){await Xl(r),rm(t,i)}},Na=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Vt(r,t),await Vt(i,t)&&(rm(e,n),await qn(t,n))},rm=(e,t)=>{kn(e,e.writable,t)};import{Duplex as bw}from"stream";import{callbackify as qw}from"util";var im=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,to:n,binary:s=!0,preserveNewlines:a=!0}={})=>{let o=s||fe.has(r),{subprocessStdout:p,waitReadableDestroy:d}=Da(e,i,t),{subprocessStdin:c,waitWritableFinal:u,waitWritableDestroy:l}=Fa(e,n,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:f}=La(p,o),{read:w,onStdoutDataDone:k}=Ba({subprocessStdout:p,subprocess:e,binary:o,encoding:r,preserveNewlines:a}),x=new bw({read:w,...Ga(c,e,u),destroy:qw(kw.bind(void 0,{subprocessStdout:p,subprocessStdin:c,subprocess:e,waitReadableDestroy:d,waitWritableFinal:u,waitWritableDestroy:l})),readableHighWaterMark:f,writableHighWaterMark:c.writableHighWaterMark,readableObjectMode:h,writableObjectMode:c.writableObjectMode,encoding:m});return za({subprocessStdout:p,onStdoutDataDone:k,readable:x,subprocess:e,subprocessStdin:c}),Ua(c,x,p),x},kw=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},a)=>{await Promise.all([Ma({subprocessStdout:e,subprocess:r,waitReadableDestroy:i},a),Na({subprocessStdin:t,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},a)])};var Ha=(e,t,{from:r,binary:i=!1,preserveNewlines:n=!1}={})=>{let s=i||fe.has(t),a=zt(e,r),o=_n({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:n});return vw(o,a,e)},vw=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var nm=(e,{encoding:t})=>{let r=Yl();e.readable=Zl.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=tm.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=im.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Ha.bind(void 0,e,t),e[Symbol.asyncIterator]=Ha.bind(void 0,e,t,{})};var sm=(e,t)=>{for(let[r,i]of xw){let n=i.value.bind(t);Reflect.defineProperty(e,r,{...i,value:n})}},ww=(async()=>{})().constructor.prototype,xw=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ww,e)]);var am=(e,t,r,i)=>{let{file:n,commandArguments:s,command:a,escapedCommand:o,startTime:p,verboseInfo:d,options:c,fileDescriptors:u}=Aw(e,t,r),{subprocess:l,promise:m}=Pw({file:n,commandArguments:s,options:c,startTime:p,verboseInfo:d,command:a,escapedCommand:o,fileDescriptors:u});return l.pipe=fn.bind(void 0,{source:l,sourcePromise:m,boundOptions:{},createNested:i}),sm(l,m),Be.set(l,{options:c,fileDescriptors:u}),l},Aw=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=xi(e,t,r),{file:o,commandArguments:p,options:d}=Hi(e,t,r),c=Ew(d),u=fl(c,a);return{file:o,commandArguments:p,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:c,fileDescriptors:u}},Ew=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},Pw=({file:e,commandArguments:t,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:a,fileDescriptors:o})=>{let p;try{p=$w(...Vi(e,t,r))}catch(h){return ml({error:h,command:s,escapedCommand:a,fileDescriptors:o,options:r,startTime:i,verboseInfo:n})}let d=new AbortController;Sw(Number.POSITIVE_INFINITY,d.signal);let c=[...p.stdio];$l(p,o,d),El(p,r,d);let u={},l=Le();p.kill=Gc.bind(void 0,{kill:p.kill.bind(p),options:r,onInternalError:l,context:u,controller:d}),p.all=Gl(p,r),nm(p,r),dl(p,r);let m=jw({subprocess:p,options:r,startTime:i,verboseInfo:n,fileDescriptors:o,originalStreams:c,command:s,escapedCommand:a,context:u,onInternalError:l,controller:d});return{subprocess:p,promise:m}},jw=async({subprocess:e,options:t,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:a,escapedCommand:o,context:p,onInternalError:d,controller:c})=>{let[u,[l,m],h,f,w]=await Kl({subprocess:e,options:t,context:p,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:d,controller:c});c.abort(),d.resolve();let k=h.map((T,S)=>et(T,t,S)),x=et(f,t,"all"),_=Cw({errorInfo:u,exitCode:l,signal:m,stdio:k,all:x,ipcOutput:w,context:p,options:t,command:a,escapedCommand:o,startTime:r});return Ut(_,i,t)},Cw=({errorInfo:e,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,context:a,options:o,command:p,escapedCommand:d,startTime:c})=>"error"in e?qr({error:e.error,command:p,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof ze,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,options:o,startTime:c,isSync:!1}):tn({command:p,escapedCommand:d,stdio:i,all:n,ipcOutput:s,options:o,startTime:c});var vn=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([i,n])=>[i,Tw(i,e[i],n)]));return{...e,...r}},Tw=(e,t,r)=>Rw.has(e)&&Y(t)&&Y(r)?{...t,...r}:r,Rw=new Set(["env",...ks]);var dt=(e,t,r,i)=>{let n=(a,o,p)=>dt(a,o,r,p),s=(...a)=>Iw({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:i,createNested:n},...a);return i!==void 0&&i(s,n,t),s},Iw=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...a)=>{if(Y(s))return n(e,vn(r,s),i);let{file:o,commandArguments:p,options:d,isSync:c}=Ow({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:r});return c?nl(o,p,d):am(o,p,d,n)},Ow=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=fp(t)?_p(t,r):[t,...r],[a,o,p]=mi(...s),d=vn(vn(i,n),p),{file:c=a,commandArguments:u=o,options:l=d,isSync:m=!1}=e({file:a,commandArguments:o,options:d});return{file:c,commandArguments:u,options:l,isSync:m}};var om=({file:e,commandArguments:t})=>cm(e,t),pm=({file:e,commandArguments:t})=>({...cm(e,t),isSync:!0}),cm=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...i]=Dw(e);return{file:r,commandArguments:i}},Dw=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let i of t.split(Lw)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i)}return r},Lw=/ +/g;var dm=(e,t,r)=>{e.sync=t(Bw,r),e.s=e.sync},um=({options:e})=>lm(e),Bw=({options:e})=>({...lm(e),isSync:!0}),lm=e=>({options:{...zw(e),...e}}),zw=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},mm={preferLocal:!0};var te=dt(()=>({})),g1=dt(()=>({isSync:!0})),ut=dt(om),f1=dt(pm),_1=dt(Sd),b1=dt(um,{},mm,dm),{sendMessage:q1,getOneMessage:k1,getEachMessage:v1,getCancelSignal:w1}=ul();var ye=D(K(),1);var Wt=D(K(),1);import he from"fs";import Uw from"os";import me from"path";import Ce from"fs";import tt from"path";function b(e=process.cwd()){let t=Mw(e),r=tt.join(t,"docker-compose.yml");if(!Ce.existsSync(r))throw new Error(`Not a Spree project directory. No docker-compose.yml found.
142
- Run this command from a directory created with create-spree-app.`);let i=Fw(t);return{mode:"docker",projectDir:t,port:i}}var hm=["server","backend"];function xn(e){return hm.find(t=>Ce.existsSync(tt.join(e,t)))??"server"}function Mw(e){let t=tt.basename(e);if(!hm.includes(t))return e;let r=tt.dirname(e),i=new RegExp(`\\./${t}:/rails(:\\w+)?(\\s|$)`,"m");for(let n of["docker-compose.yml","docker-compose.dev.yml"]){let s=tt.join(r,n);if(Ce.existsSync(s))try{if(i.test(Ce.readFileSync(s,"utf-8")))return r}catch{}}return e}function Fe(e){let t=tt.join(e,".env");if(!Ce.existsSync(t))return!1;try{let r=Ce.readFileSync(t,"utf-8");return/^\s*SPREE_PATH\s*=/m.test(r)}catch{return!1}}function Sn(e){let t=tt.join(e,"docker-compose.yml");if(!Ce.existsSync(t))return!1;try{return/^\s*build\s*:/m.test(Ce.readFileSync(t,"utf-8"))}catch{return!1}}function $n(e){try{let r=Ce.readFileSync(tt.join(e,".env"),"utf-8").match(/^SPREE_SAMPLE_DATA=(true|false)\b/m);return r?r[1]==="true":void 0}catch{return}}function Fw(e){let t=tt.join(e,".env");if(!Ce.existsSync(t))return 3e3;let i=Ce.readFileSync(t,"utf-8").match(/^SPREE_PORT=(\d+)/m);return i?Number(i[1]):3e3}var ym=D(K(),1);async function Z(e,t,r){return te("docker",["compose",...e],{cwd:t,...r})}async function lt(e,t){try{await Z(["up","-d","--no-deps","web"],e,{stdio:t?.stdio??"inherit"})}catch{}}async function ne(e,t,r){return(await Wa(["bin/rails",e],t,{env:r})).split(`
141
+ if (condition) { yield value; }`)};import{Buffer as sk}from"buffer";import{StringDecoder as ak}from"string_decoder";var pn=(e,t,r)=>{if(r)return;if(e)return{transform:ok.bind(void 0,new TextEncoder)};let i=new ak(t);return{transform:pk.bind(void 0,i),final:ck.bind(void 0,i)}},ok=function*(e,t){sk.isBuffer(t)?yield Xe(t):typeof t=="string"?yield e.encode(t):yield t},pk=function*(e,t){yield ee(t)?e.write(t):t},ck=function*(e){let t=e.end();t!==""&&(yield t)};import{callbackify as Uu}from"util";var ca=Uu(async(e,t,r,i)=>{t.currentIterable=e(...r);try{for await(let n of t.currentIterable)i.push(n)}finally{delete t.currentIterable}}),cn=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=uk}=t[r];for await(let n of i(e))yield*cn(n,t,r+1)},Nu=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*dk(r,Number(t),e)},dk=async function*(e,t,r){if(e!==void 0)for await(let i of e())yield*cn(i,r,t+1)},Hu=Uu(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),uk=function*(e){yield e};var da=(e,t,r,i)=>{try{for(let n of e(...t))r.push(n);i()}catch(n){i(n)}},Vu=(e,t)=>[...t.flatMap(r=>[...xt(r,e,0)]),...kr(e)],xt=function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=mk}=t[r];for(let n of i(e))yield*xt(n,t,r+1)},kr=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*lk(r,Number(t),e)},lk=function*(e,t,r){if(e!==void 0)for(let i of e())yield*xt(i,r,t+1)},mk=function*(e){yield e};var ua=({value:e,value:{transform:t,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:a})=>{let o={},p=Ku(e,a,s),d=wt(t),c=wt(r),u=d?ca.bind(void 0,cn,o):da.bind(void 0,xt),l=d||c?ca.bind(void 0,Nu,o):da.bind(void 0,kr),m=d||c?Hu.bind(void 0,o):void 0;return{stream:new hk({writableObjectMode:i,writableHighWaterMark:Wu(i),readableObjectMode:n,readableHighWaterMark:Wu(n),transform(f,w,v){u([f,p,0],this,v)},flush(f){l([p],this,f)},destroy:m})}},dn=(e,t,r,i)=>{let n=t.filter(({type:a})=>a==="generator"),s=i?n.reverse():n;for(let{value:a,optionName:o}of s){let p=Ku(a,r,o);e=Vu(p,e)}return e},Ku=({transform:e,final:t,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},a,o)=>{let p={};return[{transform:Mu(i,o)},pn(r,a,i),on(r,s,i,p),{transform:e,final:t},{transform:Fu(n,o)},zu({binary:r,preserveNewlines:s,readableObjectMode:n,state:p})].filter(Boolean)};var Yu=(e,t)=>{for(let r of yk(e))gk(e,r,t)},yk=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),gk=(e,t,r)=>{let{stdioItems:i}=e[t],n=i.filter(({contents:o})=>o!==void 0);if(n.length===0)return;if(t!==0){let[{type:o,optionName:p}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${p}\`, can be ${ct[o]} with synchronous methods.`)}let a=n.map(({contents:o})=>o).map(o=>fk(o,i));r.input=ur(a)},fk=(e,t)=>{let r=dn(e,t,"utf8",!0);return _k(r),ur(r)},_k=e=>{let t=e.find(r=>typeof r!="string"&&!ee(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};import{writeFileSync as vk,appendFileSync as wk}from"fs";var un=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:i})=>i!=="all"&&It(r,i)&&!fe.has(t)&&bk(i)&&(e.some(({type:n,value:s})=>n==="native"&&qk.has(s))||e.every(({type:n})=>xe.has(n))),bk=e=>e===1||e===2,qk=new Set(["pipe","overlapped"]),Ju=async(e,t,r,i)=>{for await(let n of e)kk(t)||Zu(n,r,i)},Xu=(e,t,r)=>{for(let i of e)Zu(i,t,r)},kk=e=>e._readableState.pipes.length>0,Zu=(e,t,r)=>{let i=vi(e);De({type:"output",verboseMessage:i,fdNumber:t,verboseInfo:r})};var Qu=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(t===null)return{output:Array.from({length:3})};let s={},a=new Set([]);return{output:t.map((p,d)=>xk({result:p,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:i,verboseInfo:n},r)),...s}},xk=({result:e,fileDescriptors:t,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:a},{buffer:o,encoding:p,lines:d,stripFinalNewline:c,maxBuffer:u})=>{if(e===null)return;let l=eu(e,s,u),m=Xe(l),{stdioItems:h,objectMode:f}=t[r],w=Sk([m],h,p,i),{serializedResult:v,finalResult:x=v}=$k({chunks:w,objectMode:f,encoding:p,lines:d,stripFinalNewline:c,fdNumber:r});Ak({serializedResult:v,fdNumber:r,state:i,verboseInfo:a,encoding:p,stdioItems:h,objectMode:f});let _=o[r]?x:void 0;try{return i.error===void 0&&Ek(v,h,n),_}catch(T){return i.error=T,_}},Sk=(e,t,r,i)=>{try{return dn(e,t,r,!1)}catch(n){return i.error=n,e}},$k=({chunks:e,objectMode:t,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:ur(e)};let a=hp(e,r);return i[s]?{serializedResult:a,finalResult:pa(a,!n[s],t)}:{serializedResult:a}},Ak=({serializedResult:e,fdNumber:t,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:a})=>{if(!un({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:t}))return;let o=pa(e,!1,a);try{Xu(o,t,i)}catch(p){r.error??=p}},Ek=(e,t,r)=>{for(let{path:i,append:n}of t.filter(({type:s})=>sn.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?wk(i,e):(r.add(s),vk(i,e))}};var el=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,et(t,r,"all")]:Array.isArray(t)?[et(e,r,"all"),...t]:ee(e)&&ee(t)?fs([e,t]):`${e}${t}`};import{once as la}from"events";var tl=async(e,t)=>{let[r,i]=await Pk(e);return t.isForcefullyTerminated??=!1,[r,i]},Pk=async e=>{let[t,r]=await Promise.allSettled([la(e,"spawn"),la(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?rl(e):r.value},rl=async e=>{try{return await la(e,"exit")}catch{return rl(e)}},il=async e=>{let[t,r]=await e;if(!jk(t,r)&&ma(t,r))throw new Ee;return[t,r]},jk=(e,t)=>e===void 0&&t===void 0,ma=(e,t)=>e!==0||t!==null;var nl=({error:e,status:t,signal:r,output:i},{maxBuffer:n})=>{let s=Ck(e,t,r),a=s?.code==="ETIMEDOUT",o=Qd(s,i,n);return{resultError:s,exitCode:t,signal:r,timedOut:a,isMaxBuffer:o}},Ck=(e,t,r)=>e!==void 0?e:ma(t,r)?new Ee:void 0;var sl=(e,t,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:a,startTime:o,verboseInfo:p,options:d,fileDescriptors:c}=Rk(e,t,r),u=Dk({file:i,commandArguments:n,options:d,command:s,escapedCommand:a,verboseInfo:p,fileDescriptors:c,startTime:o});return Ut(u,p,d)},Rk=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=xi(e,t,r),o=Ik(r),{file:p,commandArguments:d,options:c}=Hi(e,t,o);Ok(c);let u=Ou(c,a);return{file:p,commandArguments:d,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:c,fileDescriptors:u}},Ik=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Ok=({ipc:e,ipcInput:t,detached:r,cancelSignal:i})=>{t&&ln("ipcInput"),e&&ln("ipc: true"),r&&ln("detached: true"),i&&ln("cancelSignal")},ln=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Dk=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:a,startTime:o})=>{let p=Lk({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:a,startTime:o});if(p.failed)return p;let{resultError:d,exitCode:c,signal:u,timedOut:l,isMaxBuffer:m}=nl(p,r),{output:h,error:f=d}=Qu({fileDescriptors:a,syncResult:p,options:r,isMaxBuffer:m,verboseInfo:s}),w=h.map((x,_)=>et(x,r,_)),v=et(el(h,r),r,"all");return zk({error:f,exitCode:c,signal:u,timedOut:l,isMaxBuffer:m,stdio:w,all:v,options:r,command:i,escapedCommand:n,startTime:o})},Lk=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:a})=>{try{Yu(s,r);let o=Bk(r);return Tk(...Vi(e,t,o))}catch(o){return Gt({error:o,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:a,isSync:!0})}},Bk=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:en(t)}),zk=({error:e,exitCode:t,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:a,options:o,command:p,escapedCommand:d,startTime:c})=>e===void 0?tn({command:p,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:o,startTime:c}):qr({error:e,command:p,escapedCommand:d,timedOut:i,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:n,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:s,all:a,ipcOutput:[],options:o,startTime:c,isSync:!0});import{setMaxListeners as $w}from"events";import{spawn as Aw}from"child_process";import dl from"process";import{once as ha,on as Mk}from"events";var al=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0,filter:s}={})=>(Lt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:zi(e)}),Fk({anyProcess:e,channel:t,isSubprocess:r,filter:s,reference:n})),Fk=async({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:n})=>{Oi(t,n);let s=pt(e,t,r),a=new AbortController;try{return await Promise.race([Gk(s,i,a),Uk(s,r,a),Nk(s,r,a)])}catch(o){throw Bt(e),o}finally{a.abort(),Di(t,n)}},Gk=async(e,t,{signal:r})=>{if(t===void 0){let[i]=await ha(e,"message",{signal:r});return i}for await(let[i]of Mk(e,"message",{signal:r}))if(t(i))return i},Uk=async(e,t,{signal:r})=>{await ha(e,"disconnect",{signal:r}),Vc(t)},Nk=async(e,t,{signal:r})=>{let[i]=await ha(e,"strict:error",{signal:r});throw Ti(i,t)};import{once as pl,on as Hk}from"events";var cl=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0}={})=>ya({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),ya=({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Lt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:zi(e)}),Oi(t,s);let a=pt(e,t,r),o=new AbortController,p={};return Vk(e,a,o),Wk({ipcEmitter:a,isSubprocess:r,controller:o,state:p}),Kk({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:r,shouldAwait:n,controller:o,state:p,reference:s})},Vk=async(e,t,r)=>{try{await pl(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Wk=async({ipcEmitter:e,isSubprocess:t,controller:r,state:i})=>{try{let[n]=await pl(e,"strict:error",{signal:r.signal});i.error=Ti(n,t),r.abort()}catch{}},Kk=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:a,reference:o}){try{for await(let[p]of Hk(r,"message",{signal:s.signal}))ol(a),yield p}catch{ol(a)}finally{s.abort(),Di(t,o),i||Bt(e),n&&await e}},ol=({error:e})=>{if(e)throw e};var ul=(e,{ipc:t})=>{Object.assign(e,ml(e,!1,t))},ll=()=>{let e=dl,t=!0,r=dl.channel!==void 0;return{...ml(e,t,r),getCancelSignal:bd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},ml=(e,t,r)=>({sendMessage:Ui.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:al.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:cl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});import{ChildProcess as Yk}from"child_process";import{PassThrough as Jk,Readable as Xk,Writable as Zk,Duplex as Qk}from"stream";var hl=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:a})=>{sa(i);let o=new Yk;ev(o,i),Object.assign(o,{readable:tv,writable:rv,duplex:iv});let p=Gt({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:!1}),d=nv(p,a,n);return{subprocess:o,promise:d}},ev=(e,t)=>{let r=vr(),i=vr(),n=vr(),s=Array.from({length:t.length-3},vr),a=vr(),o=[r,i,n,...s];Object.assign(e,{stdin:r,stdout:i,stderr:n,all:a,stdio:o})},vr=()=>{let e=new Jk;return e.end(),e},tv=()=>new Xk({read(){}}),rv=()=>new Zk({write(){}}),iv=()=>new Qk({read(){},write(){}}),nv=async(e,t,r)=>Ut(e,t,r);import{createReadStream as yl,createWriteStream as gl}from"fs";import{Buffer as sv}from"buffer";import{Readable as wr,Writable as av,Duplex as ov}from"stream";var _l=(e,t)=>an(pv,e,t,!1),xr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ct[e]}.`)},fl={fileNumber:xr,generator:ua,asyncGenerator:ua,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let i=t||r;return{stream:ov.fromWeb(e,{objectMode:i})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},pv={input:{...fl,fileUrl:({value:e})=>({stream:yl(e)}),filePath:({value:{file:e}})=>({stream:yl(e)}),webStream:({value:e})=>({stream:wr.fromWeb(e)}),iterable:({value:e})=>({stream:wr.from(e)}),asyncIterable:({value:e})=>({stream:wr.from(e)}),string:({value:e})=>({stream:wr.from(e)}),uint8Array:({value:e})=>({stream:wr.from(sv.from(e))})},output:{...fl,fileUrl:({value:e})=>({stream:gl(e)}),filePath:({value:{file:e,append:t}})=>({stream:gl(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:av.fromWeb(e)}),iterable:xr,asyncIterable:xr,string:xr,uint8Array:xr}};import{on as cv,once as bl}from"events";import{PassThrough as dv,getDefaultHighWaterMark as uv}from"stream";import{finished as vl}from"stream/promises";function St(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let n of e)fa(n);let t=e.some(({readableObjectMode:n})=>n),r=lv(e,t),i=new ga({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of e)i.add(n);return i}var lv=(e,t)=>{if(e.length===0)return uv(t);let r=e.filter(({readableObjectMode:i})=>i===t).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ga=class extends dv{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(t){if(fa(t),this.#t.has(t))return;this.#t.add(t),this.#i??=mv(this,this.#t,this.#s);let r=gv({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(fa(t),!this.#t.has(t))return!1;let r=this.#n.get(t);return r===void 0?!1:(this.#n.delete(t),t.unpipe(this),await r,!0)}},mv=async(e,t,r)=>{mn(e,ql);let i=new AbortController;try{await Promise.race([hv(e,i),yv(e,t,r,i)])}finally{i.abort(),mn(e,-ql)}},hv=async(e,{signal:t})=>{try{await vl(e,{signal:t,cleanup:!0})}catch(r){throw wl(e,r),r}},yv=async(e,t,r,{signal:i})=>{for await(let[n]of cv(e,"unpipe",{signal:i}))t.has(n)&&n.emit(r)},fa=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},gv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:a})=>{mn(e,kl);let o=new AbortController;try{await Promise.race([fv(s,t,o),_v({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:o}),bv({stream:t,streams:r,ended:i,aborted:n,unpipeEvent:a,controller:o})])}finally{o.abort(),mn(e,-kl)}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?_a(e):qv(e))},fv=async(e,t,{signal:r})=>{try{await e,r.aborted||_a(t)}catch(i){r.aborted||wl(t,i)}},_v=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await vl(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&i.add(t)}catch(a){if(s.aborted||!r.has(t))return;xl(a)?n.add(t):Sl(e,a)}},bv=async({stream:e,streams:t,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await bl(e,n,{signal:s}),!e.readable)return bl(s,"abort",{signal:s});t.delete(e),r.delete(e),i.delete(e)},qv=e=>{e.writable&&e.end()},wl=(e,t)=>{xl(t)?_a(e):Sl(e,t)},xl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",_a=e=>{(e.readable||e.writable)&&e.destroy()},Sl=(e,t)=>{e.destroyed||(e.once("error",kv),e.destroy(t))},kv=()=>{},mn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},ql=2,kl=1;import{finished as $l}from"stream/promises";var Ht=(e,t)=>{e.pipe(t),vv(e,t),wv(e,t)},vv=async(e,t)=>{if(!(Ae(e)||Ae(t))){try{await $l(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ba(t)}},ba=e=>{e.writable&&e.end()},wv=async(e,t)=>{if(!(Ae(e)||Ae(t))){try{await $l(t,{cleanup:!0,readable:!1,writable:!0})}catch{}qa(e)}},qa=e=>{e.readable&&e.destroy()};var Al=(e,t,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:a}]of Object.entries(t)){for(let{stream:o}of s.filter(({type:p})=>xe.has(p)))xv(e,o,a,n);for(let{stream:o}of s.filter(({type:p})=>!xe.has(p)))$v({subprocess:e,stream:o,direction:a,fdNumber:n,pipeGroups:i,controller:r})}for(let[n,s]of i.entries()){let a=s.length===1?s[0]:St(s);Ht(a,n)}},xv=(e,t,r,i)=>{r==="output"?Ht(e.stdio[i],t):Ht(t,e.stdio[i]);let n=Sv[i];n!==void 0&&(e[n]=t),e.stdio[i]=t},Sv=["stdin","stdout","stderr"],$v=({subprocess:e,stream:t,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(t===void 0)return;Av(t,s);let[a,o]=r==="output"?[t,e.stdio[i]]:[e.stdio[i],t],p=n.get(a)??[];n.set(a,[...p,o])},Av=(e,{signal:t})=>{Ae(e)&&kt(e,Ev,t)},Ev=2;import{addAbortListener as Cv}from"events";var $t=[];$t.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&$t.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$t.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hn=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",ka=Symbol.for("signal-exit emitter"),va=globalThis,Pv=Object.defineProperty.bind(Object),wa=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(va[ka])return va[ka];Pv(va,ka,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let i=this.listeners[t],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(t,r,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let s of this.listeners[t])n=s(r,i)===!0||n;return t==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},yn=class{},jv=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),xa=class extends yn{onExit(){return()=>{}}load(){}unload(){}},Sa=class extends yn{#t=$a.platform==="win32"?"SIGINT":"SIGHUP";#r=new wa;#e;#i;#s;#n={};#a=!1;constructor(t){super(),this.#e=t,this.#n={};for(let r of $t)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||t.kill(t.pid,o)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,r){if(!hn(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,t),()=>{this.#r.removeListener(i,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let t of $t)try{let r=this.#n[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#o(t)}}unload(){this.#a&&(this.#a=!1,$t.forEach(t=>{let r=this.#n[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1)}#o(t){return hn(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let i=this.#i;if(t==="exit"&&hn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,t,...r)}},$a=globalThis.process,{onExit:El,load:AI,unload:EI}=jv(hn($a)?new Sa($a):new xa);var Pl=(e,{cleanup:t,detached:r},{signal:i})=>{if(!t||r)return;let n=El(()=>{e.kill()});Cv(i,()=>{n()})};var Cl=({source:e,sourcePromise:t,boundOptions:r,createNested:i},...n)=>{let s=wi(),{destination:a,destinationStream:o,destinationError:p,from:d,unpipeSignal:c}=Tv(r,i,n),{sourceStream:u,sourceError:l}=Iv(e,d),{options:m,fileDescriptors:h}=Be.get(e);return{sourcePromise:t,sourceStream:u,sourceOptions:m,sourceError:l,destination:a,destinationStream:o,destinationError:p,unpipeSignal:c,fileDescriptors:h,startTime:s}},Tv=(e,t,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:a}={}}=Rv(e,t,...r),o=Ii(i,s);return{destination:i,destinationStream:o,from:n,unpipeSignal:a}}catch(i){return{destinationError:i}}},Rv=(e,t,r,...i)=>{if(Array.isArray(r))return{destination:t(jl,e)(r,...i),pipeOptions:e};if(typeof r=="string"||r instanceof URL||ys(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,a]=mi(r,...i);return{destination:t(jl)(n,s,a),pipeOptions:a}}if(Be.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},jl=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),Iv=(e,t)=>{try{return{sourceStream:zt(e,t)}}catch(r){return{sourceError:r}}};var Rl=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:a})=>{let o=Ov({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i});if(o!==void 0)throw Aa({error:o,fileDescriptors:n,sourceOptions:s,startTime:a})},Ov=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i})=>{if(t!==void 0&&i!==void 0)return i;if(i!==void 0)return qa(e),i;if(t!==void 0)return ba(r),t},Aa=({error:e,fileDescriptors:t,sourceOptions:r,startTime:i})=>Gt({error:e,command:Tl,escapedCommand:Tl,fileDescriptors:t,options:r,startTime:i,isSync:!1}),Tl="source.pipe(destination)";var Il=async e=>{let[{status:t,reason:r,value:i=r},{status:n,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(i)||a.pipedFrom.push(i),n==="rejected")throw a;if(t==="rejected")throw i;return a};import{finished as Dv}from"stream/promises";var Ol=(e,t,r)=>{let i=gn.has(t)?Bv(e,t):Lv(e,t);return kt(e,Mv,r.signal),kt(t,Fv,r.signal),zv(t),i},Lv=(e,t)=>{let r=St([e]);return Ht(r,t),gn.set(t,r),r},Bv=(e,t)=>{let r=gn.get(t);return r.add(e),r},zv=async e=>{try{await Dv(e,{cleanup:!0,readable:!1,writable:!0})}catch{}gn.delete(e)},gn=new WeakMap,Mv=2,Fv=1;import{aborted as Gv}from"util";var Dl=(e,t)=>e===void 0?[]:[Uv(e,t)],Uv=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await Gv(e,t),await r.remove(t);let a=new Error("Pipe canceled by `unpipeSignal` option.");throw Aa({error:a,fileDescriptors:i,sourceOptions:n,startTime:s})};var fn=(e,...t)=>{if(Y(t[0]))return fn.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...i}=Cl(e,...t),n=Nv({...i,destination:r});return n.pipe=fn.bind(void 0,{...e,source:r,sourcePromise:n,boundOptions:{}}),n},Nv=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:a,unpipeSignal:o,fileDescriptors:p,startTime:d})=>{let c=Hv(e,n);Rl({sourceStream:t,sourceError:i,destinationStream:s,destinationError:a,fileDescriptors:p,sourceOptions:r,startTime:d});let u=new AbortController;try{let l=Ol(t,s,u);return await Promise.race([Il(c),...Dl(o,{sourceStream:t,mergedStream:l,sourceOptions:r,fileDescriptors:p,startTime:d})])}finally{u.abort()}},Hv=(e,t)=>Promise.allSettled([e,t]);import{setImmediate as Zv}from"timers/promises";import{on as Vv}from"events";import{getDefaultHighWaterMark as Wv}from"stream";var _n=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let a=new AbortController;return Kv(t,a),Bl({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&i,encoding:n,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},Kv=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ea=({stream:e,onStreamEnd:t,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let a=new AbortController;Yv(t,a,e);let o=e.readableObjectMode&&!s;return Bl({stream:e,controller:a,binary:i==="buffer",shouldEncode:!o,encoding:i,shouldSplit:!o&&r,preserveNewlines:!n})},Yv=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},Bl=({stream:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})=>{let o=Vv(e,"data",{signal:t.signal,highWaterMark:Ll,highWatermark:Ll});return Jv({onStdoutChunk:o,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})},Pa=Wv(!0),Ll=Pa,Jv=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a}){let o=Xv({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a});try{for await(let[p]of e)yield*xt(p,o,0)}catch(p){if(!t.signal.aborted)throw p}finally{yield*kr(o)}},Xv=({binary:e,shouldEncode:t,encoding:r,shouldSplit:i,preserveNewlines:n})=>[pn(e,r,!t),on(e,n,!i,{})].filter(Boolean);var zl=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:a,allMixed:o,stripFinalNewline:p,verboseInfo:d,streamInfo:c})=>{let u=Qv({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:o,verboseInfo:d,streamInfo:c});if(!n){await Promise.all([ew(e),u]);return}let l=aa(p,r),m=Ea({stream:e,onStreamEnd:t,lines:a,encoding:i,stripFinalNewline:l,allMixed:o}),[h]=await Promise.all([tw({stream:e,iterable:m,fdNumber:r,encoding:i,maxBuffer:s,lines:a}),u]);return h},Qv=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!un({stdioItems:a[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let o=Ea({stream:e,onStreamEnd:t,lines:!0,encoding:i,stripFinalNewline:!0,allMixed:n});await Ju(o,e,r,s)},ew=async e=>{await Zv(),e.readableFlowing===null&&e.resume()},tw=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:a})=>{try{return t||a?await Ji(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await Xi(r,{maxBuffer:s})):await Qi(r,{maxBuffer:s})}catch(o){return Ml(Jd({error:o,stream:e,readableObjectMode:t,lines:a,encoding:n,fdNumber:i}))}},ja=async e=>{try{return await e}catch(t){return Ml(t)}},Ml=({bufferedData:e})=>lp(e)?new Uint8Array(e):e;import{finished as rw}from"stream/promises";var Sr=async(e,t,r,{isSameDirection:i,stopOnExit:n=!1}={})=>{let s=iw(e,r),a=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],rw(e,{cleanup:!0,signal:a.signal})])}catch(o){s.stdinCleanedUp||aw(o,t,r,i)}finally{a.abort()}},iw=(e,{originalStreams:[t],subprocess:r})=>{let i={stdinCleanedUp:!1};return e===t&&nw(e,r,i),i},nw=(e,t,r)=>{let{_destroy:i}=e;e._destroy=(...n)=>{sw(t,r),i.call(e,...n)}},sw=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},aw=(e,t,r,i)=>{if(!ow(e,t,r,i))throw e},ow=(e,t,r,i=!0)=>r.propagating?Fl(e)||bn(e):(r.propagating=!0,Ca(r,t)===i?Fl(e):bn(e)),Ca=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",bn=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Fl=e=>e?.code==="EPIPE";var Gl=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>e.stdio.map((p,d)=>Ta({stream:p,fdNumber:d,encoding:t,buffer:r[d],maxBuffer:i[d],lines:n[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:o})),Ta=async({stream:e,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:p,streamInfo:d})=>{if(!e)return;let c=Sr(e,t,d);if(Ca(d,t)){await c;return}let[u]=await Promise.all([zl({stream:e,onStreamEnd:c,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:p,streamInfo:d}),c]);return u};var Ul=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?St([e,t].filter(Boolean)):void 0,Nl=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>Ta({...pw(e,r),fdNumber:"all",encoding:t,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:cw(e),stripFinalNewline:s,verboseInfo:a,streamInfo:o}),pw=({stdout:e,stderr:t,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:r,buffer:s}},cw=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;import{once as dw}from"events";var Hl=e=>It(e,"ipc"),Vl=(e,t)=>{let r=vi(e);De({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var Wl=async({subprocess:e,buffer:t,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let a=Hl(s),o=Ze(t,"ipc"),p=Ze(r,"ipc");for await(let d of ya({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:i,shouldAwait:!1,reference:!0}))o&&(Xd(e,n,p),n.push(d)),a&&Vl(d,s);return n},Kl=async(e,t)=>(await Promise.allSettled([e]),t);var Yl=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:p,stripFinalNewline:d,ipc:c,ipcInput:u},context:l,verboseInfo:m,fileDescriptors:h,originalStreams:f,onInternalError:w,controller:v})=>{let x=tl(e,l),_={originalStreams:f,fileDescriptors:h,subprocess:e,exitPromise:x,propagating:!1},T=Gl({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:m,streamInfo:_}),S=Nl({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:m,streamInfo:_}),F=[],O=Wl({subprocess:e,buffer:r,maxBuffer:i,ipc:c,ipcOutput:F,verboseInfo:m}),B=uw(f,e,_),U=lw(h,_);try{return await Promise.race([Promise.all([{},il(x),Promise.all(T),S,O,Pd(e,u),...B,...U]),w,mw(e,v),...xd(e,s,l,v),...Hc({subprocess:e,cancelSignal:a,gracefulCancel:o,context:l,controller:v}),...vd({subprocess:e,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:p,context:l,controller:v})])}catch(W){return l.terminationReason??="other",Promise.all([{error:W},x,Promise.all(T.map($=>ja($))),ja(S),Kl(O,F),Promise.allSettled(B),Promise.allSettled(U)])}},uw=(e,t,r)=>e.map((i,n)=>i===t.stdio[n]?void 0:Sr(i,n,r)),lw=(e,t)=>e.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>je(s,{checkOpen:!1})&&!Ae(s)).map(({type:n,value:s,stream:a=s})=>Sr(a,i,t,{isSameDirection:xe.has(n),stopOnExit:n==="native"}))),mw=async(e,{signal:t})=>{let[r]=await dw(e,"error",{signal:t});throw r};var Jl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),$r=(e,t,r)=>{let i=e[r];i.has(t)||i.set(t,[]);let n=i.get(t),s=Le();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Vt=async({resolve:e,promises:t},r)=>{e();let[i]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!i};import{Readable as hw}from"stream";import{callbackify as yw}from"util";import{finished as Xl}from"stream/promises";var Ra=async e=>{if(e!==void 0)try{await Ia(e)}catch{}},Zl=async e=>{if(e!==void 0)try{await Oa(e)}catch{}},Ia=async e=>{await Xl(e,{cleanup:!0,readable:!1,writable:!0})},Oa=async e=>{await Xl(e,{cleanup:!0,readable:!0,writable:!1})},qn=async(e,t)=>{if(await e,t)throw t},kn=(e,t,r)=>{r&&!bn(r)?e.destroy(r):t&&e.destroy()};var Ql=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,binary:n=!0,preserveNewlines:s=!0}={})=>{let a=n||fe.has(r),{subprocessStdout:o,waitReadableDestroy:p}=Da(e,i,t),{readableEncoding:d,readableObjectMode:c,readableHighWaterMark:u}=La(o,a),{read:l,onStdoutDataDone:m}=Ba({subprocessStdout:o,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),h=new hw({read:l,destroy:yw(Ma.bind(void 0,{subprocessStdout:o,subprocess:e,waitReadableDestroy:p})),highWaterMark:u,objectMode:c,encoding:d});return za({subprocessStdout:o,onStdoutDataDone:m,readable:h,subprocess:e}),h},Da=(e,t,r)=>{let i=zt(e,t),n=$r(r,i,"readableDestroy");return{subprocessStdout:i,waitReadableDestroy:n}},La=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},i)=>i?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Pa},Ba=({subprocessStdout:e,subprocess:t,binary:r,encoding:i,preserveNewlines:n})=>{let s=Le(),a=_n({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return{read(){gw(this,a,s)},onStdoutDataDone:s}},gw=async(e,t,r)=>{try{let{value:i,done:n}=await t.next();n?r.resolve():e.push(i)}catch{}},za=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Oa(e),await i,await Ra(n),await t,r.readable&&r.push(null)}catch(s){await Ra(n),em(r,s)}},Ma=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},i)=>{await Vt(r,t)&&(em(e,i),await qn(t,i))},em=(e,t)=>{kn(e,e.readable,t)};import{Writable as fw}from"stream";import{callbackify as tm}from"util";var rm=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=Fa(e,r,t),a=new fw({...Ga(i,e,n),destroy:tm(Na.bind(void 0,{subprocessStdin:i,subprocess:e,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Ua(i,a),a},Fa=(e,t,r)=>{let i=Ii(e,t),n=$r(r,i,"writableFinal"),s=$r(r,i,"writableDestroy");return{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},Ga=(e,t,r)=>({write:_w.bind(void 0,e),final:tm(bw.bind(void 0,e,t,r))}),_w=(e,t,r,i)=>{e.write(t,r)?i():e.once("drain",i)},bw=async(e,t,r)=>{await Vt(r,t)&&(e.writable&&e.end(),await t)},Ua=async(e,t,r)=>{try{await Ia(e),t.writable&&t.end()}catch(i){await Zl(r),im(t,i)}},Na=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Vt(r,t),await Vt(i,t)&&(im(e,n),await qn(t,n))},im=(e,t)=>{kn(e,e.writable,t)};import{Duplex as qw}from"stream";import{callbackify as kw}from"util";var nm=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,to:n,binary:s=!0,preserveNewlines:a=!0}={})=>{let o=s||fe.has(r),{subprocessStdout:p,waitReadableDestroy:d}=Da(e,i,t),{subprocessStdin:c,waitWritableFinal:u,waitWritableDestroy:l}=Fa(e,n,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:f}=La(p,o),{read:w,onStdoutDataDone:v}=Ba({subprocessStdout:p,subprocess:e,binary:o,encoding:r,preserveNewlines:a}),x=new qw({read:w,...Ga(c,e,u),destroy:kw(vw.bind(void 0,{subprocessStdout:p,subprocessStdin:c,subprocess:e,waitReadableDestroy:d,waitWritableFinal:u,waitWritableDestroy:l})),readableHighWaterMark:f,writableHighWaterMark:c.writableHighWaterMark,readableObjectMode:h,writableObjectMode:c.writableObjectMode,encoding:m});return za({subprocessStdout:p,onStdoutDataDone:v,readable:x,subprocess:e,subprocessStdin:c}),Ua(c,x,p),x},vw=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},a)=>{await Promise.all([Ma({subprocessStdout:e,subprocess:r,waitReadableDestroy:i},a),Na({subprocessStdin:t,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},a)])};var Ha=(e,t,{from:r,binary:i=!1,preserveNewlines:n=!1}={})=>{let s=i||fe.has(t),a=zt(e,r),o=_n({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:n});return ww(o,a,e)},ww=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var sm=(e,{encoding:t})=>{let r=Jl();e.readable=Ql.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=rm.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=nm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Ha.bind(void 0,e,t),e[Symbol.asyncIterator]=Ha.bind(void 0,e,t,{})};var am=(e,t)=>{for(let[r,i]of Sw){let n=i.value.bind(t);Reflect.defineProperty(e,r,{...i,value:n})}},xw=(async()=>{})().constructor.prototype,Sw=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(xw,e)]);var om=(e,t,r,i)=>{let{file:n,commandArguments:s,command:a,escapedCommand:o,startTime:p,verboseInfo:d,options:c,fileDescriptors:u}=Ew(e,t,r),{subprocess:l,promise:m}=jw({file:n,commandArguments:s,options:c,startTime:p,verboseInfo:d,command:a,escapedCommand:o,fileDescriptors:u});return l.pipe=fn.bind(void 0,{source:l,sourcePromise:m,boundOptions:{},createNested:i}),am(l,m),Be.set(l,{options:c,fileDescriptors:u}),l},Ew=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=xi(e,t,r),{file:o,commandArguments:p,options:d}=Hi(e,t,r),c=Pw(d),u=_l(c,a);return{file:o,commandArguments:p,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:c,fileDescriptors:u}},Pw=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},jw=({file:e,commandArguments:t,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:a,fileDescriptors:o})=>{let p;try{p=Aw(...Vi(e,t,r))}catch(h){return hl({error:h,command:s,escapedCommand:a,fileDescriptors:o,options:r,startTime:i,verboseInfo:n})}let d=new AbortController;$w(Number.POSITIVE_INFINITY,d.signal);let c=[...p.stdio];Al(p,o,d),Pl(p,r,d);let u={},l=Le();p.kill=Uc.bind(void 0,{kill:p.kill.bind(p),options:r,onInternalError:l,context:u,controller:d}),p.all=Ul(p,r),sm(p,r),ul(p,r);let m=Cw({subprocess:p,options:r,startTime:i,verboseInfo:n,fileDescriptors:o,originalStreams:c,command:s,escapedCommand:a,context:u,onInternalError:l,controller:d});return{subprocess:p,promise:m}},Cw=async({subprocess:e,options:t,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:a,escapedCommand:o,context:p,onInternalError:d,controller:c})=>{let[u,[l,m],h,f,w]=await Yl({subprocess:e,options:t,context:p,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:d,controller:c});c.abort(),d.resolve();let v=h.map((T,S)=>et(T,t,S)),x=et(f,t,"all"),_=Tw({errorInfo:u,exitCode:l,signal:m,stdio:v,all:x,ipcOutput:w,context:p,options:t,command:a,escapedCommand:o,startTime:r});return Ut(_,i,t)},Tw=({errorInfo:e,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,context:a,options:o,command:p,escapedCommand:d,startTime:c})=>"error"in e?qr({error:e.error,command:p,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof ze,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,options:o,startTime:c,isSync:!1}):tn({command:p,escapedCommand:d,stdio:i,all:n,ipcOutput:s,options:o,startTime:c});var vn=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([i,n])=>[i,Rw(i,e[i],n)]));return{...e,...r}},Rw=(e,t,r)=>Iw.has(e)&&Y(t)&&Y(r)?{...t,...r}:r,Iw=new Set(["env",...ks]);var dt=(e,t,r,i)=>{let n=(a,o,p)=>dt(a,o,r,p),s=(...a)=>Ow({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:i,createNested:n},...a);return i!==void 0&&i(s,n,t),s},Ow=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...a)=>{if(Y(s))return n(e,vn(r,s),i);let{file:o,commandArguments:p,options:d,isSync:c}=Dw({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:r});return c?sl(o,p,d):om(o,p,d,n)},Dw=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=_p(t)?bp(t,r):[t,...r],[a,o,p]=mi(...s),d=vn(vn(i,n),p),{file:c=a,commandArguments:u=o,options:l=d,isSync:m=!1}=e({file:a,commandArguments:o,options:d});return{file:c,commandArguments:u,options:l,isSync:m}};var pm=({file:e,commandArguments:t})=>dm(e,t),cm=({file:e,commandArguments:t})=>({...dm(e,t),isSync:!0}),dm=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...i]=Lw(e);return{file:r,commandArguments:i}},Lw=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let i of t.split(Bw)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i)}return r},Bw=/ +/g;var um=(e,t,r)=>{e.sync=t(zw,r),e.s=e.sync},lm=({options:e})=>mm(e),zw=({options:e})=>({...mm(e),isSync:!0}),mm=e=>({options:{...Mw(e),...e}}),Mw=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},hm={preferLocal:!0};var te=dt(()=>({})),f1=dt(()=>({isSync:!0})),ut=dt(pm),_1=dt(cm),b1=dt($d),q1=dt(lm,{},hm,um),{sendMessage:k1,getOneMessage:v1,getEachMessage:w1,getCancelSignal:x1}=ll();var ye=D(K(),1);var Wt=D(K(),1);import he from"fs";import Nw from"os";import me from"path";import Ce from"fs";import tt from"path";function b(e=process.cwd()){let t=Fw(e),r=tt.join(t,"docker-compose.yml");if(!Ce.existsSync(r))throw new Error(`Not a Spree project directory. No docker-compose.yml found.
142
+ Run this command from a directory created with create-spree-app.`);let i=Gw(t);return{mode:"docker",projectDir:t,port:i}}var ym=["server","backend"];function xn(e){return ym.find(t=>Ce.existsSync(tt.join(e,t)))??"server"}function Fw(e){let t=tt.basename(e);if(!ym.includes(t))return e;let r=tt.dirname(e),i=new RegExp(`\\./${t}:/rails(:\\w+)?(\\s|$)`,"m");for(let n of["docker-compose.yml","docker-compose.dev.yml"]){let s=tt.join(r,n);if(Ce.existsSync(s))try{if(i.test(Ce.readFileSync(s,"utf-8")))return r}catch{}}return e}function Fe(e){let t=tt.join(e,".env");if(!Ce.existsSync(t))return!1;try{let r=Ce.readFileSync(t,"utf-8");return/^\s*SPREE_PATH\s*=/m.test(r)}catch{return!1}}function Sn(e){let t=tt.join(e,"docker-compose.yml");if(!Ce.existsSync(t))return!1;try{return/^\s*build\s*:/m.test(Ce.readFileSync(t,"utf-8"))}catch{return!1}}function $n(e){try{let r=Ce.readFileSync(tt.join(e,".env"),"utf-8").match(/^SPREE_SAMPLE_DATA=(true|false)\b/m);return r?r[1]==="true":void 0}catch{return}}function Gw(e){let t=tt.join(e,".env");if(!Ce.existsSync(t))return 3e3;let i=Ce.readFileSync(t,"utf-8").match(/^SPREE_PORT=(\d+)/m);return i?Number(i[1]):3e3}var gm=D(K(),1);async function Z(e,t,r){return te("docker",["compose",...e],{cwd:t,...r})}async function lt(e,t){try{await Z(["up","-d","--no-deps","web"],e,{stdio:t?.stdio??"inherit"})}catch{}}async function se(e,t,r){return(await Wa(["bin/rails",e],t,{env:r})).split(`
143
143
  `).filter(n=>!n.startsWith("[")).join(`
144
144
  `).trim()}async function Ge(e){try{let{stdout:t}=await te("docker",["compose","config","--services"],{cwd:e}),r=t.split(`
145
- `).map(n=>n.trim()),i=["web","worker"].filter(n=>r.includes(n));return i.length>0?i:["web"]}catch{return["web"]}}async function gm(e){let{stdout:t}=await te("docker",["compose","ps","-a","-q"],{cwd:e});return t.trim().length>0}async function mt(e,t){let{stdout:r}=await te("docker",["compose","ps",e,"--format","{{.State}}"],{cwd:t});return r.split(`
146
- `).some(i=>i.trim()==="running")}async function ht(e,t,r={}){let{service:i="web",tty:n=!0,detach:s=!1,env:a}=r,o=["compose","exec"];if(s&&o.push("-d"),n||o.push("-T"),a)for(let[p,d]of Object.entries(a))o.push("-e",`${p}=${d}`);o.push(i,...e),await te("docker",o,{cwd:t,stdio:"inherit"})}async function Va(e,t,r={}){let{service:i="web",env:n,captureStderr:s=!1}=r,a=["compose","run","--rm"];if(n)for(let[p,d]of Object.entries(n))a.push("-e",`${p}=${d}`);a.push(i,...e),await te("docker",a,{cwd:t,...s?{stdin:"inherit",stdout:"inherit",stderr:["pipe","inherit"]}:{stdio:"inherit"}})}async function fm(e,t={}){let{service:r="web",edgeHint:i}=t;return await mt(r,e)?"exec":(Fe(e)&&(j([`The ${r} container is not running, and this is a monorepo edge project.`,`Run ${ym.default.bold("pnpm server:dev")} from the monorepo root${i?` \u2014 ${i}`:""}.`].join(`
147
- `)),process.exit(1)),q.info(`${r} container is not running \u2014 using a one-off container (\`docker compose run\`) instead.`),"run")}async function M(e,t,r={}){let{service:i="web",env:n}=r;await fm(t,r)==="exec"?await ht(e,t,{service:i,env:n}):await Va(e,t,{service:i,env:n})}async function Wa(e,t,r={}){let{service:i="web",env:n}=r,s=await fm(t,r),a=["compose",s];if(s==="run"&&a.push("--rm"),a.push("-T"),n)for(let[p,d]of Object.entries(n))a.push("-e",`${p}=${d}`);a.push(i,...e);let o;for(let p=0;p<5;p++)try{let{stdout:d}=await te("docker",a,{cwd:t});return d}catch(d){if(o=d,!Gw(d))throw d;await new Promise(c=>setTimeout(c,2e3))}throw o}function Gw(e){let t=e instanceof Error?e.message:String(e);return/is not running/i.test(t)||/no such container/i.test(t)||/container .* is restarting/i.test(t)}async function Ar(e,t){await te("docker",["compose","logs","-f",e],{cwd:t,stdio:"inherit"})}var Ka=`http://localhost:${3e3}`,yt=class extends Error{};function _m(){return process.env.XDG_CONFIG_HOME?me.join(process.env.XDG_CONFIG_HOME,"spree"):me.join(Uw.homedir(),".config","spree")}function At(){return me.join(_m(),"config.json")}function Kt(e){return e?.code==="ENOENT"}function Er(){let e;try{e=he.readFileSync(At(),"utf-8")}catch(t){if(Kt(t))return{profiles:{}};throw t}try{let t=JSON.parse(e);return{...t,profiles:t.profiles??{}}}catch{let t=`${At()}.bak`;try{he.renameSync(At(),t)}catch{}return process.stderr.write(`${Wt.default.yellow(`warning: ${At()} was not valid JSON; moved it to ${t} and starting fresh.`)}
148
- `),{profiles:{}}}}function Ya(e){he.mkdirSync(_m(),{recursive:!0,mode:448}),bm(At(),`${JSON.stringify(e,null,2)}
149
- `)}function bm(e,t){he.writeFileSync(e,t,{mode:384}),he.chmodSync(e,384)}function Yt(e){return me.join(e,".spree","credentials.json")}function Ja(e){return me.join(e,".spree","setup-complete")}function qm(e){let t=Ja(e);he.mkdirSync(me.dirname(t),{recursive:!0,mode:448}),Xa(me.join(me.dirname(t),".gitignore")),he.writeFileSync(t,`${new Date().toISOString()}
150
- `)}function km(e){return me.join(e,".spree","admin-email")}function vm(e,t){let r=km(e);he.mkdirSync(me.dirname(r),{recursive:!0,mode:448}),Xa(me.join(me.dirname(r),".gitignore")),he.writeFileSync(r,`${t}
151
- `)}function wm(e){try{return he.readFileSync(km(e),"utf-8").trim()||null}catch(t){if(Kt(t))return null;throw t}}function Nw(e){let t;try{t=he.readFileSync(Yt(e),"utf-8")}catch(r){if(Kt(r))return null;throw r}try{return JSON.parse(t)}catch{return null}}function Hw(e,t){let r=Yt(e),i=me.dirname(r);he.mkdirSync(i,{recursive:!0,mode:448}),Xa(me.join(i,".gitignore")),bm(r,`${JSON.stringify(t,null,2)}
145
+ `).map(n=>n.trim()),i=["web","worker"].filter(n=>r.includes(n));return i.length>0?i:["web"]}catch{return["web"]}}async function fm(e){let{stdout:t}=await te("docker",["compose","ps","-a","-q"],{cwd:e});return t.trim().length>0}async function mt(e,t){let{stdout:r}=await te("docker",["compose","ps",e,"--format","{{.State}}"],{cwd:t});return r.split(`
146
+ `).some(i=>i.trim()==="running")}async function ht(e,t,r={}){let{service:i="web",tty:n=!0,detach:s=!1,env:a}=r,o=["compose","exec"];if(s&&o.push("-d"),n||o.push("-T"),a)for(let[p,d]of Object.entries(a))o.push("-e",`${p}=${d}`);o.push(i,...e),await te("docker",o,{cwd:t,stdio:"inherit"})}async function Va(e,t,r={}){let{service:i="web",env:n,captureStderr:s=!1}=r,a=["compose","run","--rm"];if(n)for(let[p,d]of Object.entries(n))a.push("-e",`${p}=${d}`);a.push(i,...e),await te("docker",a,{cwd:t,...s?{stdin:"inherit",stdout:"inherit",stderr:["pipe","inherit"]}:{stdio:"inherit"}})}async function _m(e,t={}){let{service:r="web",edgeHint:i}=t;return await mt(r,e)?"exec":(Fe(e)&&(j([`The ${r} container is not running, and this is a monorepo edge project.`,`Run ${gm.default.bold("pnpm server:dev")} from the monorepo root${i?` \u2014 ${i}`:""}.`].join(`
147
+ `)),process.exit(1)),q.info(`${r} container is not running \u2014 using a one-off container (\`docker compose run\`) instead.`),"run")}async function M(e,t,r={}){let{service:i="web",env:n}=r;await _m(t,r)==="exec"?await ht(e,t,{service:i,env:n}):await Va(e,t,{service:i,env:n})}async function Wa(e,t,r={}){let{service:i="web",env:n}=r,s=await _m(t,r),a=["compose",s];if(s==="run"&&a.push("--rm"),a.push("-T"),n)for(let[p,d]of Object.entries(n))a.push("-e",`${p}=${d}`);a.push(i,...e);let o;for(let p=0;p<5;p++)try{let{stdout:d}=await te("docker",a,{cwd:t});return d}catch(d){if(o=d,!Uw(d))throw d;await new Promise(c=>setTimeout(c,2e3))}throw o}function Uw(e){let t=e instanceof Error?e.message:String(e);return/is not running/i.test(t)||/no such container/i.test(t)||/container .* is restarting/i.test(t)}async function Ar(e,t){await te("docker",["compose","logs","-f",e],{cwd:t,stdio:"inherit"})}var Ka=`http://localhost:${3e3}`,yt=class extends Error{};function bm(){return process.env.XDG_CONFIG_HOME?me.join(process.env.XDG_CONFIG_HOME,"spree"):me.join(Nw.homedir(),".config","spree")}function At(){return me.join(bm(),"config.json")}function Kt(e){return e?.code==="ENOENT"}function Er(){let e;try{e=he.readFileSync(At(),"utf-8")}catch(t){if(Kt(t))return{profiles:{}};throw t}try{let t=JSON.parse(e);return{...t,profiles:t.profiles??{}}}catch{let t=`${At()}.bak`;try{he.renameSync(At(),t)}catch{}return process.stderr.write(`${Wt.default.yellow(`warning: ${At()} was not valid JSON; moved it to ${t} and starting fresh.`)}
148
+ `),{profiles:{}}}}function Ya(e){he.mkdirSync(bm(),{recursive:!0,mode:448}),qm(At(),`${JSON.stringify(e,null,2)}
149
+ `)}function qm(e,t){he.writeFileSync(e,t,{mode:384}),he.chmodSync(e,384)}function Yt(e){return me.join(e,".spree","credentials.json")}function Ja(e){return me.join(e,".spree","setup-complete")}function km(e){let t=Ja(e);he.mkdirSync(me.dirname(t),{recursive:!0,mode:448}),Xa(me.join(me.dirname(t),".gitignore")),he.writeFileSync(t,`${new Date().toISOString()}
150
+ `)}function vm(e){return me.join(e,".spree","admin-email")}function wm(e,t){let r=vm(e);he.mkdirSync(me.dirname(r),{recursive:!0,mode:448}),Xa(me.join(me.dirname(r),".gitignore")),he.writeFileSync(r,`${t}
151
+ `)}function xm(e){try{return he.readFileSync(vm(e),"utf-8").trim()||null}catch(t){if(Kt(t))return null;throw t}}function Hw(e){let t;try{t=he.readFileSync(Yt(e),"utf-8")}catch(r){if(Kt(r))return null;throw r}try{return JSON.parse(t)}catch{return null}}function Vw(e,t){let r=Yt(e),i=me.dirname(r);he.mkdirSync(i,{recursive:!0,mode:448}),Xa(me.join(i,".gitignore")),qm(r,`${JSON.stringify(t,null,2)}
152
152
  `)}function Xa(e){let t="";try{t=he.readFileSync(e,"utf-8")}catch(i){if(!Kt(i))throw i}t.split(`
153
153
  `).some(i=>i.trim()==="*")||he.writeFileSync(e,t&&!t.endsWith(`
154
154
  `)?`${t}
155
155
  *
156
156
  `:`${t}*
157
- `)}function An(e){return e.slice(0,12)}async function Za(e,t,r=!1){r||process.stderr.write(`${Wt.default.dim("No credentials found \u2014 minting a read-only API key via the dev stack...")}
158
- `);let i;try{i=await ne("spree:cli:create_api_key",e,{NAME:"@spree/cli (auto)",KEY_TYPE:"secret",SCOPES:"read_all",REPLACE:"true"})}catch(a){let o=a instanceof Error?a.message:String(a),p=o.match(/^\w*(?:::\w+)*(?:Error|Invalid):.*$/m)?.[0];throw new yt(p?`Could not mint an API key.
159
- ${Wt.default.dim(p)}`:`Could not mint an API key via the dev stack. Is it running? Start it with \`spree dev\`.
160
- ${Wt.default.dim(o.split(`
161
- `)[0])}`)}let n=i.match(/sk_[A-Za-z0-9_-]+/);if(!n)throw new yt("Could not mint an API key via the dev stack. Is it running? Start it with `spree dev`.");let s={baseUrl:`http://localhost:${t}`,token:n[0],scopes:["read_all"],mintedAt:new Date().toISOString()};return Hw(e,s),r||process.stderr.write(`${Wt.default.dim("Saved to .spree/credentials.json (scopes: read_all)")}
162
- `),s}async function Pr(e,t={}){let{allowMint:r=!0,cwd:i=process.cwd()}=t,n=Er(),s=e.baseUrl,a=e.apiKey,o;if(a&&(o={apiKey:a,source:"flags"}),!o&&e.profile){let c=n.profiles[e.profile];if(!c)throw new yt(`Unknown profile "${e.profile}". Run \`spree auth login --profile ${e.profile}\` to create it.`);o={baseUrl:c.baseUrl,apiKey:c.token,source:"profile",profileName:e.profile}}if(!o&&process.env.SPREE_API_KEY&&(o={baseUrl:process.env.SPREE_BASE_URL,apiKey:process.env.SPREE_API_KEY,source:"env"}),!o){let c,u=0;try{let l=b(i);c=l.projectDir,u=l.port}catch{}if(c){let l=`http://localhost:${u}`,m=!s||s.replace(/\/$/,"")===l,h=Nw(c);!h&&r&&m&&(h=await Za(c,u)),h&&(o={baseUrl:h.baseUrl,apiKey:h.token,source:"project",scopes:h.scopes})}}if(!o&&n.defaultProfile){let c=n.profiles[n.defaultProfile];c&&(o={baseUrl:c.baseUrl,apiKey:c.token,source:"profile",profileName:n.defaultProfile})}let p=s??o?.baseUrl,d=o?.apiKey;if(!p&&(o?.source==="flags"||o?.source==="env")&&(p=Ka),!p||!d)throw new yt(["No Admin API credentials found. Provide them via one of (host and key resolve together per source):"," - flags: --api-key <sk_...> (host defaults to "+Ka+"; pass --base-url for a remote store)"," - env: SPREE_API_KEY (host defaults to "+Ka+"; set SPREE_BASE_URL for a remote store)"," - project: run inside a Spree project with the dev stack up (auto-mints a read-only key)"," - profile: spree auth login --profile <name>"].join(`
163
- `));return{baseUrl:p,apiKey:d,source:o?.source??"flags",profileName:o?.profileName,tokenPrefix:An(d),scopes:o?.scopes}}var Qa={dashboard:{dir:"dashboard",template:"dashboard-starter",templateEnvVar:"SPREE_DASHBOARD_TEMPLATE",port:5173,label:"Dashboard"},"seller-dashboard":{dir:"seller-dashboard",template:"seller-dashboard-starter",templateEnvVar:"SPREE_SELLER_DASHBOARD_TEMPLATE",port:5174,label:"Seller Panel"}};function Sm(e){e.command("add").description("Add an optional component to your project").argument("<thing>","Component to add: dashboard or seller-dashboard").option("--template <src>","Starter template: git URL or local path (default: the template bundled with the CLI; env SPREE_DASHBOARD_TEMPLATE / SPREE_SELLER_DASHBOARD_TEMPLATE overrides)").option("--no-install","Skip dependency install").option("--quiet","Skip the final summary note (for wrapping tools that print their own)").action(async(t,r)=>{let i=Qa[t];i||(console.error(`
164
- ${ye.default.red("Error:")} Unknown component: ${t}. Try: ${Object.keys(Qa).join(", ")}
165
- `),process.exit(2)),di(ye.default.bgCyan(ye.default.black(` Spree ${i.label} `)));let n=b();await Kw(n,i,{template:r.template??process.env[i.templateEnvVar]??Yw(i),install:r.install,quiet:r.quiet}),Ct("Done!")})}async function Kw(e,t,r){let i=ae.join(e.projectDir,"apps",t.dir),n=ae.join(i,".env.local");if(de.existsSync(i)){let o=$m(e.projectDir,t.dir,e.port);if(o==="untouched"){q.warn(`${ye.default.bold(`apps/${t.dir}/`)} already exists. Nothing to do.`);return}q.info(`${o==="written"?"Wrote missing":"Repaired"} ${ye.default.bold(`apps/${t.dir}/.env.local`)}. Nothing else to do.`);return}let s=I();s.start(`Fetching ${t.label.toLowerCase()} starter...`);try{await Xw(r.template,i),Jw(i)}catch(o){s.stop("Fetch failed."),q.error(o instanceof Error?o.message:String(o)),process.exit(1)}s.stop(`Created ${ye.default.cyan(`apps/${t.dir}/`)}`),Am(n,e.port);let a=Jt(e.projectDir,i);if(r.install){s.start(`Installing dependencies with ${a}...`);try{await te(a,["install"],{cwd:i}),s.stop("Dependencies installed.")}catch(o){s.stop(ye.default.yellow(`${a} install failed \u2014 run it manually in apps/${t.dir}/.`)),q.warn(o instanceof Error?o.message:String(o))}}r.quiet||V(["Start it with:",` ${ye.default.cyan(`${a==="npm"?"npx":a} spree dev`)}`,` ${ye.default.dim("# runs the API and the dashboard together")}`,...r.install?[]:[` ${ye.default.dim(`# install dependencies first: cd apps/${t.dir} && ${a} install`)}`],"",`Then open ${ye.default.bold(`http://localhost:${t.port}`)} and sign in.`].join(`
166
- `),`${t.label} added!`)}function Yw(e){let t=ae.dirname(Ww(import.meta.url)),r=[ae.resolve(t,"../../templates",e.template),ae.resolve(t,"templates",e.template)];for(let i of r)if(de.existsSync(ae.join(i,"package.json")))return i;console.error(`
157
+ `)}function An(e){return e.slice(0,12)}async function Za(e,t){let r;try{r=await se("spree:cli:create_api_key",e,{NAME:t.name,KEY_TYPE:t.keyType,...t.scopes?.length?{SCOPES:t.scopes.join(",")}:{},...t.replace?{REPLACE:"true"}:{}})}catch(s){let a=s instanceof Error?s.message:String(s),o=a.match(/^\w*(?:::\w+)*(?:Error|Invalid):.*$/m)?.[0];throw new yt(o?`Could not mint an API key.
158
+ ${Wt.default.dim(o)}`:`Could not mint an API key via the dev stack. Is it running? Start it with \`spree dev\`.
159
+ ${Wt.default.dim(a.split(`
160
+ `)[0])}`)}let i=t.keyType==="publishable"?"pk_":"sk_",n=r.match(new RegExp(`${i}[A-Za-z0-9_-]+`))?.[0];if(!n)throw new yt("Could not mint an API key via the dev stack. Is it running? Start it with `spree dev`.");return n}async function Qa(e,t,r=!1){r||process.stderr.write(`${Wt.default.dim("No credentials found \u2014 minting a read-only API key via the dev stack...")}
161
+ `);let i=await Za(e,{name:"@spree/cli (auto)",keyType:"secret",scopes:["read_all"],replace:!0}),n={baseUrl:`http://localhost:${t}`,token:i,scopes:["read_all"],mintedAt:new Date().toISOString()};return Vw(e,n),r||process.stderr.write(`${Wt.default.dim("Saved to .spree/credentials.json (scopes: read_all)")}
162
+ `),n}async function Pr(e,t={}){let{allowMint:r=!0,cwd:i=process.cwd()}=t,n=Er(),s=e.baseUrl,a=e.apiKey,o;if(a&&(o={apiKey:a,source:"flags"}),!o&&e.profile){let c=n.profiles[e.profile];if(!c)throw new yt(`Unknown profile "${e.profile}". Run \`spree auth login --profile ${e.profile}\` to create it.`);o={baseUrl:c.baseUrl,apiKey:c.token,source:"profile",profileName:e.profile}}if(!o&&process.env.SPREE_API_KEY&&(o={baseUrl:process.env.SPREE_BASE_URL,apiKey:process.env.SPREE_API_KEY,source:"env"}),!o){let c,u=0;try{let l=b(i);c=l.projectDir,u=l.port}catch{}if(c){let l=`http://localhost:${u}`,m=!s||s.replace(/\/$/,"")===l,h=Hw(c);!h&&r&&m&&(h=await Qa(c,u)),h&&(o={baseUrl:h.baseUrl,apiKey:h.token,source:"project",scopes:h.scopes})}}if(!o&&n.defaultProfile){let c=n.profiles[n.defaultProfile];c&&(o={baseUrl:c.baseUrl,apiKey:c.token,source:"profile",profileName:n.defaultProfile})}let p=s??o?.baseUrl,d=o?.apiKey;if(!p&&(o?.source==="flags"||o?.source==="env")&&(p=Ka),!p||!d)throw new yt(["No Admin API credentials found. Provide them via one of (host and key resolve together per source):"," - flags: --api-key <sk_...> (host defaults to "+Ka+"; pass --base-url for a remote store)"," - env: SPREE_API_KEY (host defaults to "+Ka+"; set SPREE_BASE_URL for a remote store)"," - project: run inside a Spree project with the dev stack up (auto-mints a read-only key)"," - profile: spree auth login --profile <name>"].join(`
163
+ `));return{baseUrl:p,apiKey:d,source:o?.source??"flags",profileName:o?.profileName,tokenPrefix:An(d),scopes:o?.scopes}}var eo={dashboard:{dir:"dashboard",template:"dashboard-starter",templateEnvVar:"SPREE_DASHBOARD_TEMPLATE",port:5173,label:"Dashboard"},"seller-dashboard":{dir:"seller-dashboard",template:"seller-dashboard-starter",templateEnvVar:"SPREE_SELLER_DASHBOARD_TEMPLATE",port:5174,label:"Seller Panel"}};function $m(e){e.command("add").description("Add an optional component to your project").argument("<thing>","Component to add: dashboard or seller-dashboard").option("--template <src>","Starter template: git URL or local path (default: the template bundled with the CLI; env SPREE_DASHBOARD_TEMPLATE / SPREE_SELLER_DASHBOARD_TEMPLATE overrides)").option("--no-install","Skip dependency install").option("--quiet","Skip the final summary note (for wrapping tools that print their own)").action(async(t,r)=>{let i=eo[t];i||(console.error(`
164
+ ${ye.default.red("Error:")} Unknown component: ${t}. Try: ${Object.keys(eo).join(", ")}
165
+ `),process.exit(2)),di(ye.default.bgCyan(ye.default.black(` Spree ${i.label} `)));let n=b();await Yw(n,i,{template:r.template??process.env[i.templateEnvVar]??Jw(i),install:r.install,quiet:r.quiet}),Ct("Done!")})}async function Yw(e,t,r){let i=ae.join(e.projectDir,"apps",t.dir),n=ae.join(i,".env.local");if(de.existsSync(i)){let o=Am(e.projectDir,t.dir,e.port);if(o==="untouched"){q.warn(`${ye.default.bold(`apps/${t.dir}/`)} already exists. Nothing to do.`);return}q.info(`${o==="written"?"Wrote missing":"Repaired"} ${ye.default.bold(`apps/${t.dir}/.env.local`)}. Nothing else to do.`);return}let s=I();s.start(`Fetching ${t.label.toLowerCase()} starter...`);try{await Zw(r.template,i),Xw(i)}catch(o){s.stop("Fetch failed."),q.error(o instanceof Error?o.message:String(o)),process.exit(1)}s.stop(`Created ${ye.default.cyan(`apps/${t.dir}/`)}`),Em(n,e.port);let a=Jt(e.projectDir,i);if(r.install){s.start(`Installing dependencies with ${a}...`);try{await te(a,["install"],{cwd:i}),s.stop("Dependencies installed.")}catch(o){s.stop(ye.default.yellow(`${a} install failed \u2014 run it manually in apps/${t.dir}/.`)),q.warn(o instanceof Error?o.message:String(o))}}r.quiet||V(["Start it with:",` ${ye.default.cyan(`${a==="npm"?"npx":a} spree dev`)}`,` ${ye.default.dim("# runs the API and the dashboard together")}`,...r.install?[]:[` ${ye.default.dim(`# install dependencies first: cd apps/${t.dir} && ${a} install`)}`],"",`Then open ${ye.default.bold(`http://localhost:${t.port}`)} and sign in.`].join(`
166
+ `),`${t.label} added!`)}function Jw(e){let t=ae.dirname(Kw(import.meta.url)),r=[ae.resolve(t,"../../templates",e.template),ae.resolve(t,"templates",e.template)];for(let i of r)if(de.existsSync(ae.join(i,"package.json")))return i;console.error(`
167
167
  ${ye.default.red("Error:")} Bundled ${e.label.toLowerCase()} template not found. In the monorepo, run ${ye.default.cyan("pnpm build")} in packages/cli first (it generates the templates), or pass --template <path|git-url>.
168
- `),process.exit(1)}function Jw(e){let t=ae.join(e,"gitignore.template");de.existsSync(t)&&de.renameSync(t,ae.join(e,".gitignore"))}async function Xw(e,t){if(de.existsSync(e)&&de.statSync(e).isDirectory()){de.cpSync(e,t,{recursive:!0,filter:r=>{let i=ae.basename(r);return i!=="node_modules"&&i!=="dist"&&i!==".git"}});return}await te("git",["clone","--depth","1","--",e,t]),de.rmSync(ae.join(t,".git"),{recursive:!0,force:!0})}var xm=/^VITE_SPREE_API_URL=(https?:\/\/localhost\S*)$/m;function $m(e,t,r){let i=ae.join(e,"apps",t);if(!de.existsSync(ae.join(i,"package.json")))return"untouched";let n=ae.join(i,".env.local"),s;try{s=de.readFileSync(n,"utf-8")}catch(a){if(!Kt(a))throw a;return Am(n,r),"written"}return xm.test(s)?(de.writeFileSync(n,s.replace(xm,`VITE_API_PROXY_TARGET=http://localhost:${r}`)),"repaired"):"untouched"}var Zw=Object.values(Qa).map(e=>e.dir);function En(e,t){let r="untouched";for(let i of Zw){let n=$m(e,i,t);n!=="untouched"&&(r=n)}return r}function Am(e,t){de.writeFileSync(e,["# Dev-server proxy target \u2014 where Vite forwards /api and /rails (your","# Rails backend). The SPA stays same-origin with the API: the SDK uses","# relative URLs and the proxy bridges the port gap.","#","# Do NOT set VITE_SPREE_API_URL for local dev \u2014 it switches the SDK to","# absolute cross-origin URLs, which breaks on CORS and the SameSite=Lax","# auth cookie. Set it only when building for a deploy where the","# dashboard is hosted on a different origin than the API.","#","# No credentials belong in this file \u2014 every VITE_-prefixed value is","# compiled into the client bundle.",`VITE_API_PROXY_TARGET=http://localhost:${t}`,""].join(`
169
- `))}function Jt(e,t){for(let r of[t,e]){if(de.existsSync(ae.join(r,"pnpm-lock.yaml")))return"pnpm";if(de.existsSync(ae.join(r,"yarn.lock")))return"yarn";if(de.existsSync(ae.join(r,"package-lock.json")))return"npm"}return"pnpm"}function v(e){if(!e)return;let t={};return e.expand?.length&&(t.expand=e.expand.join(",")),e.fields?.length&&(t.fields=e.fields.join(",")),Object.keys(t).length>0?t:void 0}function Qw(e){return e===!1?!1:{maxRetries:e?.maxRetries??2,retryOnStatus:e?.retryOnStatus??[429,500,502,503,504],baseDelay:e?.baseDelay??300,maxDelay:e?.maxDelay??1e4,retryOnNetworkError:e?.retryOnNetworkError??!0}}var ex=new Set(["page","limit","expand","sort","fields"]);function y(e){let t={};for(let[r,i]of Object.entries(e))if(i!==void 0){if(ex.has(r)){t[r]=Array.isArray(i)?i.join(","):i;continue}if(r.startsWith("q[")){t[r]=i;continue}if(Array.isArray(i)){let n=r.endsWith("[]")?r.slice(0,-2):r;t[`q[${n}][]`]=i}else t[`q[${r}]`]=i}return t}var ft=class extends Error{code;status;details;constructor(e,t){super(e.error.message),this.name="SpreeError",this.code=e.error.code,this.status=t,this.details=e.error.details}};function Em(e,t){let r=t.baseDelay*2**e,i=Math.random()*t.baseDelay;return Math.min(r+i,t.maxDelay)}function Pm(e){return new Promise(t=>setTimeout(t,e))}function tx(){return`spree-sdk-retry-${crypto.randomUUID()}`}function rx(e,t,r,i){return e==="GET"||e==="HEAD"||i?r.retryOnStatus.includes(t):t===429}function ix(e,t,r){return t.retryOnNetworkError?e==="GET"||e==="HEAD"||r:!1}function nx(e,t,r,i){return async function(s,a,o={}){let{token:p,spreeToken:d,idempotencyKey:c,headers:u={},body:l,params:m}=o,h=o.locale??i?.locale,f=o.currency??i?.currency,w=o.country??i?.country,k=o.channel??i?.channel,x=typeof window<"u"?window.location.origin:void 0,_=e.baseUrl||x;if(!_)throw new TypeError("sdk-core: baseUrl is required in non-browser environments (no window.location to resolve relative URLs against)");let T=new URL(`${e.baseUrl}${t}${a}`,_);m&&Object.entries(m).forEach(([W,$])=>{if($!==void 0)if(Array.isArray($))for(let Ve of $)T.searchParams.append(W,String(Ve));else T.searchParams.set(W,String($))});let S={"Content-Type":"application/json",...u};r.headerValue&&(S[r.headerName]=r.headerValue),p&&(S.Authorization=`Bearer ${p}`),d&&(S["x-spree-token"]=d),h&&(S["x-spree-locale"]=h),f&&(S["x-spree-currency"]=f),w&&(S["x-spree-country"]=w),k&&(S["x-spree-channel"]=k);let O=c??(s!=="GET"&&s!=="HEAD"&&e.retryConfig?tx():void 0);O&&(S["Idempotency-Key"]=O);let B=!!O,U=e.retryConfig?e.retryConfig.maxRetries+1:1;for(let W=0;W<U;W++)try{let $=await e.fetchFn(T.toString(),{method:s,headers:S,body:l?JSON.stringify(l):void 0,credentials:e.credentials});if(!$.ok){if(!(W>=U-1)&&e.retryConfig&&rx(s,$.status,e.retryConfig,B)){let H=$.headers.get("Retry-After"),ue=H?Math.min(parseInt(H,10)*1e3,e.retryConfig.maxDelay):Em(W,e.retryConfig);await Pm(ue);continue}let $e=await $.json().catch(()=>null);throw typeof $e?.error?.code=="string"&&typeof $e.error.message=="string"?new ft($e,$.status):new ft({error:{code:"http_error",message:`Request failed with status ${$.status}`}},$.status)}return $.status===204?void 0:$.status===202?$.headers.get("content-type")?.includes("application/json")?$.json():void 0:$.json()}catch($){if($ instanceof ft)throw $;if(!(W>=U-1)&&e.retryConfig&&ix(s,e.retryConfig,B)){let $e=Em(W,e.retryConfig);await Pm($e);continue}throw $}throw new Error("Unexpected end of retry loop")}}var gt={"Spree::Product":"/products","Spree::Variant":"/variants","Spree::Order":"/orders","Spree::User":"/customers","Spree::Category":"/categories","Spree::Collection":"/collections","Spree::OptionType":"/option_types"},sx=class{request;constructor(e){this.request=e}parentScopedCustomFields(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields`,{...i,params:r?y(r):void 0}),get:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields/${r}`,i),create:(t,r,i)=>this.request("POST",`${e}/${t}/custom_fields`,{...i,body:r}),update:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/custom_fields/${r}`,{...n,body:i}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/custom_fields/${r}`,i)}}parentScopedTranslations(e){return{get:(t,r)=>this.request("GET",`${e}/${t}/translations`,r).then(i=>i.data)}}productMembership(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/products`,{...i,params:r?y(r):void 0}),create:(t,r,i)=>this.request("POST",`${e}/${t}/products`,{...i,body:{product_ids:r}}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/products`,{...i,body:{product_ids:r}})}}positionedProductMembership(e){return{...this.productMembership(e),reposition:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/products/${r}/reposition`,{...n,body:i})}}customFields(e,t){let r=gt[e];if(!r)throw new Error(`Unknown custom-field owner type: ${e}. Add it to CUSTOM_FIELD_OWNER_PATHS.`);let i=this.parentScopedCustomFields(r);return{list:(n,s)=>i.list(t,n,s),get:(n,s)=>i.get(t,n,s),create:(n,s)=>i.create(t,n,s),update:(n,s,a)=>i.update(t,n,s,a),delete:(n,s)=>i.delete(t,n,s)}}customFieldDefinitions={list:(e,t)=>this.request("GET","/custom_field_definitions",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/custom_field_definitions/${e}`,t),resourceTypes:e=>this.request("GET","/custom_field_definitions/resource_types",e),create:(e,t)=>this.request("POST","/custom_field_definitions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/custom_field_definitions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/custom_field_definitions/${e}`,t)};auth={login:(e,t)=>this.request("POST","/auth/login",{...t,body:e}),refresh:e=>this.request("POST","/auth/refresh",e),logout:e=>this.request("POST","/auth/logout",e),providers:e=>this.request("GET","/auth/providers",e),lookupInvitation:(e,t,r)=>this.request("GET",`/auth/invitations/${e}/lookup`,{...r,params:{token:t}}),acceptInvitation:(e,t,r,i)=>this.request("POST",`/auth/invitations/${e}/accept`,{...i,params:{token:t},body:r}),setupStatus:e=>this.request("GET","/auth/setup",e),setupCountries:e=>this.request("GET","/auth/setup/countries",e),completeSetup:(e,t)=>this.request("POST","/auth/setup",{...t,body:e}),requestPasswordReset:(e,t)=>this.request("POST","/auth/password_resets",{...t,body:e}),resetPassword:(e,t,r)=>this.request("PATCH",`/auth/password_resets/${encodeURIComponent(e)}`,{...r,body:t})};me={get:e=>this.request("GET","/me",e),update:(e,t)=>this.request("PATCH","/me",{...t,body:e})};reporting={query:(e,t)=>this.request("POST","/reporting/query",{...t,body:e}),schema:e=>this.request("GET","/reporting/schema",e),savedReports:{list:(e,t)=>this.request("GET","/reporting/saved_reports",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/reporting/saved_reports/${e}`,t),create:(e,t)=>this.request("POST","/reporting/saved_reports",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/reporting/saved_reports/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/reporting/saved_reports/${e}`,t)}};dashboard={counters:(e,t)=>this.request("GET","/dashboard/counters",{...t,params:e})};store={get:e=>this.request("GET","/store",e),update:(e,t)=>this.request("PATCH","/store",{...t,body:e}),dataSources:e=>this.request("GET","/store/data_sources",e).then(t=>t.data)};locales={list:e=>this.request("GET","/locales",e).then(t=>t.data)};translatableResources={list:e=>this.request("GET","/translatable_resources",e).then(t=>t.data)};translations={coverage:(e,t,r)=>{let{page:i,limit:n,search:s,...a}=t??{};return this.request("GET","/translations",{...r,params:{resource_type:e,...i===void 0?{}:{page:i},...n===void 0?{}:{limit:n},...s===void 0?{}:{search:s},...y(a)}})},batch:(e,t)=>this.request("POST","/translations/batch",{...t,body:{translations:e}}).then(r=>r.data)};products={list:(e,t)=>this.request("GET","/products",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/products/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/products",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/products/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/products/${e}`,t),clone:(e,t)=>this.request("POST",`/products/${e}/clone`,t),approve:(e,t)=>this.request("PATCH",`/products/${e}/approve`,t),reject:(e,t,r)=>this.request("PATCH",`/products/${e}/reject`,{...r,body:t}),bulkStatusUpdate:(e,t)=>this.request("POST","/products/bulk_status_update",{...t,body:e}),bulkAddToCategories:(e,t)=>this.request("POST","/products/bulk_add_to_categories",{...t,body:e}),bulkRemoveFromCategories:(e,t)=>this.request("POST","/products/bulk_remove_from_categories",{...t,body:e}),bulkAddToCollections:(e,t)=>this.request("POST","/products/bulk_add_to_collections",{...t,body:e}),bulkRemoveFromCollections:(e,t)=>this.request("POST","/products/bulk_remove_from_collections",{...t,body:e}),bulkAddToChannels:(e,t)=>this.request("POST","/products/bulk_add_to_channels",{...t,body:e}),bulkRemoveFromChannels:(e,t)=>this.request("POST","/products/bulk_remove_from_channels",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/products/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/products/bulk_remove_tags",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/products/bulk_destroy",{...t,body:e}),media:{list:(e,t,r)=>this.request("GET",`/products/${e}/media`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/media`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/media/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/media/${t}`,r)},digitalAssets:{list:(e,t,r)=>this.request("GET",`/products/${e}/digital_assets`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/digital_assets`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/digital_assets/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/digital_assets/${t}`,r),providers:(e,t)=>this.request("GET",`/products/${e}/digital_assets/providers`,t)},variants:{list:(e,t,r)=>this.request("GET",`/products/${e}/variants`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/products/${e}/variants`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/variants/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/variants/${t}`,r),media:{list:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}/media`,{...i,params:r?y(r):void 0}),create:(e,t,r,i)=>this.request("POST",`/products/${e}/variants/${t}/media`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/products/${e}/variants/${t}/media/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/products/${e}/variants/${t}/media/${r}`,i)}},customFields:this.parentScopedCustomFields(gt["Spree::Product"]),translations:this.parentScopedTranslations("/products")};digitalLinks={list:(e,t)=>this.request("GET","/digital_links",{...t,params:e?y(e):void 0}),retrieve:(e,t)=>this.request("GET",`/digital_links/${e}`,t),reset:(e,t)=>this.request("PATCH",`/digital_links/${e}/reset`,t)};orders={list:(e,t)=>this.request("GET","/orders",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/orders/${e}`,t),complete:(e,t,r)=>this.request("PATCH",`/orders/${e}/complete`,{...r,body:t}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/cancel`,{...r,body:t}),approve:(e,t)=>this.request("PATCH",`/orders/${e}/approve`,t),resendConfirmation:(e,t)=>this.request("POST",`/orders/${e}/resend_confirmation`,t),resendDigitalLinks:(e,t)=>this.request("POST",`/orders/${e}/resend_digital_links`,t),giftCards:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/gift_cards`,{...r,body:t}),remove:(e,t,r)=>this.request("DELETE",`/orders/${e}/gift_cards/${t}`,r)},storeCredits:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/store_credits`,{...r,body:t}),remove:(e,t)=>this.request("DELETE",`/orders/${e}/store_credits`,t)},items:{list:(e,t,r)=>this.request("GET",`/orders/${e}/items`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/items/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/items`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/items/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/items/${t}`,r)},fulfillments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/fulfillments`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/fulfill`,{...i,body:r}),markDelivered:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/mark_delivered`,{...i,body:r}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/cancel`,r),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/labels/${r}`,i)},deliveries:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/deliveries`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),markDelivered:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}/mark_delivered`,{...n,body:i})},split:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/split`,{...i,body:r})},returns:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/returns`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/returns/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/receive`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/refund`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/cancel`,{...i,body:r}),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/returns/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/returns/${t}/labels/${r}`,i)}},exchanges:{list:(e,t,r)=>this.request("GET",`/orders/${e}/exchanges`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/exchanges/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/exchanges`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/receive`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/fulfill`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/cancel`,{...i,body:r})},claims:{list:(e,t,r)=>this.request("GET",`/orders/${e}/claims`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/claims/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/claims`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/claims/${t}/approve`,r),resolve:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/resolve`,{...i,body:r}),deny:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/deny`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/cancel`,{...i,body:r})},payments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/payments`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/payments/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/payments`,{...r,body:t}),capture:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/capture`,r),void:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/void`,r)},refunds:{list:(e,t,r)=>this.request("GET",`/orders/${e}/refunds`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/orders/${e}/refunds`,{...r,body:t})},taxLines:{list:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines/${t}`,r)},discounts:{list:(e,t,r)=>this.request("GET",`/orders/${e}/discounts`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/discounts/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/discounts`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/discounts/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discounts/${t}`,r)},discountCodes:{create:(e,t,r)=>this.request("POST",`/orders/${e}/discount_codes`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discount_codes/${encodeURIComponent(t)}`,r)},fees:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fees`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/fees/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/fees`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fees/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/fees/${t}`,r)},customFields:this.parentScopedCustomFields(gt["Spree::Order"])};optionTypes={list:(e,t)=>this.request("GET","/option_types",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/option_types/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/option_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/option_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/option_types/${e}`,t),customFields:this.parentScopedCustomFields(gt["Spree::OptionType"]),translations:this.parentScopedTranslations("/option_types")};deliveryMethods={list:(e,t)=>this.request("GET","/delivery_methods",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_methods/${e}`,t),create:(e,t)=>this.request("POST","/delivery_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_methods/${e}`,t),calculators:e=>this.request("GET","/delivery_methods/calculators",e),fulfillmentProviders:e=>this.request("GET","/delivery_methods/fulfillment_providers",e),rateProviders:e=>this.request("GET","/delivery_methods/rate_providers",e),rules:{list:(e,t)=>this.request("GET",`/delivery_methods/${e}/rules`,t),create:(e,t,r)=>this.request("POST",`/delivery_methods/${e}/rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_methods/${e}/rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_methods/${e}/rules/${t}`,r)},ruleTypes:e=>this.request("GET","/delivery_method_rules/types",e)};deliveryProfiles={list:(e,t)=>this.request("GET","/delivery_profiles",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_profiles/${e}`,t),create:(e,t)=>this.request("POST","/delivery_profiles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_profiles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_profiles/${e}`,t),kinds:e=>this.request("GET","/delivery_profiles/kinds",e),originGroups:{list:(e,t)=>this.request("GET",`/delivery_profiles/${e}/origin_groups`,t),create:(e,t,r)=>this.request("POST",`/delivery_profiles/${e}/origin_groups`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_profiles/${e}/origin_groups/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_profiles/${e}/origin_groups/${t}`,r)}};trackingCarriers={list:e=>this.request("GET","/tracking_carriers",e)};deliveryZones={list:(e,t)=>this.request("GET","/delivery_zones",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/delivery_zones/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/delivery_zones",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_zones/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_zones/${e}`,t)};packageTypes={list:(e,t)=>this.request("GET","/package_types",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/package_types/${e}`,t),create:(e,t)=>this.request("POST","/package_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/package_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/package_types/${e}`,t)};paymentMethods={list:(e,t)=>this.request("GET","/payment_methods",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/payment_methods/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/payment_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/payment_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/payment_methods/${e}`,t),types:e=>this.request("GET","/payment_methods/types",e)};integrations={list:(e,t)=>this.request("GET","/integrations",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/integrations/${e}`,t),create:(e,t)=>this.request("POST","/integrations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/integrations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/integrations/${e}`,t),types:e=>this.request("GET","/integrations/types",e),test:(e,t)=>this.request("POST",`/integrations/${e}/test`,t)};priceLists={list:(e,t)=>this.request("GET","/price_lists",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/price_lists/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/price_lists",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/price_lists/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/price_lists/${e}`,t),products:this.productMembership("/price_lists"),activate:(e,t)=>this.request("PATCH",`/price_lists/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/price_lists/${e}/deactivate`,t),ruleTypes:e=>this.request("GET","/price_lists/price_rule_types",e)};prices={list:(e,t)=>this.request("GET","/prices",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/prices/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/prices",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/prices/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/prices/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/prices/bulk_upsert",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/prices/bulk_destroy",{...t,body:e})};promotions={list:(e,t)=>this.request("GET","/promotions",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/promotions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/promotions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/promotions/${e}`,t),actions:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_actions`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_actions/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_actions/${t}`,r)},rules:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_rules/${t}`,r)},couponCodes:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes/${t}`,r)}};promotionActions={types:e=>this.request("GET","/promotion_actions/types",e),calculators:(e,t)=>this.request("GET","/promotion_actions/calculators",{...t,params:{type:e}})};promotionRules={types:e=>this.request("GET","/promotion_rules/types",e)};tags={list:(e,t)=>this.request("GET","/tags",{...t,params:e})};customerGroups={list:(e,t)=>this.request("GET","/customer_groups",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/customer_groups/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/customer_groups",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customer_groups/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customer_groups/${e}`,t)};sellers={list:(e,t)=>this.request("GET","/sellers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/sellers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/sellers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/sellers/${e}`,t),invite:(e,t,r)=>this.request("POST",`/sellers/${e}/invite`,{...r,body:t}),approve:(e,t,r)=>this.request("PATCH",`/sellers/${e}/approve`,{...r,body:t}),onboarding:(e,t)=>this.request("GET",`/sellers/${e}/onboarding`,t),reopenOnboarding:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reopen_onboarding`,{...r,body:t}),team:{list:(e,t)=>this.request("GET",`/sellers/${e}/team`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/team/${t}`,r)},invitations:{list:(e,t)=>this.request("GET",`/sellers/${e}/invitations`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/invitations/${t}`,r),resend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/invitations/${t}/resend`,r)},requirementSubmissions:{list:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions/${t}`,r),accept:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/accept`,{...i,body:r}),reject:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/reject`,{...i,body:r}),waive:(e,t,r)=>this.request("POST",`/sellers/${e}/requirement_submissions`,{...r,body:t})},suspend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/suspend`,{...r,body:t}),reject:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reject`,{...r,body:t}),balances:(e,t)=>this.request("GET",`/sellers/${e}/balances`,t),settle:(e,t)=>this.request("POST",`/sellers/${e}/payouts`,t)};sellerRequirements={list:(e,t)=>this.request("GET","/seller_requirements",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/seller_requirements/${e}`,t),create:(e,t)=>this.request("POST","/seller_requirements",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/seller_requirements/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/seller_requirements/${e}`,t),types:e=>this.request("GET","/seller_requirements/types",e)};commissionRates={list:(e,t)=>this.request("GET","/commission_rates",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_rates/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/commission_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/commission_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/commission_rates/${e}`,t),ruleTypes:e=>this.request("GET","/commission_rates/rule_types",e)};commissionLines={list:(e,t)=>this.request("GET","/commission_lines",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_lines/${e}`,{...r,params:v(t)})};orderGroups={list:(e,t)=>this.request("GET","/order_groups",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/order_groups/${e}`,{...r,params:v(t)})};sellerTransfers={list:(e,t)=>this.request("GET","/seller_transfers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_transfers/${e}`,{...r,params:v(t)})};sellerPayouts={list:(e,t)=>this.request("GET","/seller_payouts",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_payouts/${e}`,{...r,params:v(t)}),complete:(e,t,r)=>this.request("PATCH",`/seller_payouts/${e}/complete`,{...r,body:t})};giftCards={list:(e,t)=>this.request("GET","/gift_cards",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/gift_cards/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/gift_cards",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/gift_cards/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/gift_cards/${e}`,t)};storeCredits={list:(e,t)=>this.request("GET","/store_credits",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/store_credits/${e}`,{...r,params:v(t)}),events:{list:(e,t,r)=>this.request("GET",`/store_credits/${e}/events`,{...r,params:t?y(t):void 0})}};returns={list:(e,t)=>this.request("GET","/returns",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/returns/${e}`,{...r,params:v(t)})};exchanges={list:(e,t)=>this.request("GET","/exchanges",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/exchanges/${e}`,{...r,params:v(t)})};claims={list:(e,t)=>this.request("GET","/claims",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/claims/${e}`,{...r,params:v(t)})};giftCardBatches={list:(e,t)=>this.request("GET","/gift_card_batches",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/gift_card_batches/${e}`,t),create:(e,t)=>this.request("POST","/gift_card_batches",{...t,body:e})};taxRates={list:(e,t)=>this.request("GET","/tax_rates",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_rates/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/tax_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_rates/${e}`,t)};taxProviders={list:e=>this.request("GET","/tax_providers",e)};payoutProviders={list:e=>this.request("GET","/payout_providers",e)};companies={list:(e,t)=>this.request("GET","/companies",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/companies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/companies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/companies/${e}`,t),addresses:{list:(e,t,r)=>this.request("GET",`/companies/${e}/addresses`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/addresses`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/addresses/${t}`,r),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/addresses/${t}`,r)},memberships:{list:(e,t,r)=>this.request("GET",`/companies/${e}/memberships`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/memberships`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/memberships/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/memberships/${t}`,r)},invitations:{list:(e,t,r)=>this.request("GET",`/companies/${e}/invitations`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/invitations/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/invitations/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers/${t}/validate`,r)},taxExemptionCertificates:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_exemption_certificates`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_exemption_certificates`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,body:r}),verify:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/verify`,r),revoke:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/revoke`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_exemption_certificates/${t}`,r)}};catalogs={list:(e,t)=>this.request("GET","/catalogs",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/catalogs/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/catalogs",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/catalogs/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/catalogs/${e}`,t),products:this.productMembership("/catalogs"),activate:(e,t)=>this.request("PATCH",`/catalogs/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/catalogs/${e}/deactivate`,t),importProducts:(e,t)=>this.request("POST",`/catalogs/${e}/import_products`,t),assign:(e,t,r)=>this.request("POST",`/catalogs/${e}/assign`,{...r,body:t}),quantityRules:{upsert:(e,t,r)=>this.request("PUT",`/catalogs/${e}/quantity_rules`,{...r,body:t})},orderMinimums:{list:(e,t,r)=>this.request("GET",`/catalogs/${e}/order_minimums`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/catalogs/${e}/order_minimums`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/catalogs/${e}/order_minimums/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/catalogs/${e}/order_minimums/${t}`,r)}};catalogAssignments={delete:(e,t)=>this.request("DELETE",`/catalog_assignments/${e}`,t)};exports={list:(e,t)=>this.request("GET","/exports",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/exports/${e}`,t),create:(e,t)=>this.request("POST","/exports",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/exports/${e}`,t)};imports={list:(e,t)=>this.request("GET","/imports",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/imports/${e}`,t),create:(e,t)=>this.request("POST","/imports",{...t,body:e}),completeMapping:(e,t,r)=>this.request("PATCH",`/imports/${e}/complete_mapping`,{...r,body:t??{}}),retryFailedRows:(e,t)=>this.request("PATCH",`/imports/${e}/retry_failed_rows`,t),delete:(e,t)=>this.request("DELETE",`/imports/${e}`,t),rows:{list:(e,t,r)=>this.request("GET",`/imports/${e}/rows`,{...r,params:t?y(t):void 0})}};customers={list:(e,t)=>this.request("GET","/customers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}`,{...r,params:v(t)}),creditCards:{list:(e,t,r)=>this.request("GET",`/customers/${e}/credit_cards`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/credit_cards/${t}`,{...i,params:v(r)}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/credit_cards/${t}`,r)},create:(e,t)=>this.request("POST","/customers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customers/${e}`,t),export:(e,t)=>this.request("GET",`/customers/${e}/export`,t),anonymize:(e,t)=>this.request("POST",`/customers/${e}/anonymize`,t),bulkAddToGroups:(e,t)=>this.request("POST","/customers/bulk_add_to_groups",{...t,body:e}),bulkRemoveFromGroups:(e,t)=>this.request("POST","/customers/bulk_remove_from_groups",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/customers/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/customers/bulk_remove_tags",{...t,body:e}),addresses:{list:(e,t,r)=>this.request("GET",`/customers/${e}/addresses`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/addresses/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/addresses`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/addresses/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers/${t}/validate`,r)},storeCredits:{list:(e,t,r)=>this.request("GET",`/customers/${e}/store_credits`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/store_credits/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/store_credits`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/store_credits/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/store_credits/${t}`,r)},customFields:this.parentScopedCustomFields(gt["Spree::User"])};media={list:(e,t)=>this.request("GET","/media",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/media/${e}`,t),create:(e,t)=>this.request("POST","/media",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/media/${e}`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/media/${e}`,{...r,params:t?.detach?{detach:"true"}:void 0}),usage:(e,t)=>this.request("GET",`/media/${e}/usage`,t)};categories={list:(e,t)=>this.request("GET","/categories",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/categories/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/categories/${e}`,t),reposition:(e,t,r)=>this.request("PATCH",`/categories/${e}/reposition`,{...r,body:t}),products:this.positionedProductMembership("/categories"),customFields:this.parentScopedCustomFields(gt["Spree::Category"]),translations:this.parentScopedTranslations("/categories")};collections={list:(e,t)=>this.request("GET","/collections",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/collections/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/collections",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/collections/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/collections/${e}`,t),products:this.positionedProductMembership("/collections"),customFields:this.parentScopedCustomFields(gt["Spree::Collection"]),translations:this.parentScopedTranslations("/collections")};collectionRules={types:e=>this.request("GET","/collection_rules/types",e)};variants={list:(e,t)=>this.request("GET","/variants",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/variants/${e}`,{...r,params:v(t)}),customFields:this.parentScopedCustomFields(gt["Spree::Variant"])};productTypes={list:(e,t)=>this.request("GET","/product_types",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/product_types/${e}`,t),create:(e,t)=>this.request("POST","/product_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/product_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/product_types/${e}`,t),applyToProducts:(e,t)=>this.request("POST",`/product_types/${e}/apply_to_products`,t)};taxCategories={list:(e,t)=>this.request("GET","/tax_categories",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_categories/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/tax_categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_categories/${e}`,t)};policies={list:(e,t)=>this.request("GET","/policies",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/policies/${e}`,t),create:(e,t)=>this.request("POST","/policies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/policies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/policies/${e}`,t)};returnReasons={list:(e,t)=>this.request("GET","/return_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/return_reasons/${e}`,t),create:(e,t)=>this.request("POST","/return_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/return_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/return_reasons/${e}`,t)};claimReasons={list:(e,t)=>this.request("GET","/claim_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/claim_reasons/${e}`,t),create:(e,t)=>this.request("POST","/claim_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/claim_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/claim_reasons/${e}`,t)};orderCancellationReasons={list:(e,t)=>this.request("GET","/order_cancellation_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/order_cancellation_reasons/${e}`,t),create:(e,t)=>this.request("POST","/order_cancellation_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/order_cancellation_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/order_cancellation_reasons/${e}`,t)};refundReasons={list:(e,t)=>this.request("GET","/refund_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/refund_reasons/${e}`,t),create:(e,t)=>this.request("POST","/refund_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/refund_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/refund_reasons/${e}`,t)};channels={list:(e,t)=>this.request("GET","/channels",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/channels",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/channels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/channels/${e}`,t),addProducts:(e,t,r)=>this.request("POST",`/channels/${e}/add_products`,{...r,body:t}),removeProducts:(e,t,r)=>this.request("POST",`/channels/${e}/remove_products`,{...r,body:t}),orderRoutingRules:{list:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/channels/${e}/order_routing_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/channels/${e}/order_routing_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/channels/${e}/order_routing_rules/${t}`,r)}};orderRoutingRules={types:e=>this.request("GET","/order_routing_rules/types",e)};markets={list:(e,t)=>this.request("GET","/markets",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/markets/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/markets",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/markets/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/markets/${e}`,t)};stockLocations={list:(e,t)=>this.request("GET","/stock_locations",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_locations/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/stock_locations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_locations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_locations/${e}`,t)};stockLevels={list:(e,t)=>this.request("GET","/stock_levels",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_levels/${e}`,{...r,params:v(t)}),update:(e,t,r)=>this.request("PATCH",`/stock_levels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_levels/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/stock_levels/bulk_upsert",{...t,body:e})};stockMovements={list:(e,t)=>this.request("GET","/stock_movements",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_movements/${e}`,{...r,params:v(t)})};stockTransfers={list:(e,t)=>this.request("GET","/stock_transfers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_transfers/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/stock_transfers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_transfers/${e}`,t),markReady:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_ready`,t),markInTransit:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/mark_in_transit`,{...r,body:t}),markDraft:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/stock_transfers/${e}/stock_receipts`,{...r,params:v(t)}),get:(e,t,r,i)=>this.request("GET",`/stock_transfers/${e}/stock_receipts/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/stock_transfers/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/cancel`,{...r,body:t})};suppliers={list:(e,t)=>this.request("GET","/suppliers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/suppliers/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/suppliers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/suppliers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/suppliers/${e}`,t)};purchaseOrders={list:(e,t)=>this.request("GET","/purchase_orders",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/purchase_orders/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/purchase_orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/purchase_orders/${e}`,t),markOrdered:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_ordered`,t),markDraft:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/purchase_orders/${e}/stock_receipts`,{...r,params:v(t)}),get:(e,t,r,i)=>this.request("GET",`/purchase_orders/${e}/stock_receipts/${t}`,{...i,params:v(r)}),create:(e,t,r)=>this.request("POST",`/purchase_orders/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/cancel`,{...r,body:t})};countries={list:(e,t)=>this.request("GET","/countries",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/countries/${e}`,{...r,params:v(t)})};directUploads={create:(e,t)=>this.request("POST","/direct_uploads",{...t,body:e})};adminUsers={list:(e,t)=>this.request("GET","/admin_users",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/admin_users/${e}`,{...r,params:v(t)}),update:(e,t,r)=>this.request("PATCH",`/admin_users/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/admin_users/${e}`,t)};invitations={list:(e,t)=>this.request("GET","/invitations",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/invitations/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/invitations",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/invitations/${e}`,t),resend:(e,t)=>this.request("PATCH",`/invitations/${e}/resend`,t)};apiKeys={list:(e,t)=>this.request("GET","/api_keys",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/api_keys/${e}`,{...r,params:v(t)}),current:e=>this.request("GET","/api_keys/current",e??{}),create:(e,t)=>this.request("POST","/api_keys",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/api_keys/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/api_keys/${e}`,t),revoke:(e,t)=>this.request("PATCH",`/api_keys/${e}/revoke`,t)};allowedOrigins={list:(e,t)=>this.request("GET","/allowed_origins",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/allowed_origins/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/allowed_origins",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/allowed_origins/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/allowed_origins/${e}`,t)};webhookEndpoints={list:(e,t)=>this.request("GET","/webhook_endpoints",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/webhook_endpoints",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/webhook_endpoints/${e}`,t),sendTest:(e,t)=>this.request("POST",`/webhook_endpoints/${e}/send_test`,t),enable:(e,t)=>this.request("PATCH",`/webhook_endpoints/${e}/enable`,t),disable:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}/disable`,{...r,body:t}),deliveries:{list:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries/${t}`,r),redeliver:(e,t,r)=>this.request("POST",`/webhook_endpoints/${e}/deliveries/${t}/redeliver`,r)}};roles={list:(e,t)=>this.request("GET","/roles",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/roles/${e}`,{...r,params:v(t)}),create:(e,t)=>this.request("POST","/roles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/roles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/roles/${e}`,t)};permissions={list:e=>this.request("GET","/permissions",e)}};function jr(e){let t=e.baseUrl.replace(/\/$/,""),r=e.fetch||fetch.bind(globalThis),i=Qw(e.retry),n={baseUrl:t,fetchFn:r,retryConfig:i,credentials:e.credentials??"include"},s=e.jwtToken,a=e.storeId,o=null,p="/api/v3/admin",d=async(l,m,h={})=>{let f={};a&&!m.startsWith("/auth/")&&(f["X-Spree-Store-Id"]=a);let w={...h,headers:{...f,...h.headers}},k=()=>{let x=e.secretKey?{headerName:"X-Spree-Api-Key",headerValue:e.secretKey}:{headerName:"Authorization",headerValue:s?`Bearer ${s}`:""};return nx(n,p,x)(l,m,w)};try{return await k()}catch(x){if(x instanceof ft&&x.status===401&&o&&!m.includes("/auth/")&&await o())return k();throw x}},c=new sx(d),u=Object.create(c);return u.setStore=l=>{a=l},u.setToken=l=>{s=l},u.onUnauthorized=l=>{o=l},u}var oh=D(Dr(),1),Re=D(K(),1);var Km=D(K(),1);import o0 from"fs";var _o=Symbol("no-body");async function Ym(e){if(e===void 0)return _o;let t;if(e==="-")t=await p0();else if(e.startsWith("@")){let r=e.slice(1);try{t=o0.readFileSync(r,"utf-8")}catch(i){throw i?.code==="ENOENT"?new Error(`Request body file not found: ${r}`):new Error(`Could not read request body file ${r}: ${i.message}`)}}else t=e;try{return JSON.parse(t)}catch{let r=e==="-"?" (from stdin)":e.startsWith("@")?` (${e.slice(1)})`:"";throw new Error(`Request body is not valid JSON${r}`)}}async function p0(){process.stdin.isTTY&&process.stderr.write(`${Km.default.dim("Reading request body from stdin \u2014 paste JSON and press Ctrl-D...")}
170
- `);let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString("utf-8")}var bo=D(Dr(),1),_e=D(K(),1);function Lr(e,t="json"){if(e!=null){if(t==="table"){let r=u0(e);if(r){(0,bo.printTable)(r.map(Jm));return}let i=Jm(e);(0,bo.printTable)(Object.entries(i).map(([n,s])=>({field:n,value:s})));return}process.stdout.isTTY?process.stdout.write(`${d0(JSON.stringify(e,null,2))}
168
+ `),process.exit(1)}function Xw(e){let t=ae.join(e,"gitignore.template");de.existsSync(t)&&de.renameSync(t,ae.join(e,".gitignore"))}async function Zw(e,t){if(de.existsSync(e)&&de.statSync(e).isDirectory()){de.cpSync(e,t,{recursive:!0,filter:r=>{let i=ae.basename(r);return i!=="node_modules"&&i!=="dist"&&i!==".git"}});return}await te("git",["clone","--depth","1","--",e,t]),de.rmSync(ae.join(t,".git"),{recursive:!0,force:!0})}var Sm=/^VITE_SPREE_API_URL=(https?:\/\/localhost\S*)$/m;function Am(e,t,r){let i=ae.join(e,"apps",t);if(!de.existsSync(ae.join(i,"package.json")))return"untouched";let n=ae.join(i,".env.local"),s;try{s=de.readFileSync(n,"utf-8")}catch(a){if(!Kt(a))throw a;return Em(n,r),"written"}return Sm.test(s)?(de.writeFileSync(n,s.replace(Sm,`VITE_API_PROXY_TARGET=http://localhost:${r}`)),"repaired"):"untouched"}var Qw=Object.values(eo).map(e=>e.dir);function En(e,t){let r="untouched";for(let i of Qw){let n=Am(e,i,t);n!=="untouched"&&(r=n)}return r}function Em(e,t){de.writeFileSync(e,["# Dev-server proxy target \u2014 where Vite forwards /api and /rails (your","# Rails backend). The SPA stays same-origin with the API: the SDK uses","# relative URLs and the proxy bridges the port gap.","#","# Do NOT set VITE_SPREE_API_URL for local dev \u2014 it switches the SDK to","# absolute cross-origin URLs, which breaks on CORS and the SameSite=Lax","# auth cookie. Set it only when building for a deploy where the","# dashboard is hosted on a different origin than the API.","#","# No credentials belong in this file \u2014 every VITE_-prefixed value is","# compiled into the client bundle.",`VITE_API_PROXY_TARGET=http://localhost:${t}`,""].join(`
169
+ `))}function Jt(e,t){for(let r of[t,e]){if(de.existsSync(ae.join(r,"pnpm-lock.yaml")))return"pnpm";if(de.existsSync(ae.join(r,"yarn.lock")))return"yarn";if(de.existsSync(ae.join(r,"package-lock.json")))return"npm"}return"pnpm"}function k(e){if(!e)return;let t={};return e.expand?.length&&(t.expand=e.expand.join(",")),e.fields?.length&&(t.fields=e.fields.join(",")),Object.keys(t).length>0?t:void 0}function ex(e){return e===!1?!1:{maxRetries:e?.maxRetries??2,retryOnStatus:e?.retryOnStatus??[429,500,502,503,504],baseDelay:e?.baseDelay??300,maxDelay:e?.maxDelay??1e4,retryOnNetworkError:e?.retryOnNetworkError??!0}}var tx=new Set(["page","limit","expand","sort","fields"]);function y(e){let t={};for(let[r,i]of Object.entries(e))if(i!==void 0){if(tx.has(r)){t[r]=Array.isArray(i)?i.join(","):i;continue}if(r.startsWith("q[")){t[r]=i;continue}if(Array.isArray(i)){let n=r.endsWith("[]")?r.slice(0,-2):r;t[`q[${n}][]`]=i}else t[`q[${r}]`]=i}return t}var ft=class extends Error{code;status;details;constructor(e,t){super(e.error.message),this.name="SpreeError",this.code=e.error.code,this.status=t,this.details=e.error.details}};function Pm(e,t){let r=t.baseDelay*2**e,i=Math.random()*t.baseDelay;return Math.min(r+i,t.maxDelay)}function jm(e){return new Promise(t=>setTimeout(t,e))}function rx(){return`spree-sdk-retry-${crypto.randomUUID()}`}function ix(e,t,r,i){return e==="GET"||e==="HEAD"||i?r.retryOnStatus.includes(t):t===429}function nx(e,t,r){return t.retryOnNetworkError?e==="GET"||e==="HEAD"||r:!1}function sx(e,t,r,i){return async function(s,a,o={}){let{token:p,spreeToken:d,idempotencyKey:c,headers:u={},body:l,params:m}=o,h=o.locale??i?.locale,f=o.currency??i?.currency,w=o.country??i?.country,v=o.channel??i?.channel,x=typeof window<"u"?window.location.origin:void 0,_=e.baseUrl||x;if(!_)throw new TypeError("sdk-core: baseUrl is required in non-browser environments (no window.location to resolve relative URLs against)");let T=new URL(`${e.baseUrl}${t}${a}`,_);m&&Object.entries(m).forEach(([W,$])=>{if($!==void 0)if(Array.isArray($))for(let Ve of $)T.searchParams.append(W,String(Ve));else T.searchParams.set(W,String($))});let S={"Content-Type":"application/json",...u};r.headerValue&&(S[r.headerName]=r.headerValue),p&&(S.Authorization=`Bearer ${p}`),d&&(S["x-spree-token"]=d),h&&(S["x-spree-locale"]=h),f&&(S["x-spree-currency"]=f),w&&(S["x-spree-country"]=w),v&&(S["x-spree-channel"]=v);let O=c??(s!=="GET"&&s!=="HEAD"&&e.retryConfig?rx():void 0);O&&(S["Idempotency-Key"]=O);let B=!!O,U=e.retryConfig?e.retryConfig.maxRetries+1:1;for(let W=0;W<U;W++)try{let $=await e.fetchFn(T.toString(),{method:s,headers:S,body:l?JSON.stringify(l):void 0,credentials:e.credentials});if(!$.ok){if(!(W>=U-1)&&e.retryConfig&&ix(s,$.status,e.retryConfig,B)){let H=$.headers.get("Retry-After"),ue=H?Math.min(parseInt(H,10)*1e3,e.retryConfig.maxDelay):Pm(W,e.retryConfig);await jm(ue);continue}let $e=await $.json().catch(()=>null);throw typeof $e?.error?.code=="string"&&typeof $e.error.message=="string"?new ft($e,$.status):new ft({error:{code:"http_error",message:`Request failed with status ${$.status}`}},$.status)}return $.status===204?void 0:$.status===202?$.headers.get("content-type")?.includes("application/json")?$.json():void 0:$.json()}catch($){if($ instanceof ft)throw $;if(!(W>=U-1)&&e.retryConfig&&nx(s,e.retryConfig,B)){let $e=Pm(W,e.retryConfig);await jm($e);continue}throw $}throw new Error("Unexpected end of retry loop")}}var gt={"Spree::Product":"/products","Spree::Variant":"/variants","Spree::Order":"/orders","Spree::User":"/customers","Spree::Category":"/categories","Spree::Collection":"/collections","Spree::OptionType":"/option_types"},ax=class{request;constructor(e){this.request=e}parentScopedCustomFields(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields`,{...i,params:r?y(r):void 0}),get:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields/${r}`,i),create:(t,r,i)=>this.request("POST",`${e}/${t}/custom_fields`,{...i,body:r}),update:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/custom_fields/${r}`,{...n,body:i}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/custom_fields/${r}`,i)}}parentScopedTranslations(e){return{get:(t,r)=>this.request("GET",`${e}/${t}/translations`,r).then(i=>i.data)}}productMembership(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/products`,{...i,params:r?y(r):void 0}),create:(t,r,i)=>this.request("POST",`${e}/${t}/products`,{...i,body:{product_ids:r}}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/products`,{...i,body:{product_ids:r}})}}positionedProductMembership(e){return{...this.productMembership(e),reposition:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/products/${r}/reposition`,{...n,body:i})}}customFields(e,t){let r=gt[e];if(!r)throw new Error(`Unknown custom-field owner type: ${e}. Add it to CUSTOM_FIELD_OWNER_PATHS.`);let i=this.parentScopedCustomFields(r);return{list:(n,s)=>i.list(t,n,s),get:(n,s)=>i.get(t,n,s),create:(n,s)=>i.create(t,n,s),update:(n,s,a)=>i.update(t,n,s,a),delete:(n,s)=>i.delete(t,n,s)}}customFieldDefinitions={list:(e,t)=>this.request("GET","/custom_field_definitions",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/custom_field_definitions/${e}`,t),resourceTypes:e=>this.request("GET","/custom_field_definitions/resource_types",e),create:(e,t)=>this.request("POST","/custom_field_definitions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/custom_field_definitions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/custom_field_definitions/${e}`,t)};auth={login:(e,t)=>this.request("POST","/auth/login",{...t,body:e}),refresh:e=>this.request("POST","/auth/refresh",e),logout:e=>this.request("POST","/auth/logout",e),providers:e=>this.request("GET","/auth/providers",e),lookupInvitation:(e,t,r)=>this.request("GET",`/auth/invitations/${e}/lookup`,{...r,params:{token:t}}),acceptInvitation:(e,t,r,i)=>this.request("POST",`/auth/invitations/${e}/accept`,{...i,params:{token:t},body:r}),setupStatus:e=>this.request("GET","/auth/setup",e),setupCountries:e=>this.request("GET","/auth/setup/countries",e),completeSetup:(e,t)=>this.request("POST","/auth/setup",{...t,body:e}),requestPasswordReset:(e,t)=>this.request("POST","/auth/password_resets",{...t,body:e}),resetPassword:(e,t,r)=>this.request("PATCH",`/auth/password_resets/${encodeURIComponent(e)}`,{...r,body:t})};me={get:e=>this.request("GET","/me",e),update:(e,t)=>this.request("PATCH","/me",{...t,body:e})};reporting={query:(e,t)=>this.request("POST","/reporting/query",{...t,body:e}),schema:e=>this.request("GET","/reporting/schema",e),savedReports:{list:(e,t)=>this.request("GET","/reporting/saved_reports",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/reporting/saved_reports/${e}`,t),create:(e,t)=>this.request("POST","/reporting/saved_reports",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/reporting/saved_reports/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/reporting/saved_reports/${e}`,t)}};dashboard={counters:(e,t)=>this.request("GET","/dashboard/counters",{...t,params:e})};store={get:e=>this.request("GET","/store",e),update:(e,t)=>this.request("PATCH","/store",{...t,body:e}),dataSources:e=>this.request("GET","/store/data_sources",e).then(t=>t.data)};locales={list:e=>this.request("GET","/locales",e).then(t=>t.data)};translatableResources={list:e=>this.request("GET","/translatable_resources",e).then(t=>t.data)};translations={coverage:(e,t,r)=>{let{page:i,limit:n,search:s,...a}=t??{};return this.request("GET","/translations",{...r,params:{resource_type:e,...i===void 0?{}:{page:i},...n===void 0?{}:{limit:n},...s===void 0?{}:{search:s},...y(a)}})},batch:(e,t)=>this.request("POST","/translations/batch",{...t,body:{translations:e}}).then(r=>r.data)};products={list:(e,t)=>this.request("GET","/products",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/products/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/products",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/products/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/products/${e}`,t),clone:(e,t)=>this.request("POST",`/products/${e}/clone`,t),approve:(e,t)=>this.request("PATCH",`/products/${e}/approve`,t),reject:(e,t,r)=>this.request("PATCH",`/products/${e}/reject`,{...r,body:t}),bulkStatusUpdate:(e,t)=>this.request("POST","/products/bulk_status_update",{...t,body:e}),bulkAddToCategories:(e,t)=>this.request("POST","/products/bulk_add_to_categories",{...t,body:e}),bulkRemoveFromCategories:(e,t)=>this.request("POST","/products/bulk_remove_from_categories",{...t,body:e}),bulkAddToCollections:(e,t)=>this.request("POST","/products/bulk_add_to_collections",{...t,body:e}),bulkRemoveFromCollections:(e,t)=>this.request("POST","/products/bulk_remove_from_collections",{...t,body:e}),bulkAddToChannels:(e,t)=>this.request("POST","/products/bulk_add_to_channels",{...t,body:e}),bulkRemoveFromChannels:(e,t)=>this.request("POST","/products/bulk_remove_from_channels",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/products/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/products/bulk_remove_tags",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/products/bulk_destroy",{...t,body:e}),media:{list:(e,t,r)=>this.request("GET",`/products/${e}/media`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/media`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/media/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/media/${t}`,r)},digitalAssets:{list:(e,t,r)=>this.request("GET",`/products/${e}/digital_assets`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/digital_assets`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/digital_assets/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/digital_assets/${t}`,r),providers:(e,t)=>this.request("GET",`/products/${e}/digital_assets/providers`,t)},variants:{list:(e,t,r)=>this.request("GET",`/products/${e}/variants`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/products/${e}/variants`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/variants/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/variants/${t}`,r),media:{list:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}/media`,{...i,params:r?y(r):void 0}),create:(e,t,r,i)=>this.request("POST",`/products/${e}/variants/${t}/media`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/products/${e}/variants/${t}/media/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/products/${e}/variants/${t}/media/${r}`,i)}},customFields:this.parentScopedCustomFields(gt["Spree::Product"]),translations:this.parentScopedTranslations("/products")};digitalLinks={list:(e,t)=>this.request("GET","/digital_links",{...t,params:e?y(e):void 0}),retrieve:(e,t)=>this.request("GET",`/digital_links/${e}`,t),reset:(e,t)=>this.request("PATCH",`/digital_links/${e}/reset`,t)};orders={list:(e,t)=>this.request("GET","/orders",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/orders/${e}`,t),complete:(e,t,r)=>this.request("PATCH",`/orders/${e}/complete`,{...r,body:t}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/cancel`,{...r,body:t}),approve:(e,t)=>this.request("PATCH",`/orders/${e}/approve`,t),resendConfirmation:(e,t)=>this.request("POST",`/orders/${e}/resend_confirmation`,t),resendDigitalLinks:(e,t)=>this.request("POST",`/orders/${e}/resend_digital_links`,t),giftCards:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/gift_cards`,{...r,body:t}),remove:(e,t,r)=>this.request("DELETE",`/orders/${e}/gift_cards/${t}`,r)},storeCredits:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/store_credits`,{...r,body:t}),remove:(e,t)=>this.request("DELETE",`/orders/${e}/store_credits`,t)},items:{list:(e,t,r)=>this.request("GET",`/orders/${e}/items`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/items/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/items`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/items/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/items/${t}`,r)},fulfillments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/fulfillments`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/fulfill`,{...i,body:r}),markDelivered:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/mark_delivered`,{...i,body:r}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/cancel`,r),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/labels/${r}`,i)},deliveries:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/deliveries`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),markDelivered:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}/mark_delivered`,{...n,body:i})},split:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/split`,{...i,body:r})},returns:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/returns`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/returns/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/receive`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/refund`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/cancel`,{...i,body:r}),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/returns/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/returns/${t}/labels/${r}`,i)}},exchanges:{list:(e,t,r)=>this.request("GET",`/orders/${e}/exchanges`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/exchanges/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/exchanges`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/receive`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/fulfill`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/cancel`,{...i,body:r})},claims:{list:(e,t,r)=>this.request("GET",`/orders/${e}/claims`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/claims/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/claims`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/claims/${t}/approve`,r),resolve:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/resolve`,{...i,body:r}),deny:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/deny`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/cancel`,{...i,body:r})},payments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/payments`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/payments/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/payments`,{...r,body:t}),capture:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/capture`,r),void:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/void`,r)},refunds:{list:(e,t,r)=>this.request("GET",`/orders/${e}/refunds`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/orders/${e}/refunds`,{...r,body:t})},taxLines:{list:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines/${t}`,r)},discounts:{list:(e,t,r)=>this.request("GET",`/orders/${e}/discounts`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/discounts/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/discounts`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/discounts/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discounts/${t}`,r)},discountCodes:{create:(e,t,r)=>this.request("POST",`/orders/${e}/discount_codes`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discount_codes/${encodeURIComponent(t)}`,r)},fees:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fees`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/fees/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/fees`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fees/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/fees/${t}`,r)},customFields:this.parentScopedCustomFields(gt["Spree::Order"])};optionTypes={list:(e,t)=>this.request("GET","/option_types",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/option_types/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/option_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/option_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/option_types/${e}`,t),customFields:this.parentScopedCustomFields(gt["Spree::OptionType"]),translations:this.parentScopedTranslations("/option_types")};deliveryMethods={list:(e,t)=>this.request("GET","/delivery_methods",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_methods/${e}`,t),create:(e,t)=>this.request("POST","/delivery_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_methods/${e}`,t),calculators:e=>this.request("GET","/delivery_methods/calculators",e),fulfillmentProviders:e=>this.request("GET","/delivery_methods/fulfillment_providers",e),rateProviders:e=>this.request("GET","/delivery_methods/rate_providers",e),rules:{list:(e,t)=>this.request("GET",`/delivery_methods/${e}/rules`,t),create:(e,t,r)=>this.request("POST",`/delivery_methods/${e}/rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_methods/${e}/rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_methods/${e}/rules/${t}`,r)},ruleTypes:e=>this.request("GET","/delivery_method_rules/types",e)};deliveryProfiles={list:(e,t)=>this.request("GET","/delivery_profiles",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_profiles/${e}`,t),create:(e,t)=>this.request("POST","/delivery_profiles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_profiles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_profiles/${e}`,t),kinds:e=>this.request("GET","/delivery_profiles/kinds",e),originGroups:{list:(e,t)=>this.request("GET",`/delivery_profiles/${e}/origin_groups`,t),create:(e,t,r)=>this.request("POST",`/delivery_profiles/${e}/origin_groups`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_profiles/${e}/origin_groups/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_profiles/${e}/origin_groups/${t}`,r)}};trackingCarriers={list:e=>this.request("GET","/tracking_carriers",e)};deliveryZones={list:(e,t)=>this.request("GET","/delivery_zones",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/delivery_zones/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/delivery_zones",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_zones/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_zones/${e}`,t)};packageTypes={list:(e,t)=>this.request("GET","/package_types",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/package_types/${e}`,t),create:(e,t)=>this.request("POST","/package_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/package_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/package_types/${e}`,t)};paymentMethods={list:(e,t)=>this.request("GET","/payment_methods",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/payment_methods/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/payment_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/payment_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/payment_methods/${e}`,t),types:e=>this.request("GET","/payment_methods/types",e)};integrations={list:(e,t)=>this.request("GET","/integrations",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/integrations/${e}`,t),create:(e,t)=>this.request("POST","/integrations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/integrations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/integrations/${e}`,t),types:e=>this.request("GET","/integrations/types",e),test:(e,t)=>this.request("POST",`/integrations/${e}/test`,t)};priceLists={list:(e,t)=>this.request("GET","/price_lists",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/price_lists/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/price_lists",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/price_lists/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/price_lists/${e}`,t),products:this.productMembership("/price_lists"),activate:(e,t)=>this.request("PATCH",`/price_lists/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/price_lists/${e}/deactivate`,t),ruleTypes:e=>this.request("GET","/price_lists/price_rule_types",e)};prices={list:(e,t)=>this.request("GET","/prices",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/prices/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/prices",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/prices/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/prices/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/prices/bulk_upsert",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/prices/bulk_destroy",{...t,body:e})};promotions={list:(e,t)=>this.request("GET","/promotions",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/promotions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/promotions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/promotions/${e}`,t),actions:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_actions`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_actions/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_actions/${t}`,r)},rules:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_rules/${t}`,r)},couponCodes:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes/${t}`,r)}};promotionActions={types:e=>this.request("GET","/promotion_actions/types",e),calculators:(e,t)=>this.request("GET","/promotion_actions/calculators",{...t,params:{type:e}})};promotionRules={types:e=>this.request("GET","/promotion_rules/types",e)};tags={list:(e,t)=>this.request("GET","/tags",{...t,params:e})};customerGroups={list:(e,t)=>this.request("GET","/customer_groups",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/customer_groups/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/customer_groups",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customer_groups/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customer_groups/${e}`,t)};sellers={list:(e,t)=>this.request("GET","/sellers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/sellers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/sellers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/sellers/${e}`,t),invite:(e,t,r)=>this.request("POST",`/sellers/${e}/invite`,{...r,body:t}),approve:(e,t,r)=>this.request("PATCH",`/sellers/${e}/approve`,{...r,body:t}),onboarding:(e,t)=>this.request("GET",`/sellers/${e}/onboarding`,t),reopenOnboarding:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reopen_onboarding`,{...r,body:t}),team:{list:(e,t)=>this.request("GET",`/sellers/${e}/team`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/team/${t}`,r)},invitations:{list:(e,t)=>this.request("GET",`/sellers/${e}/invitations`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/invitations/${t}`,r),resend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/invitations/${t}/resend`,r)},requirementSubmissions:{list:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions/${t}`,r),accept:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/accept`,{...i,body:r}),reject:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/reject`,{...i,body:r}),waive:(e,t,r)=>this.request("POST",`/sellers/${e}/requirement_submissions`,{...r,body:t})},suspend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/suspend`,{...r,body:t}),reject:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reject`,{...r,body:t}),balances:(e,t)=>this.request("GET",`/sellers/${e}/balances`,t),settle:(e,t)=>this.request("POST",`/sellers/${e}/payouts`,t)};sellerRequirements={list:(e,t)=>this.request("GET","/seller_requirements",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/seller_requirements/${e}`,t),create:(e,t)=>this.request("POST","/seller_requirements",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/seller_requirements/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/seller_requirements/${e}`,t),types:e=>this.request("GET","/seller_requirements/types",e)};commissionRates={list:(e,t)=>this.request("GET","/commission_rates",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_rates/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/commission_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/commission_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/commission_rates/${e}`,t),ruleTypes:e=>this.request("GET","/commission_rates/rule_types",e)};commissionLines={list:(e,t)=>this.request("GET","/commission_lines",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_lines/${e}`,{...r,params:k(t)})};orderGroups={list:(e,t)=>this.request("GET","/order_groups",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/order_groups/${e}`,{...r,params:k(t)})};sellerTransfers={list:(e,t)=>this.request("GET","/seller_transfers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_transfers/${e}`,{...r,params:k(t)})};sellerPayouts={list:(e,t)=>this.request("GET","/seller_payouts",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_payouts/${e}`,{...r,params:k(t)}),complete:(e,t,r)=>this.request("PATCH",`/seller_payouts/${e}/complete`,{...r,body:t})};giftCards={list:(e,t)=>this.request("GET","/gift_cards",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/gift_cards/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/gift_cards",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/gift_cards/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/gift_cards/${e}`,t)};storeCredits={list:(e,t)=>this.request("GET","/store_credits",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/store_credits/${e}`,{...r,params:k(t)}),events:{list:(e,t,r)=>this.request("GET",`/store_credits/${e}/events`,{...r,params:t?y(t):void 0})}};returns={list:(e,t)=>this.request("GET","/returns",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/returns/${e}`,{...r,params:k(t)})};exchanges={list:(e,t)=>this.request("GET","/exchanges",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/exchanges/${e}`,{...r,params:k(t)})};claims={list:(e,t)=>this.request("GET","/claims",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/claims/${e}`,{...r,params:k(t)})};giftCardBatches={list:(e,t)=>this.request("GET","/gift_card_batches",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/gift_card_batches/${e}`,t),create:(e,t)=>this.request("POST","/gift_card_batches",{...t,body:e})};taxRates={list:(e,t)=>this.request("GET","/tax_rates",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_rates/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/tax_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_rates/${e}`,t)};taxProviders={list:e=>this.request("GET","/tax_providers",e)};payoutProviders={list:e=>this.request("GET","/payout_providers",e)};companies={list:(e,t)=>this.request("GET","/companies",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/companies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/companies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/companies/${e}`,t),addresses:{list:(e,t,r)=>this.request("GET",`/companies/${e}/addresses`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/addresses`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/addresses/${t}`,r),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/addresses/${t}`,r)},memberships:{list:(e,t,r)=>this.request("GET",`/companies/${e}/memberships`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/memberships`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/memberships/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/memberships/${t}`,r)},invitations:{list:(e,t,r)=>this.request("GET",`/companies/${e}/invitations`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/invitations/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/invitations/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers/${t}/validate`,r)},taxExemptionCertificates:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_exemption_certificates`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_exemption_certificates`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,body:r}),verify:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/verify`,r),revoke:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/revoke`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_exemption_certificates/${t}`,r)}};catalogs={list:(e,t)=>this.request("GET","/catalogs",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/catalogs/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/catalogs",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/catalogs/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/catalogs/${e}`,t),products:this.productMembership("/catalogs"),activate:(e,t)=>this.request("PATCH",`/catalogs/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/catalogs/${e}/deactivate`,t),importProducts:(e,t)=>this.request("POST",`/catalogs/${e}/import_products`,t),assign:(e,t,r)=>this.request("POST",`/catalogs/${e}/assign`,{...r,body:t}),quantityRules:{upsert:(e,t,r)=>this.request("PUT",`/catalogs/${e}/quantity_rules`,{...r,body:t})},orderMinimums:{list:(e,t,r)=>this.request("GET",`/catalogs/${e}/order_minimums`,{...r,params:t?y(t):void 0}),create:(e,t,r)=>this.request("POST",`/catalogs/${e}/order_minimums`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/catalogs/${e}/order_minimums/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/catalogs/${e}/order_minimums/${t}`,r)}};catalogAssignments={delete:(e,t)=>this.request("DELETE",`/catalog_assignments/${e}`,t)};exports={list:(e,t)=>this.request("GET","/exports",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/exports/${e}`,t),create:(e,t)=>this.request("POST","/exports",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/exports/${e}`,t)};imports={list:(e,t)=>this.request("GET","/imports",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/imports/${e}`,t),create:(e,t)=>this.request("POST","/imports",{...t,body:e}),completeMapping:(e,t,r)=>this.request("PATCH",`/imports/${e}/complete_mapping`,{...r,body:t??{}}),retryFailedRows:(e,t)=>this.request("PATCH",`/imports/${e}/retry_failed_rows`,t),delete:(e,t)=>this.request("DELETE",`/imports/${e}`,t),rows:{list:(e,t,r)=>this.request("GET",`/imports/${e}/rows`,{...r,params:t?y(t):void 0})}};customers={list:(e,t)=>this.request("GET","/customers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}`,{...r,params:k(t)}),creditCards:{list:(e,t,r)=>this.request("GET",`/customers/${e}/credit_cards`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/credit_cards/${t}`,{...i,params:k(r)}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/credit_cards/${t}`,r)},create:(e,t)=>this.request("POST","/customers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customers/${e}`,t),export:(e,t)=>this.request("GET",`/customers/${e}/export`,t),anonymize:(e,t)=>this.request("POST",`/customers/${e}/anonymize`,t),bulkAddToGroups:(e,t)=>this.request("POST","/customers/bulk_add_to_groups",{...t,body:e}),bulkRemoveFromGroups:(e,t)=>this.request("POST","/customers/bulk_remove_from_groups",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/customers/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/customers/bulk_remove_tags",{...t,body:e}),addresses:{list:(e,t,r)=>this.request("GET",`/customers/${e}/addresses`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/addresses/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/addresses`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/addresses/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers/${t}/validate`,r)},storeCredits:{list:(e,t,r)=>this.request("GET",`/customers/${e}/store_credits`,{...r,params:t?y(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/store_credits/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/store_credits`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/store_credits/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/store_credits/${t}`,r)},customFields:this.parentScopedCustomFields(gt["Spree::User"])};media={list:(e,t)=>this.request("GET","/media",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/media/${e}`,t),create:(e,t)=>this.request("POST","/media",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/media/${e}`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/media/${e}`,{...r,params:t?.detach?{detach:"true"}:void 0}),usage:(e,t)=>this.request("GET",`/media/${e}/usage`,t)};categories={list:(e,t)=>this.request("GET","/categories",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/categories/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/categories/${e}`,t),reposition:(e,t,r)=>this.request("PATCH",`/categories/${e}/reposition`,{...r,body:t}),products:this.positionedProductMembership("/categories"),customFields:this.parentScopedCustomFields(gt["Spree::Category"]),translations:this.parentScopedTranslations("/categories")};collections={list:(e,t)=>this.request("GET","/collections",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/collections/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/collections",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/collections/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/collections/${e}`,t),products:this.positionedProductMembership("/collections"),customFields:this.parentScopedCustomFields(gt["Spree::Collection"]),translations:this.parentScopedTranslations("/collections")};collectionRules={types:e=>this.request("GET","/collection_rules/types",e)};variants={list:(e,t)=>this.request("GET","/variants",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/variants/${e}`,{...r,params:k(t)}),customFields:this.parentScopedCustomFields(gt["Spree::Variant"])};productTypes={list:(e,t)=>this.request("GET","/product_types",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/product_types/${e}`,t),create:(e,t)=>this.request("POST","/product_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/product_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/product_types/${e}`,t),applyToProducts:(e,t)=>this.request("POST",`/product_types/${e}/apply_to_products`,t)};taxCategories={list:(e,t)=>this.request("GET","/tax_categories",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_categories/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/tax_categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_categories/${e}`,t)};policies={list:(e,t)=>this.request("GET","/policies",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/policies/${e}`,t),create:(e,t)=>this.request("POST","/policies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/policies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/policies/${e}`,t)};returnReasons={list:(e,t)=>this.request("GET","/return_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/return_reasons/${e}`,t),create:(e,t)=>this.request("POST","/return_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/return_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/return_reasons/${e}`,t)};claimReasons={list:(e,t)=>this.request("GET","/claim_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/claim_reasons/${e}`,t),create:(e,t)=>this.request("POST","/claim_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/claim_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/claim_reasons/${e}`,t)};orderCancellationReasons={list:(e,t)=>this.request("GET","/order_cancellation_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/order_cancellation_reasons/${e}`,t),create:(e,t)=>this.request("POST","/order_cancellation_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/order_cancellation_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/order_cancellation_reasons/${e}`,t)};refundReasons={list:(e,t)=>this.request("GET","/refund_reasons",{...t,params:e?y(e):void 0}),get:(e,t)=>this.request("GET",`/refund_reasons/${e}`,t),create:(e,t)=>this.request("POST","/refund_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/refund_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/refund_reasons/${e}`,t)};channels={list:(e,t)=>this.request("GET","/channels",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/channels",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/channels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/channels/${e}`,t),addProducts:(e,t,r)=>this.request("POST",`/channels/${e}/add_products`,{...r,body:t}),removeProducts:(e,t,r)=>this.request("POST",`/channels/${e}/remove_products`,{...r,body:t}),orderRoutingRules:{list:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/channels/${e}/order_routing_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/channels/${e}/order_routing_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/channels/${e}/order_routing_rules/${t}`,r)}};orderRoutingRules={types:e=>this.request("GET","/order_routing_rules/types",e)};markets={list:(e,t)=>this.request("GET","/markets",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/markets/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/markets",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/markets/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/markets/${e}`,t)};stockLocations={list:(e,t)=>this.request("GET","/stock_locations",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_locations/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/stock_locations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_locations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_locations/${e}`,t)};stockLevels={list:(e,t)=>this.request("GET","/stock_levels",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_levels/${e}`,{...r,params:k(t)}),update:(e,t,r)=>this.request("PATCH",`/stock_levels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_levels/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/stock_levels/bulk_upsert",{...t,body:e})};stockMovements={list:(e,t)=>this.request("GET","/stock_movements",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_movements/${e}`,{...r,params:k(t)})};stockTransfers={list:(e,t)=>this.request("GET","/stock_transfers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_transfers/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/stock_transfers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_transfers/${e}`,t),markReady:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_ready`,t),markInTransit:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/mark_in_transit`,{...r,body:t}),markDraft:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/stock_transfers/${e}/stock_receipts`,{...r,params:k(t)}),get:(e,t,r,i)=>this.request("GET",`/stock_transfers/${e}/stock_receipts/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/stock_transfers/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/cancel`,{...r,body:t})};suppliers={list:(e,t)=>this.request("GET","/suppliers",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/suppliers/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/suppliers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/suppliers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/suppliers/${e}`,t)};purchaseOrders={list:(e,t)=>this.request("GET","/purchase_orders",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/purchase_orders/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/purchase_orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/purchase_orders/${e}`,t),markOrdered:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_ordered`,t),markDraft:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/purchase_orders/${e}/stock_receipts`,{...r,params:k(t)}),get:(e,t,r,i)=>this.request("GET",`/purchase_orders/${e}/stock_receipts/${t}`,{...i,params:k(r)}),create:(e,t,r)=>this.request("POST",`/purchase_orders/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/cancel`,{...r,body:t})};countries={list:(e,t)=>this.request("GET","/countries",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/countries/${e}`,{...r,params:k(t)})};directUploads={create:(e,t)=>this.request("POST","/direct_uploads",{...t,body:e})};adminUsers={list:(e,t)=>this.request("GET","/admin_users",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/admin_users/${e}`,{...r,params:k(t)}),update:(e,t,r)=>this.request("PATCH",`/admin_users/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/admin_users/${e}`,t)};invitations={list:(e,t)=>this.request("GET","/invitations",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/invitations/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/invitations",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/invitations/${e}`,t),resend:(e,t)=>this.request("PATCH",`/invitations/${e}/resend`,t)};apiKeys={list:(e,t)=>this.request("GET","/api_keys",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/api_keys/${e}`,{...r,params:k(t)}),current:e=>this.request("GET","/api_keys/current",e??{}),create:(e,t)=>this.request("POST","/api_keys",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/api_keys/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/api_keys/${e}`,t),revoke:(e,t)=>this.request("PATCH",`/api_keys/${e}/revoke`,t)};allowedOrigins={list:(e,t)=>this.request("GET","/allowed_origins",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/allowed_origins/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/allowed_origins",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/allowed_origins/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/allowed_origins/${e}`,t)};webhookEndpoints={list:(e,t)=>this.request("GET","/webhook_endpoints",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/webhook_endpoints",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/webhook_endpoints/${e}`,t),sendTest:(e,t)=>this.request("POST",`/webhook_endpoints/${e}/send_test`,t),enable:(e,t)=>this.request("PATCH",`/webhook_endpoints/${e}/enable`,t),disable:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}/disable`,{...r,body:t}),deliveries:{list:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries`,{...r,params:t?y(t):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries/${t}`,r),redeliver:(e,t,r)=>this.request("POST",`/webhook_endpoints/${e}/deliveries/${t}/redeliver`,r)}};roles={list:(e,t)=>this.request("GET","/roles",{...t,params:e?y(e):void 0}),get:(e,t,r)=>this.request("GET",`/roles/${e}`,{...r,params:k(t)}),create:(e,t)=>this.request("POST","/roles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/roles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/roles/${e}`,t)};permissions={list:e=>this.request("GET","/permissions",e)}};function jr(e){let t=e.baseUrl.replace(/\/$/,""),r=e.fetch||fetch.bind(globalThis),i=ex(e.retry),n={baseUrl:t,fetchFn:r,retryConfig:i,credentials:e.credentials??"include"},s=e.jwtToken,a=e.storeId,o=null,p="/api/v3/admin",d=async(l,m,h={})=>{let f={};a&&!m.startsWith("/auth/")&&(f["X-Spree-Store-Id"]=a);let w={...h,headers:{...f,...h.headers}},v=()=>{let x=e.secretKey?{headerName:"X-Spree-Api-Key",headerValue:e.secretKey}:{headerName:"Authorization",headerValue:s?`Bearer ${s}`:""};return sx(n,p,x)(l,m,w)};try{return await v()}catch(x){if(x instanceof ft&&x.status===401&&o&&!m.includes("/auth/")&&await o())return v();throw x}},c=new ax(d),u=Object.create(c);return u.setStore=l=>{a=l},u.setToken=l=>{s=l},u.onUnauthorized=l=>{o=l},u}var ph=D(Dr(),1),Re=D(K(),1);var Ym=D(K(),1);import p0 from"fs";var bo=Symbol("no-body");async function Jm(e){if(e===void 0)return bo;let t;if(e==="-")t=await c0();else if(e.startsWith("@")){let r=e.slice(1);try{t=p0.readFileSync(r,"utf-8")}catch(i){throw i?.code==="ENOENT"?new Error(`Request body file not found: ${r}`):new Error(`Could not read request body file ${r}: ${i.message}`)}}else t=e;try{return JSON.parse(t)}catch{let r=e==="-"?" (from stdin)":e.startsWith("@")?` (${e.slice(1)})`:"";throw new Error(`Request body is not valid JSON${r}`)}}async function c0(){process.stdin.isTTY&&process.stderr.write(`${Ym.default.dim("Reading request body from stdin \u2014 paste JSON and press Ctrl-D...")}
170
+ `);let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString("utf-8")}var qo=D(Dr(),1),_e=D(K(),1);function Lr(e,t="json"){if(e!=null){if(t==="table"){let r=l0(e);if(r){(0,qo.printTable)(r.map(Xm));return}let i=Xm(e);(0,qo.printTable)(Object.entries(i).map(([n,s])=>({field:n,value:s})));return}process.stdout.isTTY?process.stdout.write(`${u0(JSON.stringify(e,null,2))}
171
171
  `):process.stdout.write(`${JSON.stringify(e)}
172
- `)}}var c0=/("(?:\\.|[^"\\])*"(\s*:)?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function d0(e){return e.replace(c0,(t,r,i,n,s)=>r!==void 0?i?_e.default.cyan(r.slice(0,-i.length))+i:_e.default.green(r):n!==void 0?_e.default.yellow(n):s!==void 0?_e.default.yellow(s):t)}function u0(e){return Array.isArray(e)?e:e&&typeof e=="object"&&Array.isArray(e.data)?e.data:null}function Jm(e){let t={};for(let[r,i]of Object.entries(e))i===null||["string","number","boolean"].includes(typeof i)?t[r]=i:Array.isArray(i)?t[r]=`[${i.length}]`:t[r]="{\u2026}";return t}function Pt(e,t={}){if(e instanceof ft){let i=e.details?`
172
+ `)}}var d0=/("(?:\\.|[^"\\])*"(\s*:)?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function u0(e){return e.replace(d0,(t,r,i,n,s)=>r!==void 0?i?_e.default.cyan(r.slice(0,-i.length))+i:_e.default.green(r):n!==void 0?_e.default.yellow(n):s!==void 0?_e.default.yellow(s):t)}function l0(e){return Array.isArray(e)?e:e&&typeof e=="object"&&Array.isArray(e.data)?e.data:null}function Xm(e){let t={};for(let[r,i]of Object.entries(e))i===null||["string","number","boolean"].includes(typeof i)?t[r]=i:Array.isArray(i)?t[r]=`[${i.length}]`:t[r]="{\u2026}";return t}function Pt(e,t={}){if(e instanceof ft){let i=e.details?`
173
173
  ${JSON.stringify({details:e.details},null,2)}`:"";process.stderr.write(`${_e.default.red(`${e.code}:`)} ${e.message}${i}
174
174
  `);let n=e.details?.required_scope;typeof n=="string"&&process.stderr.write(`${_e.default.dim(`Hint: this key lacks \`${n}\`. Create one that has it and use it:`)}
175
175
  ${_e.default.dim(` spree api-key create --type secret --scopes ${n}`)}
@@ -178,7 +178,7 @@ ${_e.default.dim(" then pass it via --api-key <sk_...> or export SPREE_API_KEY=
178
178
  `),process.exit(2)),e instanceof TypeError&&/fetch failed/i.test(e.message)){let i=e.cause,n=i instanceof Error?i.message:i?String(i):"",s=t.baseUrl?` (${t.baseUrl})`:"";process.stderr.write(`${_e.default.red("error:")} could not reach the server${s}${n?`: ${n}`:""}
179
179
  `),process.stderr.write(`${_e.default.dim("Hint: check the URL, or run `spree api status` to diagnose reachability and credentials.")}
180
180
  `),process.exit(2)}let r=e instanceof Error?e.message:String(e);process.stderr.write(`${_e.default.red("error:")} ${r}
181
- `),process.exit(2)}function Zm(e){let t=new Map;for(let i of e.query??[]){let n=i.indexOf("=");if(n<=0)throw new Error(`Invalid -q expression "${i}" \u2014 expected key=value (e.g. -q status_eq=active)`);let s=i.slice(0,n),a=i.slice(n+1),o=t.get(s);o?o.push(a):t.set(s,[a])}let r={};for(let[i,n]of t)n.length>1?r[`q[${i}][]`]=n:r[`q[${i}]`]=n[0];return e.sort&&(r.sort=e.sort),e.page!==void 0&&(r.page=Xm(e.page,"--page")),e.limit!==void 0&&(r.limit=Xm(e.limit,"--limit")),e.expand&&(r.expand=e.expand),e.fields&&(r.fields=e.fields),r}function Xm(e,t){if(!/^[1-9]\d*$/.test(e))throw new Error(`Invalid ${t} "${e}" \u2014 expected a positive integer`);return Number(e)}function Br(e){let t=e.startsWith("/")?e:`/${e}`,r="/api/v3/admin";return t===r?"/":t.startsWith(`${r}/`)?t.slice(r.length):t}var er=D(K(),1);async function zr(e,t){let r=jr({baseUrl:e,secretKey:t,retry:!1});try{return{status:"connected",storeName:(await r.request("GET","/store",{}))?.name}}catch(i){return i instanceof ft?i.status===401?{status:"unauthorized",message:i.message}:i.status===403?{status:"forbidden"}:{status:"unreachable",message:`server responded HTTP ${i.status}: ${i.message}`}:{status:"unreachable",message:i instanceof Error?i.message:String(i)}}}async function Qm(e,t){let r=jr({baseUrl:e,secretKey:t,retry:!1});try{return(await r.apiKeys.current()).scopes??null}catch{return null}}function jn(e){return e.status==="unauthorized"||e.status==="unreachable"}function Cn(e){return{connected:er.default.green(`connected${e.storeName?` (${e.storeName})`:""}`),forbidden:er.default.green("connected")+er.default.dim(" (key valid; lacks read_settings for store details)"),unauthorized:er.default.red("key rejected (401)"),unreachable:er.default.red(`unreachable \u2014 ${e.message}`)}[e.status]}var eh={info:{title:"Admin API",contact:{name:"Spree Commerce",url:"https://spreecommerce.org",email:"hello@spreecommerce.org"},description:`Spree Admin API v3 - Administrative API for managing products, orders, and store settings.
181
+ `),process.exit(2)}function Qm(e){let t=new Map;for(let i of e.query??[]){let n=i.indexOf("=");if(n<=0)throw new Error(`Invalid -q expression "${i}" \u2014 expected key=value (e.g. -q status_eq=active)`);let s=i.slice(0,n),a=i.slice(n+1),o=t.get(s);o?o.push(a):t.set(s,[a])}let r={};for(let[i,n]of t)n.length>1?r[`q[${i}][]`]=n:r[`q[${i}]`]=n[0];return e.sort&&(r.sort=e.sort),e.page!==void 0&&(r.page=Zm(e.page,"--page")),e.limit!==void 0&&(r.limit=Zm(e.limit,"--limit")),e.expand&&(r.expand=e.expand),e.fields&&(r.fields=e.fields),r}function Zm(e,t){if(!/^[1-9]\d*$/.test(e))throw new Error(`Invalid ${t} "${e}" \u2014 expected a positive integer`);return Number(e)}function Br(e){let t=e.startsWith("/")?e:`/${e}`,r="/api/v3/admin";return t===r?"/":t.startsWith(`${r}/`)?t.slice(r.length):t}var er=D(K(),1);async function zr(e,t){let r=jr({baseUrl:e,secretKey:t,retry:!1});try{return{status:"connected",storeName:(await r.request("GET","/store",{}))?.name}}catch(i){return i instanceof ft?i.status===401?{status:"unauthorized",message:i.message}:i.status===403?{status:"forbidden"}:{status:"unreachable",message:`server responded HTTP ${i.status}: ${i.message}`}:{status:"unreachable",message:i instanceof Error?i.message:String(i)}}}async function eh(e,t){let r=jr({baseUrl:e,secretKey:t,retry:!1});try{return(await r.apiKeys.current()).scopes??null}catch{return null}}function jn(e){return e.status==="unauthorized"||e.status==="unreachable"}function Cn(e){return{connected:er.default.green(`connected${e.storeName?` (${e.storeName})`:""}`),forbidden:er.default.green("connected")+er.default.dim(" (key valid; lacks read_settings for store details)"),unauthorized:er.default.red("key rejected (401)"),unreachable:er.default.red(`unreachable \u2014 ${e.message}`)}[e.status]}var th={info:{title:"Admin API",contact:{name:"Spree Commerce",url:"https://spreecommerce.org",email:"hello@spreecommerce.org"},description:`Spree Admin API v3 - Administrative API for managing products, orders, and store settings.
182
182
 
183
183
  ## Authentication
184
184
 
@@ -251,7 +251,7 @@ by the one-time setup token printed at install time (rotate it with
251
251
  \`bin/rails spree:setup:token\`). Issues a JWT access token and a
252
252
  refresh-token cookie exactly like login. Returns 404 once any admin
253
253
  user exists \u2014 the flow is closed permanently after setup.
254
- `,parameters:[],responses:{"200":{description:"setup completed",content:{"application/json":{}}},"404":{description:"setup not available",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["setup_token","email","password","country_code"],properties:{setup_token:{type:"string",description:"One-time token from the install output."},email:{type:"string",format:"email"},password:{type:"string"},password_confirmation:{type:"string"},first_name:{type:"string"},last_name:{type:"string"},store_name:{type:"string"},country_code:{type:"string",description:"ISO 3166-1 alpha-2 country the store sells from. Determines the default market, the warehouse, the delivery zones and the currency."},locale:{type:"string",description:"Storefront locale. Defaults to the country's own language."},currency:{type:"string",description:"ISO 4217 currency. Defaults to the country's own currency \u2014 pass one only when the store prices in something else."}}}}}}}},"/api/v3/admin/auth/setup/countries":{get:{summary:"List countries for first-run setup",tags:["Authentication"],description:`Countries the store can be set up in, each with the currency and
254
+ `,parameters:[],responses:{"200":{description:"setup completed",content:{"application/json":{}}},"404":{description:"setup not available",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["setup_token","email","password","country_code"],properties:{setup_token:{type:"string",description:"One-time token from the install output."},email:{type:"string",format:"email"},password:{type:"string"},password_confirmation:{type:"string"},first_name:{type:"string"},last_name:{type:"string"},store_name:{type:"string"},country_code:{type:"string",description:"ISO 3166-1 alpha-2 country the store sells from. Determines the default market, the warehouse, the delivery zones and the currency."},locale:{type:"string",description:"Storefront locale. Defaults to the country's own language."},currency:{type:"string",description:"ISO 4217 currency. Defaults to the country's own currency \u2014 pass one only when the store prices in something else."},sample_data:{type:"boolean",description:"Load the demo catalog, customers and orders in the background once the admin account exists."}}}}}}}},"/api/v3/admin/auth/setup/countries":{get:{summary:"List countries for first-run setup",tags:["Authentication"],description:`Countries the store can be set up in, each with the currency and
255
255
  official languages derived from it. Unauthenticated, because the setup
256
256
  screen runs before any credential exists. Returns 404 once any admin
257
257
  user exists.
@@ -875,24 +875,24 @@ shape a stock location uses.
875
875
  readable. Refused with a 422 while a purchase order still points at it.
876
876
 
877
877
 
878
- **Required scope:** \`write_purchasing\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"204":{description:"supplier deleted"}}}}},components:{schemas:{PaginationMeta:{type:"object",properties:{page:{type:"integer"},limit:{type:"integer"},count:{type:"integer",description:"Total number of records"},pages:{type:"integer",description:"Total number of pages"},from:{type:"integer",description:"Index of first record on this page"},to:{type:"integer",description:"Index of last record on this page"},in:{type:"integer",description:"Number of records on this page"},previous:{type:"integer",nullable:!0,description:"Previous page number"},next:{type:"integer",nullable:!0,description:"Next page number"}},required:["page","limit","count","pages","from","to","in"]},ErrorResponse:{type:"object",properties:{error:{type:"object",properties:{code:{type:"string"},message:{type:"string"},details:{type:"object",description:"Field-specific validation errors",nullable:!0}},required:["code","message"]}},required:["error"]},AuthResponse:{type:"object",properties:{token:{type:"string",description:"JWT access token"},user:{$ref:"#/components/schemas/AdminUser"}},required:["token","user"]},PermissionRule:{type:"object",description:"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.",properties:{allow:{type:"boolean",description:"true for `can`, false for `cannot`"},actions:{type:"array",items:{type:"string"},description:'Action names, e.g. ["read", "update"] or ["manage"]'},subjects:{type:"array",items:{type:"string"},description:'Subject class names, e.g. ["Spree::Product"] or ["all"]'},has_conditions:{type:"boolean",description:"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},required:["allow","actions","subjects","has_conditions"]},ImportSchemaField:{type:"object",description:"A canonical column of an import type, including per-store custom field columns",properties:{name:{type:"string",description:"Canonical field name used in mappings"},label:{type:"string",description:"Human-readable label"},required:{type:"boolean",description:"Whether the field must be mapped before processing"}},required:["name","label","required"]},CheckoutRequirement:{type:"object",properties:{step:{type:"string",description:"Checkout step this requirement belongs to"},field:{type:"string",description:"Field that needs to be satisfied"},message:{type:"string",description:"Human-readable requirement message"}},required:["step","field","message"]},CartWarning:{type:"object",description:"A warning about a cart issue (e.g., item removed due to stock change)",properties:{code:{type:"string",description:"Machine-readable warning code"},message:{type:"string",description:"Human-readable warning message"},line_item_id:{type:"string",nullable:!0,description:"Prefixed line item ID (when applicable)"},variant_id:{type:"string",nullable:!0,description:"Prefixed variant ID (when applicable)"},item_index:{type:"integer",nullable:!0,description:"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},required:["code","message"]},FulfillmentManifestItem:{type:"object",description:"An item within a fulfillment \u2014 which line item and how many units are in this fulfillment",properties:{item_id:{type:"string",description:"Line item ID"},variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer",description:"Quantity in this fulfillment"}},required:["item_id","variant_id","quantity"]},AdminUserRoleAssignment:{type:"object",description:"A role assignment for the current store on a staff member",properties:{id:{type:"string",description:"Prefixed role ID"},name:{type:"string",description:"Role name"}},required:["id","name"]},AdminUserStore:{type:"object",description:"A store the staff member can access through a role assignment",properties:{id:{type:"string",description:"Prefixed store ID"},name:{type:"string",description:"Store name"},code:{type:"string",description:"Store code"}},required:["id","name","code"]},PreferenceField:{type:"object",description:"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.",properties:{key:{type:"string"},type:{type:"string",description:"string | text | password | integer | decimal | boolean | array | hash"},default:{description:"Default value (any JSON type), null when there is no default",nullable:!0}},required:["key","type"]},PromotionActionCalculator:{type:"object",description:"The action's nested calculator (when the action carries one \u2014 null for actions like `free_shipping`)",properties:{type:{type:"string",description:"Wire shorthand for the calculator subclass"},label:{type:"string"},preferences:{type:"object",additionalProperties:!0},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}}},required:["type","label","preferences","preference_schema"]},PromotionActionLineItem:{type:"object",description:"One row in a `create_line_items` action \u2014 the variant added to the order and how many",properties:{variant_id:{type:"string"},quantity:{type:"integer"}},required:["variant_id","quantity"]},MeResponse:{type:"object",description:"Current admin user profile and serialized permissions",properties:{user:{$ref:"#/components/schemas/AdminUser"},permissions:{type:"array",items:{$ref:"#/components/schemas/PermissionRule"}}},required:["user","permissions"]},Address:{type:"object",properties:{id:{type:"string"},label:{type:"string",nullable:!0},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string"},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},city:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},country_name:{type:"string"},country_code:{type:"string"},state_text:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},quick_checkout:{type:"boolean"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"},state_abbr:{type:"string",nullable:!0},country_iso:{type:"string"},state_name:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},latitude:{type:"number",nullable:!0},longitude:{type:"number",nullable:!0},customer_id:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0}},required:["id","label","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","metadata","created_at","updated_at","latitude","longitude","customer_id","owner_id","owner_type"],"x-typelizer":!0},AdminUser:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},selected_locale:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0},roles:{type:"array",items:{$ref:"#/components/schemas/AdminUserRoleAssignment"}},stores:{type:"array",items:{$ref:"#/components/schemas/AdminUserStore"}}},required:["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":!0},AllowedOrigin:{type:"object",properties:{id:{type:"string"},origin:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","origin","created_at","updated_at"],"x-typelizer":!0},ApiKey:{type:"object",properties:{id:{type:"string"},name:{type:"string"},key_type:{type:"string",enum:["publishable","secret"]},token_prefix:{type:"string",nullable:!0},scopes:{type:"array",items:{type:"string"}},created_at:{type:"string"},updated_at:{type:"string"},revoked_at:{type:"string",nullable:!0},last_used_at:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},plaintext_token:{type:"string",nullable:!0},created_by_email:{type:"string",nullable:!0}},required:["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email"],"x-typelizer":!0},AppliedPromotion:{type:"object",properties:{id:{type:"string"},promotion_id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":!0},Cart:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},preferred_stock_location_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_number_required:{type:"boolean"},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},token:{type:"string"},email:{type:"string",nullable:!0},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},warnings:{type:"array",items:{$ref:"#/components/schemas/CartWarning"}},coupon_code:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},adjustment_total:{type:"string",nullable:!0},display_adjustment_total:{type:"string",nullable:!0},discount_total:{type:"string",nullable:!0},display_discount_total:{type:"string",nullable:!0},tax_total:{type:"string",nullable:!0},display_tax_total:{type:"string",nullable:!0},included_tax_total:{type:"string",nullable:!0},display_included_tax_total:{type:"string",nullable:!0},additional_tax_total:{type:"string",nullable:!0},display_additional_tax_total:{type:"string",nullable:!0},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},gift_card_total:{type:"string",nullable:!0},display_gift_card_total:{type:"string",nullable:!0},amount_due:{type:"string",nullable:!0},display_amount_due:{type:"string",nullable:!0},delivery_total:{type:"string",nullable:!0},display_delivery_total:{type:"string",nullable:!0},fee_total:{type:"string",nullable:!0},display_fee_total:{type:"string",nullable:!0},store_credit_total:{type:"string",nullable:!0},display_store_credit_total:{type:"string",nullable:!0},covered_by_store_credit:{type:"boolean"},current_step:{type:"string"},completed_steps:{type:"array",items:{type:"string"}},requirements:{type:"array",items:{$ref:"#/components/schemas/CheckoutRequirement"}},order_minimum:{type:"number",nullable:!0},order_minimum_shortfall:{type:"number",nullable:!0},below_order_minimum:{type:"boolean",nullable:!0},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},shipping_eq_billing_address:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},completed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}}},required:["id","market_id","channel_id","preferred_stock_location_id","company_id","company_name","po_number_required","po_document_filename","po_document_byte_size","number","token","email","customer_note","po_number","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","order_minimum","order_minimum_shortfall","below_order_minimum","freight_summary","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":!0},CatalogAssignment:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},catalog_id:{type:"string"},assignable_type:{type:"string"},assignable_id:{type:"string"},assignable_name:{type:"string",nullable:!0}},required:["id","created_at","catalog_id","assignable_type","assignable_id","assignable_name"],"x-typelizer":!0},CatalogOrderMinimum:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"}},required:["id","currency","created_at","updated_at","amount","display_amount"],"x-typelizer":!0},CatalogPrice:{type:"object",properties:{id:{type:"string",nullable:!0},label:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},currency:{type:"string"},source:{type:"string",enum:["explicit","automatic","base"]},break_count:{type:"number"},amount:{type:"string"},display_amount:{type:"string"},tiers:{type:"array",items:{$ref:"#/components/schemas/CatalogPriceTier"}}},required:["id","label","sku","currency","source","break_count","amount","display_amount","tiers"],"x-typelizer":!0},CatalogPriceTier:{type:"object",properties:{min_quantity:{type:"number"},display_amount:{type:"string"},amount:{type:"string"}},required:["min_quantity","display_amount","amount"],"x-typelizer":!0},CatalogProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},quantity_rule:{allOf:[{$ref:"#/components/schemas/CatalogProductTerm"}],nullable:!0},catalog_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},CatalogProductTerm:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},product_name:{type:"string",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},mixed:{type:"boolean"}},required:["id","product_id","product_name","minimum_order_quantity","order_multiple","mixed"],"x-typelizer":!0},CatalogQuantityRule:{type:"object",properties:{id:{type:"string"},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant_id:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},product_name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","minimum_order_quantity","order_multiple","created_at","updated_at","variant_id","variant_sku","product_name","options_text"],"x-typelizer":!0},Catalog:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},active:{type:"boolean"},position:{type:"number",nullable:!0},metadata:{type:"object",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},products_count:{type:"number"},pricing_strategy:{type:"string"},order_minimums:{type:"array",items:{$ref:"#/components/schemas/CatalogOrderMinimum"}},price_list:{$ref:"#/components/schemas/PriceList"},assignments:{type:"array",items:{$ref:"#/components/schemas/CatalogAssignment"}}},required:["id","name","description","active","position","metadata","minimum_order_quantity","order_multiple","created_at","updated_at","products_count","pricing_strategy"],"x-typelizer":!0},Category:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},depth:{type:"number"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},children_count:{type:"number"},parent_id:{type:"string",nullable:!0},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},is_root:{type:"boolean"},is_child:{type:"boolean"},is_leaf:{type:"boolean"},parent:{$ref:"#/components/schemas/Category"},children:{type:"array",items:{$ref:"#/components/schemas/Category"}},ancestors:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},external_references:{type:"object"},translations:{type:"object"},metadata:{type:"object"},pretty_name:{type:"string"},lft:{type:"number"},rgt:{type:"number"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","external_references","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":!0},Channel:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string"},active:{type:"boolean"},default:{type:"boolean"},storefront_access:{type:"string"},guest_checkout:{type:"boolean"},preferred_order_routing_strategy:{type:"string",nullable:!0},preferred_storefront_access:{type:"string",nullable:!0},preferred_guest_checkout:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_location_ids:{type:"array",items:{type:"string"}},default_catalog_id:{type:"string",nullable:!0}},required:["id","name","code","active","default","storefront_access","guest_checkout","preferred_order_routing_strategy","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","stock_location_ids","default_catalog_id"],"x-typelizer":!0},ClaimLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},send_replacement:{type:"boolean"},description:{type:"string",nullable:!0},refund_amount:{type:"string"},paid_amount:{type:"string"},display_refund_amount:{type:"string"},variant_id:{type:"string",nullable:!0},replacement_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},replacement_variant:{$ref:"#/components/schemas/Variant"}},required:["id","quantity","send_replacement","description","refund_amount","paid_amount","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":!0},ClaimReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Claim:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["open","approved","resolved","denied","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},resolution:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},approved_at:{type:"string",nullable:!0},resolved_at:{type:"string",nullable:!0},denied_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ClaimReason"},claim_line_items:{type:"array",items:{$ref:"#/components/schemas/ClaimLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},created_by_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id"],"x-typelizer":!0},CollectionRule:{type:"object",properties:{id:{type:"string"},value:{type:"string",nullable:!0},match_policy:{type:"string",enum:["is_equal_to","is_not_equal_to","contains","does_not_contain"]},type:{type:"string",description:"Rule type. Built-in: tag, available_on, sale. Extensions may register more."}},required:["id","value","match_policy","type"],"x-typelizer":!0},Collection:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},sort_order:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},products_count:{type:"number"},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},translations:{type:"object"},automatic:{type:"boolean"},rules_match_policy:{type:"string",enum:["all","any"]},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},rules:{type:"array",items:{$ref:"#/components/schemas/CollectionRule"}}},required:["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":!0},CommissionLine:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["percentage","fixed"]},currency:{type:"string"},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},rate:{type:"string"},tax_rate:{type:"string"},amount:{type:"string"},tax_amount:{type:"string"},total:{type:"string"},display_amount:{type:"string"},display_tax_amount:{type:"string"},display_total:{type:"string"},order_id:{type:"string"},seller_id:{type:"string"},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},commission_rate_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},commission_rate:{$ref:"#/components/schemas/CommissionRate"}},required:["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","total","display_amount","display_tax_amount","display_total","order_id","seller_id","line_item_id","fulfillment_id","commission_rate_id","seller_name"],"x-typelizer":!0},CommissionRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},enabled:{type:"boolean"},position:{type:"number"},kind:{type:"string",enum:["percentage","fixed"]},tax_inclusive:{type:"boolean"},include_shipping:{type:"boolean"},metadata:{type:"object",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},value:{type:"string"},commission_tax_rate:{type:"string",nullable:!0},amounts:{type:"object"},bounds:{type:"object"},global:{type:"boolean"},rules:{type:"array",items:{$ref:"#/components/schemas/CommissionRule"}}},required:["id","name","code","enabled","position","kind","tax_inclusive","include_shipping","metadata","deleted_at","created_at","updated_at","value","commission_tax_rate","amounts","bounds","global","rules"],"x-typelizer":!0},CommissionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: seller_rule, category_rule, product_rule, item_total_rule. Extensions may register more."},commission_rate_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"array",items:{type:"string"}}},required:["id","created_at","updated_at","type","commission_rate_id","preferences","preference_schema"],"x-typelizer":!0},CompanyInvitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},expires_at:{type:"string",nullable:!0},company_id:{type:"string"},status:{type:"string",enum:["pending","accepted","revoked","expired"]},accepted_at:{type:"string",nullable:!0},revoked_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","email","expires_at","company_id","status","accepted_at","revoked_at","created_at","updated_at"],"x-typelizer":!0},CompanyMembership:{type:"object",properties:{id:{type:"string"},company_id:{type:"string"},customer_id:{type:"string"},email:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","company_id","customer_id","email","created_at","updated_at"],"x-typelizer":!0},Company:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["company","division"]},po_number_required:{type:"boolean"},parent_id:{type:"string",nullable:!0},ancestors:{type:"object"},external_references:{type:"object"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},children_count:{type:"number"},members_count:{type:"number"},children:{type:"array",items:{$ref:"#/components/schemas/Company"}},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},memberships:{type:"array",items:{$ref:"#/components/schemas/CompanyMembership"}}},required:["id","name","kind","po_number_required","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"x-typelizer":!0},ConsentRecord:{type:"object",properties:{id:{type:"string"},purpose:{type:"string"},source:{type:"string",enum:["checkout","registration","account","admin","newsletter","anonymization","unknown","import","storefront"]},accepted:{type:"boolean"},email:{type:"string",nullable:!0},ip_address:{type:"string",nullable:!0},created_at:{type:"string"},recorded_at:{type:"string",nullable:!0},documents:{type:"object"}},required:["id","purpose","source","accepted","email","ip_address","created_at","recorded_at","documents"],"x-typelizer":!0},Country:{type:"object",properties:{iso:{type:"string"},iso3:{type:"string"},name:{type:"string"},states_required:{type:"boolean"},zipcode_required:{type:"boolean"},states:{type:"array",items:{$ref:"#/components/schemas/State"}},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0}},required:["iso","iso3","name","states_required","zipcode_required"],"x-typelizer":!0},CouponCode:{type:"object",properties:{id:{type:"string"},code:{type:"string"},state:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},promotion_id:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":!0},CreditCard:{type:"object",properties:{id:{type:"string"},brand:{type:"string"},last4:{type:"string"},month:{type:"number"},year:{type:"number"},name:{type:"string",nullable:!0},default:{type:"boolean"},gateway_payment_profile_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},payment_method_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":!0},CustomFieldDefinition:{type:"object",properties:{id:{type:"string"},namespace:{type:"string"},key:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},resource_type:{type:"string",description:"Class name of the resource the field attaches to, for example Spree::Product, Spree::Order or Spree::Customer. Extensions may register more."},storefront_visible:{type:"boolean"},searchable:{type:"boolean"},sortable:{type:"boolean"},filter_key:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","namespace","key","label","field_type","resource_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at"],"x-typelizer":!0},CustomField:{type:"object",properties:{id:{type:"string"},label:{type:"string"},type:{type:"string",deprecated:!0},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},key:{type:"string"},value:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},storefront_visible:{type:"boolean"},custom_field_definition_id:{type:"string"}},required:["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":!0},CustomerGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},customers_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":!0},Customer:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},accepts_email_marketing:{type:"boolean"},email_marketing_consent_updated_at:{type:"string",nullable:!0},full_name:{type:"string"},available_store_credit_total:{type:"string"},display_available_store_credit_total:{type:"string"},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},default_billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},default_shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},newsletter_subscriber:{allOf:[{$ref:"#/components/schemas/NewsletterSubscriber"}],nullable:!0},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},failed_attempts:{type:"number"},metadata:{type:"object"},email_marketing_consent_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},anonymized_at:{type:"string",nullable:!0},anonymized:{type:"boolean"},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},default_billing_address_id:{type:"string",nullable:!0},default_shipping_address_id:{type:"string",nullable:!0},orders_count:{type:"number"},total_spent:{type:"string"},display_total_spent:{type:"string"},last_order_completed_at:{type:"string",nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},store_credits:{type:"array",items:{$ref:"#/components/schemas/StoreCredit"}},customer_group_ids:{type:"array",items:{type:"string"}},companies:{type:"array",items:{$ref:"#/components/schemas/Company"}}},required:["id","email","first_name","last_name","phone","accepts_email_marketing","email_marketing_consent_updated_at","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","email_marketing_consent_source","created_at","updated_at","anonymized_at","anonymized","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":!0},DashboardCounter:{type:"object",properties:{key:{type:"string",description:"Registered counter name. The dashboard translates it; built-in: orders_to_fulfill, payments_to_collect, open_returns, open_exchanges, open_claims, low_stock_items, out_of_stock_items."},value:{type:"number"},link:{type:"object",nullable:!0,description:"The list filter that shows exactly the rows counted, or null when no list can."},nav:{type:"string",nullable:!0,description:"Sidebar entry key this count badges, or null."}},required:["key","value","link","nav"],"x-typelizer":!0},DataRequest:{type:"object",properties:{id:{type:"string"},number:{type:"string"},kind:{type:"string",enum:["access","erasure"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},requested_at:{type:"string",nullable:!0},completed_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},email:{type:"string"},error_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},requested_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"}},required:["id","number","kind","status","requested_at","completed_at","expires_at","email","error_message","created_at","updated_at","customer_id","requested_by_id"],"x-typelizer":!0},DeliveryMethodRule:{type:"object",properties:{id:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more."},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"array",items:{type:"string"}}},required:["id","active","created_at","updated_at","type","preferences","preference_schema","product_ids"],"x-typelizer":!0},DeliveryMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},estimated_transit_business_days_min:{type:"number",nullable:!0},estimated_transit_business_days_max:{type:"number",nullable:!0},digital:{type:"boolean"},pickup:{type:"boolean"},pickup_point:{type:"boolean"},admin_name:{type:"string",nullable:!0},fulfillment_provider:{type:"string"},pickup_point_provider:{type:"string",nullable:!0},rate_provider:{type:"string",nullable:!0},storefront_visible:{type:"boolean"},tracking_url:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},available_to_sellers:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},services:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodService"}},rules:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodRule"}},tax_category_id:{type:"string",nullable:!0},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_zone_id:{type:"string",nullable:!0},stock_location_ids:{type:"array",items:{type:"string"}},calculator_type:{type:"string",nullable:!0},calculator_preferences:{type:"object",nullable:!0}},required:["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","fulfillment_provider","pickup_point_provider","rate_provider","storefront_visible","tracking_url","markup_flat","markup_percent","available_to_sellers","created_at","updated_at","deleted_at","seller_id","seller_name","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","calculator_type","calculator_preferences"],"x-typelizer":!0},DeliveryMethodService:{type:"object",properties:{id:{type:"string"},carrier:{type:"string"},service:{type:"string"},label:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},position:{type:"number"}},required:["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":!0},DeliveryOriginGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},stock_location_ids:{type:"array",items:{type:"string"}},delivery_zones_count:{type:"number"},delivery_methods_count:{type:"number"}},required:["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":!0},DeliveryProfile:{type:"object",properties:{id:{type:"string"},name:{type:"string"},default:{type:"boolean"},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Profile kind. Built-in: shipping, digital. Extensions may register more."},digital:{type:"boolean"},offers_pickup:{type:"boolean"},offers_shipping:{type:"boolean"},stock_location_ids:{type:"array",items:{type:"string"}},origin_groups:{type:"object"},products_count:{type:"number"},delivery_methods_count:{type:"number"},delivery_zones_count:{type:"number"}},required:["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":!0},DeliveryRate:{type:"object",properties:{id:{type:"string"},delivery_method_id:{type:"string"},name:{type:"string"},selected:{type:"boolean"},cost:{type:"string"},total:{type:"string"},additional_tax_total:{type:"string"},included_tax_total:{type:"string"},tax_total:{type:"string"},carrier:{type:"string",nullable:!0},service_level:{type:"string",nullable:!0},estimated_delivery_date:{type:"string",nullable:!0},unpriced:{type:"boolean"},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},display_cost:{type:"string"},display_total:{type:"string"},display_additional_tax_total:{type:"string"},display_included_tax_total:{type:"string"},display_tax_total:{type:"string"},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","unpriced","freight_summary","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":!0},Delivery:{type:"object",properties:{id:{type:"string"},tracking_number:{type:"string"},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},status:{type:"string",enum:["pending","pre_transit","in_transit","out_for_delivery","available_for_pickup","delivered","return_to_sender","failure","unknown"]},tracking_url:{type:"string",nullable:!0},estimated_delivery_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},details:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},shipping_label_id:{type:"string",nullable:!0}},required:["id","tracking_number","carrier","carrier_name","service","status","tracking_url","estimated_delivery_at","delivered_at","details","created_at","updated_at","shipping_label_id"],"x-typelizer":!0},DeliveryZoneMember:{type:"object",properties:{id:{type:"string"},member_type:{type:"string",enum:["country","state","postal_code"]},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},postal_code_prefix:{type:"string",nullable:!0},postal_code_from:{type:"string",nullable:!0},postal_code_to:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","state_name","created_at","updated_at"],"x-typelizer":!0},DeliveryZone:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},members:{type:"array",items:{$ref:"#/components/schemas/DeliveryZoneMember"}},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_method_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":!0},DigitalAsset:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},authorized_clicks:{type:"number",nullable:!0},authorized_days:{type:"number",nullable:!0},byte_size:{type:"number",nullable:!0},provider_type:{type:"string",nullable:!0},provider_settings:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},provider_name:{type:"string",description:"Digital asset provider name. Built-in: File. Extensions may register more."},download_url:{type:"string",nullable:!0},effective_authorized_clicks:{type:"number"},effective_authorized_days:{type:"number"}},required:["id","variant_id","filename","content_type","authorized_clicks","authorized_days","byte_size","provider_type","provider_settings","created_at","updated_at","provider_name","download_url","effective_authorized_clicks","effective_authorized_days"],"x-typelizer":!0},DigitalLink:{type:"object",properties:{id:{type:"string"},access_counter:{type:"number"},filename:{type:"string"},content_type:{type:"string"},download_url:{type:"string"},expires_at:{type:"string",nullable:!0},authorizable:{type:"boolean"},expired:{type:"boolean"},access_limit_exceeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","access_counter","filename","content_type","download_url","expires_at","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":!0},Discount:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{type:"string",enum:["promotion","manual"]},code:{type:"string",nullable:!0},value_type:{type:"string",nullable:!0},value:{type:"string",nullable:!0},promotion_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},ExchangeLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},original_price:{type:"string"},new_variant_price:{type:"string"},price_difference:{type:"string"},original_variant_id:{type:"string",nullable:!0},new_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},original_variant:{$ref:"#/components/schemas/Variant"},new_variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},Exchange:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","fulfilled","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},price_difference:{type:"string"},display_price_difference:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},fulfilled_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},exchange_line_items:{type:"array",items:{$ref:"#/components/schemas/ExchangeLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id"],"x-typelizer":!0},Export:{type:"object",properties:{id:{type:"string"},number:{type:"string"},format:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},done:{type:"boolean"},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},download_url:{type:"string",nullable:!0}},required:["id","number","format","created_at","updated_at","type","user_id","done","store_id","seller_id","seller_name","filename","byte_size","download_url"],"x-typelizer":!0},Fee:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{anyOf:[{type:"string",enum:["surcharge","handling","gift_wrap","cod","payment","duty"]},{type:"string"}],description:"What sort of charge this is. `duty` is a customs duty on a cross-border order and is not taxed; the other kinds are. Extensions may register further kinds."},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},FreightSummaryLine:{type:"object",properties:{variant_id:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},name:{type:"string",nullable:!0},units:{type:"number"},cartons:{type:"number",nullable:!0},pallets:{type:"number",nullable:!0},units_per_carton:{type:"number",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},complete:{type:"boolean"},weight_per_carton:{type:"string",nullable:!0},volume:{type:"string"},weight:{type:"string"}},required:["variant_id","sku","name","units","cartons","pallets","units_per_carton","cartons_per_pallet","complete","weight_per_carton","volume","weight"],"x-typelizer":!0},FreightSummary:{type:"object",properties:{total_units:{type:"number"},total_cartons:{type:"number"},total_pallets:{type:"number",nullable:!0},total_volume:{type:"string"},total_weight:{type:"string"},complete:{type:"boolean"},lines:{type:"array",items:{$ref:"#/components/schemas/FreightSummaryLine"}}},required:["total_units","total_cartons","total_pallets","total_volume","total_weight","complete","lines"],"x-typelizer":!0},FulfillmentItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},status:{anyOf:[{type:"string",enum:["on_hand","backordered","shipped","returned"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":!0},Fulfillment:{type:"object",properties:{id:{type:"string"},number:{type:"string"},tracking:{type:"string",nullable:!0},tracking_url:{type:"string",nullable:!0},pickup_point_data:{type:"object",nullable:!0},selected_delivery_rate_id:{type:"string",nullable:!0},unpriced:{type:"boolean"},cost:{type:"string"},display_cost:{type:"string"},total:{type:"string"},display_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},status:{anyOf:[{type:"string",enum:["unfulfilled","fulfilled","delivered","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},fulfillment_type:{type:"string",enum:["shipping","digital","pickup","pickup_point"]},fulfilled_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentManifestItem"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},stock_location:{$ref:"#/components/schemas/StockLocation"},delivery_rates:{type:"array",items:{$ref:"#/components/schemas/DeliveryRate"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},adjustment_total:{type:"string"},pre_tax_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},provider_generates_labels:{type:"boolean"},fulfillment_items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentItem"}},order:{$ref:"#/components/schemas/Order"}},required:["id","number","tracking","tracking_url","pickup_point_data","selected_delivery_rate_id","unpriced","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","delivered_at","items","deliveries","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","labels","provider_generates_labels"],"x-typelizer":!0},GiftCardBatch:{type:"object",properties:{id:{type:"string"},codes_count:{type:"number"},currency:{type:"string",nullable:!0},prefix:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0}},required:["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":!0},GiftCard:{type:"object",properties:{id:{type:"string"},code:{type:"string"},status:{anyOf:[{type:"string",enum:["active","partially_redeemed","redeemed","canceled","expired"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_authorized:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},expires_at:{type:"string",nullable:!0},redeemed_at:{type:"string",nullable:!0},expired:{type:"boolean"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"},gift_card_batch:{$ref:"#/components/schemas/GiftCardBatch"},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}}},required:["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":!0},ImportMapping:{type:"object",properties:{id:{type:"string"},schema_field:{type:"string"},file_column:{type:"string",nullable:!0},required:{type:"boolean"}},required:["id","schema_field","file_column","required"],"x-typelizer":!0},ImportRow:{type:"object",properties:{id:{type:"string"},row_number:{type:"number"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},validation_errors:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},import_id:{type:"string",nullable:!0},item_type:{type:"string",nullable:!0},item_id:{type:"string",nullable:!0},data:{type:"object"}},required:["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":!0},Import:{type:"object",properties:{id:{type:"string"},number:{type:"string"},rows_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0,description:"Import type. Built-in: products, product_translations, customers, price_list_prices. Extensions may register more."},status:{anyOf:[{type:"string",enum:["pending","mapping","completed_mapping","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},processing_errors:{type:"string",nullable:!0},preferred_delimiter:{type:"string"},price_list_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},original_filename:{type:"string",nullable:!0},original_byte_size:{type:"number",nullable:!0},original_file_url:{type:"string",nullable:!0},completed_rows_count:{type:"number"},failed_rows_count:{type:"number"},schema_fields:{type:"array",items:{$ref:"#/components/schemas/ImportSchemaField"}},csv_headers:{type:"array",items:{type:"string"}},sample_row:{type:"object"},mappings:{type:"array",items:{$ref:"#/components/schemas/ImportMapping"}}},required:["id","number","rows_count","created_at","updated_at","type","status","store_id","seller_id","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","price_list_id","seller_name","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":!0},Integration:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Integration type, registered by the provider gem that owns it (for example the EasyPost provider). Core ships none."},group:{type:"string",nullable:!0},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":!0},Invitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},created_at:{type:"string"},updated_at:{type:"string"},expires_at:{type:"string"},role_id:{type:"string"},role_name:{type:"string"},inviter_email:{type:"string"},acceptance_url:{type:"string"},invitee_exists:{type:"boolean"},store:{type:"object"}},required:["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":!0},LineItem:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string"},seller_id:{type:"string",nullable:!0},preorder:{type:"boolean"},preorder_ships_at:{type:"string",nullable:!0},quantity:{type:"number"},currency:{type:"string"},name:{type:"string"},slug:{type:"string"},options_text:{type:"string"},price:{type:"string"},display_price:{type:"string"},total:{type:"string"},display_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},discounted_amount:{type:"string"},display_discounted_amount:{type:"string"},display_compare_at_amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},digital_links:{type:"array",items:{$ref:"#/components/schemas/DigitalLink"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},price_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},catalog_price:{type:"string",nullable:!0},cost_price:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},tax_category:{$ref:"#/components/schemas/TaxCategory"}},required:["id","variant_id","seller_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","price_source","created_at","updated_at","catalog_price","cost_price","tax_category_id"],"x-typelizer":!0},Market:{type:"object",properties:{id:{type:"string"},name:{type:"string"},currency:{type:"string"},default_locale:{type:"string"},tax_inclusive:{type:"boolean"},default:{type:"boolean"},country_codes:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},tax_provider:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","currency","default_locale","tax_inclusive","default","country_codes","supported_locales","tax_provider","created_at","updated_at"],"x-typelizer":!0},Media:{type:"object",properties:{id:{type:"string"},product_id:{type:"string",nullable:!0},variant_ids:{type:"array",items:{type:"string"}},position:{type:"number"},alt:{type:"string",nullable:!0},media_type:{type:"string",enum:["image","video","external_video"]},focal_point_x:{type:"number",nullable:!0},focal_point_y:{type:"number",nullable:!0},external_video_url:{type:"string",nullable:!0},video_provider:{type:"string",nullable:!0},video_embed_url:{type:"string",nullable:!0},video_url:{type:"string",nullable:!0},poster_url:{type:"string",nullable:!0},original_url:{type:"string",nullable:!0},mini_url:{type:"string",nullable:!0},small_url:{type:"string",nullable:!0},medium_url:{type:"string",nullable:!0},large_url:{type:"string",nullable:!0},xlarge_url:{type:"string",nullable:!0},og_image_url:{type:"string",nullable:!0},external_references:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},attached:{type:"boolean"},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},embed_url:{type:"string",nullable:!0},signed_id:{type:"string",nullable:!0},viewable_id:{type:"string",nullable:!0},download_url:{type:"string",nullable:!0},metadata:{type:"object"},viewable_type:{type:"string",nullable:!0}},required:["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","video_provider","video_embed_url","video_url","poster_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","external_references","created_at","updated_at","attached","filename","content_type","byte_size","embed_url","signed_id","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":!0},MembershipProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0}},required:["id","name","thumbnail_url"],"x-typelizer":!0},NewsletterSubscriber:{type:"object",properties:{id:{type:"string"},email:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},verified:{type:"boolean"},verified_at:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0}},required:["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":!0},OptionType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},kind:{type:"string",enum:["dropdown","color_swatch","buttons"]},translations:{type:"object"},metadata:{type:"object"},filterable:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":!0},OptionValue:{type:"object",properties:{id:{type:"string"},option_type_id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},color_code:{type:"string",nullable:!0},option_type_name:{type:"string"},option_type_label:{type:"string"},image_url:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},option_type:{$ref:"#/components/schemas/OptionType"}},required:["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":!0},OrderCancellationReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},OrderGroup:{type:"object",properties:{id:{type:"string"},number:{type:"string"},email:{type:"string",nullable:!0},currency:{type:"string"},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},seller_count:{type:"number"},includes_first_party:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}}},required:["id","number","email","currency","total","display_total","item_total","display_item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","created_at","updated_at","payments"],"x-typelizer":!0},OrderRoutingRule:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: preferred_location, default_location, minimize_splits. Extensions may register more."},channel_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema"],"x-typelizer":!0},Order:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},withdrawal_period_ends_at:{type:"string",nullable:!0},within_withdrawal_period:{type:"boolean"},cart_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},email:{type:"string"},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},coupon_code:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},item_total:{type:"string"},display_item_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},total:{type:"string"},display_total:{type:"string"},gift_card_total:{type:"string"},display_gift_card_total:{type:"string"},amount_due:{type:"string"},display_amount_due:{type:"string"},delivery_total:{type:"string"},display_delivery_total:{type:"string"},fee_total:{type:"string"},display_fee_total:{type:"string"},store_credit_total:{type:"string"},display_store_credit_total:{type:"string"},covered_by_store_credit:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},fulfillments:{type:"array",items:{$ref:"#/components/schemas/Fulfillment"}},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},gift_card:{allOf:[{$ref:"#/components/schemas/GiftCard"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},external_references:{type:"object"},status:{type:"string",enum:["draft","placed","canceled"]},last_ip_address:{type:"string",nullable:!0},considered_risky:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},payment_total:{type:"string"},display_payment_total:{type:"string"},metadata:{type:"object"},cancel_note:{type:"string",nullable:!0},commission_amount_total:{type:"string"},display_commission_amount_total:{type:"string"},commission_tax_total:{type:"string"},display_commission_tax_total:{type:"string"},commission_total:{type:"string"},display_commission_total:{type:"string"},canceled_at:{type:"string",nullable:!0},approved_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_stock_location_id:{type:"string",nullable:!0},po_document_url:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},order_group_id:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},approver_id:{type:"string",nullable:!0},canceler_id:{type:"string",nullable:!0},cancel_reason_id:{type:"string",nullable:!0},cancel_reason_name:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}},cart:{$ref:"#/components/schemas/Cart"},channel:{$ref:"#/components/schemas/Channel"},preferred_stock_location:{$ref:"#/components/schemas/StockLocation"},payment_methods:{type:"array",items:{$ref:"#/components/schemas/PaymentMethod"}},customer:{$ref:"#/components/schemas/Customer"},approver:{$ref:"#/components/schemas/AdminUser"},canceler:{$ref:"#/components/schemas/AdminUser"},cancel_reason:{$ref:"#/components/schemas/OrderCancellationReason"},created_by:{$ref:"#/components/schemas/AdminUser"},returns:{type:"array",items:{$ref:"#/components/schemas/Return"}},exchanges:{type:"array",items:{$ref:"#/components/schemas/Exchange"}},claims:{type:"array",items:{$ref:"#/components/schemas/Claim"}},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0}},required:["id","market_id","withdrawal_period_ends_at","within_withdrawal_period","cart_id","channel_id","company_id","company_name","po_document_filename","po_document_byte_size","number","email","customer_note","po_number","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","external_references","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","cancel_note","commission_amount_total","display_commission_amount_total","commission_tax_total","display_commission_tax_total","commission_total","display_commission_total","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","po_document_url","seller_id","order_group_id","tags","internal_note","internal_note_html","approver_id","canceler_id","cancel_reason_id","cancel_reason_name","created_by_id","customer_id","freight_summary"],"x-typelizer":!0},PackageType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["box","envelope","carton","pallet","container"]},length:{type:"string",nullable:!0},width:{type:"string",nullable:!0},height:{type:"string",nullable:!0},weight:{type:"string",nullable:!0},max_weight:{type:"string",nullable:!0},default:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},volume:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0}},required:["id","name","kind","length","width","height","weight","max_weight","default","metadata","created_at","updated_at","dimensions_unit","weight_unit","volume","seller_id","seller_name"],"x-typelizer":!0},PaymentMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},type:{type:"string",description:"Payment method type. Built-in: check, store_credit, custom_payment_source_method, bogus (test only); payment provider gems register their own, for example stripe."},session_required:{type:"boolean"},source_required:{type:"boolean"},metadata:{type:"object"},active:{type:"boolean"},auto_capture:{type:"boolean",nullable:!0},capture_method:{type:"string",enum:["checkout","on_dispatch","manual"],nullable:!0},resolved_capture_method:{type:"string",enum:["checkout","on_dispatch","manual"]},storefront_visible:{type:"boolean"},position:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","description","type","session_required","source_required","metadata","active","auto_capture","capture_method","resolved_capture_method","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":!0},Payment:{type:"object",properties:{id:{type:"string"},payment_method_id:{type:"string"},response_code:{type:"string",nullable:!0},number:{type:"string"},status:{anyOf:[{type:"string",enum:["checkout","processing","pending","completed","failed","void","invalid"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},amount:{type:"string"},display_amount:{type:"string"},source_type:{type:"string",nullable:!0,enum:["credit_card","store_credit","payment_source"]},source_id:{type:"string",nullable:!0},source:{anyOf:[{$ref:"#/components/schemas/CreditCard"},{$ref:"#/components/schemas/StoreCredit"},{$ref:"#/components/schemas/PaymentSource"}],nullable:!0},payment_method:{$ref:"#/components/schemas/PaymentMethod"},metadata:{type:"object"},avs_response:{type:"string",nullable:!0},cvv_response_code:{type:"string",nullable:!0},cvv_response_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},captured_amount:{type:"string"},order_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}}},required:["id","payment_method_id","response_code","number","status","amount","display_amount","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":!0},PaymentSource:{type:"object",properties:{id:{type:"string"},gateway_payment_profile_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":!0},PaymentSplit:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},authorized_amount:{type:"string"},display_authorized_amount:{type:"string"},captured_amount:{type:"string"},display_captured_amount:{type:"string"},refunded_amount:{type:"string"},display_refunded_amount:{type:"string"},claimed_amount:{type:"string"},display_claimed_amount:{type:"string"},net_captured_amount:{type:"string"},display_net_captured_amount:{type:"string"},refundable_amount:{type:"string"},display_refundable_amount:{type:"string"},payment_id:{type:"string"},payment_number:{type:"string",nullable:!0},order_id:{type:"string"},order_number:{type:"string",nullable:!0}},required:["id","currency","created_at","updated_at","authorized_amount","display_authorized_amount","captured_amount","display_captured_amount","refunded_amount","display_refunded_amount","claimed_amount","display_claimed_amount","net_captured_amount","display_net_captured_amount","refundable_amount","display_refundable_amount","payment_id","payment_number","order_id","order_number"],"x-typelizer":!0},Permission:{type:"object",properties:{key:{type:"string"},resource:{type:"string"},kind:{type:"string",enum:["read","write"]},group:{type:"string"},group_label:{type:"string"},label:{type:"string"},description:{type:"string"}},required:["key","resource","kind","group","group_label","label","description"],"x-typelizer":!0},Policy:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},body:{type:"string",nullable:!0},body_html:{type:"string",nullable:!0},updated_at:{type:"string"},created_at:{type:"string"}},required:["id","name","slug","body","body_html","updated_at","created_at"],"x-typelizer":!0},PriceAdjustmentTier:{type:"object",properties:{id:{type:"string"},min_quantity:{type:"number"},percentage:{type:"string"}},required:["id","min_quantity","percentage"],"x-typelizer":!0},PriceHistory:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_in_cents:{type:"number"},currency:{type:"string"},display_amount:{type:"string"},recorded_at:{type:"string"},variant_id:{type:"string"},price_id:{type:"string"},compare_at_amount:{type:"string",nullable:!0},created_at:{type:"string"}},required:["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":!0},PriceListProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},price_list_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},PriceList:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["draft","active","inactive","scheduled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},position:{type:"number"},match_policy:{type:"string",enum:["all","any"]},adjust_compare_at:{type:"boolean"},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},price_adjustment_percentage:{type:"string",nullable:!0},automatic_pricing:{type:"boolean"},currently_active:{type:"boolean"},products_count:{type:"number"},prices_count:{type:"number"},price_adjustment_tiers:{type:"array",items:{$ref:"#/components/schemas/PriceAdjustmentTier"}},price_rules:{type:"array",items:{$ref:"#/components/schemas/PriceRule"}}},required:["id","name","description","status","position","match_policy","adjust_compare_at","starts_at","ends_at","deleted_at","created_at","updated_at","price_adjustment_percentage","automatic_pricing","currently_active","products_count","prices_count","price_adjustment_tiers"],"x-typelizer":!0},PriceRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: channel_rule, customer_group_rule, market_rule, user_rule, volume_rule, zone_rule. Extensions may register more."},price_list_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","created_at","updated_at","type","price_list_id","preferences","preference_schema"],"x-typelizer":!0},Price:{type:"object",properties:{id:{type:"string"},amount:{type:"string",nullable:!0},amount_in_cents:{type:"number",nullable:!0},compare_at_amount:{type:"string",nullable:!0},compare_at_amount_in_cents:{type:"number",nullable:!0},currency:{type:"string",nullable:!0},display_amount:{type:"string",nullable:!0},display_compare_at_amount:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},min_quantity:{type:"number"},variant_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","min_quantity","variant_id","created_at","updated_at"],"x-typelizer":!0},ProductPublication:{type:"object",properties:{id:{type:"string"},published_at:{type:"string",nullable:!0},unpublished_at:{type:"string",nullable:!0},product_id:{type:"string"},channel_id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":!0},Product:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},variant_count:{type:"number"},available_on:{type:"string",nullable:!0},preorder_ships_at:{type:"string",nullable:!0},purchasable:{type:"boolean"},preorder:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},available:{type:"boolean"},description:{type:"string",nullable:!0},description_html:{type:"string",nullable:!0},default_variant_id:{type:"string"},buy_box_variant_id:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},variants:{type:"array",items:{$ref:"#/components/schemas/Variant"}},default_variant:{$ref:"#/components/schemas/Variant"},option_types:{type:"array",items:{$ref:"#/components/schemas/OptionType"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},translations:{type:"object"},status:{anyOf:[{type:"string",enum:["draft","active","archived","proposed","rejected"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},metadata:{type:"object"},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},submission:{allOf:[{$ref:"#/components/schemas/ProductSubmission"}],nullable:!0},seller_name:{type:"string",nullable:!0},product_type_id:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},digital_assets:{type:"array",items:{$ref:"#/components/schemas/DigitalAsset"}},collections:{type:"array",items:{$ref:"#/components/schemas/Collection"}},product_publications:{type:"array",items:{$ref:"#/components/schemas/ProductPublication"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},product_type:{$ref:"#/components/schemas/ProductType"}},required:["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","buy_box_variant_id","thumbnail_url","tags","price","original_price","seller_id","external_references","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","seller_name","product_type_id","tax_category_id"],"x-typelizer":!0},ProductSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","approved","rejected","withdrawn"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},review_note:{type:"string",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},product_id:{type:"string"},metadata:{type:"object",nullable:!0},updated_at:{type:"string"},submitted_by_id:{type:"string",nullable:!0},reviewed_by_id:{type:"string",nullable:!0},reviewed_by_name:{type:"string",nullable:!0},auto_approved:{type:"boolean"}},required:["id","status","review_note","reviewed_at","created_at","product_id","metadata","updated_at","submitted_by_id","reviewed_by_id","reviewed_by_name","auto_approved"],"x-typelizer":!0},ProductTypeCustomFieldDefinition:{type:"object",properties:{id:{type:"string"},key:{type:"string"},namespace:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},required:{type:"boolean"},sort_order:{type:"number"}},required:["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":!0},ProductType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},translations:{type:"object"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},option_type_ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}},custom_field_definitions:{type:"array",items:{$ref:"#/components/schemas/ProductTypeCustomFieldDefinition"}}},required:["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":!0},PromotionAction:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Action type. Built-in: create_adjustment, create_item_adjustments, create_line_items, free_shipping. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},calculator:{allOf:[{$ref:"#/components/schemas/PromotionActionCalculator"}],nullable:!0},line_items:{type:"array",items:{$ref:"#/components/schemas/PromotionActionLineItem"},nullable:!0}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","calculator","line_items"],"x-typelizer":!0},PromotionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: currency, country, channel, market, item_total, product, customer, customer_group, first_order, customer_logged_in, one_use_per_user, category, option_value. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},product_ids:{type:"array",items:{type:"string"},nullable:!0},category_ids:{type:"array",items:{type:"string"},nullable:!0},customer_ids:{type:"array",items:{type:"string"},nullable:!0},option_value_ids:{type:"array",items:{type:"string"},nullable:!0},products:{type:"array",items:{$ref:"#/components/schemas/Product"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","product_ids","category_ids","customer_ids","option_value_ids"],"x-typelizer":!0},Promotion:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},usage_limit:{type:"number",nullable:!0},match_policy:{type:"string",enum:["all","any"]},path:{type:"string",nullable:!0},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"number",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},action_ids:{type:"array",items:{type:"string"}},rule_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":!0},PurchaseOrderItem:{type:"object",properties:{id:{type:"string"},quantity_ordered:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},currency:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},unit_cost:{type:"string"},total_cost:{type:"string"},display_unit_cost:{type:"string"},display_total_cost:{type:"string"},purchase_order_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_ordered","quantity_received","quantity_rejected","quantity_over","outstanding","currency","created_at","updated_at","unit_cost","total_cost","display_unit_cost","display_total_cost","purchase_order_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},PurchaseOrder:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{type:"string"},currency:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},ordered_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},expected_at:{type:"string",nullable:!0},cancel_by:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_ordered_total:{type:"number"},editable:{type:"boolean"},subtotal:{type:"string"},display_subtotal:{type:"string"},supplier_id:{type:"string",nullable:!0},destination_location_id:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/PurchaseOrderItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},supplier:{$ref:"#/components/schemas/Supplier"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","status","currency","reference","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","ordered_at","received_at","closed_short_at","created_at","updated_at","expected_at","cancel_by","closed_short","quantity_ordered_total","editable","subtotal","display_subtotal","supplier_id","destination_location_id"],"x-typelizer":!0},RefundReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Refund:{type:"object",properties:{id:{type:"string"},transaction_id:{type:"string",nullable:!0},amount:{type:"string",nullable:!0},payment_id:{type:"string",nullable:!0},refund_reason_id:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},payment:{$ref:"#/components/schemas/Payment"}},required:["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at"],"x-typelizer":!0},ReturnLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},line_item:{$ref:"#/components/schemas/LineItem"}},required:["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},ReturnReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Return:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","refunded","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},refunded_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},return_line_items:{type:"array",items:{$ref:"#/components/schemas/ReturnLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},refunded_total:{type:"string"},refundable_total:{type:"string"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}}},required:["id","number","status","order_id","reason_id","refund_total","display_refund_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","refunded_total","refundable_total","documents","labels","deliveries"],"x-typelizer":!0},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},permissions:{type:"array",items:{type:"string"}},mutable:{type:"boolean"},users_count:{type:"number"}},required:["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":!0},SavedReport:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},query:{type:"object"},seeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},user_id:{type:"string",nullable:!0},author_name:{type:"string",nullable:!0}},required:["id","name","description","query","seeded","created_at","updated_at","user_id","author_name"],"x-typelizer":!0},SellerBalance:{type:"object",properties:{currency:{type:"string"},seller_id:{type:"string"},earned:{type:"string"},display_earned:{type:"string"},paid:{type:"string"},display_paid:{type:"string"},balance:{type:"string"},display_balance:{type:"string"},pending:{type:"string"},display_pending:{type:"string"}},required:["currency","seller_id","earned","display_earned","paid","display_paid","balance","display_balance","pending","display_pending"],"x-typelizer":!0},SellerPayout:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},provider:{type:"string",description:"Payout provider class name. Built-in: Spree::PayoutProvider::System. Provider gems register more."},reference:{type:"string",nullable:!0},metadata:{type:"object"},period_start:{type:"string",nullable:!0},period_end:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},seller_id:{type:"string"},seller_name:{type:"string",nullable:!0},transfers_count:{type:"number"}},required:["id","status","currency","provider","reference","metadata","period_start","period_end","created_at","updated_at","amount","display_amount","seller_id","seller_name","transfers_count"],"x-typelizer":!0},SellerRequirement:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},required:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},preferences:{type:"object"},custom_field_definition_ids:{type:"array",items:{type:"string"}},allow_multiple:{type:"boolean"},accepts_submissions:{type:"boolean"},reviewed_by_operator:{type:"boolean"}},required:["id","position","active","required","metadata","created_at","updated_at","kind","name","description","preferences","custom_field_definition_ids","allow_multiple","accepts_submissions","reviewed_by_operator"],"x-typelizer":!0},SellerRequirementStatus:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},required:{type:"boolean"},position:{type:"number"},status:{type:"string",enum:["complete","incomplete","pending","rejected"]},action_url:{type:"string",nullable:!0},blocker:{type:"object",nullable:!0},blocking:{type:"boolean"},required_policy_name:{type:"string",nullable:!0},submission:{$ref:"#/components/schemas/SellerRequirementSubmission"},published_policy:{$ref:"#/components/schemas/Policy"}},required:["id","kind","name","description","required","position","status","action_url","blocker","blocking","required_policy_name"],"x-typelizer":!0},SellerRequirementSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted","rejected","waived"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},note:{type:"string",nullable:!0},review_note:{type:"string",nullable:!0},reference:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string"},requirement_id:{type:"string"},requirement_name:{type:"string"},file_url:{type:"string",nullable:!0},file_name:{type:"string",nullable:!0}},required:["id","status","note","review_note","reference","metadata","reviewed_at","created_at","updated_at","seller_id","requirement_id","requirement_name","file_url","file_name"],"x-typelizer":!0},Seller:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},about:{type:"string"},about_html:{type:"string"},logo_url:{type:"string",nullable:!0},square_logo_url:{type:"string",nullable:!0},cover_photo_url:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["pending","invited","canceled","onboarding","ready_for_review","approved","rejected","suspended"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},contact_email:{type:"string",nullable:!0},billing_email:{type:"string",nullable:!0},tax_remittance:{type:"string"},payouts_schedule_interval:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},holiday_mode_until:{type:"string",nullable:!0},terms_accepted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},minimum_payout_amount:{type:"string",nullable:!0},on_holiday:{type:"boolean"},sellable:{type:"boolean"},products_count:{type:"number"},users_count:{type:"number"},onboarding_progress:{type:"object"},onboarding_complete:{type:"boolean"},legal_name:{type:"string",nullable:!0},registration_number:{type:"string",nullable:!0},billing_address:{$ref:"#/components/schemas/Address"},returns_address:{$ref:"#/components/schemas/Address"}},required:["id","name","slug","about","about_html","logo_url","square_logo_url","cover_photo_url","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","on_holiday","sellable","products_count","users_count","onboarding_progress","onboarding_complete","legal_name","registration_number"],"x-typelizer":!0},SellerTeamMember:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0}},required:["id","email","first_name","last_name","full_name","created_at","updated_at","avatar_url"],"x-typelizer":!0},SellerTransfer:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["earning","refund_reversal"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},provider:{type:"string",description:"Payout provider class name. Built-in: Spree::PayoutProvider::System. Provider gems register more."},reference:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},seller_id:{type:"string"},order_id:{type:"string",nullable:!0},payout_id:{type:"string",nullable:!0},reversed_from_id:{type:"string",nullable:!0},refund_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0}},required:["id","kind","status","currency","provider","reference","metadata","created_at","updated_at","amount","display_amount","seller_id","order_id","payout_id","reversed_from_id","refund_id","seller_name","order_number"],"x-typelizer":!0},SetupTask:{type:"object",properties:{name:{type:"string"},done:{type:"boolean"}},required:["name","done"],"x-typelizer":!0},ShippingLabel:{type:"object",properties:{id:{type:"string"},source:{type:"string",enum:["purchased","uploaded"]},status:{anyOf:[{type:"string",enum:["purchased","refund_requested","refunded"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},tracking_number:{type:"string",nullable:!0},currency:{type:"string",nullable:!0},format:{type:"string",nullable:!0},external_id:{type:"string",nullable:!0},metadata:{type:"object"},refunded_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},owner_id:{type:"string"},owner_type:{type:"string",enum:["Spree::Fulfillment","Spree::Return"]},cost:{type:"string"},display_cost:{type:"string"},integration_id:{type:"string",nullable:!0},file_pending:{type:"boolean"},download_url:{type:"string",nullable:!0}},required:["id","source","status","carrier","carrier_name","service","tracking_number","currency","format","external_id","metadata","refunded_at","created_at","updated_at","owner_id","owner_type","cost","display_cost","integration_id","file_pending","download_url"],"x-typelizer":!0},State:{type:"object",properties:{abbr:{type:"string"},name:{type:"string"}},required:["abbr","name"],"x-typelizer":!0},StockLevel:{type:"object",properties:{id:{type:"string"},count_on_hand:{type:"number"},backorderable:{type:"boolean"},stock_location_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},external_references:{type:"object"},metadata:{type:"object"},reserved_count:{type:"number"},incoming_count:{type:"number"},purchasable_count:{type:"number"},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_location_name:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},allocated_count:{type:"number"},available_count:{type:"number"},stock_location:{$ref:"#/components/schemas/StockLocation"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","count_on_hand","backorderable","stock_location_id","variant_id","external_references","metadata","reserved_count","incoming_count","purchasable_count","variant_name","variant_sku","created_at","updated_at","stock_location_name","product_id","options_text","thumbnail_url","allocated_count","available_count"],"x-typelizer":!0},StockLocation:{type:"object",properties:{id:{type:"string"},name:{type:"string"},address1:{type:"string",nullable:!0},city:{type:"string",nullable:!0},zipcode:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},state_text:{type:"string",nullable:!0},pickup_ready_in_minutes:{type:"number",nullable:!0},pickup_instructions:{type:"string",nullable:!0},external_references:{type:"object"},admin_name:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},active:{type:"boolean"},default:{type:"boolean"},backorderable_default:{type:"boolean"},propagate_all_variants:{type:"boolean"},kind:{anyOf:[{type:"string",enum:["warehouse","store","fulfillment_center"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},pickup_enabled:{type:"boolean"},pickup_stock_policy:{type:"string",enum:["local","any"]},returns_enabled:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"}},required:["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","external_references","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","returns_enabled","created_at","updated_at","seller_id","seller_name"],"x-typelizer":!0},StockMovement:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},kind:{type:"string",nullable:!0,enum:["received","allocated","shipped","released","adjusted"]},reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_level_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},stock_location_name:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},return_id:{type:"string",nullable:!0},exchange_id:{type:"string",nullable:!0},stock_transfer_id:{type:"string",nullable:!0},stock_receipt_id:{type:"string",nullable:!0},purchase_order_id:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0},return_number:{type:"string",nullable:!0},exchange_number:{type:"string",nullable:!0},stock_transfer_number:{type:"string",nullable:!0},purchase_order_number:{type:"string",nullable:!0},unit_cost:{type:"string",nullable:!0},display_unit_cost:{type:"string",nullable:!0}},required:["id","quantity","kind","reason","created_at","updated_at","stock_level_id","stock_location_id","stock_location_name","variant_id","variant_name","variant_sku","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id","stock_receipt_id","purchase_order_id","order_number","return_number","exchange_number","stock_transfer_number","purchase_order_number","unit_cost","display_unit_cost"],"x-typelizer":!0},StockReceiptItem:{type:"object",properties:{id:{type:"string"},quantity_accepted:{type:"number"},quantity_rejected:{type:"number"},rejection_reason:{type:"string",nullable:!0,enum:["damaged","wrong_item","expired","other"]},notes:{type:"string",nullable:!0},line_type:{type:"string",enum:["purchase_order_item","stock_transfer_item"]},line_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_accepted","quantity_rejected","rejection_reason","notes","line_type","line_id","variant_id","product_id","variant_name","variant_sku","thumbnail_url"],"x-typelizer":!0},StockReceipt:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},quantity_accepted_total:{type:"number"},quantity_rejected_total:{type:"number"},received_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},receivable_type:{type:"string",enum:["purchase_order","stock_transfer"]},receivable_id:{type:"string"},received_by_id:{type:"string",nullable:!0},items_count:{type:"number"},items:{type:"array",items:{$ref:"#/components/schemas/StockReceiptItem"}}},required:["id","number","reference","notes","metadata","quantity_accepted_total","quantity_rejected_total","received_at","created_at","updated_at","receivable_type","receivable_id","received_by_id","items_count"],"x-typelizer":!0},StockReservation:{type:"object",properties:{id:{type:"string"},stock_level_id:{type:"string"},line_item_id:{type:"string"},order_id:{type:"string"},variant_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},quantity:{type:"number"},expires_at:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","stock_level_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":!0},StockTransferItem:{type:"object",properties:{id:{type:"string"},quantity_shipped:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},stock_transfer_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_shipped","quantity_received","quantity_rejected","quantity_over","outstanding","created_at","updated_at","stock_transfer_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},StockTransfer:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},source_location_id:{type:"string"},destination_location_id:{type:"string"},status:{type:"string"},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},shipped_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_shipped_total:{type:"number"},editable:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/StockTransferItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},source_location:{$ref:"#/components/schemas/StockLocation"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","reference","created_at","updated_at","source_location_id","destination_location_id","status","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","shipped_at","received_at","closed_short_at","deleted_at","closed_short","quantity_shipped_total","editable"],"x-typelizer":!0},StoreCreditEvent:{type:"object",properties:{id:{type:"string"},action:{type:"string"},authorization_code:{type:"string",nullable:!0},display_action:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},store_credit_id:{type:"string"},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0}},required:["id","action","authorization_code","display_action","amount","display_amount","created_at","updated_at","store_credit_id","originator_type","originator_id"],"x-typelizer":!0},StoreCredit:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},currency:{type:"string"},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount_authorized:{type:"string"},outstanding:{type:"boolean"},display_amount_authorized:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"}},required:["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","amount_authorized","outstanding","display_amount_authorized","customer_id","created_by_id","originator_type","originator_id"],"x-typelizer":!0},Store:{type:"object",properties:{id:{type:"string"},metadata:{type:"object"},name:{type:"string"},code:{type:"string"},preferred_storefront_url:{type:"string",nullable:!0},default_currency:{type:"string"},default_locale:{type:"string"},default_country_code:{type:"string",nullable:!0},mail_from_address:{type:"string",nullable:!0},customer_support_email:{type:"string",nullable:!0},new_order_notifications_email:{type:"string",nullable:!0},preferred_send_consumer_transactional_emails:{type:"boolean"},preferred_admin_locale:{type:"string",nullable:!0},preferred_timezone:{type:"string"},preferred_weight_unit:{type:"string",enum:["g","kg","lb","oz"]},preferred_unit_system:{type:"string"},preferred_storefront_access:{type:"string"},preferred_guest_checkout:{type:"boolean"},preferred_company_field_enabled:{type:"boolean"},preferred_address_requires_company:{type:"boolean"},preferred_address_requires_phone:{type:"boolean"},preferred_capture_method:{type:"string"},preferred_track_inventory_levels:{type:"boolean"},preferred_stock_reservations_enabled:{type:"boolean"},preferred_low_stock_threshold:{type:"number"},preferred_tax_using_ship_address:{type:"boolean"},preferred_track_price_history:{type:"boolean"},preferred_show_products_without_price:{type:"boolean"},preferred_disable_sku_validation:{type:"boolean"},preferred_order_routing_strategy:{type:"string"},preferred_pricing_provider:{type:"string"},preferred_inventory_provider:{type:"string"},preferred_pricing_provider_failure_policy:{type:"string"},preferred_inventory_provider_failure_policy:{type:"string"},preferred_payout_provider:{type:"string",nullable:!0},preferred_default_payouts_schedule_interval:{type:"string"},preferred_default_minimum_payout_amount:{type:"number"},preferred_document_number_format:{type:"string"},preferred_order_number_prefix:{type:"string"},preferred_order_number_suffix:{type:"string"},preferred_order_number_sequence_start:{type:"number"},preferred_limit_digital_download_count:{type:"boolean"},preferred_digital_asset_authorized_clicks:{type:"number"},preferred_limit_digital_download_days:{type:"boolean"},preferred_digital_asset_authorized_days:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},order_number_sequence_started:{type:"boolean"},url:{type:"string"},api_url:{type:"string"},setup_tasks:{type:"array",items:{$ref:"#/components/schemas/SetupTask"}},supported_currencies:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},available_locales:{type:"array",items:{type:"string"}},logo_url:{type:"string",nullable:!0},mailer_logo_url:{type:"string",nullable:!0}},required:["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","default_country_code","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_low_stock_threshold","preferred_tax_using_ship_address","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_order_routing_strategy","preferred_pricing_provider","preferred_inventory_provider","preferred_pricing_provider_failure_policy","preferred_inventory_provider_failure_policy","preferred_payout_provider","preferred_default_payouts_schedule_interval","preferred_default_minimum_payout_amount","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","preferred_limit_digital_download_count","preferred_digital_asset_authorized_clicks","preferred_limit_digital_download_days","preferred_digital_asset_authorized_days","created_at","updated_at","order_number_sequence_started","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":!0},Supplier:{type:"object",properties:{id:{type:"string"},name:{type:"string"},contact_name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},city:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},purchase_orders_count:{type:"number"},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},can_be_deleted:{type:"boolean"}},required:["id","name","contact_name","email","phone","notes","address1","address2","city","state_name","state_code","country_code","postal_code","purchase_orders_count","metadata","created_at","updated_at","deleted_at","can_be_deleted"],"x-typelizer":!0},TaxCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},tax_code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},is_default:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":!0},TaxExemptionCertificate:{type:"object",properties:{id:{type:"string"},certificate_number:{type:"string"},reason_code:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","verified","expired","revoked"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},issuing_authority:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},issued_at:{type:"string"},expires_at:{type:"string"},verified_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},company_id:{type:"string"},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},active:{type:"boolean"},lapsed:{type:"boolean"},can_be_deleted:{type:"boolean"},document_filename:{type:"string",nullable:!0},document_byte_size:{type:"number",nullable:!0},document_url:{type:"string",nullable:!0}},required:["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":!0},TaxIdentifier:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Tax identifier kind, keyed to a registered validator. Built-in: eu_vat. Extensions may register more."},value:{type:"string"},validation_status:{type:"string",nullable:!0,enum:["pending","verified","unverified","unavailable","unsupported"]},validation_evidence:{type:"object",nullable:!0},source:{type:"string",nullable:!0,enum:["override","company","customer"]},validated_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},validatable:{type:"boolean"},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0}},required:["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"x-typelizer":!0},TaxLine:{type:"object",properties:{id:{type:"string"},label:{type:"string"},included:{type:"boolean"},rate:{type:"string"},tax_rate_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},fee_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},provider_id:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},data:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","included","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","amount","display_amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at"],"x-typelizer":!0},TaxRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},included_in_price:{type:"boolean"},show_rate_in_label:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},amount:{type:"string"},amount_percentage:{type:"number",nullable:!0},tax_category_id:{type:"string",nullable:!0},store_id:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0}},required:["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"x-typelizer":!0},Variant:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},sku:{type:"string",nullable:!0},options_text:{type:"string"},track_inventory:{type:"boolean"},media_count:{type:"number"},preorder_ships_at:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},preorder:{type:"boolean"},weight:{type:"number",nullable:!0},height:{type:"number",nullable:!0},width:{type:"number",nullable:!0},depth:{type:"number",nullable:!0},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},purchase_unit:{type:"string",nullable:!0,enum:["unit","carton"]},units_per_carton:{type:"number",nullable:!0},price:{$ref:"#/components/schemas/Price"},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},metadata:{type:"object"},position:{type:"number"},cost_price:{type:"string",nullable:!0},cost_currency:{type:"string",nullable:!0},barcode:{type:"string",nullable:!0},backorder_limit:{type:"number",nullable:!0},hs_code:{type:"string",nullable:!0},country_of_origin:{type:"string",nullable:!0},customs_description:{type:"string",nullable:!0},carton_weight:{type:"string",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preorderable:{type:"boolean"},tax_category_id:{type:"string",nullable:!0},carton_package_type_id:{type:"string",nullable:!0},units_per_pallet:{type:"number",nullable:!0},available_stock:{type:"number",nullable:!0},reserved_quantity:{type:"number"},total_on_hand:{type:"number",nullable:!0},product_name:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},prices:{type:"array",items:{$ref:"#/components/schemas/Price"}},stock_levels:{type:"array",items:{$ref:"#/components/schemas/StockLevel"}}},required:["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","weight_unit","dimensions_unit","minimum_order_quantity","order_multiple","purchase_unit","units_per_carton","price","original_price","seller_id","option_values","external_references","metadata","position","cost_price","cost_currency","barcode","backorder_limit","hs_code","country_of_origin","customs_description","carton_weight","cartons_per_pallet","deleted_at","created_at","updated_at","preorderable","tax_category_id","carton_package_type_id","units_per_pallet","available_stock","reserved_quantity","total_on_hand","product_name","delivery_profile_id"],"x-typelizer":!0},WebhookDelivery:{type:"object",properties:{id:{type:"string"},event_name:{type:"string"},event_id:{type:"string",nullable:!0},response_code:{type:"number",nullable:!0},execution_time:{type:"number",nullable:!0},error_type:{type:"string",nullable:!0},request_errors:{type:"string",nullable:!0},response_body:{type:"string",nullable:!0},success:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivered_at:{type:"string",nullable:!0},payload:{type:"object"},webhook_endpoint_id:{type:"string"},webhook_endpoint_url:{type:"string"}},required:["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":!0},WebhookEndpoint:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},url:{type:"string"},active:{type:"boolean"},subscriptions:{type:"array",items:{type:"string"}},disabled_reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},disabled_at:{type:"string",nullable:!0},secret_key:{type:"string",nullable:!0},last_delivery_at:{type:"string",nullable:!0},recent_delivery_count:{type:"number"},recent_failure_count:{type:"number"},total_delivery_count:{type:"number"},successful_delivery_count:{type:"number"},failed_delivery_count:{type:"number"}},required:["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":!0}}}};var rh=new Set(["get","post","put","patch","delete"]);function Tn(){return eh}function m0(e){let t=e.description?.match(/\*\*Required scope:\*\* (.+?) \(for API-key authentication\)\./);return t?t[1].replaceAll("`",""):"\u2014"}function ih(e,t={}){let r=[];for(let[i,n]of Object.entries(e.paths)){let s=i.replace("/api/v3/admin","")||"/";for(let[a,o]of Object.entries(n)){if(!rh.has(a))continue;if(t.resource){let d=s.split("/")[1]??"";if(d!==t.resource&&!d.startsWith(t.resource))continue}let p=o.summary??"";t.search&&!`${a} ${s} ${p}`.toLowerCase().includes(t.search.toLowerCase())||r.push({method:a.toUpperCase(),path:s,scope:m0(o),summary:p})}}return r}function nh(e,t){let r=t.trim().split(/\s+/),i=r.length>1?r[0].toLowerCase():void 0,n=r.length>1?r[1]:r[0],s=Br(n),a=th(e,i,o=>o===s);return a.length>0?a:th(e,i,o=>h0(o,s))}function th(e,t,r){let i=[];for(let[n,s]of Object.entries(e.paths)){let a=n.replace("/api/v3/admin","")||"/";if(r(a))for(let[o,p]of Object.entries(s))rh.has(o)&&(t&&o!==t||i.push({method:o.toUpperCase(),path:a,summary:p.summary,description:p.description,parameters:tr(p.parameters,e),requestBody:tr(p.requestBody,e),responses:tr(p.responses,e)}))}return i}function h0(e,t){if(e===t)return!0;let r=e.split("/"),i=t.split("/");return r.length!==i.length?!1:r.every((n,s)=>n.startsWith("{")&&n.endsWith("}")?i[s].length>0:n===i[s])}var y0=8;function tr(e,t,r=[]){if(Array.isArray(e))return e.map(a=>tr(a,t,r));if(!e||typeof e!="object")return e;let i=e,n=i.$ref;if(typeof n=="string"){let a=n.replace("#/components/schemas/","");return r.includes(a)||r.length>=y0||!(a in t.components.schemas)?{$ref:n}:tr(t.components.schemas[a],t,[...r,a])}let s={};for(let[a,o]of Object.entries(i))s[a]=tr(o,t,r);return s}function g0(e,t){return[...t,e]}function ph(e){return e.option("--profile <name>","use a saved profile (see `spree auth`)").option("--base-url <url>","store URL (overrides profile/env/project)").option("--api-key <key>","secret API key (prefer SPREE_API_KEY \u2014 flags leak into shell history)").option("--store-id <id>","X-Spree-Store-Id for hosts serving multiple stores")}function ch(){return new Mo("--format <format>","output format").choices(["json","table"]).default("json")}function sh(e){return ph(e).addOption(ch())}async function ah(e){let t=await Pr({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile});return{client:jr({baseUrl:t.baseUrl,secretKey:t.apiKey,...e.storeId?{storeId:e.storeId}:{}}),credentials:t}}function dh(e){let t=e.command("api").description("Call the Admin API directly (generic get/post/patch/delete)");t.addHelpText("after",["","Examples:"," spree api get /products -q status_eq=active --limit 10",` spree api post /products -d '{"name":"Classic Tee","prices":[{"currency":"USD","amount":"29.99"}]}'`," spree api get /orders/ord_x8k2J9aQ --expand items,payments","","Discover the surface (offline, no server needed):"," spree api endpoints --search <term> # find endpoints + required scopes",' spree api schema "POST /orders" # request/response schema for one operation'," spree completion zsh # tab-completion for paths, filters, scopes"].join(`
879
- `)),sh(t.command("get <path>").description("GET an Admin API path, e.g. `spree api get /products -q status_eq=active`").option("-q, --query <expr>","Ransack predicate key=value (repeatable)",g0,[]).option("--sort <fields>","sort, e.g. -created_at").option("--page <n>","page number").option("--limit <n>","page size (max 100)").option("--expand <relations>","expand relations, e.g. variants,variants.prices").option("--fields <fields>","sparse fields, e.g. id,name")).action(async(r,i)=>{let n;try{let s=Zm(i),{client:a,credentials:o}=await ah(i);n=o.baseUrl;let p=await a.request("GET",Br(r),{params:s});Lr(p,i.format)}catch(s){Pt(s,{baseUrl:n})}});for(let r of["post","patch","delete"])sh(t.command(`${r} <path>`).description(`${r.toUpperCase()} an Admin API path`).option("-d, --data <json>","request body: inline JSON, @file, or '-' for stdin")).action(async(i,n)=>{let s;try{let a=await Ym(n.data),{client:o,credentials:p}=await ah(n);s=p.baseUrl;let d=await o.request(r.toUpperCase(),Br(i),{...a===_o?{}:{body:a}});Lr(d,n.format)}catch(a){Pt(a,{baseUrl:s})}});t.command("endpoints").description("List Admin API endpoints with their required scopes").option("--resource <name>","filter by first path segment, e.g. orders").option("--search <term>","filter by method, path, or summary").addOption(ch()).action(r=>{let i=ih(Tn(),{resource:r.resource,search:r.search});if(i.length===0){process.stderr.write(`No endpoints match.
880
- `),process.exitCode=1;return}if(r.format==="table"){(0,oh.printTable)(i.map(n=>({Method:n.method,Path:n.path,Scope:n.scope,Summary:n.summary})));return}Lr(i,"json")}),t.command("schema <operation>").description('Show the request/response schema for an operation, e.g. `spree api schema "POST /products"`').action(r=>{let i=nh(Tn(),r);if(i.length===0){process.stderr.write(`No operation matches "${r}". Try \`spree api endpoints --search ${r.split(/\s+/).pop()}\`.
881
- `),process.exitCode=1;return}let n=/\s/.test(r.trim());Lr(n&&i.length===1?i[0]:i,"json")}),ph(t.command("status").description("Show resolved credentials, server reachability, and the bundled spec version")).action(async r=>{try{let i=await Pr({baseUrl:r.baseUrl,apiKey:r.apiKey,profile:r.profile},{allowMint:!1}),n=await zr(i.baseUrl,i.apiKey),s=Tn(),a=Cn(n),o=[`${Re.default.bold("Base URL:")} ${i.baseUrl}`,`${Re.default.bold("Credentials:")} ${i.source}${i.profileName?` (${i.profileName})`:""}, key ${i.tokenPrefix}${Re.default.dim("\u2026")}`],p=n.status==="unreachable"||n.status==="unauthorized"?null:await Qm(i.baseUrl,i.apiKey);p!==null?o.push(`${Re.default.bold("Scopes:")} ${p.length?p.join(", "):Re.default.dim("(none)")}`):i.scopes?.length&&o.push(`${Re.default.bold("Scopes:")} ${i.scopes.join(", ")} ${Re.default.dim("(local snapshot from mint time \u2014 may be stale)")}`),o.push(`${Re.default.bold("Server:")} ${a}`),o.push(`${Re.default.bold("Bundled spec:")} ${s.info?.version??"unknown"} ${Re.default.dim("(spree api endpoints/schema reflect this snapshot, not the live server)")}`),process.stdout.write(`${o.join(`
878
+ **Required scope:** \`write_purchasing\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"204":{description:"supplier deleted"}}}}},components:{schemas:{PaginationMeta:{type:"object",properties:{page:{type:"integer"},limit:{type:"integer"},count:{type:"integer",description:"Total number of records"},pages:{type:"integer",description:"Total number of pages"},from:{type:"integer",description:"Index of first record on this page"},to:{type:"integer",description:"Index of last record on this page"},in:{type:"integer",description:"Number of records on this page"},previous:{type:"integer",nullable:!0,description:"Previous page number"},next:{type:"integer",nullable:!0,description:"Next page number"}},required:["page","limit","count","pages","from","to","in"]},ErrorResponse:{type:"object",properties:{error:{type:"object",properties:{code:{type:"string"},message:{type:"string"},details:{type:"object",description:"Field-specific validation errors",nullable:!0}},required:["code","message"]}},required:["error"]},AuthResponse:{type:"object",properties:{token:{type:"string",description:"JWT access token"},user:{$ref:"#/components/schemas/AdminUser"}},required:["token","user"]},PermissionRule:{type:"object",description:"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.",properties:{allow:{type:"boolean",description:"true for `can`, false for `cannot`"},actions:{type:"array",items:{type:"string"},description:'Action names, e.g. ["read", "update"] or ["manage"]'},subjects:{type:"array",items:{type:"string"},description:'Subject class names, e.g. ["Spree::Product"] or ["all"]'},has_conditions:{type:"boolean",description:"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},required:["allow","actions","subjects","has_conditions"]},ImportSchemaField:{type:"object",description:"A canonical column of an import type, including per-store custom field columns",properties:{name:{type:"string",description:"Canonical field name used in mappings"},label:{type:"string",description:"Human-readable label"},required:{type:"boolean",description:"Whether the field must be mapped before processing"}},required:["name","label","required"]},CheckoutRequirement:{type:"object",properties:{step:{type:"string",description:"Checkout step this requirement belongs to"},field:{type:"string",description:"Field that needs to be satisfied"},message:{type:"string",description:"Human-readable requirement message"}},required:["step","field","message"]},CartWarning:{type:"object",description:"A warning about a cart issue (e.g., item removed due to stock change)",properties:{code:{type:"string",description:"Machine-readable warning code"},message:{type:"string",description:"Human-readable warning message"},line_item_id:{type:"string",nullable:!0,description:"Prefixed line item ID (when applicable)"},variant_id:{type:"string",nullable:!0,description:"Prefixed variant ID (when applicable)"},item_index:{type:"integer",nullable:!0,description:"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},required:["code","message"]},FulfillmentManifestItem:{type:"object",description:"An item within a fulfillment \u2014 which line item and how many units are in this fulfillment",properties:{item_id:{type:"string",description:"Line item ID"},variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer",description:"Quantity in this fulfillment"}},required:["item_id","variant_id","quantity"]},AdminUserRoleAssignment:{type:"object",description:"A role assignment for the current store on a staff member",properties:{id:{type:"string",description:"Prefixed role ID"},name:{type:"string",description:"Role name"}},required:["id","name"]},AdminUserStore:{type:"object",description:"A store the staff member can access through a role assignment",properties:{id:{type:"string",description:"Prefixed store ID"},name:{type:"string",description:"Store name"},code:{type:"string",description:"Store code"}},required:["id","name","code"]},PreferenceField:{type:"object",description:"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.",properties:{key:{type:"string"},type:{type:"string",description:"string | text | password | integer | decimal | boolean | array | hash"},default:{description:"Default value (any JSON type), null when there is no default",nullable:!0}},required:["key","type"]},PromotionActionCalculator:{type:"object",description:"The action's nested calculator (when the action carries one \u2014 null for actions like `free_shipping`)",properties:{type:{type:"string",description:"Wire shorthand for the calculator subclass"},label:{type:"string"},preferences:{type:"object",additionalProperties:!0},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}}},required:["type","label","preferences","preference_schema"]},PromotionActionLineItem:{type:"object",description:"One row in a `create_line_items` action \u2014 the variant added to the order and how many",properties:{variant_id:{type:"string"},quantity:{type:"integer"}},required:["variant_id","quantity"]},MeResponse:{type:"object",description:"Current admin user profile and serialized permissions",properties:{user:{$ref:"#/components/schemas/AdminUser"},permissions:{type:"array",items:{$ref:"#/components/schemas/PermissionRule"}}},required:["user","permissions"]},Actor:{type:"object",properties:{id:{type:"string"},type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},label:{type:"string",nullable:!0}},required:["id","type","label"],"x-typelizer":!0},Address:{type:"object",properties:{id:{type:"string"},label:{type:"string",nullable:!0},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string"},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},city:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},country_name:{type:"string"},country_code:{type:"string"},state_text:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},quick_checkout:{type:"boolean"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"},state_abbr:{type:"string",nullable:!0},country_iso:{type:"string"},state_name:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},latitude:{type:"number",nullable:!0},longitude:{type:"number",nullable:!0},customer_id:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0}},required:["id","label","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","metadata","created_at","updated_at","latitude","longitude","customer_id","owner_id","owner_type"],"x-typelizer":!0},AdminUser:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},selected_locale:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0},roles:{type:"array",items:{$ref:"#/components/schemas/AdminUserRoleAssignment"}},stores:{type:"array",items:{$ref:"#/components/schemas/AdminUserStore"}}},required:["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":!0},AllowedOrigin:{type:"object",properties:{id:{type:"string"},origin:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","origin","created_at","updated_at"],"x-typelizer":!0},ApiKey:{type:"object",properties:{id:{type:"string"},name:{type:"string"},key_type:{type:"string",enum:["publishable","secret"]},token_prefix:{type:"string",nullable:!0},scopes:{type:"array",items:{type:"string"}},created_at:{type:"string"},updated_at:{type:"string"},revoked_at:{type:"string",nullable:!0},last_used_at:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},plaintext_token:{type:"string",nullable:!0},created_by_email:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by_label:{type:"string",nullable:!0}},required:["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email","created_by_type","created_by_label"],"x-typelizer":!0},AppliedPromotion:{type:"object",properties:{id:{type:"string"},promotion_id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":!0},Cart:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},preferred_stock_location_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_number_required:{type:"boolean"},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},token:{type:"string"},email:{type:"string",nullable:!0},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},warnings:{type:"array",items:{$ref:"#/components/schemas/CartWarning"}},coupon_code:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},adjustment_total:{type:"string",nullable:!0},display_adjustment_total:{type:"string",nullable:!0},discount_total:{type:"string",nullable:!0},display_discount_total:{type:"string",nullable:!0},tax_total:{type:"string",nullable:!0},display_tax_total:{type:"string",nullable:!0},included_tax_total:{type:"string",nullable:!0},display_included_tax_total:{type:"string",nullable:!0},additional_tax_total:{type:"string",nullable:!0},display_additional_tax_total:{type:"string",nullable:!0},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},gift_card_total:{type:"string",nullable:!0},display_gift_card_total:{type:"string",nullable:!0},amount_due:{type:"string",nullable:!0},display_amount_due:{type:"string",nullable:!0},delivery_total:{type:"string",nullable:!0},display_delivery_total:{type:"string",nullable:!0},fee_total:{type:"string",nullable:!0},display_fee_total:{type:"string",nullable:!0},store_credit_total:{type:"string",nullable:!0},display_store_credit_total:{type:"string",nullable:!0},covered_by_store_credit:{type:"boolean"},current_step:{type:"string"},completed_steps:{type:"array",items:{type:"string"}},requirements:{type:"array",items:{$ref:"#/components/schemas/CheckoutRequirement"}},order_minimum:{type:"number",nullable:!0},order_minimum_shortfall:{type:"number",nullable:!0},below_order_minimum:{type:"boolean",nullable:!0},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},shipping_eq_billing_address:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},completed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}}},required:["id","market_id","channel_id","preferred_stock_location_id","company_id","company_name","po_number_required","po_document_filename","po_document_byte_size","number","token","email","customer_note","po_number","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","order_minimum","order_minimum_shortfall","below_order_minimum","freight_summary","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":!0},CatalogAssignment:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},catalog_id:{type:"string"},assignable_type:{type:"string"},assignable_id:{type:"string"},assignable_name:{type:"string",nullable:!0}},required:["id","created_at","catalog_id","assignable_type","assignable_id","assignable_name"],"x-typelizer":!0},CatalogOrderMinimum:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"}},required:["id","currency","created_at","updated_at","amount","display_amount"],"x-typelizer":!0},CatalogPrice:{type:"object",properties:{id:{type:"string",nullable:!0},label:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},currency:{type:"string"},source:{type:"string",enum:["explicit","automatic","base"]},break_count:{type:"number"},amount:{type:"string"},display_amount:{type:"string"},tiers:{type:"array",items:{$ref:"#/components/schemas/CatalogPriceTier"}}},required:["id","label","sku","currency","source","break_count","amount","display_amount","tiers"],"x-typelizer":!0},CatalogPriceTier:{type:"object",properties:{min_quantity:{type:"number"},display_amount:{type:"string"},amount:{type:"string"}},required:["min_quantity","display_amount","amount"],"x-typelizer":!0},CatalogProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},quantity_rule:{allOf:[{$ref:"#/components/schemas/CatalogProductTerm"}],nullable:!0},catalog_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},CatalogProductTerm:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},product_name:{type:"string",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},mixed:{type:"boolean"}},required:["id","product_id","product_name","minimum_order_quantity","order_multiple","mixed"],"x-typelizer":!0},CatalogQuantityRule:{type:"object",properties:{id:{type:"string"},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant_id:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},product_name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","minimum_order_quantity","order_multiple","created_at","updated_at","variant_id","variant_sku","product_name","options_text"],"x-typelizer":!0},Catalog:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},active:{type:"boolean"},position:{type:"number",nullable:!0},metadata:{type:"object",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},products_count:{type:"number"},pricing_strategy:{type:"string"},order_minimums:{type:"array",items:{$ref:"#/components/schemas/CatalogOrderMinimum"}},price_list:{$ref:"#/components/schemas/PriceList"},assignments:{type:"array",items:{$ref:"#/components/schemas/CatalogAssignment"}}},required:["id","name","description","active","position","metadata","minimum_order_quantity","order_multiple","created_at","updated_at","products_count","pricing_strategy"],"x-typelizer":!0},Category:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},depth:{type:"number"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},children_count:{type:"number"},parent_id:{type:"string",nullable:!0},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},is_root:{type:"boolean"},is_child:{type:"boolean"},is_leaf:{type:"boolean"},parent:{$ref:"#/components/schemas/Category"},children:{type:"array",items:{$ref:"#/components/schemas/Category"}},ancestors:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},external_references:{type:"object"},translations:{type:"object"},metadata:{type:"object"},pretty_name:{type:"string"},lft:{type:"number"},rgt:{type:"number"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","external_references","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":!0},Channel:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string"},active:{type:"boolean"},default:{type:"boolean"},storefront_access:{type:"string"},guest_checkout:{type:"boolean"},preferred_order_routing_strategy:{type:"string",nullable:!0},preferred_storefront_access:{type:"string",nullable:!0},preferred_guest_checkout:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_location_ids:{type:"array",items:{type:"string"}},default_catalog_id:{type:"string",nullable:!0}},required:["id","name","code","active","default","storefront_access","guest_checkout","preferred_order_routing_strategy","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","stock_location_ids","default_catalog_id"],"x-typelizer":!0},ClaimLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},send_replacement:{type:"boolean"},description:{type:"string",nullable:!0},refund_amount:{type:"string"},paid_amount:{type:"string"},display_refund_amount:{type:"string"},variant_id:{type:"string",nullable:!0},replacement_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},replacement_variant:{$ref:"#/components/schemas/Variant"}},required:["id","quantity","send_replacement","description","refund_amount","paid_amount","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":!0},ClaimReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Claim:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["open","approved","resolved","denied","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},resolution:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},approved_at:{type:"string",nullable:!0},resolved_at:{type:"string",nullable:!0},denied_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ClaimReason"},claim_line_items:{type:"array",items:{$ref:"#/components/schemas/ClaimLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id","created_by_type"],"x-typelizer":!0},CollectionRule:{type:"object",properties:{id:{type:"string"},value:{type:"string",nullable:!0},match_policy:{type:"string",enum:["is_equal_to","is_not_equal_to","contains","does_not_contain"]},type:{type:"string",description:"Rule type. Built-in: tag, available_on, sale. Extensions may register more."}},required:["id","value","match_policy","type"],"x-typelizer":!0},Collection:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},sort_order:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},products_count:{type:"number"},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},translations:{type:"object"},automatic:{type:"boolean"},rules_match_policy:{type:"string",enum:["all","any"]},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},rules:{type:"array",items:{$ref:"#/components/schemas/CollectionRule"}}},required:["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":!0},CommissionLine:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["percentage","fixed"]},currency:{type:"string"},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},rate:{type:"string"},tax_rate:{type:"string"},amount:{type:"string"},tax_amount:{type:"string"},total:{type:"string"},display_amount:{type:"string"},display_tax_amount:{type:"string"},display_total:{type:"string"},order_id:{type:"string"},seller_id:{type:"string"},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},commission_rate_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},commission_rate:{$ref:"#/components/schemas/CommissionRate"}},required:["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","total","display_amount","display_tax_amount","display_total","order_id","seller_id","line_item_id","fulfillment_id","commission_rate_id","seller_name"],"x-typelizer":!0},CommissionRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},enabled:{type:"boolean"},position:{type:"number"},kind:{type:"string",enum:["percentage","fixed"]},tax_inclusive:{type:"boolean"},include_shipping:{type:"boolean"},metadata:{type:"object",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},value:{type:"string"},commission_tax_rate:{type:"string",nullable:!0},amounts:{type:"object"},bounds:{type:"object"},global:{type:"boolean"},rules:{type:"array",items:{$ref:"#/components/schemas/CommissionRule"}}},required:["id","name","code","enabled","position","kind","tax_inclusive","include_shipping","metadata","deleted_at","created_at","updated_at","value","commission_tax_rate","amounts","bounds","global","rules"],"x-typelizer":!0},CommissionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: seller_rule, category_rule, product_rule, item_total_rule. Extensions may register more."},commission_rate_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"object",nullable:!0},seller_ids:{type:"object",nullable:!0},category_ids:{type:"object",nullable:!0},sellers:{type:"array",items:{$ref:"#/components/schemas/Seller"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}}},required:["id","created_at","updated_at","type","commission_rate_id","preferences","preference_schema","product_ids","seller_ids","category_ids"],"x-typelizer":!0},CompanyInvitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},expires_at:{type:"string",nullable:!0},company_id:{type:"string"},status:{type:"string",enum:["pending","accepted","revoked","expired"]},accepted_at:{type:"string",nullable:!0},revoked_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","email","expires_at","company_id","status","accepted_at","revoked_at","created_at","updated_at"],"x-typelizer":!0},CompanyMembership:{type:"object",properties:{id:{type:"string"},company_id:{type:"string"},customer_id:{type:"string"},email:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","company_id","customer_id","email","created_at","updated_at"],"x-typelizer":!0},Company:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["company","division"]},po_number_required:{type:"boolean"},parent_id:{type:"string",nullable:!0},ancestors:{type:"object"},external_references:{type:"object"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},children_count:{type:"number"},members_count:{type:"number"},children:{type:"array",items:{$ref:"#/components/schemas/Company"}},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},memberships:{type:"array",items:{$ref:"#/components/schemas/CompanyMembership"}}},required:["id","name","kind","po_number_required","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"x-typelizer":!0},ConsentRecord:{type:"object",properties:{id:{type:"string"},purpose:{type:"string"},source:{type:"string",enum:["checkout","registration","account","admin","newsletter","anonymization","unknown","import","storefront"]},accepted:{type:"boolean"},email:{type:"string",nullable:!0},ip_address:{type:"string",nullable:!0},created_at:{type:"string"},recorded_at:{type:"string",nullable:!0},documents:{type:"object"}},required:["id","purpose","source","accepted","email","ip_address","created_at","recorded_at","documents"],"x-typelizer":!0},Country:{type:"object",properties:{iso:{type:"string"},iso3:{type:"string"},name:{type:"string"},states_required:{type:"boolean"},zipcode_required:{type:"boolean"},states:{type:"array",items:{$ref:"#/components/schemas/State"}},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0}},required:["iso","iso3","name","states_required","zipcode_required"],"x-typelizer":!0},CouponCode:{type:"object",properties:{id:{type:"string"},code:{type:"string"},state:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},promotion_id:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":!0},CreditCard:{type:"object",properties:{id:{type:"string"},brand:{type:"string"},last4:{type:"string"},month:{type:"number"},year:{type:"number"},name:{type:"string",nullable:!0},default:{type:"boolean"},gateway_payment_profile_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},payment_method_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":!0},CustomFieldDefinition:{type:"object",properties:{id:{type:"string"},namespace:{type:"string"},key:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},resource_type:{type:"string",description:"Class name of the resource the field attaches to, for example Spree::Product, Spree::Order or Spree::Customer. Extensions may register more."},storefront_visible:{type:"boolean"},searchable:{type:"boolean"},sortable:{type:"boolean"},filter_key:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","namespace","key","label","field_type","resource_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at"],"x-typelizer":!0},CustomField:{type:"object",properties:{id:{type:"string"},label:{type:"string"},type:{type:"string",deprecated:!0},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},key:{type:"string"},value:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},storefront_visible:{type:"boolean"},custom_field_definition_id:{type:"string"}},required:["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":!0},CustomerGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},customers_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":!0},Customer:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},accepts_email_marketing:{type:"boolean"},email_marketing_consent_updated_at:{type:"string",nullable:!0},full_name:{type:"string"},available_store_credit_total:{type:"string"},display_available_store_credit_total:{type:"string"},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},default_billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},default_shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},newsletter_subscriber:{allOf:[{$ref:"#/components/schemas/NewsletterSubscriber"}],nullable:!0},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},failed_attempts:{type:"number"},metadata:{type:"object"},email_marketing_consent_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},anonymized_at:{type:"string",nullable:!0},anonymized:{type:"boolean"},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},default_billing_address_id:{type:"string",nullable:!0},default_shipping_address_id:{type:"string",nullable:!0},orders_count:{type:"number"},total_spent:{type:"string"},display_total_spent:{type:"string"},last_order_completed_at:{type:"string",nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},store_credits:{type:"array",items:{$ref:"#/components/schemas/StoreCredit"}},customer_group_ids:{type:"array",items:{type:"string"}},companies:{type:"array",items:{$ref:"#/components/schemas/Company"}}},required:["id","email","first_name","last_name","phone","accepts_email_marketing","email_marketing_consent_updated_at","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","email_marketing_consent_source","created_at","updated_at","anonymized_at","anonymized","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":!0},DashboardCounter:{type:"object",properties:{key:{type:"string",description:"Registered counter name. The dashboard translates it; built-in: orders_to_fulfill, payments_to_collect, open_returns, open_exchanges, open_claims, low_stock_items, out_of_stock_items."},value:{type:"number"},link:{type:"object",nullable:!0,description:"The list filter that shows exactly the rows counted, or null when no list can."},nav:{type:"string",nullable:!0,description:"Sidebar entry key this count badges, or null."}},required:["key","value","link","nav"],"x-typelizer":!0},DataRequest:{type:"object",properties:{id:{type:"string"},number:{type:"string"},kind:{type:"string",enum:["access","erasure"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},requested_at:{type:"string",nullable:!0},completed_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},email:{type:"string"},error_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},requested_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"}},required:["id","number","kind","status","requested_at","completed_at","expires_at","email","error_message","created_at","updated_at","customer_id","requested_by_id"],"x-typelizer":!0},DeliveryMethodRule:{type:"object",properties:{id:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more."},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"array",items:{type:"string"}}},required:["id","active","created_at","updated_at","type","preferences","preference_schema","product_ids"],"x-typelizer":!0},DeliveryMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},estimated_transit_business_days_min:{type:"number",nullable:!0},estimated_transit_business_days_max:{type:"number",nullable:!0},digital:{type:"boolean"},pickup:{type:"boolean"},pickup_point:{type:"boolean"},admin_name:{type:"string",nullable:!0},fulfillment_provider:{type:"string"},pickup_point_provider:{type:"string",nullable:!0},rate_provider:{type:"string",nullable:!0},storefront_visible:{type:"boolean"},tracking_url:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},available_to_sellers:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},services:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodService"}},rules:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodRule"}},tax_category_id:{type:"string",nullable:!0},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_zone_id:{type:"string",nullable:!0},stock_location_ids:{type:"array",items:{type:"string"}},calculator_type:{type:"string",nullable:!0},calculator_preferences:{type:"object",nullable:!0}},required:["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","fulfillment_provider","pickup_point_provider","rate_provider","storefront_visible","tracking_url","markup_flat","markup_percent","available_to_sellers","created_at","updated_at","deleted_at","seller_id","seller_name","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","calculator_type","calculator_preferences"],"x-typelizer":!0},DeliveryMethodService:{type:"object",properties:{id:{type:"string"},carrier:{type:"string"},service:{type:"string"},label:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},position:{type:"number"}},required:["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":!0},DeliveryOriginGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},stock_location_ids:{type:"array",items:{type:"string"}},delivery_zones_count:{type:"number"},delivery_methods_count:{type:"number"}},required:["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":!0},DeliveryProfile:{type:"object",properties:{id:{type:"string"},name:{type:"string"},default:{type:"boolean"},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Profile kind. Built-in: shipping, digital. Extensions may register more."},digital:{type:"boolean"},offers_pickup:{type:"boolean"},offers_shipping:{type:"boolean"},stock_location_ids:{type:"array",items:{type:"string"}},origin_groups:{type:"object"},products_count:{type:"number"},delivery_methods_count:{type:"number"},delivery_zones_count:{type:"number"}},required:["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":!0},DeliveryRate:{type:"object",properties:{id:{type:"string"},delivery_method_id:{type:"string"},name:{type:"string"},selected:{type:"boolean"},cost:{type:"string"},total:{type:"string"},additional_tax_total:{type:"string"},included_tax_total:{type:"string"},tax_total:{type:"string"},carrier:{type:"string",nullable:!0},service_level:{type:"string",nullable:!0},estimated_delivery_date:{type:"string",nullable:!0},unpriced:{type:"boolean"},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},display_cost:{type:"string"},display_total:{type:"string"},display_additional_tax_total:{type:"string"},display_included_tax_total:{type:"string"},display_tax_total:{type:"string"},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","unpriced","freight_summary","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":!0},Delivery:{type:"object",properties:{id:{type:"string"},tracking_number:{type:"string"},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},status:{type:"string",enum:["pending","pre_transit","in_transit","out_for_delivery","available_for_pickup","delivered","return_to_sender","failure","unknown"]},tracking_url:{type:"string",nullable:!0},estimated_delivery_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},details:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},shipping_label_id:{type:"string",nullable:!0}},required:["id","tracking_number","carrier","carrier_name","service","status","tracking_url","estimated_delivery_at","delivered_at","details","created_at","updated_at","shipping_label_id"],"x-typelizer":!0},DeliveryZoneMember:{type:"object",properties:{id:{type:"string"},member_type:{type:"string",enum:["country","state","postal_code"]},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},postal_code_prefix:{type:"string",nullable:!0},postal_code_from:{type:"string",nullable:!0},postal_code_to:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","state_name","created_at","updated_at"],"x-typelizer":!0},DeliveryZone:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},members:{type:"array",items:{$ref:"#/components/schemas/DeliveryZoneMember"}},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_method_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":!0},DigitalAsset:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},authorized_clicks:{type:"number",nullable:!0},authorized_days:{type:"number",nullable:!0},byte_size:{type:"number",nullable:!0},provider_type:{type:"string",nullable:!0},provider_settings:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},provider_name:{type:"string",description:"Digital asset provider name. Built-in: File. Extensions may register more."},download_url:{type:"string",nullable:!0},effective_authorized_clicks:{type:"number"},effective_authorized_days:{type:"number"}},required:["id","variant_id","filename","content_type","authorized_clicks","authorized_days","byte_size","provider_type","provider_settings","created_at","updated_at","provider_name","download_url","effective_authorized_clicks","effective_authorized_days"],"x-typelizer":!0},DigitalLink:{type:"object",properties:{id:{type:"string"},access_counter:{type:"number"},filename:{type:"string"},content_type:{type:"string"},download_url:{type:"string"},expires_at:{type:"string",nullable:!0},authorizable:{type:"boolean"},expired:{type:"boolean"},access_limit_exceeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","access_counter","filename","content_type","download_url","expires_at","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":!0},Discount:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{type:"string",enum:["promotion","manual"]},code:{type:"string",nullable:!0},value_type:{type:"string",nullable:!0},value:{type:"string",nullable:!0},promotion_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},ExchangeLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},original_price:{type:"string"},new_variant_price:{type:"string"},price_difference:{type:"string"},original_variant_id:{type:"string",nullable:!0},new_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},original_variant:{$ref:"#/components/schemas/Variant"},new_variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},Exchange:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","fulfilled","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},price_difference:{type:"string"},display_price_difference:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},fulfilled_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},exchange_line_items:{type:"array",items:{$ref:"#/components/schemas/ExchangeLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type"],"x-typelizer":!0},Export:{type:"object",properties:{id:{type:"string"},number:{type:"string"},format:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},done:{type:"boolean"},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},download_url:{type:"string",nullable:!0}},required:["id","number","format","created_at","updated_at","type","user_id","done","store_id","seller_id","seller_name","filename","byte_size","download_url"],"x-typelizer":!0},Fee:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{anyOf:[{type:"string",enum:["surcharge","handling","gift_wrap","cod","payment","duty"]},{type:"string"}],description:"What sort of charge this is. `duty` is a customs duty on a cross-border order and is not taxed; the other kinds are. Extensions may register further kinds."},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},FreightSummaryLine:{type:"object",properties:{variant_id:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},name:{type:"string",nullable:!0},units:{type:"number"},cartons:{type:"number",nullable:!0},pallets:{type:"number",nullable:!0},units_per_carton:{type:"number",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},complete:{type:"boolean"},weight_per_carton:{type:"string",nullable:!0},volume:{type:"string"},weight:{type:"string"}},required:["variant_id","sku","name","units","cartons","pallets","units_per_carton","cartons_per_pallet","complete","weight_per_carton","volume","weight"],"x-typelizer":!0},FreightSummary:{type:"object",properties:{total_units:{type:"number"},total_cartons:{type:"number"},total_pallets:{type:"number",nullable:!0},total_volume:{type:"string"},total_weight:{type:"string"},complete:{type:"boolean"},lines:{type:"array",items:{$ref:"#/components/schemas/FreightSummaryLine"}}},required:["total_units","total_cartons","total_pallets","total_volume","total_weight","complete","lines"],"x-typelizer":!0},FulfillmentItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},status:{anyOf:[{type:"string",enum:["on_hand","backordered","shipped","returned"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":!0},Fulfillment:{type:"object",properties:{id:{type:"string"},number:{type:"string"},tracking:{type:"string",nullable:!0},tracking_url:{type:"string",nullable:!0},pickup_point_data:{type:"object",nullable:!0},selected_delivery_rate_id:{type:"string",nullable:!0},unpriced:{type:"boolean"},cost:{type:"string"},display_cost:{type:"string"},total:{type:"string"},display_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},status:{anyOf:[{type:"string",enum:["unfulfilled","fulfilled","delivered","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},fulfillment_type:{type:"string",enum:["shipping","digital","pickup","pickup_point"]},fulfilled_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentManifestItem"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},stock_location:{$ref:"#/components/schemas/StockLocation"},delivery_rates:{type:"array",items:{$ref:"#/components/schemas/DeliveryRate"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},adjustment_total:{type:"string"},pre_tax_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},provider_generates_labels:{type:"boolean"},fulfillment_items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentItem"}},order:{$ref:"#/components/schemas/Order"}},required:["id","number","tracking","tracking_url","pickup_point_data","selected_delivery_rate_id","unpriced","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","delivered_at","items","deliveries","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","labels","provider_generates_labels"],"x-typelizer":!0},GiftCardBatch:{type:"object",properties:{id:{type:"string"},codes_count:{type:"number"},currency:{type:"string",nullable:!0},prefix:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0}},required:["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":!0},GiftCard:{type:"object",properties:{id:{type:"string"},code:{type:"string"},status:{anyOf:[{type:"string",enum:["active","partially_redeemed","redeemed","canceled","expired"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_authorized:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},expires_at:{type:"string",nullable:!0},redeemed_at:{type:"string",nullable:!0},expired:{type:"boolean"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"},gift_card_batch:{$ref:"#/components/schemas/GiftCardBatch"},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}}},required:["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":!0},ImportMapping:{type:"object",properties:{id:{type:"string"},schema_field:{type:"string"},file_column:{type:"string",nullable:!0},required:{type:"boolean"}},required:["id","schema_field","file_column","required"],"x-typelizer":!0},ImportRow:{type:"object",properties:{id:{type:"string"},row_number:{type:"number"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},validation_errors:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},import_id:{type:"string",nullable:!0},item_type:{type:"string",nullable:!0},item_id:{type:"string",nullable:!0},data:{type:"object"}},required:["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":!0},Import:{type:"object",properties:{id:{type:"string"},number:{type:"string"},rows_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0,description:"Import type. Built-in: products, product_translations, customers, price_list_prices. Extensions may register more."},status:{anyOf:[{type:"string",enum:["pending","mapping","completed_mapping","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},processing_errors:{type:"string",nullable:!0},preferred_delimiter:{type:"string"},price_list_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},original_filename:{type:"string",nullable:!0},original_byte_size:{type:"number",nullable:!0},original_file_url:{type:"string",nullable:!0},completed_rows_count:{type:"number"},failed_rows_count:{type:"number"},schema_fields:{type:"array",items:{$ref:"#/components/schemas/ImportSchemaField"}},csv_headers:{type:"array",items:{type:"string"}},sample_row:{type:"object"},mappings:{type:"array",items:{$ref:"#/components/schemas/ImportMapping"}}},required:["id","number","rows_count","created_at","updated_at","type","status","store_id","seller_id","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","price_list_id","seller_name","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":!0},Integration:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Integration type, registered by the provider gem that owns it (for example the EasyPost provider). Core ships none."},group:{type:"string",nullable:!0},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":!0},Invitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},created_at:{type:"string"},updated_at:{type:"string"},expires_at:{type:"string"},role_id:{type:"string"},role_name:{type:"string"},inviter_email:{type:"string"},acceptance_url:{type:"string"},invitee_exists:{type:"boolean"},store:{type:"object"}},required:["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":!0},LineItem:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string"},seller_id:{type:"string",nullable:!0},preorder:{type:"boolean"},preorder_ships_at:{type:"string",nullable:!0},quantity:{type:"number"},currency:{type:"string"},name:{type:"string"},slug:{type:"string"},options_text:{type:"string"},price:{type:"string"},display_price:{type:"string"},total:{type:"string"},display_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},discounted_amount:{type:"string"},display_discounted_amount:{type:"string"},display_compare_at_amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},digital_links:{type:"array",items:{$ref:"#/components/schemas/DigitalLink"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},price_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},catalog_price:{type:"string",nullable:!0},cost_price:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},tax_category:{$ref:"#/components/schemas/TaxCategory"}},required:["id","variant_id","seller_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","price_source","created_at","updated_at","catalog_price","cost_price","tax_category_id"],"x-typelizer":!0},Market:{type:"object",properties:{id:{type:"string"},name:{type:"string"},currency:{type:"string"},default_locale:{type:"string"},tax_inclusive:{type:"boolean"},default:{type:"boolean"},country_codes:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},tax_provider:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","currency","default_locale","tax_inclusive","default","country_codes","supported_locales","tax_provider","created_at","updated_at"],"x-typelizer":!0},Media:{type:"object",properties:{id:{type:"string"},product_id:{type:"string",nullable:!0},variant_ids:{type:"array",items:{type:"string"}},position:{type:"number"},alt:{type:"string",nullable:!0},media_type:{type:"string",enum:["image","video","external_video"]},focal_point_x:{type:"number",nullable:!0},focal_point_y:{type:"number",nullable:!0},external_video_url:{type:"string",nullable:!0},video_provider:{type:"string",nullable:!0},video_embed_url:{type:"string",nullable:!0},video_url:{type:"string",nullable:!0},poster_url:{type:"string",nullable:!0},original_url:{type:"string",nullable:!0},mini_url:{type:"string",nullable:!0},small_url:{type:"string",nullable:!0},medium_url:{type:"string",nullable:!0},large_url:{type:"string",nullable:!0},xlarge_url:{type:"string",nullable:!0},og_image_url:{type:"string",nullable:!0},external_references:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},attached:{type:"boolean"},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},embed_url:{type:"string",nullable:!0},signed_id:{type:"string",nullable:!0},viewable_id:{type:"string",nullable:!0},download_url:{type:"string",nullable:!0},metadata:{type:"object"},viewable_type:{type:"string",nullable:!0}},required:["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","video_provider","video_embed_url","video_url","poster_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","external_references","created_at","updated_at","attached","filename","content_type","byte_size","embed_url","signed_id","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":!0},MembershipProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0}},required:["id","name","thumbnail_url"],"x-typelizer":!0},NewsletterSubscriber:{type:"object",properties:{id:{type:"string"},email:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},verified:{type:"boolean"},verified_at:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0}},required:["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":!0},OptionType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},kind:{type:"string",enum:["dropdown","color_swatch","buttons"]},translations:{type:"object"},metadata:{type:"object"},filterable:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":!0},OptionValue:{type:"object",properties:{id:{type:"string"},option_type_id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},color_code:{type:"string",nullable:!0},option_type_name:{type:"string"},option_type_label:{type:"string"},image_url:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},option_type:{$ref:"#/components/schemas/OptionType"}},required:["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":!0},OrderCancellationReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},OrderGroup:{type:"object",properties:{id:{type:"string"},number:{type:"string"},email:{type:"string",nullable:!0},currency:{type:"string"},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},seller_count:{type:"number"},includes_first_party:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}}},required:["id","number","email","currency","total","display_total","item_total","display_item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","created_at","updated_at","payments"],"x-typelizer":!0},OrderRoutingRule:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: preferred_location, default_location, minimize_splits. Extensions may register more."},channel_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema"],"x-typelizer":!0},Order:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},withdrawal_period_ends_at:{type:"string",nullable:!0},within_withdrawal_period:{type:"boolean"},cart_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},email:{type:"string"},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},coupon_code:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},item_total:{type:"string"},display_item_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},total:{type:"string"},display_total:{type:"string"},gift_card_total:{type:"string"},display_gift_card_total:{type:"string"},amount_due:{type:"string"},display_amount_due:{type:"string"},delivery_total:{type:"string"},display_delivery_total:{type:"string"},fee_total:{type:"string"},display_fee_total:{type:"string"},store_credit_total:{type:"string"},display_store_credit_total:{type:"string"},covered_by_store_credit:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},fulfillments:{type:"array",items:{$ref:"#/components/schemas/Fulfillment"}},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},gift_card:{allOf:[{$ref:"#/components/schemas/GiftCard"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},external_references:{type:"object"},status:{type:"string",enum:["draft","placed","canceled"]},last_ip_address:{type:"string",nullable:!0},considered_risky:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},payment_total:{type:"string"},display_payment_total:{type:"string"},metadata:{type:"object"},cancel_note:{type:"string",nullable:!0},commission_amount_total:{type:"string"},display_commission_amount_total:{type:"string"},commission_tax_total:{type:"string"},display_commission_tax_total:{type:"string"},commission_total:{type:"string"},display_commission_total:{type:"string"},canceled_at:{type:"string",nullable:!0},approved_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_stock_location_id:{type:"string",nullable:!0},po_document_url:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},order_group_id:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},approver_id:{type:"string",nullable:!0},approver_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},approver:{$ref:"#/components/schemas/Actor"},canceler_id:{type:"string",nullable:!0},canceler_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},canceler:{$ref:"#/components/schemas/Actor"},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},cancel_reason_id:{type:"string",nullable:!0},cancel_reason_name:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}},cart:{$ref:"#/components/schemas/Cart"},channel:{$ref:"#/components/schemas/Channel"},preferred_stock_location:{$ref:"#/components/schemas/StockLocation"},payment_methods:{type:"array",items:{$ref:"#/components/schemas/PaymentMethod"}},customer:{$ref:"#/components/schemas/Customer"},cancel_reason:{$ref:"#/components/schemas/OrderCancellationReason"},returns:{type:"array",items:{$ref:"#/components/schemas/Return"}},exchanges:{type:"array",items:{$ref:"#/components/schemas/Exchange"}},claims:{type:"array",items:{$ref:"#/components/schemas/Claim"}},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0}},required:["id","market_id","withdrawal_period_ends_at","within_withdrawal_period","cart_id","channel_id","company_id","company_name","po_document_filename","po_document_byte_size","number","email","customer_note","po_number","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","external_references","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","cancel_note","commission_amount_total","display_commission_amount_total","commission_tax_total","display_commission_tax_total","commission_total","display_commission_total","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","po_document_url","seller_id","order_group_id","tags","internal_note","internal_note_html","approver_id","approver_type","canceler_id","canceler_type","created_by_id","created_by_type","cancel_reason_id","cancel_reason_name","customer_id","freight_summary"],"x-typelizer":!0},PackageType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["box","envelope","carton","pallet","container"]},length:{type:"string",nullable:!0},width:{type:"string",nullable:!0},height:{type:"string",nullable:!0},weight:{type:"string",nullable:!0},max_weight:{type:"string",nullable:!0},default:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},volume:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0}},required:["id","name","kind","length","width","height","weight","max_weight","default","metadata","created_at","updated_at","dimensions_unit","weight_unit","volume","seller_id","seller_name"],"x-typelizer":!0},PaymentMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},type:{type:"string",description:"Payment method type. Built-in: check, store_credit, custom_payment_source_method, bogus (test only); payment provider gems register their own, for example stripe."},session_required:{type:"boolean"},source_required:{type:"boolean"},metadata:{type:"object"},active:{type:"boolean"},auto_capture:{type:"boolean",nullable:!0},capture_method:{type:"string",enum:["checkout","on_dispatch","manual"],nullable:!0},resolved_capture_method:{type:"string",enum:["checkout","on_dispatch","manual"]},storefront_visible:{type:"boolean"},position:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","description","type","session_required","source_required","metadata","active","auto_capture","capture_method","resolved_capture_method","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":!0},Payment:{type:"object",properties:{id:{type:"string"},payment_method_id:{type:"string"},response_code:{type:"string",nullable:!0},number:{type:"string"},status:{anyOf:[{type:"string",enum:["checkout","processing","pending","completed","failed","void","invalid"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},amount:{type:"string"},display_amount:{type:"string"},source_type:{type:"string",nullable:!0,enum:["credit_card","store_credit","payment_source"]},source_id:{type:"string",nullable:!0},source:{anyOf:[{$ref:"#/components/schemas/CreditCard"},{$ref:"#/components/schemas/StoreCredit"},{$ref:"#/components/schemas/PaymentSource"}],nullable:!0},payment_method:{$ref:"#/components/schemas/PaymentMethod"},metadata:{type:"object"},avs_response:{type:"string",nullable:!0},cvv_response_code:{type:"string",nullable:!0},cvv_response_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},captured_amount:{type:"string"},order_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}}},required:["id","payment_method_id","response_code","number","status","amount","display_amount","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":!0},PaymentSource:{type:"object",properties:{id:{type:"string"},gateway_payment_profile_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":!0},PaymentSplit:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},authorized_amount:{type:"string"},display_authorized_amount:{type:"string"},captured_amount:{type:"string"},display_captured_amount:{type:"string"},refunded_amount:{type:"string"},display_refunded_amount:{type:"string"},claimed_amount:{type:"string"},display_claimed_amount:{type:"string"},net_captured_amount:{type:"string"},display_net_captured_amount:{type:"string"},refundable_amount:{type:"string"},display_refundable_amount:{type:"string"},payment_id:{type:"string"},payment_number:{type:"string",nullable:!0},order_id:{type:"string"},order_number:{type:"string",nullable:!0}},required:["id","currency","created_at","updated_at","authorized_amount","display_authorized_amount","captured_amount","display_captured_amount","refunded_amount","display_refunded_amount","claimed_amount","display_claimed_amount","net_captured_amount","display_net_captured_amount","refundable_amount","display_refundable_amount","payment_id","payment_number","order_id","order_number"],"x-typelizer":!0},Permission:{type:"object",properties:{key:{type:"string"},resource:{type:"string"},kind:{type:"string",enum:["read","write"]},group:{type:"string"},group_label:{type:"string"},label:{type:"string"},description:{type:"string"}},required:["key","resource","kind","group","group_label","label","description"],"x-typelizer":!0},Policy:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},body:{type:"string",nullable:!0},body_html:{type:"string",nullable:!0},updated_at:{type:"string"},created_at:{type:"string"}},required:["id","name","slug","body","body_html","updated_at","created_at"],"x-typelizer":!0},PriceAdjustmentTier:{type:"object",properties:{id:{type:"string"},min_quantity:{type:"number"},percentage:{type:"string"}},required:["id","min_quantity","percentage"],"x-typelizer":!0},PriceHistory:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_in_cents:{type:"number"},currency:{type:"string"},display_amount:{type:"string"},recorded_at:{type:"string"},variant_id:{type:"string"},price_id:{type:"string"},compare_at_amount:{type:"string",nullable:!0},created_at:{type:"string"}},required:["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":!0},PriceListProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},price_list_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},PriceList:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["draft","active","inactive","scheduled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},position:{type:"number"},match_policy:{type:"string",enum:["all","any"]},adjust_compare_at:{type:"boolean"},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},price_adjustment_percentage:{type:"string",nullable:!0},automatic_pricing:{type:"boolean"},currently_active:{type:"boolean"},products_count:{type:"number"},prices_count:{type:"number"},price_adjustment_tiers:{type:"array",items:{$ref:"#/components/schemas/PriceAdjustmentTier"}},price_rules:{type:"array",items:{$ref:"#/components/schemas/PriceRule"}}},required:["id","name","description","status","position","match_policy","adjust_compare_at","starts_at","ends_at","deleted_at","created_at","updated_at","price_adjustment_percentage","automatic_pricing","currently_active","products_count","prices_count","price_adjustment_tiers"],"x-typelizer":!0},PriceRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: channel_rule, customer_group_rule, market_rule, user_rule, volume_rule, zone_rule. Extensions may register more."},price_list_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","created_at","updated_at","type","price_list_id","preferences","preference_schema"],"x-typelizer":!0},Price:{type:"object",properties:{id:{type:"string"},amount:{type:"string",nullable:!0},amount_in_cents:{type:"number",nullable:!0},compare_at_amount:{type:"string",nullable:!0},compare_at_amount_in_cents:{type:"number",nullable:!0},currency:{type:"string",nullable:!0},display_amount:{type:"string",nullable:!0},display_compare_at_amount:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},min_quantity:{type:"number"},variant_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","min_quantity","variant_id","created_at","updated_at"],"x-typelizer":!0},ProductPublication:{type:"object",properties:{id:{type:"string"},published_at:{type:"string",nullable:!0},unpublished_at:{type:"string",nullable:!0},product_id:{type:"string"},channel_id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":!0},Product:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},variant_count:{type:"number"},available_on:{type:"string",nullable:!0},preorder_ships_at:{type:"string",nullable:!0},purchasable:{type:"boolean"},preorder:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},available:{type:"boolean"},description:{type:"string",nullable:!0},description_html:{type:"string",nullable:!0},default_variant_id:{type:"string"},buy_box_variant_id:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},variants:{type:"array",items:{$ref:"#/components/schemas/Variant"}},default_variant:{$ref:"#/components/schemas/Variant"},option_types:{type:"array",items:{$ref:"#/components/schemas/OptionType"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},translations:{type:"object"},status:{anyOf:[{type:"string",enum:["draft","active","archived","proposed","rejected"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},metadata:{type:"object"},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},submission:{allOf:[{$ref:"#/components/schemas/ProductSubmission"}],nullable:!0},seller_name:{type:"string",nullable:!0},product_type_id:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},digital_assets:{type:"array",items:{$ref:"#/components/schemas/DigitalAsset"}},collections:{type:"array",items:{$ref:"#/components/schemas/Collection"}},product_publications:{type:"array",items:{$ref:"#/components/schemas/ProductPublication"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},product_type:{$ref:"#/components/schemas/ProductType"}},required:["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","buy_box_variant_id","thumbnail_url","tags","price","original_price","seller_id","external_references","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","seller_name","product_type_id","tax_category_id"],"x-typelizer":!0},ProductSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","approved","rejected","withdrawn"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},review_note:{type:"string",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},product_id:{type:"string"},metadata:{type:"object",nullable:!0},updated_at:{type:"string"},submitted_by_id:{type:"string",nullable:!0},reviewed_by_id:{type:"string",nullable:!0},reviewed_by_name:{type:"string",nullable:!0},auto_approved:{type:"boolean"}},required:["id","status","review_note","reviewed_at","created_at","product_id","metadata","updated_at","submitted_by_id","reviewed_by_id","reviewed_by_name","auto_approved"],"x-typelizer":!0},ProductTypeCustomFieldDefinition:{type:"object",properties:{id:{type:"string"},key:{type:"string"},namespace:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},required:{type:"boolean"},sort_order:{type:"number"}},required:["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":!0},ProductType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},translations:{type:"object"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},option_type_ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}},custom_field_definitions:{type:"array",items:{$ref:"#/components/schemas/ProductTypeCustomFieldDefinition"}}},required:["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":!0},PromotionAction:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Action type. Built-in: create_adjustment, create_item_adjustments, create_line_items, free_shipping. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},calculator:{allOf:[{$ref:"#/components/schemas/PromotionActionCalculator"}],nullable:!0},line_items:{type:"array",items:{$ref:"#/components/schemas/PromotionActionLineItem"},nullable:!0}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","calculator","line_items"],"x-typelizer":!0},PromotionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: currency, country, channel, market, item_total, product, customer, customer_group, first_order, customer_logged_in, one_use_per_user, category, option_value. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},product_ids:{type:"array",items:{type:"string"},nullable:!0},category_ids:{type:"array",items:{type:"string"},nullable:!0},customer_ids:{type:"array",items:{type:"string"},nullable:!0},option_value_ids:{type:"array",items:{type:"string"},nullable:!0},products:{type:"array",items:{$ref:"#/components/schemas/Product"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","product_ids","category_ids","customer_ids","option_value_ids"],"x-typelizer":!0},Promotion:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},usage_limit:{type:"number",nullable:!0},match_policy:{type:"string",enum:["all","any"]},path:{type:"string",nullable:!0},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"number",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},action_ids:{type:"array",items:{type:"string"}},rule_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":!0},PurchaseOrderItem:{type:"object",properties:{id:{type:"string"},quantity_ordered:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},currency:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},unit_cost:{type:"string"},total_cost:{type:"string"},display_unit_cost:{type:"string"},display_total_cost:{type:"string"},purchase_order_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_ordered","quantity_received","quantity_rejected","quantity_over","outstanding","currency","created_at","updated_at","unit_cost","total_cost","display_unit_cost","display_total_cost","purchase_order_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},PurchaseOrder:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{type:"string"},currency:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},ordered_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},expected_at:{type:"string",nullable:!0},cancel_by:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_ordered_total:{type:"number"},editable:{type:"boolean"},subtotal:{type:"string"},display_subtotal:{type:"string"},supplier_id:{type:"string",nullable:!0},destination_location_id:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/PurchaseOrderItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},supplier:{$ref:"#/components/schemas/Supplier"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","status","currency","reference","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","ordered_at","received_at","closed_short_at","created_at","updated_at","expected_at","cancel_by","closed_short","quantity_ordered_total","editable","subtotal","display_subtotal","supplier_id","destination_location_id"],"x-typelizer":!0},RefundReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Refund:{type:"object",properties:{id:{type:"string"},transaction_id:{type:"string",nullable:!0},amount:{type:"string",nullable:!0},payment_id:{type:"string",nullable:!0},refund_reason_id:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},refunder_id:{type:"string",nullable:!0},refunder_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},refunder:{$ref:"#/components/schemas/Actor"},payment:{$ref:"#/components/schemas/Payment"}},required:["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at","refunder_id","refunder_type"],"x-typelizer":!0},ReturnLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},line_item:{$ref:"#/components/schemas/LineItem"}},required:["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},ReturnReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Return:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","refunded","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},refunded_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},return_line_items:{type:"array",items:{$ref:"#/components/schemas/ReturnLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},refunded_total:{type:"string"},refundable_total:{type:"string"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}}},required:["id","number","status","order_id","reason_id","refund_total","display_refund_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type","refunded_total","refundable_total","documents","labels","deliveries"],"x-typelizer":!0},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},permissions:{type:"array",items:{type:"string"}},mutable:{type:"boolean"},users_count:{type:"number"}},required:["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":!0},SavedReport:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},query:{type:"object"},seeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},user_id:{type:"string",nullable:!0},author_name:{type:"string",nullable:!0}},required:["id","name","description","query","seeded","created_at","updated_at","user_id","author_name"],"x-typelizer":!0},SellerBalance:{type:"object",properties:{currency:{type:"string"},settlement_currency:{type:"string"},converted:{type:"boolean"},seller_id:{type:"string"},earned:{type:"string"},display_earned:{type:"string"},payable:{type:"string"},display_payable:{type:"string"},paid:{type:"string"},display_paid:{type:"string"},balance:{type:"string"},display_balance:{type:"string"},pending:{type:"string"},display_pending:{type:"string"}},required:["currency","settlement_currency","converted","seller_id","earned","display_earned","payable","display_payable","paid","display_paid","balance","display_balance","pending","display_pending"],"x-typelizer":!0},SellerPayout:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},provider:{type:"string",description:"Payout provider class name. Built-in: Spree::PayoutProvider::System. Provider gems register more."},reference:{type:"string",nullable:!0},metadata:{type:"object"},period_start:{type:"string",nullable:!0},period_end:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},seller_id:{type:"string"},seller_name:{type:"string",nullable:!0},transfers_count:{type:"number"}},required:["id","status","currency","provider","reference","metadata","period_start","period_end","created_at","updated_at","amount","display_amount","seller_id","seller_name","transfers_count"],"x-typelizer":!0},SellerRequirement:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},required:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},preferences:{type:"object"},custom_field_definition_ids:{type:"array",items:{type:"string"}},allow_multiple:{type:"boolean"},accepts_submissions:{type:"boolean"},reviewed_by_operator:{type:"boolean"}},required:["id","position","active","required","metadata","created_at","updated_at","kind","name","description","preferences","custom_field_definition_ids","allow_multiple","accepts_submissions","reviewed_by_operator"],"x-typelizer":!0},SellerRequirementStatus:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},required:{type:"boolean"},position:{type:"number"},status:{type:"string",enum:["complete","incomplete","pending","rejected"]},action_url:{type:"string",nullable:!0},blocker:{type:"object",nullable:!0},blocking:{type:"boolean"},required_policy_name:{type:"string",nullable:!0},submission:{$ref:"#/components/schemas/SellerRequirementSubmission"},published_policy:{$ref:"#/components/schemas/Policy"}},required:["id","kind","name","description","required","position","status","action_url","blocker","blocking","required_policy_name"],"x-typelizer":!0},SellerRequirementSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted","rejected","waived"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},note:{type:"string",nullable:!0},review_note:{type:"string",nullable:!0},reference:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string"},requirement_id:{type:"string"},requirement_name:{type:"string"},file_url:{type:"string",nullable:!0},file_name:{type:"string",nullable:!0}},required:["id","status","note","review_note","reference","metadata","reviewed_at","created_at","updated_at","seller_id","requirement_id","requirement_name","file_url","file_name"],"x-typelizer":!0},Seller:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},about:{type:"string"},about_html:{type:"string"},logo_url:{type:"string",nullable:!0},square_logo_url:{type:"string",nullable:!0},cover_photo_url:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["pending","invited","canceled","onboarding","ready_for_review","approved","rejected","suspended"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},contact_email:{type:"string",nullable:!0},billing_email:{type:"string",nullable:!0},tax_remittance:{type:"string"},payouts_schedule_interval:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},holiday_mode_until:{type:"string",nullable:!0},terms_accepted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},minimum_payout_amount:{type:"string",nullable:!0},on_holiday:{type:"boolean"},sellable:{type:"boolean"},products_count:{type:"number"},users_count:{type:"number"},onboarding_progress:{type:"object"},onboarding_complete:{type:"boolean"},legal_name:{type:"string",nullable:!0},registration_number:{type:"string",nullable:!0},billing_address:{$ref:"#/components/schemas/Address"},returns_address:{$ref:"#/components/schemas/Address"}},required:["id","name","slug","about","about_html","logo_url","square_logo_url","cover_photo_url","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","on_holiday","sellable","products_count","users_count","onboarding_progress","onboarding_complete","legal_name","registration_number"],"x-typelizer":!0},SellerTeamMember:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0}},required:["id","email","first_name","last_name","full_name","created_at","updated_at","avatar_url"],"x-typelizer":!0},SellerTransfer:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["earning","refund_reversal"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},provider:{type:"string",description:"Payout provider class name. Built-in: Spree::PayoutProvider::System. Provider gems register more."},reference:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},settled_amount:{type:"string",nullable:!0},settled_currency:{type:"string",nullable:!0},converted:{type:"boolean"},seller_id:{type:"string"},order_id:{type:"string",nullable:!0},payout_id:{type:"string",nullable:!0},reversed_from_id:{type:"string",nullable:!0},refund_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0}},required:["id","kind","status","currency","provider","reference","metadata","created_at","updated_at","amount","display_amount","settled_amount","settled_currency","converted","seller_id","order_id","payout_id","reversed_from_id","refund_id","seller_name","order_number"],"x-typelizer":!0},SetupTask:{type:"object",properties:{name:{type:"string"},done:{type:"boolean"}},required:["name","done"],"x-typelizer":!0},ShippingLabel:{type:"object",properties:{id:{type:"string"},source:{type:"string",enum:["purchased","uploaded"]},status:{anyOf:[{type:"string",enum:["purchased","refund_requested","refunded"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},tracking_number:{type:"string",nullable:!0},currency:{type:"string",nullable:!0},format:{type:"string",nullable:!0},external_id:{type:"string",nullable:!0},metadata:{type:"object"},refunded_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},owner_id:{type:"string"},owner_type:{type:"string",enum:["Spree::Fulfillment","Spree::Return"]},cost:{type:"string"},display_cost:{type:"string"},integration_id:{type:"string",nullable:!0},file_pending:{type:"boolean"},download_url:{type:"string",nullable:!0}},required:["id","source","status","carrier","carrier_name","service","tracking_number","currency","format","external_id","metadata","refunded_at","created_at","updated_at","owner_id","owner_type","cost","display_cost","integration_id","file_pending","download_url"],"x-typelizer":!0},State:{type:"object",properties:{abbr:{type:"string"},name:{type:"string"}},required:["abbr","name"],"x-typelizer":!0},StockLevel:{type:"object",properties:{id:{type:"string"},count_on_hand:{type:"number"},backorderable:{type:"boolean"},stock_location_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},external_references:{type:"object"},metadata:{type:"object"},reserved_count:{type:"number"},incoming_count:{type:"number"},purchasable_count:{type:"number"},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_location_name:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},allocated_count:{type:"number"},available_count:{type:"number"},stock_location:{$ref:"#/components/schemas/StockLocation"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","count_on_hand","backorderable","stock_location_id","variant_id","external_references","metadata","reserved_count","incoming_count","purchasable_count","variant_name","variant_sku","created_at","updated_at","stock_location_name","product_id","options_text","thumbnail_url","allocated_count","available_count"],"x-typelizer":!0},StockLocation:{type:"object",properties:{id:{type:"string"},name:{type:"string"},address1:{type:"string",nullable:!0},city:{type:"string",nullable:!0},zipcode:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},state_text:{type:"string",nullable:!0},pickup_ready_in_minutes:{type:"number",nullable:!0},pickup_instructions:{type:"string",nullable:!0},external_references:{type:"object"},admin_name:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},active:{type:"boolean"},default:{type:"boolean"},backorderable_default:{type:"boolean"},propagate_all_variants:{type:"boolean"},kind:{anyOf:[{type:"string",enum:["warehouse","store","fulfillment_center"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},pickup_enabled:{type:"boolean"},pickup_stock_policy:{type:"string",enum:["local","any"]},returns_enabled:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"}},required:["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","external_references","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","returns_enabled","created_at","updated_at","seller_id","seller_name"],"x-typelizer":!0},StockMovement:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},kind:{type:"string",nullable:!0,enum:["received","allocated","shipped","released","adjusted"]},reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_level_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},stock_location_name:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},return_id:{type:"string",nullable:!0},exchange_id:{type:"string",nullable:!0},stock_transfer_id:{type:"string",nullable:!0},stock_receipt_id:{type:"string",nullable:!0},purchase_order_id:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0},return_number:{type:"string",nullable:!0},exchange_number:{type:"string",nullable:!0},stock_transfer_number:{type:"string",nullable:!0},purchase_order_number:{type:"string",nullable:!0},unit_cost:{type:"string",nullable:!0},display_unit_cost:{type:"string",nullable:!0}},required:["id","quantity","kind","reason","created_at","updated_at","stock_level_id","stock_location_id","stock_location_name","variant_id","variant_name","variant_sku","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id","stock_receipt_id","purchase_order_id","order_number","return_number","exchange_number","stock_transfer_number","purchase_order_number","unit_cost","display_unit_cost"],"x-typelizer":!0},StockReceiptItem:{type:"object",properties:{id:{type:"string"},quantity_accepted:{type:"number"},quantity_rejected:{type:"number"},rejection_reason:{type:"string",nullable:!0,enum:["damaged","wrong_item","expired","other"]},notes:{type:"string",nullable:!0},line_type:{type:"string",enum:["purchase_order_item","stock_transfer_item"]},line_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_accepted","quantity_rejected","rejection_reason","notes","line_type","line_id","variant_id","product_id","variant_name","variant_sku","thumbnail_url"],"x-typelizer":!0},StockReceipt:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},quantity_accepted_total:{type:"number"},quantity_rejected_total:{type:"number"},received_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},receivable_type:{type:"string",enum:["purchase_order","stock_transfer"]},receivable_id:{type:"string"},received_by_id:{type:"string",nullable:!0},received_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},received_by:{$ref:"#/components/schemas/Actor"},items_count:{type:"number"},items:{type:"array",items:{$ref:"#/components/schemas/StockReceiptItem"}}},required:["id","number","reference","notes","metadata","quantity_accepted_total","quantity_rejected_total","received_at","created_at","updated_at","receivable_type","receivable_id","received_by_id","received_by_type","items_count"],"x-typelizer":!0},StockReservation:{type:"object",properties:{id:{type:"string"},stock_level_id:{type:"string"},line_item_id:{type:"string"},order_id:{type:"string"},variant_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},quantity:{type:"number"},expires_at:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","stock_level_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":!0},StockTransferItem:{type:"object",properties:{id:{type:"string"},quantity_shipped:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},stock_transfer_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_shipped","quantity_received","quantity_rejected","quantity_over","outstanding","created_at","updated_at","stock_transfer_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},StockTransfer:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},source_location_id:{type:"string"},destination_location_id:{type:"string"},status:{type:"string"},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},shipped_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_shipped_total:{type:"number"},editable:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/StockTransferItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},source_location:{$ref:"#/components/schemas/StockLocation"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","reference","created_at","updated_at","source_location_id","destination_location_id","status","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","shipped_at","received_at","closed_short_at","deleted_at","closed_short","quantity_shipped_total","editable"],"x-typelizer":!0},StoreCreditEvent:{type:"object",properties:{id:{type:"string"},action:{type:"string"},authorization_code:{type:"string",nullable:!0},display_action:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},store_credit_id:{type:"string"},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0}},required:["id","action","authorization_code","display_action","amount","display_amount","created_at","updated_at","store_credit_id","originator_type","originator_id"],"x-typelizer":!0},StoreCredit:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},currency:{type:"string"},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount_authorized:{type:"string"},outstanding:{type:"boolean"},display_amount_authorized:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"}},required:["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","amount_authorized","outstanding","display_amount_authorized","customer_id","created_by_id","originator_type","originator_id"],"x-typelizer":!0},Store:{type:"object",properties:{id:{type:"string"},metadata:{type:"object"},name:{type:"string"},code:{type:"string"},preferred_storefront_url:{type:"string",nullable:!0},default_currency:{type:"string"},default_locale:{type:"string"},default_country_code:{type:"string",nullable:!0},mail_from_address:{type:"string",nullable:!0},customer_support_email:{type:"string",nullable:!0},new_order_notifications_email:{type:"string",nullable:!0},preferred_send_consumer_transactional_emails:{type:"boolean"},preferred_admin_locale:{type:"string",nullable:!0},preferred_timezone:{type:"string"},preferred_weight_unit:{type:"string",enum:["g","kg","lb","oz"]},preferred_unit_system:{type:"string"},preferred_storefront_access:{type:"string"},preferred_guest_checkout:{type:"boolean"},preferred_always_include_confirm_step:{type:"boolean"},preferred_company_field_enabled:{type:"boolean"},preferred_address_requires_company:{type:"boolean"},preferred_address_requires_phone:{type:"boolean"},preferred_capture_method:{type:"string"},preferred_track_inventory_levels:{type:"boolean"},preferred_stock_reservations_enabled:{type:"boolean"},preferred_low_stock_threshold:{type:"number"},preferred_tax_using_ship_address:{type:"boolean"},preferred_track_price_history:{type:"boolean"},preferred_show_products_without_price:{type:"boolean"},preferred_disable_sku_validation:{type:"boolean"},preferred_order_routing_strategy:{type:"string"},preferred_pricing_provider:{type:"string"},preferred_inventory_provider:{type:"string"},preferred_pricing_provider_failure_policy:{type:"string"},preferred_inventory_provider_failure_policy:{type:"string"},preferred_payout_provider:{type:"string",nullable:!0},preferred_default_payouts_schedule_interval:{type:"string"},preferred_default_minimum_payout_amount:{type:"number"},preferred_document_number_format:{type:"string"},preferred_order_number_prefix:{type:"string"},preferred_order_number_suffix:{type:"string"},preferred_order_number_sequence_start:{type:"number"},preferred_limit_digital_download_count:{type:"boolean"},preferred_digital_asset_authorized_clicks:{type:"number"},preferred_limit_digital_download_days:{type:"boolean"},preferred_digital_asset_authorized_days:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},order_number_sequence_started:{type:"boolean"},url:{type:"string"},api_url:{type:"string"},setup_tasks:{type:"array",items:{$ref:"#/components/schemas/SetupTask"}},supported_currencies:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},available_locales:{type:"array",items:{type:"string"}},logo_url:{type:"string",nullable:!0},mailer_logo_url:{type:"string",nullable:!0}},required:["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","default_country_code","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_always_include_confirm_step","preferred_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_low_stock_threshold","preferred_tax_using_ship_address","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_order_routing_strategy","preferred_pricing_provider","preferred_inventory_provider","preferred_pricing_provider_failure_policy","preferred_inventory_provider_failure_policy","preferred_payout_provider","preferred_default_payouts_schedule_interval","preferred_default_minimum_payout_amount","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","preferred_limit_digital_download_count","preferred_digital_asset_authorized_clicks","preferred_limit_digital_download_days","preferred_digital_asset_authorized_days","created_at","updated_at","order_number_sequence_started","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":!0},Supplier:{type:"object",properties:{id:{type:"string"},name:{type:"string"},contact_name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},city:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},purchase_orders_count:{type:"number"},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},can_be_deleted:{type:"boolean"}},required:["id","name","contact_name","email","phone","notes","address1","address2","city","state_name","state_code","country_code","postal_code","purchase_orders_count","metadata","created_at","updated_at","deleted_at","can_be_deleted"],"x-typelizer":!0},TaxCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},tax_code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},is_default:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":!0},TaxExemptionCertificate:{type:"object",properties:{id:{type:"string"},certificate_number:{type:"string"},reason_code:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","verified","expired","revoked"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},issuing_authority:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},issued_at:{type:"string"},expires_at:{type:"string"},verified_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},company_id:{type:"string"},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},active:{type:"boolean"},lapsed:{type:"boolean"},can_be_deleted:{type:"boolean"},document_filename:{type:"string",nullable:!0},document_byte_size:{type:"number",nullable:!0},document_url:{type:"string",nullable:!0}},required:["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":!0},TaxIdentifier:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Tax identifier kind, keyed to a registered validator. Built-in: eu_vat. Extensions may register more."},value:{type:"string"},validation_status:{type:"string",nullable:!0,enum:["pending","verified","unverified","unavailable","unsupported"]},validation_evidence:{type:"object",nullable:!0},source:{type:"string",nullable:!0,enum:["override","company","customer"]},validated_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},validatable:{type:"boolean"},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0}},required:["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"x-typelizer":!0},TaxLine:{type:"object",properties:{id:{type:"string"},label:{type:"string"},included:{type:"boolean"},rate:{type:"string"},tax_rate_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},fee_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},provider_id:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},data:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","included","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","amount","display_amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at"],"x-typelizer":!0},TaxRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},included_in_price:{type:"boolean"},show_rate_in_label:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},amount:{type:"string"},amount_percentage:{type:"number",nullable:!0},tax_category_id:{type:"string",nullable:!0},store_id:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0}},required:["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"x-typelizer":!0},Variant:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},sku:{type:"string",nullable:!0},options_text:{type:"string"},track_inventory:{type:"boolean"},media_count:{type:"number"},preorder_ships_at:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},preorder:{type:"boolean"},weight:{type:"number",nullable:!0},height:{type:"number",nullable:!0},width:{type:"number",nullable:!0},depth:{type:"number",nullable:!0},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},purchase_unit:{type:"string",nullable:!0,enum:["unit","carton"]},units_per_carton:{type:"number",nullable:!0},price:{$ref:"#/components/schemas/Price"},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},metadata:{type:"object"},position:{type:"number"},cost_price:{type:"string",nullable:!0},cost_currency:{type:"string",nullable:!0},barcode:{type:"string",nullable:!0},backorder_limit:{type:"number",nullable:!0},hs_code:{type:"string",nullable:!0},country_of_origin:{type:"string",nullable:!0},customs_description:{type:"string",nullable:!0},carton_weight:{type:"string",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preorderable:{type:"boolean"},tax_category_id:{type:"string",nullable:!0},carton_package_type_id:{type:"string",nullable:!0},units_per_pallet:{type:"number",nullable:!0},available_stock:{type:"number",nullable:!0},reserved_quantity:{type:"number"},total_on_hand:{type:"number",nullable:!0},product_name:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},prices:{type:"array",items:{$ref:"#/components/schemas/Price"}},stock_levels:{type:"array",items:{$ref:"#/components/schemas/StockLevel"}}},required:["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","weight_unit","dimensions_unit","minimum_order_quantity","order_multiple","purchase_unit","units_per_carton","price","original_price","seller_id","option_values","external_references","metadata","position","cost_price","cost_currency","barcode","backorder_limit","hs_code","country_of_origin","customs_description","carton_weight","cartons_per_pallet","deleted_at","created_at","updated_at","preorderable","tax_category_id","carton_package_type_id","units_per_pallet","available_stock","reserved_quantity","total_on_hand","product_name","delivery_profile_id"],"x-typelizer":!0},WebhookDelivery:{type:"object",properties:{id:{type:"string"},event_name:{type:"string"},event_id:{type:"string",nullable:!0},response_code:{type:"number",nullable:!0},execution_time:{type:"number",nullable:!0},error_type:{type:"string",nullable:!0},request_errors:{type:"string",nullable:!0},response_body:{type:"string",nullable:!0},success:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivered_at:{type:"string",nullable:!0},payload:{type:"object"},webhook_endpoint_id:{type:"string"},webhook_endpoint_url:{type:"string"}},required:["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":!0},WebhookEndpoint:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},url:{type:"string"},active:{type:"boolean"},subscriptions:{type:"array",items:{type:"string"}},disabled_reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},disabled_at:{type:"string",nullable:!0},secret_key:{type:"string",nullable:!0},last_delivery_at:{type:"string",nullable:!0},recent_delivery_count:{type:"number"},recent_failure_count:{type:"number"},total_delivery_count:{type:"number"},successful_delivery_count:{type:"number"},failed_delivery_count:{type:"number"}},required:["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":!0}}}};var ih=new Set(["get","post","put","patch","delete"]);function Tn(){return th}function h0(e){let t=e.description?.match(/\*\*Required scope:\*\* (.+?) \(for API-key authentication\)\./);return t?t[1].replaceAll("`",""):"\u2014"}function nh(e,t={}){let r=[];for(let[i,n]of Object.entries(e.paths)){let s=i.replace("/api/v3/admin","")||"/";for(let[a,o]of Object.entries(n)){if(!ih.has(a))continue;if(t.resource){let d=s.split("/")[1]??"";if(d!==t.resource&&!d.startsWith(t.resource))continue}let p=o.summary??"";t.search&&!`${a} ${s} ${p}`.toLowerCase().includes(t.search.toLowerCase())||r.push({method:a.toUpperCase(),path:s,scope:h0(o),summary:p})}}return r}function sh(e,t){let r=t.trim().split(/\s+/),i=r.length>1?r[0].toLowerCase():void 0,n=r.length>1?r[1]:r[0],s=Br(n),a=rh(e,i,o=>o===s);return a.length>0?a:rh(e,i,o=>y0(o,s))}function rh(e,t,r){let i=[];for(let[n,s]of Object.entries(e.paths)){let a=n.replace("/api/v3/admin","")||"/";if(r(a))for(let[o,p]of Object.entries(s))ih.has(o)&&(t&&o!==t||i.push({method:o.toUpperCase(),path:a,summary:p.summary,description:p.description,parameters:tr(p.parameters,e),requestBody:tr(p.requestBody,e),responses:tr(p.responses,e)}))}return i}function y0(e,t){if(e===t)return!0;let r=e.split("/"),i=t.split("/");return r.length!==i.length?!1:r.every((n,s)=>n.startsWith("{")&&n.endsWith("}")?i[s].length>0:n===i[s])}var g0=8;function tr(e,t,r=[]){if(Array.isArray(e))return e.map(a=>tr(a,t,r));if(!e||typeof e!="object")return e;let i=e,n=i.$ref;if(typeof n=="string"){let a=n.replace("#/components/schemas/","");return r.includes(a)||r.length>=g0||!(a in t.components.schemas)?{$ref:n}:tr(t.components.schemas[a],t,[...r,a])}let s={};for(let[a,o]of Object.entries(i))s[a]=tr(o,t,r);return s}function f0(e,t){return[...t,e]}function ch(e){return e.option("--profile <name>","use a saved profile (see `spree auth`)").option("--base-url <url>","store URL (overrides profile/env/project)").option("--api-key <key>","secret API key (prefer SPREE_API_KEY \u2014 flags leak into shell history)").option("--store-id <id>","X-Spree-Store-Id for hosts serving multiple stores")}function dh(){return new Fo("--format <format>","output format").choices(["json","table"]).default("json")}function ah(e){return ch(e).addOption(dh())}async function oh(e){let t=await Pr({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile});return{client:jr({baseUrl:t.baseUrl,secretKey:t.apiKey,...e.storeId?{storeId:e.storeId}:{}}),credentials:t}}function uh(e){let t=e.command("api").description("Call the Admin API directly (generic get/post/patch/delete)");t.addHelpText("after",["","Examples:"," spree api get /products -q status_eq=active --limit 10",` spree api post /products -d '{"name":"Classic Tee","prices":[{"currency":"USD","amount":"29.99"}]}'`," spree api get /orders/ord_x8k2J9aQ --expand items,payments","","Discover the surface (offline, no server needed):"," spree api endpoints --search <term> # find endpoints + required scopes",' spree api schema "POST /orders" # request/response schema for one operation'," spree completion zsh # tab-completion for paths, filters, scopes"].join(`
879
+ `)),ah(t.command("get <path>").description("GET an Admin API path, e.g. `spree api get /products -q status_eq=active`").option("-q, --query <expr>","Ransack predicate key=value (repeatable)",f0,[]).option("--sort <fields>","sort, e.g. -created_at").option("--page <n>","page number").option("--limit <n>","page size (max 100)").option("--expand <relations>","expand relations, e.g. variants,variants.prices").option("--fields <fields>","sparse fields, e.g. id,name")).action(async(r,i)=>{let n;try{let s=Qm(i),{client:a,credentials:o}=await oh(i);n=o.baseUrl;let p=await a.request("GET",Br(r),{params:s});Lr(p,i.format)}catch(s){Pt(s,{baseUrl:n})}});for(let r of["post","patch","delete"])ah(t.command(`${r} <path>`).description(`${r.toUpperCase()} an Admin API path`).option("-d, --data <json>","request body: inline JSON, @file, or '-' for stdin")).action(async(i,n)=>{let s;try{let a=await Jm(n.data),{client:o,credentials:p}=await oh(n);s=p.baseUrl;let d=await o.request(r.toUpperCase(),Br(i),{...a===bo?{}:{body:a}});Lr(d,n.format)}catch(a){Pt(a,{baseUrl:s})}});t.command("endpoints").description("List Admin API endpoints with their required scopes").option("--resource <name>","filter by first path segment, e.g. orders").option("--search <term>","filter by method, path, or summary").addOption(dh()).action(r=>{let i=nh(Tn(),{resource:r.resource,search:r.search});if(i.length===0){process.stderr.write(`No endpoints match.
880
+ `),process.exitCode=1;return}if(r.format==="table"){(0,ph.printTable)(i.map(n=>({Method:n.method,Path:n.path,Scope:n.scope,Summary:n.summary})));return}Lr(i,"json")}),t.command("schema <operation>").description('Show the request/response schema for an operation, e.g. `spree api schema "POST /products"`').action(r=>{let i=sh(Tn(),r);if(i.length===0){process.stderr.write(`No operation matches "${r}". Try \`spree api endpoints --search ${r.split(/\s+/).pop()}\`.
881
+ `),process.exitCode=1;return}let n=/\s/.test(r.trim());Lr(n&&i.length===1?i[0]:i,"json")}),ch(t.command("status").description("Show resolved credentials, server reachability, and the bundled spec version")).action(async r=>{try{let i=await Pr({baseUrl:r.baseUrl,apiKey:r.apiKey,profile:r.profile},{allowMint:!1}),n=await zr(i.baseUrl,i.apiKey),s=Tn(),a=Cn(n),o=[`${Re.default.bold("Base URL:")} ${i.baseUrl}`,`${Re.default.bold("Credentials:")} ${i.source}${i.profileName?` (${i.profileName})`:""}, key ${i.tokenPrefix}${Re.default.dim("\u2026")}`],p=n.status==="unreachable"||n.status==="unauthorized"?null:await eh(i.baseUrl,i.apiKey);p!==null?o.push(`${Re.default.bold("Scopes:")} ${p.length?p.join(", "):Re.default.dim("(none)")}`):i.scopes?.length&&o.push(`${Re.default.bold("Scopes:")} ${i.scopes.join(", ")} ${Re.default.dim("(local snapshot from mint time \u2014 may be stale)")}`),o.push(`${Re.default.bold("Server:")} ${a}`),o.push(`${Re.default.bold("Bundled spec:")} ${s.info?.version??"unknown"} ${Re.default.dim("(spree api endpoints/schema reflect this snapshot, not the live server)")}`),process.stdout.write(`${o.join(`
882
882
  `)}
883
- `),jn(n)&&(process.exitCode=1)}catch(i){Pt(i,{baseUrl:r.baseUrl})}})}var uh=D(Dr(),1),it=D(K(),1);function lh(e){let t=e.command("api-key").description("Manage API keys");t.command("create").description("Create an API key").option("--name <name>","key name").option("--type <type>","key type: publishable or secret").option("--scopes <scopes>","comma-separated scopes for secret keys (e.g. read_all or read_orders,write_products)").action(async r=>{let i=b(),n=r.name,s=r.type,a=r.scopes;if(!n){let m=await le({message:"Key name:",placeholder:"My Storefront",validate(h){if(!h)return"Name is required"}});L(m)&&(j("Cancelled."),process.exit(0)),n=m}if(!s){let m=await li({message:"Key type:",options:[{value:"publishable",label:"Publishable (for storefronts)"},{value:"secret",label:"Secret (for server-to-server)"}]});L(m)&&(j("Cancelled."),process.exit(0)),s=m}if(s!=="publishable"&&s!=="secret")throw new Error('Key type must be "publishable" or "secret".');if(s==="secret"&&!a){let m=await le({message:"Scopes (comma-separated):",placeholder:"read_all",initialValue:"read_all",validate(h){if(!h)return"Secret keys require at least one scope"}});L(m)&&(j("Cancelled."),process.exit(0)),a=m}let o=I();o.start("Creating API key...");let p=await ne("spree:cli:create_api_key",i.projectDir,{NAME:n,KEY_TYPE:s,...s==="secret"&&a?{SCOPES:a}:{}}),d=s==="publishable"?"pk_":"sk_",c=p.match(new RegExp(`${d}[A-Za-z0-9_-]+`)),u=c?c[0]:p.trim();o.stop("API key created.");let l=[`${it.default.bold("Name:")} ${n}`,`${it.default.bold("Type:")} ${s}`,`${it.default.bold("Token:")} ${it.default.cyan(u)}`];s==="secret"&&(l.push(`${it.default.bold("Scopes:")} ${a}`),l.push(""),l.push(it.default.yellow("Save this token now \u2014 secret keys cannot be retrieved later."))),V(l.join(`
884
- `),"API Key")}),t.command("list").description("List API keys").action(async()=>{let r=b(),i=I();i.start("Fetching API keys...");let n=await ne("spree:cli:list_api_keys",r.projectDir);i.stop("");let s=n.trim().split(`
885
- `).filter(Boolean);if(s.length===0){q.info("No API keys found.");return}let a=s.map(o=>{let[p,d,c,u,l,m]=o.split("|");return{ID:p??"",Name:d??"",Type:c??"",Token:u??"",Created:l??"",Status:m==="active"?it.default.green(m):it.default.red(m??"")}});(0,uh.printTable)(a)}),t.command("revoke").description("Revoke an API key").argument("<id>","ID of the key to revoke (from api-key list)").action(async r=>{let i=b(),n=I();n.start("Revoking API key...");let a=(await ne("spree:cli:revoke_api_key",i.projectDir,{ID:r})).trim();n.stop(`API key "${a}" revoked.`)})}var mh=D(Dr(),1),ie=D(K(),1);function hh(e){let t=e.command("auth").description("Manage Admin API credentials (profiles in ~/.config/spree)");t.command("login").description("Save a secret API key as a named profile").option("--profile <name>","profile name","default").option("--base-url <url>","store URL, e.g. https://store.example.com").action(async r=>{process.stdin.isTTY||(process.stderr.write(`${ie.default.red("error:")} \`spree auth login\` is interactive. For non-interactive use, set SPREE_BASE_URL + SPREE_API_KEY (or pass --base-url/--api-key to \`spree api\`).
883
+ `),jn(n)&&(process.exitCode=1)}catch(i){Pt(i,{baseUrl:r.baseUrl})}})}var lh=D(Dr(),1),it=D(K(),1);function mh(e){let t=e.command("api-key").description("Manage API keys");t.command("create").description("Create an API key").option("--name <name>","key name").option("--type <type>","key type: publishable or secret").option("--scopes <scopes>","comma-separated scopes for secret keys (e.g. read_all or read_orders,write_products)").action(async r=>{let i=b(),n=r.name,s=r.type,a=r.scopes;if(!n){let c=await le({message:"Key name:",placeholder:"My Storefront",validate(u){if(!u)return"Name is required"}});L(c)&&(j("Cancelled."),process.exit(0)),n=c}if(!s){let c=await li({message:"Key type:",options:[{value:"publishable",label:"Publishable (for storefronts)"},{value:"secret",label:"Secret (for server-to-server)"}]});L(c)&&(j("Cancelled."),process.exit(0)),s=c}if(s!=="publishable"&&s!=="secret")throw new Error('Key type must be "publishable" or "secret".');if(s==="secret"&&!a){let c=await le({message:"Scopes (comma-separated):",placeholder:"read_all",initialValue:"read_all",validate(u){if(!u)return"Secret keys require at least one scope"}});L(c)&&(j("Cancelled."),process.exit(0)),a=c}let o=I();o.start("Creating API key...");let p=await Za(i.projectDir,{name:n,keyType:s,scopes:s==="secret"&&a?a.split(",").map(c=>c.trim()):[]});o.stop("API key created.");let d=[`${it.default.bold("Name:")} ${n}`,`${it.default.bold("Type:")} ${s}`,`${it.default.bold("Token:")} ${it.default.cyan(p)}`];s==="secret"&&(d.push(`${it.default.bold("Scopes:")} ${a}`),d.push(""),d.push(it.default.yellow("Save this token now \u2014 secret keys cannot be retrieved later."))),V(d.join(`
884
+ `),"API Key")}),t.command("list").description("List API keys").action(async()=>{let r=b(),i=I();i.start("Fetching API keys...");let n=await se("spree:cli:list_api_keys",r.projectDir);i.stop("");let s=n.trim().split(`
885
+ `).filter(Boolean);if(s.length===0){q.info("No API keys found.");return}let a=s.map(o=>{let[p,d,c,u,l,m]=o.split("|");return{ID:p??"",Name:d??"",Type:c??"",Token:u??"",Created:l??"",Status:m==="active"?it.default.green(m):it.default.red(m??"")}});(0,lh.printTable)(a)}),t.command("revoke").description("Revoke an API key").argument("<id>","ID of the key to revoke (from api-key list)").action(async r=>{let i=b(),n=I();n.start("Revoking API key...");let a=(await se("spree:cli:revoke_api_key",i.projectDir,{ID:r})).trim();n.stop(`API key "${a}" revoked.`)})}var hh=D(Dr(),1),ie=D(K(),1);function yh(e){let t=e.command("auth").description("Manage Admin API credentials (profiles in ~/.config/spree)");t.command("login").description("Save a secret API key as a named profile").option("--profile <name>","profile name","default").option("--base-url <url>","store URL, e.g. https://store.example.com").action(async r=>{process.stdin.isTTY||(process.stderr.write(`${ie.default.red("error:")} \`spree auth login\` is interactive. For non-interactive use, set SPREE_BASE_URL + SPREE_API_KEY (or pass --base-url/--api-key to \`spree api\`).
886
886
  `),process.exit(2));let i=r.baseUrl;if(!i){let d=await le({message:"Store URL:",placeholder:"https://store.example.com",validate(c){if(!c)return"URL is required";if(!/^https?:\/\//.test(c))return"Must start with http:// or https://"}});L(d)&&(j("Cancelled."),process.exit(130)),i=d}i=i.replace(/\/$/,"");let n=await ui({message:"Secret API key (sk_...):",validate(d){if(!d)return"Key is required";if(!d.startsWith("sk_"))return"Admin API keys start with sk_"}});L(n)&&(j("Cancelled."),process.exit(130));let s=n,a=I();a.start("Validating credentials...");let o=await zr(i,s);o.status==="unauthorized"&&(a.stop(ie.default.red("The server rejected this key (401). Check the key and try again.")),process.exit(2)),o.status==="unreachable"&&(a.stop(ie.default.red(`Could not reach ${i}: ${o.message}`)),process.exit(2)),a.stop(o.storeName?`Connected to ${ie.default.bold(o.storeName)}.`:"Credentials accepted (key lacks read_settings, so the store name is hidden \u2014 that is fine).");let p=Er();p.profiles[r.profile]={baseUrl:i,token:s},p.defaultProfile||=r.profile,Ya(p),V([`${ie.default.bold("Profile:")} ${r.profile}${p.defaultProfile===r.profile?ie.default.dim(" (default)"):""}`,`${ie.default.bold("Base URL:")} ${i}`,`${ie.default.bold("Key:")} ${An(s)}${ie.default.dim("\u2026")}`,"",ie.default.dim(`Saved to ${At()}`)].join(`
887
887
  `),"Logged in")}),t.command("status").description("Show which credentials `spree api` would use, and verify them").option("--profile <name>","check a specific profile").action(async r=>{let i;try{i=await Pr({profile:r.profile},{allowMint:!1})}catch(o){Pt(o)}let n=I();n.start("Checking server...");let s=await zr(i.baseUrl,i.apiKey);n.stop("");let a=Cn(s);V([`${ie.default.bold("Source:")} ${i.source}${i.profileName?` (${i.profileName})`:""}`,`${ie.default.bold("Base URL:")} ${i.baseUrl}`,`${ie.default.bold("Key:")} ${i.tokenPrefix}${ie.default.dim("\u2026")}`,...i.scopes?[`${ie.default.bold("Scopes:")} ${i.scopes.join(", ")}`]:[],`${ie.default.bold("Server:")} ${a}`].join(`
888
888
  `),"Auth status"),jn(s)&&(process.exitCode=1)}),t.command("logout").description("Remove a saved profile (or the project credentials)").option("--profile <name>","profile to remove","default").option("--project","remove .spree/credentials.json from the current project instead").action(async r=>{if(r.project){let n;try{n=b().projectDir}catch(a){Pt(a)}(await import("fs")).rmSync(Yt(n),{force:!0}),q.success("Removed project credentials. The next `spree api` call mints a fresh read-only key.");return}let i=Er();if(!i.profiles[r.profile]){let n=Object.keys(i.profiles),s=n.length?` Saved profiles: ${n.join(", ")}.`:" No profiles are saved.";process.stderr.write(`${ie.default.red("error:")} no profile named "${r.profile}".${s}
889
- `),process.exit(2)}delete i.profiles[r.profile],i.defaultProfile===r.profile&&(i.defaultProfile=Object.keys(i.profiles)[0]),Ya(i),q.success(`Removed profile "${r.profile}". The key itself stays active \u2014 revoke it with \`spree api-key revoke\` or in the admin.`)}),t.command("list").description("List saved profiles").action(()=>{let r=Er(),i=Object.keys(r.profiles);if(i.length===0){q.info("No profiles saved. Run `spree auth login` to add one.");return}(0,mh.printTable)(i.map(n=>({Profile:r.defaultProfile===n?`${n} *`:n,"Base URL":r.profiles[n].baseUrl,Key:`${An(r.profiles[n].token)}\u2026`})))})}import Mr from"fs";import rr from"path";var oe=D(K(),1);function yh(e){e.command("build").description("Rebuild the dev image (after Dockerfile / .ruby-version changes)").option("--reset-bundle","also wipe the bundle_cache volume to re-seed gems").option("--yes","skip confirmation prompts (for CI)").option("--production","build the production image instead \u2014 includes apps/dashboard when present").option("--tag <tag>","image tag for --production (default: <project>-spree:latest)").action(async t=>{if(t.production){await k0(b().projectDir,t.tag);return}await f0(t)})}async function f0(e){let t=b();if(Fe(t.projectDir)&&(j(["This project uses SPREE_PATH for monorepo development.",`Use ${oe.default.bold("pnpm server:build")} from the monorepo root instead of ${oe.default.bold("spree build")}.`,"It builds against the edge compose overlay the running stack was started with."].join(`
889
+ `),process.exit(2)}delete i.profiles[r.profile],i.defaultProfile===r.profile&&(i.defaultProfile=Object.keys(i.profiles)[0]),Ya(i),q.success(`Removed profile "${r.profile}". The key itself stays active \u2014 revoke it with \`spree api-key revoke\` or in the admin.`)}),t.command("list").description("List saved profiles").action(()=>{let r=Er(),i=Object.keys(r.profiles);if(i.length===0){q.info("No profiles saved. Run `spree auth login` to add one.");return}(0,hh.printTable)(i.map(n=>({Profile:r.defaultProfile===n?`${n} *`:n,"Base URL":r.profiles[n].baseUrl,Key:`${An(r.profiles[n].token)}\u2026`})))})}import Mr from"fs";import rr from"path";var oe=D(K(),1);function gh(e){e.command("build").description("Rebuild the dev image (after Dockerfile / .ruby-version changes)").option("--reset-bundle","also wipe the bundle_cache volume to re-seed gems").option("--yes","skip confirmation prompts (for CI)").option("--production","build the production image instead \u2014 includes apps/dashboard when present").option("--tag <tag>","image tag for --production (default: <project>-spree:latest)").action(async t=>{if(t.production){await v0(b().projectDir,t.tag);return}await _0(t)})}async function _0(e){let t=b();if(Fe(t.projectDir)&&(j(["This project uses SPREE_PATH for monorepo development.",`Use ${oe.default.bold("pnpm server:build")} from the monorepo root instead of ${oe.default.bold("spree build")}.`,"It builds against the edge compose overlay the running stack was started with."].join(`
890
890
  `)),process.exit(1)),Sn(t.projectDir)||(console.error(`
891
891
  ${oe.default.red("Error:")} docker-compose.yml has no \`build:\` section. Run ${oe.default.bold("spree eject")} first to switch to a build-from-source stack.
892
- `),process.exit(1)),e.resetBundle){if(!e.yes){let i=await Je({message:"Wipe the bundle_cache volume? Any gems added via `spree bundle add` since the last image build will be lost.",initialValue:!1});(L(i)||!i)&&(j("Build cancelled."),process.exit(0))}let r=I();r.start("Wiping bundle_cache volume...");try{await Z(["down"],t.projectDir,{stdio:"ignore"});let n=`${await v0(t.projectDir)}_bundle_cache`;await w0(n,t.projectDir)?(await te("docker",["volume","rm",n],{cwd:t.projectDir,stdio:"ignore"}),r.stop("bundle_cache volume wiped.")):r.stop(`bundle_cache volume not present (looked for ${n}).`)}catch(i){throw r.stop("Failed to wipe bundle_cache volume."),i}}console.log(`
892
+ `),process.exit(1)),e.resetBundle){if(!e.yes){let i=await Je({message:"Wipe the bundle_cache volume? Any gems added via `spree bundle add` since the last image build will be lost.",initialValue:!1});(L(i)||!i)&&(j("Build cancelled."),process.exit(0))}let r=I();r.start("Wiping bundle_cache volume...");try{await Z(["down"],t.projectDir,{stdio:"ignore"});let n=`${await w0(t.projectDir)}_bundle_cache`;await x0(n,t.projectDir)?(await te("docker",["volume","rm",n],{cwd:t.projectDir,stdio:"ignore"}),r.stop("bundle_cache volume wiped.")):r.stop(`bundle_cache volume not present (looked for ${n}).`)}catch(i){throw r.stop("Failed to wipe bundle_cache volume."),i}}console.log(`
893
893
  ${oe.default.bold("Rebuilding dev image...")}
894
894
  `),await Z(["build",...await Ge(t.projectDir)],t.projectDir,{stdio:"inherit"}),V([`Image rebuilt. Start the stack with ${oe.default.bold("spree dev")}.`,e.resetBundle?`On next boot, gems will re-seed into a fresh ${oe.default.dim("bundle_cache")} volume.`:""].filter(Boolean).join(`
895
- `),"Build complete")}function _0(e,t){let r=xn(e),i=rr.join(e,r),n=rr.join(i,"Dockerfile");if(!Mr.existsSync(n))throw new Error(`No ${r}/Dockerfile found. Is this a create-spree-app project?`);let s=t??`${rr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}-spree:latest`,a=Mr.existsSync(rr.join(e,"apps","dashboard","package.json"));return Mr.readFileSync(n,"utf-8").includes(".spree-custom-dashboard")?(b0(e),{args:["build",e,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"custom":"stock-or-none"}):{args:["build",i,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"unsupported-dockerfile":"stock-or-none"}}function b0(e){let t=rr.join(e,".dockerignore");Mr.existsSync(t)||Mr.writeFileSync(t,q0)}var q0=`# Build context for server/Dockerfile (repo root): keep it to sources.
895
+ `),"Build complete")}function b0(e,t){let r=xn(e),i=rr.join(e,r),n=rr.join(i,"Dockerfile");if(!Mr.existsSync(n))throw new Error(`No ${r}/Dockerfile found. Is this a create-spree-app project?`);let s=t??`${rr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}-spree:latest`,a=Mr.existsSync(rr.join(e,"apps","dashboard","package.json"));return Mr.readFileSync(n,"utf-8").includes(".spree-custom-dashboard")?(q0(e),{args:["build",e,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"custom":"stock-or-none"}):{args:["build",i,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"unsupported-dockerfile":"stock-or-none"}}function q0(e){let t=rr.join(e,".dockerignore");Mr.existsSync(t)||Mr.writeFileSync(t,k0)}var k0=`# Build context for server/Dockerfile (repo root): keep it to sources.
896
896
  **/node_modules
897
897
  **/.git
898
898
  .spree
@@ -908,12 +908,12 @@ backend/log
908
908
  backend/tmp
909
909
  backend/storage
910
910
  backend/.env*
911
- `;async function k0(e,t){let r;try{r=_0(e,t)}catch(i){console.error(`
911
+ `;async function v0(e,t){let r;try{r=b0(e,t)}catch(i){console.error(`
912
912
  ${oe.default.red("Error:")} ${i instanceof Error?i.message:String(i)}
913
913
  `),process.exit(1)}r.dashboard==="custom"?q.info(`Including your dashboard from ${oe.default.bold("apps/dashboard/")} (built in-image).`):r.dashboard==="unsupported-dockerfile"&&q.warn(`${oe.default.bold("apps/dashboard/")} exists, but ${oe.default.bold(`${r.apiDir}/Dockerfile`)} predates dashboard support \u2014 the image will NOT include your dashboard. Update the Dockerfile from the spree-starter template to bake it in.`),console.log(`
914
914
  ${oe.default.bold(`Building production image ${r.imageTag}...`)}
915
915
  `),await te("docker",r.args,{cwd:e,stdio:"inherit"}),V([`Run it: ${oe.default.cyan(`docker run --rm -p 3000:3000 ${r.imageTag}`)}`,`Push it: ${oe.default.cyan(`docker tag ${r.imageTag} <registry>/<repo> && docker push <registry>/<repo>`)}`,r.dashboard!=="unsupported-dockerfile"?`Dashboard: served at ${oe.default.bold("/dashboard")} on the same origin as the API.`:""].filter(Boolean).join(`
916
- `),"Production image built")}async function v0(e){try{let{stdout:t}=await te("docker",["compose","config","--format","json"],{cwd:e}),r=JSON.parse(t);if(r.name)return r.name}catch{}return rr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}async function w0(e,t){try{return await te("docker",["volume","inspect",e],{cwd:t,stdio:"ignore"}),!0}catch{return!1}}function gh(e){e.command("bundle").description("Run a bundler command (`bundle \u2026`) inside the web container").argument("<args...>","arguments to pass to bundle").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bundle",...t],r.projectDir,{edgeHint:"the edge stack heals gem drift on boot"})})}var fh=["/admin_users","/allowed_origins","/api_keys","/auth","/catalogs","/categories","/channels","/claim_reasons","/collection_rules","/collections","/commission_lines","/commission_rates","/companies","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/media","/option_types","/order_cancellation_reasons","/order_routing_rules","/orders","/package_types","/payment_methods","/permissions","/policies","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/purchase_orders","/refund_reasons","/return_reasons","/roles","/seller_payouts","/seller_requirements","/sellers","/stock_levels","/stock_locations","/stock_movements","/stock_transfers","/store","/store_credits","/suppliers","/tags","/tax_rates","/translatable_resources","/translations","/webhook_endpoints"];var _h=["bash","zsh","fish"],S0=["eq","not_eq","cont","not_cont","start","end","in","not_in","gt","gteq","lt","lteq","null","not_null","present","blank"],$0=["get","post","patch","delete","endpoints","schema","status"],A0=["read_all","write_all","read_orders","write_orders","read_products","write_products","read_media","write_media","read_promotions","write_promotions","read_customers","write_customers","read_payments","write_payments","read_fulfillments","write_fulfillments","read_refunds","write_refunds","read_gift_cards","write_gift_cards","read_store_credits","write_store_credits","read_stock","write_stock","read_categories","write_categories","read_collections","write_collections","read_settings","write_settings","read_webhooks","write_webhooks","read_api_keys","write_api_keys","read_staff","write_staff","read_dashboard"];function E0(e){let[t,r,...i]=e,n=e[e.length-1]??"",s=e[e.length-2]??"";if(e.length<=1)return Rn(["api","auth",...P0],n);if((s==="-q"||s==="--query")&&n.includes("_")&&!n.includes("=")){let a=n.slice(0,n.lastIndexOf("_")+1);return S0.map(o=>`${a}${o}=`)}if(s==="--scopes"){let a=n.includes(",")?n.slice(n.lastIndexOf(",")+1):n,o=n.slice(0,n.length-a.length);return Rn(A0,a).map(p=>o+p)}if(t==="api"){if(e.length===2)return Rn($0,n);if(["get","post","patch","delete","schema"].includes(r)&&i.length<=1)return Rn(fh,n)}return[]}var P0=["api-key","dev","console","migrate"];function Rn(e,t){return t?e.filter(r=>r.startsWith(t)):e}function j0(e){return e==="fish"?`# spree fish completion \u2014 eval "$(spree completion fish)"
916
+ `),"Production image built")}async function w0(e){try{let{stdout:t}=await te("docker",["compose","config","--format","json"],{cwd:e}),r=JSON.parse(t);if(r.name)return r.name}catch{}return rr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}async function x0(e,t){try{return await te("docker",["volume","inspect",e],{cwd:t,stdio:"ignore"}),!0}catch{return!1}}function fh(e){e.command("bundle").description("Run a bundler command (`bundle \u2026`) inside the web container").argument("<args...>","arguments to pass to bundle").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bundle",...t],r.projectDir,{edgeHint:"the edge stack heals gem drift on boot"})})}var _h=["/admin_users","/allowed_origins","/api_keys","/auth","/catalogs","/categories","/channels","/claim_reasons","/collection_rules","/collections","/commission_lines","/commission_rates","/companies","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/media","/option_types","/order_cancellation_reasons","/order_routing_rules","/orders","/package_types","/payment_methods","/permissions","/policies","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/purchase_orders","/refund_reasons","/return_reasons","/roles","/seller_payouts","/seller_requirements","/sellers","/stock_levels","/stock_locations","/stock_movements","/stock_transfers","/store","/store_credits","/suppliers","/tags","/tax_rates","/translatable_resources","/translations","/webhook_endpoints"];var bh=["bash","zsh","fish"],$0=["eq","not_eq","cont","not_cont","start","end","in","not_in","gt","gteq","lt","lteq","null","not_null","present","blank"],A0=["get","post","patch","delete","endpoints","schema","status"],E0=["read_all","write_all","read_orders","write_orders","read_products","write_products","read_media","write_media","read_promotions","write_promotions","read_customers","write_customers","read_payments","write_payments","read_fulfillments","write_fulfillments","read_refunds","write_refunds","read_gift_cards","write_gift_cards","read_store_credits","write_store_credits","read_stock","write_stock","read_categories","write_categories","read_collections","write_collections","read_settings","write_settings","read_webhooks","write_webhooks","read_api_keys","write_api_keys","read_staff","write_staff","read_dashboard"];function P0(e){let[t,r,...i]=e,n=e[e.length-1]??"",s=e[e.length-2]??"";if(e.length<=1)return Rn(["api","auth",...j0],n);if((s==="-q"||s==="--query")&&n.includes("_")&&!n.includes("=")){let a=n.slice(0,n.lastIndexOf("_")+1);return $0.map(o=>`${a}${o}=`)}if(s==="--scopes"){let a=n.includes(",")?n.slice(n.lastIndexOf(",")+1):n,o=n.slice(0,n.length-a.length);return Rn(E0,a).map(p=>o+p)}if(t==="api"){if(e.length===2)return Rn(A0,n);if(["get","post","patch","delete","schema"].includes(r)&&i.length<=1)return Rn(_h,n)}return[]}var j0=["api-key","dev","console","migrate"];function Rn(e,t){return t?e.filter(r=>r.startsWith(t)):e}function C0(e){return e==="fish"?`# spree fish completion \u2014 eval "$(spree completion fish)"
917
917
  function __spree_complete
918
918
  set -l tokens (commandline -opc) (commandline -ct)
919
919
  spree __complete $tokens[2..-1]
@@ -932,43 +932,43 @@ _spree() {
932
932
  COMPREPLY=( $(spree __complete "\${words[@]}") )
933
933
  }
934
934
  complete -F _spree spree
935
- `}function bh(e){e.command("completion <shell>").description("Output a shell completion script (bash, zsh, or fish)").action(t=>{if(!_h.includes(t)){process.stderr.write(`Unsupported shell "${t}". Choose one of: ${_h.join(", ")}.
936
- `),process.exitCode=2;return}process.stdout.write(j0(t))}),e.command("__complete",{hidden:!0}).allowUnknownOption().argument("[words...]").action(t=>{for(let r of E0(t??[]))process.stdout.write(`${r}
937
- `)})}function qh(e){e.command("console").description("Open Rails console").action(async()=>{let t=b();await M(["bin/rails","console"],t.projectDir,{edgeHint:"then open the console"})})}var Ie=D(K(),1);var C0=["bin/rails","db:drop","db:create","spree:install:migrations","db:migrate","db:seed"];function kh(e){e.command("db:reset").description("Drop, create, migrate, and seed the dev database (destructive; self-heals a running stack)").option("--yes","skip the confirmation prompt (for CI)").action(async t=>{let r=b(),i=a=>{j(a.join(`
935
+ `}function qh(e){e.command("completion <shell>").description("Output a shell completion script (bash, zsh, or fish)").action(t=>{if(!bh.includes(t)){process.stderr.write(`Unsupported shell "${t}". Choose one of: ${bh.join(", ")}.
936
+ `),process.exitCode=2;return}process.stdout.write(C0(t))}),e.command("__complete",{hidden:!0}).allowUnknownOption().argument("[words...]").action(t=>{for(let r of P0(t??[]))process.stdout.write(`${r}
937
+ `)})}function kh(e){e.command("console").description("Open Rails console").action(async()=>{let t=b();await M(["bin/rails","console"],t.projectDir,{edgeHint:"then open the console"})})}var Ie=D(K(),1);var T0=["bin/rails","db:drop","db:create","spree:install:migrations","db:migrate","db:seed"];function vh(e){e.command("db:reset").description("Drop, create, migrate, and seed the dev database (destructive; self-heals a running stack)").option("--yes","skip the confirmation prompt (for CI)").action(async t=>{let r=b(),i=a=>{j(a.join(`
938
938
  `)),process.exit(1)};if(Fe(r.projectDir)&&i(["This is a monorepo edge project (SPREE_PATH set in .env).",`Reset the dev database from the monorepo root with ${Ie.default.bold("pnpm server:setup")}`,"(or the relevant `pnpm server:*` script) \u2014 the project-local compose is not the","running config here."]),!t.yes){let a=await Je({message:"This will drop the spree_development database. Continue?",initialValue:!1});(L(a)||!a)&&(j("Cancelled."),process.exit(0))}let n,s;try{s=await Ge(r.projectDir),n=(await Promise.all(s.map(o=>mt(o,r.projectDir)))).some(Boolean)}catch(a){return i(["Could not inspect the Docker stack from this directory.",` ${Ie.default.dim(String(a.message).split(`
939
- `)[0])}`,"",`Run ${Ie.default.bold("spree db:reset")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}if(n){let a=I();a.start("Stopping the app to release database connections..."),await Z(["stop",...s],r.projectDir),a.stop("App stopped.")}try{await Va(C0,r.projectDir,{captureStderr:!0})}catch(a){let o=String(a.stderr??a.message??"");throw/being accessed by other users|55006/.test(o)&&i(["Could not drop spree_development \u2014 another client is still connected.",`A database client (TablePlus, DataGrip, psql) may be connected on port ${Ie.default.bold("5433")}.`,"Disconnect it, then re-run `spree db:reset`.",...n?["",`Bring the stack back up with ${Ie.default.bold("spree dev")}.`]:[]]),a}q.success("Database reset."),n&&V(`Bring the stack back up with ${Ie.default.bold("spree dev")}.`,"Done")}),e.command("db:console").description("Open a psql session against the dev database").action(async()=>{let t=b(),r;try{r=await mt("postgres",t.projectDir)}catch(i){j(["Could not inspect the Docker stack from this directory.",` ${Ie.default.dim(String(i.message).split(`
939
+ `)[0])}`,"",`Run ${Ie.default.bold("spree db:reset")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}if(n){let a=I();a.start("Stopping the app to release database connections..."),await Z(["stop",...s],r.projectDir),a.stop("App stopped.")}try{await Va(T0,r.projectDir,{captureStderr:!0})}catch(a){let o=String(a.stderr??a.message??"");throw/being accessed by other users|55006/.test(o)&&i(["Could not drop spree_development \u2014 another client is still connected.",`A database client (TablePlus, DataGrip, psql) may be connected on port ${Ie.default.bold("5433")}.`,"Disconnect it, then re-run `spree db:reset`.",...n?["",`Bring the stack back up with ${Ie.default.bold("spree dev")}.`]:[]]),a}q.success("Database reset."),n&&V(`Bring the stack back up with ${Ie.default.bold("spree dev")}.`,"Done")}),e.command("db:console").description("Open a psql session against the dev database").action(async()=>{let t=b(),r;try{r=await mt("postgres",t.projectDir)}catch(i){j(["Could not inspect the Docker stack from this directory.",` ${Ie.default.dim(String(i.message).split(`
940
940
  `)[0])}`,"",`Run ${Ie.default.bold("spree db:console")} from your project root, and make sure Docker is running.`].join(`
941
941
  `)),process.exit(1)}r||(j(["Postgres is not running.",`Start the stack with ${Ie.default.bold("spree dev")}, then re-run ${Ie.default.bold("spree db:console")}.`].join(`
942
- `)),process.exit(1)),await ht(["psql","-U","postgres","spree_development"],t.projectDir,{service:"postgres"})})}import Sh from"fs";var pe=D(K(),1);import{spawn as T0}from"child_process";import qo from"fs";import ir from"path";var Fr=D(K(),1);function jt(e){return qo.existsSync(ir.join(e,"apps","dashboard","package.json"))}function Gr(e){let t=ir.join(e,"apps","dashboard");return qo.existsSync(ir.join(t,"package.json"))&&qo.existsSync(ir.join(t,"node_modules"))}function In(e){let t=ir.join(e,"apps","dashboard");q.warn(`${Fr.default.bold("apps/dashboard/")} has no dependencies installed \u2014 skipping its dev server. Install them (cd apps/dashboard && ${Jt(e,t)} install) and rerun.`)}var R0=Fr.default.dim("dashboard | "),I0=new RegExp("\x1B\\[[0-9;]*m","g");function On(e){if(!Gr(e))return null;let t=ir.join(e,"apps","dashboard"),r=Jt(e,t),i=process.platform==="win32",n=T0(r,["run","dev"],{cwd:t,stdio:["ignore","pipe","pipe"],detached:!i,shell:i}),s=`http://localhost:${5173}`,a=!1,o=()=>{},p=new Promise(m=>{o=m}),d=m=>{a=!0,clearTimeout(c),o(m)},c=setTimeout(()=>d(s),3e4);c.unref();let u=(m,h)=>{let f="";m.on("data",w=>{f+=w.toString();let k=f.split(`
943
- `);f=k.pop()??"";for(let x of k)if(h.write(`${R0}${x}
944
- `),!a){let _=x.replace(I0,"").match(/Local:\s+(http:\/\/\S+?)\/?\s*$/);_&&d(_[1])}})};n.stdout&&u(n.stdout,process.stdout),n.stderr&&u(n.stderr,process.stderr);let l=!1;return n.on("error",m=>{d(s),q.warn(`Could not start the dashboard dev server (${m.message}) \u2014 start it manually with ${Fr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),n.on("exit",(m,h)=>{d(s),!l&&h===null&&m!==null&&m!==0&&m!==130&&q.warn(`The dashboard dev server exited (code ${m}) \u2014 restart it with ${Fr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),{url:p,stop:()=>{if(l=!0,d(s),!(n.exitCode!==null||n.killed)){if(!i&&n.pid)try{process.kill(-n.pid,"SIGTERM");return}catch{}n.kill("SIGTERM")}}}}import nr from"fs";import{platform as D0}from"os";import Ur from"path";var J=D(K(),1);var L0=3e3,vh=12e4;function xh(e){e.command("init").description("First-run setup: start services, configure API key, load sample data").option("--no-sample-data","skip loading sample data").option("--no-open","skip opening browser").option("--admin-email <email>","email for the admin account created during setup").option("--admin-password <password>","password for the admin account created during setup").action(async t=>{await ko(t)})}async function ko(e){let t=b(),{adminEmail:r,adminPassword:i}=await U0(e),n=e.sampleData&&($n(t.projectDir)??!0);q.step("Pulling latest images..."),await Z(["pull"],t.projectDir,{stdio:"inherit"});let s=I();s.start("Starting Docker services..."),await lt(t.projectDir,{stdio:"ignore"}),await Z(["up","-d"],t.projectDir),s.stop("Docker services started."),s.start("Waiting for Spree to be ready..."),await B0(t.port),s.stop("Spree is ready."),s.start("Seeding database...");let o=(await ne("db:seed",t.projectDir,r&&i?{ADMIN_EMAIL:r,ADMIN_PASSWORD:i}:void 0)).match(/\/setup\?token=(\S+)/)?.[1];s.stop("Database seeded."),r&&i&&vm(t.projectDir,r),s.start("Configuring API keys...");let p=await z0(t.projectDir);G0(t.projectDir,p);let d=await F0(t.projectDir,t.port);s.stop("API keys configured."),await wh(t.projectDir,"storefront"),await wh(t.projectDir,"dashboard"),En(t.projectDir,t.port),n&&(r&&i?(s.start("Loading sample data..."),await ne("spree:load_sample_data",t.projectDir),s.stop("Sample data loaded.")):q.warn("Skipping sample data \u2014 it needs an admin account. Finish setup, then run `spree sample-data`.")),s.start("Indexing products for search..."),await ne("spree:search:reindex",t.projectDir),s.stop("Search index ready."),qm(t.projectDir);let c=Gr(t.projectDir);jt(t.projectDir)&&!c&&In(t.projectDir);let u=c?`http://localhost:${5173}`:`http://localhost:${t.port}/dashboard`,l=r&&i?[` Email: ${r}`,` Password: ${i}`]:[` ${J.default.dim("Create your admin account:")}`,` ${J.default.cyan(o?`${u}/setup?token=${o}`:"run `spree run bin/rails spree:setup:token` for the setup link")}`],m=c?[J.default.bold("Admin Dashboard"),` ${J.default.cyan(`http://localhost:${5173}`)}`,...l,` ${J.default.dim("Live-reloading from apps/dashboard/")}`]:[J.default.bold("Admin Dashboard"),` ${J.default.dim(`Not installed \u2014 add it with ${J.default.bold("spree add dashboard")}`)}`,...l],h=n&&M0(t.projectDir)?[J.default.bold("Wholesale portal (B2B demo)"),` ${J.default.cyan(`http://localhost:${3001}/wholesale`)} ${J.default.dim("\u2014 needs the storefront dev server running")}`,` ${J.default.dim('Register a buyer, then approve them in the admin (add to the "Wholesale" customer group)')}`,""]:[];V(["",...m,"",J.default.bold("Store API"),` ${J.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,` Publishable key: ${J.default.cyan(p)}`,"",...h,J.default.bold("Admin API"),` ${J.default.cyan(`http://localhost:${t.port}/api/v3/admin`)}`,` Secret key: ${J.default.cyan(d)}`,` ${J.default.dim("Saved to .spree/credentials.json")}`,""].join(`
945
- `),"Your Spree store is ready!");let f=c?On(t.projectDir):null,w=()=>{f?.stop(),process.exit(130)};process.once("SIGINT",w);try{if(e.open){let k=f?await f.url:null,x=o&&k?`${k.replace(/\/$/,"")}/setup?token=${o}`:k??`http://localhost:${t.port}`;await N0(x)}q.info(`Streaming logs (Ctrl+C to stop)...
946
- `),await Ar("web",t.projectDir)}finally{process.removeListener("SIGINT",w),f?.stop()}}async function wh(e,t){let r=Ur.join(e,"apps",t);if(!nr.existsSync(Ur.join(r,"package.json"))||nr.existsSync(Ur.join(r,"node_modules")))return;let i=Jt(e,r),n=I();n.start(`Installing ${t} dependencies with ${i}...`);try{await te(i,["install"],{cwd:r}),n.stop(`${t==="dashboard"?"Dashboard":"Storefront"} dependencies installed.`)}catch(s){n.stop(J.default.yellow(`${i} install failed \u2014 run it manually in apps/${t}/.`)),q.warn(s instanceof Error?s.message:String(s))}}async function B0(e){let t=`http://localhost:${e}/up`,r=Date.now();for(;Date.now()-r<vh;){try{if((await fetch(t)).ok)return}catch{}await new Promise(i=>setTimeout(i,L0))}throw new Error(`Spree did not become healthy within ${vh/1e3}s`)}async function z0(e){let t=await ne("spree:cli:ensure_api_key",e),r=t.match(/pk_[A-Za-z0-9_-]+/);if(!r)throw new Error(`Could not extract API key from Rails output: ${t}`);return r[0]}function M0(e){let t=Ur.join(e,"apps","storefront",".env.local");try{return nr.readFileSync(t,"utf-8").match(/^SPREE_WHOLESALE_CHANNEL=(\S+)/m)?.[1]??null}catch{return null}}async function F0(e,t){let{token:r}=await Za(e,t,!0);return r}function G0(e,t){let r=Ur.join(e,"apps","storefront",".env.local");if(!nr.existsSync(r))return;let i=nr.readFileSync(r,"utf-8");nr.writeFileSync(r,i.replace(/^SPREE_PUBLISHABLE_KEY=.*/m,`SPREE_PUBLISHABLE_KEY=${t}`))}async function U0(e){let{adminEmail:t,adminPassword:r}=e;return t&&!t.includes("@")&&(j(`Invalid --admin-email: ${t}`),process.exit(1)),r&&r.length<8&&(j("Invalid --admin-password: use at least 8 characters."),process.exit(1)),!!t!=!!r&&(j("Pass both --admin-email and --admin-password, or neither."),process.exit(1)),{adminEmail:t,adminPassword:r}}async function N0(e){let t=D0(),r=t==="darwin"?"open":t==="win32"?"start":"xdg-open";try{await ut(`${r} ${e}`,{stdio:"ignore"})}catch{}}function Ah(e){e.command("dev").description("Run the app in the foreground \u2014 the API, plus the React Dashboard dev server when apps/dashboard exists; Ctrl+C stops them").action(async()=>{let t=b();if(Fe(t.projectDir)&&(j(["This project uses SPREE_PATH for monorepo development.",`Use ${pe.default.bold("pnpm server:dev")} from the monorepo root instead of ${pe.default.bold("spree dev")}.`,"It loads the edge compose overlay and sets SPREE_PATH so the Spree gems resolve to the monorepo source."].join(`
947
- `)),process.exit(1)),En(t.projectDir,t.port),!Sn(t.projectDir)&&!Sh.existsSync(Ja(t.projectDir))&&!Sh.existsSync(Yt(t.projectDir))){let o=$n(t.projectDir)!==void 0;if(!o)try{o=!await gm(t.projectDir)}catch{}if(o){q.info("First run detected \u2014 completing setup automatically."),await ko({sampleData:!0,open:!0});return}}let r=jt(t.projectDir)&&Gr(t.projectDir);jt(t.projectDir)&&!r&&In(t.projectDir),V(["",...r?[pe.default.bold("Admin Dashboard"),` ${pe.default.cyan(`http://localhost:${5173}`)}`,...$h(t.projectDir),` ${pe.default.dim("Live-reloading from apps/dashboard/")}`]:[pe.default.bold("Admin Dashboard"),` ${pe.default.dim(`Not installed \u2014 add it with ${pe.default.bold("spree add dashboard")}`)}`,...$h(t.projectDir)],"",pe.default.bold("Store API"),` ${pe.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,""].join(`
942
+ `)),process.exit(1)),await ht(["psql","-U","postgres","spree_development"],t.projectDir,{service:"postgres"})})}import $h from"fs";var pe=D(K(),1);import{spawn as R0}from"child_process";import ko from"fs";import ir from"path";var Fr=D(K(),1);function jt(e){return ko.existsSync(ir.join(e,"apps","dashboard","package.json"))}function Gr(e){let t=ir.join(e,"apps","dashboard");return ko.existsSync(ir.join(t,"package.json"))&&ko.existsSync(ir.join(t,"node_modules"))}function In(e){let t=ir.join(e,"apps","dashboard");q.warn(`${Fr.default.bold("apps/dashboard/")} has no dependencies installed \u2014 skipping its dev server. Install them (cd apps/dashboard && ${Jt(e,t)} install) and rerun.`)}var I0=Fr.default.dim("dashboard | "),O0=new RegExp("\x1B\\[[0-9;]*m","g");function On(e){if(!Gr(e))return null;let t=ir.join(e,"apps","dashboard"),r=Jt(e,t),i=process.platform==="win32",n=R0(r,["run","dev"],{cwd:t,stdio:["ignore","pipe","pipe"],detached:!i,shell:i}),s=`http://localhost:${5173}`,a=!1,o=()=>{},p=new Promise(m=>{o=m}),d=m=>{a=!0,clearTimeout(c),o(m)},c=setTimeout(()=>d(s),3e4);c.unref();let u=(m,h)=>{let f="";m.on("data",w=>{f+=w.toString();let v=f.split(`
943
+ `);f=v.pop()??"";for(let x of v)if(h.write(`${I0}${x}
944
+ `),!a){let _=x.replace(O0,"").match(/Local:\s+(http:\/\/\S+?)\/?\s*$/);_&&d(_[1])}})};n.stdout&&u(n.stdout,process.stdout),n.stderr&&u(n.stderr,process.stderr);let l=!1;return n.on("error",m=>{d(s),q.warn(`Could not start the dashboard dev server (${m.message}) \u2014 start it manually with ${Fr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),n.on("exit",(m,h)=>{d(s),!l&&h===null&&m!==null&&m!==0&&m!==130&&q.warn(`The dashboard dev server exited (code ${m}) \u2014 restart it with ${Fr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),{url:p,stop:()=>{if(l=!0,d(s),!(n.exitCode!==null||n.killed)){if(!i&&n.pid)try{process.kill(-n.pid,"SIGTERM");return}catch{}n.kill("SIGTERM")}}}}import nr from"fs";import{platform as L0}from"os";import Ur from"path";var J=D(K(),1);var B0=3e3,wh=12e4;function Sh(e){e.command("init").description("First-run setup: start services, seed the database, configure API keys").option("--no-sample-data","skip loading sample data on scripted installs (see --admin-email)").option("--no-open","skip opening browser").option("--admin-email <email>","scripted installs only: seed an admin account instead of printing the setup link").option("--admin-password <password>","password for the admin account seeded by --admin-email").action(async t=>{await vo(t)})}async function vo(e){let t=b(),{adminEmail:r,adminPassword:i}=N0(e),n=e.sampleData&&($n(t.projectDir)??!0);q.step("Pulling latest images..."),await Z(["pull"],t.projectDir,{stdio:"inherit"});let s=I();s.start("Starting Docker services..."),await lt(t.projectDir,{stdio:"ignore"}),await Z(["up","-d"],t.projectDir),s.stop("Docker services started."),s.start("Waiting for Spree to be ready..."),await z0(t.port),s.stop("Spree is ready."),s.start("Seeding database...");let o=(await se("db:seed",t.projectDir,r&&i?{ADMIN_EMAIL:r,ADMIN_PASSWORD:i}:void 0)).match(/\/setup\?token=(\S+)/)?.[1];s.stop("Database seeded."),r&&i&&wm(t.projectDir,r),s.start("Configuring API keys...");let p=await M0(t.projectDir);U0(t.projectDir,p);let d=await G0(t.projectDir,t.port);s.stop("API keys configured."),await xh(t.projectDir,"storefront"),await xh(t.projectDir,"dashboard"),En(t.projectDir,t.port);let c=n&&!!(r&&i);c?(s.start("Loading sample data..."),await se("spree:load_sample_data",t.projectDir),s.stop("Sample data loaded.")):n&&q.info('Sample data: tick "Load sample data" on the setup screen, or run `spree sample-data` any time later.'),s.start("Indexing products for search..."),await se("spree:search:reindex",t.projectDir),s.stop("Search index ready."),km(t.projectDir);let u=Gr(t.projectDir);jt(t.projectDir)&&!u&&In(t.projectDir);let l=u?`http://localhost:${5173}`:`http://localhost:${t.port}/dashboard`,m=r&&i?[` Email: ${r}`,` Password: ${i}`]:[` ${J.default.dim("Create your admin account (and load sample data, if you like):")}`,` ${J.default.cyan(o?`${l}/setup?token=${o}`:"run `spree run bin/rails spree:setup:token` for the setup link")}`],h=u?[J.default.bold("Admin Dashboard"),` ${J.default.cyan(`http://localhost:${5173}`)}`,...m,` ${J.default.dim("Live-reloading from apps/dashboard/")}`]:[J.default.bold("Admin Dashboard"),` ${J.default.dim(`Not installed \u2014 add it with ${J.default.bold("spree add dashboard")}`)}`,...m],f=c&&F0(t.projectDir)?[J.default.bold("Wholesale portal (B2B demo)"),` ${J.default.cyan(`http://localhost:${3001}/wholesale`)} ${J.default.dim("\u2014 needs the storefront dev server running")}`,` ${J.default.dim('Register a buyer, then approve them in the admin (add to the "Wholesale" customer group)')}`,""]:[];V(["",...h,"",J.default.bold("Store API"),` ${J.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,` Publishable key: ${J.default.cyan(p)}`,"",...f,J.default.bold("Admin API"),` ${J.default.cyan(`http://localhost:${t.port}/api/v3/admin`)}`,` Secret key: ${J.default.cyan(d)}`,` ${J.default.dim("Saved to .spree/credentials.json")}`,""].join(`
945
+ `),"Your Spree store is ready!");let w=u?On(t.projectDir):null,v=()=>{w?.stop(),process.exit(130)};process.once("SIGINT",v);try{if(e.open){let x=w?await w.url:null,_=o&&x?`${x.replace(/\/$/,"")}/setup?token=${o}`:x??`http://localhost:${t.port}`;await H0(_)}q.info(`Streaming logs (Ctrl+C to stop)...
946
+ `),await Ar("web",t.projectDir)}finally{process.removeListener("SIGINT",v),w?.stop()}}async function xh(e,t){let r=Ur.join(e,"apps",t);if(!nr.existsSync(Ur.join(r,"package.json"))||nr.existsSync(Ur.join(r,"node_modules")))return;let i=Jt(e,r),n=I();n.start(`Installing ${t} dependencies with ${i}...`);try{await te(i,["install"],{cwd:r}),n.stop(`${t==="dashboard"?"Dashboard":"Storefront"} dependencies installed.`)}catch(s){n.stop(J.default.yellow(`${i} install failed \u2014 run it manually in apps/${t}/.`)),q.warn(s instanceof Error?s.message:String(s))}}async function z0(e){let t=`http://localhost:${e}/up`,r=Date.now();for(;Date.now()-r<wh;){try{if((await fetch(t)).ok)return}catch{}await new Promise(i=>setTimeout(i,B0))}throw new Error(`Spree did not become healthy within ${wh/1e3}s`)}async function M0(e){let t=await se("spree:cli:ensure_api_key",e),r=t.match(/pk_[A-Za-z0-9_-]+/);if(!r)throw new Error(`Could not extract API key from Rails output: ${t}`);return r[0]}function F0(e){let t=Ur.join(e,"apps","storefront",".env.local");try{return nr.readFileSync(t,"utf-8").match(/^SPREE_WHOLESALE_CHANNEL=(\S+)/m)?.[1]??null}catch{return null}}async function G0(e,t){let{token:r}=await Qa(e,t,!0);return r}function U0(e,t){let r=Ur.join(e,"apps","storefront",".env.local");if(!nr.existsSync(r))return;let i=nr.readFileSync(r,"utf-8");nr.writeFileSync(r,i.replace(/^SPREE_PUBLISHABLE_KEY=.*/m,`SPREE_PUBLISHABLE_KEY=${t}`))}function N0(e){let{adminEmail:t,adminPassword:r}=e;return t&&!t.includes("@")&&(j(`Invalid --admin-email: ${t}`),process.exit(1)),r&&r.length<8&&(j("Invalid --admin-password: use at least 8 characters."),process.exit(1)),!!t!=!!r&&(j("Pass both --admin-email and --admin-password, or neither."),process.exit(1)),{adminEmail:t,adminPassword:r}}async function H0(e){let t=L0(),r=t==="darwin"?"open":t==="win32"?"start":"xdg-open";try{await ut(`${r} ${e}`,{stdio:"ignore"})}catch{}}function Eh(e){e.command("dev").description("Run the app in the foreground \u2014 the API, plus the React Dashboard dev server when apps/dashboard exists; Ctrl+C stops them").action(async()=>{let t=b();if(Fe(t.projectDir)&&(j(["This project uses SPREE_PATH for monorepo development.",`Use ${pe.default.bold("pnpm server:dev")} from the monorepo root instead of ${pe.default.bold("spree dev")}.`,"It loads the edge compose overlay and sets SPREE_PATH so the Spree gems resolve to the monorepo source."].join(`
947
+ `)),process.exit(1)),En(t.projectDir,t.port),!Sn(t.projectDir)&&!$h.existsSync(Ja(t.projectDir))&&!$h.existsSync(Yt(t.projectDir))){let o=$n(t.projectDir)!==void 0;if(!o)try{o=!await fm(t.projectDir)}catch{}if(o){q.info("First run detected \u2014 completing setup automatically."),await vo({sampleData:!0,open:!0});return}}let r=jt(t.projectDir)&&Gr(t.projectDir);jt(t.projectDir)&&!r&&In(t.projectDir),V(["",...r?[pe.default.bold("Admin Dashboard"),` ${pe.default.cyan(`http://localhost:${5173}`)}`,...Ah(t.projectDir),` ${pe.default.dim("Live-reloading from apps/dashboard/")}`]:[pe.default.bold("Admin Dashboard"),` ${pe.default.dim(`Not installed \u2014 add it with ${pe.default.bold("spree add dashboard")}`)}`,...Ah(t.projectDir)],"",pe.default.bold("Store API"),` ${pe.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,""].join(`
948
948
  `),"Spree Commerce"),q.info(`Starting services \u2014 ${r?"API + dashboard logs":"API logs"} stream below. ${pe.default.bold("Ctrl+C")} stops them (databases keep running; ${pe.default.bold("spree stop")} shuts everything down).
949
- `);let i=()=>{};process.on("SIGINT",i);let n,s=null;try{await lt(t.projectDir),s=r?On(t.projectDir):null,n=await Z(["up",...await Ge(t.projectDir)],t.projectDir,{stdio:"inherit",reject:!1})}finally{s?.stop(),process.off("SIGINT",i)}let a=n.exitCode??0;a!==0&&a!==130&&(j(`docker compose exited with code ${a} \u2014 see the output above.`),process.exit(a)),Ct(`${r?"API + dashboard":"API"} stopped. Databases keep running \u2014 ${pe.default.bold("spree stop")} shuts everything down.`)})}function $h(e){let t=wm(e);return t?[` Email: ${t}`,` Password: ${pe.default.dim("chosen during spree init")}`]:[` ${pe.default.dim("Create your admin account with the setup link from `spree init`")}`]}import Nr from"fs";import vo from"path";var be=D(K(),1);function Eh(e){e.command("eject").description("Switch to the dev compose: bind-mount the Rails app with hot reload").action(async()=>{let t=b(),r=xn(t.projectDir),i=vo.join(t.projectDir,r);Nr.existsSync(i)||(console.error(`
949
+ `);let i=()=>{};process.on("SIGINT",i);let n,s=null;try{await lt(t.projectDir),s=r?On(t.projectDir):null,n=await Z(["up",...await Ge(t.projectDir)],t.projectDir,{stdio:"inherit",reject:!1})}finally{s?.stop(),process.off("SIGINT",i)}let a=n.exitCode??0;a!==0&&a!==130&&(j(`docker compose exited with code ${a} \u2014 see the output above.`),process.exit(a)),Ct(`${r?"API + dashboard":"API"} stopped. Databases keep running \u2014 ${pe.default.bold("spree stop")} shuts everything down.`)})}function Ah(e){let t=xm(e);return t?[` Email: ${t}`,` Password: ${pe.default.dim("chosen during spree init")}`]:[` ${pe.default.dim("Create your admin account with the setup link from `spree init`")}`]}import Nr from"fs";import wo from"path";var be=D(K(),1);function Ph(e){e.command("eject").description("Switch to the dev compose: bind-mount the Rails app with hot reload").action(async()=>{let t=b(),r=xn(t.projectDir),i=wo.join(t.projectDir,r);Nr.existsSync(i)||(console.error(`
950
950
  ${be.default.red("Error:")} No ${r}/ directory found.
951
- `),process.exit(1));let n=vo.join(t.projectDir,"docker-compose.dev.yml");Nr.existsSync(n)||(console.error(`
951
+ `),process.exit(1));let n=wo.join(t.projectDir,"docker-compose.dev.yml");Nr.existsSync(n)||(console.error(`
952
952
  ${be.default.red("Error:")} No docker-compose.dev.yml found.
953
- `),process.exit(1));let s=Nr.readFileSync(n,"utf-8");s.includes("- .:/rails")&&(s=s.replace("- .:/rails",`- ./${r}:/rails`),Nr.writeFileSync(n,s)),Nr.writeFileSync(vo.join(t.projectDir,"docker-compose.yml"),s),console.log(`
953
+ `),process.exit(1));let s=Nr.readFileSync(n,"utf-8");s.includes("- .:/rails")&&(s=s.replace("- .:/rails",`- ./${r}:/rails`),Nr.writeFileSync(n,s)),Nr.writeFileSync(wo.join(t.projectDir,"docker-compose.yml"),s),console.log(`
954
954
  ${be.default.bold(`Switching to dev compose (bind-mounts ./${r})...`)}
955
955
  `),await lt(t.projectDir),await Z(["up","-d"],t.projectDir,{stdio:"inherit"}),console.log(`
956
956
  ${be.default.bold("Preparing the development database...")}
957
957
  `),await ht(["bin/rails","db:prepare"],t.projectDir,{tty:!1}),V([`The Rails API is now bind-mounted from ${be.default.bold(`./${r}`)} \u2014 edits are live.`,"",`The dev stack uses its own ${be.default.bold("spree_development")} database (just`,`created and seeded). Load demo products with ${be.default.bold("spree sample-data")}.`,"","You can now customize:",` ${be.default.dim(`${r}/app/`)} \u2014 models, controllers, services (instant reload)`,` ${be.default.dim(`${r}/config/`)} \u2014 Rails configuration (instant reload)`,` ${be.default.dim(`${r}/Gemfile`)} \u2014 add gems via ${be.default.bold("spree bundle add <gem>")}`,"",`Rebuild only on Dockerfile / .ruby-version changes: ${be.default.bold("spree build")}`].join(`
958
- `),"Ejected!")})}function Ph(e){e.command("exec").description("Run an arbitrary command inside the web container").argument("<command...>","command and arguments to run").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(t,r.projectDir)})}var H0=new Set(["migration","controller","scaffold","scaffold_controller","mailer","job","channel","helper","resource","integration_test","system_test","task","generator","benchmark"]);function jh(e){e.command("generate").alias("g").description("Run a generator (Spree generators auto-prefixed; Rails built-ins forwarded as-is)").argument("<name>","generator name (`model`, `model_decorator`, `migration`, \u2026)").argument("[args...]","arguments to pass to the generator").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=b(),n=t.includes(":")||H0.has(t)?t:`spree:${t}`;await M(["bin/rails","g",n,...r],i.projectDir)})}var Dn=D(K(),1);function Ch(e){e.command("logs").description("Stream service logs").argument("[service]","service name (e.g. web)","web").action(async t=>{let r=b();if(t==="worker"&&!(await Ge(r.projectDir)).includes("worker")){q.info(`This project has no ${Dn.default.bold("worker")} service \u2014 jobs run inside the web process (Solid Queue in Puma). Streaming ${Dn.default.bold("web")} logs; the job dashboard is at ${Dn.default.cyan(`http://localhost:${r.port}/jobs`)}.`),await Ar("web",r.projectDir);return}await Ar(t,r.projectDir)})}var Hr=D(K(),1);function Th(e){e.command("migrate").description("Install pending Spree migrations from gems, then run them (`spree:install:migrations` + `db:migrate`)").argument("[args...]","extra args forwarded to db:migrate").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await mt("web",r.projectDir)?(console.log(`
958
+ `),"Ejected!")})}function jh(e){e.command("exec").description("Run an arbitrary command inside the web container").argument("<command...>","command and arguments to run").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(t,r.projectDir)})}var V0=new Set(["migration","controller","scaffold","scaffold_controller","mailer","job","channel","helper","resource","integration_test","system_test","task","generator","benchmark"]);function Ch(e){e.command("generate").alias("g").description("Run a generator (Spree generators auto-prefixed; Rails built-ins forwarded as-is)").argument("<name>","generator name (`model`, `model_decorator`, `migration`, \u2026)").argument("[args...]","arguments to pass to the generator").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=b(),n=t.includes(":")||V0.has(t)?t:`spree:${t}`;await M(["bin/rails","g",n,...r],i.projectDir)})}var Dn=D(K(),1);function Th(e){e.command("logs").description("Stream service logs").argument("[service]","service name (e.g. web)","web").action(async t=>{let r=b();if(t==="worker"&&!(await Ge(r.projectDir)).includes("worker")){q.info(`This project has no ${Dn.default.bold("worker")} service \u2014 jobs run inside the web process (Solid Queue in Puma). Streaming ${Dn.default.bold("web")} logs; the job dashboard is at ${Dn.default.cyan(`http://localhost:${r.port}/jobs`)}.`),await Ar("web",r.projectDir);return}await Ar(t,r.projectDir)})}var Hr=D(K(),1);function Rh(e){e.command("migrate").description("Install pending Spree migrations from gems, then run them (`spree:install:migrations` + `db:migrate`)").argument("[args...]","extra args forwarded to db:migrate").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await mt("web",r.projectDir)?(console.log(`
959
959
  ${Hr.default.bold("\u2192 Installing pending Spree migrations from gems...")}`),await ht(["bin/rails","spree:install:migrations"],r.projectDir),console.log(`
960
960
  ${Hr.default.bold("\u2192 Running db:migrate...")}`),await ht(["bin/rails","db:migrate",...t],r.projectDir)):(console.log(`
961
- ${Hr.default.bold("\u2192 Installing + running pending Spree migrations...")}`),await M(["bin/rails","spree:install:migrations","db:migrate",...t],r.projectDir,{edgeHint:"the edge boot installs and runs pending migrations itself"})),V(`Run ${Hr.default.bold("spree migrate:status")} to inspect the migration log.`,"Migrations up to date")}),e.command("migrate:rollback").description("Roll back the last migration (`STEP=n` to roll back n steps)").argument("[args...]","extra args forwarded to db:rollback (e.g. STEP=2)").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rails","db:rollback",...t],r.projectDir)}),e.command("migrate:status").description("Show migration status (`bin/rails db:migrate:status`)").action(async()=>{let t=b();await M(["bin/rails","db:migrate:status"],t.projectDir)})}import{platform as V0}from"os";function Rh(e){e.command("open").description("Open the admin dashboard in the browser").action(async()=>{let t=b(),r=jt(t.projectDir)?`http://localhost:${5173}`:`http://localhost:${t.port}`,i=V0();await ut(`${i==="darwin"?"open":i==="win32"?"start":"xdg-open"} ${r}`)})}import xo from"fs";import ar from"path";import{fileURLToPath as W0}from"url";var N=D(K(),1);import nt from"fs";import Ln from"path";function Oh(e){let{src:t,dst:r,vars:i,skip:n,force:s}=e;if(!nt.existsSync(t))throw new Error(`Template source not found: ${t}`);if(nt.existsSync(r)){if(nt.readdirSync(r).length>0&&!s)throw new Error(`Destination ${r} is not empty. Pass force=true to overwrite.`)}else nt.mkdirSync(r,{recursive:!0});Dh(t,r,"",i,n)}function Dh(e,t,r,i,n){let s=Ln.join(e,r);for(let a of nt.readdirSync(s,{withFileTypes:!0})){let o=r?`${r}/${a.name}`:a.name;if(n?.(o))continue;let p=Lh(wo(a.name,i)),d=Ln.join(e,o);if(a.isDirectory()){let h=r?`${Ih(r,i)}/${p}`:p,f=Ln.join(t,h);nt.mkdirSync(f,{recursive:!0}),Dh(e,t,o,i,n);continue}let c=p.endsWith(".tt"),u=c?p.slice(0,-3):p,l=r?`${Ih(r,i)}/${u}`:u,m=Ln.join(t,l);if(c){let h=nt.readFileSync(d,"utf8");nt.writeFileSync(m,wo(h,i))}else nt.copyFileSync(d,m)}}function wo(e,t){return e.replace(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g,(r,i)=>Object.hasOwn(t,i)?t[i]:r)}function Ih(e,t){return e.split("/").map(r=>Lh(wo(r,t))).join("/")}function Lh(e){if(e.includes("/")||e.includes("\\")||e==="..")throw new Error(`Template variable produced an unsafe path segment: "${e}"`);return e}var K0="../../templates/plugin",Bn=["MIT","Apache-2.0","BSD-3-Clause"];function zh(e){e.command("plugin").description("Scaffold and manage Spree plugins (dashboard + Rails engine)").command("new").description("Scaffold a new Spree plugin monorepo (dashboard plugin half today; Rails engine coming soon)").argument("[name]","Plugin name (e.g. brands). If omitted, you will be prompted.").option("--ruby-name <name>","Ruby gem name (default: spree_<name>)").option("--module-name <name>","Ruby module / TS namespace (default: PascalCase of the gem name)").option("--npm-scope <scope>","npm scope, e.g. @acme (default: unscoped)").option("--author <name>","Author name (default: git config user.name)").option("--author-email <email>","Author email (default: git config user.email)").option("--license <license>",`License: ${Bn.join(", ")} (default: MIT)`).option("-y, --yes","Non-interactive: accept the default for every prompt not answered by a flag",!1).option("--no-dashboard","Skip the dashboard plugin half").option("--no-engine","Skip the Rails engine half (currently always skipped \u2014 engine support coming soon)").option("--no-install","Skip running pnpm install").option("--force","Overwrite a non-empty destination directory").action(async(r,i)=>{di(N.default.bgCyan(N.default.black(" Spree Plugin Scaffolder ")));let n=await Y0(r,i);L(n)&&(j("Scaffolding cancelled."),process.exit(0));let s=ar.resolve(process.cwd(),n.name);xo.existsSync(s)&&xo.readdirSync(s).length>0&&!i.force&&(j(`Destination ${N.default.bold(s)} is not empty. Choose a different name or rerun with ${N.default.cyan("--force")}.`),process.exit(1));let a=X0(n),o=rS(),p=I();p.start(`Scaffolding ${N.default.cyan(n.name)}...`);try{Oh({src:o,dst:s,vars:a,skip:Z0(n),force:i.force})}catch(d){p.stop("Scaffolding failed."),q.error(d instanceof Error?d.message:String(d)),process.exit(1)}p.stop(`Created ${N.default.cyan(s)}`),i.install?await Q0(s,n):q.info(N.default.dim("Skipping dependency install \u2014 run them yourself when ready.")),eS(n,s,i.install),Ct("Happy hacking!")})}async function Y0(e,t){let r=_=>{if(!_)return"Required";if(!/^[a-z][a-z0-9-]*$/.test(_))return'Use lowercase letters, digits, and dashes (e.g. "brands" or "loyalty-points")'};if(e!==void 0){let _=r(e);_&&(q.error(`Invalid plugin name ${N.default.bold(e)}: ${_}`),process.exit(2))}e===void 0&&t.yes&&(q.error("Pass the plugin name as an argument when using --yes: spree plugin new <name> -y"),process.exit(2));let i=e??await le({message:"Plugin name",placeholder:"brands",validate:r});if(L(i))return i;let n=`spree_${i.replace(/-/g,"_")}`,s=await sr({flag:"--ruby-name",flagValue:t.rubyName,fallback:n,yes:t.yes,validate:_=>_&&/^[a-z][a-z0-9_]*$/.test(_)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")',prompt:()=>le({message:"Ruby gem name",placeholder:n,initialValue:n,validate:_=>_&&/^[a-z][a-z0-9_]*$/.test(_)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")'})});if(L(s))return s;let a=tS(s),o=await sr({flag:"--module-name",flagValue:t.moduleName,fallback:a,yes:t.yes,validate:_=>_&&/^[A-Z][A-Za-z0-9]*$/.test(_)?void 0:'PascalCase (e.g. "SpreeBrands")',prompt:()=>le({message:"Ruby module / TS namespace",placeholder:a,initialValue:a,validate:_=>_&&/^[A-Z][A-Za-z0-9]*$/.test(_)?void 0:'PascalCase (e.g. "SpreeBrands")'})});if(L(o))return o;let p=_=>!_||/^@[a-z0-9][a-z0-9-]*$/.test(_)?void 0:"Must start with @ and contain lowercase letters/digits/dashes",d=await sr({flag:"--npm-scope",flagValue:t.npmScope,fallback:"",yes:t.yes,validate:p,prompt:()=>le({message:"npm scope (optional, leave blank for unscoped)",placeholder:"@my-org",initialValue:"",validate:p})});if(L(d))return d;let c=t.author===void 0?await Bh("user.name"):void 0,u=await sr({flag:"--author",flagValue:t.author,fallback:c,yes:t.yes,validate:_=>_?void 0:"Required",prompt:()=>le({message:"Author name",placeholder:"Jane Developer",initialValue:c??"",validate:_=>_?void 0:"Required"})});if(L(u))return u;let l=_=>_&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(_)?void 0:"Enter a valid email",m=t.authorEmail===void 0?await Bh("user.email"):void 0,h=await sr({flag:"--author-email",flagValue:t.authorEmail,fallback:m,yes:t.yes,validate:l,prompt:()=>le({message:"Author email",placeholder:"jane@example.com",initialValue:m??"",validate:l})});if(L(h))return h;let f=_=>_&&Bn.includes(_)?void 0:`Must be one of: ${Bn.join(", ")}`,w=await sr({flag:"--license",flagValue:t.license,fallback:"MIT",yes:t.yes,validate:f,prompt:()=>li({message:"License",options:Bn.map(_=>({value:_,label:_})),initialValue:"MIT"})});if(L(w))return w;let k=t.dashboard===!1?!1:t.yes||await J0("Include dashboard plugin?",!0);if(L(k))return k;let x=!1;return t.engine!==!1&&q.warn("Rails engine generation is coming in a future release. For now, scaffold the dashboard half here and use `spree-extension create` for the Ruby side."),!k&&!x&&(j("Nothing to scaffold (dashboard half declined)."),process.exit(1)),{name:i,rubyName:s,moduleName:o,npmScope:d.trim(),authorName:u,authorEmail:h,license:w,includeDashboard:k,includeEngine:x}}async function J0(e,t){return await Je({message:e,initialValue:t})}async function sr(e){if(e.flagValue!==void 0){let t=e.validate(e.flagValue);return t&&(q.error(`Invalid value for ${N.default.cyan(e.flag)}: ${t}`),process.exit(2)),e.flagValue}if(e.yes){let t=e.validate(e.fallback);return(e.fallback===void 0||t)&&(q.error(`--yes could not resolve a default for ${N.default.cyan(e.flag)}`+(t?` (${t})`:"")+` \u2014 pass ${N.default.cyan(e.flag)} explicitly.`),process.exit(2)),e.fallback}return e.prompt()}async function Bh(e){try{let{stdout:t}=await ut(`git config --get ${e}`);return t.trim()||void 0}catch{return}}function X0(e){let t=e.npmScope?`${e.npmScope}/${e.name}`:e.name;return{name:e.name,plugin_name:e.name,ruby_name:e.rubyName,module_name:e.moduleName,npm_scope:e.npmScope,npm_package_name:t,npm_dashboard_package:e.npmScope?`${e.npmScope}/${e.name}-dashboard`:`${e.name}-dashboard`,author_name:e.authorName,author_email:e.authorEmail,license:e.license,year:String(new Date().getFullYear())}}function Z0(e){let t=!e.includeDashboard,r=!e.includeEngine;return i=>!!(t&&(i==="packages/dashboard"||i.startsWith("packages/dashboard/"))||r&&(i==="engine"||i.startsWith("engine/")))}async function Q0(e,t){let r=I();if(t.includeDashboard){r.start("Running pnpm install...");try{await ut("pnpm install",{cwd:e,stdio:"pipe"}),r.stop("pnpm install complete.")}catch(i){r.stop(N.default.yellow("pnpm install failed \u2014 run it manually.")),q.warn(i instanceof Error?i.message:String(i))}}if(t.includeEngine){r.start("Running bundle install in engine/...");try{await ut("bundle install",{cwd:ar.join(e,"engine"),stdio:"pipe"}),r.stop("bundle install complete.")}catch(i){r.stop(N.default.yellow("bundle install failed \u2014 run it manually.")),q.warn(i instanceof Error?i.message:String(i))}}}function eS(e,t,r){let i=[""];i.push(N.default.bold("Next steps")),i.push(` ${N.default.dim("cd")} ${ar.relative(process.cwd(),t)||"."}`),r||(e.includeDashboard&&i.push(` ${N.default.dim("pnpm")} install`),e.includeEngine&&i.push(` ${N.default.dim("cd engine && bundle")} install && ${N.default.dim("cd ..")}`)),e.includeDashboard&&(i.push(""),i.push(N.default.bold("Dashboard plugin")),i.push(` Edit ${N.default.cyan("packages/dashboard/src/index.tsx")} to register nav entries and slot widgets.`),i.push(` Add pages as file routes in ${N.default.cyan("packages/dashboard/src/routes/")} \u2014 compiled into the host's typed route tree.`),i.push(` See ${N.default.cyan("https://spreecommerce.org/docs/developer/dashboard/plugins/overview")}`)),e.includeEngine&&(i.push(""),i.push(N.default.bold("Rails engine")),i.push(` Edit ${N.default.cyan(`engine/app/controllers/spree/api/v3/admin/${e.rubyName}_controller.rb`)}`),i.push(` See ${N.default.cyan("https://spreecommerce.org/docs/developer/contributing/creating-an-extension")}`)),i.push(""),V(i.join(`
962
- `),"Your plugin is scaffolded.")}function tS(e){return e.split(/[_-]/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function rS(){let e=ar.dirname(W0(import.meta.url)),t=[ar.resolve(e,K0),ar.resolve(e,"templates/plugin")];for(let r of t)if(xo.existsSync(r))return r;throw new Error(`Plugin template not found. Looked in:
961
+ ${Hr.default.bold("\u2192 Installing + running pending Spree migrations...")}`),await M(["bin/rails","spree:install:migrations","db:migrate",...t],r.projectDir,{edgeHint:"the edge boot installs and runs pending migrations itself"})),V(`Run ${Hr.default.bold("spree migrate:status")} to inspect the migration log.`,"Migrations up to date")}),e.command("migrate:rollback").description("Roll back the last migration (`STEP=n` to roll back n steps)").argument("[args...]","extra args forwarded to db:rollback (e.g. STEP=2)").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rails","db:rollback",...t],r.projectDir)}),e.command("migrate:status").description("Show migration status (`bin/rails db:migrate:status`)").action(async()=>{let t=b();await M(["bin/rails","db:migrate:status"],t.projectDir)})}import{platform as W0}from"os";function Ih(e){e.command("open").description("Open the admin dashboard in the browser").action(async()=>{let t=b(),r=jt(t.projectDir)?`http://localhost:${5173}`:`http://localhost:${t.port}`,i=W0();await ut(`${i==="darwin"?"open":i==="win32"?"start":"xdg-open"} ${r}`)})}import So from"fs";import ar from"path";import{fileURLToPath as K0}from"url";var N=D(K(),1);import nt from"fs";import Ln from"path";function Dh(e){let{src:t,dst:r,vars:i,skip:n,force:s}=e;if(!nt.existsSync(t))throw new Error(`Template source not found: ${t}`);if(nt.existsSync(r)){if(nt.readdirSync(r).length>0&&!s)throw new Error(`Destination ${r} is not empty. Pass force=true to overwrite.`)}else nt.mkdirSync(r,{recursive:!0});Lh(t,r,"",i,n)}function Lh(e,t,r,i,n){let s=Ln.join(e,r);for(let a of nt.readdirSync(s,{withFileTypes:!0})){let o=r?`${r}/${a.name}`:a.name;if(n?.(o))continue;let p=Bh(xo(a.name,i)),d=Ln.join(e,o);if(a.isDirectory()){let h=r?`${Oh(r,i)}/${p}`:p,f=Ln.join(t,h);nt.mkdirSync(f,{recursive:!0}),Lh(e,t,o,i,n);continue}let c=p.endsWith(".tt"),u=c?p.slice(0,-3):p,l=r?`${Oh(r,i)}/${u}`:u,m=Ln.join(t,l);if(c){let h=nt.readFileSync(d,"utf8");nt.writeFileSync(m,xo(h,i))}else nt.copyFileSync(d,m)}}function xo(e,t){return e.replace(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g,(r,i)=>Object.hasOwn(t,i)?t[i]:r)}function Oh(e,t){return e.split("/").map(r=>Bh(xo(r,t))).join("/")}function Bh(e){if(e.includes("/")||e.includes("\\")||e==="..")throw new Error(`Template variable produced an unsafe path segment: "${e}"`);return e}var Y0="../../templates/plugin",Bn=["MIT","Apache-2.0","BSD-3-Clause"];function Mh(e){e.command("plugin").description("Scaffold and manage Spree plugins (dashboard + Rails engine)").command("new").description("Scaffold a new Spree plugin monorepo (dashboard plugin half today; Rails engine coming soon)").argument("[name]","Plugin name (e.g. brands). If omitted, you will be prompted.").option("--ruby-name <name>","Ruby gem name (default: spree_<name>)").option("--module-name <name>","Ruby module / TS namespace (default: PascalCase of the gem name)").option("--npm-scope <scope>","npm scope, e.g. @acme (default: unscoped)").option("--author <name>","Author name (default: git config user.name)").option("--author-email <email>","Author email (default: git config user.email)").option("--license <license>",`License: ${Bn.join(", ")} (default: MIT)`).option("-y, --yes","Non-interactive: accept the default for every prompt not answered by a flag",!1).option("--no-dashboard","Skip the dashboard plugin half").option("--no-engine","Skip the Rails engine half (currently always skipped \u2014 engine support coming soon)").option("--no-install","Skip running pnpm install").option("--force","Overwrite a non-empty destination directory").action(async(r,i)=>{di(N.default.bgCyan(N.default.black(" Spree Plugin Scaffolder ")));let n=await J0(r,i);L(n)&&(j("Scaffolding cancelled."),process.exit(0));let s=ar.resolve(process.cwd(),n.name);So.existsSync(s)&&So.readdirSync(s).length>0&&!i.force&&(j(`Destination ${N.default.bold(s)} is not empty. Choose a different name or rerun with ${N.default.cyan("--force")}.`),process.exit(1));let a=Z0(n),o=iS(),p=I();p.start(`Scaffolding ${N.default.cyan(n.name)}...`);try{Dh({src:o,dst:s,vars:a,skip:Q0(n),force:i.force})}catch(d){p.stop("Scaffolding failed."),q.error(d instanceof Error?d.message:String(d)),process.exit(1)}p.stop(`Created ${N.default.cyan(s)}`),i.install?await eS(s,n):q.info(N.default.dim("Skipping dependency install \u2014 run them yourself when ready.")),tS(n,s,i.install),Ct("Happy hacking!")})}async function J0(e,t){let r=_=>{if(!_)return"Required";if(!/^[a-z][a-z0-9-]*$/.test(_))return'Use lowercase letters, digits, and dashes (e.g. "brands" or "loyalty-points")'};if(e!==void 0){let _=r(e);_&&(q.error(`Invalid plugin name ${N.default.bold(e)}: ${_}`),process.exit(2))}e===void 0&&t.yes&&(q.error("Pass the plugin name as an argument when using --yes: spree plugin new <name> -y"),process.exit(2));let i=e??await le({message:"Plugin name",placeholder:"brands",validate:r});if(L(i))return i;let n=`spree_${i.replace(/-/g,"_")}`,s=await sr({flag:"--ruby-name",flagValue:t.rubyName,fallback:n,yes:t.yes,validate:_=>_&&/^[a-z][a-z0-9_]*$/.test(_)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")',prompt:()=>le({message:"Ruby gem name",placeholder:n,initialValue:n,validate:_=>_&&/^[a-z][a-z0-9_]*$/.test(_)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")'})});if(L(s))return s;let a=rS(s),o=await sr({flag:"--module-name",flagValue:t.moduleName,fallback:a,yes:t.yes,validate:_=>_&&/^[A-Z][A-Za-z0-9]*$/.test(_)?void 0:'PascalCase (e.g. "SpreeBrands")',prompt:()=>le({message:"Ruby module / TS namespace",placeholder:a,initialValue:a,validate:_=>_&&/^[A-Z][A-Za-z0-9]*$/.test(_)?void 0:'PascalCase (e.g. "SpreeBrands")'})});if(L(o))return o;let p=_=>!_||/^@[a-z0-9][a-z0-9-]*$/.test(_)?void 0:"Must start with @ and contain lowercase letters/digits/dashes",d=await sr({flag:"--npm-scope",flagValue:t.npmScope,fallback:"",yes:t.yes,validate:p,prompt:()=>le({message:"npm scope (optional, leave blank for unscoped)",placeholder:"@my-org",initialValue:"",validate:p})});if(L(d))return d;let c=t.author===void 0?await zh("user.name"):void 0,u=await sr({flag:"--author",flagValue:t.author,fallback:c,yes:t.yes,validate:_=>_?void 0:"Required",prompt:()=>le({message:"Author name",placeholder:"Jane Developer",initialValue:c??"",validate:_=>_?void 0:"Required"})});if(L(u))return u;let l=_=>_&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(_)?void 0:"Enter a valid email",m=t.authorEmail===void 0?await zh("user.email"):void 0,h=await sr({flag:"--author-email",flagValue:t.authorEmail,fallback:m,yes:t.yes,validate:l,prompt:()=>le({message:"Author email",placeholder:"jane@example.com",initialValue:m??"",validate:l})});if(L(h))return h;let f=_=>_&&Bn.includes(_)?void 0:`Must be one of: ${Bn.join(", ")}`,w=await sr({flag:"--license",flagValue:t.license,fallback:"MIT",yes:t.yes,validate:f,prompt:()=>li({message:"License",options:Bn.map(_=>({value:_,label:_})),initialValue:"MIT"})});if(L(w))return w;let v=t.dashboard===!1?!1:t.yes||await X0("Include dashboard plugin?",!0);if(L(v))return v;let x=!1;return t.engine!==!1&&q.warn("Rails engine generation is coming in a future release. For now, scaffold the dashboard half here and use `spree-extension create` for the Ruby side."),!v&&!x&&(j("Nothing to scaffold (dashboard half declined)."),process.exit(1)),{name:i,rubyName:s,moduleName:o,npmScope:d.trim(),authorName:u,authorEmail:h,license:w,includeDashboard:v,includeEngine:x}}async function X0(e,t){return await Je({message:e,initialValue:t})}async function sr(e){if(e.flagValue!==void 0){let t=e.validate(e.flagValue);return t&&(q.error(`Invalid value for ${N.default.cyan(e.flag)}: ${t}`),process.exit(2)),e.flagValue}if(e.yes){let t=e.validate(e.fallback);return(e.fallback===void 0||t)&&(q.error(`--yes could not resolve a default for ${N.default.cyan(e.flag)}`+(t?` (${t})`:"")+` \u2014 pass ${N.default.cyan(e.flag)} explicitly.`),process.exit(2)),e.fallback}return e.prompt()}async function zh(e){try{let{stdout:t}=await ut(`git config --get ${e}`);return t.trim()||void 0}catch{return}}function Z0(e){let t=e.npmScope?`${e.npmScope}/${e.name}`:e.name;return{name:e.name,plugin_name:e.name,ruby_name:e.rubyName,module_name:e.moduleName,npm_scope:e.npmScope,npm_package_name:t,npm_dashboard_package:e.npmScope?`${e.npmScope}/${e.name}-dashboard`:`${e.name}-dashboard`,author_name:e.authorName,author_email:e.authorEmail,license:e.license,year:String(new Date().getFullYear())}}function Q0(e){let t=!e.includeDashboard,r=!e.includeEngine;return i=>!!(t&&(i==="packages/dashboard"||i.startsWith("packages/dashboard/"))||r&&(i==="engine"||i.startsWith("engine/")))}async function eS(e,t){let r=I();if(t.includeDashboard){r.start("Running pnpm install...");try{await ut("pnpm install",{cwd:e,stdio:"pipe"}),r.stop("pnpm install complete.")}catch(i){r.stop(N.default.yellow("pnpm install failed \u2014 run it manually.")),q.warn(i instanceof Error?i.message:String(i))}}if(t.includeEngine){r.start("Running bundle install in engine/...");try{await ut("bundle install",{cwd:ar.join(e,"engine"),stdio:"pipe"}),r.stop("bundle install complete.")}catch(i){r.stop(N.default.yellow("bundle install failed \u2014 run it manually.")),q.warn(i instanceof Error?i.message:String(i))}}}function tS(e,t,r){let i=[""];i.push(N.default.bold("Next steps")),i.push(` ${N.default.dim("cd")} ${ar.relative(process.cwd(),t)||"."}`),r||(e.includeDashboard&&i.push(` ${N.default.dim("pnpm")} install`),e.includeEngine&&i.push(` ${N.default.dim("cd engine && bundle")} install && ${N.default.dim("cd ..")}`)),e.includeDashboard&&(i.push(""),i.push(N.default.bold("Dashboard plugin")),i.push(` Edit ${N.default.cyan("packages/dashboard/src/index.tsx")} to register nav entries and slot widgets.`),i.push(` Add pages as file routes in ${N.default.cyan("packages/dashboard/src/routes/")} \u2014 compiled into the host's typed route tree.`),i.push(` See ${N.default.cyan("https://spreecommerce.org/docs/developer/dashboard/plugins/overview")}`)),e.includeEngine&&(i.push(""),i.push(N.default.bold("Rails engine")),i.push(` Edit ${N.default.cyan(`engine/app/controllers/spree/api/v3/admin/${e.rubyName}_controller.rb`)}`),i.push(` See ${N.default.cyan("https://spreecommerce.org/docs/developer/contributing/creating-an-extension")}`)),i.push(""),V(i.join(`
962
+ `),"Your plugin is scaffolded.")}function rS(e){return e.split(/[_-]/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function iS(){let e=ar.dirname(K0(import.meta.url)),t=[ar.resolve(e,Y0),ar.resolve(e,"templates/plugin")];for(let r of t)if(So.existsSync(r))return r;throw new Error(`Plugin template not found. Looked in:
963
963
  ${t.join(`
964
964
  `)}
965
965
 
966
- Reinstall @spree/cli to fix.`)}function Mh(e){e.command("rails").description("Run a Rails command (`bin/rails \u2026`) inside the web container").argument("<args...>","arguments to pass to bin/rails").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rails",...t],r.projectDir)})}function Fh(e){e.command("rake").description("Run a rake task (`bin/rake \u2026`) inside the web container").argument("<args...>","task name and arguments").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rake",...t],r.projectDir)})}function Gh(e){e.command("restart").description("Restart web + worker in place (does not reload Gemfile or compose changes)").action(async()=>{let t=b(),r=I();r.start("Restarting web + worker...");try{await Z(["restart",...await Ge(t.projectDir)],t.projectDir),r.stop("Services restarted.")}catch(i){throw r.stop("Restart failed."),i}})}function Uh(e){e.command("routes").description("Show Rails routes (`bin/rails routes`)").argument("[args...]","arguments to pass to bin/rails routes").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rails","routes",...t],r.projectDir)})}function Nh(e){e.command("rspec").description("Run RSpec tests (`bundle exec rspec \u2026`) inside the web container").argument("[args...]","files, line numbers, and flags to pass to rspec").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bundle","exec","rspec",...t],r.projectDir,{env:{RAILS_ENV:"test"},edgeHint:"then re-run spree rspec"})})}function Hh(e){e.command("sample-data").description("Load sample data (products, categories, images)").action(async()=>{let t=b(),r=I();r.start("Loading sample data..."),await ne("spree:load_sample_data",t.projectDir),r.stop("Sample data loaded.")})}function Vh(e){e.command("seed").description("Seed the database").action(async()=>{let t=b(),r=I();r.start("Seeding database..."),await ne("db:seed",t.projectDir),r.stop("Database seeded.")})}function Wh(e){e.command("shell").alias("bash").description("Open an interactive bash shell inside the web container").action(async()=>{let t=b();await M(["bash"],t.projectDir,{edgeHint:"then open the shell"})})}function Kh(e){e.command("stop").description("Stop services").action(async()=>{let t=b(),r=I();r.start("Stopping services..."),await Z(["stop"],t.projectDir),r.stop("Services stopped.")})}function Yh(e){e.command("task").description("Run a Spree rake task (auto-prefixes `spree:`)").argument("<name>","task name (without `spree:` prefix)").argument("[args...]","arguments to pass to the task").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=b();await M(["bin/rake",`spree:${t}`,...r],i.projectDir)})}function Jh(e){e.command("update").description("Pull latest image and recreate containers").action(async()=>{let t=b();q.step("Pulling latest images..."),await Z(["pull"],t.projectDir,{stdio:"inherit"});let r=I();r.start("Recreating containers..."),await lt(t.projectDir,{stdio:"ignore"}),await Z(["up","-d"],t.projectDir),r.stop("Containers recreated."),q.success("Update complete! Migrations will run automatically on startup."),q.info("Run `spree logs` to follow the startup progress.")})}import Xh from"fs";import iS from"path";var qe=D(K(),1);function Zh(e){e.command("upgrade").description("Walk through a Spree version upgrade (bundle + migrate + spree:upgrade)").option("--plan","print the plan via spree:upgrade DRY_RUN=1; skip bundle + migrate").option("--step <id>","run a single rake step by id (skips bundle + migrate)").option("--to <version>","explicit target version (auto-detected from installed gem otherwise)").option("--yes","skip prompts on automated steps").action(async t=>{let r=b();await nS(r.projectDir),t.plan||t.step||(await sS(r.projectDir,t),await oS(r.projectDir,t)),await pS(r.projectDir,t),t.plan||dS(r.projectDir)})}async function nS(e){let t=r=>{j(r.join(`
966
+ Reinstall @spree/cli to fix.`)}function Fh(e){e.command("rails").description("Run a Rails command (`bin/rails \u2026`) inside the web container").argument("<args...>","arguments to pass to bin/rails").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rails",...t],r.projectDir)})}function Gh(e){e.command("rake").description("Run a rake task (`bin/rake \u2026`) inside the web container").argument("<args...>","task name and arguments").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rake",...t],r.projectDir)})}function Uh(e){e.command("restart").description("Restart web + worker in place (does not reload Gemfile or compose changes)").action(async()=>{let t=b(),r=I();r.start("Restarting web + worker...");try{await Z(["restart",...await Ge(t.projectDir)],t.projectDir),r.stop("Services restarted.")}catch(i){throw r.stop("Restart failed."),i}})}function Nh(e){e.command("routes").description("Show Rails routes (`bin/rails routes`)").argument("[args...]","arguments to pass to bin/rails routes").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bin/rails","routes",...t],r.projectDir)})}function Hh(e){e.command("rspec").description("Run RSpec tests (`bundle exec rspec \u2026`) inside the web container").argument("[args...]","files, line numbers, and flags to pass to rspec").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=b();await M(["bundle","exec","rspec",...t],r.projectDir,{env:{RAILS_ENV:"test"},edgeHint:"then re-run spree rspec"})})}function Vh(e){e.command("sample-data").description("Load sample data (products, categories, images)").action(async()=>{let t=b(),r=I();r.start("Loading sample data..."),await se("spree:load_sample_data",t.projectDir),r.stop("Sample data loaded.")})}function Wh(e){e.command("seed").description("Seed the database").action(async()=>{let t=b(),r=I();r.start("Seeding database..."),await se("db:seed",t.projectDir),r.stop("Database seeded.")})}function Kh(e){e.command("shell").alias("bash").description("Open an interactive bash shell inside the web container").action(async()=>{let t=b();await M(["bash"],t.projectDir,{edgeHint:"then open the shell"})})}function Yh(e){e.command("stop").description("Stop services").action(async()=>{let t=b(),r=I();r.start("Stopping services..."),await Z(["stop"],t.projectDir),r.stop("Services stopped.")})}function Jh(e){e.command("task").description("Run a Spree rake task (auto-prefixes `spree:`)").argument("<name>","task name (without `spree:` prefix)").argument("[args...]","arguments to pass to the task").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=b();await M(["bin/rake",`spree:${t}`,...r],i.projectDir)})}function Xh(e){e.command("update").description("Pull latest image and recreate containers").action(async()=>{let t=b();q.step("Pulling latest images..."),await Z(["pull"],t.projectDir,{stdio:"inherit"});let r=I();r.start("Recreating containers..."),await lt(t.projectDir,{stdio:"ignore"}),await Z(["up","-d"],t.projectDir),r.stop("Containers recreated."),q.success("Update complete! Migrations will run automatically on startup."),q.info("Run `spree logs` to follow the startup progress.")})}import Zh from"fs";import nS from"path";var qe=D(K(),1);function Qh(e){e.command("upgrade").description("Walk through a Spree version upgrade (bundle + migrate + spree:upgrade)").option("--plan","print the plan via spree:upgrade DRY_RUN=1; skip bundle + migrate").option("--step <id>","run a single rake step by id (skips bundle + migrate)").option("--to <version>","explicit target version (auto-detected from installed gem otherwise)").option("--yes","skip prompts on automated steps").action(async t=>{let r=b();await sS(r.projectDir),t.plan||t.step||(await aS(r.projectDir,t),await pS(r.projectDir,t)),await cS(r.projectDir,t),t.plan||uS(r.projectDir)})}async function sS(e){let t=r=>{j(r.join(`
967
967
  `)),process.exit(1)};Fe(e)&&t(["This is a monorepo edge project (SPREE_PATH set in .env).",`Run the upgrade from the monorepo root with ${qe.default.bold("pnpm server:*")} \u2014 the`,"project-local docker-compose.yml is not the running config here."]);try{await mt("web",e)}catch(r){t(["Could not inspect the Docker stack from this directory.",` ${qe.default.dim(String(r.message).split(`
968
- `)[0])}`,"",`Run ${qe.default.bold("spree upgrade")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}}async function sS(e,t){if(!t.yes){let i=await Je({message:"Run `bundle update` to bump Spree gems?",initialValue:!0});if(L(i)&&(j("Upgrade aborted."),process.exit(0)),!i){q.info("Skipping `bundle update`.");return}}let r=await aS(e);if(r.length===0)throw new Error('No Spree gems detected in Gemfile.lock. Confirm the project has `gem "spree"` (or `spree_core`/`spree_admin`) in its Gemfile.');q.step(qe.default.bold(`bundle update ${r.join(" ")}`)),await M(["bundle","update",...r],e)}async function aS(e){try{return(await Wa(["bundle","list","--name-only"],e)).split(`
968
+ `)[0])}`,"",`Run ${qe.default.bold("spree upgrade")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}}async function aS(e,t){if(!t.yes){let i=await Je({message:"Run `bundle update` to bump Spree gems?",initialValue:!0});if(L(i)&&(j("Upgrade aborted."),process.exit(0)),!i){q.info("Skipping `bundle update`.");return}}let r=await oS(e);if(r.length===0)throw new Error('No Spree gems detected in Gemfile.lock. Confirm the project has `gem "spree"` (or `spree_core`/`spree_admin`) in its Gemfile.');q.step(qe.default.bold(`bundle update ${r.join(" ")}`)),await M(["bundle","update",...r],e)}async function oS(e){try{return(await Wa(["bundle","list","--name-only"],e)).split(`
969
969
  `).map(r=>r.trim()).filter(r=>r.startsWith("spree"))}catch(t){let r=t;throw new Error("Could not list gems in the web container \u2014 the bundle looks out of sync.\nRun `spree bundle install` first, then re-run `spree upgrade`."+(r.stderr?.trim()?`
970
970
 
971
- ${r.stderr.trim()}`:""))}}async function oS(e,t){if(!t.yes){let r=await Je({message:"Install + run pending migrations?",initialValue:!0});if(L(r)&&(j("Upgrade aborted."),process.exit(0)),!r){q.info("Skipping migrations.");return}}q.step(qe.default.bold("spree:install:migrations + db:migrate")),await M(["bin/rails","spree:install:migrations","db:migrate"],e)}async function pS(e,t){let r={};t.plan&&(r.DRY_RUN="1"),t.step&&(r.STEP=t.step),t.to&&(r.TO=t.to),q.step(qe.default.bold("spree:upgrade")),await M(["bin/rake","spree:upgrade"],e,{env:r})}function cS(e){let t="Update @spree/sdk in any storefront or integration consuming the API",r=iS.join(e,"apps","storefront","package.json");if(!Xh.existsSync(r))return t;try{let i=JSON.parse(Xh.readFileSync(r,"utf-8")),n=i.dependencies?.["@spree/sdk"]??i.devDependencies?.["@spree/sdk"];return n?`Update @spree/sdk in apps/storefront (currently ${n}) to the release matching the new Spree version`:t}catch{return t}}function dS(e){V([`The manifest only ran ${qe.default.bold("rake-automatable")} steps.`,"","Don't forget the manual parts from the upgrade doc:",` ${qe.default.dim("- Schedule Spree::StockReservations::ExpireJob (cron)")}`,` ${qe.default.dim(`- ${cS(e)}`)}`,` ${qe.default.dim("- Review behavior changes (cart, availability, payment-method types)")}`,` ${qe.default.dim("- Audit custom decorators against renamed APIs")}`,"",`Full checklist: ${qe.default.cyan("https://spreecommerce.org/docs/developer/upgrades")}`].join(`
972
- `),"Next steps")}var Qh=D(K(),1);function ey(e){e.command("user").description("Manage admin users").command("create").description("Create an admin user").option("--email <email>","admin email").option("--password <password>","admin password").action(async r=>{let i=b(),n=r.email,s=r.password;if(!n){let o=await le({message:"Admin email:",placeholder:"admin@example.com",validate(p){if(!p)return"Email is required";if(!p.includes("@"))return"Invalid email"}});L(o)&&(j("Cancelled."),process.exit(0)),n=o}if(!s){let o=await ui({message:"Admin password:",validate(p){if(!p||p.length<6)return"Password must be at least 6 characters"}});L(o)&&(j("Cancelled."),process.exit(0)),s=o}let a=I();a.start("Creating admin user..."),await ne("spree:cli:create_admin",i.projectDir,{EMAIL:n,PASSWORD:s}),a.stop("Admin user created."),q.success(`Email: ${Qh.default.cyan(n)}`)})}import{createRequire as uS}from"module";var lS=uS(import.meta.url),ty=lS("../package.json").version;var C=new zo().name("spree").description("CLI for managing Spree Commerce projects").version(ty).enablePositionalOptions().showSuggestionAfterError(!0).showHelpAfterError("(run `spree --help` for usage)").exitOverride(e=>{(e.code.startsWith("commander.help")||e.code==="commander.version")&&process.exit(0),process.exit(2)});xh(C);Sm(C);Ah(C);Kh(C);Gh(C);Jh(C);Ch(C);Eh(C);yh(C);jh(C);Th(C);kh(C);Uh(C);Zh(C);Ph(C);Mh(C);gh(C);Fh(C);Yh(C);Nh(C);qh(C);Wh(C);ey(C);lh(C);Rh(C);Vh(C);Hh(C);zh(C);dh(C);hh(C);bh(C);async function mS(){try{await C.parseAsync()}catch(e){e instanceof Error&&"code"in e&&(e.code==="commander.helpDisplayed"||e.code==="commander.version")&&process.exit(0),e instanceof Error&&"code"in e&&String(e.code).startsWith("commander.")&&process.exit(2);let t=e instanceof Error&&e.constructor.name==="CredentialError"?2:1,r=e instanceof Error?e.message:"An unexpected error occurred.";console.error(`
973
- ${ry.default.red("Error:")} ${r}
974
- `),process.exit(t)}}mS();
971
+ ${r.stderr.trim()}`:""))}}async function pS(e,t){if(!t.yes){let r=await Je({message:"Install + run pending migrations?",initialValue:!0});if(L(r)&&(j("Upgrade aborted."),process.exit(0)),!r){q.info("Skipping migrations.");return}}q.step(qe.default.bold("spree:install:migrations + db:migrate")),await M(["bin/rails","spree:install:migrations","db:migrate"],e)}async function cS(e,t){let r={};t.plan&&(r.DRY_RUN="1"),t.step&&(r.STEP=t.step),t.to&&(r.TO=t.to),q.step(qe.default.bold("spree:upgrade")),await M(["bin/rake","spree:upgrade"],e,{env:r})}function dS(e){let t="Update @spree/sdk in any storefront or integration consuming the API",r=nS.join(e,"apps","storefront","package.json");if(!Zh.existsSync(r))return t;try{let i=JSON.parse(Zh.readFileSync(r,"utf-8")),n=i.dependencies?.["@spree/sdk"]??i.devDependencies?.["@spree/sdk"];return n?`Update @spree/sdk in apps/storefront (currently ${n}) to the release matching the new Spree version`:t}catch{return t}}function uS(e){V([`The manifest only ran ${qe.default.bold("rake-automatable")} steps.`,"","Don't forget the manual parts from the upgrade doc:",` ${qe.default.dim("- Schedule Spree::StockReservations::ExpireJob (cron)")}`,` ${qe.default.dim(`- ${dS(e)}`)}`,` ${qe.default.dim("- Review behavior changes (cart, availability, payment-method types)")}`,` ${qe.default.dim("- Audit custom decorators against renamed APIs")}`,"",`Full checklist: ${qe.default.cyan("https://spreecommerce.org/docs/developer/upgrades")}`].join(`
972
+ `),"Next steps")}var ey=D(K(),1);function ty(e){e.command("user").description("Manage admin users").command("create").description("Create an admin user").option("--email <email>","admin email").option("--password <password>","admin password").action(async r=>{let i=b(),n=r.email,s=r.password;if(!n){let o=await le({message:"Admin email:",placeholder:"admin@example.com",validate(p){if(!p)return"Email is required";if(!p.includes("@"))return"Invalid email"}});L(o)&&(j("Cancelled."),process.exit(0)),n=o}if(!s){let o=await ui({message:"Admin password:",validate(p){if(!p||p.length<6)return"Password must be at least 6 characters"}});L(o)&&(j("Cancelled."),process.exit(0)),s=o}let a=I();a.start("Creating admin user..."),await se("spree:cli:create_admin",i.projectDir,{EMAIL:n,PASSWORD:s}),a.stop("Admin user created."),q.success(`Email: ${ey.default.cyan(n)}`)})}import{createRequire as lS}from"module";var mS=lS(import.meta.url),ry=mS("../package.json").version;var C=new Mo().name("spree").description("CLI for managing Spree Commerce projects").version(ry).enablePositionalOptions().showSuggestionAfterError(!0).showHelpAfterError("(run `spree --help` for usage)").exitOverride(e=>{(e.code.startsWith("commander.help")||e.code==="commander.version")&&process.exit(0),process.exit(2)});Sh(C);$m(C);Eh(C);Yh(C);Uh(C);Xh(C);Th(C);Ph(C);gh(C);Ch(C);Rh(C);vh(C);Nh(C);Qh(C);jh(C);Fh(C);fh(C);Gh(C);Jh(C);Hh(C);kh(C);Kh(C);ty(C);mh(C);Ih(C);Wh(C);Vh(C);Mh(C);uh(C);yh(C);qh(C);async function hS(){try{await C.parseAsync()}catch(e){e instanceof Error&&"code"in e&&(e.code==="commander.helpDisplayed"||e.code==="commander.version")&&process.exit(0),e instanceof Error&&"code"in e&&String(e.code).startsWith("commander.")&&process.exit(2);let t=e instanceof Error&&e.constructor.name==="CredentialError"?2:1,r=e instanceof Error?e.message:"An unexpected error occurred.";console.error(`
973
+ ${iy.default.red("Error:")} ${r}
974
+ `),process.exit(t)}}hS();