@raclettejs/core 0.1.40 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -1
- package/dist/cli.js +104 -104
- package/dist/cli.js.map +4 -4
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
- package/services/frontend/eslint.config.js +31 -9
- package/services/frontend/src/core/setup/socketBootstrap.ts +4 -3
- package/services/frontend/src/core/store/state.ts +2 -7
- package/services/frontend/src/core/store/types/index.ts +2 -0
- package/services/frontend/src/orchestrator/ProductOrchestrator.vue +33 -22
- package/services/frontend/src/orchestrator/components/LoadingWidgetState.vue +7 -3
- package/services/frontend/src/orchestrator/components/composition/WidgetsLayoutLoader.vue +179 -195
- package/services/frontend/src/orchestrator/components/dataExport/DataExporter.vue +79 -24
- package/services/frontend/src/orchestrator/components/dataTable/BaseDataTable.vue +27 -14
- package/services/frontend/src/orchestrator/components/dataTable/BaseDataTableGroupSelectCheckbox.vue +42 -0
- package/services/frontend/src/orchestrator/components/index.ts +2 -0
- package/services/frontend/src/orchestrator/components/menu/ServerStatus.vue +2 -4
- package/services/frontend/src/orchestrator/components/menu/UserMenu.vue +1 -1
- package/services/frontend/src/orchestrator/components/welcomeScreen/AdminWelcomeScreen.vue +1 -1
- package/services/frontend/src/orchestrator/composables/index.ts +1 -0
- package/services/frontend/src/orchestrator/composables/useAppLoadingCoordinator.ts +77 -0
- package/services/frontend/src/orchestrator/composables/usePageNavigation.ts +1 -1
- package/services/frontend/src/orchestrator/composables/useUiState.ts +2 -0
- package/services/frontend/src/orchestrator/composables/useWidgetLifecycle.ts +65 -76
- package/services/frontend/src/orchestrator/composables/useWidgets/helperFunctions.ts +7 -4
- package/services/frontend/src/orchestrator/constants/index.ts +2 -0
- package/services/frontend/src/orchestrator/constants/widgetSlot.ts +7 -0
- package/services/frontend/src/orchestrator/exports.ts +1 -0
- package/services/frontend/src/orchestrator/helpers/staticWidgetRegistry.ts +9 -44
- package/services/frontend/src/orchestrator/helpers/widgetLayoutHelper.ts +37 -0
- package/services/frontend/src/orchestrator/helpers/widgetLoader.ts +0 -1
- package/services/frontend/src/orchestrator/helpers/widgetSlotHelper.ts +20 -0
- package/services/frontend/src/orchestrator/helpers/widgetVisuals.ts +11 -12
- package/services/frontend/src/orchestrator/helpers/wrapWidgetWithLifecycle.ts +32 -0
- package/services/frontend/src/orchestrator/router/routerHooks/afterEach.ts +1 -20
- package/services/frontend/src/orchestrator/types/Widgets.ts +12 -6
- package/src/types.ts +7 -1
package/dist/cli.js
CHANGED
|
@@ -1,94 +1,111 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
|
-
var
|
|
4
|
-
`)}displayWidth(t){return
|
|
3
|
+
var Vh=Object.create;var ho=Object.defineProperty;var Uh=Object.getOwnPropertyDescriptor;var Wh=Object.getOwnPropertyNames;var qh=Object.getPrototypeOf,Yh=Object.prototype.hasOwnProperty;var F=(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 vt=(e,t)=>()=>(e&&(t=e(e=0)),t);var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kh=(e,t)=>{for(var r in t)ho(e,r,{get:t[r],enumerable:!0})},zh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wh(t))!Yh.call(e,o)&&o!==r&&ho(e,o,{get:()=>t[o],enumerable:!(n=Uh(t,o))||n.enumerable});return e};var Dt=(e,t,r)=>(r=e!=null?Vh(qh(e)):{},zh(t||!e||!e.__esModule?ho(r,"default",{value:e,enumerable:!0}):r,e));var yr=w(Eo=>{var zr=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},_o=class extends zr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Eo.CommanderError=zr;Eo.InvalidArgumentError=_o});var Xr=w(ko=>{var{InvalidArgumentError:pm}=yr(),xo=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,n)=>{if(!this.argChoices.includes(r))throw new pm(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function dm(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}ko.Argument=xo;ko.humanReadableArgName=dm});var Ao=w(Co=>{var{humanReadableArgName:fm}=Xr(),wo=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(o=>!o._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,i)=>o.name().localeCompare(i.name())),r}compareOptions(t,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(o=>!o.hidden),n=t._getHelpOption();if(n&&!n.hidden){let o=n.short&&t._findOption(n.short),i=n.long&&t._findOption(n.long);!o&&!i?r.push(n):n.long&&!i?r.push(t.createOption(n.long,n.description)):n.short&&!o&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);r.push(...o)}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(n=>fm(n)).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((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let o=t.parent;o;o=o.parent)n=o.name()+" "+n;return n+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(n=>JSON.stringify(n)).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 n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let o=new Map;return t.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[])}),r.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[]),o.get(s).push(i)}),o}formatHelp(t,r){let n=r.padWidth(t,r),o=r.helpWidth??80;function i(p,d){return r.formatItem(p,n,d,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let c=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,d)=>{let y=p.map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(d,y,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(d=>i(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));s=s.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,d)=>{let y=p.map(m=>i(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(d,y,r))}),s.join(`
|
|
4
|
+
`)}displayWidth(t){return nc(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,n,o){let s=" ".repeat(2);if(!n)return s+t;let a=t.padEnd(r+t.length-o.displayWidth(t)),c=2,l=(this.helpWidth??80)-r-c-2,p;return l<this.minWidthToWrap||o.preformatted(n)?p=n:p=o.boxWrap(n,l).replace(/\n/g,`
|
|
5
5
|
`+" ".repeat(r+c)),s+a+" ".repeat(c)+p.replace(/\n/g,`
|
|
6
6
|
${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,i=[];return n.forEach(s=>{let a=s.match(o);if(a===null){i.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let p=this.displayWidth(l);if(u+p<=r){c.push(l),u+=p;return}i.push(c.join(""));let d=l.trimStart();c=[d],u=this.displayWidth(d)}),i.push(c.join(""))}),i.join(`
|
|
7
|
-
`)}};function
|
|
7
|
+
`)}};function nc(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Co.Help=wo;Co.stripColor=nc});var Oo=w(To=>{var{InvalidArgumentError:hm}=yr(),So=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 n=mm(t);this.short=n.shortFlag,this.long=n.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,n)=>{if(!this.argChoices.includes(r))throw new hm(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?oc(this.name().replace(/^no-/,"")):oc(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}},Ro=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,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return r.negate===(i===t)}};function oc(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function mm(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(t=i.shift()),o.test(i[0])&&(r=i.shift()),!t&&n.test(i[0])&&(t=i.shift()),!t&&o.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let s=i[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
8
8
|
- a short flag is a single dash and a single character
|
|
9
9
|
- either use a single dash and a single character (for a short flag)
|
|
10
10
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
11
11
|
- too many short flags`):o.test(s)?new Error(`${a}
|
|
12
12
|
- too many long flags`):new Error(`${a}
|
|
13
|
-
- 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}}
|
|
13
|
+
- 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}}To.Option=So;To.DualOptions=Ro});var sc=w(ic=>{function gm(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;e[o-1]===t[n-1]?i=0:i=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}function ym(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(s=>s.slice(2)));let n=[],o=3,i=.4;return t.forEach(s=>{if(s.length<=1)return;let a=gm(e,s),c=Math.max(e.length,s.length);(c-a)/c>i&&(a<o?(o=a,n=[s]):a===o&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
14
14
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
15
|
-
(Did you mean ${n[0]}?)`:""}
|
|
16
|
-
- 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
|
|
17
|
-
Expecting one of '${n.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,n){this._exitCallback&&this._exitCallback(new
|
|
18
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=o=>[o.name()].concat(o.aliases()),n=r(t).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let o=(i,s,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,s):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${t.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(t,r,n,o,i){if(typeof r=="object"&&r instanceof
|
|
19
|
-
- 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,n){if(
|
|
15
|
+
(Did you mean ${n[0]}?)`:""}ic.suggestSimilar=ym});var uc=w(Lo=>{var vm=F("node:events").EventEmitter,Po=F("node:child_process"),nt=F("node:path"),Jr=F("node:fs"),B=F("node:process"),{Argument:bm,humanReadableArgName:_m}=Xr(),{CommanderError:$o}=yr(),{Help:Em,stripColor:xm}=Ao(),{Option:ac,DualOptions:km}=Oo(),{suggestSimilar:cc}=sc(),Do=class e extends vm{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=>B.stdout.write(r),writeErr:r=>B.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>B.stdout.isTTY?B.stdout.columns:void 0,getErrHelpWidth:()=>B.stderr.isTTY?B.stderr.columns:void 0,getOutHasColors:()=>No()??(B.stdout.isTTY&&B.stdout.hasColors?.()),getErrHasColors:()=>No()??(B.stderr.isTTY&&B.stderr.hasColors?.()),stripColor:r=>xm(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,n){let o=r,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return o&&(c.description(o),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),o?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Em,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
|
|
16
|
+
- 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 bm(t,r)}argument(t,r,n,o){let i=this.createArgument(t,r);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),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 n=t??"help [command]",[,o,i]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(o);return a.helpOption(!1),i&&a.arguments(i),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),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 n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
17
|
+
Expecting one of '${n.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,n){this._exitCallback&&this._exitCallback(new $o(t,r,n)),B.exit(t)}action(t){let r=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new ac(t,r)}_callParseArg(t,r,n,o){try{return t.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=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 '${n}'
|
|
18
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=o=>[o.name()].concat(o.aliases()),n=r(t).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let o=(i,s,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,s):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${t.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(t,r,n,o,i){if(typeof r=="object"&&r instanceof ac)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let a=o;o=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(t,r,n,o){return this._optionEx({},t,r,n,o)}requiredOption(t,r,n,o){return this._optionEx({mandatory:!0},t,r,n,o)}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,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.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){B.versions?.electron&&(r.from="electron");let o=B.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=B.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":B.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=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",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),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.
|
|
19
|
+
- 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,n){if(Jr.existsSync(t))return;let o=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
|
|
20
20
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
21
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,p){let d=nt.resolve(l,p);if(
|
|
22
|
+
- ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,p){let d=nt.resolve(l,p);if(Jr.existsSync(d))return d;if(o.includes(nt.extname(p)))return;let y=o.find(m=>Jr.existsSync(`${d}${m}`));if(y)return`${d}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Jr.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=nt.resolve(nt.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!t._executableFile&&this._scriptPath){let p=nt.basename(this._scriptPath,nt.extname(this._scriptPath));p!==this._name&&(l=i(a,`${p}-${t._name}`))}s=l||s}n=o.includes(nt.extname(s));let c;B.platform!=="win32"?n?(r.unshift(s),r=lc(B.execArgv).concat(r),c=Po.spawn(B.argv[0],r,{stdio:"inherit"})):c=Po.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=lc(B.execArgv).concat(r),c=Po.spawn(B.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{B.on(p,()=>{c.killed===!1&&c.exitCode===null&&c.kill(p)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new $o(l,"commander.executeSubCommandAsync","(close)")):B.exit(l)}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)B.exit(1);else{let p=new $o(1,"commander.executeSubCommandAsync","(error)");p.nestedError=l,u(p)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let o=this._findCommand(t);o||this.help({error:!0}),o._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),i}_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=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,a)=>t(n,a,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=t(n,i,n.defaultValue))),r[o]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),r==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let o=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,r))}),o}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.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(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,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():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),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(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=t.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],o=r;function i(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(p=>p.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,a=null,c=null,u=0;for(;u<t.length||c;){let l=c??t[u++];if(c=null,l==="--"){o===n&&o.push(l),o.push(...t.slice(u));break}if(a&&(!i(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,i(l)){let p=this._findOption(l);if(p){if(p.required){let d=t[u++];d===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,d)}else if(p.optional){let d=null;u<t.length&&(!i(t[u])||s(t[u]))&&(d=t[u++]),this.emit(`option:${p.name()}`,d)}else this.emit(`option:${p.name()}`);a=p.variadic?p:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let p=this._findOption(`-${l[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,l.slice(2)):(this.emit(`option:${p.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let p=l.indexOf("="),d=this._findOption(l.slice(0,p));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(p+1));continue}}if(o===r&&i(l)&&!(this.commands.length===0&&s(l))&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),n.push(...t.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...t.slice(u));break}else if(this._defaultCommandName){n.push(l,...t.slice(u));break}}if(this._passThroughOptions){o.push(l,...t.slice(u));break}o.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();t[o]=o===this._versionOptionName?this._version:this[o]}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
23
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
24
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in B.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()}`,B.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new
|
|
26
|
-
`),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 n=this.parent?._findCommand(t);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${o}'`)}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(n=>
|
|
25
|
+
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in B.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()}`,B.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new km(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"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 n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),u=this.options.find(p=>p.negate&&a===p.attributeName()),l=this.options.find(p=>!p.negate&&a===p.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||s},o=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${o(t)} cannot be used with ${o(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);r=cc(t,o)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),r=cc(t,o)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
26
|
+
`),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 n=this.parent?._findCommand(t);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${o}'`)}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(n=>_m(n));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=nt.basename(t,nt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(t){t=t||{};let r=!!t.error,n,o,i;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let i=this.helpInformation({error:n.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",o))}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(B.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
27
27
|
Expecting one of '${n.join("', '")}'`);let o=`${t}Help`;return this.on(o,i=>{let s;typeof r=="function"?s=r({error:i.error,command:i.command}):s=r,s&&i.write(`${s}
|
|
28
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
29
|
-
`);let n;for(;(n=
|
|
30
|
-
`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}function zy(e){e=e||{};let t=kl(e);e.path=t;let r=ue.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=xl(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=Jy(r,a);i=ue.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return ue.parse(i)}function Xy(e){console.error(`[dotenv@${Jo}][WARN] ${e}`)}function wr(e){console.log(`[dotenv@${Jo}][DEBUG] ${e}`)}function El(e){console.log(`[dotenv@${Jo}] ${e}`)}function xl(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Jy(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let o=r.searchParams.get("environment");if(!o){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let i=`DOTENV_VAULT_${o.toUpperCase()}`,s=e.parsed[i];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function kl(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Xo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=on.resolve(process.cwd(),".env.vault");return Xo.existsSync(t)?t:null}function _l(e){return e[0]==="~"?on.join(Hy.homedir(),e.slice(1)):e}function Qy(e){let t=Qt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Qt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&El("Loading env from encrypted .env.vault");let n=ue._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),ue.populate(o,n,e),{parsed:n}}function Zy(e){let t=on.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=Qt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=Qt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&wr("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[_l(e.path)];else{s=[];for(let l of e.path)s.push(_l(l))}let a,c={};for(let l of s)try{let p=ue.parse(Xo.readFileSync(l,{encoding:r}));ue.populate(c,p,e)}catch(p){o&&wr(`Failed to load ${l} ${p.message}`),a=p}let u=ue.populate(n,c,e);if(o=Qt(n.DOTENV_CONFIG_DEBUG||o),i=Qt(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,p=[];for(let d of s)try{let y=on.relative(process.cwd(),d);p.push(y)}catch(y){o&&wr(`Failed to load ${d} ${y.message}`),a=y}El(`injecting env (${l}) from ${p.join(",")} ${qy(`-- tip: ${Uy()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function ev(e){if(xl(e).length===0)return ue.configDotenv(e);let t=kl(e);return t?ue._configVault(e):(Xy(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ue.configDotenv(e))}function tv(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{let s=Gy.createDecipheriv("aes-256-gcm",r,o);return s.setAuthTag(i),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function rv(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override),i={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s],i[s]=t[s]),n&&wr(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],i[s]=t[s]);return i}var ue={configDotenv:Zy,_configVault:Qy,_parseVault:zy,config:ev,decrypt:tv,parse:Ky,populate:rv};it.exports.configDotenv=ue.configDotenv;it.exports._configVault=ue._configVault;it.exports._parseVault=ue._parseVault;it.exports.config=ue.config;it.exports.decrypt=ue.decrypt;it.exports.parse=ue.parse;it.exports.populate=ue.populate;it.exports=ue});var Cl=k((XA,nv)=>{nv.exports={name:"@raclettejs/core",version:"0.1.39",description:"racletteJS core package",repository:"https://gitlab.com/raclettejs/core",author:"Pacifico Digital Explorations GmbH <info@raclettejs.com>",license:"AGPL-3.0-only",type:"module",scripts:{":install:services":"yarn --cwd ./services/backend install && yarn --cwd ./services/frontend install",build:"node build.mjs || true",dev:"node watch.mjs",watch:"node watch.mjs","format:check":"prettier --check .","format:fix":"prettier --write .",lint:"eslint","lint:grouped":"FILTER_RULE=$RULE eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --format ./dev/eslint/groupByRuleFormatter.cjs","lint:fix":"eslint --fix",prepublishOnly:"yarn run build && yarn run sync","publish:patch":"yarn version --patch && yarn publish",sync:"node ./scripts/sync-exports.js"},bin:{"check-dependencies.sh":"./bin/check-dependencies.sh",raclette:"./bin/cli.js"},main:"index.js",types:"./types/index.ts",files:["services","!services/**/.yarn","!services/**/node_modules","!services/**/.yarnrc.yml","bin","dist","types","scripts","index.js","README.md","yarn.lock","src/types.ts","LICENSE.md","CONTRIBUTING.md","raclette.default.config.yaml","templates"],exports:{".":{types:"./types/index.ts",import:"./dist/index.js"},"./backend":{types:"./services/backend/src/index.ts",import:"./services/backend/src/index.ts"},"./frontend":{types:"./services/frontend/src/core/index.ts",import:"./services/frontend/src/core/index.ts"},"./orchestrator":{types:"./services/frontend/src/orchestrator/index.ts",import:"./services/frontend/src/orchestrator/index.ts"}},config:{},dependencies:{"@inquirer/prompts":"8.3.2","@types/mustache":"4.2.6",chalk:"5.6.2",chokidar:"5.0.0","cli-highlight":"2.1.11",commander:"14.0.3",dotenv:"17.3.1",esbuild:"0.27.4","fs-extra":"11.3.4",globby:"16.1.1","js-yaml":"4.1.1",mustache:"4.2.0",ramda:"0.32.0","tsc-alias":"1.8.16"},devDependencies:{"@emnapi/core":"1.9.2","@emnapi/runtime":"1.9.2","@eslint/js":"9.35.0","@raclettejs/types":"workspace:*","@types/fs-extra":"11.0.4","@types/js-yaml":"4.0.9","@types/node":"25.5.0","@types/ramda":"0.31.1",eslint:"9.35.0","eslint-config-prettier":"9.1.2","eslint-flat-config-utils":"3.0.2","eslint-plugin-import":"2.32.0","eslint-plugin-prefer-arrow-functions":"3.9.1","eslint-plugin-prettier":"5.5.5","eslint-plugin-vue":"9.33.0",globals:"17.4.0",prettier:"3.8.1",typescript:"5.9.3","typescript-eslint":"8.59.2","vue-eslint-parser":"10.3.0"}}});import{on as ov,once as Al}from"node:events";import{PassThrough as iv,getDefaultHighWaterMark as sv}from"node:stream";import{finished as Tl}from"node:stream/promises";function ti(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)ei(o);let t=e.some(({readableObjectMode:o})=>o),r=av(e,t),n=new Zo({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var av,Zo,cv,lv,uv,ei,pv,dv,fv,hv,mv,Ol,Pl,ri,$l,gv,sn,Sl,Rl,Dl=vt(()=>{av=(e,t)=>{if(e.length===0)return sv(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Zo=class extends iv{#e=new Set([]);#o=new Set([]);#i=new Set([]);#r;#n=Symbol("unpipe");#t=new WeakMap;add(t){if(ei(t),this.#e.has(t))return;this.#e.add(t),this.#r??=cv(this,this.#e,this.#n);let r=pv({passThroughStream:this,stream:t,streams:this.#e,ended:this.#o,aborted:this.#i,onFinished:this.#r,unpipeEvent:this.#n});this.#t.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(ei(t),!this.#e.has(t))return!1;let r=this.#t.get(t);return r===void 0?!1:(this.#t.delete(t),t.unpipe(this),await r,!0)}},cv=async(e,t,r)=>{sn(e,Sl);let n=new AbortController;try{await Promise.race([lv(e,n),uv(e,t,r,n)])}finally{n.abort(),sn(e,-Sl)}},lv=async(e,{signal:t})=>{try{await Tl(e,{signal:t,cleanup:!0})}catch(r){throw Ol(e,r),r}},uv=async(e,t,r,{signal:n})=>{for await(let[o]of ov(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},ei=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},pv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{sn(e,Rl);let a=new AbortController;try{await Promise.race([dv(i,t,a),fv({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),hv({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),sn(e,-Rl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?ri(e):mv(e))},dv=async(e,t,{signal:r})=>{try{await e,r.aborted||ri(t)}catch(n){r.aborted||Ol(t,n)}},fv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await Tl(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;Pl(s)?o.add(t):$l(e,s)}},hv=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await Al(e,o,{signal:i}),!e.readable)return Al(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},mv=e=>{e.writable&&e.end()},Ol=(e,t)=>{Pl(t)?ri(e):$l(e,t)},Pl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",ri=e=>{(e.readable||e.writable)&&e.destroy()},$l=(e,t)=>{e.destroyed||(e.once("error",gv),e.destroy(t))},gv=()=>{},sn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Sl=2,Rl=1});var Nl=k(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.splitWhen=Zt.flatten=void 0;function yv(e){return e.reduce((t,r)=>[].concat(t,r),[])}Zt.flatten=yv;function vv(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Zt.splitWhen=vv});var Ll=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.isEnoentCodeError=void 0;function bv(e){return e.code==="ENOENT"}an.isEnoentCodeError=bv});var Il=k(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.createDirentFromStats=void 0;var ni=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function _v(e,t){return new ni(e,t)}cn.createDirentFromStats=_v});var Bl=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.convertPosixPathToPattern=se.convertWindowsPathToPattern=se.convertPathToPattern=se.escapePosixPath=se.escapeWindowsPath=se.escape=se.removeLeadingDotSegment=se.makeAbsolute=se.unixify=void 0;var Ev=M("os"),xv=M("path"),Fl=Ev.platform()==="win32",kv=2,wv=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Cv=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Av=/^\\\\([.?])/,Sv=/\\(?![!()+@[\]{}])/g;function Rv(e){return e.replace(/\\/g,"/")}se.unixify=Rv;function Tv(e,t){return xv.resolve(e,t)}se.makeAbsolute=Tv;function Ov(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(kv)}return e}se.removeLeadingDotSegment=Ov;se.escape=Fl?oi:ii;function oi(e){return e.replace(Cv,"\\$2")}se.escapeWindowsPath=oi;function ii(e){return e.replace(wv,"\\$2")}se.escapePosixPath=ii;se.convertPathToPattern=Fl?jl:Ml;function jl(e){return oi(e).replace(Av,"//$1").replace(Sv,"/")}se.convertWindowsPathToPattern=jl;function Ml(e){return ii(e)}se.convertPosixPathToPattern=Ml});var Gl=k((iS,Hl)=>{Hl.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var Wl=k((sS,Ul)=>{var Pv=Gl(),Vl={"{":"}","(":")","[":"]"},$v=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,o=-2,i=-2,s=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(s===-1||s>n||(s=e.indexOf("\\",t),s===-1||s>n)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(s=e.indexOf("\\",t),s===-1||s>o))||i!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(i=e.indexOf(")",t),i>t&&(s=e.indexOf("\\",t),s===-1||s>i))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(i=e.indexOf(")",r),i>r&&(s=e.indexOf("\\",r),s===-1||s>i))))return!0;if(e[t]==="\\"){var a=e[t+1];t+=2;var c=Vl[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},Dv=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=Vl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};Ul.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Pv(t))return!0;var n=$v;return r&&r.strict===!1&&(n=Dv),n(t)}});var Yl=k((aS,ql)=>{"use strict";var Nv=Wl(),Lv=M("path").posix.dirname,Iv=M("os").platform()==="win32",si="/",Fv=/\\/g,jv=/[\{\[].*[\}\]]$/,Mv=/(^|[^\\])([\{\[]|\([^\)]+$)/,Bv=/\\([\!\*\?\|\[\]\(\)\{\}])/g;ql.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Iv&&t.indexOf(si)<0&&(t=t.replace(Fv,si)),jv.test(t)&&(t+=si),t+="a";do t=Lv(t);while(Nv(t)||Mv.test(t));return t.replace(Bv,"$1")}});var ln=k(De=>{"use strict";De.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;De.find=(e,t)=>e.nodes.find(r=>r.type===t);De.exceedsLimit=(e,t,r=1,n)=>n===!1||!De.isInteger(e)||!De.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;De.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};De.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;De.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;De.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;De.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);De.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let i=n[o];if(Array.isArray(i)){r(i);continue}i!==void 0&&t.push(i)}return t};return r(e),t}});var un=k((lS,zl)=>{"use strict";var Kl=ln();zl.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&Kl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&Kl.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(e)}});var Jl=k((uS,Xl)=>{"use strict";Xl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var su=k((pS,iu)=>{"use strict";var Ql=Jl(),Lt=(e,t,r)=>{if(Ql(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Ql(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),i=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=e+":"+t+"="+o+i+s+a;if(Lt.cache.hasOwnProperty(c))return Lt.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let m=e+"|"+t;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let p=ou(e)||ou(t),d={min:e,max:t,a:u,b:l},y=[],g=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let m=l<0?Math.abs(l):1;g=Zl(m,Math.abs(u),d,n),u=d.a=0}return l>=0&&(y=Zl(u,l,d,n)),d.negatives=g,d.positives=y,d.result=Hv(g,y,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&y.length+g.length>1&&(d.result=`(?:${d.result})`),Lt.cache[c]=d,d.result};function Hv(e,t,r){let n=ai(e,t,"-",!1,r)||[],o=ai(t,e,"",!1,r)||[],i=ai(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Gv(e,t){let r=1,n=1,o=tu(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=tu(e,r);for(o=ru(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=ru(t+1,n)-1;return i=[...i],i.sort(Wv),i}function Vv(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Uv(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,u]=n[a];c===u?i+=c:c!=="0"||u!=="9"?i+=qv(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Zl(e,t,r,n){let o=Gv(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Vv(String(s),String(u),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+nu(a.count),s=u+1;continue}r.isPadded&&(p=Yv(u,r,n)),l.string=p+l.pattern+nu(l.count),i.push(l),s=u+1,a=l}return i}function ai(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!eu(t,"string",a)&&i.push(r+a),n&&eu(t,"string",a)&&i.push(r+a)}return i}function Uv(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Wv(e,t){return e>t?1:t>e?-1:0}function eu(e,t,r){return e.some(n=>n[t]===r)}function tu(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function ru(e,t){return e-e%Math.pow(10,t)}function nu(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function qv(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function ou(e){return/^-?(0+)\d/.test(e)}function Yv(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}Lt.cache={};Lt.clearCache=()=>Lt.cache={};iu.exports=Lt});var ui=k((dS,fu)=>{"use strict";var Kv=M("util"),cu=su(),au=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),zv=e=>t=>e===!0?Number(t):String(t),ci=e=>typeof e=="number"||typeof e=="string"&&e!=="",Cr=e=>Number.isInteger(+e),li=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Xv=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Jv=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},dn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Qv=(e,t,r)=>{e.negatives.sort((a,c)=>a<c?-1:a>c?1:0),e.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=t.capture?"":"?:",o="",i="",s;return e.positives.length&&(o=e.positives.map(a=>dn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>dn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},lu=(e,t,r,n)=>{if(r)return cu(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},uu=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return cu(e,t,r)},pu=(...e)=>new RangeError("Invalid range arguments: "+Kv.inspect(...e)),du=(e,t,r)=>{if(r.strictRanges===!0)throw pu([e,t]);return[]},Zv=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},eb=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw pu([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),u=String(r);r=Math.max(Math.abs(r),1);let l=li(a)||li(c)||li(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&Xv(e,t,n)===!1,y=n.transform||zv(d);if(n.toRegex&&r===1)return lu(dn(e,p),dn(t,p),!0,n);let g={negatives:[],positives:[]},m=S=>g[S<0?"negatives":"positives"].push(Math.abs(S)),E=[],x=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?m(o):E.push(Jv(y(o,x),p,d)),o=s?o-r:o+r,x++;return n.toRegex===!0?r>1?Qv(g,n,p):uu(E,null,{wrap:!1,...n}):E},tb=(e,t,r=1,n={})=>{if(!Cr(e)&&e.length>1||!Cr(t)&&t.length>1)return du(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),i=`${e}`.charCodeAt(0),s=`${t}`.charCodeAt(0),a=i>s,c=Math.min(i,s),u=Math.max(i,s);if(n.toRegex&&r===1)return lu(c,u,!1,n);let l=[],p=0;for(;a?i>=s:i<=s;)l.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?uu(l,null,{wrap:!1,options:n}):l},pn=(e,t,r,n={})=>{if(t==null&&ci(e))return[e];if(!ci(e)||!ci(t))return du(e,t,n);if(typeof r=="function")return pn(e,t,1,{transform:r});if(au(r))return pn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,Cr(r)?Cr(e)&&Cr(t)?eb(e,t,r,o):tb(e,t,Math.max(Math.abs(r),1),o):r!=null&&!au(r)?Zv(r,o):pn(e,t,1,r)};fu.exports=pn});var gu=k((fS,mu)=>{"use strict";var rb=ui(),hu=ln(),nb=(e,t={})=>{let r=(n,o={})=>{let i=hu.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=hu.reduce(n.nodes),p=rb(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(e)};mu.exports=nb});var bu=k((hS,vu)=>{"use strict";var ob=ui(),yu=un(),er=ln(),It=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?er.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(It(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?It(o,i,r):o+i);return er.flatten(n)},ib=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,i={})=>{o.queue=[];let s=i,a=i.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(o.invalid||o.dollar){a.push(It(a.pop(),yu(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(It(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=er.reduce(o.nodes);if(er.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=ob(...p,t);d.length===0&&(d=yu(o,t)),a.push(It(a.pop(),d)),o.nodes=[];return}let c=er.encloseBrace(o),u=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&u.push(""),u.push("");continue}if(d.type==="close"){a.push(It(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(It(u.pop(),d.value));continue}d.nodes&&n(d,o)}return u};return er.flatten(n(e))};vu.exports=ib});var Eu=k((mS,_u)=>{"use strict";_u.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
31
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Au=k((gS,Cu)=>{"use strict";var sb=un(),{MAX_LENGTH:xu,CHAR_BACKSLASH:pi,CHAR_BACKTICK:ab,CHAR_COMMA:cb,CHAR_DOT:lb,CHAR_LEFT_PARENTHESES:ub,CHAR_RIGHT_PARENTHESES:pb,CHAR_LEFT_CURLY_BRACE:db,CHAR_RIGHT_CURLY_BRACE:fb,CHAR_LEFT_SQUARE_BRACKET:ku,CHAR_RIGHT_SQUARE_BRACKET:wu,CHAR_DOUBLE_QUOTE:hb,CHAR_SINGLE_QUOTE:mb,CHAR_NO_BREAK_SPACE:gb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:yb}=Eu(),vb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(xu,r.maxLength):xu;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},i=[o],s=o,a=o,c=0,u=e.length,l=0,p=0,d,y=()=>e[l++],g=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(g({type:"bos"});l<u;)if(s=i[i.length-1],d=y(),!(d===yb||d===gb)){if(d===pi){g({type:"text",value:(t.keepEscaping?d:"")+y()});continue}if(d===wu){g({type:"text",value:"\\"+d});continue}if(d===ku){c++;let m;for(;l<u&&(m=y());){if(d+=m,m===ku){c++;continue}if(m===pi){d+=y();continue}if(m===wu&&(c--,c===0))break}g({type:"text",value:d});continue}if(d===ub){s=g({type:"paren",nodes:[]}),i.push(s),g({type:"text",value:d});continue}if(d===pb){if(s.type!=="paren"){g({type:"text",value:d});continue}s=i.pop(),g({type:"text",value:d}),s=i[i.length-1];continue}if(d===hb||d===mb||d===ab){let m=d,E;for(t.keepQuotes!==!0&&(d="");l<u&&(E=y());){if(E===pi){d+=E+y();continue}if(E===m){t.keepQuotes===!0&&(d+=E);break}d+=E}g({type:"text",value:d});continue}if(d===db){p++;let E={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=g(E),i.push(s),g({type:"open",value:d});continue}if(d===fb){if(s.type!=="brace"){g({type:"text",value:d});continue}let m="close";s=i.pop(),s.close=!0,g({type:m,value:d}),p--,s=i[i.length-1];continue}if(d===cb&&p>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:sb(s)}]}g({type:"comma",value:d}),s.commas++;continue}if(d===lb&&p>0&&s.commas===0){let m=s.nodes;if(p===0||m.length===0){g({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let E=m[m.length-1];E.value+=a.value+d,a=E,s.ranges--;continue}g({type:"dot",value:d});continue}g({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0)});let m=i[i.length-1],E=m.nodes.indexOf(s);m.nodes.splice(E,1,...s.nodes)}while(i.length>0);return g({type:"eos"}),o};Cu.exports=vb});var Tu=k((yS,Ru)=>{"use strict";var Su=un(),bb=gu(),_b=bu(),Eb=Au(),Re=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Re.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Re.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Re.parse=(e,t={})=>Eb(e,t);Re.stringify=(e,t={})=>Su(typeof e=="string"?Re.parse(e,t):e,t);Re.compile=(e,t={})=>(typeof e=="string"&&(e=Re.parse(e,t)),bb(e,t));Re.expand=(e,t={})=>{typeof e=="string"&&(e=Re.parse(e,t));let r=_b(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Re.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Re.compile(e,t):Re.expand(e,t);Ru.exports=Re});var Ar=k((vS,Nu)=>{"use strict";var xb=M("path"),Je="\\\\/",Ou=`[^${Je}]`,kb=0,st="\\.",wb="\\+",Cb="\\?",fn="\\/",Ab="(?=.)",Pu="[^/]",di=`(?:${fn}|$)`,$u=`(?:^|${fn})`,fi=`${st}{1,2}${di}`,Sb=`(?!${st})`,Rb=`(?!${$u}${fi})`,Tb=`(?!${st}{0,1}${di})`,Ob=`(?!${fi})`,Pb=`[^.${fn}]`,$b=`${Pu}*?`,Du={DOT_LITERAL:st,PLUS_LITERAL:wb,QMARK_LITERAL:Cb,SLASH_LITERAL:fn,ONE_CHAR:Ab,QMARK:Pu,END_ANCHOR:di,DOTS_SLASH:fi,NO_DOT:Sb,NO_DOTS:Rb,NO_DOT_SLASH:Tb,NO_DOTS_SLASH:Ob,QMARK_NO_DOT:Pb,STAR:$b,START_ANCHOR:$u},Db={...Du,SLASH_LITERAL:`[${Je}]`,QMARK:Ou,STAR:`${Ou}*?`,DOTS_SLASH:`${st}{1,2}(?:[${Je}]|$)`,NO_DOT:`(?!${st})`,NO_DOTS:`(?!(?:^|[${Je}])${st}{1,2}(?:[${Je}]|$))`,NO_DOT_SLASH:`(?!${st}{0,1}(?:[${Je}]|$))`,NO_DOTS_SLASH:`(?!${st}{1,2}(?:[${Je}]|$))`,QMARK_NO_DOT:`[^.${Je}]`,START_ANCHOR:`(?:^|[${Je}])`,END_ANCHOR:`(?:[${Je}]|$)`},Nb={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Nu.exports={DEFAULT_MAX_EXTGLOB_RECURSION:kb,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Nb,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:xb.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Db:Du}}});var Sr=k(we=>{"use strict";var Lb=M("path"),Ib=process.platform==="win32",{REGEX_BACKSLASH:Fb,REGEX_REMOVE_BACKSLASH:jb,REGEX_SPECIAL_CHARS:Mb,REGEX_SPECIAL_CHARS_GLOBAL:Bb}=Ar();we.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);we.hasRegexChars=e=>Mb.test(e);we.isRegexChar=e=>e.length===1&&we.hasRegexChars(e);we.escapeRegex=e=>e.replace(Bb,"\\$1");we.toPosixSlashes=e=>e.replace(Fb,"/");we.removeBackslashes=e=>e.replace(jb,t=>t==="\\"?"":t);we.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};we.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Ib===!0||Lb.sep==="\\";we.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?we.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};we.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};we.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Gu=k((_S,Hu)=>{"use strict";var Lu=Sr(),{CHAR_ASTERISK:hi,CHAR_AT:Hb,CHAR_BACKWARD_SLASH:Rr,CHAR_COMMA:Gb,CHAR_DOT:mi,CHAR_EXCLAMATION_MARK:gi,CHAR_FORWARD_SLASH:Bu,CHAR_LEFT_CURLY_BRACE:yi,CHAR_LEFT_PARENTHESES:vi,CHAR_LEFT_SQUARE_BRACKET:Vb,CHAR_PLUS:Ub,CHAR_QUESTION_MARK:Iu,CHAR_RIGHT_CURLY_BRACE:Wb,CHAR_RIGHT_PARENTHESES:Fu,CHAR_RIGHT_SQUARE_BRACKET:qb}=Ar(),ju=e=>e===Bu||e===Rr,Mu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Yb=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,u=-1,l=0,p=0,d=!1,y=!1,g=!1,m=!1,E=!1,x=!1,S=!1,D=!1,oe=!1,q=!1,P=0,I,w,F={value:"",depth:0,isGlob:!1},ae=()=>u>=n,_=()=>c.charCodeAt(u+1),Q=()=>(I=w,c.charCodeAt(++u));for(;u<n;){w=Q();let ve;if(w===Rr){S=F.backslashes=!0,w=Q(),w===yi&&(x=!0);continue}if(x===!0||w===yi){for(P++;ae()!==!0&&(w=Q());){if(w===Rr){S=F.backslashes=!0,Q();continue}if(w===yi){P++;continue}if(x!==!0&&w===mi&&(w=Q())===mi){if(d=F.isBrace=!0,g=F.isGlob=!0,q=!0,o===!0)continue;break}if(x!==!0&&w===Gb){if(d=F.isBrace=!0,g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Wb&&(P--,P===0)){x=!1,d=F.isBrace=!0,q=!0;break}}if(o===!0)continue;break}if(w===Bu){if(i.push(u),s.push(F),F={value:"",depth:0,isGlob:!1},q===!0)continue;if(I===mi&&u===l+1){l+=2;continue}p=u+1;continue}if(r.noext!==!0&&(w===Ub||w===Hb||w===hi||w===Iu||w===gi)===!0&&_()===vi){if(g=F.isGlob=!0,m=F.isExtglob=!0,q=!0,w===gi&&u===l&&(oe=!0),o===!0){for(;ae()!==!0&&(w=Q());){if(w===Rr){S=F.backslashes=!0,w=Q();continue}if(w===Fu){g=F.isGlob=!0,q=!0;break}}continue}break}if(w===hi){if(I===hi&&(E=F.isGlobstar=!0),g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Iu){if(g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Vb){for(;ae()!==!0&&(ve=Q());){if(ve===Rr){S=F.backslashes=!0,Q();continue}if(ve===qb){y=F.isBracket=!0,g=F.isGlob=!0,q=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&w===gi&&u===l){D=F.negated=!0,l++;continue}if(r.noparen!==!0&&w===vi){if(g=F.isGlob=!0,o===!0){for(;ae()!==!0&&(w=Q());){if(w===vi){S=F.backslashes=!0,w=Q();continue}if(w===Fu){q=!0;break}}continue}break}if(g===!0){if(q=!0,o===!0)continue;break}}r.noext===!0&&(m=!1,g=!1);let z=c,gt="",v="";l>0&&(gt=c.slice(0,l),c=c.slice(l),p-=l),z&&g===!0&&p>0?(z=c.slice(0,p),v=c.slice(p)):g===!0?(z="",v=c):z=c,z&&z!==""&&z!=="/"&&z!==c&&ju(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),r.unescape===!0&&(v&&(v=Lu.removeBackslashes(v)),z&&S===!0&&(z=Lu.removeBackslashes(z)));let b={prefix:gt,input:e,start:l,base:z,glob:v,isBrace:d,isBracket:y,isGlob:g,isExtglob:m,isGlobstar:E,negated:D,negatedExtglob:oe};if(r.tokens===!0&&(b.maxDepth=0,ju(w)||s.push(F),b.tokens=s),r.parts===!0||r.tokens===!0){let ve;for(let j=0;j<i.length;j++){let Ve=ve?ve+1:l,Ue=i[j],Se=e.slice(Ve,Ue);r.tokens&&(j===0&&l!==0?(s[j].isPrefix=!0,s[j].value=gt):s[j].value=Se,Mu(s[j]),b.maxDepth+=s[j].depth),(j!==0||Se!=="")&&a.push(Se),ve=Ue}if(ve&&ve+1<e.length){let j=e.slice(ve+1);a.push(j),r.tokens&&(s[s.length-1].value=j,Mu(s[s.length-1]),b.maxDepth+=s[s.length-1].depth)}b.slashes=i,b.parts=a}return b};Hu.exports=Yb});var Yu=k((ES,qu)=>{"use strict";var Tr=Ar(),me=Sr(),{MAX_LENGTH:hn,POSIX_REGEX_SOURCE:Kb,REGEX_NON_SPECIAL_CHARS:zb,REGEX_SPECIAL_CHARS_BACKREF:Xb,REPLACEMENTS:Vu}=Tr,Jb=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>me.escapeRegex(o)).join("..")}return r},tr=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Uu=e=>{let t=[],r=0,n=0,o=0,i="",s=!1;for(let a of e){if(s===!0){i+=a,s=!1;continue}if(a==="\\"){i+=a,s=!0;continue}if(a==='"'){o=o===1?0:1,i+=a;continue}if(o===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){t.push(i),i="";continue}}}i+=a}return t.push(i),t},Qb=e=>{let t=!1;for(let r of e){if(t===!0){t=!1;continue}if(r==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Wu=e=>{let t=e.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),r=!0);if(Qb(t))return t.replace(/\\(.)/g,"$1")},Zb=e=>{let t=e.map(Wu).filter(Boolean);for(let r=0;r<t.length;r++)for(let n=r+1;n<t.length;n++){let o=t[r],i=t[n],s=o[0];if(!(!s||o!==s.repeat(o.length)||i!==s.repeat(i.length))&&(o===i||o.startsWith(i)||i.startsWith(o)))return!0}return!1},bi=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let r=0,n=0,o=0,i=!1;for(let s=1;s<e.length;s++){let a=e[s];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){o=o===1?0:1;continue}if(o!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return t===!0&&s!==e.length-1?void 0:{type:e[0],body:e.slice(2,s),end:s}}}}},e_=e=>{let t=0,r=[];for(;t<e.length;){let o=bi(e.slice(t),!1);if(!o||o.type!=="*")return;let i=Uu(o.body).map(a=>a.trim());if(i.length!==1)return;let s=Wu(i[0]);if(!s||s.length!==1)return;r.push(s),t+=o.end+1}return r.length<1?void 0:`${r.length===1?me.escapeRegex(r[0]):`[${r.map(o=>me.escapeRegex(o)).join("")}]`}*`},t_=e=>{let t=0,r=e.trim(),n=bi(r);for(;n;)t++,r=n.body.trim(),n=bi(r);return t},r_=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion=="number"?t.maxExtglobRecursion:Tr.DEFAULT_MAX_EXTGLOB_RECURSION,n=Uu(e).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||Zb(n)))return{risky:!0};for(let o of n){let i=e_(o);if(i)return{risky:!0,safeOutput:i};if(t_(o)>r)return{risky:!0}}return{risky:!1}},_i=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Vu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(hn,r.maxLength):hn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},s=[i],a=r.capture?"":"?:",c=me.isWindows(t),u=Tr.globChars(c),l=Tr.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:y,ONE_CHAR:g,DOTS_SLASH:m,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:S,QMARK:D,QMARK_NO_DOT:oe,STAR:q,START_ANCHOR:P}=u,I=A=>`(${a}(?:(?!${P}${A.dot?m:p}).)*?)`,w=r.dot?"":E,F=r.dot?D:oe,ae=r.bash===!0?I(r):q;r.capture&&(ae=`(${ae})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};e=me.removePrefix(e,_),o=e.length;let Q=[],z=[],gt=[],v=i,b,ve=()=>_.index===o-1,j=_.peek=(A=1)=>e[_.index+A],Ve=_.advance=()=>e[++_.index]||"",Ue=()=>e.slice(_.index+1),Se=(A="",Z=0)=>{_.consumed+=A,_.index+=Z},Gr=A=>{_.output+=A.output!=null?A.output:A.value,Se(A.value)},Dh=()=>{let A=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Ve(),_.start++,A++;return A%2===0?!1:(_.negated=!0,_.start++,!0)},Vr=A=>{_[A]++,gt.push(A)},yt=A=>{_[A]--,gt.pop()},L=A=>{if(v.type==="globstar"){let Z=_.braces>0&&(A.type==="comma"||A.type==="brace"),C=A.extglob===!0||Q.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!Z&&!C&&(_.output=_.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=ae,_.output+=v.output)}if(Q.length&&A.type!=="paren"&&(Q[Q.length-1].inner+=A.value),(A.value||A.output)&&Gr(A),v&&v.type==="text"&&A.type==="text"){v.value+=A.value,v.output=(v.output||"")+A.value;return}A.prev=v,s.push(A),v=A},Ur=(A,Z)=>{let C={...l[Z],conditions:1,inner:""};C.prev=v,C.parens=_.parens,C.output=_.output,C.startIndex=_.index,C.tokensIndex=s.length;let N=(r.capture?"(":"")+C.open;Vr("parens"),L({type:A,value:Z,output:_.output?"":g}),L({type:"paren",extglob:!0,value:Ve(),output:N}),Q.push(C)},Nh=A=>{let Z=e.slice(A.startIndex,_.index+1),C=e.slice(A.startIndex+2,_.index),N=r_(C,r);if((A.type==="plus"||A.type==="star")&&N.risky){let Y=N.safeOutput?(A.output?"":g)+(r.capture?`(${N.safeOutput})`:N.safeOutput):void 0,We=s[A.tokensIndex];We.type="text",We.value=Z,We.output=Y||me.escapeRegex(Z);for(let qe=A.tokensIndex+1;qe<s.length;qe++)s[qe].value="",s[qe].output="",delete s[qe].suffix;_.output=A.output+We.output,_.backtrack=!0,L({type:"paren",extglob:!0,value:b,output:""}),yt("parens");return}let X=A.close+(r.capture?")":""),ce;if(A.type==="negate"){let Y=ae;if(A.inner&&A.inner.length>1&&A.inner.includes("/")&&(Y=I(r)),(Y!==ae||ve()||/^\)+$/.test(Ue()))&&(X=A.close=`)$))${Y}`),A.inner.includes("*")&&(ce=Ue())&&/^\.[^\\/.]+$/.test(ce)){let We=_i(ce,{...t,fastpaths:!1}).output;X=A.close=`)${We})${Y})`}A.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:b,output:X}),yt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let A=!1,Z=e.replace(Xb,(C,N,X,ce,Y,We)=>ce==="\\"?(A=!0,C):ce==="?"?N?N+ce+(Y?D.repeat(Y.length):""):We===0?F+(Y?D.repeat(Y.length):""):D.repeat(X.length):ce==="."?p.repeat(X.length):ce==="*"?N?N+ce+(Y?ae:""):ae:N?C:`\\${C}`);return A===!0&&(r.unescape===!0?Z=Z.replace(/\\/g,""):Z=Z.replace(/\\+/g,C=>C.length%2===0?"\\\\":C?"\\":"")),Z===e&&r.contains===!0?(_.output=e,_):(_.output=me.wrapOutput(Z,_,t),_)}for(;!ve();){if(b=Ve(),b==="\0")continue;if(b==="\\"){let C=j();if(C==="/"&&r.bash!==!0||C==="."||C===";")continue;if(!C){b+="\\",L({type:"text",value:b});continue}let N=/^\\+/.exec(Ue()),X=0;if(N&&N[0].length>2&&(X=N[0].length,_.index+=X,X%2!==0&&(b+="\\")),r.unescape===!0?b=Ve():b+=Ve(),_.brackets===0){L({type:"text",value:b});continue}}if(_.brackets>0&&(b!=="]"||v.value==="["||v.value==="[^")){if(r.posix!==!1&&b===":"){let C=v.value.slice(1);if(C.includes("[")&&(v.posix=!0,C.includes(":"))){let N=v.value.lastIndexOf("["),X=v.value.slice(0,N),ce=v.value.slice(N+2),Y=Kb[ce];if(Y){v.value=X+Y,_.backtrack=!0,Ve(),!i.output&&s.indexOf(v)===1&&(i.output=g);continue}}}(b==="["&&j()!==":"||b==="-"&&j()==="]")&&(b=`\\${b}`),b==="]"&&(v.value==="["||v.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&v.value==="["&&(b="^"),v.value+=b,Gr({value:b});continue}if(_.quotes===1&&b!=='"'){b=me.escapeRegex(b),v.value+=b,Gr({value:b});continue}if(b==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:b});continue}if(b==="("){Vr("parens"),L({type:"paren",value:b});continue}if(b===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(tr("opening","("));let C=Q[Q.length-1];if(C&&_.parens===C.parens+1){Nh(Q.pop());continue}L({type:"paren",value:b,output:_.parens?")":"\\)"}),yt("parens");continue}if(b==="["){if(r.nobracket===!0||!Ue().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(tr("closing","]"));b=`\\${b}`}else Vr("brackets");L({type:"bracket",value:b});continue}if(b==="]"){if(r.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){L({type:"text",value:b,output:`\\${b}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(tr("opening","["));L({type:"text",value:b,output:`\\${b}`});continue}yt("brackets");let C=v.value.slice(1);if(v.posix!==!0&&C[0]==="^"&&!C.includes("/")&&(b=`/${b}`),v.value+=b,Gr({value:b}),r.literalBrackets===!1||me.hasRegexChars(C))continue;let N=me.escapeRegex(v.value);if(_.output=_.output.slice(0,-v.value.length),r.literalBrackets===!0){_.output+=N,v.value=N;continue}v.value=`(${a}${N}|${v.value})`,_.output+=v.value;continue}if(b==="{"&&r.nobrace!==!0){Vr("braces");let C={type:"brace",value:b,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};z.push(C),L(C);continue}if(b==="}"){let C=z[z.length-1];if(r.nobrace===!0||!C){L({type:"text",value:b,output:b});continue}let N=")";if(C.dots===!0){let X=s.slice(),ce=[];for(let Y=X.length-1;Y>=0&&(s.pop(),X[Y].type!=="brace");Y--)X[Y].type!=="dots"&&ce.unshift(X[Y].value);N=Jb(ce,r),_.backtrack=!0}if(C.comma!==!0&&C.dots!==!0){let X=_.output.slice(0,C.outputIndex),ce=_.tokens.slice(C.tokensIndex);C.value=C.output="\\{",b=N="\\}",_.output=X;for(let Y of ce)_.output+=Y.output||Y.value}L({type:"brace",value:b,output:N}),yt("braces"),z.pop();continue}if(b==="|"){Q.length>0&&Q[Q.length-1].conditions++,L({type:"text",value:b});continue}if(b===","){let C=b,N=z[z.length-1];N&>[gt.length-1]==="braces"&&(N.comma=!0,C="|"),L({type:"comma",value:b,output:C});continue}if(b==="/"){if(v.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),v=i;continue}L({type:"slash",value:b,output:y});continue}if(b==="."){if(_.braces>0&&v.type==="dot"){v.value==="."&&(v.output=p);let C=z[z.length-1];v.type="dots",v.output+=b,v.value+=b,C.dots=!0;continue}if(_.braces+_.parens===0&&v.type!=="bos"&&v.type!=="slash"){L({type:"text",value:b,output:p});continue}L({type:"dot",value:b,output:p});continue}if(b==="?"){if(!(v&&v.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Ur("qmark",b);continue}if(v&&v.type==="paren"){let N=j(),X=b;if(N==="<"&&!me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(N)||N==="<"&&!/<([!=]|\w+>)/.test(Ue()))&&(X=`\\${b}`),L({type:"text",value:b,output:X});continue}if(r.dot!==!0&&(v.type==="slash"||v.type==="bos")){L({type:"qmark",value:b,output:oe});continue}L({type:"qmark",value:b,output:D});continue}if(b==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){Ur("negate",b);continue}if(r.nonegate!==!0&&_.index===0){Dh();continue}}if(b==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Ur("plus",b);continue}if(v&&v.value==="("||r.regex===!1){L({type:"plus",value:b,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||_.parens>0){L({type:"plus",value:b});continue}L({type:"plus",value:d});continue}if(b==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){L({type:"at",extglob:!0,value:b,output:""});continue}L({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);let C=zb.exec(Ue());C&&(b+=C[0],_.index+=C[0].length),L({type:"text",value:b});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=b,v.output=ae,_.backtrack=!0,_.globstar=!0,Se(b);continue}let A=Ue();if(r.noextglob!==!0&&/^\([^?]/.test(A)){Ur("star",b);continue}if(v.type==="star"){if(r.noglobstar===!0){Se(b);continue}let C=v.prev,N=C.prev,X=C.type==="slash"||C.type==="bos",ce=N&&(N.type==="star"||N.type==="globstar");if(r.bash===!0&&(!X||A[0]&&A[0]!=="/")){L({type:"star",value:b,output:""});continue}let Y=_.braces>0&&(C.type==="comma"||C.type==="brace"),We=Q.length&&(C.type==="pipe"||C.type==="paren");if(!X&&C.type!=="paren"&&!Y&&!We){L({type:"star",value:b,output:""});continue}for(;A.slice(0,3)==="/**";){let qe=e[_.index+4];if(qe&&qe!=="/")break;A=A.slice(3),Se("/**",3)}if(C.type==="bos"&&ve()){v.type="globstar",v.value+=b,v.output=I(r),_.output=v.output,_.globstar=!0,Se(b);continue}if(C.type==="slash"&&C.prev.type!=="bos"&&!ce&&ve()){_.output=_.output.slice(0,-(C.output+v.output).length),C.output=`(?:${C.output}`,v.type="globstar",v.output=I(r)+(r.strictSlashes?")":"|$)"),v.value+=b,_.globstar=!0,_.output+=C.output+v.output,Se(b);continue}if(C.type==="slash"&&C.prev.type!=="bos"&&A[0]==="/"){let qe=A[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(C.output+v.output).length),C.output=`(?:${C.output}`,v.type="globstar",v.output=`${I(r)}${y}|${y}${qe})`,v.value+=b,_.output+=C.output+v.output,_.globstar=!0,Se(b+Ve()),L({type:"slash",value:"/",output:""});continue}if(C.type==="bos"&&A[0]==="/"){v.type="globstar",v.value+=b,v.output=`(?:^|${y}|${I(r)}${y})`,_.output=v.output,_.globstar=!0,Se(b+Ve()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-v.output.length),v.type="globstar",v.output=I(r),v.value+=b,_.output+=v.output,_.globstar=!0,Se(b);continue}let Z={type:"star",value:b,output:ae};if(r.bash===!0){Z.output=".*?",(v.type==="bos"||v.type==="slash")&&(Z.output=w+Z.output),L(Z);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&r.regex===!0){Z.output=b,L(Z);continue}(_.index===_.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(_.output+=x,v.output+=x):r.dot===!0?(_.output+=S,v.output+=S):(_.output+=w,v.output+=w),j()!=="*"&&(_.output+=g,v.output+=g)),L(Z)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing","]"));_.output=me.escapeLast(_.output,"["),yt("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing",")"));_.output=me.escapeLast(_.output,"("),yt("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing","}"));_.output=me.escapeLast(_.output,"{"),yt("braces")}if(r.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let A of _.tokens)_.output+=A.output!=null?A.output:A.value,A.suffix&&(_.output+=A.suffix)}return _};_i.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(hn,r.maxLength):hn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=Vu[e]||e;let i=me.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:y,START_ANCHOR:g}=Tr.globChars(i),m=r.dot?p:l,E=r.dot?d:l,x=r.capture?"":"?:",S={negated:!1,prefix:""},D=r.bash===!0?".*?":y;r.capture&&(D=`(${D})`);let oe=w=>w.noglobstar===!0?D:`(${x}(?:(?!${g}${w.dot?u:s}).)*?)`,q=w=>{switch(w){case"*":return`${m}${c}${D}`;case".*":return`${s}${c}${D}`;case"*.*":return`${m}${D}${s}${c}${D}`;case"*/*":return`${m}${D}${a}${c}${E}${D}`;case"**":return m+oe(r);case"**/*":return`(?:${m}${oe(r)}${a})?${E}${c}${D}`;case"**/*.*":return`(?:${m}${oe(r)}${a})?${E}${D}${s}${c}${D}`;case"**/.*":return`(?:${m}${oe(r)}${a})?${s}${c}${D}`;default:{let F=/^(.*?)\.(\w+)$/.exec(w);if(!F)return;let ae=q(F[1]);return ae?ae+s+F[2]:void 0}}},P=me.removePrefix(e,S),I=q(P);return I&&r.strictSlashes!==!0&&(I+=`${a}?`),I};qu.exports=_i});var zu=k((xS,Ku)=>{"use strict";var n_=M("path"),o_=Gu(),Ei=Yu(),xi=Sr(),i_=Ar(),s_=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>re(d,t,r));return d=>{for(let y of l){let g=y(d);if(g)return g}return!1}}let n=s_(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},i=xi.isWindows(t),s=n?re.compileRe(e,t):re.makeRe(e,t,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};c=re(o.ignore,l,r)}let u=(l,p=!1)=>{let{isMatch:d,match:y,output:g}=re.test(l,s,t,{glob:e,posix:i}),m={glob:e,state:a,regex:s,posix:i,input:l,output:g,match:y,isMatch:d};return typeof o.onResult=="function"&&o.onResult(m),d===!1?(m.isMatch=!1,p?m:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(m),m.isMatch=!1,p?m:!1):(typeof o.onMatch=="function"&&o.onMatch(m),p?m:!0)};return r&&(u.state=a),u};re.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=r||{},s=i.format||(o?xi.toPosixSlashes:null),a=e===n,c=a&&s?s(e):e;return a===!1&&(c=s?s(e):e,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=re.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};re.matchBase=(e,t,r,n=xi.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(n_.basename(e));re.isMatch=(e,t,r)=>re(t,r)(e);re.parse=(e,t)=>Array.isArray(e)?e.map(r=>re.parse(r,t)):Ei(e,{...t,fastpaths:!1});re.scan=(e,t)=>o_(e,t);re.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},i=o.contains?"":"^",s=o.contains?"":"$",a=`${i}(?:${e.output})${s}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let c=re.toRegex(a,t);return n===!0&&(c.state=e),c};re.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=Ei.fastpaths(e,t)),o.output||(o=Ei(e,t)),re.compileRe(o,t,r,n)};re.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};re.constants=i_;Ku.exports=re});var Ju=k((kS,Xu)=>{"use strict";Xu.exports=zu()});var np=k((wS,rp)=>{"use strict";var Zu=M("util"),ep=Tu(),Qe=Ju(),ki=Sr(),Qu=e=>e===""||e==="./",tp=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Qe(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let y of e){let g=p(y,!0);(d?!g.isMatch:g.isMatch)&&(d?n.add(g.output):(n.delete(g.output),o.add(g.output)))}}let u=(s===t.length?[...i]:[...o]).filter(l=>!n.has(l));if(r&&u.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return u};J.match=J;J.matcher=(e,t)=>Qe(e,t);J.isMatch=(e,t,r)=>Qe(t,r)(e);J.any=J.isMatch;J.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],i=a=>{r.onResult&&r.onResult(a),o.push(a.output)},s=new Set(J(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};J.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Zu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>J.contains(e,n,r));if(typeof t=="string"){if(Qu(e)||Qu(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...r,contains:!0})};J.matchKeys=(e,t,r)=>{if(!ki.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=J(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};J.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(n.some(s=>i(s)))return!0}return!1};J.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};J.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Zu.inspect(e)}"`);return[].concat(t).every(n=>Qe(n,r)(e))};J.capture=(e,t,r)=>{let n=ki.isWindows(r),i=Qe.makeRe(String(e),{...r,capture:!0}).exec(n?ki.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};J.makeRe=(...e)=>Qe.makeRe(...e);J.scan=(...e)=>Qe.scan(...e);J.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of ep(String(n),t))r.push(Qe.parse(o,t));return r};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!tp(e)?[e]:ep(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=tp;rp.exports=J});var fp=k(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.isAbsolute=T.partitionAbsoluteAndRelative=T.removeDuplicateSlashes=T.matchAny=T.convertPatternsToRe=T.makeRe=T.getPatternParts=T.expandBraceExpansion=T.expandPatternsWithBraceExpansion=T.isAffectDepthOfReadingPattern=T.endsWithSlashGlobStar=T.hasGlobStar=T.getBaseDirectory=T.isPatternRelatedToParentDirectory=T.getPatternsOutsideCurrentDirectory=T.getPatternsInsideCurrentDirectory=T.getPositivePatterns=T.getNegativePatterns=T.isPositivePattern=T.isNegativePattern=T.convertToNegativePattern=T.convertToPositivePattern=T.isDynamicPattern=T.isStaticPattern=void 0;var op=M("path"),a_=Yl(),wi=np(),ip="**",c_="\\",l_=/[*?]|^!/,u_=/\[[^[]*]/,p_=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,d_=/[!*+?@]\([^(]*\)/,f_=/,|\.\./,h_=/(?!^)\/{2,}/g;function sp(e,t={}){return!ap(e,t)}T.isStaticPattern=sp;function ap(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(c_)||l_.test(e)||u_.test(e)||p_.test(e)||t.extglob!==!1&&d_.test(e)||t.braceExpansion!==!1&&m_(e))}T.isDynamicPattern=ap;function m_(e){let t=e.indexOf("{");if(t===-1)return!1;let r=e.indexOf("}",t+1);if(r===-1)return!1;let n=e.slice(t,r);return f_.test(n)}function g_(e){return mn(e)?e.slice(1):e}T.convertToPositivePattern=g_;function y_(e){return"!"+e}T.convertToNegativePattern=y_;function mn(e){return e.startsWith("!")&&e[1]!=="("}T.isNegativePattern=mn;function cp(e){return!mn(e)}T.isPositivePattern=cp;function v_(e){return e.filter(mn)}T.getNegativePatterns=v_;function b_(e){return e.filter(cp)}T.getPositivePatterns=b_;function __(e){return e.filter(t=>!Ci(t))}T.getPatternsInsideCurrentDirectory=__;function E_(e){return e.filter(Ci)}T.getPatternsOutsideCurrentDirectory=E_;function Ci(e){return e.startsWith("..")||e.startsWith("./..")}T.isPatternRelatedToParentDirectory=Ci;function x_(e){return a_(e,{flipBackslashes:!1})}T.getBaseDirectory=x_;function k_(e){return e.includes(ip)}T.hasGlobStar=k_;function lp(e){return e.endsWith("/"+ip)}T.endsWithSlashGlobStar=lp;function w_(e){let t=op.basename(e);return lp(e)||sp(t)}T.isAffectDepthOfReadingPattern=w_;function C_(e){return e.reduce((t,r)=>t.concat(up(r)),[])}T.expandPatternsWithBraceExpansion=C_;function up(e){let t=wi.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}T.expandBraceExpansion=up;function A_(e,t){let{parts:r}=wi.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return r.length===0&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}T.getPatternParts=A_;function pp(e,t){return wi.makeRe(e,t)}T.makeRe=pp;function S_(e,t){return e.map(r=>pp(r,t))}T.convertPatternsToRe=S_;function R_(e,t){return t.some(r=>r.test(e))}T.matchAny=R_;function T_(e){return e.replace(h_,"/")}T.removeDuplicateSlashes=T_;function O_(e){let t=[],r=[];for(let n of e)dp(n)?t.push(n):r.push(n);return[t,r]}T.partitionAbsoluteAndRelative=O_;function dp(e){return op.isAbsolute(e)}T.isAbsolute=dp});var yp=k((AS,gp)=>{"use strict";var P_=M("stream"),hp=P_.PassThrough,$_=Array.prototype.slice;gp.exports=D_;function D_(){let e=[],t=$_.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let o=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=hp(n);function a(){for(let l=0,p=arguments.length;l<p;l++)e.push(mp(arguments[l],n));return c(),this}function c(){if(r)return;r=!0;let l=e.shift();if(!l){process.nextTick(u);return}Array.isArray(l)||(l=[l]);let p=l.length+1;function d(){--p>0||(r=!1,c())}function y(g){function m(){g.removeListener("merge2UnpipeEnd",m),g.removeListener("end",m),i&&g.removeListener("error",E),d()}function E(x){s.emit("error",x)}if(g._readableState.endEmitted)return d();g.on("merge2UnpipeEnd",m),g.on("end",m),i&&g.on("error",E),g.pipe(s,{end:!1}),g.resume()}for(let g=0;g<l.length;g++)y(l[g]);d()}function u(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function mp(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=mp(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(hp(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var bp=k(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.merge=void 0;var N_=yp();function L_(e){let t=N_(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>vp(e)),t.once("end",()=>vp(e)),t}gn.merge=L_;function vp(e){e.forEach(t=>t.emit("close"))}});var _p=k(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.isEmpty=rr.isString=void 0;function I_(e){return typeof e=="string"}rr.isString=I_;function F_(e){return e===""}rr.isEmpty=F_});var at=k(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.string=ge.stream=ge.pattern=ge.path=ge.fs=ge.errno=ge.array=void 0;var j_=Nl();ge.array=j_;var M_=Ll();ge.errno=M_;var B_=Il();ge.fs=B_;var H_=Bl();ge.path=H_;var G_=fp();ge.pattern=G_;var V_=bp();ge.stream=V_;var U_=_p();ge.string=U_});var wp=k(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.convertPatternGroupToTask=ye.convertPatternGroupsToTasks=ye.groupPatternsByBaseDirectory=ye.getNegativePatternsAsPositive=ye.getPositivePatterns=ye.convertPatternsToTasks=ye.generate=void 0;var Be=at();function W_(e,t){let r=Ep(e,t),n=Ep(t.ignore,t),o=xp(r),i=kp(r,n),s=o.filter(l=>Be.pattern.isStaticPattern(l,t)),a=o.filter(l=>Be.pattern.isDynamicPattern(l,t)),c=Ai(s,i,!1),u=Ai(a,i,!0);return c.concat(u)}ye.generate=W_;function Ep(e,t){let r=e;return t.braceExpansion&&(r=Be.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Be.pattern.removeDuplicateSlashes(n))}function Ai(e,t,r){let n=[],o=Be.pattern.getPatternsOutsideCurrentDirectory(e),i=Be.pattern.getPatternsInsideCurrentDirectory(e),s=Si(o),a=Si(i);return n.push(...Ri(s,t,r)),"."in a?n.push(Ti(".",i,t,r)):n.push(...Ri(a,t,r)),n}ye.convertPatternsToTasks=Ai;function xp(e){return Be.pattern.getPositivePatterns(e)}ye.getPositivePatterns=xp;function kp(e,t){return Be.pattern.getNegativePatterns(e).concat(t).map(Be.pattern.convertToPositivePattern)}ye.getNegativePatternsAsPositive=kp;function Si(e){let t={};return e.reduce((r,n)=>{let o=Be.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}ye.groupPatternsByBaseDirectory=Si;function Ri(e,t,r){return Object.keys(e).map(n=>Ti(n,e[n],t,r))}ye.convertPatternGroupsToTasks=Ri;function Ti(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(Be.pattern.convertToNegativePattern))}}ye.convertPatternGroupToTask=Ti});var Ap=k(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.read=void 0;function q_(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Cp(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){Oi(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Cp(r,i);return}Oi(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),Oi(r,s)})})}yn.read=q_;function Cp(e,t){e(t)}function Oi(e,t){e(null,t)}});var Sp=k(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.read=void 0;function Y_(e,t){let r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw n}}vn.read=Y_});var Rp=k(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.createFileSystemAdapter=xt.FILE_SYSTEM_ADAPTER=void 0;var bn=M("fs");xt.FILE_SYSTEM_ADAPTER={lstat:bn.lstat,stat:bn.stat,lstatSync:bn.lstatSync,statSync:bn.statSync};function K_(e){return e===void 0?xt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},xt.FILE_SYSTEM_ADAPTER),e)}xt.createFileSystemAdapter=K_});var Tp=k($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});var z_=Rp(),Pi=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=z_.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,r){return t??r}};$i.default=Pi});var Ft=k(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.statSync=kt.stat=kt.Settings=void 0;var Op=Ap(),X_=Sp(),Di=Tp();kt.Settings=Di.default;function J_(e,t,r){if(typeof t=="function"){Op.read(e,Ni(),t);return}Op.read(e,Ni(t),r)}kt.stat=J_;function Q_(e,t){let r=Ni(t);return X_.read(e,r)}kt.statSync=Q_;function Ni(e={}){return e instanceof Di.default?e:new Di.default(e)}});var Dp=k((IS,$p)=>{var Pp;$p.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(Pp||(Pp=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var Lp=k((FS,Np)=>{Np.exports=eE;var Z_=Dp();function eE(e,t){let r,n,o,i=!0;Array.isArray(e)?(r=[],n=e.length):(o=Object.keys(e),r={},n=o.length);function s(c){function u(){t&&t(c,r),t=null}i?Z_(u):u()}function a(c,u,l){r[c]=l,(--n===0||u)&&s(u)}n?o?o.forEach(function(c){e[c](function(u,l){a(c,u,l)})}):e.forEach(function(c,u){c(function(l,p){a(u,l,p)})}):s(null),i=!1}});var Li=k(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var _n=process.versions.node.split(".");if(_n[0]===void 0||_n[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Ip=Number.parseInt(_n[0],10),tE=Number.parseInt(_n[1],10),Fp=10,rE=10,nE=Ip>Fp,oE=Ip===Fp&&tE>=rE;En.IS_SUPPORT_READDIR_WITH_FILE_TYPES=nE||oE});var jp=k(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.createDirentFromStats=void 0;var Ii=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function iE(e,t){return new Ii(e,t)}xn.createDirentFromStats=iE});var Fi=k(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.fs=void 0;var sE=jp();kn.fs=sE});var ji=k(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.joinPathSegments=void 0;function aE(e,t,r){return e.endsWith(r)?e+t:e+r+t}wn.joinPathSegments=aE});var Up=k(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.readdir=wt.readdirWithFileTypes=wt.read=void 0;var cE=Ft(),Mp=Lp(),lE=Li(),Bp=Fi(),Hp=ji();function uE(e,t,r){if(!t.stats&&lE.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Gp(e,t,r);return}Vp(e,t,r)}wt.read=uE;function Gp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){Cn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:Hp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){Mi(r,i);return}let s=i.map(a=>pE(a,t));Mp(s,(a,c)=>{if(a!==null){Cn(r,a);return}Mi(r,c)})})}wt.readdirWithFileTypes=Gp;function pE(e,t){return r=>{if(!e.dirent.isSymbolicLink()){r(null,e);return}t.fs.stat(e.path,(n,o)=>{if(n!==null){if(t.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,e);return}e.dirent=Bp.fs.createDirentFromStats(e.name,o),r(null,e)})}}function Vp(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){Cn(r,n);return}let i=o.map(s=>{let a=Hp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{cE.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let p={name:s,path:a,dirent:Bp.fs.createDirentFromStats(s,l)};t.stats&&(p.stats=l),c(null,p)})}});Mp(i,(s,a)=>{if(s!==null){Cn(r,s);return}Mi(r,a)})})}wt.readdir=Vp;function Cn(e,t){e(t)}function Mi(e,t){e(null,t)}});var zp=k(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.readdir=Ct.readdirWithFileTypes=Ct.read=void 0;var dE=Ft(),fE=Li(),Wp=Fi(),qp=ji();function hE(e,t){return!t.stats&&fE.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Yp(e,t):Kp(e,t)}Ct.read=hE;function Yp(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:qp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=Wp.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}Ct.readdirWithFileTypes=Yp;function Kp(e,t){return t.fs.readdirSync(e).map(n=>{let o=qp.joinPathSegments(e,n,t.pathSegmentSeparator),i=dE.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:Wp.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}Ct.readdir=Kp});var Xp=k(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.createFileSystemAdapter=At.FILE_SYSTEM_ADAPTER=void 0;var nr=M("fs");At.FILE_SYSTEM_ADAPTER={lstat:nr.lstat,stat:nr.stat,lstatSync:nr.lstatSync,statSync:nr.statSync,readdir:nr.readdir,readdirSync:nr.readdirSync};function mE(e){return e===void 0?At.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},At.FILE_SYSTEM_ADAPTER),e)}At.createFileSystemAdapter=mE});var Jp=k(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var gE=M("path"),yE=Ft(),vE=Xp(),Bi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=vE.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,gE.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new yE.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Hi.default=Bi});var An=k(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.Settings=St.scandirSync=St.scandir=void 0;var Qp=Up(),bE=zp(),Gi=Jp();St.Settings=Gi.default;function _E(e,t,r){if(typeof t=="function"){Qp.read(e,Vi(),t);return}Qp.read(e,Vi(t),r)}St.scandir=_E;function EE(e,t){let r=Vi(t);return bE.read(e,r)}St.scandirSync=EE;function Vi(e={}){return e instanceof Gi.default?e:new Gi.default(e)}});var ed=k((YS,Zp)=>{"use strict";function xE(e){var t=new e,r=t;function n(){var i=t;return i.next?t=i.next:(t=new e,r=t),i.next=null,i}function o(i){r.next=i,r=i}return{get:n,release:o}}Zp.exports=xE});var rd=k((KS,Ui)=>{"use strict";var kE=ed();function td(e,t,r){if(typeof e=="function"&&(r=t,t=e,e=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=kE(wE),o=null,i=null,s=0,a=null,c={push:m,drain:Ce,saturated:Ce,pause:l,paused:!1,get concurrency(){return r},set concurrency(P){if(!(P>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=P,!c.paused)for(;o&&s<r;)s++,x()},running:u,resume:y,idle:g,length:p,getQueue:d,unshift:E,empty:Ce,kill:S,killAndDrain:D,error:q,abort:oe};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var P=o,I=0;P;)P=P.next,I++;return I}function d(){for(var P=o,I=[];P;)I.push(P.value),P=P.next;return I}function y(){if(c.paused){if(c.paused=!1,o===null){s++,x();return}for(;o&&s<r;)s++,x()}}function g(){return s===0&&c.length()===0}function m(P,I){var w=n.get();w.context=e,w.release=x,w.value=P,w.callback=I||Ce,w.errorHandler=a,s>=r||c.paused?i?(i.next=w,i=w):(o=w,i=w,c.saturated()):(s++,t.call(e,w.value,w.worked))}function E(P,I){var w=n.get();w.context=e,w.release=x,w.value=P,w.callback=I||Ce,w.errorHandler=a,s>=r||c.paused?o?(w.next=o,o=w):(o=w,i=w,c.saturated()):(s++,t.call(e,w.value,w.worked))}function x(P){P&&n.release(P);var I=o;I&&s<=r?c.paused?s--:(i===o&&(i=null),o=I.next,I.next=null,t.call(e,I.value,I.worked),i===null&&c.empty()):--s===0&&c.drain()}function S(){o=null,i=null,c.drain=Ce}function D(){o=null,i=null,c.drain(),c.drain=Ce}function oe(){var P=o;for(o=null,i=null;P;){var I=P.next,w=P.callback,F=P.errorHandler,ae=P.value,_=P.context;P.value=null,P.callback=Ce,P.errorHandler=null,F&&F(new Error("abort"),ae),w.call(_,new Error("abort")),P.release(P),P=I}c.drain=Ce}function q(P){a=P}}function Ce(){}function wE(){this.value=null,this.callback=Ce,this.next=null,this.release=Ce,this.context=null,this.errorHandler=null;var e=this;this.worked=function(r,n){var o=e.callback,i=e.errorHandler,s=e.value;e.value=null,e.callback=Ce,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function CE(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,p){t.call(this,l).then(function(d){p(null,d)},p)}var o=td(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=u,o;function a(l){var p=new Promise(function(d,y){i(l,function(g,m){if(g){y(g);return}d(m)})});return p.catch(Ce),p}function c(l){var p=new Promise(function(d,y){s(l,function(g,m){if(g){y(g);return}d(m)})});return p.catch(Ce),p}function u(){var l=new Promise(function(p){process.nextTick(function(){if(o.idle())p();else{var d=o.drain;o.drain=function(){typeof d=="function"&&d(),p(),o.drain=d}}})});return l}}Ui.exports=td;Ui.exports.promise=CE});var Sn=k(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.joinPathSegments=Ze.replacePathSegmentSeparator=Ze.isAppliedFilter=Ze.isFatalError=void 0;function AE(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ze.isFatalError=AE;function SE(e,t){return e===null||e(t)}Ze.isAppliedFilter=SE;function RE(e,t){return e.split(/[/\\]/).join(t)}Ze.replacePathSegmentSeparator=RE;function TE(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ze.joinPathSegments=TE});var Yi=k(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var OE=Sn(),Wi=class{constructor(t,r){this._root=t,this._settings=r,this._root=OE.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};qi.default=Wi});var Xi=k(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});var PE=M("events"),$E=An(),DE=rd(),Rn=Sn(),NE=Yi(),Ki=class extends NE.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=$E.scandir,this._emitter=new PE.EventEmitter,this._queue=DE(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){let n={directory:t,base:r};this._queue.push(n,o=>{o!==null&&this._handleError(o)})}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,(n,o)=>{if(n!==null){r(n,void 0);return}for(let i of o)this._handleEntry(i,t.base);r(null,void 0)})}_handleError(t){this._isDestroyed||!Rn.isFatalError(this._settings,t)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError)return;let n=t.path;r!==void 0&&(t.path=Rn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Rn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Rn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};zi.default=Ki});var nd=k(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var LE=Xi(),Ji=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new LE.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{IE(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{FE(t,this._storage)}),this._reader.read()}};Qi.default=Ji;function IE(e,t){e(t)}function FE(e,t){e(null,t)}});var od=k(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var jE=M("stream"),ME=Xi(),Zi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new ME.default(this._root,this._settings),this._stream=new jE.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};es.default=Zi});var id=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var BE=An(),Tn=Sn(),HE=Yi(),ts=class extends HE.default{constructor(){super(...arguments),this._scandir=BE.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(let t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,r){try{let n=this._scandir(t,this._settings.fsScandirSettings);for(let o of n)this._handleEntry(o,r)}catch(n){this._handleError(n)}}_handleError(t){if(Tn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=Tn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Tn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&Tn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};rs.default=ts});var sd=k(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var GE=id(),ns=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new GE.default(this._root,this._settings)}read(){return this._reader.read()}};os.default=ns});var ad=k(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var VE=M("path"),UE=An(),is=class{constructor(t={}){this._options=t,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,VE.sep),this.fsScandirSettings=new UE.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};ss.default=is});var Pn=k(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.Settings=et.walkStream=et.walkSync=et.walk=void 0;var cd=nd(),WE=od(),qE=sd(),as=ad();et.Settings=as.default;function YE(e,t,r){if(typeof t=="function"){new cd.default(e,On()).read(t);return}new cd.default(e,On(t)).read(r)}et.walk=YE;function KE(e,t){let r=On(t);return new qE.default(e,r).read()}et.walkSync=KE;function zE(e,t){let r=On(t);return new WE.default(e,r).read()}et.walkStream=zE;function On(e={}){return e instanceof as.default?e:new as.default(e)}});var $n=k(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var XE=M("path"),JE=Ft(),ld=at(),cs=class{constructor(t){this._settings=t,this._fsStatSettings=new JE.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return XE.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:ld.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!ld.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};ls.default=cs});var ds=k(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var QE=M("stream"),ZE=Ft(),ex=Pn(),tx=$n(),us=class extends tx.default{constructor(){super(...arguments),this._walkStream=ex.walkStream,this._stat=ZE.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new QE.PassThrough({objectMode:!0});o._write=(i,s,a)=>this._getEntry(n[i],t[i],r).then(c=>{c!==null&&r.entryFilter(c)&&o.push(c),i===n.length-1&&o.end(),a()}).catch(a);for(let i=0;i<n.length;i++)o.write(i);return o}_getEntry(t,r,n){return this._getStat(t).then(o=>this._makeEntry(o,r)).catch(o=>{if(n.errorFilter(o))return null;throw o})}_getStat(t){return new Promise((r,n)=>{this._stat(t,this._fsStatSettings,(o,i)=>o===null?r(i):n(o))})}};ps.default=us});var ud=k(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var rx=Pn(),nx=$n(),ox=ds(),fs=class extends nx.default{constructor(){super(...arguments),this._walkAsync=rx.walk,this._readerStream=new ox.default(this._settings)}dynamic(t,r){return new Promise((n,o)=>{this._walkAsync(t,r,(i,s)=>{i===null?n(s):o(i)})})}async static(t,r){let n=[],o=this._readerStream.static(t,r);return new Promise((i,s)=>{o.once("error",s),o.on("data",a=>n.push(a)),o.once("end",()=>i(n))})}};hs.default=fs});var pd=k(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var Or=at(),ms=class{constructor(t,r,n){this._patterns=t,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let t of this._patterns){let r=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:t,segments:r,sections:n})}}_getPatternSegments(t){return Or.pattern.getPatternParts(t,this._micromatchOptions).map(n=>Or.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Or.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return Or.array.splitWhen(t,r=>r.dynamic&&Or.pattern.hasGlobStar(r.pattern))}};gs.default=ms});var dd=k(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var ix=pd(),ys=class extends ix.default{match(t){let r=t.split("/"),n=r.length,o=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of o){let s=i.sections[0];if(!i.complete&&n>s.length||r.every((c,u)=>{let l=i.segments[u];return!!(l.dynamic&&l.patternRe.test(c)||!l.dynamic&&l.pattern===c)}))return!0}return!1}};vs.default=ys});var fd=k(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var Dn=at(),sx=dd(),bs=class{constructor(t,r){this._settings=t,this._micromatchOptions=r}getFilter(t,r,n){let o=this._getMatcher(r),i=this._getNegativePatternsRe(n);return s=>this._filter(t,s,o,i)}_getMatcher(t){return new sx.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(Dn.pattern.isAffectDepthOfReadingPattern);return Dn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Dn.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,o)}_isSkippedByDeep(t,r){return this._settings.deep===1/0?!1:this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){let n=r.split("/").length;if(t==="")return n;let o=t.split("/").length;return n-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!Dn.pattern.matchAny(t,r)}};_s.default=bs});var hd=k(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var Rt=at(),Es=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=Rt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:Rt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:Rt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:Rt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=Rt.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;let o=this._isMatchToPatternsSet(n,r,t.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(n),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,r,n){return!(!this._isMatchToPatterns(t,r.positive.all,n)||this._isMatchToPatterns(t,r.negative.relative,n)||this._isMatchToAbsoluteNegative(t,r.negative.absolute,n))}_isMatchToAbsoluteNegative(t,r,n){if(r.length===0)return!1;let o=Rt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=Rt.pattern.matchAny(t,r);return!o&&n?Rt.pattern.matchAny(t+"/",r):o}};xs.default=Es});var md=k(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});var ax=at(),ks=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return ax.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};ws.default=ks});var yd=k(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var gd=at(),Cs=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=gd.path.makeAbsolute(this._settings.cwd,r),r=gd.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};As.default=Cs});var Nn=k(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});var cx=M("path"),lx=fd(),ux=hd(),px=md(),dx=yd(),Ss=class{constructor(t){this._settings=t,this.errorFilter=new px.default(this._settings),this.entryFilter=new ux.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new lx.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new dx.default(this._settings)}_getRootDirectory(t){return cx.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){let r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};Rs.default=Ss});var vd=k(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var fx=ud(),hx=Nn(),Ts=class extends hx.default{constructor(){super(...arguments),this._reader=new fx.default(this._settings)}async read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(r,t,n)).map(i=>n.transform(i))}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};Os.default=Ts});var bd=k($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var mx=M("stream"),gx=ds(),yx=Nn(),Ps=class extends yx.default{constructor(){super(...arguments),this._reader=new gx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new mx.Readable({objectMode:!0,read:()=>{}});return o.once("error",s=>i.emit("error",s)).on("data",s=>i.emit("data",n.transform(s))).once("end",()=>i.emit("end")),i.once("close",()=>o.destroy()),i}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};$s.default=Ps});var _d=k(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var vx=Ft(),bx=Pn(),_x=$n(),Ds=class extends _x.default{constructor(){super(...arguments),this._walkSync=bx.walkSync,this._statSync=vx.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){let n=[];for(let o of t){let i=this._getFullEntryPath(o),s=this._getEntry(i,o,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(t,r,n){try{let o=this._getStat(t);return this._makeEntry(o,r)}catch(o){if(n.errorFilter(o))return null;throw o}}_getStat(t){return this._statSync(t,this._fsStatSettings)}};Ns.default=Ds});var Ed=k(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});var Ex=_d(),xx=Nn(),Ls=class extends xx.default{constructor(){super(...arguments),this._reader=new Ex.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(r,t,n).map(n.transform)}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};Is.default=Ls});var xd=k(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var or=M("fs"),kx=M("os"),wx=Math.max(kx.cpus().length,1);ir.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:or.lstat,lstatSync:or.lstatSync,stat:or.stat,statSync:or.statSync,readdir:or.readdir,readdirSync:or.readdirSync};var Fs=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,wx),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===void 0?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},ir.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};ir.default=Fs});var Ln=k((bR,wd)=>{"use strict";var kd=wp(),Cx=vd(),Ax=bd(),Sx=Ed(),js=xd(),Ne=at();async function Ms(e,t){He(e);let r=Bs(e,Cx.default,t),n=await Promise.all(r);return Ne.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){He(u);let p=Bs(u,Sx.default,l);return Ne.array.flatten(p)}e.sync=t;function r(u,l){He(u);let p=Bs(u,Ax.default,l);return Ne.stream.merge(p)}e.stream=r;function n(u,l){He(u);let p=[].concat(u),d=new js.default(l);return kd.generate(p,d)}e.generateTasks=n;function o(u,l){He(u);let p=new js.default(l);return Ne.pattern.isDynamicPattern(u,p)}e.isDynamicPattern=o;function i(u){return He(u),Ne.path.escape(u)}e.escapePath=i;function s(u){return He(u),Ne.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(d){return He(d),Ne.path.escapePosixPath(d)}u.escapePath=l;function p(d){return He(d),Ne.path.convertPosixPathToPattern(d)}u.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(u){function l(d){return He(d),Ne.path.escapeWindowsPath(d)}u.escapePath=l;function p(d){return He(d),Ne.path.convertWindowsPathToPattern(d)}u.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(Ms||(Ms={}));function Bs(e,t,r){let n=[].concat(e),o=new js.default(r),i=kd.generate(n,o),s=new t(o);return i.map(s.read,s)}function He(e){if(![].concat(e).every(n=>Ne.string.isString(n)&&!Ne.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}wd.exports=Ms});var Cd=vt(()=>{});import{promisify as Rx}from"node:util";import{execFile as Tx,execFileSync as kR}from"node:child_process";import{fileURLToPath as Ox}from"node:url";function Pr(e){return e instanceof URL?Ox(e):e}var CR,AR,Hs=vt(()=>{Cd();CR=Rx(Tx);AR=10*1024*1024});var Nd=k((TR,jn)=>{function Rd(e){return Array.isArray(e)?e:[e]}var Px=void 0,Vs="",Ad=" ",Gs="\\",$x=/^\s+$/,Dx=/(?:[^\\]|^)\\$/,Nx=/^\\!/,Lx=/^\\#/,Ix=/\r?\n/g,Fx=/^\.{0,2}\/|^\.{1,2}$/,jx=/\/$/,sr="/",Td="node-ignore";typeof Symbol<"u"&&(Td=Symbol.for("node-ignore"));var Od=Td,ar=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),Mx=/([0-z])-([0-z])/g,Pd=()=>!1,Bx=e=>e.replace(Mx,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Vs),Hx=e=>{let{length:t}=e;return e.slice(0,t-t%2)},Gx=[[/^\uFEFF/,()=>Vs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?Ad:Vs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+Ad}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Gs],[/\\\\/g,()=>Gs],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===Gs?`\\[${r}${Hx(n)}${o}`:o==="]"&&n.length%2===0?`[${Bx(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],Vx=/(^|\\\/)?\\\*$/,$r="regex",In="checkRegex",Sd="_",Ux={[$r](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[In](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},Wx=e=>Gx.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Fn=e=>typeof e=="string",qx=e=>e&&Fn(e)&&!$x.test(e)&&!Dx.test(e)&&e.indexOf("#")!==0,Yx=e=>e.split(Ix).filter(Boolean),Us=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,ar(this,"body",n),ar(this,"ignoreCase",o),ar(this,"regexPrefix",s)}get regex(){let t=Sd+$r;return this[t]?this[t]:this._make($r,t)}get checkRegex(){let t=Sd+In;return this[t]?this[t]:this._make(In,t)}_make(t,r){let n=this.regexPrefix.replace(Vx,Ux[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return ar(this,r,o)}},Kx=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(Nx,"!").replace(Lx,"#");let i=Wx(o);return new Us(e,t,o,r,n,i)},Ws=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[Od]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Fn(t)&&(t={pattern:t}),qx(t.pattern)){let r=Kx(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Rd(Fn(t)?Yx(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:u}=c;i===u&&o!==i||u&&!o&&!i&&!r||!c[n].test(t)||(o=!u,i=u,s=u?Px:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},zx=(e,t)=>{throw new t(e)},ct=(e,t,r)=>Fn(e)?e?ct.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),$d=e=>Fx.test(e);ct.isNotRelative=$d;ct.convert=e=>e;var qs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){ar(this,Od,!0),this._rules=new Ws(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,r,n,o){let i=t&&ct.convert(t);return ct(i,t,this._strictPathCheck?zx:Pd),this._t(i,r,n,o)}checkIgnore(t){if(!jx.test(t))return this.test(t);let r=t.split(sr).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(sr)+sr,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,In)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(sr).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,$r);let i=this._t(o.join(sr)+sr,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,$r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Rd(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Ys=e=>new qs(e),Xx=e=>ct(e&&ct.convert(e),e,Pd),Dd=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");ct.convert=e;let t=/^[a-z]:\//i;ct.isNotRelative=r=>t.test(r)||$d(r)};typeof process<"u"&&process.platform==="win32"&&Dd();jn.exports=Ys;Ys.default=Ys;jn.exports.isPathValid=Xx;ar(jn.exports,Symbol.for("setupWindows"),Dd)});import Ks from"node:path";function Dr(e,t){let r=Ks.relative(t,e);return!!(r&&r!==".."&&!r.startsWith(`..${Ks.sep}`)&&r!==Ks.resolve(e))}var zs=vt(()=>{});function Mn(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var Ld=vt(()=>{});import Id from"node:fs";import Te from"node:path";import{promisify as Jx}from"node:util";var Xs,Ge,Qx,Zx,Js,Fd,Ae,Bn,Qs,ek,Hn,tk,rk,jd,Zs,nk,ok,ea,ik,Md,sk,Bd,ta,ra=vt(()=>{Xs=Ut(Ln(),1);zs();Ge=e=>e[0]==="!",Qx=e=>{if(!e.startsWith("/"))return e;let t=e.slice(1),r=t.indexOf("/"),n=r>0?t.slice(0,r):t;return r>0&&!Xs.default.isDynamicPattern(n)?e:t},Zx=(e,t)=>t===e,Js=e=>{if(!Te.isAbsolute(e))return;let t=[];for(let r of e.split("/"))if(r){if(Xs.default.isDynamicPattern(r))break;t.push(r)}return t.length===0?void 0:`/${t.join("/")}`},Fd=(e,t=[],r=!1)=>{if(!e.startsWith("/"))return e;let n=Qx(e);if(n!==e)return n;if(r)return e.slice(1);let o=Js(e);return o!==void 0&&t.some(s=>Zx(s,o))?e:e.slice(1)},Ae=(e,t)=>{let r=e?.[t];return typeof r=="function"?r.bind(e):void 0},Bn=(e,t)=>{let r=e?.[t];if(typeof r=="function")return Jx(r.bind(e))},Qs=e=>{if(!e.endsWith("/"))return e;let t=e.replace(/\/+$/u,"");if(!t)return"/**";if(t==="**")return"**/**";let r=t.startsWith("/"),o=(r?t.slice(1):t).includes("/");return`${!r&&!o&&!t.startsWith("**/")?"**/":""}${t}/**`},ek=e=>{let r=(Ge(e)?e.slice(1):e).match(/^(\.\.\/)+/);return r?r[0]:""},Hn=(e,t)=>{if(e.length===0||t.length===0)return t;let r=e.map(i=>ek(i)),n=r[0];return!n||!r.every(i=>i===n)?t:t.map(i=>i.startsWith("**/")&&!i.startsWith("../")?n+i:i)},tk=e=>Ae(e?.promises,"stat")??Ae(Id.promises,"stat"),rk=e=>Ae(e||Id,"statSync"),jd=e=>!!(e?.isDirectory?.()||e?.isFile?.()),Zs=(e,t)=>{let r=[],n=e;for(r.push(n);n!==t;){let o=Te.dirname(n);if(o===n)break;n=o,r.push(n)}return r},nk=async(e,t)=>{for(let r of e){let n=Te.join(r,".git");try{let o=await t(n);if(jd(o))return r}catch{}}},ok=(e,t)=>{let r=rk(t);if(!r)return;let n=Te.resolve(e),{root:o}=Te.parse(n),i=Zs(n,o);for(let s of i){let a=Te.join(s,".git");try{let c=r(a);if(jd(c))return s}catch{}}},ea=(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return ok(e,t)},ik=async(e,t)=>{let r=tk(t);if(!r)return ea(e,t);let n=Te.resolve(e),{root:o}=Te.parse(n),i=Zs(n,o);return nk(i,r)},Md=async(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return ik(e,t)},sk=(e,t)=>{let r=Te.resolve(e),n=Te.resolve(t);return n===r||Dr(n,r)},Bd=(e,t)=>{if(e&&typeof e!="string")throw new TypeError("gitRoot must be a string or undefined");if(typeof t!="string")throw new TypeError("cwd must be a string");return e?sk(e,t)?[...Zs(Te.resolve(t),Te.resolve(e))].reverse().map(n=>Te.join(n,".gitignore")):[]:[]},ta=(e,t,r)=>{if(t)return[];let n=[],o=!1;for(let i of e){if(Ge(i)){o=!0;break}n.push(r(i))}return o?[]:n}});import ak from"node:process";import ck from"node:fs";import lk from"node:fs/promises";import Oe from"node:path";var na,Hd,uk,pk,Gn,dk,fk,Gd,Vd,hk,mk,gk,yk,Ud,vk,Wd,Vn,bk,_k,Ek,xk,qd,Yd,Kd,oa,ia,kk,zd,Xd,Jd,Qd,sa=vt(()=>{na=Ut(Ln(),1),Hd=Ut(Nd(),1);zs();Ld();Hs();ra();uk=["**/node_modules","**/flow-typed","**/coverage","**/.git"],pk={absolute:!0,dot:!0},Gn="**/.gitignore",dk=e=>Ae(e?.promises,"readFile")??Ae(lk,"readFile")??Bn(e,"readFile"),fk=e=>Ae(e,"readFileSync")??Ae(ck,"readFileSync"),Gd=(e,t)=>e&&(e.code==="ENOENT"||e.code==="ENOTDIR")?!0:!!t,Vd=(e,t)=>t instanceof Error?(t.message=`Failed to read ignore file at ${e}: ${t.message}`,t):new Error(`Failed to read ignore file at ${e}: ${String(t)}`),hk=(e,t,r)=>{try{let n=t(e,"utf8");return{filePath:e,content:n}}catch(n){if(Gd(n,r))return;throw Vd(e,n)}},mk=async(e,t,r)=>(await Promise.all(e.map(async o=>{try{let i=await t(o,"utf8");return{filePath:o,content:i}}catch(i){if(Gd(i,r))return;throw Vd(o,i)}}))).filter(Boolean),gk=(e,t,r)=>e.map(n=>hk(n,t,r)).filter(Boolean),yk=e=>{let t=new Set;return e.filter(r=>t.has(r)?!1:(t.add(r),!0))},Ud=(e,t,r)=>e(t,{...r,...pk}),vk=(e,t)=>e?Bd(e,t.cwd):[],Wd=(e,t,r)=>yk([...vk(e,t),...r]),Vn=(e,t,r)=>{let n=r||t.cwd,o=kk(e,n);return{patterns:o,predicate:xk(o,t.cwd,n),usingGitRoot:!!(r&&r!==t.cwd)}},bk=(e,t)=>{if(!t)return e;let r=Ge(e),n=r?e.slice(1):e,o=n.indexOf("/"),i=o!==-1&&o!==n.length-1,s;return i?n.startsWith("/")?s=Oe.posix.join(t,n.slice(1)):s=Oe.posix.join(t,n):s=Oe.posix.join(t,"**",n),r?"!"+s:s},_k=(e,t)=>{let r=Mn(Oe.relative(t,Oe.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>bk(n,r))},Ek=(e,t)=>{if(Oe.isAbsolute(e)){let r=Oe.relative(t,e);return r&&!Dr(e,t)?void 0:r}if(e.startsWith("./"))return e.slice(2);if(!e.startsWith("../"))return e},xk=(e,t,r)=>{let n=(0,Hd.default)().add(e),o=Oe.normalize(Oe.resolve(t)),i=Oe.normalize(Oe.resolve(r));return s=>{if(s=Pr(s),Oe.normalize(Oe.resolve(s))===o)return!1;let c=Ek(s,i);return c===void 0?!1:c?n.ignores(Mn(c)):!1}},qd=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[],r=Pr(e.cwd)??ak.cwd(),n=typeof e.deep=="number"?Math.max(0,e.deep)+1:Number.POSITIVE_INFINITY;return{cwd:r,suppressErrors:e.suppressErrors??!1,deep:n,ignore:[...t,...uk],followSymbolicLinks:e.followSymbolicLinks??!0,concurrency:e.concurrency,throwErrorOnBrokenSymbolicLink:e.throwErrorOnBrokenSymbolicLink??!1,fs:e.fs}},Yd=async(e,t,r)=>{let n=qd(t),o=await Ud(na.default,e,n),i=r?await Md(n.cwd,n.fs):void 0,s=Wd(i,n,o),a=dk(n.fs);return{files:await mk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},Kd=(e,t,r)=>{let n=qd(t),o=Ud(na.default.sync,e,n),i=r?ea(n.cwd,n.fs):void 0,s=Wd(i,n,o),a=fk(n.fs);return{files:gk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},oa=async(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=await Yd(e,t,!1);return Vn(r,n,o).predicate},ia=(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=Kd(e,t,!1);return Vn(r,n,o).predicate},kk=(e,t)=>e.flatMap(r=>_k(r,t)),zd=async(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=await Yd(e,t,r);return Vn(n,o,i)},Xd=(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=Kd(e,t,r);return Vn(n,o,i)},Jd=e=>oa(Gn,e),Qd=e=>ia(Gn,e)});var ff={};Bh(ff,{convertPathToPattern:()=>Fk,generateGlobTasks:()=>Lk,generateGlobTasksSync:()=>Ik,globby:()=>pa,globbyStream:()=>Dk,globbySync:()=>$k,isDynamicPattern:()=>Nk,isGitIgnored:()=>Jd,isGitIgnoredSync:()=>Qd,isIgnoredByIgnoreFiles:()=>oa,isIgnoredByIgnoreFilesSync:()=>ia});import aa from"node:process";import ca from"node:fs";import lt from"node:path";import{Readable as wk}from"node:stream";var cr,Ck,Ak,Sk,Rk,Tk,tf,rf,Un,Zd,ef,la,Ok,nf,of,qn,sf,Pk,af,Wn,cf,lf,uf,pf,df,ua,pa,$k,Dk,Nk,Lk,Ik,Fk,da=vt(()=>{Dl();cr=Ut(Ln(),1);Hs();sa();ra();sa();Ck=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},Ak=e=>Ae(e?.promises,"stat")??Ae(ca.promises,"stat")??Bn(e,"stat"),Sk=e=>Ae(e,"statSync")??Ae(ca,"statSync"),Rk=async(e,t)=>{try{return(await Ak(t)(e)).isDirectory()}catch{return!1}},Tk=(e,t)=>{try{return Sk(t)(e).isDirectory()}catch{return!1}},tf=(e,t)=>{let r=Ge(e)?e.slice(1):e;return lt.isAbsolute(r)?r:lt.join(t,r)},rf=e=>{let t=e?.match(/\*\*\/([^/]+)$/);if(!t)return!1;let r=t[1],n=/[*?[\]{}]/.test(r),o=lt.extname(r)&&!r.startsWith(".");return!n&&!o},Un=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>lt.posix.join(e,`**/${lt.extname(o)?o:`${o}${n}`}`)):[lt.posix.join(e,`**${n?`/*${n}`:""}`)]},Zd=async(e,{cwd:t=aa.cwd(),files:r,extensions:n,fs:o}={})=>(await Promise.all(e.map(async s=>{let a=Ge(s)?s.slice(1):s;if(rf(a))return Un({directoryPath:s,files:r,extensions:n});let c=tf(s,t);return await Rk(c,o)?Un({directoryPath:s,files:r,extensions:n}):s}))).flat(),ef=(e,{cwd:t=aa.cwd(),files:r,extensions:n,fs:o}={})=>e.flatMap(i=>{let s=Ge(i)?i.slice(1):i;if(rf(s))return Un({directoryPath:i,files:r,extensions:n});let a=tf(i,t);return Tk(a,o)?Un({directoryPath:i,files:r,extensions:n}):i}),la=e=>(e=[...new Set([e].flat())],Ck(e),e),Ok=(e,t=ca)=>{if(!e||!t.statSync)return;let r;try{r=t.statSync(e)}catch{return}if(!r.isDirectory())throw new Error(`The \`cwd\` option must be a path to a directory, got: ${e}`)},nf=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[];return e={...e,ignore:t,expandDirectories:e.expandDirectories??!0,cwd:Pr(e.cwd)},Ok(e.cwd,e.fs),e},of=e=>async(t,r)=>e(la(t),nf(r)),qn=e=>(t,r)=>e(la(t),nf(r)),sf=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?la(t):[];return r&&n.push(Gn),n},Pk=async e=>{let t=sf(e);if(t.length===0)return{options:e,filter:Wn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=await zd(t,e,r),s=ta(n,i,Qs);return{options:{...e,ignore:[...e.ignore,...s]},filter:Wn(o,e.cwd)}},af=e=>{let t=sf(e);if(t.length===0)return{options:e,filter:Wn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=Xd(t,e,r),s=ta(n,i,Qs);return{options:{...e,ignore:[...e.ignore,...s]},filter:Wn(o,e.cwd)}},Wn=(e,t)=>{let r=new Set,n=t||aa.cwd(),o=new Map;return i=>{let s=lt.normalize(i.path??i);if(r.has(s))return!1;if(e){let a=o.get(s);if(a===void 0&&(a=lt.isAbsolute(s)?s:lt.resolve(n,s),o.set(s,a),o.size>1e4&&o.clear()),e(a))return!1}return r.add(s),!0}},cf=(e,t)=>e.flat().filter(r=>t(r)),lf=(e,t)=>{if(e.length>0&&e.every(s=>Ge(s))){if(t.expandNegationOnlyPatterns===!1)return[];e=["**/*",...e]}let r=[],n=!1,o=[];for(let s of e){if(Ge(s)){o.push(`!${Fd(s.slice(1),r,n)}`);continue}o.push(s);let a=Js(s);if(a===void 0){n=!0;continue}r.push(a)}e=o;let i=[];for(;e.length>0;){let s=e.findIndex(c=>Ge(c));if(s===-1){i.push({patterns:e,options:t});break}let a=e[s].slice(1);for(let c of i)c.options.ignore.push(a);s!==0&&i.push({patterns:e.slice(0,s),options:{...t,ignore:[...t.ignore,a]}}),e=e.slice(s+1)}return i},uf=e=>e.map(t=>({patterns:t.patterns,options:{...t.options,ignore:Hn(t.patterns,t.options.ignore)}})),pf=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),df=async(e,t)=>{let r=lf(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return uf(r);let s={...pf(o,n),fs:i};return Promise.all(r.map(async a=>{let{patterns:c,options:u}=a;return[c,u.ignore]=await Promise.all([Zd(c,s),Zd(u.ignore,{cwd:n,fs:i})]),u.ignore=Hn(c,u.ignore),{patterns:c,options:u}}))},ua=(e,t)=>{let r=lf(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return uf(r);let s={...pf(o,n),fs:i};return r.map(a=>{let{patterns:c,options:u}=a;return c=ef(c,s),u.ignore=ef(u.ignore,{cwd:n,fs:i}),u.ignore=Hn(c,u.ignore),{patterns:c,options:u}})},pa=of(async(e,t)=>{let{options:r,filter:n}=await Pk(t),o=await df(e,r),i=await Promise.all(o.map(s=>(0,cr.default)(s.patterns,s.options)));return cf(i,n)}),$k=qn((e,t)=>{let{options:r,filter:n}=af(t),i=ua(e,r).map(s=>cr.default.sync(s.patterns,s.options));return cf(i,n)}),Dk=qn((e,t)=>{let{options:r,filter:n}=af(t),i=ua(e,r).map(a=>cr.default.stream(a.patterns,a.options));return i.length===0?wk.from([]):ti(i).filter(a=>n(a))}),Nk=qn((e,t)=>e.some(r=>cr.default.isDynamicPattern(r,t))),Lk=of(df),Ik=qn(ua),{convertPathToPattern:Fk}=cr.default});var Ye=["frontend","backend"],ho=["workbench.frontend","workbench.backend"],Wr=[...Ye,...ho];var Ga=(e=0)=>t=>`\x1B[${t+e}m`,Va=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Ua=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},UC=Object.keys(ee.modifier),Gh=Object.keys(ee.color),Vh=Object.keys(ee.bgColor),WC=[...Gh,...Vh];function Uh(){let e=new Map;for(let[t,r]of Object.entries(ee)){for(let[n,o]of Object.entries(r))ee[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ee[n],e.set(o[0],o[1]);Object.defineProperty(ee,t,{value:r,enumerable:!1})}return Object.defineProperty(ee,"codes",{value:e,enumerable:!1}),ee.color.close="\x1B[39m",ee.bgColor.close="\x1B[49m",ee.color.ansi=Ga(),ee.color.ansi256=Va(),ee.color.ansi16m=Ua(),ee.bgColor.ansi=Ga(10),ee.bgColor.ansi256=Va(10),ee.bgColor.ansi16m=Ua(10),Object.defineProperties(ee,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>ee.rgbToAnsi256(...ee.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ee.ansi256ToAnsi(ee.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ee.ansi256ToAnsi(ee.hexToAnsi256(t)),enumerable:!1}}),ee}var Wh=Uh(),Me=Wh;import mo from"node:process";import qh from"node:os";import Wa from"node:tty";function Pe(e,t=globalThis.Deno?globalThis.Deno.args:mo.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:te}=mo,qr;Pe("no-color")||Pe("no-colors")||Pe("color=false")||Pe("color=never")?qr=0:(Pe("color")||Pe("colors")||Pe("color=true")||Pe("color=always"))&&(qr=1);function Yh(){if("FORCE_COLOR"in te)return te.FORCE_COLOR==="true"?1:te.FORCE_COLOR==="false"?0:te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(te.FORCE_COLOR,10),3)}function Kh(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function zh(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Yh();n!==void 0&&(qr=n);let o=r?qr:n;if(o===0)return 0;if(r){if(Pe("color=16m")||Pe("color=full")||Pe("color=truecolor"))return 3;if(Pe("color=256"))return 2}if("TF_BUILD"in te&&"AGENT_NAME"in te)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(te.TERM==="dumb")return i;if(mo.platform==="win32"){let s=qh.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in te)||te.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if(te.COLORTERM==="truecolor"||te.TERM==="xterm-kitty"||te.TERM==="xterm-ghostty"||te.TERM==="wezterm")return 3;if("TERM_PROGRAM"in te){let s=Number.parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:i}function qa(e,t={}){let r=zh(e,{streamIsTTY:e&&e.isTTY,...t});return Kh(r)}var Xh={stdout:qa({isTTY:Wa.isatty(1)}),stderr:qa({isTTY:Wa.isatty(2)})},Ya=Xh;function Ka(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function za(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
|
|
28
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function lc(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],o=i[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:t})}function No(){if(B.env.NO_COLOR||B.env.FORCE_COLOR==="0"||B.env.FORCE_COLOR==="false")return!1;if(B.env.FORCE_COLOR||B.env.CLICOLOR_FORCE!==void 0)return!0}Lo.Command=Do;Lo.useColor=No});var hc=w($e=>{var{Argument:pc}=Xr(),{Command:Io}=uc(),{CommanderError:wm,InvalidArgumentError:dc}=yr(),{Help:Cm}=Ao(),{Option:fc}=Oo();$e.program=new Io;$e.createCommand=e=>new Io(e);$e.createOption=(e,t)=>new fc(e,t);$e.createArgument=(e,t)=>new pc(e,t);$e.Command=Io;$e.Option=fc;$e.Argument=pc;$e.Help=Cm;$e.CommanderError=wm;$e.InvalidArgumentError=dc;$e.InvalidOptionArgumentError=dc});var xl=w((iS,Ky)=>{Ky.exports={name:"dotenv",version:"17.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Zo=w((sS,it)=>{var Jo=F("fs"),sn=F("path"),zy=F("os"),Xy=F("crypto"),Jy=xl(),Qo=Jy.version,kl=["\u{1F510} encrypt with Dotenvx: https://dotenvx.com","\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit","\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild","\u{1F916} agentic secret storage: https://dotenvx.com/as2","\u26A1\uFE0F secrets for agents: https://dotenvx.com/as2","\u{1F6E1}\uFE0F auth for agents: https://vestauth.com","\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`","\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }","\u2699\uFE0F enable debug logging with { debug: true }","\u2699\uFE0F override existing env vars with { override: true }","\u2699\uFE0F suppress all logs with { quiet: true }","\u2699\uFE0F write to custom object with { processEnv: myObject }","\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"];function Qy(){return kl[Math.floor(Math.random()*kl.length)]}function Qt(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function Zy(){return process.stdout.isTTY}function ev(e){return Zy()?`\x1B[2m${e}\x1B[0m`:e}var tv=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function rv(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
29
|
+
`);let n;for(;(n=tv.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(i=i.replace(/\\n/g,`
|
|
30
|
+
`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}function nv(e){e=e||{};let t=Sl(e);e.path=t;let r=ue.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=Al(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=iv(r,a);i=ue.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return ue.parse(i)}function ov(e){console.error(`[dotenv@${Qo}][WARN] ${e}`)}function wr(e){console.log(`[dotenv@${Qo}][DEBUG] ${e}`)}function Cl(e){console.log(`[dotenv@${Qo}] ${e}`)}function Al(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function iv(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let o=r.searchParams.get("environment");if(!o){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let i=`DOTENV_VAULT_${o.toUpperCase()}`,s=e.parsed[i];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function Sl(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Jo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=sn.resolve(process.cwd(),".env.vault");return Jo.existsSync(t)?t:null}function wl(e){return e[0]==="~"?sn.join(zy.homedir(),e.slice(1)):e}function sv(e){let t=Qt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Qt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&Cl("Loading env from encrypted .env.vault");let n=ue._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),ue.populate(o,n,e),{parsed:n}}function av(e){let t=sn.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=Qt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=Qt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&wr("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[wl(e.path)];else{s=[];for(let l of e.path)s.push(wl(l))}let a,c={};for(let l of s)try{let p=ue.parse(Jo.readFileSync(l,{encoding:r}));ue.populate(c,p,e)}catch(p){o&&wr(`Failed to load ${l} ${p.message}`),a=p}let u=ue.populate(n,c,e);if(o=Qt(n.DOTENV_CONFIG_DEBUG||o),i=Qt(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,p=[];for(let d of s)try{let y=sn.relative(process.cwd(),d);p.push(y)}catch(y){o&&wr(`Failed to load ${d} ${y.message}`),a=y}Cl(`injecting env (${l}) from ${p.join(",")} ${ev(`-- tip: ${Qy()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function cv(e){if(Al(e).length===0)return ue.configDotenv(e);let t=Sl(e);return t?ue._configVault(e):(ov(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ue.configDotenv(e))}function lv(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{let s=Xy.createDecipheriv("aes-256-gcm",r,o);return s.setAuthTag(i),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function uv(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override),i={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s],i[s]=t[s]),n&&wr(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],i[s]=t[s]);return i}var ue={configDotenv:av,_configVault:sv,_parseVault:nv,config:cv,decrypt:lv,parse:rv,populate:uv};it.exports.configDotenv=ue.configDotenv;it.exports._configVault=ue._configVault;it.exports._parseVault=ue._parseVault;it.exports.config=ue.config;it.exports.decrypt=ue.decrypt;it.exports.parse=ue.parse;it.exports.populate=ue.populate;it.exports=ue});var Rl=w((lS,pv)=>{pv.exports={name:"@raclettejs/core",version:"0.1.40",description:"racletteJS core package",repository:"https://gitlab.com/raclettejs/core",author:"Pacifico Digital Explorations GmbH <info@raclettejs.com>",license:"AGPL-3.0-only",type:"module",scripts:{":install:services":"yarn --cwd ./services/backend install && yarn --cwd ./services/frontend install",build:"node build.mjs || true",dev:"node watch.mjs",watch:"node watch.mjs","format:check":"prettier --check .","format:fix":"prettier --write .",lint:"eslint","lint:grouped":"FILTER_RULE=$RULE eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --format ./dev/eslint/groupByRuleFormatter.cjs","lint:fix":"eslint --fix",prepublishOnly:"yarn run build && yarn run sync","publish:patch":"yarn version --patch && yarn publish",sync:"node ./scripts/sync-exports.js"},bin:{"check-dependencies.sh":"./bin/check-dependencies.sh",raclette:"./bin/cli.js"},main:"index.js",types:"./types/index.ts",files:["services","!services/**/.yarn","!services/**/node_modules","!services/**/.yarnrc.yml","bin","dist","types","scripts","index.js","README.md","yarn.lock","src/types.ts","LICENSE.md","CONTRIBUTING.md","raclette.default.config.yaml","templates"],exports:{".":{types:"./types/index.ts",import:"./dist/index.js"},"./backend":{types:"./services/backend/src/index.ts",import:"./services/backend/src/index.ts"},"./frontend":{types:"./services/frontend/src/core/index.ts",import:"./services/frontend/src/core/index.ts"},"./orchestrator":{types:"./services/frontend/src/orchestrator/index.ts",import:"./services/frontend/src/orchestrator/index.ts"}},config:{},dependencies:{"@inquirer/prompts":"8.3.2","@types/mustache":"4.2.6",chalk:"5.6.2",chokidar:"5.0.0","cli-highlight":"2.1.11",commander:"14.0.3",dotenv:"17.3.1",esbuild:"0.27.4","fs-extra":"11.3.4",globby:"16.1.1","js-yaml":"4.1.1",mustache:"4.2.0",ramda:"0.32.0","tsc-alias":"1.8.16"},devDependencies:{"@emnapi/core":"1.9.2","@emnapi/runtime":"1.9.2","@eslint/js":"9.35.0","@raclettejs/types":"workspace:*","@types/fs-extra":"11.0.4","@types/js-yaml":"4.0.9","@types/node":"25.5.0","@types/ramda":"0.31.1",eslint:"9.35.0","eslint-config-prettier":"9.1.2","eslint-flat-config-utils":"3.0.2","eslint-plugin-import":"2.32.0","eslint-plugin-prefer-arrow-functions":"3.9.1","eslint-plugin-prettier":"5.5.5","eslint-plugin-vue":"9.33.0",globals:"17.4.0",prettier:"3.8.1",typescript:"5.9.3","typescript-eslint":"8.59.2","vue-eslint-parser":"10.3.0"}}});import{on as dv,once as Tl}from"node:events";import{PassThrough as fv,getDefaultHighWaterMark as hv}from"node:stream";import{finished as $l}from"node:stream/promises";function ni(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)ri(o);let t=e.some(({readableObjectMode:o})=>o),r=mv(e,t),n=new ti({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var mv,ti,gv,yv,vv,ri,bv,_v,Ev,xv,kv,Dl,Nl,oi,Ll,wv,an,Ol,Pl,Il=vt(()=>{mv=(e,t)=>{if(e.length===0)return hv(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},ti=class extends fv{#e=new Set([]);#o=new Set([]);#i=new Set([]);#r;#n=Symbol("unpipe");#t=new WeakMap;add(t){if(ri(t),this.#e.has(t))return;this.#e.add(t),this.#r??=gv(this,this.#e,this.#n);let r=bv({passThroughStream:this,stream:t,streams:this.#e,ended:this.#o,aborted:this.#i,onFinished:this.#r,unpipeEvent:this.#n});this.#t.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(ri(t),!this.#e.has(t))return!1;let r=this.#t.get(t);return r===void 0?!1:(this.#t.delete(t),t.unpipe(this),await r,!0)}},gv=async(e,t,r)=>{an(e,Ol);let n=new AbortController;try{await Promise.race([yv(e,n),vv(e,t,r,n)])}finally{n.abort(),an(e,-Ol)}},yv=async(e,{signal:t})=>{try{await $l(e,{signal:t,cleanup:!0})}catch(r){throw Dl(e,r),r}},vv=async(e,t,r,{signal:n})=>{for await(let[o]of dv(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},ri=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},bv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{an(e,Pl);let a=new AbortController;try{await Promise.race([_v(i,t,a),Ev({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),xv({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),an(e,-Pl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?oi(e):kv(e))},_v=async(e,t,{signal:r})=>{try{await e,r.aborted||oi(t)}catch(n){r.aborted||Dl(t,n)}},Ev=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await $l(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;Nl(s)?o.add(t):Ll(e,s)}},xv=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await Tl(e,o,{signal:i}),!e.readable)return Tl(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},kv=e=>{e.writable&&e.end()},Dl=(e,t)=>{Nl(t)?oi(e):Ll(e,t)},Nl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",oi=e=>{(e.readable||e.writable)&&e.destroy()},Ll=(e,t)=>{e.destroyed||(e.once("error",wv),e.destroy(t))},wv=()=>{},an=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Ol=2,Pl=1});var Fl=w(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.splitWhen=Zt.flatten=void 0;function Cv(e){return e.reduce((t,r)=>[].concat(t,r),[])}Zt.flatten=Cv;function Av(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Zt.splitWhen=Av});var jl=w(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.isEnoentCodeError=void 0;function Sv(e){return e.code==="ENOENT"}cn.isEnoentCodeError=Sv});var Ml=w(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.createDirentFromStats=void 0;var ii=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Rv(e,t){return new ii(e,t)}ln.createDirentFromStats=Rv});var Vl=w(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.convertPosixPathToPattern=se.convertWindowsPathToPattern=se.convertPathToPattern=se.escapePosixPath=se.escapeWindowsPath=se.escape=se.removeLeadingDotSegment=se.makeAbsolute=se.unixify=void 0;var Tv=F("os"),Ov=F("path"),Bl=Tv.platform()==="win32",Pv=2,$v=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Dv=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Nv=/^\\\\([.?])/,Lv=/\\(?![!()+@[\]{}])/g;function Iv(e){return e.replace(/\\/g,"/")}se.unixify=Iv;function Fv(e,t){return Ov.resolve(e,t)}se.makeAbsolute=Fv;function jv(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(Pv)}return e}se.removeLeadingDotSegment=jv;se.escape=Bl?si:ai;function si(e){return e.replace(Dv,"\\$2")}se.escapeWindowsPath=si;function ai(e){return e.replace($v,"\\$2")}se.escapePosixPath=ai;se.convertPathToPattern=Bl?Hl:Gl;function Hl(e){return si(e).replace(Nv,"//$1").replace(Lv,"/")}se.convertWindowsPathToPattern=Hl;function Gl(e){return ai(e)}se.convertPosixPathToPattern=Gl});var Wl=w((vS,Ul)=>{Ul.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var Kl=w((bS,Yl)=>{var Mv=Wl(),ql={"{":"}","(":")","[":"]"},Bv=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,o=-2,i=-2,s=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(s===-1||s>n||(s=e.indexOf("\\",t),s===-1||s>n)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(s=e.indexOf("\\",t),s===-1||s>o))||i!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(i=e.indexOf(")",t),i>t&&(s=e.indexOf("\\",t),s===-1||s>i))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(i=e.indexOf(")",r),i>r&&(s=e.indexOf("\\",r),s===-1||s>i))))return!0;if(e[t]==="\\"){var a=e[t+1];t+=2;var c=ql[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},Hv=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=ql[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};Yl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Mv(t))return!0;var n=Bv;return r&&r.strict===!1&&(n=Hv),n(t)}});var Xl=w((_S,zl)=>{"use strict";var Gv=Kl(),Vv=F("path").posix.dirname,Uv=F("os").platform()==="win32",ci="/",Wv=/\\/g,qv=/[\{\[].*[\}\]]$/,Yv=/(^|[^\\])([\{\[]|\([^\)]+$)/,Kv=/\\([\!\*\?\|\[\]\(\)\{\}])/g;zl.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Uv&&t.indexOf(ci)<0&&(t=t.replace(Wv,ci)),qv.test(t)&&(t+=ci),t+="a";do t=Vv(t);while(Gv(t)||Yv.test(t));return t.replace(Kv,"$1")}});var un=w(De=>{"use strict";De.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;De.find=(e,t)=>e.nodes.find(r=>r.type===t);De.exceedsLimit=(e,t,r=1,n)=>n===!1||!De.isInteger(e)||!De.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;De.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};De.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;De.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;De.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;De.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);De.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let i=n[o];if(Array.isArray(i)){r(i);continue}i!==void 0&&t.push(i)}return t};return r(e),t}});var pn=w((xS,Ql)=>{"use strict";var Jl=un();Ql.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&Jl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&Jl.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(e)}});var eu=w((kS,Zl)=>{"use strict";Zl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var lu=w((wS,cu)=>{"use strict";var tu=eu(),It=(e,t,r)=>{if(tu(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(tu(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),i=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=e+":"+t+"="+o+i+s+a;if(It.cache.hasOwnProperty(c))return It.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let g=e+"|"+t;return n.capture?`(${g})`:n.wrap===!1?g:`(?:${g})`}let p=au(e)||au(t),d={min:e,max:t,a:u,b:l},y=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let g=l<0?Math.abs(l):1;m=ru(g,Math.abs(u),d,n),u=d.a=0}return l>=0&&(y=ru(u,l,d,n)),d.negatives=m,d.positives=y,d.result=zv(m,y,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&y.length+m.length>1&&(d.result=`(?:${d.result})`),It.cache[c]=d,d.result};function zv(e,t,r){let n=li(e,t,"-",!1,r)||[],o=li(t,e,"",!1,r)||[],i=li(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Xv(e,t){let r=1,n=1,o=ou(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=ou(e,r);for(o=iu(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=iu(t+1,n)-1;return i=[...i],i.sort(Zv),i}function Jv(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Qv(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,u]=n[a];c===u?i+=c:c!=="0"||u!=="9"?i+=eb(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function ru(e,t,r,n){let o=Xv(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Jv(String(s),String(u),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+su(a.count),s=u+1;continue}r.isPadded&&(p=tb(u,r,n)),l.string=p+l.pattern+su(l.count),i.push(l),s=u+1,a=l}return i}function li(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!nu(t,"string",a)&&i.push(r+a),n&&nu(t,"string",a)&&i.push(r+a)}return i}function Qv(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Zv(e,t){return e>t?1:t>e?-1:0}function nu(e,t,r){return e.some(n=>n[t]===r)}function ou(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function iu(e,t){return e-e%Math.pow(10,t)}function su(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function eb(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function au(e){return/^-?(0+)\d/.test(e)}function tb(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}It.cache={};It.clearCache=()=>It.cache={};cu.exports=It});var di=w((CS,gu)=>{"use strict";var rb=F("util"),pu=lu(),uu=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),nb=e=>t=>e===!0?Number(t):String(t),ui=e=>typeof e=="number"||typeof e=="string"&&e!=="",Cr=e=>Number.isInteger(+e),pi=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},ob=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,ib=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},fn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},sb=(e,t,r)=>{e.negatives.sort((a,c)=>a<c?-1:a>c?1:0),e.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=t.capture?"":"?:",o="",i="",s;return e.positives.length&&(o=e.positives.map(a=>fn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>fn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},du=(e,t,r,n)=>{if(r)return pu(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},fu=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return pu(e,t,r)},hu=(...e)=>new RangeError("Invalid range arguments: "+rb.inspect(...e)),mu=(e,t,r)=>{if(r.strictRanges===!0)throw hu([e,t]);return[]},ab=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},cb=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw hu([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),u=String(r);r=Math.max(Math.abs(r),1);let l=pi(a)||pi(c)||pi(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&ob(e,t,n)===!1,y=n.transform||nb(d);if(n.toRegex&&r===1)return du(fn(e,p),fn(t,p),!0,n);let m={negatives:[],positives:[]},g=k=>m[k<0?"negatives":"positives"].push(Math.abs(k)),E=[],x=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?g(o):E.push(ib(y(o,x),p,d)),o=s?o-r:o+r,x++;return n.toRegex===!0?r>1?sb(m,n,p):fu(E,null,{wrap:!1,...n}):E},lb=(e,t,r=1,n={})=>{if(!Cr(e)&&e.length>1||!Cr(t)&&t.length>1)return mu(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),i=`${e}`.charCodeAt(0),s=`${t}`.charCodeAt(0),a=i>s,c=Math.min(i,s),u=Math.max(i,s);if(n.toRegex&&r===1)return du(c,u,!1,n);let l=[],p=0;for(;a?i>=s:i<=s;)l.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?fu(l,null,{wrap:!1,options:n}):l},dn=(e,t,r,n={})=>{if(t==null&&ui(e))return[e];if(!ui(e)||!ui(t))return mu(e,t,n);if(typeof r=="function")return dn(e,t,1,{transform:r});if(uu(r))return dn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,Cr(r)?Cr(e)&&Cr(t)?cb(e,t,r,o):lb(e,t,Math.max(Math.abs(r),1),o):r!=null&&!uu(r)?ab(r,o):dn(e,t,1,r)};gu.exports=dn});var bu=w((AS,vu)=>{"use strict";var ub=di(),yu=un(),pb=(e,t={})=>{let r=(n,o={})=>{let i=yu.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=yu.reduce(n.nodes),p=ub(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(e)};vu.exports=pb});var xu=w((SS,Eu)=>{"use strict";var db=di(),_u=pn(),er=un(),Ft=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?er.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(Ft(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Ft(o,i,r):o+i);return er.flatten(n)},fb=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,i={})=>{o.queue=[];let s=i,a=i.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(o.invalid||o.dollar){a.push(Ft(a.pop(),_u(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(Ft(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=er.reduce(o.nodes);if(er.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=db(...p,t);d.length===0&&(d=_u(o,t)),a.push(Ft(a.pop(),d)),o.nodes=[];return}let c=er.encloseBrace(o),u=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&u.push(""),u.push("");continue}if(d.type==="close"){a.push(Ft(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(Ft(u.pop(),d.value));continue}d.nodes&&n(d,o)}return u};return er.flatten(n(e))};Eu.exports=fb});var wu=w((RS,ku)=>{"use strict";ku.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
31
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Tu=w((TS,Ru)=>{"use strict";var hb=pn(),{MAX_LENGTH:Cu,CHAR_BACKSLASH:fi,CHAR_BACKTICK:mb,CHAR_COMMA:gb,CHAR_DOT:yb,CHAR_LEFT_PARENTHESES:vb,CHAR_RIGHT_PARENTHESES:bb,CHAR_LEFT_CURLY_BRACE:_b,CHAR_RIGHT_CURLY_BRACE:Eb,CHAR_LEFT_SQUARE_BRACKET:Au,CHAR_RIGHT_SQUARE_BRACKET:Su,CHAR_DOUBLE_QUOTE:xb,CHAR_SINGLE_QUOTE:kb,CHAR_NO_BREAK_SPACE:wb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Cb}=wu(),Ab=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Cu,r.maxLength):Cu;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},i=[o],s=o,a=o,c=0,u=e.length,l=0,p=0,d,y=()=>e[l++],m=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return s.nodes.push(g),g.parent=s,g.prev=a,a=g,g};for(m({type:"bos"});l<u;)if(s=i[i.length-1],d=y(),!(d===Cb||d===wb)){if(d===fi){m({type:"text",value:(t.keepEscaping?d:"")+y()});continue}if(d===Su){m({type:"text",value:"\\"+d});continue}if(d===Au){c++;let g;for(;l<u&&(g=y());){if(d+=g,g===Au){c++;continue}if(g===fi){d+=y();continue}if(g===Su&&(c--,c===0))break}m({type:"text",value:d});continue}if(d===vb){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:d});continue}if(d===bb){if(s.type!=="paren"){m({type:"text",value:d});continue}s=i.pop(),m({type:"text",value:d}),s=i[i.length-1];continue}if(d===xb||d===kb||d===mb){let g=d,E;for(t.keepQuotes!==!0&&(d="");l<u&&(E=y());){if(E===fi){d+=E+y();continue}if(E===g){t.keepQuotes===!0&&(d+=E);break}d+=E}m({type:"text",value:d});continue}if(d===_b){p++;let E={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=m(E),i.push(s),m({type:"open",value:d});continue}if(d===Eb){if(s.type!=="brace"){m({type:"text",value:d});continue}let g="close";s=i.pop(),s.close=!0,m({type:g,value:d}),p--,s=i[i.length-1];continue}if(d===gb&&p>0){if(s.ranges>0){s.ranges=0;let g=s.nodes.shift();s.nodes=[g,{type:"text",value:hb(s)}]}m({type:"comma",value:d}),s.commas++;continue}if(d===yb&&p>0&&s.commas===0){let g=s.nodes;if(p===0||g.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){g.pop();let E=g[g.length-1];E.value+=a.value+d,a=E,s.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0)});let g=i[i.length-1],E=g.nodes.indexOf(s);g.nodes.splice(E,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};Ru.exports=Ab});var $u=w((OS,Pu)=>{"use strict";var Ou=pn(),Sb=bu(),Rb=xu(),Tb=Tu(),Re=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Re.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Re.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Re.parse=(e,t={})=>Tb(e,t);Re.stringify=(e,t={})=>Ou(typeof e=="string"?Re.parse(e,t):e,t);Re.compile=(e,t={})=>(typeof e=="string"&&(e=Re.parse(e,t)),Sb(e,t));Re.expand=(e,t={})=>{typeof e=="string"&&(e=Re.parse(e,t));let r=Rb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Re.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Re.compile(e,t):Re.expand(e,t);Pu.exports=Re});var Ar=w((PS,Fu)=>{"use strict";var Ob=F("path"),Je="\\\\/",Du=`[^${Je}]`,Pb=0,st="\\.",$b="\\+",Db="\\?",hn="\\/",Nb="(?=.)",Nu="[^/]",hi=`(?:${hn}|$)`,Lu=`(?:^|${hn})`,mi=`${st}{1,2}${hi}`,Lb=`(?!${st})`,Ib=`(?!${Lu}${mi})`,Fb=`(?!${st}{0,1}${hi})`,jb=`(?!${mi})`,Mb=`[^.${hn}]`,Bb=`${Nu}*?`,Iu={DOT_LITERAL:st,PLUS_LITERAL:$b,QMARK_LITERAL:Db,SLASH_LITERAL:hn,ONE_CHAR:Nb,QMARK:Nu,END_ANCHOR:hi,DOTS_SLASH:mi,NO_DOT:Lb,NO_DOTS:Ib,NO_DOT_SLASH:Fb,NO_DOTS_SLASH:jb,QMARK_NO_DOT:Mb,STAR:Bb,START_ANCHOR:Lu},Hb={...Iu,SLASH_LITERAL:`[${Je}]`,QMARK:Du,STAR:`${Du}*?`,DOTS_SLASH:`${st}{1,2}(?:[${Je}]|$)`,NO_DOT:`(?!${st})`,NO_DOTS:`(?!(?:^|[${Je}])${st}{1,2}(?:[${Je}]|$))`,NO_DOT_SLASH:`(?!${st}{0,1}(?:[${Je}]|$))`,NO_DOTS_SLASH:`(?!${st}{1,2}(?:[${Je}]|$))`,QMARK_NO_DOT:`[^.${Je}]`,START_ANCHOR:`(?:^|[${Je}])`,END_ANCHOR:`(?:[${Je}]|$)`},Gb={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Fu.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Pb,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Gb,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Ob.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Hb:Iu}}});var Sr=w(we=>{"use strict";var Vb=F("path"),Ub=process.platform==="win32",{REGEX_BACKSLASH:Wb,REGEX_REMOVE_BACKSLASH:qb,REGEX_SPECIAL_CHARS:Yb,REGEX_SPECIAL_CHARS_GLOBAL:Kb}=Ar();we.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);we.hasRegexChars=e=>Yb.test(e);we.isRegexChar=e=>e.length===1&&we.hasRegexChars(e);we.escapeRegex=e=>e.replace(Kb,"\\$1");we.toPosixSlashes=e=>e.replace(Wb,"/");we.removeBackslashes=e=>e.replace(qb,t=>t==="\\"?"":t);we.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};we.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Ub===!0||Vb.sep==="\\";we.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?we.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};we.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};we.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Wu=w((DS,Uu)=>{"use strict";var ju=Sr(),{CHAR_ASTERISK:gi,CHAR_AT:zb,CHAR_BACKWARD_SLASH:Rr,CHAR_COMMA:Xb,CHAR_DOT:yi,CHAR_EXCLAMATION_MARK:vi,CHAR_FORWARD_SLASH:Vu,CHAR_LEFT_CURLY_BRACE:bi,CHAR_LEFT_PARENTHESES:_i,CHAR_LEFT_SQUARE_BRACKET:Jb,CHAR_PLUS:Qb,CHAR_QUESTION_MARK:Mu,CHAR_RIGHT_CURLY_BRACE:Zb,CHAR_RIGHT_PARENTHESES:Bu,CHAR_RIGHT_SQUARE_BRACKET:e_}=Ar(),Hu=e=>e===Vu||e===Rr,Gu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},t_=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,u=-1,l=0,p=0,d=!1,y=!1,m=!1,g=!1,E=!1,x=!1,k=!1,O=!1,re=!1,q=!1,$=0,I,C,j={value:"",depth:0,isGlob:!1},ae=()=>u>=n,_=()=>c.charCodeAt(u+1),Q=()=>(I=C,c.charCodeAt(++u));for(;u<n;){C=Q();let ve;if(C===Rr){k=j.backslashes=!0,C=Q(),C===bi&&(x=!0);continue}if(x===!0||C===bi){for($++;ae()!==!0&&(C=Q());){if(C===Rr){k=j.backslashes=!0,Q();continue}if(C===bi){$++;continue}if(x!==!0&&C===yi&&(C=Q())===yi){if(d=j.isBrace=!0,m=j.isGlob=!0,q=!0,o===!0)continue;break}if(x!==!0&&C===Xb){if(d=j.isBrace=!0,m=j.isGlob=!0,q=!0,o===!0)continue;break}if(C===Zb&&($--,$===0)){x=!1,d=j.isBrace=!0,q=!0;break}}if(o===!0)continue;break}if(C===Vu){if(i.push(u),s.push(j),j={value:"",depth:0,isGlob:!1},q===!0)continue;if(I===yi&&u===l+1){l+=2;continue}p=u+1;continue}if(r.noext!==!0&&(C===Qb||C===zb||C===gi||C===Mu||C===vi)===!0&&_()===_i){if(m=j.isGlob=!0,g=j.isExtglob=!0,q=!0,C===vi&&u===l&&(re=!0),o===!0){for(;ae()!==!0&&(C=Q());){if(C===Rr){k=j.backslashes=!0,C=Q();continue}if(C===Bu){m=j.isGlob=!0,q=!0;break}}continue}break}if(C===gi){if(I===gi&&(E=j.isGlobstar=!0),m=j.isGlob=!0,q=!0,o===!0)continue;break}if(C===Mu){if(m=j.isGlob=!0,q=!0,o===!0)continue;break}if(C===Jb){for(;ae()!==!0&&(ve=Q());){if(ve===Rr){k=j.backslashes=!0,Q();continue}if(ve===e_){y=j.isBracket=!0,m=j.isGlob=!0,q=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&C===vi&&u===l){O=j.negated=!0,l++;continue}if(r.noparen!==!0&&C===_i){if(m=j.isGlob=!0,o===!0){for(;ae()!==!0&&(C=Q());){if(C===_i){k=j.backslashes=!0,C=Q();continue}if(C===Bu){q=!0;break}}continue}break}if(m===!0){if(q=!0,o===!0)continue;break}}r.noext===!0&&(g=!1,m=!1);let z=c,gt="",v="";l>0&&(gt=c.slice(0,l),c=c.slice(l),p-=l),z&&m===!0&&p>0?(z=c.slice(0,p),v=c.slice(p)):m===!0?(z="",v=c):z=c,z&&z!==""&&z!=="/"&&z!==c&&Hu(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),r.unescape===!0&&(v&&(v=ju.removeBackslashes(v)),z&&k===!0&&(z=ju.removeBackslashes(z)));let b={prefix:gt,input:e,start:l,base:z,glob:v,isBrace:d,isBracket:y,isGlob:m,isExtglob:g,isGlobstar:E,negated:O,negatedExtglob:re};if(r.tokens===!0&&(b.maxDepth=0,Hu(C)||s.push(j),b.tokens=s),r.parts===!0||r.tokens===!0){let ve;for(let M=0;M<i.length;M++){let Ve=ve?ve+1:l,Ue=i[M],Se=e.slice(Ve,Ue);r.tokens&&(M===0&&l!==0?(s[M].isPrefix=!0,s[M].value=gt):s[M].value=Se,Gu(s[M]),b.maxDepth+=s[M].depth),(M!==0||Se!=="")&&a.push(Se),ve=Ue}if(ve&&ve+1<e.length){let M=e.slice(ve+1);a.push(M),r.tokens&&(s[s.length-1].value=M,Gu(s[s.length-1]),b.maxDepth+=s[s.length-1].depth)}b.slashes=i,b.parts=a}return b};Uu.exports=t_});var Xu=w((NS,zu)=>{"use strict";var Tr=Ar(),me=Sr(),{MAX_LENGTH:mn,POSIX_REGEX_SOURCE:r_,REGEX_NON_SPECIAL_CHARS:n_,REGEX_SPECIAL_CHARS_BACKREF:o_,REPLACEMENTS:qu}=Tr,i_=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>me.escapeRegex(o)).join("..")}return r},tr=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Yu=e=>{let t=[],r=0,n=0,o=0,i="",s=!1;for(let a of e){if(s===!0){i+=a,s=!1;continue}if(a==="\\"){i+=a,s=!0;continue}if(a==='"'){o=o===1?0:1,i+=a;continue}if(o===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){t.push(i),i="";continue}}}i+=a}return t.push(i),t},s_=e=>{let t=!1;for(let r of e){if(t===!0){t=!1;continue}if(r==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Ku=e=>{let t=e.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),r=!0);if(s_(t))return t.replace(/\\(.)/g,"$1")},a_=e=>{let t=e.map(Ku).filter(Boolean);for(let r=0;r<t.length;r++)for(let n=r+1;n<t.length;n++){let o=t[r],i=t[n],s=o[0];if(!(!s||o!==s.repeat(o.length)||i!==s.repeat(i.length))&&(o===i||o.startsWith(i)||i.startsWith(o)))return!0}return!1},Ei=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let r=0,n=0,o=0,i=!1;for(let s=1;s<e.length;s++){let a=e[s];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){o=o===1?0:1;continue}if(o!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return t===!0&&s!==e.length-1?void 0:{type:e[0],body:e.slice(2,s),end:s}}}}},c_=e=>{let t=0,r=[];for(;t<e.length;){let o=Ei(e.slice(t),!1);if(!o||o.type!=="*")return;let i=Yu(o.body).map(a=>a.trim());if(i.length!==1)return;let s=Ku(i[0]);if(!s||s.length!==1)return;r.push(s),t+=o.end+1}return r.length<1?void 0:`${r.length===1?me.escapeRegex(r[0]):`[${r.map(o=>me.escapeRegex(o)).join("")}]`}*`},l_=e=>{let t=0,r=e.trim(),n=Ei(r);for(;n;)t++,r=n.body.trim(),n=Ei(r);return t},u_=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion=="number"?t.maxExtglobRecursion:Tr.DEFAULT_MAX_EXTGLOB_RECURSION,n=Yu(e).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||a_(n)))return{risky:!0};for(let o of n){let i=c_(o);if(i)return{risky:!0,safeOutput:i};if(l_(o)>r)return{risky:!0}}return{risky:!1}},xi=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=qu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(mn,r.maxLength):mn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},s=[i],a=r.capture?"":"?:",c=me.isWindows(t),u=Tr.globChars(c),l=Tr.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:y,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:k,QMARK:O,QMARK_NO_DOT:re,STAR:q,START_ANCHOR:$}=u,I=S=>`(${a}(?:(?!${$}${S.dot?g:p}).)*?)`,C=r.dot?"":E,j=r.dot?O:re,ae=r.bash===!0?I(r):q;r.capture&&(ae=`(${ae})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};e=me.removePrefix(e,_),o=e.length;let Q=[],z=[],gt=[],v=i,b,ve=()=>_.index===o-1,M=_.peek=(S=1)=>e[_.index+S],Ve=_.advance=()=>e[++_.index]||"",Ue=()=>e.slice(_.index+1),Se=(S="",Z=0)=>{_.consumed+=S,_.index+=Z},Vr=S=>{_.output+=S.output!=null?S.output:S.value,Se(S.value)},Hh=()=>{let S=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)Ve(),_.start++,S++;return S%2===0?!1:(_.negated=!0,_.start++,!0)},Ur=S=>{_[S]++,gt.push(S)},yt=S=>{_[S]--,gt.pop()},L=S=>{if(v.type==="globstar"){let Z=_.braces>0&&(S.type==="comma"||S.type==="brace"),A=S.extglob===!0||Q.length&&(S.type==="pipe"||S.type==="paren");S.type!=="slash"&&S.type!=="paren"&&!Z&&!A&&(_.output=_.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=ae,_.output+=v.output)}if(Q.length&&S.type!=="paren"&&(Q[Q.length-1].inner+=S.value),(S.value||S.output)&&Vr(S),v&&v.type==="text"&&S.type==="text"){v.value+=S.value,v.output=(v.output||"")+S.value;return}S.prev=v,s.push(S),v=S},Wr=(S,Z)=>{let A={...l[Z],conditions:1,inner:""};A.prev=v,A.parens=_.parens,A.output=_.output,A.startIndex=_.index,A.tokensIndex=s.length;let N=(r.capture?"(":"")+A.open;Ur("parens"),L({type:S,value:Z,output:_.output?"":m}),L({type:"paren",extglob:!0,value:Ve(),output:N}),Q.push(A)},Gh=S=>{let Z=e.slice(S.startIndex,_.index+1),A=e.slice(S.startIndex+2,_.index),N=u_(A,r);if((S.type==="plus"||S.type==="star")&&N.risky){let Y=N.safeOutput?(S.output?"":m)+(r.capture?`(${N.safeOutput})`:N.safeOutput):void 0,We=s[S.tokensIndex];We.type="text",We.value=Z,We.output=Y||me.escapeRegex(Z);for(let qe=S.tokensIndex+1;qe<s.length;qe++)s[qe].value="",s[qe].output="",delete s[qe].suffix;_.output=S.output+We.output,_.backtrack=!0,L({type:"paren",extglob:!0,value:b,output:""}),yt("parens");return}let X=S.close+(r.capture?")":""),ce;if(S.type==="negate"){let Y=ae;if(S.inner&&S.inner.length>1&&S.inner.includes("/")&&(Y=I(r)),(Y!==ae||ve()||/^\)+$/.test(Ue()))&&(X=S.close=`)$))${Y}`),S.inner.includes("*")&&(ce=Ue())&&/^\.[^\\/.]+$/.test(ce)){let We=xi(ce,{...t,fastpaths:!1}).output;X=S.close=`)${We})${Y})`}S.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:b,output:X}),yt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let S=!1,Z=e.replace(o_,(A,N,X,ce,Y,We)=>ce==="\\"?(S=!0,A):ce==="?"?N?N+ce+(Y?O.repeat(Y.length):""):We===0?j+(Y?O.repeat(Y.length):""):O.repeat(X.length):ce==="."?p.repeat(X.length):ce==="*"?N?N+ce+(Y?ae:""):ae:N?A:`\\${A}`);return S===!0&&(r.unescape===!0?Z=Z.replace(/\\/g,""):Z=Z.replace(/\\+/g,A=>A.length%2===0?"\\\\":A?"\\":"")),Z===e&&r.contains===!0?(_.output=e,_):(_.output=me.wrapOutput(Z,_,t),_)}for(;!ve();){if(b=Ve(),b==="\0")continue;if(b==="\\"){let A=M();if(A==="/"&&r.bash!==!0||A==="."||A===";")continue;if(!A){b+="\\",L({type:"text",value:b});continue}let N=/^\\+/.exec(Ue()),X=0;if(N&&N[0].length>2&&(X=N[0].length,_.index+=X,X%2!==0&&(b+="\\")),r.unescape===!0?b=Ve():b+=Ve(),_.brackets===0){L({type:"text",value:b});continue}}if(_.brackets>0&&(b!=="]"||v.value==="["||v.value==="[^")){if(r.posix!==!1&&b===":"){let A=v.value.slice(1);if(A.includes("[")&&(v.posix=!0,A.includes(":"))){let N=v.value.lastIndexOf("["),X=v.value.slice(0,N),ce=v.value.slice(N+2),Y=r_[ce];if(Y){v.value=X+Y,_.backtrack=!0,Ve(),!i.output&&s.indexOf(v)===1&&(i.output=m);continue}}}(b==="["&&M()!==":"||b==="-"&&M()==="]")&&(b=`\\${b}`),b==="]"&&(v.value==="["||v.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&v.value==="["&&(b="^"),v.value+=b,Vr({value:b});continue}if(_.quotes===1&&b!=='"'){b=me.escapeRegex(b),v.value+=b,Vr({value:b});continue}if(b==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:b});continue}if(b==="("){Ur("parens"),L({type:"paren",value:b});continue}if(b===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(tr("opening","("));let A=Q[Q.length-1];if(A&&_.parens===A.parens+1){Gh(Q.pop());continue}L({type:"paren",value:b,output:_.parens?")":"\\)"}),yt("parens");continue}if(b==="["){if(r.nobracket===!0||!Ue().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(tr("closing","]"));b=`\\${b}`}else Ur("brackets");L({type:"bracket",value:b});continue}if(b==="]"){if(r.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){L({type:"text",value:b,output:`\\${b}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(tr("opening","["));L({type:"text",value:b,output:`\\${b}`});continue}yt("brackets");let A=v.value.slice(1);if(v.posix!==!0&&A[0]==="^"&&!A.includes("/")&&(b=`/${b}`),v.value+=b,Vr({value:b}),r.literalBrackets===!1||me.hasRegexChars(A))continue;let N=me.escapeRegex(v.value);if(_.output=_.output.slice(0,-v.value.length),r.literalBrackets===!0){_.output+=N,v.value=N;continue}v.value=`(${a}${N}|${v.value})`,_.output+=v.value;continue}if(b==="{"&&r.nobrace!==!0){Ur("braces");let A={type:"brace",value:b,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};z.push(A),L(A);continue}if(b==="}"){let A=z[z.length-1];if(r.nobrace===!0||!A){L({type:"text",value:b,output:b});continue}let N=")";if(A.dots===!0){let X=s.slice(),ce=[];for(let Y=X.length-1;Y>=0&&(s.pop(),X[Y].type!=="brace");Y--)X[Y].type!=="dots"&&ce.unshift(X[Y].value);N=i_(ce,r),_.backtrack=!0}if(A.comma!==!0&&A.dots!==!0){let X=_.output.slice(0,A.outputIndex),ce=_.tokens.slice(A.tokensIndex);A.value=A.output="\\{",b=N="\\}",_.output=X;for(let Y of ce)_.output+=Y.output||Y.value}L({type:"brace",value:b,output:N}),yt("braces"),z.pop();continue}if(b==="|"){Q.length>0&&Q[Q.length-1].conditions++,L({type:"text",value:b});continue}if(b===","){let A=b,N=z[z.length-1];N&>[gt.length-1]==="braces"&&(N.comma=!0,A="|"),L({type:"comma",value:b,output:A});continue}if(b==="/"){if(v.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),v=i;continue}L({type:"slash",value:b,output:y});continue}if(b==="."){if(_.braces>0&&v.type==="dot"){v.value==="."&&(v.output=p);let A=z[z.length-1];v.type="dots",v.output+=b,v.value+=b,A.dots=!0;continue}if(_.braces+_.parens===0&&v.type!=="bos"&&v.type!=="slash"){L({type:"text",value:b,output:p});continue}L({type:"dot",value:b,output:p});continue}if(b==="?"){if(!(v&&v.value==="(")&&r.noextglob!==!0&&M()==="("&&M(2)!=="?"){Wr("qmark",b);continue}if(v&&v.type==="paren"){let N=M(),X=b;if(N==="<"&&!me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(N)||N==="<"&&!/<([!=]|\w+>)/.test(Ue()))&&(X=`\\${b}`),L({type:"text",value:b,output:X});continue}if(r.dot!==!0&&(v.type==="slash"||v.type==="bos")){L({type:"qmark",value:b,output:re});continue}L({type:"qmark",value:b,output:O});continue}if(b==="!"){if(r.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){Wr("negate",b);continue}if(r.nonegate!==!0&&_.index===0){Hh();continue}}if(b==="+"){if(r.noextglob!==!0&&M()==="("&&M(2)!=="?"){Wr("plus",b);continue}if(v&&v.value==="("||r.regex===!1){L({type:"plus",value:b,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||_.parens>0){L({type:"plus",value:b});continue}L({type:"plus",value:d});continue}if(b==="@"){if(r.noextglob!==!0&&M()==="("&&M(2)!=="?"){L({type:"at",extglob:!0,value:b,output:""});continue}L({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);let A=n_.exec(Ue());A&&(b+=A[0],_.index+=A[0].length),L({type:"text",value:b});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=b,v.output=ae,_.backtrack=!0,_.globstar=!0,Se(b);continue}let S=Ue();if(r.noextglob!==!0&&/^\([^?]/.test(S)){Wr("star",b);continue}if(v.type==="star"){if(r.noglobstar===!0){Se(b);continue}let A=v.prev,N=A.prev,X=A.type==="slash"||A.type==="bos",ce=N&&(N.type==="star"||N.type==="globstar");if(r.bash===!0&&(!X||S[0]&&S[0]!=="/")){L({type:"star",value:b,output:""});continue}let Y=_.braces>0&&(A.type==="comma"||A.type==="brace"),We=Q.length&&(A.type==="pipe"||A.type==="paren");if(!X&&A.type!=="paren"&&!Y&&!We){L({type:"star",value:b,output:""});continue}for(;S.slice(0,3)==="/**";){let qe=e[_.index+4];if(qe&&qe!=="/")break;S=S.slice(3),Se("/**",3)}if(A.type==="bos"&&ve()){v.type="globstar",v.value+=b,v.output=I(r),_.output=v.output,_.globstar=!0,Se(b);continue}if(A.type==="slash"&&A.prev.type!=="bos"&&!ce&&ve()){_.output=_.output.slice(0,-(A.output+v.output).length),A.output=`(?:${A.output}`,v.type="globstar",v.output=I(r)+(r.strictSlashes?")":"|$)"),v.value+=b,_.globstar=!0,_.output+=A.output+v.output,Se(b);continue}if(A.type==="slash"&&A.prev.type!=="bos"&&S[0]==="/"){let qe=S[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(A.output+v.output).length),A.output=`(?:${A.output}`,v.type="globstar",v.output=`${I(r)}${y}|${y}${qe})`,v.value+=b,_.output+=A.output+v.output,_.globstar=!0,Se(b+Ve()),L({type:"slash",value:"/",output:""});continue}if(A.type==="bos"&&S[0]==="/"){v.type="globstar",v.value+=b,v.output=`(?:^|${y}|${I(r)}${y})`,_.output=v.output,_.globstar=!0,Se(b+Ve()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-v.output.length),v.type="globstar",v.output=I(r),v.value+=b,_.output+=v.output,_.globstar=!0,Se(b);continue}let Z={type:"star",value:b,output:ae};if(r.bash===!0){Z.output=".*?",(v.type==="bos"||v.type==="slash")&&(Z.output=C+Z.output),L(Z);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&r.regex===!0){Z.output=b,L(Z);continue}(_.index===_.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(_.output+=x,v.output+=x):r.dot===!0?(_.output+=k,v.output+=k):(_.output+=C,v.output+=C),M()!=="*"&&(_.output+=m,v.output+=m)),L(Z)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing","]"));_.output=me.escapeLast(_.output,"["),yt("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing",")"));_.output=me.escapeLast(_.output,"("),yt("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing","}"));_.output=me.escapeLast(_.output,"{"),yt("braces")}if(r.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let S of _.tokens)_.output+=S.output!=null?S.output:S.value,S.suffix&&(_.output+=S.suffix)}return _};xi.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(mn,r.maxLength):mn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=qu[e]||e;let i=me.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:y,START_ANCHOR:m}=Tr.globChars(i),g=r.dot?p:l,E=r.dot?d:l,x=r.capture?"":"?:",k={negated:!1,prefix:""},O=r.bash===!0?".*?":y;r.capture&&(O=`(${O})`);let re=C=>C.noglobstar===!0?O:`(${x}(?:(?!${m}${C.dot?u:s}).)*?)`,q=C=>{switch(C){case"*":return`${g}${c}${O}`;case".*":return`${s}${c}${O}`;case"*.*":return`${g}${O}${s}${c}${O}`;case"*/*":return`${g}${O}${a}${c}${E}${O}`;case"**":return g+re(r);case"**/*":return`(?:${g}${re(r)}${a})?${E}${c}${O}`;case"**/*.*":return`(?:${g}${re(r)}${a})?${E}${O}${s}${c}${O}`;case"**/.*":return`(?:${g}${re(r)}${a})?${s}${c}${O}`;default:{let j=/^(.*?)\.(\w+)$/.exec(C);if(!j)return;let ae=q(j[1]);return ae?ae+s+j[2]:void 0}}},$=me.removePrefix(e,k),I=q($);return I&&r.strictSlashes!==!0&&(I+=`${a}?`),I};zu.exports=xi});var Qu=w((LS,Ju)=>{"use strict";var p_=F("path"),d_=Wu(),ki=Xu(),wi=Sr(),f_=Ar(),h_=e=>e&&typeof e=="object"&&!Array.isArray(e),ne=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>ne(d,t,r));return d=>{for(let y of l){let m=y(d);if(m)return m}return!1}}let n=h_(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},i=wi.isWindows(t),s=n?ne.compileRe(e,t):ne.makeRe(e,t,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};c=ne(o.ignore,l,r)}let u=(l,p=!1)=>{let{isMatch:d,match:y,output:m}=ne.test(l,s,t,{glob:e,posix:i}),g={glob:e,state:a,regex:s,posix:i,input:l,output:m,match:y,isMatch:d};return typeof o.onResult=="function"&&o.onResult(g),d===!1?(g.isMatch=!1,p?g:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(g),g.isMatch=!1,p?g:!1):(typeof o.onMatch=="function"&&o.onMatch(g),p?g:!0)};return r&&(u.state=a),u};ne.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=r||{},s=i.format||(o?wi.toPosixSlashes:null),a=e===n,c=a&&s?s(e):e;return a===!1&&(c=s?s(e):e,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=ne.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};ne.matchBase=(e,t,r,n=wi.isWindows(r))=>(t instanceof RegExp?t:ne.makeRe(t,r)).test(p_.basename(e));ne.isMatch=(e,t,r)=>ne(t,r)(e);ne.parse=(e,t)=>Array.isArray(e)?e.map(r=>ne.parse(r,t)):ki(e,{...t,fastpaths:!1});ne.scan=(e,t)=>d_(e,t);ne.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},i=o.contains?"":"^",s=o.contains?"":"$",a=`${i}(?:${e.output})${s}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let c=ne.toRegex(a,t);return n===!0&&(c.state=e),c};ne.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=ki.fastpaths(e,t)),o.output||(o=ki(e,t)),ne.compileRe(o,t,r,n)};ne.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};ne.constants=f_;Ju.exports=ne});var ep=w((IS,Zu)=>{"use strict";Zu.exports=Qu()});var sp=w((FS,ip)=>{"use strict";var rp=F("util"),np=$u(),Qe=ep(),Ci=Sr(),tp=e=>e===""||e==="./",op=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Qe(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let y of e){let m=p(y,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let u=(s===t.length?[...i]:[...o]).filter(l=>!n.has(l));if(r&&u.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return u};J.match=J;J.matcher=(e,t)=>Qe(e,t);J.isMatch=(e,t,r)=>Qe(t,r)(e);J.any=J.isMatch;J.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],i=a=>{r.onResult&&r.onResult(a),o.push(a.output)},s=new Set(J(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};J.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${rp.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>J.contains(e,n,r));if(typeof t=="string"){if(tp(e)||tp(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...r,contains:!0})};J.matchKeys=(e,t,r)=>{if(!Ci.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=J(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};J.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(n.some(s=>i(s)))return!0}return!1};J.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};J.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${rp.inspect(e)}"`);return[].concat(t).every(n=>Qe(n,r)(e))};J.capture=(e,t,r)=>{let n=Ci.isWindows(r),i=Qe.makeRe(String(e),{...r,capture:!0}).exec(n?Ci.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};J.makeRe=(...e)=>Qe.makeRe(...e);J.scan=(...e)=>Qe.scan(...e);J.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of np(String(n),t))r.push(Qe.parse(o,t));return r};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!op(e)?[e]:np(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=op;ip.exports=J});var gp=w(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.isAbsolute=T.partitionAbsoluteAndRelative=T.removeDuplicateSlashes=T.matchAny=T.convertPatternsToRe=T.makeRe=T.getPatternParts=T.expandBraceExpansion=T.expandPatternsWithBraceExpansion=T.isAffectDepthOfReadingPattern=T.endsWithSlashGlobStar=T.hasGlobStar=T.getBaseDirectory=T.isPatternRelatedToParentDirectory=T.getPatternsOutsideCurrentDirectory=T.getPatternsInsideCurrentDirectory=T.getPositivePatterns=T.getNegativePatterns=T.isPositivePattern=T.isNegativePattern=T.convertToNegativePattern=T.convertToPositivePattern=T.isDynamicPattern=T.isStaticPattern=void 0;var ap=F("path"),m_=Xl(),Ai=sp(),cp="**",g_="\\",y_=/[*?]|^!/,v_=/\[[^[]*]/,b_=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,__=/[!*+?@]\([^(]*\)/,E_=/,|\.\./,x_=/(?!^)\/{2,}/g;function lp(e,t={}){return!up(e,t)}T.isStaticPattern=lp;function up(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(g_)||y_.test(e)||v_.test(e)||b_.test(e)||t.extglob!==!1&&__.test(e)||t.braceExpansion!==!1&&k_(e))}T.isDynamicPattern=up;function k_(e){let t=e.indexOf("{");if(t===-1)return!1;let r=e.indexOf("}",t+1);if(r===-1)return!1;let n=e.slice(t,r);return E_.test(n)}function w_(e){return gn(e)?e.slice(1):e}T.convertToPositivePattern=w_;function C_(e){return"!"+e}T.convertToNegativePattern=C_;function gn(e){return e.startsWith("!")&&e[1]!=="("}T.isNegativePattern=gn;function pp(e){return!gn(e)}T.isPositivePattern=pp;function A_(e){return e.filter(gn)}T.getNegativePatterns=A_;function S_(e){return e.filter(pp)}T.getPositivePatterns=S_;function R_(e){return e.filter(t=>!Si(t))}T.getPatternsInsideCurrentDirectory=R_;function T_(e){return e.filter(Si)}T.getPatternsOutsideCurrentDirectory=T_;function Si(e){return e.startsWith("..")||e.startsWith("./..")}T.isPatternRelatedToParentDirectory=Si;function O_(e){return m_(e,{flipBackslashes:!1})}T.getBaseDirectory=O_;function P_(e){return e.includes(cp)}T.hasGlobStar=P_;function dp(e){return e.endsWith("/"+cp)}T.endsWithSlashGlobStar=dp;function $_(e){let t=ap.basename(e);return dp(e)||lp(t)}T.isAffectDepthOfReadingPattern=$_;function D_(e){return e.reduce((t,r)=>t.concat(fp(r)),[])}T.expandPatternsWithBraceExpansion=D_;function fp(e){let t=Ai.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}T.expandBraceExpansion=fp;function N_(e,t){let{parts:r}=Ai.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return r.length===0&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}T.getPatternParts=N_;function hp(e,t){return Ai.makeRe(e,t)}T.makeRe=hp;function L_(e,t){return e.map(r=>hp(r,t))}T.convertPatternsToRe=L_;function I_(e,t){return t.some(r=>r.test(e))}T.matchAny=I_;function F_(e){return e.replace(x_,"/")}T.removeDuplicateSlashes=F_;function j_(e){let t=[],r=[];for(let n of e)mp(n)?t.push(n):r.push(n);return[t,r]}T.partitionAbsoluteAndRelative=j_;function mp(e){return ap.isAbsolute(e)}T.isAbsolute=mp});var _p=w((MS,bp)=>{"use strict";var M_=F("stream"),yp=M_.PassThrough,B_=Array.prototype.slice;bp.exports=H_;function H_(){let e=[],t=B_.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let o=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=yp(n);function a(){for(let l=0,p=arguments.length;l<p;l++)e.push(vp(arguments[l],n));return c(),this}function c(){if(r)return;r=!0;let l=e.shift();if(!l){process.nextTick(u);return}Array.isArray(l)||(l=[l]);let p=l.length+1;function d(){--p>0||(r=!1,c())}function y(m){function g(){m.removeListener("merge2UnpipeEnd",g),m.removeListener("end",g),i&&m.removeListener("error",E),d()}function E(x){s.emit("error",x)}if(m._readableState.endEmitted)return d();m.on("merge2UnpipeEnd",g),m.on("end",g),i&&m.on("error",E),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)y(l[m]);d()}function u(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function vp(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=vp(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(yp(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var xp=w(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.merge=void 0;var G_=_p();function V_(e){let t=G_(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Ep(e)),t.once("end",()=>Ep(e)),t}yn.merge=V_;function Ep(e){e.forEach(t=>t.emit("close"))}});var kp=w(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.isEmpty=rr.isString=void 0;function U_(e){return typeof e=="string"}rr.isString=U_;function W_(e){return e===""}rr.isEmpty=W_});var at=w(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.string=ge.stream=ge.pattern=ge.path=ge.fs=ge.errno=ge.array=void 0;var q_=Fl();ge.array=q_;var Y_=jl();ge.errno=Y_;var K_=Ml();ge.fs=K_;var z_=Vl();ge.path=z_;var X_=gp();ge.pattern=X_;var J_=xp();ge.stream=J_;var Q_=kp();ge.string=Q_});var Sp=w(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.convertPatternGroupToTask=ye.convertPatternGroupsToTasks=ye.groupPatternsByBaseDirectory=ye.getNegativePatternsAsPositive=ye.getPositivePatterns=ye.convertPatternsToTasks=ye.generate=void 0;var Be=at();function Z_(e,t){let r=wp(e,t),n=wp(t.ignore,t),o=Cp(r),i=Ap(r,n),s=o.filter(l=>Be.pattern.isStaticPattern(l,t)),a=o.filter(l=>Be.pattern.isDynamicPattern(l,t)),c=Ri(s,i,!1),u=Ri(a,i,!0);return c.concat(u)}ye.generate=Z_;function wp(e,t){let r=e;return t.braceExpansion&&(r=Be.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Be.pattern.removeDuplicateSlashes(n))}function Ri(e,t,r){let n=[],o=Be.pattern.getPatternsOutsideCurrentDirectory(e),i=Be.pattern.getPatternsInsideCurrentDirectory(e),s=Ti(o),a=Ti(i);return n.push(...Oi(s,t,r)),"."in a?n.push(Pi(".",i,t,r)):n.push(...Oi(a,t,r)),n}ye.convertPatternsToTasks=Ri;function Cp(e){return Be.pattern.getPositivePatterns(e)}ye.getPositivePatterns=Cp;function Ap(e,t){return Be.pattern.getNegativePatterns(e).concat(t).map(Be.pattern.convertToPositivePattern)}ye.getNegativePatternsAsPositive=Ap;function Ti(e){let t={};return e.reduce((r,n)=>{let o=Be.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}ye.groupPatternsByBaseDirectory=Ti;function Oi(e,t,r){return Object.keys(e).map(n=>Pi(n,e[n],t,r))}ye.convertPatternGroupsToTasks=Oi;function Pi(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(Be.pattern.convertToNegativePattern))}}ye.convertPatternGroupToTask=Pi});var Tp=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.read=void 0;function eE(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Rp(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){$i(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Rp(r,i);return}$i(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),$i(r,s)})})}vn.read=eE;function Rp(e,t){e(t)}function $i(e,t){e(null,t)}});var Op=w(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.read=void 0;function tE(e,t){let r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw n}}bn.read=tE});var Pp=w(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.createFileSystemAdapter=xt.FILE_SYSTEM_ADAPTER=void 0;var _n=F("fs");xt.FILE_SYSTEM_ADAPTER={lstat:_n.lstat,stat:_n.stat,lstatSync:_n.lstatSync,statSync:_n.statSync};function rE(e){return e===void 0?xt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},xt.FILE_SYSTEM_ADAPTER),e)}xt.createFileSystemAdapter=rE});var $p=w(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});var nE=Pp(),Di=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=nE.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,r){return t??r}};Ni.default=Di});var jt=w(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.statSync=kt.stat=kt.Settings=void 0;var Dp=Tp(),oE=Op(),Li=$p();kt.Settings=Li.default;function iE(e,t,r){if(typeof t=="function"){Dp.read(e,Ii(),t);return}Dp.read(e,Ii(t),r)}kt.stat=iE;function sE(e,t){let r=Ii(t);return oE.read(e,r)}kt.statSync=sE;function Ii(e={}){return e instanceof Li.default?e:new Li.default(e)}});var Ip=w((zS,Lp)=>{var Np;Lp.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(Np||(Np=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var jp=w((XS,Fp)=>{Fp.exports=cE;var aE=Ip();function cE(e,t){let r,n,o,i=!0;Array.isArray(e)?(r=[],n=e.length):(o=Object.keys(e),r={},n=o.length);function s(c){function u(){t&&t(c,r),t=null}i?aE(u):u()}function a(c,u,l){r[c]=l,(--n===0||u)&&s(u)}n?o?o.forEach(function(c){e[c](function(u,l){a(c,u,l)})}):e.forEach(function(c,u){c(function(l,p){a(u,l,p)})}):s(null),i=!1}});var Fi=w(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var En=process.versions.node.split(".");if(En[0]===void 0||En[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Mp=Number.parseInt(En[0],10),lE=Number.parseInt(En[1],10),Bp=10,uE=10,pE=Mp>Bp,dE=Mp===Bp&&lE>=uE;xn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=pE||dE});var Hp=w(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.createDirentFromStats=void 0;var ji=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function fE(e,t){return new ji(e,t)}kn.createDirentFromStats=fE});var Mi=w(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.fs=void 0;var hE=Hp();wn.fs=hE});var Bi=w(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.joinPathSegments=void 0;function mE(e,t,r){return e.endsWith(r)?e+t:e+r+t}Cn.joinPathSegments=mE});var Yp=w(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.readdir=wt.readdirWithFileTypes=wt.read=void 0;var gE=jt(),Gp=jp(),yE=Fi(),Vp=Mi(),Up=Bi();function vE(e,t,r){if(!t.stats&&yE.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Wp(e,t,r);return}qp(e,t,r)}wt.read=vE;function Wp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){An(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:Up.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){Hi(r,i);return}let s=i.map(a=>bE(a,t));Gp(s,(a,c)=>{if(a!==null){An(r,a);return}Hi(r,c)})})}wt.readdirWithFileTypes=Wp;function bE(e,t){return r=>{if(!e.dirent.isSymbolicLink()){r(null,e);return}t.fs.stat(e.path,(n,o)=>{if(n!==null){if(t.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,e);return}e.dirent=Vp.fs.createDirentFromStats(e.name,o),r(null,e)})}}function qp(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){An(r,n);return}let i=o.map(s=>{let a=Up.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{gE.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let p={name:s,path:a,dirent:Vp.fs.createDirentFromStats(s,l)};t.stats&&(p.stats=l),c(null,p)})}});Gp(i,(s,a)=>{if(s!==null){An(r,s);return}Hi(r,a)})})}wt.readdir=qp;function An(e,t){e(t)}function Hi(e,t){e(null,t)}});var Qp=w(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.readdir=Ct.readdirWithFileTypes=Ct.read=void 0;var _E=jt(),EE=Fi(),Kp=Mi(),zp=Bi();function xE(e,t){return!t.stats&&EE.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Xp(e,t):Jp(e,t)}Ct.read=xE;function Xp(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:zp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=Kp.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}Ct.readdirWithFileTypes=Xp;function Jp(e,t){return t.fs.readdirSync(e).map(n=>{let o=zp.joinPathSegments(e,n,t.pathSegmentSeparator),i=_E.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:Kp.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}Ct.readdir=Jp});var Zp=w(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.createFileSystemAdapter=At.FILE_SYSTEM_ADAPTER=void 0;var nr=F("fs");At.FILE_SYSTEM_ADAPTER={lstat:nr.lstat,stat:nr.stat,lstatSync:nr.lstatSync,statSync:nr.statSync,readdir:nr.readdir,readdirSync:nr.readdirSync};function kE(e){return e===void 0?At.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},At.FILE_SYSTEM_ADAPTER),e)}At.createFileSystemAdapter=kE});var ed=w(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var wE=F("path"),CE=jt(),AE=Zp(),Gi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=AE.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,wE.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new CE.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Vi.default=Gi});var Sn=w(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.Settings=St.scandirSync=St.scandir=void 0;var td=Yp(),SE=Qp(),Ui=ed();St.Settings=Ui.default;function RE(e,t,r){if(typeof t=="function"){td.read(e,Wi(),t);return}td.read(e,Wi(t),r)}St.scandir=RE;function TE(e,t){let r=Wi(t);return SE.read(e,r)}St.scandirSync=TE;function Wi(e={}){return e instanceof Ui.default?e:new Ui.default(e)}});var nd=w((sR,rd)=>{"use strict";function OE(e){var t=new e,r=t;function n(){var i=t;return i.next?t=i.next:(t=new e,r=t),i.next=null,i}function o(i){r.next=i,r=i}return{get:n,release:o}}rd.exports=OE});var id=w((aR,qi)=>{"use strict";var PE=nd();function od(e,t,r){if(typeof e=="function"&&(r=t,t=e,e=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=PE($E),o=null,i=null,s=0,a=null,c={push:g,drain:Ce,saturated:Ce,pause:l,paused:!1,get concurrency(){return r},set concurrency($){if(!($>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=$,!c.paused)for(;o&&s<r;)s++,x()},running:u,resume:y,idle:m,length:p,getQueue:d,unshift:E,empty:Ce,kill:k,killAndDrain:O,error:q,abort:re};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var $=o,I=0;$;)$=$.next,I++;return I}function d(){for(var $=o,I=[];$;)I.push($.value),$=$.next;return I}function y(){if(c.paused){if(c.paused=!1,o===null){s++,x();return}for(;o&&s<r;)s++,x()}}function m(){return s===0&&c.length()===0}function g($,I){var C=n.get();C.context=e,C.release=x,C.value=$,C.callback=I||Ce,C.errorHandler=a,s>=r||c.paused?i?(i.next=C,i=C):(o=C,i=C,c.saturated()):(s++,t.call(e,C.value,C.worked))}function E($,I){var C=n.get();C.context=e,C.release=x,C.value=$,C.callback=I||Ce,C.errorHandler=a,s>=r||c.paused?o?(C.next=o,o=C):(o=C,i=C,c.saturated()):(s++,t.call(e,C.value,C.worked))}function x($){$&&n.release($);var I=o;I&&s<=r?c.paused?s--:(i===o&&(i=null),o=I.next,I.next=null,t.call(e,I.value,I.worked),i===null&&c.empty()):--s===0&&c.drain()}function k(){o=null,i=null,c.drain=Ce}function O(){o=null,i=null,c.drain(),c.drain=Ce}function re(){var $=o;for(o=null,i=null;$;){var I=$.next,C=$.callback,j=$.errorHandler,ae=$.value,_=$.context;$.value=null,$.callback=Ce,$.errorHandler=null,j&&j(new Error("abort"),ae),C.call(_,new Error("abort")),$.release($),$=I}c.drain=Ce}function q($){a=$}}function Ce(){}function $E(){this.value=null,this.callback=Ce,this.next=null,this.release=Ce,this.context=null,this.errorHandler=null;var e=this;this.worked=function(r,n){var o=e.callback,i=e.errorHandler,s=e.value;e.value=null,e.callback=Ce,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function DE(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,p){t.call(this,l).then(function(d){p(null,d)},p)}var o=od(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=u,o;function a(l){var p=new Promise(function(d,y){i(l,function(m,g){if(m){y(m);return}d(g)})});return p.catch(Ce),p}function c(l){var p=new Promise(function(d,y){s(l,function(m,g){if(m){y(m);return}d(g)})});return p.catch(Ce),p}function u(){var l=new Promise(function(p){process.nextTick(function(){if(o.idle())p();else{var d=o.drain;o.drain=function(){typeof d=="function"&&d(),p(),o.drain=d}}})});return l}}qi.exports=od;qi.exports.promise=DE});var Rn=w(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.joinPathSegments=Ze.replacePathSegmentSeparator=Ze.isAppliedFilter=Ze.isFatalError=void 0;function NE(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ze.isFatalError=NE;function LE(e,t){return e===null||e(t)}Ze.isAppliedFilter=LE;function IE(e,t){return e.split(/[/\\]/).join(t)}Ze.replacePathSegmentSeparator=IE;function FE(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ze.joinPathSegments=FE});var zi=w(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var jE=Rn(),Yi=class{constructor(t,r){this._root=t,this._settings=r,this._root=jE.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Ki.default=Yi});var Qi=w(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var ME=F("events"),BE=Sn(),HE=id(),Tn=Rn(),GE=zi(),Xi=class extends GE.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=BE.scandir,this._emitter=new ME.EventEmitter,this._queue=HE(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){let n={directory:t,base:r};this._queue.push(n,o=>{o!==null&&this._handleError(o)})}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,(n,o)=>{if(n!==null){r(n,void 0);return}for(let i of o)this._handleEntry(i,t.base);r(null,void 0)})}_handleError(t){this._isDestroyed||!Tn.isFatalError(this._settings,t)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError)return;let n=t.path;r!==void 0&&(t.path=Tn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Tn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Tn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};Ji.default=Xi});var sd=w(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var VE=Qi(),Zi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new VE.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{UE(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{WE(t,this._storage)}),this._reader.read()}};es.default=Zi;function UE(e,t){e(t)}function WE(e,t){e(null,t)}});var ad=w(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var qE=F("stream"),YE=Qi(),ts=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new YE.default(this._root,this._settings),this._stream=new qE.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};rs.default=ts});var cd=w(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var KE=Sn(),On=Rn(),zE=zi(),ns=class extends zE.default{constructor(){super(...arguments),this._scandir=KE.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(let t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,r){try{let n=this._scandir(t,this._settings.fsScandirSettings);for(let o of n)this._handleEntry(o,r)}catch(n){this._handleError(n)}}_handleError(t){if(On.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=On.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),On.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&On.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};os.default=ns});var ld=w(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var XE=cd(),is=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new XE.default(this._root,this._settings)}read(){return this._reader.read()}};ss.default=is});var ud=w(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var JE=F("path"),QE=Sn(),as=class{constructor(t={}){this._options=t,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,JE.sep),this.fsScandirSettings=new QE.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};cs.default=as});var $n=w(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.Settings=et.walkStream=et.walkSync=et.walk=void 0;var pd=sd(),ZE=ad(),ex=ld(),ls=ud();et.Settings=ls.default;function tx(e,t,r){if(typeof t=="function"){new pd.default(e,Pn()).read(t);return}new pd.default(e,Pn(t)).read(r)}et.walk=tx;function rx(e,t){let r=Pn(t);return new ex.default(e,r).read()}et.walkSync=rx;function nx(e,t){let r=Pn(t);return new ZE.default(e,r).read()}et.walkStream=nx;function Pn(e={}){return e instanceof ls.default?e:new ls.default(e)}});var Dn=w(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var ox=F("path"),ix=jt(),dd=at(),us=class{constructor(t){this._settings=t,this._fsStatSettings=new ix.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return ox.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:dd.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!dd.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};ps.default=us});var hs=w(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var sx=F("stream"),ax=jt(),cx=$n(),lx=Dn(),ds=class extends lx.default{constructor(){super(...arguments),this._walkStream=cx.walkStream,this._stat=ax.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new sx.PassThrough({objectMode:!0});o._write=(i,s,a)=>this._getEntry(n[i],t[i],r).then(c=>{c!==null&&r.entryFilter(c)&&o.push(c),i===n.length-1&&o.end(),a()}).catch(a);for(let i=0;i<n.length;i++)o.write(i);return o}_getEntry(t,r,n){return this._getStat(t).then(o=>this._makeEntry(o,r)).catch(o=>{if(n.errorFilter(o))return null;throw o})}_getStat(t){return new Promise((r,n)=>{this._stat(t,this._fsStatSettings,(o,i)=>o===null?r(i):n(o))})}};fs.default=ds});var fd=w(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var ux=$n(),px=Dn(),dx=hs(),ms=class extends px.default{constructor(){super(...arguments),this._walkAsync=ux.walk,this._readerStream=new dx.default(this._settings)}dynamic(t,r){return new Promise((n,o)=>{this._walkAsync(t,r,(i,s)=>{i===null?n(s):o(i)})})}async static(t,r){let n=[],o=this._readerStream.static(t,r);return new Promise((i,s)=>{o.once("error",s),o.on("data",a=>n.push(a)),o.once("end",()=>i(n))})}};gs.default=ms});var hd=w(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var Or=at(),ys=class{constructor(t,r,n){this._patterns=t,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let t of this._patterns){let r=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:t,segments:r,sections:n})}}_getPatternSegments(t){return Or.pattern.getPatternParts(t,this._micromatchOptions).map(n=>Or.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Or.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return Or.array.splitWhen(t,r=>r.dynamic&&Or.pattern.hasGlobStar(r.pattern))}};vs.default=ys});var md=w(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var fx=hd(),bs=class extends fx.default{match(t){let r=t.split("/"),n=r.length,o=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of o){let s=i.sections[0];if(!i.complete&&n>s.length||r.every((c,u)=>{let l=i.segments[u];return!!(l.dynamic&&l.patternRe.test(c)||!l.dynamic&&l.pattern===c)}))return!0}return!1}};_s.default=bs});var gd=w(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var Nn=at(),hx=md(),Es=class{constructor(t,r){this._settings=t,this._micromatchOptions=r}getFilter(t,r,n){let o=this._getMatcher(r),i=this._getNegativePatternsRe(n);return s=>this._filter(t,s,o,i)}_getMatcher(t){return new hx.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(Nn.pattern.isAffectDepthOfReadingPattern);return Nn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Nn.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,o)}_isSkippedByDeep(t,r){return this._settings.deep===1/0?!1:this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){let n=r.split("/").length;if(t==="")return n;let o=t.split("/").length;return n-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!Nn.pattern.matchAny(t,r)}};xs.default=Es});var yd=w(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});var Rt=at(),ks=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=Rt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:Rt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:Rt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:Rt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=Rt.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;let o=this._isMatchToPatternsSet(n,r,t.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(n),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,r,n){return!(!this._isMatchToPatterns(t,r.positive.all,n)||this._isMatchToPatterns(t,r.negative.relative,n)||this._isMatchToAbsoluteNegative(t,r.negative.absolute,n))}_isMatchToAbsoluteNegative(t,r,n){if(r.length===0)return!1;let o=Rt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=Rt.pattern.matchAny(t,r);return!o&&n?Rt.pattern.matchAny(t+"/",r):o}};ws.default=ks});var vd=w(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var mx=at(),Cs=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return mx.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};As.default=Cs});var _d=w(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});var bd=at(),Ss=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=bd.path.makeAbsolute(this._settings.cwd,r),r=bd.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};Rs.default=Ss});var Ln=w(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var gx=F("path"),yx=gd(),vx=yd(),bx=vd(),_x=_d(),Ts=class{constructor(t){this._settings=t,this.errorFilter=new bx.default(this._settings),this.entryFilter=new vx.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new yx.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new _x.default(this._settings)}_getRootDirectory(t){return gx.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){let r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};Os.default=Ts});var Ed=w($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var Ex=fd(),xx=Ln(),Ps=class extends xx.default{constructor(){super(...arguments),this._reader=new Ex.default(this._settings)}async read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(r,t,n)).map(i=>n.transform(i))}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};$s.default=Ps});var xd=w(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var kx=F("stream"),wx=hs(),Cx=Ln(),Ds=class extends Cx.default{constructor(){super(...arguments),this._reader=new wx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new kx.Readable({objectMode:!0,read:()=>{}});return o.once("error",s=>i.emit("error",s)).on("data",s=>i.emit("data",n.transform(s))).once("end",()=>i.emit("end")),i.once("close",()=>o.destroy()),i}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};Ns.default=Ds});var kd=w(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});var Ax=jt(),Sx=$n(),Rx=Dn(),Ls=class extends Rx.default{constructor(){super(...arguments),this._walkSync=Sx.walkSync,this._statSync=Ax.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){let n=[];for(let o of t){let i=this._getFullEntryPath(o),s=this._getEntry(i,o,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(t,r,n){try{let o=this._getStat(t);return this._makeEntry(o,r)}catch(o){if(n.errorFilter(o))return null;throw o}}_getStat(t){return this._statSync(t,this._fsStatSettings)}};Is.default=Ls});var wd=w(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var Tx=kd(),Ox=Ln(),Fs=class extends Ox.default{constructor(){super(...arguments),this._reader=new Tx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(r,t,n).map(n.transform)}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};js.default=Fs});var Cd=w(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var or=F("fs"),Px=F("os"),$x=Math.max(Px.cpus().length,1);ir.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:or.lstat,lstatSync:or.lstatSync,stat:or.stat,statSync:or.statSync,readdir:or.readdir,readdirSync:or.readdirSync};var Ms=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,$x),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===void 0?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},ir.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};ir.default=Ms});var In=w(($R,Sd)=>{"use strict";var Ad=Sp(),Dx=Ed(),Nx=xd(),Lx=wd(),Bs=Cd(),Ne=at();async function Hs(e,t){He(e);let r=Gs(e,Dx.default,t),n=await Promise.all(r);return Ne.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){He(u);let p=Gs(u,Lx.default,l);return Ne.array.flatten(p)}e.sync=t;function r(u,l){He(u);let p=Gs(u,Nx.default,l);return Ne.stream.merge(p)}e.stream=r;function n(u,l){He(u);let p=[].concat(u),d=new Bs.default(l);return Ad.generate(p,d)}e.generateTasks=n;function o(u,l){He(u);let p=new Bs.default(l);return Ne.pattern.isDynamicPattern(u,p)}e.isDynamicPattern=o;function i(u){return He(u),Ne.path.escape(u)}e.escapePath=i;function s(u){return He(u),Ne.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(d){return He(d),Ne.path.escapePosixPath(d)}u.escapePath=l;function p(d){return He(d),Ne.path.convertPosixPathToPattern(d)}u.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(u){function l(d){return He(d),Ne.path.escapeWindowsPath(d)}u.escapePath=l;function p(d){return He(d),Ne.path.convertWindowsPathToPattern(d)}u.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(Hs||(Hs={}));function Gs(e,t,r){let n=[].concat(e),o=new Bs.default(r),i=Ad.generate(n,o),s=new t(o);return i.map(s.read,s)}function He(e){if(![].concat(e).every(n=>Ne.string.isString(n)&&!Ne.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Sd.exports=Hs});var Rd=vt(()=>{});import{promisify as Ix}from"node:util";import{execFile as Fx,execFileSync as IR}from"node:child_process";import{fileURLToPath as jx}from"node:url";function Pr(e){return e instanceof URL?jx(e):e}var jR,MR,Vs=vt(()=>{Rd();jR=Ix(Fx);MR=10*1024*1024});var Fd=w((GR,Mn)=>{function Pd(e){return Array.isArray(e)?e:[e]}var Mx=void 0,Ws="",Td=" ",Us="\\",Bx=/^\s+$/,Hx=/(?:[^\\]|^)\\$/,Gx=/^\\!/,Vx=/^\\#/,Ux=/\r?\n/g,Wx=/^\.{0,2}\/|^\.{1,2}$/,qx=/\/$/,sr="/",$d="node-ignore";typeof Symbol<"u"&&($d=Symbol.for("node-ignore"));var Dd=$d,ar=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),Yx=/([0-z])-([0-z])/g,Nd=()=>!1,Kx=e=>e.replace(Yx,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Ws),zx=e=>{let{length:t}=e;return e.slice(0,t-t%2)},Xx=[[/^\uFEFF/,()=>Ws],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?Td:Ws)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+Td}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Us],[/\\\\/g,()=>Us],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===Us?`\\[${r}${zx(n)}${o}`:o==="]"&&n.length%2===0?`[${Kx(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],Jx=/(^|\\\/)?\\\*$/,$r="regex",Fn="checkRegex",Od="_",Qx={[$r](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Fn](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},Zx=e=>Xx.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),jn=e=>typeof e=="string",ek=e=>e&&jn(e)&&!Bx.test(e)&&!Hx.test(e)&&e.indexOf("#")!==0,tk=e=>e.split(Ux).filter(Boolean),qs=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,ar(this,"body",n),ar(this,"ignoreCase",o),ar(this,"regexPrefix",s)}get regex(){let t=Od+$r;return this[t]?this[t]:this._make($r,t)}get checkRegex(){let t=Od+Fn;return this[t]?this[t]:this._make(Fn,t)}_make(t,r){let n=this.regexPrefix.replace(Jx,Qx[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return ar(this,r,o)}},rk=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(Gx,"!").replace(Vx,"#");let i=Zx(o);return new qs(e,t,o,r,n,i)},Ys=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[Dd]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(jn(t)&&(t={pattern:t}),ek(t.pattern)){let r=rk(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Pd(jn(t)?tk(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:u}=c;i===u&&o!==i||u&&!o&&!i&&!r||!c[n].test(t)||(o=!u,i=u,s=u?Mx:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},nk=(e,t)=>{throw new t(e)},ct=(e,t,r)=>jn(e)?e?ct.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),Ld=e=>Wx.test(e);ct.isNotRelative=Ld;ct.convert=e=>e;var Ks=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){ar(this,Dd,!0),this._rules=new Ys(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,r,n,o){let i=t&&ct.convert(t);return ct(i,t,this._strictPathCheck?nk:Nd),this._t(i,r,n,o)}checkIgnore(t){if(!qx.test(t))return this.test(t);let r=t.split(sr).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(sr)+sr,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Fn)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(sr).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,$r);let i=this._t(o.join(sr)+sr,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,$r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Pd(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},zs=e=>new Ks(e),ok=e=>ct(e&&ct.convert(e),e,Nd),Id=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");ct.convert=e;let t=/^[a-z]:\//i;ct.isNotRelative=r=>t.test(r)||Ld(r)};typeof process<"u"&&process.platform==="win32"&&Id();Mn.exports=zs;zs.default=zs;Mn.exports.isPathValid=ok;ar(Mn.exports,Symbol.for("setupWindows"),Id)});import Xs from"node:path";function Dr(e,t){let r=Xs.relative(t,e);return!!(r&&r!==".."&&!r.startsWith(`..${Xs.sep}`)&&r!==Xs.resolve(e))}var Js=vt(()=>{});function Bn(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var jd=vt(()=>{});import Md from"node:fs";import Te from"node:path";import{promisify as ik}from"node:util";var Qs,Ge,sk,ak,Zs,Bd,Ae,Hn,ea,ck,Gn,lk,uk,Hd,ta,pk,dk,ra,fk,Gd,hk,Vd,na,oa=vt(()=>{Qs=Dt(In(),1);Js();Ge=e=>e[0]==="!",sk=e=>{if(!e.startsWith("/"))return e;let t=e.slice(1),r=t.indexOf("/"),n=r>0?t.slice(0,r):t;return r>0&&!Qs.default.isDynamicPattern(n)?e:t},ak=(e,t)=>t===e,Zs=e=>{if(!Te.isAbsolute(e))return;let t=[];for(let r of e.split("/"))if(r){if(Qs.default.isDynamicPattern(r))break;t.push(r)}return t.length===0?void 0:`/${t.join("/")}`},Bd=(e,t=[],r=!1)=>{if(!e.startsWith("/"))return e;let n=sk(e);if(n!==e)return n;if(r)return e.slice(1);let o=Zs(e);return o!==void 0&&t.some(s=>ak(s,o))?e:e.slice(1)},Ae=(e,t)=>{let r=e?.[t];return typeof r=="function"?r.bind(e):void 0},Hn=(e,t)=>{let r=e?.[t];if(typeof r=="function")return ik(r.bind(e))},ea=e=>{if(!e.endsWith("/"))return e;let t=e.replace(/\/+$/u,"");if(!t)return"/**";if(t==="**")return"**/**";let r=t.startsWith("/"),o=(r?t.slice(1):t).includes("/");return`${!r&&!o&&!t.startsWith("**/")?"**/":""}${t}/**`},ck=e=>{let r=(Ge(e)?e.slice(1):e).match(/^(\.\.\/)+/);return r?r[0]:""},Gn=(e,t)=>{if(e.length===0||t.length===0)return t;let r=e.map(i=>ck(i)),n=r[0];return!n||!r.every(i=>i===n)?t:t.map(i=>i.startsWith("**/")&&!i.startsWith("../")?n+i:i)},lk=e=>Ae(e?.promises,"stat")??Ae(Md.promises,"stat"),uk=e=>Ae(e||Md,"statSync"),Hd=e=>!!(e?.isDirectory?.()||e?.isFile?.()),ta=(e,t)=>{let r=[],n=e;for(r.push(n);n!==t;){let o=Te.dirname(n);if(o===n)break;n=o,r.push(n)}return r},pk=async(e,t)=>{for(let r of e){let n=Te.join(r,".git");try{let o=await t(n);if(Hd(o))return r}catch{}}},dk=(e,t)=>{let r=uk(t);if(!r)return;let n=Te.resolve(e),{root:o}=Te.parse(n),i=ta(n,o);for(let s of i){let a=Te.join(s,".git");try{let c=r(a);if(Hd(c))return s}catch{}}},ra=(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return dk(e,t)},fk=async(e,t)=>{let r=lk(t);if(!r)return ra(e,t);let n=Te.resolve(e),{root:o}=Te.parse(n),i=ta(n,o);return pk(i,r)},Gd=async(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return fk(e,t)},hk=(e,t)=>{let r=Te.resolve(e),n=Te.resolve(t);return n===r||Dr(n,r)},Vd=(e,t)=>{if(e&&typeof e!="string")throw new TypeError("gitRoot must be a string or undefined");if(typeof t!="string")throw new TypeError("cwd must be a string");return e?hk(e,t)?[...ta(Te.resolve(t),Te.resolve(e))].reverse().map(n=>Te.join(n,".gitignore")):[]:[]},na=(e,t,r)=>{if(t)return[];let n=[],o=!1;for(let i of e){if(Ge(i)){o=!0;break}n.push(r(i))}return o?[]:n}});import mk from"node:process";import gk from"node:fs";import yk from"node:fs/promises";import Oe from"node:path";var ia,Ud,vk,bk,Vn,_k,Ek,Wd,qd,xk,kk,wk,Ck,Yd,Ak,Kd,Un,Sk,Rk,Tk,Ok,zd,Xd,Jd,sa,aa,Pk,Qd,Zd,ef,tf,ca=vt(()=>{ia=Dt(In(),1),Ud=Dt(Fd(),1);Js();jd();Vs();oa();vk=["**/node_modules","**/flow-typed","**/coverage","**/.git"],bk={absolute:!0,dot:!0},Vn="**/.gitignore",_k=e=>Ae(e?.promises,"readFile")??Ae(yk,"readFile")??Hn(e,"readFile"),Ek=e=>Ae(e,"readFileSync")??Ae(gk,"readFileSync"),Wd=(e,t)=>e&&(e.code==="ENOENT"||e.code==="ENOTDIR")?!0:!!t,qd=(e,t)=>t instanceof Error?(t.message=`Failed to read ignore file at ${e}: ${t.message}`,t):new Error(`Failed to read ignore file at ${e}: ${String(t)}`),xk=(e,t,r)=>{try{let n=t(e,"utf8");return{filePath:e,content:n}}catch(n){if(Wd(n,r))return;throw qd(e,n)}},kk=async(e,t,r)=>(await Promise.all(e.map(async o=>{try{let i=await t(o,"utf8");return{filePath:o,content:i}}catch(i){if(Wd(i,r))return;throw qd(o,i)}}))).filter(Boolean),wk=(e,t,r)=>e.map(n=>xk(n,t,r)).filter(Boolean),Ck=e=>{let t=new Set;return e.filter(r=>t.has(r)?!1:(t.add(r),!0))},Yd=(e,t,r)=>e(t,{...r,...bk}),Ak=(e,t)=>e?Vd(e,t.cwd):[],Kd=(e,t,r)=>Ck([...Ak(e,t),...r]),Un=(e,t,r)=>{let n=r||t.cwd,o=Pk(e,n);return{patterns:o,predicate:Ok(o,t.cwd,n),usingGitRoot:!!(r&&r!==t.cwd)}},Sk=(e,t)=>{if(!t)return e;let r=Ge(e),n=r?e.slice(1):e,o=n.indexOf("/"),i=o!==-1&&o!==n.length-1,s;return i?n.startsWith("/")?s=Oe.posix.join(t,n.slice(1)):s=Oe.posix.join(t,n):s=Oe.posix.join(t,"**",n),r?"!"+s:s},Rk=(e,t)=>{let r=Bn(Oe.relative(t,Oe.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>Sk(n,r))},Tk=(e,t)=>{if(Oe.isAbsolute(e)){let r=Oe.relative(t,e);return r&&!Dr(e,t)?void 0:r}if(e.startsWith("./"))return e.slice(2);if(!e.startsWith("../"))return e},Ok=(e,t,r)=>{let n=(0,Ud.default)().add(e),o=Oe.normalize(Oe.resolve(t)),i=Oe.normalize(Oe.resolve(r));return s=>{if(s=Pr(s),Oe.normalize(Oe.resolve(s))===o)return!1;let c=Tk(s,i);return c===void 0?!1:c?n.ignores(Bn(c)):!1}},zd=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[],r=Pr(e.cwd)??mk.cwd(),n=typeof e.deep=="number"?Math.max(0,e.deep)+1:Number.POSITIVE_INFINITY;return{cwd:r,suppressErrors:e.suppressErrors??!1,deep:n,ignore:[...t,...vk],followSymbolicLinks:e.followSymbolicLinks??!0,concurrency:e.concurrency,throwErrorOnBrokenSymbolicLink:e.throwErrorOnBrokenSymbolicLink??!1,fs:e.fs}},Xd=async(e,t,r)=>{let n=zd(t),o=await Yd(ia.default,e,n),i=r?await Gd(n.cwd,n.fs):void 0,s=Kd(i,n,o),a=_k(n.fs);return{files:await kk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},Jd=(e,t,r)=>{let n=zd(t),o=Yd(ia.default.sync,e,n),i=r?ra(n.cwd,n.fs):void 0,s=Kd(i,n,o),a=Ek(n.fs);return{files:wk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},sa=async(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=await Xd(e,t,!1);return Un(r,n,o).predicate},aa=(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=Jd(e,t,!1);return Un(r,n,o).predicate},Pk=(e,t)=>e.flatMap(r=>Rk(r,t)),Qd=async(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=await Xd(e,t,r);return Un(n,o,i)},Zd=(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=Jd(e,t,r);return Un(n,o,i)},ef=e=>sa(Vn,e),tf=e=>aa(Vn,e)});var gf={};Kh(gf,{convertPathToPattern:()=>Wk,generateGlobTasks:()=>Vk,generateGlobTasksSync:()=>Uk,globby:()=>fa,globbyStream:()=>Hk,globbySync:()=>Bk,isDynamicPattern:()=>Gk,isGitIgnored:()=>ef,isGitIgnoredSync:()=>tf,isIgnoredByIgnoreFiles:()=>sa,isIgnoredByIgnoreFilesSync:()=>aa});import la from"node:process";import ua from"node:fs";import lt from"node:path";import{Readable as $k}from"node:stream";var cr,Dk,Nk,Lk,Ik,Fk,of,sf,Wn,rf,nf,pa,jk,af,cf,Yn,lf,Mk,uf,qn,pf,df,ff,hf,mf,da,fa,Bk,Hk,Gk,Vk,Uk,Wk,ha=vt(()=>{Il();cr=Dt(In(),1);Vs();ca();oa();ca();Dk=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},Nk=e=>Ae(e?.promises,"stat")??Ae(ua.promises,"stat")??Hn(e,"stat"),Lk=e=>Ae(e,"statSync")??Ae(ua,"statSync"),Ik=async(e,t)=>{try{return(await Nk(t)(e)).isDirectory()}catch{return!1}},Fk=(e,t)=>{try{return Lk(t)(e).isDirectory()}catch{return!1}},of=(e,t)=>{let r=Ge(e)?e.slice(1):e;return lt.isAbsolute(r)?r:lt.join(t,r)},sf=e=>{let t=e?.match(/\*\*\/([^/]+)$/);if(!t)return!1;let r=t[1],n=/[*?[\]{}]/.test(r),o=lt.extname(r)&&!r.startsWith(".");return!n&&!o},Wn=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>lt.posix.join(e,`**/${lt.extname(o)?o:`${o}${n}`}`)):[lt.posix.join(e,`**${n?`/*${n}`:""}`)]},rf=async(e,{cwd:t=la.cwd(),files:r,extensions:n,fs:o}={})=>(await Promise.all(e.map(async s=>{let a=Ge(s)?s.slice(1):s;if(sf(a))return Wn({directoryPath:s,files:r,extensions:n});let c=of(s,t);return await Ik(c,o)?Wn({directoryPath:s,files:r,extensions:n}):s}))).flat(),nf=(e,{cwd:t=la.cwd(),files:r,extensions:n,fs:o}={})=>e.flatMap(i=>{let s=Ge(i)?i.slice(1):i;if(sf(s))return Wn({directoryPath:i,files:r,extensions:n});let a=of(i,t);return Fk(a,o)?Wn({directoryPath:i,files:r,extensions:n}):i}),pa=e=>(e=[...new Set([e].flat())],Dk(e),e),jk=(e,t=ua)=>{if(!e||!t.statSync)return;let r;try{r=t.statSync(e)}catch{return}if(!r.isDirectory())throw new Error(`The \`cwd\` option must be a path to a directory, got: ${e}`)},af=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[];return e={...e,ignore:t,expandDirectories:e.expandDirectories??!0,cwd:Pr(e.cwd)},jk(e.cwd,e.fs),e},cf=e=>async(t,r)=>e(pa(t),af(r)),Yn=e=>(t,r)=>e(pa(t),af(r)),lf=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?pa(t):[];return r&&n.push(Vn),n},Mk=async e=>{let t=lf(e);if(t.length===0)return{options:e,filter:qn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=await Qd(t,e,r),s=na(n,i,ea);return{options:{...e,ignore:[...e.ignore,...s]},filter:qn(o,e.cwd)}},uf=e=>{let t=lf(e);if(t.length===0)return{options:e,filter:qn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=Zd(t,e,r),s=na(n,i,ea);return{options:{...e,ignore:[...e.ignore,...s]},filter:qn(o,e.cwd)}},qn=(e,t)=>{let r=new Set,n=t||la.cwd(),o=new Map;return i=>{let s=lt.normalize(i.path??i);if(r.has(s))return!1;if(e){let a=o.get(s);if(a===void 0&&(a=lt.isAbsolute(s)?s:lt.resolve(n,s),o.set(s,a),o.size>1e4&&o.clear()),e(a))return!1}return r.add(s),!0}},pf=(e,t)=>e.flat().filter(r=>t(r)),df=(e,t)=>{if(e.length>0&&e.every(s=>Ge(s))){if(t.expandNegationOnlyPatterns===!1)return[];e=["**/*",...e]}let r=[],n=!1,o=[];for(let s of e){if(Ge(s)){o.push(`!${Bd(s.slice(1),r,n)}`);continue}o.push(s);let a=Zs(s);if(a===void 0){n=!0;continue}r.push(a)}e=o;let i=[];for(;e.length>0;){let s=e.findIndex(c=>Ge(c));if(s===-1){i.push({patterns:e,options:t});break}let a=e[s].slice(1);for(let c of i)c.options.ignore.push(a);s!==0&&i.push({patterns:e.slice(0,s),options:{...t,ignore:[...t.ignore,a]}}),e=e.slice(s+1)}return i},ff=e=>e.map(t=>({patterns:t.patterns,options:{...t.options,ignore:Gn(t.patterns,t.options.ignore)}})),hf=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),mf=async(e,t)=>{let r=df(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return ff(r);let s={...hf(o,n),fs:i};return Promise.all(r.map(async a=>{let{patterns:c,options:u}=a;return[c,u.ignore]=await Promise.all([rf(c,s),rf(u.ignore,{cwd:n,fs:i})]),u.ignore=Gn(c,u.ignore),{patterns:c,options:u}}))},da=(e,t)=>{let r=df(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return ff(r);let s={...hf(o,n),fs:i};return r.map(a=>{let{patterns:c,options:u}=a;return c=nf(c,s),u.ignore=nf(u.ignore,{cwd:n,fs:i}),u.ignore=Gn(c,u.ignore),{patterns:c,options:u}})},fa=cf(async(e,t)=>{let{options:r,filter:n}=await Mk(t),o=await mf(e,r),i=await Promise.all(o.map(s=>(0,cr.default)(s.patterns,s.options)));return pf(i,n)}),Bk=Yn((e,t)=>{let{options:r,filter:n}=uf(t),i=da(e,r).map(s=>cr.default.sync(s.patterns,s.options));return pf(i,n)}),Hk=Yn((e,t)=>{let{options:r,filter:n}=uf(t),i=da(e,r).map(a=>cr.default.stream(a.patterns,a.options));return i.length===0?$k.from([]):ni(i).filter(a=>n(a))}),Gk=Yn((e,t)=>e.some(r=>cr.default.isDynamicPattern(r,t))),Vk=cf(mf),Uk=Yn(da),{convertPathToPattern:Wk}=cr.default});var Ye=["frontend","backend"],mo=["workbench.frontend","workbench.backend"],qr=[...Ye,...mo];var qa=(e=0)=>t=>`\x1B[${t+e}m`,Ya=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Ka=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},nA=Object.keys(ee.modifier),Xh=Object.keys(ee.color),Jh=Object.keys(ee.bgColor),oA=[...Xh,...Jh];function Qh(){let e=new Map;for(let[t,r]of Object.entries(ee)){for(let[n,o]of Object.entries(r))ee[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ee[n],e.set(o[0],o[1]);Object.defineProperty(ee,t,{value:r,enumerable:!1})}return Object.defineProperty(ee,"codes",{value:e,enumerable:!1}),ee.color.close="\x1B[39m",ee.bgColor.close="\x1B[49m",ee.color.ansi=qa(),ee.color.ansi256=Ya(),ee.color.ansi16m=Ka(),ee.bgColor.ansi=qa(10),ee.bgColor.ansi256=Ya(10),ee.bgColor.ansi16m=Ka(10),Object.defineProperties(ee,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>ee.rgbToAnsi256(...ee.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ee.ansi256ToAnsi(ee.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ee.ansi256ToAnsi(ee.hexToAnsi256(t)),enumerable:!1}}),ee}var Zh=Qh(),Me=Zh;import go from"node:process";import em from"node:os";import za from"node:tty";function Pe(e,t=globalThis.Deno?globalThis.Deno.args:go.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:te}=go,Yr;Pe("no-color")||Pe("no-colors")||Pe("color=false")||Pe("color=never")?Yr=0:(Pe("color")||Pe("colors")||Pe("color=true")||Pe("color=always"))&&(Yr=1);function tm(){if("FORCE_COLOR"in te)return te.FORCE_COLOR==="true"?1:te.FORCE_COLOR==="false"?0:te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(te.FORCE_COLOR,10),3)}function rm(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function nm(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=tm();n!==void 0&&(Yr=n);let o=r?Yr:n;if(o===0)return 0;if(r){if(Pe("color=16m")||Pe("color=full")||Pe("color=truecolor"))return 3;if(Pe("color=256"))return 2}if("TF_BUILD"in te&&"AGENT_NAME"in te)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(te.TERM==="dumb")return i;if(go.platform==="win32"){let s=em.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in te)||te.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if(te.COLORTERM==="truecolor"||te.TERM==="xterm-kitty"||te.TERM==="xterm-ghostty"||te.TERM==="wezterm")return 3;if("TERM_PROGRAM"in te){let s=Number.parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:i}function Xa(e,t={}){let r=nm(e,{streamIsTTY:e&&e.isTTY,...t});return rm(r)}var om={stdout:Xa({isTTY:za.isatty(1)}),stderr:Xa({isTTY:za.isatty(2)})},Ja=om;function Qa(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function Za(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
|
|
32
32
|
`:`
|
|
33
33
|
`)+r,o=n+1,n=e.indexOf(`
|
|
34
|
-
`,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:
|
|
35
|
-
`);return i!==-1&&(t=
|
|
34
|
+
`,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:ec,stderr:tc}=Ja,yo=Symbol("GENERATOR"),Wt=Symbol("STYLER"),mr=Symbol("IS_EMPTY"),rc=["ansi","ansi","ansi256","ansi16m"],qt=Object.create(null),im=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=ec?ec.level:0;e.level=t.level===void 0?r:t.level};var sm=e=>{let t=(...r)=>r.join(" ");return im(t,e),Object.setPrototypeOf(t,gr.prototype),t};function gr(e){return sm(e)}Object.setPrototypeOf(gr.prototype,Function.prototype);for(let[e,t]of Object.entries(Me))qt[e]={get(){let r=Kr(this,bo(t.open,t.close,this[Wt]),this[mr]);return Object.defineProperty(this,e,{value:r}),r}};qt.visible={get(){let e=Kr(this,this[Wt],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var vo=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Me[r].ansi16m(...n):t==="ansi256"?Me[r].ansi256(Me.rgbToAnsi256(...n)):Me[r].ansi(Me.rgbToAnsi(...n)):e==="hex"?vo("rgb",t,r,...Me.hexToRgb(...n)):Me[r][e](...n),am=["rgb","hex","ansi256"];for(let e of am){qt[e]={get(){let{level:r}=this;return function(...n){let o=bo(vo(e,rc[r],"color",...n),Me.color.close,this[Wt]);return Kr(this,o,this[mr])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);qt[t]={get(){let{level:r}=this;return function(...n){let o=bo(vo(e,rc[r],"bgColor",...n),Me.bgColor.close,this[Wt]);return Kr(this,o,this[mr])}}}}var cm=Object.defineProperties(()=>{},{...qt,level:{enumerable:!0,get(){return this[yo].level},set(e){this[yo].level=e}}}),bo=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},Kr=(e,t,r)=>{let n=(...o)=>lm(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,cm),n[yo]=e,n[Wt]=t,n[mr]=r,n},lm=(e,t)=>{if(e.level<=0||!t)return e[mr]?"":t;let r=e[Wt];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Qa(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
35
|
+
`);return i!==-1&&(t=Za(t,o,n,i)),n+t+o};Object.defineProperties(gr.prototype,qt);var um=gr(),hA=gr({level:tc?tc.level:0});var h=um;var mc=Dt(hc(),1),{program:kA,createCommand:wA,createArgument:CA,createOption:AA,CommanderError:SA,InvalidArgumentError:RA,InvalidOptionArgumentError:TA,Command:gc,Argument:OA,Option:PA,Help:$A}=mc.default;function U(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ke(e){return function t(r){return arguments.length===0||U(r)?t:e.apply(this,arguments)}}function ze(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return U(r)?t:Ke(function(o){return e(r,o)});default:return U(r)&&U(n)?t:U(r)?Ke(function(o){return e(o,n)}):U(n)?Ke(function(o){return e(r,o)}):e(r,n)}}}function vr(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return U(r)?t:ze(function(i,s){return e(r,i,s)});case 2:return U(r)&&U(n)?t:U(r)?ze(function(i,s){return e(i,n,s)}):U(n)?ze(function(i,s){return e(r,i,s)}):Ke(function(i){return e(r,n,i)});default:return U(r)&&U(n)&&U(o)?t:U(r)&&U(n)?ze(function(i,s){return e(i,s,o)}):U(r)&&U(o)?ze(function(i,s){return e(i,n,s)}):U(n)&&U(o)?ze(function(i,s){return e(r,i,s)}):U(r)?Ke(function(i){return e(i,n,o)}):U(n)?Ke(function(i){return e(r,i,o)}):U(o)?Ke(function(i){return e(r,n,i)}):e(r,n,o)}}}function Yt(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Qr(e){return Object.prototype.toString.call(e)==="[object Object]"}var Am=vr(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)Yt(i,r)&&(o[i]=Yt(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)Yt(i,n)&&!Yt(i,o)&&(o[i]=n[i]);return o}),yc=Am;var Sm=vr(function e(t,r,n){return yc(function(o,i,s){return Qr(i)&&Qr(s)?e(t,i,s):t(o,i,s)},r,n)}),vc=Sm;var Rm=ze(function(t,r){return vc(function(n,o,i){return i},t,r)}),bt=Rm;import Pt from"fs-extra";import $t from"path";import{fileURLToPath as ZC}from"url";function Nc(e){return typeof e>"u"||e===null}function Tm(e){return typeof e=="object"&&e!==null}function Om(e){return Array.isArray(e)?e:Nc(e)?[]:[e]}function Pm(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function $m(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Dm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Nm=Nc,Lm=Tm,Im=Om,Fm=$m,jm=Dm,Mm=Pm,le={isNothing:Nm,isObject:Lm,toArray:Im,repeat:Fm,isNegativeZero:jm,extend:Mm};function Lc(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
36
36
|
|
|
37
|
-
`+e.mark.snippet),n+" "+r):n}function _r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=
|
|
38
|
-
`+a;for(u=
|
|
37
|
+
`+e.mark.snippet),n+" "+r):n}function _r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Lc(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}_r.prototype=Object.create(Error.prototype);_r.prototype.constructor=_r;_r.prototype.toString=function(t){return this.name+": "+Lc(this,t)};var be=_r;function Fo(e,t,r,n,o){var i="",s="",a=Math.floor(o/2)-1;return n-t>a&&(i=" ... ",t=n-a+i.length),r-n>a&&(s=" ...",r=n+a-s.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+s,pos:n-t+i.length}}function jo(e,t){return le.repeat(" ",t-e.length)+e}function Bm(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],i,s=-1;i=r.exec(e.buffer);)o.push(i.index),n.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var a="",c,u,l=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+l+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)u=Fo(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),p),a=le.repeat(" ",t.indent)+jo((e.line-c+1).toString(),l)+" | "+u.str+`
|
|
38
|
+
`+a;for(u=Fo(e.buffer,n[s],o[s],e.position,p),a+=le.repeat(" ",t.indent)+jo((e.line+1).toString(),l)+" | "+u.str+`
|
|
39
39
|
`,a+=le.repeat("-",t.indent+l+3+u.pos)+`^
|
|
40
|
-
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=
|
|
41
|
-
`;return a.replace(/\n$/,"")}var
|
|
42
|
-
\r`;function
|
|
43
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function
|
|
44
|
-
`,t-1))}function
|
|
45
|
-
`,i?1+c:c):o===
|
|
46
|
-
`);break}for(n?
|
|
40
|
+
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=Fo(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),p),a+=le.repeat(" ",t.indent)+jo((e.line+c+1).toString(),l)+" | "+u.str+`
|
|
41
|
+
`;return a.replace(/\n$/,"")}var Hm=Bm,Gm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Vm=["scalar","sequence","mapping"];function Um(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Wm(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Gm.indexOf(r)===-1)throw new be('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Um(t.styleAliases||null),Vm.indexOf(this.kind)===-1)throw new be('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var fe=Wm;function bc(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(i,s){i.tag===n.tag&&i.kind===n.kind&&i.multi===n.multi&&(o=s)}),r[o]=n}),r}function qm(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function Bo(e){return this.extend(e)}Bo.prototype.extend=function(t){var r=[],n=[];if(t instanceof fe)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new be("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof fe))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new be("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new be("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(i){if(!(i instanceof fe))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(Bo.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=bc(o,"implicit"),o.compiledExplicit=bc(o,"explicit"),o.compiledTypeMap=qm(o.compiledImplicit,o.compiledExplicit),o};var Ic=Bo,Fc=new fe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),jc=new fe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Mc=new fe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Bc=new Ic({explicit:[Fc,jc,Mc]});function Ym(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Km(){return null}function zm(e){return e===null}var Hc=new fe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ym,construct:Km,predicate:zm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Xm(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Jm(e){return e==="true"||e==="True"||e==="TRUE"}function Qm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Gc=new fe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Xm,construct:Jm,predicate:Qm,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Zm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function eg(e){return 48<=e&&e<=55}function tg(e){return 48<=e&&e<=57}function rg(e){if(e===null)return!1;var t=e.length,r=0,n=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Zm(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!eg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!tg(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function ng(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function og(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!le.isNegativeZero(e)}var Vc=new fe("tag:yaml.org,2002:int",{kind:"scalar",resolve:rg,construct:ng,predicate:og,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ig=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sg(e){return!(e===null||!ig.test(e)||e[e.length-1]==="_")}function ag(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var cg=/^[-+]?[0-9]+e/;function lg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(le.isNegativeZero(e))return"-0.0";return r=e.toString(10),cg.test(r)?r.replace("e",".e"):r}function ug(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||le.isNegativeZero(e))}var Uc=new fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:sg,construct:ag,predicate:ug,represent:lg,defaultStyle:"lowercase"}),Wc=Bc.extend({implicit:[Hc,Gc,Vc,Uc]}),qc=Wc,Yc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Kc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function pg(e){return e===null?!1:Yc.exec(e)!==null||Kc.exec(e)!==null}function dg(e){var t,r,n,o,i,s,a,c=0,u=null,l,p,d;if(t=Yc.exec(e),t===null&&(t=Kc.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(i=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(l=+t[10],p=+(t[11]||0),u=(l*60+p)*6e4,t[9]==="-"&&(u=-u)),d=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&d.setTime(d.getTime()-u),d}function fg(e){return e.toISOString()}var zc=new fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:pg,construct:dg,instanceOf:Date,represent:fg});function hg(e){return e==="<<"||e===null}var Xc=new fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hg}),Wo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
42
|
+
\r`;function mg(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Wo;for(r=0;r<o;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function gg(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Wo,s=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|i.indexOf(n.charAt(t));return r=o%4*6,r===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):r===18?(a.push(s>>10&255),a.push(s>>2&255)):r===12&&a.push(s>>4&255),new Uint8Array(a)}function yg(e){var t="",r=0,n,o,i=e.length,s=Wo;for(n=0;n<i;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return o=i%3,o===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):o===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):o===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function vg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Jc=new fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:mg,construct:gg,predicate:vg,represent:yg}),bg=Object.prototype.hasOwnProperty,_g=Object.prototype.toString;function Eg(e){if(e===null)return!0;var t=[],r,n,o,i,s,a=e;for(r=0,n=a.length;r<n;r+=1){if(o=a[r],s=!1,_g.call(o)!=="[object Object]")return!1;for(i in o)if(bg.call(o,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function xg(e){return e!==null?e:[]}var Qc=new fe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Eg,construct:xg}),kg=Object.prototype.toString;function wg(e){if(e===null)return!0;var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],kg.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function Cg(e){if(e===null)return[];var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}var Zc=new fe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:wg,construct:Cg}),Ag=Object.prototype.hasOwnProperty;function Sg(e){if(e===null)return!0;var t,r=e;for(t in r)if(Ag.call(r,t)&&r[t]!==null)return!1;return!0}function Rg(e){return e!==null?e:{}}var el=new fe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Sg,construct:Rg}),qo=qc.extend({implicit:[zc,Xc],explicit:[Jc,Qc,Zc,el]}),Et=Object.prototype.hasOwnProperty,Zr=1,tl=2,rl=3,en=4,Mo=1,Tg=2,_c=3,Og=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pg=/[\x85\u2028\u2029]/,$g=/[,\[\]\{\}]/,nl=/^(?:!|!!|![a-z\-]+!)$/i,ol=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ec(e){return Object.prototype.toString.call(e)}function Xe(e){return e===10||e===13}function Lt(e){return e===9||e===32}function xe(e){return e===9||e===32||e===10||e===13}function zt(e){return e===44||e===91||e===93||e===123||e===125}function Dg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Ng(e){return e===120?2:e===117?4:e===85?8:0}function Lg(e){return 48<=e&&e<=57?e-48:-1}function xc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
43
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Ig(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function il(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var sl=new Array(256),al=new Array(256);for(Nt=0;Nt<256;Nt++)sl[Nt]=xc(Nt)?1:0,al[Nt]=xc(Nt);var Nt;function Fg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||qo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function cl(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Hm(r),new be(t,r)}function R(e,t){throw cl(e,t)}function tn(e,t){e.onWarning&&e.onWarning.call(null,cl(e,t))}var kc={YAML:function(t,r,n){var o,i,s;t.version!==null&&R(t,"duplication of %YAML directive"),n.length!==1&&R(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&R(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&R(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&tn(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&R(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],nl.test(o)||R(t,"ill-formed tag handle (first argument) of the TAG directive"),Et.call(t.tagMap,o)&&R(t,'there is a previously declared suffix for "'+o+'" tag handle'),ol.test(i)||R(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{R(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};function _t(e,t,r,n){var o,i,s,a;if(t<r){if(a=e.input.slice(t,r),n)for(o=0,i=a.length;o<i;o+=1)s=a.charCodeAt(o),s===9||32<=s&&s<=1114111||R(e,"expected valid JSON character");else Og.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function wc(e,t,r,n){var o,i,s,a;for(le.isObject(r)||R(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),s=0,a=o.length;s<a;s+=1)i=o[s],Et.call(t,i)||(il(t,i,r[i]),n[i]=!0)}function Xt(e,t,r,n,o,i,s,a,c){var u,l;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),u=0,l=o.length;u<l;u+=1)Array.isArray(o[u])&&R(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Ec(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&Ec(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(u=0,l=i.length;u<l;u+=1)wc(e,t,i[u],r);else wc(e,t,i,r);else!e.json&&!Et.call(r,o)&&Et.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,R(e,"duplicated mapping key")),il(t,o,i),delete r[o];return t}function Yo(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ie(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Lt(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Xe(o))for(Yo(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&tn(e,"deficient indentation"),n}function on(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||xe(r)))}function Ko(e,t){t===1?e.result+=" ":t>1&&(e.result+=le.repeat(`
|
|
44
|
+
`,t-1))}function jg(e,t,r){var n,o,i,s,a,c,u,l,p=e.kind,d=e.result,y;if(y=e.input.charCodeAt(e.position),xe(y)||zt(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(o=e.input.charCodeAt(e.position+1),xe(o)||r&&zt(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;y!==0;){if(y===58){if(o=e.input.charCodeAt(e.position+1),xe(o)||r&&zt(o))break}else if(y===35){if(n=e.input.charCodeAt(e.position-1),xe(n))break}else{if(e.position===e.lineStart&&on(e)||r&&zt(y))break;if(Xe(y))if(c=e.line,u=e.lineStart,l=e.lineIndent,ie(e,!1,-1),e.lineIndent>=t){a=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=l;break}}a&&(_t(e,i,s,!1),Ko(e,e.line-c),i=s=e.position,a=!1),Lt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return _t(e,i,s,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function Mg(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(_t(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else Xe(r)?(_t(e,n,o,!0),Ko(e,ie(e,!1,t)),n=o=e.position):e.position===e.lineStart&&on(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}function Bg(e,t){var r,n,o,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return _t(e,r,e.position,!0),e.position++,!0;if(a===92){if(_t(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Xe(a))ie(e,!1,t);else if(a<256&&sl[a])e.result+=al[a],e.position++;else if((s=Ng(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=Dg(a))>=0?i=(i<<4)+s:R(e,"expected hexadecimal character");e.result+=Ig(i),e.position++}else R(e,"unknown escape sequence");r=n=e.position}else Xe(a)?(_t(e,r,n,!0),Ko(e,ie(e,!1,t)),r=n=e.position):e.position===e.lineStart&&on(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}function Hg(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,l,p,d,y,m=Object.create(null),g,E,x,k;if(k=e.input.charCodeAt(e.position),k===91)l=93,y=!1,a=[];else if(k===123)l=125,y=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),k=e.input.charCodeAt(++e.position);k!==0;){if(ie(e,!0,t),k=e.input.charCodeAt(e.position),k===l)return e.position++,e.tag=s,e.anchor=c,e.kind=y?"mapping":"sequence",e.result=a,!0;r?k===44&&R(e,"expected the node content, but found ','"):R(e,"missed comma between flow collection entries"),E=g=x=null,p=d=!1,k===63&&(u=e.input.charCodeAt(e.position+1),xe(u)&&(p=d=!0,e.position++,ie(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,Jt(e,t,Zr,!1,!0),E=e.tag,g=e.result,ie(e,!0,t),k=e.input.charCodeAt(e.position),(d||e.line===n)&&k===58&&(p=!0,k=e.input.charCodeAt(++e.position),ie(e,!0,t),Jt(e,t,Zr,!1,!0),x=e.result),y?Xt(e,a,m,E,g,x,n,o,i):p?a.push(Xt(e,null,m,E,g,x,n,o,i)):a.push(g),ie(e,!0,t),k=e.input.charCodeAt(e.position),k===44?(r=!0,k=e.input.charCodeAt(++e.position)):r=!1}R(e,"unexpected end of the stream within a flow collection")}function Gg(e,t){var r,n,o=Mo,i=!1,s=!1,a=t,c=0,u=!1,l,p;if(p=e.input.charCodeAt(e.position),p===124)n=!1;else if(p===62)n=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Mo===o?o=p===43?_c:Tg:R(e,"repeat of a chomping mode identifier");else if((l=Lg(p))>=0)l===0?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?R(e,"repeat of an indentation width identifier"):(a=t+l-1,s=!0);else break;if(Lt(p)){do p=e.input.charCodeAt(++e.position);while(Lt(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Xe(p)&&p!==0)}for(;p!==0;){for(Yo(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Xe(p)){c++;continue}if(e.lineIndent<a){o===_c?e.result+=le.repeat(`
|
|
45
|
+
`,i?1+c:c):o===Mo&&i&&(e.result+=`
|
|
46
|
+
`);break}for(n?Lt(p)?(u=!0,e.result+=le.repeat(`
|
|
47
47
|
`,i?1+c:c)):u?(u=!1,e.result+=le.repeat(`
|
|
48
48
|
`,c+1)):c===0?i&&(e.result+=" "):e.result+=le.repeat(`
|
|
49
49
|
`,c):e.result+=le.repeat(`
|
|
50
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Xe(p)&&p!==0;)p=e.input.charCodeAt(++e.position);_t(e,r,e.position,!1)}return!0}function
|
|
51
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
50
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Xe(p)&&p!==0;)p=e.input.charCodeAt(++e.position);_t(e,r,e.position,!1)}return!0}function Cc(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!xe(s))));){if(a=!0,e.position++,ie(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Jt(e,t,rl,!1,!0),i.push(e.result),ie(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)R(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function Vg(e,t,r){var n,o,i,s,a,c,u=e.tag,l=e.anchor,p={},d=Object.create(null),y=null,m=null,g=null,E=!1,x=!1,k;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),k=e.input.charCodeAt(e.position);k!==0;){if(!E&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(k===63||k===58)&&xe(n))k===63?(E&&(Xt(e,p,d,y,m,null,s,a,c),y=m=g=null),x=!0,E=!0,o=!0):E?(E=!1,o=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,k=n;else{if(s=e.line,a=e.lineStart,c=e.position,!Jt(e,r,tl,!1,!0))break;if(e.line===i){for(k=e.input.charCodeAt(e.position);Lt(k);)k=e.input.charCodeAt(++e.position);if(k===58)k=e.input.charCodeAt(++e.position),xe(k)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Xt(e,p,d,y,m,null,s,a,c),y=m=g=null),x=!0,E=!1,o=!1,y=e.tag,m=e.result;else if(x)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=l,!0}else if(x)R(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=l,!0}if((e.line===i||e.lineIndent>t)&&(E&&(s=e.line,a=e.lineStart,c=e.position),Jt(e,t,en,!0,o)&&(E?m=e.result:g=e.result),E||(Xt(e,p,d,y,m,g,s,a,c),y=m=g=null),ie(e,!0,-1),k=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&k!==0)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return E&&Xt(e,p,d,y,m,null,s,a,c),x&&(e.tag=u,e.anchor=l,e.kind="mapping",e.result=p),x}function Ug(e){var t,r=!1,n=!1,o,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&R(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,o="!!",s=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!xe(s);)s===33&&(n?R(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),nl.test(o)||R(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),$g.test(i)&&R(e,"tag suffix cannot contain flow indicator characters")}i&&!ol.test(i)&&R(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{R(e,"tag name is malformed: "+i)}return r?e.tag=i:Et.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:R(e,'undeclared tag handle "'+o+'"'),!0}function Wg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&R(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!xe(r)&&!zt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function qg(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!xe(n)&&!zt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Et.call(e.anchorMap,r)||R(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ie(e,!0,-1),!0}function Jt(e,t,r,n,o){var i,s,a,c=1,u=!1,l=!1,p,d,y,m,g,E;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=en===r||rl===r,n&&ie(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Ug(e)||Wg(e);)ie(e,!0,-1)?(u=!0,a=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=u||o),(c===1||en===r)&&(Zr===r||tl===r?g=t:g=t+1,E=e.position-e.lineStart,c===1?a&&(Cc(e,E)||Vg(e,E,g))||Hg(e,g)?l=!0:(s&&Gg(e,g)||Mg(e,g)||Bg(e,g)?l=!0:qg(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):jg(e,g,Zr===r)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=a&&Cc(e,E))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,d=e.implicitTypes.length;p<d;p+=1)if(m=e.implicitTypes[p],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Et.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,y=e.typeMap.multi[e.kind||"fallback"],p=0,d=y.length;p<d;p+=1)if(e.tag.slice(0,y[p].tag.length)===y[p].tag){m=y[p];break}m||R(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function Yg(e){var t=e.position,r,n,o,i=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(ie(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(i=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!xe(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&R(e,"directive name must not be less than one character in length");s!==0;){for(;Lt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Xe(s));break}if(Xe(s))break;for(r=e.position;s!==0&&!xe(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&Yo(e),Et.call(kc,n)?kc[n](e,n,o):tn(e,'unknown document directive "'+n+'"')}if(ie(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ie(e,!0,-1)):i&&R(e,"directives end mark is expected"),Jt(e,e.lineIndent-1,en,!1,!0),ie(e,!0,-1),e.checkLineBreaks&&Pg.test(e.input.slice(t,e.position))&&tn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&on(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ie(e,!0,-1));return}if(e.position<e.length-1)R(e,"end of the stream or a document separator is expected");else return}function ll(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
51
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Fg(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,R(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Yg(r);return r.documents}function Kg(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=ll(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function zg(e,t){var r=ll(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new be("expected a single document in the stream, but found more")}}var Xg=Kg,Jg=zg,ul={loadAll:Xg,load:Jg},pl=Object.prototype.toString,dl=Object.prototype.hasOwnProperty,zo=65279,Qg=9,Er=10,Zg=13,ey=32,ty=33,ry=34,Ho=35,ny=37,oy=38,iy=39,sy=42,fl=44,ay=45,rn=58,cy=61,ly=62,uy=63,py=64,hl=91,ml=93,dy=96,gl=123,fy=124,yl=125,he={};he[0]="\\0";he[7]="\\a";he[8]="\\b";he[9]="\\t";he[10]="\\n";he[11]="\\v";he[12]="\\f";he[13]="\\r";he[27]="\\e";he[34]='\\"';he[92]="\\\\";he[133]="\\N";he[160]="\\_";he[8232]="\\L";he[8233]="\\P";var hy=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],my=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function gy(e,t){var r,n,o,i,s,a,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,i=n.length;o<i;o+=1)s=n[o],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&dl.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function yy(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new be("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+le.repeat("0",n-t.length)+t}var vy=1,xr=2;function by(e){this.schema=e.schema||qo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=le.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=gy(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?xr:vy,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ac(e,t){for(var r=le.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
52
52
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
53
|
-
`&&(i+=r),i+=s;return i}function
|
|
54
|
-
`+le.repeat(" ",e.indent*t)}function
|
|
53
|
+
`&&(i+=r),i+=s;return i}function Go(e,t){return`
|
|
54
|
+
`+le.repeat(" ",e.indent*t)}function _y(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function nn(e){return e===ey||e===Qg}function kr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==zo||65536<=e&&e<=1114111}function Sc(e){return kr(e)&&e!==zo&&e!==Zg&&e!==Er}function Rc(e,t,r){var n=Sc(e),o=n&&!nn(e);return(r?n:n&&e!==fl&&e!==hl&&e!==ml&&e!==gl&&e!==yl)&&e!==Ho&&!(t===rn&&!o)||Sc(t)&&!nn(t)&&e===Ho||t===rn&&o}function Ey(e){return kr(e)&&e!==zo&&!nn(e)&&e!==ay&&e!==uy&&e!==rn&&e!==fl&&e!==hl&&e!==ml&&e!==gl&&e!==yl&&e!==Ho&&e!==oy&&e!==sy&&e!==ty&&e!==fy&&e!==cy&&e!==ly&&e!==iy&&e!==ry&&e!==ny&&e!==py&&e!==dy}function xy(e){return!nn(e)&&e!==rn}function br(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function vl(e){var t=/^\n* /;return t.test(e)}var bl=1,Vo=2,_l=3,El=4,Kt=5;function ky(e,t,r,n,o,i,s,a){var c,u=0,l=null,p=!1,d=!1,y=n!==-1,m=-1,g=Ey(br(e,0))&&xy(br(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=br(e,c),!kr(u))return Kt;g=g&&Rc(u,l,a),l=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=br(e,c),u===Er)p=!0,y&&(d=d||c-m-1>n&&e[m+1]!==" ",m=c);else if(!kr(u))return Kt;g=g&&Rc(u,l,a),l=u}d=d||y&&c-m-1>n&&e[m+1]!==" "}return!p&&!d?g&&!s&&!o(e)?bl:i===xr?Kt:Vo:r>9&&vl(e)?Kt:s?i===xr?Kt:Vo:d?El:_l}function wy(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===xr?'""':"''";if(!e.noCompatMode&&(hy.indexOf(t)!==-1||my.test(t)))return e.quotingType===xr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=n||e.flowLevel>-1&&r>=e.flowLevel;function c(u){return _y(e,u)}switch(ky(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case bl:return t;case Vo:return"'"+t.replace(/'/g,"''")+"'";case _l:return"|"+Tc(t,e.indent)+Oc(Ac(t,i));case El:return">"+Tc(t,e.indent)+Oc(Ac(Cy(t,s),i));case Kt:return'"'+Ay(t)+'"';default:throw new be("impossible error: invalid scalar style")}})()}function Tc(e,t){var r=vl(e)?String(t):"",n=e[e.length-1]===`
|
|
55
55
|
`,o=n&&(e[e.length-2]===`
|
|
56
56
|
`||e===`
|
|
57
57
|
`),i=o?"+":n?"":"-";return r+i+`
|
|
58
|
-
`}function
|
|
59
|
-
`?e.slice(0,-1):e}function
|
|
60
|
-
`);return u=u!==-1?u:e.length,r.lastIndex=u,
|
|
58
|
+
`}function Oc(e){return e[e.length-1]===`
|
|
59
|
+
`?e.slice(0,-1):e}function Cy(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
|
|
60
|
+
`);return u=u!==-1?u:e.length,r.lastIndex=u,Pc(e.slice(0,u),t)})(),o=e[0]===`
|
|
61
61
|
`||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
|
|
62
|
-
`:"")+
|
|
62
|
+
`:"")+Pc(c,t),o=i}return n}function Pc(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,i,s=0,a=0,c="";n=r.exec(e);)a=n.index,a-o>t&&(i=s>o?s:a,c+=`
|
|
63
63
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
64
64
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
65
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function
|
|
66
|
-
`:""}var
|
|
67
|
-
`&&(l(),c="",u=0,r=!1);if(!
|
|
65
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function Ay(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=br(e,o),n=he[r],!n&&kr(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||yy(r);return t}function Sy(e,t,r){var n="",o=e.tag,i,s,a;for(i=0,s=r.length;i<s;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(ot(e,t,a,!1,!1)||typeof a>"u"&&ot(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function $c(e,t,r,n){var o="",i=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(ot(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&ot(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=Go(e,t)),e.dump&&Er===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function Ry(e,t,r){var n="",o=e.tag,i=Object.keys(r),s,a,c,u,l;for(s=0,a=i.length;s<a;s+=1)l="",n!==""&&(l+=", "),e.condenseFlow&&(l+='"'),c=i[s],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),ot(e,t,c,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ot(e,t,u,!1,!1)&&(l+=e.dump,n+=l));e.tag=o,e.dump="{"+n+"}"}function Ty(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,l,p,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new be("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=Go(e,t)),u=s[a],l=r[u],e.replacer&&(l=e.replacer.call(r,u,l)),ot(e,t+1,u,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Er===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=Go(e,t)),ot(e,t+1,l,!0,p)&&(e.dump&&Er===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function Dc(e,t,r){var n,o,i,s,a,c;for(o=r?e.explicitTypes:e.implicitTypes,i=0,s=o.length;i<s;i+=1)if(a=o[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(r?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,pl.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(dl.call(a.represent,c))n=a.represent[c](t,c);else throw new be("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function ot(e,t,r,n,o,i,s){e.tag=null,e.dump=r,Dc(e,r,!1)||Dc(e,r,!0);var a=pl.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var l=a==="[object Object]"||a==="[object Array]",p,d;if(l&&(p=e.duplicates.indexOf(r),d=p!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(o=!1),d&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(l&&d&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(Ty(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(Ry(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?$c(e,t-1,e.dump,o):$c(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(Sy(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&wy(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new be("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Oy(e,t){var r=[],n=[],o,i;for(Uo(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function Uo(e,t,r){var n,o,i;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)Uo(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)Uo(e[n[o]],t,r)}function Py(e,t){t=t||{};var r=new by(t);r.noRefs||Oy(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),ot(r,0,n,!0,!0)?r.dump+`
|
|
66
|
+
`:""}var $y=Py,Dy={dump:$y};function Xo(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Ny=fe,Ly=Ic,Iy=Bc,Fy=Wc,jy=qc,My=qo,By=ul.load,Hy=ul.loadAll,Gy=Dy.dump,Vy=be,Uy={binary:Jc,float:Uc,map:Mc,null:Hc,pairs:Zc,set:el,timestamp:zc,bool:Gc,int:Vc,merge:Xc,omap:Qc,seq:jc,str:Fc},Wy=Xo("safeLoad","load"),qy=Xo("safeLoadAll","loadAll"),Yy=Xo("safeDump","dump"),ke={Type:Ny,Schema:Ly,FAILSAFE_SCHEMA:Iy,JSON_SCHEMA:Fy,CORE_SCHEMA:jy,DEFAULT_SCHEMA:My,load:By,loadAll:Hy,dump:Gy,YAMLException:Vy,types:Uy,safeLoad:Wy,safeLoadAll:qy,safeDump:Yy};import Xn from"fs-extra";import Fr from"path";import{extname as pw,resolve as dw,join as fw}from"path";var Sf=Dt(Zo(),1);import hw from"chokidar";import{pathToFileURL as mw}from"url";import lr from"fs-extra";import Kn from"path";var ei=class{constructor(){this.level="info";this.verbose=!1}setLevel(t){this.level=t}setVerbose(t){this.verbose=t}shouldLog(t){let r={error:0,warn:1,info:2,debug:3};return t==="debug"&&this.verbose?!0:r[t]<=r[this.level]}getTypeStyle(t){switch(t){case"success":return h.green;case"error":return h.red;case"warning":return h.yellow;case"info":return h.blue;case"instruction":return h.cyan;case"progress":return h.reset;case"debug":return h.gray;case"raclette":return h.rgb(221,139,64);default:return r=>r}}getTypeIcon(t){switch(t){case"success":return"\u2705";case"error":return"\u274C";case"warning":return"\u26A0\uFE0F";case"info":return"\u2139\uFE0F ";case"instruction":return"\u{1F4A1}";case"progress":return"\u{1F504}";case"debug":return"";case"raclette":return"\u{1F9C0}";default:return""}}log(t,r,n){if(!this.shouldLog(t))return;let o=n?this.getTypeStyle(n):h.reset,i=n?this.getTypeIcon(n):"",s=i?`${i} `:"";console.log(o(`${s}${r}`))}logError(t,r){if(!this.shouldLog("error"))return;let n=this.getTypeStyle("error"),o=this.getTypeIcon("error"),i=o?`${o} `:"";r?console.error(n(`${i}${t}`),r):console.error(n(`${i}${t}`))}error(t,r){this.logError(t,r)}warn(t){this.log("warn",t,"warning")}info(t){this.log("info",t,"info")}debug(t){this.log("debug",t,"debug")}success(t){this.log("info",t,"success")}instruction(t){this.log("info",t,"instruction")}progress(t){this.log("info",t,"progress")}raclette(t){this.log("info",t,"raclette")}raw(t,r="info"){this.shouldLog(r)&&console.log(t)}},f=new ei;var yf=(e,t=["js","yaml","yml"])=>{for(let r of t){let n=e+"."+r;if(lr.existsSync(n))return n}throw new Error(`Could not find any of ${e+"{"+t.join(",")+"}"}`)},vf=async(e=process.cwd())=>{let t=Kn.join(e,".raclette");return await lr.ensureDir(t),t},Nr=(e=process.cwd())=>{let t=Rl().name,n=(e.includes("node_modules")?[[e.match(/(.*node_modules)/)?.[1]||"",t],[e,"node_modules",t],[e,"../../..",t]]:[[e,"node_modules",t],[e,"../..","raclette"],[e,"../..",t],[e,"../..","core"],[e,"..","raclette"],[e,"..",t],[e,"..","core"]]).map(i=>Kn.resolve(...i,"package.json")).find(i=>lr.readJsonSync(i,{throws:!1})?.name===t);if(n)return n.slice(0,-12);let o="Could not determine core package path to set up VFS. Canceling...";throw f.error(o),new Error(o)},bf=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(ha(),gf));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},_f=async(e,t)=>await lr.pathExists(e)?(await lr.ensureDir(Kn.dirname(t)),await lr.copy(e,t),f.debug(`\u2705 Copied ${Kn.basename(e)} to ${t}`),!0):(f.warn(chalk.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);import wf from"fs-extra";import Mt from"path";var qk=Object.prototype.toString,pr=Array.isArray||function(t){return qk.call(t)==="[object Array]"};function ga(e){return typeof e=="function"}function Yk(e){return pr(e)?"array":typeof e}function ma(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ef(e,t){return e!=null&&typeof e=="object"&&t in e}function Kk(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var zk=RegExp.prototype.test;function Xk(e,t){return zk.call(e,t)}var Jk=/\S/;function Qk(e){return!Xk(Jk,e)}var Zk={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function ew(e){return String(e).replace(/[&<>"'`=\/]/g,function(r){return Zk[r]})}var tw=/\s*/,rw=/\s+/,xf=/\s*=/,nw=/\s*\}/,ow=/#|\^|\/|>|\{|&|=|!/;function iw(e,t){if(!e)return[];var r=!1,n=[],o=[],i=[],s=!1,a=!1,c="",u=0;function l(){if(s&&!a)for(;i.length;)delete o[i.pop()];else i=[];s=!1,a=!1}var p,d,y;function m(C){if(typeof C=="string"&&(C=C.split(rw,2)),!pr(C)||C.length!==2)throw new Error("Invalid tags: "+C);p=new RegExp(ma(C[0])+"\\s*"),d=new RegExp("\\s*"+ma(C[1])),y=new RegExp("\\s*"+ma("}"+C[1]))}m(t||Le.tags);for(var g=new Ir(e),E,x,k,O,re,q;!g.eos();){if(E=g.pos,k=g.scanUntil(p),k)for(var $=0,I=k.length;$<I;++$)O=k.charAt($),Qk(O)?(i.push(o.length),c+=O):(a=!0,r=!0,c+=" "),o.push(["text",O,E,E+1]),E+=1,O===`
|
|
67
|
+
`&&(l(),c="",u=0,r=!1);if(!g.scan(p))break;if(s=!0,x=g.scan(ow)||"name",g.scan(tw),x==="="?(k=g.scanUntil(xf),g.scan(xf),g.scanUntil(d)):x==="{"?(k=g.scanUntil(y),g.scan(nw),g.scanUntil(d),x="&"):k=g.scanUntil(d),!g.scan(d))throw new Error("Unclosed tag at "+g.pos);if(x==">"?re=[x,k,E,g.pos,c,u,r]:re=[x,k,E,g.pos],u++,o.push(re),x==="#"||x==="^")n.push(re);else if(x==="/"){if(q=n.pop(),!q)throw new Error('Unopened section "'+k+'" at '+E);if(q[1]!==k)throw new Error('Unclosed section "'+q[1]+'" at '+E)}else x==="name"||x==="{"||x==="&"?a=!0:x==="="&&m(k)}if(l(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+g.pos);return aw(sw(o))}function sw(e){for(var t=[],r,n,o=0,i=e.length;o<i;++o)r=e[o],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(t.push(r),n=r));return t}function aw(e){for(var t=[],r=t,n=[],o,i,s=0,a=e.length;s<a;++s)switch(o=e[s],o[0]){case"#":case"^":r.push(o),n.push(o),r=o[4]=[];break;case"/":i=n.pop(),i[5]=o[2],r=n.length>0?n[n.length-1][4]:t;break;default:r.push(o)}return t}function Ir(e){this.string=e,this.tail=e,this.pos=0}Ir.prototype.eos=function(){return this.tail===""};Ir.prototype.scan=function(t){var r=this.tail.match(t);if(!r||r.index!==0)return"";var n=r[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};Ir.prototype.scanUntil=function(t){var r=this.tail.search(t),n;switch(r){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=n.length,n};function ur(e,t){this.view=e,this.cache={".":this.view},this.parent=t}ur.prototype.push=function(t){return new ur(t,this)};ur.prototype.lookup=function(t){var r=this.cache,n;if(r.hasOwnProperty(t))n=r[t];else{for(var o=this,i,s,a,c=!1;o;){if(t.indexOf(".")>0)for(i=o.view,s=t.split("."),a=0;i!=null&&a<s.length;)a===s.length-1&&(c=Ef(i,s[a])||Kk(i,s[a])),i=i[s[a++]];else i=o.view[t],c=Ef(o.view,t);if(c){n=i;break}o=o.parent}r[t]=n}return ga(n)&&(n=n.call(this.view)),n};function _e(){this.templateCache={_cache:{},set:function(t,r){this._cache[t]=r},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}_e.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};_e.prototype.parse=function(t,r){var n=this.templateCache,o=t+":"+(r||Le.tags).join(":"),i=typeof n<"u",s=i?n.get(o):void 0;return s==null&&(s=iw(t,r),i&&n.set(o,s)),s};_e.prototype.render=function(t,r,n,o){var i=this.getConfigTags(o),s=this.parse(t,i),a=r instanceof ur?r:new ur(r,void 0);return this.renderTokens(s,a,n,t,o)};_e.prototype.renderTokens=function(t,r,n,o,i){for(var s="",a,c,u,l=0,p=t.length;l<p;++l)u=void 0,a=t[l],c=a[0],c==="#"?u=this.renderSection(a,r,n,o,i):c==="^"?u=this.renderInverted(a,r,n,o,i):c===">"?u=this.renderPartial(a,r,n,i):c==="&"?u=this.unescapedValue(a,r):c==="name"?u=this.escapedValue(a,r,i):c==="text"&&(u=this.rawValue(a)),u!==void 0&&(s+=u);return s};_e.prototype.renderSection=function(t,r,n,o,i){var s=this,a="",c=r.lookup(t[1]);function u(d){return s.render(d,r,n,i)}if(c){if(pr(c))for(var l=0,p=c.length;l<p;++l)a+=this.renderTokens(t[4],r.push(c[l]),n,o,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")a+=this.renderTokens(t[4],r.push(c),n,o,i);else if(ga(c)){if(typeof o!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(r.view,o.slice(t[3],t[5]),u),c!=null&&(a+=c)}else a+=this.renderTokens(t[4],r,n,o,i);return a}};_e.prototype.renderInverted=function(t,r,n,o,i){var s=r.lookup(t[1]);if(!s||pr(s)&&s.length===0)return this.renderTokens(t[4],r,n,o,i)};_e.prototype.indentPartial=function(t,r,n){for(var o=r.replace(/[^ \t]/g,""),i=t.split(`
|
|
68
68
|
`),s=0;s<i.length;s++)i[s].length&&(s>0||!n)&&(i[s]=o+i[s]);return i.join(`
|
|
69
|
-
`)};_e.prototype.renderPartial=function(t,r,n,o){if(n){var i=this.getConfigTags(o),s=
|
|
69
|
+
`)};_e.prototype.renderPartial=function(t,r,n,o){if(n){var i=this.getConfigTags(o),s=ga(n)?n(t[1]):n[t[1]];if(s!=null){var a=t[6],c=t[5],u=t[4],l=s;c==0&&u&&(l=this.indentPartial(s,u,a));var p=this.parse(l,i);return this.renderTokens(p,r,n,l,o)}}};_e.prototype.unescapedValue=function(t,r){var n=r.lookup(t[1]);if(n!=null)return n};_e.prototype.escapedValue=function(t,r,n){var o=this.getConfigEscape(n)||Le.escape,i=r.lookup(t[1]);if(i!=null)return typeof i=="number"&&o===Le.escape?String(i):o(i)};_e.prototype.rawValue=function(t){return t[1]};_e.prototype.getConfigTags=function(t){return pr(t)?t:t&&typeof t=="object"?t.tags:void 0};_e.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!pr(t))return t.escape};var Le={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){Lr.templateCache=e},get templateCache(){return Lr.templateCache}},Lr=new _e;Le.clearCache=function(){return Lr.clearCache()};Le.parse=function(t,r){return Lr.parse(t,r)};Le.render=function(t,r,n,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Yk(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Lr.render(t,r,n,o)};Le.escape=ew;Le.Scanner=Ir;Le.Context=ur;Le.Writer=_e;var kf=Le;import{fileURLToPath as cw}from"url";var ya=class extends Error{constructor(t,r=void 0){super(t+(r?": "+r.message:"")),this.name="BuildError"}},lw={yaml:{entry:e=>Object.entries(e).map(t=>t[0]+": "+JSON.stringify(t[1]))},js:{}},Cf=(e,t,r=null)=>{let n=uw(e);try{let o=kf.render(wf.readFileSync(n,"utf-8"),{...t,...lw.yaml});return r&&wf.writeFileSync(Mt.resolve(r,e),o,"utf8"),o}catch(o){throw new ya(`Could not process "${n}"`,o)}},zn=()=>Mt.resolve(Mt.dirname(cw(import.meta.url)),"../package.json"),Af=()=>Mt.resolve(Mt.dirname(zn())),uw=e=>Mt.resolve(Mt.dirname(zn()),"templates",e);var gw=["js","mjs","ts","yaml","yml"],Rf=async()=>{function e(r){if(typeof r=="string"){if(r==="true")return!0;if(r==="false")return!1;if(/^\d+$/.test(r)){let n=Number(r);if(!isNaN(n))return n}if(/^\d+\.\d+$/.test(r)){let n=Number(r);if(!isNaN(n))return n}return r}if(Array.isArray(r))return r.map(n=>e(n));if(r&&typeof r=="object"){let n={};for(let[o,i]of Object.entries(r))n[o]=e(i);return n}return r}let t=(0,Sf.config)({path:fw(process.cwd(),".env")}).parsed;return e(t)},yw=Fr.join(Fr.dirname(zn()),"raclette.default.config.yaml"),Bt=async(e=yw,t={})=>{let n={env:{[process.env?.environment||"development"]:t}},o=dw(e),i;try{switch(pw(e)){case".*":let s=e.slice(0,-1);i=await Bt(s+gw.find(a=>Xn.existsSync(s+a)));break;case".yaml":case".yml":i=ke.load(Xn.readFileSync(o,"utf8"),{filename:e});break;case".ts":case".mjs":case".js":i=(await import(`${mw(o).href}?t=${Date.now()}`)).default;break;default:throw new TypeError(`config.load() does not support ${e} file extension.`)}}catch(s){throw new Error(`Failed to load config ${o}: ${s?.message}`)}return bt(i,n)},Tf=(e="null")=>{try{return ke.load(e)}catch(t){throw new Error(`Failed to parse config: ${t?.message}`)}},va=(...e)=>{let t=e[0];for(let r of e.slice(1))t=bt(t,r);return t},ba=async(e,t)=>{f.debug("Generating service configuration files...");let r={name:e.name,env:e.env,modules:e.modules,plugins:e.plugins,global:e.global};for(let n of Ye){let o=Fr.join(t,n);Xn.ensureDirSync(o);let i={...r,service:n,...e[n]},s=`// Generated Raclette ${n} Configuration
|
|
70
70
|
// This file is auto-generated, do not edit directly
|
|
71
71
|
|
|
72
72
|
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
73
73
|
|
|
74
74
|
export default racletteConfig;
|
|
75
|
-
`;
|
|
76
|
-
`)[0]:e=ut("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return ut(`"${e}" --version`,{stdio:"pipe"}),e}catch{throw new Error(`Docker found at ${e} but not executable`)}}catch{let t=["/Applications/Docker.app/Contents/Resources/bin/docker","/usr/local/bin/docker","C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe","C:\\Program Files\\Docker\\Docker\\resources\\docker.exe","/usr/bin/docker","/snap/docker/current/bin/docker"];for(let r of t)if(
|
|
75
|
+
`;Xn.writeFileSync(Fr.join(o,"raclette.config.js"),s)}},Of=(e,t)=>{let r=yf(Fr.join(e,"raclette.config"));f.progress(`\u{1F50D} Watching for changes in original config: ${r}`);let n=hw.watch(r,{ignored:/(^|[/\\])\../,persistent:!0});return n.on("change",async o=>{f.progress(`\u{1F4DD} Original config file changed: ${o}`);try{await Bt(r,t)}catch(i){f.error("Error reloading configuration: "+i.message)}}),()=>n.close()};import{spawn as Ia}from"child_process";import Ot,{pathExists as Zw}from"fs-extra";import Ie from"path";import Br from"fs-extra";import Gt from"path";import{execSync as ut}from"child_process";import bw from"fs-extra";var Jn=null,_a=()=>{if(Jn)return Jn;let e=_w(),t=Ew(e),r=e,n=!0,o=xw(t);return Jn={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},Jn};var _w=()=>{try{let e;process.platform==="win32"?e=ut("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
|
|
76
|
+
`)[0]:e=ut("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return ut(`"${e}" --version`,{stdio:"pipe"}),e}catch{throw new Error(`Docker found at ${e} but not executable`)}}catch{let t=["/Applications/Docker.app/Contents/Resources/bin/docker","/usr/local/bin/docker","C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe","C:\\Program Files\\Docker\\Docker\\resources\\docker.exe","/usr/bin/docker","/snap/docker/current/bin/docker"];for(let r of t)if(bw.existsSync(r))try{return ut(`"${r}" --version`,{stdio:"pipe"}),f.debug(h.yellow(`Found Docker at: ${r}`)),r}catch{}throw new Error("Docker not found in PATH or common installation locations")}},Ew=e=>{try{return ut(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(h.yellow("Could not determine Docker version")),"unknown"}},xw=e=>{let t=e.match(/Docker version (\d+)\.(\d+)/);if(!t)return!1;let r=parseInt(t[1]),n=parseInt(t[2]);return r>28||r===28&&n>=0},Qn=()=>{f.raw(h.blue("\u{1F433} Checking Docker installation..."));try{let e=_a();f.debug(`\u2705 Docker found at: ${e.dockerPath}`),f.debug(`Docker version: ${e.version}`);try{ut(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),f.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(h.red(`
|
|
77
77
|
\u274C Modern Docker Compose is not available`)),console.warn(h.yellow(`
|
|
78
78
|
\u{1F4CB} Raclette requires Docker with integrated 'compose' command`)),console.warn(h.yellow("Please update to Docker version 20.10.13+ or Docker Desktop 4.1.0+")),new Error("Modern Docker Compose is required")}e.isDocker28Plus&&f.debug("\u26A0\uFE0F Detected Docker 28+, using enhanced path resolution");try{ut(`"${e.dockerPath}" info`,{stdio:"pipe",encoding:"utf8"}),f.success(" Docker daemon is running")}catch{throw f.error("Docker daemon is not running"),f.warn("Please start Docker Desktop or the Docker daemon and try again."),process.platform==="darwin"?console.log(h.yellow(`
|
|
79
79
|
macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(h.yellow(`
|
|
80
80
|
Windows: Start Docker Desktop from the Start menu`)):console.log(h.yellow(`
|
|
81
81
|
Linux: Start Docker daemon with "systemctl start docker"`)),new Error("Docker daemon is not running")}return e}catch(e){throw e.message.includes("Docker daemon is not running")||e.message.includes("Modern Docker Compose is required")?e:(f.error("Docker installation issue: "+e.message),console.log(h.yellow(`
|
|
82
|
-
\u{1F4E5} Installation guide:`)),console.log(h.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(h.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(h.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},pe=(e,t={})=>{let n=`"${
|
|
83
|
-
Error: ${o.message}`)}},Ee=(e,t={})=>{let n=`"${
|
|
82
|
+
\u{1F4E5} Installation guide:`)),console.log(h.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(h.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(h.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},pe=(e,t={})=>{let n=`"${_a().dockerPath}" ${e.join(" ")}`;try{let o=ut(n,{...t,stdio:t.stdio||"pipe",encoding:t.stdio==="inherit"?void 0:t.encoding||"utf8",shell:!0});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker command failed: ${n}
|
|
83
|
+
Error: ${o.message}`)}},Ee=(e,t={})=>{let n=`"${_a().composeCommand}" compose ${e.join(" ")}`;f.debug(`Execute Docker Command: ${n}`);try{let o=ut(n,{stdio:"pipe",encoding:"utf8",shell:!0,...t});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker Compose command failed: ${n}
|
|
84
84
|
Error: ${o.message}`)}},jr=e=>{try{return pe(["ps","-a","--filter",`name=^${e}$`,"--format",'"{{.Names}}"']).trim().split(`
|
|
85
85
|
`).some(r=>r.trim()===e)}catch{return!1}},dr=e=>{try{return pe(["ps","--filter",`name=^${e}$`,"--format",'"{{.Names}}"']).trim().split(`
|
|
86
|
-
`).some(r=>r.trim()===e)}catch{return!1}},
|
|
87
|
-
`).filter(r=>r.trim().length>0):[]}catch{return[]}},Rf=e=>{let t=mw(e);if(t.length===0){f.debug(`\u26A0\uFE0F No containers found with prefix '${e}'`);return}f.debug(`\u26A0\uFE0F Found ${t.length} container(s) with prefix '${e}':`),t.forEach(r=>{f.debug(` - ${r}`)});try{f.debug("Stopping containers..."),pe(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),pe(["rm",...t],{stdio:"inherit"}),f.success(`Successfully stopped and removed ${t.length} container(s)`)}catch(r){throw f.error(`Failed to stop containers with prefix '${e}': ${r.message}`),r}};var gw="raclette-public-shared",tt={mongodb:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20},cache:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3},backend:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},hr=e=>({test:["CMD","curl","-f",`http://0.0.0.0:${e}/`],interval:"10s",timeout:"30s",retries:10}),yw=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),_a=(e,t)=>Bt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Bt.resolve(t,e):Bt.resolve(t,e),Zn=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Zn(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=_a(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=yw(o):o&&typeof o=="object"?r[n]=Zn(o,t):r[n]=o;return r},Tt=(e,t)=>{let r=Zn(e,t);if(r.source&&r.source.includes("/")&&(r.source=_a(r.source,t)),r.mustExist&&!Mr.existsSync(r.source))return f.debug(`Skipping volume mount: ${r.source} does not exist`),null;if(!r.type&&!r.readonly&&!r.volumeOptions&&!r.bindOptions&&!r.tmpfsOptions)return`${r.source}:${r.target}${r.readonly?":ro":""}`;let n={type:r.type||"volume",source:r.source,target:r.target};return r.readonly&&(n.read_only=!0),r.volumeOptions&&(n.volume=r.volumeOptions),r.bindOptions&&(n.bind=r.bindOptions),r.tmpfsOptions&&(n.tmpfs=r.tmpfsOptions),n},vw=(e,t)=>{if(!e.includes("/")||e.startsWith("${"))return e;let r=e.split(":");if(r.length<2)return e;let n=r[0],o=r[1],i=r.slice(2).join(":"),s=_a(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},eo=(e,t)=>e.map(r=>typeof r=="string"?vw(r,t):r).map(r=>r),Ea=async(e,t,r,n=!1,o="development",i=!0,s=!0)=>{let a={services:{},volumes:{"yarn-cache":{driver:"local"}},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},c=e.env[o]||{};a.volumes[gw]=null,e.volumes&&Object.entries(e.volumes).forEach(([p,d])=>{d===null?a.volumes[p]=null:a.volumes[p]=Zn(d,t)});let u=!1,l=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let p=e.services.mongodb.name;jr(p)&&(f.debug(`MongoDB container '${p}' already exists, will be skipped`),u=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let p=e.services.cache.name;jr(p)&&(f.debug(`Cache container '${p}' already exists, will be skipped`),l=!0)}}if(e.services.mongodb?.enabled&&!u){let d=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,y=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,g=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${d}}`,image:"mongo:8.2",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${y}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${g}}:/data/config`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},e.services.mongodb.volumes&&e.services.mongodb.volumes.length>0&&e.services.mongodb.volumes.forEach(m=>{let E=Tt(m,t);E&&a.services.mongodb.volumes.push(E)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=null),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(e.services.cache?.enabled&&!l){let d=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,y=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${d}}`,image:"valkey/valkey:9.0-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${y}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let g=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",m=e?.backend?.cache?.persistence||"none";m==="none"&&(a.services.cache.command='valkey-server --save ""'),m==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),m==="rdb"&&(a.services.cache.command="valkey-server --save "+g),m==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+g),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(E=>{let x=Tt(E,t);x&&a.services.cache.volumes.push(x)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=null)}if(!n){let p=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let d=e.services.backend.name??`${e.name}-backend`,y=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${d}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:p?"yarn run dev:inspect":"yarn dev",environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${RACLETTE_SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}","RACLETTE_FRONTEND_URLS=${RACLETTE_FRONTEND_URLS:-}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://mongodb:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb?.port||27017}}/\${RACLETTE_MONGODB_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-redis://cache:\${RACLETTE_CACHE_PORT:-${e.services.cache?.port||6379}}}${e.services.cache?.db?`/${e.services.cache?.db}`:""}`,...Object.entries(c).map(([g,m])=>`${g}=${m}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${y}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${fr("backend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...p?[`${p||"9229"}:9229`]:[]],networks:["raclette_shared"],depends_on:{},healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},e.services.backend.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(g=>{let m=Tt(g,t);m&&a.services.backend.volumes.push(m)}),e.services.mongodb?.enabled&&!u&&(a.services.backend.depends_on.mongodb={condition:"service_started"}),e.services.cache?.enabled&&!l&&(a.services.backend.depends_on.cache={condition:"service_healthy"}),Object.keys(a.services.backend.depends_on).length===0&&delete a.services.backend.depends_on,a.volumes[y]=null}if(e.services.frontend?.enabled){let d=e.services.frontend.name??`${e.name}-frontend`,y=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,g=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${d}}`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:`\${NODE_ENV:-${o}}`},target:`\${NODE_ENV:-${o}}`},command:"yarn dev",depends_on:{},environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-true}",`RACLETTE_SERVER_BASE_URL=\${RACLETTE_SERVER_BASE_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,`RACLETTE_SOCKET_URL=\${RACLETTE_SOCKET_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,...Object.entries(c).map(([m,E])=>`${m}=${E}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${y}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins",...o==="development"?["./.raclette/frontend/raclette.config.js:/app/raclette.config.js",`${fr("frontend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_CLIENT_PORT:-${e.services.frontend.port}}:8081`],networks:["raclette_shared"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:8081/"],interval:"10s",timeout:"30s",retries:10}},o!=="production"&&(a.services.frontend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.frontend.volumes.push("./.raclette/frontend/package.json:/app/package.json"),a.services.frontend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.backend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/backend/package.json:/app/package.json")),e.services.frontend.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(m=>{let E=Tt(m,t);E&&a.services.frontend.volumes.push(E)}),e.services.backend?.enabled&&(a.services.frontend.depends_on.backend={condition:"service_healthy"}),Object.keys(a.services.frontend.depends_on).length===0&&delete a.services.frontend.depends_on,a.volumes[y]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let d=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,y=d&&!d.endsWith("/")?d+"/":d;a.services.backend?.volumes?.push(`${y}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${y}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(p=>{p.volumes&&(p.volumes=eo(p.volumes,t))}),await Mr.writeFile(r,ke.dump(a)),await to(e,Bt.dirname(r),o)},fr=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Tf=async(e,t,r,n="development")=>{await Ea(e,t,r,!1,n,!1,!1)},bw=`# Service images use Yarn 1 \u2014 exclude monorepo Yarn Berry IDE config
|
|
86
|
+
`).some(r=>r.trim()===e)}catch{return!1}},Zn=e=>{f.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{pe(["network","inspect",e]),f.debug(`\u2705 Network '${e}' already exists`);return}catch{f.debug(`\u{1F310} Creating Docker network '${e}'...`);try{pe(["network","create",e],{stdio:"inherit"}),f.debug(`\u2705 Network '${e}' created`)}catch(r){if(r.message?.includes("already exists")){f.debug(`\u2705 Network '${e}' already exists`);return}throw f.error("Failed to create network: "+r.message),r}}},Ea=(e,t,r={})=>pe(["exec",e,"sh","-c",`"${t}"`],r),kw=e=>{try{let t=pe(["ps","-a","--filter",`name=^${e}`,"--format",'"{{.Names}}"']);return t.trim()?t.trim().split(`
|
|
87
|
+
`).filter(r=>r.trim().length>0):[]}catch{return[]}},Pf=e=>{let t=kw(e);if(t.length===0){f.debug(`\u26A0\uFE0F No containers found with prefix '${e}'`);return}f.debug(`\u26A0\uFE0F Found ${t.length} container(s) with prefix '${e}':`),t.forEach(r=>{f.debug(` - ${r}`)});try{f.debug("Stopping containers..."),pe(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),pe(["rm",...t],{stdio:"inherit"}),f.success(`Successfully stopped and removed ${t.length} container(s)`)}catch(r){throw f.error(`Failed to stop containers with prefix '${e}': ${r.message}`),r}};var ww=e=>e.name==="raclette-workbench",$f=e=>typeof e=="number"&&!Number.isNaN(e)&&e>=0?Math.floor(e):null,Df=(e,t)=>{let r=e.services?.cache;return $f(r?.dbs?.[t])??$f(r?.db)??0},Nf=e=>e===0?"":`/${e}`,Lf=(e,t,r={})=>{let n=r.host??"cache",o=r.scheme??"redis",i=e.services?.cache?.port??6379,s=Df(e,t);return`${o}://${n}:${i}${Nf(s)}`},Mr=(e,t,r="redis")=>{let n=e.services?.cache?.port??6379,o=Nf(Df(e,t));return`\${RACLETTE_CACHE_URL:-${r}://cache:\${RACLETTE_CACHE_PORT:-${n}}${o}}`};var If=(e,t)=>ww(e)&&t?{config:t,role:"workbench"}:{config:e,role:"app"};var Cw=Dt(Zo(),1);import z0 from"chokidar";import Aw from"fs-extra";import Sw from"path";import pt from"fs-extra";import Ht from"path";var Ff=async(e,t)=>{try{await pt.ensureDir(Ht.dirname(e)),await pt.pathExists(e)&&(await pt.stat(e)).isDirectory()&&(console.warn(h.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await pt.remove(e)),await pt.writeFile(e,t)}catch(r){throw f.error(` Error writing file ${e}: ${r.message}`),r}},xa=async(e,t)=>{f.debug("Generating service configuration files...");let r=Ht.join(t,"backend"),n=Ht.join(t,"frontend");await pt.ensureDir(r),await pt.ensureDir(n);let o={name:e.name,env:e.env,modules:e.modules,plugins:e.plugins,global:e.global},i={...o,service:"backend",...e.backend},s=`
|
|
88
|
+
// Generated racletteJS Backend Configuration
|
|
89
|
+
// This file is auto-generated, do not edit directly
|
|
90
|
+
|
|
91
|
+
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
92
|
+
|
|
93
|
+
export default racletteConfig;
|
|
94
|
+
`;await Ff(Ht.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
|
|
95
|
+
// Generated racletteJS Frontend Configuration
|
|
96
|
+
// This file is auto-generated, do not edit directly
|
|
97
|
+
|
|
98
|
+
export const racletteConfig = ${JSON.stringify(a,null,2)};
|
|
99
|
+
|
|
100
|
+
export default racletteConfig;
|
|
101
|
+
`;await Ff(Ht.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var eo=e=>{if(!e||typeof e!="object")throw new Error("Workbench configuration must be an object");if(!e.frontend||typeof e.frontend!="object")throw new Error('Workbench configuration must have a "frontend" object');if(e.frontend.i18n!==void 0){if(typeof e.frontend.i18n!="object")throw new Error("frontend.i18n must be an object");if(e.frontend.i18n.locales!==void 0){if(!Array.isArray(e.frontend.i18n.locales))throw new Error("frontend.i18n.locales must be an array");if(!e.frontend.i18n.locales.every(t=>typeof t=="string"))throw new Error("All locales must be strings")}}return!0},to=async(e,t=process.cwd())=>{let r=Ht.join(t,".raclette"),n=Ht.join(r,"raclette.config.workbench.js");await pt.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
|
|
102
|
+
|
|
103
|
+
export default defineRacletteConfig(${JSON.stringify(e,null,2)})
|
|
104
|
+
`;return await pt.writeFile(n,o,"utf8"),n};var jf=async e=>{let t=Sw.join(e,"raclette.config.js");if(!await Aw.pathExists(t))return null;let r=await Rw(t);return ka(r)},Rw=async e=>{try{let{pathToFileURL:t}=await import("url"),n=`${t(e).href}?t=${Date.now()}`;F.cache[e]&&delete F.cache[e];let o=await import(n);return o.default||o}catch(t){throw console.error(h.red(`Error loading config from ${e}:`),t),t}},ka=e=>{if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e)){let t=Number(e);if(!isNaN(t))return t}if(/^\d+\.\d+$/.test(e)){let t=Number(e);if(!isNaN(t))return t}return e}if(Array.isArray(e))return e.map(t=>ka(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=ka(n);return t}return e};var Tw="raclette-public-shared",tt={mongodb:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20},cache:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3},backend:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},hr=e=>({test:["CMD","curl","-f",`http://0.0.0.0:${e}/`],interval:"10s",timeout:"30s",retries:10}),Ow=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),wa=(e,t)=>Gt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Gt.resolve(t,e):Gt.resolve(t,e),ro=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>ro(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=wa(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=Ow(o):o&&typeof o=="object"?r[n]=ro(o,t):r[n]=o;return r},Tt=(e,t)=>{let r=ro(e,t);if(r.source&&r.source.includes("/")&&(r.source=wa(r.source,t)),r.mustExist&&!Br.existsSync(r.source))return f.debug(`Skipping volume mount: ${r.source} does not exist`),null;if(!r.type&&!r.readonly&&!r.volumeOptions&&!r.bindOptions&&!r.tmpfsOptions)return`${r.source}:${r.target}${r.readonly?":ro":""}`;let n={type:r.type||"volume",source:r.source,target:r.target};return r.readonly&&(n.read_only=!0),r.volumeOptions&&(n.volume=r.volumeOptions),r.bindOptions&&(n.bind=r.bindOptions),r.tmpfsOptions&&(n.tmpfs=r.tmpfsOptions),n},Pw=(e,t)=>{if(!e.includes("/")||e.startsWith("${"))return e;let r=e.split(":");if(r.length<2)return e;let n=r[0],o=r[1],i=r.slice(2).join(":"),s=wa(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},no=(e,t)=>e.map(r=>typeof r=="string"?Pw(r,t):r).map(r=>r),Ca=async(e,t,r,n=!1,o="development",i=!0,s=!0)=>{let a={services:{},volumes:{"yarn-cache":{driver:"local"}},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},c=e.env[o]||{},u=process.env.RACLETTE_APP_PATH?await jf(process.env.RACLETTE_APP_PATH):null,l=If(e,u),p=Mr(l.config,l.role);a.volumes[Tw]=null,e.volumes&&Object.entries(e.volumes).forEach(([m,g])=>{g===null?a.volumes[m]=null:a.volumes[m]=ro(g,t)});let d=!1,y=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let m=e.services.mongodb.name;jr(m)&&(f.debug(`MongoDB container '${m}' already exists, will be skipped`),d=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let m=e.services.cache.name;jr(m)&&(f.debug(`Cache container '${m}' already exists, will be skipped`),y=!0)}}if(e.services.mongodb?.enabled&&!d){let g=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,E=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,x=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${g}}`,image:"mongo:8.2",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${E}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${x}}:/data/config`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},e.services.mongodb.volumes&&e.services.mongodb.volumes.length>0&&e.services.mongodb.volumes.forEach(k=>{let O=Tt(k,t);O&&a.services.mongodb.volumes.push(O)}),!E.startsWith("/")&&!E.startsWith("./")&&(a.volumes[E]=null),!x.startsWith("/")&&!x.startsWith("./")&&(a.volumes[x]=null)}if(e.services.cache?.enabled&&!y){let g=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,E=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${g}}`,image:"valkey/valkey:9.0-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${E}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let x=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",k=e?.backend?.cache?.persistence||"none";k==="none"&&(a.services.cache.command='valkey-server --save ""'),k==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),k==="rdb"&&(a.services.cache.command="valkey-server --save "+x),k==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+x),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(O=>{let re=Tt(O,t);re&&a.services.cache.volumes.push(re)}),!E.startsWith("/")&&!E.startsWith("./")&&(a.volumes[E]=null)}if(!n){let m=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let g=e.services.backend.name??`${e.name}-backend`,E=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${g}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:m?"yarn run dev:inspect":"yarn dev",environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${RACLETTE_SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}","RACLETTE_FRONTEND_URLS=${RACLETTE_FRONTEND_URLS:-}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://mongodb:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb?.port||27017}}/\${RACLETTE_MONGODB_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=${p}`,...Object.entries(c).map(([x,k])=>`${x}=${k}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${E}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${fr("backend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...m?[`${m||"9229"}:9229`]:[]],networks:["raclette_shared"],depends_on:{},healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},e.services.backend.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(x=>{let k=Tt(x,t);k&&a.services.backend.volumes.push(k)}),e.services.mongodb?.enabled&&!d&&(a.services.backend.depends_on.mongodb={condition:"service_started"}),e.services.cache?.enabled&&!y&&(a.services.backend.depends_on.cache={condition:"service_healthy"}),Object.keys(a.services.backend.depends_on).length===0&&delete a.services.backend.depends_on,a.volumes[E]=null}if(e.services.frontend?.enabled){let g=e.services.frontend.name??`${e.name}-frontend`,E=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,x=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${g}}`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:`\${NODE_ENV:-${o}}`},target:`\${NODE_ENV:-${o}}`},command:"yarn dev",depends_on:{},environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-true}",`RACLETTE_SERVER_BASE_URL=\${RACLETTE_SERVER_BASE_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,`RACLETTE_SOCKET_URL=\${RACLETTE_SOCKET_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,...Object.entries(c).map(([k,O])=>`${k}=${O}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${E}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins",...o==="development"?["./.raclette/frontend/raclette.config.js:/app/raclette.config.js",`${fr("frontend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_CLIENT_PORT:-${e.services.frontend.port}}:8081`],networks:["raclette_shared"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:8081/"],interval:"10s",timeout:"30s",retries:10}},o!=="production"&&(a.services.frontend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.frontend.volumes.push("./.raclette/frontend/package.json:/app/package.json"),a.services.frontend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.backend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/backend/package.json:/app/package.json")),e.services.frontend.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(k=>{let O=Tt(k,t);O&&a.services.frontend.volumes.push(O)}),e.services.backend?.enabled&&(a.services.frontend.depends_on.backend={condition:"service_healthy"}),Object.keys(a.services.frontend.depends_on).length===0&&delete a.services.frontend.depends_on,a.volumes[E]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let g=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,E=g&&!g.endsWith("/")?g+"/":g;a.services.backend?.volumes?.push(`${E}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${E}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(m=>{m.volumes&&(m.volumes=no(m.volumes,t))}),await Br.writeFile(r,ke.dump(a)),await oo(e,Gt.dirname(r),o)},fr=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Mf=async(e,t,r,n="development")=>{await Ca(e,t,r,!1,n,!1,!1)},$w=`# Service images use Yarn 1 \u2014 exclude monorepo Yarn Berry IDE config
|
|
88
105
|
**/.yarnrc.yml
|
|
89
106
|
**/.yarnrc
|
|
90
107
|
**/.yarn
|
|
91
|
-
`,
|
|
108
|
+
`,Dw=async e=>{await Br.writeFile(Gt.join(e,".dockerignore"),$w)},oo=async(e,t,r)=>{await Dw(t);let n=Gt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
|
|
92
109
|
WORKDIR /app
|
|
93
110
|
|
|
94
111
|
# add bash since alpine doesn't come with a shell
|
|
@@ -124,7 +141,7 @@ EXPOSE 9229
|
|
|
124
141
|
|
|
125
142
|
# default command
|
|
126
143
|
CMD ["yarn", "run", "${r==="production"?"build":"dev"}"]
|
|
127
|
-
`;await
|
|
144
|
+
`;await Br.writeFile(n,o);let i=Gt.join(t,"frontend.Dockerfile"),s=`FROM node:24-alpine3.21 AS build
|
|
128
145
|
WORKDIR /app
|
|
129
146
|
|
|
130
147
|
RUN apk update && apk add bash curl ${(e.services.frontend?.installPackages||[]).join(" ")}
|
|
@@ -179,7 +196,7 @@ RUN chmod +x /docker-entrypoint.d/entrypoint.sh
|
|
|
179
196
|
ENV PORT 80
|
|
180
197
|
EXPOSE 80
|
|
181
198
|
|
|
182
|
-
CMD ["nginx", "-g", "daemon off;"]`;await
|
|
199
|
+
CMD ["nginx", "-g", "daemon off;"]`;await Br.writeFile(i,s)};import Bf from"path";var io=async(e,t,r)=>Ye.filter(n=>r||e.services[n]?.enabled),so=async(e,t,r,n={})=>{if(r.length===0)return;console.log(h.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=Bf.join(t,"docker-compose.yml"),s=["-p",e.name??Bf.basename(process.cwd()),"-f",o,"build"];n.noCache&&s.push("--no-cache");for(let a of r)try{console.log(h.blue(`\u{1F504} Rebuilding ${a} service...`)),Ee([...s,a],{stdio:"inherit"}),f.success(` Service ${a} rebuilt successfully`)}catch(c){f.error(`Error rebuilding service ${a}: ${c.message}`)}};import Zf from"fs-extra";import eh from"path";var Hf=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?Aa():[]],Aa=()=>[],Gf=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],Vf=(e=!1)=>{let t=` // JavaScript config
|
|
183
200
|
{
|
|
184
201
|
files: ["**/*.{js,mjs,cjs}"],
|
|
185
202
|
languageOptions: {
|
|
@@ -224,7 +241,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
224
241
|
}
|
|
225
242
|
}`;return e?t+`,
|
|
226
243
|
|
|
227
|
-
`+
|
|
244
|
+
`+Nw():t},Nw=()=>` // Style recommended config
|
|
228
245
|
{
|
|
229
246
|
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
|
|
230
247
|
rules: {
|
|
@@ -247,7 +264,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
247
264
|
{ min: 3, exceptions: ["i", "j", "a", "b", "fs", "id"], properties: "never" },
|
|
248
265
|
],
|
|
249
266
|
}
|
|
250
|
-
}`;var
|
|
267
|
+
}`;var Sa=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?Ra():[]],Ra=()=>[],Uf=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],Wf=(e=!1)=>{let t=` // React config
|
|
251
268
|
{
|
|
252
269
|
files: ["**/*.{jsx,tsx}"],
|
|
253
270
|
plugins: {
|
|
@@ -271,7 +288,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
271
288
|
}
|
|
272
289
|
}`;return e?t+`,
|
|
273
290
|
|
|
274
|
-
`+
|
|
291
|
+
`+Lw():t},Lw=()=>"";var qf=(e=!1)=>["typescript-eslint",...e?Ta():[]],Ta=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],Yf=e=>{let t=["import tseslint from 'typescript-eslint';"];return e&&(t.push("import importPlugin from 'eslint-plugin-import';"),t.push("import preferArrow from 'eslint-plugin-prefer-arrow-functions';")),t},Kf=(e=!1)=>{let r=` // TypeScript config
|
|
275
292
|
{
|
|
276
293
|
files: ["**/*.{ts,tsx}"],
|
|
277
294
|
plugins: ${e?`{
|
|
@@ -300,7 +317,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
300
317
|
}
|
|
301
318
|
}`;return e?r+`,
|
|
302
319
|
|
|
303
|
-
`+
|
|
320
|
+
`+Iw():r},Iw=()=>` // TypeScript recommended config
|
|
304
321
|
{
|
|
305
322
|
files: ["**/*.{ts,tsx}"],
|
|
306
323
|
rules: {
|
|
@@ -383,7 +400,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
383
400
|
}
|
|
384
401
|
]
|
|
385
402
|
}
|
|
386
|
-
}`;var
|
|
403
|
+
}`;var Oa=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser",...e?Pa():[]],Pa=()=>[],zf=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';"],Xf=(e=!1)=>{let t=` // Vue config
|
|
387
404
|
{
|
|
388
405
|
files: ["**/*.vue"],
|
|
389
406
|
// Manually add Vue plugin
|
|
@@ -424,7 +441,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
424
441
|
}
|
|
425
442
|
}`;return e?t+`,
|
|
426
443
|
|
|
427
|
-
`+
|
|
444
|
+
`+Fw():t},Fw=()=>` // Vue recommended config
|
|
428
445
|
{
|
|
429
446
|
files: ["**/*.vue"],
|
|
430
447
|
rules: {
|
|
@@ -467,7 +484,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
467
484
|
"vue/v-on-style": "error",
|
|
468
485
|
"vue/v-slot-style": "error"
|
|
469
486
|
}
|
|
470
|
-
}`;var
|
|
487
|
+
}`;var Jf=e=>{let t=e.eslint?.useRecommended!==!1,r=[...Hf(),...qf()];return e.frontend?.framework==="vue"?r.push(...Oa()):e.frontend?.framework==="react"&&r.push(...Sa()),t&&(r.push(...Aa(),...Ta()),e.frontend?.framework==="vue"?r.push(...Pa()):e.frontend?.framework==="react"&&r.push(...Ra())),[...new Set(r)]};import{existsSync as $a}from"fs";import Da from"path";var Qf=e=>{let t=[...e].sort(),r=$a(Da.join(process.cwd(),"yarn.lock")),n=$a(Da.join(process.cwd(),"pnpm-lock.yaml")),o=$a(Da.join(process.cwd(),"bun.lockb")),i="npm",s="install";return r?(i="yarn",s="add"):n?(i="pnpm",s="add"):o&&(i="bun",s="add"),`${i} ${s} -D ${t.join(" ")}`};var ao=async(e,t,r=!0)=>{let n=eh.join(t,"eslint.config.mjs");f.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=jw(e,o),s=[];if(s.push(` // TS ESLint base rules
|
|
471
488
|
{
|
|
472
489
|
files: ["**/*.{ts,tsx}"],
|
|
473
490
|
plugins: {
|
|
@@ -498,7 +515,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Mr.writeFile(i,s)};import Of from"path
|
|
|
498
515
|
".raclette/**",
|
|
499
516
|
".gitignore"
|
|
500
517
|
]
|
|
501
|
-
}`),s.push(
|
|
518
|
+
}`),s.push(Vf(o)),s.push(Kf(o)),e.frontend?.framework==="vue"&&s.push(Xf(o)),e.frontend?.framework==="react"&&s.push(Wf(o)),e.eslint?.rules&&Object.keys(e.eslint.rules).length>0){let c=JSON.stringify(e.eslint.rules,null,2).replace(/"([^"]+)":/g,"$1:");s.push(` // User custom rules
|
|
502
519
|
{
|
|
503
520
|
rules: ${c}
|
|
504
521
|
}`)}if(e.eslint?.ignores&&e.eslint.ignores.length>0){let c=JSON.stringify(e.eslint.ignores).replace(/^\[|\]$/g,"");s.push(` // User custom ignores
|
|
@@ -536,7 +553,7 @@ export const withRaclette = (...userConfigs) => {
|
|
|
536
553
|
|
|
537
554
|
// Default export for direct usage
|
|
538
555
|
export default racletteEslintConfig
|
|
539
|
-
`;await
|
|
556
|
+
`;await Zf.writeFile(n,a),r&&await Mw(t,e),f.debug(`Generated eslint.config.mjs in ${t}`)},jw=(e,t)=>{let r=[];return r.push(...Gf()),r.push(...Yf(t)),e.frontend?.framework==="vue"?r.push(...zf()):e.frontend?.framework==="react"&&r.push(...Uf()),r},Mw=async(e,t)=>{let r=eh.join(e,"ESLINT-README.md"),n=Jf(t),i=`# racletteJS ESLint Configuration
|
|
540
557
|
|
|
541
558
|
This directory contains an auto-generated ESLint configuration for your racletteJS project.
|
|
542
559
|
|
|
@@ -545,7 +562,7 @@ This directory contains an auto-generated ESLint configuration for your raclette
|
|
|
545
562
|
To use this ESLint configuration, you need to install the following dependencies:
|
|
546
563
|
|
|
547
564
|
\`\`\`bash
|
|
548
|
-
${
|
|
565
|
+
${Qf(n)}
|
|
549
566
|
\`\`\`
|
|
550
567
|
|
|
551
568
|
## How to Use
|
|
@@ -622,50 +639,33 @@ export default {
|
|
|
622
639
|
}
|
|
623
640
|
}
|
|
624
641
|
\`\`\`
|
|
625
|
-
`;await
|
|
642
|
+
`;await Zf.writeFile(r,i)};import{execSync as th}from"child_process";import K from"fs-extra";import oe from"path";import{pathToFileURL as Bw}from"url";var Hw=async(e,t,r=!1)=>{r&&f.progress(`Loading merged packages for ${e}...`);let n=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],o={},i={};for(let s of n)try{let a=await Gw(s);if(a.dependencies){o={...o,...a.dependencies};let c=Object.keys(a.dependencies).length;c>0&&r&&f.success(`Merged ${c} dependencies from ${s.file}:${s.key}`)}if(a.devDependencies){i={...i,...a.devDependencies};let c=Object.keys(a.devDependencies).length;c>0&&r&&f.success(`Merged ${c} devDependencies from ${s.file}:${s.key}`)}}catch(a){throw f.error(`Error loading package source ${s.file}:${s.key} - ${a.message}`),f.error(`Aborting package setup for ${e}`),a}return r&&f.raw(h.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(o).length} deps, ${Object.keys(i).length} devDeps`)),{dependencies:o,devDependencies:i}},Gw=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await K.pathExists(e.file))return f.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await K.readJson(e.file),r=e.key.split("."),n=t;for(let o of r)if(n&&typeof n=="object"&&o in n)n=n[o];else return f.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(f.warn(`Invalid package data at '${e.key}' in ${e.file}, skipping`),{}):{dependencies:n.dependencies||{},devDependencies:n.devDependencies||{}}}catch(t){throw new Error(`Failed to parse ${e.file}: ${t.message}`)}},co=(e,t)=>{let r=t.lockFiles?.[e];if(r)return f.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=oe.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},Na=async(e,t)=>{let r=await vf();if(!t)try{t=await import(Bw(oe.join(process.cwd(),"raclette.config.js")).href).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Ye.includes(e)&&await rh(`services/${e}/package.json`,oe.join(r,e),e,t,!1),mo.includes(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},Vw=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=oe.join(process.cwd(),"package.json");if(!await K.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await K.readJson(t),n={...r.dependencies||{},...r.devDependencies||{}},o=e.plugins.map(s=>typeof s=="string"?s:s[0]),i={};for(let s of o)n[s]?(i[s]=n[s],f.debug(`Found plugin ${s}@${n[s]}`)):f.warn(`Plugin ${s} is enabled in config but not found in package.json`);return i}catch(r){return f.warn(`Error reading app package.json: ${r.message}`),{}}},rh=async(e,t,r,n,o=!1)=>{let i=Nr();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await K.ensureDir(t);let s=oe.join(i,e),a=oe.dirname(s),c=oe.join(t,"package.json");if(!K.pathExistsSync(s))return f.warn(`Warning: Could not find package.json at ${s}`);o&&f.debug("Reading source package.json...");try{let u=await K.readJson(s),l=["frontend","backend"].includes(r)?await Hw(r,n,o):{dependencies:{},devDependencies:{}},p=await Vw(n),d={...u.dependencies,...l.dependencies,...p},y={...u.devDependencies,...l.devDependencies},m=bt(u,{dependencies:d,devDependencies:y});o&&f.debug("Writing merged package.json..."),await K.writeJson(c,m,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await Kw(a,t,r,n)}catch(u){throw f.error(`Error setting up package.json for ${r}: ${u.message}`),u}},lo=async e=>{let t=oe.join(process.cwd(),e.root);f.progress("Setting up node packages for services...");for(let r of Ye){if(!e.services[r]?.enabled)continue;let n=oe.join(t,r);await rh(`services/${r}/package.json`,n,r,e,!0),await _f(co(r,e),oe.join(n,"yarn.lock"))}},Uw=async()=>{let e=oe.join(process.cwd(),"packages.json");if(await K.pathExists(e))try{return await K.readJson(e)}catch(t){f.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},Ww=async e=>{let t=oe.join(process.cwd(),"packages.json");await K.writeJson(t,e,{spaces:2})};var qw=async(e,t,r=!1)=>{let n=oe.join(process.cwd(),"package.json");if(!await K.pathExists(n))throw new Error("No package.json found in project root");try{th("yarn --version",{stdio:"pipe"})}catch{throw new Error("Yarn is not available in PATH")}let o=e;t&&(o=`${e}@${t}`);let s=`yarn add ${o} ${r?"--dev":""}`.trim();f.progress(`Running: ${s}`);try{th(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await K.readJson(n),c=r?"devDependencies":"dependencies",u=a[c]?.[e];if(!u)throw new Error(`Package ${e} was not found in ${c} after installation`);return f.success(`Added ${e}@${u} to app package.json ${c}`),u}catch(a){throw new Error(`Failed to add ${e}${t?`@${t}`:""}: ${a.message}`)}},Yw=e=>{let t=e.match(/^(@[^/]+\/[^@]+)(?:@(.+))?$/);if(t)return{name:t[1],version:t[2]};let r=e.match(/^([^@]+)(?:@(.+))?$/);return r?{name:r[1],version:r[2]}:{name:e}},nh=async(e,t,r=!1)=>{let{name:n,version:o}=Yw(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await qw(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await Uw(),a=[...e.split("."),r?"devDependencies":"dependencies"],c=s;for(let u of a)c[u]||(c[u]={}),c=c[u];c[n]=i,f.success(`Added ${n}@${i} to ${a.join(".")}`),a.length==3&&f.instruction("Note: Workbench packages are stored in packages.json but package.json files are not updated"),await Ww(s),f.success("Updated packages.json in project root")},uo=async e=>{let t=Nr();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=co("frontend",e);if(await K.pathExists(r))f.debug(`\u{1F512} ${oe.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=oe.join(t,"services","frontend","yarn.lock");await K.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await K.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await K.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
626
643
|
# yarn lockfile v1
|
|
627
644
|
|
|
628
|
-
`)),f.debug(`\u{1F512}\u2705 Created ${
|
|
645
|
+
`)),f.debug(`\u{1F512}\u2705 Created ${oe.basename(r)}`)}}if(e.services.backend?.enabled){let r=co("backend",e);if(await K.pathExists(r))f.debug(`\u{1F512} ${oe.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=oe.join(t,"services","backend","yarn.lock");await K.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await K.copy(n,r)):(f.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await K.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
629
646
|
# yarn lockfile v1
|
|
630
647
|
|
|
631
|
-
`)),f.debug(`\u{1F512}\u2705 Created ${
|
|
648
|
+
`)),f.debug(`\u{1F512}\u2705 Created ${oe.basename(r)}`)}}f.success("Lock files ready for volume mounting")},Kw=async(e,t,r,n)=>{let o=oe.join(t,"yarn.lock");f.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=co(r,n)),i&&await K.pathExists(i))f.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await K.copy(i,o);else{let s=oe.join(e,"yarn.lock");await K.pathExists(s)?(f.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await K.copy(s,o)):(f.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await K.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
632
649
|
# yarn lockfile v1
|
|
633
650
|
|
|
634
|
-
`))}};import
|
|
651
|
+
`))}};import oh from"fs-extra";import ih from"path";var po=async(e,t)=>{let r=ih.join(t,"tsconfig.json"),n={compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"node",esModuleInterop:!0,resolveJsonModule:!0,outDir:"dist",declaration:!0,emitDeclarationOnly:!0,strict:!0,paths:{"@app":["../services/frontend/src/app"],"@app/*":["../services/frontend/src/app/*"],"@shared/app/*":["../shared/*"],"@shared/*":["./virtual/backend/src/shared/*"],"@raclettejs/core/backend":["../node_modules/@raclettejs/core/services/backend/src"],"@raclettejs/core/backend/*":["../node_modules/@raclettejs/core/services/backend/src/*"],"@raclettejs/workbench/app/*":["../node_modules/@raclettejs/workbench/frontend/src/app/*"],"@raclettejs/workbench/*":["../node_modules/@raclettejs/workbench/*"],"@raclettejs/core/frontend":["../node_modules/@raclettejs/core/services/frontend/src/core"],"@raclettejs/core/frontend/*":["../node_modules/@raclettejs/core/services/frontend/src/core/*"],"@raclettejs/core/orchestrator":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator"],"@raclettejs/core/orchestrator/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/*"],"@raclettejs/core/orchestrator/components":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/components"],"@raclettejs/core/orchestrator/components/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/components/*"],"@raclettejs/core/orchestrator/composables":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/composables"],"@raclettejs/core/orchestrator/composables/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/composables/*"],"@raclettejs/core":["../node_modules/@raclettejs/core"]},typeRoots:["./node_modules/@types","./node_modules/@raclettejs/core/types"]},include:["./src/**/*","types/**/*","../**/*","../node_modules/@raclettejs/core/*"],exclude:["../node_modules","../dist","./**","../node_modules/@raclettejs/core/node_modules"]};e.typescript?.compilerOptions&&Object.assign(n.compilerOptions,e.typescript.compilerOptions),e?.frontend?.framework==="vue"&&(zw(t),n.include.push("shims.vue.d.ts")),await oh.writeFile(r,JSON.stringify(n,null,2)),f.debug(`Generated tsconfig.json in ${t}`)},zw=async e=>{await oh.writeFile(ih.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
|
|
635
652
|
import { DefineComponent } from "vue"
|
|
636
653
|
const component: DefineComponent<{}, {}, any>
|
|
637
654
|
export default component
|
|
638
|
-
}`)};import
|
|
639
|
-
// Generated racletteJS Backend Configuration
|
|
640
|
-
// This file is auto-generated, do not edit directly
|
|
641
|
-
|
|
642
|
-
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
643
|
-
|
|
644
|
-
export default racletteConfig;
|
|
645
|
-
`;await Jf(Ht.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
|
|
646
|
-
// Generated racletteJS Frontend Configuration
|
|
647
|
-
// This file is auto-generated, do not edit directly
|
|
648
|
-
|
|
649
|
-
export const racletteConfig = ${JSON.stringify(a,null,2)};
|
|
650
|
-
|
|
651
|
-
export default racletteConfig;
|
|
652
|
-
`;await Jf(Ht.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var lo=e=>{if(!e||typeof e!="object")throw new Error("Workbench configuration must be an object");if(!e.frontend||typeof e.frontend!="object")throw new Error('Workbench configuration must have a "frontend" object');if(e.frontend.i18n!==void 0){if(typeof e.frontend.i18n!="object")throw new Error("frontend.i18n must be an object");if(e.frontend.i18n.locales!==void 0){if(!Array.isArray(e.frontend.i18n.locales))throw new Error("frontend.i18n.locales must be an array");if(!e.frontend.i18n.locales.every(t=>typeof t=="string"))throw new Error("All locales must be strings")}}return!0},uo=async(e,t=process.cwd())=>{let r=Ht.join(t,".raclette"),n=Ht.join(r,"raclette.config.workbench.js");await dt.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
|
|
653
|
-
|
|
654
|
-
export default defineRacletteConfig(${JSON.stringify(e,null,2)})
|
|
655
|
-
`;return await dt.writeFile(n,o,"utf8"),n};var Br=new Map,Zf="yarn",eh=process.platform==="win32",th=async e=>{let t=Ie.join(e,".yarnrc.yml");if(!await Ot.pathExists(t))return!1;let n=(await Ot.readFile(t,"utf8")).match(/^\s*yarnPath\s*:\s*(.+)\s*$/m);if(!n)return!1;let i=n[1].trim().replace(/^['"]|['"]$/g,"");if(!i)return!1;let s=Ie.resolve(e,i);return await Ot.pathExists(s)?!1:(f.warn(`Configured yarnPath is missing (${s}). Falling back to global Yarn.`),!0)},rh=async(e,t,r,n)=>{f.raclette("Starting development environment...");let o=Af(xf("fs.yml",{appDirName:Ie.basename(n.workingDir)})),i=Ie.dirname(n.dockerComposePath),s=r.name??Ie.basename(e),a=Sf(e,t),c={kill:()=>(a(),!0)};Br.set("originalConfigWatcher",c),await ao(r),await so(r),await Xf(r,o),Qn("raclette_shared"),await Ea(r,n.workingDir,n.dockerComposePath,!1,"development",!0),await co(r,i),await oo(r,i);let u=await ro(r,i,n.forceRebuild??!1);u.length>0&&await no(r,i,u,{noCache:n.noCache});let l=Hw(r),p=Gw(l);p.length>0&&f.info(`Found existing services: ${p.join(", ")}`);let d=Vw(r,s,n.dockerComposePath);["SIGINT","SIGTERM"].forEach(y=>{process.removeAllListeners(y),process.on(y,()=>d(y))}),n.quiet?(await nh(r,s,n.dockerComposePath,l,p,n.verbose??!1),console.log(h.green(`
|
|
655
|
+
}`)};import Xw from"chokidar";import La from"fs-extra";import dt from"path";ha();var Jw=[],sh=async(e,t)=>{let r=process.cwd(),n=dt.join(r,e.root),o=[`**/${e.root}/**`,...t.patterns.ignore],i={"":r,"/":n,".":Af(),undefined:".",null:".",$:process.env.RACLETTE_APP_PATH??r};typeof t?.watcher.ignored=="string"&&(t.watcher.ignored=new RegExp(t.watcher.ignored));let s=d=>d.reduce((y,m)=>y.concat(t.patterns[m]??[m]),[]),a=[],c=async(d,y,m)=>{let g=[];for(let E of y)for(let x of m){let k=dt.join(d,E),O=x.endsWith("/")?dt.join(x,E):x;a.push([E,dt.join(n,"vfs",E)]),g.push(La.ensureDir(dt.dirname(O)).finally(()=>La.link(k,O).catch(re=>re.code!=="EEXIST"&&f.error(`Unexpected error" ${re.code} linking ${k} \u2192 ${O}`))))}return Promise.all(g)},u=async(d,y,m)=>{let g=[];for(let E of y)for(let x of m){let k=x.endsWith("/")?dt.join(x,E):x;g.push(La.unlink(dt.join(k)))}return Promise.all(g)},l=async(d,y)=>{let m=Xw.watch(d,t.watcher??{});m.on("add",g=>c(d,[g],y)),m.on("unlink",g=>u(d,[g],y)),Jw.push(m)};return Promise.all(t.mappings.map(async d=>{let y=d.src??".",m=dt.join(i[y[0]]??r,y.replace(/^\$/,"")),g=(Array.isArray(d.dst)?d.dst:[d.dst??""]).map(x=>dt.join(e.root,"virtual/",x)),E=s(Array.isArray(d.get)?d.get:[d.get??"**"]);return m.startsWith(n)||l(m,g),fa(E,{cwd:m,ignore:o}).then(x=>c(m,x,g)).catch(x=>x.errno!=17&&console.log(x))}))};var Hr=new Map,ah="yarn",ch=process.platform==="win32",lh=async e=>{let t=Ie.join(e,".yarnrc.yml");if(!await Ot.pathExists(t))return!1;let n=(await Ot.readFile(t,"utf8")).match(/^\s*yarnPath\s*:\s*(.+)\s*$/m);if(!n)return!1;let i=n[1].trim().replace(/^['"]|['"]$/g,"");if(!i)return!1;let s=Ie.resolve(e,i);return await Ot.pathExists(s)?!1:(f.warn(`Configured yarnPath is missing (${s}). Falling back to global Yarn.`),!0)},uh=async(e,t,r,n)=>{f.raclette("Starting development environment...");let o=Tf(Cf("fs.yml",{appDirName:Ie.basename(n.workingDir)})),i=Ie.dirname(n.dockerComposePath),s=r.name??Ie.basename(e),a=Of(e,t),c={kill:()=>(a(),!0)};Hr.set("originalConfigWatcher",c),await uo(r),await lo(r),await sh(r,o),Zn("raclette_shared"),await Ca(r,n.workingDir,n.dockerComposePath,!1,"development",!0),await po(r,i),await ao(r,i);let u=await io(r,i,n.forceRebuild??!1);u.length>0&&await so(r,i,u,{noCache:n.noCache});let l=eC(r),p=tC(l);p.length>0&&f.info(`Found existing services: ${p.join(", ")}`);let d=rC(r,s,n.dockerComposePath);["SIGINT","SIGTERM"].forEach(y=>{process.removeAllListeners(y),process.on(y,()=>d(y))}),n.quiet?(await ph(r,s,n.dockerComposePath,l,p,n.verbose??!1),console.log(h.green(`
|
|
656
656
|
\u2705 Development environment is ready!`)),l.frontend.enabled&&console.log(h.blue(`\u{1F30D} Frontend running at: http://localhost:${l.frontend.port}`)),l.backend.enabled&&console.log(h.blue(`\u{1F680} Server running at: http://localhost:${l.backend.port}`)),console.log(h.yellow(`
|
|
657
|
-
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await
|
|
657
|
+
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await nC(r,s,n.dockerComposePath,l,p,n.logFilter,n.verbose??!1)},eC=e=>{let t=e.name??Ie.basename(process.cwd());return{frontend:{name:"frontend",containerName:e.services.frontend?.name??`${t}-frontend`,port:e.services.frontend?.port??8081,enabled:e.services.frontend?.enabled??!1,isDatabaseService:!1},backend:{name:"backend",containerName:e.services.backend?.name??`${t}-backend`,port:e.services.backend?.port??8082,enabled:e.services.backend?.enabled??!1,isDatabaseService:!1},mongodb:{name:"mongodb",containerName:e.services.mongodb?.name??`${t}-mongodb`,port:e.services.mongodb?.port??27017,enabled:e.services.mongodb?.enabled??!1,volumeName:e.services.mongodb?.volume??`${t}-mongodb`,isDatabaseService:!0},cache:{name:"cache",containerName:e.services.cache?.name??`${t}-cache`,port:e.services.cache?.port??6379,enabled:e.services.cache?.enabled??!1,volumeName:e.services.cache?.volume??`${t}-cache`,isDatabaseService:!0}}},tC=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&jr(n.containerName)&&t.push(r)}),t},rC=(e,t,r)=>n=>{console.log(`
|
|
658
658
|
`+"=".repeat(80)),console.log(h.bold.yellow(` CLEANUP: Shutting down services after ${n}...`)),console.log("=".repeat(80)+`
|
|
659
|
-
`);for(let[o,i]of
|
|
660
|
-
`+"=".repeat(80)),console.log(h.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(h.red("Error stopping Docker services:"),o)}process.exit(0)},
|
|
661
|
-
Log process ended with code ${d??0}`)),p()}),l.on("error",d=>{f.error(` Error with log process: ${d.message}`),p()})})}catch(l){throw f.error(`Error setting up log following: ${l.message}`),l}},
|
|
662
|
-
`).forEach(
|
|
663
|
-
`).forEach(
|
|
659
|
+
`);for(let[o,i]of Hr.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(h.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{dh(e),Ee(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
|
|
660
|
+
`+"=".repeat(80)),console.log(h.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(h.red("Error stopping Docker services:"),o)}process.exit(0)},ph=async(e,t,r,n,o,i)=>{if(console.log(h.blue("\u{1F433} Starting Docker services...")),!await Ot.pathExists(r)){let a=`Docker compose file not found: ${r}`;throw f.error(a),new Error(a)}let s=[];if(Object.entries(n).forEach(([a,c])=>{let u=a;if(c.enabled){if(o.includes(u)){f.info(`Skipping existing service: ${u}`);return}s.push(u)}}),s.length===0){f.warn("No Docker services to start! All services either exist or are not enabled.");return}f.raw(h.blue(`\u{1F680} Starting following services: ${s.join(", ")}`));try{Ee(["-p",t,"-f",r,"up","-d",...s],{stdio:"inherit"}),f.success(`Docker services started: ${s.join(", ")}`)}catch(a){throw f.error(`Error starting Docker services: ${a.message}`),a}try{await oC(e,i)}catch(a){f.error(`Error starting Workbench: ${a.message}`)}},nC=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await ph(e,t,r,n,o,s);let a=i.filter(l=>o.includes(l)?!1:n[l]?.enabled);if(a.length===0){f.warn("No services to show logs for");return}f.raw(h.blue(`\u{1F4CB} Showing logs for: ${a.join(", ")} (press Ctrl+C to stop)...`));let c=Ie.resolve(r),u=["-p",t,"-f",c,"logs","--follow",...a];try{f.debug("Running Docker Compose logs...");let l=Ia("docker",["compose",...u],{stdio:"inherit",shell:!0,cwd:Ie.dirname(c)});return Hr.set("dockerLogs",l),new Promise(p=>{l.on("close",d=>{l.killed||console.log(h.yellow(`
|
|
661
|
+
Log process ended with code ${d??0}`)),p()}),l.on("error",d=>{f.error(` Error with log process: ${d.message}`),p()})})}catch(l){throw f.error(`Error setting up log following: ${l.message}`),l}},fo=async e=>{if(!e.services?.workbench?.enabled)return;let t=Ie.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await Ot.pathExists(t))throw f.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=Ie.join(t,"package.json");if(!await Ot.pathExists(r))throw f.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},oC=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await fo(e);if(!r)return;let n=r;try{n=await Ot.realpath(r)}catch{}let o=Ie.join(process.cwd(),"workbenchPlugins");await Zw(o)||(o=void 0);let i;if(e.workbench)try{eo(e.workbench),i=await to(e.workbench)}catch(u){throw console.error(h.red("Workbench configuration error:"),u.message),u}let s=Object.fromEntries(Object.entries(e.env.development||{}).filter(([u])=>u.startsWith("RACLETTE_")).flatMap(([u,l])=>{let p=[[u,l]];if(u.startsWith("RACLETTE_WORKBENCH_")){let d=u.replace("RACLETTE_WORKBENCH_","RACLETTE_");p.push([d,l])}return p}));e.services?.workbench?.debugPort&&(s.ENABLE_DEBUG=!0,s.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let a={...process.env,NODE_ENV:"development",MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:Lf(e,"workbench",{host:"localhost",scheme:"raclette-cache"}),RACLETTE_CLIENT_PORT:String(e.services.workbench?.frontendPort||8083),RACLETTE_SERVER_PORT:String(e.services.workbench?.backendPort||8084),...s};return await lh(process.cwd())&&(a.YARN_IGNORE_PATH="1"),new Promise((u,l)=>{let p=`${e.name}-workbench`;f.progress("Starting workbench as "+p);let d=["dev",t?"-v":"","-p",p,...i?["-f",i]:[]].filter(x=>x!==""),y=["--cwd",n,...d],m=e.services?.workbench?.withLogs||t,g=Ia(ah,y,{cwd:process.cwd(),env:a,stdio:m?"pipe":"ignore",shell:ch});Hr.set("workbench",g),m&&(g.stdout?.on("data",x=>{x.toString().trim().split(`
|
|
662
|
+
`).forEach(O=>{console.log(h.magenta(`[Workbench] ${O}`))})}),g.stderr?.on("data",x=>{x.toString().trim().split(`
|
|
663
|
+
`).forEach(O=>{console.error(h.red(`[Workbench] ${O}`))})}),g.stdout?.on("data",x=>{x.toString().includes("VITE v")&&(clearTimeout(E),u())}));let E=setTimeout(()=>{u()},m?1e3*60*5:5e3);g.on("close",x=>{clearTimeout(E),x!==0&&x!==null?(console.error(h.red(`Workbench process exited with code ${x}`)),l(new Error(`Workbench process exited with code ${x}`))):u()}),g.on("error",x=>{clearTimeout(E),console.error(h.red("Workbench process error:"),x),l(x)}),m||setTimeout(u,1e3)})},dh=async e=>{if(e.services?.workbench?.enabled)try{let t=await fo(e);if(!t)return;let r=t;try{r=await Ot.realpath(t)}catch{}let n={...process.env};await lh(process.cwd())&&(n.YARN_IGNORE_PATH="1"),Ia(ah,["--cwd",r,"down","-p",`${e.name}-workbench`],{cwd:process.cwd(),env:n,stdio:"pipe",shell:ch})}catch{f.debug("Workbench down command failed, forcing process termination");let r=Hr.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{Pf(n)}catch(o){f.warn(`Could not stop workbench containers: ${o.message}`)}}}},Fa=(e,t)=>{let r=t?.name??Ie.basename(process.cwd());f.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),f.raclette("Stopping all Docker services...");try{dh(t),Ee(["-p",r,"-f",e,"down"],{stdio:"inherit"}),f.success("All Docker services stopped successfully")}catch(n){throw f.error("Error stopping Docker services:",n),n}};import hh from"fs-extra";import mh from"path";var iC=e=>dr(e),Gr=async(e,t,r)=>{let o=`${t?.name??mh.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await hh.readFile(r,"utf8"),s=new RegExp(`\\$\\{RACLETTE_${e.toUpperCase()}_CONTAINERNAME:-([^}]+)\\}`).exec(i);s&&s[1]&&(o=s[1])}catch(i){console.warn(h.yellow(`Warning: Could not read docker-compose file to determine container name: ${i.message}`))}return o},fh=async(e,t,r)=>{let n=await Gr(e,t,r);if(!iC(n))return!1;try{console.log(h.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),Ea(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=Ea(n,"cat /app/node_modules/.install-result",{stdio:"pipe"}).trim();return o==="0"?(console.log(h.green(`\u2705 Dependencies for ${e} updated successfully`)),!0):(console.error(h.red(`\u274C Dependency installation for ${e} failed with code ${o}`)),console.error(h.red("Some packages might be incompatible with your Node.js version or have other issues.")),console.error(h.yellow("Check the logs above for specific error messages.")),!1)}catch{return console.log(h.green(`\u2705 Dependencies for ${e} updated (status unknown)`)),!0}}catch(o){return console.error(h.red(`\u274C Error updating dependencies for ${e}: ${o.message}`)),!1}},ja=async(e,t,r)=>{console.log(h.blue("\u{1F9C0} Updating package dependencies..."));let n=mh.join(r,"docker-compose.yml");if(!await hh.pathExists(n))return console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running with racletteJS.")),!1;let o=!1,i=!0;if(e==="frontend"||e==="both"){let s=await fh("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await fh("backend",t,n);o=s||o,i=i&&s}return o&&!i&&(console.log(h.yellow("\u26A0\uFE0F Some services encountered errors during dependency installation.")),console.log(h.yellow("You may need to address compatibility issues in your package.json."))),o&&i};import{spawn as vh}from"child_process";import gh from"path";var bh=async(e,t,r,n)=>{if(e.includes("workbench")){await cC(r,t);return}let o=[];if(e.length===0)o=yh(r),console.log(h.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=yh(r),a=e.filter(c=>!s.includes(c));if(a.length>0)throw console.error(h.red(`\u274C Invalid services specified: ${a.join(", ")}`)),console.log(h.yellow(`Available services: ${s.join(", ")}`)),new Error("Invalid services specified");o=e,console.log(h.blue(`\u{1F4CB} Showing logs for: ${o.join(", ")}`))}let i=await sC(o,r,n);if(i.length===0)throw console.error(h.red("\u274C None of the specified services appear to be running.")),console.log(h.yellow("\u{1F4A1} Try running 'raclette dev' first to start the services.")),new Error("No running services found");if(i.length<o.length){let s=o.filter(a=>!i.includes(a));console.warn(h.yellow(`\u26A0\uFE0F Some services are not running: ${s.join(", ")}`)),console.log(h.blue(`\u{1F4CB} Showing logs for running services: ${i.join(", ")}`)),o=i}await aC(r,n,o,t)};function yh(e){let t=[];return e.services?.frontend?.enabled&&t.push("frontend"),e.services?.backend?.enabled&&t.push("backend"),e.services?.mongodb?.enabled&&t.push("mongodb"),e.services?.cache?.enabled&&t.push("cache"),e.services?.workbench?.enabled&&t.push("workbench"),e.services?.workbench?.enabled&&t.push("workbench"),t}async function sC(e,t,r){let n=[];for(let o of e)try{let i=await Gr(o,t,r);dr(i)&&n.push(o)}catch(i){console.warn(h.yellow(`\u26A0\uFE0F Could not check status of service '${o}': ${i.message}`))}return n}async function aC(e,t,r,n){let o=e?.name??gh.basename(process.cwd());console.log(h.blue(`\u{1F4CB} Following logs for: ${r.join(", ")} ${n.follow?"(press Ctrl+C to stop)":""}`));let i=["-p",o,"-f",t,"logs"];n.follow&&i.push("--follow"),n.tail&&i.push("--tail",n.tail),i.push(...r);try{let s=vh("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:gh.dirname(t)});s.on("close",a=>{s.killed||console.log(h.yellow(`
|
|
664
664
|
Log process ended with code ${a??0}`))}),s.on("error",a=>{console.error(h.red(`\u274C Error with log process: ${a.message}`))}),process.on("SIGINT",()=>{console.log(h.yellow(`
|
|
665
|
-
\u{1F6D1} Stopping log following...`)),s.kill("SIGTERM"),process.exit(0)}),n.follow?await new Promise(()=>{}):await new Promise(a=>{s.on("close",()=>a())})}catch(s){throw console.error(h.red(`\u274C Error following logs: ${s.message}`)),s}}async function
|
|
665
|
+
\u{1F6D1} Stopping log following...`)),s.kill("SIGTERM"),process.exit(0)}),n.follow?await new Promise(()=>{}):await new Promise(a=>{s.on("close",()=>a())})}catch(s){throw console.error(h.red(`\u274C Error following logs: ${s.message}`)),s}}async function cC(e,t){console.log(h.blue("\u{1F527} Handling workbench logs..."));let r=fo(e);f.debug("Calling yarn log frontend backend on workbench instance...");try{let n=["log","frontend","backend"];t.follow||n.push("--no-follow"),t.tail&&n.push("--tail",t.tail);let o=vh("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(h.yellow(`
|
|
666
666
|
Workbench log process ended with code ${i??0}`))}),o.on("error",i=>{console.error(h.red(`\u274C Error with workbench log process: ${i.message}`)),console.log(h.yellow("\u{1F4A1} Make sure the workbench package has the 'log' script in its package.json"))}),process.on("SIGINT",()=>{console.log(h.yellow(`
|
|
667
|
-
\u{1F6D1} Stopping workbench log following...`)),o.kill("SIGTERM"),process.exit(0)}),t.follow?await new Promise(()=>{}):await new Promise(i=>{o.on("close",()=>i())})}catch(n){throw console.error(h.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as
|
|
668
|
-
`),"utf8")
|
|
667
|
+
\u{1F6D1} Stopping workbench log following...`)),o.kill("SIGTERM"),process.exit(0)}),t.follow?await new Promise(()=>{}):await new Promise(i=>{o.on("close",()=>i())})}catch(n){throw console.error(h.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as RC}from"child_process";import V from"fs-extra";import G from"path";import lC from"chokidar";import D from"fs-extra";import P from"path";var _h=[".prettierrc","eslint.config.js",".yarnrc.yml"],uC=["bin/check-dependencies.sh"],kh=async(e,t,r)=>{let n=process.cwd(),o=P.join(n,".raclette"),i=P.join(o,"virtual"),s=Nr();f.debug(`\u{1F4E6} Using core package at: ${s}`),await gC(o,s,uC),f.debug("[VFS] Cleaning virtual file system directory..."),await D.pathExists(i)&&await D.rm(i,{recursive:!0}),await D.ensureDir(i);let a=[{name:"generated-service-files",path:o,servicePathMap:{backend:".",frontend:"."},priority:1},{name:"app",path:n,servicePathMap:{backend:"services",frontend:"services"},folderMappings:{shared:"backend/src/shared/app",i18n:"frontend/src/orchestrator/i18n/app"},priority:10},{name:"core-types",path:s,servicePathMap:{backend:"",frontend:""},folderMappings:{"src/types.ts":["backend/types/index.ts","frontend/types/index.ts"]},priority:29},{name:"core",path:s,servicePathMap:{backend:"services",frontend:"services"},priority:30},...e?.sourceDirectories||[],...t??[]],c=new Map,u={backend:["/"],frontend:["/"]},l=[...a].sort((g,E)=>E.priority-g.priority).map(g=>{let E=g.path.startsWith(".")?P.join(process.cwd(),g.path):g.path;return{...g,path:E}});await hC(l,c,i,u,_h,o),await mC(i),D.writeFileSync(P.join(o,"mappings.tsv"),Array.from(c.entries().map(g=>g.join(" "))).join(`
|
|
668
|
+
`),"utf8"),D.writeFileSync(P.join(o,"dirs.json"),JSON.stringify(l,null,2),"utf8");let p=[],d=g=>{let E=P.relative(n,g);return c.get(E)||g},y=()=>{p.forEach(E=>E.close()),p.length=0,pC(l,u,i).forEach(E=>{if(D.existsSync(E.sourcePath)){let x=dC(E,l,c,_h);p.push(x)}})},m=()=>p.forEach(g=>g.close());return r||y(),{resolveFile:d,watchFiles:y,close:m}},pC=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",u=P.join(o.path,c,i,a);n.push({sourcePath:u,sourceDir:o,targetResolver:l=>P.join(r,i,a,l),mappingKeyResolver:l=>P.join(i,a,l)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=P.join(o.path,i);D.existsSync(a)&&D.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(l=>{n.push({sourcePath:P.dirname(a),sourceDir:o,targetResolver:p=>P.basename(a)===p?P.join(r,l):P.join(r,l,p),mappingKeyResolver:p=>P.basename(a)===p?i:P.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:u=>P.join(r,i,u),mappingKeyResolver:u=>P.join(i,u)})})}),n},dC=(e,t,r,n)=>{f.debug(`[VFS] Setting up watcher for ${e.sourceDir.name}: ${e.sourcePath}`);let o=e.sourceDir.name==="generated-service-files"?["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss","**/package.json","**/yarn.lock","**/*.json"]:["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss"],i=lC.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(Ma(a,n))return;let u=e.mappingKeyResolver(a),l=e.targetResolver(a);await fC(t,r,u,l,a,c,n)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},fC=async(e,t,r,n,o,i,s)=>{let a=[...e].sort((c,u)=>c.priority-u.priority);if(i){let c=Eh(a,r,o);if(c){if(Ma(o,s))return;await D.ensureDir(P.dirname(n)),await D.copy(c.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${c.sourceDir.name}`)}else await D.pathExists(n)&&await D.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`)}else{let c=Eh(a,r,o);if(c){if(Ma(o,s))return;await D.ensureDir(P.dirname(n)),await D.copy(c.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${c.sourceDir.name}`)}}},Eh=(e,t,r)=>{for(let n of e){let o={backend:["/"],frontend:["/"]};for(let[i,s]of Object.entries(o))for(let a of s)if(P.join(i,a,r)===t){let u=n.servicePathMap?.[i]||"",l=P.join(n.path,u,i,a,r);if(D.existsSync(l))return{sourceDir:n,fullPath:l}}if(n.folderMappings)for(let[i,s]of Object.entries(n.folderMappings)){let a=Array.isArray(s)?s:[s];for(let c of a){let u,l;if(i===t){if(l=P.join(n.path,i),D.existsSync(l))return{sourceDir:n,fullPath:l}}else if(u=P.join(i,r),u===t&&(l=P.join(n.path,i,r),D.existsSync(l)))return{sourceDir:n,fullPath:l}}}}return null},xh=async(e,t,r,n,o,i)=>{if(!D.pathExistsSync(t))return;await D.ensureDir(P.dirname(r));let s=e.name==="generated-service-files";await D.copy(t,r,{overwrite:!0,filter:u=>{let l=P.basename(u);if(i.includes(l)||l.startsWith(".yarnrc"))return!1;if(s&&(l==="package.json"||l==="yarn.lock"))return!0;if(!s&&(l==="package.json"||l==="yarn.lock"))return!1;let p=P.relative(t,u);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")&&!p.startsWith(".yarn")&&!p.includes("/.yarn/")}});let c=await bf(t,s?["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss","**/package.json","**/yarn.lock"]:["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss"]);for(let u of c){let l=P.basename(u);if(i.includes(l)||l.startsWith(".yarnrc"))continue;if(!(s&&(l==="package.json"||l==="yarn.lock"))){if(!s&&(l==="package.json"||l==="yarn.lock"))continue}let p=P.relative(t,u),d=P.join(o,p),y=P.join(r,p);n.set(d,y)}f.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},hC=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await D.pathExists(s.path)){console.warn(h.yellow(`[VFS] Source directory not found: ${s.path}`));continue}for(let[a,c]of Object.entries(n))for(let u of c){let l=s.servicePathMap?.[a]||"";if(!l)continue;let p=P.join(s.path,l,a,u),d=P.join(r,a,u),y=P.join(a,u);await xh(s,p,d,t,y,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let u=P.join(s.path,a),l=(Array.isArray(c)?c:[c]).map(d=>P.join(r,d)),p=await D.pathExists(u)&&(await D.stat(u)).isFile();if(!p&&s.clear)for(let d of l)await D.rm(d,{recursive:!0,force:!0}),await D.ensureDir(d);if(p)for(let d of l)await D.ensureDir(P.dirname(d)),await D.copy(u,d),t.set(a,d),f.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of l)await xh(s,u,d,t,d,o)}}f.debug("[VFS] Built virtual file system")},Ma=(e,t)=>{let r=P.basename(e);return t.includes(r)||r.startsWith(".yarnrc")},mC=async e=>{for(let t of["backend","frontend"]){let r=P.join(e,t);if(!await D.pathExists(r))continue;for(let o of await D.readdir(r))o.startsWith(".yarnrc")&&await D.remove(P.join(r,o));let n=P.join(r,".yarn");await D.pathExists(n)&&await D.remove(n)}};var gC=async(e,t,r)=>{let n=P.join(e,"dist");await D.ensureDir(n);for(let o of r){let i=P.join(t,o),s=P.basename(o),a=P.join(n,s);await D.pathExists(a)&&await D.remove(a),await D.pathExists(i)&&(await D.ensureDir(P.dirname(a)),await D.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await D.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}};import{execSync as yC}from"child_process";import H from"fs-extra";import W from"path";var Ba=async(e,t,r)=>{console.log(h.blue("\u{1F4E6} Creating production artifacts...")),await _C(t,e,r);let n=W.join(t,"docker-compose.yml");return await EC(e,t,n,r),await xC(e,t,r),await kC(t,r,e),console.log(h.green("\u2705 Production artifacts created")),n},wh=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=W.join(t,a),u=W.basename(a),l=W.join(r,u);if(await H.ensureDir(W.dirname(l)),await H.pathExists(c))await H.copy(c,l),o&&await H.chmod(l,493),console.log(h.gray(`${s} \u2705 Copied ${a}`));else{let p=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${p}`);console.log(h.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},vC=async(e,t,r)=>wh(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),bC=async(e,t,r,n)=>wh(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),_C=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
|
|
669
669
|
FROM nginx:alpine
|
|
670
670
|
COPY service/frontend /usr/share/nginx/html
|
|
671
671
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
@@ -778,7 +778,7 @@ server {
|
|
|
778
778
|
proxy_set_header Host $host;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
|
-
`;if(await H.writeFile(W.join(e,"Dockerfile.frontend"),i),await H.writeFile(W.join(e,"Dockerfile.backend"),s),await H.writeFile(W.join(e,"nginx.conf"),a),await
|
|
781
|
+
`;if(await H.writeFile(W.join(e,"Dockerfile.frontend"),i),await H.writeFile(W.join(e,"Dockerfile.backend"),s),await H.writeFile(W.join(e,"nginx.conf"),a),await vC(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let u=`
|
|
782
782
|
FROM nginx:alpine
|
|
783
783
|
COPY workbench/frontend /usr/share/nginx/html
|
|
784
784
|
COPY nginx.workbench.conf /etc/nginx/conf.d/default.conf
|
|
@@ -856,7 +856,7 @@ server {
|
|
|
856
856
|
proxy_set_header Authorization $http_authorization;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
-
`;await H.writeFile(W.join(e,"Dockerfile.workbench-frontend"),u),await H.writeFile(W.join(e,"Dockerfile.workbench-backend"),l),await H.writeFile(W.join(e,"nginx.workbench.conf"),p)}},
|
|
859
|
+
`;await H.writeFile(W.join(e,"Dockerfile.workbench-frontend"),u),await H.writeFile(W.join(e,"Dockerfile.workbench-backend"),l),await H.writeFile(W.join(e,"nginx.workbench.conf"),p)}},EC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=e.env.production||{},a={services:{frontend:{build:{context:".",dockerfile:"Dockerfile.frontend"},ports:[`\${PORT:-${o}}:${o}`],depends_on:["backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(s).map(([u,l])=>`${u}=${l}`)],healthcheck:hr(o)},backend:{build:{context:".",dockerfile:"Dockerfile.backend"},depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}",`RACLETTE_FRONTEND_URLS=\${RACLETTE_FRONTEND_URLS:-http://localhost:${o}}`,`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=${Mr(e,"app","valkey")}`,...Object.entries(s).map(([u,l])=>`${u}=${l}`)],healthcheck:tt.backend},database:{image:"mongo:8.2",restart:"unless-stopped",volumes:["mongodb_data:/data/db","mongodb_config:/data/config"],networks:["app-network"],environment:["MONGO_INITDB_DATABASE=${MONGO_DATABASE:-"+(e.services.mongodb?.databaseName||e.name)+"}"],healthcheck:{...tt.mongodb}},cache:{image:"valkey/valkey:9.0-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{...tt.cache}}},volumes:{mongodb_data:{},mongodb_config:{},cache_data:{}},networks:{"app-network":{driver:"bridge"}}},c=e.backend?.cache;if(c?.persistence){let u=c.RDB_OPTIONS||"3600 1 300 100 60 10000";switch(c.persistence){case"none":a.services.cache.command='valkey-server --save ""';break;case"aof":a.services.cache.command="valkey-server --appendonly yes";break;case"rdb":a.services.cache.command="valkey-server --save "+u;break;case"rdb+aof":a.services.cache.command="valkey-server --appendonly yes --save "+u;break}}if(n){let u=e.env.production||{};a.services["workbench-frontend"]={build:{context:".",dockerfile:"Dockerfile.workbench-frontend"},ports:[`\${WORKBENCH_PORT:-${i}}:${i}`],depends_on:["workbench-backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(u).map(([l,p])=>`${l}=${p}`)],healthcheck:hr(i)},a.services["workbench-backend"]={build:{context:".",dockerfile:"Dockerfile.workbench-backend"},depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`RACLETTE_FRONTEND_URLS=\${RACLETTE_FRONTEND_URLS:-http://localhost:${i}}`,`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=${Mr(e,"workbench","valkey")}`,...Object.entries(u).map(([l,p])=>`${l}=${p}`)],healthcheck:tt.backend}}await H.writeFile(r,ke.dump(a))},xC=async(e,t,r)=>{let n=Ha(e,r);await H.writeFile(W.join(t,".env.example"),n)},Ha=(e,t)=>{let r=e.services.frontend?.port||8081,n=e.services.workbench?.frontendPort||8083;return`# Production Environment Variables
|
|
860
860
|
# Copy this file to .env and fill in your values
|
|
861
861
|
|
|
862
862
|
# Required - Generate a secure random string for this
|
|
@@ -894,7 +894,7 @@ ${Object.keys(e.env.production||{}).map(i=>`# ${i}=`).join(`
|
|
|
894
894
|
|
|
895
895
|
# Cache specific overrides (uncomment if using external Valkey/Redis)
|
|
896
896
|
# RACLETTE_CACHE_URL=valkey://your-external-cache:6379
|
|
897
|
-
`},
|
|
897
|
+
`},kC=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
|
|
898
898
|
# racletteJS Production Deployment Script
|
|
899
899
|
|
|
900
900
|
set -e
|
|
@@ -947,7 +947,7 @@ echo " - Built with TypeScript and compiled to dist/src/server.js"
|
|
|
947
947
|
echo " - Runs on Node.js 24 Alpine with production dependencies only"
|
|
948
948
|
echo " - Should listen on 0.0.0.0:3000 for proper container networking"
|
|
949
949
|
echo " - Accessible via /api proxy on port ${n}"
|
|
950
|
-
`,s=W.join(e,"deploy.sh");await H.writeFile(s,i),await H.chmod(s,493)},
|
|
950
|
+
`,s=W.join(e,"deploy.sh");await H.writeFile(s,i),await H.chmod(s,493)},Ch=async(e,t,r)=>{let n={services:{},volumes:{},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},o=`${e.name}-build`;if(e.services.mongodb?.enabled){let i=`${o}-mongodb-data`;n.services.mongodb={container_name:`${o}-mongodb`,image:"mongo:8.2",ports:[`127.0.0.1:${e.services.mongodb.port}:27017`],volumes:[`${i}:/data/db`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},n.volumes[i]=null}if(e.services.redis?.enabled){let i=`${o}-redis-data`;n.services.redis={container_name:`${o}-redis`,image:"redis:7-alpine",ports:[`127.0.0.1:${e.services.redis.port}:6379`],command:"redis-server --appendonly yes",volumes:[`${i}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","redis-cli","ping"],interval:"10s",timeout:"5s",retries:3}},n.volumes[i]=null}if(e.services.backend?.enabled){let i=`${o}-backend_node_modules`;n.services.backend={container_name:`${o}-backend`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:"development"}},command:"yarn generate",environment:["NODE_ENV=development","RACLETTE_BUILD_MODE=generate",`MONGO_HOST=mongodb://mongodb:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,"SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}",`CACHE_URL=redis://redis:${e.services.redis?.port||6379}`,...Object.entries(e.env.development||{}).map(([s,a])=>`${s}=${a}`)],volumes:[`${i}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins","./.raclette/backend/raclette.config.js:/app/raclette.config.js","./.raclette/backend/package.json:/app/package.json","./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh",`${fr("backend",e)}:/app/yarn.lock`],networks:["raclette_shared"],depends_on:{...e.services.mongodb?.enabled&&{mongodb:{condition:"service_started"}},...e.services.redis?.enabled&&{redis:{condition:"service_healthy"}}},entrypoint:["/app/check-dependencies.sh"]},n.volumes[i]=null}e.services.backend?.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(i=>{let s=Tt(i,t);s&&n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=no(i.volumes,t))}),await H.writeFile(r,ke.dump(n))},Ah=async(e,t,r,n)=>{let o={services:{},volumes:{},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},i=`${e.name}-build`;if(e.services.frontend?.enabled){let s=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`;o.services.frontend={container_name:`${i}-frontend`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:"production"},target:"build"},command:["sh","-c","yarn install --production=false && yarn build && cp -r /app/dist/* /build-output/"],environment:[...Object.entries(e.env.production||{}).map(([a,c])=>`${a}=${c}`),"NODE_ENV=production"],volumes:["./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${s}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins","./.raclette/virtual/frontend/types:/app/types","./.raclette/frontend/raclette.config.js:/app/raclette.config.js","./.raclette/frontend/package.json:/app/package.json",`${fr("frontend",e)}:/app/yarn.lock`,`${W.resolve(n,"frontend")}:/build-output`],networks:["raclette_shared"]},o.volumes[s]=null;try{e.services.frontend?.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(a=>{let c=Tt(a,t);c&&o.services.frontend.volumes.push(c)})}catch{console.error(h.red("Could not add custom volumes to backend docker-compose file. This might lead to missing data."))}}if(e.services.backend?.enabled){let s=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;o.services.backend={container_name:`${i}-backend`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:"production"}},command:["sh","-c","yarn install --production=false && rm -rf ./dist && yarn build && cp -r /app/dist /build-output/ && cp /app/package.json /build-output/ && cp /app/yarn.lock /build-output/ || echo 'Backend build failed'"],environment:[...Object.entries(e.env.production||{}).map(([a,c])=>`${a}=${c}`),"NODE_ENV=production"],volumes:[`${s}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./.raclette/backend/raclette.config.js:/app/raclette.config.js","./plugins:/app/src/appPlugins","./.raclette/backend/package.json:/app/package.json",`${fr("backend",e)}:/app/yarn.lock`,"./.raclette/virtual/backend/types:/app/types",`${W.resolve(n,"backend")}:/build-output`],networks:["raclette_shared"]},o.volumes[s]=null;try{e.services.backend?.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(a=>{let c=Tt(a,t);c&&o.services.backend.volumes.push(c)})}catch{console.error(h.red("Could not add custom volumes to backend docker-compose file. This might lead to missing data."))}}Object.values(o.services).forEach(s=>{s.volumes&&(s.volumes=no(s.volumes,t))}),await H.writeFile(r,ke.dump(o))},wC=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
|
|
951
951
|
# racletteJS Production Deployment Script with Image Loading
|
|
952
952
|
|
|
953
953
|
set -e
|
|
@@ -1002,7 +1002,7 @@ echo " View logs: docker compose logs -f"
|
|
|
1002
1002
|
echo " Stop: docker compose down"
|
|
1003
1003
|
echo " Restart: docker compose restart"
|
|
1004
1004
|
echo " Update images: ./load-images.sh && docker compose up -d"
|
|
1005
|
-
`;await H.writeFile(W.join(e,"deploy.sh"),s),await H.chmod(W.join(e,"deploy.sh"),493)},
|
|
1005
|
+
`;await H.writeFile(W.join(e,"deploy.sh"),s),await H.chmod(W.join(e,"deploy.sh"),493)},CC=async(e,t)=>{let r=`#!/bin/bash
|
|
1006
1006
|
# Load Docker Images Script
|
|
1007
1007
|
|
|
1008
1008
|
set -e
|
|
@@ -1034,7 +1034,7 @@ echo "\u2705 All images loaded successfully!"
|
|
|
1034
1034
|
echo ""
|
|
1035
1035
|
echo "\u{1F433} Available images:"
|
|
1036
1036
|
docker images | grep -E "${t.map(n=>n.split(":")[0]).join("|")}" || echo "No images found (this might be expected if tags changed)"
|
|
1037
|
-
`;await H.writeFile(W.join(e,"load-images.sh"),r),await H.chmod(W.join(e,"load-images.sh"),493)},
|
|
1037
|
+
`;await H.writeFile(W.join(e,"load-images.sh"),r),await H.chmod(W.join(e,"load-images.sh"),493)},AC=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
|
|
1038
1038
|
|
|
1039
1039
|
This package contains everything needed to deploy your racletteJS application.
|
|
1040
1040
|
|
|
@@ -1121,7 +1121,7 @@ ${n?`- Workbench: http://localhost:${i}`:""}
|
|
|
1121
1121
|
- Ports ${o}${n?`, ${i}`:""} available
|
|
1122
1122
|
|
|
1123
1123
|
Generated on: ${new Date().toISOString()}
|
|
1124
|
-
`;await H.writeFile(W.join(e,"README.md"),s)},
|
|
1124
|
+
`;await H.writeFile(W.join(e,"README.md"),s)},Sh=async(e,t,r,n,o)=>{console.log(h.blue("\u{1F4E6} Packaging images for distribution..."));let i=W.join(t,"..","package"),s=`${e.name}-deployment-${n}`,a=W.join(i,`${s}.tar.gz`);await H.ensureDir(i),await H.emptyDir(i);let c=W.join(i,s);await H.ensureDir(c);try{console.log(h.gray(" \u{1F4BE} Exporting Docker images..."));let u=W.join(c,"images");await H.ensureDir(u);for(let p of r){let d=`${p.replace(/[:/]/g,"_")}.tar`,y=W.join(u,d);console.log(h.gray(` \u{1F4E6} Exporting ${p}...`)),pe(["save","-o",y,p],{stdio:"pipe"});let m=await H.stat(y);if(m.size===0)throw new Error(`Failed to export image ${p}`);console.log(h.gray(` \u2705 Exported ${p} (${(m.size/1024/1024).toFixed(1)}MB)`))}console.log(h.gray(" \u{1F4C4} Copying deployment files..."));let l=["docker-compose.yml",".env.example","deploy.sh","nginx.conf"];return o&&l.push("nginx.workbench.conf"),await bC(l,t,c,{required:!1,logPrefix:" "}),await wC(c,r,o,e),await CC(c,r),await AC(c,e,r,o),console.log(h.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await SC(c,a),await H.remove(c),console.log(h.green(` \u2705 Deployment package created: ${s}.tar.gz`)),{packagePath:a,imageNames:r}}catch(u){throw await H.remove(c).catch(()=>{}),u}},SC=async(e,t)=>{let r=W.dirname(e),n=W.basename(e);yC(`tar -czf "${t}" -C "${r}" "${n}"`,{stdio:"pipe"});let o=await H.stat(t);console.log(h.gray(` \u{1F4E6} Package size: ${(o.size/1024/1024).toFixed(1)}MB`))};var Rh=240,Ga=7200,TC=()=>{let e=process.env.RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS,t,r;if(e===void 0||e==="")t=Rh,r="default (env unset)";else{let n=Number.parseInt(e,10);!Number.isFinite(n)||n<1?(t=Rh,r=`invalid env "${e}", using default`):(t=Math.min(n,Ga),r=n>Ga?`capped from ${n}s to max ${Ga}s`:`from env RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS=${e}`)}return console.log(h.gray(` \u23F1\uFE0F Generation mode wait: ${t}s (${r})`)),t},Th=async(e,t,r={})=>{let n=Date.now(),o=OC(r);console.log(h.blue(`\u{1F9C0} Starting racletteJS ${o} build...`)),Qn();let i=G.join(process.cwd(),".raclette"),s=G.resolve(r.outputDir||G.join(i,".build"));await V.ensureDir(s),await V.emptyDir(s);try{await jC(e,t,i),await MC(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await PC(e,i,s,r);break;case"images":a=await Oh(e,i,s,r);break;case"package":a=await $C(e,i,s,r);break}let c=(Date.now()-n)/1e3;return f.success(` ${o} build completed in ${c}s`),FC(a,e),a}catch(a){throw f.error(`${o} build failed: ${a.message}`),a}},OC=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),PC=async(e,t,r,n)=>{if(n.buildOnly){console.log(h.blue("\u{1F4C1} Building application files only...")),await Va(e,t,r,n);let i=await Ua(e,r,n);return console.log(h.green("\u2705 Build files ready")),{mode:"artifacts",buildDir:r,artifacts:{}}}else{console.log(h.blue("\u{1F4C1} Building local deployment artifacts..."));let i=G.join(r,"service");await Va(e,t,i,n);let s=await Ua(e,r,n),a=await Ba(e,r,s),c=await IC(e,r,s);return console.log(h.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:G.join(r,"deploy.sh"),readmeFile:c,envExampleFile:G.join(r,".env.example")}}}},Oh=async(e,t,r,n)=>{console.log(h.blue("\u{1F433} Building Docker images for CI/CD..."));let o=G.join(r,"service");await Va(e,t,o,n);let i=await Ua(e,r,n);await Ba(e,r,i);let s=await DC(e,r,i,n);return console.log(h.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},$C=async(e,t,r,n)=>{console.log(h.blue("\u{1F4E6} Building offline deployment package..."));let o=await Oh(e,t,r,n),i=Ph(),s=await Sh(e,r,o.images.names,i,o.images.names.some(a=>a.includes("workbench")));return console.log(h.green("\u2705 Offline deployment package ready")),{...o,mode:"package",deploymentPackage:s.packagePath}},DC=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||Ph(),s=n.platforms||"linux/amd64,linux/arm64",a=n.buildx||!1,c=[],u=[i];if(n.generateLatest&&!u.includes("latest")&&u.push("latest"),a)try{await NC(),console.log(h.blue(`\u{1F3D7}\uFE0F Building multi-architecture images for: ${s}`))}catch(l){console.warn(h.yellow("\u26A0\uFE0F Buildx not available, falling back to single-architecture builds")),console.warn(h.yellow(` ${l.message}`)),a=!1}if(a){let l=["frontend","backend"];r&&l.push("workbench-frontend","workbench-backend");for(let p of l){let d=`${o}/${p}`,y=G.join(t,`Dockerfile.${p}`);if(!await V.pathExists(y))throw new Error(`Dockerfile not found: ${y}`);let m=u.map(g=>`${d}:${g}`);c.push(...m),await LC({context:t,dockerfile:y,tags:m,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(h.gray(` \u2705 Built ${p} for ${s}`)),m.forEach(g=>{console.log(h.gray(` ${g}`))})}}else{console.log(h.gray(" \u{1F528} Building single-architecture images..."));let p=["-f",G.join(t,"docker-compose.yml"),"build"];n.noCache&&p.push("--no-cache"),Ee(p,{stdio:n.verbose?"inherit":"pipe",cwd:t});let d=["frontend","backend"];r&&d.push("workbench-frontend","workbench-backend");for(let y of d){let m=`${G.basename(t)}-${y}`.replace(/\./,""),g=`${o}/${y}`;u.forEach(E=>{let x=`${g}:${E}`;pe(["tag",m,x],{stdio:"pipe"}),c.push(x)}),console.log(h.gray(` \u2705 Tagged ${y}`))}}return console.log(h.green(" \u2705 Docker images built and tagged")),{names:c,tags:u}},NC=async()=>{try{pe(["buildx","version"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),pe(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Creating buildx builder...")),pe(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),pe(["buildx","inspect","--bootstrap"],{stdio:"pipe"}),console.log(h.gray(" \u2705 Buildx builder ready with QEMU emulation"))}catch(e){throw console.warn(h.yellow(" \u26A0\uFE0F Buildx setup failed, falling back to single-architecture builds")),console.warn(h.yellow(` ${e.message}`)),new Error("Buildx not available - use single-architecture builds instead")}},LC=async e=>{let t=["buildx","build","--platform",e.platforms,"--file",e.dockerfile];e.tags.forEach(n=>{t.push("--tag",n)});let r=e.platforms.split(",").length;e.push?t.push("--push"):r===1?t.push("--load"):(console.log(h.yellow(" \u26A0\uFE0F Multi-platform images cannot be loaded locally")),console.log(h.yellow(" \u2139\uFE0F Images built but not loaded to local Docker"))),e.noCache&&t.push("--no-cache"),t.push(e.context);try{pe(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},IC=async(e,t,r)=>{let n=G.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
|
|
1125
1125
|
|
|
1126
1126
|
This build contains everything needed to deploy ${e.name} locally using Docker.
|
|
1127
1127
|
|
|
@@ -1186,7 +1186,7 @@ Edit \`docker-compose.yml\` to:
|
|
|
1186
1186
|
|
|
1187
1187
|
Built on: ${new Date().toISOString()}
|
|
1188
1188
|
Build type: Local deployment artifacts
|
|
1189
|
-
`;return await V.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},
|
|
1189
|
+
`;return await V.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},FC=(e,t)=>{let r=t.services.frontend?.port||8081,n=t.services.workbench?.frontendPort||8083,o=e.images?.names.some(i=>i.includes("workbench"))||!1;switch(console.log(""),console.log(h.blue("\u{1F4E6} Build Summary:")),console.log(` Mode: ${h.cyan(e.mode)}`),console.log(` Build Directory: ${h.cyan(e.buildDir)}`),e.mode==="artifacts"&&(console.log(` Docker Compose: ${h.cyan(e.artifacts.composeFile||"N/A")}`),console.log(` Deploy Script: ${h.cyan(e.artifacts.deployScript||"N/A")}`),console.log(` README: ${h.cyan(e.artifacts.readmeFile||"N/A")}`)),e.images&&e.images.names.length>0&&(console.log(` Docker Images: ${h.cyan(e.images.names.length)} built`),e.images.names.forEach(i=>{console.log(` - ${h.gray(i)}`)})),e.deploymentPackage&&console.log(` Deployment Package: ${h.cyan(e.deploymentPackage)}`),console.log(""),console.log(h.blue("\u{1F680} Next steps:")),e.mode){case"artifacts":console.log(h.yellow(` 1. Go to Directory: cd ${e.buildDir}`)),console.log(h.yellow(" 2. Copy (and edit) .env: cp .env.example .env")),console.log(h.yellow(" 3. Deploy: chmod +x deploy.sh && ./deploy.sh")),console.log(h.yellow(` \u2192 App will be at http://localhost:${r}`)),o&&console.log(h.yellow(` \u2192 Workbench at http://localhost:${n}`));break;case"images":console.log(h.yellow(" Images ready for registry push:")),e.images?.names.forEach(i=>{console.log(h.yellow(` docker push ${i}`))}),console.log(""),console.log(h.gray(" \u{1F4A1} Example pipeline usage:")),console.log(h.gray(" docker push myregistry.com/myproject/frontend:v1.0.0")),console.log(h.gray(" docker push myregistry.com/myproject/backend:v1.0.0"));break;case"package":console.log(h.yellow(" 1. Transfer package to target system")),console.log(h.yellow(" 2. Extract: tar -xzf deployment-package.tar.gz")),console.log(h.yellow(" 3. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 4. Deploy: ./deploy.sh"));break}},Ph=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),jC=async(e,t,r)=>{console.log(h.blue("\u{1F4C1} Setting up build environment...")),await uo(e),await lo(e),await kh(e),await po(e,r),await ao(e,r),await xa(e,r),console.log(h.green("\u2705 Build environment ready"))},MC=async(e,t,r)=>{console.log(h.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=G.join(r,"docker-compose.generate.yml");await oo(e,r,"build"),await Ch(e,t,o),Zn("raclette_shared");try{console.log(h.gray(" \u{1F433} Starting generation services...")),Ee(["-p",n,"-f",o,"up","-d","--build"],{stdio:"pipe"}),console.log(h.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=TC();for(;i<s;)try{if(!(await Ee(["-p",n,"-f",o,"ps","-q","backend"],{stdio:"pipe"})).trim())break;await new Promise(c=>setTimeout(c,1e3)),i++}catch{break}if(i>=s)throw new Error(`Generation mode timed out after ${s}s (set RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS to increase)`);console.log(h.green(" \u2705 File generation completed"))}finally{try{Ee(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup generation services"))}}},Va=async(e,t,r,n)=>{console.log(h.blue("\u{1F3A8} Building main application...")),await V.ensureDir(r),await oo(e,t,"build"),await BC(e,t,r,n)},BC=async(e,t,r,n)=>{console.log(h.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=G.join(t,"docker-compose.app-build.yml"),s=G.join(t,".temp-build");await V.ensureDir(s),await V.ensureDir(G.join(s,"frontend")),await V.ensureDir(G.join(s,"backend"));try{await Ah(e,process.cwd(),i,s);let a=["-p",o,"-f",i,"up","--build"];if(n.noCache&&a.push("--force-recreate"),console.log(h.gray(" \u{1F528} Starting parallel build process...")),Ee(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=G.join(r,"frontend");await V.ensureDir(c);let u=G.join(s,"frontend");if(await V.pathExists(u)){if((await V.readdir(u)).length===0)throw new Error("Frontend build produced no output files");await V.copy(u,c),console.log(h.green(" \u2705 Frontend build complete"))}else throw new Error("Frontend build did not produce expected output directory")}if(e.services.backend?.enabled){let c=G.join(r,"backend");await V.ensureDir(c);let u=G.join(s,"backend");if(!await V.pathExists(u))throw new Error("Backend build did not produce expected output directory");await HC(e,t,c,s),console.log(h.green(" \u2705 Backend build complete"))}console.log(h.green(" \u2705 Application build completed"))}finally{try{Ee(["-p",o,"-f",i,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup build services"))}await V.remove(s),await V.remove(i)}},HC=async(e,t,r,n)=>{console.log(h.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=G.join(n,"backend");await V.ensureDir(r),await V.pathExists(o)&&(await V.copy(o,r),console.log(h.gray(" \u2705 Copied backend build artifacts")));let i=G.join(r,"dist");if(!await V.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=G.join(i,"src","server.js");if(!await V.pathExists(s))throw new Error("Backend build did not produce expected dist/src/server.js entry point");let a=G.join(r,"package.json");if(await V.pathExists(a)){let u=await V.readJson(a),l={...u,scripts:{start:"node dist/src/server.js",...u.scripts},devDependencies:void 0};await V.writeJson(a,l,{spaces:2}),console.log(h.gray(" \u2705 Updated package.json for production"))}else throw new Error("Backend build did not include package.json");let c=G.join(r,"yarn.lock");await V.pathExists(c)||console.warn(h.yellow(" \u26A0\uFE0F No yarn.lock found in backend build")),console.log(h.gray(" \u2705 Backend Node.js application structure created")),console.log(h.gray(" \u{1F4C1} Entry point: dist/src/server.js")),await GC(r)},GC=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=G.join(e,i);await V.pathExists(s)||r.push(i)}if(r.length>0)throw new Error(`Backend application is missing required files: ${r.join(", ")}`);let n=G.join(e,"package.json"),o=await V.readJson(n);(!o.scripts?.start||!o.scripts.start.includes("dist/src/server.js"))&&console.warn(h.yellow(" \u26A0\uFE0F package.json start script may not point to dist/src/server.js")),console.log(h.gray(" \u2705 Backend structure verified successfully"))},Ua=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await VC(e,t,r),!0),VC=async(e,t,r)=>{console.log(h.blue("\u{1F527} Building workbench..."));let n=G.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await V.pathExists(n)){f.warn("Workbench package not found, skipping workbench build");return}let o=G.join(t,"workbench"),i;if(e.workbench)try{eo(e.workbench),i=await to(e.workbench)}catch(s){throw console.error(h.red("Workbench configuration error:"),s.message),s}try{let s={...process.env,MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:`redis://localhost:${e.services.redis?.port||6379}`,...e.env.development},a=`${e.name}-workbench`;console.log(h.gray(" \u{1F527} Running workbench build process as "+a)),await new Promise((c,u)=>{let l=["build","--output-dir",o,"--build-only",r.verbose?"-v":"","-p",a,...i?["-f",i]:[]].filter(d=>d!==""),p=RC("yarn",l,{cwd:n,stdio:r.verbose?"inherit":"ignore",env:s});p.on("close",d=>{f.raw(h.gray(` \u{1F3C1} Workbench build process exited with code ${d}`)),d===0?c():u(new Error(`Workbench build failed with exit code ${d}`))}),p.on("error",d=>{f.raw(h.red(` \u274C Workbench build process error: ${d.message}`)),u(d)})}),f.raw(h.green(" \u2705 Workbench build complete"))}catch(s){throw f.error("Workbench build failed: "+s.message),s}};import ht from"fs-extra";import ft from"path";var Wa=()=>[{description:"custom favicon",source:"./branding/favicon.png",target:"/usr/shared/nginx/html/favicon.png",service:"frontend"},{description:"custom logo in app",source:"./branding/custom-logo.png",target:"/usr/shared/nginx/html/logo.png",service:"frontend"},{description:"custom home icon (can be full logo or just an icon)",source:"./branding/custom-home-icon.png",target:"/usr/shared/nginx/html/home-icon.png",service:"frontend"},{description:"custom logo in login screen (not used, if not set)",source:"./branding/custom-login-logo.png",target:"/usr/shared/nginx/html/login-logo.png",service:"frontend"}];var $h=async(e,t={})=>{console.log(h.blue("\u{1F4CB} Generating deployment guide..."));let r=ft.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=Lh(e,n,o,i);return t.generateFiles?await qC(e,s,r,i):await YC(e,s,r,i)},Dh=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=Lh(e,r,n,o);return await UC(e,i,n,o)},UC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await Fh(e,t,r,n),a=await jh(),c=WC(e.name,r);return`# Deploy ${e.name} with Docker
|
|
1190
1190
|
|
|
1191
1191
|
Deploy ${e.name} using pre-built Docker images.
|
|
1192
1192
|
|
|
@@ -1254,8 +1254,8 @@ docker compose down -v
|
|
|
1254
1254
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1255
1255
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1256
1256
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1257
|
-
`}
|
|
1258
|
-
`),
|
|
1257
|
+
`},WC=(e,t)=>["# Required","RACLETTE_SERVER_TOKEN_SECRET=your-secret-key-here","RACLETTE_FRONTEND_URLS=https://yourdomain.com,https://workbench.yourdomain.com # required to prevent CORS issues","","# Database Name",`RACLETTE_MONGO_DATABASE=${e}`,"","# Image Configuration",`IMAGE_TAG=${t}`,"","# Optional - Debug Mode","# RACLETTE_DEBUG_MODE=true # Uncomment to see frontend logs in console"].join(`
|
|
1258
|
+
`),Nh=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await Fh(e,t,"latest",r),s=await jh();return`# Deploy ${e.name} with Docker
|
|
1259
1259
|
|
|
1260
1260
|
Deploy ${e.name} using pre-built Docker images.
|
|
1261
1261
|
|
|
@@ -1363,7 +1363,7 @@ docker compose down -v
|
|
|
1363
1363
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1364
1364
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1365
1365
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1366
|
-
`},
|
|
1366
|
+
`},Lh=(e,t,r,n)=>{let o=["frontend","backend"],i=e.services.workbench?.enabled||!1;return i&&o.push("workbench-frontend","workbench-backend"),{names:o.map(a=>{let c=`${t}/${a}`;return`${n?`${n}${c}`:c}:${r}`}),hasWorkbench:i}},qC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4C1} Generating deployment files..."));let o=ft.join(r,"deploy-guide");await ht.ensureDir(o);let i=ft.join(o,"docker-compose.yml");await Ih(e,t,i,"latest",n);let s=ft.join(o,"docker-compose.override.yml.example");await KC(e,s);let a=ft.join(o,".env.example");await zC(e,a,t.hasWorkbench);let c=ft.join(o,"README.md");await XC(e,t,c,n);let u=ft.join(o,"DEPLOY.md");return await JC(e,t,u,n),console.log(h.green("\u2705 Deployment files generated")),console.log(h.gray(` \u{1F4C1} Files created in: ${o}`)),{outputPath:o,mode:"files",deployGuideFile:u,additionalFiles:[i,s,a,c]}},YC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=ft.join(r,"DEPLOY.md");return await QC(e,t,o,n),console.log(h.green("\u2705 Deployment guide generated")),console.log(h.gray(` \u{1F4C4} Guide: ${o}`)),{outputPath:r,mode:"embedded",deployGuideFile:o}},Ih=async(e,t,r,n,o)=>{let i=e.services.frontend?.port||8081,s=e.services.workbench?.frontendPort||8083,a=u=>{let d=u.split(":")[0].replace(o,"");return o?`${o}${d}:\${IMAGE_TAG:-${n}}`:`\${DOCKER_REGISTRY:-}${d}:\${IMAGE_TAG:-${n}}`},c={name:e.name,services:{frontend:{image:a(t.names[0]),ports:[`\${FRONTEND_PORT:-${i}}:${i}`],depends_on:["backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}"],healthcheck:hr(i)},backend:{image:a(t.names[1]),depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`RACLETTE_FRONTEND_URLS=\${RACLETTE_FRONTEND_URLS:-http://localhost:${i}}`,`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:tt.backend},database:{image:"mongo:8.2",restart:"unless-stopped",volumes:["mongodb_data:/data/db"],networks:["app-network"],environment:[`MONGO_INITDB_DATABASE=\${MONGO_DATABASE:-${e.name}}`],healthcheck:tt.mongodb},cache:{image:"valkey/valkey:9.0-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:tt.cache}},volumes:{mongodb_data:{},cache_data:{}},networks:{"app-network":{driver:"bridge"}}};t.hasWorkbench&&t.names.length>=4&&(c.services["workbench-frontend"]={image:a(t.names[2]),ports:[`\${WORKBENCH_FRONTEND_PORT:-${s}}:${s}`],depends_on:["workbench-backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}"],healthcheck:hr(s)},c.services["workbench-backend"]={image:a(t.names[3]),depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","PORT=3000","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`RACLETTE_FRONTEND_URLS=\${RACLETTE_FRONTEND_URLS:-http://localhost:${s}}`,`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:tt.backend}),await ht.writeFile(r,ke.dump(c))},KC=async(e,t)=>{let r=Wa(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
|
|
1367
1367
|
# Copy this file to docker-compose.override.yml and customize as needed
|
|
1368
1368
|
# This file allows you to extend the main docker-compose.yml without modifying it
|
|
1369
1369
|
|
|
@@ -1401,7 +1401,7 @@ ${o.map(s=>` # ${s.description}
|
|
|
1401
1401
|
# Add custom networks if needed
|
|
1402
1402
|
# networks:
|
|
1403
1403
|
# custom-network:
|
|
1404
|
-
`;await ht.writeFile(t,i)},
|
|
1404
|
+
`;await ht.writeFile(t,i)},zC=async(e,t,r)=>{let n=Ha(e,r);await ht.writeFile(t,n)},XC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
|
|
1405
1405
|
|
|
1406
1406
|
This folder contains deployment files for testing registry-based deployment locally.
|
|
1407
1407
|
|
|
@@ -1490,7 +1490,7 @@ you can adjust these registry examples based on where your images will be hosted
|
|
|
1490
1490
|
\`\`\`
|
|
1491
1491
|
|
|
1492
1492
|
Generated on: ${new Date().toISOString()}
|
|
1493
|
-
`;await ht.writeFile(r,s)},
|
|
1493
|
+
`;await ht.writeFile(r,s)},JC=async(e,t,r,n)=>{let o=await Nh(e,t,n);await ht.writeFile(r,o)},QC=async(e,t,r,n)=>{let o=await Nh(e,t,n),i=`# ${e.name} - Registry Deployment Guide
|
|
1494
1494
|
|
|
1495
1495
|
## For Developers
|
|
1496
1496
|
|
|
@@ -1514,7 +1514,7 @@ ${t.names.map(s=>`- \`${s}\``).join(`
|
|
|
1514
1514
|
*Copy everything below this line to your project README or documentation*
|
|
1515
1515
|
|
|
1516
1516
|
${o}
|
|
1517
|
-
`;await ht.writeFile(r,i)},
|
|
1517
|
+
`;await ht.writeFile(r,i)},Fh=async(e,t,r,n)=>{let o=ft.join(process.cwd(),"temp-compose.yml");await Ih(e,t,o,r,n);let i=await ht.readFile(o,"utf8");return await ht.remove(o),i},jh=async()=>{let e=Wa(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
|
|
1518
1518
|
frontend:
|
|
1519
1519
|
volumes:
|
|
1520
1520
|
${t.map(n=>` # ${n.description}
|
|
@@ -1529,7 +1529,7 @@ ${r.map(n=>` # ${n.description}
|
|
|
1529
1529
|
# - ${n.source}:${n.target}`).join(`
|
|
1530
1530
|
`)}
|
|
1531
1531
|
environment:
|
|
1532
|
-
# - CUSTOM_API_KEY=your-key`};var Vt=process.cwd(),HC=$t.resolve($t.dirname(BC(import.meta.url)),"..");process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=Vt);process.env.RACLETTE_CORE_ABSOLUTE_PATH||(process.env.RACLETTE_CORE_ABSOLUTE_PATH=HC);var Gt=await Cf(),Ph=Object.keys(Gt).length&&h.blue(`\u{1F4C4} Loaded ${Object.keys(Gt).length} environment variables from ${Vt}/.env`);Gt.RACLETTE_APP_PATH=process.env.RACLETTE_APP_PATH;Gt.RACLETTE_CORE_ABSOLUTE_PATH=process.env.RACLETTE_CORE_ABSOLUTE_PATH;var de=ga(await Mt(),await Mt("raclette.config.*",Gt)),$h=Gt.RACLETTE_ROOT||de.root||".raclette",Fe=$t.join(Vt,$h),mt=$t.join(Fe,"docker-compose.yml");de.root=$h;var je=new dc,rt=(e,t)=>{Ph&&f.raclette(Ph),Pt.ensureDirSync(Fe)};je.version("0.1.0");je.command("dev").description("Start development environment").option("-q, --quiet","Run Docker Compose in detached mode without following logs").option("-v, --verbose","Get more information about what is happening").option("--filter <service>","Filter logs to specific services (comma-separated)","frontend,backend").option("--force-rebuild, --rebuild","Force rebuild of Docker images regardless of file changes").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").option("-r, --root <root>","Raclette tools root directory",".raclette").option("--no-cache","Force rebuild Docker images without using cache").hook("preAction",rt).action(async e=>{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment...");try{Jn();let t=ga(de,e.configFile?await Mt(e.configFile):{});Pt.writeFile($t.join(Fe,"raclette.config.yaml"),ke.dump(t)),e.projectName&&(f.raclette("Setting project name to "+e.projectName),t.name=e.projectName),ya(t,Fe),await rh(Fe,Gt,t,{workingDir:Vt,dockerComposePath:mt,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):Ye,forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});je.command("log [services...]").description("Follow logs for specified services (or all services if none specified)").option("-f, --follow","Follow log output (default: true)",!0).option("--no-follow","Don't follow log output").option("--tail <lines>","Number of lines to show from the end of the logs","100").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs..."),await Pt.pathExists(mt)||(f.error("No docker-compose.yml found. Services may not be running."),f.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await ph(e,t,de,mt)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});je.command("down").description("Stop Docker Compose services").option("--keep-shared","Don't stop shared services like DB and Cache").option("-p, --project-name <projectName>","Applies a specific project name").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=Vt;e.projectName&&(f.raclette("Setting project name to "+e.projectName),de.name=e.projectName);let r=$t.join(Fe,"docker-compose.full.yml");if(!await Pt.pathExists(mt)){console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(f.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Da(mt,de)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Tf(de,t,r,"development"),await Da(r,de),await Pt.remove(r)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});je.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").hook("preAction",rt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Restarting Raclette services..."),e.length===0){f.warn("No services specified. Please specify which services to restart."),f.instruction("Usage: raclette restart <service1> <service2> ..."),f.instruction("Common services: frontend, backend, mongodb, cache");return}let r=de?.name??$t.basename(Vt);if(!await Pt.pathExists(mt)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let n of e)try{let o=await Hr(n,de,mt);if(!dr(o)){f.warn(`Service '${n}' (container: ${o}) doesn't appear to be running.`),f.instruction(" If you're sure it's running, it might have a different container name than expected."),f.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await Pt.pathExists(mt)?(f.progress(`Restarting service: ${n}...`),Ee(["-p",r,"-f",mt,"restart",n],{stdio:"inherit"})):(f.progress(` Restarting container: ${o}...`),pe(["restart",o],{stdio:"inherit"})),f.success(`Service '${n}' restarted successfully`)}catch(o){f.error(`Error restarting service '${n}': ${o.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});je.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e="both",t)=>{try{f.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(f.error("Target must be one of: frontend, backend, both"),process.exit(1)),await Oa(e,de),await Na(e,de,Fe)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});je.command("build").description("Build application with different modes").option("--mode <mode>","Build mode: artifacts (local deployment), images (CI/CD), package (offline)","artifacts").option("--image-tag <tag>","Image tag for registry (e.g., v1.0.0)").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--generate-latest","Also tag images as :latest").option("--output-dir <dir>","Output directory").option("--skip-workbench","Skip workbench build").option("--no-cache","Build without cache").option("-v, --verbose","Verbose output").option("--buildx","Use Docker buildx for multi-architecture builds").option("--platforms <platforms>","Target platforms for buildx","linux/amd64,linux/arm64").option("--build-only","Legacy: same as --mode artifacts").option("--build-images","Legacy: same as --mode images").option("--package-images","Legacy: same as --mode package").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").hook("preAction",rt).action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=Vt,r=bt(de,e.configFile?await Mt(e.configFile):{});Pt.writeFileSync($t.join(Fe,"raclette.config.yaml"),ke.dump(r)),ya(r,Fe),e.projectName&&(f.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let n={outputDir:e.outputDir,skipWorkbench:e.skipWorkbench,verbose:e.verbose,noCache:e.noCache,mode:e.mode,imageTag:e.imageTag,imagePrefix:e.imagePrefix,generateLatest:e.generateLatest,buildOnly:e.buildOnly,buildImages:e.buildImages,packageImages:e.packageImages,buildx:e.buildx,platforms:e.platforms},o=await Eh(r,t,n);switch(f.success("Build complete!"),o.mode){case"artifacts":f.success(`Build files are in ${o.buildDir}!`),f.raw(h.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":f.success("Docker images built and tagged"),f.raw(h.green("\u{1F680} Ready for registry push"));break;case"package":f.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&f.raw(h.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){f.error("Error building application: "+t?.message),process.exit(1)}});je.command("add-package <target> <package...>").description(`Add a package to the project (target: ${Wr.join(", ")})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t,r)=>{f.setVerbose(r.verbose);try{Wr.includes(e)||(f.error(`Target must be one of: ${Wr.join(", ")}}`),process.exit(1)),f.raclette(`Adding package(s) to ${e}...`);for(let n of t)await Yf(e,n,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder..."),await Oa(e,de),await Na(e,de,Fe)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});je.command("rebuild [services...]").description("Rebuild Docker images for specified services or all services").option("--no-cache","Force rebuild Docker images without using cache").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images..."),e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let n=await ro(de,Fe);if(n.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=n}let r=e.filter(n=>n==="frontend"||n==="backend"||n==="workbench");r.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await no(de,Fe,r,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${r.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});je.command("deploy-guide").description("Generate deployment guide and files for registry-based deployment").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--image-tag <tag>","Image tag (default: latest)").option("--registry <url>","Registry URL prefix (e.g., registry.gitlab.com/group/)").option("--output-dir <dir>","Output directory (default: current directory)").option("--generate-files","Generate separate files for local testing").option("--return-only","Output to stdout only (no file generation)").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async e=>{try{if(f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),e.returnOnly){let n={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},o=await Ch(de,n);console.log(o),process.exit(0)}let t={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},r=await wh(de,t);f.success("Deployment guide generated!"),r.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${r.outputPath}`)),f.raw(h.yellow("\u{1F4A1} Use these files for local testing")),f.raw(h.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(f.raw(h.cyan(`\u{1F4C4} Guide created: ${r.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch(t){f.error("Error generating deployment guide: "+t.message),process.exit(1)}});je.command("config").description("(Re)Configure Raclette Application").option("-c, --config <config>","configuration file","raclette.config.yaml").hook("preAction",rt).action(async e=>{console.log(h.bold.green("YO!")+h.bold.red(":"))});je.parse(process.argv);
|
|
1532
|
+
# - CUSTOM_API_KEY=your-key`};var Ut=process.cwd(),eA=$t.resolve($t.dirname(ZC(import.meta.url)),"..");process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=Ut);process.env.RACLETTE_CORE_ABSOLUTE_PATH||(process.env.RACLETTE_CORE_ABSOLUTE_PATH=eA);var Vt=await Rf(),Mh=Object.keys(Vt).length&&h.blue(`\u{1F4C4} Loaded ${Object.keys(Vt).length} environment variables from ${Ut}/.env`);Vt.RACLETTE_APP_PATH=process.env.RACLETTE_APP_PATH;Vt.RACLETTE_CORE_ABSOLUTE_PATH=process.env.RACLETTE_CORE_ABSOLUTE_PATH;var de=va(await Bt(),await Bt("raclette.config.*",Vt)),Bh=Vt.RACLETTE_ROOT||de.root||".raclette",Fe=$t.join(Ut,Bh),mt=$t.join(Fe,"docker-compose.yml");de.root=Bh;var je=new gc,rt=(e,t)=>{Mh&&f.raclette(Mh),Pt.ensureDirSync(Fe)};je.version("0.1.0");je.command("dev").description("Start development environment").option("-q, --quiet","Run Docker Compose in detached mode without following logs").option("-v, --verbose","Get more information about what is happening").option("--filter <service>","Filter logs to specific services (comma-separated)","frontend,backend").option("--force-rebuild, --rebuild","Force rebuild of Docker images regardless of file changes").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").option("-r, --root <root>","Raclette tools root directory",".raclette").option("--no-cache","Force rebuild Docker images without using cache").hook("preAction",rt).action(async e=>{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment...");try{Qn();let t=va(de,e.configFile?await Bt(e.configFile):{});Pt.writeFile($t.join(Fe,"raclette.config.yaml"),ke.dump(t)),e.projectName&&(f.raclette("Setting project name to "+e.projectName),t.name=e.projectName),ba(t,Fe),await uh(Fe,Vt,t,{workingDir:Ut,dockerComposePath:mt,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):Ye,forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});je.command("log [services...]").description("Follow logs for specified services (or all services if none specified)").option("-f, --follow","Follow log output (default: true)",!0).option("--no-follow","Don't follow log output").option("--tail <lines>","Number of lines to show from the end of the logs","100").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs..."),await Pt.pathExists(mt)||(f.error("No docker-compose.yml found. Services may not be running."),f.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await bh(e,t,de,mt)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});je.command("down").description("Stop Docker Compose services").option("--keep-shared","Don't stop shared services like DB and Cache").option("-p, --project-name <projectName>","Applies a specific project name").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=Ut;e.projectName&&(f.raclette("Setting project name to "+e.projectName),de.name=e.projectName);let r=$t.join(Fe,"docker-compose.full.yml");if(!await Pt.pathExists(mt)){console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(f.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Fa(mt,de)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Mf(de,t,r,"development"),await Fa(r,de),await Pt.remove(r)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});je.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").hook("preAction",rt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Restarting Raclette services..."),e.length===0){f.warn("No services specified. Please specify which services to restart."),f.instruction("Usage: raclette restart <service1> <service2> ..."),f.instruction("Common services: frontend, backend, mongodb, cache");return}let r=de?.name??$t.basename(Ut);if(!await Pt.pathExists(mt)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let n of e)try{let o=await Gr(n,de,mt);if(!dr(o)){f.warn(`Service '${n}' (container: ${o}) doesn't appear to be running.`),f.instruction(" If you're sure it's running, it might have a different container name than expected."),f.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await Pt.pathExists(mt)?(f.progress(`Restarting service: ${n}...`),Ee(["-p",r,"-f",mt,"restart",n],{stdio:"inherit"})):(f.progress(` Restarting container: ${o}...`),pe(["restart",o],{stdio:"inherit"})),f.success(`Service '${n}' restarted successfully`)}catch(o){f.error(`Error restarting service '${n}': ${o.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});je.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e="both",t)=>{try{f.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(f.error("Target must be one of: frontend, backend, both"),process.exit(1)),await Na(e,de),await ja(e,de,Fe)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});je.command("build").description("Build application with different modes").option("--mode <mode>","Build mode: artifacts (local deployment), images (CI/CD), package (offline)","artifacts").option("--image-tag <tag>","Image tag for registry (e.g., v1.0.0)").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--generate-latest","Also tag images as :latest").option("--output-dir <dir>","Output directory").option("--skip-workbench","Skip workbench build").option("--no-cache","Build without cache").option("-v, --verbose","Verbose output").option("--buildx","Use Docker buildx for multi-architecture builds").option("--platforms <platforms>","Target platforms for buildx","linux/amd64,linux/arm64").option("--build-only","Legacy: same as --mode artifacts").option("--build-images","Legacy: same as --mode images").option("--package-images","Legacy: same as --mode package").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").hook("preAction",rt).action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=Ut,r=bt(de,e.configFile?await Bt(e.configFile):{});Pt.writeFileSync($t.join(Fe,"raclette.config.yaml"),ke.dump(r)),ba(r,Fe),e.projectName&&(f.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let n={outputDir:e.outputDir,skipWorkbench:e.skipWorkbench,verbose:e.verbose,noCache:e.noCache,mode:e.mode,imageTag:e.imageTag,imagePrefix:e.imagePrefix,generateLatest:e.generateLatest,buildOnly:e.buildOnly,buildImages:e.buildImages,packageImages:e.packageImages,buildx:e.buildx,platforms:e.platforms},o=await Th(r,t,n);switch(f.success("Build complete!"),o.mode){case"artifacts":f.success(`Build files are in ${o.buildDir}!`),f.raw(h.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":f.success("Docker images built and tagged"),f.raw(h.green("\u{1F680} Ready for registry push"));break;case"package":f.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&f.raw(h.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){f.error("Error building application: "+t?.message),process.exit(1)}});je.command("add-package <target> <package...>").description(`Add a package to the project (target: ${qr.join(", ")})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t,r)=>{f.setVerbose(r.verbose);try{qr.includes(e)||(f.error(`Target must be one of: ${qr.join(", ")}}`),process.exit(1)),f.raclette(`Adding package(s) to ${e}...`);for(let n of t)await nh(e,n,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder..."),await Na(e,de),await ja(e,de,Fe)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});je.command("rebuild [services...]").description("Rebuild Docker images for specified services or all services").option("--no-cache","Force rebuild Docker images without using cache").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images..."),e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let n=await io(de,Fe);if(n.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=n}let r=e.filter(n=>n==="frontend"||n==="backend"||n==="workbench");r.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await so(de,Fe,r,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${r.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});je.command("deploy-guide").description("Generate deployment guide and files for registry-based deployment").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--image-tag <tag>","Image tag (default: latest)").option("--registry <url>","Registry URL prefix (e.g., registry.gitlab.com/group/)").option("--output-dir <dir>","Output directory (default: current directory)").option("--generate-files","Generate separate files for local testing").option("--return-only","Output to stdout only (no file generation)").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async e=>{try{if(f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),e.returnOnly){let n={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},o=await Dh(de,n);console.log(o),process.exit(0)}let t={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},r=await $h(de,t);f.success("Deployment guide generated!"),r.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${r.outputPath}`)),f.raw(h.yellow("\u{1F4A1} Use these files for local testing")),f.raw(h.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(f.raw(h.cyan(`\u{1F4C4} Guide created: ${r.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch(t){f.error("Error generating deployment guide: "+t.message),process.exit(1)}});je.command("config").description("(Re)Configure Raclette Application").option("-c, --config <config>","configuration file","raclette.config.yaml").hook("preAction",rt).action(async e=>{console.log(h.bold.green("YO!")+h.bold.red(":"))});je.parse(process.argv);
|
|
1533
1533
|
/*!
|
|
1534
1534
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
1535
1535
|
*
|