@gjsify/cli 0.64.49-next.348 → 0.64.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.gjs.mjs +2 -2
  2. package/package.json +21 -22
package/dist/cli.gjs.mjs CHANGED
@@ -146,7 +146,7 @@ fi
146
146
  `)}`:``;n.fail(N(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(C).length,Object.keys(C).join(`, `)+S))}},F.unknownArguments=function unknownArguments(S,C,I,H,W=!0){let q=t.getInternalMethods().getCommandInstance().getCommands(),Y=[],X=t.getInternalMethods().getContext();if(Object.keys(S).forEach(n=>{!zp.includes(n)&&!Object.prototype.hasOwnProperty.call(I,n)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),n)&&!F.isValidAndSomeAliasIsNotNew(n,C)&&Y.push(n)}),W&&(X.commands.length>0||q.length>0||H)&&S._.slice(X.commands.length).forEach(t=>{q.includes(``+t)||Y.push(``+t)}),W){let n=t.getDemandedCommands()._?.max||0,C=X.commands.length+n;C<S._.length&&S._.slice(C).forEach(t=>{t=String(t),!X.commands.includes(t)&&!Y.includes(t)&&Y.push(t)})}Y.length&&n.fail(N(`Unknown argument: %s`,`Unknown arguments: %s`,Y.length,Y.map(t=>t.trim()?t:`"${t}"`).join(`, `)))},F.unknownCommands=function unknownCommands(S){let C=t.getInternalMethods().getCommandInstance().getCommands(),F=[],I=t.getInternalMethods().getContext();return(I.commands.length>0||C.length>0)&&S._.slice(I.commands.length).forEach(t=>{C.includes(``+t)||F.push(``+t)}),F.length>0?(n.fail(N(`Unknown command: %s`,`Unknown commands: %s`,F.length,F.join(`, `))),!0):!1},F.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(n,S){if(!Object.prototype.hasOwnProperty.call(S,n))return!1;let C=t.parsed.newAliases;return[n,...S[n]].some(t=>!Object.prototype.hasOwnProperty.call(C,t)||!C[n])},F.limitedChoices=function limitedChoices(S){let N=t.getOptions(),F={};if(!Object.keys(N.choices).length)return;Object.keys(S).forEach(t=>{zp.indexOf(t)===-1&&Object.prototype.hasOwnProperty.call(N.choices,t)&&[].concat(S[t]).forEach(n=>{N.choices[t].indexOf(n)===-1&&n!==void 0&&(F[t]=(F[t]||[]).concat(n))})});let I=Object.keys(F);if(!I.length)return;let H=C(`Invalid values:`);I.forEach(t=>{H+=`\n ${C(`Argument: %s, Given: %s, Choices: %s`,t,n.stringifiedValues(F[t]),n.stringifiedValues(N.choices[t]))}`}),n.fail(H)};let I={};F.implies=function implies(n,C){argsert(`<string|object> [array|number|string]`,[n,C],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.implies(t,n[t])}):(t.global(n),I[n]||(I[n]=[]),Array.isArray(C)?C.forEach(t=>F.implies(n,t)):(assertNotStrictEqual(C,void 0,S),I[n].push(C)))},F.getImplied=function getImplied(){return I};function keyExists(t,n){let S=Number(n);return n=isNaN(S)?n:S,typeof n==`number`?n=t._.length>=n:n.match(/^--no-.+/)?(n=n.match(/^--no-(.+)/)[1],n=!Object.prototype.hasOwnProperty.call(t,n)):n=Object.prototype.hasOwnProperty.call(t,n),n}F.implications=function implications(t){let S=[];if(Object.keys(I).forEach(n=>{let C=n;(I[n]||[]).forEach(n=>{let N=C,F=n;N=keyExists(t,N),n=keyExists(t,n),N&&!n&&S.push(` ${C} -> ${F}`)})}),S.length){let t=`${C(`Implications failed:`)}\n`;S.forEach(n=>{t+=n}),n.fail(t)}};let H={};F.conflicts=function conflicts(n,S){argsert(`<string|object> [array|string]`,[n,S],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.conflicts(t,n[t])}):(t.global(n),H[n]||(H[n]=[]),Array.isArray(S)?S.forEach(t=>F.conflicts(n,t)):H[n].push(S))},F.getConflicting=()=>H,F.conflicting=function conflictingFn(N){Object.keys(N).forEach(t=>{H[t]&&H[t].forEach(S=>{S&&N[t]!==void 0&&N[S]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,S))})}),t.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(H).forEach(t=>{H[t].forEach(F=>{F&&N[S.Parser.camelCase(t)]!==void 0&&N[S.Parser.camelCase(F)]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,F))})})},F.recommendCommands=function recommendCommands(t,S){S=S.sort((t,n)=>n.length-t.length);let N=null,F=1/0;for(let n=0,C;(C=S[n])!==void 0;n++){let n=levenshtein(t,C);n<=3&&n<F&&(F=n,N=C)}N&&n.fail(C(`Did you mean %s?`,N))},F.reset=function reset(t){return I=objFilter(I,n=>!t[n]),H=objFilter(H,n=>!t[n]),F};let W=[];return F.freeze=function freeze(){W.push({implied:I,conflicting:H})},F.unfreeze=function unfreeze(){let t=W.pop();assertNotStrictEqual(t,void 0,S),{implied:I,conflicting:H}=t},F}var zp,Bp=__esmMin(()=>{Ep(),Sp(),Rp(),jp(),zp=[`$0`,`--`,`_`]});function YargsFactory(t){return(n=[],S=t.process.cwd(),C)=>{let N=new YargsInstance(n,S,C,t);return Object.defineProperty(N,"argv",{get:()=>N.parse(),enumerable:!0}),N.help(),N.version(),N}}function isYargsInstance(t){return!!t&&typeof t.getInternalMethods==`function`}var __classPrivateFieldSet,__classPrivateFieldGet,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,YargsInstance,oh=__esmMin(()=>{_e(),Ap(),Sp(),Bl(),Np(),Ep(),Lp(),Bp(),jp(),Ul(),Dp(),Cp(),Op(),Mp(),__classPrivateFieldSet=function(t,n,S,C,N){if(C===`m`)throw TypeError(`Private method is not writable`);if(C===`a`&&!N)throw TypeError(`Private accessor was defined without a setter`);if(typeof n==`function`?t!==n||!N:!n.has(t))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return C===`a`?N.call(t,S):N?N.value=S:n.set(t,S),S},__classPrivateFieldGet=function(t,n,S,C){if(S===`a`&&!C)throw TypeError(`Private accessor was defined without a getter`);if(typeof n==`function`?t!==n||!C:!n.has(t))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return S===`m`?C:S===`a`?C.call(t):C?C.value:n.get(t)},Cm=Symbol(`copyDoubleDash`),wm=Symbol(`copyDoubleDash`),Tm=Symbol(`deleteFromParserHintObject`),Em=Symbol(`emitWarning`),Dm=Symbol(`freeze`),Om=Symbol(`getDollarZero`),km=Symbol(`getParserConfiguration`),Am=Symbol(`getUsageConfiguration`),jm=Symbol(`guessLocale`),Mm=Symbol(`guessVersion`),Nm=Symbol(`parsePositionalNumbers`),Pm=Symbol(`pkgUp`),Fm=Symbol(`populateParserHintArray`),Im=Symbol(`populateParserHintSingleValueDictionary`),Lm=Symbol(`populateParserHintArrayDictionary`),Rm=Symbol(`populateParserHintDictionary`),zm=Symbol(`sanitizeKey`),Bm=Symbol(`setKey`),Vm=Symbol(`unfreeze`),Hm=Symbol(`validateAsync`),Um=Symbol(`getCommandInstance`),Wm=Symbol(`getContext`),Gm=Symbol(`getHasOutput`),Km=Symbol(`getLoggerInstance`),qm=Symbol(`getParseContext`),Jm=Symbol(`getUsageInstance`),Ym=Symbol(`getValidationInstance`),Xm=Symbol(`hasParseCallback`),Zm=Symbol(`isGlobalContext`),Qm=Symbol(`postProcess`),$m=Symbol(`rebase`),eh=Symbol(`reset`),th=Symbol(`runYargsParserAndExecuteCommands`),nh=Symbol(`runValidation`),rh=Symbol(`setHasOutput`),ih=Symbol(`kTrackManuallySetKeys`),ah=`en_US`,YargsInstance=class{constructor(t=[],n,S,C){this.customScriptName=!1,this.parsed=!1,Vp.set(this,void 0),Hp.set(this,void 0),Up.set(this,{commands:[],fullCommands:[]}),Wp.set(this,null),Gp.set(this,null),Kp.set(this,`show-hidden`),qp.set(this,null),Jp.set(this,!0),Yp.set(this,{}),Xp.set(this,!0),Zp.set(this,[]),Qp.set(this,void 0),$p.set(this,{}),em.set(this,!1),tm.set(this,null),nm.set(this,!0),im.set(this,void 0),am.set(this,``),om.set(this,void 0),sm.set(this,void 0),cm.set(this,{}),lm.set(this,null),um.set(this,null),dm.set(this,{}),fm.set(this,{}),pm.set(this,void 0),mm.set(this,!1),hm.set(this,void 0),gm.set(this,!1),_m.set(this,!1),vm.set(this,!1),ym.set(this,void 0),bm.set(this,{}),xm.set(this,null),Sm.set(this,void 0),__classPrivateFieldSet(this,hm,C,`f`),__classPrivateFieldSet(this,pm,t,`f`),__classPrivateFieldSet(this,Hp,n,`f`),__classPrivateFieldSet(this,sm,S,`f`),__classPrivateFieldSet(this,Qp,new GlobalMiddleware(this),`f`),this.$0=this[Om](),this[eh](),__classPrivateFieldSet(this,Vp,__classPrivateFieldGet(this,Vp,`f`),`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`),`f`),__classPrivateFieldSet(this,Sm,__classPrivateFieldGet(this,Sm,`f`),`f`),__classPrivateFieldSet(this,om,__classPrivateFieldGet(this,om,`f`),`f`),__classPrivateFieldGet(this,om,`f`).showHiddenOpt=__classPrivateFieldGet(this,Kp,`f`),__classPrivateFieldSet(this,im,this[wm](),`f`),__classPrivateFieldGet(this,hm,`f`).y18n.setLocale(ah)}addHelpOpt(t,n){return argsert(`[string|boolean] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,tm,`f`)&&(this[Tm](__classPrivateFieldGet(this,tm,`f`)),__classPrivateFieldSet(this,tm,null,`f`)),t===!1&&n===void 0?this:(__classPrivateFieldSet(this,tm,typeof t==`string`?t:`help`,`f`),this.boolean(__classPrivateFieldGet(this,tm,`f`)),this.describe(__classPrivateFieldGet(this,tm,`f`),n||__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Show help`)),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(argsert(`[string|boolean] [string]`,[t,n],arguments.length),t===!1&&n===void 0)return this;let S=typeof t==`string`?t:__classPrivateFieldGet(this,Kp,`f`);return this.boolean(S),this.describe(S,n||__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Show hidden options`)),__classPrivateFieldGet(this,om,`f`).showHiddenOpt=S,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[Lm](this.alias.bind(this),`alias`,t,n),this}array(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`array`,t),this[ih](t),this}boolean(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`boolean`,t),this[ih](t),this}check(t,n){return argsert(`<function> [boolean]`,[t,n],arguments.length),this.middleware((n,S)=>maybeAsyncResult(()=>t(n,S.getOptions()),S=>(S?(typeof S==`string`||S instanceof Error)&&__classPrivateFieldGet(this,ym,`f`).fail(S.toString(),S):__classPrivateFieldGet(this,ym,`f`).fail(__classPrivateFieldGet(this,hm,`f`).y18n.__(`Argument check failed: %s`,t.toString())),n),t=>(__classPrivateFieldGet(this,ym,`f`).fail(t.message?t.message:t.toString(),t),n)),!1,n),this}choices(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[Lm](this.choices.bind(this),`choices`,t,n),this}coerce(t,n){if(argsert(`<object|string|array> [function]`,[t,n],arguments.length),Array.isArray(t)){if(!n)throw new zl(`coerce callback must be provided`);for(let S of t)this.coerce(S,n);return this}else if(typeof t==`object`){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!n)throw new zl(`coerce callback must be provided`);let S=t;return __classPrivateFieldGet(this,om,`f`).key[S]=!0,__classPrivateFieldGet(this,Qp,`f`).addCoerceMiddleware((t,C)=>{let N=C.getAliases()[S]??[],F=[S,...N].filter(n=>Object.prototype.hasOwnProperty.call(t,n));return F.length===0?t:maybeAsyncResult(()=>n(t[F[0]]),n=>(F.forEach(S=>{t[S]=n}),t),t=>{throw new zl(t.message)})},S),this}conflicts(t,n){return argsert(`<string|object> [string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,Sm,`f`).conflicts(t,n),this}config(t=`config`,n,S){return argsert(`[object|string] [string|function] [function]`,[t,n,S],arguments.length),typeof t==`object`&&!Array.isArray(t)?(t=applyExtends(t,__classPrivateFieldGet(this,Hp,`f`),this[km]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).configObjects=(__classPrivateFieldGet(this,om,`f`).configObjects||[]).concat(t),this):(typeof n==`function`&&(S=n,n=void 0),this.describe(t,n||__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(t)?t:[t]).forEach(t=>{__classPrivateFieldGet(this,om,`f`).config[t]=S||!0}),this)}completion(t,n,S){return argsert(`[string] [string|boolean|function] [function]`,[t,n,S],arguments.length),typeof n==`function`&&(S=n,n=void 0),__classPrivateFieldSet(this,Gp,t||__classPrivateFieldGet(this,Gp,`f`)||`completion`,`f`),!n&&n!==!1&&(n=`generate completion script`),this.command(__classPrivateFieldGet(this,Gp,`f`),n),S&&__classPrivateFieldGet(this,Wp,`f`).registerFunction(S),this}command(t,n,S,C,N,F){return argsert(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[t,n,S,C,N,F],arguments.length),__classPrivateFieldGet(this,Vp,`f`).addHandler(t,n,S,C,N,F),this}commands(t,n,S,C,N,F){return this.command(t,n,S,C,N,F)}commandDir(t,n){argsert(`<string> [object]`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,sm,`f`)||__classPrivateFieldGet(this,hm,`f`).require;return __classPrivateFieldGet(this,Vp,`f`).addDirectory(t,S,__classPrivateFieldGet(this,hm,`f`).getCallerFile(),n),this}count(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`count`,t),this[ih](t),this}default(t,n,S){return argsert(`<object|string|array> [*] [string]`,[t,n,S],arguments.length),S&&(assertSingleKey(t,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).defaultDescription[t]=S),typeof n==`function`&&(assertSingleKey(t,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).defaultDescription[t]||(__classPrivateFieldGet(this,om,`f`).defaultDescription[t]=__classPrivateFieldGet(this,ym,`f`).functionDescription(n)),n=n.call()),this[Im](this.default.bind(this),`default`,t,n),this}defaults(t,n,S){return this.default(t,n,S)}demandCommand(t=1,n,S,C){return argsert(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[t,n,S,C],arguments.length),typeof n!=`number`&&(S=n,n=1/0),this.global(`_`,!1),__classPrivateFieldGet(this,om,`f`).demandedCommands._={min:t,max:n,minMsg:S,maxMsg:C},this}demand(t,n,S){return Array.isArray(n)?(n.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,hm,`f`)),this.demandOption(t,S)}),n=1/0):typeof n!=`number`&&(S=n,n=1/0),typeof t==`number`?(assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,hm,`f`)),this.demandCommand(t,n,S,S)):Array.isArray(t)?t.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,hm,`f`)),this.demandOption(t,S)}):typeof S==`string`?this.demandOption(t,S):(S===!0||S===void 0)&&this.demandOption(t),this}demandOption(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Im](this.demandOption.bind(this),`demandedOptions`,t,n),this}deprecateOption(t,n){return argsert(`<string> [string|boolean]`,[t,n],arguments.length),__classPrivateFieldGet(this,om,`f`).deprecatedOptions[t]=n,this}describe(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Bm](t,!0),__classPrivateFieldGet(this,ym,`f`).describe(t,n),this}detectLocale(t){return argsert(`<boolean>`,[t],arguments.length),__classPrivateFieldSet(this,Jp,t,`f`),this}env(t){return argsert(`[string|boolean]`,[t],arguments.length),t===!1?delete __classPrivateFieldGet(this,om,`f`).envPrefix:__classPrivateFieldGet(this,om,`f`).envPrefix=t||``,this}epilogue(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,ym,`f`).epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return argsert(`<string|array> [string]`,[t,n],arguments.length),Array.isArray(t)?t.forEach(t=>this.example(...t)):__classPrivateFieldGet(this,ym,`f`).example(t,n),this}exit(t,n){__classPrivateFieldSet(this,em,!0,`f`),__classPrivateFieldSet(this,qp,n,`f`),__classPrivateFieldGet(this,Xp,`f`)&&__classPrivateFieldGet(this,hm,`f`).process.exit(t)}exitProcess(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Xp,t,`f`),this}fail(t){if(argsert(`<function|boolean>`,[t],arguments.length),typeof t==`boolean`&&t!==!1)throw new zl(`Invalid first argument. Expected function or boolean 'false'`);return __classPrivateFieldGet(this,ym,`f`).failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return argsert(`<array> [function]`,[t,n],arguments.length),n?__classPrivateFieldGet(this,Wp,`f`).getCompletion(t,n):new Promise((n,S)=>{__classPrivateFieldGet(this,Wp,`f`).getCompletion(t,(t,C)=>{t?S(t):n(C)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,om,`f`).demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,om,`f`).demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,om,`f`).deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,Jp,`f`)}getExitProcess(){return __classPrivateFieldGet(this,Xp,`f`)}getGroups(){return Object.assign({},__classPrivateFieldGet(this,$p,`f`),__classPrivateFieldGet(this,fm,`f`))}getHelp(){if(__classPrivateFieldSet(this,em,!0,`f`),!__classPrivateFieldGet(this,ym,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[th](__classPrivateFieldGet(this,pm,`f`),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,ym,`f`).help())}let t=__classPrivateFieldGet(this,Vp,`f`).runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,ym,`f`).help())}return Promise.resolve(__classPrivateFieldGet(this,ym,`f`).help())}getOptions(){return __classPrivateFieldGet(this,om,`f`)}getStrict(){return __classPrivateFieldGet(this,gm,`f`)}getStrictCommands(){return __classPrivateFieldGet(this,_m,`f`)}getStrictOptions(){return __classPrivateFieldGet(this,vm,`f`)}global(t,n){return argsert(`<string|array> [boolean]`,[t,n],arguments.length),t=[].concat(t),n===!1?t.forEach(t=>{__classPrivateFieldGet(this,om,`f`).local.includes(t)||__classPrivateFieldGet(this,om,`f`).local.push(t)}):__classPrivateFieldGet(this,om,`f`).local=__classPrivateFieldGet(this,om,`f`).local.filter(n=>t.indexOf(n)===-1),this}group(t,n){argsert(`<string|array> <string>`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,fm,`f`)[n]||__classPrivateFieldGet(this,$p,`f`)[n];__classPrivateFieldGet(this,fm,`f`)[n]&&delete __classPrivateFieldGet(this,fm,`f`)[n];let C={};return __classPrivateFieldGet(this,$p,`f`)[n]=(S||[]).concat(t).filter(t=>C[t]?!1:C[t]=!0),this}hide(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,om,`f`).hiddenOptions.push(t),this}implies(t,n){return argsert(`<string|object> [number|string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,Sm,`f`).implies(t,n),this}locale(t){return argsert(`[string]`,[t],arguments.length),t===void 0?(this[jm](),__classPrivateFieldGet(this,hm,`f`).y18n.getLocale()):(__classPrivateFieldSet(this,Jp,!1,`f`),__classPrivateFieldGet(this,hm,`f`).y18n.setLocale(t),this)}middleware(t,n,S){return __classPrivateFieldGet(this,Qp,`f`).addMiddleware(t,!!n,S)}nargs(t,n){return argsert(`<string|object|array> [number]`,[t,n],arguments.length),this[Im](this.nargs.bind(this),`narg`,t,n),this}normalize(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`normalize`,t),this}number(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`number`,t),this[ih](t),this}option(t,n){if(argsert(`<string|object> [object]`,[t,n],arguments.length),typeof t==`object`)Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof n!=`object`&&(n={}),this[ih](t),__classPrivateFieldGet(this,xm,`f`)&&(t===`version`||n?.alias===`version`)&&this[Em]([`"version" is a reserved word.`,`Please do one of the following:`,'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)",`- Use a different option key`,`https://yargs.js.org/docs/#api-reference-version`].join(`
147
147
  `),void 0,`versionWarning`),__classPrivateFieldGet(this,om,`f`).key[t]=!0,n.alias&&this.alias(t,n.alias);let S=n.deprecate||n.deprecated;S&&this.deprecateOption(t,S);let C=n.demand||n.required||n.require;C&&this.demand(t,C),n.demandOption&&this.demandOption(t,typeof n.demandOption==`string`?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),`default`in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type===`boolean`)&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type===`array`)&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type===`number`)&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type===`string`)&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type===`count`)&&this.count(t),typeof n.global==`boolean`&&this.global(t,n.global),n.defaultDescription&&(__classPrivateFieldGet(this,om,`f`).defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let N=n.describe||n.description||n.desc,F=__classPrivateFieldGet(this,ym,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(F,t)||typeof N==`string`)&&this.describe(t,N),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,S){argsert(`[string|array] [function|boolean|object] [function]`,[t,n,S],arguments.length),this[Dm](),t===void 0&&(t=__classPrivateFieldGet(this,pm,`f`)),typeof n==`object`&&(__classPrivateFieldSet(this,um,n,`f`),n=S),typeof n==`function`&&(__classPrivateFieldSet(this,lm,n,`f`),n=!1),n||__classPrivateFieldSet(this,pm,t,`f`),__classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldSet(this,Xp,!1,`f`);let C=this[th](t,!!n),N=this.parsed;return __classPrivateFieldGet(this,Wp,`f`).setParsed(this.parsed),isPromise(C)?C.then(t=>(__classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldGet(this,lm,`f`).call(this,__classPrivateFieldGet(this,qp,`f`),t,__classPrivateFieldGet(this,am,`f`)),t)).catch(t=>{throw __classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldGet(this,lm,`f`)(t,this.parsed.argv,__classPrivateFieldGet(this,am,`f`)),t}).finally(()=>{this[Vm](),this.parsed=N}):(__classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldGet(this,lm,`f`).call(this,__classPrivateFieldGet(this,qp,`f`),C,__classPrivateFieldGet(this,am,`f`)),this[Vm](),this.parsed=N,C)}parseAsync(t,n,S){let C=this.parse(t,n,S);return isPromise(C)?C:Promise.resolve(C)}parseSync(t,n,S){let C=this.parse(t,n,S);if(isPromise(C))throw new zl(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return C}parserConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,cm,t,`f`),this}pkgConf(t,n){argsert(`<string> [string]`,[t,n],arguments.length);let S=null,C=this[Pm](n||__classPrivateFieldGet(this,Hp,`f`));return C[t]&&typeof C[t]==`object`&&(S=applyExtends(C[t],n||__classPrivateFieldGet(this,Hp,`f`),this[km]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).configObjects=(__classPrivateFieldGet(this,om,`f`).configObjects||[]).concat(S)),this}positional(t,n){argsert(`<string> <object>`,[t,n],arguments.length);let S=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];n=objFilter(n,(t,n)=>t===`type`&&![`string`,`number`,`boolean`].includes(n)?!1:S.includes(t));let C=__classPrivateFieldGet(this,Up,`f`).fullCommands[__classPrivateFieldGet(this,Up,`f`).fullCommands.length-1],N=C?__classPrivateFieldGet(this,Vp,`f`).cmdToParseOptions(C):{array:[],alias:{},default:{},demand:{}};return objectKeys(N).forEach(S=>{let C=N[S];Array.isArray(C)?C.indexOf(t)!==-1&&(n[S]=!0):C[t]&&!(S in n)&&(n[S]=C[t])}),this.group(t,__classPrivateFieldGet(this,ym,`f`).getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,mm,t,`f`),this}required(t,n,S){return this.demand(t,n,S)}require(t,n,S){return this.demand(t,n,S)}requiresArg(t){return argsert(`<array|string|object> [number]`,[t],arguments.length),typeof t==`string`&&__classPrivateFieldGet(this,om,`f`).narg[t]||this[Im](this.requiresArg.bind(this),`narg`,t,NaN),this}showCompletionScript(t,n){return argsert(`[string] [string]`,[t,n],arguments.length),t||=this.$0,__classPrivateFieldGet(this,im,`f`).log(__classPrivateFieldGet(this,Wp,`f`).generateCompletionScript(t,n||__classPrivateFieldGet(this,Gp,`f`)||`completion`)),this}showHelp(t){if(argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldSet(this,em,!0,`f`),!__classPrivateFieldGet(this,ym,`f`).hasCachedHelpMessage()){if(!this.parsed){let n=this[th](__classPrivateFieldGet(this,pm,`f`),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,ym,`f`).showHelp(t)}),this}let n=__classPrivateFieldGet(this,Vp,`f`).runDefaultBuilderOn(this);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,ym,`f`).showHelp(t)}),this}return __classPrivateFieldGet(this,ym,`f`).showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return argsert(`[boolean|string] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,ym,`f`).showHelpOnFail(t,n),this}showVersion(t){return argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldGet(this,ym,`f`).showVersion(t),this}skipValidation(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`skipValidation`,t),this}strict(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,gm,t!==!1,`f`),this}strictCommands(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,_m,t!==!1,`f`),this}strictOptions(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,vm,t!==!1,`f`),this}string(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`string`,t),this[ih](t),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,hm,`f`).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Jp,!1,`f`),__classPrivateFieldGet(this,hm,`f`).y18n.updateLocale(t),this}usage(t,n,S,C){if(argsert(`<string|null|undefined> [string|boolean] [function|object] [function]`,[t,n,S,C],arguments.length),n!==void 0){if(assertNotStrictEqual(t,null,__classPrivateFieldGet(this,hm,`f`)),(t||``).match(/^\$0( |$)/))return this.command(t,n,S,C);throw new zl(`.usage() description must start with $0 if being used as alias for .command()`)}else return __classPrivateFieldGet(this,ym,`f`).usage(t),this}usageConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,bm,t,`f`),this}version(t,n,S){let C=`version`;if(argsert(`[boolean|string] [string] [string]`,[t,n,S],arguments.length),__classPrivateFieldGet(this,xm,`f`)&&(this[Tm](__classPrivateFieldGet(this,xm,`f`)),__classPrivateFieldGet(this,ym,`f`).version(void 0),__classPrivateFieldSet(this,xm,null,`f`)),arguments.length===0)S=this[Mm](),t=C;else if(arguments.length===1){if(t===!1)return this;S=t,t=C}else arguments.length===2&&(S=n,n=void 0);return __classPrivateFieldSet(this,xm,typeof t==`string`?t:C,`f`),n||=__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Show version number`),__classPrivateFieldGet(this,ym,`f`).version(S||void 0),this.boolean(__classPrivateFieldGet(this,xm,`f`)),this.describe(__classPrivateFieldGet(this,xm,`f`),n),this}wrap(t){return argsert(`<number|null|undefined>`,[t],arguments.length),__classPrivateFieldGet(this,ym,`f`).wrap(t),this}[(Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap,Kp=new WeakMap,qp=new WeakMap,Jp=new WeakMap,Yp=new WeakMap,Xp=new WeakMap,Zp=new WeakMap,Qp=new WeakMap,$p=new WeakMap,em=new WeakMap,tm=new WeakMap,nm=new WeakMap,im=new WeakMap,am=new WeakMap,om=new WeakMap,sm=new WeakMap,cm=new WeakMap,lm=new WeakMap,um=new WeakMap,dm=new WeakMap,fm=new WeakMap,pm=new WeakMap,mm=new WeakMap,hm=new WeakMap,gm=new WeakMap,_m=new WeakMap,vm=new WeakMap,ym=new WeakMap,bm=new WeakMap,xm=new WeakMap,Sm=new WeakMap,Cm)](t){if(!t._||!t[`--`])return t;t._.push.apply(t._,t[`--`]);try{delete t[`--`]}catch{}return t}[wm](){return{log:(...t)=>{this[Xm]()||ge.log(...t),__classPrivateFieldSet(this,em,!0,`f`),__classPrivateFieldGet(this,am,`f`).length&&__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+`
148
148
  `,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+t.join(` `),`f`)},error:(...t)=>{this[Xm]()||ge.error(...t),__classPrivateFieldSet(this,em,!0,`f`),__classPrivateFieldGet(this,am,`f`).length&&__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+`
149
- `,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+t.join(` `),`f`)}}}[Tm](t){objectKeys(__classPrivateFieldGet(this,om,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,om,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,ym,`f`).getDescriptions()[t]}[Em](t,n,S){__classPrivateFieldGet(this,Yp,`f`)[S]||(__classPrivateFieldGet(this,hm,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Yp,`f`)[S]=!0)}[Dm](){__classPrivateFieldGet(this,Zp,`f`).push({options:__classPrivateFieldGet(this,om,`f`),configObjects:__classPrivateFieldGet(this,om,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Xp,`f`),groups:__classPrivateFieldGet(this,$p,`f`),strict:__classPrivateFieldGet(this,gm,`f`),strictCommands:__classPrivateFieldGet(this,_m,`f`),strictOptions:__classPrivateFieldGet(this,vm,`f`),completionCommand:__classPrivateFieldGet(this,Gp,`f`),output:__classPrivateFieldGet(this,am,`f`),exitError:__classPrivateFieldGet(this,qp,`f`),hasOutput:__classPrivateFieldGet(this,em,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,lm,`f`),parseContext:__classPrivateFieldGet(this,um,`f`)}),__classPrivateFieldGet(this,ym,`f`).freeze(),__classPrivateFieldGet(this,Sm,`f`).freeze(),__classPrivateFieldGet(this,Vp,`f`).freeze(),__classPrivateFieldGet(this,Qp,`f`).freeze()}[Om](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,hm,`f`).process.argv()[0])?__classPrivateFieldGet(this,hm,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,hm,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[$m](__classPrivateFieldGet(this,Hp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,hm,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,hm,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,hm,`f`).path.dirname(__classPrivateFieldGet(this,hm,`f`).process.execPath())}/`,``)),t}[km](){return __classPrivateFieldGet(this,cm,`f`)}[Am](){return __classPrivateFieldGet(this,bm,`f`)}[jm](){if(!__classPrivateFieldGet(this,Jp,`f`))return;let t=__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[Mm](){return this[Pm]().version||`unknown`}[Nm](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,hm,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[Pm](t){let n=t||`*`;if(__classPrivateFieldGet(this,dm,`f`)[n])return __classPrivateFieldGet(this,dm,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,hm,`f`).mainFilename;__classPrivateFieldGet(this,hm,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,hm,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,hm,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,hm,`f`)),S=JSON.parse(__classPrivateFieldGet(this,hm,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,dm,`f`)[n]=S||{},__classPrivateFieldGet(this,dm,`f`)[n]}[Fm](t,n){n=[].concat(n),n.forEach(n=>{n=this[zm](n),__classPrivateFieldGet(this,om,`f`)[t].push(n)})}[Im](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=S})}[Lm](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=(__classPrivateFieldGet(this,om,`f`)[t][n]||[]).concat(S)})}[Rm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[zm](S),C)}[zm](t){return t===`__proto__`?`___proto___`:t}[Bm](t,n){return this[Im](this[Bm].bind(this),`key`,t,n),this}[Vm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Zp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,hm,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,om,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Xp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,$p,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,am,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,qp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,em,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,gm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,_m,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,vm,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,Gp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,lm,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,um,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,om,`f`).configObjects=te,__classPrivateFieldGet(this,ym,`f`).unfreeze(),__classPrivateFieldGet(this,Sm,`f`).unfreeze(),__classPrivateFieldGet(this,Vp,`f`).unfreeze(),__classPrivateFieldGet(this,Qp,`f`).unfreeze()}[Hm](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Um].bind(this),getContext:this[Wm].bind(this),getHasOutput:this[Gm].bind(this),getLoggerInstance:this[Km].bind(this),getParseContext:this[qm].bind(this),getParserConfiguration:this[km].bind(this),getUsageConfiguration:this[Am].bind(this),getUsageInstance:this[Jm].bind(this),getValidationInstance:this[Ym].bind(this),hasParseCallback:this[Xm].bind(this),isGlobalContext:this[Zm].bind(this),postProcess:this[Qm].bind(this),reset:this[eh].bind(this),runValidation:this[nh].bind(this),runYargsParserAndExecuteCommands:this[th].bind(this),setHasOutput:this[rh].bind(this)}}[Um](){return __classPrivateFieldGet(this,Vp,`f`)}[Wm](){return __classPrivateFieldGet(this,Up,`f`)}[Gm](){return __classPrivateFieldGet(this,em,`f`)}[Km](){return __classPrivateFieldGet(this,im,`f`)}[qm](){return __classPrivateFieldGet(this,um,`f`)||{}}[Jm](){return __classPrivateFieldGet(this,ym,`f`)}[Ym](){return __classPrivateFieldGet(this,Sm,`f`)}[Xm](){return!!__classPrivateFieldGet(this,lm,`f`)}[Zm](){return __classPrivateFieldGet(this,nm,`f`)}[Qm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[Cm](t)),(this[km]()[`parse-positional-numbers`]||this[km]()[`parse-positional-numbers`]===void 0)&&(t=this[Nm](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)),t)}[eh](t={}){__classPrivateFieldSet(this,om,__classPrivateFieldGet(this,om,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,om,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,om,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,fm,`f`),Object.keys(__classPrivateFieldGet(this,$p,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,$p,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,$p,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,om,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,om,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,om,`f`).envPrefix,__classPrivateFieldSet(this,om,n,`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`)?__classPrivateFieldGet(this,ym,`f`).reset(S):usage(this,__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Sm,__classPrivateFieldGet(this,Sm,`f`)?__classPrivateFieldGet(this,Sm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Vp,__classPrivateFieldGet(this,Vp,`f`)?__classPrivateFieldGet(this,Vp,`f`).reset():command(__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Sm,`f`),__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Wp,`f`)||__classPrivateFieldSet(this,Wp,completion(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Vp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Qp,`f`).reset(),__classPrivateFieldSet(this,Gp,null,`f`),__classPrivateFieldSet(this,am,``,`f`),__classPrivateFieldSet(this,qp,null,`f`),__classPrivateFieldSet(this,em,!1,`f`),this.parsed=!1,this}[$m](t,n){return __classPrivateFieldGet(this,hm,`f`).path.relative(t,n)}[th](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,pm,`f`),__classPrivateFieldGet(this,om,`f`).__=__classPrivateFieldGet(this,hm,`f`).y18n.__,__classPrivateFieldGet(this,om,`f`).configuration=this[km]();let I=!!__classPrivateFieldGet(this,om,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,om,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,hm,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,om,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,um,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,tm,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,xm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,ym,`f`).clearCachedHelpMessage();try{if(this[jm](),n)return this[Qm](q,I,!!S,!1);__classPrivateFieldGet(this,tm,`f`)&&[__classPrivateFieldGet(this,tm,`f`)].concat(X[__classPrivateFieldGet(this,tm,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,nm,!1,`f`);let H=__classPrivateFieldGet(this,Vp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Wp,`f`)?.completionKey?[__classPrivateFieldGet(this,Wp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Wp,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,Gp,`f`)){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Qm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,Gp,`f`)){t=F;break}!__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,mm,`f`)&&t&&!re&&__classPrivateFieldGet(this,Sm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,Gp,`f`)&&q._.includes(__classPrivateFieldGet(this,Gp,`f`))&&!ne&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Qm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Wp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Wp,`f`).getCompletion(n,(t,n)=>{if(t)throw new zl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,im,`f`).log(t)}),this.exit(0)}),this[Qm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,em,`f`)||(Z?(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,im,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,ym,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,om,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,om,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new zl(W.error.message);if(!ne){let t=this[nh](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!0)),Y=this[Hm](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof zl)__classPrivateFieldGet(this,ym,`f`).fail(t.message,t);else throw t}return this[Qm](Y??q,I,!!S,!0)}[nh](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new zl(S.message);__classPrivateFieldGet(this,Sm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,Sm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,_m,`f`)&&(I=__classPrivateFieldGet(this,Sm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,gm,`f`)&&!I?__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,vm,`f`)&&__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,Sm,`f`).limitedChoices(F),__classPrivateFieldGet(this,Sm,`f`).implications(F),__classPrivateFieldGet(this,Sm,`f`).conflicting(F)}}[rh](){__classPrivateFieldSet(this,em,!0,`f`)}[ih](t){if(typeof t==`string`)__classPrivateFieldGet(this,om,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,om,`f`).key[n]=!0}}}),sh,ch=__esmMin(()=>{xp(),oh(),sh=YargsFactory(bp)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var lh=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.49-next.348`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var uh=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,dh=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):fh}function parseNpmrc(t){let n={registry:fh,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var fh,ph=__esmMin(()=>{fh=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var mh=__esmMin(()=>{dh(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var hh=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var gh=__esmMin(()=>{uh(),dh(),ph(),mh()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var vh=__esmMin(()=>{uh(),dh(),mh(),hh()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var yh=__esmMin(()=>{uh(),ph()}),bh=__esmMin(()=>{uh(),dh(),ph(),hh(),gh(),vh(),yh()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return xh===void 0&&(xh=`0.64.49-next.348`),xh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=Hn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=Hn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var xh,Sh=__esmMin(()=>{rf(),Xn(),cr(),bh()}),Ch,wh=__esmMin(()=>{Ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(Th.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${Th.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&Eh[t]===`external-link`}var Th,Eh,Dh,Oh=__esmMin(()=>{Th=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],Eh={flathub:`external-link`,web:`external-link`,"microsoft-store":`none`,"apple-app-store":`store-purchase`},Dh=`GJSIFY_CHANNEL`});function parseDeclaredPricing(t,n){if(!(t===void 0||t===``)){if(kh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a pricing tier. Known: ${kh.join(`, `)}.`)}}var kh,Ah,jh=__esmMin(()=>{kh=[`free`,`paid`],Ah=`GJSIFY_PRICING`}),Mh=__commonJSMin(((t,n)=>{let S=(Xn(),__toCommonJS(Pn)),C=($l(),__toCommonJS(Yl)),N=(rf(),__toCommonJS(tf)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),Nh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),Ph=__commonJSMin(((t,n)=>{let S=Nh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),Fh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(ru(),__toCommonJS(eu)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(Xn(),__toCommonJS(Pn)),H=Mh(),W=Ph();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),Ih=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),Lh=__commonJSMin(((t,n)=>{var S=(Hu(),__toCommonJS(Ru)),C=Ih(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
149
+ `,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+t.join(` `),`f`)}}}[Tm](t){objectKeys(__classPrivateFieldGet(this,om,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,om,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,ym,`f`).getDescriptions()[t]}[Em](t,n,S){__classPrivateFieldGet(this,Yp,`f`)[S]||(__classPrivateFieldGet(this,hm,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Yp,`f`)[S]=!0)}[Dm](){__classPrivateFieldGet(this,Zp,`f`).push({options:__classPrivateFieldGet(this,om,`f`),configObjects:__classPrivateFieldGet(this,om,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Xp,`f`),groups:__classPrivateFieldGet(this,$p,`f`),strict:__classPrivateFieldGet(this,gm,`f`),strictCommands:__classPrivateFieldGet(this,_m,`f`),strictOptions:__classPrivateFieldGet(this,vm,`f`),completionCommand:__classPrivateFieldGet(this,Gp,`f`),output:__classPrivateFieldGet(this,am,`f`),exitError:__classPrivateFieldGet(this,qp,`f`),hasOutput:__classPrivateFieldGet(this,em,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,lm,`f`),parseContext:__classPrivateFieldGet(this,um,`f`)}),__classPrivateFieldGet(this,ym,`f`).freeze(),__classPrivateFieldGet(this,Sm,`f`).freeze(),__classPrivateFieldGet(this,Vp,`f`).freeze(),__classPrivateFieldGet(this,Qp,`f`).freeze()}[Om](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,hm,`f`).process.argv()[0])?__classPrivateFieldGet(this,hm,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,hm,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[$m](__classPrivateFieldGet(this,Hp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,hm,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,hm,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,hm,`f`).path.dirname(__classPrivateFieldGet(this,hm,`f`).process.execPath())}/`,``)),t}[km](){return __classPrivateFieldGet(this,cm,`f`)}[Am](){return __classPrivateFieldGet(this,bm,`f`)}[jm](){if(!__classPrivateFieldGet(this,Jp,`f`))return;let t=__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[Mm](){return this[Pm]().version||`unknown`}[Nm](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,hm,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[Pm](t){let n=t||`*`;if(__classPrivateFieldGet(this,dm,`f`)[n])return __classPrivateFieldGet(this,dm,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,hm,`f`).mainFilename;__classPrivateFieldGet(this,hm,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,hm,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,hm,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,hm,`f`)),S=JSON.parse(__classPrivateFieldGet(this,hm,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,dm,`f`)[n]=S||{},__classPrivateFieldGet(this,dm,`f`)[n]}[Fm](t,n){n=[].concat(n),n.forEach(n=>{n=this[zm](n),__classPrivateFieldGet(this,om,`f`)[t].push(n)})}[Im](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=S})}[Lm](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=(__classPrivateFieldGet(this,om,`f`)[t][n]||[]).concat(S)})}[Rm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[zm](S),C)}[zm](t){return t===`__proto__`?`___proto___`:t}[Bm](t,n){return this[Im](this[Bm].bind(this),`key`,t,n),this}[Vm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Zp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,hm,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,om,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Xp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,$p,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,am,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,qp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,em,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,gm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,_m,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,vm,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,Gp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,lm,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,um,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,om,`f`).configObjects=te,__classPrivateFieldGet(this,ym,`f`).unfreeze(),__classPrivateFieldGet(this,Sm,`f`).unfreeze(),__classPrivateFieldGet(this,Vp,`f`).unfreeze(),__classPrivateFieldGet(this,Qp,`f`).unfreeze()}[Hm](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Um].bind(this),getContext:this[Wm].bind(this),getHasOutput:this[Gm].bind(this),getLoggerInstance:this[Km].bind(this),getParseContext:this[qm].bind(this),getParserConfiguration:this[km].bind(this),getUsageConfiguration:this[Am].bind(this),getUsageInstance:this[Jm].bind(this),getValidationInstance:this[Ym].bind(this),hasParseCallback:this[Xm].bind(this),isGlobalContext:this[Zm].bind(this),postProcess:this[Qm].bind(this),reset:this[eh].bind(this),runValidation:this[nh].bind(this),runYargsParserAndExecuteCommands:this[th].bind(this),setHasOutput:this[rh].bind(this)}}[Um](){return __classPrivateFieldGet(this,Vp,`f`)}[Wm](){return __classPrivateFieldGet(this,Up,`f`)}[Gm](){return __classPrivateFieldGet(this,em,`f`)}[Km](){return __classPrivateFieldGet(this,im,`f`)}[qm](){return __classPrivateFieldGet(this,um,`f`)||{}}[Jm](){return __classPrivateFieldGet(this,ym,`f`)}[Ym](){return __classPrivateFieldGet(this,Sm,`f`)}[Xm](){return!!__classPrivateFieldGet(this,lm,`f`)}[Zm](){return __classPrivateFieldGet(this,nm,`f`)}[Qm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[Cm](t)),(this[km]()[`parse-positional-numbers`]||this[km]()[`parse-positional-numbers`]===void 0)&&(t=this[Nm](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)),t)}[eh](t={}){__classPrivateFieldSet(this,om,__classPrivateFieldGet(this,om,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,om,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,om,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,fm,`f`),Object.keys(__classPrivateFieldGet(this,$p,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,$p,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,$p,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,om,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,om,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,om,`f`).envPrefix,__classPrivateFieldSet(this,om,n,`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`)?__classPrivateFieldGet(this,ym,`f`).reset(S):usage(this,__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Sm,__classPrivateFieldGet(this,Sm,`f`)?__classPrivateFieldGet(this,Sm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Vp,__classPrivateFieldGet(this,Vp,`f`)?__classPrivateFieldGet(this,Vp,`f`).reset():command(__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Sm,`f`),__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Wp,`f`)||__classPrivateFieldSet(this,Wp,completion(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Vp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Qp,`f`).reset(),__classPrivateFieldSet(this,Gp,null,`f`),__classPrivateFieldSet(this,am,``,`f`),__classPrivateFieldSet(this,qp,null,`f`),__classPrivateFieldSet(this,em,!1,`f`),this.parsed=!1,this}[$m](t,n){return __classPrivateFieldGet(this,hm,`f`).path.relative(t,n)}[th](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,pm,`f`),__classPrivateFieldGet(this,om,`f`).__=__classPrivateFieldGet(this,hm,`f`).y18n.__,__classPrivateFieldGet(this,om,`f`).configuration=this[km]();let I=!!__classPrivateFieldGet(this,om,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,om,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,hm,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,om,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,um,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,tm,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,xm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,ym,`f`).clearCachedHelpMessage();try{if(this[jm](),n)return this[Qm](q,I,!!S,!1);__classPrivateFieldGet(this,tm,`f`)&&[__classPrivateFieldGet(this,tm,`f`)].concat(X[__classPrivateFieldGet(this,tm,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,nm,!1,`f`);let H=__classPrivateFieldGet(this,Vp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Wp,`f`)?.completionKey?[__classPrivateFieldGet(this,Wp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Wp,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,Gp,`f`)){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Qm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,Gp,`f`)){t=F;break}!__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,mm,`f`)&&t&&!re&&__classPrivateFieldGet(this,Sm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,Gp,`f`)&&q._.includes(__classPrivateFieldGet(this,Gp,`f`))&&!ne&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Qm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Wp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Wp,`f`).getCompletion(n,(t,n)=>{if(t)throw new zl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,im,`f`).log(t)}),this.exit(0)}),this[Qm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,em,`f`)||(Z?(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,im,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,ym,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,om,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,om,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new zl(W.error.message);if(!ne){let t=this[nh](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!0)),Y=this[Hm](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof zl)__classPrivateFieldGet(this,ym,`f`).fail(t.message,t);else throw t}return this[Qm](Y??q,I,!!S,!0)}[nh](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new zl(S.message);__classPrivateFieldGet(this,Sm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,Sm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,_m,`f`)&&(I=__classPrivateFieldGet(this,Sm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,gm,`f`)&&!I?__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,vm,`f`)&&__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,Sm,`f`).limitedChoices(F),__classPrivateFieldGet(this,Sm,`f`).implications(F),__classPrivateFieldGet(this,Sm,`f`).conflicting(F)}}[rh](){__classPrivateFieldSet(this,em,!0,`f`)}[ih](t){if(typeof t==`string`)__classPrivateFieldGet(this,om,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,om,`f`).key[n]=!0}}}),sh,ch=__esmMin(()=>{xp(),oh(),sh=YargsFactory(bp)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var lh=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.49`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var uh=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,dh=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):fh}function parseNpmrc(t){let n={registry:fh,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var fh,ph=__esmMin(()=>{fh=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var mh=__esmMin(()=>{dh(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var hh=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var gh=__esmMin(()=>{uh(),dh(),ph(),mh()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var vh=__esmMin(()=>{uh(),dh(),mh(),hh()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var yh=__esmMin(()=>{uh(),ph()}),bh=__esmMin(()=>{uh(),dh(),ph(),hh(),gh(),vh(),yh()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return xh===void 0&&(xh=`0.64.49`),xh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=Hn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=Hn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var xh,Sh=__esmMin(()=>{rf(),Xn(),cr(),bh()}),Ch,wh=__esmMin(()=>{Ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(Th.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${Th.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&Eh[t]===`external-link`}var Th,Eh,Dh,Oh=__esmMin(()=>{Th=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],Eh={flathub:`external-link`,web:`external-link`,"microsoft-store":`none`,"apple-app-store":`store-purchase`},Dh=`GJSIFY_CHANNEL`});function parseDeclaredPricing(t,n){if(!(t===void 0||t===``)){if(kh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a pricing tier. Known: ${kh.join(`, `)}.`)}}var kh,Ah,jh=__esmMin(()=>{kh=[`free`,`paid`],Ah=`GJSIFY_PRICING`}),Mh=__commonJSMin(((t,n)=>{let S=(Xn(),__toCommonJS(Pn)),C=($l(),__toCommonJS(Yl)),N=(rf(),__toCommonJS(tf)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),Nh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),Ph=__commonJSMin(((t,n)=>{let S=Nh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),Fh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(ru(),__toCommonJS(eu)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(Xn(),__toCommonJS(Pn)),H=Mh(),W=Ph();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),Ih=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),Lh=__commonJSMin(((t,n)=>{var S=(Hu(),__toCommonJS(Ru)),C=Ih(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
150
150
  `)},set:function(t){S=t}});var F=null,I=Object.getOwnPropertyDescriptor(this,`stack`),H=I.get,W=I.value;delete I.value,delete I.writable,I.set=function(t){F=t},I.get=function(){var t=(F||(H?H.call(this):W)).split(/\r?\n+/g);F||(t[0]=this.name+`: `+this.message);var S=1;for(var C in n)if(n.hasOwnProperty(C)){var N=n[C];if(`line`in N){var I=N.line(this[C]);I&&t.splice(S++,0,` `+I)}`stack`in N&&N.stack(this[C],t)}return t.join(`
151
151
  `)},Object.defineProperty(this,"stack",I)};return Object.setPrototypeOf?(Object.setPrototypeOf(N.prototype,Error.prototype),Object.setPrototypeOf(N,Error)):S.inherits(N,Error),N};N.append=function(t,n){return{message:function(S,C){return S||=n,S&&(C[0]+=` `+t.replace(`%s`,S.toString())),C}}},N.line=function(t,n){return{line:function(S){return S||=n,S?t.replace(`%s`,S.toString()):null}}},n.exports=N})),Rh=__commonJSMin(((t,n)=>{let hexify=t=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return`0x`+(n.length%2?`0`:``)+n},parseError=(t,n,S)=>{if(!n)return{message:t.message+` while parsing empty string`,position:0};let C=t.message.match(/^Unexpected token (.) .*position\s+(\d+)/i),N=C?+C[2]:t.message.match(/^Unexpected end of JSON.*/i)?n.length-1:null,F=C?t.message.replace(/^Unexpected token ./,`Unexpected token ${JSON.stringify(C[1])} (${hexify(C[1])})`):t.message;if(N!=null){let t=N<=S?0:N-S,C=N+S>=n.length?n.length:N+S,I=(t===0?``:`...`)+n.slice(t,C)+(C===n.length?``:`...`);return{message:F+` while parsing ${n===I?``:`near `}${JSON.stringify(I)}`,position:N}}else return{message:F+` while parsing '${n.slice(0,S*2)}'`,position:0}};var JSONParseError=class extends SyntaxError{constructor(t,n,S,C){S||=20;let N=parseError(t,n,S);super(N.message),Object.assign(this,N),this.code=`EJSONPARSE`,this.systemError=t,Error.captureStackTrace(this,C||this.constructor)}get name(){return this.constructor.name}set name(t){}get[Symbol.toStringTag](){return this.constructor.name}};let S=Symbol.for(`indent`),C=Symbol.for(`newline`),N=/^\s*[{\[]((?:\r?\n)+)([\s\t]*)/,F=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,parseJson=(t,n,I)=>{let H=stripBOM(t);I||=20;try{let[,t=`
152
152
  `,I=` `]=H.match(F)||H.match(N)||[,``,``],W=JSON.parse(H,n);return W&&typeof W==`object`&&(W[C]=t,W[S]=I),W}catch(n){if(typeof t!=`string`&&!Buffer.isBuffer(t)){let S=Array.isArray(t)&&t.length===0;throw Object.assign(TypeError(`Cannot parse ${S?`an empty array`:String(t)}`),{code:`EJSONPARSE`,systemError:n})}throw new JSONParseError(n,H,I,parseJson)}},stripBOM=t=>String(t).replace(/^\uFEFF/,``);n.exports=parseJson,parseJson.JSONParseError=JSONParseError,parseJson.noExceptions=(t,n)=>{try{return JSON.parse(stripBOM(t),n)}catch{}}})),zh=__commonJSMin((t=>{t.__esModule=!0,t.LinesAndColumns=void 0;var n=`
@@ -649,7 +649,7 @@ Project '${t.projectName}' (${zh[t.projectKind]}) ${n}
649
649
  Additional information: BADCLIENT: Bad error code, ${q} not found in range ${F}..${I} (found: ${W.join(`, `)})`),N}return n?H.map(t=>this.mapCodeFixAction(t)):H}getCombinedCodeFix({scope:t,fixId:n},S){Q.assert(t.type===`file`);let{file:C,project:N}=this.getFileAndProject(t.args),F=N.getLanguageService().getCombinedCodeFix({type:`file`,fileName:C},n,this.getFormatOptions(C),this.getPreferences(C));return S?{changes:this.mapTextChangesToCodeEdits(F.changes),commands:F.commands}:F}applyCodeActionCommand(t){let n=t.command;for(let t of toArray(n)){let{file:n,project:S}=this.getFileAndProject(t);S.getLanguageService().applyCodeActionCommand(t,this.getFormatOptions(n)).then(t=>{},t=>{})}return{}}getStartAndEndPosition(t,n){let S,C;return t.startPosition===void 0?(S=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=S):S=t.startPosition,t.endPosition===void 0?(C=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=C):C=t.endPosition,{startPosition:S,endPosition:C}}mapCodeAction({description:t,changes:n,commands:S}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:S}}mapCodeFixAction({fixName:t,description:n,changes:S,commands:C,fixId:N,fixAllDescription:F}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(S),commands:C,fixId:N,fixAllDescription:F}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(t=>this.mapTextChangeToCodeEdit(t))}mapTextChangeToCodeEdit(t){let n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),Q.fail(`Expected isNewFile for (only) new files. `+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(t=>convertTextChangeToCodeEdit(t,n))}:convertNewFileTextChangeToCodeEdit(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:``}}getBraceMatching(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getPosition(t,N),I=C.getBraceMatchingAtPosition(S,F);return I?n?I.map(t=>toProtocolTextSpan(t,N)):I:void 0}getDiagnosticsForProject(t,n,S){if(this.suppressDiagnosticEvents)return;let{fileNames:C,languageServiceDisabled:N}=this.getProjectInfoWorker(S,void 0,!0,void 0,!0);if(N)return;let F=C.filter(t=>!t.includes(`lib.d.ts`));if(F.length===0)return;let I=[],H=[],W=[],q=[],Y=toNormalizedPath(S),X=this.projectService.ensureDefaultProjectForFile(Y);for(let t of F)this.getCanonicalFileName(t)===this.getCanonicalFileName(S)?I.push(t):this.projectService.getScriptInfo(t).isScriptOpen()?H.push(t):isDeclarationFileName(t)?q.push(t):W.push(t);let Z=[...I,...H,...W,...q].map(t=>({fileName:t,project:X}));this.updateErrorCheck(t,Z,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){let{locations:S}=t,{file:C,languageService:N}=this.getFileAndLanguageServiceForSyntacticOperation(t),F=Q.checkDefined(this.projectService.getScriptInfo(C));return map(S,t=>{let S=this.getPosition(t,F),I=N.getSmartSelectionRange(C,S);return n?this.mapSelectionRange(I,F):I})}toggleLineComment(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfo(S),F=this.getRange(t,N),I=C.toggleLineComment(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}toggleMultilineComment(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.toggleMultilineComment(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}commentSelection(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.commentSelection(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}uncommentSelection(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.uncommentSelection(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}mapSelectionRange(t,n){let S={textSpan:toProtocolTextSpan(t.textSpan,n)};return t.parent&&(S.parent=this.mapSelectionRange(t.parent,n)),S}getScriptInfoFromProjectService(t){let n=toNormalizedPath(t);return this.projectService.getScriptInfoForNormalizedPath(n)||(this.projectService.logErrorForScriptInfoNotFound(n),Th.ThrowNoProject())}toProtocolCallHierarchyItem(t){let n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:toProtocolTextSpan(t.span,n),selectionSpan:toProtocolTextSpan(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){let n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(t=>toProtocolTextSpan(t,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(t=>toProtocolTextSpan(t,n))}}prepareCallHierarchy(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.projectService.getScriptInfoForNormalizedPath(n);if(C){let N=this.getPosition(t,C),F=S.getLanguageService().prepareCallHierarchy(n,N);return F&&mapOneOrMany(F,t=>this.toProtocolCallHierarchyItem(t))}}provideCallHierarchyIncomingCalls(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.getScriptInfoFromProjectService(n);return S.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,C)).map(t=>this.toProtocolCallHierarchyIncomingCall(t))}provideCallHierarchyOutgoingCalls(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.getScriptInfoFromProjectService(n);return S.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,C)).map(t=>this.toProtocolCallHierarchyOutgoingCall(t,C))}getCanonicalFileName(t){return normalizePath(this.host.useCaseSensitiveFileNames?t:toFileNameLowerCase(t))}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){Q.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){Q.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,S){let C=this.performanceData;try{return this.performanceData=S,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=C}}executeCommand(t){let n=this.handlers.get(t.command);if(n){let S=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),S}else return this.logger.msg(`Unrecognized JSON command:${stringifyIndented(t)}`,`Err`),this.doOutput(void 0,`unknown`,t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,S,C,N,F,I,H;this.gcTimer.scheduleCollect();let W,q=this.performanceData;this.logger.hasLevel(2)&&(W=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${indent2(this.toStringMessage(t))}`));let Y,X;try{Y=this.parseMessage(t),X=Y.arguments&&Y.arguments.file?Y.arguments:void 0,(n=Ie)==null||n.instant(Ie.Phase.Session,`request`,{seq:Y.seq,command:Y.command}),(S=Ie)==null||S.push(Ie.Phase.Session,`executeCommand`,{seq:Y.seq,command:Y.command},!0);let{response:F,responseRequired:I,performanceData:H}=this.executeCommand(Y);if((C=Ie)==null||C.pop(),this.logger.hasLevel(2)){let t=hrTimeToMilliseconds(this.hrtime(W)).toFixed(4);I?this.logger.perftrc(`${Y.seq}::${Y.command}: elapsed time (in milliseconds) ${t}`):this.logger.perftrc(`${Y.seq}::${Y.command}: async elapsed time (in milliseconds) ${t}`)}(N=Ie)==null||N.instant(Ie.Phase.Session,`response`,{seq:Y.seq,command:Y.command,success:!!F}),F?this.doOutput(F,Y.command,Y.seq,!0,H):I&&this.doOutput(void 0,Y.command,Y.seq,!1,H,`No content available.`)}catch(n){if((F=Ie)==null||F.popAll(),n instanceof OperationCanceledException){(I=Ie)==null||I.instant(Ie.Phase.Session,`commandCanceled`,{seq:Y?.seq,command:Y?.command}),this.doOutput({canceled:!0},Y.command,Y.seq,!0,this.performanceData);return}this.logErrorWorker(n,this.toStringMessage(t),X),(H=Ie)==null||H.instant(Ie.Phase.Session,`commandError`,{seq:Y?.seq,command:Y?.command,message:n.message}),this.doOutput(void 0,Y?Y.command:`unknown`,Y?Y.seq:0,!1,this.performanceData,`Error processing request. `+n.message+`
650
650
  `+n.stack)}finally{this.performanceData=q}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function toProtocolPerformanceData(t){let n=t.diagnosticsDuration&&arrayFrom(t.diagnosticsDuration,([t,n])=>({...n,file:t}));return{...t,diagnosticsDuration:n}}function toProtocolTextSpan(t,n){return{start:n.positionToLineOffset(t.start),end:n.positionToLineOffset(textSpanEnd(t))}}function toProtocolTextSpanWithContext(t,n,S){let C=toProtocolTextSpan(t,S),N=n&&toProtocolTextSpan(n,S);return N?{...C,contextStart:N.start,contextEnd:N.end}:C}function convertTextChangeToCodeEdit(t,n){return{start:positionToLineOffset(n,t.span.start),end:positionToLineOffset(n,textSpanEnd(t.span)),newText:t.newText}}function positionToLineOffset(t,n){return isConfigFile(t)?locationFromLineAndCharacter(t.getLineAndCharacterOfPosition(n)):t.positionToLineOffset(n)}function convertLinkedEditInfoToRanges(t,n){let S=t.ranges.map(t=>({start:n.positionToLineOffset(t.start),end:n.positionToLineOffset(t.start+t.length)}));return t.wordPattern?{ranges:S,wordPattern:t.wordPattern}:{ranges:S}}function locationFromLineAndCharacter(t){return{line:t.line+1,offset:t.character+1}}function convertNewFileTextChangeToCodeEdit(t){Q.assert(t.textChanges.length===1);let n=first(t.textChanges);return Q.assert(n.span.start===0&&n.span.length===0),{fileName:t.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:n.newText}]}}function getLocationInNewDocument(t,n,S,C){let{line:N,character:F}=computeLineAndCharacterOfPosition(computeLineStarts(applyEdits(t,n,C)),S);return{line:N+1,offset:F+1}}function applyEdits(t,n,S){for(let{fileName:C,textChanges:N}of S)if(C===n)for(let n=N.length-1;n>=0;n--){let{newText:S,span:{start:C,length:F}}=N[n];t=t.slice(0,C)+S+t.slice(C+F)}return t}function referenceEntryToReferencesResponseItem(t,{fileName:n,textSpan:S,contextSpan:C,isWriteAccess:N,isDefinition:F},{disableLineTextInReferences:I}){let H=Q.checkDefined(t.getScriptInfo(n)),W=toProtocolTextSpanWithContext(S,C,H),q=I?void 0:getLineText(H,W);return{file:n,...W,lineText:q,isWriteAccess:N,isDefinition:F}}function getLineText(t,n){let S=t.lineToTextSpan(n.start.line-1);return t.getSnapshot().getText(S.start,textSpanEnd(S)).replace(/\r|\n/g,``)}function isCompletionEntryData(t){return t===void 0||t&&typeof t==`object`&&typeof t.exportName==`string`&&(t.fileName===void 0||typeof t.fileName==`string`)&&(t.ambientModuleName===void 0||typeof t.ambientModuleName==`string`&&(t.isPackageJsonImport===void 0||typeof t.isPackageJsonImport==`boolean`))}var yg=4,bg=(t=>(t[t.PreStart=0]=`PreStart`,t[t.Start=1]=`Start`,t[t.Entire=2]=`Entire`,t[t.Mid=3]=`Mid`,t[t.End=4]=`End`,t[t.PostEnd=5]=`PostEnd`,t))(bg||{}),EditWalker=class{constructor(){this.goSubtree=!0,this.lineIndex=new wg,this.endBranch=[],this.state=2,this.initialText=``,this.trailingText=``,this.lineIndex.root=new Tg,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(t,n){n&&(this.trailingText=``),t=t?this.initialText+t+this.trailingText:this.initialText+this.trailingText;let S=wg.linesFromText(t).lines;S.length>1&&S[S.length-1]===``&&S.pop();let C,N;for(let t=this.endBranch.length-1;t>=0;t--)this.endBranch[t].updateCounts(),this.endBranch[t].charCount()===0&&(N=this.endBranch[t],C=t>0?this.endBranch[t-1]:this.branchNode);N&&C.remove(N);let F=this.startPath[this.startPath.length-1];if(S.length>0)if(F.text=S[0],S.length>1){let t=Array(S.length-1),n=F;for(let n=1;n<S.length;n++)t[n-1]=new LineLeaf(S[n]);let C=this.startPath.length-2;for(;C>=0;){let S=this.startPath[C];t=S.insertAt(n,t),C--,n=S}let N=t.length;for(;N>0;){let n=new Tg;n.add(this.lineIndex.root),t=n.insertAt(this.lineIndex.root,t),N=t.length,this.lineIndex.root=n}this.lineIndex.root.updateCounts()}else for(let t=this.startPath.length-2;t>=0;t--)this.startPath[t].updateCounts();else{this.startPath[this.startPath.length-2].remove(F);for(let t=this.startPath.length-2;t>=0;t--)this.startPath[t].updateCounts()}return this.lineIndex}post(t,n,S){S===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(t,n,S,C,N){let F=this.stack[this.stack.length-1];this.state===2&&N===1&&(this.state=1,this.branchNode=F,this.lineCollectionAtBranch=S);let I;function fresh(t){return t.isLeaf()?new LineLeaf(``):new Tg}switch(N){case 0:this.goSubtree=!1,this.state!==4&&F.add(S);break;case 1:this.state===4?this.goSubtree=!1:(I=fresh(S),F.add(I),this.startPath.push(I));break;case 2:this.state===4?S.isLeaf()||(I=fresh(S),F.add(I),this.endBranch.push(I)):(I=fresh(S),F.add(I),this.startPath.push(I));break;case 3:this.goSubtree=!1;break;case 4:this.state===4?S.isLeaf()||(I=fresh(S),F.add(I),this.endBranch.push(I)):this.goSubtree=!1;break;case 5:this.goSubtree=!1,this.state!==1&&F.add(S);break}this.goSubtree&&this.stack.push(I)}leaf(t,n,S){this.state===1?this.initialText=S.text.substring(0,t):(this.state===2&&(this.initialText=S.text.substring(0,t)),this.trailingText=S.text.substring(t+n))}},TextChange9=class{constructor(t,n,S){this.pos=t,this.deleteLen=n,this.insertedText=S}getTextChangeRange(){return createTextChangeRange(createTextSpan(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},xg=class _ScriptVersionCache{constructor(){this.changes=[],this.versions=Array(_ScriptVersionCache.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%_ScriptVersionCache.maxVersions}currentVersionToIndex(){return this.currentVersion%_ScriptVersionCache.maxVersions}edit(t,n,S){this.changes.push(new TextChange9(t,n,S)),(this.changes.length>_ScriptVersionCache.changeNumberThreshold||n>_ScriptVersionCache.changeLengthThreshold||S&&S.length>_ScriptVersionCache.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(let t of this.changes)n=n.edit(t.pos,t.deleteLen,t.insertedText);t=new Cg(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=_ScriptVersionCache.maxVersions&&(this.minVersion=this.currentVersion-_ScriptVersionCache.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let n=this._getSnapshot().index,{lineText:S,absolutePosition:C}=n.lineNumberToInfo(t+1);return createTextSpan(C,S===void 0?n.absolutePositionOfStartOfLine(t+2)-C:S.length)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){let S=[];for(let C=t+1;C<=n;C++){let t=this.versions[this.versionToIndex(C)];for(let n of t.changesSincePreviousVersion)S.push(n.getTextChangeRange())}return collapseTextChangeRangesAcrossMultipleVersions(S)}else return;else return Jn}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let n=new _ScriptVersionCache,S=new Cg(0,n,new wg);n.versions[n.currentVersion]=S;let C=wg.linesFromText(t);return S.index.load(C.lines),n}};xg.changeNumberThreshold=8,xg.changeLengthThreshold=256,xg.maxVersions=8;var Sg=xg,Cg=class _LineIndexSnapshot{constructor(t,n,S,C=Ch){this.version=t,this.cache=n,this.index=S,this.changesSincePreviousVersion=C}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof _LineIndexSnapshot&&this.cache===t.cache)return this.version<=t.version?Jn:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},wg=class _LineIndex{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:n,zeroBasedColumn:S}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:S+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){if(t<=this.getLineCount()){let{position:n,leaf:S}=this.root.lineNumberToInfo(t,0);return{absolutePosition:n,lineText:S&&S.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let n=[];for(let S=0;S<t.length;S++)n[S]=new LineLeaf(t[S]);this.root=_LineIndex.buildTreeFromBottom(n)}else this.root=new Tg}walk(t,n,S){this.root.walk(t,n,S)}getText(t,n){let S=``;return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(t,n,C)=>{S=S.concat(C.text.substring(t,t+n))}}),S}getLength(){return this.root.charCount()}every(t,n,S){S||=this.root.charCount();let C={goSubtree:!0,done:!1,leaf(n,S,C){t(C,n,S)||(this.done=!0)}};return this.walk(n,S-n,C),!C.done}edit(t,n,S){if(this.root.charCount()===0)return Q.assert(n===0),S===void 0?void 0:(this.load(_LineIndex.linesFromText(S).lines),this);{let C;if(this.checkEdits){let N=this.getText(0,this.root.charCount());C=N.slice(0,t)+S+N.slice(t+n)}let N=new EditWalker,F=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let C=this.getText(t,1);S=S?C+S:C,n=0,F=!0}else if(n>0){let C=t+n,{zeroBasedColumn:N,lineText:F}=this.positionToColumnAndLineText(C);N===0&&(n+=F.length,S=S?S+F:F)}if(this.root.walk(t,n,N),N.insertLines(S,F),this.checkEdits){let t=N.lineIndex.getText(0,N.lineIndex.getLength());Q.assert(C===t,`buffer edit mismatch`)}return N.lineIndex}}static buildTreeFromBottom(t){if(t.length<yg)return new Tg(t);let n=Array(Math.ceil(t.length/yg)),S=0;for(let C=0;C<n.length;C++){let N=Math.min(S+yg,t.length);n[C]=new Tg(t.slice(S,N)),S=N}return this.buildTreeFromBottom(n)}static linesFromText(t){let n=computeLineStarts(t);if(n.length===0)return{lines:[],lineMap:n};let S=Array(n.length),C=n.length-1;for(let N=0;N<C;N++)S[N]=t.substring(n[N],n[N+1]);let N=t.substring(n[C]);return N.length>0?S[C]=N:S.pop(),{lines:S,lineMap:n}}},Tg=class _LineNode{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,S,C,N){return S.pre&&S.pre(t,n,this.children[C],this,N),S.goSubtree?(this.children[C].walk(t,n,S),S.post&&S.post(t,n,this.children[C],this,N)):S.goSubtree=!0,S.done}skipChild(t,n,S,C,N){C.pre&&!C.done&&(C.pre(t,n,this.children[S],this,N),C.goSubtree=!0)}walk(t,n,S){if(this.children.length===0)return;let C=0,N=this.children[C].charCount(),F=t;for(;F>=N;)this.skipChild(F,n,C,S,0),F-=N,C++,N=this.children[C].charCount();if(F+n<=N){if(this.execWalk(F,n,S,C,2))return}else{if(this.execWalk(F,N-F,S,C,1))return;let t=n-(N-F);for(C++,N=this.children[C].charCount();t>N;){if(this.execWalk(0,N,S,C,3))return;t-=N,C++,N=this.children[C].charCount()}if(t>0&&this.execWalk(0,t,S,C,4))return}if(S.pre){let t=this.children.length;if(C<t-1)for(let n=C+1;n<t;n++)this.skipChild(0,0,n,S,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(let S of this.children)if(S.charCount()>n)return S.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:S.text}:S.charOffsetToLineInfo(t,n);else n-=S.charCount(),t+=S.lineCount();let S=this.lineCount();return S===0?{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0}:{oneBasedLine:S,zeroBasedColumn:Q.checkDefined(this.lineNumberToInfo(S,0).leaf).charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(let S of this.children){let C=S.lineCount();if(C>=t)return S.isLeaf()?{position:n,leaf:S}:S.lineNumberToInfo(t,n);t-=C,n+=S.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n,S=this.children.length;t++;let C=t;if(t<S){for(n=new _LineNode;t<S;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=C,n}remove(t){let n=this.findChildIndex(t),S=this.children.length;if(n<S-1)for(let t=n;t<S-1;t++)this.children[t]=this.children[t+1];this.children.pop()}findChildIndex(t){let n=this.children.indexOf(t);return Q.assert(n!==-1),n}insertAt(t,n){let S=this.findChildIndex(t),C=this.children.length,N=n.length;if(C<yg&&S===C-1&&N===1)return this.add(n[0]),this.updateCounts(),[];{let t=this.splitAfter(S),C=0;for(S++;S<yg&&C<N;)this.children[S]=n[C],S++,C++;let F=[],I=0;if(C<N){I=Math.ceil((N-C)/yg),F=Array(I);let t=0;for(let t=0;t<I;t++)F[t]=new _LineNode;let S=F[0];for(;C<N;)S.add(n[C]),C++,S.children.length===yg&&(t++,S=F[t]);for(let t=F.length-1;t>=0;t--)F[t].children.length===0&&F.pop()}t&&F.push(t),this.updateCounts();for(let t=0;t<I;t++)F[t].updateCounts();return F}}add(t){this.children.push(t),Q.assert(this.children.length<=yg)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},LineLeaf=class{constructor(t){this.text=t}isLeaf(){return!0}walk(t,n,S){S.leaf(t,n,this)}charCount(){return this.text.length}lineCount(){return 1}},Eg=class _TypingsInstallerAdapter{constructor(t,n,S,C,N,F){this.telemetryEnabled=t,this.logger=n,this.host=S,this.globalTypingsCacheLocation=C,this.event=N,this.maxActiveRequestCount=F,this.activeRequestCount=0,this.requestQueue=createQueue(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){return ec.validatePackageName(t)===ec.NameValidationResult.Ok?(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:`typesRegistry`})),!!this.typesRegistryCache?.has(t)):!1}installPackage(t){this.packageInstallId++;let n={kind:`installPackage`,...t,id:this.packageInstallId},S=new Promise((t,n)=>{(this.packageInstalledPromise??=new Map).set(this.packageInstallId,{resolve:t,reject:n})});return this.installer.send(n),S}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:`closeProject`})}enqueueInstallTypingsRequest(t,n,S){let C=createInstallTypingsRequest(t,n,S);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(C)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(C):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${C.projectName}`),this.requestQueue.enqueue(C),this.requestMap.set(C.projectName,C))}handleMessage(t){var n;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${stringifyIndented(t)}`),t.kind){case ic:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case rc:{let S=this.packageInstalledPromise?.get(t.id);Q.assertIsDefined(S,`Should find the promise for package install`),(n=this.packageInstalledPromise)==null||n.delete(t.id),t.success?S.resolve({successMessage:t.message}):S.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,`setTypings`);break}case sc:{let n={message:t.message};this.event(n,`typesInstallerInitializationFailed`);break}case ac:{let n={eventId:t.eventId,packages:t.packagesToInstall};this.event(n,`beginInstallTypes`);break}case oc:{if(this.telemetryEnabled){let n={telemetryEventName:`typingsInstalled`,payload:{installedPackages:t.packagesToInstall.join(`,`),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(n,`telemetry`)}let n={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(n,`endInstallTypes`);break}case nc:this.projectService.updateTypingsForProject(t);break;case tc:for(this.activeRequestCount>0?this.activeRequestCount--:Q.fail(`TIAdapter:: Received too many responses`);!this.requestQueue.isEmpty();){let t=this.requestQueue.dequeue();if(this.requestMap.get(t.projectName)===t){this.requestMap.delete(t.projectName),this.scheduleRequest(t);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${t.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,`setTypings`);break;case cc:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(t)}`),this.installer.send(t)},_TypingsInstallerAdapter.requestDelayMillis,`${t.projectName}::${t.kind}`)}};Eg.requestDelayMillis=100;var Dg=Eg,Og={};__export(Og,{ActionInvalidate:()=>nc,ActionPackageInstalled:()=>rc,ActionSet:()=>tc,ActionWatchTypingLocations:()=>cc,Arguments:()=>lc,AutoImportProviderProject:()=>Hh,AuxiliaryProject:()=>AuxiliaryProject,CharRangeSection:()=>bg,CloseFileWatcherEvent:()=>tg,CommandNames:()=>hg,ConfigFileDiagEvent:()=>Yh,ConfiguredProject:()=>ConfiguredProject2,ConfiguredProjectLoadKind:()=>dg,CreateDirectoryWatcherEvent:()=>eg,CreateFileWatcherEvent:()=>$h,Errors:()=>Th,EventBeginInstallTypes:()=>ac,EventEndInstallTypes:()=>oc,EventInitializationFailed:()=>sc,EventTypesRegistry:()=>ic,ExternalProject:()=>ExternalProject,GcTimer:()=>Dh,InferredProject:()=>InferredProject2,LargeFileReferencedEvent:()=>Jh,LineIndex:()=>wg,LineLeaf:()=>LineLeaf,LineNode:()=>Tg,LogLevel:()=>Sh,Msg:()=>wh,OpenFileInfoTelemetryEvent:()=>Qh,Project:()=>Bh,ProjectInfoTelemetryEvent:()=>Zh,ProjectKind:()=>zh,ProjectLanguageServiceStateEvent:()=>Xh,ProjectLoadingFinishEvent:()=>qh,ProjectLoadingStartEvent:()=>Kh,ProjectService:()=>pg,ProjectsUpdatedInBackgroundEvent:()=>Gh,ScriptInfo:()=>ScriptInfo,ScriptVersionCache:()=>Sg,Session:()=>vg,TextStorage:()=>TextStorage,ThrottledOperations:()=>Eh,TypingsInstallerAdapter:()=>Dg,allFilesAreJsOrDts:()=>allFilesAreJsOrDts,allRootFilesAreJsOrDts:()=>allRootFilesAreJsOrDts,asNormalizedPath:()=>asNormalizedPath,convertCompilerOptions:()=>convertCompilerOptions,convertFormatOptions:()=>convertFormatOptions,convertScriptKindName:()=>convertScriptKindName,convertTypeAcquisition:()=>convertTypeAcquisition,convertUserPreferences:()=>convertUserPreferences,convertWatchOptions:()=>convertWatchOptions,countEachFileTypes:()=>countEachFileTypes,createInstallTypingsRequest:()=>createInstallTypingsRequest,createModuleSpecifierCache:()=>createModuleSpecifierCache,createNormalizedPathMap:()=>createNormalizedPathMap,createPackageJsonCache:()=>createPackageJsonCache,createSortedArray:()=>createSortedArray2,emptyArray:()=>Ch,findArgument:()=>findArgument,formatDiagnosticToProtocol:()=>formatDiagnosticToProtocol,formatMessage:()=>formatMessage2,getBaseConfigFileName:()=>getBaseConfigFileName,getDetailWatchInfo:()=>getDetailWatchInfo,getLocationInNewDocument:()=>getLocationInNewDocument,hasArgument:()=>hasArgument,hasNoTypeScriptSource:()=>hasNoTypeScriptSource,indent:()=>indent2,isBackgroundProject:()=>isBackgroundProject,isConfigFile:()=>isConfigFile,isConfiguredProject:()=>isConfiguredProject,isDynamicFileName:()=>isDynamicFileName,isExternalProject:()=>isExternalProject,isInferredProject:()=>isInferredProject,isInferredProjectName:()=>isInferredProjectName,isProjectDeferredClose:()=>isProjectDeferredClose,makeAutoImportProviderProjectName:()=>makeAutoImportProviderProjectName,makeAuxiliaryProjectName:()=>makeAuxiliaryProjectName,makeInferredProjectName:()=>makeInferredProjectName,maxFileSize:()=>Wh,maxProgramSizeForNonTsFiles:()=>Uh,normalizedPathToPath:()=>normalizedPathToPath,nowString:()=>nowString,nullCancellationToken:()=>mg,nullTypingsInstaller:()=>lg,protocol:()=>Oh,scriptInfoIsContainedByBackgroundProject:()=>scriptInfoIsContainedByBackgroundProject,scriptInfoIsContainedByDeferredClosedProject:()=>scriptInfoIsContainedByDeferredClosedProject,stringifyIndented:()=>stringifyIndented,toEvent:()=>toEvent,toNormalizedPath:()=>toNormalizedPath,tryConvertScriptKindName:()=>tryConvertScriptKindName,typingsInstaller:()=>bh,updateProjectIfDirty:()=>updateProjectIfDirty}),ge!==void 0&&(Q.loggingHost={log(t,n){switch(t){case 1:return ge.error(n);case 2:return ge.warn(n);case 3:return ge.log(n);case 4:return ge.log(n)}}})})({get exports(){return I},set exports(t){I=t,n!==void 0&&n.exports&&(n.exports=t)}})})),w_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadTs=t.loadTsSync=t.loadYaml=t.loadJson=t.loadJs=t.loadJsSync=void 0;let S=(rf(),__toCommonJS(tf)),C=(Bd(),__toCommonJS(Ld)),N=n((Xn(),__toCommonJS(Pn))),F=(cr(),__toCommonJS(Zn)),I=(hl(),__toCommonJS(pl)),H;t.loadJsSync=function loadJsSync(t){return H===void 0&&(H=Fh()),H(t)},t.loadJs=async function loadJs(n){try{let{href:t}=(0,F.pathToFileURL)(await(0,C.realpath)(n));return(await import(t)).default}catch(S){try{return(0,t.loadJsSync)(n,``)}catch(t){throw t.code===`ERR_REQUIRE_ESM`||t instanceof SyntaxError&&t.toString().includes(`Cannot use import statement outside a module`)?S:t}}};let W;t.loadJson=function loadJson(t,n){W===void 0&&(W=Kh());try{return W(n)}catch(n){throw n.message=`JSON Error in ${t}:\n${n.message}`,n}};let q;t.loadYaml=function loadYaml(t,n){q===void 0&&(q=_g());try{return q.load(n)}catch(n){throw n.message=`YAML Error in ${t}:\n${n.message}`,n}};let Y;t.loadTsSync=function loadTsSync(n,C){Y===void 0&&(Y=C_());let F=`${n}.${(0,I.randomUUID)()}.cjs`;try{let I=resolveTsConfig(N.default.dirname(n))??{};return I.compilerOptions={...I.compilerOptions,module:Y.ModuleKind.NodeNext,moduleResolution:Y.ModuleResolutionKind.NodeNext,target:Y.ScriptTarget.ES2022,noEmit:!1},C=Y.transpileModule(C,I).outputText,(0,S.writeFileSync)(F,C),(0,t.loadJsSync)(F,C).default}catch(t){throw t.message=`TypeScript Error in ${n}:\n${t.message}`,t}finally{(0,S.existsSync)(F)&&(0,S.rmSync)(F)}},t.loadTs=async function loadTs(n,F){Y===void 0&&(Y=(await Promise.resolve().then(()=>__toESM(C_()))).default);let H=`${n}.${(0,I.randomUUID)()}.mjs`,W;try{try{let t=resolveTsConfig(N.default.dirname(n))??{};t.compilerOptions={...t.compilerOptions,module:Y.ModuleKind.ES2022,moduleResolution:Y.ModuleResolutionKind.Bundler,target:Y.ScriptTarget.ES2022,noEmit:!1},W=Y.transpileModule(F,t).outputText,await(0,C.writeFile)(H,W)}catch(t){throw t.message=`TypeScript Error in ${n}:\n${t.message}`,t}return await(0,t.loadJs)(H,W)}finally{(0,S.existsSync)(H)&&await(0,C.rm)(H)}};function resolveTsConfig(t){let n=Y.findConfigFile(t,t=>Y.sys.fileExists(t));if(n!==void 0){let{config:t,error:S}=Y.readConfigFile(n,t=>Y.sys.readFile(t));if(S)throw Error(`Error in ${n}: ${S.messageText.toString()}`);return t}}})),T_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.metaSearchPlaces=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=void 0,t.getDefaultSearchPlaces=getDefaultSearchPlaces,t.getDefaultSearchPlacesSync=getDefaultSearchPlacesSync;let n=w_();function getDefaultSearchPlaces(t){return[`package.json`,`.${t}rc`,`.${t}rc.json`,`.${t}rc.yaml`,`.${t}rc.yml`,`.${t}rc.js`,`.${t}rc.ts`,`.${t}rc.cjs`,`.${t}rc.mjs`,`.config/${t}rc`,`.config/${t}rc.json`,`.config/${t}rc.yaml`,`.config/${t}rc.yml`,`.config/${t}rc.js`,`.config/${t}rc.ts`,`.config/${t}rc.cjs`,`.config/${t}rc.mjs`,`${t}.config.js`,`${t}.config.ts`,`${t}.config.cjs`,`${t}.config.mjs`]}function getDefaultSearchPlacesSync(t){return[`package.json`,`.${t}rc`,`.${t}rc.json`,`.${t}rc.yaml`,`.${t}rc.yml`,`.${t}rc.js`,`.${t}rc.ts`,`.${t}rc.cjs`,`.config/${t}rc`,`.config/${t}rc.json`,`.config/${t}rc.yaml`,`.config/${t}rc.yml`,`.config/${t}rc.js`,`.config/${t}rc.ts`,`.config/${t}rc.cjs`,`${t}.config.js`,`${t}.config.ts`,`${t}.config.cjs`]}t.globalConfigSearchPlaces=[`config`,`config.json`,`config.yaml`,`config.yml`,`config.js`,`config.ts`,`config.cjs`,`config.mjs`],t.globalConfigSearchPlacesSync=[`config`,`config.json`,`config.yaml`,`config.yml`,`config.js`,`config.ts`,`config.cjs`],t.metaSearchPlaces=[`package.json`,`package.yaml`,`.config/config.json`,`.config/config.yaml`,`.config/config.yml`,`.config/config.js`,`.config/config.ts`,`.config/config.cjs`,`.config/config.mjs`],t.defaultLoaders=Object.freeze({".mjs":n.loadJs,".cjs":n.loadJs,".js":n.loadJs,".ts":n.loadTs,".json":n.loadJson,".yaml":n.loadYaml,".yml":n.loadYaml,noExt:n.loadYaml}),t.defaultLoadersSync=Object.freeze({".cjs":n.loadJsSync,".js":n.loadJsSync,".ts":n.loadTsSync,".json":n.loadJson,".yaml":n.loadYaml,".yml":n.loadYaml,noExt:n.loadYaml})})),E_=__commonJSMin(((t,n)=>{let S=(Xn(),__toCommonJS(Pn)),C=(a_(),__toCommonJS(Zg)),N=C.homedir(),F=C.tmpdir(),{env:I}=process,macos=t=>{let n=S.join(N,`Library`);return{data:S.join(n,`Application Support`,t),config:S.join(n,`Preferences`,t),cache:S.join(n,`Caches`,t),log:S.join(n,`Logs`,t),temp:S.join(F,t)}},windows=t=>{let n=I.APPDATA||S.join(N,`AppData`,`Roaming`),C=I.LOCALAPPDATA||S.join(N,`AppData`,`Local`);return{data:S.join(C,t,`Data`),config:S.join(n,t,`Config`),cache:S.join(C,t,`Cache`),log:S.join(C,t,`Log`),temp:S.join(F,t)}},linux=t=>{let n=S.basename(N);return{data:S.join(I.XDG_DATA_HOME||S.join(N,`.local`,`share`),t),config:S.join(I.XDG_CONFIG_HOME||S.join(N,`.config`),t),cache:S.join(I.XDG_CACHE_HOME||S.join(N,`.cache`),t),log:S.join(I.XDG_STATE_HOME||S.join(N,`.local`,`state`),t),temp:S.join(F,n,t)}},envPaths=(t,n)=>{if(typeof t!=`string`)throw TypeError(`Expected string, got ${typeof t}`);return n=Object.assign({suffix:`nodejs`},n),n.suffix&&(t+=`-${n.suffix}`),process.platform===`darwin`?macos(t):process.platform===`win32`?windows(t):linux(t)};n.exports=envPaths,n.exports.default=envPaths})),D_=__commonJSMin((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,S,C){C===void 0&&(C=S);var N=Object.getOwnPropertyDescriptor(n,S);(!N||(`get`in N?!n.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return n[S]}}),Object.defineProperty(t,C,N)}):(function(t,n,S,C){C===void 0&&(C=S),t[C]=n[S]})),S=t&&t.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),C=t&&t.__importStar||(function(){var ownKeys=function(t){return ownKeys=Object.getOwnPropertyNames||function(t){var n=[];for(var S in t)Object.prototype.hasOwnProperty.call(t,S)&&(n[n.length]=S);return n},ownKeys(t)};return function(t){if(t&&t.__esModule)return t;var C={};if(t!=null)for(var N=ownKeys(t),F=0;F<N.length;F++)N[F]!=="default"&&n(C,t,N[F]);return S(C,t),C}})();Object.defineProperty(t,"__esModule",{value:!0}),t.emplace=emplace,t.getPropertyByPath=getPropertyByPath,t.removeUndefinedValuesFromObject=removeUndefinedValuesFromObject,t.isDirectory=isDirectory,t.isDirectorySync=isDirectorySync;let N=C((rf(),__toCommonJS(tf)));function emplace(t,n,S){let C=t.get(n);if(C!==void 0)return C;let N=S();return t.set(n,N),N}function getPropertyByPath(t,n){return typeof n==`string`&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:(typeof n==`string`?n.split(`.`):n).reduce((t,n)=>t===void 0?t:t[n],t)}function removeUndefinedValuesFromObject(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>t!==void 0))}async function isDirectory(t){try{return(await N.promises.stat(t)).isDirectory()}catch(t){if(t.code===`ENOENT`)return!1;throw t}}function isDirectorySync(t){try{return N.default.statSync(t).isDirectory()}catch(t){if(t.code===`ENOENT`)return!1;throw t}}})),O_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerBase=void 0,t.getExtensionDescription=getExtensionDescription;let S=n(E_()),C=n((a_(),__toCommonJS(Zg))),N=n((Xn(),__toCommonJS(Pn))),F=D_();var ExplorerBase=class{#e=!1;config;loadCache;searchCache;constructor(t){this.config=t,t.cache&&(this.loadCache=new Map,this.searchCache=new Map),this.#t()}set loadingMetaConfig(t){this.#e=t}#t(){let t=this.config;for(let n of t.searchPlaces){let t=N.default.extname(n),S=this.config.loaders[t||`noExt`]??this.config.loaders.default;if(S===void 0)throw Error(`Missing loader for ${getExtensionDescription(n)}.`);if(typeof S!=`function`)throw Error(`Loader for ${getExtensionDescription(n)} is not a function: Received ${typeof S}.`)}}clearLoadCache(){this.loadCache&&this.loadCache.clear()}clearSearchCache(){this.searchCache&&this.searchCache.clear()}clearCaches(){this.clearLoadCache(),this.clearSearchCache()}toCosmiconfigResult(t,n){if(n===null)return null;if(n===void 0)return{filepath:t,config:void 0,isEmpty:!0};if(this.config.applyPackagePropertyPathToConfiguration||this.#e){let t=this.config.packageProp??this.config.moduleName;n=(0,F.getPropertyByPath)(n,t)}return n===void 0?{filepath:t,config:void 0,isEmpty:!0}:{config:n,filepath:t}}validateImports(t,n,S){let C=N.default.dirname(t);for(let F of n){if(typeof F!=`string`)throw Error(`${t}: Key $import must contain a string or a list of strings`);let n=N.default.resolve(C,F);if(n===t)throw Error(`Self-import detected in ${t}`);let I=S.indexOf(n);if(I!==-1)throw Error(`Circular import detected:
651
651
  ${[...S,n].map((t,n)=>`${n+1}. ${t}`).join(`
652
- `)} (same as ${I+1}.)`)}}getSearchPlacesForDir(t,n){return(t.isGlobalConfig?n:this.config.searchPlaces).map(n=>N.default.join(t.path,n))}getGlobalConfigDir(){return(0,S.default)(this.config.moduleName,{suffix:``}).config}*getGlobalDirs(t){let n=N.default.resolve(this.config.stopDir??C.default.homedir());yield{path:t,isGlobalConfig:!1};let S=t;for(;S!==n;){let t=N.default.dirname(S);if(t===S)break;yield{path:t,isGlobalConfig:!1},S=t}yield{path:this.getGlobalConfigDir(),isGlobalConfig:!0}}};t.ExplorerBase=ExplorerBase;function getExtensionDescription(t){return t?`extension "${t}"`:`files without extensions`}})),k_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=void 0,t.mergeAll=mergeAll,t.hasOwn=Function.prototype.call.bind(Object.prototype.hasOwnProperty);let n=Function.prototype.call.bind(Object.prototype.toString);function isPlainObject(t){return n(t)===`[object Object]`}function merge(n,S,C){for(let N of Object.keys(S)){if(N===`__proto__`||N===`constructor`)continue;let F=S[N];if((0,t.hasOwn)(n,N)){if(Array.isArray(n[N])&&Array.isArray(F)){if(C.mergeArrays){n[N].push(...F);continue}}else if(isPlainObject(n[N])&&isPlainObject(F)){n[N]=merge(n[N],F,C);continue}}n[N]=F}return n}function mergeAll(t,n){return t.reduce((t,S)=>merge(t,S,n),{})}})),A_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Explorer=void 0;let S=n((Bd(),__toCommonJS(Ld))),C=n((Xn(),__toCommonJS(Pn))),N=T_(),F=O_(),I=k_(),H=D_();var Explorer=class extends F.ExplorerBase{async load(t){t=C.default.resolve(t);let load=async()=>await this.config.transform(await this.#e(t));return this.loadCache?await(0,H.emplace)(this.loadCache,t,load):await load()}async search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=await this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=await n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=async()=>{if(await(0,H.isDirectory)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlaces))try{let n=await this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return await this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=await n.next();return t.done?await this.config.transform(null):(F=t.value,this.searchCache?await(0,H.emplace)(this.searchCache,F.path,search):await search())};return this.searchCache?await(0,H.emplace)(this.searchCache,t,search):await search()}async#e(t,n=[]){let C=await S.default.readFile(t,{encoding:`utf-8`});return this.toCosmiconfigResult(t,await this.#t(t,C,n))}async#t(t,n,S){let N=await this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=await Promise.all(q.map(async t=>{let n=C.default.resolve(F,t);return(await this.#e(n,Y))?.config}));return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}async#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=await N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}async#r(t){try{return await S.default.stat(t),!0}catch{return!1}}async*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(await this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}};t.Explorer=Explorer})),j_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerSync=void 0;let S=n((rf(),__toCommonJS(tf))),C=n((Xn(),__toCommonJS(Pn))),N=T_(),F=O_(),I=k_(),H=D_();var ExplorerSync=class extends F.ExplorerBase{load(t){t=C.default.resolve(t);let load=()=>this.config.transform(this.#e(t));return this.loadCache?(0,H.emplace)(this.loadCache,t,load):load()}search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=()=>{if((0,H.isDirectorySync)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlacesSync))try{let n=this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=n.next();return t.done?this.config.transform(null):(F=t.value,this.searchCache?(0,H.emplace)(this.searchCache,F.path,search):search())};return this.searchCache?(0,H.emplace)(this.searchCache,t,search):search()}#e(t,n=[]){let C=S.default.readFileSync(t,`utf8`);return this.toCosmiconfigResult(t,this.#t(t,C,n))}#t(t,n,S){let N=this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=q.map(t=>{let n=C.default.resolve(F,t);return this.#e(n,Y)?.config});return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}#r(t){try{return S.default.statSync(t),!0}catch{return!1}}*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}loadSync(t){return this.load(t)}searchSync(t=``){return this.search(t)}};t.ExplorerSync=ExplorerSync})),M_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=t.getDefaultSearchPlacesSync=t.getDefaultSearchPlaces=void 0,t.cosmiconfig=cosmiconfig;let n=T_();Object.defineProperty(t,"defaultLoaders",{enumerable:!0,get:function(){return n.defaultLoaders}}),Object.defineProperty(t,"defaultLoadersSync",{enumerable:!0,get:function(){return n.defaultLoadersSync}}),Object.defineProperty(t,"getDefaultSearchPlaces",{enumerable:!0,get:function(){return n.getDefaultSearchPlaces}}),Object.defineProperty(t,"getDefaultSearchPlacesSync",{enumerable:!0,get:function(){return n.getDefaultSearchPlacesSync}}),Object.defineProperty(t,"globalConfigSearchPlaces",{enumerable:!0,get:function(){return n.globalConfigSearchPlaces}}),Object.defineProperty(t,"globalConfigSearchPlacesSync",{enumerable:!0,get:function(){return n.globalConfigSearchPlacesSync}});let S=A_(),C=j_(),N=D_(),F=function identity(t){return t};function getUserDefinedOptionsFromMetaConfig(){let t=new C.ExplorerSync({moduleName:`cosmiconfig`,stopDir:process.cwd(),searchPlaces:n.metaSearchPlaces,ignoreEmptySearchPlaces:!1,applyPackagePropertyPathToConfiguration:!0,loaders:n.defaultLoaders,transform:F,cache:!0,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:`none`}).search();if(!t)return null;if(t.config?.loaders)throw Error(`Can not specify loaders in meta config file`);if(t.config?.searchStrategy)throw Error(`Can not specify searchStrategy in meta config file`);let S={mergeSearchPlaces:!0,...t.config??{}};return{config:(0,N.removeUndefinedValuesFromObject)(S),filepath:t.filepath}}function getResolvedSearchPlaces(t,n,S){let C=S.searchPlaces?.map(n=>n.replace(`{name}`,t));return S.mergeSearchPlaces?[...C??[],...n]:C??n}function mergeOptionsBase(t,n,S){let C=getUserDefinedOptionsFromMetaConfig();if(!C)return{...n,...(0,N.removeUndefinedValuesFromObject)(S),loaders:{...n.loaders,...S.loaders}};let F=C.config,I=S.searchPlaces??n.searchPlaces;return{...n,...(0,N.removeUndefinedValuesFromObject)(S),metaConfigFilePath:C.filepath,...F,searchPlaces:getResolvedSearchPlaces(t,I,F),loaders:{...n.loaders,...S.loaders}}}function validateOptions(t){if(t.searchStrategy!=null&&t.searchStrategy!==`global`&&t.stopDir)throw Error('Can not supply `stopDir` option with `searchStrategy` other than "global"')}function mergeOptions(t,S){return validateOptions(S),mergeOptionsBase(t,{moduleName:t,searchPlaces:(0,n.getDefaultSearchPlaces)(t),ignoreEmptySearchPlaces:!0,cache:!0,transform:F,loaders:n.defaultLoaders,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:S.stopDir?`global`:`none`},S)}function cosmiconfig(t,n={}){let C=mergeOptions(t,n),N=new S.Explorer(C);return{search:N.search.bind(N),load:N.load.bind(N),clearLoadCache:N.clearLoadCache.bind(N),clearSearchCache:N.clearSearchCache.bind(N),clearCaches:N.clearCaches.bind(N)}}}));function isBun(){return globalThis.Bun!==void 0}function isDeno(){return globalThis.Deno!==void 0}function isGjs(){return globalThis.imports?.gi!==void 0}function hostRuntime$1(){return isBun()?`bun`:isDeno()?`deno`:isGjs()?`gjs`:`node`}function isNode(){return isBun()||isDeno()||isGjs()?!1:typeof globalThis.process?.versions?.node==`string`}function gjsSystemVersion(){return globalThis.imports?.system?.version}function gjsExit(t){let n=globalThis.imports?.system;return n?.exit?(n.exit(t),!0):!1}var N_=__esmMin(()=>{__name$1(hostRuntime$1,`hostRuntime`)}),P_,__exportAll,F_=__esmMin(()=>{P_=Object.defineProperty,__exportAll=(t,n)=>{let S={};for(var C in t)P_(S,C,{get:t[C],enumerable:!0});return n||P_(S,Symbol.toStringTag,{value:`Module`}),S}});function communicateWithTimeout(t,n,S,C){let N={stdout:null,stderr:null,timedOut:!1,error:null},F=vt.MainContext.new(),I=null,H=!1;F.push_thread_default();try{for(t.communicate_async(n,null,(n,S)=>{try{let n=t.communicate_finish(S);N.stdout=n[1]??null,N.stderr=n[2]??null}catch(t){N.error=t}H=!0}),I=vt.timeout_source_new(S),I.set_callback(()=>(N.timedOut=!0,C(),vt.SOURCE_REMOVE)),I.attach(F);!H;)F.iteration(!0)}finally{I!==null&&I.destroy(),F.pop_thread_default()}return N}var I_=__esmMin(()=>{yt()});function defaultShell$1(){return R_===null&&(R_=!vt.file_test(`/bin/sh`,vt.FileTest.IS_EXECUTABLE)&&vt.file_test(`/system/bin/sh`,vt.FileTest.IS_EXECUTABLE)?`/system/bin/sh`:`/bin/sh`),R_}function shellArgv$2(t,n){return[typeof n==`string`&&n.length>0?n:defaultShell$1(),`-c`,t]}function argv0Shell(){return z_===void 0&&(z_=vt.find_program_in_path(`bash`)??vt.find_program_in_path(`zsh`)),z_??defaultShell$1()}function applyArgv0$2(t,n){return[argv0Shell(),`-c`,`exec -a "$0" "$@"`,t,...n]}function detachedPrefix$3(){return B_===void 0&&(B_=vt.find_program_in_path(`setsid`)),B_===null?null:[B_]}function killProcess$4(t,n,S){let C=n??`SIGTERM`;if(C===`SIGKILL`||C===9){t.force_exit();return}let N=typeof C==`number`?C:S[C]??S.SIGTERM;t.send_signal(N)}var L_,R_,z_,B_,V_=__esmMin(()=>{yt(),L_=Object.freeze({SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGFPE:8,SIGKILL:9,SIGSEGV:11,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28}),R_=null,__name$1(defaultShell$1,`defaultShell`),__name$1(shellArgv$2,`shellArgv`),__name$1(applyArgv0$2,`applyArgv0`),__name$1(detachedPrefix$3,`detachedPrefix`),__name$1(killProcess$4,`killProcess`)});function detachedPrefix$2(){if(U_===void 0){let t=vt.find_program_in_path(`setsid`);U_=t===null?vt.file_test(`/usr/bin/perl`,vt.FileTest.IS_EXECUTABLE)?[`/usr/bin/perl`,`-e`,`use POSIX (); POSIX::setsid(); exec { $ARGV[0] } @ARGV or die "exec: $!"`,`--`]:null:[t]}return U_}function killProcess$3(t,n){killProcess$4(t,n,W_)}var H_,U_,W_,G_=__esmMin(()=>{F_(),V_(),yt(),H_=__exportAll({SIGNALS:()=>W_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$3,shellArgv:()=>shellArgv$2}),__name$1(detachedPrefix$2,`detachedPrefix`),W_=Object.freeze({...L_,SIGEMT:7,SIGBUS:10,SIGSYS:12,SIGURG:16,SIGSTOP:17,SIGTSTP:18,SIGCONT:19,SIGCHLD:20,SIGTTIN:21,SIGTTOU:22,SIGIO:23,SIGUSR1:30,SIGUSR2:31}),__name$1(killProcess$3,`killProcess`)});function killProcess$2(t,n){killProcess$4(t,n,q_)}var K_,q_,J_=__esmMin(()=>{F_(),V_(),K_=__exportAll({SIGNALS:()=>q_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$3,killProcess:()=>killProcess$2,shellArgv:()=>shellArgv$2}),q_=Object.freeze({...L_,SIGBUS:7,SIGUSR1:10,SIGUSR2:12,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGIO:29,SIGPOLL:29,SIGPWR:30,SIGSYS:31}),__name$1(killProcess$2,`killProcess`)});function defaultShell(){return vt.getenv(`ComSpec`)||`cmd.exe`}function shellArgv$1(t,n){let S=typeof n==`string`&&n.length>0?n:defaultShell();return X_.test(S)?[S,`/d`,`/s`,`/c`,`"${t}"`]:[S,`-c`,t]}function detachedPrefix$1(){return null}function applyArgv0$1(t,n){let S=Error(`options.argv0 (${t}) is not supported on Windows: GSubprocess cannot decouple the executable path from the child's argv[0]`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function killProcess$1(t,n){t.force_exit()}var Y_,X_,Z_,Q_=__esmMin(()=>{F_(),yt(),Y_=__exportAll({SIGNALS:()=>Z_,applyArgv0:()=>applyArgv0$1,defaultShell:()=>defaultShell,detachedPrefix:()=>detachedPrefix$1,killProcess:()=>killProcess$1,shellArgv:()=>shellArgv$1}),X_=/^(?:.*\\)?cmd(?:\.exe)?$/i,__name$1(shellArgv$1,`shellArgv`),__name$1(detachedPrefix$1,`detachedPrefix`),__name$1(applyArgv0$1,`applyArgv0`),__name$1(killProcess$1,`killProcess`),Z_=Object.freeze({SIGINT:2,SIGKILL:9,SIGTERM:15})});function detectPlatform(){return ev===null&&(ev=vt.get_current_dir().startsWith(`/`)?vt.file_test(`/proc/self/status`,vt.FileTest.EXISTS)?!vt.file_test(`/bin/sh`,vt.FileTest.IS_EXECUTABLE)&&vt.file_test(`/system/bin/sh`,vt.FileTest.IS_EXECUTABLE)?`android`:`linux`:vt.file_test(`/System/Library/CoreServices/SystemVersion.plist`,vt.FileTest.EXISTS)?`darwin`:`posix`:`win32`),ev}function ops(){switch(detectPlatform()){case`win32`:return Y_;case`darwin`:return H_;case`linux`:case`android`:return K_;default:return $_}}function shellArgv(t,n){return ops().shellArgv(t,n)}function detachedPrefix(){return ops().detachedPrefix()}function applyArgv0(t,n){return ops().applyArgv0(t,n)}function killProcess(t,n){ops().killProcess(t,n)}var $_,ev,tv=__esmMin(()=>{V_(),G_(),J_(),Q_(),yt(),$_={defaultShell:defaultShell$1,shellArgv:shellArgv$2,detachedPrefix:detachedPrefix$3,applyArgv0:applyArgv0$2,killProcess:(t,n)=>killProcess$4(t,n,L_),SIGNALS:L_},ev=null});function resolveNativeSab(t){if(!t)return null;let n;try{n=t.GjsifySabNative}catch{return null}if(!n||typeof n!=`object`)return null;let S=openNativeLibrary(`GjsifySabNative`,t);if(S)return ge.debug(S.message),null;let C=n;return typeof C.SharedBuffer?.create!=`function`||typeof C.FdChannel?.make_pair!=`function`?null:C}var nv,rv,iv,av=__esmMin(()=>{_e(),Ye(),nv=globalThis,rv=resolveNativeSab(nv.imports?.gi),iv=rv?{makePair(){let[t,n,S]=rv.FdChannel.make_pair();if(!t)throw Error(`socketpair() failed`);return{parentFd:n,childFd:S}},makeStreamPair(){if(typeof rv.FdChannel.make_stream_pair!=`function`)return null;let[t,n,S]=rv.FdChannel.make_stream_pair();if(!t)throw Error(`socketpair() failed`);return{parentFd:n,childFd:S}},sendFd(t,n,S){return rv.FdChannel.send_fd(t,n,S>>>0)},recvFd(t){let[n,S]=rv.FdChannel.recv_fd(t);if(n===0)return null;if(n<0)throw Error(`recvmsg failed`);return{fd:n,tag:S>>>0}},closeFd(t){rv.FdChannel.close_fd(t)}}:null});function _gioErrorToNodeError(t,n,S){let C=t??Error(`Unknown spawn error`),N=C,F=C.code,I=C.matches,H=!1;if(typeof I==`function`)try{H=I.call(C,vt.SpawnError,vt.SpawnError.NOENT)===!0}catch{}if(!H&&F===vt.SpawnError.NOENT&&(H=!0),!H&&typeof C.message==`string`&&/No such file or directory|ENOENT|Failed to execute|nicht gefunden|nicht ausgeführt/i.test(C.message)&&(H=!0),H){let t=Error(`spawn ${n} ENOENT`);return t.code=`ENOENT`,t.errno=-2,t.syscall=`spawn ${n}`,t.path=n,t.spawnargs=S.slice(),t}if(C instanceof Error)return N;let W=C,q=typeof W.message==`string`?W.message:String(C),Y=Error(q);return(typeof F==`number`||typeof F==`string`)&&(Y.code=F),Y}function _normalizeCwd(t){if(t!=null){if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.href==`string`&&typeof t.protocol==`string`){let n=t;if(n.protocol!==`file:`)throw TypeError(`The URL must be of scheme file:; received '${n.protocol}' for 'options.cwd'`);return fileURLToPath(n)}return t instanceof Uint8Array?new TextDecoder().decode(t):String(t)}}function _encodeEnvValue(t){if(t!==void 0)return`${t}`}function _spawnSubprocess(t,n,S){let C=new Pi.SubprocessLauncher({flags:n}),N=_normalizeCwd(S?.cwd);if(N!==void 0&&C.set_cwd(N),S?.env){let t=S.env;C.set_environ([]);let n=new Set;for(let S in t){if(n.has(S))continue;n.add(S);let N=_encodeEnvValue(t[S]);N!==void 0&&C.setenv(S,N,!0)}}for(let[t,n]of Object.entries(S?.extraEnv??{}))C.setenv(t,n,!0);for(let{source:t,target:n}of S?.takeFds??[])C.take_fd(t,n);let F=t;if(S?.argv0!==void 0&&S.argv0!==null){if(typeof S.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof S.argv0}`);F=applyArgv0(S.argv0,t)}if(S?.detached===!0){let t=detachedPrefix();t!==null&&(F=[...t,...F])}let I;try{I=C.spawnv(F)}finally{S?.takeFds?.length&&queueMicrotask(()=>C.close())}let H=_capturePidAtSpawn(I);return{proc:I,pid:H}}function _capturePidAtSpawn(t){let n=t.get_identifier();if(n){let t=parseInt(n,10);if(t>0)return t}return 0}function _watchStdioForClose(t,n=!1){let S=[t.stdout,t.stderr].filter(t=>t!==null);if(S.length===0&&!n)return(n,S)=>{t.emit(`exit`,n,S),t.emit(`close`,n,S)};let C=S.length+ +!!n,N=!1,F=null,I=null,closeIfDone=()=>{N&&C===0&&t.emit(`close`,F,I)};for(let t of S){let n=!1,settleOnce=()=>{n||(n=!0,--C,closeIfDone())};t.once(`end`,settleOnce),t.once(`close`,settleOnce)}return n&&t.once(`disconnect`,()=>{--C,closeIfDone()}),(n,C)=>{F=n,I=C,N=!0,t.emit(`exit`,n,C),queueMicrotask(()=>{for(let t of S)t.destroyed||t.readableEnded||t.listenerCount(`data`)>0||t.listenerCount(`readable`)>0||t.resume()}),closeIfDone()}}function _communicateSync(t,n,S,C){if(S<=0){let S=t.communicate(n,null);return{stdout:S[1]??null,stderr:S[2]??null,timedOut:!1}}let N=communicateWithTimeout(t,n,S,()=>{killProcess(t,C??`SIGTERM`)});if(N.error)throw N.error;return{stdout:N.stdout,stderr:N.stderr,timedOut:N.timedOut}}function _syncTimeoutError(t,n,S,C,N){let F=n?gbytesToUint8Array(n):new Uint8Array,I=S?gbytesToUint8Array(S):new Uint8Array,H=new TextDecoder().decode(I),W=Error(`Command failed: ${t}\n${H}`);return W.code=`ETIMEDOUT`,W.killed=!0,W.signal=typeof N==`string`?N:`SIGTERM`,W.status=null,C===`buffer`||C===null?(W.stdout=ot.from(F),W.stderr=ot.from(I)):(W.stdout=new TextDecoder().decode(F),W.stderr=H),W}function _decodeExecOutput(t,n){let S=t??new Uint8Array;if(n===`buffer`||n===null)return ot.from(S);let C=n&&ot.isEncoding(n)?n:`utf8`;return ot.from(S).toString(C)}function _normalizeKillSignal(t){return t??`SIGTERM`}function _exec(t,n,S){typeof n==`function`&&(S=n,n={});let C=n||{},N=new ChildProcess,F=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE,I=C.maxBuffer??1024*1024,H=C.timeout&&C.timeout>0?C.timeout:0,W=_normalizeKillSignal(C.killSignal),q=C.signal;return _execImpl(N,shellArgv(t,C.shell),F,C,{cmd:t,encoding:C.encoding,maxBuffer:I,timeoutMs:H,killSignal:W,abortSignal:q,callback:S})}function _absorbExecError(){}function _execImpl(t,n,S,C,N){t.on(`error`,_absorbExecError);let F=null,I=!1,H=null,W=null,armTimeout=n=>{N.timeoutMs&&(F=setTimeout(()=>{I=!0;try{killProcess(n,N.killSignal)}catch{}t.killed=!0},N.timeoutMs))},disarmTimeout=()=>{F!==null&&(clearTimeout(F),F=null)},armAbort=n=>{if(!N.abortSignal)return;let fire=()=>{H=Error(`The operation was aborted`),H.name=`AbortError`;try{killProcess(n,N.killSignal)}catch{}t.killed=!0};if(N.abortSignal.aborted){queueMicrotask(fire);return}W=fire,N.abortSignal.addEventListener(`abort`,W,{once:!0})},disarmAbort=()=>{N.abortSignal&&W&&(N.abortSignal.removeEventListener(`abort`,W),W=null)};try{let{proc:F,pid:W}=_spawnSubprocess(n,S,C);t._setSubprocess(F,W),ov.add(t),armTimeout(F),armAbort(F);let q=_watchStdioForClose(t);t._holdProcess(),F.communicate_async(null,null,(n,S)=>{disarmTimeout(),disarmAbort(),ov.delete(t);try{let[,n,C]=F.communicate_finish(S),W=n?gbytesToUint8Array(n):null,Y=C?gbytesToUint8Array(C):null,X=null;N.maxBuffer!==1/0&&W&&W.length>N.maxBuffer&&(W=W.subarray(0,N.maxBuffer),X=RangeError(`stdout maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`),!X&&N.maxBuffer!==1/0&&Y&&Y.length>N.maxBuffer&&(Y=Y.subarray(0,N.maxBuffer),X=RangeError(`stderr maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`);let Z=_decodeExecOutput(W,N.encoding),te=_decodeExecOutput(Y,N.encoding),ne=F.get_if_exited()?F.get_exit_status():null,re=F.get_if_signaled()?typeof N.killSignal==`string`?N.killSignal:`SIGTERM`:null;t.exitCode=ne,t.signalCode=re;let ie=null;if(H)ie=H,ie.killed=!0,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(X)ie=X,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(I)ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.code=null,ie.signal=typeof N.killSignal==`string`?N.killSignal:`SIGTERM`,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(ne!==0&&ne!==null){let n=typeof te==`string`?te:te.toString();ie=Error(`Command failed: ${N.cmd}\n${n}`),ie.code=ne,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd}else re&&(ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.signal=re,ie.code=null,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd);N.callback&&N.callback(ie,Z,te),q(ne,re)}catch(n){let S=n instanceof Error?n:Error(String(n));N.callback&&N.callback(S,``,``),t.emit(`error`,S)}}),queueMicrotask(()=>t.emit(`spawn`))}catch(S){disarmTimeout(),disarmAbort();let C=_gioErrorToNodeError(S,n[0]??``,n.slice(1));setTimeout(()=>{N.callback&&N.callback(C,``,``),t.emit(`error`,C)},0)}return t}function execFile(t,n,S,C){let N=[],F={},I;typeof n==`function`?I=n:Array.isArray(n)?(N=n,typeof S==`function`?I=S:(F=S||{},I=C)):n&&typeof n==`object`&&(F=n,I=typeof S==`function`?S:C);let H=new ChildProcess,W=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE,q=F.maxBuffer??1024*1024,Y=F.timeout&&F.timeout>0?F.timeout:0,X=_normalizeKillSignal(F.killSignal);return _execImpl(H,[t,...N],W,F,{cmd:t,encoding:F.encoding,maxBuffer:q,timeoutMs:Y,killSignal:X,abortSignal:F.signal,callback:I})}function definePromisifiedExec(t){Object.defineProperty(t,Symbol.for(`nodejs.util.promisify.custom`),{enumerable:!1,value:(...n)=>{let S,C=new Promise((C,N)=>{let callback=(t,n,S)=>{t===null?C({stdout:n,stderr:S}):(t.stdout=n,t.stderr=S,N(t))};S=t(...n,callback)});return C.child=S,C}})}function execFileSync(t,n,S){let C=[],N;Array.isArray(n)?(C=n,N=S):n&&typeof n==`object`&&(N=n);let F=N?.encoding,I=N?.input,H=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE|(I?Pi.SubprocessFlags.STDIN_PIPE:Pi.SubprocessFlags.NONE),W;try{({proc:W}=_spawnSubprocess([t,...C],H,N))}catch(n){throw _gioErrorToNodeError(n,t,C)}let q=I?new vt.Bytes(typeof I==`string`?new TextEncoder().encode(I):I):null,Y=N?.timeout&&N.timeout>0?N.timeout:0,{stdout:X,stderr:Z,timedOut:te}=_communicateSync(W,q,Y,N?.killSignal);if(te)throw _syncTimeoutError(`${t} ${C.join(` `)}`.trim(),X,Z,F,N?.killSignal);let ne=W.get_exit_status();if(ne!==0){let n=Z?new TextDecoder().decode(gbytesToUint8Array(Z)):``,S=X?new TextDecoder().decode(gbytesToUint8Array(X)):``,N=Error(`Command failed: ${t} ${C.join(` `)}`);throw N.status=ne,F===`buffer`||F===null?(N.stderr=Z?ot.from(gbytesToUint8Array(Z)):ot.alloc(0),N.stdout=X?ot.from(gbytesToUint8Array(X)):ot.alloc(0)):(N.stderr=n,N.stdout=S),N}if(!X)return F===`buffer`||F==null?ot.alloc(0):``;let re=gbytesToUint8Array(X);if(F===`buffer`||F==null)return ot.from(re);let ie=ot.isEncoding(F)?F:`utf8`;return ot.from(re).toString(ie)}function spawn(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=new ChildProcess,H=N?.shell,W;W=H?shellArgv([t,...F].join(` `),H):[t,...F];let q=N?.stdio,Y=Array.isArray(q)?[typeof q[0]==`string`?q[0]:`pipe`,typeof q[1]==`string`?q[1]:`pipe`,typeof q[2]==`string`?q[2]:`pipe`]:typeof q==`string`?[q,q,q]:[`pipe`,`pipe`,`pipe`],X=Pi.SubprocessFlags.NONE;Y[0]===`pipe`?X|=Pi.SubprocessFlags.STDIN_PIPE:Y[0]===`inherit`&&(X|=Pi.SubprocessFlags.STDIN_INHERIT),Y[1]===`pipe`&&(X|=Pi.SubprocessFlags.STDOUT_PIPE),Y[1]===`ignore`&&(X|=Pi.SubprocessFlags.STDOUT_SILENCE),Y[2]===`pipe`&&(X|=Pi.SubprocessFlags.STDERR_PIPE),Y[2]===`ignore`&&(X|=Pi.SubprocessFlags.STDERR_SILENCE);let Z=_openIpcSlot(q,N?.serialization);try{let{proc:t,pid:n}=_spawnSubprocess(W,X,{...N,takeFds:Z?[{source:Z.childFd,target:Z.slot}]:void 0,extraEnv:Z?{NODE_CHANNEL_FD:String(Z.slot),NODE_CHANNEL_SERIALIZATION_MODE:`json`}:void 0});if(I._setSubprocess(t,n),ov.add(I),Z&&setupNodeChannel(I,Z.parentFd),Y[0]===`pipe`){let n=t.get_stdin_pipe();n&&(I.stdin=new GioOutputStreamWritable(n))}let S=t.get_stdout_pipe();S&&(I.stdout=new GioInputStreamReadable(S));let C=t.get_stderr_pipe();C&&(I.stderr=new GioInputStreamReadable(C));let F=_watchStdioForClose(I,Z!==null);I._holdProcess();let H=N?.signal,q=null,emitAbortError=()=>{let t=N?.killSignal??`SIGTERM`;I.kill(t);let n=Error(`The operation was aborted`);n.name=`AbortError`,I.emit(`error`,n)};H&&(H.aborted?queueMicrotask(emitAbortError):(q=emitAbortError,H.addEventListener(`abort`,q,{once:!0})));let te=null;if(N?.timeout&&N.timeout>0){let t=N.killSignal??`SIGTERM`;te=setTimeout(()=>{I.kill(t),te=null},N.timeout)}t.wait_async(null,(n,S)=>{try{t.wait_finish(S);let n=t.get_if_exited()?t.get_exit_status():null,C=null;if(t.get_if_signaled()){let t=N?.killSignal;C=typeof t==`string`?t:`SIGTERM`}I.exitCode=n,I.signalCode=C,te!==null&&(clearTimeout(te),te=null),H&&q&&H.removeEventListener(`abort`,q),I.stdin&&!I.stdin.destroyed&&I.stdin.destroy(),F(n,C)}catch(t){I.emit(`error`,t instanceof Error?t:Error(String(t)))}ov.delete(I)}),queueMicrotask(()=>I.emit(`spawn`))}catch(n){Z&&!I.channel&&iv?.closeFd(Z.parentFd),deferEmit(I,`error`,_gioErrorToNodeError(n,H?t:W[0]??``,H?F:W.slice(1)))}return I}function _codedError(t,n,S){let C=new t(S);return C.code=n,C}function _openIpcSlot(t,n){if(!Array.isArray(t))return null;let S=t.indexOf(`ipc`);if(S===-1)return null;if(t.indexOf(`ipc`,S+1)!==-1)throw _codedError(Error,`ERR_IPC_ONE_PIPE`,`Child process can have only one IPC pipe`);if(S<3)throw _codedError(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`An 'ipc' channel on stdin, stdout or stderr is not supported under GJS`);if(n!==void 0&&n!==`json`)throw _codedError(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`serialization: '${n}' is not supported under GJS yet; use 'json'`);let C=iv?.makeStreamPair()??null;if(!C)throw _codedError(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`An 'ipc' channel needs @gjsify/sab-native with make_stream_pair, which this install lacks`);return{slot:S,parentFd:C.parentFd,childFd:C.childFd}}function spawnSync(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=N?.shell,H=N?.input,W;W=I?shellArgv([t,...F].join(` `),I):[t,...F];let q=N?.timeout&&N.timeout>0?N.timeout:0,Y=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE|(H?Pi.SubprocessFlags.STDIN_PIPE:Pi.SubprocessFlags.NONE),X=H;if(X!=null&&typeof X!=`string`&&!(X instanceof Uint8Array)&&!(X instanceof ArrayBuffer)&&!ArrayBuffer.isView(X))throw TypeError(`The "input" property must be of type string, Buffer, TypedArray, or DataView. Received type ${typeof X}`);let Z=N?.encoding,te=Z===`buffer`||Z==null?ot.alloc(0):``,ne,re=0;try{({proc:ne,pid:re}=_spawnSubprocess(W,Y,N))}catch(n){let S=I?t:W[0]??``,C=I?F:W.slice(1);return{pid:0,output:[null,te,te],stdout:te,stderr:te,status:null,signal:null,error:_gioErrorToNodeError(n,S,C)}}let ie=H?new vt.Bytes(typeof H==`string`?new TextEncoder().encode(H):H):null,ae,oe,Q=null,se=!1;try{if(q>0){let t=communicateWithTimeout(ne,ie,q,()=>{killProcess(ne,N?.killSignal??`SIGTERM`)});if(se=t.timedOut,t.error)throw t.error;ae=t.stdout,oe=t.stderr}else{let t=ne.communicate(ie,null);ae=t[1]??null,oe=t[2]??null}}catch(t){Q=t instanceof Error?t:Error(String(t)),ae=null,oe=null}let ce=ae?ot.from(gbytesToUint8Array(ae)):ot.alloc(0),le=oe?ot.from(gbytesToUint8Array(oe)):ot.alloc(0),decode=t=>{if(Z===`buffer`||Z==null)return t;let n=ot.isEncoding(Z)?Z:`utf8`;return t.toString(n)},ue=decode(ce),de=decode(le),fe=ne.get_if_exited()?ne.get_exit_status():null,pe=null;if(ne.get_if_signaled()){let t=N?.killSignal;pe=typeof t==`string`?t:`SIGTERM`}se&&(pe=typeof N?.killSignal==`string`?N.killSignal:`SIGTERM`);let me={pid:re,output:[null,ue,de],stdout:ue,stderr:de,status:se?null:fe,signal:pe};if(se){let t=Error(`Command failed: ${W.join(` `)}\n${typeof de==`string`?de:de.toString()}`);t.code=`ETIMEDOUT`,t.killed=!0,t.signal=pe,me.error=t}else Q&&(me.error=Q);return me}var GioInputStreamReadable,GioOutputStreamWritable,ov,ChildProcess,sv=__esmMin(()=>{I_(),tv(),yt(),Fi(),on(),ht(),xa(),cr(),Co(),Ue(),vn(),av(),GioInputStreamReadable=class extends ha{_stream;_cancellable=new Pi.Cancellable;constructor(t){super(),this._stream=t}_read(t){this._stream.read_bytes_async(Math.max(t,4096),vt.PRIORITY_DEFAULT,this._cancellable,trackedCallback((t,n)=>{try{let t=this._stream.read_bytes_finish(n).get_data();!t||t.length===0?this.push(null):this.push(ot.from(t))}catch(t){this._cancellable.is_cancelled()||this.destroy(t)}}))}_destroy(t,n){this._cancellable.cancel(),n(t)}},GioOutputStreamWritable=class extends ga{_stream;_cancellable=new Pi.Cancellable;_closed=!1;constructor(t){super(),this._stream=t}_write(t,n,S){if(this._closed){S(Error(`write after end`));return}let C=typeof t==`string`?ot.from(t):t instanceof Uint8Array?t:ot.from(t);this._stream.write_bytes_async(new vt.Bytes(C),vt.PRIORITY_DEFAULT,this._cancellable,trackedCallback((t,n)=>{try{this._stream.write_bytes_finish(n),S()}catch(t){this._cancellable.is_cancelled()?S():S(t)}}))}_final(t){if(this._closed){t();return}this._closed=!0;try{this._stream.close(null)}catch{}t()}_destroy(t,n){if(this._cancellable.cancel(),!this._closed){this._closed=!0;try{this._stream.close(null)}catch{}}n(t)}},ov=new Set,ChildProcess=class extends Jt{pid;exitCode=null;signalCode=null;killed=!1;connected=!1;stdin=null;stdout=null;stderr=null;get stdio(){return[this.stdin,this.stdout,this.stderr]}_subprocess=null;_setSubprocess(t,n){this._subprocess=t,n>0&&(this.pid=n)}kill(t){if(!this._subprocess)return!1;try{return killProcess(this._subprocess,t??`SIGTERM`),this.killed=!0,!0}catch{return!1}}_holdsProcess=!1;_closed=!1;_holdProcess(){this.once(`close`,()=>{this._closed=!0,this._dropHold()}),this._acquireHold()}_acquireHold(){this._holdsProcess||this._closed||(this._holdsProcess=!0,acquireMainLoop())}_dropHold(){this._holdsProcess&&(this._holdsProcess=!1,setTimeout(releaseMainLoop,0))}ref(){return this._acquireHold(),this}unref(){return this._dropHold(),this}},definePromisifiedExec(_exec),definePromisifiedExec(execFile)});function lookupEnv(t,n){let S=n.toLowerCase();for(let n of Object.keys(t))if(n.toLowerCase()===S&&t[n]!==void 0)return t[n]}function escapeCmdCommand(t){return t.replace(dv,`^$1`)}function escapeCmdArgument(t,n=!1){let S=`${t}`;return S=S.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),S=S.replace(/(?=(\\+?)?)\1$/,`$1$1`),S=`"${S}"`,S=S.replace(dv,`^$1`),n&&(S=S.replace(dv,`^$1`)),S}function buildCmdExeInvocation(t,n,S=`cmd.exe`){let C=uv.test(t);return{cmd:S,args:[`/d`,`/s`,`/c`,`"${[escapeCmdCommand(t),...n.map(t=>escapeCmdArgument(t,C))].join(` `)}"`],windowsVerbatimArguments:!0}}function isBareName(t){return!t.includes(`/`)&&!t.includes(`\\`)&&!/\.[^.]+$/.test(t)}function findOnPath(t,n){let S=n.platform===`win32`,C=(lookupEnv(n.env,`PATH`)??``).split(S?`;`:`:`).filter(Boolean),N=S&&!/\.[^.\\/]+$/.test(t)?(lookupEnv(n.env,`PATHEXT`)??cv).split(`;`).filter(Boolean):[``];for(let S of C)for(let C of N){let N=n.join(S,t+C);if(n.exists(N))return N}}function resolveWin32Command(t,n,S){if(S.platform!==`win32`||!isBareName(t))return;let C=findOnPath(t,S);if(C)return lv.test(C)?{cmd:C,args:[...n]}:buildCmdExeInvocation(C,n,lookupEnv(S.env,`COMSPEC`)??`cmd.exe`)}var cv,lv,uv,dv,fv=__esmMin(()=>{cv=`.COM;.EXE;.BAT;.CMD`,lv=/\.(?:com|exe)$/i,uv=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,dv=/([()\][%!^"`<>&|;, *?])/g});function resolveEnv(t){if(!t.color)return t.env;let n=t.env??process.env,S=process.env.FORCE_COLOR!==void 0||process.env.NO_COLOR!==void 0?{}:{FORCE_COLOR:`1`};return{...n,...S}}function toSpawnable(t,n,S){return resolveWin32Command(t,n,{platform:process.platform,env:S??process.env,exists:existsSync,join:zn})??{cmd:t,args:[...n]}}function mapSpawnError(t,n){return t.code===`ENOENT`&&n.notFound?n.notFound(t):t}function mustBlock(t){return isGjs()&&t.completion===`return`}function spawnToCompletion(t,n,S){let C=resolveEnv(S),N=S.shell?{cmd:t,args:[...n],windowsVerbatimArguments:!1}:toSpawnable(t,n,C);if(mustBlock(S)){let t=spawnSync(N.cmd,N.args,{stdio:[`inherit`,`pipe`,`pipe`],cwd:S.cwd,env:C,shell:S.shell,maxBuffer:S.maxBuffer??pv,windowsVerbatimArguments:N.windowsVerbatimArguments});if(t.error)return Promise.reject(mapSpawnError(t.error,S));if(S.stdio===`capture`)return Promise.resolve({code:t.status,signal:t.signal??null,stdout:String(t.stdout??``),stderr:String(t.stderr??``)});let n=S.stdio===`inherit-stderr`?process.stderr:process.stdout;return t.stdout&&t.stdout.length>0&&n.write(t.stdout),t.stderr&&t.stderr.length>0&&process.stderr.write(t.stderr),Promise.resolve({code:t.status,signal:t.signal??null})}return new Promise((t,n)=>{let F=N,I={cwd:S.cwd,stdio:S.stdio===`pipe`?[`ignore`,`pipe`,`pipe`]:S.stdio===`capture`?[`inherit`,`pipe`,`pipe`]:S.stdio===`inherit-stderr`?[`inherit`,2,2]:`inherit`};S.shell&&(I.shell=!0),C&&(I.env=C),F.windowsVerbatimArguments&&(I.windowsVerbatimArguments=!0);let H=spawn(F.cmd,F.args,I);S.onSpawn?.(H);let W;if(S.stdio===`capture`){let t={stdout:``,stderr:``};W=t,H.stdout?.on(`data`,n=>t.stdout+=String(n)),H.stderr?.on(`data`,n=>t.stderr+=String(n))}H.on(`close`,(n,S)=>{t(W?{code:n,signal:S,...W}:{code:n,signal:S})}),H.on(`error`,t=>{n(mapSpawnError(t,S))})})}function describeExit(t){return t.signal===null?`code ${t.code}`:`signal ${t.signal}`}var pv,mv=__esmMin(()=>{sv(),rf(),Xn(),N_(),fv(),pv=64*1024*1024});function isExampleRuntime(t){return hv.includes(t)}function buildAppForRuntime(t){return gv[t].buildApp}function requiresGjsSystemDeps(t){return buildAppForRuntime(t)===`gjs`}function isRuntimeOnPath(t){let n=toSpawnable(t,[`--version`]),S=spawnSync(n.cmd,n.args,{stdio:`ignore`,timeout:15e3,windowsVerbatimArguments:n.windowsVerbatimArguments});return!S.error&&S.status===0}function isRuntimeAvailable(t){return t===hostRuntime$1()?!0:isRuntimeOnPath(gv[t].probe)}function defaultExampleRuntime(){return isRuntimeAvailable(`gjs`)?`gjs`:hostRuntime$1()}function readDeclaredRuntimes(t){let n=t?.gjsify?.example?.runtimes;return Array.isArray(n)?n.filter(t=>typeof t==`string`&&isExampleRuntime(t)):null}function checkRuntimeSupported(t,n,S){return n===null||n.includes(t)?{ok:!0}:{ok:!1,message:`"${S}" does not support --runtime ${t}.\n Declared runtimes: ${n.length>0?n.join(`, `):`(none)`}.\n Run it on one of the declared runtimes, e.g. --runtime ${n[0]??`gjs`}.`}}var hv,gv,_v=__esmMin(()=>{sv(),N_(),mv(),hv=[`gjs`,`node`,`bun`,`deno`],gv={gjs:{probe:`gjs`,buildApp:`gjs`,launch:(t,n=[])=>[`gjs`,[`-m`,t,...n]]},node:{probe:`node`,buildApp:`node`,launch:(t,n=[])=>[`node`,[t,...n]]},bun:{probe:`bun`,buildApp:`node`,launch:(t,n=[])=>[`bun`,[t,...n]]},deno:{probe:`deno`,buildApp:`node`,launch:(t,n=[])=>[`deno`,[`run`,`-A`,`--node-modules-dir=manual`,t,...n]]}}});function isSourceDialect(t){return typeof t==`string`&&vv.includes(t)}var vv,yv,bv=__esmMin(()=>{vv=[`react-native`],yv=new Set([`gjs`,`node`])}),xv=__esmMin(()=>{}),Sv=__esmMin(()=>{}),Cv=__esmMin(()=>{}),wv=__esmMin(()=>{bv(),xv(),Sv(),Cv()});function collectPlatformEntries(t){let n=new Set;if(!t||typeof t!=`object`)return n;for(let S of Ev)S!==`gjs`&&Object.prototype.hasOwnProperty.call(t,`./${S}`)&&n.add(S);return n}function findScanRoots(){let t=[],n=Hn(fileURLToPath(import.meta.url));for(let S=0;S<8;S++){let S=In(n,`packages`);existsSync(S)&&[`node`,`web`,`dom`,`framework`,`infra`].some(t=>existsSync(zn(S,t)))&&t.push({kind:`workspace`,dir:S});let C=In(n,`node_modules`,`@gjsify`);existsSync(C)&&t.push({kind:`installed`,dir:C});let N=Hn(n);if(N===n)break;n=N}try{let n=In(process.cwd(),`node_modules`,`@gjsify`);existsSync(n)&&t.push({kind:`installed`,dir:n})}catch{}return t}function ingestPackageDirSync(t,n){let S=zn(t,`package.json`);if(existsSync(S))try{let C=readFileSync(S,`utf8`),N=JSON.parse(C),F=typeof N.name==`string`?N.name:null,I=N?.gjsify?.runtimes;if(F&&F.startsWith(`@gjsify/`)&&!n.has(F)&&I&&typeof I==`object`){let S={};for(let t of Ev){let n=I[t];typeof n==`string`&&Tv.has(n)&&(S[t]=n)}let C=existsSync(zn(t,`globals.mjs`)),H=collectPlatformEntries(N?.exports);n.set(F,{name:F,dir:t,runtimes:S,hasGlobals:C,platformEntries:H})}}catch{}}function getCacheSync(){if(Dv)return Dv;let t=findScanRoots(),n=new Map;if(t.length===0)return Dv=n,Dv;function walkWorkspace(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}if(existsSync(zn(t,`package.json`))){ingestPackageDirSync(t,n);return}for(let n of S)n.isDirectory()&&(n.name===`node_modules`||n.name===`lib`||n.name===`dist`||n.name.startsWith(`.`)||walkWorkspace(zn(t,n.name)))}function walkInstalled(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S)!C.isDirectory()&&!C.isSymbolicLink()||C.name.startsWith(`.`)||ingestPackageDirSync(zn(t,C.name),n)}for(let n of t)n.kind===`workspace`?walkWorkspace(n.dir):walkInstalled(n.dir);return Dv=n,Dv}function warnOnce(t,n){Ov.has(t)||(Ov.add(t),ge.warn(`[@gjsify/resolve-npm] ${n}`))}function resolveSlot(t,n){let S=t.runtimes[n];if(!S)return null;switch(S){case`polyfill`:return n!==`gjs`&&t.platformEntries?.has(n)?`${t.name}/${n}`:null;case`partial`:return null;case`native`:return t.hasGlobals?`${t.name}/globals`:(warnOnce(`${t.name}-${n}-native-missing-globals`,`${t.name} declares runtimes.${n}="native" but ships no globals.mjs — resolving it normally for --app ${n} builds.`),null);case`none`:return null;default:return null}}function getDerivedAliasesSync(t){if(!Ev.has(t))return{};let n=getCacheSync(),S={};for(let C of n.values()){let n=resolveSlot(C,t);n!==null&&n!==C.name&&(S[C.name]=n)}return S}var Tv,Ev,Dv,Ov,kv=__esmMin(()=>{_e(),Bd(),rf(),Xn(),cr(),Tv=new Set([`polyfill`,`native`,`partial`,`none`]),Ev=new Set([`gjs`,`node`,`browser`,`nativescript`,`react-native`]),Dv=null,Ov=new Set}),Av,jv,Mv=__esmMin(()=>{Av={browser:{renderer:`@gjsify/adwaita-web`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,Graphene:`1.0`,GtkSource:`5`}},nativescript:{renderer:`@gjsify/adwaita-nativescript`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,Graphene:`1.0`,GtkSource:`5`},specifiers:{GObject:`@gjsify/adwaita-nativescript/gobject`,GtkSource:`@gjsify/gtksource-nativescript/gtksource`}}},jv=Object.freeze(Object.keys(Av))});function withDerivedSlotRouting(t,n){let S=null,materialise=()=>{if(S)return S;let C=getDerivedAliasesSync(n),N={};for(let[n,S]of Object.entries(t))N[n]=Object.prototype.hasOwnProperty.call(C,S)?C[S]:S;return S=N,S};return new Proxy(t,{get:(n,S)=>typeof S==`string`?materialise()[S]:Reflect.get(t,S),has:(t,n)=>Reflect.has(materialise(),n),ownKeys:()=>Reflect.ownKeys(materialise()),getOwnPropertyDescriptor:(t,n)=>Reflect.getOwnPropertyDescriptor(materialise(),n)})}var Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv=__esmMin(()=>{kv(),Mv(),Nv=`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/web.stream/consumers.stream/promises.string_decoder.sys.test.timers.timers/promises.tls.tty.url.util.util/types.v8.vm.wasi.sqlite.worker_threads.zlib`.split(`.`),Pv=[`readable-stream`,`node-fetch`],Fv={jsdom:`@gjsify/empty`,"./polling-xhr.node.js":`./polling-xhr.js`,"./websocket.node.js":`./websocket.js`,"./globals.node.js":`./globals.js`},Iv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process`,cluster:`@gjsify/cluster`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto`,dgram:`@gjsify/dgram`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns`,"dns/promises":`@gjsify/dns/promises`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs`,"fs/promises":`@gjsify/fs/promises`,http:`@gjsify/http`,http2:`@gjsify/http2`,https:`@gjsify/https`,inspector:`@gjsify/inspector`,module:`@gjsify/module`,net:`@gjsify/net`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/readline`,"readline/promises":`@gjsify/readline/promises`,repl:`@gjsify/repl`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls`,tty:`@gjsify/tty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/v8`,vm:`@gjsify/vm`,wasi:`@gjsify/wasi`,sqlite:`@gjsify/sqlite`,worker_threads:`@gjsify/worker_threads`,zlib:`@gjsify/zlib`,"node-fetch":`@gjsify/fetch`,ws:`@gjsify/ws`,"isomorphic-ws":`@gjsify/websocket`},Lv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process/browser`,cluster:`@gjsify/empty`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto/browser`,dgram:`@gjsify/empty`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns/browser`,"dns/promises":`@gjsify/empty`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs/browser`,"fs/promises":`@gjsify/fs/browser/promises`,http:`@gjsify/http/browser`,http2:`@gjsify/empty`,https:`@gjsify/https/browser`,inspector:`@gjsify/empty`,module:`@gjsify/module/browser`,net:`@gjsify/net/browser`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/empty`,"readline/promises":`@gjsify/empty`,repl:`@gjsify/empty`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls/browser`,tty:`@gjsify/empty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/empty`,vm:`@gjsify/vm`,wasi:`@gjsify/empty`,sqlite:`@gjsify/sqlite/browser`,worker_threads:`@gjsify/worker_threads/browser`,zlib:`@gjsify/zlib/browser`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/ws/browser`,"isomorphic-ws":`@gjsify/empty`},Rv=withDerivedSlotRouting(Lv,`browser`),zv={child_process:`@gjsify/empty`,cluster:`@gjsify/empty`,dgram:`@gjsify/empty`,dns:`@gjsify/empty`,"dns/promises":`@gjsify/empty`,inspector:`@gjsify/empty`,net:`@gjsify/empty`,tls:`@gjsify/empty`,tty:`@gjsify/empty`,http:`@gjsify/empty`,https:`@gjsify/empty`,http2:`@gjsify/empty`,readline:`@gjsify/empty`,repl:`@gjsify/empty`,v8:`@gjsify/empty`,vm:`@gjsify/empty`,worker_threads:`@gjsify/empty`,perf_hooks:`@gjsify/empty`,diagnostics_channel:`@gjsify/empty`,domain:`@gjsify/empty`,sqlite:`@gjsify/empty`,sys:`@gjsify/empty`,zlib:`@gjsify/empty`,assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,module:`@gjsify/module`,crypto:`@gjsify/crypto`,events:`@gjsify/events`,fs:`@gjsify/native-fs-bridge`,"fs/promises":`@gjsify/native-fs-bridge`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,process:`@gjsify/process`,stream:`@gjsify/stream`,"stream/promises":`@gjsify/stream/promises`,"stream/web":`@gjsify/stream/web`,string_decoder:`@gjsify/string_decoder`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,querystring:`@gjsify/querystring`,console:`@gjsify/console`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,gettext:`@gjsify/node-gi/gettext`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/empty`,"isomorphic-ws":`@gjsify/empty`},Bv={"abort-controller":`@gjsify/abort-controller`,"compression-streams":`@gjsify/compression-streams`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception`,"event-target-shim":`@gjsify/dom-events`,"message-channel":`@gjsify/message-channel`,"web-worker":`@gjsify/web-worker`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch`,formdata:`@gjsify/formdata`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/abort-controller/register`,"compression-streams/register":`@gjsify/compression-streams/register`,"dom-events/register":`@gjsify/dom-events/register`,"dom-events/register/event-target":`@gjsify/dom-events/register/event-target`,"dom-events/register/custom-events":`@gjsify/dom-events/register/custom-events`,"dom-events/register/ui-events":`@gjsify/dom-events/register/ui-events`,"dom-events/register/global-event-target":`@gjsify/dom-events/register/global-event-target`,"dom-exception/register":`@gjsify/dom-exception/register`,"message-channel/register":`@gjsify/message-channel/register`,"web-worker/register":`@gjsify/web-worker/register`,"eventsource/register":`@gjsify/eventsource/register`,"websocket/register":`@gjsify/websocket/register`,"fetch/register":`@gjsify/fetch/register`,"fetch/register/fetch":`@gjsify/fetch/register/fetch`,"fetch/register/xhr":`@gjsify/fetch/register/xhr`,"webcrypto/register":`@gjsify/webcrypto/register`,"web-streams/register":`@gjsify/web-streams/register`,"web-streams/register/readable":`@gjsify/web-streams/register/readable`,"web-streams/register/writable":`@gjsify/web-streams/register/writable`,"web-streams/register/transform":`@gjsify/web-streams/register/transform`,"web-streams/register/text-streams":`@gjsify/web-streams/register/text-streams`,"web-streams/register/queuing":`@gjsify/web-streams/register/queuing`,xmlhttprequest:`@gjsify/fetch`,"xmlhttprequest/register":`@gjsify/fetch/register/xhr`,"@gjsify/xmlhttprequest":`@gjsify/fetch`,"@gjsify/xmlhttprequest/register":`@gjsify/fetch/register/xhr`,domparser:`@gjsify/domparser`,"domparser/register":`@gjsify/domparser/register`,webaudio:`@gjsify/webaudio`,"webaudio/register":`@gjsify/webaudio/register`,gamepad:`@gjsify/gamepad`,"gamepad/register":`@gjsify/gamepad/register`,webrtc:`@gjsify/webrtc`,"webrtc/register":`@gjsify/webrtc/register`,"webrtc/register/peer-connection":`@gjsify/webrtc/register/peer-connection`,"webrtc/register/data-channel":`@gjsify/webrtc/register/data-channel`,"webrtc/register/error":`@gjsify/webrtc/register/error`,"webrtc/register/media":`@gjsify/webrtc/register/media`,"webrtc/register/media-devices":`@gjsify/webrtc/register/media-devices`,webassembly:`@gjsify/webassembly`,"webassembly/register":`@gjsify/webassembly/register`,"webassembly/register/promise":`@gjsify/webassembly/register/promise`},Vv={"@gjsify/node-globals":`@gjsify/empty`,"@gjsify/node-globals/register":`@gjsify/empty`,"@gjsify/node-globals/register/process":`@gjsify/empty`,"@gjsify/node-globals/register/buffer":`@gjsify/empty`,"@gjsify/node-globals/register/timers":`@gjsify/empty`,"@gjsify/node-globals/register/encoding":`@gjsify/empty`,"@gjsify/node-globals/register/url":`@gjsify/empty`,"@gjsify/node-globals/register/structured-clone":`@gjsify/empty`,"@gjsify/node-globals/register/microtask":`@gjsify/empty`,"@gjsify/node-globals/register/navigator":`@gjsify/empty`,"@gjsify/web-globals":`@gjsify/empty`,"@gjsify/web-globals/register":`@gjsify/empty`,"@gjsify/web-globals/register/performance":`@gjsify/empty`,"@gjsify/web-globals/register/formdata":`@gjsify/empty`},Hv={system:`@gjsify/node-gi/system`,gettext:`@gjsify/node-gi/gettext`,cairo:`@gjsify/node-gi/cairo`},Uv={"abort-controller":`@gjsify/abort-controller/globals`,"compression-streams":`@gjsify/compression-streams/globals`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception/globals`,"message-channel":`@gjsify/message-channel/globals`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch/globals`,formdata:`@gjsify/formdata/globals`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto/globals`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket/globals`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/empty`,"compression-streams/register":`@gjsify/empty`,"dom-events/register":`@gjsify/empty`,"dom-events/register/event-target":`@gjsify/empty`,"dom-events/register/custom-events":`@gjsify/empty`,"dom-events/register/ui-events":`@gjsify/empty`,"dom-events/register/global-event-target":`@gjsify/empty`,"dom-exception/register":`@gjsify/empty`,"message-channel/register":`@gjsify/empty`,"eventsource/register":`@gjsify/empty`,"websocket/register":`@gjsify/empty`,"fetch/register":`@gjsify/empty`,"fetch/register/fetch":`@gjsify/empty`,"fetch/register/xhr":`@gjsify/empty`,"webcrypto/register":`@gjsify/empty`,"web-streams/register":`@gjsify/empty`,"web-streams/register/readable":`@gjsify/empty`,"web-streams/register/writable":`@gjsify/empty`,"web-streams/register/transform":`@gjsify/empty`,"web-streams/register/text-streams":`@gjsify/empty`,"web-streams/register/queuing":`@gjsify/empty`,"@gjsify/abort-controller/register":`@gjsify/empty`,"@gjsify/compression-streams/register":`@gjsify/empty`,"@gjsify/dom-events/register":`@gjsify/empty`,"@gjsify/dom-events/register/event-target":`@gjsify/empty`,"@gjsify/dom-events/register/custom-events":`@gjsify/empty`,"@gjsify/dom-events/register/ui-events":`@gjsify/empty`,"@gjsify/dom-events/register/global-event-target":`@gjsify/empty`,"@gjsify/dom-exception/register":`@gjsify/empty`,"@gjsify/message-channel/register":`@gjsify/empty`,"@gjsify/eventsource/register":`@gjsify/empty`,"@gjsify/websocket/register":`@gjsify/empty`,"@gjsify/fetch/register":`@gjsify/empty`,"@gjsify/fetch/register/fetch":`@gjsify/empty`,"@gjsify/fetch/register/xhr":`@gjsify/empty`,"@gjsify/webcrypto/register":`@gjsify/empty`,"@gjsify/web-streams/register":`@gjsify/empty`,"@gjsify/web-streams/register/readable":`@gjsify/empty`,"@gjsify/web-streams/register/writable":`@gjsify/empty`,"@gjsify/web-streams/register/transform":`@gjsify/empty`,"@gjsify/web-streams/register/text-streams":`@gjsify/empty`,"@gjsify/web-streams/register/queuing":`@gjsify/empty`,"@gjsify/dom-elements/register":`@gjsify/empty`,"@gjsify/dom-elements/register/document":`@gjsify/empty`,"@gjsify/dom-elements/register/canvas":`@gjsify/empty`,"@gjsify/dom-elements/register/image":`@gjsify/empty`,"@gjsify/dom-elements/register/observers":`@gjsify/empty`,"@gjsify/dom-elements/register/font-face":`@gjsify/empty`,"@gjsify/dom-elements/register/match-media":`@gjsify/empty`,"@gjsify/dom-elements/register/location":`@gjsify/empty`,"@gjsify/dom-elements/register/navigator":`@gjsify/empty`,"@gjsify/canvas2d/register":`@gjsify/empty`,"@gjsify/iframe/register":`@gjsify/empty`,"@gjsify/webgl/register":`@gjsify/empty`,"@gjsify/buffer/register":`@gjsify/empty`,xmlhttprequest:`@gjsify/empty`,"xmlhttprequest/register":`@gjsify/empty`,"@gjsify/xmlhttprequest":`@gjsify/empty`,"@gjsify/xmlhttprequest/register":`@gjsify/empty`,domparser:`@gjsify/empty`,"domparser/register":`@gjsify/empty`,"@gjsify/domparser/register":`@gjsify/empty`,webaudio:`@gjsify/empty`,"webaudio/register":`@gjsify/empty`,"@gjsify/webaudio/register":`@gjsify/empty`,gamepad:`@gjsify/empty`,"gamepad/register":`@gjsify/empty`,"@gjsify/gamepad/register":`@gjsify/empty`,webrtc:`@gjsify/empty`,"webrtc/register":`@gjsify/empty`,"webrtc/register/peer-connection":`@gjsify/empty`,"webrtc/register/data-channel":`@gjsify/empty`,"webrtc/register/error":`@gjsify/empty`,"webrtc/register/media":`@gjsify/empty`,"webrtc/register/media-devices":`@gjsify/empty`,"@gjsify/webrtc":`@gjsify/empty`,"@gjsify/webrtc/register":`@gjsify/empty`,"@gjsify/webrtc/register/peer-connection":`@gjsify/empty`,"@gjsify/webrtc/register/data-channel":`@gjsify/empty`,"@gjsify/webrtc/register/error":`@gjsify/empty`,"@gjsify/webrtc/register/media":`@gjsify/empty`,"@gjsify/webrtc/register/media-devices":`@gjsify/empty`,webassembly:`@gjsify/webassembly/globals`,"webassembly/register":`@gjsify/empty`,"webassembly/register/promise":`@gjsify/empty`,"@gjsify/webassembly/register":`@gjsify/empty`,"@gjsify/webassembly/register/promise":`@gjsify/empty`}}),setNodeAliasPrefix,getAliasesGeneralForGjs,getAliasesNodeForGjs,getAliasesWebForGjs,getAliasesGeneralForNode,getAliasesGjsForNode,getAliasesWebForNode,getAliasesForGjs,getAliasesForNode,Gv=__esmMin(()=>{Wv(),setNodeAliasPrefix=t=>{for(let n in t){if(n.startsWith(`node:`))continue;let S=`node:${n}`;t[S]||(t[S]=t[n])}return t},getAliasesGeneralForGjs=t=>Fv,getAliasesNodeForGjs=t=>setNodeAliasPrefix(Iv),getAliasesWebForGjs=t=>Bv,getAliasesGeneralForNode=t=>Vv,getAliasesGjsForNode=t=>Hv,getAliasesWebForNode=t=>Uv,getAliasesForGjs=t=>({...getDerivedAliasesSync(`gjs`),...getAliasesGeneralForGjs(t),...getAliasesNodeForGjs(t),...getAliasesWebForGjs(t)}),getAliasesForNode=t=>({...getDerivedAliasesSync(`node`),...getAliasesGeneralForNode(t),...getAliasesGjsForNode(t),...getAliasesWebForNode(t)}),[...Nv,...Nv.map(t=>`node:${t}`)],[...Pv]}),Kv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitWhen=t.flatten=void 0;function flatten(t){return t.reduce((t,n)=>[].concat(t,n),[])}t.flatten=flatten;function splitWhen(t,n){let S=[[]],C=0;for(let N of t)n(N)?(C++,S[C]=[]):S[C].push(N);return S}t.splitWhen=splitWhen})),qv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code===`ENOENT`}t.isEnoentCodeError=isEnoentCodeError})),Jv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDirentFromStats=void 0;var DirentFromStats=class{constructor(t,n){this.name=t,this.isBlockDevice=n.isBlockDevice.bind(n),this.isCharacterDevice=n.isCharacterDevice.bind(n),this.isDirectory=n.isDirectory.bind(n),this.isFIFO=n.isFIFO.bind(n),this.isFile=n.isFile.bind(n),this.isSocket=n.isSocket.bind(n),this.isSymbolicLink=n.isSymbolicLink.bind(n)}};function createDirentFromStats(t,n){return new DirentFromStats(t,n)}t.createDirentFromStats=createDirentFromStats})),Yv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=(a_(),__toCommonJS(Zg)),S=(Xn(),__toCommonJS(Pn)),C=n.platform()===`win32`,N=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,F=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,I=/^\\\\([.?])/,H=/\\(?![!()+@[\]{}])/g;function unixify(t){return t.replace(/\\/g,`/`)}t.unixify=unixify;function makeAbsolute(t,n){return S.resolve(t,n)}t.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)===`.`){let n=t.charAt(1);if(n===`/`||n===`\\`)return t.slice(2)}return t}t.removeLeadingDotSegment=removeLeadingDotSegment,t.escape=C?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(F,`\\$2`)}t.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(N,`\\$2`)}t.escapePosixPath=escapePosixPath,t.convertPathToPattern=C?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(I,`//$1`).replace(H,`/`)}t.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}t.convertPosixPathToPattern=convertPosixPathToPattern})),Xv=__commonJSMin(((t,n)=>{
652
+ `)} (same as ${I+1}.)`)}}getSearchPlacesForDir(t,n){return(t.isGlobalConfig?n:this.config.searchPlaces).map(n=>N.default.join(t.path,n))}getGlobalConfigDir(){return(0,S.default)(this.config.moduleName,{suffix:``}).config}*getGlobalDirs(t){let n=N.default.resolve(this.config.stopDir??C.default.homedir());yield{path:t,isGlobalConfig:!1};let S=t;for(;S!==n;){let t=N.default.dirname(S);if(t===S)break;yield{path:t,isGlobalConfig:!1},S=t}yield{path:this.getGlobalConfigDir(),isGlobalConfig:!0}}};t.ExplorerBase=ExplorerBase;function getExtensionDescription(t){return t?`extension "${t}"`:`files without extensions`}})),k_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=void 0,t.mergeAll=mergeAll,t.hasOwn=Function.prototype.call.bind(Object.prototype.hasOwnProperty);let n=Function.prototype.call.bind(Object.prototype.toString);function isPlainObject(t){return n(t)===`[object Object]`}function merge(n,S,C){for(let N of Object.keys(S)){if(N===`__proto__`||N===`constructor`)continue;let F=S[N];if((0,t.hasOwn)(n,N)){if(Array.isArray(n[N])&&Array.isArray(F)){if(C.mergeArrays){n[N].push(...F);continue}}else if(isPlainObject(n[N])&&isPlainObject(F)){n[N]=merge(n[N],F,C);continue}}n[N]=F}return n}function mergeAll(t,n){return t.reduce((t,S)=>merge(t,S,n),{})}})),A_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Explorer=void 0;let S=n((Bd(),__toCommonJS(Ld))),C=n((Xn(),__toCommonJS(Pn))),N=T_(),F=O_(),I=k_(),H=D_();var Explorer=class extends F.ExplorerBase{async load(t){t=C.default.resolve(t);let load=async()=>await this.config.transform(await this.#e(t));return this.loadCache?await(0,H.emplace)(this.loadCache,t,load):await load()}async search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=await this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=await n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=async()=>{if(await(0,H.isDirectory)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlaces))try{let n=await this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return await this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=await n.next();return t.done?await this.config.transform(null):(F=t.value,this.searchCache?await(0,H.emplace)(this.searchCache,F.path,search):await search())};return this.searchCache?await(0,H.emplace)(this.searchCache,t,search):await search()}async#e(t,n=[]){let C=await S.default.readFile(t,{encoding:`utf-8`});return this.toCosmiconfigResult(t,await this.#t(t,C,n))}async#t(t,n,S){let N=await this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=await Promise.all(q.map(async t=>{let n=C.default.resolve(F,t);return(await this.#e(n,Y))?.config}));return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}async#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=await N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}async#r(t){try{return await S.default.stat(t),!0}catch{return!1}}async*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(await this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}};t.Explorer=Explorer})),j_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerSync=void 0;let S=n((rf(),__toCommonJS(tf))),C=n((Xn(),__toCommonJS(Pn))),N=T_(),F=O_(),I=k_(),H=D_();var ExplorerSync=class extends F.ExplorerBase{load(t){t=C.default.resolve(t);let load=()=>this.config.transform(this.#e(t));return this.loadCache?(0,H.emplace)(this.loadCache,t,load):load()}search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=()=>{if((0,H.isDirectorySync)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlacesSync))try{let n=this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=n.next();return t.done?this.config.transform(null):(F=t.value,this.searchCache?(0,H.emplace)(this.searchCache,F.path,search):search())};return this.searchCache?(0,H.emplace)(this.searchCache,t,search):search()}#e(t,n=[]){let C=S.default.readFileSync(t,`utf8`);return this.toCosmiconfigResult(t,this.#t(t,C,n))}#t(t,n,S){let N=this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=q.map(t=>{let n=C.default.resolve(F,t);return this.#e(n,Y)?.config});return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}#r(t){try{return S.default.statSync(t),!0}catch{return!1}}*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}loadSync(t){return this.load(t)}searchSync(t=``){return this.search(t)}};t.ExplorerSync=ExplorerSync})),M_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=t.getDefaultSearchPlacesSync=t.getDefaultSearchPlaces=void 0,t.cosmiconfig=cosmiconfig;let n=T_();Object.defineProperty(t,"defaultLoaders",{enumerable:!0,get:function(){return n.defaultLoaders}}),Object.defineProperty(t,"defaultLoadersSync",{enumerable:!0,get:function(){return n.defaultLoadersSync}}),Object.defineProperty(t,"getDefaultSearchPlaces",{enumerable:!0,get:function(){return n.getDefaultSearchPlaces}}),Object.defineProperty(t,"getDefaultSearchPlacesSync",{enumerable:!0,get:function(){return n.getDefaultSearchPlacesSync}}),Object.defineProperty(t,"globalConfigSearchPlaces",{enumerable:!0,get:function(){return n.globalConfigSearchPlaces}}),Object.defineProperty(t,"globalConfigSearchPlacesSync",{enumerable:!0,get:function(){return n.globalConfigSearchPlacesSync}});let S=A_(),C=j_(),N=D_(),F=function identity(t){return t};function getUserDefinedOptionsFromMetaConfig(){let t=new C.ExplorerSync({moduleName:`cosmiconfig`,stopDir:process.cwd(),searchPlaces:n.metaSearchPlaces,ignoreEmptySearchPlaces:!1,applyPackagePropertyPathToConfiguration:!0,loaders:n.defaultLoaders,transform:F,cache:!0,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:`none`}).search();if(!t)return null;if(t.config?.loaders)throw Error(`Can not specify loaders in meta config file`);if(t.config?.searchStrategy)throw Error(`Can not specify searchStrategy in meta config file`);let S={mergeSearchPlaces:!0,...t.config??{}};return{config:(0,N.removeUndefinedValuesFromObject)(S),filepath:t.filepath}}function getResolvedSearchPlaces(t,n,S){let C=S.searchPlaces?.map(n=>n.replace(`{name}`,t));return S.mergeSearchPlaces?[...C??[],...n]:C??n}function mergeOptionsBase(t,n,S){let C=getUserDefinedOptionsFromMetaConfig();if(!C)return{...n,...(0,N.removeUndefinedValuesFromObject)(S),loaders:{...n.loaders,...S.loaders}};let F=C.config,I=S.searchPlaces??n.searchPlaces;return{...n,...(0,N.removeUndefinedValuesFromObject)(S),metaConfigFilePath:C.filepath,...F,searchPlaces:getResolvedSearchPlaces(t,I,F),loaders:{...n.loaders,...S.loaders}}}function validateOptions(t){if(t.searchStrategy!=null&&t.searchStrategy!==`global`&&t.stopDir)throw Error('Can not supply `stopDir` option with `searchStrategy` other than "global"')}function mergeOptions(t,S){return validateOptions(S),mergeOptionsBase(t,{moduleName:t,searchPlaces:(0,n.getDefaultSearchPlaces)(t),ignoreEmptySearchPlaces:!0,cache:!0,transform:F,loaders:n.defaultLoaders,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:S.stopDir?`global`:`none`},S)}function cosmiconfig(t,n={}){let C=mergeOptions(t,n),N=new S.Explorer(C);return{search:N.search.bind(N),load:N.load.bind(N),clearLoadCache:N.clearLoadCache.bind(N),clearSearchCache:N.clearSearchCache.bind(N),clearCaches:N.clearCaches.bind(N)}}}));function isBun(){return globalThis.Bun!==void 0}function isDeno(){return globalThis.Deno!==void 0}function isGjs(){return globalThis.imports?.gi!==void 0}function hostRuntime$1(){return isBun()?`bun`:isDeno()?`deno`:isGjs()?`gjs`:`node`}function isNode(){return isBun()||isDeno()||isGjs()?!1:typeof globalThis.process?.versions?.node==`string`}function gjsSystemVersion(){return globalThis.imports?.system?.version}function gjsExit(t){let n=globalThis.imports?.system;return n?.exit?(n.exit(t),!0):!1}var N_=__esmMin(()=>{__name$1(hostRuntime$1,`hostRuntime`)}),P_,__exportAll,F_=__esmMin(()=>{P_=Object.defineProperty,__exportAll=(t,n)=>{let S={};for(var C in t)P_(S,C,{get:t[C],enumerable:!0});return n||P_(S,Symbol.toStringTag,{value:`Module`}),S}});function communicateWithTimeout(t,n,S,C){let N={stdout:null,stderr:null,timedOut:!1,error:null},F=vt.MainContext.new(),I=null,H=!1;F.push_thread_default();try{for(t.communicate_async(n,null,(n,S)=>{try{let n=t.communicate_finish(S);N.stdout=n[1]??null,N.stderr=n[2]??null}catch(t){N.error=t}H=!0}),I=vt.timeout_source_new(S),I.set_callback(()=>(N.timedOut=!0,C(),vt.SOURCE_REMOVE)),I.attach(F);!H;)F.iteration(!0)}finally{I!==null&&I.destroy(),F.pop_thread_default()}return N}var I_=__esmMin(()=>{yt()});function defaultShell$1(){return R_===null&&(R_=!vt.file_test(`/bin/sh`,vt.FileTest.IS_EXECUTABLE)&&vt.file_test(`/system/bin/sh`,vt.FileTest.IS_EXECUTABLE)?`/system/bin/sh`:`/bin/sh`),R_}function shellArgv$2(t,n){return[typeof n==`string`&&n.length>0?n:defaultShell$1(),`-c`,t]}function argv0Shell(){return z_===void 0&&(z_=vt.find_program_in_path(`bash`)??vt.find_program_in_path(`zsh`)),z_??defaultShell$1()}function applyArgv0$2(t,n){return[argv0Shell(),`-c`,`exec -a "$0" "$@"`,t,...n]}function detachedPrefix$3(){return B_===void 0&&(B_=vt.find_program_in_path(`setsid`)),B_===null?null:[B_]}function killProcess$4(t,n,S){let C=n??`SIGTERM`;if(C===`SIGKILL`||C===9){t.force_exit();return}let N=typeof C==`number`?C:S[C]??S.SIGTERM;t.send_signal(N)}var L_,R_,z_,B_,V_=__esmMin(()=>{yt(),L_=Object.freeze({SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGFPE:8,SIGKILL:9,SIGSEGV:11,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28}),R_=null,__name$1(defaultShell$1,`defaultShell`),__name$1(shellArgv$2,`shellArgv`),__name$1(applyArgv0$2,`applyArgv0`),__name$1(detachedPrefix$3,`detachedPrefix`),__name$1(killProcess$4,`killProcess`)});function detachedPrefix$2(){if(U_===void 0){let t=vt.find_program_in_path(`setsid`);U_=t===null?vt.file_test(`/usr/bin/perl`,vt.FileTest.IS_EXECUTABLE)?[`/usr/bin/perl`,`-e`,`use POSIX (); POSIX::setsid(); exec { $ARGV[0] } @ARGV or die "exec: $!"`,`--`]:null:[t]}return U_}function killProcess$3(t,n){killProcess$4(t,n,W_)}var H_,U_,W_,G_=__esmMin(()=>{F_(),V_(),yt(),H_=__exportAll({SIGNALS:()=>W_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$3,shellArgv:()=>shellArgv$2}),__name$1(detachedPrefix$2,`detachedPrefix`),W_=Object.freeze({...L_,SIGEMT:7,SIGBUS:10,SIGSYS:12,SIGURG:16,SIGSTOP:17,SIGTSTP:18,SIGCONT:19,SIGCHLD:20,SIGTTIN:21,SIGTTOU:22,SIGIO:23,SIGUSR1:30,SIGUSR2:31}),__name$1(killProcess$3,`killProcess`)});function killProcess$2(t,n){killProcess$4(t,n,q_)}var K_,q_,J_=__esmMin(()=>{F_(),V_(),K_=__exportAll({SIGNALS:()=>q_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$3,killProcess:()=>killProcess$2,shellArgv:()=>shellArgv$2}),q_=Object.freeze({...L_,SIGBUS:7,SIGUSR1:10,SIGUSR2:12,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGIO:29,SIGPOLL:29,SIGPWR:30,SIGSYS:31}),__name$1(killProcess$2,`killProcess`)});function defaultShell(){return vt.getenv(`ComSpec`)||`cmd.exe`}function shellArgv$1(t,n){let S=typeof n==`string`&&n.length>0?n:defaultShell();return X_.test(S)?[S,`/d`,`/s`,`/c`,`"${t}"`]:[S,`-c`,t]}function detachedPrefix$1(){return null}function applyArgv0$1(t,n){let S=Error(`options.argv0 (${t}) is not supported on Windows: GSubprocess cannot decouple the executable path from the child's argv[0]`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function killProcess$1(t,n){t.force_exit()}var Y_,X_,Z_,Q_=__esmMin(()=>{F_(),yt(),Y_=__exportAll({SIGNALS:()=>Z_,applyArgv0:()=>applyArgv0$1,defaultShell:()=>defaultShell,detachedPrefix:()=>detachedPrefix$1,killProcess:()=>killProcess$1,shellArgv:()=>shellArgv$1}),X_=/^(?:.*\\)?cmd(?:\.exe)?$/i,__name$1(shellArgv$1,`shellArgv`),__name$1(detachedPrefix$1,`detachedPrefix`),__name$1(applyArgv0$1,`applyArgv0`),__name$1(killProcess$1,`killProcess`),Z_=Object.freeze({SIGINT:2,SIGKILL:9,SIGTERM:15})});function detectPlatform(){return ev===null&&(ev=vt.get_current_dir().startsWith(`/`)?vt.file_test(`/proc/self/status`,vt.FileTest.EXISTS)?!vt.file_test(`/bin/sh`,vt.FileTest.IS_EXECUTABLE)&&vt.file_test(`/system/bin/sh`,vt.FileTest.IS_EXECUTABLE)?`android`:`linux`:vt.file_test(`/System/Library/CoreServices/SystemVersion.plist`,vt.FileTest.EXISTS)?`darwin`:`posix`:`win32`),ev}function ops(){switch(detectPlatform()){case`win32`:return Y_;case`darwin`:return H_;case`linux`:case`android`:return K_;default:return $_}}function shellArgv(t,n){return ops().shellArgv(t,n)}function detachedPrefix(){return ops().detachedPrefix()}function applyArgv0(t,n){return ops().applyArgv0(t,n)}function killProcess(t,n){ops().killProcess(t,n)}var $_,ev,tv=__esmMin(()=>{V_(),G_(),J_(),Q_(),yt(),$_={defaultShell:defaultShell$1,shellArgv:shellArgv$2,detachedPrefix:detachedPrefix$3,applyArgv0:applyArgv0$2,killProcess:(t,n)=>killProcess$4(t,n,L_),SIGNALS:L_},ev=null});function resolveNativeSab(t){if(!t)return null;let n;try{n=t.GjsifySabNative}catch{return null}if(!n||typeof n!=`object`)return null;let S=openNativeLibrary(`GjsifySabNative`,t);if(S)return ge.debug(S.message),null;let C=n;return typeof C.SharedBuffer?.create!=`function`||typeof C.FdChannel?.make_pair!=`function`?null:C}var nv,rv,iv,av=__esmMin(()=>{_e(),Ye(),nv=globalThis,rv=resolveNativeSab(nv.imports?.gi),iv=rv?{makePair(){let[t,n,S]=rv.FdChannel.make_pair();if(!t)throw Error(`socketpair() failed`);return{parentFd:n,childFd:S}},makeStreamPair(){if(typeof rv.FdChannel.make_stream_pair!=`function`)return null;let[t,n,S]=rv.FdChannel.make_stream_pair();if(!t)throw Error(`socketpair() failed`);return{parentFd:n,childFd:S}},sendFd(t,n,S){return rv.FdChannel.send_fd(t,n,S>>>0)},recvFd(t){let[n,S]=rv.FdChannel.recv_fd(t);if(n===0)return null;if(n<0)throw Error(`recvmsg failed`);return{fd:n,tag:S>>>0}},closeFd(t){rv.FdChannel.close_fd(t)}}:null});function _gioErrorToNodeError(t,n,S){let C=t??Error(`Unknown spawn error`),N=C,F=C.code,I=C.matches,H=!1;if(typeof I==`function`)try{H=I.call(C,vt.SpawnError,vt.SpawnError.NOENT)===!0}catch{}if(!H&&F===vt.SpawnError.NOENT&&(H=!0),!H&&typeof C.message==`string`&&/No such file or directory|ENOENT|Failed to execute|nicht gefunden|nicht ausgeführt/i.test(C.message)&&(H=!0),H){let t=Error(`spawn ${n} ENOENT`);return t.code=`ENOENT`,t.errno=-2,t.syscall=`spawn ${n}`,t.path=n,t.spawnargs=S.slice(),t}if(C instanceof Error)return N;let W=C,q=typeof W.message==`string`?W.message:String(C),Y=Error(q);return(typeof F==`number`||typeof F==`string`)&&(Y.code=F),Y}function _normalizeCwd(t){if(t!=null){if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.href==`string`&&typeof t.protocol==`string`){let n=t;if(n.protocol!==`file:`)throw TypeError(`The URL must be of scheme file:; received '${n.protocol}' for 'options.cwd'`);return fileURLToPath(n)}return t instanceof Uint8Array?new TextDecoder().decode(t):String(t)}}function _encodeEnvValue(t){if(t!==void 0)return`${t}`}function _spawnSubprocess(t,n,S){let C=new Pi.SubprocessLauncher({flags:n}),N=_normalizeCwd(S?.cwd);if(N!==void 0&&C.set_cwd(N),S?.env){let t=S.env;C.set_environ([]);let n=new Set;for(let S in t){if(n.has(S))continue;n.add(S);let N=_encodeEnvValue(t[S]);N!==void 0&&C.setenv(S,N,!0)}}for(let[t,n]of Object.entries(S?.extraEnv??{}))C.setenv(t,n,!0);for(let{source:t,target:n}of S?.takeFds??[])C.take_fd(t,n);let F=t;if(S?.argv0!==void 0&&S.argv0!==null){if(typeof S.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof S.argv0}`);F=applyArgv0(S.argv0,t)}if(S?.detached===!0){let t=detachedPrefix();t!==null&&(F=[...t,...F])}let I;try{I=C.spawnv(F)}finally{S?.takeFds?.length&&queueMicrotask(()=>C.close())}let H=_capturePidAtSpawn(I);return{proc:I,pid:H}}function _capturePidAtSpawn(t){let n=t.get_identifier();if(n){let t=parseInt(n,10);if(t>0)return t}return 0}function _watchStdioForClose(t,n=!1){let S=[t.stdout,t.stderr].filter(t=>t!==null);if(S.length===0&&!n)return(n,S)=>{t.emit(`exit`,n,S),t.emit(`close`,n,S)};let C=S.length+ +!!n,N=!1,F=null,I=null,closeIfDone=()=>{N&&C===0&&t.emit(`close`,F,I)};for(let t of S){let n=!1,settleOnce=()=>{n||(n=!0,--C,closeIfDone())};t.once(`end`,settleOnce),t.once(`close`,settleOnce)}return n&&t.once(`disconnect`,()=>{--C,closeIfDone()}),(n,C)=>{F=n,I=C,N=!0,t.emit(`exit`,n,C),queueMicrotask(()=>{for(let t of S)t.destroyed||t.readableEnded||t.listenerCount(`data`)>0||t.listenerCount(`readable`)>0||t.resume()}),closeIfDone()}}function _communicateSync(t,n,S,C){if(S<=0){let S=t.communicate(n,null);return{stdout:S[1]??null,stderr:S[2]??null,timedOut:!1}}let N=communicateWithTimeout(t,n,S,()=>{killProcess(t,C??`SIGTERM`)});if(N.error)throw N.error;return{stdout:N.stdout,stderr:N.stderr,timedOut:N.timedOut}}function _syncTimeoutError(t,n,S,C,N){let F=n?gbytesToUint8Array(n):new Uint8Array,I=S?gbytesToUint8Array(S):new Uint8Array,H=new TextDecoder().decode(I),W=Error(`Command failed: ${t}\n${H}`);return W.code=`ETIMEDOUT`,W.killed=!0,W.signal=typeof N==`string`?N:`SIGTERM`,W.status=null,C===`buffer`||C===null?(W.stdout=ot.from(F),W.stderr=ot.from(I)):(W.stdout=new TextDecoder().decode(F),W.stderr=H),W}function _decodeExecOutput(t,n){let S=t??new Uint8Array;if(n===`buffer`||n===null)return ot.from(S);let C=n&&ot.isEncoding(n)?n:`utf8`;return ot.from(S).toString(C)}function _normalizeKillSignal(t){return t??`SIGTERM`}function _exec(t,n,S){typeof n==`function`&&(S=n,n={});let C=n||{},N=new ChildProcess,F=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE,I=C.maxBuffer??1024*1024,H=C.timeout&&C.timeout>0?C.timeout:0,W=_normalizeKillSignal(C.killSignal),q=C.signal;return _execImpl(N,shellArgv(t,C.shell),F,C,{cmd:t,encoding:C.encoding,maxBuffer:I,timeoutMs:H,killSignal:W,abortSignal:q,callback:S})}function _absorbExecError(){}function _execImpl(t,n,S,C,N){t.on(`error`,_absorbExecError);let F=null,I=!1,H=null,W=null,armTimeout=n=>{N.timeoutMs&&(F=setTimeout(()=>{I=!0;try{killProcess(n,N.killSignal)}catch{}t.killed=!0},N.timeoutMs))},disarmTimeout=()=>{F!==null&&(clearTimeout(F),F=null)},armAbort=n=>{if(!N.abortSignal)return;let fire=()=>{H=Error(`The operation was aborted`),H.name=`AbortError`;try{killProcess(n,N.killSignal)}catch{}t.killed=!0};if(N.abortSignal.aborted){queueMicrotask(fire);return}W=fire,N.abortSignal.addEventListener(`abort`,W,{once:!0})},disarmAbort=()=>{N.abortSignal&&W&&(N.abortSignal.removeEventListener(`abort`,W),W=null)};try{let{proc:F,pid:W}=_spawnSubprocess(n,S,C);t._setSubprocess(F,W),ov.add(t),armTimeout(F),armAbort(F);let q=_watchStdioForClose(t);t._holdProcess(),F.communicate_async(null,null,(n,S)=>{disarmTimeout(),disarmAbort(),ov.delete(t);try{let[,n,C]=F.communicate_finish(S),W=n?gbytesToUint8Array(n):null,Y=C?gbytesToUint8Array(C):null,X=null;N.maxBuffer!==1/0&&W&&W.length>N.maxBuffer&&(W=W.subarray(0,N.maxBuffer),X=RangeError(`stdout maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`),!X&&N.maxBuffer!==1/0&&Y&&Y.length>N.maxBuffer&&(Y=Y.subarray(0,N.maxBuffer),X=RangeError(`stderr maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`);let Z=_decodeExecOutput(W,N.encoding),te=_decodeExecOutput(Y,N.encoding),ne=F.get_if_exited()?F.get_exit_status():null,re=F.get_if_signaled()?typeof N.killSignal==`string`?N.killSignal:`SIGTERM`:null;t.exitCode=ne,t.signalCode=re;let ie=null;if(H)ie=H,ie.killed=!0,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(X)ie=X,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(I)ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.code=null,ie.signal=typeof N.killSignal==`string`?N.killSignal:`SIGTERM`,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(ne!==0&&ne!==null){let n=typeof te==`string`?te:te.toString();ie=Error(`Command failed: ${N.cmd}\n${n}`),ie.code=ne,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd}else re&&(ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.signal=re,ie.code=null,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd);N.callback&&N.callback(ie,Z,te),q(ne,re)}catch(n){let S=n instanceof Error?n:Error(String(n));N.callback&&N.callback(S,``,``),t.emit(`error`,S)}}),queueMicrotask(()=>t.emit(`spawn`))}catch(S){disarmTimeout(),disarmAbort();let C=_gioErrorToNodeError(S,n[0]??``,n.slice(1));setTimeout(()=>{N.callback&&N.callback(C,``,``),t.emit(`error`,C)},0)}return t}function execFile(t,n,S,C){let N=[],F={},I;typeof n==`function`?I=n:Array.isArray(n)?(N=n,typeof S==`function`?I=S:(F=S||{},I=C)):n&&typeof n==`object`&&(F=n,I=typeof S==`function`?S:C);let H=new ChildProcess,W=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE,q=F.maxBuffer??1024*1024,Y=F.timeout&&F.timeout>0?F.timeout:0,X=_normalizeKillSignal(F.killSignal);return _execImpl(H,[t,...N],W,F,{cmd:t,encoding:F.encoding,maxBuffer:q,timeoutMs:Y,killSignal:X,abortSignal:F.signal,callback:I})}function definePromisifiedExec(t){Object.defineProperty(t,Symbol.for(`nodejs.util.promisify.custom`),{enumerable:!1,value:(...n)=>{let S,C=new Promise((C,N)=>{let callback=(t,n,S)=>{t===null?C({stdout:n,stderr:S}):(t.stdout=n,t.stderr=S,N(t))};S=t(...n,callback)});return C.child=S,C}})}function execFileSync(t,n,S){let C=[],N;Array.isArray(n)?(C=n,N=S):n&&typeof n==`object`&&(N=n);let F=N?.encoding,I=N?.input,H=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE|(I?Pi.SubprocessFlags.STDIN_PIPE:Pi.SubprocessFlags.NONE),W;try{({proc:W}=_spawnSubprocess([t,...C],H,N))}catch(n){throw _gioErrorToNodeError(n,t,C)}let q=I?new vt.Bytes(typeof I==`string`?new TextEncoder().encode(I):I):null,Y=N?.timeout&&N.timeout>0?N.timeout:0,{stdout:X,stderr:Z,timedOut:te}=_communicateSync(W,q,Y,N?.killSignal);if(te)throw _syncTimeoutError(`${t} ${C.join(` `)}`.trim(),X,Z,F,N?.killSignal);let ne=W.get_exit_status();if(ne!==0){let n=Z?new TextDecoder().decode(gbytesToUint8Array(Z)):``,S=X?new TextDecoder().decode(gbytesToUint8Array(X)):``,N=Error(`Command failed: ${t} ${C.join(` `)}`);throw N.status=ne,F===`buffer`||F===null?(N.stderr=Z?ot.from(gbytesToUint8Array(Z)):ot.alloc(0),N.stdout=X?ot.from(gbytesToUint8Array(X)):ot.alloc(0)):(N.stderr=n,N.stdout=S),N}if(!X)return F===`buffer`||F==null?ot.alloc(0):``;let re=gbytesToUint8Array(X);if(F===`buffer`||F==null)return ot.from(re);let ie=ot.isEncoding(F)?F:`utf8`;return ot.from(re).toString(ie)}function spawn(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=new ChildProcess,H=N?.shell,W;W=H?shellArgv([t,...F].join(` `),H):[t,...F];let q=N?.stdio,Y=Array.isArray(q)?[typeof q[0]==`string`?q[0]:`pipe`,typeof q[1]==`string`?q[1]:`pipe`,typeof q[2]==`string`?q[2]:`pipe`]:typeof q==`string`?[q,q,q]:[`pipe`,`pipe`,`pipe`],X=Pi.SubprocessFlags.NONE;Y[0]===`pipe`?X|=Pi.SubprocessFlags.STDIN_PIPE:Y[0]===`inherit`&&(X|=Pi.SubprocessFlags.STDIN_INHERIT),Y[1]===`pipe`&&(X|=Pi.SubprocessFlags.STDOUT_PIPE),Y[1]===`ignore`&&(X|=Pi.SubprocessFlags.STDOUT_SILENCE),Y[2]===`pipe`&&(X|=Pi.SubprocessFlags.STDERR_PIPE),Y[2]===`ignore`&&(X|=Pi.SubprocessFlags.STDERR_SILENCE);let Z=_openIpcSlot(q,N?.serialization);try{let{proc:t,pid:n}=_spawnSubprocess(W,X,{...N,takeFds:Z?[{source:Z.childFd,target:Z.slot}]:void 0,extraEnv:Z?{NODE_CHANNEL_FD:String(Z.slot),NODE_CHANNEL_SERIALIZATION_MODE:`json`}:void 0});if(I._setSubprocess(t,n),ov.add(I),Z&&setupNodeChannel(I,Z.parentFd),Y[0]===`pipe`){let n=t.get_stdin_pipe();n&&(I.stdin=new GioOutputStreamWritable(n))}let S=t.get_stdout_pipe();S&&(I.stdout=new GioInputStreamReadable(S));let C=t.get_stderr_pipe();C&&(I.stderr=new GioInputStreamReadable(C));let F=_watchStdioForClose(I,Z!==null);I._holdProcess();let H=N?.signal,q=null,emitAbortError=()=>{let t=N?.killSignal??`SIGTERM`;I.kill(t);let n=Error(`The operation was aborted`);n.name=`AbortError`,I.emit(`error`,n)};H&&(H.aborted?queueMicrotask(emitAbortError):(q=emitAbortError,H.addEventListener(`abort`,q,{once:!0})));let te=null;if(N?.timeout&&N.timeout>0){let t=N.killSignal??`SIGTERM`;te=setTimeout(()=>{I.kill(t),te=null},N.timeout)}t.wait_async(null,(n,S)=>{try{t.wait_finish(S);let n=t.get_if_exited()?t.get_exit_status():null,C=null;if(t.get_if_signaled()){let t=N?.killSignal;C=typeof t==`string`?t:`SIGTERM`}I.exitCode=n,I.signalCode=C,te!==null&&(clearTimeout(te),te=null),H&&q&&H.removeEventListener(`abort`,q),I.stdin&&!I.stdin.destroyed&&I.stdin.destroy(),F(n,C)}catch(t){I.emit(`error`,t instanceof Error?t:Error(String(t)))}ov.delete(I)}),queueMicrotask(()=>I.emit(`spawn`))}catch(n){Z&&!I.channel&&iv?.closeFd(Z.parentFd),deferEmit(I,`error`,_gioErrorToNodeError(n,H?t:W[0]??``,H?F:W.slice(1)))}return I}function _codedError(t,n,S){let C=new t(S);return C.code=n,C}function _openIpcSlot(t,n){if(!Array.isArray(t))return null;let S=t.indexOf(`ipc`);if(S===-1)return null;if(t.indexOf(`ipc`,S+1)!==-1)throw _codedError(Error,`ERR_IPC_ONE_PIPE`,`Child process can have only one IPC pipe`);if(S<3)throw _codedError(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`An 'ipc' channel on stdin, stdout or stderr is not supported under GJS`);if(n!==void 0&&n!==`json`)throw _codedError(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`serialization: '${n}' is not supported under GJS yet; use 'json'`);let C=iv?.makeStreamPair()??null;if(!C)throw _codedError(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`An 'ipc' channel needs @gjsify/sab-native with make_stream_pair, which this install lacks`);return{slot:S,parentFd:C.parentFd,childFd:C.childFd}}function spawnSync(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=N?.shell,H=N?.input,W;W=I?shellArgv([t,...F].join(` `),I):[t,...F];let q=N?.timeout&&N.timeout>0?N.timeout:0,Y=Pi.SubprocessFlags.STDOUT_PIPE|Pi.SubprocessFlags.STDERR_PIPE|(H?Pi.SubprocessFlags.STDIN_PIPE:Pi.SubprocessFlags.NONE),X=H;if(X!=null&&typeof X!=`string`&&!(X instanceof Uint8Array)&&!(X instanceof ArrayBuffer)&&!ArrayBuffer.isView(X))throw TypeError(`The "input" property must be of type string, Buffer, TypedArray, or DataView. Received type ${typeof X}`);let Z=N?.encoding,te=Z===`buffer`||Z==null?ot.alloc(0):``,ne,re=0;try{({proc:ne,pid:re}=_spawnSubprocess(W,Y,N))}catch(n){let S=I?t:W[0]??``,C=I?F:W.slice(1);return{pid:0,output:[null,te,te],stdout:te,stderr:te,status:null,signal:null,error:_gioErrorToNodeError(n,S,C)}}let ie=H?new vt.Bytes(typeof H==`string`?new TextEncoder().encode(H):H):null,ae,oe,Q=null,se=!1;try{if(q>0){let t=communicateWithTimeout(ne,ie,q,()=>{killProcess(ne,N?.killSignal??`SIGTERM`)});if(se=t.timedOut,t.error)throw t.error;ae=t.stdout,oe=t.stderr}else{let t=ne.communicate(ie,null);ae=t[1]??null,oe=t[2]??null}}catch(t){Q=t instanceof Error?t:Error(String(t)),ae=null,oe=null}let ce=ae?ot.from(gbytesToUint8Array(ae)):ot.alloc(0),le=oe?ot.from(gbytesToUint8Array(oe)):ot.alloc(0),decode=t=>{if(Z===`buffer`||Z==null)return t;let n=ot.isEncoding(Z)?Z:`utf8`;return t.toString(n)},ue=decode(ce),de=decode(le),fe=ne.get_if_exited()?ne.get_exit_status():null,pe=null;if(ne.get_if_signaled()){let t=N?.killSignal;pe=typeof t==`string`?t:`SIGTERM`}se&&(pe=typeof N?.killSignal==`string`?N.killSignal:`SIGTERM`);let me={pid:re,output:[null,ue,de],stdout:ue,stderr:de,status:se?null:fe,signal:pe};if(se){let t=Error(`Command failed: ${W.join(` `)}\n${typeof de==`string`?de:de.toString()}`);t.code=`ETIMEDOUT`,t.killed=!0,t.signal=pe,me.error=t}else Q&&(me.error=Q);return me}var GioInputStreamReadable,GioOutputStreamWritable,ov,ChildProcess,sv=__esmMin(()=>{I_(),tv(),yt(),Fi(),on(),ht(),xa(),cr(),Co(),Ue(),vn(),av(),GioInputStreamReadable=class extends ha{_stream;_cancellable=new Pi.Cancellable;constructor(t){super(),this._stream=t}_read(t){this._stream.read_bytes_async(Math.max(t,4096),vt.PRIORITY_DEFAULT,this._cancellable,trackedCallback((t,n)=>{try{let t=this._stream.read_bytes_finish(n).get_data();!t||t.length===0?this.push(null):this.push(ot.from(t))}catch(t){this._cancellable.is_cancelled()||this.destroy(t)}}))}_destroy(t,n){this._cancellable.cancel(),n(t)}},GioOutputStreamWritable=class extends ga{_stream;_cancellable=new Pi.Cancellable;_closed=!1;constructor(t){super(),this._stream=t}_write(t,n,S){if(this._closed){S(Error(`write after end`));return}let C=typeof t==`string`?ot.from(t):t instanceof Uint8Array?t:ot.from(t);this._stream.write_bytes_async(new vt.Bytes(C),vt.PRIORITY_DEFAULT,this._cancellable,trackedCallback((t,n)=>{try{this._stream.write_bytes_finish(n),S()}catch(t){this._cancellable.is_cancelled()?S():S(t)}}))}_final(t){if(this._closed){t();return}this._closed=!0;try{this._stream.close(null)}catch{}t()}_destroy(t,n){if(this._cancellable.cancel(),!this._closed){this._closed=!0;try{this._stream.close(null)}catch{}}n(t)}},ov=new Set,ChildProcess=class extends Jt{pid;exitCode=null;signalCode=null;killed=!1;connected=!1;stdin=null;stdout=null;stderr=null;get stdio(){return[this.stdin,this.stdout,this.stderr]}_subprocess=null;_setSubprocess(t,n){this._subprocess=t,n>0&&(this.pid=n)}kill(t){if(!this._subprocess)return!1;try{return killProcess(this._subprocess,t??`SIGTERM`),this.killed=!0,!0}catch{return!1}}_holdsProcess=!1;_closed=!1;_holdProcess(){this.once(`close`,()=>{this._closed=!0,this._dropHold()}),this._acquireHold()}_acquireHold(){this._holdsProcess||this._closed||(this._holdsProcess=!0,acquireMainLoop())}_dropHold(){this._holdsProcess&&(this._holdsProcess=!1,setTimeout(releaseMainLoop,0))}ref(){return this._acquireHold(),this}unref(){return this._dropHold(),this}},definePromisifiedExec(_exec),definePromisifiedExec(execFile)});function lookupEnv(t,n){let S=n.toLowerCase();for(let n of Object.keys(t))if(n.toLowerCase()===S&&t[n]!==void 0)return t[n]}function escapeCmdCommand(t){return t.replace(dv,`^$1`)}function escapeCmdArgument(t,n=!1){let S=`${t}`;return S=S.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),S=S.replace(/(?=(\\+?)?)\1$/,`$1$1`),S=`"${S}"`,S=S.replace(dv,`^$1`),n&&(S=S.replace(dv,`^$1`)),S}function buildCmdExeInvocation(t,n,S=`cmd.exe`){let C=uv.test(t);return{cmd:S,args:[`/d`,`/s`,`/c`,`"${[escapeCmdCommand(t),...n.map(t=>escapeCmdArgument(t,C))].join(` `)}"`],windowsVerbatimArguments:!0}}function isBareName(t){return!t.includes(`/`)&&!t.includes(`\\`)&&!/\.[^.]+$/.test(t)}function findOnPath(t,n){let S=n.platform===`win32`,C=(lookupEnv(n.env,`PATH`)??``).split(S?`;`:`:`).filter(Boolean),N=S&&!/\.[^.\\/]+$/.test(t)?(lookupEnv(n.env,`PATHEXT`)??cv).split(`;`).filter(Boolean):[``];for(let S of C)for(let C of N){let N=n.join(S,t+C);if(n.exists(N))return N}}function resolveWin32Command(t,n,S){if(S.platform!==`win32`||!isBareName(t))return;let C=findOnPath(t,S);if(C)return lv.test(C)?{cmd:C,args:[...n]}:buildCmdExeInvocation(C,n,lookupEnv(S.env,`COMSPEC`)??`cmd.exe`)}var cv,lv,uv,dv,fv=__esmMin(()=>{cv=`.COM;.EXE;.BAT;.CMD`,lv=/\.(?:com|exe)$/i,uv=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,dv=/([()\][%!^"`<>&|;, *?])/g});function resolveEnv(t){if(!t.color)return t.env;let n=t.env??process.env,S=process.env.FORCE_COLOR!==void 0||process.env.NO_COLOR!==void 0?{}:{FORCE_COLOR:`1`};return{...n,...S}}function toSpawnable(t,n,S){return resolveWin32Command(t,n,{platform:process.platform,env:S??process.env,exists:existsSync,join:zn})??{cmd:t,args:[...n]}}function mapSpawnError(t,n){return t.code===`ENOENT`&&n.notFound?n.notFound(t):t}function mustBlock(t){return isGjs()&&t.completion===`return`}function spawnToCompletion(t,n,S){let C=resolveEnv(S),N=S.shell?{cmd:t,args:[...n],windowsVerbatimArguments:!1}:toSpawnable(t,n,C);if(mustBlock(S)){let t=spawnSync(N.cmd,N.args,{stdio:[`inherit`,`pipe`,`pipe`],cwd:S.cwd,env:C,shell:S.shell,maxBuffer:S.maxBuffer??pv,windowsVerbatimArguments:N.windowsVerbatimArguments});if(t.error)return Promise.reject(mapSpawnError(t.error,S));if(S.stdio===`capture`)return Promise.resolve({code:t.status,signal:t.signal??null,stdout:String(t.stdout??``),stderr:String(t.stderr??``)});let n=S.stdio===`inherit-stderr`?process.stderr:process.stdout;return t.stdout&&t.stdout.length>0&&n.write(t.stdout),t.stderr&&t.stderr.length>0&&process.stderr.write(t.stderr),Promise.resolve({code:t.status,signal:t.signal??null})}return new Promise((t,n)=>{let F=N,I={cwd:S.cwd,stdio:S.stdio===`pipe`?[`ignore`,`pipe`,`pipe`]:S.stdio===`capture`?[`inherit`,`pipe`,`pipe`]:S.stdio===`inherit-stderr`?[`inherit`,2,2]:`inherit`};S.shell&&(I.shell=!0),C&&(I.env=C),F.windowsVerbatimArguments&&(I.windowsVerbatimArguments=!0);let H=spawn(F.cmd,F.args,I);S.onSpawn?.(H);let W;if(S.stdio===`capture`){let t={stdout:``,stderr:``};W=t,H.stdout?.on(`data`,n=>t.stdout+=String(n)),H.stderr?.on(`data`,n=>t.stderr+=String(n))}H.on(`close`,(n,S)=>{t(W?{code:n,signal:S,...W}:{code:n,signal:S})}),H.on(`error`,t=>{n(mapSpawnError(t,S))})})}function describeExit(t){return t.signal===null?`code ${t.code}`:`signal ${t.signal}`}var pv,mv=__esmMin(()=>{sv(),rf(),Xn(),N_(),fv(),pv=64*1024*1024});function isExampleRuntime(t){return hv.includes(t)}function buildAppForRuntime(t){return gv[t].buildApp}function requiresGjsSystemDeps(t){return buildAppForRuntime(t)===`gjs`}function isRuntimeOnPath(t){let n=toSpawnable(t,[`--version`]),S=spawnSync(n.cmd,n.args,{stdio:`ignore`,timeout:15e3,windowsVerbatimArguments:n.windowsVerbatimArguments});return!S.error&&S.status===0}function isRuntimeAvailable(t){return t===hostRuntime$1()?!0:isRuntimeOnPath(gv[t].probe)}function defaultExampleRuntime(){return isRuntimeAvailable(`gjs`)?`gjs`:hostRuntime$1()}function readDeclaredRuntimes(t){let n=t?.gjsify?.example?.runtimes;return Array.isArray(n)?n.filter(t=>typeof t==`string`&&isExampleRuntime(t)):null}function checkRuntimeSupported(t,n,S){return n===null||n.includes(t)?{ok:!0}:{ok:!1,message:`"${S}" does not support --runtime ${t}.\n Declared runtimes: ${n.length>0?n.join(`, `):`(none)`}.\n Run it on one of the declared runtimes, e.g. --runtime ${n[0]??`gjs`}.`}}var hv,gv,_v=__esmMin(()=>{sv(),N_(),mv(),hv=[`gjs`,`node`,`bun`,`deno`],gv={gjs:{probe:`gjs`,buildApp:`gjs`,launch:(t,n=[])=>[`gjs`,[`-m`,t,...n]]},node:{probe:`node`,buildApp:`node`,launch:(t,n=[])=>[`node`,[t,...n]]},bun:{probe:`bun`,buildApp:`node`,launch:(t,n=[])=>[`bun`,[t,...n]]},deno:{probe:`deno`,buildApp:`node`,launch:(t,n=[])=>[`deno`,[`run`,`-A`,`--node-modules-dir=manual`,t,...n]]}}});function isSourceDialect(t){return typeof t==`string`&&vv.includes(t)}var vv,yv,bv=__esmMin(()=>{vv=[`react-native`],yv=new Set([`gjs`,`node`])}),xv=__esmMin(()=>{}),Sv=__esmMin(()=>{}),Cv=__esmMin(()=>{}),wv=__esmMin(()=>{bv(),xv(),Sv(),Cv()});function collectPlatformEntries(t){let n=new Set;if(!t||typeof t!=`object`)return n;for(let S of Ev)S!==`gjs`&&Object.prototype.hasOwnProperty.call(t,`./${S}`)&&n.add(S);return n}function findScanRoots(){let t=[],n=Hn(fileURLToPath(import.meta.url));for(let S=0;S<8;S++){let S=In(n,`packages`);existsSync(S)&&[`node`,`web`,`dom`,`framework`,`infra`].some(t=>existsSync(zn(S,t)))&&t.push({kind:`workspace`,dir:S});let C=In(n,`node_modules`,`@gjsify`);existsSync(C)&&t.push({kind:`installed`,dir:C});let N=Hn(n);if(N===n)break;n=N}try{let n=In(process.cwd(),`node_modules`,`@gjsify`);existsSync(n)&&t.push({kind:`installed`,dir:n})}catch{}return t}function ingestPackageDirSync(t,n){let S=zn(t,`package.json`);if(existsSync(S))try{let C=readFileSync(S,`utf8`),N=JSON.parse(C),F=typeof N.name==`string`?N.name:null,I=N?.gjsify?.runtimes;if(F&&F.startsWith(`@gjsify/`)&&!n.has(F)&&I&&typeof I==`object`){let S={};for(let t of Ev){let n=I[t];typeof n==`string`&&Tv.has(n)&&(S[t]=n)}let C=existsSync(zn(t,`globals.mjs`)),H=collectPlatformEntries(N?.exports);n.set(F,{name:F,dir:t,runtimes:S,hasGlobals:C,platformEntries:H})}}catch{}}function getCacheSync(){if(Dv)return Dv;let t=findScanRoots(),n=new Map;if(t.length===0)return Dv=n,Dv;function walkWorkspace(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}if(existsSync(zn(t,`package.json`))){ingestPackageDirSync(t,n);return}for(let n of S)n.isDirectory()&&(n.name===`node_modules`||n.name===`lib`||n.name===`dist`||n.name.startsWith(`.`)||walkWorkspace(zn(t,n.name)))}function walkInstalled(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S)!C.isDirectory()&&!C.isSymbolicLink()||C.name.startsWith(`.`)||ingestPackageDirSync(zn(t,C.name),n)}for(let n of t)n.kind===`workspace`?walkWorkspace(n.dir):walkInstalled(n.dir);return Dv=n,Dv}function warnOnce(t,n){Ov.has(t)||(Ov.add(t),ge.warn(`[@gjsify/resolve-npm] ${n}`))}function resolveSlot(t,n){let S=t.runtimes[n];if(!S)return null;switch(S){case`polyfill`:return n!==`gjs`&&t.platformEntries?.has(n)?`${t.name}/${n}`:null;case`partial`:return null;case`native`:return t.hasGlobals?`${t.name}/globals`:(warnOnce(`${t.name}-${n}-native-missing-globals`,`${t.name} declares runtimes.${n}="native" but ships no globals.mjs — resolving it normally for --app ${n} builds.`),null);case`none`:return null;default:return null}}function getDerivedAliasesSync(t){if(!Ev.has(t))return{};let n=getCacheSync(),S={};for(let C of n.values()){let n=resolveSlot(C,t);n!==null&&n!==C.name&&(S[C.name]=n)}return S}var Tv,Ev,Dv,Ov,kv=__esmMin(()=>{_e(),Bd(),rf(),Xn(),cr(),Tv=new Set([`polyfill`,`native`,`partial`,`none`]),Ev=new Set([`gjs`,`node`,`browser`,`nativescript`,`react-native`]),Dv=null,Ov=new Set}),Av,jv,Mv=__esmMin(()=>{Av={browser:{renderer:`@gjsify/adwaita-web`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,Graphene:`1.0`,GtkSource:`5`}},nativescript:{renderer:`@gjsify/adwaita-nativescript`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,Graphene:`1.0`,GtkSource:`5`},specifiers:{GObject:`@gjsify/adwaita-nativescript/gobject`,GtkSource:`@gjsify/gtksource-nativescript/gtksource`}}},jv=Object.freeze(Object.keys(Av))});function withDerivedSlotRouting(t,n){let S=null,materialise=()=>{if(S)return S;let C=getDerivedAliasesSync(n),N={};for(let[n,S]of Object.entries(t))N[n]=Object.prototype.hasOwnProperty.call(C,S)?C[S]:S;return S=N,S};return new Proxy(t,{get:(n,S)=>typeof S==`string`?materialise()[S]:Reflect.get(t,S),has:(t,n)=>Reflect.has(materialise(),n),ownKeys:()=>Reflect.ownKeys(materialise()),getOwnPropertyDescriptor:(t,n)=>Reflect.getOwnPropertyDescriptor(materialise(),n)})}var Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv=__esmMin(()=>{kv(),Mv(),Nv=`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/web.stream/consumers.stream/promises.string_decoder.sys.test.timers.timers/promises.tls.tty.url.util.util/types.v8.vm.wasi.sqlite.worker_threads.zlib`.split(`.`),Pv=[`readable-stream`,`node-fetch`],Fv={jsdom:`@gjsify/empty`,"./polling-xhr.node.js":`./polling-xhr.js`,"./websocket.node.js":`./websocket.js`,"./globals.node.js":`./globals.js`},Iv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process`,cluster:`@gjsify/cluster`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto`,dgram:`@gjsify/dgram`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns`,"dns/promises":`@gjsify/dns/promises`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs`,"fs/promises":`@gjsify/fs/promises`,http:`@gjsify/http`,http2:`@gjsify/http2`,https:`@gjsify/https`,inspector:`@gjsify/inspector`,module:`@gjsify/module`,net:`@gjsify/net`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/readline`,"readline/promises":`@gjsify/readline/promises`,repl:`@gjsify/repl`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls`,tty:`@gjsify/tty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/v8`,vm:`@gjsify/vm`,wasi:`@gjsify/wasi`,sqlite:`@gjsify/sqlite`,worker_threads:`@gjsify/worker_threads`,zlib:`@gjsify/zlib`,"node-fetch":`@gjsify/fetch`,ws:`@gjsify/ws`,"isomorphic-ws":`@gjsify/websocket`},Lv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process/browser`,cluster:`@gjsify/empty`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto/browser`,dgram:`@gjsify/empty`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns/browser`,"dns/promises":`@gjsify/empty`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs/browser`,"fs/promises":`@gjsify/fs/browser/promises`,http:`@gjsify/http/browser`,http2:`@gjsify/empty`,https:`@gjsify/https/browser`,inspector:`@gjsify/empty`,module:`@gjsify/module/browser`,net:`@gjsify/net/browser`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/empty`,"readline/promises":`@gjsify/empty`,repl:`@gjsify/empty`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls/browser`,tty:`@gjsify/empty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/empty`,vm:`@gjsify/vm`,wasi:`@gjsify/empty`,sqlite:`@gjsify/sqlite/browser`,worker_threads:`@gjsify/worker_threads/browser`,zlib:`@gjsify/zlib/browser`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/ws/browser`,"isomorphic-ws":`@gjsify/empty`},Rv=withDerivedSlotRouting(Lv,`browser`),zv={child_process:`@gjsify/empty`,cluster:`@gjsify/empty`,dgram:`@gjsify/empty`,dns:`@gjsify/empty`,"dns/promises":`@gjsify/empty`,inspector:`@gjsify/empty`,net:`@gjsify/empty`,tls:`@gjsify/empty`,tty:`@gjsify/empty`,http:`@gjsify/empty`,https:`@gjsify/empty`,http2:`@gjsify/empty`,readline:`@gjsify/empty`,repl:`@gjsify/empty`,v8:`@gjsify/empty`,vm:`@gjsify/empty`,worker_threads:`@gjsify/empty`,perf_hooks:`@gjsify/empty`,diagnostics_channel:`@gjsify/empty`,domain:`@gjsify/empty`,sys:`@gjsify/empty`,zlib:`@gjsify/empty`,assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert`,async_hooks:`@gjsify/async_hooks`,sqlite:`@gjsify/sqlite`,buffer:`@gjsify/buffer`,module:`@gjsify/module`,crypto:`@gjsify/crypto`,events:`@gjsify/events`,fs:`@gjsify/native-fs-bridge`,"fs/promises":`@gjsify/native-fs-bridge`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,process:`@gjsify/process`,stream:`@gjsify/stream`,"stream/promises":`@gjsify/stream/promises`,"stream/web":`@gjsify/stream/web`,string_decoder:`@gjsify/string_decoder`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,querystring:`@gjsify/querystring`,console:`@gjsify/console`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,gettext:`@gjsify/node-gi/gettext`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/empty`,"isomorphic-ws":`@gjsify/empty`},Bv={"abort-controller":`@gjsify/abort-controller`,"compression-streams":`@gjsify/compression-streams`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception`,"event-target-shim":`@gjsify/dom-events`,"message-channel":`@gjsify/message-channel`,"web-worker":`@gjsify/web-worker`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch`,formdata:`@gjsify/formdata`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/abort-controller/register`,"compression-streams/register":`@gjsify/compression-streams/register`,"dom-events/register":`@gjsify/dom-events/register`,"dom-events/register/event-target":`@gjsify/dom-events/register/event-target`,"dom-events/register/custom-events":`@gjsify/dom-events/register/custom-events`,"dom-events/register/ui-events":`@gjsify/dom-events/register/ui-events`,"dom-events/register/global-event-target":`@gjsify/dom-events/register/global-event-target`,"dom-exception/register":`@gjsify/dom-exception/register`,"message-channel/register":`@gjsify/message-channel/register`,"web-worker/register":`@gjsify/web-worker/register`,"eventsource/register":`@gjsify/eventsource/register`,"websocket/register":`@gjsify/websocket/register`,"fetch/register":`@gjsify/fetch/register`,"fetch/register/fetch":`@gjsify/fetch/register/fetch`,"fetch/register/xhr":`@gjsify/fetch/register/xhr`,"webcrypto/register":`@gjsify/webcrypto/register`,"web-streams/register":`@gjsify/web-streams/register`,"web-streams/register/readable":`@gjsify/web-streams/register/readable`,"web-streams/register/writable":`@gjsify/web-streams/register/writable`,"web-streams/register/transform":`@gjsify/web-streams/register/transform`,"web-streams/register/text-streams":`@gjsify/web-streams/register/text-streams`,"web-streams/register/queuing":`@gjsify/web-streams/register/queuing`,xmlhttprequest:`@gjsify/fetch`,"xmlhttprequest/register":`@gjsify/fetch/register/xhr`,"@gjsify/xmlhttprequest":`@gjsify/fetch`,"@gjsify/xmlhttprequest/register":`@gjsify/fetch/register/xhr`,domparser:`@gjsify/domparser`,"domparser/register":`@gjsify/domparser/register`,webaudio:`@gjsify/webaudio`,"webaudio/register":`@gjsify/webaudio/register`,gamepad:`@gjsify/gamepad`,"gamepad/register":`@gjsify/gamepad/register`,webrtc:`@gjsify/webrtc`,"webrtc/register":`@gjsify/webrtc/register`,"webrtc/register/peer-connection":`@gjsify/webrtc/register/peer-connection`,"webrtc/register/data-channel":`@gjsify/webrtc/register/data-channel`,"webrtc/register/error":`@gjsify/webrtc/register/error`,"webrtc/register/media":`@gjsify/webrtc/register/media`,"webrtc/register/media-devices":`@gjsify/webrtc/register/media-devices`,webassembly:`@gjsify/webassembly`,"webassembly/register":`@gjsify/webassembly/register`,"webassembly/register/promise":`@gjsify/webassembly/register/promise`},Vv={"@gjsify/node-globals":`@gjsify/empty`,"@gjsify/node-globals/register":`@gjsify/empty`,"@gjsify/node-globals/register/process":`@gjsify/empty`,"@gjsify/node-globals/register/buffer":`@gjsify/empty`,"@gjsify/node-globals/register/timers":`@gjsify/empty`,"@gjsify/node-globals/register/encoding":`@gjsify/empty`,"@gjsify/node-globals/register/url":`@gjsify/empty`,"@gjsify/node-globals/register/structured-clone":`@gjsify/empty`,"@gjsify/node-globals/register/microtask":`@gjsify/empty`,"@gjsify/node-globals/register/navigator":`@gjsify/empty`,"@gjsify/web-globals":`@gjsify/empty`,"@gjsify/web-globals/register":`@gjsify/empty`,"@gjsify/web-globals/register/performance":`@gjsify/empty`,"@gjsify/web-globals/register/formdata":`@gjsify/empty`},Hv={system:`@gjsify/node-gi/system`,gettext:`@gjsify/node-gi/gettext`,cairo:`@gjsify/node-gi/cairo`},Uv={"abort-controller":`@gjsify/abort-controller/globals`,"compression-streams":`@gjsify/compression-streams/globals`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception/globals`,"message-channel":`@gjsify/message-channel/globals`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch/globals`,formdata:`@gjsify/formdata/globals`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto/globals`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket/globals`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/empty`,"compression-streams/register":`@gjsify/empty`,"dom-events/register":`@gjsify/empty`,"dom-events/register/event-target":`@gjsify/empty`,"dom-events/register/custom-events":`@gjsify/empty`,"dom-events/register/ui-events":`@gjsify/empty`,"dom-events/register/global-event-target":`@gjsify/empty`,"dom-exception/register":`@gjsify/empty`,"message-channel/register":`@gjsify/empty`,"eventsource/register":`@gjsify/empty`,"websocket/register":`@gjsify/empty`,"fetch/register":`@gjsify/empty`,"fetch/register/fetch":`@gjsify/empty`,"fetch/register/xhr":`@gjsify/empty`,"webcrypto/register":`@gjsify/empty`,"web-streams/register":`@gjsify/empty`,"web-streams/register/readable":`@gjsify/empty`,"web-streams/register/writable":`@gjsify/empty`,"web-streams/register/transform":`@gjsify/empty`,"web-streams/register/text-streams":`@gjsify/empty`,"web-streams/register/queuing":`@gjsify/empty`,"@gjsify/abort-controller/register":`@gjsify/empty`,"@gjsify/compression-streams/register":`@gjsify/empty`,"@gjsify/dom-events/register":`@gjsify/empty`,"@gjsify/dom-events/register/event-target":`@gjsify/empty`,"@gjsify/dom-events/register/custom-events":`@gjsify/empty`,"@gjsify/dom-events/register/ui-events":`@gjsify/empty`,"@gjsify/dom-events/register/global-event-target":`@gjsify/empty`,"@gjsify/dom-exception/register":`@gjsify/empty`,"@gjsify/message-channel/register":`@gjsify/empty`,"@gjsify/eventsource/register":`@gjsify/empty`,"@gjsify/websocket/register":`@gjsify/empty`,"@gjsify/fetch/register":`@gjsify/empty`,"@gjsify/fetch/register/fetch":`@gjsify/empty`,"@gjsify/fetch/register/xhr":`@gjsify/empty`,"@gjsify/webcrypto/register":`@gjsify/empty`,"@gjsify/web-streams/register":`@gjsify/empty`,"@gjsify/web-streams/register/readable":`@gjsify/empty`,"@gjsify/web-streams/register/writable":`@gjsify/empty`,"@gjsify/web-streams/register/transform":`@gjsify/empty`,"@gjsify/web-streams/register/text-streams":`@gjsify/empty`,"@gjsify/web-streams/register/queuing":`@gjsify/empty`,"@gjsify/dom-elements/register":`@gjsify/empty`,"@gjsify/dom-elements/register/document":`@gjsify/empty`,"@gjsify/dom-elements/register/canvas":`@gjsify/empty`,"@gjsify/dom-elements/register/image":`@gjsify/empty`,"@gjsify/dom-elements/register/observers":`@gjsify/empty`,"@gjsify/dom-elements/register/font-face":`@gjsify/empty`,"@gjsify/dom-elements/register/match-media":`@gjsify/empty`,"@gjsify/dom-elements/register/location":`@gjsify/empty`,"@gjsify/dom-elements/register/navigator":`@gjsify/empty`,"@gjsify/canvas2d/register":`@gjsify/empty`,"@gjsify/iframe/register":`@gjsify/empty`,"@gjsify/webgl/register":`@gjsify/empty`,"@gjsify/buffer/register":`@gjsify/empty`,xmlhttprequest:`@gjsify/empty`,"xmlhttprequest/register":`@gjsify/empty`,"@gjsify/xmlhttprequest":`@gjsify/empty`,"@gjsify/xmlhttprequest/register":`@gjsify/empty`,domparser:`@gjsify/empty`,"domparser/register":`@gjsify/empty`,"@gjsify/domparser/register":`@gjsify/empty`,webaudio:`@gjsify/empty`,"webaudio/register":`@gjsify/empty`,"@gjsify/webaudio/register":`@gjsify/empty`,gamepad:`@gjsify/empty`,"gamepad/register":`@gjsify/empty`,"@gjsify/gamepad/register":`@gjsify/empty`,webrtc:`@gjsify/empty`,"webrtc/register":`@gjsify/empty`,"webrtc/register/peer-connection":`@gjsify/empty`,"webrtc/register/data-channel":`@gjsify/empty`,"webrtc/register/error":`@gjsify/empty`,"webrtc/register/media":`@gjsify/empty`,"webrtc/register/media-devices":`@gjsify/empty`,"@gjsify/webrtc":`@gjsify/empty`,"@gjsify/webrtc/register":`@gjsify/empty`,"@gjsify/webrtc/register/peer-connection":`@gjsify/empty`,"@gjsify/webrtc/register/data-channel":`@gjsify/empty`,"@gjsify/webrtc/register/error":`@gjsify/empty`,"@gjsify/webrtc/register/media":`@gjsify/empty`,"@gjsify/webrtc/register/media-devices":`@gjsify/empty`,webassembly:`@gjsify/webassembly/globals`,"webassembly/register":`@gjsify/empty`,"webassembly/register/promise":`@gjsify/empty`,"@gjsify/webassembly/register":`@gjsify/empty`,"@gjsify/webassembly/register/promise":`@gjsify/empty`}}),setNodeAliasPrefix,getAliasesGeneralForGjs,getAliasesNodeForGjs,getAliasesWebForGjs,getAliasesGeneralForNode,getAliasesGjsForNode,getAliasesWebForNode,getAliasesForGjs,getAliasesForNode,Gv=__esmMin(()=>{Wv(),setNodeAliasPrefix=t=>{for(let n in t){if(n.startsWith(`node:`))continue;let S=`node:${n}`;t[S]||(t[S]=t[n])}return t},getAliasesGeneralForGjs=t=>Fv,getAliasesNodeForGjs=t=>setNodeAliasPrefix(Iv),getAliasesWebForGjs=t=>Bv,getAliasesGeneralForNode=t=>Vv,getAliasesGjsForNode=t=>Hv,getAliasesWebForNode=t=>Uv,getAliasesForGjs=t=>({...getDerivedAliasesSync(`gjs`),...getAliasesGeneralForGjs(t),...getAliasesNodeForGjs(t),...getAliasesWebForGjs(t)}),getAliasesForNode=t=>({...getDerivedAliasesSync(`node`),...getAliasesGeneralForNode(t),...getAliasesGjsForNode(t),...getAliasesWebForNode(t)}),[...Nv,...Nv.map(t=>`node:${t}`)],[...Pv]}),Kv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitWhen=t.flatten=void 0;function flatten(t){return t.reduce((t,n)=>[].concat(t,n),[])}t.flatten=flatten;function splitWhen(t,n){let S=[[]],C=0;for(let N of t)n(N)?(C++,S[C]=[]):S[C].push(N);return S}t.splitWhen=splitWhen})),qv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code===`ENOENT`}t.isEnoentCodeError=isEnoentCodeError})),Jv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDirentFromStats=void 0;var DirentFromStats=class{constructor(t,n){this.name=t,this.isBlockDevice=n.isBlockDevice.bind(n),this.isCharacterDevice=n.isCharacterDevice.bind(n),this.isDirectory=n.isDirectory.bind(n),this.isFIFO=n.isFIFO.bind(n),this.isFile=n.isFile.bind(n),this.isSocket=n.isSocket.bind(n),this.isSymbolicLink=n.isSymbolicLink.bind(n)}};function createDirentFromStats(t,n){return new DirentFromStats(t,n)}t.createDirentFromStats=createDirentFromStats})),Yv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=(a_(),__toCommonJS(Zg)),S=(Xn(),__toCommonJS(Pn)),C=n.platform()===`win32`,N=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,F=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,I=/^\\\\([.?])/,H=/\\(?![!()+@[\]{}])/g;function unixify(t){return t.replace(/\\/g,`/`)}t.unixify=unixify;function makeAbsolute(t,n){return S.resolve(t,n)}t.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)===`.`){let n=t.charAt(1);if(n===`/`||n===`\\`)return t.slice(2)}return t}t.removeLeadingDotSegment=removeLeadingDotSegment,t.escape=C?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(F,`\\$2`)}t.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(N,`\\$2`)}t.escapePosixPath=escapePosixPath,t.convertPathToPattern=C?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(I,`//$1`).replace(H,`/`)}t.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}t.convertPosixPathToPattern=convertPosixPathToPattern})),Xv=__commonJSMin(((t,n)=>{
653
653
  /*!
654
654
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
655
655
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.64.49-next.348",
3
+ "version": "0.64.49",
4
4
  "description": "CLI for Gjsify",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -142,22 +142,22 @@
142
142
  "cli"
143
143
  ],
144
144
  "dependencies": {
145
- "@gjsify/blueprint": "0.64.49-next.348",
146
- "@gjsify/buffer": "0.64.49-next.348",
147
- "@gjsify/create-app": "0.64.49-next.348",
148
- "@gjsify/node-globals": "0.64.49-next.348",
149
- "@gjsify/node-polyfills": "0.64.49-next.348",
150
- "@gjsify/npm-registry": "0.64.49-next.348",
151
- "@gjsify/resolve-npm": "0.64.49-next.348",
152
- "@gjsify/rolldown-plugin-gjsify": "0.64.49-next.348",
153
- "@gjsify/vite-plugin-blueprint": "0.64.49-next.348",
154
- "@gjsify/rolldown-plugin-pnp": "0.64.49-next.348",
155
- "@gjsify/semver": "0.64.49-next.348",
156
- "@gjsify/tar": "0.64.49-next.348",
157
- "@gjsify/tsc": "0.64.49-next.348",
158
- "@gjsify/utils": "0.64.49-next.348",
159
- "@gjsify/web-polyfills": "0.64.49-next.348",
160
- "@gjsify/workspace": "0.64.49-next.348",
145
+ "@gjsify/blueprint": "0.64.49",
146
+ "@gjsify/buffer": "0.64.49",
147
+ "@gjsify/create-app": "0.64.49",
148
+ "@gjsify/node-globals": "0.64.49",
149
+ "@gjsify/node-polyfills": "0.64.49",
150
+ "@gjsify/npm-registry": "0.64.49",
151
+ "@gjsify/resolve-npm": "0.64.49",
152
+ "@gjsify/rolldown-plugin-gjsify": "0.64.49",
153
+ "@gjsify/vite-plugin-blueprint": "0.64.49",
154
+ "@gjsify/rolldown-plugin-pnp": "0.64.49",
155
+ "@gjsify/semver": "0.64.49",
156
+ "@gjsify/tar": "0.64.49",
157
+ "@gjsify/tsc": "0.64.49",
158
+ "@gjsify/utils": "0.64.49",
159
+ "@gjsify/web-polyfills": "0.64.49",
160
+ "@gjsify/workspace": "0.64.49",
161
161
  "acorn": "^8.17.0",
162
162
  "cosmiconfig": "^9.0.2",
163
163
  "get-tsconfig": "^4.14.0",
@@ -166,13 +166,13 @@
166
166
  "yargs": "^18.0.0"
167
167
  },
168
168
  "devDependencies": {
169
- "@gjsify/unit": "0.64.49-next.348",
169
+ "@gjsify/unit": "0.64.49",
170
170
  "@types/yargs": "^17.0.35",
171
171
  "typescript": "^6.0.3"
172
172
  },
173
173
  "peerDependencies": {
174
- "@gjsify/oxfmt-native": "0.64.49-next.348",
175
- "@gjsify/rolldown-native": "0.64.49-next.348"
174
+ "@gjsify/oxfmt-native": "0.64.49",
175
+ "@gjsify/rolldown-native": "0.64.49"
176
176
  },
177
177
  "peerDependenciesMeta": {
178
178
  "@gjsify/oxfmt-native": {
@@ -191,6 +191,5 @@
191
191
  "bugs": {
192
192
  "url": "https://github.com/gjsify/gjsify/issues"
193
193
  },
194
- "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/cli#readme",
195
- "gitHead": "c61ed1ad2d0c4bacbd6a1652663d5bfbf2fca47b"
194
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/cli#readme"
196
195
  }