@raclettejs/core 0.1.10 → 0.1.12
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 +59 -2
- package/dist/cli.js +104 -104
- package/dist/cli.js.map +7 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +7 -0
- package/package.json +32 -31
- package/services/backend/package.json +35 -45
- package/services/backend/src/core/payload/payloadTypes.ts +7 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.get.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.getAll.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/composition.model.ts +5 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/composition.schema.ts +1 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/composition.service.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.get.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.getAll.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/helpers/payload.ts +6 -2
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.get.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.getAll.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.get.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.getAll.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/index.ts +2 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.get.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.getAll.ts +6 -2
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/tag.service.ts +22 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.get.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.getAll.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.remove.ts +3 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/user.service.ts +1 -2
- package/services/backend/src/corePlugins/raclette__core/frontend/generated-config.ts +12 -12
- package/services/backend/src/domains/index.ts +3 -0
- package/services/backend/src/domains/system/collections.service.ts +119 -0
- package/services/backend/src/domains/system/index.ts +8 -0
- package/services/backend/src/domains/system/routes/index.ts +5 -0
- package/services/backend/src/domains/system/routes/route.collection.getAll.ts +61 -0
- package/services/backend/src/domains/system/routes/route.collection.remove.ts +93 -0
- package/services/backend/src/types/custom-fastify.d.ts +1 -0
- package/services/backend/src/utils/request.utils.ts +28 -1
- package/services/backend/yarn.lock +431 -1180
- package/services/frontend/package.json +29 -40
- package/services/frontend/src/core/constants/ApiClient.ts +6 -1
- package/services/frontend/src/core/lib/data/dataApi.ts +8 -1
- package/services/frontend/src/core/lib/data/fetchDataHandler.ts +58 -27
- package/services/frontend/src/core/lib/data/queryApi.ts +29 -8
- package/services/frontend/src/core/lib/data/responseTypeHandler.ts +27 -4
- package/services/frontend/src/core/lib/data/writeDataHandler.ts +1 -1
- package/services/frontend/src/core/lib/dataHelper.ts +8 -1
- package/services/frontend/src/core/lib/easteregg.ts +1 -1
- package/services/frontend/src/core/lib/eventEmitter.ts +1 -0
- package/services/frontend/src/core/lib/eventWhitelist.ts +11 -1
- package/services/frontend/src/core/lib/logger.ts +11 -3
- package/services/frontend/src/core/lib/userNotifier.ts +17 -17
- package/services/frontend/src/core/main.ts +3 -3
- package/services/frontend/src/core/setup/plugin-system/api/wrappers.ts +18 -1
- package/services/frontend/src/core/setup/plugin-system/registration/index.ts +1 -1
- package/services/frontend/src/core/setup/socketClient.ts +2 -2
- package/services/frontend/src/core/setup/socketEvents.ts +2 -2
- package/services/frontend/src/core/store/reducers/compositions/selectors.ts +2 -2
- package/services/frontend/src/core/store/reducers/data/index.ts +1 -1
- package/services/frontend/src/core/store/reducers/data/reducers.ts +3 -3
- package/services/frontend/src/core/store/reducers/queries/effects.ts +20 -1
- package/services/frontend/src/core/store/reducers/queries/index.ts +1 -0
- package/services/frontend/src/core/store/reducers/queries/reducers.ts +28 -1
- package/services/frontend/src/core/store/reducers/queriesCache/queryCacheHelper.ts +5 -4
- package/services/frontend/src/core/store/reducers/queriesCache/reducers.ts +4 -3
- package/services/frontend/src/core/store/state.ts +1 -1
- package/services/frontend/src/core/types/ApiClient.ts +1 -1
- package/services/frontend/src/core/types/DataApi.ts +4 -0
- package/services/frontend/src/core/types/Queries.ts +1 -0
- package/services/frontend/src/orchestrator/ProductOrchestrator.vue +19 -7
- package/services/frontend/src/orchestrator/WelcomeScreen.vue +39 -41
- package/services/frontend/src/orchestrator/assets/styles/tailwindStyles.css +3 -0
- package/services/frontend/src/orchestrator/assets/styles/themes/dark.ts +2 -2
- package/services/frontend/src/orchestrator/assets/styles/vuetifyStyles.scss +0 -1
- package/services/frontend/src/orchestrator/components/composition/CompositionOverlay.vue +11 -2
- package/services/frontend/src/orchestrator/components/composition/WidgetsLayoutLoader.vue +167 -58
- package/services/frontend/src/orchestrator/components/menu/DevIndicator.vue +122 -7
- package/services/frontend/src/orchestrator/components/menu/UserMenu.vue +38 -20
- package/services/frontend/src/orchestrator/components/snackbar/SnackStack.vue +17 -5
- package/services/frontend/src/orchestrator/composables/useCurrentComposition.ts +32 -4
- package/services/frontend/src/orchestrator/composables/usePageNavigation.ts +5 -1
- package/services/frontend/src/orchestrator/composables/usePluginApi.ts +125 -26
- package/services/frontend/src/orchestrator/composables/useRouteState.ts +0 -1
- package/services/frontend/src/orchestrator/composables/useVueQueryObservableHelper.ts +2 -0
- package/services/frontend/src/orchestrator/composables/useVueWriteOperationHelper.ts +5 -3
- package/services/frontend/src/orchestrator/composables/useWidgets/helperFunctions.ts +4 -1
- package/services/frontend/src/orchestrator/helpers/loginUserNotifications.ts +1 -1
- package/services/frontend/src/orchestrator/helpers/uiHelper.ts +1 -1
- package/services/frontend/src/orchestrator/i18n/de-DE.json +2 -1
- package/services/frontend/src/orchestrator/i18n/en-EU.json +2 -1
- package/services/frontend/src/orchestrator/i18n/sk.json +2 -1
- package/services/frontend/src/orchestrator/i18n/tl-TL.json +1 -1
- package/services/frontend/src/orchestrator/router/routeParserHelper.ts +4 -1
- package/services/frontend/src/orchestrator/router/routeStore.ts +78 -11
- package/services/frontend/tsconfig.app.json +1 -0
- package/services/frontend/yarn.lock +796 -1872
- package/yarn.lock +435 -618
package/dist/cli.js
CHANGED
|
@@ -1,98 +1,101 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
|
-
var
|
|
4
|
-
`)}displayWidth(t){return
|
|
5
|
-
`+" ".repeat(r+c)),s+a+" ".repeat(c)+
|
|
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()],
|
|
7
|
-
`)}};function
|
|
3
|
+
var gf=Object.create;var Hn=Object.defineProperty;var yf=Object.getOwnPropertyDescriptor;var bf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,_f=Object.prototype.hasOwnProperty;var I=(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 rt=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ef=(e,t)=>{for(var r in t)Hn(e,r,{get:t[r],enumerable:!0})},kf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bf(t))!_f.call(e,o)&&o!==r&&Hn(e,o,{get:()=>t[o],enumerable:!(n=yf(t,o))||n.enumerable});return e};var Yt=(e,t,r)=>(r=e!=null?gf(vf(e)):{},kf(t||!e||!e.__esModule?Hn(r,"default",{value:e,enumerable:!0}):r,e));var zt=E(Yn=>{var Ar=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}},qn=class extends Ar{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Yn.CommanderError=Ar;Yn.InvalidArgumentError=qn});var Sr=E(Xn=>{var{InvalidArgumentError:Ff}=zt(),Kn=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 Ff(`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 Mf(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Xn.Argument=Kn;Xn.humanReadableArgName=Mf});var Jn=E(Qn=>{var{humanReadableArgName:Bf}=Sr(),zn=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=>Bf(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(d,p){return r.formatItem(d,n,p,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(d=>i(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,p)=>{let g=d.map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(p,g,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(p=>i(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,p)=>{let g=d.map(m=>i(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(p,g,r))}),s.join(`
|
|
4
|
+
`)}displayWidth(t){return ia(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,d;return l<this.minWidthToWrap||o.preformatted(n)?d=n:d=o.boxWrap(n,l).replace(/\n/g,`
|
|
5
|
+
`+" ".repeat(r+c)),s+a+" ".repeat(c)+d.replace(/\n/g,`
|
|
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 d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}i.push(c.join(""));let p=l.trimStart();c=[p],u=this.displayWidth(p)}),i.push(c.join(""))}),i.join(`
|
|
7
|
+
`)}};function ia(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Qn.Help=zn;Qn.stripColor=ia});var ro=E(to=>{var{InvalidArgumentError:Hf}=zt(),Zn=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=Vf(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 Hf(`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?sa(this.name().replace(/^no-/,"")):sa(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}},eo=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 sa(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Vf(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=Zn;to.DualOptions=eo});var ca=E(aa=>{function Gf(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 Wf(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=Gf(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.
|
|
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]}?)`:""}aa.suggestSimilar=Wf});var pa=E(ao=>{var Uf=I("node:events").EventEmitter,no=I("node:child_process"),We=I("node:path"),Rr=I("node:fs"),F=I("node:process"),{Argument:qf,humanReadableArgName:Yf}=Sr(),{CommanderError:oo}=zt(),{Help:Kf,stripColor:Xf}=Jn(),{Option:la,DualOptions:zf}=ro(),{suggestSimilar:ua}=ca(),io=class e extends Uf{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=>F.stdout.write(r),writeErr:r=>F.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>F.stdout.isTTY?F.stdout.columns:void 0,getErrHelpWidth:()=>F.stderr.isTTY?F.stderr.columns:void 0,getOutHasColors:()=>so()??(F.stdout.isTTY&&F.stdout.hasColors?.()),getErrHasColors:()=>so()??(F.stderr.isTTY&&F.stderr.hasColors?.()),stripColor:r=>Xf(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 Kf,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 qf(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 oo(t,r,n)),F.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 la(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 la)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){F.versions?.electron&&(r.from="electron");let o=F.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=F.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":F.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(Rr.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(
|
|
22
|
+
- ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,d){let p=We.resolve(l,d);if(Rr.existsSync(p))return p;if(o.includes(We.extname(d)))return;let g=o.find(m=>Rr.existsSync(`${p}${m}`));if(g)return`${p}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Rr.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=We.resolve(We.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!t._executableFile&&this._scriptPath){let d=We.basename(this._scriptPath,We.extname(this._scriptPath));d!==this._name&&(l=i(a,`${d}-${t._name}`))}s=l||s}n=o.includes(We.extname(s));let c;F.platform!=="win32"?n?(r.unshift(s),r=da(F.execArgv).concat(r),c=no.spawn(F.argv[0],r,{stdio:"inherit"})):c=no.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=da(F.execArgv).concat(r),c=no.spawn(F.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{F.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new oo(l,"commander.executeSubCommandAsync","(close)")):F.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)F.exit(1);else{let d=new oo(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),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+(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!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 d=this._findOption(l);if(d){if(d.required){let p=t[u++];p===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,p)}else if(d.optional){let p=null;u<t.length&&(!i(t[u])||s(t[u]))&&(p=t[u++]),this.emit(`option:${d.name()}`,p)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),p=this._findOption(l.slice(0,d));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,l.slice(d+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 F.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()}`,F.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 F.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()}`,F.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new zf(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(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.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=ua(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=ua(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=>Yf(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=We.basename(t,We.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(F.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 ih(e){e=e||{};let t=ka(e);e.path=t;let r=se.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=Ea(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=ah(r,a);i=se.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return se.parse(i)}function sh(e){console.error(`[dotenv@${lo}][WARN] ${e}`)}function zt(e){console.log(`[dotenv@${lo}][DEBUG] ${e}`)}function _a(e){console.log(`[dotenv@${lo}] ${e}`)}function Ea(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 ah(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 ka(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)co.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Tr.resolve(process.cwd(),".env.vault");return co.existsSync(t)?t:null}function va(e){return e[0]==="~"?Tr.join(Qf.homedir(),e.slice(1)):e}function ch(e){let t=xt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=xt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&_a("Loading env from encrypted .env.vault");let n=se._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),se.populate(o,n,e),{parsed:n}}function lh(e){let t=Tr.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=xt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=xt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&zt("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[va(e.path)];else{s=[];for(let u of e.path)s.push(va(u))}let a,c={};for(let u of s)try{let p=se.parse(co.readFileSync(u,{encoding:r}));se.populate(c,p,e)}catch(p){o&&zt(`Failed to load ${u} ${p.message}`),a=p}let l=se.populate(n,c,e);if(o=xt(n.DOTENV_CONFIG_DEBUG||o),i=xt(n.DOTENV_CONFIG_QUIET||i),o||!i){let u=Object.keys(l).length,p=[];for(let d of s)try{let g=Tr.relative(process.cwd(),d);p.push(g)}catch(g){o&&zt(`Failed to load ${d} ${g.message}`),a=g}_a(`injecting env (${u}) from ${p.join(",")} ${rh(`(tip: ${eh()})`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function uh(e){if(Ea(e).length===0)return se.configDotenv(e);let t=ka(e);return t?se._configVault(e):(sh(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),se.configDotenv(e))}function ph(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=Jf.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",l=s.message==="Unsupported state or unable to authenticate data";if(a||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw s}}function dh(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&&zt(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 se={configDotenv:lh,_configVault:ch,_parseVault:ih,config:uh,decrypt:ph,parse:oh,populate:dh};qe.exports.configDotenv=se.configDotenv;qe.exports._configVault=se._configVault;qe.exports._parseVault=se._parseVault;qe.exports.config=se.config;qe.exports.decrypt=se.decrypt;qe.exports.parse=se.parse;qe.exports.populate=se.populate;qe.exports=se});import{on as ny,once as oy}from"node:events";import{PassThrough as iy}from"node:stream";import{finished as el}from"node:stream/promises";function Lo(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Do(o);let t=e.some(({readableObjectMode:o})=>o),r=sy(e,t),n=new $o({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&nl(n),n}var sy,$o,ay,cy,ly,Do,uy,tl,py,dy,fy,rl,nl,No,ol,hy,Qr,Jc,Zc,il=tt(()=>{sy=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},$o=class extends iy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){Do(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=ay(this,this.#e),uy({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return Do(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},ay=async(e,t)=>{Qr(e,Jc);let r=new AbortController;try{await Promise.race([cy(e,r),ly(e,t,r)])}finally{r.abort(),Qr(e,-Jc)}},cy=async(e,{signal:t})=>{await el(e,{signal:t,cleanup:!0})},ly=async(e,t,{signal:r})=>{for await(let[n]of ny(e,"unpipe",{signal:r}))t.has(n)&&n.emit(rl)},Do=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},uy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{Qr(e,Zc);let s=new AbortController;try{await Promise.race([py(i,t),dy({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),fy({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),Qr(e,-Zc)}r.size===n.size+o.size&&(n.size===0&&o.size>0?No(e):nl(e))},tl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",py=async(e,t)=>{try{await e,No(t)}catch(r){tl(r)?No(t):ol(t,r)}},dy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await el(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;tl(s)?o.add(t):ol(e,s)}},fy=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await oy(e,rl,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},rl=Symbol("unpipe"),nl=e=>{e.writable&&e.end()},No=e=>{(e.readable||e.writable)&&e.destroy()},ol=(e,t)=>{e.destroyed||(e.once("error",hy),e.destroy(t))},hy=()=>{},Qr=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Jc=2,Zc=1});var sl=E($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.splitWhen=$t.flatten=void 0;function my(e){return e.reduce((t,r)=>[].concat(t,r),[])}$t.flatten=my;function gy(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}$t.splitWhen=gy});var al=E(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isEnoentCodeError=void 0;function yy(e){return e.code==="ENOENT"}Jr.isEnoentCodeError=yy});var cl=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.createDirentFromStats=void 0;var Io=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 by(e,t){return new Io(e,t)}Zr.createDirentFromStats=by});var dl=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.convertPosixPathToPattern=oe.convertWindowsPathToPattern=oe.convertPathToPattern=oe.escapePosixPath=oe.escapeWindowsPath=oe.escape=oe.removeLeadingDotSegment=oe.makeAbsolute=oe.unixify=void 0;var vy=I("os"),_y=I("path"),ll=vy.platform()==="win32",Ey=2,ky=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,xy=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,wy=/^\\\\([.?])/,Cy=/\\(?![!()+@[\]{}])/g;function Ay(e){return e.replace(/\\/g,"/")}oe.unixify=Ay;function Sy(e,t){return _y.resolve(e,t)}oe.makeAbsolute=Sy;function Ry(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(Ey)}return e}oe.removeLeadingDotSegment=Ry;oe.escape=ll?jo:Fo;function jo(e){return e.replace(xy,"\\$2")}oe.escapeWindowsPath=jo;function Fo(e){return e.replace(ky,"\\$2")}oe.escapePosixPath=Fo;oe.convertPathToPattern=ll?ul:pl;function ul(e){return jo(e).replace(wy,"//$1").replace(Cy,"/")}oe.convertWindowsPathToPattern=ul;function pl(e){return Fo(e)}oe.convertPosixPathToPattern=pl});var hl=E((TC,fl)=>{fl.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 yl=E((PC,gl)=>{var Oy=hl(),ml={"{":"}","(":")","[":"]"},Ty=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=ml[a];if(c){var l=e.indexOf(c,t);l!==-1&&(t=l+1)}if(e[t]==="!")return!0}else t++}return!1},Py=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=ml[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};gl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Oy(t))return!0;var n=Ty;return r&&r.strict===!1&&(n=Py),n(t)}});var vl=E(($C,bl)=>{"use strict";var $y=yl(),Dy=I("path").posix.dirname,Ny=I("os").platform()==="win32",Mo="/",Ly=/\\/g,Iy=/[\{\[].*[\}\]]$/,jy=/(^|[^\\])([\{\[]|\([^\)]+$)/,Fy=/\\([\!\*\?\|\[\]\(\)\{\}])/g;bl.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Ny&&t.indexOf(Mo)<0&&(t=t.replace(Ly,Mo)),Iy.test(t)&&(t+=Mo),t+="a";do t=Dy(t);while($y(t)||jy.test(t));return t.replace(Fy,"$1")}});var en=E(Ae=>{"use strict";Ae.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Ae.find=(e,t)=>e.nodes.find(r=>r.type===t);Ae.exceedsLimit=(e,t,r=1,n)=>n===!1||!Ae.isInteger(e)||!Ae.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Ae.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)};Ae.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Ae.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;Ae.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Ae.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Ae.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 tn=E((NC,El)=>{"use strict";var _l=en();El.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&_l.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&_l.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 xl=E((LC,kl)=>{"use strict";kl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var $l=E((IC,Pl)=>{"use strict";var wl=xl(),bt=(e,t,r)=>{if(wl(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(wl(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(bt.cache.hasOwnProperty(c))return bt.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(Math.abs(l-u)===1){let y=e+"|"+t;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let p=Tl(e)||Tl(t),d={min:e,max:t,a:l,b:u},g=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),l<0){let y=u<0?Math.abs(u):1;m=Cl(y,Math.abs(l),d,n),l=d.a=0}return u>=0&&(g=Cl(l,u,d,n)),d.negatives=m,d.positives=g,d.result=My(m,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+m.length>1&&(d.result=`(?:${d.result})`),bt.cache[c]=d,d.result};function My(e,t,r){let n=Bo(e,t,"-",!1,r)||[],o=Bo(t,e,"",!1,r)||[],i=Bo(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function By(e,t){let r=1,n=1,o=Sl(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=Sl(e,r);for(o=Rl(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Rl(t+1,n)-1;return i=[...i],i.sort(Gy),i}function Hy(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Vy(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,l]=n[a];c===l?i+=c:c!=="0"||l!=="9"?i+=Uy(c,l,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Cl(e,t,r,n){let o=By(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let l=o[c],u=Hy(String(s),String(l),n),p="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+Ol(a.count),s=l+1;continue}r.isPadded&&(p=Wy(l,r,n)),u.string=p+u.pattern+Ol(u.count),i.push(u),s=l+1,a=u}return i}function Bo(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Al(t,"string",a)&&i.push(r+a),n&&Al(t,"string",a)&&i.push(r+a)}return i}function Vy(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Gy(e,t){return e>t?1:t>e?-1:0}function Al(e,t,r){return e.some(n=>n[t]===r)}function Sl(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Rl(e,t){return e-e%Math.pow(10,t)}function Ol(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Uy(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Tl(e){return/^-?(0+)\d/.test(e)}function Wy(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}}`}}bt.cache={};bt.clearCache=()=>bt.cache={};Pl.exports=bt});var Go=E((jC,Ml)=>{"use strict";var qy=I("util"),Nl=$l(),Dl=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yy=e=>t=>e===!0?Number(t):String(t),Ho=e=>typeof e=="number"||typeof e=="string"&&e!=="",sr=e=>Number.isInteger(+e),Vo=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Ky=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Xy=(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},nn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},zy=(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=>nn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>nn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},Ll=(e,t,r,n)=>{if(r)return Nl(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},Il=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Nl(e,t,r)},jl=(...e)=>new RangeError("Invalid range arguments: "+qy.inspect(...e)),Fl=(e,t,r)=>{if(r.strictRanges===!0)throw jl([e,t]);return[]},Qy=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Jy=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw jl([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),l=String(r);r=Math.max(Math.abs(r),1);let u=Vo(a)||Vo(c)||Vo(l),p=u?Math.max(a.length,c.length,l.length):0,d=u===!1&&Ky(e,t,n)===!1,g=n.transform||Yy(d);if(n.toRegex&&r===1)return Ll(nn(e,p),nn(t,p),!0,n);let m={negatives:[],positives:[]},y=O=>m[O<0?"negatives":"positives"].push(Math.abs(O)),k=[],R=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?y(o):k.push(Xy(g(o,R),p,d)),o=s?o-r:o+r,R++;return n.toRegex===!0?r>1?zy(m,n,p):Il(k,null,{wrap:!1,...n}):k},Zy=(e,t,r=1,n={})=>{if(!sr(e)&&e.length>1||!sr(t)&&t.length>1)return Fl(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),l=Math.max(i,s);if(n.toRegex&&r===1)return Ll(c,l,!1,n);let u=[],p=0;for(;a?i>=s:i<=s;)u.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?Il(u,null,{wrap:!1,options:n}):u},rn=(e,t,r,n={})=>{if(t==null&&Ho(e))return[e];if(!Ho(e)||!Ho(t))return Fl(e,t,n);if(typeof r=="function")return rn(e,t,1,{transform:r});if(Dl(r))return rn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,sr(r)?sr(e)&&sr(t)?Jy(e,t,r,o):Zy(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Dl(r)?Qy(r,o):rn(e,t,1,r)};Ml.exports=rn});var Vl=E((FC,Hl)=>{"use strict";var eb=Go(),Bl=en(),tb=(e,t={})=>{let r=(n,o={})=>{let i=Bl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",l="";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 u=Bl.reduce(n.nodes),p=eb(...u,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return u.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let u of n.nodes)l+=r(u,n);return l};return r(e)};Hl.exports=tb});var Wl=E((MC,Ul)=>{"use strict";var rb=Go(),Gl=tn(),Dt=en(),vt=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Dt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(vt(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?vt(o,i,r):o+i);return Dt.flatten(n)},nb=(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(vt(a.pop(),Gl(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(vt(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Dt.reduce(o.nodes);if(Dt.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=rb(...p,t);d.length===0&&(d=Gl(o,t)),a.push(vt(a.pop(),d)),o.nodes=[];return}let c=Dt.encloseBrace(o),l=o.queue,u=o;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&l.push(""),l.push("");continue}if(d.type==="close"){a.push(vt(a.pop(),l,c));continue}if(d.value&&d.type!=="open"){l.push(vt(l.pop(),d.value));continue}d.nodes&&n(d,o)}return l};return Dt.flatten(n(e))};Ul.exports=nb});var Yl=E((BC,ql)=>{"use strict";ql.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 Jl=E((HC,Ql)=>{"use strict";var ob=tn(),{MAX_LENGTH:Kl,CHAR_BACKSLASH:Uo,CHAR_BACKTICK:ib,CHAR_COMMA:sb,CHAR_DOT:ab,CHAR_LEFT_PARENTHESES:cb,CHAR_RIGHT_PARENTHESES:lb,CHAR_LEFT_CURLY_BRACE:ub,CHAR_RIGHT_CURLY_BRACE:pb,CHAR_LEFT_SQUARE_BRACKET:Xl,CHAR_RIGHT_SQUARE_BRACKET:zl,CHAR_DOUBLE_QUOTE:db,CHAR_SINGLE_QUOTE:fb,CHAR_NO_BREAK_SPACE:hb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:mb}=Yl(),gb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Kl,r.maxLength):Kl;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,l=e.length,u=0,p=0,d,g=()=>e[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return s.nodes.push(y),y.parent=s,y.prev=a,a=y,y};for(m({type:"bos"});u<l;)if(s=i[i.length-1],d=g(),!(d===mb||d===hb)){if(d===Uo){m({type:"text",value:(t.keepEscaping?d:"")+g()});continue}if(d===zl){m({type:"text",value:"\\"+d});continue}if(d===Xl){c++;let y;for(;u<l&&(y=g());){if(d+=y,y===Xl){c++;continue}if(y===Uo){d+=g();continue}if(y===zl&&(c--,c===0))break}m({type:"text",value:d});continue}if(d===cb){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:d});continue}if(d===lb){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===db||d===fb||d===ib){let y=d,k;for(t.keepQuotes!==!0&&(d="");u<l&&(k=g());){if(k===Uo){d+=k+g();continue}if(k===y){t.keepQuotes===!0&&(d+=k);break}d+=k}m({type:"text",value:d});continue}if(d===ub){p++;let k={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(k),i.push(s),m({type:"open",value:d});continue}if(d===pb){if(s.type!=="brace"){m({type:"text",value:d});continue}let y="close";s=i.pop(),s.close=!0,m({type:y,value:d}),p--,s=i[i.length-1];continue}if(d===sb&&p>0){if(s.ranges>0){s.ranges=0;let y=s.nodes.shift();s.nodes=[y,{type:"text",value:ob(s)}]}m({type:"comma",value:d}),s.commas++;continue}if(d===ab&&p>0&&s.commas===0){let y=s.nodes;if(p===0||y.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"){y.pop();let k=y[y.length-1];k.value+=a.value+d,a=k,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(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let y=i[i.length-1],k=y.nodes.indexOf(s);y.nodes.splice(k,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};Ql.exports=gb});var tu=E((VC,eu)=>{"use strict";var Zl=tn(),yb=Vl(),bb=Wl(),vb=Jl(),Ee=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ee.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ee.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.parse=(e,t={})=>vb(e,t);Ee.stringify=(e,t={})=>Zl(typeof e=="string"?Ee.parse(e,t):e,t);Ee.compile=(e,t={})=>(typeof e=="string"&&(e=Ee.parse(e,t)),yb(e,t));Ee.expand=(e,t={})=>{typeof e=="string"&&(e=Ee.parse(e,t));let r=bb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ee.compile(e,t):Ee.expand(e,t);eu.exports=Ee});var ar=E((GC,su)=>{"use strict";var _b=I("path"),He="\\\\/",ru=`[^${He}]`,Xe="\\.",Eb="\\+",kb="\\?",on="\\/",xb="(?=.)",nu="[^/]",Wo=`(?:${on}|$)`,ou=`(?:^|${on})`,qo=`${Xe}{1,2}${Wo}`,wb=`(?!${Xe})`,Cb=`(?!${ou}${qo})`,Ab=`(?!${Xe}{0,1}${Wo})`,Sb=`(?!${qo})`,Rb=`[^.${on}]`,Ob=`${nu}*?`,iu={DOT_LITERAL:Xe,PLUS_LITERAL:Eb,QMARK_LITERAL:kb,SLASH_LITERAL:on,ONE_CHAR:xb,QMARK:nu,END_ANCHOR:Wo,DOTS_SLASH:qo,NO_DOT:wb,NO_DOTS:Cb,NO_DOT_SLASH:Ab,NO_DOTS_SLASH:Sb,QMARK_NO_DOT:Rb,STAR:Ob,START_ANCHOR:ou},Tb={...iu,SLASH_LITERAL:`[${He}]`,QMARK:ru,STAR:`${ru}*?`,DOTS_SLASH:`${Xe}{1,2}(?:[${He}]|$)`,NO_DOT:`(?!${Xe})`,NO_DOTS:`(?!(?:^|[${He}])${Xe}{1,2}(?:[${He}]|$))`,NO_DOT_SLASH:`(?!${Xe}{0,1}(?:[${He}]|$))`,NO_DOTS_SLASH:`(?!${Xe}{1,2}(?:[${He}]|$))`,QMARK_NO_DOT:`[^.${He}]`,START_ANCHOR:`(?:^|[${He}])`,END_ANCHOR:`(?:[${He}]|$)`},Pb={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"};su.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Pb,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:{"***":"*","**/**":"**","**/**/**":"**"},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:_b.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?Tb:iu}}});var cr=E(ve=>{"use strict";var $b=I("path"),Db=process.platform==="win32",{REGEX_BACKSLASH:Nb,REGEX_REMOVE_BACKSLASH:Lb,REGEX_SPECIAL_CHARS:Ib,REGEX_SPECIAL_CHARS_GLOBAL:jb}=ar();ve.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ve.hasRegexChars=e=>Ib.test(e);ve.isRegexChar=e=>e.length===1&&ve.hasRegexChars(e);ve.escapeRegex=e=>e.replace(jb,"\\$1");ve.toPosixSlashes=e=>e.replace(Nb,"/");ve.removeBackslashes=e=>e.replace(Lb,t=>t==="\\"?"":t);ve.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ve.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Db===!0||$b.sep==="\\";ve.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ve.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ve.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ve.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var hu=E((WC,fu)=>{"use strict";var au=cr(),{CHAR_ASTERISK:Yo,CHAR_AT:Fb,CHAR_BACKWARD_SLASH:lr,CHAR_COMMA:Mb,CHAR_DOT:Ko,CHAR_EXCLAMATION_MARK:Xo,CHAR_FORWARD_SLASH:du,CHAR_LEFT_CURLY_BRACE:zo,CHAR_LEFT_PARENTHESES:Qo,CHAR_LEFT_SQUARE_BRACKET:Bb,CHAR_PLUS:Hb,CHAR_QUESTION_MARK:cu,CHAR_RIGHT_CURLY_BRACE:Vb,CHAR_RIGHT_PARENTHESES:lu,CHAR_RIGHT_SQUARE_BRACKET:Gb}=ar(),uu=e=>e===du||e===lr,pu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Ub=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,l=-1,u=0,p=0,d=!1,g=!1,m=!1,y=!1,k=!1,R=!1,O=!1,K=!1,xe=!1,N=!1,X=0,P,T,M={value:"",depth:0,isGlob:!1},le=()=>l>=n,_=()=>c.charCodeAt(l+1),z=()=>(P=T,c.charCodeAt(++l));for(;l<n;){T=z();let he;if(T===lr){O=M.backslashes=!0,T=z(),T===zo&&(R=!0);continue}if(R===!0||T===zo){for(X++;le()!==!0&&(T=z());){if(T===lr){O=M.backslashes=!0,z();continue}if(T===zo){X++;continue}if(R!==!0&&T===Ko&&(T=z())===Ko){if(d=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(R!==!0&&T===Mb){if(d=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Vb&&(X--,X===0)){R=!1,d=M.isBrace=!0,N=!0;break}}if(o===!0)continue;break}if(T===du){if(i.push(l),s.push(M),M={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===Ko&&l===u+1){u+=2;continue}p=l+1;continue}if(r.noext!==!0&&(T===Hb||T===Fb||T===Yo||T===cu||T===Xo)===!0&&_()===Qo){if(m=M.isGlob=!0,y=M.isExtglob=!0,N=!0,T===Xo&&l===u&&(xe=!0),o===!0){for(;le()!==!0&&(T=z());){if(T===lr){O=M.backslashes=!0,T=z();continue}if(T===lu){m=M.isGlob=!0,N=!0;break}}continue}break}if(T===Yo){if(P===Yo&&(k=M.isGlobstar=!0),m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===cu){if(m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Bb){for(;le()!==!0&&(he=z());){if(he===lr){O=M.backslashes=!0,z();continue}if(he===Gb){g=M.isBracket=!0,m=M.isGlob=!0,N=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&T===Xo&&l===u){K=M.negated=!0,u++;continue}if(r.noparen!==!0&&T===Qo){if(m=M.isGlob=!0,o===!0){for(;le()!==!0&&(T=z());){if(T===Qo){O=M.backslashes=!0,T=z();continue}if(T===lu){N=!0;break}}continue}break}if(m===!0){if(N=!0,o===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let W=c,et="",b="";u>0&&(et=c.slice(0,u),c=c.slice(u),p-=u),W&&m===!0&&p>0?(W=c.slice(0,p),b=c.slice(p)):m===!0?(W="",b=c):W=c,W&&W!==""&&W!=="/"&&W!==c&&uu(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),r.unescape===!0&&(b&&(b=au.removeBackslashes(b)),W&&O===!0&&(W=au.removeBackslashes(W)));let v={prefix:et,input:e,start:u,base:W,glob:b,isBrace:d,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:k,negated:K,negatedExtglob:xe};if(r.tokens===!0&&(v.maxDepth=0,uu(T)||s.push(M),v.tokens=s),r.parts===!0||r.tokens===!0){let he;for(let j=0;j<i.length;j++){let Ie=he?he+1:u,je=i[j],_e=e.slice(Ie,je);r.tokens&&(j===0&&u!==0?(s[j].isPrefix=!0,s[j].value=et):s[j].value=_e,pu(s[j]),v.maxDepth+=s[j].depth),(j!==0||_e!=="")&&a.push(_e),he=je}if(he&&he+1<e.length){let j=e.slice(he+1);a.push(j),r.tokens&&(s[s.length-1].value=j,pu(s[s.length-1]),v.maxDepth+=s[s.length-1].depth)}v.slashes=i,v.parts=a}return v};fu.exports=Ub});var yu=E((qC,gu)=>{"use strict";var sn=ar(),ke=cr(),{MAX_LENGTH:an,POSIX_REGEX_SOURCE:Wb,REGEX_NON_SPECIAL_CHARS:qb,REGEX_SPECIAL_CHARS_BACKREF:Yb,REPLACEMENTS:mu}=sn,Kb=(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=>ke.escapeRegex(o)).join("..")}return r},Nt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Jo=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=mu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(an,r.maxLength):an,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=ke.isWindows(t),l=sn.globChars(c),u=sn.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:k,NO_DOT_SLASH:R,NO_DOTS_SLASH:O,QMARK:K,QMARK_NO_DOT:xe,STAR:N,START_ANCHOR:X}=l,P=w=>`(${a}(?:(?!${X}${w.dot?y:p}).)*?)`,T=r.dot?"":k,M=r.dot?K:xe,le=r.bash===!0?P(r):N;r.capture&&(le=`(${le})`),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=ke.removePrefix(e,_),o=e.length;let z=[],W=[],et=[],b=i,v,he=()=>_.index===o-1,j=_.peek=(w=1)=>e[_.index+w],Ie=_.advance=()=>e[++_.index]||"",je=()=>e.slice(_.index+1),_e=(w="",q=0)=>{_.consumed+=w,_.index+=q},Er=w=>{_.output+=w.output!=null?w.output:w.value,_e(w.value)},pf=()=>{let w=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Ie(),_.start++,w++;return w%2===0?!1:(_.negated=!0,_.start++,!0)},kr=w=>{_[w]++,et.push(w)},ft=w=>{_[w]--,et.pop()},L=w=>{if(b.type==="globstar"){let q=_.braces>0&&(w.type==="comma"||w.type==="brace"),x=w.extglob===!0||z.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!q&&!x&&(_.output=_.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=le,_.output+=b.output)}if(z.length&&w.type!=="paren"&&(z[z.length-1].inner+=w.value),(w.value||w.output)&&Er(w),b&&b.type==="text"&&w.type==="text"){b.value+=w.value,b.output=(b.output||"")+w.value;return}w.prev=b,s.push(w),b=w},xr=(w,q)=>{let x={...u[q],conditions:1,inner:""};x.prev=b,x.parens=_.parens,x.output=_.output;let D=(r.capture?"(":"")+x.open;kr("parens"),L({type:w,value:q,output:_.output?"":m}),L({type:"paren",extglob:!0,value:Ie(),output:D}),z.push(x)},df=w=>{let q=w.close+(r.capture?")":""),x;if(w.type==="negate"){let D=le;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(D=P(r)),(D!==le||he()||/^\)+$/.test(je()))&&(q=w.close=`)$))${D}`),w.inner.includes("*")&&(x=je())&&/^\.[^\\/.]+$/.test(x)){let ee=Jo(x,{...t,fastpaths:!1}).output;q=w.close=`)${ee})${D})`}w.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:v,output:q}),ft("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let w=!1,q=e.replace(Yb,(x,D,ee,me,ie,Mn)=>me==="\\"?(w=!0,x):me==="?"?D?D+me+(ie?K.repeat(ie.length):""):Mn===0?M+(ie?K.repeat(ie.length):""):K.repeat(ee.length):me==="."?p.repeat(ee.length):me==="*"?D?D+me+(ie?le:""):le:D?x:`\\${x}`);return w===!0&&(r.unescape===!0?q=q.replace(/\\/g,""):q=q.replace(/\\+/g,x=>x.length%2===0?"\\\\":x?"\\":"")),q===e&&r.contains===!0?(_.output=e,_):(_.output=ke.wrapOutput(q,_,t),_)}for(;!he();){if(v=Ie(),v==="\0")continue;if(v==="\\"){let x=j();if(x==="/"&&r.bash!==!0||x==="."||x===";")continue;if(!x){v+="\\",L({type:"text",value:v});continue}let D=/^\\+/.exec(je()),ee=0;if(D&&D[0].length>2&&(ee=D[0].length,_.index+=ee,ee%2!==0&&(v+="\\")),r.unescape===!0?v=Ie():v+=Ie(),_.brackets===0){L({type:"text",value:v});continue}}if(_.brackets>0&&(v!=="]"||b.value==="["||b.value==="[^")){if(r.posix!==!1&&v===":"){let x=b.value.slice(1);if(x.includes("[")&&(b.posix=!0,x.includes(":"))){let D=b.value.lastIndexOf("["),ee=b.value.slice(0,D),me=b.value.slice(D+2),ie=Wb[me];if(ie){b.value=ee+ie,_.backtrack=!0,Ie(),!i.output&&s.indexOf(b)===1&&(i.output=m);continue}}}(v==="["&&j()!==":"||v==="-"&&j()==="]")&&(v=`\\${v}`),v==="]"&&(b.value==="["||b.value==="[^")&&(v=`\\${v}`),r.posix===!0&&v==="!"&&b.value==="["&&(v="^"),b.value+=v,Er({value:v});continue}if(_.quotes===1&&v!=='"'){v=ke.escapeRegex(v),b.value+=v,Er({value:v});continue}if(v==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:v});continue}if(v==="("){kr("parens"),L({type:"paren",value:v});continue}if(v===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Nt("opening","("));let x=z[z.length-1];if(x&&_.parens===x.parens+1){df(z.pop());continue}L({type:"paren",value:v,output:_.parens?")":"\\)"}),ft("parens");continue}if(v==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Nt("closing","]"));v=`\\${v}`}else kr("brackets");L({type:"bracket",value:v});continue}if(v==="]"){if(r.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){L({type:"text",value:v,output:`\\${v}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Nt("opening","["));L({type:"text",value:v,output:`\\${v}`});continue}ft("brackets");let x=b.value.slice(1);if(b.posix!==!0&&x[0]==="^"&&!x.includes("/")&&(v=`/${v}`),b.value+=v,Er({value:v}),r.literalBrackets===!1||ke.hasRegexChars(x))continue;let D=ke.escapeRegex(b.value);if(_.output=_.output.slice(0,-b.value.length),r.literalBrackets===!0){_.output+=D,b.value=D;continue}b.value=`(${a}${D}|${b.value})`,_.output+=b.value;continue}if(v==="{"&&r.nobrace!==!0){kr("braces");let x={type:"brace",value:v,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};W.push(x),L(x);continue}if(v==="}"){let x=W[W.length-1];if(r.nobrace===!0||!x){L({type:"text",value:v,output:v});continue}let D=")";if(x.dots===!0){let ee=s.slice(),me=[];for(let ie=ee.length-1;ie>=0&&(s.pop(),ee[ie].type!=="brace");ie--)ee[ie].type!=="dots"&&me.unshift(ee[ie].value);D=Kb(me,r),_.backtrack=!0}if(x.comma!==!0&&x.dots!==!0){let ee=_.output.slice(0,x.outputIndex),me=_.tokens.slice(x.tokensIndex);x.value=x.output="\\{",v=D="\\}",_.output=ee;for(let ie of me)_.output+=ie.output||ie.value}L({type:"brace",value:v,output:D}),ft("braces"),W.pop();continue}if(v==="|"){z.length>0&&z[z.length-1].conditions++,L({type:"text",value:v});continue}if(v===","){let x=v,D=W[W.length-1];D&&et[et.length-1]==="braces"&&(D.comma=!0,x="|"),L({type:"comma",value:v,output:x});continue}if(v==="/"){if(b.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),b=i;continue}L({type:"slash",value:v,output:g});continue}if(v==="."){if(_.braces>0&&b.type==="dot"){b.value==="."&&(b.output=p);let x=W[W.length-1];b.type="dots",b.output+=v,b.value+=v,x.dots=!0;continue}if(_.braces+_.parens===0&&b.type!=="bos"&&b.type!=="slash"){L({type:"text",value:v,output:p});continue}L({type:"dot",value:v,output:p});continue}if(v==="?"){if(!(b&&b.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){xr("qmark",v);continue}if(b&&b.type==="paren"){let D=j(),ee=v;if(D==="<"&&!ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(je()))&&(ee=`\\${v}`),L({type:"text",value:v,output:ee});continue}if(r.dot!==!0&&(b.type==="slash"||b.type==="bos")){L({type:"qmark",value:v,output:xe});continue}L({type:"qmark",value:v,output:K});continue}if(v==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){xr("negate",v);continue}if(r.nonegate!==!0&&_.index===0){pf();continue}}if(v==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){xr("plus",v);continue}if(b&&b.value==="("||r.regex===!1){L({type:"plus",value:v,output:d});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||_.parens>0){L({type:"plus",value:v});continue}L({type:"plus",value:d});continue}if(v==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){L({type:"at",extglob:!0,value:v,output:""});continue}L({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let x=qb.exec(je());x&&(v+=x[0],_.index+=x[0].length),L({type:"text",value:v});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=v,b.output=le,_.backtrack=!0,_.globstar=!0,_e(v);continue}let w=je();if(r.noextglob!==!0&&/^\([^?]/.test(w)){xr("star",v);continue}if(b.type==="star"){if(r.noglobstar===!0){_e(v);continue}let x=b.prev,D=x.prev,ee=x.type==="slash"||x.type==="bos",me=D&&(D.type==="star"||D.type==="globstar");if(r.bash===!0&&(!ee||w[0]&&w[0]!=="/")){L({type:"star",value:v,output:""});continue}let ie=_.braces>0&&(x.type==="comma"||x.type==="brace"),Mn=z.length&&(x.type==="pipe"||x.type==="paren");if(!ee&&x.type!=="paren"&&!ie&&!Mn){L({type:"star",value:v,output:""});continue}for(;w.slice(0,3)==="/**";){let wr=e[_.index+4];if(wr&&wr!=="/")break;w=w.slice(3),_e("/**",3)}if(x.type==="bos"&&he()){b.type="globstar",b.value+=v,b.output=P(r),_.output=b.output,_.globstar=!0,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&!me&&he()){_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=P(r)+(r.strictSlashes?")":"|$)"),b.value+=v,_.globstar=!0,_.output+=x.output+b.output,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&w[0]==="/"){let wr=w[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=`${P(r)}${g}|${g}${wr})`,b.value+=v,_.output+=x.output+b.output,_.globstar=!0,_e(v+Ie()),L({type:"slash",value:"/",output:""});continue}if(x.type==="bos"&&w[0]==="/"){b.type="globstar",b.value+=v,b.output=`(?:^|${g}|${P(r)}${g})`,_.output=b.output,_.globstar=!0,_e(v+Ie()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-b.output.length),b.type="globstar",b.output=P(r),b.value+=v,_.output+=b.output,_.globstar=!0,_e(v);continue}let q={type:"star",value:v,output:le};if(r.bash===!0){q.output=".*?",(b.type==="bos"||b.type==="slash")&&(q.output=T+q.output),L(q);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&r.regex===!0){q.output=v,L(q);continue}(_.index===_.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(_.output+=R,b.output+=R):r.dot===!0?(_.output+=O,b.output+=O):(_.output+=T,b.output+=T),j()!=="*"&&(_.output+=m,b.output+=m)),L(q)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing","]"));_.output=ke.escapeLast(_.output,"["),ft("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing",")"));_.output=ke.escapeLast(_.output,"("),ft("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing","}"));_.output=ke.escapeLast(_.output,"{"),ft("braces")}if(r.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${g}?`}),_.backtrack===!0){_.output="";for(let w of _.tokens)_.output+=w.output!=null?w.output:w.value,w.suffix&&(_.output+=w.suffix)}return _};Jo.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(an,r.maxLength):an,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=mu[e]||e;let i=ke.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:m}=sn.globChars(i),y=r.dot?p:u,k=r.dot?d:u,R=r.capture?"":"?:",O={negated:!1,prefix:""},K=r.bash===!0?".*?":g;r.capture&&(K=`(${K})`);let xe=T=>T.noglobstar===!0?K:`(${R}(?:(?!${m}${T.dot?l:s}).)*?)`,N=T=>{switch(T){case"*":return`${y}${c}${K}`;case".*":return`${s}${c}${K}`;case"*.*":return`${y}${K}${s}${c}${K}`;case"*/*":return`${y}${K}${a}${c}${k}${K}`;case"**":return y+xe(r);case"**/*":return`(?:${y}${xe(r)}${a})?${k}${c}${K}`;case"**/*.*":return`(?:${y}${xe(r)}${a})?${k}${K}${s}${c}${K}`;case"**/.*":return`(?:${y}${xe(r)}${a})?${s}${c}${K}`;default:{let M=/^(.*?)\.(\w+)$/.exec(T);if(!M)return;let le=N(M[1]);return le?le+s+M[2]:void 0}}},X=ke.removePrefix(e,O),P=N(X);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};gu.exports=Jo});var vu=E((YC,bu)=>{"use strict";var Xb=I("path"),zb=hu(),Zo=yu(),ei=cr(),Qb=ar(),Jb=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let u=e.map(d=>re(d,t,r));return d=>{for(let g of u){let m=g(d);if(m)return m}return!1}}let n=Jb(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=ei.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 u={...t,ignore:null,onMatch:null,onResult:null};c=re(o.ignore,u,r)}let l=(u,p=!1)=>{let{isMatch:d,match:g,output:m}=re.test(u,s,t,{glob:e,posix:i}),y={glob:e,state:a,regex:s,posix:i,input:u,output:m,match:g,isMatch:d};return typeof o.onResult=="function"&&o.onResult(y),d===!1?(y.isMatch=!1,p?y:!1):c(u)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,p?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),p?y:!0)};return r&&(l.state=a),l};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?ei.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=ei.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(Xb.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)):Zo(e,{...t,fastpaths:!1});re.scan=(e,t)=>zb(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=Zo.fastpaths(e,t)),o.output||(o=Zo(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=Qb;bu.exports=re});var Eu=E((KC,_u)=>{"use strict";_u.exports=vu()});var Su=E((XC,Au)=>{"use strict";var xu=I("util"),wu=tu(),Ve=Eu(),ti=cr(),ku=e=>e===""||e==="./",Cu=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Y=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=u=>{i.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<t.length;u++){let p=Ve(String(t[u]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let g of e){let m=p(g,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let l=(s===t.length?[...i]:[...o]).filter(u=>!n.has(u));if(r&&l.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(u=>u.replace(/\\/g,"")):t}return l};Y.match=Y;Y.matcher=(e,t)=>Ve(e,t);Y.isMatch=(e,t,r)=>Ve(t,r)(e);Y.any=Y.isMatch;Y.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(Y(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};Y.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${xu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>Y.contains(e,n,r));if(typeof t=="string"){if(ku(e)||ku(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Y.isMatch(e,t,{...r,contains:!0})};Y.matchKeys=(e,t,r)=>{if(!ti.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=Y(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};Y.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Ve(String(o),r);if(n.some(s=>i(s)))return!0}return!1};Y.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Ve(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};Y.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${xu.inspect(e)}"`);return[].concat(t).every(n=>Ve(n,r)(e))};Y.capture=(e,t,r)=>{let n=ti.isWindows(r),i=Ve.makeRe(String(e),{...r,capture:!0}).exec(n?ti.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};Y.makeRe=(...e)=>Ve.makeRe(...e);Y.scan=(...e)=>Ve.scan(...e);Y.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of wu(String(n),t))r.push(Ve.parse(o,t));return r};Y.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Cu(e)?[e]:wu(e,t)};Y.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Y.braces(e,{...t,expand:!0})};Y.hasBraces=Cu;Au.exports=Y});var ju=E(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.isAbsolute=S.partitionAbsoluteAndRelative=S.removeDuplicateSlashes=S.matchAny=S.convertPatternsToRe=S.makeRe=S.getPatternParts=S.expandBraceExpansion=S.expandPatternsWithBraceExpansion=S.isAffectDepthOfReadingPattern=S.endsWithSlashGlobStar=S.hasGlobStar=S.getBaseDirectory=S.isPatternRelatedToParentDirectory=S.getPatternsOutsideCurrentDirectory=S.getPatternsInsideCurrentDirectory=S.getPositivePatterns=S.getNegativePatterns=S.isPositivePattern=S.isNegativePattern=S.convertToNegativePattern=S.convertToPositivePattern=S.isDynamicPattern=S.isStaticPattern=void 0;var Ru=I("path"),Zb=vl(),ri=Su(),Ou="**",ev="\\",tv=/[*?]|^!/,rv=/\[[^[]*]/,nv=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,ov=/[!*+?@]\([^(]*\)/,iv=/,|\.\./,sv=/(?!^)\/{2,}/g;function Tu(e,t={}){return!Pu(e,t)}S.isStaticPattern=Tu;function Pu(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(ev)||tv.test(e)||rv.test(e)||nv.test(e)||t.extglob!==!1&&ov.test(e)||t.braceExpansion!==!1&&av(e))}S.isDynamicPattern=Pu;function av(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 iv.test(n)}function cv(e){return cn(e)?e.slice(1):e}S.convertToPositivePattern=cv;function lv(e){return"!"+e}S.convertToNegativePattern=lv;function cn(e){return e.startsWith("!")&&e[1]!=="("}S.isNegativePattern=cn;function $u(e){return!cn(e)}S.isPositivePattern=$u;function uv(e){return e.filter(cn)}S.getNegativePatterns=uv;function pv(e){return e.filter($u)}S.getPositivePatterns=pv;function dv(e){return e.filter(t=>!ni(t))}S.getPatternsInsideCurrentDirectory=dv;function fv(e){return e.filter(ni)}S.getPatternsOutsideCurrentDirectory=fv;function ni(e){return e.startsWith("..")||e.startsWith("./..")}S.isPatternRelatedToParentDirectory=ni;function hv(e){return Zb(e,{flipBackslashes:!1})}S.getBaseDirectory=hv;function mv(e){return e.includes(Ou)}S.hasGlobStar=mv;function Du(e){return e.endsWith("/"+Ou)}S.endsWithSlashGlobStar=Du;function gv(e){let t=Ru.basename(e);return Du(e)||Tu(t)}S.isAffectDepthOfReadingPattern=gv;function yv(e){return e.reduce((t,r)=>t.concat(Nu(r)),[])}S.expandPatternsWithBraceExpansion=yv;function Nu(e){let t=ri.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}S.expandBraceExpansion=Nu;function bv(e,t){let{parts:r}=ri.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}S.getPatternParts=bv;function Lu(e,t){return ri.makeRe(e,t)}S.makeRe=Lu;function vv(e,t){return e.map(r=>Lu(r,t))}S.convertPatternsToRe=vv;function _v(e,t){return t.some(r=>r.test(e))}S.matchAny=_v;function Ev(e){return e.replace(sv,"/")}S.removeDuplicateSlashes=Ev;function kv(e){let t=[],r=[];for(let n of e)Iu(n)?t.push(n):r.push(n);return[t,r]}S.partitionAbsoluteAndRelative=kv;function Iu(e){return Ru.isAbsolute(e)}S.isAbsolute=Iu});var Hu=E((QC,Bu)=>{"use strict";var xv=I("stream"),Fu=xv.PassThrough,wv=Array.prototype.slice;Bu.exports=Cv;function Cv(){let e=[],t=wv.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=Fu(n);function a(){for(let u=0,p=arguments.length;u<p;u++)e.push(Mu(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=e.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let p=u.length+1;function d(){--p>0||(r=!1,c())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",k),d()}function k(R){s.emit("error",R)}if(m._readableState.endEmitted)return d();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",k),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<u.length;m++)g(u[m]);d()}function l(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function Mu(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=Mu(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Fu(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var Gu=E(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.merge=void 0;var Av=Hu();function Sv(e){let t=Av(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Vu(e)),t.once("end",()=>Vu(e)),t}ln.merge=Sv;function Vu(e){e.forEach(t=>t.emit("close"))}});var Uu=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.isEmpty=Lt.isString=void 0;function Rv(e){return typeof e=="string"}Lt.isString=Rv;function Ov(e){return e===""}Lt.isEmpty=Ov});var ze=E(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.string=de.stream=de.pattern=de.path=de.fs=de.errno=de.array=void 0;var Tv=sl();de.array=Tv;var Pv=al();de.errno=Pv;var $v=cl();de.fs=$v;var Dv=dl();de.path=Dv;var Nv=ju();de.pattern=Nv;var Lv=Gu();de.stream=Lv;var Iv=Uu();de.string=Iv});var Ku=E(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.convertPatternGroupToTask=fe.convertPatternGroupsToTasks=fe.groupPatternsByBaseDirectory=fe.getNegativePatternsAsPositive=fe.getPositivePatterns=fe.convertPatternsToTasks=fe.generate=void 0;var $e=ze();function jv(e,t){let r=Wu(e,t),n=Wu(t.ignore,t),o=qu(r),i=Yu(r,n),s=o.filter(u=>$e.pattern.isStaticPattern(u,t)),a=o.filter(u=>$e.pattern.isDynamicPattern(u,t)),c=oi(s,i,!1),l=oi(a,i,!0);return c.concat(l)}fe.generate=jv;function Wu(e,t){let r=e;return t.braceExpansion&&(r=$e.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>$e.pattern.removeDuplicateSlashes(n))}function oi(e,t,r){let n=[],o=$e.pattern.getPatternsOutsideCurrentDirectory(e),i=$e.pattern.getPatternsInsideCurrentDirectory(e),s=ii(o),a=ii(i);return n.push(...si(s,t,r)),"."in a?n.push(ai(".",i,t,r)):n.push(...si(a,t,r)),n}fe.convertPatternsToTasks=oi;function qu(e){return $e.pattern.getPositivePatterns(e)}fe.getPositivePatterns=qu;function Yu(e,t){return $e.pattern.getNegativePatterns(e).concat(t).map($e.pattern.convertToPositivePattern)}fe.getNegativePatternsAsPositive=Yu;function ii(e){let t={};return e.reduce((r,n)=>{let o=$e.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}fe.groupPatternsByBaseDirectory=ii;function si(e,t,r){return Object.keys(e).map(n=>ai(n,e[n],t,r))}fe.convertPatternGroupsToTasks=si;function ai(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map($e.pattern.convertToNegativePattern))}}fe.convertPatternGroupToTask=ai});var zu=E(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.read=void 0;function Fv(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Xu(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){ci(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Xu(r,i);return}ci(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),ci(r,s)})})}un.read=Fv;function Xu(e,t){e(t)}function ci(e,t){e(null,t)}});var Qu=E(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.read=void 0;function Mv(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}}pn.read=Mv});var Ju=E(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.createFileSystemAdapter=st.FILE_SYSTEM_ADAPTER=void 0;var dn=I("fs");st.FILE_SYSTEM_ADAPTER={lstat:dn.lstat,stat:dn.stat,lstatSync:dn.lstatSync,statSync:dn.statSync};function Bv(e){return e===void 0?st.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},st.FILE_SYSTEM_ADAPTER),e)}st.createFileSystemAdapter=Bv});var Zu=E(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});var Hv=Ju(),li=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=Hv.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}};ui.default=li});var _t=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.statSync=at.stat=at.Settings=void 0;var ep=zu(),Vv=Qu(),pi=Zu();at.Settings=pi.default;function Gv(e,t,r){if(typeof t=="function"){ep.read(e,di(),t);return}ep.read(e,di(t),r)}at.stat=Gv;function Uv(e,t){let r=di(t);return Vv.read(e,r)}at.statSync=Uv;function di(e={}){return e instanceof pi.default?e:new pi.default(e)}});var np=E((aA,rp)=>{var tp;rp.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(tp||(tp=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var ip=E((cA,op)=>{op.exports=qv;var Wv=np();function qv(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 l(){t&&t(c,r),t=null}i?Wv(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(l)}n?o?o.forEach(function(c){e[c](function(l,u){a(c,l,u)})}):e.forEach(function(c,l){c(function(u,p){a(l,u,p)})}):s(null),i=!1}});var fi=E(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var fn=process.versions.node.split(".");if(fn[0]===void 0||fn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var sp=Number.parseInt(fn[0],10),Yv=Number.parseInt(fn[1],10),ap=10,Kv=10,Xv=sp>ap,zv=sp===ap&&Yv>=Kv;hn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Xv||zv});var cp=E(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.createDirentFromStats=void 0;var hi=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 Qv(e,t){return new hi(e,t)}mn.createDirentFromStats=Qv});var mi=E(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.fs=void 0;var Jv=cp();gn.fs=Jv});var gi=E(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.joinPathSegments=void 0;function Zv(e,t,r){return e.endsWith(r)?e+t:e+r+t}yn.joinPathSegments=Zv});var hp=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.readdir=ct.readdirWithFileTypes=ct.read=void 0;var e_=_t(),lp=ip(),t_=fi(),up=mi(),pp=gi();function r_(e,t,r){if(!t.stats&&t_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){dp(e,t,r);return}fp(e,t,r)}ct.read=r_;function dp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){bn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:pp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){yi(r,i);return}let s=i.map(a=>n_(a,t));lp(s,(a,c)=>{if(a!==null){bn(r,a);return}yi(r,c)})})}ct.readdirWithFileTypes=dp;function n_(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=up.fs.createDirentFromStats(e.name,o),r(null,e)})}}function fp(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){bn(r,n);return}let i=o.map(s=>{let a=pp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{e_.stat(a,t.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let p={name:s,path:a,dirent:up.fs.createDirentFromStats(s,u)};t.stats&&(p.stats=u),c(null,p)})}});lp(i,(s,a)=>{if(s!==null){bn(r,s);return}yi(r,a)})})}ct.readdir=fp;function bn(e,t){e(t)}function yi(e,t){e(null,t)}});var vp=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.readdir=lt.readdirWithFileTypes=lt.read=void 0;var o_=_t(),i_=fi(),mp=mi(),gp=gi();function s_(e,t){return!t.stats&&i_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?yp(e,t):bp(e,t)}lt.read=s_;function yp(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:gp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=mp.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}lt.readdirWithFileTypes=yp;function bp(e,t){return t.fs.readdirSync(e).map(n=>{let o=gp.joinPathSegments(e,n,t.pathSegmentSeparator),i=o_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:mp.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}lt.readdir=bp});var _p=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.createFileSystemAdapter=ut.FILE_SYSTEM_ADAPTER=void 0;var It=I("fs");ut.FILE_SYSTEM_ADAPTER={lstat:It.lstat,stat:It.stat,lstatSync:It.lstatSync,statSync:It.statSync,readdir:It.readdir,readdirSync:It.readdirSync};function a_(e){return e===void 0?ut.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ut.FILE_SYSTEM_ADAPTER),e)}ut.createFileSystemAdapter=a_});var Ep=E(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});var c_=I("path"),l_=_t(),u_=_p(),bi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=u_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,c_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new l_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};vi.default=bi});var vn=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.Settings=pt.scandirSync=pt.scandir=void 0;var kp=hp(),p_=vp(),_i=Ep();pt.Settings=_i.default;function d_(e,t,r){if(typeof t=="function"){kp.read(e,Ei(),t);return}kp.read(e,Ei(t),r)}pt.scandir=d_;function f_(e,t){let r=Ei(t);return p_.read(e,r)}pt.scandirSync=f_;function Ei(e={}){return e instanceof _i.default?e:new _i.default(e)}});var wp=E((bA,xp)=>{"use strict";function h_(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}}xp.exports=h_});var Ap=E((vA,ki)=>{"use strict";var m_=wp();function Cp(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=m_(g_),o=null,i=null,s=0,a=null,c={push:y,drain:Se,saturated:Se,pause:u,paused:!1,get concurrency(){return r},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=N,!c.paused)for(;o&&s<r;)s++,R()},running:l,resume:g,idle:m,length:p,getQueue:d,unshift:k,empty:Se,kill:O,killAndDrain:K,error:xe};return c;function l(){return s}function u(){c.paused=!0}function p(){for(var N=o,X=0;N;)N=N.next,X++;return X}function d(){for(var N=o,X=[];N;)X.push(N.value),N=N.next;return X}function g(){if(c.paused){if(c.paused=!1,o===null){s++,R();return}for(;o&&s<r;)s++,R()}}function m(){return s===0&&c.length()===0}function y(N,X){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=X||Se,P.errorHandler=a,s>=r||c.paused?i?(i.next=P,i=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function k(N,X){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=X||Se,P.errorHandler=a,s>=r||c.paused?o?(P.next=o,o=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function R(N){N&&n.release(N);var X=o;X&&s<=r?c.paused?s--:(i===o&&(i=null),o=X.next,X.next=null,t.call(e,X.value,X.worked),i===null&&c.empty()):--s===0&&c.drain()}function O(){o=null,i=null,c.drain=Se}function K(){o=null,i=null,c.drain(),c.drain=Se}function xe(N){a=N}}function Se(){}function g_(){this.value=null,this.callback=Se,this.next=null,this.release=Se,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=Se,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function y_(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(u,p){t.call(this,u).then(function(d){p(null,d)},p)}var o=Cp(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=l,o;function a(u){var p=new Promise(function(d,g){i(u,function(m,y){if(m){g(m);return}d(y)})});return p.catch(Se),p}function c(u){var p=new Promise(function(d,g){s(u,function(m,y){if(m){g(m);return}d(y)})});return p.catch(Se),p}function l(){var u=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 u}}ki.exports=Cp;ki.exports.promise=y_});var _n=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.joinPathSegments=Ge.replacePathSegmentSeparator=Ge.isAppliedFilter=Ge.isFatalError=void 0;function b_(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ge.isFatalError=b_;function v_(e,t){return e===null||e(t)}Ge.isAppliedFilter=v_;function __(e,t){return e.split(/[/\\]/).join(t)}Ge.replacePathSegmentSeparator=__;function E_(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ge.joinPathSegments=E_});var Ci=E(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});var k_=_n(),xi=class{constructor(t,r){this._root=t,this._settings=r,this._root=k_.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};wi.default=xi});var Ri=E(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var x_=I("events"),w_=vn(),C_=Ap(),En=_n(),A_=Ci(),Ai=class extends A_.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=w_.scandir,this._emitter=new x_.EventEmitter,this._queue=C_(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||!En.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=En.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),En.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&En.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};Si.default=Ai});var Sp=E(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var S_=Ri(),Oi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new S_.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{R_(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{O_(t,this._storage)}),this._reader.read()}};Ti.default=Oi;function R_(e,t){e(t)}function O_(e,t){e(null,t)}});var Rp=E($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});var T_=I("stream"),P_=Ri(),Pi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new P_.default(this._root,this._settings),this._stream=new T_.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}};$i.default=Pi});var Op=E(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});var $_=vn(),kn=_n(),D_=Ci(),Di=class extends D_.default{constructor(){super(...arguments),this._scandir=$_.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(kn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=kn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),kn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&kn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Ni.default=Di});var Tp=E(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});var N_=Op(),Li=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new N_.default(this._root,this._settings)}read(){return this._reader.read()}};Ii.default=Li});var Pp=E(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var L_=I("path"),I_=vn(),ji=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,L_.sep),this.fsScandirSettings=new I_.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}};Fi.default=ji});var wn=E(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Settings=Ue.walkStream=Ue.walkSync=Ue.walk=void 0;var $p=Sp(),j_=Rp(),F_=Tp(),Mi=Pp();Ue.Settings=Mi.default;function M_(e,t,r){if(typeof t=="function"){new $p.default(e,xn()).read(t);return}new $p.default(e,xn(t)).read(r)}Ue.walk=M_;function B_(e,t){let r=xn(t);return new F_.default(e,r).read()}Ue.walkSync=B_;function H_(e,t){let r=xn(t);return new j_.default(e,r).read()}Ue.walkStream=H_;function xn(e={}){return e instanceof Mi.default?e:new Mi.default(e)}});var Cn=E(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var V_=I("path"),G_=_t(),Dp=ze(),Bi=class{constructor(t){this._settings=t,this._fsStatSettings=new G_.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return V_.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Dp.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Dp.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};Hi.default=Bi});var Ui=E(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var U_=I("stream"),W_=_t(),q_=wn(),Y_=Cn(),Vi=class extends Y_.default{constructor(){super(...arguments),this._walkStream=q_.walkStream,this._stat=W_.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new U_.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))})}};Gi.default=Vi});var Np=E(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var K_=wn(),X_=Cn(),z_=Ui(),Wi=class extends X_.default{constructor(){super(...arguments),this._walkAsync=K_.walk,this._readerStream=new z_.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))})}};qi.default=Wi});var Lp=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var ur=ze(),Yi=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 ur.pattern.getPatternParts(t,this._micromatchOptions).map(n=>ur.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:ur.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return ur.array.splitWhen(t,r=>r.dynamic&&ur.pattern.hasGlobStar(r.pattern))}};Ki.default=Yi});var Ip=E(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});var Q_=Lp(),Xi=class extends Q_.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,l)=>{let u=i.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};zi.default=Xi});var jp=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var An=ze(),J_=Ip(),Qi=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 J_.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(An.pattern.isAffectDepthOfReadingPattern);return An.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=An.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!An.pattern.matchAny(t,r)}};Ji.default=Qi});var Fp=E(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var dt=ze(),Zi=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=dt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:dt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:dt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:dt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=dt.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=dt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=dt.pattern.matchAny(t,r);return!o&&n?dt.pattern.matchAny(t+"/",r):o}};es.default=Zi});var Mp=E(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var Z_=ze(),ts=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return Z_.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};rs.default=ts});var Hp=E(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var Bp=ze(),ns=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=Bp.path.makeAbsolute(this._settings.cwd,r),r=Bp.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};os.default=ns});var Sn=E(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var eE=I("path"),tE=jp(),rE=Fp(),nE=Mp(),oE=Hp(),is=class{constructor(t){this._settings=t,this.errorFilter=new nE.default(this._settings),this.entryFilter=new rE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new tE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new oE.default(this._settings)}_getRootDirectory(t){return eE.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}}};ss.default=is});var Vp=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var iE=Np(),sE=Sn(),as=class extends sE.default{constructor(){super(...arguments),this._reader=new iE.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)}};cs.default=as});var Gp=E(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var aE=I("stream"),cE=Ui(),lE=Sn(),ls=class extends lE.default{constructor(){super(...arguments),this._reader=new cE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new aE.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)}};us.default=ls});var Up=E(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var uE=_t(),pE=wn(),dE=Cn(),ps=class extends dE.default{constructor(){super(...arguments),this._walkSync=pE.walkSync,this._statSync=uE.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)}};ds.default=ps});var Wp=E(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var fE=Up(),hE=Sn(),fs=class extends hE.default{constructor(){super(...arguments),this._reader=new fE.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)}};hs.default=fs});var qp=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var jt=I("fs"),mE=I("os"),gE=Math.max(mE.cpus().length,1);Ft.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:jt.lstat,lstatSync:jt.lstatSync,stat:jt.stat,statSync:jt.statSync,readdir:jt.readdir,readdirSync:jt.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,gE),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({},Ft.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};Ft.default=ms});var vs=E((UA,Kp)=>{"use strict";var Yp=Ku(),yE=Vp(),bE=Gp(),vE=Wp(),gs=qp(),Re=ze();async function ys(e,t){De(e);let r=bs(e,yE.default,t),n=await Promise.all(r);return Re.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(l,u){De(l);let p=bs(l,vE.default,u);return Re.array.flatten(p)}e.sync=t;function r(l,u){De(l);let p=bs(l,bE.default,u);return Re.stream.merge(p)}e.stream=r;function n(l,u){De(l);let p=[].concat(l),d=new gs.default(u);return Yp.generate(p,d)}e.generateTasks=n;function o(l,u){De(l);let p=new gs.default(u);return Re.pattern.isDynamicPattern(l,p)}e.isDynamicPattern=o;function i(l){return De(l),Re.path.escape(l)}e.escapePath=i;function s(l){return De(l),Re.path.convertPathToPattern(l)}e.convertPathToPattern=s;let a;(function(l){function u(d){return De(d),Re.path.escapePosixPath(d)}l.escapePath=u;function p(d){return De(d),Re.path.convertPosixPathToPattern(d)}l.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(l){function u(d){return De(d),Re.path.escapeWindowsPath(d)}l.escapePath=u;function p(d){return De(d),Re.path.convertWindowsPathToPattern(d)}l.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(ys||(ys={}));function bs(e,t,r){let n=[].concat(e),o=new gs.default(r),i=Yp.generate(n,o),s=new t(o);return i.map(s.read,s)}function De(e){if(![].concat(e).every(n=>Re.string.isString(n)&&!Re.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Kp.exports=ys});import _E from"node:fs";import EE from"node:fs/promises";async function _s(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await EE[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Es(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return _E[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var YA,Xp,KA,XA,zp,zA,Qp=tt(()=>{YA=_s.bind(void 0,"stat","isFile"),Xp=_s.bind(void 0,"stat","isDirectory"),KA=_s.bind(void 0,"lstat","isSymbolicLink"),XA=Es.bind(void 0,"statSync","isFile"),zp=Es.bind(void 0,"statSync","isDirectory"),zA=Es.bind(void 0,"lstatSync","isSymbolicLink")});var Jp=tt(()=>{});import{promisify as kE}from"node:util";import{execFile as xE,execFileSync as t0}from"node:child_process";import{fileURLToPath as wE}from"node:url";function pr(e){return e instanceof URL?wE(e):e}var n0,o0,ks=tt(()=>{Jp();n0=kE(xE);o0=10*1024*1024});var ad=E((a0,Tn)=>{function td(e){return Array.isArray(e)?e:[e]}var CE=void 0,ws="",Zp=" ",xs="\\",AE=/^\s+$/,SE=/(?:[^\\]|^)\\$/,RE=/^\\!/,OE=/^\\#/,TE=/\r?\n/g,PE=/^\.{0,2}\/|^\.{1,2}$/,$E=/\/$/,Mt="/",rd="node-ignore";typeof Symbol<"u"&&(rd=Symbol.for("node-ignore"));var nd=rd,Bt=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),DE=/([0-z])-([0-z])/g,od=()=>!1,NE=e=>e.replace(DE,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:ws),LE=e=>{let{length:t}=e;return e.slice(0,t-t%2)},IE=[[/^\uFEFF/,()=>ws],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?Zp:ws)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+Zp}],[/[\\$.|*+(){^]/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,()=>xs],[/\\\\/g,()=>xs],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===xs?`\\[${r}${LE(n)}${o}`:o==="]"&&n.length%2===0?`[${NE(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],jE=/(^|\\\/)?\\\*$/,dr="regex",Rn="checkRegex",ed="_",FE={[dr](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Rn](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},ME=e=>IE.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),On=e=>typeof e=="string",BE=e=>e&&On(e)&&!AE.test(e)&&!SE.test(e)&&e.indexOf("#")!==0,HE=e=>e.split(TE).filter(Boolean),Cs=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Bt(this,"body",n),Bt(this,"ignoreCase",o),Bt(this,"regexPrefix",s)}get regex(){let t=ed+dr;return this[t]?this[t]:this._make(dr,t)}get checkRegex(){let t=ed+Rn;return this[t]?this[t]:this._make(Rn,t)}_make(t,r){let n=this.regexPrefix.replace(jE,FE[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Bt(this,r,o)}},VE=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(RE,"!").replace(OE,"#");let i=ME(o);return new Cs(e,t,o,r,n,i)},As=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[nd]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(On(t)&&(t={pattern:t}),BE(t.pattern)){let r=VE(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,td(On(t)?HE(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:l}=c;i===l&&o!==i||l&&!o&&!i&&!r||!c[n].test(t)||(o=!l,i=l,s=l?CE:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},GE=(e,t)=>{throw new t(e)},Qe=(e,t,r)=>On(e)?e?Qe.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),id=e=>PE.test(e);Qe.isNotRelative=id;Qe.convert=e=>e;var Ss=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Bt(this,nd,!0),this._rules=new As(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&&Qe.convert(t);return Qe(i,t,this._strictPathCheck?GE:od),this._t(i,r,n,o)}checkIgnore(t){if(!$E.test(t))return this.test(t);let r=t.split(Mt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Mt)+Mt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Rn)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Mt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,dr);let i=this._t(o.join(Mt)+Mt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,dr)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return td(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Rs=e=>new Ss(e),UE=e=>Qe(e&&Qe.convert(e),e,od),sd=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qe.convert=e;let t=/^[a-z]:\//i;Qe.isNotRelative=r=>t.test(r)||id(r)};typeof process<"u"&&process.platform==="win32"&&sd();Tn.exports=Rs;Rs.default=Rs;Tn.exports.isPathValid=UE;Bt(Tn.exports,Symbol.for("setupWindows"),sd)});function Ht(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var cd=tt(()=>{});var fr,Os=tt(()=>{fr=e=>e[0]==="!"});import WE from"node:process";import qE from"node:fs";import YE from"node:fs/promises";import Vt from"node:path";var Ts,ld,KE,ud,Pn,XE,zE,QE,pd,dd,hr,mr,fd,hd,Ps=tt(()=>{Ts=qt(vs(),1),ld=qt(ad(),1);cd();ks();Os();KE=["**/node_modules","**/flow-typed","**/coverage","**/.git"],ud={absolute:!0,dot:!0},Pn="**/.gitignore",XE=(e,t)=>fr(e)?"!"+Vt.posix.join(t,e.slice(1)):Vt.posix.join(t,e),zE=(e,t)=>{let r=Ht(Vt.relative(t,Vt.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>XE(n,r))},QE=(e,t)=>{if(t=Ht(t),Vt.isAbsolute(e)){if(Ht(e).startsWith(t))return Vt.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},pd=(e,t)=>{let r=e.flatMap(o=>zE(o,t)),n=(0,ld.default)().add(r);return o=>(o=pr(o),o=QE(o,t),o?n.ignores(Ht(o)):!1)},dd=(e={})=>({cwd:pr(e.cwd)??WE.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...KE]}),hr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=dd(t),s=await(0,Ts.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...ud}),a=await Promise.all(s.map(async c=>({filePath:c,content:await YE.readFile(c,"utf8")})));return pd(a,r)},mr=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=dd(t),a=Ts.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...ud}).map(c=>({filePath:c,content:qE.readFileSync(c,"utf8")}));return pd(a,r)},fd=e=>hr(Pn,e),hd=e=>mr(Pn,e)});var Od={};bf(Od,{convertPathToPattern:()=>ck,generateGlobTasks:()=>sk,generateGlobTasksSync:()=>ak,globby:()=>rk,globbyStream:()=>ok,globbySync:()=>nk,isDynamicPattern:()=>ik,isGitIgnored:()=>fd,isGitIgnoredSync:()=>hd,isIgnoredByIgnoreFiles:()=>hr,isIgnoredByIgnoreFilesSync:()=>mr});import yd from"node:process";import JE from"node:fs";import Gt from"node:path";var Ut,ZE,bd,vd,md,gd,$s,ek,_d,Ed,$n,kd,tk,xd,wd,Cd,Ad,Sd,Rd,Ds,rk,nk,ok,ik,sk,ak,ck,Td=tt(()=>{il();Ut=qt(vs(),1);Qp();ks();Ps();Os();Ps();ZE=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},bd=(e,t)=>{let r=fr(e)?e.slice(1):e;return Gt.isAbsolute(r)?r:Gt.join(t,r)},vd=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>Gt.posix.join(e,`**/${Gt.extname(o)?o:`${o}${n}`}`)):[Gt.posix.join(e,`**${n?`/*${n}`:""}`)]},md=async(e,{cwd:t=yd.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await Xp(bd(i,t))?vd({directoryPath:i,files:r,extensions:n}):i))).flat(),gd=(e,{cwd:t=yd.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>zp(bd(o,t))?vd({directoryPath:o,files:r,extensions:n}):o),$s=e=>(e=[...new Set([e].flat())],ZE(e),e),ek=e=>{if(!e)return;let t;try{t=JE.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},_d=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:pr(e.cwd)},ek(e.cwd),e),Ed=e=>async(t,r)=>e($s(t),_d(r)),$n=e=>(t,r)=>e($s(t),_d(r)),kd=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?$s(t):[];return r&&n.push(Pn),n},tk=async e=>{let t=kd(e);return wd(t.length>0&&await hr(t,e))},xd=e=>{let t=kd(e);return wd(t.length>0&&mr(t,e))},wd=e=>{let t=new Set;return r=>{let n=Gt.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Cd=(e,t)=>e.flat().filter(r=>t(r)),Ad=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>fr(i));if(n===-1){r.push({patterns:e,options:t});break}let o=e[n].slice(1);for(let i of r)i.options.ignore.push(o);n!==0&&r.push({patterns:e.slice(0,n),options:{...t,ignore:[...t.ignore,o]}}),e=e.slice(n+1)}return r},Sd=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Rd=async(e,t)=>{let r=Ad(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Sd(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([md(a,i),md(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Ds=(e,t)=>{let r=Ad(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Sd(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=gd(a,i),c.ignore=gd(c.ignore,{cwd:n}),{patterns:a,options:c}})},rk=Ed(async(e,t)=>{let[r,n]=await Promise.all([Rd(e,t),tk(t)]),o=await Promise.all(r.map(i=>(0,Ut.default)(i.patterns,i.options)));return Cd(o,n)}),nk=$n((e,t)=>{let r=Ds(e,t),n=xd(t),o=r.map(i=>Ut.default.sync(i.patterns,i.options));return Cd(o,n)}),ok=$n((e,t)=>{let r=Ds(e,t),n=xd(t),o=r.map(s=>Ut.default.stream(s.patterns,s.options));return Lo(o).filter(s=>n(s))}),ik=$n((e,t)=>e.some(r=>Ut.default.isDynamicPattern(r,t))),sk=Ed(Rd),ak=$n(Ds),{convertPathToPattern:ck}=Ut.default});var qs=(e=0)=>t=>`\x1B[${t+e}m`,Ys=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Ks=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Q={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]}},kx=Object.keys(Q.modifier),_f=Object.keys(Q.color),Ef=Object.keys(Q.bgColor),xx=[..._f,...Ef];function kf(){let e=new Map;for(let[t,r]of Object.entries(Q)){for(let[n,o]of Object.entries(r))Q[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Q[n],e.set(o[0],o[1]);Object.defineProperty(Q,t,{value:r,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:e,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=qs(),Q.color.ansi256=Ys(),Q.color.ansi16m=Ks(),Q.bgColor.ansi=qs(10),Q.bgColor.ansi256=Ys(10),Q.bgColor.ansi16m=Ks(10),Object.defineProperties(Q,{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=>Q.rgbToAnsi256(...Q.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)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>Q.ansi256ToAnsi(Q.hexToAnsi256(t)),enumerable:!1}}),Q}var xf=kf(),Te=xf;import Hn from"node:process";import wf from"node:os";import Xs from"node:tty";function we(e,t=globalThis.Deno?globalThis.Deno.args:Hn.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:J}=Hn,Cr;we("no-color")||we("no-colors")||we("color=false")||we("color=never")?Cr=0:(we("color")||we("colors")||we("color=true")||we("color=always"))&&(Cr=1);function Cf(){if("FORCE_COLOR"in J)return J.FORCE_COLOR==="true"?1:J.FORCE_COLOR==="false"?0:J.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(J.FORCE_COLOR,10),3)}function Af(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Sf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Cf();n!==void 0&&(Cr=n);let o=r?Cr:n;if(o===0)return 0;if(r){if(we("color=16m")||we("color=full")||we("color=truecolor"))return 3;if(we("color=256"))return 2}if("TF_BUILD"in J&&"AGENT_NAME"in J)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(J.TERM==="dumb")return i;if(Hn.platform==="win32"){let s=wf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in J)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in J)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in J)||J.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in J)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(J.TEAMCITY_VERSION)?1:0;if(J.COLORTERM==="truecolor"||J.TERM==="xterm-kitty"||J.TERM==="xterm-ghostty"||J.TERM==="wezterm")return 3;if("TERM_PROGRAM"in J){let s=Number.parseInt((J.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(J.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(J.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(J.TERM)||"COLORTERM"in J?1:i}function zs(e,t={}){let r=Sf(e,{streamIsTTY:e&&e.isTTY,...t});return Af(r)}var Rf={stdout:zs({isTTY:Xs.isatty(1)}),stderr:zs({isTTY:Xs.isatty(2)})},Qs=Rf;function Js(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 Zs(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 da(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 so(){if(F.env.NO_COLOR||F.env.FORCE_COLOR==="0"||F.env.FORCE_COLOR==="false")return!1;if(F.env.FORCE_COLOR||F.env.CLICOLOR_FORCE!==void 0)return!0}ao.Command=io;ao.useColor=so});var ga=E(Ce=>{var{Argument:fa}=Sr(),{Command:co}=pa(),{CommanderError:Qf,InvalidArgumentError:ha}=zt(),{Help:Jf}=Jn(),{Option:ma}=ro();Ce.program=new co;Ce.createCommand=e=>new co(e);Ce.createOption=(e,t)=>new ma(e,t);Ce.createArgument=(e,t)=>new fa(e,t);Ce.Command=co;Ce.Option=ma;Ce.Argument=fa;Ce.Help=Jf;Ce.CommanderError=Qf;Ce.InvalidArgumentError=ha;Ce.InvalidOptionArgumentError=ha});var va=E((ew,Zf)=>{Zf.exports={name:"dotenv",version:"17.2.2",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 --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --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 Ca=E((tw,Ue)=>{var lo=I("fs"),Or=I("path"),eh=I("os"),th=I("crypto"),rh=va(),uo=rh.version,_a=["\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{1F4E1} observe env with Radar: https://dotenvx.com/radar","\u{1F4E1} auto-backup env with Radar: https://dotenvx.com/radar","\u{1F4E1} version env with Radar: https://dotenvx.com/radar","\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 nh(){return _a[Math.floor(Math.random()*_a.length)]}function wt(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function oh(){return process.stdout.isTTY}function ih(e){return oh()?`\x1B[2m${e}\x1B[0m`:e}var sh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ah(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
29
|
+
`);let n;for(;(n=sh.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 ch(e){e=e||{};let t=wa(e);e.path=t;let r=se.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=xa(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=uh(r,a);i=se.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return se.parse(i)}function lh(e){console.error(`[dotenv@${uo}][WARN] ${e}`)}function Qt(e){console.log(`[dotenv@${uo}][DEBUG] ${e}`)}function ka(e){console.log(`[dotenv@${uo}] ${e}`)}function xa(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 uh(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 wa(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)lo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Or.resolve(process.cwd(),".env.vault");return lo.existsSync(t)?t:null}function Ea(e){return e[0]==="~"?Or.join(eh.homedir(),e.slice(1)):e}function dh(e){let t=wt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=wt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&ka("Loading env from encrypted .env.vault");let n=se._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),se.populate(o,n,e),{parsed:n}}function ph(e){let t=Or.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=wt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=wt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&Qt("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[Ea(e.path)];else{s=[];for(let l of e.path)s.push(Ea(l))}let a,c={};for(let l of s)try{let d=se.parse(lo.readFileSync(l,{encoding:r}));se.populate(c,d,e)}catch(d){o&&Qt(`Failed to load ${l} ${d.message}`),a=d}let u=se.populate(n,c,e);if(o=wt(n.DOTENV_CONFIG_DEBUG||o),i=wt(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,d=[];for(let p of s)try{let g=Or.relative(process.cwd(),p);d.push(g)}catch(g){o&&Qt(`Failed to load ${p} ${g.message}`),a=g}ka(`injecting env (${l}) from ${d.join(",")} ${ih(`-- tip: ${nh()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function fh(e){if(xa(e).length===0)return se.configDotenv(e);let t=wa(e);return t?se._configVault(e):(lh(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),se.configDotenv(e))}function hh(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=th.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 mh(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&&Qt(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 se={configDotenv:ph,_configVault:dh,_parseVault:ch,config:fh,decrypt:hh,parse:ah,populate:mh};Ue.exports.configDotenv=se.configDotenv;Ue.exports._configVault=se._configVault;Ue.exports._parseVault=se._parseVault;Ue.exports.config=se.config;Ue.exports.decrypt=se.decrypt;Ue.exports.parse=se.parse;Ue.exports.populate=se.populate;Ue.exports=se});import{on as sy,once as ay}from"node:events";import{PassThrough as cy}from"node:stream";import{finished as rl}from"node:stream/promises";function Io(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)No(o);let t=e.some(({readableObjectMode:o})=>o),r=ly(e,t),n=new Do({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&il(n),n}var ly,Do,uy,dy,py,No,fy,nl,hy,my,gy,ol,il,Lo,sl,yy,Jr,el,tl,al=rt(()=>{ly=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Do=class extends cy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){No(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=uy(this,this.#e),fy({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return No(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},uy=async(e,t)=>{Jr(e,el);let r=new AbortController;try{await Promise.race([dy(e,r),py(e,t,r)])}finally{r.abort(),Jr(e,-el)}},dy=async(e,{signal:t})=>{await rl(e,{signal:t,cleanup:!0})},py=async(e,t,{signal:r})=>{for await(let[n]of sy(e,"unpipe",{signal:r}))t.has(n)&&n.emit(ol)},No=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},fy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{Jr(e,tl);let s=new AbortController;try{await Promise.race([hy(i,t),my({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),gy({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),Jr(e,-tl)}r.size===n.size+o.size&&(n.size===0&&o.size>0?Lo(e):il(e))},nl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",hy=async(e,t)=>{try{await e,Lo(t)}catch(r){nl(r)?Lo(t):sl(t,r)}},my=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await rl(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):sl(e,s)}},gy=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await ay(e,ol,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},ol=Symbol("unpipe"),il=e=>{e.writable&&e.end()},Lo=e=>{(e.readable||e.writable)&&e.destroy()},sl=(e,t)=>{e.destroyed||(e.once("error",yy),e.destroy(t))},yy=()=>{},Jr=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},el=2,tl=1});var cl=E(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.splitWhen=Dt.flatten=void 0;function by(e){return e.reduce((t,r)=>[].concat(t,r),[])}Dt.flatten=by;function vy(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Dt.splitWhen=vy});var ll=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isEnoentCodeError=void 0;function _y(e){return e.code==="ENOENT"}Zr.isEnoentCodeError=_y});var ul=E(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.createDirentFromStats=void 0;var jo=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 Ey(e,t){return new jo(e,t)}en.createDirentFromStats=Ey});var hl=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.convertPosixPathToPattern=oe.convertWindowsPathToPattern=oe.convertPathToPattern=oe.escapePosixPath=oe.escapeWindowsPath=oe.escape=oe.removeLeadingDotSegment=oe.makeAbsolute=oe.unixify=void 0;var ky=I("os"),xy=I("path"),dl=ky.platform()==="win32",wy=2,Cy=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Ay=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Sy=/^\\\\([.?])/,Ry=/\\(?![!()+@[\]{}])/g;function Oy(e){return e.replace(/\\/g,"/")}oe.unixify=Oy;function Ty(e,t){return xy.resolve(e,t)}oe.makeAbsolute=Ty;function Py(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(wy)}return e}oe.removeLeadingDotSegment=Py;oe.escape=dl?Fo:Mo;function Fo(e){return e.replace(Ay,"\\$2")}oe.escapeWindowsPath=Fo;function Mo(e){return e.replace(Cy,"\\$2")}oe.escapePosixPath=Mo;oe.convertPathToPattern=dl?pl:fl;function pl(e){return Fo(e).replace(Sy,"//$1").replace(Ry,"/")}oe.convertWindowsPathToPattern=pl;function fl(e){return Mo(e)}oe.convertPosixPathToPattern=fl});var gl=E((PC,ml)=>{ml.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 vl=E(($C,bl)=>{var $y=gl(),yl={"{":"}","(":")","[":"]"},Dy=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=yl[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},Ny=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=yl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};bl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if($y(t))return!0;var n=Dy;return r&&r.strict===!1&&(n=Ny),n(t)}});var El=E((DC,_l)=>{"use strict";var Ly=vl(),Iy=I("path").posix.dirname,jy=I("os").platform()==="win32",Bo="/",Fy=/\\/g,My=/[\{\[].*[\}\]]$/,By=/(^|[^\\])([\{\[]|\([^\)]+$)/,Hy=/\\([\!\*\?\|\[\]\(\)\{\}])/g;_l.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&jy&&t.indexOf(Bo)<0&&(t=t.replace(Fy,Bo)),My.test(t)&&(t+=Bo),t+="a";do t=Iy(t);while(Ly(t)||By.test(t));return t.replace(Hy,"$1")}});var tn=E(Ae=>{"use strict";Ae.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Ae.find=(e,t)=>e.nodes.find(r=>r.type===t);Ae.exceedsLimit=(e,t,r=1,n)=>n===!1||!Ae.isInteger(e)||!Ae.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Ae.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)};Ae.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Ae.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;Ae.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Ae.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Ae.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 rn=E((LC,xl)=>{"use strict";var kl=tn();xl.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 Cl=E((IC,wl)=>{"use strict";wl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Nl=E((jC,Dl)=>{"use strict";var Al=Cl(),vt=(e,t,r)=>{if(Al(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Al(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(vt.cache.hasOwnProperty(c))return vt.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let y=e+"|"+t;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let d=$l(e)||$l(t),p={min:e,max:t,a:u,b:l},g=[],m=[];if(d&&(p.isPadded=d,p.maxLen=String(p.max).length),u<0){let y=l<0?Math.abs(l):1;m=Sl(y,Math.abs(u),p,n),u=p.a=0}return l>=0&&(g=Sl(u,l,p,n)),p.negatives=m,p.positives=g,p.result=Vy(m,g,n),n.capture===!0?p.result=`(${p.result})`:n.wrap!==!1&&g.length+m.length>1&&(p.result=`(?:${p.result})`),vt.cache[c]=p,p.result};function Vy(e,t,r){let n=Ho(e,t,"-",!1,r)||[],o=Ho(t,e,"",!1,r)||[],i=Ho(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Gy(e,t){let r=1,n=1,o=Ol(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=Ol(e,r);for(o=Tl(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Tl(t+1,n)-1;return i=[...i],i.sort(qy),i}function Wy(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Uy(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+=Yy(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Sl(e,t,r,n){let o=Gy(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Wy(String(s),String(u),n),d="";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+Pl(a.count),s=u+1;continue}r.isPadded&&(d=Ky(u,r,n)),l.string=d+l.pattern+Pl(l.count),i.push(l),s=u+1,a=l}return i}function Ho(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Rl(t,"string",a)&&i.push(r+a),n&&Rl(t,"string",a)&&i.push(r+a)}return i}function Uy(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function qy(e,t){return e>t?1:t>e?-1:0}function Rl(e,t,r){return e.some(n=>n[t]===r)}function Ol(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Tl(e,t){return e-e%Math.pow(10,t)}function Pl(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Yy(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function $l(e){return/^-?(0+)\d/.test(e)}function Ky(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}}`}}vt.cache={};vt.clearCache=()=>vt.cache={};Dl.exports=vt});var Wo=E((FC,Hl)=>{"use strict";var Xy=I("util"),Il=Nl(),Ll=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),zy=e=>t=>e===!0?Number(t):String(t),Vo=e=>typeof e=="number"||typeof e=="string"&&e!=="",sr=e=>Number.isInteger(+e),Go=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Qy=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Jy=(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},on=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Zy=(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=>on(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>on(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},jl=(e,t,r,n)=>{if(r)return Il(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},Fl=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Il(e,t,r)},Ml=(...e)=>new RangeError("Invalid range arguments: "+Xy.inspect(...e)),Bl=(e,t,r)=>{if(r.strictRanges===!0)throw Ml([e,t]);return[]},eb=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},tb=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw Ml([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=Go(a)||Go(c)||Go(u),d=l?Math.max(a.length,c.length,u.length):0,p=l===!1&&Qy(e,t,n)===!1,g=n.transform||zy(p);if(n.toRegex&&r===1)return jl(on(e,d),on(t,d),!0,n);let m={negatives:[],positives:[]},y=O=>m[O<0?"negatives":"positives"].push(Math.abs(O)),k=[],R=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?y(o):k.push(Jy(g(o,R),d,p)),o=s?o-r:o+r,R++;return n.toRegex===!0?r>1?Zy(m,n,d):Fl(k,null,{wrap:!1,...n}):k},rb=(e,t,r=1,n={})=>{if(!sr(e)&&e.length>1||!sr(t)&&t.length>1)return Bl(e,t,n);let o=n.transform||(p=>String.fromCharCode(p)),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 jl(c,u,!1,n);let l=[],d=0;for(;a?i>=s:i<=s;)l.push(o(i,d)),i=a?i-r:i+r,d++;return n.toRegex===!0?Fl(l,null,{wrap:!1,options:n}):l},nn=(e,t,r,n={})=>{if(t==null&&Vo(e))return[e];if(!Vo(e)||!Vo(t))return Bl(e,t,n);if(typeof r=="function")return nn(e,t,1,{transform:r});if(Ll(r))return nn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,sr(r)?sr(e)&&sr(t)?tb(e,t,r,o):rb(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Ll(r)?eb(r,o):nn(e,t,1,r)};Hl.exports=nn});var Wl=E((MC,Gl)=>{"use strict";var nb=Wo(),Vl=tn(),ob=(e,t={})=>{let r=(n,o={})=>{let i=Vl.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=Vl.reduce(n.nodes),d=nb(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(e)};Gl.exports=ob});var Yl=E((BC,ql)=>{"use strict";var ib=Wo(),Ul=rn(),Nt=tn(),_t=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Nt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(_t(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?_t(o,i,r):o+i);return Nt.flatten(n)},sb=(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(_t(a.pop(),Ul(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(_t(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let d=Nt.reduce(o.nodes);if(Nt.exceedsLimit(...d,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=ib(...d,t);p.length===0&&(p=Ul(o,t)),a.push(_t(a.pop(),p)),o.nodes=[];return}let c=Nt.encloseBrace(o),u=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let d=0;d<o.nodes.length;d++){let p=o.nodes[d];if(p.type==="comma"&&o.type==="brace"){d===1&&u.push(""),u.push("");continue}if(p.type==="close"){a.push(_t(a.pop(),u,c));continue}if(p.value&&p.type!=="open"){u.push(_t(u.pop(),p.value));continue}p.nodes&&n(p,o)}return u};return Nt.flatten(n(e))};ql.exports=sb});var Xl=E((HC,Kl)=>{"use strict";Kl.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 eu=E((VC,Zl)=>{"use strict";var ab=rn(),{MAX_LENGTH:zl,CHAR_BACKSLASH:Uo,CHAR_BACKTICK:cb,CHAR_COMMA:lb,CHAR_DOT:ub,CHAR_LEFT_PARENTHESES:db,CHAR_RIGHT_PARENTHESES:pb,CHAR_LEFT_CURLY_BRACE:fb,CHAR_RIGHT_CURLY_BRACE:hb,CHAR_LEFT_SQUARE_BRACKET:Ql,CHAR_RIGHT_SQUARE_BRACKET:Jl,CHAR_DOUBLE_QUOTE:mb,CHAR_SINGLE_QUOTE:gb,CHAR_NO_BREAK_SPACE:yb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:bb}=Xl(),vb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(zl,r.maxLength):zl;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,d=0,p,g=()=>e[l++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return s.nodes.push(y),y.parent=s,y.prev=a,a=y,y};for(m({type:"bos"});l<u;)if(s=i[i.length-1],p=g(),!(p===bb||p===yb)){if(p===Uo){m({type:"text",value:(t.keepEscaping?p:"")+g()});continue}if(p===Jl){m({type:"text",value:"\\"+p});continue}if(p===Ql){c++;let y;for(;l<u&&(y=g());){if(p+=y,y===Ql){c++;continue}if(y===Uo){p+=g();continue}if(y===Jl&&(c--,c===0))break}m({type:"text",value:p});continue}if(p===db){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:p});continue}if(p===pb){if(s.type!=="paren"){m({type:"text",value:p});continue}s=i.pop(),m({type:"text",value:p}),s=i[i.length-1];continue}if(p===mb||p===gb||p===cb){let y=p,k;for(t.keepQuotes!==!0&&(p="");l<u&&(k=g());){if(k===Uo){p+=k+g();continue}if(k===y){t.keepQuotes===!0&&(p+=k);break}p+=k}m({type:"text",value:p});continue}if(p===fb){d++;let k={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=m(k),i.push(s),m({type:"open",value:p});continue}if(p===hb){if(s.type!=="brace"){m({type:"text",value:p});continue}let y="close";s=i.pop(),s.close=!0,m({type:y,value:p}),d--,s=i[i.length-1];continue}if(p===lb&&d>0){if(s.ranges>0){s.ranges=0;let y=s.nodes.shift();s.nodes=[y,{type:"text",value:ab(s)}]}m({type:"comma",value:p}),s.commas++;continue}if(p===ub&&d>0&&s.commas===0){let y=s.nodes;if(d===0||y.length===0){m({type:"text",value:p});continue}if(a.type==="dot"){if(s.range=[],a.value+=p,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"){y.pop();let k=y[y.length-1];k.value+=a.value+p,a=k,s.ranges--;continue}m({type:"dot",value:p});continue}m({type:"text",value:p})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let y=i[i.length-1],k=y.nodes.indexOf(s);y.nodes.splice(k,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};Zl.exports=vb});var nu=E((GC,ru)=>{"use strict";var tu=rn(),_b=Wl(),Eb=Yl(),kb=eu(),Ee=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ee.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ee.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.parse=(e,t={})=>kb(e,t);Ee.stringify=(e,t={})=>tu(typeof e=="string"?Ee.parse(e,t):e,t);Ee.compile=(e,t={})=>(typeof e=="string"&&(e=Ee.parse(e,t)),_b(e,t));Ee.expand=(e,t={})=>{typeof e=="string"&&(e=Ee.parse(e,t));let r=Eb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ee.compile(e,t):Ee.expand(e,t);ru.exports=Ee});var ar=E((WC,cu)=>{"use strict";var xb=I("path"),Be="\\\\/",ou=`[^${Be}]`,Xe="\\.",wb="\\+",Cb="\\?",sn="\\/",Ab="(?=.)",iu="[^/]",qo=`(?:${sn}|$)`,su=`(?:^|${sn})`,Yo=`${Xe}{1,2}${qo}`,Sb=`(?!${Xe})`,Rb=`(?!${su}${Yo})`,Ob=`(?!${Xe}{0,1}${qo})`,Tb=`(?!${Yo})`,Pb=`[^.${sn}]`,$b=`${iu}*?`,au={DOT_LITERAL:Xe,PLUS_LITERAL:wb,QMARK_LITERAL:Cb,SLASH_LITERAL:sn,ONE_CHAR:Ab,QMARK:iu,END_ANCHOR:qo,DOTS_SLASH:Yo,NO_DOT:Sb,NO_DOTS:Rb,NO_DOT_SLASH:Ob,NO_DOTS_SLASH:Tb,QMARK_NO_DOT:Pb,STAR:$b,START_ANCHOR:su},Db={...au,SLASH_LITERAL:`[${Be}]`,QMARK:ou,STAR:`${ou}*?`,DOTS_SLASH:`${Xe}{1,2}(?:[${Be}]|$)`,NO_DOT:`(?!${Xe})`,NO_DOTS:`(?!(?:^|[${Be}])${Xe}{1,2}(?:[${Be}]|$))`,NO_DOT_SLASH:`(?!${Xe}{0,1}(?:[${Be}]|$))`,NO_DOTS_SLASH:`(?!${Xe}{1,2}(?:[${Be}]|$))`,QMARK_NO_DOT:`[^.${Be}]`,START_ANCHOR:`(?:^|[${Be}])`,END_ANCHOR:`(?:[${Be}]|$)`},Nb={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"};cu.exports={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:{"***":"*","**/**":"**","**/**/**":"**"},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:au}}});var cr=E(ve=>{"use strict";var Lb=I("path"),Ib=process.platform==="win32",{REGEX_BACKSLASH:jb,REGEX_REMOVE_BACKSLASH:Fb,REGEX_SPECIAL_CHARS:Mb,REGEX_SPECIAL_CHARS_GLOBAL:Bb}=ar();ve.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ve.hasRegexChars=e=>Mb.test(e);ve.isRegexChar=e=>e.length===1&&ve.hasRegexChars(e);ve.escapeRegex=e=>e.replace(Bb,"\\$1");ve.toPosixSlashes=e=>e.replace(jb,"/");ve.removeBackslashes=e=>e.replace(Fb,t=>t==="\\"?"":t);ve.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ve.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Ib===!0||Lb.sep==="\\";ve.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ve.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ve.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ve.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var gu=E((qC,mu)=>{"use strict";var lu=cr(),{CHAR_ASTERISK:Ko,CHAR_AT:Hb,CHAR_BACKWARD_SLASH:lr,CHAR_COMMA:Vb,CHAR_DOT:Xo,CHAR_EXCLAMATION_MARK:zo,CHAR_FORWARD_SLASH:hu,CHAR_LEFT_CURLY_BRACE:Qo,CHAR_LEFT_PARENTHESES:Jo,CHAR_LEFT_SQUARE_BRACKET:Gb,CHAR_PLUS:Wb,CHAR_QUESTION_MARK:uu,CHAR_RIGHT_CURLY_BRACE:Ub,CHAR_RIGHT_PARENTHESES:du,CHAR_RIGHT_SQUARE_BRACKET:qb}=ar(),pu=e=>e===hu||e===lr,fu=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,d=0,p=!1,g=!1,m=!1,y=!1,k=!1,R=!1,O=!1,X=!1,xe=!1,N=!1,z=0,P,T,M={value:"",depth:0,isGlob:!1},le=()=>u>=n,_=()=>c.charCodeAt(u+1),Q=()=>(P=T,c.charCodeAt(++u));for(;u<n;){T=Q();let he;if(T===lr){O=M.backslashes=!0,T=Q(),T===Qo&&(R=!0);continue}if(R===!0||T===Qo){for(z++;le()!==!0&&(T=Q());){if(T===lr){O=M.backslashes=!0,Q();continue}if(T===Qo){z++;continue}if(R!==!0&&T===Xo&&(T=Q())===Xo){if(p=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(R!==!0&&T===Vb){if(p=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Ub&&(z--,z===0)){R=!1,p=M.isBrace=!0,N=!0;break}}if(o===!0)continue;break}if(T===hu){if(i.push(u),s.push(M),M={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===Xo&&u===l+1){l+=2;continue}d=u+1;continue}if(r.noext!==!0&&(T===Wb||T===Hb||T===Ko||T===uu||T===zo)===!0&&_()===Jo){if(m=M.isGlob=!0,y=M.isExtglob=!0,N=!0,T===zo&&u===l&&(xe=!0),o===!0){for(;le()!==!0&&(T=Q());){if(T===lr){O=M.backslashes=!0,T=Q();continue}if(T===du){m=M.isGlob=!0,N=!0;break}}continue}break}if(T===Ko){if(P===Ko&&(k=M.isGlobstar=!0),m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===uu){if(m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Gb){for(;le()!==!0&&(he=Q());){if(he===lr){O=M.backslashes=!0,Q();continue}if(he===qb){g=M.isBracket=!0,m=M.isGlob=!0,N=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&T===zo&&u===l){X=M.negated=!0,l++;continue}if(r.noparen!==!0&&T===Jo){if(m=M.isGlob=!0,o===!0){for(;le()!==!0&&(T=Q());){if(T===Jo){O=M.backslashes=!0,T=Q();continue}if(T===du){N=!0;break}}continue}break}if(m===!0){if(N=!0,o===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let q=c,tt="",b="";l>0&&(tt=c.slice(0,l),c=c.slice(l),d-=l),q&&m===!0&&d>0?(q=c.slice(0,d),b=c.slice(d)):m===!0?(q="",b=c):q=c,q&&q!==""&&q!=="/"&&q!==c&&pu(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(b&&(b=lu.removeBackslashes(b)),q&&O===!0&&(q=lu.removeBackslashes(q)));let v={prefix:tt,input:e,start:l,base:q,glob:b,isBrace:p,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:k,negated:X,negatedExtglob:xe};if(r.tokens===!0&&(v.maxDepth=0,pu(T)||s.push(M),v.tokens=s),r.parts===!0||r.tokens===!0){let he;for(let j=0;j<i.length;j++){let Le=he?he+1:l,Ie=i[j],_e=e.slice(Le,Ie);r.tokens&&(j===0&&l!==0?(s[j].isPrefix=!0,s[j].value=tt):s[j].value=_e,fu(s[j]),v.maxDepth+=s[j].depth),(j!==0||_e!=="")&&a.push(_e),he=Ie}if(he&&he+1<e.length){let j=e.slice(he+1);a.push(j),r.tokens&&(s[s.length-1].value=j,fu(s[s.length-1]),v.maxDepth+=s[s.length-1].depth)}v.slashes=i,v.parts=a}return v};mu.exports=Yb});var vu=E((YC,bu)=>{"use strict";var an=ar(),ke=cr(),{MAX_LENGTH:cn,POSIX_REGEX_SOURCE:Kb,REGEX_NON_SPECIAL_CHARS:Xb,REGEX_SPECIAL_CHARS_BACKREF:zb,REPLACEMENTS:yu}=an,Qb=(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=>ke.escapeRegex(o)).join("..")}return r},Lt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Zo=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=yu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(cn,r.maxLength):cn,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=ke.isWindows(t),u=an.globChars(c),l=an.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:k,NO_DOT_SLASH:R,NO_DOTS_SLASH:O,QMARK:X,QMARK_NO_DOT:xe,STAR:N,START_ANCHOR:z}=u,P=w=>`(${a}(?:(?!${z}${w.dot?y:d}).)*?)`,T=r.dot?"":k,M=r.dot?X:xe,le=r.bash===!0?P(r):N;r.capture&&(le=`(${le})`),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=ke.removePrefix(e,_),o=e.length;let Q=[],q=[],tt=[],b=i,v,he=()=>_.index===o-1,j=_.peek=(w=1)=>e[_.index+w],Le=_.advance=()=>e[++_.index]||"",Ie=()=>e.slice(_.index+1),_e=(w="",Y=0)=>{_.consumed+=w,_.index+=Y},_r=w=>{_.output+=w.output!=null?w.output:w.value,_e(w.value)},hf=()=>{let w=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Le(),_.start++,w++;return w%2===0?!1:(_.negated=!0,_.start++,!0)},Er=w=>{_[w]++,tt.push(w)},ht=w=>{_[w]--,tt.pop()},L=w=>{if(b.type==="globstar"){let Y=_.braces>0&&(w.type==="comma"||w.type==="brace"),x=w.extglob===!0||Q.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!Y&&!x&&(_.output=_.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=le,_.output+=b.output)}if(Q.length&&w.type!=="paren"&&(Q[Q.length-1].inner+=w.value),(w.value||w.output)&&_r(w),b&&b.type==="text"&&w.type==="text"){b.value+=w.value,b.output=(b.output||"")+w.value;return}w.prev=b,s.push(w),b=w},kr=(w,Y)=>{let x={...l[Y],conditions:1,inner:""};x.prev=b,x.parens=_.parens,x.output=_.output;let D=(r.capture?"(":"")+x.open;Er("parens"),L({type:w,value:Y,output:_.output?"":m}),L({type:"paren",extglob:!0,value:Le(),output:D}),Q.push(x)},mf=w=>{let Y=w.close+(r.capture?")":""),x;if(w.type==="negate"){let D=le;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(D=P(r)),(D!==le||he()||/^\)+$/.test(Ie()))&&(Y=w.close=`)$))${D}`),w.inner.includes("*")&&(x=Ie())&&/^\.[^\\/.]+$/.test(x)){let ee=Zo(x,{...t,fastpaths:!1}).output;Y=w.close=`)${ee})${D})`}w.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:v,output:Y}),ht("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let w=!1,Y=e.replace(zb,(x,D,ee,me,ie,Bn)=>me==="\\"?(w=!0,x):me==="?"?D?D+me+(ie?X.repeat(ie.length):""):Bn===0?M+(ie?X.repeat(ie.length):""):X.repeat(ee.length):me==="."?d.repeat(ee.length):me==="*"?D?D+me+(ie?le:""):le:D?x:`\\${x}`);return w===!0&&(r.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,x=>x.length%2===0?"\\\\":x?"\\":"")),Y===e&&r.contains===!0?(_.output=e,_):(_.output=ke.wrapOutput(Y,_,t),_)}for(;!he();){if(v=Le(),v==="\0")continue;if(v==="\\"){let x=j();if(x==="/"&&r.bash!==!0||x==="."||x===";")continue;if(!x){v+="\\",L({type:"text",value:v});continue}let D=/^\\+/.exec(Ie()),ee=0;if(D&&D[0].length>2&&(ee=D[0].length,_.index+=ee,ee%2!==0&&(v+="\\")),r.unescape===!0?v=Le():v+=Le(),_.brackets===0){L({type:"text",value:v});continue}}if(_.brackets>0&&(v!=="]"||b.value==="["||b.value==="[^")){if(r.posix!==!1&&v===":"){let x=b.value.slice(1);if(x.includes("[")&&(b.posix=!0,x.includes(":"))){let D=b.value.lastIndexOf("["),ee=b.value.slice(0,D),me=b.value.slice(D+2),ie=Kb[me];if(ie){b.value=ee+ie,_.backtrack=!0,Le(),!i.output&&s.indexOf(b)===1&&(i.output=m);continue}}}(v==="["&&j()!==":"||v==="-"&&j()==="]")&&(v=`\\${v}`),v==="]"&&(b.value==="["||b.value==="[^")&&(v=`\\${v}`),r.posix===!0&&v==="!"&&b.value==="["&&(v="^"),b.value+=v,_r({value:v});continue}if(_.quotes===1&&v!=='"'){v=ke.escapeRegex(v),b.value+=v,_r({value:v});continue}if(v==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:v});continue}if(v==="("){Er("parens"),L({type:"paren",value:v});continue}if(v===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Lt("opening","("));let x=Q[Q.length-1];if(x&&_.parens===x.parens+1){mf(Q.pop());continue}L({type:"paren",value:v,output:_.parens?")":"\\)"}),ht("parens");continue}if(v==="["){if(r.nobracket===!0||!Ie().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Lt("closing","]"));v=`\\${v}`}else Er("brackets");L({type:"bracket",value:v});continue}if(v==="]"){if(r.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){L({type:"text",value:v,output:`\\${v}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Lt("opening","["));L({type:"text",value:v,output:`\\${v}`});continue}ht("brackets");let x=b.value.slice(1);if(b.posix!==!0&&x[0]==="^"&&!x.includes("/")&&(v=`/${v}`),b.value+=v,_r({value:v}),r.literalBrackets===!1||ke.hasRegexChars(x))continue;let D=ke.escapeRegex(b.value);if(_.output=_.output.slice(0,-b.value.length),r.literalBrackets===!0){_.output+=D,b.value=D;continue}b.value=`(${a}${D}|${b.value})`,_.output+=b.value;continue}if(v==="{"&&r.nobrace!==!0){Er("braces");let x={type:"brace",value:v,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};q.push(x),L(x);continue}if(v==="}"){let x=q[q.length-1];if(r.nobrace===!0||!x){L({type:"text",value:v,output:v});continue}let D=")";if(x.dots===!0){let ee=s.slice(),me=[];for(let ie=ee.length-1;ie>=0&&(s.pop(),ee[ie].type!=="brace");ie--)ee[ie].type!=="dots"&&me.unshift(ee[ie].value);D=Qb(me,r),_.backtrack=!0}if(x.comma!==!0&&x.dots!==!0){let ee=_.output.slice(0,x.outputIndex),me=_.tokens.slice(x.tokensIndex);x.value=x.output="\\{",v=D="\\}",_.output=ee;for(let ie of me)_.output+=ie.output||ie.value}L({type:"brace",value:v,output:D}),ht("braces"),q.pop();continue}if(v==="|"){Q.length>0&&Q[Q.length-1].conditions++,L({type:"text",value:v});continue}if(v===","){let x=v,D=q[q.length-1];D&&tt[tt.length-1]==="braces"&&(D.comma=!0,x="|"),L({type:"comma",value:v,output:x});continue}if(v==="/"){if(b.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),b=i;continue}L({type:"slash",value:v,output:g});continue}if(v==="."){if(_.braces>0&&b.type==="dot"){b.value==="."&&(b.output=d);let x=q[q.length-1];b.type="dots",b.output+=v,b.value+=v,x.dots=!0;continue}if(_.braces+_.parens===0&&b.type!=="bos"&&b.type!=="slash"){L({type:"text",value:v,output:d});continue}L({type:"dot",value:v,output:d});continue}if(v==="?"){if(!(b&&b.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){kr("qmark",v);continue}if(b&&b.type==="paren"){let D=j(),ee=v;if(D==="<"&&!ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ee=`\\${v}`),L({type:"text",value:v,output:ee});continue}if(r.dot!==!0&&(b.type==="slash"||b.type==="bos")){L({type:"qmark",value:v,output:xe});continue}L({type:"qmark",value:v,output:X});continue}if(v==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){kr("negate",v);continue}if(r.nonegate!==!0&&_.index===0){hf();continue}}if(v==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){kr("plus",v);continue}if(b&&b.value==="("||r.regex===!1){L({type:"plus",value:v,output:p});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||_.parens>0){L({type:"plus",value:v});continue}L({type:"plus",value:p});continue}if(v==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){L({type:"at",extglob:!0,value:v,output:""});continue}L({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let x=Xb.exec(Ie());x&&(v+=x[0],_.index+=x[0].length),L({type:"text",value:v});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=v,b.output=le,_.backtrack=!0,_.globstar=!0,_e(v);continue}let w=Ie();if(r.noextglob!==!0&&/^\([^?]/.test(w)){kr("star",v);continue}if(b.type==="star"){if(r.noglobstar===!0){_e(v);continue}let x=b.prev,D=x.prev,ee=x.type==="slash"||x.type==="bos",me=D&&(D.type==="star"||D.type==="globstar");if(r.bash===!0&&(!ee||w[0]&&w[0]!=="/")){L({type:"star",value:v,output:""});continue}let ie=_.braces>0&&(x.type==="comma"||x.type==="brace"),Bn=Q.length&&(x.type==="pipe"||x.type==="paren");if(!ee&&x.type!=="paren"&&!ie&&!Bn){L({type:"star",value:v,output:""});continue}for(;w.slice(0,3)==="/**";){let xr=e[_.index+4];if(xr&&xr!=="/")break;w=w.slice(3),_e("/**",3)}if(x.type==="bos"&&he()){b.type="globstar",b.value+=v,b.output=P(r),_.output=b.output,_.globstar=!0,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&!me&&he()){_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=P(r)+(r.strictSlashes?")":"|$)"),b.value+=v,_.globstar=!0,_.output+=x.output+b.output,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&w[0]==="/"){let xr=w[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=`${P(r)}${g}|${g}${xr})`,b.value+=v,_.output+=x.output+b.output,_.globstar=!0,_e(v+Le()),L({type:"slash",value:"/",output:""});continue}if(x.type==="bos"&&w[0]==="/"){b.type="globstar",b.value+=v,b.output=`(?:^|${g}|${P(r)}${g})`,_.output=b.output,_.globstar=!0,_e(v+Le()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-b.output.length),b.type="globstar",b.output=P(r),b.value+=v,_.output+=b.output,_.globstar=!0,_e(v);continue}let Y={type:"star",value:v,output:le};if(r.bash===!0){Y.output=".*?",(b.type==="bos"||b.type==="slash")&&(Y.output=T+Y.output),L(Y);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&r.regex===!0){Y.output=v,L(Y);continue}(_.index===_.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(_.output+=R,b.output+=R):r.dot===!0?(_.output+=O,b.output+=O):(_.output+=T,b.output+=T),j()!=="*"&&(_.output+=m,b.output+=m)),L(Y)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lt("closing","]"));_.output=ke.escapeLast(_.output,"["),ht("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lt("closing",")"));_.output=ke.escapeLast(_.output,"("),ht("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lt("closing","}"));_.output=ke.escapeLast(_.output,"{"),ht("braces")}if(r.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${g}?`}),_.backtrack===!0){_.output="";for(let w of _.tokens)_.output+=w.output!=null?w.output:w.value,w.suffix&&(_.output+=w.suffix)}return _};Zo.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(cn,r.maxLength):cn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=yu[e]||e;let i=ke.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:g,START_ANCHOR:m}=an.globChars(i),y=r.dot?d:l,k=r.dot?p:l,R=r.capture?"":"?:",O={negated:!1,prefix:""},X=r.bash===!0?".*?":g;r.capture&&(X=`(${X})`);let xe=T=>T.noglobstar===!0?X:`(${R}(?:(?!${m}${T.dot?u:s}).)*?)`,N=T=>{switch(T){case"*":return`${y}${c}${X}`;case".*":return`${s}${c}${X}`;case"*.*":return`${y}${X}${s}${c}${X}`;case"*/*":return`${y}${X}${a}${c}${k}${X}`;case"**":return y+xe(r);case"**/*":return`(?:${y}${xe(r)}${a})?${k}${c}${X}`;case"**/*.*":return`(?:${y}${xe(r)}${a})?${k}${X}${s}${c}${X}`;case"**/.*":return`(?:${y}${xe(r)}${a})?${s}${c}${X}`;default:{let M=/^(.*?)\.(\w+)$/.exec(T);if(!M)return;let le=N(M[1]);return le?le+s+M[2]:void 0}}},z=ke.removePrefix(e,O),P=N(z);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};bu.exports=Zo});var Eu=E((KC,_u)=>{"use strict";var Jb=I("path"),Zb=gu(),ei=vu(),ti=cr(),ev=ar(),tv=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(p=>re(p,t,r));return p=>{for(let g of l){let m=g(p);if(m)return m}return!1}}let n=tv(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=ti.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,d=!1)=>{let{isMatch:p,match:g,output:m}=re.test(l,s,t,{glob:e,posix:i}),y={glob:e,state:a,regex:s,posix:i,input:l,output:m,match:g,isMatch:p};return typeof o.onResult=="function"&&o.onResult(y),p===!1?(y.isMatch=!1,d?y:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,d?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),d?y:!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?ti.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=ti.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(Jb.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)=>Zb(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=ev;_u.exports=re});var xu=E((XC,ku)=>{"use strict";ku.exports=Eu()});var Ou=E((zC,Ru)=>{"use strict";var Cu=I("util"),Au=nu(),He=xu(),ri=cr(),wu=e=>e===""||e==="./",Su=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},K=(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 d=He(String(t[l]),{...r,onResult:a},!0),p=d.state.negated||d.state.negatedExtglob;p&&s++;for(let g of e){let m=d(g,!0);(p?!m.isMatch:m.isMatch)&&(p?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};K.match=K;K.matcher=(e,t)=>He(e,t);K.isMatch=(e,t,r)=>He(t,r)(e);K.any=K.isMatch;K.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(K(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};K.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Cu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>K.contains(e,n,r));if(typeof t=="string"){if(wu(e)||wu(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return K.isMatch(e,t,{...r,contains:!0})};K.matchKeys=(e,t,r)=>{if(!ri.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=K(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};K.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=He(String(o),r);if(n.some(s=>i(s)))return!0}return!1};K.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=He(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};K.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Cu.inspect(e)}"`);return[].concat(t).every(n=>He(n,r)(e))};K.capture=(e,t,r)=>{let n=ri.isWindows(r),i=He.makeRe(String(e),{...r,capture:!0}).exec(n?ri.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};K.makeRe=(...e)=>He.makeRe(...e);K.scan=(...e)=>He.scan(...e);K.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of Au(String(n),t))r.push(He.parse(o,t));return r};K.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Su(e)?[e]:Au(e,t)};K.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return K.braces(e,{...t,expand:!0})};K.hasBraces=Su;Ru.exports=K});var Mu=E(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.isAbsolute=S.partitionAbsoluteAndRelative=S.removeDuplicateSlashes=S.matchAny=S.convertPatternsToRe=S.makeRe=S.getPatternParts=S.expandBraceExpansion=S.expandPatternsWithBraceExpansion=S.isAffectDepthOfReadingPattern=S.endsWithSlashGlobStar=S.hasGlobStar=S.getBaseDirectory=S.isPatternRelatedToParentDirectory=S.getPatternsOutsideCurrentDirectory=S.getPatternsInsideCurrentDirectory=S.getPositivePatterns=S.getNegativePatterns=S.isPositivePattern=S.isNegativePattern=S.convertToNegativePattern=S.convertToPositivePattern=S.isDynamicPattern=S.isStaticPattern=void 0;var Tu=I("path"),rv=El(),ni=Ou(),Pu="**",nv="\\",ov=/[*?]|^!/,iv=/\[[^[]*]/,sv=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,av=/[!*+?@]\([^(]*\)/,cv=/,|\.\./,lv=/(?!^)\/{2,}/g;function $u(e,t={}){return!Du(e,t)}S.isStaticPattern=$u;function Du(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(nv)||ov.test(e)||iv.test(e)||sv.test(e)||t.extglob!==!1&&av.test(e)||t.braceExpansion!==!1&&uv(e))}S.isDynamicPattern=Du;function uv(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 cv.test(n)}function dv(e){return ln(e)?e.slice(1):e}S.convertToPositivePattern=dv;function pv(e){return"!"+e}S.convertToNegativePattern=pv;function ln(e){return e.startsWith("!")&&e[1]!=="("}S.isNegativePattern=ln;function Nu(e){return!ln(e)}S.isPositivePattern=Nu;function fv(e){return e.filter(ln)}S.getNegativePatterns=fv;function hv(e){return e.filter(Nu)}S.getPositivePatterns=hv;function mv(e){return e.filter(t=>!oi(t))}S.getPatternsInsideCurrentDirectory=mv;function gv(e){return e.filter(oi)}S.getPatternsOutsideCurrentDirectory=gv;function oi(e){return e.startsWith("..")||e.startsWith("./..")}S.isPatternRelatedToParentDirectory=oi;function yv(e){return rv(e,{flipBackslashes:!1})}S.getBaseDirectory=yv;function bv(e){return e.includes(Pu)}S.hasGlobStar=bv;function Lu(e){return e.endsWith("/"+Pu)}S.endsWithSlashGlobStar=Lu;function vv(e){let t=Tu.basename(e);return Lu(e)||$u(t)}S.isAffectDepthOfReadingPattern=vv;function _v(e){return e.reduce((t,r)=>t.concat(Iu(r)),[])}S.expandPatternsWithBraceExpansion=_v;function Iu(e){let t=ni.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}S.expandBraceExpansion=Iu;function Ev(e,t){let{parts:r}=ni.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}S.getPatternParts=Ev;function ju(e,t){return ni.makeRe(e,t)}S.makeRe=ju;function kv(e,t){return e.map(r=>ju(r,t))}S.convertPatternsToRe=kv;function xv(e,t){return t.some(r=>r.test(e))}S.matchAny=xv;function wv(e){return e.replace(lv,"/")}S.removeDuplicateSlashes=wv;function Cv(e){let t=[],r=[];for(let n of e)Fu(n)?t.push(n):r.push(n);return[t,r]}S.partitionAbsoluteAndRelative=Cv;function Fu(e){return Tu.isAbsolute(e)}S.isAbsolute=Fu});var Gu=E((JC,Vu)=>{"use strict";var Av=I("stream"),Bu=Av.PassThrough,Sv=Array.prototype.slice;Vu.exports=Rv;function Rv(){let e=[],t=Sv.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=Bu(n);function a(){for(let l=0,d=arguments.length;l<d;l++)e.push(Hu(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 d=l.length+1;function p(){--d>0||(r=!1,c())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",k),p()}function k(R){s.emit("error",R)}if(m._readableState.endEmitted)return p();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",k),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)g(l[m]);p()}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 Hu(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=Hu(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Bu(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var Uu=E(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.merge=void 0;var Ov=Gu();function Tv(e){let t=Ov(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Wu(e)),t.once("end",()=>Wu(e)),t}un.merge=Tv;function Wu(e){e.forEach(t=>t.emit("close"))}});var qu=E(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.isEmpty=It.isString=void 0;function Pv(e){return typeof e=="string"}It.isString=Pv;function $v(e){return e===""}It.isEmpty=$v});var ze=E(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.string=pe.stream=pe.pattern=pe.path=pe.fs=pe.errno=pe.array=void 0;var Dv=cl();pe.array=Dv;var Nv=ll();pe.errno=Nv;var Lv=ul();pe.fs=Lv;var Iv=hl();pe.path=Iv;var jv=Mu();pe.pattern=jv;var Fv=Uu();pe.stream=Fv;var Mv=qu();pe.string=Mv});var zu=E(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.convertPatternGroupToTask=fe.convertPatternGroupsToTasks=fe.groupPatternsByBaseDirectory=fe.getNegativePatternsAsPositive=fe.getPositivePatterns=fe.convertPatternsToTasks=fe.generate=void 0;var $e=ze();function Bv(e,t){let r=Yu(e,t),n=Yu(t.ignore,t),o=Ku(r),i=Xu(r,n),s=o.filter(l=>$e.pattern.isStaticPattern(l,t)),a=o.filter(l=>$e.pattern.isDynamicPattern(l,t)),c=ii(s,i,!1),u=ii(a,i,!0);return c.concat(u)}fe.generate=Bv;function Yu(e,t){let r=e;return t.braceExpansion&&(r=$e.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>$e.pattern.removeDuplicateSlashes(n))}function ii(e,t,r){let n=[],o=$e.pattern.getPatternsOutsideCurrentDirectory(e),i=$e.pattern.getPatternsInsideCurrentDirectory(e),s=si(o),a=si(i);return n.push(...ai(s,t,r)),"."in a?n.push(ci(".",i,t,r)):n.push(...ai(a,t,r)),n}fe.convertPatternsToTasks=ii;function Ku(e){return $e.pattern.getPositivePatterns(e)}fe.getPositivePatterns=Ku;function Xu(e,t){return $e.pattern.getNegativePatterns(e).concat(t).map($e.pattern.convertToPositivePattern)}fe.getNegativePatternsAsPositive=Xu;function si(e){let t={};return e.reduce((r,n)=>{let o=$e.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}fe.groupPatternsByBaseDirectory=si;function ai(e,t,r){return Object.keys(e).map(n=>ci(n,e[n],t,r))}fe.convertPatternGroupsToTasks=ai;function ci(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map($e.pattern.convertToNegativePattern))}}fe.convertPatternGroupToTask=ci});var Ju=E(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.read=void 0;function Hv(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Qu(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){li(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Qu(r,i);return}li(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),li(r,s)})})}dn.read=Hv;function Qu(e,t){e(t)}function li(e,t){e(null,t)}});var Zu=E(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.read=void 0;function Vv(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}}pn.read=Vv});var ed=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.createFileSystemAdapter=at.FILE_SYSTEM_ADAPTER=void 0;var fn=I("fs");at.FILE_SYSTEM_ADAPTER={lstat:fn.lstat,stat:fn.stat,lstatSync:fn.lstatSync,statSync:fn.statSync};function Gv(e){return e===void 0?at.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},at.FILE_SYSTEM_ADAPTER),e)}at.createFileSystemAdapter=Gv});var td=E(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});var Wv=ed(),ui=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=Wv.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}};di.default=ui});var Et=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.statSync=ct.stat=ct.Settings=void 0;var rd=Ju(),Uv=Zu(),pi=td();ct.Settings=pi.default;function qv(e,t,r){if(typeof t=="function"){rd.read(e,fi(),t);return}rd.read(e,fi(t),r)}ct.stat=qv;function Yv(e,t){let r=fi(t);return Uv.read(e,r)}ct.statSync=Yv;function fi(e={}){return e instanceof pi.default?e:new pi.default(e)}});var id=E((cA,od)=>{var nd;od.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(nd||(nd=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var ad=E((lA,sd)=>{sd.exports=Xv;var Kv=id();function Xv(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?Kv(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,d){a(u,l,d)})}):s(null),i=!1}});var hi=E(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var hn=process.versions.node.split(".");if(hn[0]===void 0||hn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var cd=Number.parseInt(hn[0],10),zv=Number.parseInt(hn[1],10),ld=10,Qv=10,Jv=cd>ld,Zv=cd===ld&&zv>=Qv;mn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Jv||Zv});var ud=E(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.createDirentFromStats=void 0;var mi=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 e_(e,t){return new mi(e,t)}gn.createDirentFromStats=e_});var gi=E(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.fs=void 0;var t_=ud();yn.fs=t_});var yi=E(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.joinPathSegments=void 0;function r_(e,t,r){return e.endsWith(r)?e+t:e+r+t}bn.joinPathSegments=r_});var gd=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.readdir=lt.readdirWithFileTypes=lt.read=void 0;var n_=Et(),dd=ad(),o_=hi(),pd=gi(),fd=yi();function i_(e,t,r){if(!t.stats&&o_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){hd(e,t,r);return}md(e,t,r)}lt.read=i_;function hd(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){vn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:fd.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){bi(r,i);return}let s=i.map(a=>s_(a,t));dd(s,(a,c)=>{if(a!==null){vn(r,a);return}bi(r,c)})})}lt.readdirWithFileTypes=hd;function s_(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=pd.fs.createDirentFromStats(e.name,o),r(null,e)})}}function md(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){vn(r,n);return}let i=o.map(s=>{let a=fd.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{n_.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let d={name:s,path:a,dirent:pd.fs.createDirentFromStats(s,l)};t.stats&&(d.stats=l),c(null,d)})}});dd(i,(s,a)=>{if(s!==null){vn(r,s);return}bi(r,a)})})}lt.readdir=md;function vn(e,t){e(t)}function bi(e,t){e(null,t)}});var Ed=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.readdir=ut.readdirWithFileTypes=ut.read=void 0;var a_=Et(),c_=hi(),yd=gi(),bd=yi();function l_(e,t){return!t.stats&&c_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?vd(e,t):_d(e,t)}ut.read=l_;function vd(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:bd.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=yd.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}ut.readdirWithFileTypes=vd;function _d(e,t){return t.fs.readdirSync(e).map(n=>{let o=bd.joinPathSegments(e,n,t.pathSegmentSeparator),i=a_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:yd.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}ut.readdir=_d});var kd=E(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.createFileSystemAdapter=dt.FILE_SYSTEM_ADAPTER=void 0;var jt=I("fs");dt.FILE_SYSTEM_ADAPTER={lstat:jt.lstat,stat:jt.stat,lstatSync:jt.lstatSync,statSync:jt.statSync,readdir:jt.readdir,readdirSync:jt.readdirSync};function u_(e){return e===void 0?dt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},dt.FILE_SYSTEM_ADAPTER),e)}dt.createFileSystemAdapter=u_});var xd=E(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var d_=I("path"),p_=Et(),f_=kd(),vi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=f_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,d_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new p_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};_i.default=vi});var _n=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.Settings=pt.scandirSync=pt.scandir=void 0;var wd=gd(),h_=Ed(),Ei=xd();pt.Settings=Ei.default;function m_(e,t,r){if(typeof t=="function"){wd.read(e,ki(),t);return}wd.read(e,ki(t),r)}pt.scandir=m_;function g_(e,t){let r=ki(t);return h_.read(e,r)}pt.scandirSync=g_;function ki(e={}){return e instanceof Ei.default?e:new Ei.default(e)}});var Ad=E((vA,Cd)=>{"use strict";function y_(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}}Cd.exports=y_});var Rd=E((_A,xi)=>{"use strict";var b_=Ad();function Sd(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=b_(v_),o=null,i=null,s=0,a=null,c={push:y,drain:Se,saturated:Se,pause:l,paused:!1,get concurrency(){return r},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=N,!c.paused)for(;o&&s<r;)s++,R()},running:u,resume:g,idle:m,length:d,getQueue:p,unshift:k,empty:Se,kill:O,killAndDrain:X,error:xe};return c;function u(){return s}function l(){c.paused=!0}function d(){for(var N=o,z=0;N;)N=N.next,z++;return z}function p(){for(var N=o,z=[];N;)z.push(N.value),N=N.next;return z}function g(){if(c.paused){if(c.paused=!1,o===null){s++,R();return}for(;o&&s<r;)s++,R()}}function m(){return s===0&&c.length()===0}function y(N,z){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=z||Se,P.errorHandler=a,s>=r||c.paused?i?(i.next=P,i=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function k(N,z){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=z||Se,P.errorHandler=a,s>=r||c.paused?o?(P.next=o,o=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function R(N){N&&n.release(N);var z=o;z&&s<=r?c.paused?s--:(i===o&&(i=null),o=z.next,z.next=null,t.call(e,z.value,z.worked),i===null&&c.empty()):--s===0&&c.drain()}function O(){o=null,i=null,c.drain=Se}function X(){o=null,i=null,c.drain(),c.drain=Se}function xe(N){a=N}}function Se(){}function v_(){this.value=null,this.callback=Se,this.next=null,this.release=Se,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=Se,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function __(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,d){t.call(this,l).then(function(p){d(null,p)},d)}var o=Sd(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=u,o;function a(l){var d=new Promise(function(p,g){i(l,function(m,y){if(m){g(m);return}p(y)})});return d.catch(Se),d}function c(l){var d=new Promise(function(p,g){s(l,function(m,y){if(m){g(m);return}p(y)})});return d.catch(Se),d}function u(){var l=new Promise(function(d){process.nextTick(function(){if(o.idle())d();else{var p=o.drain;o.drain=function(){typeof p=="function"&&p(),d(),o.drain=p}}})});return l}}xi.exports=Sd;xi.exports.promise=__});var En=E(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.joinPathSegments=Ve.replacePathSegmentSeparator=Ve.isAppliedFilter=Ve.isFatalError=void 0;function E_(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ve.isFatalError=E_;function k_(e,t){return e===null||e(t)}Ve.isAppliedFilter=k_;function x_(e,t){return e.split(/[/\\]/).join(t)}Ve.replacePathSegmentSeparator=x_;function w_(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ve.joinPathSegments=w_});var Ai=E(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});var C_=En(),wi=class{constructor(t,r){this._root=t,this._settings=r,this._root=C_.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Ci.default=wi});var Oi=E(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});var A_=I("events"),S_=_n(),R_=Rd(),kn=En(),O_=Ai(),Si=class extends O_.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=S_.scandir,this._emitter=new A_.EventEmitter,this._queue=R_(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||!kn.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=kn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),kn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&kn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};Ri.default=Si});var Od=E(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});var T_=Oi(),Ti=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new T_.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{P_(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{$_(t,this._storage)}),this._reader.read()}};Pi.default=Ti;function P_(e,t){e(t)}function $_(e,t){e(null,t)}});var Td=E(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});var D_=I("stream"),N_=Oi(),$i=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new N_.default(this._root,this._settings),this._stream=new D_.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}};Di.default=$i});var Pd=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var L_=_n(),xn=En(),I_=Ai(),Ni=class extends I_.default{constructor(){super(...arguments),this._scandir=L_.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(xn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=xn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),xn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&xn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Li.default=Ni});var $d=E(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});var j_=Pd(),Ii=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new j_.default(this._root,this._settings)}read(){return this._reader.read()}};ji.default=Ii});var Dd=E(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var F_=I("path"),M_=_n(),Fi=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,F_.sep),this.fsScandirSettings=new M_.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}};Mi.default=Fi});var Cn=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.Settings=Ge.walkStream=Ge.walkSync=Ge.walk=void 0;var Nd=Od(),B_=Td(),H_=$d(),Bi=Dd();Ge.Settings=Bi.default;function V_(e,t,r){if(typeof t=="function"){new Nd.default(e,wn()).read(t);return}new Nd.default(e,wn(t)).read(r)}Ge.walk=V_;function G_(e,t){let r=wn(t);return new H_.default(e,r).read()}Ge.walkSync=G_;function W_(e,t){let r=wn(t);return new B_.default(e,r).read()}Ge.walkStream=W_;function wn(e={}){return e instanceof Bi.default?e:new Bi.default(e)}});var An=E(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var U_=I("path"),q_=Et(),Ld=ze(),Hi=class{constructor(t){this._settings=t,this._fsStatSettings=new q_.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return U_.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}};Vi.default=Hi});var Ui=E(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var Y_=I("stream"),K_=Et(),X_=Cn(),z_=An(),Gi=class extends z_.default{constructor(){super(...arguments),this._walkStream=X_.walkStream,this._stat=K_.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new Y_.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))})}};Wi.default=Gi});var Id=E(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Q_=Cn(),J_=An(),Z_=Ui(),qi=class extends J_.default{constructor(){super(...arguments),this._walkAsync=Q_.walk,this._readerStream=new Z_.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))})}};Yi.default=qi});var jd=E(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var ur=ze(),Ki=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 ur.pattern.getPatternParts(t,this._micromatchOptions).map(n=>ur.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:ur.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return ur.array.splitWhen(t,r=>r.dynamic&&ur.pattern.hasGlobStar(r.pattern))}};Xi.default=Ki});var Fd=E(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var eE=jd(),zi=class extends eE.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}};Qi.default=zi});var Md=E(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var Sn=ze(),tE=Fd(),Ji=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 tE.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(Sn.pattern.isAffectDepthOfReadingPattern);return Sn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Sn.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!Sn.pattern.matchAny(t,r)}};Zi.default=Ji});var Bd=E(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var ft=ze(),es=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=ft.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:ft.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:ft.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:ft.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=ft.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=ft.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=ft.pattern.matchAny(t,r);return!o&&n?ft.pattern.matchAny(t+"/",r):o}};ts.default=es});var Hd=E(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var rE=ze(),rs=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return rE.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};ns.default=rs});var Gd=E(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var Vd=ze(),os=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=Vd.path.makeAbsolute(this._settings.cwd,r),r=Vd.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};is.default=os});var Rn=E(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var nE=I("path"),oE=Md(),iE=Bd(),sE=Hd(),aE=Gd(),ss=class{constructor(t){this._settings=t,this.errorFilter=new sE.default(this._settings),this.entryFilter=new iE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new oE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new aE.default(this._settings)}_getRootDirectory(t){return nE.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}}};as.default=ss});var Wd=E(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var cE=Id(),lE=Rn(),cs=class extends lE.default{constructor(){super(...arguments),this._reader=new cE.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)}};ls.default=cs});var Ud=E(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var uE=I("stream"),dE=Ui(),pE=Rn(),us=class extends pE.default{constructor(){super(...arguments),this._reader=new dE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new uE.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)}};ds.default=us});var qd=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var fE=Et(),hE=Cn(),mE=An(),ps=class extends mE.default{constructor(){super(...arguments),this._walkSync=hE.walkSync,this._statSync=fE.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)}};fs.default=ps});var Yd=E(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var gE=qd(),yE=Rn(),hs=class extends yE.default{constructor(){super(...arguments),this._reader=new gE.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)}};ms.default=hs});var Kd=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var Ft=I("fs"),bE=I("os"),vE=Math.max(bE.cpus().length,1);Mt.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Ft.lstat,lstatSync:Ft.lstatSync,stat:Ft.stat,statSync:Ft.statSync,readdir:Ft.readdir,readdirSync:Ft.readdirSync};var gs=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,vE),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({},Mt.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};Mt.default=gs});var _s=E((UA,zd)=>{"use strict";var Xd=zu(),_E=Wd(),EE=Ud(),kE=Yd(),ys=Kd(),Re=ze();async function bs(e,t){De(e);let r=vs(e,_E.default,t),n=await Promise.all(r);return Re.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){De(u);let d=vs(u,kE.default,l);return Re.array.flatten(d)}e.sync=t;function r(u,l){De(u);let d=vs(u,EE.default,l);return Re.stream.merge(d)}e.stream=r;function n(u,l){De(u);let d=[].concat(u),p=new ys.default(l);return Xd.generate(d,p)}e.generateTasks=n;function o(u,l){De(u);let d=new ys.default(l);return Re.pattern.isDynamicPattern(u,d)}e.isDynamicPattern=o;function i(u){return De(u),Re.path.escape(u)}e.escapePath=i;function s(u){return De(u),Re.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(p){return De(p),Re.path.escapePosixPath(p)}u.escapePath=l;function d(p){return De(p),Re.path.convertPosixPathToPattern(p)}u.convertPathToPattern=d})(a=e.posix||(e.posix={}));let c;(function(u){function l(p){return De(p),Re.path.escapeWindowsPath(p)}u.escapePath=l;function d(p){return De(p),Re.path.convertWindowsPathToPattern(p)}u.convertPathToPattern=d})(c=e.win32||(e.win32={}))})(bs||(bs={}));function vs(e,t,r){let n=[].concat(e),o=new ys.default(r),i=Xd.generate(n,o),s=new t(o);return i.map(s.read,s)}function De(e){if(![].concat(e).every(n=>Re.string.isString(n)&&!Re.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}zd.exports=bs});import xE from"node:fs";import wE from"node:fs/promises";async function Es(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await wE[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function ks(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return xE[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var KA,Qd,XA,zA,Jd,QA,Zd=rt(()=>{KA=Es.bind(void 0,"stat","isFile"),Qd=Es.bind(void 0,"stat","isDirectory"),XA=Es.bind(void 0,"lstat","isSymbolicLink"),zA=ks.bind(void 0,"statSync","isFile"),Jd=ks.bind(void 0,"statSync","isDirectory"),QA=ks.bind(void 0,"lstatSync","isSymbolicLink")});var ep=rt(()=>{});import{promisify as CE}from"node:util";import{execFile as AE,execFileSync as r0}from"node:child_process";import{fileURLToPath as SE}from"node:url";function dr(e){return e instanceof URL?SE(e):e}var o0,i0,xs=rt(()=>{ep();o0=CE(AE);i0=10*1024*1024});var lp=E((c0,Pn)=>{function np(e){return Array.isArray(e)?e:[e]}var RE=void 0,Cs="",tp=" ",ws="\\",OE=/^\s+$/,TE=/(?:[^\\]|^)\\$/,PE=/^\\!/,$E=/^\\#/,DE=/\r?\n/g,NE=/^\.{0,2}\/|^\.{1,2}$/,LE=/\/$/,Bt="/",op="node-ignore";typeof Symbol<"u"&&(op=Symbol.for("node-ignore"));var ip=op,Ht=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),IE=/([0-z])-([0-z])/g,sp=()=>!1,jE=e=>e.replace(IE,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Cs),FE=e=>{let{length:t}=e;return e.slice(0,t-t%2)},ME=[[/^\uFEFF/,()=>Cs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?tp:Cs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+tp}],[/[\\$.|*+(){^]/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,()=>ws],[/\\\\/g,()=>ws],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===ws?`\\[${r}${FE(n)}${o}`:o==="]"&&n.length%2===0?`[${jE(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],BE=/(^|\\\/)?\\\*$/,pr="regex",On="checkRegex",rp="_",HE={[pr](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[On](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},VE=e=>ME.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Tn=e=>typeof e=="string",GE=e=>e&&Tn(e)&&!OE.test(e)&&!TE.test(e)&&e.indexOf("#")!==0,WE=e=>e.split(DE).filter(Boolean),As=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Ht(this,"body",n),Ht(this,"ignoreCase",o),Ht(this,"regexPrefix",s)}get regex(){let t=rp+pr;return this[t]?this[t]:this._make(pr,t)}get checkRegex(){let t=rp+On;return this[t]?this[t]:this._make(On,t)}_make(t,r){let n=this.regexPrefix.replace(BE,HE[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Ht(this,r,o)}},UE=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(PE,"!").replace($E,"#");let i=VE(o);return new As(e,t,o,r,n,i)},Ss=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[ip]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Tn(t)&&(t={pattern:t}),GE(t.pattern)){let r=UE(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,np(Tn(t)?WE(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?RE:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},qE=(e,t)=>{throw new t(e)},Qe=(e,t,r)=>Tn(e)?e?Qe.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),ap=e=>NE.test(e);Qe.isNotRelative=ap;Qe.convert=e=>e;var Rs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Ht(this,ip,!0),this._rules=new Ss(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&&Qe.convert(t);return Qe(i,t,this._strictPathCheck?qE:sp),this._t(i,r,n,o)}checkIgnore(t){if(!LE.test(t))return this.test(t);let r=t.split(Bt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Bt)+Bt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,On)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Bt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,pr);let i=this._t(o.join(Bt)+Bt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,pr)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return np(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Os=e=>new Rs(e),YE=e=>Qe(e&&Qe.convert(e),e,sp),cp=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qe.convert=e;let t=/^[a-z]:\//i;Qe.isNotRelative=r=>t.test(r)||ap(r)};typeof process<"u"&&process.platform==="win32"&&cp();Pn.exports=Os;Os.default=Os;Pn.exports.isPathValid=YE;Ht(Pn.exports,Symbol.for("setupWindows"),cp)});function Vt(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var up=rt(()=>{});var fr,Ts=rt(()=>{fr=e=>e[0]==="!"});import KE from"node:process";import XE from"node:fs";import zE from"node:fs/promises";import Gt from"node:path";var Ps,dp,QE,pp,$n,JE,ZE,ek,fp,hp,hr,mr,mp,gp,$s=rt(()=>{Ps=Yt(_s(),1),dp=Yt(lp(),1);up();xs();Ts();QE=["**/node_modules","**/flow-typed","**/coverage","**/.git"],pp={absolute:!0,dot:!0},$n="**/.gitignore",JE=(e,t)=>fr(e)?"!"+Gt.posix.join(t,e.slice(1)):Gt.posix.join(t,e),ZE=(e,t)=>{let r=Vt(Gt.relative(t,Gt.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>JE(n,r))},ek=(e,t)=>{if(t=Vt(t),Gt.isAbsolute(e)){if(Vt(e).startsWith(t))return Gt.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},fp=(e,t)=>{let r=e.flatMap(o=>ZE(o,t)),n=(0,dp.default)().add(r);return o=>(o=dr(o),o=ek(o,t),o?n.ignores(Vt(o)):!1)},hp=(e={})=>({cwd:dr(e.cwd)??KE.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...QE]}),hr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=hp(t),s=await(0,Ps.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...pp}),a=await Promise.all(s.map(async c=>({filePath:c,content:await zE.readFile(c,"utf8")})));return fp(a,r)},mr=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=hp(t),a=Ps.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...pp}).map(c=>({filePath:c,content:XE.readFileSync(c,"utf8")}));return fp(a,r)},mp=e=>hr($n,e),gp=e=>mr($n,e)});var Pp={};Ef(Pp,{convertPathToPattern:()=>dk,generateGlobTasks:()=>lk,generateGlobTasksSync:()=>uk,globby:()=>ik,globbyStream:()=>ak,globbySync:()=>sk,isDynamicPattern:()=>ck,isGitIgnored:()=>mp,isGitIgnoredSync:()=>gp,isIgnoredByIgnoreFiles:()=>hr,isIgnoredByIgnoreFilesSync:()=>mr});import vp from"node:process";import tk from"node:fs";import Wt from"node:path";var Ut,rk,_p,Ep,yp,bp,Ds,nk,kp,xp,Dn,wp,ok,Cp,Ap,Sp,Rp,Op,Tp,Ns,ik,sk,ak,ck,lk,uk,dk,$p=rt(()=>{al();Ut=Yt(_s(),1);Zd();xs();$s();Ts();$s();rk=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},_p=(e,t)=>{let r=fr(e)?e.slice(1):e;return Wt.isAbsolute(r)?r:Wt.join(t,r)},Ep=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>Wt.posix.join(e,`**/${Wt.extname(o)?o:`${o}${n}`}`)):[Wt.posix.join(e,`**${n?`/*${n}`:""}`)]},yp=async(e,{cwd:t=vp.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await Qd(_p(i,t))?Ep({directoryPath:i,files:r,extensions:n}):i))).flat(),bp=(e,{cwd:t=vp.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>Jd(_p(o,t))?Ep({directoryPath:o,files:r,extensions:n}):o),Ds=e=>(e=[...new Set([e].flat())],rk(e),e),nk=e=>{if(!e)return;let t;try{t=tk.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},kp=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:dr(e.cwd)},nk(e.cwd),e),xp=e=>async(t,r)=>e(Ds(t),kp(r)),Dn=e=>(t,r)=>e(Ds(t),kp(r)),wp=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?Ds(t):[];return r&&n.push($n),n},ok=async e=>{let t=wp(e);return Ap(t.length>0&&await hr(t,e))},Cp=e=>{let t=wp(e);return Ap(t.length>0&&mr(t,e))},Ap=e=>{let t=new Set;return r=>{let n=Wt.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Sp=(e,t)=>e.flat().filter(r=>t(r)),Rp=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>fr(i));if(n===-1){r.push({patterns:e,options:t});break}let o=e[n].slice(1);for(let i of r)i.options.ignore.push(o);n!==0&&r.push({patterns:e.slice(0,n),options:{...t,ignore:[...t.ignore,o]}}),e=e.slice(n+1)}return r},Op=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Tp=async(e,t)=>{let r=Rp(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Op(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([yp(a,i),yp(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Ns=(e,t)=>{let r=Rp(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Op(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=bp(a,i),c.ignore=bp(c.ignore,{cwd:n}),{patterns:a,options:c}})},ik=xp(async(e,t)=>{let[r,n]=await Promise.all([Tp(e,t),ok(t)]),o=await Promise.all(r.map(i=>(0,Ut.default)(i.patterns,i.options)));return Sp(o,n)}),sk=Dn((e,t)=>{let r=Ns(e,t),n=Cp(t),o=r.map(i=>Ut.default.sync(i.patterns,i.options));return Sp(o,n)}),ak=Dn((e,t)=>{let r=Ns(e,t),n=Cp(t),o=r.map(s=>Ut.default.stream(s.patterns,s.options));return Io(o).filter(s=>n(s))}),ck=Dn((e,t)=>e.some(r=>Ut.default.isDynamicPattern(r,t))),lk=xp(Tp),uk=Dn(Ns),{convertPathToPattern:dk}=Ut.default});var Ks=(e=0)=>t=>`\x1B[${t+e}m`,Xs=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,zs=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,J={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]}},xx=Object.keys(J.modifier),xf=Object.keys(J.color),wf=Object.keys(J.bgColor),wx=[...xf,...wf];function Cf(){let e=new Map;for(let[t,r]of Object.entries(J)){for(let[n,o]of Object.entries(r))J[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=J[n],e.set(o[0],o[1]);Object.defineProperty(J,t,{value:r,enumerable:!1})}return Object.defineProperty(J,"codes",{value:e,enumerable:!1}),J.color.close="\x1B[39m",J.bgColor.close="\x1B[49m",J.color.ansi=Ks(),J.color.ansi256=Xs(),J.color.ansi16m=zs(),J.bgColor.ansi=Ks(10),J.bgColor.ansi256=Xs(10),J.bgColor.ansi16m=zs(10),Object.defineProperties(J,{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=>J.rgbToAnsi256(...J.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)=>J.ansi256ToAnsi(J.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>J.ansi256ToAnsi(J.hexToAnsi256(t)),enumerable:!1}}),J}var Af=Cf(),Te=Af;import Vn from"node:process";import Sf from"node:os";import Qs from"node:tty";function we(e,t=globalThis.Deno?globalThis.Deno.args:Vn.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:Z}=Vn,wr;we("no-color")||we("no-colors")||we("color=false")||we("color=never")?wr=0:(we("color")||we("colors")||we("color=true")||we("color=always"))&&(wr=1);function Rf(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function Of(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Tf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Rf();n!==void 0&&(wr=n);let o=r?wr:n;if(o===0)return 0;if(r){if(we("color=16m")||we("color=full")||we("color=truecolor"))return 3;if(we("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(Z.TERM==="dumb")return i;if(Vn.platform==="win32"){let s=Sf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Z)||Z.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let s=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:i}function Js(e,t={}){let r=Tf(e,{streamIsTTY:e&&e.isTTY,...t});return Of(r)}var Pf={stdout:Js({isTTY:Qs.isatty(1)}),stderr:Js({isTTY:Qs.isatty(2)})},Zs=Pf;function ea(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 ta(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:ra,stderr:na}=Zs,Gn=Symbol("GENERATOR"),kt=Symbol("STYLER"),Kt=Symbol("IS_EMPTY"),oa=["ansi","ansi","ansi256","ansi16m"],xt=Object.create(null),$f=(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=ra?ra.level:0;e.level=t.level===void 0?r:t.level};var Df=e=>{let t=(...r)=>r.join(" ");return $f(t,e),Object.setPrototypeOf(t,Xt.prototype),t};function Xt(e){return Df(e)}Object.setPrototypeOf(Xt.prototype,Function.prototype);for(let[e,t]of Object.entries(Te))xt[e]={get(){let r=Cr(this,Un(t.open,t.close,this[kt]),this[Kt]);return Object.defineProperty(this,e,{value:r}),r}};xt.visible={get(){let e=Cr(this,this[kt],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Wn=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Te[r].ansi16m(...n):t==="ansi256"?Te[r].ansi256(Te.rgbToAnsi256(...n)):Te[r].ansi(Te.rgbToAnsi(...n)):e==="hex"?Wn("rgb",t,r,...Te.hexToRgb(...n)):Te[r][e](...n),Nf=["rgb","hex","ansi256"];for(let e of Nf){xt[e]={get(){let{level:r}=this;return function(...n){let o=Un(Wn(e,oa[r],"color",...n),Te.color.close,this[kt]);return Cr(this,o,this[Kt])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);xt[t]={get(){let{level:r}=this;return function(...n){let o=Un(Wn(e,oa[r],"bgColor",...n),Te.bgColor.close,this[kt]);return Cr(this,o,this[Kt])}}}}var Lf=Object.defineProperties(()=>{},{...xt,level:{enumerable:!0,get(){return this[Gn].level},set(e){this[Gn].level=e}}}),Un=(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}},Cr=(e,t,r)=>{let n=(...o)=>If(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Lf),n[Gn]=e,n[kt]=t,n[Kt]=r,n},If=(e,t)=>{if(e.level<=0||!t)return e[Kt]?"":t;let r=e[kt];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=ea(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
35
|
+
`);return i!==-1&&(t=ta(t,o,n,i)),n+t+o};Object.defineProperties(Xt.prototype,xt);var jf=Xt(),Nx=Xt({level:na?na.level:0});var h=jf;var ya=Yt(ga(),1),{program:Gx,createCommand:Wx,createArgument:Ux,createOption:qx,CommanderError:Yx,InvalidArgumentError:Kx,InvalidOptionArgumentError:Xx,Command:ba,Argument:zx,Option:Qx,Help:Jx}=ya.default;import vr from"fs-extra";import qt from"path";var Pa=Yt(Ca(),1);import vh from"chokidar";import Nr from"fs-extra";import Zt from"path";import qe from"fs-extra";import mt from"path";var po=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 po;var Aa=async(e,t)=>{try{await qe.ensureDir(mt.dirname(e)),await qe.pathExists(e)&&(await qe.stat(e)).isDirectory()&&(console.warn(h.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await qe.remove(e)),await qe.writeFile(e,t)}catch(r){throw f.error(` Error writing file ${e}: ${r.message}`),r}},Tr=async(e,t)=>{f.debug("Generating service configuration files...");let r=mt.join(t,"backend"),n=mt.join(t,"frontend");await qe.ensureDir(r),await qe.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=`
|
|
36
36
|
// Generated Raclette Backend Configuration
|
|
37
37
|
// This file is auto-generated, do not edit directly
|
|
38
38
|
|
|
39
39
|
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
40
40
|
|
|
41
41
|
export default racletteConfig;
|
|
42
|
-
`;await
|
|
42
|
+
`;await Aa(mt.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
|
|
43
43
|
// Generated Raclette Frontend Configuration
|
|
44
44
|
// This file is auto-generated, do not edit directly
|
|
45
45
|
|
|
46
46
|
export const racletteConfig = ${JSON.stringify(a,null,2)};
|
|
47
47
|
|
|
48
48
|
export default racletteConfig;
|
|
49
|
-
`;await
|
|
49
|
+
`;await Aa(mt.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var Pr=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},$r=async(e,t=process.cwd())=>{let r=mt.join(t,".raclette"),n=mt.join(r,"raclette.config.workbench.js");await qe.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
|
|
50
|
+
|
|
51
|
+
export default defineRacletteConfig(${JSON.stringify(e,null,2)})
|
|
52
|
+
`;return await qe.writeFile(n,o,"utf8"),n};function G(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function je(e){return function t(r){return arguments.length===0||G(r)?t:e.apply(this,arguments)}}function Fe(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return G(r)?t:je(function(o){return e(r,o)});default:return G(r)&&G(n)?t:G(r)?je(function(o){return e(o,n)}):G(n)?je(function(o){return e(r,o)}):e(r,n)}}}function Jt(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return G(r)?t:Fe(function(i,s){return e(r,i,s)});case 2:return G(r)&&G(n)?t:G(r)?Fe(function(i,s){return e(i,n,s)}):G(n)?Fe(function(i,s){return e(r,i,s)}):je(function(i){return e(r,n,i)});default:return G(r)&&G(n)&&G(o)?t:G(r)&&G(n)?Fe(function(i,s){return e(i,s,o)}):G(r)&&G(o)?Fe(function(i,s){return e(i,n,s)}):G(n)&&G(o)?Fe(function(i,s){return e(r,i,s)}):G(r)?je(function(i){return e(i,n,o)}):G(n)?je(function(i){return e(r,i,o)}):G(o)?je(function(i){return e(r,n,i)}):e(r,n,o)}}}function Ct(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Dr(e){return Object.prototype.toString.call(e)==="[object Object]"}var gh=Jt(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)Ct(i,r)&&(o[i]=Ct(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)Ct(i,n)&&!Ct(i,o)&&(o[i]=n[i]);return o}),Sa=gh;var yh=Jt(function e(t,r,n){return Sa(function(o,i,s){return Dr(i)&&Dr(s)?e(t,i,s):t(o,i,s)},r,n)}),Ra=yh;var bh=Fe(function(t,r){return Ra(function(n,o,i){return i},t,r)}),gt=bh;var Oa={name:"raclette-app",services:{frontend:{enabled:!0,port:8081,installPackages:[]},backend:{enabled:!0,port:8082,enableDebug:!1,installPackages:[]},mongodb:{enabled:!0,port:27017},cache:{enabled:!0,port:6379},workbench:{enabled:!1,frontendPort:8083,backendPort:8084}},modules:[],plugins:[],env:{development:{},production:{NODE_ENV:"production"}},global:{requireAuthentication:!0},frontend:{framework:"vue",i18n:{locales:["en-EU"],priorities:{app:10,".":30}},vue:{plugins:[]}},backend:{sockets:{autoSend:{compositions:!0,interactionLinks:!0,projectConfig:!0},security:{requireAuth:!0,tokenValidation:"jwt"},options:{adapter:"memory",connectionTimeout:3e3,pingInterval:1500,pingTimeout:1e3}}},sourceDirectories:[],packageMerging:{frontend:[{file:"./packages.json",key:"frontend"}],backend:[{file:"./packages.json",key:"backend"}]},lockFiles:{frontend:"./app.frontend.yarn.lock",backend:"./app.backend.yarn.lock"}},_h=async e=>{let t=e==="production"?".env.production":".env",r=Zt.join(process.cwd(),t);if(process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=process.cwd()),await Nr.pathExists(r)){let n=await Nr.readFile(r,"utf-8"),o=Pa.parse(n);return Object.entries(o).forEach(([i,s])=>{process.env[i]=s}),console.log(h.blue(`\u{1F4C4} Loaded ${Object.keys(o).length} environment variables from ${t}`)),{...o,RACLETTE_APP_PATH:process.env.RACLETTE_APP_PATH}}return{}},Ta=async e=>{try{let{pathToFileURL:t}=await import("url"),n=`${t(e).href}?t=${Date.now()}`;I.cache[e]&&delete I.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}},Lr=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=>Lr(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=Lr(n);return t}return e},Pe=async(e="",t="development")=>{let r=Zt.join(process.cwd(),"raclette.config.js"),n=Zt.join(process.cwd(),".raclette");if(!await Nr.pathExists(r))return console.warn("No raclette.config.js found, using default configuration"),Oa;let o=await _h(t),i=await Ta(r),s=Lr(i),a={env:{}};if(e){let u=await Ta(e);a=Lr(u)}let c=gt(gt(Oa,s),gt(a,{env:{[t]:o}}));return await Eh(c,n),await Tr(c,n),c},Eh=async(e,t)=>{let r=`// Generated Raclette Configuration
|
|
50
53
|
// This file is auto-generated from the merged configuration
|
|
51
54
|
// Do not edit directly
|
|
52
55
|
|
|
53
56
|
export default ${JSON.stringify(e,null,2)};
|
|
54
|
-
`;await
|
|
55
|
-
|
|
56
|
-
`+e.mark.snippet),n+" "+r):n}function tr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=
|
|
57
|
-
`+a;for(
|
|
58
|
-
`,a+=ae.repeat("-",t.indent+
|
|
59
|
-
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)
|
|
60
|
-
`;return a.replace(/\n$/,"")}var
|
|
61
|
-
\r`;function
|
|
62
|
-
`: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
|
|
63
|
-
`,t-1))}function
|
|
64
|
-
`,i?1+c:c):o===
|
|
65
|
-
`);break}for(n?
|
|
66
|
-
`,i?1+c:c)):
|
|
57
|
+
`;await Nr.writeFile(Zt.join(t,"raclette.config.js"),r),f.success("raclette Configuration file generated")},$a=()=>{let e=Zt.join(process.cwd(),"raclette.config.js");f.progress(`\u{1F50D} Watching for changes in original config: ${e}`);let t=vh.watch(e,{ignored:/(^|[/\\])\../,persistent:!0});return t.on("change",async r=>{f.progress(`\u{1F4DD} Original config file changed: ${r}`);try{await Pe()}catch(n){f.error("Error reloading configuration: "+n.message)}}),()=>t.close()};import{spawn as Ms}from"child_process";import Fs,{pathExists as Tk}from"fs-extra";import Je from"path";import Ur from"fs-extra";function Ka(e){return typeof e>"u"||e===null}function kh(e){return typeof e=="object"&&e!==null}function xh(e){return Array.isArray(e)?e:Ka(e)?[]:[e]}function wh(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 Ch(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Ah(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Sh=Ka,Rh=kh,Oh=xh,Th=Ch,Ph=Ah,$h=wh,ae={isNothing:Sh,isObject:Rh,toArray:Oh,repeat:Th,isNegativeZero:Ph,extend:$h};function Xa(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+=`
|
|
58
|
+
|
|
59
|
+
`+e.mark.snippet),n+" "+r):n}function tr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Xa(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}tr.prototype=Object.create(Error.prototype);tr.prototype.constructor=tr;tr.prototype.toString=function(t){return this.name+": "+Xa(this,t)};var ge=tr;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 ho(e,t){return ae.repeat(" ",t-e.length)+e}function Dh(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,d=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]),d),a=ae.repeat(" ",t.indent)+ho((e.line-c+1).toString(),l)+" | "+u.str+`
|
|
60
|
+
`+a;for(u=fo(e.buffer,n[s],o[s],e.position,d),a+=ae.repeat(" ",t.indent)+ho((e.line+1).toString(),l)+" | "+u.str+`
|
|
61
|
+
`,a+=ae.repeat("-",t.indent+l+3+u.pos)+`^
|
|
62
|
+
`,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]),d),a+=ae.repeat(" ",t.indent)+ho((e.line+c+1).toString(),l)+" | "+u.str+`
|
|
63
|
+
`;return a.replace(/\n$/,"")}var Nh=Dh,Lh=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ih=["scalar","sequence","mapping"];function jh(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Fh(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Lh.indexOf(r)===-1)throw new ge('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=jh(t.styleAliases||null),Ih.indexOf(this.kind)===-1)throw new ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ue=Fh;function Da(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 Mh(){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 go(e){return this.extend(e)}go.prototype.extend=function(t){var r=[],n=[];if(t instanceof ue)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 ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof ue))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new ge("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 ge("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 ue))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(go.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=Da(o,"implicit"),o.compiledExplicit=Da(o,"explicit"),o.compiledTypeMap=Mh(o.compiledImplicit,o.compiledExplicit),o};var za=go,Qa=new ue("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ja=new ue("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Za=new ue("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),ec=new za({explicit:[Qa,Ja,Za]});function Bh(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Hh(){return null}function Vh(e){return e===null}var tc=new ue("tag:yaml.org,2002:null",{kind:"scalar",resolve:Bh,construct:Hh,predicate:Vh,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Gh(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 Wh(e){return e==="true"||e==="True"||e==="TRUE"}function Uh(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var rc=new ue("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Gh,construct:Wh,predicate:Uh,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 qh(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Yh(e){return 48<=e&&e<=55}function Kh(e){return 48<=e&&e<=57}function Xh(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(!qh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Yh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Kh(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function zh(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 Qh(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ae.isNegativeZero(e)}var nc=new ue("tag:yaml.org,2002:int",{kind:"scalar",resolve:Xh,construct:zh,predicate:Qh,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"]}}),Jh=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Zh(e){return!(e===null||!Jh.test(e)||e[e.length-1]==="_")}function em(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 tm=/^[-+]?[0-9]+e/;function rm(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(ae.isNegativeZero(e))return"-0.0";return r=e.toString(10),tm.test(r)?r.replace("e",".e"):r}function nm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ae.isNegativeZero(e))}var oc=new ue("tag:yaml.org,2002:float",{kind:"scalar",resolve:Zh,construct:em,predicate:nm,represent:rm,defaultStyle:"lowercase"}),ic=ec.extend({implicit:[tc,rc,nc,oc]}),sc=ic,ac=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cc=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 om(e){return e===null?!1:ac.exec(e)!==null||cc.exec(e)!==null}function im(e){var t,r,n,o,i,s,a,c=0,u=null,l,d,p;if(t=ac.exec(e),t===null&&(t=cc.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],d=+(t[11]||0),u=(l*60+d)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&p.setTime(p.getTime()-u),p}function sm(e){return e.toISOString()}var lc=new ue("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:om,construct:im,instanceOf:Date,represent:sm});function am(e){return e==="<<"||e===null}var uc=new ue("tag:yaml.org,2002:merge",{kind:"scalar",resolve:am}),Eo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
64
|
+
\r`;function cm(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Eo;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 lm(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Eo,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 um(e){var t="",r=0,n,o,i=e.length,s=Eo;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 dm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var dc=new ue("tag:yaml.org,2002:binary",{kind:"scalar",resolve:cm,construct:lm,predicate:dm,represent:um}),pm=Object.prototype.hasOwnProperty,fm=Object.prototype.toString;function hm(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,fm.call(o)!=="[object Object]")return!1;for(i in o)if(pm.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 mm(e){return e!==null?e:[]}var pc=new ue("tag:yaml.org,2002:omap",{kind:"sequence",resolve:hm,construct:mm}),gm=Object.prototype.toString;function ym(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],gm.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function bm(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 fc=new ue("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ym,construct:bm}),vm=Object.prototype.hasOwnProperty;function _m(e){if(e===null)return!0;var t,r=e;for(t in r)if(vm.call(r,t)&&r[t]!==null)return!1;return!0}function Em(e){return e!==null?e:{}}var hc=new ue("tag:yaml.org,2002:set",{kind:"mapping",resolve:_m,construct:Em}),ko=sc.extend({implicit:[lc,uc],explicit:[dc,pc,fc,hc]}),ot=Object.prototype.hasOwnProperty,Ir=1,mc=2,gc=3,jr=4,mo=1,km=2,Na=3,xm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,wm=/[\x85\u2028\u2029]/,Cm=/[,\[\]\{\}]/,yc=/^(?:!|!!|![a-z\-]+!)$/i,bc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function La(e){return Object.prototype.toString.call(e)}function Me(e){return e===10||e===13}function bt(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function St(e){return e===44||e===91||e===93||e===123||e===125}function Am(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Sm(e){return e===120?2:e===117?4:e===85?8:0}function Rm(e){return 48<=e&&e<=57?e-48:-1}function Ia(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
65
|
+
`: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 Om(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var vc=new Array(256),_c=new Array(256);for(yt=0;yt<256;yt++)vc[yt]=Ia(yt)?1:0,_c[yt]=Ia(yt);var yt;function Tm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ko,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 Ec(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=Nh(r),new ge(t,r)}function C(e,t){throw Ec(e,t)}function Fr(e,t){e.onWarning&&e.onWarning.call(null,Ec(e,t))}var ja={YAML:function(t,r,n){var o,i,s;t.version!==null&&C(t,"duplication of %YAML directive"),n.length!==1&&C(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&C(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&C(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Fr(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&C(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],yc.test(o)||C(t,"ill-formed tag handle (first argument) of the TAG directive"),ot.call(t.tagMap,o)&&C(t,'there is a previously declared suffix for "'+o+'" tag handle'),bc.test(i)||C(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{C(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};function nt(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||C(e,"expected valid JSON character");else xm.test(a)&&C(e,"the stream contains non-printable characters");e.result+=a}}function Fa(e,t,r,n){var o,i,s,a;for(ae.isObject(r)||C(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],ot.call(t,i)||(t[i]=r[i],n[i]=!0)}function Rt(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])&&C(e,"nested arrays are not supported inside keys"),typeof o=="object"&&La(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&La(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)Fa(e,t,i[u],r);else Fa(e,t,i,r);else!e.json&&!ot.call(r,o)&&ot.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,C(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:i}):t[o]=i,delete r[o];return t}function xo(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++):C(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ne(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;bt(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(Me(o))for(xo(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&&Fr(e,"deficient indentation"),n}function Hr(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||be(r)))}function wo(e,t){t===1?e.result+=" ":t>1&&(e.result+=ae.repeat(`
|
|
66
|
+
`,t-1))}function Pm(e,t,r){var n,o,i,s,a,c,u,l,d=e.kind,p=e.result,g;if(g=e.input.charCodeAt(e.position),be(g)||St(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(o=e.input.charCodeAt(e.position+1),be(o)||r&&St(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;g!==0;){if(g===58){if(o=e.input.charCodeAt(e.position+1),be(o)||r&&St(o))break}else if(g===35){if(n=e.input.charCodeAt(e.position-1),be(n))break}else{if(e.position===e.lineStart&&Hr(e)||r&&St(g))break;if(Me(g))if(c=e.line,u=e.lineStart,l=e.lineIndent,ne(e,!1,-1),e.lineIndent>=t){a=!0,g=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=l;break}}a&&(nt(e,i,s,!1),wo(e,e.line-c),i=s=e.position,a=!1),bt(g)||(s=e.position+1),g=e.input.charCodeAt(++e.position)}return nt(e,i,s,!1),e.result?!0:(e.kind=d,e.result=p,!1)}function $m(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(nt(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 Me(r)?(nt(e,n,o,!0),wo(e,ne(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Hr(e)?C(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);C(e,"unexpected end of the stream within a single quoted scalar")}function Dm(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 nt(e,r,e.position,!0),e.position++,!0;if(a===92){if(nt(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Me(a))ne(e,!1,t);else if(a<256&&vc[a])e.result+=_c[a],e.position++;else if((s=Sm(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=Am(a))>=0?i=(i<<4)+s:C(e,"expected hexadecimal character");e.result+=Om(i),e.position++}else C(e,"unknown escape sequence");r=n=e.position}else Me(a)?(nt(e,r,n,!0),wo(e,ne(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Hr(e)?C(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}C(e,"unexpected end of the stream within a double quoted scalar")}function Nm(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,l,d,p,g,m=Object.create(null),y,k,R,O;if(O=e.input.charCodeAt(e.position),O===91)l=93,g=!1,a=[];else if(O===123)l=125,g=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(ne(e,!0,t),O=e.input.charCodeAt(e.position),O===l)return e.position++,e.tag=s,e.anchor=c,e.kind=g?"mapping":"sequence",e.result=a,!0;r?O===44&&C(e,"expected the node content, but found ','"):C(e,"missed comma between flow collection entries"),k=y=R=null,d=p=!1,O===63&&(u=e.input.charCodeAt(e.position+1),be(u)&&(d=p=!0,e.position++,ne(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,Ot(e,t,Ir,!1,!0),k=e.tag,y=e.result,ne(e,!0,t),O=e.input.charCodeAt(e.position),(p||e.line===n)&&O===58&&(d=!0,O=e.input.charCodeAt(++e.position),ne(e,!0,t),Ot(e,t,Ir,!1,!0),R=e.result),g?Rt(e,a,m,k,y,R,n,o,i):d?a.push(Rt(e,null,m,k,y,R,n,o,i)):a.push(y),ne(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(r=!0,O=e.input.charCodeAt(++e.position)):r=!1}C(e,"unexpected end of the stream within a flow collection")}function Lm(e,t){var r,n,o=mo,i=!1,s=!1,a=t,c=0,u=!1,l,d;if(d=e.input.charCodeAt(e.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)mo===o?o=d===43?Na:km:C(e,"repeat of a chomping mode identifier");else if((l=Rm(d))>=0)l===0?C(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?C(e,"repeat of an indentation width identifier"):(a=t+l-1,s=!0);else break;if(bt(d)){do d=e.input.charCodeAt(++e.position);while(bt(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Me(d)&&d!==0)}for(;d!==0;){for(xo(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Me(d)){c++;continue}if(e.lineIndent<a){o===Na?e.result+=ae.repeat(`
|
|
67
|
+
`,i?1+c:c):o===mo&&i&&(e.result+=`
|
|
68
|
+
`);break}for(n?bt(d)?(u=!0,e.result+=ae.repeat(`
|
|
69
|
+
`,i?1+c:c)):u?(u=!1,e.result+=ae.repeat(`
|
|
67
70
|
`,c+1)):c===0?i&&(e.result+=" "):e.result+=ae.repeat(`
|
|
68
71
|
`,c):e.result+=ae.repeat(`
|
|
69
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!
|
|
70
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
72
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Me(d)&&d!==0;)d=e.input.charCodeAt(++e.position);nt(e,r,e.position,!1)}return!0}function Ma(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,C(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!be(s))));){if(a=!0,e.position++,ne(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Ot(e,t,gc,!1,!0),i.push(e.result),ne(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)C(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 Im(e,t,r){var n,o,i,s,a,c,u=e.tag,l=e.anchor,d={},p=Object.create(null),g=null,m=null,y=null,k=!1,R=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),O=e.input.charCodeAt(e.position);O!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(O===63||O===58)&&be(n))O===63?(k&&(Rt(e,d,p,g,m,null,s,a,c),g=m=y=null),R=!0,k=!0,o=!0):k?(k=!1,o=!0):C(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=n;else{if(s=e.line,a=e.lineStart,c=e.position,!Ot(e,r,mc,!1,!0))break;if(e.line===i){for(O=e.input.charCodeAt(e.position);bt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),be(O)||C(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Rt(e,d,p,g,m,null,s,a,c),g=m=y=null),R=!0,k=!1,o=!1,g=e.tag,m=e.result;else if(R)C(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=l,!0}else if(R)C(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)&&(k&&(s=e.line,a=e.lineStart,c=e.position),Ot(e,t,jr,!0,o)&&(k?m=e.result:y=e.result),k||(Rt(e,d,p,g,m,y,s,a,c),g=m=y=null),ne(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&O!==0)C(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Rt(e,d,p,g,m,null,s,a,c),R&&(e.tag=u,e.anchor=l,e.kind="mapping",e.result=d),R}function jm(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&&C(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)):C(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!be(s);)s===33&&(n?C(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),yc.test(o)||C(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),Cm.test(i)&&C(e,"tag suffix cannot contain flow indicator characters")}i&&!bc.test(i)&&C(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{C(e,"tag name is malformed: "+i)}return r?e.tag=i:ot.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:C(e,'undeclared tag handle "'+o+'"'),!0}function Fm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&C(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!St(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Mm(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&&!be(n)&&!St(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),ot.call(e.anchorMap,r)||C(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ne(e,!0,-1),!0}function Ot(e,t,r,n,o){var i,s,a,c=1,u=!1,l=!1,d,p,g,m,y,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=jr===r||gc===r,n&&ne(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;jm(e)||Fm(e);)ne(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||jr===r)&&(Ir===r||mc===r?y=t:y=t+1,k=e.position-e.lineStart,c===1?a&&(Ma(e,k)||Im(e,k,y))||Nm(e,y)?l=!0:(s&&Lm(e,y)||$m(e,y)||Dm(e,y)?l=!0:Mm(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&C(e,"alias node should not have any properties")):Pm(e,y,Ir===r)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=a&&Ma(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&C(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,p=e.implicitTypes.length;d<p;d+=1)if(m=e.implicitTypes[d],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(ot.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,g=e.typeMap.multi[e.kind||"fallback"],d=0,p=g.length;d<p;d+=1)if(e.tag.slice(0,g[d].tag.length)===g[d].tag){m=g[d];break}m||C(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&C(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)):C(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 Bm(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&&(ne(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&&!be(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&C(e,"directive name must not be less than one character in length");s!==0;){for(;bt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Me(s));break}if(Me(s))break;for(r=e.position;s!==0&&!be(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&xo(e),ot.call(ja,n)?ja[n](e,n,o):Fr(e,'unknown document directive "'+n+'"')}if(ne(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,ne(e,!0,-1)):i&&C(e,"directives end mark is expected"),Ot(e,e.lineIndent-1,jr,!1,!0),ne(e,!0,-1),e.checkLineBreaks&&wm.test(e.input.slice(t,e.position))&&Fr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Hr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ne(e,!0,-1));return}if(e.position<e.length-1)C(e,"end of the stream or a document separator is expected");else return}function kc(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
73
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Tm(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,C(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;)Bm(r);return r.documents}function Hm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=kc(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Vm(e,t){var r=kc(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ge("expected a single document in the stream, but found more")}}var Gm=Hm,Wm=Vm,xc={loadAll:Gm,load:Wm},wc=Object.prototype.toString,Cc=Object.prototype.hasOwnProperty,Co=65279,Um=9,rr=10,qm=13,Ym=32,Km=33,Xm=34,yo=35,zm=37,Qm=38,Jm=39,Zm=42,Ac=44,eg=45,Mr=58,tg=61,rg=62,ng=63,og=64,Sc=91,Rc=93,ig=96,Oc=123,sg=124,Tc=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var ag=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],cg=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function lg(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&&Cc.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function ug(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 ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ae.repeat("0",n-t.length)+t}var dg=1,nr=2;function pg(e){this.schema=e.schema||ko,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ae.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=lg(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==='"'?nr:dg,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 Ba(e,t){for(var r=ae.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
71
74
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
72
|
-
`&&(i+=r),i+=s;return i}function
|
|
73
|
-
`+ae.repeat(" ",e.indent*t)}function
|
|
75
|
+
`&&(i+=r),i+=s;return i}function bo(e,t){return`
|
|
76
|
+
`+ae.repeat(" ",e.indent*t)}function fg(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 Br(e){return e===Ym||e===Um}function or(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Co||65536<=e&&e<=1114111}function Ha(e){return or(e)&&e!==Co&&e!==qm&&e!==rr}function Va(e,t,r){var n=Ha(e),o=n&&!Br(e);return(r?n:n&&e!==Ac&&e!==Sc&&e!==Rc&&e!==Oc&&e!==Tc)&&e!==yo&&!(t===Mr&&!o)||Ha(t)&&!Br(t)&&e===yo||t===Mr&&o}function hg(e){return or(e)&&e!==Co&&!Br(e)&&e!==eg&&e!==ng&&e!==Mr&&e!==Ac&&e!==Sc&&e!==Rc&&e!==Oc&&e!==Tc&&e!==yo&&e!==Qm&&e!==Zm&&e!==Km&&e!==sg&&e!==tg&&e!==rg&&e!==Jm&&e!==Xm&&e!==zm&&e!==og&&e!==ig}function mg(e){return!Br(e)&&e!==Mr}function er(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 Pc(e){var t=/^\n* /;return t.test(e)}var $c=1,vo=2,Dc=3,Nc=4,At=5;function gg(e,t,r,n,o,i,s,a){var c,u=0,l=null,d=!1,p=!1,g=n!==-1,m=-1,y=hg(er(e,0))&&mg(er(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=er(e,c),!or(u))return At;y=y&&Va(u,l,a),l=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=er(e,c),u===rr)d=!0,g&&(p=p||c-m-1>n&&e[m+1]!==" ",m=c);else if(!or(u))return At;y=y&&Va(u,l,a),l=u}p=p||g&&c-m-1>n&&e[m+1]!==" "}return!d&&!p?y&&!s&&!o(e)?$c:i===nr?At:vo:r>9&&Pc(e)?At:s?i===nr?At:vo:p?Nc:Dc}function yg(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===nr?'""':"''";if(!e.noCompatMode&&(ag.indexOf(t)!==-1||cg.test(t)))return e.quotingType===nr?'"'+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 fg(e,u)}switch(gg(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case $c:return t;case vo:return"'"+t.replace(/'/g,"''")+"'";case Dc:return"|"+Ga(t,e.indent)+Wa(Ba(t,i));case Nc:return">"+Ga(t,e.indent)+Wa(Ba(bg(t,s),i));case At:return'"'+vg(t)+'"';default:throw new ge("impossible error: invalid scalar style")}})()}function Ga(e,t){var r=Pc(e)?String(t):"",n=e[e.length-1]===`
|
|
74
77
|
`,o=n&&(e[e.length-2]===`
|
|
75
78
|
`||e===`
|
|
76
79
|
`),i=o?"+":n?"":"-";return r+i+`
|
|
77
|
-
`}function
|
|
78
|
-
`?e.slice(0,-1):e}function
|
|
79
|
-
`);return
|
|
80
|
+
`}function Wa(e){return e[e.length-1]===`
|
|
81
|
+
`?e.slice(0,-1):e}function bg(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
|
|
82
|
+
`);return u=u!==-1?u:e.length,r.lastIndex=u,Ua(e.slice(0,u),t)})(),o=e[0]===`
|
|
80
83
|
`||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
|
|
81
|
-
`:"")+
|
|
84
|
+
`:"")+Ua(c,t),o=i}return n}function Ua(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+=`
|
|
82
85
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
83
86
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
84
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function
|
|
85
|
-
`:""}var
|
|
86
|
-
`)[0]:e=Ke("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return Ke(`"${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(
|
|
87
|
-
\u274C Modern Docker Compose is not available`)),console.warn(
|
|
88
|
-
\u{1F4CB} Raclette requires Docker with integrated 'compose' command`)),console.warn(
|
|
89
|
-
macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(
|
|
90
|
-
Windows: Start Docker Desktop from the Start menu`)):console.log(
|
|
91
|
-
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:(
|
|
92
|
-
\u{1F4E5} Installation guide:`)),console.log(
|
|
93
|
-
Error: ${o.message}`)}},ye=(e,t={})=>{let n=`"${
|
|
94
|
-
Error: ${o.message}`)}},ir=e=>{try{return ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},
|
|
95
|
-
`).filter(r=>r.trim().length>0):[]}catch{return[]}},
|
|
87
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function vg(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=er(e,o),n=de[r],!n&&or(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||ug(r);return t}function _g(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)),(Ye(e,t,a,!1,!1)||typeof a>"u"&&Ye(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function qa(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)),(Ye(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ye(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=bo(e,t)),e.dump&&rr===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function Eg(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)),Ye(e,t,c,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ye(e,t,u,!1,!1)&&(l+=e.dump,n+=l));e.tag=o,e.dump="{"+n+"}"}function kg(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,l,d,p;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ge("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)p="",(!n||o!=="")&&(p+=bo(e,t)),u=s[a],l=r[u],e.replacer&&(l=e.replacer.call(r,u,l)),Ye(e,t+1,u,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&rr===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,d&&(p+=bo(e,t)),Ye(e,t+1,l,!0,d)&&(e.dump&&rr===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,o+=p));e.tag=i,e.dump=o||"{}"}function Ya(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,wc.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(Cc.call(a.represent,c))n=a.represent[c](t,c);else throw new ge("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function Ye(e,t,r,n,o,i,s){e.tag=null,e.dump=r,Ya(e,r,!1)||Ya(e,r,!0);var a=wc.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var l=a==="[object Object]"||a==="[object Array]",d,p;if(l&&(d=e.duplicates.indexOf(r),p=d!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(o=!1),p&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(l&&p&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(kg(e,t,e.dump,o),p&&(e.dump="&ref_"+d+e.dump)):(Eg(e,t,e.dump),p&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?qa(e,t-1,e.dump,o):qa(e,t,e.dump,o),p&&(e.dump="&ref_"+d+e.dump)):(_g(e,t,e.dump),p&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&yg(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ge("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 xg(e,t){var r=[],n=[],o,i;for(_o(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function _o(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)_o(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)_o(e[n[o]],t,r)}function wg(e,t){t=t||{};var r=new pg(t);r.noRefs||xg(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ye(r,0,n,!0,!0)?r.dump+`
|
|
88
|
+
`:""}var Cg=wg,Ag={dump:Cg};function Ao(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 Sg=ue,Rg=za,Og=ec,Tg=ic,Pg=sc,$g=ko,Dg=xc.load,Ng=xc.loadAll,Lg=Ag.dump,Ig=ge,jg={binary:dc,float:oc,map:Za,null:tc,pairs:fc,set:hc,timestamp:lc,bool:rc,int:nc,merge:uc,omap:pc,seq:Ja,str:Qa},Fg=Ao("safeLoad","load"),Mg=Ao("safeLoadAll","loadAll"),Bg=Ao("safeDump","dump"),Hg={Type:Sg,Schema:Rg,FAILSAFE_SCHEMA:Og,JSON_SCHEMA:Tg,CORE_SCHEMA:Pg,DEFAULT_SCHEMA:$g,load:Dg,loadAll:Ng,dump:Lg,YAMLException:Ig,types:jg,safeLoad:Fg,safeLoadAll:Mg,safeDump:Bg},it=Hg;import Pt from"path";import{execSync as Ke}from"child_process";import Vg from"fs-extra";var Vr=null,So=()=>{if(Vr)return Vr;let e=Gg(),t=Wg(e),r=e,n=!0,o=Ug(t);return Vr={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},Vr};var Gg=()=>{try{let e;process.platform==="win32"?e=Ke("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
|
|
89
|
+
`)[0]:e=Ke("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return Ke(`"${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(Vg.existsSync(r))try{return Ke(`"${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")}},Wg=e=>{try{return Ke(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(h.yellow("Could not determine Docker version")),"unknown"}},Ug=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},Gr=()=>{f.raw(h.blue("\u{1F433} Checking Docker installation..."));try{let e=So();f.debug(`\u2705 Docker found at: ${e.dockerPath}`),f.debug(`Docker version: ${e.version}`);try{Ke(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),f.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(h.red(`
|
|
90
|
+
\u274C Modern Docker Compose is not available`)),console.warn(h.yellow(`
|
|
91
|
+
\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{Ke(`"${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(`
|
|
92
|
+
macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(h.yellow(`
|
|
93
|
+
Windows: Start Docker Desktop from the Start menu`)):console.log(h.yellow(`
|
|
94
|
+
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(`
|
|
95
|
+
\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"))}},ce=(e,t={})=>{let n=`"${So().dockerPath}" ${e.join(" ")}`;try{let o=Ke(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}
|
|
96
|
+
Error: ${o.message}`)}},ye=(e,t={})=>{let n=`"${So().composeCommand}" compose ${e.join(" ")}`;f.debug(`Execute Docker Command: ${n}`);try{let o=Ke(n,{stdio:"pipe",encoding:"utf8",shell:!0,...t});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker Compose command failed: ${n}
|
|
97
|
+
Error: ${o.message}`)}},ir=e=>{try{return ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Tt=e=>{try{return ce(["ps","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Wr=e=>{f.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{if(ce(["network","ls","--format",'"{{.Name}}"',"|","grep",e]).trim()===e){f.debug(`\u2705 Network '${e}' already exists`);return}}catch{f.debug(`\u{1F310} Creating Docker network '${e}'...`);try{ce(["network","create",e],{stdio:"inherit"}),f.debug(`\u2705 Network '${e}' created`)}catch(r){throw f.error("Failed to create network: "+r.message),r}}},Ro=(e,t,r={})=>ce(["exec",e,"sh","-c",`"${t}"`],r),qg=e=>{try{let t=ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}"`]);return t.trim()?t.trim().split(`
|
|
98
|
+
`).filter(r=>r.trim().length>0):[]}catch{return[]}},Lc=e=>{let t=qg(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..."),ce(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),ce(["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 Yg="raclette-public-shared",Kg=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),Oo=(e,t)=>Pt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Pt.resolve(t,e):Pt.resolve(t,e),qr=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>qr(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=Oo(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=Kg(o):o&&typeof o=="object"?r[n]=qr(o,t):r[n]=o;return r},st=(e,t)=>{let r=qr(e,t);if(r.source&&r.source.includes("/")&&(r.source=Oo(r.source,t)),r.mustExist&&!Ur.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},Xg=(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=Oo(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},Yr=(e,t)=>e.map(r=>typeof r=="string"?Xg(r,t):r).map(r=>r),To=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[Yg]=null,e.volumes&&Object.entries(e.volumes).forEach(([d,p])=>{p===null?a.volumes[d]=null:a.volumes[d]=qr(p,t)});let u=!1,l=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let d=e.services.mongodb.name;ir(d)&&(f.debug(`MongoDB container '${d}' already exists, will be skipped`),u=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let d=e.services.cache.name;ir(d)&&(f.debug(`Cache container '${d}' already exists, will be skipped`),l=!0)}}if(e.services.mongodb?.enabled&&!u){let p=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,g=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,m=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${p}}`,image:"mongo:5.0.6",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${g}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${m}}:/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(y=>{let k=st(y,t);a.services.mongodb.volumes.push(k)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null),!m.startsWith("/")&&!m.startsWith("./")&&(a.volumes[m]=null)}if(e.services.cache?.enabled&&!l){let p=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,g=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${p}}`,image:"valkey/valkey:8.1-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${g}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let m=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",y=e?.backend?.cache?.persistence||"none";y==="none"&&(a.services.cache.command='valkey-server --save ""'),y==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),y==="rdb"&&(a.services.cache.command="valkey-server --save "+m),y==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+m),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(k=>{let R=st(k,t);a.services.cache.volumes.push(R)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(!n){let d=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let p=e.services.backend.name??`${e.name}-backend`,g=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${p}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:d?"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(([m,y])=>`${m}=${y}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${g}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${$t("backend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...d?[`${d||"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(m=>{let y=st(m,t);y&&a.services.backend.volumes.push(y)}),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[g]=null}if(e.services.frontend?.enabled){let p=e.services.frontend.name??`${e.name}-frontend`,g=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,m=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${p}}`,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(([y,k])=>`${y}=${k}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${g}:/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",`${$t("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(y=>{let k=st(y,t);k&&a.services.frontend.volumes.push(k)}),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[g]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let p=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,g=p&&!p.endsWith("/")?p+"/":p;a.services.backend?.volumes?.push(`${g}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${g}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(d=>{d.volumes&&(d.volumes=Yr(d.volumes,t))}),await Ur.writeFile(r,it.dump(a)),await Kr(e,Pt.dirname(r),o)},$t=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Ic=async(e,t,r,n="development")=>{await To(e,t,r,!1,n,!1,!1)},Kr=async(e,t,r)=>{let n=Pt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
|
|
96
99
|
WORKDIR /app
|
|
97
100
|
|
|
98
101
|
# add bash since alpine doesn't come with a shell
|
|
@@ -128,7 +131,7 @@ EXPOSE 9229
|
|
|
128
131
|
|
|
129
132
|
# default command
|
|
130
133
|
CMD ["yarn", "run", "${r==="production"?"build":"dev"}"]
|
|
131
|
-
`;await Ur.writeFile(n,o);let i=
|
|
134
|
+
`;await Ur.writeFile(n,o);let i=Pt.join(t,"frontend.Dockerfile"),s=`FROM node:24-alpine3.21 AS build
|
|
132
135
|
WORKDIR /app
|
|
133
136
|
|
|
134
137
|
RUN apk update && apk add bash curl ${(e.services.frontend?.installPackages||[]).join(" ")}
|
|
@@ -183,7 +186,7 @@ RUN chmod +x /docker-entrypoint.d/entrypoint.sh
|
|
|
183
186
|
ENV PORT 80
|
|
184
187
|
EXPOSE 80
|
|
185
188
|
|
|
186
|
-
CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import
|
|
189
|
+
CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path";var Xr=async(e,t,r)=>{let n=[];return r&&(console.log(h.blue("\u{1F504} Force rebuild enabled - rebuilding all services")),e.services.frontend?.enabled&&n.push("frontend"),e.services.backend?.enabled&&n.push("backend"),e.services.workbench?.enabled&&n.push("workbench")),n},zr=async(e,t,r,n={})=>{if(r.length===0)return;console.log(h.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=jc.join(t,"docker-compose.yml"),i=e.name??jc.basename(process.cwd());for(let s of r)try{console.log(h.blue(`\u{1F504} Rebuilding ${s} service...`));let a=["-p",i,"-f",o,"build"];n.noCache&&a.push("--no-cache"),a.push(s),ye(a,{stdio:"inherit"}),f.success(` Service ${s} rebuilt successfully`)}catch(a){f.error(`Error rebuilding service ${s}: ${a.message}`)}};import Jc from"fs-extra";import Zc from"path";var Fc=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?zg():[]],zg=()=>[],Mc=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],Bc=(e=!1)=>{let t=` // JavaScript config
|
|
187
190
|
{
|
|
188
191
|
files: ["**/*.{js,mjs,cjs}"],
|
|
189
192
|
languageOptions: {
|
|
@@ -228,7 +231,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
228
231
|
}
|
|
229
232
|
}`;return e?t+`,
|
|
230
233
|
|
|
231
|
-
`+
|
|
234
|
+
`+Qg():t},Qg=()=>` // Style recommended config
|
|
232
235
|
{
|
|
233
236
|
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
|
|
234
237
|
rules: {
|
|
@@ -251,7 +254,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
251
254
|
{ min: 3, exceptions: ["i", "j", "a", "b", "fs", "id"], properties: "never" },
|
|
252
255
|
],
|
|
253
256
|
}
|
|
254
|
-
}`;var
|
|
257
|
+
}`;var Hc=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?Jg():[]],Jg=()=>[],Vc=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],Gc=(e=!1)=>{let t=` // React config
|
|
255
258
|
{
|
|
256
259
|
files: ["**/*.{jsx,tsx}"],
|
|
257
260
|
plugins: {
|
|
@@ -275,7 +278,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
275
278
|
}
|
|
276
279
|
}`;return e?t+`,
|
|
277
280
|
|
|
278
|
-
`+
|
|
281
|
+
`+Zg():t},Zg=()=>"";var Wc=(e=!1)=>["typescript-eslint",...e?ey():[]],ey=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],Uc=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},qc=(e=!1)=>{let r=` // TypeScript config
|
|
279
282
|
{
|
|
280
283
|
files: ["**/*.{ts,tsx}"],
|
|
281
284
|
plugins: ${e?`{
|
|
@@ -304,7 +307,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
304
307
|
}
|
|
305
308
|
}`;return e?r+`,
|
|
306
309
|
|
|
307
|
-
`+
|
|
310
|
+
`+ty():r},ty=()=>` // TypeScript recommended config
|
|
308
311
|
{
|
|
309
312
|
files: ["**/*.{ts,tsx}"],
|
|
310
313
|
rules: {
|
|
@@ -387,7 +390,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
387
390
|
}
|
|
388
391
|
]
|
|
389
392
|
}
|
|
390
|
-
}`;var
|
|
393
|
+
}`;var Yc=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser","tailwindcss",...e?ry():[]],ry=()=>[],Kc=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';","import tailwindcss from 'eslint-plugin-tailwindcss';"],Xc=(e=!1)=>{let t=` // Vue config
|
|
391
394
|
{
|
|
392
395
|
files: ["**/*.vue"],
|
|
393
396
|
// Manually add Vue plugin
|
|
@@ -429,7 +432,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
429
432
|
}
|
|
430
433
|
}`;return e?t+`,
|
|
431
434
|
|
|
432
|
-
`+
|
|
435
|
+
`+ny():t},ny=()=>` // Vue recommended config
|
|
433
436
|
{
|
|
434
437
|
files: ["**/*.vue"],
|
|
435
438
|
rules: {
|
|
@@ -472,7 +475,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
472
475
|
"vue/v-on-style": "error",
|
|
473
476
|
"vue/v-slot-style": "error"
|
|
474
477
|
}
|
|
475
|
-
}`;import{existsSync as
|
|
478
|
+
}`;import{existsSync as Po}from"fs";import $o from"path";var zc=e=>{let t=e?.eslint?.useRecommended;return e.frontend?.framework==="vue"?Yc(t):e.frontend?.framework==="react"?Hc(t):[]},Qc=e=>{let t=[...e].sort(),r=Po($o.join(process.cwd(),"yarn.lock")),n=Po($o.join(process.cwd(),"pnpm-lock.yaml")),o=Po($o.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 Qr=async(e,t,r=!0)=>{let n=Zc.join(t,"eslint.config.mjs");f.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=oy(e,o),s=[];if(s.push(` // TS ESLint base rules
|
|
476
479
|
{
|
|
477
480
|
files: ["**/*.{ts,tsx}"],
|
|
478
481
|
plugins: {
|
|
@@ -503,7 +506,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path
|
|
|
503
506
|
".raclette/**",
|
|
504
507
|
".gitignore"
|
|
505
508
|
]
|
|
506
|
-
}`),s.push(
|
|
509
|
+
}`),s.push(Bc(o)),s.push(qc(o)),e.frontend?.framework==="vue"&&s.push(Xc(o)),e.frontend?.framework==="react"&&s.push(Gc(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
|
|
507
510
|
{
|
|
508
511
|
rules: ${c}
|
|
509
512
|
}`)}if(e.eslint?.ignores&&e.eslint.ignores.length>0){let c=JSON.stringify(e.eslint.ignores).replace(/^\[|\]$/g,"");s.push(` // User custom ignores
|
|
@@ -541,7 +544,7 @@ export const withRaclette = (...userConfigs) => {
|
|
|
541
544
|
|
|
542
545
|
// Default export for direct usage
|
|
543
546
|
export default racletteEslintConfig
|
|
544
|
-
`;await
|
|
547
|
+
`;await Jc.writeFile(n,a),r&&await iy(t,e),f.debug(`Generated eslint.config.mjs in ${t}`)},oy=(e,t)=>{let r=[];return r.push(...Mc()),r.push(...Uc(t)),e.frontend?.framework==="vue"?r.push(...Kc()):e.frontend?.framework==="react"&&r.push(...Vc()),r},iy=async(e,t)=>{let r=Zc.join(e,"ESLINT-README.md"),n=t.eslint?.useRecommended!==!1,o=Fc(n),i=Wc(n),s=zc(t),a=[...o,...i,...s],u=`# Raclette ESLint Configuration
|
|
545
548
|
|
|
546
549
|
This directory contains an auto-generated ESLint configuration for your Raclette project.
|
|
547
550
|
|
|
@@ -550,7 +553,7 @@ This directory contains an auto-generated ESLint configuration for your Raclette
|
|
|
550
553
|
To use this ESLint configuration, you need to install the following dependencies:
|
|
551
554
|
|
|
552
555
|
\`\`\`bash
|
|
553
|
-
${
|
|
556
|
+
${Qc(a)}
|
|
554
557
|
\`\`\`
|
|
555
558
|
|
|
556
559
|
## How to Use
|
|
@@ -627,35 +630,32 @@ export default {
|
|
|
627
630
|
}
|
|
628
631
|
}
|
|
629
632
|
\`\`\`
|
|
630
|
-
`;await zc.writeFile(r,l)};import{execSync as bk}from"child_process";import Z from"fs-extra";import te from"path";import lk from"chokidar";import $ from"fs-extra";import A from"path";var Pd=[".prettierrc","eslint.config.js"],uk=["bin/check-dependencies.sh"],Oe=async()=>{let e=A.join(process.cwd(),".raclette");return await $.ensureDir(e),e},Dn=async(e,t,r)=>{let n=process.cwd(),o=A.join(n,".raclette"),i=A.join(o,"virtual"),s=Nn();h.debug(`\u{1F4E6} Using core package at: ${s}`),await gk(o,s,uk),h.debug("[VFS] Cleaning virtual file system directory..."),await $.pathExists(i)&&await $.rm(i,{recursive:!0}),await $.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,l={backend:["/"],frontend:["/"]},u=[...a].sort((y,k)=>k.priority-y.priority).map(y=>{let k=y.path.startsWith(".")?A.join(process.cwd(),y.path):y.path;return{...y,path:k}});await hk(u,c,i,l,Pd,o);let p=[],d=y=>{let k=A.relative(n,y);return c.get(k)||y},g=()=>{p.forEach(k=>k.close()),p.length=0,pk(u,l,i).forEach(k=>{if($.existsSync(k.sourcePath)){let R=dk(k,u,c,Pd);p.push(R)}})},m=()=>p.forEach(y=>y.close());return r||g(),{resolveFile:d,watchFiles:g,close:m}},pk=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",l=A.join(o.path,c,i,a);n.push({sourcePath:l,sourceDir:o,targetResolver:u=>A.join(r,i,a,u),mappingKeyResolver:u=>A.join(i,a,u)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=A.join(o.path,i);$.existsSync(a)&&$.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(u=>{n.push({sourcePath:A.dirname(a),sourceDir:o,targetResolver:p=>A.basename(a)===p?A.join(r,u):A.join(r,u,p),mappingKeyResolver:p=>A.basename(a)===p?i:A.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:l=>A.join(r,i,l),mappingKeyResolver:l=>A.join(i,l)})})}),n},dk=(e,t,r,n)=>{h.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=lk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(mk(a,n))return;let l=e.mappingKeyResolver(a),u=e.targetResolver(a);await fk(t,r,l,u,a,c)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},fk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=$d(s,r,o);a?(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),h.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await $.pathExists(n)&&await $.remove(n),t.delete(r),h.debug(`[VFS] Removed ${r}`))}else{let a=$d(s,r,o);a&&(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),h.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},$d=(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(A.join(i,a,r)===t){let l=n.servicePathMap?.[i]||"",u=A.join(n.path,l,i,a,r);if($.existsSync(u))return{sourceDir:n,fullPath:u}}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 l,u;if(i===t){if(u=A.join(n.path,i),$.existsSync(u))return{sourceDir:n,fullPath:u}}else if(l=A.join(i,r),l===t&&(u=A.join(n.path,i,r),$.existsSync(u)))return{sourceDir:n,fullPath:u}}}}return null},Dd=async(e,t,r,n,o,i)=>{if(!await $.pathExists(t))return;await $.ensureDir(A.dirname(r));let s=e.name==="generated-service-files";await $.copy(t,r,{overwrite:!0,filter:l=>{let u=A.basename(l);if(i.includes(u))return!1;if(s&&(u==="package.json"||u==="yarn.lock"))return!0;if(!s&&(u==="package.json"||u==="yarn.lock"))return!1;let p=A.relative(t,l);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")}});let c=await yk(t,s?["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss","**/package.json","**/yarn.lock"]:["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss"]);for(let l of c){let u=A.basename(l);if(i.includes(u))continue;if(!(s&&(u==="package.json"||u==="yarn.lock"))){if(!s&&(u==="package.json"||u==="yarn.lock"))continue}let p=A.relative(t,l),d=A.join(o,p),g=A.join(r,p);n.set(d,g)}h.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},hk=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await $.pathExists(s.path)){console.warn(f.yellow(`[VFS] Source directory not found: ${s.path}`));continue}for(let[a,c]of Object.entries(n))for(let l of c){let u=s.servicePathMap?.[a]||"";if(!u)continue;let p=A.join(s.path,u,a,l),d=A.join(r,a,l),g=A.join(a,l);await Dd(s,p,d,t,g,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let l=A.join(s.path,a),u=(Array.isArray(c)?c:[c]).map(d=>A.join(r,d)),p=await $.pathExists(l)&&(await $.stat(l)).isFile();if(!p&&s.clear)for(let d of u)await $.rm(d,{recursive:!0,force:!0}),await $.ensureDir(d);if(p)for(let d of u)await $.ensureDir(A.dirname(d)),await $.copy(l,d),t.set(a,d),h.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of u)await Dd(s,l,d,t,d,o)}}h.debug("[VFS] Built virtual file system")},mk=(e,t)=>t.includes(A.basename(e));var gk=async(e,t,r)=>{let n=A.join(e,"dist");await $.ensureDir(n);for(let o of r){let i=A.join(t,o),s=A.basename(o),a=A.join(n,s);await $.pathExists(a)&&await $.remove(a),await $.pathExists(i)&&(await $.ensureDir(A.dirname(a)),await $.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await $.chmod(a,493),h.debug(`[VFS] Copied ${s} to dist directory`))}},yk=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(Td(),Od));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Nn=()=>{let e=process.cwd();h.debug("process.cwd(): "+process.cwd());let r=e.includes("node_modules")?[A.join(e.match(/(.*node_modules)/)?.[1]||"","@raclettejs/core"),A.join(e,"node_modules","@raclettejs/core"),A.join(e,"..","..","..","@raclettejs/core")]:[A.join(e,"node_modules","@raclettejs/core"),A.resolve(e,"..","..","raclette"),A.resolve(e,"..","..","@raclettejs/core"),A.resolve(e,"..","..","core"),A.resolve(e,"..","raclette"),A.resolve(e,"..","@raclettejs/core"),A.resolve(e,"..","core")];for(let n of r)if($.existsSync(n)){let o=A.join(n,"package.json");if($.existsSync(o))try{if(JSON.parse($.readFileSync(o,"utf8")).name==="@raclettejs/core")return n}catch{}}throw h.error("Could not determine core package path to set up VFS. Canceling..."),new Error("Could not determine core package path to set up VFS. Canceling...")},Ns=async(e,t)=>await $.pathExists(e)?(await $.ensureDir(A.dirname(t)),await $.copy(e,t),h.debug(`\u2705 Copied ${A.basename(e)} to ${t}`),!0):(h.warn(f.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var Nd=e=>e==="frontend"||e==="backend",Ld=e=>e==="workbench.frontend"||e==="workbench.backend",vk=async(e,t)=>{h.progress(`Loading merged packages for ${e}...`);let r=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],n={},o={};for(let i of r)try{let s=await _k(i);if(s.dependencies){n={...n,...s.dependencies};let a=Object.keys(s.dependencies).length;a>0&&h.success(`Merged ${a} dependencies from ${i.file}:${i.key}`)}if(s.devDependencies){o={...o,...s.devDependencies};let a=Object.keys(s.devDependencies).length;a>0&&h.success(`Merged ${a} devDependencies from ${i.file}:${i.key}`)}}catch(s){throw h.error(`Error loading package source ${i.file}:${i.key} - ${s.message}`),h.error(`Aborting package setup for ${e}`),s}return h.raw(f.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(n).length} deps, ${Object.keys(o).length} devDeps`)),{dependencies:n,devDependencies:o}},_k=async e=>{if(h.progress(`Loading ${e.file}:${e.key}...`),!await Z.pathExists(e.file))return h.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await Z.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 h.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(h.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}`)}},gr=(e,t)=>{let r=t.lockFiles?.[e];if(r)return h.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=te.join(process.cwd(),`${e}.yarn.lock`);return h.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},Is=async(e,t)=>{let r=await Oe();if(!t)try{t=await import(te.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){h.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Nd(e)&&await Ls(`app/${e}/package.json`,te.join(r,e),e,t),Ld(e)&&h.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},Ek=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=te.join(process.cwd(),"package.json");if(!await Z.pathExists(t))return console.warn(f.yellow("Warning: No package.json found in app directory")),{};try{let r=await Z.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],console.log(f.blue(`\u{1F4E6} Found plugin ${s}@${n[s]}`))):console.warn(f.yellow(`\u26A0\uFE0F Plugin ${s} is enabled in config but not found in package.json`));return i}catch(r){return console.warn(f.yellow(`Error reading app package.json: ${r.message}`)),{}}},Ls=async(e,t,r,n)=>{let o=Nn();h.progress(`Setting up package.json for ${r}`),h.debug(`Source: ${e}`),h.debug(`Target dir: ${t}`),await Z.ensureDir(t);let i=te.join(o,e),s=te.dirname(i),a=te.join(t,"package.json");if(await Z.pathExists(i))try{h.debug("Reading source package.json...");let c=await Z.readJson(i),l={dependencies:{},devDependencies:{}};(r==="frontend"||r==="backend")&&(l=await vk(r,n));let u=await Ek(n),p={...c.dependencies,...l.dependencies,...u},d={...c.devDependencies,...l.devDependencies},g=mt(c,{dependencies:p,devDependencies:d});h.debug("Writing merged package.json..."),await Z.writeJson(a,g,{spaces:2}),h.success(`Created package.json for ${r}`),await Ck(s,t,r,n)}catch(c){throw h.error(`Error setting up package.json for ${r}: ${c.message}`),c}else h.warn(`Warning: Could not find package.json at ${i}`)},Ln=async e=>{let t=te.join(process.cwd(),".raclette");if(h.progress("Setting up node packages for services..."),e.services.backend?.enabled){let r=te.join(t,"backend");await Ls("services/backend/package.json",r,"backend",e);let n=gr("backend",e),o=te.join(r,"yarn.lock");await Ns(n,o)}if(e.services.frontend?.enabled){let r=te.join(t,"frontend");await Ls("services/frontend/package.json",r,"frontend",e);let n=gr("frontend",e),o=te.join(r,"yarn.lock");await Ns(n,o)}},kk=async()=>{let e=te.join(process.cwd(),"packages.json");if(await Z.pathExists(e))try{return await Z.readJson(e)}catch(t){h.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},xk=async e=>{let t=te.join(process.cwd(),"packages.json");await Z.writeJson(t,e,{spaces:2})},wk=e=>{try{let t=bk(`yarn info ${e} version --json`,{stdio:"pipe",encoding:"utf8"});if(!t)throw new Error("No package found!");return JSON.parse(t).data}catch(t){return h.error(`Package verification failed for ${e}: ${t.message}`),null}},Id=async(e,t,r=!1)=>{h.raw(f.blue(`\u{1F4E6} Validating package ${t} for ${e}...`));let n=await wk(t);if(!n)throw new Error(`Package ${t} not found or is not accessible`);h.success(`Found package ${t}@${n}`);let o=await kk(),i=r?"devDependencies":"dependencies";if(Nd(e))o[e]||(o[e]={}),o[e][i]||(o[e][i]={}),o[e][i][t]=n,console.log(f.green(`\u2705 Added ${t}@${n} to ${e} ${i}`));else if(Ld(e)){let s=e==="workbench.frontend"?"frontend":"backend";o.workbench||(o.workbench={}),o.workbench[s]||(o.workbench[s]={}),o.workbench[s][i]||(o.workbench[s][i]={}),o.workbench[s][i][t]=n,console.log(f.green(`\u2705 Added ${t}@${n} to ${e} ${i}`)),console.log(f.yellow("\u2139\uFE0F Note: Workbench packages are stored in packages.json but package.json files are not updated"))}await xk(o),console.log(f.green("\u2705 Updated packages.json in project root"))},In=async e=>{let t=Nn();if(h.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=gr("frontend",e);if(await Z.pathExists(r))h.debug(`\u{1F512} ${te.basename(r)} already exists`);else{h.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"app","frontend","yarn.lock");await Z.pathExists(n)?(h.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await Z.copy(n,r)):(h.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await Z.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
633
|
+
`;await Jc.writeFile(r,u)};import{execSync as Ip}from"child_process";import U from"fs-extra";import te from"path";import pk from"chokidar";import $ from"fs-extra";import A from"path";var Dp=[".prettierrc","eslint.config.js"],fk=["bin/check-dependencies.sh"],Oe=async()=>{let e=A.join(process.cwd(),".raclette");return await $.ensureDir(e),e},Nn=async(e,t,r)=>{let n=process.cwd(),o=A.join(n,".raclette"),i=A.join(o,"virtual"),s=Ln();f.debug(`\u{1F4E6} Using core package at: ${s}`),await vk(o,s,fk),f.debug("[VFS] Cleaning virtual file system directory..."),await $.pathExists(i)&&await $.rm(i,{recursive:!0}),await $.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((y,k)=>k.priority-y.priority).map(y=>{let k=y.path.startsWith(".")?A.join(process.cwd(),y.path):y.path;return{...y,path:k}});await yk(l,c,i,u,Dp,o);let d=[],p=y=>{let k=A.relative(n,y);return c.get(k)||y},g=()=>{d.forEach(k=>k.close()),d.length=0,hk(l,u,i).forEach(k=>{if($.existsSync(k.sourcePath)){let R=mk(k,l,c,Dp);d.push(R)}})},m=()=>d.forEach(y=>y.close());return r||g(),{resolveFile:p,watchFiles:g,close:m}},hk=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",u=A.join(o.path,c,i,a);n.push({sourcePath:u,sourceDir:o,targetResolver:l=>A.join(r,i,a,l),mappingKeyResolver:l=>A.join(i,a,l)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=A.join(o.path,i);$.existsSync(a)&&$.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(l=>{n.push({sourcePath:A.dirname(a),sourceDir:o,targetResolver:d=>A.basename(a)===d?A.join(r,l):A.join(r,l,d),mappingKeyResolver:d=>A.basename(a)===d?i:A.join(i,d)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:u=>A.join(r,i,u),mappingKeyResolver:u=>A.join(i,u)})})}),n},mk=(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=pk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(bk(a,n))return;let u=e.mappingKeyResolver(a),l=e.targetResolver(a);await gk(t,r,u,l,a,c)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},gk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=Np(s,r,o);a?(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await $.pathExists(n)&&await $.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`))}else{let a=Np(s,r,o);a&&(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},Np=(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(A.join(i,a,r)===t){let u=n.servicePathMap?.[i]||"",l=A.join(n.path,u,i,a,r);if($.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=A.join(n.path,i),$.existsSync(l))return{sourceDir:n,fullPath:l}}else if(u=A.join(i,r),u===t&&(l=A.join(n.path,i,r),$.existsSync(l)))return{sourceDir:n,fullPath:l}}}}return null},Lp=async(e,t,r,n,o,i)=>{if(!await $.pathExists(t))return;await $.ensureDir(A.dirname(r));let s=e.name==="generated-service-files";await $.copy(t,r,{overwrite:!0,filter:u=>{let l=A.basename(u);if(i.includes(l))return!1;if(s&&(l==="package.json"||l==="yarn.lock"))return!0;if(!s&&(l==="package.json"||l==="yarn.lock"))return!1;let d=A.relative(t,u);return!d.startsWith("node_modules")&&!d.startsWith(".git")&&!d.startsWith("dist")}});let c=await _k(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=A.basename(u);if(i.includes(l))continue;if(!(s&&(l==="package.json"||l==="yarn.lock"))){if(!s&&(l==="package.json"||l==="yarn.lock"))continue}let d=A.relative(t,u),p=A.join(o,d),g=A.join(r,d);n.set(p,g)}f.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},yk=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await $.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 d=A.join(s.path,l,a,u),p=A.join(r,a,u),g=A.join(a,u);await Lp(s,d,p,t,g,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let u=A.join(s.path,a),l=(Array.isArray(c)?c:[c]).map(p=>A.join(r,p)),d=await $.pathExists(u)&&(await $.stat(u)).isFile();if(!d&&s.clear)for(let p of l)await $.rm(p,{recursive:!0,force:!0}),await $.ensureDir(p);if(d)for(let p of l)await $.ensureDir(A.dirname(p)),await $.copy(u,p),t.set(a,p),f.debug(`[VFS] Mapped individual file ${a} -> ${p}`);else for(let p of l)await Lp(s,u,p,t,p,o)}}f.debug("[VFS] Built virtual file system")},bk=(e,t)=>t.includes(A.basename(e));var vk=async(e,t,r)=>{let n=A.join(e,"dist");await $.ensureDir(n);for(let o of r){let i=A.join(t,o),s=A.basename(o),a=A.join(n,s);await $.pathExists(a)&&await $.remove(a),await $.pathExists(i)&&(await $.ensureDir(A.dirname(a)),await $.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await $.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}},_k=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>($p(),Pp));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Ln=()=>{let e=process.cwd();f.debug("process.cwd(): "+process.cwd());let r=e.includes("node_modules")?[A.join(e.match(/(.*node_modules)/)?.[1]||"","@raclettejs/core"),A.join(e,"node_modules","@raclettejs/core"),A.join(e,"..","..","..","@raclettejs/core")]:[A.join(e,"node_modules","@raclettejs/core"),A.resolve(e,"..","..","raclette"),A.resolve(e,"..","..","@raclettejs/core"),A.resolve(e,"..","..","core"),A.resolve(e,"..","raclette"),A.resolve(e,"..","@raclettejs/core"),A.resolve(e,"..","core")];for(let n of r)if($.existsSync(n)){let o=A.join(n,"package.json");if($.existsSync(o))try{if(JSON.parse($.readFileSync(o,"utf8")).name==="@raclettejs/core")return n}catch{}}throw f.error("Could not determine core package path to set up VFS. Canceling..."),new Error("Could not determine core package path to set up VFS. Canceling...")},Ls=async(e,t)=>await $.pathExists(e)?(await $.ensureDir(A.dirname(t)),await $.copy(e,t),f.debug(`\u2705 Copied ${A.basename(e)} to ${t}`),!0):(f.warn(h.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var jp=e=>e==="frontend"||e==="backend",Fp=e=>e==="workbench.frontend"||e==="workbench.backend",Ek=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 kk(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}},kk=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await U.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 U.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}`)}},gr=(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=te.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},js=async(e,t)=>{let r=await Oe();if(!t)try{t=await import(te.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}jp(e)&&await Is(`services/${e}/package.json`,te.join(r,e),e,t,!1),Fp(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},xk=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=te.join(process.cwd(),"package.json");if(!await U.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await U.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}`),{}}},Is=async(e,t,r,n,o=!1)=>{let i=Ln();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await U.ensureDir(t);let s=te.join(i,e),a=te.dirname(s),c=te.join(t,"package.json");if(await U.pathExists(s))try{o&&f.debug("Reading source package.json...");let u=await U.readJson(s),l={dependencies:{},devDependencies:{}};(r==="frontend"||r==="backend")&&(l=await Ek(r,n,o));let d=await xk(n),p={...u.dependencies,...l.dependencies,...d},g={...u.devDependencies,...l.devDependencies},m=gt(u,{dependencies:p,devDependencies:g});o&&f.debug("Writing merged package.json..."),await U.writeJson(c,m,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await Rk(a,t,r,n)}catch(u){throw f.error(`Error setting up package.json for ${r}: ${u.message}`),u}else f.warn(`Warning: Could not find package.json at ${s}`)},In=async e=>{let t=te.join(process.cwd(),".raclette");if(f.progress("Setting up node packages for services..."),e.services.backend?.enabled){let r=te.join(t,"backend");await Is("services/backend/package.json",r,"backend",e,!0);let n=gr("backend",e),o=te.join(r,"yarn.lock");await Ls(n,o)}if(e.services.frontend?.enabled){let r=te.join(t,"frontend");await Is("services/frontend/package.json",r,"frontend",e,!0);let n=gr("frontend",e),o=te.join(r,"yarn.lock");await Ls(n,o)}},wk=async()=>{let e=te.join(process.cwd(),"packages.json");if(await U.pathExists(e))try{return await U.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:{}}}}},Ck=async e=>{let t=te.join(process.cwd(),"packages.json");await U.writeJson(t,e,{spaces:2})};var Ak=async(e,t,r=!1)=>{let n=te.join(process.cwd(),"package.json");if(!await U.pathExists(n))throw new Error("No package.json found in project root");try{Ip("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{Ip(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await U.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}`)}},Sk=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}},Mp=async(e,t,r=!1)=>{let{name:n,version:o}=Sk(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await Ak(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await wk(),a=r?"devDependencies":"dependencies";if(jp(e))s[e]||(s[e]={}),s[e][a]||(s[e][a]={}),s[e][a][n]=i,f.success(`Added ${n}@${i} to ${e} ${a}`);else if(Fp(e)){let c=e==="workbench.frontend"?"frontend":"backend";s.workbench||(s.workbench={}),s.workbench[c]||(s.workbench[c]={}),s.workbench[c][a]||(s.workbench[c][a]={}),s.workbench[c][a][n]=i,f.success(`Added ${n}@${i} to ${e} ${a}`),f.instruction("Note: Workbench packages are stored in packages.json but package.json files are not updated")}await Ck(s),f.success("Updated packages.json in project root")},jn=async e=>{let t=Ln();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=gr("frontend",e);if(await U.pathExists(r))f.debug(`\u{1F512} ${te.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"services","frontend","yarn.lock");await U.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await U.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await U.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
631
634
|
# yarn lockfile v1
|
|
632
635
|
|
|
633
|
-
`)),
|
|
636
|
+
`)),f.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}if(e.services.backend?.enabled){let r=gr("backend",e);if(await U.pathExists(r))f.debug(`\u{1F512} ${te.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"services","backend","yarn.lock");await U.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await U.copy(n,r)):(f.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await U.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
634
637
|
# yarn lockfile v1
|
|
635
638
|
|
|
636
|
-
`)),
|
|
639
|
+
`)),f.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}f.success("Lock files ready for volume mounting")},Rk=async(e,t,r,n)=>{let o=te.join(t,"yarn.lock");f.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=gr(r,n)),i&&await U.pathExists(i))f.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await U.copy(i,o);else{let s=te.join(e,"yarn.lock");await U.pathExists(s)?(f.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await U.copy(s,o)):(f.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await U.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
637
640
|
# yarn lockfile v1
|
|
638
641
|
|
|
639
|
-
`))}};import
|
|
642
|
+
`))}};import Bp from"fs-extra";import Hp from"path";var Fn=async(e,t)=>{let r=Hp.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"&&(Ok(t),n.include.push("shims.vue.d.ts")),await Bp.writeFile(r,JSON.stringify(n,null,2)),f.debug(`Generated tsconfig.json in ${t}`)},Ok=async e=>{await Bp.writeFile(Hp.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
|
|
640
643
|
import { DefineComponent } from "vue"
|
|
641
644
|
const component: DefineComponent<{}, {}, any>
|
|
642
645
|
export default component
|
|
643
|
-
}`)};var
|
|
644
|
-
\u2705 Development environment is ready!`)),a.frontend.enabled&&console.log(
|
|
645
|
-
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(
|
|
646
|
-
`+"=".repeat(80)),console.log(
|
|
647
|
-
`);for(let[o,i]of
|
|
648
|
-
`+"=".repeat(80)),console.log(
|
|
649
|
-
Log process ended with code ${
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
\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(f.red(`\u274C Error following logs: ${s.message}`)),s}}async function Fk(e,t){console.log(f.blue("\u{1F527} Handling workbench logs..."));let r=Fn(e);h.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=Yd("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(f.yellow(`
|
|
657
|
-
Workbench log process ended with code ${i??0}`))}),o.on("error",i=>{console.error(f.red(`\u274C Error with workbench log process: ${i.message}`)),console.log(f.yellow("\u{1F4A1} Make sure the workbench package has the 'log' script in its package.json"))}),process.on("SIGINT",()=>{console.log(f.yellow(`
|
|
658
|
-
\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(f.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as zk}from"child_process";import V from"fs-extra";import H from"path";import{execSync as Mk}from"child_process";import B from"fs-extra";import U from"path";var Bs=async(e,t,r)=>{console.log(f.blue("\u{1F4E6} Creating production artifacts...")),await Vk(t,e,r);let n=U.join(t,"docker-compose.yml");return await Gk(e,t,n,r),await Uk(e,t,r),await Wk(t,r,e),console.log(f.green("\u2705 Production artifacts created")),n},Xd=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=U.join(t,a),l=U.basename(a),u=U.join(r,l);if(await B.ensureDir(U.dirname(u)),await B.pathExists(c))await B.copy(c,u),o&&await B.chmod(u,493),console.log(f.gray(`${s} \u2705 Copied ${a}`));else{let p=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${p}`);console.log(f.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},Bk=async(e,t,r)=>Xd(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),Hk=async(e,t,r,n)=>Xd(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),Vk=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
|
|
646
|
+
}`)};var yr=new Map,Vp=async(e,t)=>{f.raclette("Starting development environment...");let r=Je.dirname(t.dockerComposePath),n=e.name??Je.basename(process.cwd()),o=$a(),i={kill:()=>(o(),!0)};yr.set("originalConfigWatcher",i),await jn(e),await In(e),await Nn(e),Wr("raclette_shared"),await To(e,t.workingDir,t.dockerComposePath,!1,"development",!0),await Fn(e,r),await Qr(e,r);let s=await Xr(e,r,t.forceRebuild??!1);s.length>0&&await zr(e,r,s,{noCache:t.noCache});let a=Pk(e),c=$k(a);c.length>0&&f.info(`Found existing services: ${c.join(", ")}`);let u=Dk(e,n,t.dockerComposePath);["SIGINT","SIGTERM"].forEach(l=>{process.removeAllListeners(l),process.on(l,()=>u(l))}),t.quiet?(await Gp(e,n,t.dockerComposePath,a,c),console.log(h.green(`
|
|
647
|
+
\u2705 Development environment is ready!`)),a.frontend.enabled&&console.log(h.blue(`\u{1F30D} Frontend running at: http://localhost:${a.frontend.port}`)),a.backend.enabled&&console.log(h.blue(`\u{1F680} Server running at: http://localhost:${a.backend.port}`)),console.log(h.yellow(`
|
|
648
|
+
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await Nk(e,n,t.dockerComposePath,a,c,t.logFilter,t.verbose)},Pk=e=>{let t=e.name??Je.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}}},$k=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&ir(n.containerName)&&t.push(r)}),t},Dk=(e,t,r)=>n=>{console.log(`
|
|
649
|
+
`+"=".repeat(80)),console.log(h.bold.yellow(` CLEANUP: Shutting down services after ${n}...`)),console.log("=".repeat(80)+`
|
|
650
|
+
`);for(let[o,i]of yr.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(h.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{Wp(e),ye(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
|
|
651
|
+
`+"=".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)},Gp=async(e,t,r,n,o,i)=>{if(console.log(h.blue("\u{1F433} Starting Docker services...")),!await Fs.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{ye(["-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 Lk(e,i)}catch(a){f.error(`Error starting Workbench: ${a.message}`)}},Nk=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await Gp(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=Je.resolve(r),u=["-p",t,"-f",c,"logs","--follow",...a];try{f.debug("Running Docker Compose logs...");let l=Ms("docker",["compose",...u],{stdio:"inherit",shell:!0,cwd:Je.dirname(c)});return yr.set("dockerLogs",l),new Promise(d=>{l.on("close",p=>{l.killed||console.log(h.yellow(`
|
|
652
|
+
Log process ended with code ${p??0}`)),d()}),l.on("error",p=>{f.error(` Error with log process: ${p.message}`),d()})})}catch(l){throw f.error(`Error setting up log following: ${l.message}`),l}},Mn=async e=>{if(!e.services?.workbench?.enabled)return;let t=Je.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await Fs.pathExists(t))throw f.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=Je.join(t,"package.json");if(!await Fs.pathExists(r))throw f.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},Lk=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await Mn(e);if(!r)return;let n=Je.join(process.cwd(),"workbenchPlugins");await Tk(n)||(n=void 0);let o;if(e.workbench)try{Pr(e.workbench),o=await $r(e.workbench)}catch(a){throw console.error(h.red("Workbench configuration error:"),a.message),a}let i=Object.fromEntries(Object.entries(e.env.development||{}).filter(([a])=>a.startsWith("RACLETTE_")).flatMap(([a,c])=>{let u=[[a,c]];if(a.startsWith("RACLETTE_WORKBENCH_")){let l=a.replace("RACLETTE_WORKBENCH_","RACLETTE_");u.push([l,c])}return u}));e.services?.workbench?.debugPort&&(i.ENABLE_DEBUG=!0,i.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let s={...process.env,NODE_ENV:"development",MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:`raclette-cache://localhost:${e.services.cache?.port||6379}${e.services.cache?.db?`/${e.services.cache.db}`:""}`,RACLETTE_CLIENT_PORT:String(e.services.workbench?.frontendPort||8083),RACLETTE_SERVER_PORT:String(e.services.workbench?.backendPort||8084),...i};return new Promise((a,c)=>{let u=`${e.name}-workbench`;f.progress("Starting workbench as "+u);let l=["dev",t?"-v":"","-p",u,...o?["-f",o]:[]].filter(m=>m!==""),d=e.services?.workbench?.withLogs||t,p=Ms("yarn",l,{cwd:r,env:s,stdio:d?"pipe":"ignore"});yr.set("workbench",p),d&&(p.stdout?.on("data",m=>{m.toString().trim().split(`
|
|
653
|
+
`).forEach(k=>{console.log(h.magenta(`[Workbench] ${k}`))})}),p.stderr?.on("data",m=>{m.toString().trim().split(`
|
|
654
|
+
`).forEach(k=>{console.error(h.red(`[Workbench] ${k}`))})}),p.stdout?.on("data",m=>{m.toString().includes("VITE v")&&(clearTimeout(g),a())}));let g=setTimeout(()=>{a()},d?1e3*60*5:5e3);p.on("close",m=>{clearTimeout(g),m!==0&&m!==null?(console.error(h.red(`Workbench process exited with code ${m}`)),c(new Error(`Workbench process exited with code ${m}`))):a()}),p.on("error",m=>{clearTimeout(g),console.error(h.red("Workbench process error:"),m),c(m)}),d||setTimeout(a,1e3)})},Wp=async e=>{if(e.services?.workbench?.enabled)try{let t=await Mn(e);if(!t)return;Ms("yarn",["down","-p",`${e.name}-workbench`],{cwd:t,stdio:"pipe"})}catch{f.debug("Workbench down command failed, forcing process termination");let r=yr.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{Lc(n)}catch(o){f.warn(`Could not stop workbench containers: ${o.message}`)}}}},Bs=(e,t)=>{let r=t?.name??Je.basename(process.cwd());f.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),f.raclette("Stopping all Docker services...");try{Wp(t),ye(["-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 qp from"fs-extra";import Yp from"path";var Ik=e=>Tt(e),br=async(e,t,r)=>{let o=`${t?.name??Yp.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await qp.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},Up=async(e,t,r)=>{let n=await br(e,t,r);if(!Ik(n))return!1;try{console.log(h.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),Ro(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=Ro(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}},Hs=async(e,t,r)=>{console.log(h.blue("\u{1F9C0} Updating package dependencies..."));let n=Yp.join(r,"docker-compose.yml");if(!await qp.pathExists(n))return console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running with Raclette.")),!1;let o=!1,i=!0;if(e==="frontend"||e==="both"){let s=await Up("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await Up("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 zp}from"child_process";import Kp from"path";var Qp=async(e,t,r,n)=>{if(e.includes("workbench")){await Mk(r,t);return}let o=[];if(e.length===0)o=Xp(r),console.log(h.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=Xp(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 jk(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 Fk(r,n,o,t)};function Xp(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 jk(e,t,r){let n=[];for(let o of e)try{let i=await br(o,t,r);Tt(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 Fk(e,t,r,n){let o=e?.name??Kp.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=zp("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:Kp.dirname(t)});s.on("close",a=>{s.killed||console.log(h.yellow(`
|
|
655
|
+
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(`
|
|
656
|
+
\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 Mk(e,t){console.log(h.blue("\u{1F527} Handling workbench logs..."));let r=Mn(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=zp("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(h.yellow(`
|
|
657
|
+
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(`
|
|
658
|
+
\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 Qk}from"child_process";import V from"fs-extra";import H from"path";import{execSync as Bk}from"child_process";import B from"fs-extra";import W from"path";var Vs=async(e,t,r)=>{console.log(h.blue("\u{1F4E6} Creating production artifacts...")),await Gk(t,e,r);let n=W.join(t,"docker-compose.yml");return await Wk(e,t,n,r),await Uk(e,t,r),await qk(t,r,e),console.log(h.green("\u2705 Production artifacts created")),n},Jp=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 B.ensureDir(W.dirname(l)),await B.pathExists(c))await B.copy(c,l),o&&await B.chmod(l,493),console.log(h.gray(`${s} \u2705 Copied ${a}`));else{let d=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${d}`);console.log(h.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},Hk=async(e,t,r)=>Jp(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),Vk=async(e,t,r,n)=>Jp(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),Gk=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
|
|
659
659
|
FROM nginx:alpine
|
|
660
660
|
COPY service/frontend /usr/share/nginx/html
|
|
661
661
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
@@ -764,7 +764,7 @@ server {
|
|
|
764
764
|
proxy_set_header Host $host;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
`;if(await B.writeFile(
|
|
767
|
+
`;if(await B.writeFile(W.join(e,"Dockerfile.frontend"),i),await B.writeFile(W.join(e,"Dockerfile.backend"),s),await B.writeFile(W.join(e,"nginx.conf"),a),await Hk(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let u=`
|
|
768
768
|
FROM nginx:alpine
|
|
769
769
|
COPY workbench/frontend /usr/share/nginx/html
|
|
770
770
|
COPY nginx.workbench.conf /etc/nginx/conf.d/default.conf
|
|
@@ -781,7 +781,7 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
|
781
781
|
|
|
782
782
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
783
783
|
CMD ["nginx", "-g", "daemon off;"]
|
|
784
|
-
`,
|
|
784
|
+
`,l=`
|
|
785
785
|
FROM node:24.4-alpine
|
|
786
786
|
WORKDIR /app
|
|
787
787
|
|
|
@@ -812,7 +812,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
|
|
|
812
812
|
|
|
813
813
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
814
814
|
CMD ["yarn", "start"]
|
|
815
|
-
`,
|
|
815
|
+
`,d=`
|
|
816
816
|
server {
|
|
817
817
|
listen ${o};
|
|
818
818
|
root /usr/share/nginx/html;
|
|
@@ -842,7 +842,7 @@ server {
|
|
|
842
842
|
proxy_set_header Authorization $http_authorization;
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
`;await B.writeFile(
|
|
845
|
+
`;await B.writeFile(W.join(e,"Dockerfile.workbench-frontend"),u),await B.writeFile(W.join(e,"Dockerfile.workbench-backend"),l),await B.writeFile(W.join(e,"nginx.workbench.conf"),d)}},Wk=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}`)]},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}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-valkey://cache:6379${e.services.cache?.db?`/${e.services.cache?.db}`:""}}`,...Object.entries(s).map(([u,l])=>`${u}=${l}`)]},database:{image:"mongo:5.0.6",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:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},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:-http://localhost:${i}/api}`,"RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(u).map(([l,d])=>`${l}=${d}`)]},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}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-valkey://cache:6379${e.services.cache?.db?`/${e.services.cache?.db}`:""}}`,...Object.entries(u).map(([l,d])=>`${l}=${d}`)]}}await B.writeFile(r,it.dump(a))},Uk=async(e,t,r)=>{let n=Gs(e,r);await B.writeFile(W.join(t,".env.example"),n)},Gs=(e,t)=>{let r=e.services.frontend?.port||8081,n=e.services.workbench?.frontendPort||8083;return`# Production Environment Variables
|
|
846
846
|
# Copy this file to .env and fill in your values
|
|
847
847
|
|
|
848
848
|
# Required - Generate a secure random string for this
|
|
@@ -880,7 +880,7 @@ ${Object.keys(e.env.production||{}).map(i=>`# ${i}=`).join(`
|
|
|
880
880
|
|
|
881
881
|
# Cache specific overrides (uncomment if using external Valkey/Redis)
|
|
882
882
|
# RACLETTE_CACHE_URL=valkey://your-external-cache:6379
|
|
883
|
-
`},
|
|
883
|
+
`},qk=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
|
|
884
884
|
# Raclette Production Deployment Script
|
|
885
885
|
|
|
886
886
|
set -e
|
|
@@ -933,7 +933,7 @@ echo " - Built with TypeScript and compiled to dist/src/server.js"
|
|
|
933
933
|
echo " - Runs on Node.js 24 Alpine with production dependencies only"
|
|
934
934
|
echo " - Should listen on 0.0.0.0:3000 for proper container networking"
|
|
935
935
|
echo " - Accessible via /api proxy on port ${n}"
|
|
936
|
-
`,s=
|
|
936
|
+
`,s=W.join(e,"deploy.sh");await B.writeFile(s,i),await B.chmod(s,493)},Zp=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:5.0.6",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",`${$t("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=st(i,t);n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=Yr(i.volumes,t))}),await B.writeFile(r,it.dump(n))},ef=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",`${$t("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=st(a,t);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",`${$t("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=st(a,t);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=Yr(s.volumes,t))}),await B.writeFile(r,it.dump(o))},Yk=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
|
|
937
937
|
# Raclette Production Deployment Script with Image Loading
|
|
938
938
|
|
|
939
939
|
set -e
|
|
@@ -988,7 +988,7 @@ echo " View logs: docker compose logs -f"
|
|
|
988
988
|
echo " Stop: docker compose down"
|
|
989
989
|
echo " Restart: docker compose restart"
|
|
990
990
|
echo " Update images: ./load-images.sh && docker compose up -d"
|
|
991
|
-
`;await B.writeFile(
|
|
991
|
+
`;await B.writeFile(W.join(e,"deploy.sh"),s),await B.chmod(W.join(e,"deploy.sh"),493)},Kk=async(e,t)=>{let r=`#!/bin/bash
|
|
992
992
|
# Load Docker Images Script
|
|
993
993
|
|
|
994
994
|
set -e
|
|
@@ -1020,7 +1020,7 @@ echo "\u2705 All images loaded successfully!"
|
|
|
1020
1020
|
echo ""
|
|
1021
1021
|
echo "\u{1F433} Available images:"
|
|
1022
1022
|
docker images | grep -E "${t.map(n=>n.split(":")[0]).join("|")}" || echo "No images found (this might be expected if tags changed)"
|
|
1023
|
-
`;await B.writeFile(
|
|
1023
|
+
`;await B.writeFile(W.join(e,"load-images.sh"),r),await B.chmod(W.join(e,"load-images.sh"),493)},Xk=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
|
|
1024
1024
|
|
|
1025
1025
|
This package contains everything needed to deploy your Raclette application.
|
|
1026
1026
|
|
|
@@ -1107,7 +1107,7 @@ ${n?`- Workbench: http://localhost:${i}`:""}
|
|
|
1107
1107
|
- Ports ${o}${n?`, ${i}`:""} available
|
|
1108
1108
|
|
|
1109
1109
|
Generated on: ${new Date().toISOString()}
|
|
1110
|
-
`;await B.writeFile(
|
|
1110
|
+
`;await B.writeFile(W.join(e,"README.md"),s)},tf=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 B.ensureDir(i),await B.emptyDir(i);let c=W.join(i,s);await B.ensureDir(c);try{console.log(h.gray(" \u{1F4BE} Exporting Docker images..."));let u=W.join(c,"images");await B.ensureDir(u);for(let d of r){let p=`${d.replace(/[:/]/g,"_")}.tar`,g=W.join(u,p);console.log(h.gray(` \u{1F4E6} Exporting ${d}...`)),ce(["save","-o",g,d],{stdio:"pipe"});let m=await B.stat(g);if(m.size===0)throw new Error(`Failed to export image ${d}`);console.log(h.gray(` \u2705 Exported ${d} (${(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 Vk(l,t,c,{required:!1,logPrefix:" "}),await Yk(c,r,o,e),await Kk(c,r),await Xk(c,e,r,o),console.log(h.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await zk(c,a),await B.remove(c),console.log(h.green(` \u2705 Deployment package created: ${s}.tar.gz`)),{packagePath:a,imageNames:r}}catch(u){throw await B.remove(c).catch(()=>{}),u}},zk=async(e,t)=>{let r=W.dirname(e),n=W.basename(e);Bk(`tar -czf "${t}" -C "${r}" "${n}"`,{stdio:"pipe"});let o=await B.stat(t);console.log(h.gray(` \u{1F4E6} Package size: ${(o.size/1024/1024).toFixed(1)}MB`))};var rf=async(e,t,r={})=>{let n=Date.now(),o=Jk(r);console.log(h.blue(`\u{1F9C0} Starting Raclette ${o} build...`)),Gr();let i=H.join(process.cwd(),".raclette"),s=H.resolve(r.outputDir||H.join(i,".build"));await V.ensureDir(s),await V.emptyDir(s);try{await sx(e,t,i),await ax(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await Zk(e,i,s,r);break;case"images":a=await nf(e,i,s,r);break;case"package":a=await ex(e,i,s,r);break}let c=(Date.now()-n)/1e3;return f.success(` ${o} build completed in ${c}s`),ix(a,e),a}catch(a){throw f.error(`${o} build failed: ${a.message}`),a}},Jk=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),Zk=async(e,t,r,n)=>{if(n.buildOnly){console.log(h.blue("\u{1F4C1} Building application files only...")),await Ws(e,t,r,n);let i=await Us(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=H.join(r,"service");await Ws(e,t,i,n);let s=await Us(e,r,n),a=await Vs(e,r,s),c=await ox(e,r,s);return console.log(h.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:H.join(r,"deploy.sh"),readmeFile:c,envExampleFile:H.join(r,".env.example")}}}},nf=async(e,t,r,n)=>{console.log(h.blue("\u{1F433} Building Docker images for CI/CD..."));let o=H.join(r,"service");await Ws(e,t,o,n);let i=await Us(e,r,n);await Vs(e,r,i);let s=await tx(e,r,i,n);return console.log(h.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},ex=async(e,t,r,n)=>{console.log(h.blue("\u{1F4E6} Building offline deployment package..."));let o=await nf(e,t,r,n),i=of(),s=await tf(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}},tx=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||of(),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 rx(),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 d of l){let p=`${o}/${d}`,g=H.join(t,`Dockerfile.${d}`);if(!await V.pathExists(g))throw new Error(`Dockerfile not found: ${g}`);let m=u.map(y=>`${p}:${y}`);c.push(...m),await nx({context:t,dockerfile:g,tags:m,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(h.gray(` \u2705 Built ${d} for ${s}`)),m.forEach(y=>{console.log(h.gray(` ${y}`))})}}else{console.log(h.gray(" \u{1F528} Building single-architecture images..."));let d=["-f",H.join(t,"docker-compose.yml"),"build"];n.noCache&&d.push("--no-cache"),ye(d,{stdio:n.verbose?"inherit":"pipe",cwd:t});let p=["frontend","backend"];r&&p.push("workbench-frontend","workbench-backend");for(let g of p){let m=`${H.basename(t)}-${g}`.replace(/\./,""),y=`${o}/${g}`;u.forEach(k=>{let R=`${y}:${k}`;ce(["tag",m,R],{stdio:"pipe"}),c.push(R)}),console.log(h.gray(` \u2705 Tagged ${g}`))}}return console.log(h.green(" \u2705 Docker images built and tagged")),{names:c,tags:u}},rx=async()=>{try{ce(["buildx","version"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),ce(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Creating buildx builder...")),ce(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),ce(["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")}},nx=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{ce(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},ox=async(e,t,r)=>{let n=H.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
|
|
1111
1111
|
|
|
1112
1112
|
This build contains everything needed to deploy ${e.name} locally using Docker.
|
|
1113
1113
|
|
|
@@ -1172,7 +1172,7 @@ Edit \`docker-compose.yml\` to:
|
|
|
1172
1172
|
|
|
1173
1173
|
Built on: ${new Date().toISOString()}
|
|
1174
1174
|
Build type: Local deployment artifacts
|
|
1175
|
-
`;return await V.writeFile(n,s),console.log(
|
|
1175
|
+
`;return await V.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},ix=(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. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 2. 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}},of=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),sx=async(e,t,r)=>{console.log(h.blue("\u{1F4C1} Setting up build environment...")),await jn(e),await In(e),await Nn(e),await Fn(e,r),await Qr(e,r),await Tr(e,r),console.log(h.green("\u2705 Build environment ready"))},ax=async(e,t,r)=>{console.log(h.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=H.join(r,"docker-compose.generate.yml");await Kr(e,r,"build"),await Zp(e,t,o),Wr("raclette_shared");try{console.log(h.gray(" \u{1F433} Starting generation services...")),ye(["-p",n,"-f",o,"up","-d"],{stdio:"pipe"}),console.log(h.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=60;for(;i<s;)try{if(!(await ye(["-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");console.log(h.green(" \u2705 File generation completed"))}finally{try{ye(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup generation services"))}}},Ws=async(e,t,r,n)=>{console.log(h.blue("\u{1F3A8} Building main application...")),await V.ensureDir(r),await Kr(e,t,"build"),await cx(e,t,r,n)},cx=async(e,t,r,n)=>{console.log(h.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=H.join(t,"docker-compose.app-build.yml"),s=H.join(t,".temp-build");await V.ensureDir(s),await V.ensureDir(H.join(s,"frontend")),await V.ensureDir(H.join(s,"backend"));try{await ef(e,process.cwd(),i,s);let a=["-p",o,"-f",i,"up"];if(n.noCache&&a.push("--build","--force-recreate"),console.log(h.gray(" \u{1F528} Starting parallel build process...")),ye(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=H.join(r,"frontend");await V.ensureDir(c);let u=H.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=H.join(r,"backend");await V.ensureDir(c);let u=H.join(s,"backend");if(!await V.pathExists(u))throw new Error("Backend build did not produce expected output directory");await lx(e,t,c,s),console.log(h.green(" \u2705 Backend build complete"))}console.log(h.green(" \u2705 Application build completed"))}finally{try{ye(["-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)}},lx=async(e,t,r,n)=>{console.log(h.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=H.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=H.join(r,"dist");if(!await V.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=H.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=H.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=H.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 ux(r)},ux=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=H.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=H.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"))},Us=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await dx(e,t,r),!0),dx=async(e,t,r)=>{console.log(h.blue("\u{1F527} Building workbench..."));let n=H.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await V.pathExists(n)){f.warn("Workbench package not found, skipping workbench build");return}let o=H.join(t,"workbench"),i;if(e.workbench)try{Pr(e.workbench),i=await $r(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(p=>p!==""),d=Qk("yarn",l,{cwd:n,stdio:r.verbose?"inherit":"ignore",env:s});d.on("close",p=>{f.raw(h.gray(` \u{1F3C1} Workbench build process exited with code ${p}`)),p===0?c():u(new Error(`Workbench build failed with exit code ${p}`))}),d.on("error",p=>{f.raw(h.red(` \u274C Workbench build process error: ${p.message}`)),u(p)})}),f.raw(h.green(" \u2705 Workbench build complete"))}catch(s){throw f.error("Workbench build failed: "+s.message),s}};import et from"fs-extra";import Ze from"path";var qs=()=>[{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 sf=async(e,t={})=>{console.log(h.blue("\u{1F4CB} Generating deployment guide..."));let r=Ze.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=lf(e,n,o,i);return t.generateFiles?await hx(e,s,r,i):await mx(e,s,r,i)},af=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=lf(e,r,n,o);return await px(e,i,n,o)},px=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await df(e,t,r,n),a=await pf(),c=fx(e.name,r);return`# Deploy ${e.name} with Docker
|
|
1176
1176
|
|
|
1177
1177
|
Deploy ${e.name} using pre-built Docker images.
|
|
1178
1178
|
|
|
@@ -1240,8 +1240,8 @@ docker compose down -v
|
|
|
1240
1240
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1241
1241
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1242
1242
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1243
|
-
`},
|
|
1244
|
-
`),
|
|
1243
|
+
`},fx=(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(`
|
|
1244
|
+
`),cf=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await df(e,t,"latest",r),s=await pf();return`# Deploy ${e.name} with Docker
|
|
1245
1245
|
|
|
1246
1246
|
Deploy ${e.name} using pre-built Docker images.
|
|
1247
1247
|
|
|
@@ -1349,7 +1349,7 @@ docker compose down -v
|
|
|
1349
1349
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1350
1350
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1351
1351
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1352
|
-
`},
|
|
1352
|
+
`},lf=(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}},hx=async(e,t,r,n)=>{console.log(h.blue("\u{1F4C1} Generating deployment files..."));let o=Ze.join(r,"deploy-guide");await et.ensureDir(o);let i=Ze.join(o,"docker-compose.yml");await uf(e,t,i,"latest",n);let s=Ze.join(o,"docker-compose.override.yml.example");await gx(e,s);let a=Ze.join(o,".env.example");await yx(e,a,t.hasWorkbench);let c=Ze.join(o,"README.md");await bx(e,t,c,n);let u=Ze.join(o,"DEPLOY.md");return await vx(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]}},mx=async(e,t,r,n)=>{console.log(h.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=Ze.join(r,"DEPLOY.md");return await _x(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}},uf=async(e,t,r,n,o)=>{let i=e.services.frontend?.port||8081,s=e.services.workbench?.frontendPort||8083,a=u=>{let p=u.split(":")[0].replace(o,"");return o?`${o}${p}:\${IMAGE_TAG:-${n}}`:`\${DOCKER_REGISTRY:-}${p}:\${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:{test:["CMD","curl","-f",`http://0.0.0.0:${i}/`],interval:"10s",timeout:"30s",retries:10}},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}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},database:{image:"mongo:5.0.6",restart:"unless-stopped",volumes:["mongodb_data:/data/db"],networks:["app-network"],environment:[`MONGO_INITDB_DATABASE=\${MONGO_DATABASE:-${e.name}}`],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},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:{test:["CMD","curl","-f",`http://0.0.0.0:${s}/`],interval:"10s",timeout:"30s",retries:10}},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}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}}),await et.writeFile(r,it.dump(c))},gx=async(e,t)=>{let r=qs(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
|
|
1353
1353
|
# Copy this file to docker-compose.override.yml and customize as needed
|
|
1354
1354
|
# This file allows you to extend the main docker-compose.yml without modifying it
|
|
1355
1355
|
|
|
@@ -1387,7 +1387,7 @@ ${o.map(s=>` # ${s.description}
|
|
|
1387
1387
|
# Add custom networks if needed
|
|
1388
1388
|
# networks:
|
|
1389
1389
|
# custom-network:
|
|
1390
|
-
`;await
|
|
1390
|
+
`;await et.writeFile(t,i)},yx=async(e,t,r)=>{let n=Gs(e,r);await et.writeFile(t,n)},bx=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
|
|
1391
1391
|
|
|
1392
1392
|
This folder contains deployment files for testing registry-based deployment locally.
|
|
1393
1393
|
|
|
@@ -1476,7 +1476,7 @@ you can adjust these registry examples based on where your images will be hosted
|
|
|
1476
1476
|
\`\`\`
|
|
1477
1477
|
|
|
1478
1478
|
Generated on: ${new Date().toISOString()}
|
|
1479
|
-
`;await
|
|
1479
|
+
`;await et.writeFile(r,s)},vx=async(e,t,r,n)=>{let o=await cf(e,t,n);await et.writeFile(r,o)},_x=async(e,t,r,n)=>{let o=await cf(e,t,n),i=`# ${e.name} - Registry Deployment Guide
|
|
1480
1480
|
|
|
1481
1481
|
## For Developers
|
|
1482
1482
|
|
|
@@ -1500,7 +1500,7 @@ ${t.names.map(s=>`- \`${s}\``).join(`
|
|
|
1500
1500
|
*Copy everything below this line to your project README or documentation*
|
|
1501
1501
|
|
|
1502
1502
|
${o}
|
|
1503
|
-
`;await
|
|
1503
|
+
`;await et.writeFile(r,i)},df=async(e,t,r,n)=>{let o=Ze.join(process.cwd(),"temp-compose.yml");await uf(e,t,o,r,n);let i=await et.readFile(o,"utf8");return await et.remove(o),i},pf=async()=>{let e=qs(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
|
|
1504
1504
|
frontend:
|
|
1505
1505
|
volumes:
|
|
1506
1506
|
${t.map(n=>` # ${n.description}
|
|
@@ -1515,7 +1515,7 @@ ${r.map(n=>` # ${n.description}
|
|
|
1515
1515
|
# - ${n.source}:${n.target}`).join(`
|
|
1516
1516
|
`)}
|
|
1517
1517
|
environment:
|
|
1518
|
-
# - CUSTOM_API_KEY=your-key`};var Le=new ga;Le.version("0.1.0");Le.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("--no-cache","Force rebuild Docker images without using cache").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Starting raclette development environment..."),Vr();let t=await Oe(),r=process.cwd(),n;try{n=await Pe(e.configFile)}catch(i){h.error("Could not read raclette.config.js file. Please check your file for syntax errors! Canceling startup process."),h.error(`The following error occured on reading the file: "${i.message}"`),process.exit(1)}n||(h.error("No configuration loaded"),process.exit(1));let o=Wt.join(t,"docker-compose.yml");e.projectName&&(h.raclette("Setting project name to "+e.projectName),n.name=e.projectName),await Md(n,{dockerComposePath:o,workingDir:r,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):["frontend","backend"],forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){h.error("Error starting development environment: "+t?.message),process.exit(1)}});Le.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").action(async(e,t)=>{try{h.setVerbose(t.verbose),h.raclette("Attaching to service logs...");let r=await Oe(),n=await Pe(),o=Wt.join(r,"docker-compose.yml");await _r.pathExists(o)||(h.error("No docker-compose.yml found. Services may not be running."),h.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await Kd(e,t,n,o)}catch(r){h.error("Error following logs: "+r.message),process.exit(1)}});Le.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").action(async e=>{try{h.setVerbose(e.verbose),console.log(f.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=await Oe(),r=await Pe(),n=process.cwd();e.projectName&&(h.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let o=Wt.join(t,"docker-compose.yml"),i=Wt.join(t,"docker-compose.full.yml");if(!await _r.pathExists(o)){console.error(f.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(h.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Fs(o,r)):(h.debug("\u2139Generating full docker-compose file including shared services"),await Nc(r,n,i,"development"),await Fs(i,r),await _r.remove(i)),h.success("Docker services stopped successfully")}catch(t){h.error("Error stopping Docker services: "+t.message),process.exit(1)}});Le.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").action(async(e,t)=>{try{if(h.setVerbose(t.verbose),h.raclette("Restarting Raclette services..."),e.length===0){h.warn("No services specified. Please specify which services to restart."),h.instruction("Usage: raclette restart <service1> <service2> ..."),h.instruction("Common services: frontend, backend, mongodb, cache");return}let r=await Oe(),n=await Pe(),o=n?.name??Wt.basename(process.cwd()),i=Wt.join(r,"docker-compose.yml");if(!await _r.pathExists(i)){h.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let s of e)try{let a=await vr(s,n,i);if(!Ot(a)){h.warn(`Service '${s}' (container: ${a}) doesn't appear to be running.`),h.instruction(" If you're sure it's running, it might have a different container name than expected."),h.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await _r.pathExists(i)?(h.progress(`Restarting service: ${s}...`),ye(["-p",o,"-f",i,"restart",s],{stdio:"inherit"})):(h.progress(` Restarting container: ${a}...`),ce(["restart",a],{stdio:"inherit"})),h.success(`Service '${s}' restarted successfully`)}catch(a){h.error(`Error restarting service '${s}': ${a.message}`)}}catch(r){h.error("Error restarting services: "+r.message),process.exit(1)}});Le.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").action(async(e="both",t)=>{try{h.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(h.error("Target must be one of: frontend, backend, both"),process.exit(1));let r=await Oe(),n=await Pe();await Is(e,n),await Ms(e,n,r)||(h.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){h.error("Error updating dependencies: "+r.message),process.exit(1)}});Le.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").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Building raclette application...");let t=process.cwd();await Oe();let r=await Pe();e.projectName&&(h.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 Zd(r,t,n);switch(h.success("Build complete!"),o.mode){case"artifacts":h.success(`Build files are in ${o.buildDir}!`),h.raw(f.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":h.success("Docker images built and tagged"),h.raw(f.green("\u{1F680} Ready for registry push"));break;case"package":h.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&h.raw(f.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){h.error("Error building application: "+t?.message),process.exit(1)}});var Ws=()=>["frontend","backend","workbench.frontend","workbench.backend"],_x=e=>Ws().includes(e),uf=e=>e.join(", ");Le.command("add-package <target> <package...>").description(`Add a package to the project (target: ${uf(Ws())})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").action(async(e,t,r)=>{try{if(h.setVerbose(r.verbose),!_x(e)){let i=Ws();h.error(`Target must be one of: ${uf(i)}`),process.exit(1)}h.raclette(`Adding package(s) to ${e}...`);for(let i of t)await Id(e,i,r.dev);let n=await Oe(),o=await Pe();await Is(e,o),await Ms(e,o,n)}catch(n){h.error("Error adding package: "+n.message),process.exit(1)}});Le.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").action(async(e,t)=>{try{h.setVerbose(t.verbose),h.raclette("Rebuilding Raclette Docker images...");let r=await Oe(),n=await Pe();if(e.length===0){h.debug("\u{1F50D} Detecting services with changes...");let i=await Kr(n,r);if(i.length===0){h.warn("No service file changes detected. Use service names to force rebuild.");return}e=i}let o=e.filter(i=>i==="frontend"||i==="backend"||i==="workbench");o.length===0&&(h.error("No valid services specified for rebuild"),h.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await Xr(n,r,o,{noCache:t.noCache}),h.success(`Rebuild complete for services: ${o.join(", ")}`)}catch(r){h.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});Le.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").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Generating raclette deployment guide..."),await Oe();let t=await Pe();if(e.returnOnly){let o={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},i=await nf(t,o);console.log(i),process.exit(0)}let r={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},n=await rf(t,r);h.success("Deployment guide generated!"),n.mode==="files"?(h.raw(f.cyan(`\u{1F4C1} Files created in: ${n.outputPath}`)),h.raw(f.yellow("\u{1F4A1} Use these files for local testing")),h.raw(f.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(h.raw(f.cyan(`\u{1F4C4} Guide created: ${n.deployGuideFile}`)),h.raw(f.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch{h.error("Error generating deployment guide: "+error.message),process.exit(1)}});Le.parse(process.argv);
|
|
1518
|
+
# - CUSTOM_API_KEY=your-key`};var Ne=new ba;Ne.version("0.1.0");Ne.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("--no-cache","Force rebuild Docker images without using cache").action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment..."),Gr();let t=await Oe(),r=process.cwd(),n;try{n=await Pe(e.configFile)}catch(i){f.error("Could not read raclette.config.js file. Please check your file for syntax errors! Canceling startup process."),f.error(`The following error occured on reading the file: "${i.message}"`),process.exit(1)}n||(f.error("No configuration loaded"),process.exit(1));let o=qt.join(t,"docker-compose.yml");e.projectName&&(f.raclette("Setting project name to "+e.projectName),n.name=e.projectName),await Vp(n,{dockerComposePath:o,workingDir:r,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):["frontend","backend"],forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});Ne.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").action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs...");let r=await Oe(),n=await Pe(),o=qt.join(r,"docker-compose.yml");await vr.pathExists(o)||(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 Qp(e,t,n,o)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});Ne.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").action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=await Oe(),r=await Pe(),n=process.cwd();e.projectName&&(f.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let o=qt.join(t,"docker-compose.yml"),i=qt.join(t,"docker-compose.full.yml");if(!await vr.pathExists(o)){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 Bs(o,r)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Ic(r,n,i,"development"),await Bs(i,r),await vr.remove(i)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});Ne.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").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=await Oe(),n=await Pe(),o=n?.name??qt.basename(process.cwd()),i=qt.join(r,"docker-compose.yml");if(!await vr.pathExists(i)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let s of e)try{let a=await br(s,n,i);if(!Tt(a)){f.warn(`Service '${s}' (container: ${a}) 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 vr.pathExists(i)?(f.progress(`Restarting service: ${s}...`),ye(["-p",o,"-f",i,"restart",s],{stdio:"inherit"})):(f.progress(` Restarting container: ${a}...`),ce(["restart",a],{stdio:"inherit"})),f.success(`Service '${s}' restarted successfully`)}catch(a){f.error(`Error restarting service '${s}': ${a.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});Ne.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").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));let r=await Oe(),n=await Pe();await js(e,n),await Hs(e,n,r)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});Ne.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").action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=process.cwd();await Oe();let r=await Pe(e.configFile);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 rf(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)}});var Ys=()=>["frontend","backend","workbench.frontend","workbench.backend"],Ex=e=>Ys().includes(e),ff=e=>e.join(", ");Ne.command("add-package <target> <package...>").description(`Add a package to the project (target: ${ff(Ys())})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").action(async(e,t,r)=>{try{if(f.setVerbose(r.verbose),!Ex(e)){let i=Ys();f.error(`Target must be one of: ${ff(i)}`),process.exit(1)}f.raclette(`Adding package(s) to ${e}...`);for(let i of t)await Mp(e,i,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder...");let n=await Oe(),o=await Pe();await js(e,o),await Hs(e,o,n)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});Ne.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").action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images...");let r=await Oe(),n=await Pe();if(e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let i=await Xr(n,r);if(i.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=i}let o=e.filter(i=>i==="frontend"||i==="backend"||i==="workbench");o.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await zr(n,r,o,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${o.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});Ne.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").action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),await Oe();let t=await Pe();if(e.returnOnly){let o={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},i=await af(t,o);console.log(i),process.exit(0)}let r={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},n=await sf(t,r);f.success("Deployment guide generated!"),n.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${n.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: ${n.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch{f.error("Error generating deployment guide: "+error.message),process.exit(1)}});Ne.parse(process.argv);
|
|
1519
1519
|
/*! Bundled license information:
|
|
1520
1520
|
|
|
1521
1521
|
is-extglob/index.js:
|