@gjsify/cli 0.64.12-next.280 → 0.64.12-next.281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.gjs.mjs +3 -3
- package/lib/types/config-data.d.ts +2 -2
- package/lib/utils/ship/depends.js +0 -6
- package/package.json +21 -21
package/dist/cli.gjs.mjs
CHANGED
|
@@ -63,7 +63,7 @@ function tokenizeArgString(t){if(Array.isArray(t))return t.map(t=>typeof t==`str
|
|
|
63
63
|
* Copyright (c) 2016, Contributors
|
|
64
64
|
* SPDX-License-Identifier: ISC
|
|
65
65
|
*/
|
|
66
|
-
function combineAliases(t){let n=[],S=Object.create(null),C=!0;for(Object.keys(t).forEach(function(S){n.push([].concat(t[S],S))});C;){C=!1;for(let t=0;t<n.length;t++)for(let S=t+1;S<n.length;S++)if(n[t].filter(function(t){return n[S].indexOf(t)!==-1}).length){n[t]=n[t].concat(n[S]),n.splice(S,1),C=!0;break}}return n.forEach(function(t){t=t.filter(function(t,n,S){return S.indexOf(t)===n});let n=t.pop();n!==void 0&&typeof n==`string`&&(S[n]=t)}),S}function increment(t){return t===void 0?1:t+1}function sanitizeKey(t){return t===`__proto__`?`___proto___`:t}function stripQuotes$1(t){return typeof t==`string`&&(t[0]===`'`||t[0]===`"`)&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var Fu,YargsParser,Iu=__esmMin(()=>{Mu(),Pu(),ju(),YargsParser=class{constructor(t){Fu=t}parse(t,n){let S=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),C=tokenizeArgString(t),N=typeof t==`string`,F=combineAliases(Object.assign(Object.create(null),S.alias)),I=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":`no-`,"parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},S.configuration),H=Object.assign(Object.create(null),S.default),W=S.configObjects||[],q=S.envPrefix,Y=I[`populate--`],X=Y?`--`:`_`,Z=Object.create(null),te=Object.create(null),ne=S.__||Fu.format,re={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},ie=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,ae=RegExp(`^--`+I[`negation-prefix`]+`(.+)`);[].concat(S.array||[]).filter(Boolean).forEach(function(t){let n=typeof t==`object`?t.key:t,S=Object.keys(t).map(function(t){return{boolean:`bools`,string:`strings`,number:`numbers`}[t]}).filter(Boolean).pop();S&&(re[S][n]=!0),re.arrays[n]=!0,re.keys.push(n)}),[].concat(S.boolean||[]).filter(Boolean).forEach(function(t){re.bools[t]=!0,re.keys.push(t)}),[].concat(S.string||[]).filter(Boolean).forEach(function(t){re.strings[t]=!0,re.keys.push(t)}),[].concat(S.number||[]).filter(Boolean).forEach(function(t){re.numbers[t]=!0,re.keys.push(t)}),[].concat(S.count||[]).filter(Boolean).forEach(function(t){re.counts[t]=!0,re.keys.push(t)}),[].concat(S.normalize||[]).filter(Boolean).forEach(function(t){re.normalize[t]=!0,re.keys.push(t)}),typeof S.narg==`object`&&Object.entries(S.narg).forEach(([t,n])=>{typeof n==`number`&&(re.nargs[t]=n,re.keys.push(t))}),typeof S.coerce==`object`&&Object.entries(S.coerce).forEach(([t,n])=>{typeof n==`function`&&(re.coercions[t]=n,re.keys.push(t))}),S.config!==void 0&&(Array.isArray(S.config)||typeof S.config==`string`?[].concat(S.config).filter(Boolean).forEach(function(t){re.configs[t]=!0}):typeof S.config==`object`&&Object.entries(S.config).forEach(([t,n])=>{(typeof n==`boolean`||typeof n==`function`)&&(re.configs[t]=n)})),extendAliases(S.key,F,S.default,re.arrays),Object.keys(H).forEach(function(t){(re.aliases[t]||[]).forEach(function(n){H[n]=H[t]})});let oe=null;checkConfiguration();let Q=[],se=Object.assign(Object.create(null),{_:[]}),ce={};for(let t=0;t<C.length;t++){let n=C[t],S=n.replace(/^-{3,}/,`---`),N,F,H,W,q,Y;if(n!==`--`&&/^-/.test(n)&&isUnknownOptionAsArg(n))pushPositional(n);else if(S.match(/^---+(=|$)/)){pushPositional(n);continue}else if(n.match(/^--.+=/)||!I[`short-option-groups`]&&n.match(/^-.+=/))W=n.match(/^--?([^=]+)=([\s\S]*)$/),W!==null&&Array.isArray(W)&&W.length>=3&&(checkAllAliases(W[1],re.arrays)?t=eatArray(t,W[1],C,W[2]):checkAllAliases(W[1],re.nargs)===!1?setArg(W[1],W[2],!0):t=eatNargs(t,W[1],C,W[2]));else if(n.match(ae)&&I[`boolean-negation`])W=n.match(ae),W!==null&&Array.isArray(W)&&W.length>=2&&(F=W[1],setArg(F,checkAllAliases(F,re.arrays)?[!1]:!1));else if(n.match(/^--.+/)||!I[`short-option-groups`]&&n.match(/^-[^-]+/))W=n.match(/^--?(.+)/),W!==null&&Array.isArray(W)&&W.length>=2&&(F=W[1],checkAllAliases(F,re.arrays)?t=eatArray(t,F,C):checkAllAliases(F,re.nargs)===!1?(q=C[t+1],q!==void 0&&(!q.match(/^-/)||q.match(ie))&&!checkAllAliases(F,re.bools)&&!checkAllAliases(F,re.counts)||/^(true|false)$/.test(q)?(setArg(F,q),t++):setArg(F,defaultValue(F))):t=eatNargs(t,F,C));else if(n.match(/^-.\..+=/))W=n.match(/^-([^=]+)=([\s\S]*)$/),W!==null&&Array.isArray(W)&&W.length>=3&&setArg(W[1],W[2]);else if(n.match(/^-.\..+/)&&!n.match(ie))q=C[t+1],W=n.match(/^-(.\..+)/),W!==null&&Array.isArray(W)&&W.length>=2&&(F=W[1],q!==void 0&&!q.match(/^-/)&&!checkAllAliases(F,re.bools)&&!checkAllAliases(F,re.counts)?(setArg(F,q),t++):setArg(F,defaultValue(F)));else if(n.match(/^-[^-]+/)&&!n.match(ie)){H=n.slice(1,-1).split(``),N=!1;for(let S=0;S<H.length;S++){if(q=n.slice(S+2),H[S+1]&&H[S+1]===`=`){Y=n.slice(S+3),F=H[S],checkAllAliases(F,re.arrays)?t=eatArray(t,F,C,Y):checkAllAliases(F,re.nargs)===!1?setArg(F,Y):t=eatNargs(t,F,C,Y),N=!0;break}if(q===`-`){setArg(H[S],q);continue}if(/[A-Za-z]/.test(H[S])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&checkAllAliases(q,re.bools)===!1){setArg(H[S],q),N=!0;break}if(H[S+1]&&H[S+1].match(/\W/)){setArg(H[S],q),N=!0;break}else setArg(H[S],defaultValue(H[S]))}F=n.slice(-1)[0],!N&&F!==`-`&&(checkAllAliases(F,re.arrays)?t=eatArray(t,F,C):checkAllAliases(F,re.nargs)===!1?(q=C[t+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(ie))&&!checkAllAliases(F,re.bools)&&!checkAllAliases(F,re.counts)||/^(true|false)$/.test(q)?(setArg(F,q),t++):setArg(F,defaultValue(F))):t=eatNargs(t,F,C))}else if(n.match(/^-[0-9]$/)&&n.match(ie)&&checkAllAliases(n.slice(1),re.bools))F=n.slice(1),setArg(F,defaultValue(F));else if(n===`--`){Q=C.slice(t+1);break}else if(I[`halt-at-non-option`]){Q=C.slice(t);break}else pushPositional(n)}applyEnvVars(se,!0),applyEnvVars(se,!1),setConfig(se),setConfigObjects(),applyDefaultsAndAliases(se,re.aliases,H,!0),applyCoercions(se),I[`set-placeholder-key`]&&setPlaceholderKeys(se),Object.keys(re.counts).forEach(function(t){hasKey(se,t.split(`.`))||setArg(t,0)}),Y&&Q.length&&(se[X]=[]),Q.forEach(function(t){se[X].push(t)}),I[`camel-case-expansion`]&&I[`strip-dashed`]&&Object.keys(se).filter(t=>t!==`--`&&t.includes(`-`)).forEach(t=>{delete se[t]}),I[`strip-aliased`]&&[].concat(...Object.keys(F).map(t=>F[t])).forEach(t=>{I[`camel-case-expansion`]&&t.includes(`-`)&&delete se[t.split(`.`).map(t=>camelCase(t)).join(`.`)],delete se[t]});function pushPositional(t){let n=maybeCoerceNumber(`_`,t);(typeof n==`string`||typeof n==`number`)&&se._.push(n)}function eatNargs(t,n,S,C){let N,F=checkAllAliases(n,re.nargs);if(F=typeof F!=`number`||isNaN(F)?1:F,F===0)return isUndefined(C)||(oe=Error(ne(`Argument unexpected for: %s`,n))),setArg(n,defaultValue(n)),t;let H=+!isUndefined(C);if(I[`nargs-eats-options`])S.length-(t+1)+H<F&&(oe=Error(ne(`Not enough arguments following: %s`,n))),H=F;else{for(N=t+1;N<S.length&&(!S[N].match(/^-[^0-9]/)||S[N].match(ie)||isUnknownOptionAsArg(S[N]));N++)H++;H<F&&(oe=Error(ne(`Not enough arguments following: %s`,n)))}let W=Math.min(H,F);for(!isUndefined(C)&&W>0&&(setArg(n,C),W--),N=t+1;N<W+t+1;N++)setArg(n,S[N]);return t+W}function eatArray(t,n,S,C){let F=[],W=C||S[t+1],q=checkAllAliases(n,re.nargs);if(checkAllAliases(n,re.bools)&&!/^(true|false)$/.test(W))F.push(!0);else if(isUndefined(W)||isUndefined(C)&&/^-/.test(W)&&!ie.test(W)&&!isUnknownOptionAsArg(W)){if(H[n]!==void 0){let t=H[n];F=Array.isArray(t)?t:[t]}}else{isUndefined(C)||F.push(processValue(n,C,!0));for(let C=t+1;C<S.length&&!(!I[`greedy-arrays`]&&F.length>0||q&&typeof q==`number`&&F.length>=q||(W=S[C],/^-/.test(W)&&!ie.test(W)&&!isUnknownOptionAsArg(W)));C++)t=C,F.push(processValue(n,W,N))}return typeof q==`number`&&(q&&F.length<q||isNaN(q)&&F.length===0)&&(oe=Error(ne(`Not enough arguments following: %s`,n))),setArg(n,F),t}function setArg(t,n,S=N){/-/.test(t)&&I[`camel-case-expansion`]&&addNewAlias(t,t.split(`.`).map(function(t){return camelCase(t)}).join(`.`));let C=processValue(t,n,S),F=t.split(`.`);setKey(se,F,C),re.aliases[t]&&re.aliases[t].forEach(function(t){let n=t.split(`.`);setKey(se,n,C)}),F.length>1&&I[`dot-notation`]&&(re.aliases[F[0]]||[]).forEach(function(n){let S=n.split(`.`),N=[].concat(F);N.shift(),S=S.concat(N),(re.aliases[t]||[]).includes(S.join(`.`))||setKey(se,S,C)}),checkAllAliases(t,re.normalize)&&!checkAllAliases(t,re.arrays)&&[t].concat(re.aliases[t]||[]).forEach(function(t){Object.defineProperty(ce,t,{enumerable:!0,get(){return n},set(t){n=typeof t==`string`?Fu.normalize(t):t}})})}function addNewAlias(t,n){re.aliases[t]&&re.aliases[t].length||(re.aliases[t]=[n],Z[n]=!0),re.aliases[n]&&re.aliases[n].length||addNewAlias(n,t)}function processValue(t,n,S){S&&(n=stripQuotes$1(n)),(checkAllAliases(t,re.bools)||checkAllAliases(t,re.counts))&&typeof n==`string`&&(n=n===`true`);let C=Array.isArray(n)?n.map(function(n){return maybeCoerceNumber(t,n)}):maybeCoerceNumber(t,n);return checkAllAliases(t,re.counts)&&(isUndefined(C)||typeof C==`boolean`)&&(C=increment()),checkAllAliases(t,re.normalize)&&checkAllAliases(t,re.arrays)&&(C=Array.isArray(n)?n.map(t=>Fu.normalize(t)):Fu.normalize(n)),C}function maybeCoerceNumber(t,n){return!I[`parse-positional-numbers`]&&t===`_`||!checkAllAliases(t,re.strings)&&!checkAllAliases(t,re.bools)&&!Array.isArray(n)&&(looksLikeNumber(n)&&I[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))||!isUndefined(n)&&checkAllAliases(t,re.numbers))&&(n=Number(n)),n}function setConfig(t){let n=Object.create(null);applyDefaultsAndAliases(n,re.aliases,H),Object.keys(re.configs).forEach(function(S){let C=t[S]||n[S];if(C)try{let t=null,n=Fu.resolve(Fu.cwd(),C),N=re.configs[S];if(typeof N==`function`){try{t=N(n)}catch(n){t=n}if(t instanceof Error){oe=t;return}}else t=Fu.require(n);setConfigObject(t)}catch(n){n.name===`PermissionDenied`?oe=n:t[S]&&(oe=Error(ne(`Invalid JSON config file: %s`,C)))}})}function setConfigObject(t,n){Object.keys(t).forEach(function(S){let C=t[S],N=n?n+`.`+S:S;typeof C==`object`&&C&&!Array.isArray(C)&&I[`dot-notation`]?setConfigObject(C,N):(!hasKey(se,N.split(`.`))||checkAllAliases(N,re.arrays)&&I[`combine-arrays`])&&setArg(N,C)})}function setConfigObjects(){W!==void 0&&W.forEach(function(t){setConfigObject(t)})}function applyEnvVars(t,n){if(q===void 0)return;let S=typeof q==`string`?q:``,C=Fu.env();Object.keys(C).forEach(function(N){if(S===``||N.lastIndexOf(S,0)===0){let F=N.split(`__`).map(function(t,n){return n===0&&(t=t.substring(S.length)),camelCase(t)});(n&&re.configs[F.join(`.`)]||!n)&&!hasKey(t,F)&&setArg(F.join(`.`),C[N])}})}function applyCoercions(t){let n,S=new Set;Object.keys(t).forEach(function(C){if(!S.has(C)&&(n=checkAllAliases(C,re.coercions),typeof n==`function`))try{let N=maybeCoerceNumber(C,n(t[C]));[].concat(re.aliases[C]||[],C).forEach(n=>{S.add(n),t[n]=N})}catch(t){oe=t}})}function setPlaceholderKeys(t){return re.keys.forEach(n=>{~n.indexOf(`.`)||t[n]===void 0&&(t[n]=void 0)}),t}function applyDefaultsAndAliases(t,n,S,C=!1){Object.keys(S).forEach(function(N){hasKey(t,N.split(`.`))||(setKey(t,N.split(`.`),S[N]),C&&(te[N]=!0),(n[N]||[]).forEach(function(n){hasKey(t,n.split(`.`))||setKey(t,n.split(`.`),S[N])}))})}function hasKey(t,n){let S=t;I[`dot-notation`]||(n=[n.join(`.`)]),n.slice(0,-1).forEach(function(t){S=S[t]||{}});let C=n[n.length-1];return typeof S==`object`?C in S:!1}function setKey(t,n,S){let C=t;I[`dot-notation`]||(n=[n.join(`.`)]),n.slice(0,-1).forEach(function(t){t=sanitizeKey(t),typeof C==`object`&&C[t]===void 0&&(C[t]={}),typeof C[t]!=`object`||Array.isArray(C[t])?(Array.isArray(C[t])?C[t].push({}):C[t]=[C[t],{}],C=C[t][C[t].length-1]):C=C[t]});let N=sanitizeKey(n[n.length-1]),F=checkAllAliases(n.join(`.`),re.arrays),H=Array.isArray(S),W=I[`duplicate-arguments-array`];!W&&checkAllAliases(N,re.nargs)&&(W=!0,(!isUndefined(C[N])&&re.nargs[N]===1||Array.isArray(C[N])&&C[N].length===re.nargs[N])&&(C[N]=void 0)),S===increment()?C[N]=increment(C[N]):Array.isArray(C[N])?W&&F&&H?C[N]=I[`flatten-duplicate-arrays`]?C[N].concat(S):(Array.isArray(C[N][0])?C[N]:[C[N]]).concat([S]):!W&&!!F==!!H?C[N]=S:C[N]=C[N].concat([S]):C[N]===void 0&&F?C[N]=H?S:[S]:W&&!(C[N]===void 0||checkAllAliases(N,re.counts)||checkAllAliases(N,re.bools))?C[N]=[C[N],S]:C[N]=S}function extendAliases(...t){t.forEach(function(t){Object.keys(t||{}).forEach(function(t){re.aliases[t]||(re.aliases[t]=[].concat(F[t]||[]),re.aliases[t].concat(t).forEach(function(n){if(/-/.test(n)&&I[`camel-case-expansion`]){let S=camelCase(n);S!==t&&re.aliases[t].indexOf(S)===-1&&(re.aliases[t].push(S),Z[S]=!0)}}),re.aliases[t].concat(t).forEach(function(n){if(n.length>1&&/[A-Z]/.test(n)&&I[`camel-case-expansion`]){let S=decamelize(n,`-`);S!==t&&re.aliases[t].indexOf(S)===-1&&(re.aliases[t].push(S),Z[S]=!0)}}),re.aliases[t].forEach(function(n){re.aliases[n]=[t].concat(re.aliases[t].filter(function(t){return n!==t}))}))})})}function checkAllAliases(t,n){let S=[].concat(re.aliases[t]||[],t),C=Object.keys(n),N=S.find(t=>C.includes(t));return N?n[N]:!1}function hasAnyFlag(t){let n=Object.keys(re);return[].concat(n.map(t=>re[t])).some(function(n){return Array.isArray(n)?n.includes(t):n[t]})}function hasFlagsMatching(t,...n){return[].concat(...n).some(function(n){let S=t.match(n);return S&&hasAnyFlag(S[1])})}function hasAllShortFlags(t){if(t.match(ie)||!t.match(/^-[^-]+/))return!1;let n=!0,S,C=t.slice(1).split(``);for(let N=0;N<C.length;N++){if(S=t.slice(N+2),!hasAnyFlag(C[N])){n=!1;break}if(C[N+1]&&C[N+1]===`=`||S===`-`||/[A-Za-z]/.test(C[N])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(S)||C[N+1]&&C[N+1].match(/\W/))break}return n}function isUnknownOptionAsArg(t){return I[`unknown-options-as-args`]&&isUnknownOption(t)}function isUnknownOption(t){return t=t.replace(/^-{3,}/,`--`),t.match(ie)||hasAllShortFlags(t)?!1:!hasFlagsMatching(t,/^-+([^=]+?)=[\s\S]*$/,ae,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function defaultValue(t){return!checkAllAliases(t,re.bools)&&!checkAllAliases(t,re.counts)&&`${t}`in H?H[t]:defaultForType(guessType(t))}function defaultForType(t){return{[Nu.BOOLEAN]:!0,[Nu.STRING]:``,[Nu.NUMBER]:void 0,[Nu.ARRAY]:[]}[t]}function guessType(t){let n=Nu.BOOLEAN;return checkAllAliases(t,re.strings)?n=Nu.STRING:checkAllAliases(t,re.numbers)?n=Nu.NUMBER:checkAllAliases(t,re.bools)?n=Nu.BOOLEAN:checkAllAliases(t,re.arrays)&&(n=Nu.ARRAY),n}function isUndefined(t){return t===void 0}function checkConfiguration(){Object.keys(re.counts).find(t=>checkAllAliases(t,re.arrays)?(oe=Error(ne(`Invalid configuration: %s, opts.count excludes opts.array.`,t)),!0):checkAllAliases(t,re.nargs)?(oe=Error(ne(`Invalid configuration: %s, opts.count excludes opts.narg.`,t)),!0):!1)}return{aliases:Object.assign({},re.aliases),argv:Object.assign(ce,se),configuration:I,defaulted:Object.assign({},te),error:oe,newAliases:Object.assign({},Z)}}},__name$1(stripQuotes$1,`stripQuotes`)}),Lu,Ru,zu=__esmMin(()=>{Lu=Object.defineProperty,Ru=__name$1((t,n)=>{let S={};for(var C in t)Lu(S,C,{get:t[C],enumerable:!0});return n||Lu(S,Symbol.toStringTag,{value:`Module`}),S},`__exportAll`)});function normalizePath$1(t){return t instanceof URL||t instanceof Jn?fileURLToPath(t):typeof t==`string`?t:t.toString()}function randomName(){return[...[,,,,,,]].map(()=>`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`[Math.floor(Math.random()*62)]).join(``)}var Bu=__esmMin(()=>{Xn(),__name$1(normalizePath$1,`normalizePath`)});function createNodeError(t,n,S,C){return typeof t?.code==`string`?t:createNodeError$1(t,n,{path:S.toString(),dest:C?.toString()})}function requireCallback(t,n=`cb`){if(typeof t==`function`)return t;let S=TypeError(`The "${n}" argument must be of type function. Received ${describeReceived(t)}`);throw S.code=`ERR_INVALID_ARG_TYPE`,S}function describeReceived(t){if(t==null)return String(t);if(typeof t==`object`){let n=t.constructor?.name;return`an instance of ${n&&n.length>0?n:`Object`}`}if(typeof t==`string`){let n=t.length>25?`${t.slice(0,25)}...`:t;return n.includes(`'`)?`type string ("${n}")`:`type string ('${n}')`}return typeof t==`bigint`?`type bigint (${t}n)`:typeof t==`symbol`?`type symbol (${t.toString()})`:`type ${typeof t} (${String(t)})`}function invalidState(t){let n=Error(`Invalid state: ${t}`);return n.code=`ERR_INVALID_STATE`,n}var Vu=__esmMin(()=>{Je()});function gioEventToNodeType(t){switch(t){case Si.FileMonitorEvent.CHANGED:case Si.FileMonitorEvent.CHANGES_DONE_HINT:return`change`;case Si.FileMonitorEvent.DELETED:case Si.FileMonitorEvent.CREATED:case Si.FileMonitorEvent.RENAMED:case Si.FileMonitorEvent.MOVED_IN:case Si.FileMonitorEvent.MOVED_OUT:return`rename`;default:return null}}var WatchTree,Hu=__esmMin(()=>{Vu(),Ci(),zn(),Je(),WatchTree=class{_monitors=new Map;_fileMonitors=new Map;_closed=!1;_root;_recursive;_fanOut;_budget;_budgetReported=!1;_onEvent;_onError;constructor(t,n,S,C,N){this._recursive=n,this._onEvent=S,this._onError=C,this._fanOut=N?.fanOut??isDarwin(),this._budget=N?.budget??(this._fanOut?4096:1/0);let F=Si.File.new_for_path(t);this._root=F.get_path()??t,this._open(this._root,F),F.query_file_type(Si.FileQueryInfoFlags.NONE,null)===Si.FileType.DIRECTORY&&(n||this._fanOut)&&this._descend(this._root,!1)}get monitorCount(){return this._monitors.size+this._fileMonitors.size}close(){this._closed=!0;for(let t of this._monitors.values())t.cancel();this._monitors.clear();for(let t of this._fileMonitors.values())t.cancel();this._fileMonitors.clear()}_open(t,n){let S=n.monitor(Si.FileMonitorFlags.NONE,null);S.connect(`changed`,(t,n,S,C)=>{this._dispatch(n,C)}),this._monitors.set(t,S)}_watchFile(t){if(this._closed||this._fileMonitors.has(t)||!this._admit(t))return;let n;try{n=Si.File.new_for_path(t).monitor(Si.FileMonitorFlags.NONE,null)}catch(t){isNotFoundError(t)||this._onError(t);return}n.connect(`changed`,(t,n,S,C)=>{if(gioEventToNodeType(C)!==`change`)return;let N=n.get_path();N!==null&&this._emit(`change`,N)}),this._fileMonitors.set(t,n)}_admit(t){if(this.monitorCount<this._budget)return!0;if(this._budgetReported)return!1;this._budgetReported=!0;let n=Error(`fs.watch: this watch holds its whole budget of ${this._budget} monitors and stopped at ${t}. Anything under ${this._root} that is not already attached is NOT being watched, and no further event will arrive for it. The budget is finite because this host needs a monitor per FILE rather than per directory, and unbounded growth of a shared process resource surfaces as an unrelated allocation failing elsewhere, in a trace that never mentions fs.watch. Watch a narrower directory.`);return n.code=`ERR_FS_WATCH_MONITOR_BUDGET`,n.path=t,this._onError(n),!1}_dispatch(t,n){let S=t.get_path();if(S===null)return;let C=gioEventToNodeType(n);if(C!==null&&this._emit(C,S),!(!this._recursive&&!this._fanOut))switch(n){case Si.FileMonitorEvent.CREATED:case Si.FileMonitorEvent.MOVED_IN:{let n=t.query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);n===Si.FileType.DIRECTORY?this._recursive&&this._addSubtree(S,!0):this._fanOut&&n===Si.FileType.REGULAR&&this._watchFile(S);break}case Si.FileMonitorEvent.DELETED:case Si.FileMonitorEvent.MOVED_OUT:this._dropSubtree(S);break}}_emit(t,n){let S=kn(this._root,n);this._onEvent(t,S===``?Mn(n):S)}_addSubtree(t,n){if(!(this._closed||this._monitors.has(t))&&this._admit(t)){try{this._open(t,Si.File.new_for_path(t))}catch(t){isNotFoundError(t)||this._onError(t);return}this._descend(t,n)}}_descend(t,n){for(let S of this._children(t)){if(this._closed)return;if(S.isDirectory){if(!this._recursive)continue;n&&this._emit(`rename`,S.path),this._addSubtree(S.path,n)}else n&&this._emit(`rename`,S.path),this._fanOut&&S.isFile&&this._watchFile(S.path)}}_dropSubtree(t){this._fileMonitors.get(t)?.cancel(),this._fileMonitors.delete(t);let n=t+In;for(let[t,S]of this._fileMonitors)t.startsWith(n)&&(S.cancel(),this._fileMonitors.delete(t));for(let[S,C]of this._monitors)S!==t&&!S.startsWith(n)||(C.cancel(),this._monitors.delete(S))}_children(t){let n;try{n=Si.File.new_for_path(t).enumerate_children(`standard::name,standard::type`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(t){return isNotFoundError(t)||this._onError(t),[]}let S=[];try{let C=n.next_file(null);for(;C!==null;){let N=C.get_file_type();S.push({path:On(t,C.get_name()),isDirectory:N===Si.FileType.DIRECTORY,isFile:N===Si.FileType.REGULAR}),C=n.next_file(null)}}catch(t){isNotFoundError(t)||this._onError(t)}finally{try{n.close(null)}catch{}}return S}}});async function*watchAsync(t,n){let S=n?.signal;if(S?.aborted)return;let C=normalizePath$1(t),N=[],F=[],I=!1,H=null;function enqueue(t){I||(F.length>0?F.shift().resolve({value:t,done:!1}):N.push(t))}function terminate(){if(!I)for(I=!0;F.length>0;)F.shift().resolve({value:void 0,done:!0})}let W;try{W=new WatchTree(C,n?.recursive===!0,(t,n)=>{enqueue({eventType:t,filename:n})},t=>{H=t,terminate()})}catch{return}let abortHandler=()=>terminate();S?.addEventListener(`abort`,abortHandler);try{for(;!I;){if(N.length>0){yield N.shift();continue}let t=await new Promise(t=>{F.push({resolve:t})});if(t.done)break;yield t.value}if(H!==null)throw H}finally{S?.removeEventListener(`abort`,abortHandler),W.close()}}var Uu,FSWatcher,Wu=__esmMin(()=>{Bu(),Hu(),vt(),tn(),Uu=new WeakMap,FSWatcher=class extends Wt{constructor(t,n,S){super(),(!n||typeof n!=`object`)&&(n={persistent:!0});let C=n.persistent!==!1,N=new WatchTree(normalizePath$1(t),n.recursive===!0,(t,n)=>{this.emit(`change`,t,n)},t=>{this.emit(`error`,t)}),F=null;C&&(F=_t.timeout_add(_t.PRIORITY_LOW,2147483647,()=>_t.SOURCE_CONTINUE)),Uu.set(this,{persistent:C,closed:!1,sourceId:F,tree:N}),S&&this.on(`change`,S)}close(){let t=Uu.get(this);t.closed||(t.closed=!0,t.tree.close(),t.sourceId!==null&&(_t.source_remove(t.sourceId),t.sourceId=null))}ref(){let t=Uu.get(this);return!t.persistent&&!t.closed&&(t.persistent=!0,t.sourceId=_t.timeout_add(_t.PRIORITY_LOW,2147483647,()=>_t.SOURCE_CONTINUE)),this}unref(){let t=Uu.get(this);return t.persistent&&(t.persistent=!1,t.sourceId!==null&&(_t.source_remove(t.sourceId),t.sourceId=null)),this}}}),Gu=__exportAll$5({lchmod:()=>void 0,lchmodAsync:()=>lchmodAsync,lchmodSync:()=>void 0,lchown:()=>lchown,lchownAsync:()=>lchownAsync,lchownSync:()=>lchownSync,lutimes:()=>lutimes,lutimesAsync:()=>lutimesAsync,lutimesSync:()=>lutimesSync,utimes:()=>utimes,utimesAsync:()=>utimesAsync,utimesSync:()=>utimesSync});function toGLibDateTime(t){let n=t instanceof Date?t.getTime():typeof t==`bigint`?Number(t):typeof t==`string`?Date.parse(t):t*1e3;return _t.DateTime.new_from_unix_utc(Math.floor(n/1e3))}function setTimestamps(t,n,S,C){let N=Si.File.new_for_path(t),F=new Si.FileInfo;F.set_modification_date_time(toGLibDateTime(S)),F.set_access_date_time(toGLibDateTime(n)),N.set_attributes_from_info(F,C,null)}function utimesSync(t,n,S){setTimestamps(normalizePath$1(t),n,S,Si.FileQueryInfoFlags.NONE)}function utimes(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>utimesSync(t,n,S)).then(()=>C(null),C)}async function utimesAsync(t,n,S){utimesSync(t,n,S)}function lutimesSync(t,n,S){setTimestamps(normalizePath$1(t),n,S,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS)}function lutimes(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>lutimesSync(t,n,S)).then(()=>C(null),C)}async function lutimesAsync(t,n,S){lutimesSync(t,n,S)}function lchownSync(t,n,S){let C=normalizePath$1(t),N=Si.File.new_for_path(C),F=new Si.FileInfo;n!==-1&&F.set_attribute_uint32(`unix::uid`,n),S!==-1&&F.set_attribute_uint32(`unix::gid`,S),N.set_attributes_from_info(F,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}function lchown(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>lchownSync(t,n,S)).then(()=>C(null),C)}async function lchownAsync(t,n,S){lchownSync(t,n,S)}function lchmodUnsupported(){let t=Error(`The lchmod() method is not implemented`);return t.code=`ERR_METHOD_NOT_IMPLEMENTED`,t}async function lchmodAsync(t,n){throw lchmodUnsupported()}var Ku=__esmMin(()=>{Bu(),Vu(),vt(),Ci()});function isStdFd(t){return t===0||t===1||t===2}function stdinInput(){return qu||=ro.InputStream.new(0,!1),qu}function stdOutput(t){return Ju[t]||(Ju[t]=ro.OutputStream.new(t,!1)),Ju[t]}function readStdFdAll(t){try{let n=t===0?stdinInput():ro.InputStream.new(t,!1),S=[],C=0;for(;;){let t=n.read_bytes(64*1024,null).get_data();if(!t||t.length===0)break;S.push(t),C+=t.length}return concat(S,C)}catch(n){if(t!==0)throw n;let[S,C]=Si.File.new_for_path(`/dev/stdin`).load_contents(null);if(!S)throw n;return C}}function readStdFdSync(t,n,S,C){let N=(t===0?stdinInput():ro.InputStream.new(t,!1)).read_bytes(C,null).get_data();return N&&N.length>0?(new Uint8Array(n.buffer,n.byteOffset+S).set(N),N.length):0}function writeStdFdSync(t,n){return stdOutput(t).write_bytes(_t.Bytes.new(n),null)}function concat(t,n){if(t.length===1)return t[0];let S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.length;return S}var qu,Ju,Yu=__esmMin(()=>{vt(),Ci(),io(),qu=null,Ju={}});function getEncodingFromOptions(t={encoding:null,flag:`r`},n=`utf8`){return t===null?n:typeof t==`string`?t:typeof t==`object`&&typeof t.encoding==`string`?t.encoding:n}function encodeUint8Array(t,n){return t===`buffer`?it.from(n):new TextDecoder(t).decode(n)}function decode(t,n){if(n){let S=new TextDecoder(n),C=new TextEncoder;return S.decode(C.encode(t))}else return t}var Xu=__esmMin(()=>{mt()});function createReadStream(t,n){return new ReadStream(t,n)}var ReadStream,Zu=__esmMin(()=>{Bu(),Rd(),Ld(),vt(),Ci(),mt(),la(),ReadStream=class extends ra{bytesRead=0;path;pending=!0;fd=null;_ownFd=null;_autoCloseFd=!0;_positional=!1;_gioFile;_inputStream=null;_cancellable=new Si.Cancellable;_start;_end;_pos;_reading=!1;_readAgain=!1;_lastSize=64*1024;close(t){this._cancellable.cancel(),this._release(),this.destroy(),t&&t(null)}constructor(t,n){let S=normalizePath$1(t);super({highWaterMark:n?.highWaterMark??64*1024,encoding:n?.encoding,objectMode:!1}),this.path=S,this._gioFile=Si.File.new_for_path(S),this._start=n?.start??0,this._end=n?.end??1/0,this._pos=this._start,this._positional=n?.start!==void 0,typeof n?.fd==`number`&&(this._ownFd=n.fd,this.fd=n.fd,this._autoCloseFd=n.autoClose!==!1),this.once(`end`,()=>this._release())}_construct(t){if(this._ownFd!==null){this.pending=!1,t(),this.emit(`open`,this._ownFd),this.emit(`ready`);return}this._gioFile.read_async(_t.PRIORITY_DEFAULT,this._cancellable,(n,S)=>{if(this.destroyed){t();return}try{this._inputStream=this._gioFile.read_finish(S),this.pending=!1,this.emit(`open`,0),this.emit(`ready`),this._start>0&&this._inputStream.can_seek()&&this._inputStream.seek(this._start,_t.SeekType.SET,null),t()}catch(n){this._cancellable.is_cancelled()||t(n)}})}_read(t){if(this._lastSize=t,this._reading){this._readAgain=!0;return}this._doRead(t)}_doRead(t){if(this._ownFd!==null){if(this._reading||this.destroyed)return;this._reading=!0,_t.timeout_add(_t.PRIORITY_DEFAULT,0,()=>(this._reading=!1,this.destroyed||this._readThroughFd(t),_t.SOURCE_REMOVE));return}let n=t;if(this._end!==1/0){let S=this._end-this._pos+1;if(S<=0){this.push(null);return}n=Math.min(t,S)}let S=this._inputStream;!S||this.destroyed||(this._reading=!0,S.read_bytes_async(n,_t.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{this._reading=!1;try{let t=S.read_bytes_finish(n).get_data();if(!t||t.length===0){this._readAgain=!1,this.push(null);return}this.bytesRead+=t.length,this._pos+=t.length,this.push(it.from(t)),this._readAgain&&!this._reading&&(this._readAgain=!1,this._doRead(this._lastSize))}catch(t){this._readAgain=!1,this._cancellable.is_cancelled()||this.destroy(t)}}))}_readThroughFd(t){try{let n=t;if(this._end!==1/0){let S=this._end-this._pos+1;if(S<=0){this._readAgain=!1,this.push(null);return}n=Math.min(t,S)}let S=Id.getInstance(this._ownFd,`read`),C=it.alloc(n),N=S._readSync(C,0,n,this._positional?this._pos:null);if(N===0){this._readAgain=!1,this.push(null);return}this.bytesRead+=N,this._pos+=N,this.push(C.subarray(0,N))}catch(t){this._readAgain=!1,this.destroy(t)}}_release(){this._inputStream&&=(this._inputStream.close_async(_t.PRIORITY_DEFAULT,null,()=>{}),null),this._releaseFd()}_releaseFd(){if(this._ownFd===null||!this._autoCloseFd)return;let t=this._ownFd;this._ownFd=null,this.fd=null;try{closeSync(t)}catch{}}_destroy(t,n){this._cancellable.cancel(),this._release(),n(t)}}});function openFlagValues(){return isWin32()?td:isDarwin()?$u:Qu}function stringFlagBits(t,n){switch(t){case`r`:return n.O_RDONLY;case`rs`:case`sr`:return n.O_RDONLY|n.O_SYNC;case`r+`:return n.O_RDWR;case`rs+`:case`sr+`:return n.O_RDWR|n.O_SYNC;case`w`:return n.O_TRUNC|n.O_CREAT|n.O_WRONLY;case`wx`:case`xw`:return n.O_TRUNC|n.O_CREAT|n.O_WRONLY|n.O_EXCL;case`w+`:return n.O_TRUNC|n.O_CREAT|n.O_RDWR;case`wx+`:case`xw+`:return n.O_TRUNC|n.O_CREAT|n.O_RDWR|n.O_EXCL;case`a`:return n.O_APPEND|n.O_CREAT|n.O_WRONLY;case`ax`:case`xa`:return n.O_APPEND|n.O_CREAT|n.O_WRONLY|n.O_EXCL;case`as`:case`sa`:return n.O_APPEND|n.O_CREAT|n.O_WRONLY|n.O_SYNC;case`a+`:return n.O_APPEND|n.O_CREAT|n.O_RDWR;case`ax+`:case`xa+`:return n.O_APPEND|n.O_CREAT|n.O_RDWR|n.O_EXCL;case`as+`:case`sa+`:return n.O_APPEND|n.O_CREAT|n.O_RDWR|n.O_SYNC;default:return}}function parseOpenFlags(t){let n=openFlagValues(),S;if(t==null)S=n.O_RDONLY;else if(typeof t==`number`)S=t;else{let C=stringFlagBits(t,n);if(C===void 0){let n=TypeError(`Unknown file open flag: ${t}`);throw n.code=`ERR_INVALID_ARG_VALUE`,n}S=C}let C=S&(n.O_RDONLY|n.O_WRONLY|n.O_RDWR);return{posix:S,readable:C===n.O_RDONLY||C===n.O_RDWR,writable:C===n.O_WRONLY||C===n.O_RDWR,append:(S&n.O_APPEND)!==0,creat:(S&n.O_CREAT)!==0,excl:(S&n.O_CREAT)!==0&&(S&n.O_EXCL)!==0,trunc:(S&n.O_TRUNC)!==0,nofollow:n.O_NOFOLLOW!==0&&(S&n.O_NOFOLLOW)!==0,directory:n.O_DIRECTORY!==0&&(S&n.O_DIRECTORY)!==0}}function normalizeMode(t,n){let S=t??n,C=S;if(typeof S==`string`){if(!/^[0-7]+$/.test(S))throw invalidMode(S);C=parseInt(S,8)}if(typeof C!=`number`)throw modeNotANumber(C);if(!Number.isInteger(C))throw modeOutOfRange(`an integer`,C);if(C<0||C>4294967295)throw modeOutOfRange(`>= 0 && <= 4294967295`,C);return C}function invalidMode(t){let n=TypeError(`The argument 'mode' must be a 32-bit unsigned integer or an octal string. Received '${t}'`);return n.code=`ERR_INVALID_ARG_VALUE`,n}function modeNotANumber(t){let n=t==null?String(t):`type ${typeof t} (${describeValue(t)})`,S=TypeError(`The "mode" argument must be of type number. Received ${n}`);return S.code=`ERR_INVALID_ARG_TYPE`,S}function describeValue(t){try{return typeof t==`object`?Object.prototype.toString.call(t):String(t)}catch{return`<unprintable>`}}function modeOutOfRange(t,n){let S=RangeError(`The value of "mode" is out of range. It must be ${t}. Received ${n}`);return S.code=`ERR_OUT_OF_RANGE`,S}var Qu,$u,td,nd=__esmMin(()=>{Je(),Qu={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_NONBLOCK:2048,O_DSYNC:4096,O_SYNC:1052672,O_DIRECTORY:65536,O_NOFOLLOW:131072},$u={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_NONBLOCK:4,O_DSYNC:4194304,O_SYNC:128,O_DIRECTORY:1048576,O_NOFOLLOW:256},td={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:256,O_EXCL:1024,O_NOCTTY:0,O_TRUNC:512,O_APPEND:8,O_NONBLOCK:0,O_DSYNC:0,O_SYNC:0,O_DIRECTORY:0,O_NOFOLLOW:0}}),Dirent,rd=__esmMin(()=>{Ci(),zn(),Dirent=class{name;parentPath;_isFile=!1;_isDirectory=!1;_isBlockDevice=!1;_isCharacterDevice=!1;_isSymbolicLink=!1;_isFIFO=!1;_isSocket=!1;_file;constructor(t,n,S,C,N){switch(n||=Mn(t),this.name=n,this.parentPath=N??jn(t),this._file=Si.File.new_for_path(t),S??this._file.query_file_type(Si.FileQueryInfoFlags.NONE,null)){case Si.FileType.DIRECTORY:this._isDirectory=!0;break;case Si.FileType.MOUNTABLE:break;case Si.FileType.REGULAR:this._isFile=!0;break;case Si.FileType.SYMBOLIC_LINK:case Si.FileType.SHORTCUT:this._isSymbolicLink=!0;break;case Si.FileType.SPECIAL:this._classifySpecialFile(t,C);break}}_classifySpecialFile(t,n){try{let S=n?.has_attribute(`unix::mode`)===!0?n:Si.File.new_for_path(t).query_info(`unix::mode`,Si.FileQueryInfoFlags.NONE,null),C=S.has_attribute(`unix::mode`)?S.get_attribute_uint32(`unix::mode`):0;if(C===0)return;switch(C&61440){case 24576:this._isBlockDevice=!0;break;case 8192:this._isCharacterDevice=!0;break;case 49152:this._isSocket=!0;break;case 4096:this._isFIFO=!0;break}}catch{}}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isBlockDevice(){return this._isBlockDevice}isCharacterDevice(){return this._isCharacterDevice}isSymbolicLink(){return this._isSymbolicLink}isFIFO(){return this._isFIFO}isSocket(){return this._isSocket}}});function fsError(t,n,S,C){let N=`${t}: ${describe$1(t)}, ${n}`;S&&(N+=` '${S}'`),C&&(N+=` -> '${C}'`);let F=Error(N);return F.code=t,F.errno=id[t]??-1,F.syscall=n,S&&(F.path=S),C&&(F.dest=C),F}function describe$1(t){switch(t){case`ENOENT`:return`no such file or directory`;case`EEXIST`:return`file already exists`;case`EACCES`:return`permission denied`;case`EISDIR`:return`illegal operation on a directory`;case`ENOTDIR`:return`not a directory`;case`EBADF`:return`bad file descriptor`;case`EPERM`:return`operation not permitted`;case`EINVAL`:return`invalid argument`;case`ELOOP`:return`too many symbolic links encountered`;case`ENAMETOOLONG`:return`name too long`;case`EMFILE`:return`too many open files`;case`ENFILE`:return`file table overflow`;case`EROFS`:return`read-only file system`;case`ESPIPE`:return`invalid seek`;case`ENXIO`:return`no such device or address`;default:return`i/o error`}}function hasProcFd(){return ad===null&&(ad=_t.file_test(`/proc/self/fd`,_t.FileTest.IS_DIR)),ad}function fdPath(t){return hasProcFd()?`/proc/self/fd/${t}`:null}function openFd(t,n,S){let C=_t.open(t,n.posix,S);if(C<0)throw classifyOpenFailure(t,n);return C}function closeFd(t){_t.close(t)}function classifyOpenFailure(t,n){let S=nameTooLong(t,`open`);if(S)return S;let C=Si.File.new_for_path(t),N=null,F=!1;try{let t=C.query_info(`standard::type,standard::symlink-target,unix::mode,access::can-read,access::can-write`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);answered(t)?N=t:F=!0}catch{N=null}if(F)return refusalNotAboutThePath(t,n,C,null);if(N){if(n.excl)return fsError(`EEXIST`,`open`,t);if(N.get_file_type()===Si.FileType.SYMBOLIC_LINK&&!n.nofollow){let S=walkSymlinkChain(C);if(S===`loop`)return fsError(`ELOOP`,`open`,t);if(S===`too-long`)return fsError(`ENAMETOOLONG`,`open`,t);if(S===`dangling`&&!n.creat)return fsError(`ENOENT`,`open`,t)}return N.get_file_type()===Si.FileType.DIRECTORY&&n.writable?fsError(`EISDIR`,`open`,t):n.directory&&N.get_file_type()!==Si.FileType.DIRECTORY?fsError(`ENOTDIR`,`open`,t):refusalNotAboutThePath(t,n,C,N)}if(ancestorIsNotADirectory(C))return fsError(`ENOTDIR`,`open`,t);if(!n.creat)return fsError(`ENOENT`,`open`,t);let I=C.get_parent();if(!I)return fsError(`ENOENT`,`open`,t);try{I.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null)}catch{return fsError(`ENOENT`,`open`,t)}return refusalNotAboutThePath(t,n,C,null)}function ancestorIsNotADirectory(t){for(let n=t.get_parent();n;n=n.get_parent()){let t;try{t=n.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null)}catch{continue}return answered(t)?t.get_file_type()!==Si.FileType.DIRECTORY:!1}return!1}function answered(t){return t!==null&&t.has_attribute(`standard::type`)}function nameTooLong(t,n){let S=new TextEncoder;if(S.encode(t).length>4096)return fsError(`ENAMETOOLONG`,n,t);for(let C of splitPathComponents(t))if(S.encode(C).length>255)return fsError(`ENAMETOOLONG`,n,t);return null}function walkSymlinkChain(t){let n=new TextEncoder,S=t;for(let t=0;t<40;t++){let t;try{t=S.query_info(`standard::type,standard::symlink-target`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch{return`dangling`}if(!answered(t)||t.get_file_type()!==Si.FileType.SYMBOLIC_LINK)return`resolved`;let C=t.get_symlink_target();if(!C)return`dangling`;if(n.encode(C).length>4096)return`too-long`;let N=S.get_parent();S=C.startsWith(`/`)?Si.File.new_for_path(C):N?.resolve_relative_path(C)??Si.File.new_for_path(C)}return`loop`}function refusalNotAboutThePath(t,n,S,C){let N=_t.open(`/dev/null`,0,0);if(N<0)return fsError(`EMFILE`,`open`,t);_t.close(N);let F=C!==null&&(C.get_attribute_uint32(`unix::mode`)&146)==0;if((n.writable||n.creat)&&!F)try{if(S.query_filesystem_info(`filesystem::readonly`,null).get_attribute_boolean(`filesystem::readonly`))return fsError(`EROFS`,`open`,t)}catch{}return C&¬hingOnTheOtherEnd(n,C)?fsError(`ENXIO`,`open`,t):fsError(`EACCES`,`open`,t)}function nothingOnTheOtherEnd(t,n){if(!n.has_attribute(`unix::mode`))return!1;let S=n.get_attribute_uint32(`unix::mode`)&61440;if(!(S===8192||S===24576||S===4096))return!1;let permits=t=>n.has_attribute(t)&&n.get_attribute_boolean(t);return!(t.readable&&!permits(`access::can-read`)||t.writable&&!permits(`access::can-write`))}function classifyMkdirFailure(t){let n=nameTooLong(t,`mkdir`);if(n)return n;let S=Si.File.new_for_path(t);try{return answered(S.query_info(`standard::type`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null))?fsError(`EEXIST`,`mkdir`,t):fsError(`EACCES`,`mkdir`,t)}catch{}let C=S.get_parent();if(!C)return fsError(`ENOENT`,`mkdir`,t);try{let n=C.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null);if(answered(n)&&n.get_file_type()!==Si.FileType.DIRECTORY)return fsError(`ENOTDIR`,`mkdir`,t)}catch{return fsError(`ENOENT`,`mkdir`,t)}return fsError(`EACCES`,`mkdir`,t)}function seekHandle(t){let n=od.get(t);return n||(n=_t.IOChannel.unix_new(t),n.set_encoding(null),n.set_buffered(!1),n.set_close_on_unref(!1),od.set(t,n)),n}function input(t){let n=sd.get(t);return n||(n=ro.InputStream.new(t,!1),sd.set(t,n)),n}function output(t){let n=cd.get(t);return n||(n=ro.OutputStream.new(t,!1),cd.set(t,n)),n}function isSeekableFd(t,n){let S=ld.get(t);return S===void 0&&(S=probeSeekable(t,n),ld.set(t,S)),S}function probeSeekable(t,n){try{let S=Si.File.new_for_path(fdPath(t)??n).query_info(`unix::mode`,Si.FileQueryInfoFlags.NONE,null);if(S.has_attribute(`unix::mode`)){let t=S.get_attribute_uint32(`unix::mode`)&61440;if(t===4096||t===49152)return!1}}catch{}try{return seekHandle(t).seek_position(0,_t.SeekType.CUR),!0}catch{return!1}}function seekFd(t,n){seekHandle(t).seek_position(n,_t.SeekType.SET)}function tellFd(t){if(!hasProcFd())return null;try{let[n,S]=_t.file_get_contents(`/proc/self/fdinfo/${t}`);if(!n)return null;let C=/^pos:\s*(\d+)/m.exec(new TextDecoder().decode(S));return C?Number(C[1]):null}catch{return null}}function readFd(t,n){return n<=0?new Uint8Array:input(t).read_bytes(n,null).get_data()??new Uint8Array}function writeFd(t,n){if(n.length===0)return 0;let[,S]=output(t).write_all(n,null);return S}function fsyncFd(t){output(t).flush(null),_t.fsync(t)}function releaseFd(t){let n=cd.get(t);if(n)try{n.flush(null)}catch{}od.delete(t),sd.delete(t),cd.delete(t),ld.delete(t)}function sizeOfFd(t,n){let S=fdPath(t)??n,C=Si.File.new_for_path(S).query_info(`standard::size`,Si.FileQueryInfoFlags.NONE,null);return Number(C.get_size())}function truncateFd(t,n,S){let C=Si.File.new_for_path(fdPath(t)??S),N;try{let t=C.append_to(Si.FileCreateFlags.NONE,null);try{t.truncate(n,null)}finally{t.close(null)}return}catch(t){N=t}try{let t=C.open_readwrite(null);try{t.get_output_stream().truncate(n,null)}finally{t.close(null)}return}catch{}throw createNodeError(N,`ftruncate`,S)}var id,ad,od,sd,cd,ld,ud=__esmMin(()=>{Vu(),vt(),Ci(),Je(),io(),id={EPERM:-1,ENOENT:-2,EIO:-5,ENXIO:-6,EBADF:-9,EACCES:-13,EEXIST:-17,ENOTDIR:-20,EISDIR:-21,EINVAL:-22,ENFILE:-23,EMFILE:-24,ETXTBSY:-26,ENOSPC:-28,ESPIPE:-29,EROFS:-30,ENAMETOOLONG:-36,ENOTEMPTY:-39,ELOOP:-40},__name$1(describe$1,`describe`),ad=null,od=new Map,sd=new Map,cd=new Map,ld=new Map});function populateFromInfo(t){let n=t.get_attribute_uint64(`time::access`),S=t.get_attribute_uint32(`time::access-usec`)||0,C=t.get_attribute_uint64(`time::modified`),N=t.get_attribute_uint32(`time::modified-usec`)||0,F=t.get_attribute_uint64(`time::changed`),I=t.get_attribute_uint32(`time::changed-usec`)||0,H=t.get_attribute_uint64(`time::created`),W=t.get_attribute_uint32(`time::created-usec`)||0,q=n*1e3+S/1e3,Y=C*1e3+N/1e3,X=F?F*1e3+I/1e3:Y,Z=H?H*1e3+W/1e3:X;return{dev:t.get_attribute_uint32(`unix::device`)||0,ino:Number(t.get_attribute_uint64(`unix::inode`)||0),mode:t.get_attribute_uint32(`unix::mode`)||0,nlink:t.get_attribute_uint32(`unix::nlink`)||0,uid:t.get_attribute_uint32(`unix::uid`)||0,gid:t.get_attribute_uint32(`unix::gid`)||0,rdev:t.get_attribute_uint32(`unix::rdev`)||0,size:Number(t.get_size()||0),blksize:t.get_attribute_uint32(`unix::block-size`)||4096,blocks:Number(t.get_attribute_uint64(`unix::blocks`)||0),atimeMs:q,mtimeMs:Y,ctimeMs:X,birthtimeMs:Z,atime:new Date(q),mtime:new Date(Y),ctime:new Date(X),birthtime:new Date(Z)}}function statsFrom(t,n,S,C){if(!answered(t))throw fsError(`EACCES`,S,n);return C?new BigIntStats(t,n):new Stats(t,n)}var dd,Stats,BigIntStats,fd=__esmMin(()=>{rd(),ud(),Ci(),zn(),dd=`standard::*,time::*,unix::*`,Stats=class extends Dirent{dev;ino;mode;nlink;uid;gid;rdev;size;blksize;blocks;atimeMs;mtimeMs;ctimeMs;birthtimeMs;atime;mtime;ctime;birthtime;_info;constructor(t,n,S){let C,N;t instanceof Si.FileInfo?(C=t,N=n.toString(),S||=Mn(N)):(N=t.toString(),typeof n==`string`&&(S=n),S||=Mn(N),C=Si.File.new_for_path(N).query_info(dd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)),super(N,S,C.get_file_type(),C),this._info=C;let F=populateFromInfo(C);this.dev=F.dev,this.ino=F.ino,this.mode=F.mode,this.nlink=F.nlink,this.uid=F.uid,this.gid=F.gid,this.rdev=F.rdev,this.size=F.size,this.blksize=F.blksize,this.blocks=F.blocks,this.atimeMs=F.atimeMs,this.mtimeMs=F.mtimeMs,this.ctimeMs=F.ctimeMs,this.birthtimeMs=F.birthtimeMs,this.atime=F.atime,this.mtime=F.mtime,this.ctime=F.ctime,this.birthtime=F.birthtime}},BigIntStats=class extends Dirent{dev;ino;mode;nlink;uid;gid;rdev;size;blksize;blocks;atimeMs;mtimeMs;ctimeMs;birthtimeMs;atimeNs;mtimeNs;ctimeNs;birthtimeNs;atime;mtime;ctime;birthtime;_info;constructor(t,n,S){let C,N;t instanceof Si.FileInfo?(C=t,N=n.toString(),S||=Mn(N)):(N=t.toString(),typeof n==`string`&&(S=n),S||=Mn(N),C=Si.File.new_for_path(N).query_info(dd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)),super(N,S,C.get_file_type(),C),this._info=C;let F=populateFromInfo(C);this.dev=BigInt(F.dev),this.ino=BigInt(F.ino),this.mode=BigInt(F.mode),this.nlink=BigInt(F.nlink),this.uid=BigInt(F.uid),this.gid=BigInt(F.gid),this.rdev=BigInt(F.rdev),this.size=BigInt(F.size),this.blksize=BigInt(F.blksize),this.blocks=BigInt(F.blocks),this.atimeMs=BigInt(Math.trunc(F.atimeMs)),this.mtimeMs=BigInt(Math.trunc(F.mtimeMs)),this.ctimeMs=BigInt(Math.trunc(F.ctimeMs)),this.birthtimeMs=BigInt(Math.trunc(F.birthtimeMs)),this.atimeNs=this.atimeMs*1000000n,this.mtimeNs=this.mtimeMs*1000000n,this.ctimeNs=this.ctimeMs*1000000n,this.birthtimeNs=this.birthtimeMs*1000000n,this.atime=F.atime,this.mtime=F.mtime,this.ctime=F.ctime,this.birthtime=F.birthtime}}});function statSync(t,n){let S=normalizePath$1(t);try{return statsFrom(Si.File.new_for_path(S).query_info(dd,Si.FileQueryInfoFlags.NONE,null),S,`stat`,n?.bigint)}catch(t){if(n?.throwIfNoEntry===!1&&isNotFoundError(t))return;throw createNodeError(t,`stat`,S)}}function lstatSync(t,n){let S=normalizePath$1(t);try{return statsFrom(Si.File.new_for_path(S).query_info(dd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null),S,`lstat`,n?.bigint)}catch(t){if(n?.throwIfNoEntry===!1&&isNotFoundError(t))return;throw createNodeError(t,`lstat`,S)}}function readdirSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S).enumerate_children(`standard::name,standard::type`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null),N=[];try{let t=C.next_file(null);for(;t!==null;)N.push({name:t.get_name(),type:t.get_file_type()}),t=C.next_file(null)}finally{try{C.close(null)}catch{}}let F=[];for(let t of N){let C=On(S,t.name);if(n?.withFileTypes?F.push(new Dirent(C,t.name,t.type,void 0,S)):F.push(t.name),n?.recursive&&t.type===Si.FileType.DIRECTORY){let S=readdirSync(C,n);for(let n of S)typeof n==`string`?F.push(On(t.name,n)):F.push(n)}}return F}function realpathSync(t){let n=normalizePath$1(t);return resolveEveryComponent(Si.File.new_for_path(n),{left:40},n)}function resolveEveryComponent(t,n,S){let C=t.get_parent();return expandSymlinks(C===null?t:Si.File.new_for_path(resolveEveryComponent(C,n,S)).get_child(t.get_basename()),n,S)}function expandSymlinks(t,n,S){let C=t;for(;;){let t=C.query_info(`standard::is-symlink,standard::symlink-target`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);if(!t.get_is_symlink())return C.get_path();if(--n.left<0)throw Error(`ELOOP: too many levels of symbolic links, realpath '${S}'`);let N=t.get_symlink_target(),F=C.get_parent(),I=_t.path_is_absolute(N)?Si.File.new_for_path(N):(F??C).resolve_relative_path(N);C=Si.File.new_for_path(resolveEveryComponent(I,n,S))}}function symlinkSync(t,n,S){let C=normalizePath$1(n),N=normalizePath$1(t);Si.File.new_for_path(C).make_symbolic_link(N,null)}function readFileSync(t,n={encoding:null,flag:`r`}){if(t instanceof Id&&(t=t.fd),typeof t==`number`&&isStdFd(t))return encodeUint8Array(getEncodingFromOptions(n,`buffer`),readStdFdAll(t));if(typeof t==`number`)return encodeUint8Array(getEncodingFromOptions(n,`buffer`),Id.getInstance(t,`read`)._readToEndSync());let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let[t,N]=C.load_contents(null);if(!t)throw createNodeError(Error(`failed to read file`),`read`,S);return encodeUint8Array(getEncodingFromOptions(n,`buffer`),N)}catch(t){throw t.code&&typeof t.code==`string`?t:createNodeError(t,`read`,S)}}function mkdirSync(t,n){let S=!1,C;n!=null&&(typeof n==`object`?(n.recursive&&(S=n.recursive),n.mode!==void 0&&(C=n.mode)):C=n),t=normalizePath$1(t);let N=normalizeMode(C,511);if(S)return mkdirSyncRecursive(t,N);mkdirWithMode(t,N)}function mkdirWithMode(t,n){if(_t.mkdir(t,n)!==0)throw classifyMkdirFailure(t)}function mkdirSyncRecursive(t,n){if(_t.mkdir(t,n)===0)return t;let S=classifyMkdirFailure(t);if(S.code===`EEXIST`){if(_t.file_test(t,_t.FileTest.IS_DIR))return;throw S}if(S.code!==`ENOENT`)throw S;let C=On(t,`..`),N=Si.File.new_for_path(C).get_path();if(N===t)throw S;let F=mkdirSyncRecursive(N,n);return mkdirWithMode(t,n),F??t}function rmdirSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{if(C.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null).get_file_type()!==Si.FileType.DIRECTORY)throw createNodeError(Object.assign(Error(),{code:4}),`rmdir`,S);if(C.enumerate_children(`standard::name`,Si.FileQueryInfoFlags.NONE,null).next_file(null)!==null)throw createNodeError(Object.assign(Error(),{code:5}),`rmdir`,S);C.delete(null)}catch(t){throw t.code&&typeof t.code==`string`?t:createNodeError(t,`rmdir`,S)}}function unlinkSync(t){let n=normalizePath$1(t),S=Si.File.new_for_path(n);try{S.delete(null)}catch(t){throw createNodeError(t,`unlink`,n)}}function writeWholeFile(t,n,S,C){let N=getEncodingFromOptions(S,`utf8`),F=typeof S==`object`&&S?S:{},I=typeof n==`string`?it.from(n,N||`utf8`):n;if(typeof t==`number`||t instanceof Id){if(typeof t==`number`&&isStdFd(t)){writeStdFdSync(t,I);return}Id.getInstance(t,`write`)._writeSync(I,null);return}let H=new Id({path:normalizePath$1(t),flags:F.flag??C,mode:F.mode??438});try{H._writeSync(I,null)}finally{H._closeSync()}}function writeFileSync(t,n,S){writeWholeFile(t,n,S??null,`w`)}function renameSync(t,n){let S=normalizePath$1(t),C=normalizePath$1(n),N=Si.File.new_for_path(S),F=Si.File.new_for_path(C);try{N.move(F,Si.FileCopyFlags.OVERWRITE,null,null)}catch(t){throw createNodeError(t,`rename`,S,C)}}function copyFileSync(t,n,S){let C=normalizePath$1(t),N=normalizePath$1(n),F=Si.File.new_for_path(C),I=Si.File.new_for_path(N),H=Si.FileCopyFlags.NONE;S&&!(S&1)?H=Si.FileCopyFlags.OVERWRITE:S||(H=Si.FileCopyFlags.OVERWRITE);try{F.copy(I,H,null,null)}catch(t){throw createNodeError(t,`copyfile`,C,N)}stripPrivilegeBitsAfterCopy(I,C,N)}function stripPrivilegeBitsAfterCopy(t,n,S){try{let n=t.query_info(`unix::mode,standard::size`,Si.FileQueryInfoFlags.NONE,null);if(n.get_size()===0)return;let S=n.get_attribute_uint32(`unix::mode`),C=S&-2049;if((isDarwin()||S&8)&&(C&=-1025),C===S)return;t.set_attribute_uint32(`unix::mode`,C,Si.FileQueryInfoFlags.NONE,null)}catch(t){throw createNodeError(t,`copyfile`,n,S)}}function accessSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let t=C.query_info(`access::*`,Si.FileQueryInfoFlags.NONE,null);if(n!==void 0&&n!==0){let C={code:14,message:`permission denied, access '${S}'`};if(n&4&&!t.get_attribute_boolean(`access::can-read`)||n&2&&!t.get_attribute_boolean(`access::can-write`)||n&1&&!t.get_attribute_boolean(`access::can-execute`))throw createNodeError(C,`access`,S)}}catch(t){throw t.code&&typeof t.code==`string`?t:createNodeError(t,`access`,S)}}function appendFileSync(t,n,S){writeWholeFile(t,n,S??null,`a`)}function readlinkSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let t=C.query_info(`standard::symlink-target`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null).get_symlink_target();if(!t)throw Object.assign(Error(`EINVAL: invalid argument, readlink '${S}'`),{code:`EINVAL`,errno:-22,syscall:`readlink`,path:S});return(typeof n==`string`?n:n?.encoding)===`buffer`?it.from(t):t}catch(t){throw typeof t.code==`string`?t:createNodeError(t,`readlink`,S)}}function linkSync(t,n){let S=normalizePath$1(t),C=normalizePath$1(n);if(Si.File.new_for_path(S).query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)===Si.FileType.UNKNOWN)throw Object.assign(Error(`ENOENT: no such file or directory, link '${S}' -> '${C}'`),{code:`ENOENT`,errno:-2,syscall:`link`,path:S,dest:C});if(Si.File.new_for_path(C).query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)!==Si.FileType.UNKNOWN)throw Object.assign(Error(`EEXIST: file already exists, link '${S}' -> '${C}'`),{code:`EEXIST`,errno:-17,syscall:`link`,path:S,dest:C});let N=``;try{let[,,t,n]=_t.spawn_sync(null,[`ln`,`--`,S,C],null,_t.SpawnFlags.SEARCH_PATH,null);if(N=t?new TextDecoder().decode(t).trim():``,!_t.spawn_check_wait_status(n))throw Error(`ln exited non-zero (${n})`);return}catch(t){throw N===``&&t instanceof Error&&(N=t.message),Object.assign(Error(`EPERM: operation not permitted, link '${S}' -> '${C}'`+(N?` (${N})`:``)),{code:`EPERM`,errno:-1,syscall:`link`,path:S,dest:C})}}function truncateSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let t=C.open_readwrite(null);try{t.get_output_stream().truncate(Math.max(0,n??0),null)}finally{t.close(null)}}catch(t){throw createNodeError(t,`truncate`,S)}}function chmodSync(t,n){let S=normalizePath$1(t),C=normalizeMode(n);try{Si.File.new_for_path(S).set_attribute_uint32(`unix::mode`,C,Si.FileQueryInfoFlags.NONE,null)}catch(t){throw createNodeError(t,`chmod`,S)}}function chownSync(t,n,S){let C=normalizePath$1(t);try{let t=Si.File.new_for_path(C),N=new Si.FileInfo;n!==-1&&N.set_attribute_uint32(`unix::uid`,n),S!==-1&&N.set_attribute_uint32(`unix::gid`,S),t.set_attributes_from_info(N,Si.FileQueryInfoFlags.NONE,null)}catch(t){throw createNodeError(t,`chown`,C)}}function watch(t,n,S){return typeof n==`function`&&(S=n,n=void 0),new FSWatcher(normalizePath$1(t),n,S)}function openSync(t,n,S){return new Id({path:t,flags:n,mode:S})}function mkdtempSync(t,n){let S=getEncodingFromOptions(n),C=mkdtempAt(t);return S===`buffer`?it.from(C):decode(C,S)}function mkdtempAt(t){for(let n=0;n<64;n++){let n=t+randomName();if(_t.mkdir(n,448)===0)return n;let S=classifyMkdirFailure(n);if(S.code!==`EEXIST`)throw S.syscall=`mkdtemp`,S}throw fsError(`EEXIST`,`mkdtemp`,t+`XXXXXX`)}function rmSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S),N=n?.recursive||!1,F=n?.force||!1,I;try{I=C.query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){if(F&&isNotFoundError(n))return;throw createNodeError(n,`rm`,t)}if(I===Si.FileType.SYMBOLIC_LINK){try{C.delete(null)}catch(n){if(F&&isNotFoundError(n))return;throw createNodeError(n,`rm`,t)}return}if(I===Si.FileType.DIRECTORY){let C=readdirSync(t);if(!N&&C.length)throw createNodeError(Object.assign(Error(),{code:5}),`rm`,t);for(let t of C)rmSync(On(S,t),n)}try{C.delete(null)}catch(n){if(F&&isNotFoundError(n))return;throw createNodeError(n,`rm`,t)}}var pd=__esmMin(()=>{Xu(),Bu(),Vu(),Wu(),Yu(),nd(),rd(),ud(),fd(),Ld(),vt(),Ci(),zn(),mt(),uo(),Je(),realpathSync.native=realpathSync});function makeEEXIST(t){let n=Error(`ERR_FS_CP_EEXIST: file already exists, copyfile '${t}'`);return n.code=`ERR_FS_CP_EEXIST`,n.syscall=`copyfile`,n.path=t,n}function makeEISDIR(t){let n=Error(`ERR_FS_EISDIR: illegal operation on a directory, copyfile '${t}'`);return n.code=`ERR_FS_EISDIR`,n.syscall=`copyfile`,n.path=t,n}function makeENOTDIR(t,n){let S=Error(`ENOTDIR: not a directory, copyfile '${t}' -> '${n}'`);return S.code=`ENOTDIR`,S.syscall=`copyfile`,S.path=t,S.dest=n,S}function makeSubdirOfSelf(t,n){let S=Error(`Cannot copy ${t} to a subdirectory of self ${n}`);return S.code=`ERR_FS_CP_EINVAL`,S}function queryCopyFlags(t){let n=t.force??!0,S=Si.FileCopyFlags.NONE;return n&&(S|=Si.FileCopyFlags.OVERWRITE),t.preserveTimestamps&&(S|=Si.FileCopyFlags.TARGET_DEFAULT_MODIFIED_TIME),t.dereference||(S|=Si.FileCopyFlags.NOFOLLOW_SYMLINKS),S}function copyOneSyncFile(t,n,S,C,N){let F=N.force??!0;try{if(n.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null).get_file_type()===Si.FileType.DIRECTORY)throw makeENOTDIR(S,C);if(!F){if(N.errorOnExist)throw makeEEXIST(C);return}}catch(t){if(typeof t.code==`string`)throw t}let I=queryCopyFlags(N);try{t.copy(n,I,null,null)}catch(t){throw createNodeError(t,`copyfile`,S,C)}}function isStrictSubdir(t,n){let S=$(t).split(In).filter(Boolean),C=$(n).split(In).filter(Boolean);return C.length>S.length&&S.every((t,n)=>C[n]===t)}function cpOneDirSync(t,n,S,C,N){if(isStrictSubdir(S,C))throw makeSubdirOfSelf(S,C);if(n.query_exists(null))try{if(n.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null).get_file_type()!==Si.FileType.DIRECTORY)throw makeENOTDIR(C,S)}catch(t){if(typeof t.code==`string`)throw t}else try{n.make_directory_with_parents(null)}catch(t){throw createNodeError(t,`mkdir`,C)}let F;try{F=t.enumerate_children(`standard::name,standard::type,standard::is-symlink`,N.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(t){throw createNodeError(t,`scandir`,S)}let I=F.next_file(null);for(;I!==null;){let t=I.get_name(),n=On(S,t),H=On(C,t),W=N.filter;if(W&&!W(n,H)){I=F.next_file(null);continue}cpSyncInternal(n,H,N),I=F.next_file(null)}}function cpSyncInternal(t,n,S){let C=Si.File.new_for_path(t),N=Si.File.new_for_path(n),F;try{F=C.query_info(`standard::type,standard::is-symlink`,S.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){throw createNodeError(n,`stat`,t)}if(F.get_file_type()===Si.FileType.DIRECTORY){if(!S.recursive)throw makeEISDIR(t);cpOneDirSync(C,N,t,n,S)}else copyOneSyncFile(C,N,t,n,S)}function cpSync(t,n,S){let C=normalizePath$1(t),N=normalizePath$1(n),F=S??{},I=Si.File.new_for_path(C),H=F.filter;if(!(H&&!H(C,N))){try{if(I.query_info(`standard::type`,F.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null).get_file_type()===Si.FileType.DIRECTORY&&!F.recursive)throw makeEISDIR(C)}catch(t){throw typeof t.code==`string`?t:createNodeError(t,`stat`,C)}cpSyncInternal(C,N,F)}}function cp(t,n,S,C){let N,F;typeof S==`function`?(F=S,N={}):(F=requireCallback(C),N=S);let I=N.filter;if(I){Promise.resolve(I(normalizePath$1(t),normalizePath$1(n))).then(S=>{if(!S){F(null);return}try{cpPromises(t,n,N).then(()=>F(null)).catch(F)}catch(t){F(t)}}).catch(F);return}Promise.resolve().then(()=>{try{cpSync(t,n,N),F(null)}catch(t){F(t)}})}async function cpPromisesDir(t,n,S){if(isStrictSubdir(t,n))throw makeSubdirOfSelf(t,n);let C=Si.File.new_for_path(n);if(!C.query_exists(null))try{C.make_directory_with_parents(null)}catch(t){throw createNodeError(t,`mkdir`,n)}let N=Si.File.new_for_path(t),F;try{F=N.enumerate_children(`standard::name,standard::type`,S.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){throw createNodeError(n,`scandir`,t)}let I=F.next_file(null);for(;I!==null;){let C=I.get_name(),N=On(t,C),H=On(n,C),W=S.filter;if(W&&!await Promise.resolve(W(N,H))){I=F.next_file(null);continue}await cpPromises(N,H,S),I=F.next_file(null)}}async function cpPromises(t,n,S={}){let C=normalizePath$1(t),N=normalizePath$1(n),F=Si.File.new_for_path(C),I;try{I=F.query_info(`standard::type`,S.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(t){throw createNodeError(t,`stat`,C)}if(I.get_file_type()===Si.FileType.DIRECTORY){if(!S.recursive)throw makeEISDIR(C);await cpPromisesDir(C,N,S)}else copyOneSyncFile(F,Si.File.new_for_path(N),C,N,S)}var md=__esmMin(()=>{Bu(),Vu(),Ci(),zn()});function _openDir(t){let n=Si.File.new_for_path(t),S;try{S=n.enumerate_children(hd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){throw createNodeError(n,`opendir`,t)}return new Dir(t,S)}function opendirSync(t){return _openDir(normalizePath$1(t))}function opendir(t,n,S){let C;if(C=typeof n==`function`?n:requireCallback(S,`callback`),typeof C!=`function`)throw TypeError(`The "callback" argument must be of type function`);Promise.resolve().then(()=>{try{let n=opendirSync(t);C(null,n)}catch(t){C(t,null)}})}async function opendirAsync(t,n){return new Promise((n,S)=>{let C=normalizePath$1(t),N=Si.File.new_for_path(C);N.enumerate_children_async(hd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,_t.PRIORITY_DEFAULT,null,(t,F)=>{try{let t=N.enumerate_children_finish(F);n(new Dir(C,t))}catch(t){S(createNodeError(t,`opendir`,C))}})})}var hd,Dir,gd=__esmMin(()=>{Bu(),Vu(),rd(),vt(),Ci(),zn(),hd=`standard::name,standard::type,standard::is-symlink,standard::size,standard::symlink-target,unix::uid,unix::gid,unix::mode,time::modified,time::access,time::created`,Dir=class{path;_enumerator;_closed=!1;constructor(t,n){this.path=t,this._enumerator=n}_assertOpen(){if(this._closed){let t=Error(`Directory handle was closed`);throw t.code=`ERR_DIR_CLOSED`,t}}readSync(){this._assertOpen();try{let t=this._enumerator.next_file(null);if(t===null)return null;let n=t.get_name(),S=t.get_file_type();return new Dirent(On(this.path,n),n,S,void 0,this.path)}catch(t){throw createNodeError(t,`readdir`,this.path)}}read(t){if(t!==void 0){if(typeof t!=`function`)throw TypeError(`The "callback" argument must be of type function`);try{this._assertOpen();let n=this.readSync();Promise.resolve().then(()=>t(null,n))}catch(n){Promise.resolve().then(()=>t(n,null))}return}return new Promise((t,n)=>{try{this._assertOpen(),t(this.readSync())}catch(t){n(t)}})}closeSync(){this._assertOpen(),this._closed=!0;try{this._enumerator.close(null)}catch{}this._enumerator=null}close(t){if(t!==void 0){if(typeof t!=`function`)throw TypeError(`The "callback" argument must be of type function`);try{this.closeSync(),Promise.resolve().then(()=>t(null))}catch(n){Promise.resolve().then(()=>t(n))}return}return new Promise((t,n)=>{try{this.closeSync(),t()}catch(t){n(t)}})}async*[Symbol.asyncIterator](){try{for(;;){let t=await this.read();if(t===null)break;yield t}}finally{this._closed||await this.close()}}}});function segmentToRegexSrc(t){let n=/^([!*+?@])\((.+)\)$/.exec(t);if(n){let[,t,S]=n,C=S.split(`|`).map(t=>segmentToRegexSrc(t)),N=`(?:`+C.join(`|`)+`)`;switch(t){case`!`:return`(?!(?:`+C.join(`|`)+`))[^/]*`;case`*`:return N+`*`;case`+`:return N+`+`;case`?`:return N+`?`;case`@`:return N}}let S=``,C=0;for(;C<t.length;){let n=t[C];if(n===`*`){S+=`[^/]*`,C++;continue}if(n===`?`){S+=`[^/]`,C++;continue}if(n===`[`){let n=t.indexOf(`]`,C+1);if(n===-1){S+=`\\[`,C++;continue}S+=t.slice(C,n+1),C=n+1;continue}if(n===`{`){let n=t.indexOf(`}`,C+1);if(n===-1){S+=`\\{`,C++;continue}let N=t.slice(C+1,n).split(`,`).map(t=>segmentToRegexSrc(t.trim()));S+=`(?:`+N.join(`|`)+`)`,C=n+1;continue}`.+^$|()[]{}`.includes(n)?S+=`\\`+n:S+=n,C++}return S}function globToRegex$2(t){t=t.replace(/\/+/g,`/`).replace(/^\.\//,``);let n=t.split(`/`),S=[];for(let t=0;t<n.length;t++){let C=n[t],N=t===n.length-1;C===`**`?N?S.length>0&&S[S.length-1]===`/`?(S.pop(),S.push(`(?:/.+)?`)):S.push(`(?:.+)?`):S.push(`(?:[^/]+/)*`):(S.push(segmentToRegexSrc(C)),N||S.push(`/`))}return RegExp(`^(?:`+S.join(``)+`)$`)}function buildExcludePredicate(t){if(!t)return null;if(typeof t==`function`)return t;let n=(Array.isArray(t)?t:[t]).map(t=>globToRegex$2(t));return t=>n.some(n=>n.test(t))}function matchAll(t,n,S){let C=globToRegex$2(t),N=buildExcludePredicate(S),F;try{F=readdirSync(n,{recursive:!0})}catch{return[]}let I=[`.`,...F],H=[];for(let t of I){let n=t.replace(/\\/g,`/`);C.test(n)&&(N&&N(n)||H.push(t))}return H}function globSync(t,n){let S=Array.isArray(t)?t:[t],C=n?.cwd?normalizePath$1(n.cwd):globalThis.process?.cwd?.()??`/`,N=n?.exclude,F=new Set,I=[];for(let t of S)for(let n of matchAll(t,C,N))F.has(n)||(F.add(n),I.push(n));return I}function glob(t,n,S){let C,N;typeof n==`function`?(N=n,C={}):(N=requireCallback(S),C=n||{}),Promise.resolve().then(()=>{try{let n=globSync(t,C);N(null,n)}catch(t){N(t,[])}})}async function*globAsync(t,n){let S=globSync(t,n);for(let t of S)yield t}var _d=__esmMin(()=>{Bu(),Vu(),pd(),__name$1(globToRegex$2,`globToRegex`)});function buildStatFs(t){let n=Number(t.get_attribute_uint64(`filesystem::size`)??0),S=Number(t.get_attribute_uint64(`filesystem::free`)??0),C=Math.floor(n/yd),N=Math.floor(S/yd);return{type:0,bsize:yd,blocks:C,bfree:N,bavail:N,files:0,ffree:0}}function buildBigIntStatFs(t){let n=BigInt(t.get_attribute_uint64(`filesystem::size`)??0),S=BigInt(t.get_attribute_uint64(`filesystem::free`)??0),C=BigInt(yd),N=n/C,F=S/C;return{type:0n,bsize:C,blocks:N,bfree:F,bavail:F,files:0n,ffree:0n}}function statfsSync(t,n){let S=Si.File.new_for_path(normalizePath$1(t)).query_filesystem_info(vd,null);return n?.bigint===!0?buildBigIntStatFs(S):buildStatFs(S)}function queryFsInfoAsync(t,n){return new Promise((S,C)=>{let N=Si.File.new_for_path(normalizePath$1(t));N.query_filesystem_info_async(vd,_t.PRIORITY_DEFAULT,null,(t,F)=>{try{let t=N.query_filesystem_info_finish(F);S(n?buildBigIntStatFs(t):buildStatFs(t))}catch(t){C(t)}})})}function statfs(t,n,S){let C=typeof n==`function`?n:requireCallback(S);queryFsInfoAsync(t,(typeof n==`function`?{}:n)?.bigint===!0).then(t=>C(null,t),t=>C(t,null))}async function statfsAsync(t,n){return queryFsInfoAsync(t,n?.bigint===!0)}var vd,yd,bd=__esmMin(()=>{Bu(),Vu(),vt(),Ci(),vd=[`filesystem::size`,`filesystem::free`].join(`,`),yd=4096});function openFlagDescriptors(){let t={};for(let n of Object.keys(openFlagValues()))t[n]={enumerable:!0,configurable:!0,get:()=>openFlagValues()[n]};return t}var xd,Sd=__esmMin(()=>{nd(),xd=Object.defineProperties({F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1},openFlagDescriptors())}),Cd=__exportAll$5({access:()=>access$1,appendFile:()=>appendFile$1,chmod:()=>chmod$1,chown:()=>chown$1,constants:()=>xd,copyFile:()=>copyFile$1,cp:()=>cpPromises,default:()=>Td,fchmod:()=>fchmodAsync,fchown:()=>fchownAsync,fdatasync:()=>fdatasyncAsync,fstat:()=>fstatAsync,fsync:()=>fsyncAsync,ftruncate:()=>ftruncateAsync,futimes:()=>futimesAsync,glob:()=>globAsync,lchmod:()=>lchmodAsync,lchown:()=>lchownAsync,link:()=>link$1,lstat:()=>lstat$1,lutimes:()=>lutimesAsync,mkdir:()=>mkdir$1,mkdtemp:()=>mkdtemp$1,open:()=>open$2,openAsBlob:()=>openAsBlob,opendir:()=>opendirAsync,promises_exports:()=>wd,readFile:()=>readFile$1,readdir:()=>readdir$1,readlink:()=>readlink$1,readv:()=>readvAsync,realpath:()=>realpath$1,rename:()=>rename$1,rm:()=>rm$1,rmdir:()=>rmdir$1,stat:()=>stat$1,statfs:()=>statfsAsync,symlink:()=>symlink$1,truncate:()=>truncate$1,unlink:()=>unlink$1,utimes:()=>utimesAsync,watch:()=>watchAsync,write:()=>write$1,writeFile:()=>writeFile$1,writev:()=>writevAsync});async function mkdir$1(t,n){return mkdirSync(normalizePath$1(t),n)}async function readFile$1(t,n={encoding:null,flag:`r`}){if(t instanceof Id||typeof t==`number`){let S=Id.getInstance(t,`read`);return encodeUint8Array(getEncodingFromOptions(n,`buffer`),S._readToEndSync())}let S=normalizePath$1(t),C=Si.File.new_for_path(S),N,F;try{[N,F]=await new Promise((t,n)=>{C.load_contents_async(null,(S,N)=>{try{t(C.load_contents_finish(N))}catch(t){n(t)}})})}catch(t){throw createNodeError(t,`open`,S)}if(!N)throw createNodeError(Error(`failed to read file`),`open`,S);return encodeUint8Array(getEncodingFromOptions(n,`buffer`),F)}async function mkdtemp$1(t,n){let S=getEncodingFromOptions(n);return decode(mkdtempAt(t),S)}async function writeFile$1(t,n,S){writeFileSync(t,typeof n==`string`||n instanceof Uint8Array?n:String(n),S??null)}async function rmdir$1(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);if((await new Promise((t,n)=>{C.query_info_async(`standard::type`,Si.FileQueryInfoFlags.NONE,_t.PRIORITY_DEFAULT,null,(N,F)=>{try{t(C.query_info_finish(F))}catch(t){n(createNodeError(t,`rmdir`,S))}})})).get_file_type()!==Si.FileType.DIRECTORY)throw createNodeError(Object.assign(Error(),{code:4}),`rmdir`,S);if((await new Promise((t,n)=>{C.enumerate_children_async(`standard::name`,Si.FileQueryInfoFlags.NONE,_t.PRIORITY_DEFAULT,null,(N,F)=>{try{t(C.enumerate_children_finish(F))}catch(t){n(createNodeError(t,`rmdir`,S))}})})).next_file(null)!==null)throw createNodeError(Object.assign(Error(),{code:5}),`rmdir`,S);await new Promise((t,n)=>{C.delete_async(_t.PRIORITY_DEFAULT,null,(N,F)=>{try{C.delete_finish(F),t()}catch(t){n(createNodeError(t,`rmdir`,S))}})})}async function unlink$1(t){let n=normalizePath$1(t),S=Si.File.new_for_path(n);await new Promise((t,C)=>{S.delete_async(_t.PRIORITY_DEFAULT,null,(N,F)=>{try{S.delete_finish(F),t()}catch(t){C(createNodeError(t,`unlink`,n))}})})}async function open$2(t,n,S){return new Id({path:t,flags:n,mode:S})}async function write$1(t,n,S,C,N){return typeof n==`string`?_writeStr(t,n,S,C):_writeBuf(t,n,S,C,N)}async function _writeBuf(t,n,S,C,N){return{bytesWritten:(await Id.getInstance(t,`write`).write(n,S,C,N)).bytesWritten,buffer:n}}async function _writeStr(t,n,S,C){return{bytesWritten:(await Id.getInstance(t,`write`).write(n,S,C)).bytesWritten,buffer:n}}function queryInfoAsync(t,n,S,C){let N=normalizePath$1(t);return new Promise((t,F)=>{let I=Si.File.new_for_path(N);I.query_info_async(dd,n,_t.PRIORITY_DEFAULT,null,(n,H)=>{try{t(statsFrom(I.query_info_finish(H),N,S,C?.bigint))}catch(t){F(createNodeError(t,S,N))}})})}async function stat$1(t,n){return queryInfoAsync(t,Si.FileQueryInfoFlags.NONE,`stat`,n)}async function lstat$1(t,n){return queryInfoAsync(t,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,`lstat`,n)}async function readdir$1(t,n){try{return readdirSync(t,n)}catch(n){throw createNodeError(n,`scandir`,t)}}async function realpath$1(t){return realpathSync(t)}async function symlink$1(t,n,S){let C=normalizePath$1(n),N=normalizePath$1(t);return new Promise((t,n)=>{let S=Si.File.new_for_path(C);S.make_symbolic_link_async(N,_t.PRIORITY_DEFAULT,null,(F,I)=>{try{S.make_symbolic_link_finish(I),t()}catch(t){n(createNodeError(t,`symlink`,N,C))}})})}async function rm$1(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S),N=n?.recursive||!1,F=n?.force||!1,I;try{I=C.query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){if(F)return;throw createNodeError(n,`rm`,t)}if(I===Si.FileType.SYMBOLIC_LINK){await new Promise((n,S)=>{C.delete_async(_t.PRIORITY_DEFAULT,null,(N,I)=>{try{C.delete_finish(I),n()}catch(C){if(F){n();return}S(createNodeError(C,`rm`,t))}})});return}if(I===Si.FileType.DIRECTORY){let C=await readdir$1(t,{withFileTypes:!0});if(!N&&C.length)throw createNodeError(Object.assign(Error(),{code:5}),`rm`,t);for(let t of C)typeof t!=`string`&&await rm$1(On(S,t.name),n)}await new Promise((n,S)=>{C.delete_async(_t.PRIORITY_DEFAULT,null,(N,I)=>{try{C.delete_finish(I),n()}catch(C){if(F){n();return}S(createNodeError(C,`rm`,t))}})})}async function rename$1(t,n){renameSync(t,n)}async function copyFile$1(t,n,S){copyFileSync(t,n,S)}async function access$1(t,n){accessSync(t,n)}async function appendFile$1(t,n,S){appendFileSync(t,n,S)}async function readlink$1(t,n){return readlinkSync(t,n)}async function truncate$1(t,n){truncateSync(t,n)}async function chmod$1(t,n){chmodSync(t,n)}async function chown$1(t,n,S){chownSync(t,n,S)}async function link$1(t,n){linkSync(t,n)}var wd,Td,Ed=__esmMin(()=>{zu(),Xu(),Bu(),Vu(),Wu(),Ku(),Rd(),fd(),Ld(),pd(),md(),gd(),_d(),bd(),Sd(),vt(),Ci(),zn(),wd=Ru({access:()=>access$1,appendFile:()=>appendFile$1,chmod:()=>chmod$1,chown:()=>chown$1,constants:()=>xd,copyFile:()=>copyFile$1,cp:()=>cpPromises,default:()=>Td,fchmod:()=>fchmodAsync,fchown:()=>fchownAsync,fdatasync:()=>fdatasyncAsync,fstat:()=>fstatAsync,fsync:()=>fsyncAsync,ftruncate:()=>ftruncateAsync,futimes:()=>futimesAsync,glob:()=>globAsync,lchmod:()=>lchmodAsync,lchown:()=>lchownAsync,link:()=>link$1,lstat:()=>lstat$1,lutimes:()=>lutimesAsync,mkdir:()=>mkdir$1,mkdtemp:()=>mkdtemp$1,open:()=>open$2,openAsBlob:()=>openAsBlob,opendir:()=>opendirAsync,readFile:()=>readFile$1,readdir:()=>readdir$1,readlink:()=>readlink$1,readv:()=>readvAsync,realpath:()=>realpath$1,rename:()=>rename$1,rm:()=>rm$1,rmdir:()=>rmdir$1,stat:()=>stat$1,statfs:()=>statfsAsync,symlink:()=>symlink$1,truncate:()=>truncate$1,unlink:()=>unlink$1,utimes:()=>utimesAsync,watch:()=>watchAsync,write:()=>write$1,writeFile:()=>writeFile$1,writev:()=>writevAsync}),__name$1(mkdir$1,`mkdir`),__name$1(readFile$1,`readFile`),__name$1(mkdtemp$1,`mkdtemp`),__name$1(writeFile$1,`writeFile`),__name$1(rmdir$1,`rmdir`),__name$1(unlink$1,`unlink`),__name$1(open$2,`open`),__name$1(write$1,`write`),__name$1(stat$1,`stat`),__name$1(lstat$1,`lstat`),__name$1(readdir$1,`readdir`),__name$1(realpath$1,`realpath`),__name$1(symlink$1,`symlink`),__name$1(rm$1,`rm`),__name$1(rename$1,`rename`),__name$1(copyFile$1,`copyFile`),__name$1(access$1,`access`),__name$1(appendFile$1,`appendFile`),__name$1(readlink$1,`readlink`),__name$1(truncate$1,`truncate`),__name$1(chmod$1,`chmod`),__name$1(chown$1,`chown`),__name$1(link$1,`link`),Td={readFile:readFile$1,mkdir:mkdir$1,mkdtemp:mkdtemp$1,realpath:realpath$1,readdir:readdir$1,writeFile:writeFile$1,rmdir:rmdir$1,unlink:unlink$1,open:open$2,write:write$1,rm:rm$1,lstat:lstat$1,symlink:symlink$1,stat:stat$1,rename:rename$1,copyFile:copyFile$1,access:access$1,appendFile:appendFile$1,readlink:readlink$1,truncate:truncate$1,chmod:chmod$1,chown:chown$1,link:link$1,cp:cpPromises,opendir:opendirAsync,glob:globAsync,watch:watchAsync,statfs:statfsAsync,utimes:utimesAsync,lutimes:lutimesAsync,lchown:lchownAsync,lchmod:lchmodAsync,fstat:fstatAsync,ftruncate:ftruncateAsync,fdatasync:fdatasyncAsync,fsync:fsyncAsync,fchmod:fchmodAsync,fchown:fchownAsync,futimes:futimesAsync,readv:readvAsync,writev:writevAsync,openAsBlob,constants:xd}});function withHandle(t,n,S){try{return Id.getInstance(t,n)}catch(t){return Promise.resolve().then(()=>S(t)),null}}function parseOptsCb(t,n){return typeof t==`function`?{options:{},callback:t}:{options:t??{},callback:requireCallback(n)}}function statImpl(t,n,S,C,N){let F=normalizePath$1(t),I=Si.File.new_for_path(F);I.query_info_async(dd,n,_t.PRIORITY_DEFAULT,null,(t,n)=>{try{N(null,statsFrom(I.query_info_finish(n),F,S,C?.bigint))}catch(t){N(createNodeError(t,S,F))}})}function stat(t,n,S){let{options:C,callback:N}=parseOptsCb(n,S);statImpl(t,Si.FileQueryInfoFlags.NONE,`stat`,C,N)}function lstat(t,n,S){let{options:C,callback:N}=parseOptsCb(n,S);statImpl(t,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,`lstat`,C,N)}function readdir(t,n,S){let{options:C,callback:N}=parseOptsCb(n,S);Promise.resolve().then(()=>{try{N(null,readdirSync(t,C))}catch(n){N(createNodeError(n,`readdir`,t))}})}function realpath(t,n,S){let{callback:C}=parseOptsCb(n,S);Promise.resolve().then(()=>{try{C(null,realpathSync(t))}catch(t){C(t)}})}function symlink(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C);if(typeof N!=`function`)throw TypeError(`Callback must be a function. Received `+typeof N);let F=normalizePath$1(n),I=normalizePath$1(t),H=Si.File.new_for_path(F);H.make_symbolic_link_async(I,_t.PRIORITY_DEFAULT,null,(t,n)=>{try{H.make_symbolic_link_finish(n),N(null)}catch(t){N(createNodeError(t,`symlink`,I,F))}})}function open$1(t,...n){let S,C,N;switch(n.length){case 1:N=n[0];break;case 2:S=n[0],N=n[1];break;case 3:S=n[0],C=n[1],N=n[2];break;default:break}let F=requireCallback(N);open$2(t,S,C).then(t=>{F(null,t.fd)}).catch(t=>{F(t,-1)})}function write(t,n,...S){requireCallback(S[S.length-1]);let C=withHandle(t,`write`,t=>{let C=S[S.length-1];typeof n==`string`?C(t,0,``):C(t,0,it.from([]))});if(!C)return;if(typeof n==`string`){let t=S.pop(),N=S[0],F=S[1];C.write(n,N,F).then(n=>{t(null,n.bytesWritten,n.buffer)}).catch(n=>{t(n,0,``)});return}let N=S[S.length-1],F=S[0],I=S[1],H=S[2];C.write(n,F,I,H).then(t=>{N(null,t.bytesWritten,t.buffer)}).catch(t=>{N(t,0,it.from([]))})}function read$1(t,...n){let S=requireCallback(n[n.length-1]),C=withHandle(t,`read`,t=>{typeof S==`function`&&S(t,0,it.from([]))});if(!C)return;let N,F,I,H;if(!(n.length<=1))if(typeof n[0]==`object`&&!ArrayBuffer.isView(n[0])){let t=n[0];N=t.buffer,F=t.offset,I=t.length,H=t.position}else N=n[0],F=n[1],I=n[2],H=n[3];C.read(N,F,I,H).then(t=>{S(null,t.bytesRead,t.buffer)}).catch(t=>{S(t,0,it.from([]))})}function close$1(t,n){let done=t=>{typeof n==`function`&&n(t)},S=withHandle(t,`close`,done);S&&S.close().then(()=>done(null)).catch(t=>done(t))}function rm(t,...n){let S={},C=n[n.length-1];n.length>=2&&(S=n[0]),rm$1(t,S).then(()=>{C(null)}).catch(t=>{C(t)})}function rename(t,n,S){requireCallback(S),Promise.resolve().then(()=>{try{renameSync(t,n),S(null)}catch(t){S(t)}})}function copyFile(t,n,S,C){let N=typeof S==`function`?0:S,F=typeof S==`function`?S:requireCallback(C);Promise.resolve().then(()=>{try{copyFileSync(t,n,N),F(null)}catch(t){F(t)}})}function access(t,n,S){let C=typeof n==`function`?void 0:n,N=typeof n==`function`?n:requireCallback(S);Promise.resolve().then(()=>{try{accessSync(t,C),N(null)}catch(t){N(t)}})}function appendFile(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C),F=typeof S==`function`?void 0:S;Promise.resolve().then(()=>{try{appendFileSync(t,n,F),N(null)}catch(t){N(t)}})}function readlink(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{C(null,readlinkSync(t,N))}catch(t){C(t,``)}})}function truncate(t,n,S){let C=typeof n==`function`?0:n,N=typeof n==`function`?n:requireCallback(S);Promise.resolve().then(()=>{try{truncateSync(t,C),N(null)}catch(t){N(t)}})}function chmod(t,n,S){requireCallback(S),Promise.resolve().then(()=>{try{chmodSync(t,n),S(null)}catch(t){S(t)}})}function chown(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>{try{chownSync(t,n,S),C(null)}catch(t){C(t)}})}function mkdir(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{mkdirSync(t,N),C(null)}catch(t){C(t)}})}function mkdtemp(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{let n;try{n=mkdtempSync(t,N)}catch(t){C(t,void 0);return}C(null,n)})}function rmdir(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{rmdirSync(t,N),C(null)}catch(t){C(t)}})}function readFile(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{let n=typeof N==`string`?{encoding:N,flag:`r`}:{encoding:N?.encoding??null,flag:N?.flag??`r`};C(null,readFileSync(t,n))}catch(t){C(t,null)}})}function writeFile(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C),F=typeof S==`function`?void 0:S;Promise.resolve().then(()=>{try{writeFileSync(t,n,F),N(null)}catch(t){N(t)}})}function link(t,n,S){requireCallback(S),Promise.resolve().then(()=>{try{linkSync(t,n),S(null)}catch(t){S(t)}})}function unlink(t,n){requireCallback(n);let S=normalizePath$1(t);Promise.resolve().then(()=>{_t.unlink(S),n(null)})}var Dd=__esmMin(()=>{Bu(),Vu(),fd(),Ld(),pd(),Ed(),vt(),Ci(),mt(),__name$1(open$1,`open`),__name$1(read$1,`read`),__name$1(close$1,`close`)});function toPathIfFileURL(t){return normalizePath$1(t)}function createWriteStream(t,n){return new WriteStream(t,n)}var Od,kd,WriteStream,Ad=__esmMin(()=>{Bu(),nd(),Dd(),la(),Od=Symbol(`kIsPerformingIO`),kd=Symbol(`kIoDone`),WriteStream=class extends ia{close(t,n=null){let done=n=>{typeof t==`function`&&t(n)};if(this.fd===null||!this._autoClose)this.fd=null,done(n);else{let t=this._fdFromHandle;close$1(this.fd,S=>{let C=t&&S?.code===`EBADF`?null:S;done(C||n)}),this.fd=null}}bytesWritten=0;path;pending;fd=null;flags=`w`;mode=438;pos=void 0;_autoClose=!0;_fdFromHandle=!1;[Od]=!1;constructor(t,n={}){super(n),this.path=toPathIfFileURL(t),n.flags!==void 0&&(this.flags=n.flags),n.mode!==void 0&&(this.mode=normalizeMode(n.mode,438)),n.start!==void 0&&(this.pos=n.start),n.encoding&&this.setDefaultEncoding(n.encoding),typeof n.fd==`number`?(this.fd=n.fd,this._autoClose=n.autoClose??!0,this._fdFromHandle=n.fdFromHandle===!0):n.autoClose!==void 0&&(this._autoClose=n.autoClose),this.pending=this.fd===null}_construct(t){if(this.fd!==null){t(),this.emit(`open`,this.fd),this.emit(`ready`);return}open$1(this.path.toString(),this.flags,this.mode,(n,S)=>{if(n){t(n);return}this.fd=S,this.pending=!1,t(),this.emit(`open`,this.fd),this.emit(`ready`)})}_write(t,n,S){this[Od]=!0,write(this.fd,t,0,t.length,this.pos??null,(t,n)=>{if(this[Od]=!1,this.destroyed)return S(t),this.emit(kd,t);if(t)return S(t);this.bytesWritten+=n,S()}),this.pos!==void 0&&(this.pos+=t.length)}_destroy(t,n){this[Od]?this.once(kd,S=>this.close(n,t||S)):this.close(n,t)}}});function createInterface$1(t,n,S,C){return typeof t==`object`&&t&&!(`read`in t&&typeof t.read==`function`)?new Interface$1(t):new Interface$1({input:t,output:n,completer:S,terminal:C})}function*emitKeys(t){for(;;){let n=yield,S=n,C=!1,N={sequence:``,name:void 0,ctrl:!1,meta:!1,shift:!1};if(n===`\x1B`&&(C=!0,S+=n=yield,n===`\x1B`&&(S+=n=yield)),C&&(n===`O`||n===`[`)){let t=n,C=0;if(n===`O`)S+=n=yield,n>=`0`&&n<=`9`&&(C=n.charCodeAt(0)-1,S+=n=yield),t+=n;else if(n===`[`){S+=n=yield,n===`[`&&(t+=n,S+=n=yield);let N=S.length-1;n>=`0`&&n<=`9`&&(S+=n=yield,n>=`0`&&n<=`9`&&(S+=n=yield,n>=`0`&&n<=`9`&&(S+=n=yield))),n===`;`&&(S+=n=yield,n>=`0`&&n<=`9`&&(S+=yield));let F=S.slice(N),I;(I=/^(?:(\d\d?)(?:;(\d))?([~^$])|(\d{3}~))$/.exec(F))?I[4]?t+=I[4]:(t+=I[1]+I[3],C=(parseInt(I[2]??`1`,10)||1)-1):(I=/^((\d;)?(\d))?([A-Za-z])$/.exec(F))?(t+=I[4],C=(parseInt(I[3]??`1`,10)||1)-1):t+=F}switch(N.ctrl=!!(C&4),N.meta=!!(C&10),N.shift=!!(C&1),N.code=t,t){case`[P`:case`OP`:case`[11~`:case`[[A`:N.name=`f1`;break;case`[Q`:case`OQ`:case`[12~`:case`[[B`:N.name=`f2`;break;case`[R`:case`OR`:case`[13~`:case`[[C`:N.name=`f3`;break;case`[S`:case`OS`:case`[14~`:case`[[D`:N.name=`f4`;break;case`[15~`:case`[[E`:N.name=`f5`;break;case`[17~`:N.name=`f6`;break;case`[18~`:N.name=`f7`;break;case`[19~`:N.name=`f8`;break;case`[20~`:N.name=`f9`;break;case`[21~`:N.name=`f10`;break;case`[23~`:N.name=`f11`;break;case`[24~`:N.name=`f12`;break;case`[200~`:N.name=`paste-start`;break;case`[201~`:N.name=`paste-end`;break;case`[A`:case`OA`:N.name=`up`;break;case`[B`:case`OB`:N.name=`down`;break;case`[C`:case`OC`:N.name=`right`;break;case`[D`:case`OD`:N.name=`left`;break;case`[E`:case`OE`:N.name=`clear`;break;case`[F`:case`OF`:N.name=`end`;break;case`[H`:case`OH`:N.name=`home`;break;case`[1~`:N.name=`home`;break;case`[2~`:N.name=`insert`;break;case`[3~`:N.name=`delete`;break;case`[4~`:N.name=`end`;break;case`[5~`:case`[[5~`:N.name=`pageup`;break;case`[6~`:case`[[6~`:N.name=`pagedown`;break;case`[7~`:N.name=`home`;break;case`[8~`:N.name=`end`;break;case`[a`:N.name=`up`,N.shift=!0;break;case`[b`:N.name=`down`,N.shift=!0;break;case`[c`:N.name=`right`,N.shift=!0;break;case`[d`:N.name=`left`,N.shift=!0;break;case`[2$`:N.name=`insert`,N.shift=!0;break;case`[3$`:N.name=`delete`,N.shift=!0;break;case`[5$`:N.name=`pageup`,N.shift=!0;break;case`[6$`:N.name=`pagedown`,N.shift=!0;break;case`[7$`:N.name=`home`,N.shift=!0;break;case`[8$`:N.name=`end`,N.shift=!0;break;case`Oa`:N.name=`up`,N.ctrl=!0;break;case`Ob`:N.name=`down`,N.ctrl=!0;break;case`Oc`:N.name=`right`,N.ctrl=!0;break;case`Od`:N.name=`left`,N.ctrl=!0;break;case`[2^`:N.name=`insert`,N.ctrl=!0;break;case`[3^`:N.name=`delete`,N.ctrl=!0;break;case`[5^`:N.name=`pageup`,N.ctrl=!0;break;case`[6^`:N.name=`pagedown`,N.ctrl=!0;break;case`[7^`:N.name=`home`,N.ctrl=!0;break;case`[8^`:N.name=`end`,N.ctrl=!0;break;case`[Z`:N.name=`tab`,N.shift=!0;break;default:N.name=`undefined`;break}}else n===`\r`?(N.name=`return`,N.meta=C):n===`
|
|
66
|
+
function combineAliases(t){let n=[],S=Object.create(null),C=!0;for(Object.keys(t).forEach(function(S){n.push([].concat(t[S],S))});C;){C=!1;for(let t=0;t<n.length;t++)for(let S=t+1;S<n.length;S++)if(n[t].filter(function(t){return n[S].indexOf(t)!==-1}).length){n[t]=n[t].concat(n[S]),n.splice(S,1),C=!0;break}}return n.forEach(function(t){t=t.filter(function(t,n,S){return S.indexOf(t)===n});let n=t.pop();n!==void 0&&typeof n==`string`&&(S[n]=t)}),S}function increment(t){return t===void 0?1:t+1}function sanitizeKey(t){return t===`__proto__`?`___proto___`:t}function stripQuotes$1(t){return typeof t==`string`&&(t[0]===`'`||t[0]===`"`)&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var Fu,YargsParser,Iu=__esmMin(()=>{Mu(),Pu(),ju(),YargsParser=class{constructor(t){Fu=t}parse(t,n){let S=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),C=tokenizeArgString(t),N=typeof t==`string`,F=combineAliases(Object.assign(Object.create(null),S.alias)),I=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":`no-`,"parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},S.configuration),H=Object.assign(Object.create(null),S.default),W=S.configObjects||[],q=S.envPrefix,Y=I[`populate--`],X=Y?`--`:`_`,Z=Object.create(null),te=Object.create(null),ne=S.__||Fu.format,re={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},ie=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,ae=RegExp(`^--`+I[`negation-prefix`]+`(.+)`);[].concat(S.array||[]).filter(Boolean).forEach(function(t){let n=typeof t==`object`?t.key:t,S=Object.keys(t).map(function(t){return{boolean:`bools`,string:`strings`,number:`numbers`}[t]}).filter(Boolean).pop();S&&(re[S][n]=!0),re.arrays[n]=!0,re.keys.push(n)}),[].concat(S.boolean||[]).filter(Boolean).forEach(function(t){re.bools[t]=!0,re.keys.push(t)}),[].concat(S.string||[]).filter(Boolean).forEach(function(t){re.strings[t]=!0,re.keys.push(t)}),[].concat(S.number||[]).filter(Boolean).forEach(function(t){re.numbers[t]=!0,re.keys.push(t)}),[].concat(S.count||[]).filter(Boolean).forEach(function(t){re.counts[t]=!0,re.keys.push(t)}),[].concat(S.normalize||[]).filter(Boolean).forEach(function(t){re.normalize[t]=!0,re.keys.push(t)}),typeof S.narg==`object`&&Object.entries(S.narg).forEach(([t,n])=>{typeof n==`number`&&(re.nargs[t]=n,re.keys.push(t))}),typeof S.coerce==`object`&&Object.entries(S.coerce).forEach(([t,n])=>{typeof n==`function`&&(re.coercions[t]=n,re.keys.push(t))}),S.config!==void 0&&(Array.isArray(S.config)||typeof S.config==`string`?[].concat(S.config).filter(Boolean).forEach(function(t){re.configs[t]=!0}):typeof S.config==`object`&&Object.entries(S.config).forEach(([t,n])=>{(typeof n==`boolean`||typeof n==`function`)&&(re.configs[t]=n)})),extendAliases(S.key,F,S.default,re.arrays),Object.keys(H).forEach(function(t){(re.aliases[t]||[]).forEach(function(n){H[n]=H[t]})});let oe=null;checkConfiguration();let Q=[],se=Object.assign(Object.create(null),{_:[]}),ce={};for(let t=0;t<C.length;t++){let n=C[t],S=n.replace(/^-{3,}/,`---`),N,F,H,W,q,Y;if(n!==`--`&&/^-/.test(n)&&isUnknownOptionAsArg(n))pushPositional(n);else if(S.match(/^---+(=|$)/)){pushPositional(n);continue}else if(n.match(/^--.+=/)||!I[`short-option-groups`]&&n.match(/^-.+=/))W=n.match(/^--?([^=]+)=([\s\S]*)$/),W!==null&&Array.isArray(W)&&W.length>=3&&(checkAllAliases(W[1],re.arrays)?t=eatArray(t,W[1],C,W[2]):checkAllAliases(W[1],re.nargs)===!1?setArg(W[1],W[2],!0):t=eatNargs(t,W[1],C,W[2]));else if(n.match(ae)&&I[`boolean-negation`])W=n.match(ae),W!==null&&Array.isArray(W)&&W.length>=2&&(F=W[1],setArg(F,checkAllAliases(F,re.arrays)?[!1]:!1));else if(n.match(/^--.+/)||!I[`short-option-groups`]&&n.match(/^-[^-]+/))W=n.match(/^--?(.+)/),W!==null&&Array.isArray(W)&&W.length>=2&&(F=W[1],checkAllAliases(F,re.arrays)?t=eatArray(t,F,C):checkAllAliases(F,re.nargs)===!1?(q=C[t+1],q!==void 0&&(!q.match(/^-/)||q.match(ie))&&!checkAllAliases(F,re.bools)&&!checkAllAliases(F,re.counts)||/^(true|false)$/.test(q)?(setArg(F,q),t++):setArg(F,defaultValue(F))):t=eatNargs(t,F,C));else if(n.match(/^-.\..+=/))W=n.match(/^-([^=]+)=([\s\S]*)$/),W!==null&&Array.isArray(W)&&W.length>=3&&setArg(W[1],W[2]);else if(n.match(/^-.\..+/)&&!n.match(ie))q=C[t+1],W=n.match(/^-(.\..+)/),W!==null&&Array.isArray(W)&&W.length>=2&&(F=W[1],q!==void 0&&!q.match(/^-/)&&!checkAllAliases(F,re.bools)&&!checkAllAliases(F,re.counts)?(setArg(F,q),t++):setArg(F,defaultValue(F)));else if(n.match(/^-[^-]+/)&&!n.match(ie)){H=n.slice(1,-1).split(``),N=!1;for(let S=0;S<H.length;S++){if(q=n.slice(S+2),H[S+1]&&H[S+1]===`=`){Y=n.slice(S+3),F=H[S],checkAllAliases(F,re.arrays)?t=eatArray(t,F,C,Y):checkAllAliases(F,re.nargs)===!1?setArg(F,Y):t=eatNargs(t,F,C,Y),N=!0;break}if(q===`-`){setArg(H[S],q);continue}if(/[A-Za-z]/.test(H[S])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&checkAllAliases(q,re.bools)===!1){setArg(H[S],q),N=!0;break}if(H[S+1]&&H[S+1].match(/\W/)){setArg(H[S],q),N=!0;break}else setArg(H[S],defaultValue(H[S]))}F=n.slice(-1)[0],!N&&F!==`-`&&(checkAllAliases(F,re.arrays)?t=eatArray(t,F,C):checkAllAliases(F,re.nargs)===!1?(q=C[t+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(ie))&&!checkAllAliases(F,re.bools)&&!checkAllAliases(F,re.counts)||/^(true|false)$/.test(q)?(setArg(F,q),t++):setArg(F,defaultValue(F))):t=eatNargs(t,F,C))}else if(n.match(/^-[0-9]$/)&&n.match(ie)&&checkAllAliases(n.slice(1),re.bools))F=n.slice(1),setArg(F,defaultValue(F));else if(n===`--`){Q=C.slice(t+1);break}else if(I[`halt-at-non-option`]){Q=C.slice(t);break}else pushPositional(n)}applyEnvVars(se,!0),applyEnvVars(se,!1),setConfig(se),setConfigObjects(),applyDefaultsAndAliases(se,re.aliases,H,!0),applyCoercions(se),I[`set-placeholder-key`]&&setPlaceholderKeys(se),Object.keys(re.counts).forEach(function(t){hasKey(se,t.split(`.`))||setArg(t,0)}),Y&&Q.length&&(se[X]=[]),Q.forEach(function(t){se[X].push(t)}),I[`camel-case-expansion`]&&I[`strip-dashed`]&&Object.keys(se).filter(t=>t!==`--`&&t.includes(`-`)).forEach(t=>{delete se[t]}),I[`strip-aliased`]&&[].concat(...Object.keys(F).map(t=>F[t])).forEach(t=>{I[`camel-case-expansion`]&&t.includes(`-`)&&delete se[t.split(`.`).map(t=>camelCase(t)).join(`.`)],delete se[t]});function pushPositional(t){let n=maybeCoerceNumber(`_`,t);(typeof n==`string`||typeof n==`number`)&&se._.push(n)}function eatNargs(t,n,S,C){let N,F=checkAllAliases(n,re.nargs);if(F=typeof F!=`number`||isNaN(F)?1:F,F===0)return isUndefined(C)||(oe=Error(ne(`Argument unexpected for: %s`,n))),setArg(n,defaultValue(n)),t;let H=+!isUndefined(C);if(I[`nargs-eats-options`])S.length-(t+1)+H<F&&(oe=Error(ne(`Not enough arguments following: %s`,n))),H=F;else{for(N=t+1;N<S.length&&(!S[N].match(/^-[^0-9]/)||S[N].match(ie)||isUnknownOptionAsArg(S[N]));N++)H++;H<F&&(oe=Error(ne(`Not enough arguments following: %s`,n)))}let W=Math.min(H,F);for(!isUndefined(C)&&W>0&&(setArg(n,C),W--),N=t+1;N<W+t+1;N++)setArg(n,S[N]);return t+W}function eatArray(t,n,S,C){let F=[],W=C||S[t+1],q=checkAllAliases(n,re.nargs);if(checkAllAliases(n,re.bools)&&!/^(true|false)$/.test(W))F.push(!0);else if(isUndefined(W)||isUndefined(C)&&/^-/.test(W)&&!ie.test(W)&&!isUnknownOptionAsArg(W)){if(H[n]!==void 0){let t=H[n];F=Array.isArray(t)?t:[t]}}else{isUndefined(C)||F.push(processValue(n,C,!0));for(let C=t+1;C<S.length&&!(!I[`greedy-arrays`]&&F.length>0||q&&typeof q==`number`&&F.length>=q||(W=S[C],/^-/.test(W)&&!ie.test(W)&&!isUnknownOptionAsArg(W)));C++)t=C,F.push(processValue(n,W,N))}return typeof q==`number`&&(q&&F.length<q||isNaN(q)&&F.length===0)&&(oe=Error(ne(`Not enough arguments following: %s`,n))),setArg(n,F),t}function setArg(t,n,S=N){/-/.test(t)&&I[`camel-case-expansion`]&&addNewAlias(t,t.split(`.`).map(function(t){return camelCase(t)}).join(`.`));let C=processValue(t,n,S),F=t.split(`.`);setKey(se,F,C),re.aliases[t]&&re.aliases[t].forEach(function(t){let n=t.split(`.`);setKey(se,n,C)}),F.length>1&&I[`dot-notation`]&&(re.aliases[F[0]]||[]).forEach(function(n){let S=n.split(`.`),N=[].concat(F);N.shift(),S=S.concat(N),(re.aliases[t]||[]).includes(S.join(`.`))||setKey(se,S,C)}),checkAllAliases(t,re.normalize)&&!checkAllAliases(t,re.arrays)&&[t].concat(re.aliases[t]||[]).forEach(function(t){Object.defineProperty(ce,t,{enumerable:!0,get(){return n},set(t){n=typeof t==`string`?Fu.normalize(t):t}})})}function addNewAlias(t,n){re.aliases[t]&&re.aliases[t].length||(re.aliases[t]=[n],Z[n]=!0),re.aliases[n]&&re.aliases[n].length||addNewAlias(n,t)}function processValue(t,n,S){S&&(n=stripQuotes$1(n)),(checkAllAliases(t,re.bools)||checkAllAliases(t,re.counts))&&typeof n==`string`&&(n=n===`true`);let C=Array.isArray(n)?n.map(function(n){return maybeCoerceNumber(t,n)}):maybeCoerceNumber(t,n);return checkAllAliases(t,re.counts)&&(isUndefined(C)||typeof C==`boolean`)&&(C=increment()),checkAllAliases(t,re.normalize)&&checkAllAliases(t,re.arrays)&&(C=Array.isArray(n)?n.map(t=>Fu.normalize(t)):Fu.normalize(n)),C}function maybeCoerceNumber(t,n){return!I[`parse-positional-numbers`]&&t===`_`||!checkAllAliases(t,re.strings)&&!checkAllAliases(t,re.bools)&&!Array.isArray(n)&&(looksLikeNumber(n)&&I[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))||!isUndefined(n)&&checkAllAliases(t,re.numbers))&&(n=Number(n)),n}function setConfig(t){let n=Object.create(null);applyDefaultsAndAliases(n,re.aliases,H),Object.keys(re.configs).forEach(function(S){let C=t[S]||n[S];if(C)try{let t=null,n=Fu.resolve(Fu.cwd(),C),N=re.configs[S];if(typeof N==`function`){try{t=N(n)}catch(n){t=n}if(t instanceof Error){oe=t;return}}else t=Fu.require(n);setConfigObject(t)}catch(n){n.name===`PermissionDenied`?oe=n:t[S]&&(oe=Error(ne(`Invalid JSON config file: %s`,C)))}})}function setConfigObject(t,n){Object.keys(t).forEach(function(S){let C=t[S],N=n?n+`.`+S:S;typeof C==`object`&&C&&!Array.isArray(C)&&I[`dot-notation`]?setConfigObject(C,N):(!hasKey(se,N.split(`.`))||checkAllAliases(N,re.arrays)&&I[`combine-arrays`])&&setArg(N,C)})}function setConfigObjects(){W!==void 0&&W.forEach(function(t){setConfigObject(t)})}function applyEnvVars(t,n){if(q===void 0)return;let S=typeof q==`string`?q:``,C=Fu.env();Object.keys(C).forEach(function(N){if(S===``||N.lastIndexOf(S,0)===0){let F=N.split(`__`).map(function(t,n){return n===0&&(t=t.substring(S.length)),camelCase(t)});(n&&re.configs[F.join(`.`)]||!n)&&!hasKey(t,F)&&setArg(F.join(`.`),C[N])}})}function applyCoercions(t){let n,S=new Set;Object.keys(t).forEach(function(C){if(!S.has(C)&&(n=checkAllAliases(C,re.coercions),typeof n==`function`))try{let N=maybeCoerceNumber(C,n(t[C]));[].concat(re.aliases[C]||[],C).forEach(n=>{S.add(n),t[n]=N})}catch(t){oe=t}})}function setPlaceholderKeys(t){return re.keys.forEach(n=>{~n.indexOf(`.`)||t[n]===void 0&&(t[n]=void 0)}),t}function applyDefaultsAndAliases(t,n,S,C=!1){Object.keys(S).forEach(function(N){hasKey(t,N.split(`.`))||(setKey(t,N.split(`.`),S[N]),C&&(te[N]=!0),(n[N]||[]).forEach(function(n){hasKey(t,n.split(`.`))||setKey(t,n.split(`.`),S[N])}))})}function hasKey(t,n){let S=t;I[`dot-notation`]||(n=[n.join(`.`)]),n.slice(0,-1).forEach(function(t){S=S[t]||{}});let C=n[n.length-1];return typeof S==`object`?C in S:!1}function setKey(t,n,S){let C=t;I[`dot-notation`]||(n=[n.join(`.`)]),n.slice(0,-1).forEach(function(t){t=sanitizeKey(t),typeof C==`object`&&C[t]===void 0&&(C[t]={}),typeof C[t]!=`object`||Array.isArray(C[t])?(Array.isArray(C[t])?C[t].push({}):C[t]=[C[t],{}],C=C[t][C[t].length-1]):C=C[t]});let N=sanitizeKey(n[n.length-1]),F=checkAllAliases(n.join(`.`),re.arrays),H=Array.isArray(S),W=I[`duplicate-arguments-array`];!W&&checkAllAliases(N,re.nargs)&&(W=!0,(!isUndefined(C[N])&&re.nargs[N]===1||Array.isArray(C[N])&&C[N].length===re.nargs[N])&&(C[N]=void 0)),S===increment()?C[N]=increment(C[N]):Array.isArray(C[N])?W&&F&&H?C[N]=I[`flatten-duplicate-arrays`]?C[N].concat(S):(Array.isArray(C[N][0])?C[N]:[C[N]]).concat([S]):!W&&!!F==!!H?C[N]=S:C[N]=C[N].concat([S]):C[N]===void 0&&F?C[N]=H?S:[S]:W&&!(C[N]===void 0||checkAllAliases(N,re.counts)||checkAllAliases(N,re.bools))?C[N]=[C[N],S]:C[N]=S}function extendAliases(...t){t.forEach(function(t){Object.keys(t||{}).forEach(function(t){re.aliases[t]||(re.aliases[t]=[].concat(F[t]||[]),re.aliases[t].concat(t).forEach(function(n){if(/-/.test(n)&&I[`camel-case-expansion`]){let S=camelCase(n);S!==t&&re.aliases[t].indexOf(S)===-1&&(re.aliases[t].push(S),Z[S]=!0)}}),re.aliases[t].concat(t).forEach(function(n){if(n.length>1&&/[A-Z]/.test(n)&&I[`camel-case-expansion`]){let S=decamelize(n,`-`);S!==t&&re.aliases[t].indexOf(S)===-1&&(re.aliases[t].push(S),Z[S]=!0)}}),re.aliases[t].forEach(function(n){re.aliases[n]=[t].concat(re.aliases[t].filter(function(t){return n!==t}))}))})})}function checkAllAliases(t,n){let S=[].concat(re.aliases[t]||[],t),C=Object.keys(n),N=S.find(t=>C.includes(t));return N?n[N]:!1}function hasAnyFlag(t){let n=Object.keys(re);return[].concat(n.map(t=>re[t])).some(function(n){return Array.isArray(n)?n.includes(t):n[t]})}function hasFlagsMatching(t,...n){return[].concat(...n).some(function(n){let S=t.match(n);return S&&hasAnyFlag(S[1])})}function hasAllShortFlags(t){if(t.match(ie)||!t.match(/^-[^-]+/))return!1;let n=!0,S,C=t.slice(1).split(``);for(let N=0;N<C.length;N++){if(S=t.slice(N+2),!hasAnyFlag(C[N])){n=!1;break}if(C[N+1]&&C[N+1]===`=`||S===`-`||/[A-Za-z]/.test(C[N])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(S)||C[N+1]&&C[N+1].match(/\W/))break}return n}function isUnknownOptionAsArg(t){return I[`unknown-options-as-args`]&&isUnknownOption(t)}function isUnknownOption(t){return t=t.replace(/^-{3,}/,`--`),t.match(ie)||hasAllShortFlags(t)?!1:!hasFlagsMatching(t,/^-+([^=]+?)=[\s\S]*$/,ae,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function defaultValue(t){return!checkAllAliases(t,re.bools)&&!checkAllAliases(t,re.counts)&&`${t}`in H?H[t]:defaultForType(guessType(t))}function defaultForType(t){return{[Nu.BOOLEAN]:!0,[Nu.STRING]:``,[Nu.NUMBER]:void 0,[Nu.ARRAY]:[]}[t]}function guessType(t){let n=Nu.BOOLEAN;return checkAllAliases(t,re.strings)?n=Nu.STRING:checkAllAliases(t,re.numbers)?n=Nu.NUMBER:checkAllAliases(t,re.bools)?n=Nu.BOOLEAN:checkAllAliases(t,re.arrays)&&(n=Nu.ARRAY),n}function isUndefined(t){return t===void 0}function checkConfiguration(){Object.keys(re.counts).find(t=>checkAllAliases(t,re.arrays)?(oe=Error(ne(`Invalid configuration: %s, opts.count excludes opts.array.`,t)),!0):checkAllAliases(t,re.nargs)?(oe=Error(ne(`Invalid configuration: %s, opts.count excludes opts.narg.`,t)),!0):!1)}return{aliases:Object.assign({},re.aliases),argv:Object.assign(ce,se),configuration:I,defaulted:Object.assign({},te),error:oe,newAliases:Object.assign({},Z)}}},__name$1(stripQuotes$1,`stripQuotes`)}),Lu,Ru,zu=__esmMin(()=>{Lu=Object.defineProperty,Ru=__name$1((t,n)=>{let S={};for(var C in t)Lu(S,C,{get:t[C],enumerable:!0});return n||Lu(S,Symbol.toStringTag,{value:`Module`}),S},`__exportAll`)});function normalizePath$1(t){return t instanceof URL||t instanceof Jn?fileURLToPath(t):typeof t==`string`?t:t.toString()}function randomName(){return[...[,,,,,,]].map(()=>`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`[Math.floor(Math.random()*62)]).join(``)}var Bu=__esmMin(()=>{Xn(),__name$1(normalizePath$1,`normalizePath`)});function createNodeError(t,n,S,C){return typeof t?.code==`string`?t:createNodeError$1(t,n,{path:S.toString(),dest:C?.toString()})}function requireCallback(t,n=`cb`){if(typeof t==`function`)return t;let S=TypeError(`The "${n}" argument must be of type function. Received ${describeReceived(t)}`);throw S.code=`ERR_INVALID_ARG_TYPE`,S}function describeReceived(t){if(t==null)return String(t);if(typeof t==`object`){let n=t.constructor?.name;return`an instance of ${n&&n.length>0?n:`Object`}`}if(typeof t==`string`){let n=t.length>25?`${t.slice(0,25)}...`:t;return n.includes(`'`)?`type string ("${n}")`:`type string ('${n}')`}return typeof t==`bigint`?`type bigint (${t}n)`:typeof t==`symbol`?`type symbol (${t.toString()})`:`type ${typeof t} (${String(t)})`}function invalidState(t){let n=Error(`Invalid state: ${t}`);return n.code=`ERR_INVALID_STATE`,n}var Vu=__esmMin(()=>{Je()});function gioEventToNodeType(t){switch(t){case Si.FileMonitorEvent.CHANGED:case Si.FileMonitorEvent.CHANGES_DONE_HINT:return`change`;case Si.FileMonitorEvent.DELETED:case Si.FileMonitorEvent.CREATED:case Si.FileMonitorEvent.RENAMED:case Si.FileMonitorEvent.MOVED_IN:case Si.FileMonitorEvent.MOVED_OUT:return`rename`;default:return null}}var WatchTree,Hu=__esmMin(()=>{Vu(),Ci(),zn(),Je(),WatchTree=class{_monitors=new Map;_fileMonitors=new Map;_closed=!1;_root;_recursive;_fanOut;_budget;_budgetReported=!1;_onEvent;_onError;constructor(t,n,S,C,N){this._recursive=n,this._onEvent=S,this._onError=C,this._fanOut=N?.fanOut??isDarwin(),this._budget=N?.budget??(this._fanOut?4096:1/0);let F=Si.File.new_for_path(t);this._root=F.get_path()??t,this._open(this._root,F),F.query_file_type(Si.FileQueryInfoFlags.NONE,null)===Si.FileType.DIRECTORY&&(n||this._fanOut)&&this._descend(this._root,!1)}get monitorCount(){return this._monitors.size+this._fileMonitors.size}close(){this._closed=!0;for(let t of this._monitors.values())t.cancel();this._monitors.clear();for(let t of this._fileMonitors.values())t.cancel();this._fileMonitors.clear()}_open(t,n){let S=n.monitor(Si.FileMonitorFlags.NONE,null);S.connect(`changed`,(t,n,S,C)=>{this._dispatch(n,C)}),this._monitors.set(t,S)}_watchFile(t){if(this._closed||this._fileMonitors.has(t)||!this._admit(t))return;let n;try{n=Si.File.new_for_path(t).monitor(Si.FileMonitorFlags.NONE,null)}catch(t){isNotFoundError(t)||this._onError(t);return}n.connect(`changed`,(t,n,S,C)=>{if(gioEventToNodeType(C)!==`change`)return;let N=n.get_path();N!==null&&this._emit(`change`,N)}),this._fileMonitors.set(t,n)}_admit(t){if(this.monitorCount<this._budget)return!0;if(this._budgetReported)return!1;this._budgetReported=!0;let n=Error(`fs.watch: this watch holds its whole budget of ${this._budget} monitors and stopped at ${t}. Anything under ${this._root} that is not already attached is NOT being watched, and no further event will arrive for it. The budget is finite because this host needs a monitor per FILE rather than per directory, and unbounded growth of a shared process resource surfaces as an unrelated allocation failing elsewhere, in a trace that never mentions fs.watch. Watch a narrower directory.`);return n.code=`ERR_FS_WATCH_MONITOR_BUDGET`,n.path=t,this._onError(n),!1}_dispatch(t,n){let S=t.get_path();if(S===null)return;let C=gioEventToNodeType(n);if(C!==null&&this._emit(C,S),!(!this._recursive&&!this._fanOut))switch(n){case Si.FileMonitorEvent.CREATED:case Si.FileMonitorEvent.MOVED_IN:{let n=t.query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);n===Si.FileType.DIRECTORY?this._recursive&&this._addSubtree(S,!0):this._fanOut&&n===Si.FileType.REGULAR&&this._watchFile(S);break}case Si.FileMonitorEvent.DELETED:case Si.FileMonitorEvent.MOVED_OUT:this._dropSubtree(S);break}}_emit(t,n){let S=kn(this._root,n);this._onEvent(t,S===``?Mn(n):S)}_addSubtree(t,n){if(!(this._closed||this._monitors.has(t))&&this._admit(t)){try{this._open(t,Si.File.new_for_path(t))}catch(t){isNotFoundError(t)||this._onError(t);return}this._descend(t,n)}}_descend(t,n){for(let S of this._children(t)){if(this._closed)return;if(S.isDirectory){if(!this._recursive)continue;n&&this._emit(`rename`,S.path),this._addSubtree(S.path,n)}else n&&this._emit(`rename`,S.path),this._fanOut&&S.isFile&&this._watchFile(S.path)}}_dropSubtree(t){this._fileMonitors.get(t)?.cancel(),this._fileMonitors.delete(t);let n=t+In;for(let[t,S]of this._fileMonitors)t.startsWith(n)&&(S.cancel(),this._fileMonitors.delete(t));for(let[S,C]of this._monitors)S!==t&&!S.startsWith(n)||(C.cancel(),this._monitors.delete(S))}_children(t){let n;try{n=Si.File.new_for_path(t).enumerate_children(`standard::name,standard::type`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(t){return isNotFoundError(t)||this._onError(t),[]}let S=[];try{let C=n.next_file(null);for(;C!==null;){let N=C.get_file_type();S.push({path:On(t,C.get_name()),isDirectory:N===Si.FileType.DIRECTORY,isFile:N===Si.FileType.REGULAR}),C=n.next_file(null)}}catch(t){isNotFoundError(t)||this._onError(t)}finally{try{n.close(null)}catch{}}return S}}});async function*watchAsync(t,n){let S=n?.signal;if(S?.aborted)return;let C=normalizePath$1(t),N=[],F=[],I=!1,H=null;function enqueue(t){I||(F.length>0?F.shift().resolve({value:t,done:!1}):N.push(t))}function terminate(){if(!I)for(I=!0;F.length>0;)F.shift().resolve({value:void 0,done:!0})}let W;try{W=new WatchTree(C,n?.recursive===!0,(t,n)=>{enqueue({eventType:t,filename:n})},t=>{H=t,terminate()})}catch{return}let abortHandler=()=>terminate();S?.addEventListener(`abort`,abortHandler);try{for(;!I;){if(N.length>0){yield N.shift();continue}let t=await new Promise(t=>{F.push({resolve:t})});if(t.done)break;yield t.value}if(H!==null)throw H}finally{S?.removeEventListener(`abort`,abortHandler),W.close()}}var Uu,FSWatcher,Wu=__esmMin(()=>{Bu(),Hu(),vt(),tn(),Uu=new WeakMap,FSWatcher=class extends Wt{constructor(t,n,S){super(),(!n||typeof n!=`object`)&&(n={persistent:!0});let C=n.persistent!==!1,N=new WatchTree(normalizePath$1(t),n.recursive===!0,(t,n)=>{this.emit(`change`,t,n)},t=>{this.emit(`error`,t)}),F=null;C&&(F=_t.timeout_add(_t.PRIORITY_LOW,2147483647,()=>_t.SOURCE_CONTINUE)),Uu.set(this,{persistent:C,closed:!1,sourceId:F,tree:N}),S&&this.on(`change`,S)}close(){let t=Uu.get(this);t.closed||(t.closed=!0,t.tree.close(),t.sourceId!==null&&(_t.source_remove(t.sourceId),t.sourceId=null))}ref(){let t=Uu.get(this);return!t.persistent&&!t.closed&&(t.persistent=!0,t.sourceId=_t.timeout_add(_t.PRIORITY_LOW,2147483647,()=>_t.SOURCE_CONTINUE)),this}unref(){let t=Uu.get(this);return t.persistent&&(t.persistent=!1,t.sourceId!==null&&(_t.source_remove(t.sourceId),t.sourceId=null)),this}}}),Gu=__exportAll$5({lchmod:()=>void 0,lchmodAsync:()=>lchmodAsync,lchmodSync:()=>void 0,lchown:()=>lchown,lchownAsync:()=>lchownAsync,lchownSync:()=>lchownSync,lutimes:()=>lutimes,lutimesAsync:()=>lutimesAsync,lutimesSync:()=>lutimesSync,utimes:()=>utimes,utimesAsync:()=>utimesAsync,utimesSync:()=>utimesSync});function toGLibDateTime(t){let n=t instanceof Date?t.getTime():typeof t==`bigint`?Number(t):typeof t==`string`?Date.parse(t):t*1e3;return _t.DateTime.new_from_unix_utc(Math.floor(n/1e3))}function setTimestamps(t,n,S,C){let N=Si.File.new_for_path(t),F=new Si.FileInfo;F.set_modification_date_time(toGLibDateTime(S)),F.set_access_date_time(toGLibDateTime(n)),N.set_attributes_from_info(F,C,null)}function utimesSync(t,n,S){setTimestamps(normalizePath$1(t),n,S,Si.FileQueryInfoFlags.NONE)}function utimes(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>utimesSync(t,n,S)).then(()=>C(null),C)}async function utimesAsync(t,n,S){utimesSync(t,n,S)}function lutimesSync(t,n,S){setTimestamps(normalizePath$1(t),n,S,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS)}function lutimes(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>lutimesSync(t,n,S)).then(()=>C(null),C)}async function lutimesAsync(t,n,S){lutimesSync(t,n,S)}function lchownSync(t,n,S){let C=normalizePath$1(t),N=Si.File.new_for_path(C),F=new Si.FileInfo;n!==-1&&F.set_attribute_uint32(`unix::uid`,n),S!==-1&&F.set_attribute_uint32(`unix::gid`,S),N.set_attributes_from_info(F,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}function lchown(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>lchownSync(t,n,S)).then(()=>C(null),C)}async function lchownAsync(t,n,S){lchownSync(t,n,S)}function lchmodUnsupported(){let t=Error(`The lchmod() method is not implemented`);return t.code=`ERR_METHOD_NOT_IMPLEMENTED`,t}async function lchmodAsync(t,n){throw lchmodUnsupported()}var Ku=__esmMin(()=>{Bu(),Vu(),vt(),Ci()});function isStdFd(t){return t===0||t===1||t===2}function stdinInput(){return qu||=ro.InputStream.new(0,!1),qu}function stdOutput(t){return Ju[t]||(Ju[t]=ro.OutputStream.new(t,!1)),Ju[t]}function readStdFdAll(t){try{let n=t===0?stdinInput():ro.InputStream.new(t,!1),S=[],C=0;for(;;){let t=n.read_bytes(64*1024,null).get_data();if(!t||t.length===0)break;S.push(t),C+=t.length}return concat(S,C)}catch(n){if(t!==0)throw n;let[S,C]=Si.File.new_for_path(`/dev/stdin`).load_contents(null);if(!S)throw n;return C}}function readStdFdSync(t,n,S,C){let N=(t===0?stdinInput():ro.InputStream.new(t,!1)).read_bytes(C,null).get_data();return N&&N.length>0?(new Uint8Array(n.buffer,n.byteOffset+S).set(N),N.length):0}function writeStdFdSync(t,n){return stdOutput(t).write_bytes(_t.Bytes.new(n),null)}function concat(t,n){if(t.length===1)return t[0];let S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.length;return S}var qu,Ju,Yu=__esmMin(()=>{vt(),Ci(),io(),qu=null,Ju={}});function getEncodingFromOptions(t={encoding:null,flag:`r`},n=`utf8`){return t===null?n:typeof t==`string`?t:typeof t==`object`&&typeof t.encoding==`string`?t.encoding:n}function encodeUint8Array(t,n){return t===`buffer`?it.from(n):new TextDecoder(t).decode(n)}function decode(t,n){if(n){let S=new TextDecoder(n),C=new TextEncoder;return S.decode(C.encode(t))}else return t}var Xu=__esmMin(()=>{mt()});function createReadStream(t,n){return new ReadStream(t,n)}var ReadStream,Zu=__esmMin(()=>{Bu(),Rd(),Ld(),vt(),Ci(),mt(),la(),ReadStream=class extends ra{bytesRead=0;path;pending=!0;fd=null;_ownFd=null;_autoCloseFd=!0;_positional=!1;_gioFile;_inputStream=null;_cancellable=new Si.Cancellable;_start;_end;_pos;_reading=!1;_readAgain=!1;_lastSize=64*1024;close(t){this._cancellable.cancel(),this._release(),this.destroy(),t&&t(null)}constructor(t,n){let S=normalizePath$1(t);super({highWaterMark:n?.highWaterMark??64*1024,encoding:n?.encoding,objectMode:!1}),this.path=S,this._gioFile=Si.File.new_for_path(S),this._start=n?.start??0,this._end=n?.end??1/0,this._pos=this._start,this._positional=n?.start!==void 0,typeof n?.fd==`number`&&(this._ownFd=n.fd,this.fd=n.fd,this._autoCloseFd=n.autoClose!==!1),this.once(`end`,()=>this._release())}_construct(t){if(this._ownFd!==null){this.pending=!1,t(),this.emit(`open`,this._ownFd),this.emit(`ready`);return}this._gioFile.read_async(_t.PRIORITY_DEFAULT,this._cancellable,(n,S)=>{if(this.destroyed){t();return}try{this._inputStream=this._gioFile.read_finish(S),this.pending=!1,this.emit(`open`,0),this.emit(`ready`),this._start>0&&this._inputStream.can_seek()&&this._inputStream.seek(this._start,_t.SeekType.SET,null),t()}catch(n){this._cancellable.is_cancelled()||t(n)}})}_read(t){if(this._lastSize=t,this._reading){this._readAgain=!0;return}this._doRead(t)}_doRead(t){if(this._ownFd!==null){if(this._reading||this.destroyed)return;this._reading=!0,_t.timeout_add(_t.PRIORITY_DEFAULT,0,()=>(this._reading=!1,this.destroyed||this._readThroughFd(t),_t.SOURCE_REMOVE));return}let n=t;if(this._end!==1/0){let S=this._end-this._pos+1;if(S<=0){this.push(null);return}n=Math.min(t,S)}let S=this._inputStream;!S||this.destroyed||(this._reading=!0,S.read_bytes_async(n,_t.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{this._reading=!1;try{let t=S.read_bytes_finish(n).get_data();if(!t||t.length===0){this._readAgain=!1,this.push(null);return}this.bytesRead+=t.length,this._pos+=t.length,this.push(it.from(t)),this._readAgain&&!this._reading&&(this._readAgain=!1,this._doRead(this._lastSize))}catch(t){this._readAgain=!1,this._cancellable.is_cancelled()||this.destroy(t)}}))}_readThroughFd(t){try{let n=t;if(this._end!==1/0){let S=this._end-this._pos+1;if(S<=0){this._readAgain=!1,this.push(null);return}n=Math.min(t,S)}let S=Id.getInstance(this._ownFd,`read`),C=it.alloc(n),N=S._readSync(C,0,n,this._positional?this._pos:null);if(N===0){this._readAgain=!1,this.push(null);return}this.bytesRead+=N,this._pos+=N,this.push(C.subarray(0,N))}catch(t){this._readAgain=!1,this.destroy(t)}}_release(){this._inputStream&&=(this._inputStream.close_async(_t.PRIORITY_DEFAULT,null,()=>{}),null),this._releaseFd()}_releaseFd(){if(this._ownFd===null||!this._autoCloseFd)return;let t=this._ownFd;this._ownFd=null,this.fd=null;try{closeSync(t)}catch{}}_destroy(t,n){this._cancellable.cancel(),this._release(),n(t)}}});function openFlagValues(){return isWin32()?td:isDarwin()?$u:Qu}function stringFlagBits(t,n){switch(t){case`r`:return n.O_RDONLY;case`rs`:case`sr`:return n.O_RDONLY|n.O_SYNC;case`r+`:return n.O_RDWR;case`rs+`:case`sr+`:return n.O_RDWR|n.O_SYNC;case`w`:return n.O_TRUNC|n.O_CREAT|n.O_WRONLY;case`wx`:case`xw`:return n.O_TRUNC|n.O_CREAT|n.O_WRONLY|n.O_EXCL;case`w+`:return n.O_TRUNC|n.O_CREAT|n.O_RDWR;case`wx+`:case`xw+`:return n.O_TRUNC|n.O_CREAT|n.O_RDWR|n.O_EXCL;case`a`:return n.O_APPEND|n.O_CREAT|n.O_WRONLY;case`ax`:case`xa`:return n.O_APPEND|n.O_CREAT|n.O_WRONLY|n.O_EXCL;case`as`:case`sa`:return n.O_APPEND|n.O_CREAT|n.O_WRONLY|n.O_SYNC;case`a+`:return n.O_APPEND|n.O_CREAT|n.O_RDWR;case`ax+`:case`xa+`:return n.O_APPEND|n.O_CREAT|n.O_RDWR|n.O_EXCL;case`as+`:case`sa+`:return n.O_APPEND|n.O_CREAT|n.O_RDWR|n.O_SYNC;default:return}}function parseOpenFlags(t){let n=openFlagValues(),S;if(t==null)S=n.O_RDONLY;else if(typeof t==`number`)S=t;else{let C=stringFlagBits(t,n);if(C===void 0){let n=TypeError(`Unknown file open flag: ${t}`);throw n.code=`ERR_INVALID_ARG_VALUE`,n}S=C}let C=S&(n.O_RDONLY|n.O_WRONLY|n.O_RDWR);return{posix:S,readable:C===n.O_RDONLY||C===n.O_RDWR,writable:C===n.O_WRONLY||C===n.O_RDWR,append:(S&n.O_APPEND)!==0,creat:(S&n.O_CREAT)!==0,excl:(S&n.O_CREAT)!==0&&(S&n.O_EXCL)!==0,trunc:(S&n.O_TRUNC)!==0,nofollow:n.O_NOFOLLOW!==0&&(S&n.O_NOFOLLOW)!==0,directory:n.O_DIRECTORY!==0&&(S&n.O_DIRECTORY)!==0}}function normalizeMode(t,n){let S=t??n,C=S;if(typeof S==`string`){if(!/^[0-7]+$/.test(S))throw invalidMode(S);C=parseInt(S,8)}if(typeof C!=`number`)throw modeNotANumber(C);if(!Number.isInteger(C))throw modeOutOfRange(`an integer`,C);if(C<0||C>4294967295)throw modeOutOfRange(`>= 0 && <= 4294967295`,C);return C}function invalidMode(t){let n=TypeError(`The argument 'mode' must be a 32-bit unsigned integer or an octal string. Received '${t}'`);return n.code=`ERR_INVALID_ARG_VALUE`,n}function modeNotANumber(t){let n=t==null?String(t):`type ${typeof t} (${describeValue(t)})`,S=TypeError(`The "mode" argument must be of type number. Received ${n}`);return S.code=`ERR_INVALID_ARG_TYPE`,S}function describeValue(t){try{return typeof t==`object`?Object.prototype.toString.call(t):String(t)}catch{return`<unprintable>`}}function modeOutOfRange(t,n){let S=RangeError(`The value of "mode" is out of range. It must be ${t}. Received ${n}`);return S.code=`ERR_OUT_OF_RANGE`,S}var Qu,$u,td,nd=__esmMin(()=>{Je(),Qu={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_NONBLOCK:2048,O_DSYNC:4096,O_SYNC:1052672,O_DIRECTORY:65536,O_NOFOLLOW:131072},$u={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_NONBLOCK:4,O_DSYNC:4194304,O_SYNC:128,O_DIRECTORY:1048576,O_NOFOLLOW:256},td={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:256,O_EXCL:1024,O_NOCTTY:0,O_TRUNC:512,O_APPEND:8,O_NONBLOCK:0,O_DSYNC:0,O_SYNC:0,O_DIRECTORY:0,O_NOFOLLOW:0}}),Dirent,rd=__esmMin(()=>{Ci(),zn(),Dirent=class{name;parentPath;_isFile=!1;_isDirectory=!1;_isBlockDevice=!1;_isCharacterDevice=!1;_isSymbolicLink=!1;_isFIFO=!1;_isSocket=!1;_file;constructor(t,n,S,C,N){switch(n||=Mn(t),this.name=n,this.parentPath=N??jn(t),this._file=Si.File.new_for_path(t),S??this._file.query_file_type(Si.FileQueryInfoFlags.NONE,null)){case Si.FileType.DIRECTORY:this._isDirectory=!0;break;case Si.FileType.MOUNTABLE:break;case Si.FileType.REGULAR:this._isFile=!0;break;case Si.FileType.SYMBOLIC_LINK:case Si.FileType.SHORTCUT:this._isSymbolicLink=!0;break;case Si.FileType.SPECIAL:this._classifySpecialFile(t,C);break}}_classifySpecialFile(t,n){try{let S=n?.has_attribute(`unix::mode`)===!0?n:Si.File.new_for_path(t).query_info(`unix::mode`,Si.FileQueryInfoFlags.NONE,null),C=S.has_attribute(`unix::mode`)?S.get_attribute_uint32(`unix::mode`):0;if(C===0)return;switch(C&61440){case 24576:this._isBlockDevice=!0;break;case 8192:this._isCharacterDevice=!0;break;case 49152:this._isSocket=!0;break;case 4096:this._isFIFO=!0;break}}catch{}}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isBlockDevice(){return this._isBlockDevice}isCharacterDevice(){return this._isCharacterDevice}isSymbolicLink(){return this._isSymbolicLink}isFIFO(){return this._isFIFO}isSocket(){return this._isSocket}}});function fsError(t,n,S,C){let N=`${t}: ${describe$1(t)}, ${n}`;S&&(N+=` '${S}'`),C&&(N+=` -> '${C}'`);let F=Error(N);return F.code=t,F.errno=id[t]??-1,F.syscall=n,S&&(F.path=S),C&&(F.dest=C),F}function describe$1(t){switch(t){case`ENOENT`:return`no such file or directory`;case`EEXIST`:return`file already exists`;case`EACCES`:return`permission denied`;case`EISDIR`:return`illegal operation on a directory`;case`ENOTDIR`:return`not a directory`;case`EBADF`:return`bad file descriptor`;case`EPERM`:return`operation not permitted`;case`EINVAL`:return`invalid argument`;case`ELOOP`:return`too many symbolic links encountered`;case`ENAMETOOLONG`:return`name too long`;case`EMFILE`:return`too many open files`;case`ENFILE`:return`file table overflow`;case`EROFS`:return`read-only file system`;case`ESPIPE`:return`invalid seek`;case`ENXIO`:return`no such device or address`;default:return`i/o error`}}function hasProcFd(){return ad===null&&(ad=_t.file_test(`/proc/self/fd`,_t.FileTest.IS_DIR)),ad}function fdPath(t){return hasProcFd()?`/proc/self/fd/${t}`:null}function openFd(t,n,S){let C=_t.open(t,n.posix,S);if(C<0)throw classifyOpenFailure(t,n);return C}function closeFd(t){_t.close(t)}function classifyOpenFailure(t,n){let S=nameTooLong(t,`open`);if(S)return S;let C=Si.File.new_for_path(t),N=null,F=!1;try{let t=C.query_info(`standard::type,standard::symlink-target,unix::mode,access::can-read,access::can-write`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);answered(t)?N=t:F=!0}catch{N=null}if(F)return refusalNotAboutThePath(t,n,C,null);if(N){if(n.excl)return fsError(`EEXIST`,`open`,t);if(N.get_file_type()===Si.FileType.SYMBOLIC_LINK&&!n.nofollow){let S=walkSymlinkChain(C);if(S===`loop`)return fsError(`ELOOP`,`open`,t);if(S===`too-long`)return fsError(`ENAMETOOLONG`,`open`,t);if(S===`dangling`&&!n.creat)return fsError(`ENOENT`,`open`,t)}return N.get_file_type()===Si.FileType.DIRECTORY&&n.writable?fsError(`EISDIR`,`open`,t):n.directory&&N.get_file_type()!==Si.FileType.DIRECTORY?fsError(`ENOTDIR`,`open`,t):refusalNotAboutThePath(t,n,C,N)}if(ancestorIsNotADirectory(C))return fsError(`ENOTDIR`,`open`,t);if(!n.creat)return fsError(`ENOENT`,`open`,t);let I=C.get_parent();if(!I)return fsError(`ENOENT`,`open`,t);try{I.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null)}catch{return fsError(`ENOENT`,`open`,t)}return refusalNotAboutThePath(t,n,C,null)}function ancestorIsNotADirectory(t){for(let n=t.get_parent();n;n=n.get_parent()){let t;try{t=n.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null)}catch{continue}return answered(t)?t.get_file_type()!==Si.FileType.DIRECTORY:!1}return!1}function answered(t){return t!==null&&t.has_attribute(`standard::type`)}function nameTooLong(t,n){let S=new TextEncoder;if(S.encode(t).length>4096)return fsError(`ENAMETOOLONG`,n,t);for(let C of splitPathComponents(t))if(S.encode(C).length>255)return fsError(`ENAMETOOLONG`,n,t);return null}function walkSymlinkChain(t){let n=new TextEncoder,S=t;for(let t=0;t<40;t++){let t;try{t=S.query_info(`standard::type,standard::symlink-target`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch{return`dangling`}if(!answered(t)||t.get_file_type()!==Si.FileType.SYMBOLIC_LINK)return`resolved`;let C=t.get_symlink_target();if(!C)return`dangling`;if(n.encode(C).length>4096)return`too-long`;let N=S.get_parent();S=C.startsWith(`/`)?Si.File.new_for_path(C):N?.resolve_relative_path(C)??Si.File.new_for_path(C)}return`loop`}function refusalNotAboutThePath(t,n,S,C){let N=_t.open(`/dev/null`,0,0);if(N<0)return fsError(`EMFILE`,`open`,t);_t.close(N);let F=C!==null&&(C.get_attribute_uint32(`unix::mode`)&146)==0;if((n.writable||n.creat)&&!F)try{if(S.query_filesystem_info(`filesystem::readonly`,null).get_attribute_boolean(`filesystem::readonly`))return fsError(`EROFS`,`open`,t)}catch{}return C&¬hingOnTheOtherEnd(n,C)?fsError(`ENXIO`,`open`,t):fsError(`EACCES`,`open`,t)}function nothingOnTheOtherEnd(t,n){if(!n.has_attribute(`unix::mode`))return!1;let S=n.get_attribute_uint32(`unix::mode`)&61440;if(!(S===8192||S===24576||S===4096))return!1;let permits=t=>n.has_attribute(t)&&n.get_attribute_boolean(t);return!(t.readable&&!permits(`access::can-read`)||t.writable&&!permits(`access::can-write`))}function classifyMkdirFailure(t){let n=nameTooLong(t,`mkdir`);if(n)return n;let S=Si.File.new_for_path(t);try{return answered(S.query_info(`standard::type`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null))?fsError(`EEXIST`,`mkdir`,t):fsError(`EACCES`,`mkdir`,t)}catch{}let C=S.get_parent();if(!C)return fsError(`ENOENT`,`mkdir`,t);try{let n=C.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null);if(answered(n)&&n.get_file_type()!==Si.FileType.DIRECTORY)return fsError(`ENOTDIR`,`mkdir`,t)}catch{return fsError(`ENOENT`,`mkdir`,t)}return fsError(`EACCES`,`mkdir`,t)}function seekHandle(t){let n=od.get(t);return n||(n=_t.IOChannel.unix_new(t),n.set_encoding(null),n.set_buffered(!1),n.set_close_on_unref(!1),od.set(t,n)),n}function input(t){let n=sd.get(t);return n||(n=ro.InputStream.new(t,!1),sd.set(t,n)),n}function output(t){let n=cd.get(t);return n||(n=ro.OutputStream.new(t,!1),cd.set(t,n)),n}function isSeekableFd(t,n){let S=ld.get(t);return S===void 0&&(S=probeSeekable(t,n),ld.set(t,S)),S}function probeSeekable(t,n){try{let S=Si.File.new_for_path(fdPath(t)??n).query_info(`unix::mode`,Si.FileQueryInfoFlags.NONE,null);if(S.has_attribute(`unix::mode`)){let t=S.get_attribute_uint32(`unix::mode`)&61440;if(t===4096||t===49152)return!1}}catch{}try{return seekHandle(t).seek_position(0,_t.SeekType.CUR),!0}catch{return!1}}function seekFd(t,n){seekHandle(t).seek_position(n,_t.SeekType.SET)}function tellFd(t){if(!hasProcFd())return null;try{let[n,S]=_t.file_get_contents(`/proc/self/fdinfo/${t}`);if(!n)return null;let C=/^pos:\s*(\d+)/m.exec(new TextDecoder().decode(S));return C?Number(C[1]):null}catch{return null}}function readFd(t,n){return n<=0?new Uint8Array:input(t).read_bytes(n,null).get_data()??new Uint8Array}function writeFd(t,n){if(n.length===0)return 0;let[,S]=output(t).write_all(n,null);return S}function fsyncFd(t){output(t).flush(null),_t.fsync(t)}function releaseFd(t){let n=cd.get(t);if(n)try{n.flush(null)}catch{}od.delete(t),sd.delete(t),cd.delete(t),ld.delete(t)}function sizeOfFd(t,n){let S=fdPath(t)??n,C=Si.File.new_for_path(S).query_info(`standard::size`,Si.FileQueryInfoFlags.NONE,null);return Number(C.get_size())}function truncateFd(t,n,S){let C=Si.File.new_for_path(fdPath(t)??S),N;try{let t=C.append_to(Si.FileCreateFlags.NONE,null);try{t.truncate(n,null)}finally{t.close(null)}return}catch(t){N=t}try{let t=C.open_readwrite(null);try{t.get_output_stream().truncate(n,null)}finally{t.close(null)}return}catch{}throw createNodeError(N,`ftruncate`,S)}var id,ad,od,sd,cd,ld,ud=__esmMin(()=>{Vu(),vt(),Ci(),Je(),io(),id={EPERM:-1,ENOENT:-2,EIO:-5,ENXIO:-6,EBADF:-9,EACCES:-13,EEXIST:-17,ENOTDIR:-20,EISDIR:-21,EINVAL:-22,ENFILE:-23,EMFILE:-24,ETXTBSY:-26,ENOSPC:-28,ESPIPE:-29,EROFS:-30,ENAMETOOLONG:-36,ENOTEMPTY:-39,ELOOP:-40},__name$1(describe$1,`describe`),ad=null,od=new Map,sd=new Map,cd=new Map,ld=new Map});function populateFromInfo(t){let n=t.get_attribute_uint64(`time::access`),S=t.get_attribute_uint32(`time::access-usec`)||0,C=t.get_attribute_uint64(`time::modified`),N=t.get_attribute_uint32(`time::modified-usec`)||0,F=t.get_attribute_uint64(`time::changed`),I=t.get_attribute_uint32(`time::changed-usec`)||0,H=t.get_attribute_uint64(`time::created`),W=t.get_attribute_uint32(`time::created-usec`)||0,q=n*1e3+S/1e3,Y=C*1e3+N/1e3,X=F?F*1e3+I/1e3:Y,Z=H?H*1e3+W/1e3:X;return{dev:t.get_attribute_uint32(`unix::device`)||0,ino:Number(t.get_attribute_uint64(`unix::inode`)||0),mode:t.get_attribute_uint32(`unix::mode`)||0,nlink:t.get_attribute_uint32(`unix::nlink`)||0,uid:t.get_attribute_uint32(`unix::uid`)||0,gid:t.get_attribute_uint32(`unix::gid`)||0,rdev:t.get_attribute_uint32(`unix::rdev`)||0,size:Number(t.get_size()||0),blksize:t.get_attribute_uint32(`unix::block-size`)||4096,blocks:Number(t.get_attribute_uint64(`unix::blocks`)||0),atimeMs:q,mtimeMs:Y,ctimeMs:X,birthtimeMs:Z,atime:new Date(q),mtime:new Date(Y),ctime:new Date(X),birthtime:new Date(Z)}}function statsFrom(t,n,S,C){if(!answered(t))throw fsError(`EACCES`,S,n);return C?new BigIntStats(t,n):new Stats(t,n)}var dd,Stats,BigIntStats,fd=__esmMin(()=>{rd(),ud(),Ci(),zn(),dd=`standard::*,time::*,unix::*`,Stats=class extends Dirent{dev;ino;mode;nlink;uid;gid;rdev;size;blksize;blocks;atimeMs;mtimeMs;ctimeMs;birthtimeMs;atime;mtime;ctime;birthtime;_info;constructor(t,n,S){let C,N;t instanceof Si.FileInfo?(C=t,N=n.toString(),S||=Mn(N)):(N=t.toString(),typeof n==`string`&&(S=n),S||=Mn(N),C=Si.File.new_for_path(N).query_info(dd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)),super(N,S,C.get_file_type(),C),this._info=C;let F=populateFromInfo(C);this.dev=F.dev,this.ino=F.ino,this.mode=F.mode,this.nlink=F.nlink,this.uid=F.uid,this.gid=F.gid,this.rdev=F.rdev,this.size=F.size,this.blksize=F.blksize,this.blocks=F.blocks,this.atimeMs=F.atimeMs,this.mtimeMs=F.mtimeMs,this.ctimeMs=F.ctimeMs,this.birthtimeMs=F.birthtimeMs,this.atime=F.atime,this.mtime=F.mtime,this.ctime=F.ctime,this.birthtime=F.birthtime}},BigIntStats=class extends Dirent{dev;ino;mode;nlink;uid;gid;rdev;size;blksize;blocks;atimeMs;mtimeMs;ctimeMs;birthtimeMs;atimeNs;mtimeNs;ctimeNs;birthtimeNs;atime;mtime;ctime;birthtime;_info;constructor(t,n,S){let C,N;t instanceof Si.FileInfo?(C=t,N=n.toString(),S||=Mn(N)):(N=t.toString(),typeof n==`string`&&(S=n),S||=Mn(N),C=Si.File.new_for_path(N).query_info(dd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)),super(N,S,C.get_file_type(),C),this._info=C;let F=populateFromInfo(C);this.dev=BigInt(F.dev),this.ino=BigInt(F.ino),this.mode=BigInt(F.mode),this.nlink=BigInt(F.nlink),this.uid=BigInt(F.uid),this.gid=BigInt(F.gid),this.rdev=BigInt(F.rdev),this.size=BigInt(F.size),this.blksize=BigInt(F.blksize),this.blocks=BigInt(F.blocks),this.atimeMs=BigInt(Math.trunc(F.atimeMs)),this.mtimeMs=BigInt(Math.trunc(F.mtimeMs)),this.ctimeMs=BigInt(Math.trunc(F.ctimeMs)),this.birthtimeMs=BigInt(Math.trunc(F.birthtimeMs)),this.atimeNs=this.atimeMs*1000000n,this.mtimeNs=this.mtimeMs*1000000n,this.ctimeNs=this.ctimeMs*1000000n,this.birthtimeNs=this.birthtimeMs*1000000n,this.atime=F.atime,this.mtime=F.mtime,this.ctime=F.ctime,this.birthtime=F.birthtime}}});function statSync(t,n){let S=normalizePath$1(t);try{return statsFrom(Si.File.new_for_path(S).query_info(dd,Si.FileQueryInfoFlags.NONE,null),S,`stat`,n?.bigint)}catch(t){if(n?.throwIfNoEntry===!1&&isNotFoundError(t))return;throw createNodeError(t,`stat`,S)}}function lstatSync(t,n){let S=normalizePath$1(t);try{return statsFrom(Si.File.new_for_path(S).query_info(dd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null),S,`lstat`,n?.bigint)}catch(t){if(n?.throwIfNoEntry===!1&&isNotFoundError(t))return;throw createNodeError(t,`lstat`,S)}}function readdirSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S).enumerate_children(`standard::name,standard::type`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null),N=[];try{let t=C.next_file(null);for(;t!==null;)N.push({name:t.get_name(),type:t.get_file_type()}),t=C.next_file(null)}finally{try{C.close(null)}catch{}}let F=[];for(let t of N){let C=On(S,t.name);if(n?.withFileTypes?F.push(new Dirent(C,t.name,t.type,void 0,S)):F.push(t.name),n?.recursive&&t.type===Si.FileType.DIRECTORY){let S=readdirSync(C,n);for(let n of S)typeof n==`string`?F.push(On(t.name,n)):F.push(n)}}return F}function realpathSync(t){let n=normalizePath$1(t);return resolveEveryComponent(Si.File.new_for_path(n),{left:40},n)}function resolveEveryComponent(t,n,S){let C=t.get_parent();return expandSymlinks(C===null?t:Si.File.new_for_path(resolveEveryComponent(C,n,S)).get_child(t.get_basename()),n,S)}function expandSymlinks(t,n,S){let C=t;for(;;){let t=C.query_info(`standard::is-symlink,standard::symlink-target`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);if(!t.get_is_symlink())return C.get_path();if(--n.left<0)throw Error(`ELOOP: too many levels of symbolic links, realpath '${S}'`);let N=t.get_symlink_target(),F=C.get_parent(),I=_t.path_is_absolute(N)?Si.File.new_for_path(N):(F??C).resolve_relative_path(N);C=Si.File.new_for_path(resolveEveryComponent(I,n,S))}}function symlinkSync(t,n,S){let C=normalizePath$1(n),N=normalizePath$1(t);Si.File.new_for_path(C).make_symbolic_link(N,null)}function readFileSync(t,n={encoding:null,flag:`r`}){if(t instanceof Id&&(t=t.fd),typeof t==`number`&&isStdFd(t))return encodeUint8Array(getEncodingFromOptions(n,`buffer`),readStdFdAll(t));if(typeof t==`number`)return encodeUint8Array(getEncodingFromOptions(n,`buffer`),Id.getInstance(t,`read`)._readToEndSync());let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let[t,N]=C.load_contents(null);if(!t)throw createNodeError(Error(`failed to read file`),`read`,S);return encodeUint8Array(getEncodingFromOptions(n,`buffer`),N)}catch(t){throw t.code&&typeof t.code==`string`?t:createNodeError(t,`read`,S)}}function mkdirSync(t,n){let S=!1,C;n!=null&&(typeof n==`object`?(n.recursive&&(S=n.recursive),n.mode!==void 0&&(C=n.mode)):C=n),t=normalizePath$1(t);let N=normalizeMode(C,511);if(S)return mkdirSyncRecursive(t,N);mkdirWithMode(t,N)}function mkdirWithMode(t,n){if(_t.mkdir(t,n)!==0)throw classifyMkdirFailure(t)}function mkdirSyncRecursive(t,n){if(_t.mkdir(t,n)===0)return t;let S=classifyMkdirFailure(t);if(S.code===`EEXIST`){if(_t.file_test(t,_t.FileTest.IS_DIR))return;throw S}if(S.code!==`ENOENT`)throw S;let C=On(t,`..`),N=Si.File.new_for_path(C).get_path();if(N===t)throw S;let F=mkdirSyncRecursive(N,n);return mkdirWithMode(t,n),F??t}function rmdirSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{if(C.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null).get_file_type()!==Si.FileType.DIRECTORY)throw createNodeError(Object.assign(Error(),{code:4}),`rmdir`,S);if(C.enumerate_children(`standard::name`,Si.FileQueryInfoFlags.NONE,null).next_file(null)!==null)throw createNodeError(Object.assign(Error(),{code:5}),`rmdir`,S);C.delete(null)}catch(t){throw t.code&&typeof t.code==`string`?t:createNodeError(t,`rmdir`,S)}}function unlinkSync(t){let n=normalizePath$1(t),S=Si.File.new_for_path(n);try{S.delete(null)}catch(t){throw createNodeError(t,`unlink`,n)}}function writeWholeFile(t,n,S,C){let N=getEncodingFromOptions(S,`utf8`),F=typeof S==`object`&&S?S:{},I=typeof n==`string`?it.from(n,N||`utf8`):n;if(typeof t==`number`||t instanceof Id){if(typeof t==`number`&&isStdFd(t)){writeStdFdSync(t,I);return}Id.getInstance(t,`write`)._writeSync(I,null);return}let H=new Id({path:normalizePath$1(t),flags:F.flag??C,mode:F.mode??438});try{H._writeSync(I,null)}finally{H._closeSync()}}function writeFileSync(t,n,S){writeWholeFile(t,n,S??null,`w`)}function renameSync(t,n){let S=normalizePath$1(t),C=normalizePath$1(n),N=Si.File.new_for_path(S),F=Si.File.new_for_path(C);try{N.move(F,Si.FileCopyFlags.OVERWRITE,null,null)}catch(t){throw createNodeError(t,`rename`,S,C)}}function copyFileSync(t,n,S){let C=normalizePath$1(t),N=normalizePath$1(n),F=Si.File.new_for_path(C),I=Si.File.new_for_path(N),H=Si.FileCopyFlags.NONE;S&&!(S&1)?H=Si.FileCopyFlags.OVERWRITE:S||(H=Si.FileCopyFlags.OVERWRITE);try{F.copy(I,H,null,null)}catch(t){throw createNodeError(t,`copyfile`,C,N)}stripPrivilegeBitsAfterCopy(I,C,N)}function stripPrivilegeBitsAfterCopy(t,n,S){try{let n=t.query_info(`unix::mode,standard::size`,Si.FileQueryInfoFlags.NONE,null);if(n.get_size()===0)return;let S=n.get_attribute_uint32(`unix::mode`),C=S&-2049;if((isDarwin()||S&8)&&(C&=-1025),C===S)return;t.set_attribute_uint32(`unix::mode`,C,Si.FileQueryInfoFlags.NONE,null)}catch(t){throw createNodeError(t,`copyfile`,n,S)}}function accessSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let t=C.query_info(`access::*`,Si.FileQueryInfoFlags.NONE,null);if(n!==void 0&&n!==0){let C={code:14,message:`permission denied, access '${S}'`};if(n&4&&!t.get_attribute_boolean(`access::can-read`)||n&2&&!t.get_attribute_boolean(`access::can-write`)||n&1&&!t.get_attribute_boolean(`access::can-execute`))throw createNodeError(C,`access`,S)}}catch(t){throw t.code&&typeof t.code==`string`?t:createNodeError(t,`access`,S)}}function appendFileSync(t,n,S){writeWholeFile(t,n,S??null,`a`)}function readlinkSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let t=C.query_info(`standard::symlink-target`,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null).get_symlink_target();if(!t)throw Object.assign(Error(`EINVAL: invalid argument, readlink '${S}'`),{code:`EINVAL`,errno:-22,syscall:`readlink`,path:S});return(typeof n==`string`?n:n?.encoding)===`buffer`?it.from(t):t}catch(t){throw typeof t.code==`string`?t:createNodeError(t,`readlink`,S)}}function linkSync(t,n){let S=normalizePath$1(t),C=normalizePath$1(n);if(Si.File.new_for_path(S).query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)===Si.FileType.UNKNOWN)throw Object.assign(Error(`ENOENT: no such file or directory, link '${S}' -> '${C}'`),{code:`ENOENT`,errno:-2,syscall:`link`,path:S,dest:C});if(Si.File.new_for_path(C).query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)!==Si.FileType.UNKNOWN)throw Object.assign(Error(`EEXIST: file already exists, link '${S}' -> '${C}'`),{code:`EEXIST`,errno:-17,syscall:`link`,path:S,dest:C});let N=``;try{let[,,t,n]=_t.spawn_sync(null,[`ln`,`--`,S,C],null,_t.SpawnFlags.SEARCH_PATH,null);if(N=t?new TextDecoder().decode(t).trim():``,!_t.spawn_check_wait_status(n))throw Error(`ln exited non-zero (${n})`);return}catch(t){throw N===``&&t instanceof Error&&(N=t.message),Object.assign(Error(`EPERM: operation not permitted, link '${S}' -> '${C}'`+(N?` (${N})`:``)),{code:`EPERM`,errno:-1,syscall:`link`,path:S,dest:C})}}function truncateSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);try{let t=C.open_readwrite(null);try{t.get_output_stream().truncate(Math.max(0,n??0),null)}finally{t.close(null)}}catch(t){throw createNodeError(t,`truncate`,S)}}function chmodSync(t,n){let S=normalizePath$1(t),C=normalizeMode(n);try{Si.File.new_for_path(S).set_attribute_uint32(`unix::mode`,C,Si.FileQueryInfoFlags.NONE,null)}catch(t){throw createNodeError(t,`chmod`,S)}}function chownSync(t,n,S){let C=normalizePath$1(t);try{let t=Si.File.new_for_path(C),N=new Si.FileInfo;n!==-1&&N.set_attribute_uint32(`unix::uid`,n),S!==-1&&N.set_attribute_uint32(`unix::gid`,S),t.set_attributes_from_info(N,Si.FileQueryInfoFlags.NONE,null)}catch(t){throw createNodeError(t,`chown`,C)}}function watch(t,n,S){return typeof n==`function`&&(S=n,n=void 0),new FSWatcher(normalizePath$1(t),n,S)}function openSync(t,n,S){return new Id({path:t,flags:n,mode:S})}function mkdtempSync(t,n){let S=getEncodingFromOptions(n),C=mkdtempAt(t);return S===`buffer`?it.from(C):decode(C,S)}function mkdtempAt(t){for(let n=0;n<64;n++){let n=t+randomName();if(_t.mkdir(n,448)===0)return n;let S=classifyMkdirFailure(n);if(S.code!==`EEXIST`)throw S.syscall=`mkdtemp`,S}throw fsError(`EEXIST`,`mkdtemp`,t+`XXXXXX`)}function rmSync(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S),N=n?.recursive||!1,F=n?.force||!1,I;try{I=C.query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){if(F&&isNotFoundError(n))return;throw createNodeError(n,`rm`,t)}if(I===Si.FileType.SYMBOLIC_LINK){try{C.delete(null)}catch(n){if(F&&isNotFoundError(n))return;throw createNodeError(n,`rm`,t)}return}if(I===Si.FileType.DIRECTORY){let C=readdirSync(t);if(!N&&C.length)throw createNodeError(Object.assign(Error(),{code:5}),`rm`,t);for(let t of C)rmSync(On(S,t),n)}try{C.delete(null)}catch(n){if(F&&isNotFoundError(n))return;throw createNodeError(n,`rm`,t)}}var pd=__esmMin(()=>{Xu(),Bu(),Vu(),Wu(),Yu(),nd(),rd(),ud(),fd(),Ld(),vt(),Ci(),zn(),mt(),uo(),Je(),realpathSync.native=realpathSync});function makeEEXIST(t){let n=Error(`ERR_FS_CP_EEXIST: file already exists, copyfile '${t}'`);return n.code=`ERR_FS_CP_EEXIST`,n.syscall=`copyfile`,n.path=t,n}function makeEISDIR(t){let n=Error(`ERR_FS_EISDIR: illegal operation on a directory, copyfile '${t}'`);return n.code=`ERR_FS_EISDIR`,n.syscall=`copyfile`,n.path=t,n}function makeENOTDIR(t,n){let S=Error(`ENOTDIR: not a directory, copyfile '${t}' -> '${n}'`);return S.code=`ENOTDIR`,S.syscall=`copyfile`,S.path=t,S.dest=n,S}function makeSubdirOfSelf(t,n){let S=Error(`Cannot copy ${t} to a subdirectory of self ${n}`);return S.code=`ERR_FS_CP_EINVAL`,S}function queryCopyFlags(t){let n=t.force??!0,S=Si.FileCopyFlags.NONE;return n&&(S|=Si.FileCopyFlags.OVERWRITE),t.preserveTimestamps&&(S|=Si.FileCopyFlags.TARGET_DEFAULT_MODIFIED_TIME),t.dereference||(S|=Si.FileCopyFlags.NOFOLLOW_SYMLINKS),S}function copyOneSyncFile(t,n,S,C,N){let F=N.force??!0;try{if(n.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null).get_file_type()===Si.FileType.DIRECTORY)throw makeENOTDIR(S,C);if(!F){if(N.errorOnExist)throw makeEEXIST(C);return}}catch(t){if(typeof t.code==`string`)throw t}let I=queryCopyFlags(N);try{t.copy(n,I,null,null)}catch(t){throw createNodeError(t,`copyfile`,S,C)}}function isStrictSubdir(t,n){let S=$(t).split(In).filter(Boolean),C=$(n).split(In).filter(Boolean);return C.length>S.length&&S.every((t,n)=>C[n]===t)}function cpOneDirSync(t,n,S,C,N){if(isStrictSubdir(S,C))throw makeSubdirOfSelf(S,C);if(n.query_exists(null))try{if(n.query_info(`standard::type`,Si.FileQueryInfoFlags.NONE,null).get_file_type()!==Si.FileType.DIRECTORY)throw makeENOTDIR(C,S)}catch(t){if(typeof t.code==`string`)throw t}else try{n.make_directory_with_parents(null)}catch(t){throw createNodeError(t,`mkdir`,C)}let F;try{F=t.enumerate_children(`standard::name,standard::type,standard::is-symlink`,N.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(t){throw createNodeError(t,`scandir`,S)}let I=F.next_file(null);for(;I!==null;){let t=I.get_name(),n=On(S,t),H=On(C,t),W=N.filter;if(W&&!W(n,H)){I=F.next_file(null);continue}cpSyncInternal(n,H,N),I=F.next_file(null)}}function cpSyncInternal(t,n,S){let C=Si.File.new_for_path(t),N=Si.File.new_for_path(n),F;try{F=C.query_info(`standard::type,standard::is-symlink`,S.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){throw createNodeError(n,`stat`,t)}if(F.get_file_type()===Si.FileType.DIRECTORY){if(!S.recursive)throw makeEISDIR(t);cpOneDirSync(C,N,t,n,S)}else copyOneSyncFile(C,N,t,n,S)}function cpSync(t,n,S){let C=normalizePath$1(t),N=normalizePath$1(n),F=S??{},I=Si.File.new_for_path(C),H=F.filter;if(!(H&&!H(C,N))){try{if(I.query_info(`standard::type`,F.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null).get_file_type()===Si.FileType.DIRECTORY&&!F.recursive)throw makeEISDIR(C)}catch(t){throw typeof t.code==`string`?t:createNodeError(t,`stat`,C)}cpSyncInternal(C,N,F)}}function cp(t,n,S,C){let N,F;typeof S==`function`?(F=S,N={}):(F=requireCallback(C),N=S);let I=N.filter;if(I){Promise.resolve(I(normalizePath$1(t),normalizePath$1(n))).then(S=>{if(!S){F(null);return}try{cpPromises(t,n,N).then(()=>F(null)).catch(F)}catch(t){F(t)}}).catch(F);return}Promise.resolve().then(()=>{try{cpSync(t,n,N),F(null)}catch(t){F(t)}})}async function cpPromisesDir(t,n,S){if(isStrictSubdir(t,n))throw makeSubdirOfSelf(t,n);let C=Si.File.new_for_path(n);if(!C.query_exists(null))try{C.make_directory_with_parents(null)}catch(t){throw createNodeError(t,`mkdir`,n)}let N=Si.File.new_for_path(t),F;try{F=N.enumerate_children(`standard::name,standard::type`,S.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){throw createNodeError(n,`scandir`,t)}let I=F.next_file(null);for(;I!==null;){let C=I.get_name(),N=On(t,C),H=On(n,C),W=S.filter;if(W&&!await Promise.resolve(W(N,H))){I=F.next_file(null);continue}await cpPromises(N,H,S),I=F.next_file(null)}}async function cpPromises(t,n,S={}){let C=normalizePath$1(t),N=normalizePath$1(n),F=Si.File.new_for_path(C),I;try{I=F.query_info(`standard::type`,S.dereference?Si.FileQueryInfoFlags.NONE:Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(t){throw createNodeError(t,`stat`,C)}if(I.get_file_type()===Si.FileType.DIRECTORY){if(!S.recursive)throw makeEISDIR(C);await cpPromisesDir(C,N,S)}else copyOneSyncFile(F,Si.File.new_for_path(N),C,N,S)}var md=__esmMin(()=>{Bu(),Vu(),Ci(),zn()});function _openDir(t){let n=Si.File.new_for_path(t),S;try{S=n.enumerate_children(hd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){throw createNodeError(n,`opendir`,t)}return new Dir(t,S)}function opendirSync(t){return _openDir(normalizePath$1(t))}function opendir(t,n,S){let C;if(C=typeof n==`function`?n:requireCallback(S,`callback`),typeof C!=`function`)throw TypeError(`The "callback" argument must be of type function`);Promise.resolve().then(()=>{try{let n=opendirSync(t);C(null,n)}catch(t){C(t,null)}})}async function opendirAsync(t,n){return new Promise((n,S)=>{let C=normalizePath$1(t),N=Si.File.new_for_path(C);N.enumerate_children_async(hd,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,_t.PRIORITY_DEFAULT,null,(t,F)=>{try{let t=N.enumerate_children_finish(F);n(new Dir(C,t))}catch(t){S(createNodeError(t,`opendir`,C))}})})}var hd,Dir,gd=__esmMin(()=>{Bu(),Vu(),rd(),vt(),Ci(),zn(),hd=`standard::name,standard::type,standard::is-symlink,standard::size,standard::symlink-target,unix::uid,unix::gid,unix::mode,time::modified,time::access,time::created`,Dir=class{path;_enumerator;_closed=!1;constructor(t,n){this.path=t,this._enumerator=n}_assertOpen(){if(this._closed){let t=Error(`Directory handle was closed`);throw t.code=`ERR_DIR_CLOSED`,t}}readSync(){this._assertOpen();try{let t=this._enumerator.next_file(null);if(t===null)return null;let n=t.get_name(),S=t.get_file_type();return new Dirent(On(this.path,n),n,S,void 0,this.path)}catch(t){throw createNodeError(t,`readdir`,this.path)}}read(t){if(t!==void 0){if(typeof t!=`function`)throw TypeError(`The "callback" argument must be of type function`);try{this._assertOpen();let n=this.readSync();Promise.resolve().then(()=>t(null,n))}catch(n){Promise.resolve().then(()=>t(n,null))}return}return new Promise((t,n)=>{try{this._assertOpen(),t(this.readSync())}catch(t){n(t)}})}closeSync(){this._assertOpen(),this._closed=!0;try{this._enumerator.close(null)}catch{}this._enumerator=null}close(t){if(t!==void 0){if(typeof t!=`function`)throw TypeError(`The "callback" argument must be of type function`);try{this.closeSync(),Promise.resolve().then(()=>t(null))}catch(n){Promise.resolve().then(()=>t(n))}return}return new Promise((t,n)=>{try{this.closeSync(),t()}catch(t){n(t)}})}async*[Symbol.asyncIterator](){try{for(;;){let t=await this.read();if(t===null)break;yield t}}finally{this._closed||await this.close()}}}});function segmentToRegexSrc(t){let n=/^([!*+?@])\((.+)\)$/.exec(t);if(n){let[,t,S]=n,C=S.split(`|`).map(t=>segmentToRegexSrc(t)),N=`(?:`+C.join(`|`)+`)`;switch(t){case`!`:return`(?!(?:`+C.join(`|`)+`))[^/]*`;case`*`:return N+`*`;case`+`:return N+`+`;case`?`:return N+`?`;case`@`:return N}}let S=``,C=0;for(;C<t.length;){let n=t[C];if(n===`*`){S+=`[^/]*`,C++;continue}if(n===`?`){S+=`[^/]`,C++;continue}if(n===`[`){let n=t.indexOf(`]`,C+1);if(n===-1){S+=`\\[`,C++;continue}S+=t.slice(C,n+1),C=n+1;continue}if(n===`{`){let n=t.indexOf(`}`,C+1);if(n===-1){S+=`\\{`,C++;continue}let N=t.slice(C+1,n).split(`,`).map(t=>segmentToRegexSrc(t.trim()));S+=`(?:`+N.join(`|`)+`)`,C=n+1;continue}`.+^$|()[]{}`.includes(n)?S+=`\\`+n:S+=n,C++}return S}function globToRegex$2(t){t=t.replace(/\/+/g,`/`).replace(/^\.\//,``);let n=t.split(`/`),S=[];for(let t=0;t<n.length;t++){let C=n[t],N=t===n.length-1;C===`**`?N?S.length>0&&S[S.length-1]===`/`?(S.pop(),S.push(`(?:/.+)?`)):S.push(`(?:.+)?`):S.push(`(?:[^/]+/)*`):(S.push(segmentToRegexSrc(C)),N||S.push(`/`))}return RegExp(`^(?:`+S.join(``)+`)$`)}function buildExcludePredicate(t){if(!t)return null;if(typeof t==`function`)return t;let n=(Array.isArray(t)?t:[t]).map(t=>globToRegex$2(t));return t=>n.some(n=>n.test(t))}function matchAll(t,n,S){let C=globToRegex$2(t),N=buildExcludePredicate(S),F;try{F=readdirSync(n,{recursive:!0})}catch{return[]}let I=[`.`,...F],H=[];for(let t of I){let n=t.replace(/\\/g,`/`);C.test(n)&&(N&&N(n)||H.push(t))}return H}function globSync(t,n){let S=Array.isArray(t)?t:[t],C=n?.cwd?normalizePath$1(n.cwd):globalThis.process?.cwd?.()??`/`,N=n?.exclude,F=new Set,I=[];for(let t of S)for(let n of matchAll(t,C,N))F.has(n)||(F.add(n),I.push(n));return I}function glob(t,n,S){let C,N;typeof n==`function`?(N=n,C={}):(N=requireCallback(S),C=n||{}),Promise.resolve().then(()=>{try{let n=globSync(t,C);N(null,n)}catch(t){N(t,[])}})}async function*globAsync(t,n){let S=globSync(t,n);for(let t of S)yield t}var _d=__esmMin(()=>{Bu(),Vu(),pd(),__name$1(globToRegex$2,`globToRegex`)});function buildStatFs(t){let n=Number(t.get_attribute_uint64(`filesystem::size`)??0),S=Number(t.get_attribute_uint64(`filesystem::free`)??0),C=Math.floor(n/yd),N=Math.floor(S/yd);return{type:0,bsize:yd,blocks:C,bfree:N,bavail:N,files:0,ffree:0}}function buildBigIntStatFs(t){let n=BigInt(t.get_attribute_uint64(`filesystem::size`)??0),S=BigInt(t.get_attribute_uint64(`filesystem::free`)??0),C=BigInt(yd),N=n/C,F=S/C;return{type:0n,bsize:C,blocks:N,bfree:F,bavail:F,files:0n,ffree:0n}}function statfsSync(t,n){let S=Si.File.new_for_path(normalizePath$1(t)).query_filesystem_info(vd,null);return n?.bigint===!0?buildBigIntStatFs(S):buildStatFs(S)}function queryFsInfoAsync(t,n){return new Promise((S,C)=>{let N=Si.File.new_for_path(normalizePath$1(t));N.query_filesystem_info_async(vd,_t.PRIORITY_DEFAULT,null,(t,F)=>{try{let t=N.query_filesystem_info_finish(F);S(n?buildBigIntStatFs(t):buildStatFs(t))}catch(t){C(t)}})})}function statfs(t,n,S){let C=typeof n==`function`?n:requireCallback(S);queryFsInfoAsync(t,(typeof n==`function`?{}:n)?.bigint===!0).then(t=>C(null,t),t=>C(t,null))}async function statfsAsync(t,n){return queryFsInfoAsync(t,n?.bigint===!0)}var vd,yd,bd=__esmMin(()=>{Bu(),Vu(),vt(),Ci(),vd=[`filesystem::size`,`filesystem::free`].join(`,`),yd=4096});function openFlagDescriptors(){let t={};for(let n of Object.keys(openFlagValues()))t[n]={enumerable:!0,configurable:!0,get:()=>openFlagValues()[n]};return t}var xd,Sd=__esmMin(()=>{nd(),xd=Object.defineProperties({F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1},openFlagDescriptors())}),Cd=__exportAll$5({access:()=>access$1,appendFile:()=>appendFile$1,chmod:()=>chmod$1,chown:()=>chown$1,constants:()=>xd,copyFile:()=>copyFile$1,cp:()=>cpPromises,default:()=>Td,fchmod:()=>fchmodAsync,fchown:()=>fchownAsync,fdatasync:()=>fdatasyncAsync,fstat:()=>fstatAsync,fsync:()=>fsyncAsync,ftruncate:()=>ftruncateAsync,futimes:()=>futimesAsync,glob:()=>globAsync,lchmod:()=>lchmodAsync,lchown:()=>lchownAsync,link:()=>link$1,lstat:()=>lstat$1,lutimes:()=>lutimesAsync,mkdir:()=>mkdir$1,mkdtemp:()=>mkdtemp$1,open:()=>open$2,openAsBlob:()=>openAsBlob,opendir:()=>opendirAsync,promises_exports:()=>wd,readFile:()=>readFile$1,readdir:()=>readdir$1,readlink:()=>readlink$1,readv:()=>readvAsync,realpath:()=>realpath$1,rename:()=>rename$1,rm:()=>rm$1,rmdir:()=>rmdir$1,stat:()=>stat$1,statfs:()=>statfsAsync,symlink:()=>symlink$1,truncate:()=>truncate$1,unlink:()=>unlink$1,utimes:()=>utimesAsync,watch:()=>watchAsync,write:()=>write$1,writeFile:()=>writeFile$1,writev:()=>writevAsync});async function mkdir$1(t,n){return mkdirSync(normalizePath$1(t),n)}async function readFile$1(t,n={encoding:null,flag:`r`}){if(t instanceof Id||typeof t==`number`){let S=Id.getInstance(t,`read`);return encodeUint8Array(getEncodingFromOptions(n,`buffer`),S._readToEndSync())}let S=normalizePath$1(t),C=Si.File.new_for_path(S),N,F;try{[N,F]=await new Promise((t,n)=>{C.load_contents_async(null,(S,N)=>{try{t(C.load_contents_finish(N))}catch(t){n(t)}})})}catch(t){throw createNodeError(t,`open`,S)}if(!N)throw createNodeError(Error(`failed to read file`),`open`,S);return encodeUint8Array(getEncodingFromOptions(n,`buffer`),F)}async function mkdtemp$1(t,n){let S=getEncodingFromOptions(n);return decode(mkdtempAt(t),S)}async function writeFile$1(t,n,S){writeFileSync(t,typeof n==`string`||n instanceof Uint8Array?n:String(n),S??null)}async function rmdir$1(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S);if((await new Promise((t,n)=>{C.query_info_async(`standard::type`,Si.FileQueryInfoFlags.NONE,_t.PRIORITY_DEFAULT,null,(N,F)=>{try{t(C.query_info_finish(F))}catch(t){n(createNodeError(t,`rmdir`,S))}})})).get_file_type()!==Si.FileType.DIRECTORY)throw createNodeError(Object.assign(Error(),{code:4}),`rmdir`,S);if((await new Promise((t,n)=>{C.enumerate_children_async(`standard::name`,Si.FileQueryInfoFlags.NONE,_t.PRIORITY_DEFAULT,null,(N,F)=>{try{t(C.enumerate_children_finish(F))}catch(t){n(createNodeError(t,`rmdir`,S))}})})).next_file(null)!==null)throw createNodeError(Object.assign(Error(),{code:5}),`rmdir`,S);await new Promise((t,n)=>{C.delete_async(_t.PRIORITY_DEFAULT,null,(N,F)=>{try{C.delete_finish(F),t()}catch(t){n(createNodeError(t,`rmdir`,S))}})})}async function unlink$1(t){let n=normalizePath$1(t),S=Si.File.new_for_path(n);await new Promise((t,C)=>{S.delete_async(_t.PRIORITY_DEFAULT,null,(N,F)=>{try{S.delete_finish(F),t()}catch(t){C(createNodeError(t,`unlink`,n))}})})}async function open$2(t,n,S){return new Id({path:t,flags:n,mode:S})}async function write$1(t,n,S,C,N){return typeof n==`string`?_writeStr(t,n,S,C):_writeBuf(t,n,S,C,N)}async function _writeBuf(t,n,S,C,N){return{bytesWritten:(await Id.getInstance(t,`write`).write(n,S,C,N)).bytesWritten,buffer:n}}async function _writeStr(t,n,S,C){return{bytesWritten:(await Id.getInstance(t,`write`).write(n,S,C)).bytesWritten,buffer:n}}function queryInfoAsync(t,n,S,C){let N=normalizePath$1(t);return new Promise((t,F)=>{let I=Si.File.new_for_path(N);I.query_info_async(dd,n,_t.PRIORITY_DEFAULT,null,(n,H)=>{try{t(statsFrom(I.query_info_finish(H),N,S,C?.bigint))}catch(t){F(createNodeError(t,S,N))}})})}async function stat$1(t,n){return queryInfoAsync(t,Si.FileQueryInfoFlags.NONE,`stat`,n)}async function lstat$1(t,n){return queryInfoAsync(t,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,`lstat`,n)}async function readdir$1(t,n){try{return readdirSync(t,n)}catch(n){throw createNodeError(n,`scandir`,t)}}async function realpath$1(t){return realpathSync(t)}async function symlink$1(t,n,S){let C=normalizePath$1(n),N=normalizePath$1(t);return new Promise((t,n)=>{let S=Si.File.new_for_path(C);S.make_symbolic_link_async(N,_t.PRIORITY_DEFAULT,null,(F,I)=>{try{S.make_symbolic_link_finish(I),t()}catch(t){n(createNodeError(t,`symlink`,N,C))}})})}async function rm$1(t,n){let S=normalizePath$1(t),C=Si.File.new_for_path(S),N=n?.recursive||!1,F=n?.force||!1,I;try{I=C.query_file_type(Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null)}catch(n){if(F)return;throw createNodeError(n,`rm`,t)}if(I===Si.FileType.SYMBOLIC_LINK){await new Promise((n,S)=>{C.delete_async(_t.PRIORITY_DEFAULT,null,(N,I)=>{try{C.delete_finish(I),n()}catch(C){if(F){n();return}S(createNodeError(C,`rm`,t))}})});return}if(I===Si.FileType.DIRECTORY){let C=await readdir$1(t,{withFileTypes:!0});if(!N&&C.length)throw createNodeError(Object.assign(Error(),{code:5}),`rm`,t);for(let t of C)typeof t!=`string`&&await rm$1(On(S,t.name),n)}await new Promise((n,S)=>{C.delete_async(_t.PRIORITY_DEFAULT,null,(N,I)=>{try{C.delete_finish(I),n()}catch(C){if(F){n();return}S(createNodeError(C,`rm`,t))}})})}async function rename$1(t,n){renameSync(t,n)}async function copyFile$1(t,n,S){copyFileSync(t,n,S)}async function access$1(t,n){accessSync(t,n)}async function appendFile$1(t,n,S){appendFileSync(t,n,S)}async function readlink$1(t,n){return readlinkSync(t,n)}async function truncate$1(t,n){truncateSync(t,n)}async function chmod$1(t,n){chmodSync(t,n)}async function chown$1(t,n,S){chownSync(t,n,S)}async function link$1(t,n){linkSync(t,n)}var wd,Td,Ed=__esmMin(()=>{zu(),Xu(),Bu(),Vu(),Wu(),Ku(),Rd(),fd(),Ld(),pd(),md(),gd(),_d(),bd(),Sd(),vt(),Ci(),zn(),wd=Ru({access:()=>access$1,appendFile:()=>appendFile$1,chmod:()=>chmod$1,chown:()=>chown$1,constants:()=>xd,copyFile:()=>copyFile$1,cp:()=>cpPromises,default:()=>Td,fchmod:()=>fchmodAsync,fchown:()=>fchownAsync,fdatasync:()=>fdatasyncAsync,fstat:()=>fstatAsync,fsync:()=>fsyncAsync,ftruncate:()=>ftruncateAsync,futimes:()=>futimesAsync,glob:()=>globAsync,lchmod:()=>lchmodAsync,lchown:()=>lchownAsync,link:()=>link$1,lstat:()=>lstat$1,lutimes:()=>lutimesAsync,mkdir:()=>mkdir$1,mkdtemp:()=>mkdtemp$1,open:()=>open$2,openAsBlob:()=>openAsBlob,opendir:()=>opendirAsync,readFile:()=>readFile$1,readdir:()=>readdir$1,readlink:()=>readlink$1,readv:()=>readvAsync,realpath:()=>realpath$1,rename:()=>rename$1,rm:()=>rm$1,rmdir:()=>rmdir$1,stat:()=>stat$1,statfs:()=>statfsAsync,symlink:()=>symlink$1,truncate:()=>truncate$1,unlink:()=>unlink$1,utimes:()=>utimesAsync,watch:()=>watchAsync,write:()=>write$1,writeFile:()=>writeFile$1,writev:()=>writevAsync}),__name$1(mkdir$1,`mkdir`),__name$1(readFile$1,`readFile`),__name$1(mkdtemp$1,`mkdtemp`),__name$1(writeFile$1,`writeFile`),__name$1(rmdir$1,`rmdir`),__name$1(unlink$1,`unlink`),__name$1(open$2,`open`),__name$1(write$1,`write`),__name$1(stat$1,`stat`),__name$1(lstat$1,`lstat`),__name$1(readdir$1,`readdir`),__name$1(realpath$1,`realpath`),__name$1(symlink$1,`symlink`),__name$1(rm$1,`rm`),__name$1(rename$1,`rename`),__name$1(copyFile$1,`copyFile`),__name$1(access$1,`access`),__name$1(appendFile$1,`appendFile`),__name$1(readlink$1,`readlink`),__name$1(truncate$1,`truncate`),__name$1(chmod$1,`chmod`),__name$1(chown$1,`chown`),__name$1(link$1,`link`),Td={readFile:readFile$1,mkdir:mkdir$1,mkdtemp:mkdtemp$1,realpath:realpath$1,readdir:readdir$1,writeFile:writeFile$1,rmdir:rmdir$1,unlink:unlink$1,open:open$2,write:write$1,rm:rm$1,lstat:lstat$1,symlink:symlink$1,stat:stat$1,rename:rename$1,copyFile:copyFile$1,access:access$1,appendFile:appendFile$1,readlink:readlink$1,truncate:truncate$1,chmod:chmod$1,chown:chown$1,link:link$1,cp:cpPromises,opendir:opendirAsync,glob:globAsync,watch:watchAsync,statfs:statfsAsync,utimes:utimesAsync,lutimes:lutimesAsync,lchown:lchownAsync,lchmod:lchmodAsync,fstat:fstatAsync,ftruncate:ftruncateAsync,fdatasync:fdatasyncAsync,fsync:fsyncAsync,fchmod:fchmodAsync,fchown:fchownAsync,futimes:futimesAsync,readv:readvAsync,writev:writevAsync,openAsBlob,constants:xd}});function withHandle(t,n,S){try{return Id.getInstance(t,n)}catch(t){return Promise.resolve().then(()=>S(t)),null}}function parseOptsCb(t,n){return typeof t==`function`?{options:{},callback:t}:{options:t??{},callback:requireCallback(n)}}function statImpl(t,n,S,C,N){let F=normalizePath$1(t),I=Si.File.new_for_path(F);I.query_info_async(dd,n,_t.PRIORITY_DEFAULT,null,(t,n)=>{try{N(null,statsFrom(I.query_info_finish(n),F,S,C?.bigint))}catch(t){N(createNodeError(t,S,F))}})}function stat(t,n,S){let{options:C,callback:N}=parseOptsCb(n,S);statImpl(t,Si.FileQueryInfoFlags.NONE,`stat`,C,N)}function lstat(t,n,S){let{options:C,callback:N}=parseOptsCb(n,S);statImpl(t,Si.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,`lstat`,C,N)}function readdir(t,n,S){let{options:C,callback:N}=parseOptsCb(n,S);Promise.resolve().then(()=>{try{N(null,readdirSync(t,C))}catch(n){N(createNodeError(n,`readdir`,t))}})}function realpath(t,n,S){let{callback:C}=parseOptsCb(n,S);Promise.resolve().then(()=>{try{C(null,realpathSync(t))}catch(t){C(t)}})}function symlink(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C);if(typeof N!=`function`)throw TypeError(`Callback must be a function. Received `+typeof N);let F=normalizePath$1(n),I=normalizePath$1(t),H=Si.File.new_for_path(F);H.make_symbolic_link_async(I,_t.PRIORITY_DEFAULT,null,(t,n)=>{try{H.make_symbolic_link_finish(n),N(null)}catch(t){N(createNodeError(t,`symlink`,I,F))}})}function open$1(t,...n){let S,C,N;switch(n.length){case 1:N=n[0];break;case 2:S=n[0],N=n[1];break;case 3:S=n[0],C=n[1],N=n[2];break;default:break}let F=requireCallback(N);open$2(t,S,C).then(t=>{F(null,t.fd)}).catch(t=>{F(t,-1)})}function write(t,n,...S){requireCallback(S[S.length-1]);let C=withHandle(t,`write`,t=>{let C=S[S.length-1];typeof n==`string`?C(t,0,``):C(t,0,it.from([]))});if(!C)return;if(typeof n==`string`){let t=S.pop(),N=S[0],F=S[1];C.write(n,N,F).then(n=>{t(null,n.bytesWritten,n.buffer)}).catch(n=>{t(n,0,``)});return}let N=S[S.length-1],F=S[0],I=S[1],H=S[2];C.write(n,F,I,H).then(t=>{N(null,t.bytesWritten,t.buffer)}).catch(t=>{N(t,0,it.from([]))})}function read$1(t,...n){let S=requireCallback(n[n.length-1]),C=withHandle(t,`read`,t=>{typeof S==`function`&&S(t,0,it.from([]))});if(!C)return;let N,F,I,H;if(!(n.length<=1))if(typeof n[0]==`object`&&!ArrayBuffer.isView(n[0])){let t=n[0];N=t.buffer,F=t.offset,I=t.length,H=t.position}else N=n[0],F=n[1],I=n[2],H=n[3];C.read(N,F,I,H).then(t=>{S(null,t.bytesRead,t.buffer)}).catch(t=>{S(t,0,it.from([]))})}function close$1(t,n){let done=t=>{typeof n==`function`&&n(t)},S=withHandle(t,`close`,done);S&&S.close().then(()=>done(null)).catch(t=>done(t))}function rm(t,...n){let S={},C=n[n.length-1];n.length>=2&&(S=n[0]),rm$1(t,S).then(()=>{C(null)}).catch(t=>{C(t)})}function rename(t,n,S){requireCallback(S),Promise.resolve().then(()=>{try{renameSync(t,n),S(null)}catch(t){S(t)}})}function copyFile(t,n,S,C){let N=typeof S==`function`?0:S,F=typeof S==`function`?S:requireCallback(C);Promise.resolve().then(()=>{try{copyFileSync(t,n,N),F(null)}catch(t){F(t)}})}function access(t,n,S){let C=typeof n==`function`?void 0:n,N=typeof n==`function`?n:requireCallback(S);Promise.resolve().then(()=>{try{accessSync(t,C),N(null)}catch(t){N(t)}})}function appendFile(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C),F=typeof S==`function`?void 0:S;Promise.resolve().then(()=>{try{appendFileSync(t,n,F),N(null)}catch(t){N(t)}})}function readlink(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{C(null,readlinkSync(t,N))}catch(t){C(t,``)}})}function truncate(t,n,S){let C=typeof n==`function`?0:n,N=typeof n==`function`?n:requireCallback(S);Promise.resolve().then(()=>{try{truncateSync(t,C),N(null)}catch(t){N(t)}})}function chmod(t,n,S){requireCallback(S),Promise.resolve().then(()=>{try{chmodSync(t,n),S(null)}catch(t){S(t)}})}function chown(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>{try{chownSync(t,n,S),C(null)}catch(t){C(t)}})}function mkdir(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{mkdirSync(t,N),C(null)}catch(t){C(t)}})}function mkdtemp(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{let n;try{n=mkdtempSync(t,N)}catch(t){C(t,void 0);return}C(null,n)})}function rmdir(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{rmdirSync(t,N),C(null)}catch(t){C(t)}})}function readFile(t,n,S){let C=typeof n==`function`?n:requireCallback(S),N=typeof n==`function`?void 0:n;Promise.resolve().then(()=>{try{let n=typeof N==`string`?{encoding:N,flag:`r`}:{encoding:N?.encoding??null,flag:N?.flag??`r`};C(null,readFileSync(t,n))}catch(t){C(t,null)}})}function writeFile(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C),F=typeof S==`function`?void 0:S;Promise.resolve().then(()=>{try{writeFileSync(t,n,F),N(null)}catch(t){N(t)}})}function link(t,n,S){requireCallback(S),Promise.resolve().then(()=>{try{linkSync(t,n),S(null)}catch(t){S(t)}})}function unlink(t,n){requireCallback(n);let S=normalizePath$1(t);Promise.resolve().then(()=>{_t.unlink(S),n(null)})}var Dd=__esmMin(()=>{Bu(),Vu(),fd(),Ld(),pd(),Ed(),vt(),Ci(),mt(),realpath.native=realpath,__name$1(open$1,`open`),__name$1(read$1,`read`),__name$1(close$1,`close`)});function toPathIfFileURL(t){return normalizePath$1(t)}function createWriteStream(t,n){return new WriteStream(t,n)}var Od,kd,WriteStream,Ad=__esmMin(()=>{Bu(),nd(),Dd(),la(),Od=Symbol(`kIsPerformingIO`),kd=Symbol(`kIoDone`),WriteStream=class extends ia{close(t,n=null){let done=n=>{typeof t==`function`&&t(n)};if(this.fd===null||!this._autoClose)this.fd=null,done(n);else{let t=this._fdFromHandle;close$1(this.fd,S=>{let C=t&&S?.code===`EBADF`?null:S;done(C||n)}),this.fd=null}}bytesWritten=0;path;pending;fd=null;flags=`w`;mode=438;pos=void 0;_autoClose=!0;_fdFromHandle=!1;[Od]=!1;constructor(t,n={}){super(n),this.path=toPathIfFileURL(t),n.flags!==void 0&&(this.flags=n.flags),n.mode!==void 0&&(this.mode=normalizeMode(n.mode,438)),n.start!==void 0&&(this.pos=n.start),n.encoding&&this.setDefaultEncoding(n.encoding),typeof n.fd==`number`?(this.fd=n.fd,this._autoClose=n.autoClose??!0,this._fdFromHandle=n.fdFromHandle===!0):n.autoClose!==void 0&&(this._autoClose=n.autoClose),this.pending=this.fd===null}_construct(t){if(this.fd!==null){t(),this.emit(`open`,this.fd),this.emit(`ready`);return}open$1(this.path.toString(),this.flags,this.mode,(n,S)=>{if(n){t(n);return}this.fd=S,this.pending=!1,t(),this.emit(`open`,this.fd),this.emit(`ready`)})}_write(t,n,S){this[Od]=!0,write(this.fd,t,0,t.length,this.pos??null,(t,n)=>{if(this[Od]=!1,this.destroyed)return S(t),this.emit(kd,t);if(t)return S(t);this.bytesWritten+=n,S()}),this.pos!==void 0&&(this.pos+=t.length)}_destroy(t,n){this[Od]?this.once(kd,S=>this.close(n,t||S)):this.close(n,t)}}});function createInterface$1(t,n,S,C){return typeof t==`object`&&t&&!(`read`in t&&typeof t.read==`function`)?new Interface$1(t):new Interface$1({input:t,output:n,completer:S,terminal:C})}function*emitKeys(t){for(;;){let n=yield,S=n,C=!1,N={sequence:``,name:void 0,ctrl:!1,meta:!1,shift:!1};if(n===`\x1B`&&(C=!0,S+=n=yield,n===`\x1B`&&(S+=n=yield)),C&&(n===`O`||n===`[`)){let t=n,C=0;if(n===`O`)S+=n=yield,n>=`0`&&n<=`9`&&(C=n.charCodeAt(0)-1,S+=n=yield),t+=n;else if(n===`[`){S+=n=yield,n===`[`&&(t+=n,S+=n=yield);let N=S.length-1;n>=`0`&&n<=`9`&&(S+=n=yield,n>=`0`&&n<=`9`&&(S+=n=yield,n>=`0`&&n<=`9`&&(S+=n=yield))),n===`;`&&(S+=n=yield,n>=`0`&&n<=`9`&&(S+=yield));let F=S.slice(N),I;(I=/^(?:(\d\d?)(?:;(\d))?([~^$])|(\d{3}~))$/.exec(F))?I[4]?t+=I[4]:(t+=I[1]+I[3],C=(parseInt(I[2]??`1`,10)||1)-1):(I=/^((\d;)?(\d))?([A-Za-z])$/.exec(F))?(t+=I[4],C=(parseInt(I[3]??`1`,10)||1)-1):t+=F}switch(N.ctrl=!!(C&4),N.meta=!!(C&10),N.shift=!!(C&1),N.code=t,t){case`[P`:case`OP`:case`[11~`:case`[[A`:N.name=`f1`;break;case`[Q`:case`OQ`:case`[12~`:case`[[B`:N.name=`f2`;break;case`[R`:case`OR`:case`[13~`:case`[[C`:N.name=`f3`;break;case`[S`:case`OS`:case`[14~`:case`[[D`:N.name=`f4`;break;case`[15~`:case`[[E`:N.name=`f5`;break;case`[17~`:N.name=`f6`;break;case`[18~`:N.name=`f7`;break;case`[19~`:N.name=`f8`;break;case`[20~`:N.name=`f9`;break;case`[21~`:N.name=`f10`;break;case`[23~`:N.name=`f11`;break;case`[24~`:N.name=`f12`;break;case`[200~`:N.name=`paste-start`;break;case`[201~`:N.name=`paste-end`;break;case`[A`:case`OA`:N.name=`up`;break;case`[B`:case`OB`:N.name=`down`;break;case`[C`:case`OC`:N.name=`right`;break;case`[D`:case`OD`:N.name=`left`;break;case`[E`:case`OE`:N.name=`clear`;break;case`[F`:case`OF`:N.name=`end`;break;case`[H`:case`OH`:N.name=`home`;break;case`[1~`:N.name=`home`;break;case`[2~`:N.name=`insert`;break;case`[3~`:N.name=`delete`;break;case`[4~`:N.name=`end`;break;case`[5~`:case`[[5~`:N.name=`pageup`;break;case`[6~`:case`[[6~`:N.name=`pagedown`;break;case`[7~`:N.name=`home`;break;case`[8~`:N.name=`end`;break;case`[a`:N.name=`up`,N.shift=!0;break;case`[b`:N.name=`down`,N.shift=!0;break;case`[c`:N.name=`right`,N.shift=!0;break;case`[d`:N.name=`left`,N.shift=!0;break;case`[2$`:N.name=`insert`,N.shift=!0;break;case`[3$`:N.name=`delete`,N.shift=!0;break;case`[5$`:N.name=`pageup`,N.shift=!0;break;case`[6$`:N.name=`pagedown`,N.shift=!0;break;case`[7$`:N.name=`home`,N.shift=!0;break;case`[8$`:N.name=`end`,N.shift=!0;break;case`Oa`:N.name=`up`,N.ctrl=!0;break;case`Ob`:N.name=`down`,N.ctrl=!0;break;case`Oc`:N.name=`right`,N.ctrl=!0;break;case`Od`:N.name=`left`,N.ctrl=!0;break;case`[2^`:N.name=`insert`,N.ctrl=!0;break;case`[3^`:N.name=`delete`,N.ctrl=!0;break;case`[5^`:N.name=`pageup`,N.ctrl=!0;break;case`[6^`:N.name=`pagedown`,N.ctrl=!0;break;case`[7^`:N.name=`home`,N.ctrl=!0;break;case`[8^`:N.name=`end`,N.ctrl=!0;break;case`[Z`:N.name=`tab`,N.shift=!0;break;default:N.name=`undefined`;break}}else n===`\r`?(N.name=`return`,N.meta=C):n===`
|
|
67
67
|
`?(N.name=`enter`,N.meta=C):n===` `?(N.name=`tab`,N.meta=C):n===`\b`||n===``?(N.name=`backspace`,N.meta=C):n===`\x1B`?(N.name=`escape`,N.meta=C):n===` `?(N.name=`space`,N.meta=C):!C&&n<=``?(N.name=String.fromCharCode(n.charCodeAt(0)+97-1),N.ctrl=!0):/^[0-9A-Za-z]$/.test(n)?(N.name=n.toLowerCase(),N.shift=/^[A-Z]$/.test(n),N.meta=C):C&&(N.name=n.length?void 0:`escape`,N.meta=!0);N.sequence=S,S.length!==0&&(N.name!==void 0||C)?t.emit(`keypress`,C?void 0:S,N):S.length===1&&t.emit(`keypress`,S,N)}}function emitKeypressEvents(t,n={}){let S=t;if(S[Nd])return;S[Nd]=new nn(`utf8`),S[Pd]=emitKeys(t),S[Pd].next();let C=n.escapeCodeTimeout??500,N,triggerEscape=()=>S[Pd].next(``);function onData(n){if(t.listenerCount(`keypress`)>0){let F=S[Nd].write(typeof n==`string`?Buffer.from(n):n);if(F){clearTimeout(N);for(let n of F)try{S[Pd].next(n),n===`\x1B`&&(N=setTimeout(triggerEscape,C))}catch{S[Pd]=emitKeys(t),S[Pd].next()}}}else t.removeListener(`data`,onData),delete S[Nd],delete S[Pd]}t.on(`data`,onData)}var jd,Interface$1,Md,Nd,Pd,Fd=__esmMin(()=>{tn(),rn(),jd=/\r\n|\r|\n/,Interface$1=class extends Wt{static{__name$1(this,`Interface`)}terminal;line=``;cursor=0;escapeCodeTimeout;_input;_output;get input(){return this._input}get output(){return this._output}_prompt;_closed=!1;_paused=!1;history;_historySize;_crlfDelay;_lineBuffer=``;_questionCallback=null;_boundOnData=null;_boundOnEnd=null;_boundOnError=null;_boundOnKeypress=null;constructor(t,n){super();let S;if(S=t&&typeof t==`object`&&!(`read`in t&&typeof t.read==`function`)?t:{input:t,output:n},this._input=S.input||null,this._output=S.output||null,this._prompt=S.prompt||`> `,this.terminal=S.terminal??this._output!==null,this._historySize=S.historySize??30,this.history=[],this._crlfDelay=S.crlfDelay??100,this.escapeCodeTimeout=S.escapeCodeTimeout,this._input&&(this._boundOnData=t=>this._onData(t),this._boundOnEnd=()=>this._onEnd(),this._boundOnError=t=>this.emit(`error`,t),this._input.on(`data`,this._boundOnData),this._input.on(`end`,this._boundOnEnd),this._input.on(`error`,this._boundOnError),`setEncoding`in this._input&&typeof this._input.setEncoding==`function`&&this._input.setEncoding(`utf8`),this.terminal)){emitKeypressEvents(this._input,this);let t=this._input;typeof t.setRawMode==`function`&&(t.isRaw||t.setRawMode(!0)),typeof this._input.resume==`function`&&this._input.resume(),this._boundOnKeypress=(t,n)=>{if(n){if(n.ctrl&&n.name===`c`){this.listenerCount(`SIGINT`)>0?this.emit(`SIGINT`):this.close();return}if(n.name===`return`||n.name===`enter`){this._output?.write(`\r
|
|
68
68
|
`);let t=this.line;this.line=``,this.cursor=0,this._onLine(t);return}if(n.name===`backspace`||n.name===`delete`){this.cursor>0&&(this.line=this.line.slice(0,this.cursor-1)+this.line.slice(this.cursor),this.cursor--,this._output?.write(`\b \b`));return}t&&t.length===1&&!n.ctrl&&!n.meta&&n.name!==`escape`&&(this.line=this.line.slice(0,this.cursor)+t+this.line.slice(this.cursor),this.cursor++,this._output?.write(t))}},this._input.on(`keypress`,this._boundOnKeypress)}}_onData(t){if(this._closed||this._paused||this.terminal)return;let n=typeof t==`string`?t:t.toString(`utf8`);this._lineBuffer+=n;let S;for(;(S=jd.exec(this._lineBuffer))!==null;){let t=this._lineBuffer.substring(0,S.index);this._lineBuffer=this._lineBuffer.substring(S.index+S[0].length),this._onLine(t)}}_onLine(t){if(t.length>0&&this._historySize>0&&(this.history.length===0||this.history[0]!==t)&&(this.history.unshift(t),this.history.length>this._historySize&&this.history.pop()),this._questionCallback){let n=this._questionCallback;this._questionCallback=null,n(t)}this.emit(`line`,t)}_onEnd(){let t=this.terminal?this.line:this._lineBuffer;t.length>0&&(this._onLine(t),this._lineBuffer=``),this.close()}setPrompt(t){this._prompt=t}getPrompt(){return this._prompt}prompt(t){if(this._closed)throw Error(`readline was closed`);this._output?.write(this._prompt)}question(t,n,S){if(this._closed)throw Error(`readline was closed`);let C=typeof n==`function`?n:S;this._questionCallback=C,this._output?.write(t)}clearLine(t,n){return this.line=``,this.cursor=0,n&&n(),!0}write(t,n){if(!this._closed){if(n){this._input&&this._input.emit(`keypress`,t??``,n);return}if(t!=null){let n=typeof t==`string`?t:t.toString(`utf8`);n&&(this.line=this.line.slice(0,this.cursor)+n+this.line.slice(this.cursor),this.cursor+=n.length),this._output?.write(t)}}}close(){if(!this._closed){if(this._closed=!0,this._input){this._boundOnData&&this._input.removeListener(`data`,this._boundOnData),this._boundOnEnd&&this._input.removeListener(`end`,this._boundOnEnd),this._boundOnError&&this._input.removeListener(`error`,this._boundOnError),this._boundOnKeypress&&this._input.removeListener(`keypress`,this._boundOnKeypress),this._boundOnData=null,this._boundOnEnd=null,this._boundOnError=null,this._boundOnKeypress=null;let t=this._input;this.terminal&&t.isRaw&&typeof t.setRawMode==`function`&&t.setRawMode(!1),typeof this._input.pause==`function`&&this._input.pause()}this.emit(`close`)}}pause(){return this._closed?this:(this._paused=!0,this._input&&`pause`in this._input&&typeof this._input.pause==`function`&&this._input.pause(),this.emit(`pause`),this)}resume(){return this._closed?this:(this._paused=!1,this._input&&`resume`in this._input&&typeof this._input.resume==`function`&&this._input.resume(),this.emit(`resume`),this)}getCursorPos(){let t=this._output?.columns??80,n=this._prompt.length+this.cursor;return{rows:Math.floor(n/t),cols:n%t}}[Symbol.asyncIterator](){let t=[],n=null,S=!1,onLine=S=>{if(n){let t=n;n=null,t({value:S,done:!1})}else t.push(S)},onClose=()=>{if(S=!0,n){let t=n;n=null,t({value:void 0,done:!0})}};return this.on(`line`,onLine),this.on(`close`,onClose),{next:()=>t.length>0?Promise.resolve({value:t.shift(),done:!1}):S?Promise.resolve({value:void 0,done:!0}):new Promise(t=>{n=t}),return:()=>(S=!0,this.removeListener(`line`,onLine),this.removeListener(`close`,onClose),Promise.resolve({value:void 0,done:!0})),[Symbol.asyncIterator](){return this}}}},Md=Symbol.dispose??Symbol.for(`Symbol.dispose`),Interface$1.prototype[Md]=function(){this.close()},__name$1(createInterface$1,`createInterface`),Nd=Symbol(`keypress-decoder`),Pd=Symbol(`escape-decoder`)}),Id,Ld=__esmMin(()=>{Xu(),Bu(),Vu(),Zu(),nd(),Ad(),ud(),fd(),pd(),vt(),Ci(),mt(),Fd(),Id=class FileHandle{options;_gFile;_pathStr;_spec;_pos=0;_closed=!1;_webStreamLocked=!1;static instances={};constructor(t){this.options=t,this.options.flags??=`r`;let n=normalizePath$1(t.path);this._spec=parseOpenFlags(this.options.flags),this.options.mode??=438;let S=normalizeMode(this.options.mode,438);return this.fd=openFd(n,this._spec,S),this._pathStr=n,this._gFile=Si.File.new_for_path(n),FileHandle.instances[this.fd]=this,FileHandle.getInstance(this.fd)}_readCore(t,n,S,C){if(this._assertOpen(`read`),!this._spec.readable)throw fsError(`EBADF`,`read`,this._pathStr);if(S>t.byteLength-n){let C=RangeError(`The value of "length" is out of range. It must be <= ${t.byteLength-n}. Received ${S}`);throw C.code=`ERR_OUT_OF_RANGE`,C}let N=C!=null&&C>=0,F=isSeekableFd(this.fd,this._pathStr);if(N&&!F)throw fsError(`ESPIPE`,`read`,this._pathStr);let I=N?C:this._pos;F&&seekFd(this.fd,I);let H=readFd(this.fd,S);return H.length>0&&new Uint8Array(t.buffer,t.byteOffset+n,H.length).set(H),!N&&F&&(this._pos=I+H.length),H.length}_writeCore(t,n){if(this._assertOpen(`write`),!this._spec.writable)throw fsError(`EBADF`,`write`,this._pathStr);if(this._spec.append){let n=writeFd(this.fd,t);return this._pos=tellFd(this.fd)??sizeOfFd(this.fd,this._pathStr),n}let S=n!=null&&n>=0,C=isSeekableFd(this.fd,this._pathStr);if(S&&!C)throw fsError(`ESPIPE`,`write`,this._pathStr);let N=S?n:this._pos;C&&seekFd(this.fd,N);let F=writeFd(this.fd,t);return!S&&C&&(this._pos=N+F),F}_assertOpen(t){if(this._closed)throw fsError(`EBADF`,t,this._pathStr)}_truncateCore(t){if(this._assertOpen(`ftruncate`),!this._spec.writable)throw fsError(`EINVAL`,`ftruncate`,this._pathStr);truncateFd(this.fd,Math.max(0,t),this._pathStr)}_readToEnd(){let t=[],n=0;for(;;){let S=new Uint8Array(64*1024),C=this._readCore(S,0,S.length,null);if(C===0)break;t.push(S.subarray(0,C)),n+=C}let S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.length;return S}_fdTarget(){return fdPath(this.fd)??this._pathStr}fd;static getInstance(t,n=`read`){let S=t instanceof FileHandle?t.fd:t,C=FileHandle.instances[S];if(!C)throw fsError(`EBADF`,n);return C}async appendFile(t,n){await this.writeFile(t,n)}async chown(t,n){this._assertOpen(`fchown`),chownSync(normalizePath$1(this.options.path),t,n)}async chmod(t){this._assertOpen(`fchmod`),chmodSync(this._fdTarget(),t)}createReadStream(t){return new ReadStream(this.options.path,{...t,fd:this.fd})}createWriteStream(t){return new WriteStream(this.options.path,{...t,fd:this.fd,fdFromHandle:!0})}async datasync(){this._assertOpen(`fdatasync`),fsyncFd(this.fd)}async sync(){this._assertOpen(`fsync`),fsyncFd(this.fd)}async read(...t){let n,S,C,N;if(typeof t[0]==`object`&&!(t[0]instanceof Uint8Array)&&!(t[0]instanceof it)){let F=t[0];n=F.buffer,S=F.offset,C=F.length,N=F.position}else n=t[0],S=t[1],C=t[2],N=t[3];let F=n,I=S??0,H=C??(F?F.byteLength-I:65536);return{bytesRead:this._readCore(n,I,H,N??null),buffer:n}}readableWebStream(){if(this._closed)throw invalidState(`The FileHandle is closed`);if(this._webStreamLocked)throw invalidState(`The FileHandle is locked`);let t=globalThis.ReadableStream;if(typeof t!=`function`)throw Error(`readableWebStream() requires a global ReadableStream. Import "node:stream/web" or "@gjsify/web-streams/register" before calling this method.`);return this._webStreamLocked=!0,new t({type:`bytes`,pull:t=>{if(this._closed){t.close(),t.byobRequest?.respond(0);return}let n=t.byobRequest?.view,S=n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(64*1024),C;try{C=this._readCore(S,0,S.length,null)}catch(n){t.error(n);return}if(C===0){t.close(),t.byobRequest?.respond(0);return}if(t.byobRequest){t.byobRequest.respond(C);return}t.enqueue(S.subarray(0,C))}})}async readFile(t){return encodeUint8Array(getEncodingFromOptions(t,`buffer`),this._readToEnd())}readLines(t){return createInterface$1({input:this.createReadStream(t),crlfDelay:1/0})}async stat(t){this._assertOpen(`fstat`);let n=Si.File.new_for_path(this._fdTarget());return statsFrom(await new Promise((t,S)=>{n.query_info_async(dd,Si.FileQueryInfoFlags.NONE,_t.PRIORITY_DEFAULT,null,(C,N)=>{try{t(n.query_info_finish(N))}catch(t){S(t)}})}),this._pathStr,`fstat`,t?.bigint)}async truncate(t=0){this._truncateCore(t)}async utimes(t,n){this._assertOpen(`futimes`);let{utimesSync:S}=await Promise.resolve().then(()=>(Ku(),Gu));S(normalizePath$1(this.options.path),t,n)}async writeFile(t,n){let S=getEncodingFromOptions(n),C;C=typeof t==`string`?it.from(t,S||`utf8`):t,this._writeCore(C,null)}async write(t,...n){let S=null,C=null,N=null,F=null;typeof t==`string`?(S=n[0],C=n[1]):(N=n[0],F=n[1],S=n[2]),C=getEncodingFromOptions(C,typeof t==`string`?`utf8`:null);let I;I=typeof t==`string`?new TextEncoder().encode(t):t;let H=N??0,W=F??I.byteLength-H,q=I.subarray(H,H+W);return{bytesWritten:this._writeCore(q,S??null),buffer:t}}async writev(t,n){let S=0;for(let C of t){let t=it.from(C.buffer,C.byteOffset,C.byteLength),N=await this.write(t,0,t.byteLength,n==null?null:n+S);S+=N.bytesWritten}return{bytesWritten:S,buffers:t}}async readv(t,n){let S=0;for(let C of t){let t=await this.read({buffer:it.from(C.buffer,C.byteOffset,C.byteLength),position:n==null?null:n+S});if(S+=t.bytesRead,t.bytesRead<C.byteLength)break}return{bytesRead:S,buffers:t}}_flushSync(){fsyncFd(this.fd)}_closeSync(){this._teardown()}_readSync(t,n,S,C){return this._readCore(t,n,S,C)}_writeSync(t,n){return this._writeCore(t,n)}_readToEndSync(){return this._readToEnd()}_truncateSync(t){this._truncateCore(t)}_fdStatTarget(){return this._fdTarget()}_teardown(){if(this._closed)return;this._closed=!0,releaseFd(this.fd),closeFd(this.fd);let t=FileHandle;delete t.instances[this.fd]}async close(){this._teardown()}async[Symbol.asyncDispose](){await this.close()}pull(...t){throw Error('FileHandle.pull() is not implemented in @gjsify/fs yet — requires `node:stream/iter` (Node 25.9+) which @gjsify/stream has not ported. Track gjsify Open TODO "Node 25 stream/iter integration".')}writer(t){throw Error('FileHandle.writer() is not implemented in @gjsify/fs yet — requires `node:stream/iter` (Node 25.9+) which @gjsify/stream has not ported. Track gjsify Open TODO "Node 25 stream/iter integration".')}}});function getFH(t,n){return Id.getInstance(t,n)}function fstatSync(t,n){return statSync(getFH(t,`fstat`)._fdStatTarget(),n)}function fstat(t,n,S){let C=typeof n==`function`?n:requireCallback(S);fstatAsync(t,typeof n==`function`?{}:n).then(t=>C(null,t),t=>C(t,void 0))}async function fstatAsync(t,n){return n?.bigint,fstatSync(t,n)}function ftruncateSync(t,n=0){getFH(t,`ftruncate`)._truncateSync(n)}function ftruncate(t,n,S){let C=typeof n==`function`?n:requireCallback(S);ftruncateAsync(t,typeof n==`function`?0:n).then(()=>C(null),C)}async function ftruncateAsync(t,n=0){ftruncateSync(t,n)}function fdatasyncSync(t){getFH(t,`fdatasync`)._flushSync()}function fdatasync(t,n){requireCallback(n),Promise.resolve().then(()=>fdatasyncSync(t)).then(()=>n(null),n)}async function fdatasyncAsync(t){fdatasyncSync(t)}function fsyncSync(t){getFH(t,`fsync`)._flushSync()}function fsync(t,n){requireCallback(n),Promise.resolve().then(()=>fsyncSync(t)).then(()=>n(null),n)}async function fsyncAsync(t){fsyncSync(t)}function fchmodSync(t,n){chmodSync(getFH(t,`fchmod`)._fdStatTarget(),n)}function fchmod(t,n,S){requireCallback(S),Promise.resolve().then(()=>fchmodSync(t,n)).then(()=>S(null),S)}async function fchmodAsync(t,n){fchmodSync(t,n)}function fchownSync(t,n,S){chownSync(normalizePath$1(getFH(t,`fchown`).options.path),n,S)}function fchown(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>fchownSync(t,n,S)).then(()=>C(null),C)}async function fchownAsync(t,n,S){fchownSync(t,n,S)}function futimesSync(t,n,S){utimesSync(normalizePath$1(getFH(t,`futimes`).options.path),n,S)}function futimes(t,n,S,C){requireCallback(C),Promise.resolve().then(()=>futimesSync(t,n,S)).then(()=>C(null),C)}async function futimesAsync(t,n,S){futimesSync(t,n,S)}function closeSync(t){isStdFd(t)||getFH(t,`close`)._closeSync()}function readSync(t,n,S,C,N){let F=0;return typeof S==`object`&&S?(F=S.offset??0,C=S.length??n.byteLength-F,N=S.position??null):(F=S??0,C??=n.byteLength-F),isStdFd(t)?readStdFdSync(t,n,F,C):getFH(t,`read`)._readSync(n,F,C,N??null)}function writeSync(t,n,S,C,N){let F;if(typeof n==`string`)F=new TextEncoder().encode(n),typeof S==`number`&&(N=S);else{let t=typeof S==`number`?S:0,N=typeof C==`number`?C:n.byteLength-t;F=new Uint8Array(n.buffer,n.byteOffset+t,N)}return isStdFd(t)?writeStdFdSync(t,F):getFH(t,`write`)._writeSync(F,N??null)}function readvSync(t,n,S){let C=0;for(let N of n){let n=readSync(t,N,0,N.byteLength,S==null?null:S+C);if(C+=n,n<N.byteLength)break}return C}function readv(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C);readvAsync(t,n,typeof S==`function`?null:S).then(t=>N(null,t.bytesRead,t.buffers),t=>N(t,0,n))}async function readvAsync(t,n,S){return{bytesRead:readvSync(t,n,S),buffers:n}}function writevSync(t,n,S){let C=0;for(let N of n){let n=writeSync(t,N,0,N.byteLength,S==null?null:S+C);C+=n}return C}function writev(t,n,S,C){let N=typeof S==`function`?S:requireCallback(C);writevAsync(t,n,typeof S==`function`?null:S).then(t=>N(null,t.bytesWritten,t.buffers),t=>N(t,0,n))}async function writevAsync(t,n,S){return{bytesWritten:writevSync(t,n,S),buffers:n}}function exists(t,n){requireCallback(n);let S;try{statSync(normalizePath$1(t)),S=!0}catch{S=!1}Promise.resolve().then(()=>n(S))}async function openAsBlob(t,n){let S=readFileSync(normalizePath$1(t));return new Blob([S],{type:n?.type??``})}var Rd=__esmMin(()=>{Bu(),Vu(),Ku(),Yu(),Ld(),pd(),Object.defineProperty(exists,Symbol.for(`nodejs.util.promisify.custom`),{value:t=>new Promise(n=>exists(t,n))})});function zeroedStat(){return{dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:0,blksize:0,blocks:0,atimeMs:0,mtimeMs:0,ctimeMs:0,birthtimeMs:0,atime:new Date(0),mtime:new Date(0),ctime:new Date(0),birthtime:new Date(0),isFile:()=>!1,isDirectory:()=>!1,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isSymbolicLink:()=>!1,isFIFO:()=>!1,isSocket:()=>!1}}function watchFile(t,n,S){typeof n==`function`&&(S=n,n={}),requireCallback(S,`listener`);let C=n.interval??5007,N=t.toString(),F=zd.get(N);return F||(F=new StatWatcher(N,C),F.start(),zd.set(N,F)),S&&F.addChangeListener(S),F}function unwatchFile(t,n){let S=t.toString(),C=zd.get(S);C&&(n?C.removeChangeListener(n):C.removeAllChangeListeners(),C.changeListenerCount===0&&(C.stop(),zd.delete(S)))}var StatWatcher,zd,Bd=__esmMin(()=>{Vu(),pd(),tn(),StatWatcher=class extends Wt{_path;_interval;_timerId=null;_prev;_changeCount=0;constructor(t,n){super(),this._path=t,this._interval=n,this._prev=zeroedStat()}start(){try{this._prev=statSync(this._path)}catch{}this._timerId=setInterval(()=>{let t;try{t=statSync(this._path)}catch{t=zeroedStat()}let n=this._prev;(t.mtimeMs!==n.mtimeMs||t.size!==n.size||t.ino!==n.ino)&&(this._prev=t,this.emit(`change`,t,n))},this._interval)}stop(){this._timerId!==null&&(clearInterval(this._timerId),this._timerId=null),this.emit(`stop`)}addChangeListener(t){this._changeCount++,this.on(`change`,t)}removeChangeListener(t){this._changeCount--,this.removeListener(`change`,t)}removeAllChangeListeners(){this._changeCount=0,this.removeAllListeners(`change`)}get changeListenerCount(){return this._changeCount}},zd=new Map}),Vd=__exportAll$5({BigIntStats:()=>BigIntStats,Dir:()=>Dir,Dirent:()=>Dirent,FSWatcher:()=>FSWatcher,ReadStream:()=>ReadStream,StatWatcher:()=>StatWatcher,Stats:()=>Stats,WriteStream:()=>WriteStream,access:()=>access,accessSync:()=>accessSync,appendFile:()=>appendFile,appendFileSync:()=>appendFileSync,chmod:()=>chmod,chmodSync:()=>chmodSync,chown:()=>chown,chownSync:()=>chownSync,close:()=>close$1,closeSync:()=>closeSync,constants:()=>xd,copyFile:()=>copyFile,copyFileSync:()=>copyFileSync,cp:()=>cp,cpSync:()=>cpSync,createReadStream:()=>createReadStream,createWriteStream:()=>createWriteStream,default:()=>Hd,exists:()=>exists,existsSync:()=>existsSync,fchmod:()=>fchmod,fchmodSync:()=>fchmodSync,fchown:()=>fchown,fchownSync:()=>fchownSync,fdatasync:()=>fdatasync,fdatasyncSync:()=>fdatasyncSync,fstat:()=>fstat,fstatSync:()=>fstatSync,fsync:()=>fsync,fsyncSync:()=>fsyncSync,ftruncate:()=>ftruncate,ftruncateSync:()=>ftruncateSync,futimes:()=>futimes,futimesSync:()=>futimesSync,glob:()=>glob,globSync:()=>globSync,lchmod:()=>void 0,lchmodSync:()=>void 0,lchown:()=>lchown,lchownSync:()=>lchownSync,link:()=>link,linkSync:()=>linkSync,lstat:()=>lstat,lstatSync:()=>lstatSync,lutimes:()=>lutimes,lutimesSync:()=>lutimesSync,mkdir:()=>mkdir,mkdirSync:()=>mkdirSync,mkdtemp:()=>mkdtemp,mkdtempSync:()=>mkdtempSync,"module.exports":()=>Hd,open:()=>open$1,openAsBlob:()=>openAsBlob,openSync:()=>openSync,opendir:()=>opendir,opendirSync:()=>opendirSync,promises:()=>wd,read:()=>read$1,readFile:()=>readFile,readFileSync:()=>readFileSync,readSync:()=>readSync,readdir:()=>readdir,readdirSync:()=>readdirSync,readlink:()=>readlink,readlinkSync:()=>readlinkSync,readv:()=>readv,readvSync:()=>readvSync,realpath:()=>realpath,realpathSync:()=>realpathSync,rename:()=>rename,renameSync:()=>renameSync,rm:()=>rm,rmSync:()=>rmSync,rmdir:()=>rmdir,rmdirSync:()=>rmdirSync,stat:()=>stat,statSync:()=>statSync,statfs:()=>statfs,statfsSync:()=>statfsSync,symlink:()=>symlink,symlinkSync:()=>symlinkSync,truncate:()=>truncate,truncateSync:()=>truncateSync,unlink:()=>unlink,unlinkSync:()=>unlinkSync,unwatchFile:()=>unwatchFile,utimes:()=>utimes,utimesSync:()=>utimesSync,watch:()=>watch,watchFile:()=>watchFile,write:()=>write,writeFile:()=>writeFile,writeFileSync:()=>writeFileSync,writeSync:()=>writeSync,writev:()=>writev,writevSync:()=>writevSync}),Hd,Ud=__esmMin(()=>{Wu(),Ku(),Rd(),Zu(),Ad(),rd(),fd(),pd(),md(),gd(),_d(),bd(),Sd(),Ed(),Dd(),Bd(),Hd={FSWatcher,StatWatcher,Stats,BigIntStats,Dirent,Dir,constants:xd,existsSync,readdirSync,readFileSync,writeFileSync,mkdirSync,rmdirSync,unlinkSync,mkdtemp,mkdtempSync,rmSync,statSync,openSync,realpathSync,symlinkSync,lstatSync,renameSync,copyFileSync,accessSync,appendFileSync,readlinkSync,linkSync,truncateSync,chmodSync,chownSync,cpSync,opendirSync,globSync,glob,watch,watchFile,unwatchFile,statfsSync,statfs,utimesSync,utimes,lutimesSync,lutimes,lchownSync,lchown,lchmodSync:void 0,lchmod:void 0,fstatSync,fstat,ftruncateSync,ftruncate,fdatasyncSync,fdatasync,fsyncSync,fsync,fchmodSync,fchmod,fchownSync,fchown,futimesSync,futimes,closeSync,readSync,writeSync,readvSync,readv,writevSync,writev,exists,openAsBlob,createReadStream,ReadStream,createWriteStream,WriteStream,promises:wd,open:open$1,close:close$1,read:read$1,write,rm,realpath,readdir,symlink,lstat,stat,rename,copyFile,cp,access,appendFile,readlink,truncate,chmod,chown,mkdir,rmdir,readFile,writeFile,unlink,link,opendir}}),Wd,Gd,Kd,qd,Jd,Yd,Xd=__esmMin(()=>{
|
|
69
69
|
/**
|
|
@@ -145,7 +145,7 @@ fi
|
|
|
145
145
|
`)}`:``;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=>{!Tp.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=>{Tp.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 Tp,Ep=__esmMin(()=>{dp(),op(),wp(),gp(),Tp=[`$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,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,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,YargsInstance,Km=__esmMin(()=>{_e(),hp(),op(),Ol(),yp(),dp(),Cp(),Ep(),gp(),jl(),fp(),sp(),pp(),vp(),__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)},lm=Symbol(`copyDoubleDash`),um=Symbol(`copyDoubleDash`),dm=Symbol(`deleteFromParserHintObject`),fm=Symbol(`emitWarning`),pm=Symbol(`freeze`),mm=Symbol(`getDollarZero`),hm=Symbol(`getParserConfiguration`),gm=Symbol(`getUsageConfiguration`),_m=Symbol(`guessLocale`),vm=Symbol(`guessVersion`),ym=Symbol(`parsePositionalNumbers`),bm=Symbol(`pkgUp`),xm=Symbol(`populateParserHintArray`),Sm=Symbol(`populateParserHintSingleValueDictionary`),Cm=Symbol(`populateParserHintArrayDictionary`),wm=Symbol(`populateParserHintDictionary`),Tm=Symbol(`sanitizeKey`),Em=Symbol(`setKey`),Dm=Symbol(`unfreeze`),Om=Symbol(`validateAsync`),km=Symbol(`getCommandInstance`),Am=Symbol(`getContext`),jm=Symbol(`getHasOutput`),Mm=Symbol(`getLoggerInstance`),Nm=Symbol(`getParseContext`),Pm=Symbol(`getUsageInstance`),Fm=Symbol(`getValidationInstance`),Im=Symbol(`hasParseCallback`),Lm=Symbol(`isGlobalContext`),Rm=Symbol(`postProcess`),zm=Symbol(`rebase`),Bm=Symbol(`reset`),Vm=Symbol(`runYargsParserAndExecuteCommands`),Hm=Symbol(`runValidation`),Um=Symbol(`setHasOutput`),Wm=Symbol(`kTrackManuallySetKeys`),Gm=`en_US`,YargsInstance=class{constructor(t=[],n,S,C){this.customScriptName=!1,this.parsed=!1,Dp.set(this,void 0),Op.set(this,void 0),kp.set(this,{commands:[],fullCommands:[]}),Ap.set(this,null),jp.set(this,null),Mp.set(this,`show-hidden`),Np.set(this,null),Pp.set(this,!0),Fp.set(this,{}),Ip.set(this,!0),Lp.set(this,[]),Rp.set(this,void 0),zp.set(this,{}),Bp.set(this,!1),Vp.set(this,null),Hp.set(this,!0),Up.set(this,void 0),Wp.set(this,``),Gp.set(this,void 0),Kp.set(this,void 0),qp.set(this,{}),Jp.set(this,null),Yp.set(this,null),Xp.set(this,{}),Zp.set(this,{}),Qp.set(this,void 0),$p.set(this,!1),em.set(this,void 0),tm.set(this,!1),nm.set(this,!1),im.set(this,!1),am.set(this,void 0),om.set(this,{}),sm.set(this,null),cm.set(this,void 0),__classPrivateFieldSet(this,em,C,`f`),__classPrivateFieldSet(this,Qp,t,`f`),__classPrivateFieldSet(this,Op,n,`f`),__classPrivateFieldSet(this,Kp,S,`f`),__classPrivateFieldSet(this,Rp,new GlobalMiddleware(this),`f`),this.$0=this[mm](),this[Bm](),__classPrivateFieldSet(this,Dp,__classPrivateFieldGet(this,Dp,`f`),`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`),`f`),__classPrivateFieldSet(this,cm,__classPrivateFieldGet(this,cm,`f`),`f`),__classPrivateFieldSet(this,Gp,__classPrivateFieldGet(this,Gp,`f`),`f`),__classPrivateFieldGet(this,Gp,`f`).showHiddenOpt=__classPrivateFieldGet(this,Mp,`f`),__classPrivateFieldSet(this,Up,this[um](),`f`),__classPrivateFieldGet(this,em,`f`).y18n.setLocale(Gm)}addHelpOpt(t,n){return argsert(`[string|boolean] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,Vp,`f`)&&(this[dm](__classPrivateFieldGet(this,Vp,`f`)),__classPrivateFieldSet(this,Vp,null,`f`)),t===!1&&n===void 0?this:(__classPrivateFieldSet(this,Vp,typeof t==`string`?t:`help`,`f`),this.boolean(__classPrivateFieldGet(this,Vp,`f`)),this.describe(__classPrivateFieldGet(this,Vp,`f`),n||__classPrivateFieldGet(this,am,`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,Mp,`f`);return this.boolean(S),this.describe(S,n||__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Show hidden options`)),__classPrivateFieldGet(this,Gp,`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[Cm](this.alias.bind(this),`alias`,t,n),this}array(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`array`,t),this[Wm](t),this}boolean(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`boolean`,t),this[Wm](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,am,`f`).fail(S.toString(),S):__classPrivateFieldGet(this,am,`f`).fail(__classPrivateFieldGet(this,em,`f`).y18n.__(`Argument check failed: %s`,t.toString())),n),t=>(__classPrivateFieldGet(this,am,`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[Cm](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 Dl(`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 Dl(`coerce callback must be provided`);let S=t;return __classPrivateFieldGet(this,Gp,`f`).key[S]=!0,__classPrivateFieldGet(this,Rp,`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 Dl(t.message)})},S),this}conflicts(t,n){return argsert(`<string|object> [string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,cm,`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,Op,`f`),this[hm]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).configObjects=(__classPrivateFieldGet(this,Gp,`f`).configObjects||[]).concat(t),this):(typeof n==`function`&&(S=n,n=void 0),this.describe(t,n||__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(t)?t:[t]).forEach(t=>{__classPrivateFieldGet(this,Gp,`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,jp,t||__classPrivateFieldGet(this,jp,`f`)||`completion`,`f`),!n&&n!==!1&&(n=`generate completion script`),this.command(__classPrivateFieldGet(this,jp,`f`),n),S&&__classPrivateFieldGet(this,Ap,`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,Dp,`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,Kp,`f`)||__classPrivateFieldGet(this,em,`f`).require;return __classPrivateFieldGet(this,Dp,`f`).addDirectory(t,S,__classPrivateFieldGet(this,em,`f`).getCallerFile(),n),this}count(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`count`,t),this[Wm](t),this}default(t,n,S){return argsert(`<object|string|array> [*] [string]`,[t,n,S],arguments.length),S&&(assertSingleKey(t,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]=S),typeof n==`function`&&(assertSingleKey(t,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]||(__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]=__classPrivateFieldGet(this,am,`f`).functionDescription(n)),n=n.call()),this[Sm](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,Gp,`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,em,`f`)),this.demandOption(t,S)}),n=1/0):typeof n!=`number`&&(S=n,n=1/0),typeof t==`number`?(assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,em,`f`)),this.demandCommand(t,n,S,S)):Array.isArray(t)?t.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,em,`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[Sm](this.demandOption.bind(this),`demandedOptions`,t,n),this}deprecateOption(t,n){return argsert(`<string> [string|boolean]`,[t,n],arguments.length),__classPrivateFieldGet(this,Gp,`f`).deprecatedOptions[t]=n,this}describe(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Em](t,!0),__classPrivateFieldGet(this,am,`f`).describe(t,n),this}detectLocale(t){return argsert(`<boolean>`,[t],arguments.length),__classPrivateFieldSet(this,Pp,t,`f`),this}env(t){return argsert(`[string|boolean]`,[t],arguments.length),t===!1?delete __classPrivateFieldGet(this,Gp,`f`).envPrefix:__classPrivateFieldGet(this,Gp,`f`).envPrefix=t||``,this}epilogue(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,am,`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,am,`f`).example(t,n),this}exit(t,n){__classPrivateFieldSet(this,Bp,!0,`f`),__classPrivateFieldSet(this,Np,n,`f`),__classPrivateFieldGet(this,Ip,`f`)&&__classPrivateFieldGet(this,em,`f`).process.exit(t)}exitProcess(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Ip,t,`f`),this}fail(t){if(argsert(`<function|boolean>`,[t],arguments.length),typeof t==`boolean`&&t!==!1)throw new Dl(`Invalid first argument. Expected function or boolean 'false'`);return __classPrivateFieldGet(this,am,`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,Ap,`f`).getCompletion(t,n):new Promise((n,S)=>{__classPrivateFieldGet(this,Ap,`f`).getCompletion(t,(t,C)=>{t?S(t):n(C)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,Gp,`f`).demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,Gp,`f`).demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,Gp,`f`).deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,Pp,`f`)}getExitProcess(){return __classPrivateFieldGet(this,Ip,`f`)}getGroups(){return Object.assign({},__classPrivateFieldGet(this,zp,`f`),__classPrivateFieldGet(this,Zp,`f`))}getHelp(){if(__classPrivateFieldSet(this,Bp,!0,`f`),!__classPrivateFieldGet(this,am,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[Vm](__classPrivateFieldGet(this,Qp,`f`),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,am,`f`).help())}let t=__classPrivateFieldGet(this,Dp,`f`).runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,am,`f`).help())}return Promise.resolve(__classPrivateFieldGet(this,am,`f`).help())}getOptions(){return __classPrivateFieldGet(this,Gp,`f`)}getStrict(){return __classPrivateFieldGet(this,tm,`f`)}getStrictCommands(){return __classPrivateFieldGet(this,nm,`f`)}getStrictOptions(){return __classPrivateFieldGet(this,im,`f`)}global(t,n){return argsert(`<string|array> [boolean]`,[t,n],arguments.length),t=[].concat(t),n===!1?t.forEach(t=>{__classPrivateFieldGet(this,Gp,`f`).local.includes(t)||__classPrivateFieldGet(this,Gp,`f`).local.push(t)}):__classPrivateFieldGet(this,Gp,`f`).local=__classPrivateFieldGet(this,Gp,`f`).local.filter(n=>t.indexOf(n)===-1),this}group(t,n){argsert(`<string|array> <string>`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,Zp,`f`)[n]||__classPrivateFieldGet(this,zp,`f`)[n];__classPrivateFieldGet(this,Zp,`f`)[n]&&delete __classPrivateFieldGet(this,Zp,`f`)[n];let C={};return __classPrivateFieldGet(this,zp,`f`)[n]=(S||[]).concat(t).filter(t=>C[t]?!1:C[t]=!0),this}hide(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,Gp,`f`).hiddenOptions.push(t),this}implies(t,n){return argsert(`<string|object> [number|string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,cm,`f`).implies(t,n),this}locale(t){return argsert(`[string]`,[t],arguments.length),t===void 0?(this[_m](),__classPrivateFieldGet(this,em,`f`).y18n.getLocale()):(__classPrivateFieldSet(this,Pp,!1,`f`),__classPrivateFieldGet(this,em,`f`).y18n.setLocale(t),this)}middleware(t,n,S){return __classPrivateFieldGet(this,Rp,`f`).addMiddleware(t,!!n,S)}nargs(t,n){return argsert(`<string|object|array> [number]`,[t,n],arguments.length),this[Sm](this.nargs.bind(this),`narg`,t,n),this}normalize(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`normalize`,t),this}number(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`number`,t),this[Wm](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[Wm](t),__classPrivateFieldGet(this,sm,`f`)&&(t===`version`||n?.alias===`version`)&&this[fm]([`"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(`
|
|
146
146
|
`),void 0,`versionWarning`),__classPrivateFieldGet(this,Gp,`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,Gp,`f`).defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let N=n.describe||n.description||n.desc,F=__classPrivateFieldGet(this,am,`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[pm](),t===void 0&&(t=__classPrivateFieldGet(this,Qp,`f`)),typeof n==`object`&&(__classPrivateFieldSet(this,Yp,n,`f`),n=S),typeof n==`function`&&(__classPrivateFieldSet(this,Jp,n,`f`),n=!1),n||__classPrivateFieldSet(this,Qp,t,`f`),__classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldSet(this,Ip,!1,`f`);let C=this[Vm](t,!!n),N=this.parsed;return __classPrivateFieldGet(this,Ap,`f`).setParsed(this.parsed),isPromise(C)?C.then(t=>(__classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldGet(this,Jp,`f`).call(this,__classPrivateFieldGet(this,Np,`f`),t,__classPrivateFieldGet(this,Wp,`f`)),t)).catch(t=>{throw __classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldGet(this,Jp,`f`)(t,this.parsed.argv,__classPrivateFieldGet(this,Wp,`f`)),t}).finally(()=>{this[Dm](),this.parsed=N}):(__classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldGet(this,Jp,`f`).call(this,__classPrivateFieldGet(this,Np,`f`),C,__classPrivateFieldGet(this,Wp,`f`)),this[Dm](),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 Dl(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return C}parserConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,qp,t,`f`),this}pkgConf(t,n){argsert(`<string> [string]`,[t,n],arguments.length);let S=null,C=this[bm](n||__classPrivateFieldGet(this,Op,`f`));return C[t]&&typeof C[t]==`object`&&(S=applyExtends(C[t],n||__classPrivateFieldGet(this,Op,`f`),this[hm]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).configObjects=(__classPrivateFieldGet(this,Gp,`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,kp,`f`).fullCommands[__classPrivateFieldGet(this,kp,`f`).fullCommands.length-1],N=C?__classPrivateFieldGet(this,Dp,`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,am,`f`).getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,$p,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,Gp,`f`).narg[t]||this[Sm](this.requiresArg.bind(this),`narg`,t,NaN),this}showCompletionScript(t,n){return argsert(`[string] [string]`,[t,n],arguments.length),t||=this.$0,__classPrivateFieldGet(this,Up,`f`).log(__classPrivateFieldGet(this,Ap,`f`).generateCompletionScript(t,n||__classPrivateFieldGet(this,jp,`f`)||`completion`)),this}showHelp(t){if(argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldSet(this,Bp,!0,`f`),!__classPrivateFieldGet(this,am,`f`).hasCachedHelpMessage()){if(!this.parsed){let n=this[Vm](__classPrivateFieldGet(this,Qp,`f`),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,am,`f`).showHelp(t)}),this}let n=__classPrivateFieldGet(this,Dp,`f`).runDefaultBuilderOn(this);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,am,`f`).showHelp(t)}),this}return __classPrivateFieldGet(this,am,`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,am,`f`).showHelpOnFail(t,n),this}showVersion(t){return argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldGet(this,am,`f`).showVersion(t),this}skipValidation(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`skipValidation`,t),this}strict(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,tm,t!==!1,`f`),this}strictCommands(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,nm,t!==!1,`f`),this}strictOptions(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,im,t!==!1,`f`),this}string(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`string`,t),this[Wm](t),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,em,`f`).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Pp,!1,`f`),__classPrivateFieldGet(this,em,`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,em,`f`)),(t||``).match(/^\$0( |$)/))return this.command(t,n,S,C);throw new Dl(`.usage() description must start with $0 if being used as alias for .command()`)}else return __classPrivateFieldGet(this,am,`f`).usage(t),this}usageConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,om,t,`f`),this}version(t,n,S){let C=`version`;if(argsert(`[boolean|string] [string] [string]`,[t,n,S],arguments.length),__classPrivateFieldGet(this,sm,`f`)&&(this[dm](__classPrivateFieldGet(this,sm,`f`)),__classPrivateFieldGet(this,am,`f`).version(void 0),__classPrivateFieldSet(this,sm,null,`f`)),arguments.length===0)S=this[vm](),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,sm,typeof t==`string`?t:C,`f`),n||=__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Show version number`),__classPrivateFieldGet(this,am,`f`).version(S||void 0),this.boolean(__classPrivateFieldGet(this,sm,`f`)),this.describe(__classPrivateFieldGet(this,sm,`f`),n),this}wrap(t){return argsert(`<number|null|undefined>`,[t],arguments.length),__classPrivateFieldGet(this,am,`f`).wrap(t),this}[(Dp=new WeakMap,Op=new WeakMap,kp=new WeakMap,Ap=new WeakMap,jp=new WeakMap,Mp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Lp=new WeakMap,Rp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,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)](t){if(!t._||!t[`--`])return t;t._.push.apply(t._,t[`--`]);try{delete t[`--`]}catch{}return t}[um](){return{log:(...t)=>{this[Im]()||ge.log(...t),__classPrivateFieldSet(this,Bp,!0,`f`),__classPrivateFieldGet(this,Wp,`f`).length&&__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+`
|
|
147
147
|
`,`f`),__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+t.join(` `),`f`)},error:(...t)=>{this[Im]()||ge.error(...t),__classPrivateFieldSet(this,Bp,!0,`f`),__classPrivateFieldGet(this,Wp,`f`).length&&__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+`
|
|
148
|
-
`,`f`),__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+t.join(` `),`f`)}}}[dm](t){objectKeys(__classPrivateFieldGet(this,Gp,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,Gp,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,am,`f`).getDescriptions()[t]}[fm](t,n,S){__classPrivateFieldGet(this,Fp,`f`)[S]||(__classPrivateFieldGet(this,em,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Fp,`f`)[S]=!0)}[pm](){__classPrivateFieldGet(this,Lp,`f`).push({options:__classPrivateFieldGet(this,Gp,`f`),configObjects:__classPrivateFieldGet(this,Gp,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Ip,`f`),groups:__classPrivateFieldGet(this,zp,`f`),strict:__classPrivateFieldGet(this,tm,`f`),strictCommands:__classPrivateFieldGet(this,nm,`f`),strictOptions:__classPrivateFieldGet(this,im,`f`),completionCommand:__classPrivateFieldGet(this,jp,`f`),output:__classPrivateFieldGet(this,Wp,`f`),exitError:__classPrivateFieldGet(this,Np,`f`),hasOutput:__classPrivateFieldGet(this,Bp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,Jp,`f`),parseContext:__classPrivateFieldGet(this,Yp,`f`)}),__classPrivateFieldGet(this,am,`f`).freeze(),__classPrivateFieldGet(this,cm,`f`).freeze(),__classPrivateFieldGet(this,Dp,`f`).freeze(),__classPrivateFieldGet(this,Rp,`f`).freeze()}[mm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,em,`f`).process.argv()[0])?__classPrivateFieldGet(this,em,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,em,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[zm](__classPrivateFieldGet(this,Op,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,em,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,em,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,em,`f`).path.dirname(__classPrivateFieldGet(this,em,`f`).process.execPath())}/`,``)),t}[hm](){return __classPrivateFieldGet(this,qp,`f`)}[gm](){return __classPrivateFieldGet(this,om,`f`)}[_m](){if(!__classPrivateFieldGet(this,Pp,`f`))return;let t=__classPrivateFieldGet(this,em,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[vm](){return this[bm]().version||`unknown`}[ym](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,em,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[bm](t){let n=t||`*`;if(__classPrivateFieldGet(this,Xp,`f`)[n])return __classPrivateFieldGet(this,Xp,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,em,`f`).mainFilename;__classPrivateFieldGet(this,em,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,em,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,em,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,em,`f`)),S=JSON.parse(__classPrivateFieldGet(this,em,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,Xp,`f`)[n]=S||{},__classPrivateFieldGet(this,Xp,`f`)[n]}[xm](t,n){n=[].concat(n),n.forEach(n=>{n=this[Tm](n),__classPrivateFieldGet(this,Gp,`f`)[t].push(n)})}[Sm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=S})}[Cm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=(__classPrivateFieldGet(this,Gp,`f`)[t][n]||[]).concat(S)})}[wm](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[Tm](S),C)}[Tm](t){return t===`__proto__`?`___proto___`:t}[Em](t,n){return this[Sm](this[Em].bind(this),`key`,t,n),this}[Dm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Lp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,em,`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,Gp,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Ip,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,zp,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,Wp,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Np,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,Bp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,tm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,nm,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,im,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,jp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,Jp,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,Yp,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,Gp,`f`).configObjects=te,__classPrivateFieldGet(this,am,`f`).unfreeze(),__classPrivateFieldGet(this,cm,`f`).unfreeze(),__classPrivateFieldGet(this,Dp,`f`).unfreeze(),__classPrivateFieldGet(this,Rp,`f`).unfreeze()}[Om](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[km].bind(this),getContext:this[Am].bind(this),getHasOutput:this[jm].bind(this),getLoggerInstance:this[Mm].bind(this),getParseContext:this[Nm].bind(this),getParserConfiguration:this[hm].bind(this),getUsageConfiguration:this[gm].bind(this),getUsageInstance:this[Pm].bind(this),getValidationInstance:this[Fm].bind(this),hasParseCallback:this[Im].bind(this),isGlobalContext:this[Lm].bind(this),postProcess:this[Rm].bind(this),reset:this[Bm].bind(this),runValidation:this[Hm].bind(this),runYargsParserAndExecuteCommands:this[Vm].bind(this),setHasOutput:this[Um].bind(this)}}[km](){return __classPrivateFieldGet(this,Dp,`f`)}[Am](){return __classPrivateFieldGet(this,kp,`f`)}[jm](){return __classPrivateFieldGet(this,Bp,`f`)}[Mm](){return __classPrivateFieldGet(this,Up,`f`)}[Nm](){return __classPrivateFieldGet(this,Yp,`f`)||{}}[Pm](){return __classPrivateFieldGet(this,am,`f`)}[Fm](){return __classPrivateFieldGet(this,cm,`f`)}[Im](){return!!__classPrivateFieldGet(this,Jp,`f`)}[Lm](){return __classPrivateFieldGet(this,Hp,`f`)}[Rm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[lm](t)),(this[hm]()[`parse-positional-numbers`]||this[hm]()[`parse-positional-numbers`]===void 0)&&(t=this[ym](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)),t)}[Bm](t={}){__classPrivateFieldSet(this,Gp,__classPrivateFieldGet(this,Gp,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,Gp,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,Gp,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,Zp,`f`),Object.keys(__classPrivateFieldGet(this,zp,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,zp,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,zp,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,Gp,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,Gp,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,Gp,`f`).envPrefix,__classPrivateFieldSet(this,Gp,n,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)?__classPrivateFieldGet(this,am,`f`).reset(S):usage(this,__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,cm,__classPrivateFieldGet(this,cm,`f`)?__classPrivateFieldGet(this,cm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,Dp,__classPrivateFieldGet(this,Dp,`f`)?__classPrivateFieldGet(this,Dp,`f`).reset():command(__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,cm,`f`),__classPrivateFieldGet(this,Rp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Ap,`f`)||__classPrivateFieldSet(this,Ap,completion(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,Dp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Rp,`f`).reset(),__classPrivateFieldSet(this,jp,null,`f`),__classPrivateFieldSet(this,Wp,``,`f`),__classPrivateFieldSet(this,Np,null,`f`),__classPrivateFieldSet(this,Bp,!1,`f`),this.parsed=!1,this}[zm](t,n){return __classPrivateFieldGet(this,em,`f`).path.relative(t,n)}[Vm](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,Gp,`f`).__=__classPrivateFieldGet(this,em,`f`).y18n.__,__classPrivateFieldGet(this,Gp,`f`).configuration=this[hm]();let I=!!__classPrivateFieldGet(this,Gp,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,Gp,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,em,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,Gp,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,Yp,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Vp,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,sm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,am,`f`).clearCachedHelpMessage();try{if(this[_m](),n)return this[Rm](q,I,!!S,!1);__classPrivateFieldGet(this,Vp,`f`)&&[__classPrivateFieldGet(this,Vp,`f`)].concat(X[__classPrivateFieldGet(this,Vp,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,Hp,!1,`f`);let H=__classPrivateFieldGet(this,Dp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Ap,`f`)?.completionKey?[__classPrivateFieldGet(this,Ap,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Ap,`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,jp,`f`)){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Rm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,jp,`f`)){t=F;break}!__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,$p,`f`)&&t&&!re&&__classPrivateFieldGet(this,cm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,jp,`f`)&&q._.includes(__classPrivateFieldGet(this,jp,`f`))&&!ne&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Rm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Ap,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Ap,`f`).getCompletion(n,(t,n)=>{if(t)throw new Dl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,Up,`f`).log(t)}),this.exit(0)}),this[Rm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,Bp,`f`)||(Z?(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,Up,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,am,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,Gp,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,Gp,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new Dl(W.error.message);if(!ne){let t=this[Hm](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!0)),Y=this[Om](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof Dl)__classPrivateFieldGet(this,am,`f`).fail(t.message,t);else throw t}return this[Rm](Y??q,I,!!S,!0)}[Hm](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new Dl(S.message);__classPrivateFieldGet(this,cm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,cm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,nm,`f`)&&(I=__classPrivateFieldGet(this,cm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,tm,`f`)&&!I?__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,im,`f`)&&__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,cm,`f`).limitedChoices(F),__classPrivateFieldGet(this,cm,`f`).implications(F),__classPrivateFieldGet(this,cm,`f`).conflicting(F)}}[Um](){__classPrivateFieldSet(this,Bp,!0,`f`)}[Wm](t){if(typeof t==`string`)__classPrivateFieldGet(this,Gp,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,Gp,`f`).key[n]=!0}}}),qm,Jm=__esmMin(()=>{ap(),Km(),qm=YargsFactory(ip)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var Ym=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.12-next.280`,"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 Xm=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,Zm=__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):Qm}function parseNpmrc(t){let n={registry:Qm,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 Qm,$m=__esmMin(()=>{Qm=`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 eh=__esmMin(()=>{Zm(),__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 th=__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 nh=__esmMin(()=>{Xm(),Zm(),$m(),eh()});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 rh=__esmMin(()=>{Xm(),Zm(),eh(),th()});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 ih=__esmMin(()=>{Xm(),$m()}),ah=__esmMin(()=>{Xm(),Zm(),$m(),th(),nh(),rh(),ih()});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 oh===void 0&&(oh=`0.64.12-next.280`),oh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=jn(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=jn(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 oh,sh=__esmMin(()=>{Ud(),zn(),Xn(),ah()}),ch,lh=__esmMin(()=>{ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(uh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${uh.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&dh[t]===!0}var uh,dh,fh,ph=__esmMin(()=>{uh=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],dh={flathub:!0,web:!0,"microsoft-store":!1,"apple-app-store":!1},fh=`GJSIFY_CHANNEL`}),mh=__commonJSMin(((t,n)=>{let S=(zn(),__toCommonJS(wn)),C=(Vl(),__toCommonJS(Ll)),N=(Ud(),__toCommonJS(Vd)),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)})),hh=__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})),gh=__commonJSMin(((t,n)=>{let S=hh();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}}}})),vh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(Gl(),__toCommonJS(Hl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(zn(),__toCommonJS(wn)),H=mh(),W=gh();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)}})),yh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),bh=__commonJSMin(((t,n)=>{var S=(Au(),__toCommonJS(Eu)),C=yh(),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(`
|
|
148
|
+
`,`f`),__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+t.join(` `),`f`)}}}[dm](t){objectKeys(__classPrivateFieldGet(this,Gp,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,Gp,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,am,`f`).getDescriptions()[t]}[fm](t,n,S){__classPrivateFieldGet(this,Fp,`f`)[S]||(__classPrivateFieldGet(this,em,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Fp,`f`)[S]=!0)}[pm](){__classPrivateFieldGet(this,Lp,`f`).push({options:__classPrivateFieldGet(this,Gp,`f`),configObjects:__classPrivateFieldGet(this,Gp,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Ip,`f`),groups:__classPrivateFieldGet(this,zp,`f`),strict:__classPrivateFieldGet(this,tm,`f`),strictCommands:__classPrivateFieldGet(this,nm,`f`),strictOptions:__classPrivateFieldGet(this,im,`f`),completionCommand:__classPrivateFieldGet(this,jp,`f`),output:__classPrivateFieldGet(this,Wp,`f`),exitError:__classPrivateFieldGet(this,Np,`f`),hasOutput:__classPrivateFieldGet(this,Bp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,Jp,`f`),parseContext:__classPrivateFieldGet(this,Yp,`f`)}),__classPrivateFieldGet(this,am,`f`).freeze(),__classPrivateFieldGet(this,cm,`f`).freeze(),__classPrivateFieldGet(this,Dp,`f`).freeze(),__classPrivateFieldGet(this,Rp,`f`).freeze()}[mm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,em,`f`).process.argv()[0])?__classPrivateFieldGet(this,em,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,em,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[zm](__classPrivateFieldGet(this,Op,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,em,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,em,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,em,`f`).path.dirname(__classPrivateFieldGet(this,em,`f`).process.execPath())}/`,``)),t}[hm](){return __classPrivateFieldGet(this,qp,`f`)}[gm](){return __classPrivateFieldGet(this,om,`f`)}[_m](){if(!__classPrivateFieldGet(this,Pp,`f`))return;let t=__classPrivateFieldGet(this,em,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[vm](){return this[bm]().version||`unknown`}[ym](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,em,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[bm](t){let n=t||`*`;if(__classPrivateFieldGet(this,Xp,`f`)[n])return __classPrivateFieldGet(this,Xp,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,em,`f`).mainFilename;__classPrivateFieldGet(this,em,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,em,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,em,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,em,`f`)),S=JSON.parse(__classPrivateFieldGet(this,em,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,Xp,`f`)[n]=S||{},__classPrivateFieldGet(this,Xp,`f`)[n]}[xm](t,n){n=[].concat(n),n.forEach(n=>{n=this[Tm](n),__classPrivateFieldGet(this,Gp,`f`)[t].push(n)})}[Sm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=S})}[Cm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=(__classPrivateFieldGet(this,Gp,`f`)[t][n]||[]).concat(S)})}[wm](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[Tm](S),C)}[Tm](t){return t===`__proto__`?`___proto___`:t}[Em](t,n){return this[Sm](this[Em].bind(this),`key`,t,n),this}[Dm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Lp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,em,`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,Gp,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Ip,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,zp,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,Wp,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Np,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,Bp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,tm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,nm,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,im,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,jp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,Jp,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,Yp,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,Gp,`f`).configObjects=te,__classPrivateFieldGet(this,am,`f`).unfreeze(),__classPrivateFieldGet(this,cm,`f`).unfreeze(),__classPrivateFieldGet(this,Dp,`f`).unfreeze(),__classPrivateFieldGet(this,Rp,`f`).unfreeze()}[Om](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[km].bind(this),getContext:this[Am].bind(this),getHasOutput:this[jm].bind(this),getLoggerInstance:this[Mm].bind(this),getParseContext:this[Nm].bind(this),getParserConfiguration:this[hm].bind(this),getUsageConfiguration:this[gm].bind(this),getUsageInstance:this[Pm].bind(this),getValidationInstance:this[Fm].bind(this),hasParseCallback:this[Im].bind(this),isGlobalContext:this[Lm].bind(this),postProcess:this[Rm].bind(this),reset:this[Bm].bind(this),runValidation:this[Hm].bind(this),runYargsParserAndExecuteCommands:this[Vm].bind(this),setHasOutput:this[Um].bind(this)}}[km](){return __classPrivateFieldGet(this,Dp,`f`)}[Am](){return __classPrivateFieldGet(this,kp,`f`)}[jm](){return __classPrivateFieldGet(this,Bp,`f`)}[Mm](){return __classPrivateFieldGet(this,Up,`f`)}[Nm](){return __classPrivateFieldGet(this,Yp,`f`)||{}}[Pm](){return __classPrivateFieldGet(this,am,`f`)}[Fm](){return __classPrivateFieldGet(this,cm,`f`)}[Im](){return!!__classPrivateFieldGet(this,Jp,`f`)}[Lm](){return __classPrivateFieldGet(this,Hp,`f`)}[Rm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[lm](t)),(this[hm]()[`parse-positional-numbers`]||this[hm]()[`parse-positional-numbers`]===void 0)&&(t=this[ym](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)),t)}[Bm](t={}){__classPrivateFieldSet(this,Gp,__classPrivateFieldGet(this,Gp,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,Gp,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,Gp,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,Zp,`f`),Object.keys(__classPrivateFieldGet(this,zp,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,zp,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,zp,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,Gp,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,Gp,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,Gp,`f`).envPrefix,__classPrivateFieldSet(this,Gp,n,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)?__classPrivateFieldGet(this,am,`f`).reset(S):usage(this,__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,cm,__classPrivateFieldGet(this,cm,`f`)?__classPrivateFieldGet(this,cm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,Dp,__classPrivateFieldGet(this,Dp,`f`)?__classPrivateFieldGet(this,Dp,`f`).reset():command(__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,cm,`f`),__classPrivateFieldGet(this,Rp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Ap,`f`)||__classPrivateFieldSet(this,Ap,completion(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,Dp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Rp,`f`).reset(),__classPrivateFieldSet(this,jp,null,`f`),__classPrivateFieldSet(this,Wp,``,`f`),__classPrivateFieldSet(this,Np,null,`f`),__classPrivateFieldSet(this,Bp,!1,`f`),this.parsed=!1,this}[zm](t,n){return __classPrivateFieldGet(this,em,`f`).path.relative(t,n)}[Vm](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,Gp,`f`).__=__classPrivateFieldGet(this,em,`f`).y18n.__,__classPrivateFieldGet(this,Gp,`f`).configuration=this[hm]();let I=!!__classPrivateFieldGet(this,Gp,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,Gp,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,em,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,Gp,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,Yp,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Vp,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,sm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,am,`f`).clearCachedHelpMessage();try{if(this[_m](),n)return this[Rm](q,I,!!S,!1);__classPrivateFieldGet(this,Vp,`f`)&&[__classPrivateFieldGet(this,Vp,`f`)].concat(X[__classPrivateFieldGet(this,Vp,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,Hp,!1,`f`);let H=__classPrivateFieldGet(this,Dp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Ap,`f`)?.completionKey?[__classPrivateFieldGet(this,Ap,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Ap,`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,jp,`f`)){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Rm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,jp,`f`)){t=F;break}!__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,$p,`f`)&&t&&!re&&__classPrivateFieldGet(this,cm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,jp,`f`)&&q._.includes(__classPrivateFieldGet(this,jp,`f`))&&!ne&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Rm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Ap,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Ap,`f`).getCompletion(n,(t,n)=>{if(t)throw new Dl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,Up,`f`).log(t)}),this.exit(0)}),this[Rm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,Bp,`f`)||(Z?(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,Up,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,am,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,Gp,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,Gp,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new Dl(W.error.message);if(!ne){let t=this[Hm](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!0)),Y=this[Om](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof Dl)__classPrivateFieldGet(this,am,`f`).fail(t.message,t);else throw t}return this[Rm](Y??q,I,!!S,!0)}[Hm](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new Dl(S.message);__classPrivateFieldGet(this,cm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,cm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,nm,`f`)&&(I=__classPrivateFieldGet(this,cm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,tm,`f`)&&!I?__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,im,`f`)&&__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,cm,`f`).limitedChoices(F),__classPrivateFieldGet(this,cm,`f`).implications(F),__classPrivateFieldGet(this,cm,`f`).conflicting(F)}}[Um](){__classPrivateFieldSet(this,Bp,!0,`f`)}[Wm](t){if(typeof t==`string`)__classPrivateFieldGet(this,Gp,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,Gp,`f`).key[n]=!0}}}),qm,Jm=__esmMin(()=>{ap(),Km(),qm=YargsFactory(ip)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var Ym=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.12-next.281`,"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 Xm=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,Zm=__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):Qm}function parseNpmrc(t){let n={registry:Qm,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 Qm,$m=__esmMin(()=>{Qm=`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 eh=__esmMin(()=>{Zm(),__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 th=__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 nh=__esmMin(()=>{Xm(),Zm(),$m(),eh()});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 rh=__esmMin(()=>{Xm(),Zm(),eh(),th()});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 ih=__esmMin(()=>{Xm(),$m()}),ah=__esmMin(()=>{Xm(),Zm(),$m(),th(),nh(),rh(),ih()});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 oh===void 0&&(oh=`0.64.12-next.281`),oh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=jn(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=jn(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 oh,sh=__esmMin(()=>{Ud(),zn(),Xn(),ah()}),ch,lh=__esmMin(()=>{ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(uh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${uh.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&dh[t]===!0}var uh,dh,fh,ph=__esmMin(()=>{uh=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],dh={flathub:!0,web:!0,"microsoft-store":!1,"apple-app-store":!1},fh=`GJSIFY_CHANNEL`}),mh=__commonJSMin(((t,n)=>{let S=(zn(),__toCommonJS(wn)),C=(Vl(),__toCommonJS(Ll)),N=(Ud(),__toCommonJS(Vd)),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)})),hh=__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})),gh=__commonJSMin(((t,n)=>{let S=hh();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}}}})),vh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(Gl(),__toCommonJS(Hl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(zn(),__toCommonJS(wn)),H=mh(),W=gh();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)}})),yh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),bh=__commonJSMin(((t,n)=>{var S=(Au(),__toCommonJS(Eu)),C=yh(),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
149
|
`)},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(`
|
|
150
150
|
`)},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})),xh=__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=`
|
|
151
151
|
`,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{}}})),Sh=__commonJSMin((t=>{t.__esModule=!0,t.LinesAndColumns=void 0;var n=`
|
|
@@ -1094,7 +1094,7 @@ jobs:
|
|
|
1094
1094
|
`;if(n.length!==bB)throw Error(`gjsify ship: internal error — ar header is ${n.length} bytes, expected ${bB}.`);return encodeUtf8(n)}function pad(t,n){if(t.length>n)throw Error(`gjsify ship: ar header field "${t}" does not fit in ${n} bytes.`);return t.padEnd(n,` `)}var yB,bB,xB=__esmMin(()=>{vB(),yB=`!<arch>
|
|
1095
1095
|
`,bB=60});function warnAboutGjsFloor(t,n){return!TB[t]||compareVersions(n,`1.82.3`)<=0||compareVersions(n,`1.88.1`)===0?[]:[`gjsify ship: \`Depends: gjs (>= ${n})\` is not satisfiable on Debian stable — ${wB}. The package installs on forky/sid and on distributions with a newer GJS. Set \`gjsify.ship.minGjsVersion\` if this bundle genuinely runs on an older GJS; do NOT lower it to make apt happy, because the result is an install that succeeds and an app that does not start.`]}function warnAboutNodeFloor(t,n){return!DB[t]||compareVersions(n,`22`)<=0?[]:[`gjsify ship: \`Depends: nodejs (>= ${n})\` is not satisfiable on any current DEB stable/LTS — ${EB}. The package installs on forky/sid and on distributions with a newer Node. Set \`gjsify.ship.minNodeVersion\` if this bundle genuinely runs on an older Node; do NOT lower it to make apt happy, because the result is an install that succeeds and an app that dies on the first syntax or API the older interpreter does not have.`]}function compareVersions(t,n){let S=t.split(`.`).map(Number),C=n.split(`.`).map(Number);for(let t=0;t<Math.max(S.length,C.length);t++){let n=(S[t]??0)-(C[t]??0);if(n!==0)return n}return 0}function hostProvidedNamespaces(t,n=[]){let S=new Set;for(let t of n){let n=/([A-Za-z0-9]+)-([\d.]+)\.typelib$/.exec(t);n&&(S.add(`${n[1]}-${n[2]}`),S.add(n[1]))}return[...new Set(t)].sort().filter(t=>!kB.test(t)&&!S.has(t))}function deriveDepends(t,n){let S=n.interpreter===`node`?[`${SB[t]} >= ${n.minNodeVersion??`24`}`]:[`gjs >= ${n.minGjsVersion??`1.86`}`],C=[],N=new Set(n.optionalNamespaces??[]),F=[],I=[];for(let H of hostProvidedNamespaces(n.namespaces,n.bundledTypelibs)){let W=lookupTypelib(H,n.typelibPackages);if(W===void 0){(N.has(H)?I:F).push(H);continue}N.has(H)&&!S.includes(W[t])?C.push(W[t]):S.push(W[t])}if(F.length>0)throw Error(`gjsify ship: the bundle imports ${F.map(t=>`gi://${t.split(`-`)[0]}`).join(`, `)}, and no ${t} package is known to ship ${F.length>1?`those typelibs`:`that typelib`}. An undeclared runtime dependency does not fail here — it fails on a user's machine after the download. Fill the gap in package.json:
|
|
1096
1096
|
"gjsify": { "ship": { "typelibPackages": { ${JSON.stringify(F[0])}: { "deb": "gir1.2-…", "rpm": "…" } } } }
|
|
1097
|
-
and please contribute the mapping back to \`utils/ship/depends.ts\` so the next project does not have to. (\`gjsify.ship.depends.<format>\` is for dependencies that are not typelibs at all — it appends, and deliberately does not silence this.)`);return n.hasIcons&&S.push(`hicolor-icon-theme`),n.hasSchemas&&S.push(CB[t]),S.push(...n.extra),{requires:[...new Set(S)],recommends:[...new Set(C)].filter(t=>!S.includes(t)),unmappedOptional:I}}function lookupTypelib(t,n={}){let S={...OB,...n},C=S[t];if(C!==void 0)return C;if(t.includes(`-`))return;let N=Object.keys(S).filter(n=>n.startsWith(`${t}-`));if(N.length===1)return S[N[0]]}function parseDepend(t){let n=/^(\S+)\s*(>=|<=|=|>|<)\s*(\S+)$/.exec(t);return n?{name:n[1],relation:n[2],version:n[3]}:{name:t.trim()}}function formatDebDepend(t){let n=parseDepend(t);if(n.relation===void 0)return n.name;let S=n.relation===`>`?`>>`:n.relation===`<`?`<<`:n.relation;return`${n.name} (${S} ${n.version})`}var SB,CB,wB,TB,EB,DB,OB,kB,AB=__esmMin(()=>{SB={deb:`nodejs`,rpm:`nodejs(engine)`},CB={deb:`libglib2.0-bin`,rpm:`glib2`},wB=`trixie ships 1.82.3 and forky 1.88.1; 1.84 and 1.86 were skipped`,TB={deb:!0,rpm:!1},EB=`trixie ships 20, forky 24; Ubuntu 24.04 LTS ships 18 and 26.04 LTS 22`,DB={deb:!0,rpm:!1},OB={"GLib-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"GObject-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"Gio-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"GioUnix-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"GModule-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"Gtk-4.0":{deb:`gir1.2-gtk-4.0`,rpm:`gtk4`},"Gdk-4.0":{deb:`gir1.2-gtk-4.0`,rpm:`gtk4`},"Gsk-4.0":{deb:`gir1.2-gtk-4.0`,rpm:`gtk4`},"Adw-1":{deb:`gir1.2-adw-1`,rpm:`libadwaita`},"GdkPixbuf-2.0":{deb:`gir1.2-gdkpixbuf-2.0`,rpm:`gdk-pixbuf2`},"Pango-1.0":{deb:`gir1.2-pango-1.0`,rpm:`pango`},"PangoCairo-1.0":{deb:`gir1.2-pango-1.0`,rpm:`pango`},"Graphene-1.0":{deb:`gir1.2-graphene-1.0`,rpm:`graphene`},"cairo-1.0":{deb:`gir1.2-freedesktop`,rpm:`gobject-introspection`},"GtkSource-5":{deb:`gir1.2-gtksource-5`,rpm:`gtksourceview5`},"WebKit-6.0":{deb:`gir1.2-webkit-6.0`,rpm:`webkitgtk6.0`},"Soup-3.0":{deb:`gir1.2-soup-3.0`,rpm:`libsoup3`},"Json-1.0":{deb:`gir1.2-json-1.0`,rpm:`json-glib`},"Gst-1.0":{deb:`gir1.2-gstreamer-1.0`,rpm:`gstreamer1`},"Secret-1":{deb:`gir1.2-secret-1`,rpm:`libsecret`},"Notify-0.7":{deb:`gir1.2-notify-0.7`,rpm:`libnotify`},"Vte-3.91":{deb:`gir1.2-vte-3.91`,rpm:`vte291-gtk4`},"Manette-0.2":{deb:`gir1.2-manette-0.2`,rpm:`libmanette`}
|
|
1097
|
+
and please contribute the mapping back to \`utils/ship/depends.ts\` so the next project does not have to. (\`gjsify.ship.depends.<format>\` is for dependencies that are not typelibs at all — it appends, and deliberately does not silence this.)`);return n.hasIcons&&S.push(`hicolor-icon-theme`),n.hasSchemas&&S.push(CB[t]),S.push(...n.extra),{requires:[...new Set(S)],recommends:[...new Set(C)].filter(t=>!S.includes(t)),unmappedOptional:I}}function lookupTypelib(t,n={}){let S={...OB,...n},C=S[t];if(C!==void 0)return C;if(t.includes(`-`))return;let N=Object.keys(S).filter(n=>n.startsWith(`${t}-`));if(N.length===1)return S[N[0]]}function parseDepend(t){let n=/^(\S+)\s*(>=|<=|=|>|<)\s*(\S+)$/.exec(t);return n?{name:n[1],relation:n[2],version:n[3]}:{name:t.trim()}}function formatDebDepend(t){let n=parseDepend(t);if(n.relation===void 0)return n.name;let S=n.relation===`>`?`>>`:n.relation===`<`?`<<`:n.relation;return`${n.name} (${S} ${n.version})`}var SB,CB,wB,TB,EB,DB,OB,kB,AB=__esmMin(()=>{SB={deb:`nodejs`,rpm:`nodejs(engine)`},CB={deb:`libglib2.0-bin`,rpm:`glib2`},wB=`trixie ships 1.82.3 and forky 1.88.1; 1.84 and 1.86 were skipped`,TB={deb:!0,rpm:!1},EB=`trixie ships 20, forky 24; Ubuntu 24.04 LTS ships 18 and 26.04 LTS 22`,DB={deb:!0,rpm:!1},OB={"GLib-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"GObject-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"Gio-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"GioUnix-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"GModule-2.0":{deb:`gir1.2-glib-2.0`,rpm:`glib2`},"Gtk-4.0":{deb:`gir1.2-gtk-4.0`,rpm:`gtk4`},"Gdk-4.0":{deb:`gir1.2-gtk-4.0`,rpm:`gtk4`},"Gsk-4.0":{deb:`gir1.2-gtk-4.0`,rpm:`gtk4`},"Adw-1":{deb:`gir1.2-adw-1`,rpm:`libadwaita`},"GdkPixbuf-2.0":{deb:`gir1.2-gdkpixbuf-2.0`,rpm:`gdk-pixbuf2`},"Pango-1.0":{deb:`gir1.2-pango-1.0`,rpm:`pango`},"PangoCairo-1.0":{deb:`gir1.2-pango-1.0`,rpm:`pango`},"Graphene-1.0":{deb:`gir1.2-graphene-1.0`,rpm:`graphene`},"cairo-1.0":{deb:`gir1.2-freedesktop`,rpm:`gobject-introspection`},"GtkSource-5":{deb:`gir1.2-gtksource-5`,rpm:`gtksourceview5`},"WebKit-6.0":{deb:`gir1.2-webkit-6.0`,rpm:`webkitgtk6.0`},"Soup-3.0":{deb:`gir1.2-soup-3.0`,rpm:`libsoup3`},"Json-1.0":{deb:`gir1.2-json-1.0`,rpm:`json-glib`},"Gst-1.0":{deb:`gir1.2-gstreamer-1.0`,rpm:`gstreamer1`},"Secret-1":{deb:`gir1.2-secret-1`,rpm:`libsecret`},"Notify-0.7":{deb:`gir1.2-notify-0.7`,rpm:`libnotify`},"Vte-3.91":{deb:`gir1.2-vte-3.91`,rpm:`vte291-gtk4`},"Manette-0.2":{deb:`gir1.2-manette-0.2`,rpm:`libmanette`}},kB=/^Gjsify[A-Z]/});async function gzipDeterministic(t,n){let S=await gzip(t,n===void 0?void 0:{level:n});if(S.byteLength<10||S[0]!==31||S[1]!==139)throw Error(`gjsify ship: internal error — gzip did not produce a gzip stream.`);return S[4]=0,S[5]=0,S[6]=0,S[7]=0,S[9]=3,S}var jB=__esmMin(()=>{TL()});function isUnder(t,n){return t.startsWith(`${n}/`)}var MB,NB=__esmMin(()=>{MB={applications:`share/applications`,icons:`share/icons/hicolor`,schemas:`share/glib-2.0/schemas`,mime:`share/mime/packages`,metainfo:`share/metainfo`,locale:`share/locale`,fonts:`share/fonts`}});function cacheRefreshCommands(t,n){let S=[];return t.hasDesktopEntry&&S.push({probe:`update-desktop-database`,run:`update-desktop-database -q ${n}/${MB.applications}`}),t.hasIcons&&S.push({probe:`gtk-update-icon-cache`,run:`gtk-update-icon-cache -q -t -f ${n}/${MB.icons}`}),t.hasMimeTypes&&S.push({probe:`update-mime-database`,run:`update-mime-database ${n}/share/mime`}),t.hasSchemas&&S.push({probe:`glib-compile-schemas`,run:`glib-compile-schemas ${n}/${MB.schemas}`}),S.map(({probe:t,run:n})=>`if command -v ${t} >/dev/null 2>&1; then ${n} || true; fi`)}function renderDebScripts(t,n){let S=cacheRefreshCommands(t,n);if(S.length===0)return{};let C=S.map(t=>` ${t}`).join(`
|
|
1098
1098
|
`);return{postinst:[`#!/bin/sh`,`set -e`,`if [ "$1" = "configure" ]; then`,C,`fi`,``].join(`
|
|
1099
1099
|
`),postrm:[`#!/bin/sh`,`set -e`,`if [ "$1" = "remove" ]; then`,C,`fi`,``].join(`
|
|
1100
1100
|
`)}}function renderRpmScriptlets(t,n){let S=cacheRefreshCommands(t,n);if(S.length===0)return{};let C=`${S.join(`
|
|
@@ -635,8 +635,8 @@ export interface ConfigDataShip extends AppMetadata {
|
|
|
635
635
|
* Additions for ONE package format — `deb` or `rpm` — on top of everything above.
|
|
636
636
|
*
|
|
637
637
|
* Exists for a library the distros disagree about: one that Fedora ships and Ubuntu does
|
|
638
|
-
* not
|
|
639
|
-
*
|
|
638
|
+
* not, where the `.rpm` should use the system copy and only the `.deb` needs to carry
|
|
639
|
+
* its own. `bundledTypelibs` and `extraFiles` are staged for every format of a
|
|
640
640
|
* layout, so there is no way to say "the `.deb` only" with them.
|
|
641
641
|
*
|
|
642
642
|
* What a format carries here is read back off its package like any other staged file, so a
|
|
@@ -232,12 +232,6 @@ const TYPELIB_PACKAGES = {
|
|
|
232
232
|
'Notify-0.7': { deb: 'gir1.2-notify-0.7', rpm: 'libnotify' },
|
|
233
233
|
'Vte-3.91': { deb: 'gir1.2-vte-3.91', rpm: 'vte291-gtk4' },
|
|
234
234
|
'Manette-0.2': { deb: 'gir1.2-manette-0.2', rpm: 'libmanette' },
|
|
235
|
-
// libgda — what `@gjsify/sqlite` binds, so every project with a local database lands here.
|
|
236
|
-
// The rpm name is measured on this machine (`rpm -qf …/Gda-6.0.typelib` → libgda); the deb name
|
|
237
|
-
// follows the `gir1.2-<name>-<version>` convention every row above uses and is NOT verified
|
|
238
|
-
// against a Debian system. Said plainly because a wrong name fails at `apt install` with a
|
|
239
|
-
// clear error, while no row at all fails the BUILD of every such project.
|
|
240
|
-
'Gda-6.0': { deb: 'gir1.2-gda-6.0', rpm: 'libgda' },
|
|
241
235
|
};
|
|
242
236
|
/**
|
|
243
237
|
* A typelib the payload CARRIES, rather than one the system provides.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/cli",
|
|
3
|
-
"version": "0.64.12-next.
|
|
3
|
+
"version": "0.64.12-next.281",
|
|
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.12-next.
|
|
146
|
-
"@gjsify/buffer": "0.64.12-next.
|
|
147
|
-
"@gjsify/create-app": "0.64.12-next.
|
|
148
|
-
"@gjsify/node-globals": "0.64.12-next.
|
|
149
|
-
"@gjsify/node-polyfills": "0.64.12-next.
|
|
150
|
-
"@gjsify/npm-registry": "0.64.12-next.
|
|
151
|
-
"@gjsify/resolve-npm": "0.64.12-next.
|
|
152
|
-
"@gjsify/rolldown-plugin-gjsify": "0.64.12-next.
|
|
153
|
-
"@gjsify/vite-plugin-blueprint": "0.64.12-next.
|
|
154
|
-
"@gjsify/rolldown-plugin-pnp": "0.64.12-next.
|
|
155
|
-
"@gjsify/semver": "0.64.12-next.
|
|
156
|
-
"@gjsify/tar": "0.64.12-next.
|
|
157
|
-
"@gjsify/tsc": "0.64.12-next.
|
|
158
|
-
"@gjsify/utils": "0.64.12-next.
|
|
159
|
-
"@gjsify/web-polyfills": "0.64.12-next.
|
|
160
|
-
"@gjsify/workspace": "0.64.12-next.
|
|
145
|
+
"@gjsify/blueprint": "0.64.12-next.281",
|
|
146
|
+
"@gjsify/buffer": "0.64.12-next.281",
|
|
147
|
+
"@gjsify/create-app": "0.64.12-next.281",
|
|
148
|
+
"@gjsify/node-globals": "0.64.12-next.281",
|
|
149
|
+
"@gjsify/node-polyfills": "0.64.12-next.281",
|
|
150
|
+
"@gjsify/npm-registry": "0.64.12-next.281",
|
|
151
|
+
"@gjsify/resolve-npm": "0.64.12-next.281",
|
|
152
|
+
"@gjsify/rolldown-plugin-gjsify": "0.64.12-next.281",
|
|
153
|
+
"@gjsify/vite-plugin-blueprint": "0.64.12-next.281",
|
|
154
|
+
"@gjsify/rolldown-plugin-pnp": "0.64.12-next.281",
|
|
155
|
+
"@gjsify/semver": "0.64.12-next.281",
|
|
156
|
+
"@gjsify/tar": "0.64.12-next.281",
|
|
157
|
+
"@gjsify/tsc": "0.64.12-next.281",
|
|
158
|
+
"@gjsify/utils": "0.64.12-next.281",
|
|
159
|
+
"@gjsify/web-polyfills": "0.64.12-next.281",
|
|
160
|
+
"@gjsify/workspace": "0.64.12-next.281",
|
|
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.12-next.
|
|
169
|
+
"@gjsify/unit": "0.64.12-next.281",
|
|
170
170
|
"@types/yargs": "^17.0.35",
|
|
171
171
|
"typescript": "^6.0.3"
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
|
-
"@gjsify/oxfmt-native": "0.64.12-next.
|
|
175
|
-
"@gjsify/rolldown-native": "0.64.12-next.
|
|
174
|
+
"@gjsify/oxfmt-native": "0.64.12-next.281",
|
|
175
|
+
"@gjsify/rolldown-native": "0.64.12-next.281"
|
|
176
176
|
},
|
|
177
177
|
"peerDependenciesMeta": {
|
|
178
178
|
"@gjsify/oxfmt-native": {
|
|
@@ -192,5 +192,5 @@
|
|
|
192
192
|
"url": "https://github.com/gjsify/gjsify/issues"
|
|
193
193
|
},
|
|
194
194
|
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/cli#readme",
|
|
195
|
-
"gitHead": "
|
|
195
|
+
"gitHead": "c4d2e266c0d9849860b9828c14ebfe37b6d493b8"
|
|
196
196
|
}
|