hyperbook 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- (()=>{var t={6491:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},6325:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const c=10;const l=10;const u=o>c;const h=o===c&&a>=l;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},1659:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(4715);const a=i(8907);const c=i(3486);r.Settings=c.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},4715:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(3645);const a=i(5341);const c=i(6325);const l=i(946);const u=i(3253);function read(t,r,i){if(!r.stats&&c.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,c)=>{if(o!==null){callFailureCallback(i,o);return}const l=c.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,l);return}const h=l.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=l.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((c,h)=>{if(c!==null){callFailureCallback(i,c);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,c)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:l.fs.createDirentFromStats(i,c)};if(r.stats){u.stats=c}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},3253:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},8907:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(3645);const a=i(6325);const c=i(946);const l=i(3253);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:l.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=c.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=l.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:c.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},3486:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(3645);const c=i(6491);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=c.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},2926:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},946:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(2926);r.fs=o},2243:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},3645:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(6948);const a=i(6750);const c=i(9055);r.Settings=c.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},6948:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},6750:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},9055:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2243);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},4328:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(4306);const a=i(2686);const c=i(8918);const l=i(8831);r.Settings=l.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new c.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},4306:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1293);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2686:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(1293);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},8918:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9476);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},1293:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(1659);const c=i(4241);const l=i(1652);const u=i(8376);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=c(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!l.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=l.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(l.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&l.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},1652:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},8376:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1652);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},9476:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1659);const a=i(1652);const c=i(8376);class SyncReader extends c.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},8831:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(1659);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},8950:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(t){return i.includes(t)}const o=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...i];function isObjectTypeName(t){return o.includes(t)}const a=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(t){return a.includes(t)}function isOfType(t){return r=>typeof r===t}const{toString:c}=Object.prototype;const getObjectType=t=>{const r=c.call(t).slice(8,-1);if(/HTML\w+Element/.test(r)&&is.domElement(t)){return"HTMLElement"}if(isObjectTypeName(r)){return r}return undefined};const isObjectOfType=t=>r=>getObjectType(r)===t;function is(t){if(t===null){return"null"}switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(t)){return"Observable"}if(is.array(t)){return"Array"}if(is.buffer(t)){return"Buffer"}const r=getObjectType(t);if(r){return r}if(t instanceof String||t instanceof Boolean||t instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const l=isOfType("number");is.number=t=>l(t)&&!is.nan(t);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=t=>t===null;is.class_=t=>is.function_(t)&&t.toString().startsWith("class ");is.boolean=t=>t===true||t===false;is.symbol=isOfType("symbol");is.numericString=t=>is.string(t)&&!is.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));is.array=(t,r)=>{if(!Array.isArray(t)){return false}if(!is.function_(r)){return true}return t.every(r)};is.buffer=t=>{var r,i,o,a;return(a=(o=(i=(r=t)===null||r===void 0?void 0:r.constructor)===null||i===void 0?void 0:i.isBuffer)===null||o===void 0?void 0:o.call(i,t))!==null&&a!==void 0?a:false};is.blob=t=>isObjectOfType("Blob")(t);is.nullOrUndefined=t=>is.null_(t)||is.undefined(t);is.object=t=>!is.null_(t)&&(typeof t==="object"||is.function_(t));is.iterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.iterator])};is.asyncIterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.asyncIterator])};is.generator=t=>{var r,i;return is.iterable(t)&&is.function_((r=t)===null||r===void 0?void 0:r.next)&&is.function_((i=t)===null||i===void 0?void 0:i.throw)};is.asyncGenerator=t=>is.asyncIterable(t)&&is.function_(t.next)&&is.function_(t.throw);is.nativePromise=t=>isObjectOfType("Promise")(t);const hasPromiseAPI=t=>{var r,i;return is.function_((r=t)===null||r===void 0?void 0:r.then)&&is.function_((i=t)===null||i===void 0?void 0:i.catch)};is.promise=t=>is.nativePromise(t)||hasPromiseAPI(t);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=t=>getObjectType(t)==="AsyncGeneratorFunction";is.asyncFunction=t=>getObjectType(t)==="AsyncFunction";is.boundFunction=t=>is.function_(t)&&!t.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=t=>isObjectOfType("Map")(t);is.set=t=>isObjectOfType("Set")(t);is.weakMap=t=>isObjectOfType("WeakMap")(t);is.weakSet=t=>isObjectOfType("WeakSet")(t);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(t,r)=>Object.values(r).includes(t);is.directInstanceOf=(t,r)=>Object.getPrototypeOf(t)===r.prototype;is.urlInstance=t=>isObjectOfType("URL")(t);is.urlString=t=>{if(!is.string(t)){return false}try{new URL(t);return true}catch(t){return false}};is.truthy=t=>Boolean(t);is.falsy=t=>!t;is.nan=t=>Number.isNaN(t);is.primitive=t=>is.null_(t)||isPrimitiveTypeName(typeof t);is.integer=t=>Number.isInteger(t);is.safeInteger=t=>Number.isSafeInteger(t);is.plainObject=t=>{if(c.call(t)!=="[object Object]"){return false}const r=Object.getPrototypeOf(t);return r===null||r===Object.getPrototypeOf({})};is.typedArray=t=>isTypedArrayName(getObjectType(t));const isValidLength=t=>is.safeInteger(t)&&t>=0;is.arrayLike=t=>!is.nullOrUndefined(t)&&!is.function_(t)&&isValidLength(t.length);is.inRange=(t,r)=>{if(is.number(r)){return t>=Math.min(0,r)&&t<=Math.max(r,0)}if(is.array(r)&&r.length===2){return t>=Math.min(...r)&&t<=Math.max(...r)}throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};const u=1;const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=t=>is.object(t)&&t.nodeType===u&&is.string(t.nodeName)&&!is.plainObject(t)&&h.every((r=>r in t));is.observable=t=>{var r,i,o,a;if(!t){return false}if(t===((i=(r=t)[Symbol.observable])===null||i===void 0?void 0:i.call(r))){return true}if(t===((a=(o=t)["@@observable"])===null||a===void 0?void 0:a.call(o))){return true}return false};is.nodeStream=t=>is.object(t)&&is.function_(t.pipe)&&!is.observable(t);is.infinite=t=>t===Infinity||t===-Infinity;const isAbsoluteMod2=t=>r=>is.integer(r)&&Math.abs(r%2)===t;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=t=>is.array(t)&&t.length===0;is.nonEmptyArray=t=>is.array(t)&&t.length>0;is.emptyString=t=>is.string(t)&&t.length===0;const isWhiteSpaceString=t=>is.string(t)&&!/\S/.test(t);is.emptyStringOrWhitespace=t=>is.emptyString(t)||isWhiteSpaceString(t);is.nonEmptyString=t=>is.string(t)&&t.length>0;is.nonEmptyStringAndNotWhitespace=t=>is.string(t)&&!is.emptyStringOrWhitespace(t);is.emptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length===0;is.nonEmptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length>0;is.emptySet=t=>is.set(t)&&t.size===0;is.nonEmptySet=t=>is.set(t)&&t.size>0;is.emptyMap=t=>is.map(t)&&t.size===0;is.nonEmptyMap=t=>is.map(t)&&t.size>0;is.propertyKey=t=>is.any([is.string,is.number,is.symbol],t);is.formData=t=>isObjectOfType("FormData")(t);is.urlSearchParams=t=>isObjectOfType("URLSearchParams")(t);const predicateOnArray=(t,r,i)=>{if(!is.function_(r)){throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`)}if(i.length===0){throw new TypeError("Invalid number of values")}return t.call(i,r)};is.any=(t,...r)=>{const i=is.array(t)?t:[t];return i.some((t=>predicateOnArray(Array.prototype.some,t,r)))};is.all=(t,...r)=>predicateOnArray(Array.prototype.every,t,r);const assertType=(t,r,i,o={})=>{if(!t){const{multipleValues:t}=o;const a=t?`received values of types ${[...new Set(i.map((t=>`\`${is(t)}\``)))].join(", ")}`:`received value of type \`${is(i)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${a}.`)}};r.assert={undefined:t=>assertType(is.undefined(t),"undefined",t),string:t=>assertType(is.string(t),"string",t),number:t=>assertType(is.number(t),"number",t),bigint:t=>assertType(is.bigint(t),"bigint",t),function_:t=>assertType(is.function_(t),"Function",t),null_:t=>assertType(is.null_(t),"null",t),class_:t=>assertType(is.class_(t),"Class",t),boolean:t=>assertType(is.boolean(t),"boolean",t),symbol:t=>assertType(is.symbol(t),"symbol",t),numericString:t=>assertType(is.numericString(t),"string with a number",t),array:(t,r)=>{const i=assertType;i(is.array(t),"Array",t);if(r){t.forEach(r)}},buffer:t=>assertType(is.buffer(t),"Buffer",t),blob:t=>assertType(is.blob(t),"Blob",t),nullOrUndefined:t=>assertType(is.nullOrUndefined(t),"null or undefined",t),object:t=>assertType(is.object(t),"Object",t),iterable:t=>assertType(is.iterable(t),"Iterable",t),asyncIterable:t=>assertType(is.asyncIterable(t),"AsyncIterable",t),generator:t=>assertType(is.generator(t),"Generator",t),asyncGenerator:t=>assertType(is.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>assertType(is.nativePromise(t),"native Promise",t),promise:t=>assertType(is.promise(t),"Promise",t),generatorFunction:t=>assertType(is.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>assertType(is.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>assertType(is.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>assertType(is.boundFunction(t),"Function",t),regExp:t=>assertType(is.regExp(t),"RegExp",t),date:t=>assertType(is.date(t),"Date",t),error:t=>assertType(is.error(t),"Error",t),map:t=>assertType(is.map(t),"Map",t),set:t=>assertType(is.set(t),"Set",t),weakMap:t=>assertType(is.weakMap(t),"WeakMap",t),weakSet:t=>assertType(is.weakSet(t),"WeakSet",t),int8Array:t=>assertType(is.int8Array(t),"Int8Array",t),uint8Array:t=>assertType(is.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>assertType(is.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>assertType(is.int16Array(t),"Int16Array",t),uint16Array:t=>assertType(is.uint16Array(t),"Uint16Array",t),int32Array:t=>assertType(is.int32Array(t),"Int32Array",t),uint32Array:t=>assertType(is.uint32Array(t),"Uint32Array",t),float32Array:t=>assertType(is.float32Array(t),"Float32Array",t),float64Array:t=>assertType(is.float64Array(t),"Float64Array",t),bigInt64Array:t=>assertType(is.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>assertType(is.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>assertType(is.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>assertType(is.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>assertType(is.dataView(t),"DataView",t),enumCase:(t,r)=>assertType(is.enumCase(t,r),"EnumCase",t),urlInstance:t=>assertType(is.urlInstance(t),"URL",t),urlString:t=>assertType(is.urlString(t),"string with a URL",t),truthy:t=>assertType(is.truthy(t),"truthy",t),falsy:t=>assertType(is.falsy(t),"falsy",t),nan:t=>assertType(is.nan(t),"NaN",t),primitive:t=>assertType(is.primitive(t),"primitive",t),integer:t=>assertType(is.integer(t),"integer",t),safeInteger:t=>assertType(is.safeInteger(t),"integer",t),plainObject:t=>assertType(is.plainObject(t),"plain object",t),typedArray:t=>assertType(is.typedArray(t),"TypedArray",t),arrayLike:t=>assertType(is.arrayLike(t),"array-like",t),domElement:t=>assertType(is.domElement(t),"HTMLElement",t),observable:t=>assertType(is.observable(t),"Observable",t),nodeStream:t=>assertType(is.nodeStream(t),"Node.js Stream",t),infinite:t=>assertType(is.infinite(t),"infinite number",t),emptyArray:t=>assertType(is.emptyArray(t),"empty array",t),nonEmptyArray:t=>assertType(is.nonEmptyArray(t),"non-empty array",t),emptyString:t=>assertType(is.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>assertType(is.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>assertType(is.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>assertType(is.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>assertType(is.emptyObject(t),"empty object",t),nonEmptyObject:t=>assertType(is.nonEmptyObject(t),"non-empty object",t),emptySet:t=>assertType(is.emptySet(t),"empty set",t),nonEmptySet:t=>assertType(is.nonEmptySet(t),"non-empty set",t),emptyMap:t=>assertType(is.emptyMap(t),"empty map",t),nonEmptyMap:t=>assertType(is.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>assertType(is.propertyKey(t),"PropertyKey",t),formData:t=>assertType(is.formData(t),"FormData",t),urlSearchParams:t=>assertType(is.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>assertType(is.evenInteger(t),"even integer",t),oddInteger:t=>assertType(is.oddInteger(t),"odd integer",t),directInstanceOf:(t,r)=>assertType(is.directInstanceOf(t,r),"T",t),inRange:(t,r)=>assertType(is.inRange(t,r),"in range",t),any:(t,...r)=>assertType(is.any(t,...r),"predicate returns truthy for any value",r,{multipleValues:true}),all:(t,...r)=>assertType(is.all(t,...r),"predicate returns truthy for all values",r,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(r.assert,{class:{value:r.assert.class_},function:{value:r.assert.function_},null:{value:r.assert.null_}});r["default"]=is;t.exports=is;t.exports["default"]=is;t.exports.assert=r.assert},1176:(t,r,i)=>{var o=i(2012);function retry(t,r){function run(i,a){var c=r||{};var l;if(!("randomize"in c)){c.randomize=true}l=o.operation(c);function bail(t){a(t||new Error("Aborted"))}function onError(t,r){if(t.bail){bail(t);return}if(!l.retry(t)){a(l.mainError())}else if(c.onRetry){c.onRetry(t,r)}}function runAttempt(r){var o;try{o=t(bail,r)}catch(t){onError(t,r);return}Promise.resolve(o).then(i).catch((function catchIt(t){onError(t,r)}))}l.attempt(runAttempt)}return new Promise(run)}t.exports=retry},155:t=>{"use strict";t.exports=balanced;function balanced(t,r,i){if(t instanceof RegExp)t=maybeMatch(t,i);if(r instanceof RegExp)r=maybeMatch(r,i);var o=range(t,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+t.length,o[1]),post:i.slice(o[1]+r.length)}}function maybeMatch(t,r){var i=r.match(t);return i?i[0]:null}balanced.range=range;function range(t,r,i){var o,a,c,l,u;var h=i.indexOf(t);var d=i.indexOf(r,h+1);var p=h;if(h>=0&&d>0){if(t===r){return[h,d]}o=[];c=i.length;while(p>=0&&!u){if(p==h){o.push(p);h=i.indexOf(t,p+1)}else if(o.length==1){u=[o.pop(),d]}else{a=o.pop();if(a<c){c=a;l=d}d=i.indexOf(r,p+1)}p=h<d&&h>=0?h:d}if(o.length){u=[c,l]}}return u}},7847:(t,r,i)=>{var o=i(1062);var a=i(155);t.exports=expandTop;var c="\0SLASH"+Math.random()+"\0";var l="\0OPEN"+Math.random()+"\0";var u="\0CLOSE"+Math.random()+"\0";var h="\0COMMA"+Math.random()+"\0";var d="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(c).split("\\{").join(l).split("\\}").join(u).split("\\,").join(h).split("\\.").join(d)}function unescapeBraces(t){return t.split(c).join("\\").split(l).join("{").split(u).join("}").split(h).join(",").split(d).join(".")}function parseCommaParts(t){if(!t)return[""];var r=[];var i=a("{","}",t);if(!i)return t.split(",");var o=i.pre;var c=i.body;var l=i.post;var u=o.split(",");u[u.length-1]+="{"+c+"}";var h=parseCommaParts(l);if(l.length){u[u.length-1]+=h.shift();u.push.apply(u,h)}r.push.apply(r,u);return r}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function identity(t){return t}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,r){return t<=r}function gte(t,r){return t>=r}function expand(t,r){var i=[];var c=a("{","}",t);if(!c||/\$$/.test(c.pre))return[t];var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body);var h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body);var d=l||h;var p=c.body.indexOf(",")>=0;if(!d&&!p){if(c.post.match(/,.*\}/)){t=c.pre+"{"+c.body+u+c.post;return expand(t)}return[t]}var m;if(d){m=c.body.split(/\.\./)}else{m=parseCommaParts(c.body);if(m.length===1){m=expand(m[0],false).map(embrace);if(m.length===1){var g=c.post.length?expand(c.post,false):[""];return g.map((function(t){return c.pre+m[0]+t}))}}}var y=c.pre;var g=c.post.length?expand(c.post,false):[""];var b;if(d){var v=numeric(m[0]);var _=numeric(m[1]);var w=Math.max(m[0].length,m[1].length);var E=m.length==3?Math.abs(numeric(m[2])):1;var S=lte;var O=_<v;if(O){E*=-1;S=gte}var R=m.some(isPadded);b=[];for(var x=v;S(x,_);x+=E){var A;if(h){A=String.fromCharCode(x);if(A==="\\")A=""}else{A=String(x);if(R){var T=w-A.length;if(T>0){var k=new Array(T+1).join("0");if(x<0)A="-"+k+A.slice(1);else A=k+A}}}b.push(A)}}else{b=o(m,(function(t){return expand(t,false)}))}for(var C=0;C<b.length;C++){for(var P=0;P<g.length;P++){var I=y+b[C]+g[P];if(!r||d||I)i.push(I)}}return i}},1570:(t,r,i)=>{"use strict";const o=i(3625);const a=i(4666);const c=i(6183);const l=i(2467);const braces=(t,r={})=>{let i=[];if(Array.isArray(t)){for(let o of t){let t=braces.create(o,r);if(Array.isArray(t)){i.push(...t)}else{i.push(t)}}}else{i=[].concat(braces.create(t,r))}if(r&&r.expand===true&&r.nodupes===true){i=[...new Set(i)]}return i};braces.parse=(t,r={})=>l(t,r);braces.stringify=(t,r={})=>{if(typeof t==="string"){return o(braces.parse(t,r),r)}return o(t,r)};braces.compile=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}return a(t,r)};braces.expand=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}let i=c(t,r);if(r.noempty===true){i=i.filter(Boolean)}if(r.nodupes===true){i=[...new Set(i)]}return i};braces.create=(t,r={})=>{if(t===""||t.length<3){return[t]}return r.expand!==true?braces.compile(t,r):braces.expand(t,r)};t.exports=braces},4666:(t,r,i)=>{"use strict";const o=i(442);const a=i(2456);const compile=(t,r={})=>{let walk=(t,i={})=>{let c=a.isInvalidBrace(i);let l=t.invalid===true&&r.escapeInvalid===true;let u=c===true||l===true;let h=r.escapeInvalid===true?"\\":"";let d="";if(t.isOpen===true){return h+t.value}if(t.isClose===true){return h+t.value}if(t.type==="open"){return u?h+t.value:"("}if(t.type==="close"){return u?h+t.value:")"}if(t.type==="comma"){return t.prev.type==="comma"?"":u?t.value:"|"}if(t.value){return t.value}if(t.nodes&&t.ranges>0){let i=a.reduce(t.nodes);let c=o(...i,{...r,wrap:false,toRegex:true});if(c.length!==0){return i.length>1&&c.length>1?`(${c})`:c}}if(t.nodes){for(let r of t.nodes){d+=walk(r,t)}}return d};return walk(t)};t.exports=compile},487:t=>{"use strict";t.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},6183:(t,r,i)=>{"use strict";const o=i(442);const a=i(3625);const c=i(2456);const append=(t="",r="",i=false)=>{let o=[];t=[].concat(t);r=[].concat(r);if(!r.length)return t;if(!t.length){return i?c.flatten(r).map((t=>`{${t}}`)):r}for(let a of t){if(Array.isArray(a)){for(let t of a){o.push(append(t,r,i))}}else{for(let t of r){if(i===true&&typeof t==="string")t=`{${t}}`;o.push(Array.isArray(t)?append(a,t,i):a+t)}}}return c.flatten(o)};const expand=(t,r={})=>{let i=r.rangeLimit===void 0?1e3:r.rangeLimit;let walk=(t,l={})=>{t.queue=[];let u=l;let h=l.queue;while(u.type!=="brace"&&u.type!=="root"&&u.parent){u=u.parent;h=u.queue}if(t.invalid||t.dollar){h.push(append(h.pop(),a(t,r)));return}if(t.type==="brace"&&t.invalid!==true&&t.nodes.length===2){h.push(append(h.pop(),["{}"]));return}if(t.nodes&&t.ranges>0){let l=c.reduce(t.nodes);if(c.exceedsLimit(...l,r.step,i)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let u=o(...l,r);if(u.length===0){u=a(t,r)}h.push(append(h.pop(),u));t.nodes=[];return}let d=c.encloseBrace(t);let p=t.queue;let m=t;while(m.type!=="brace"&&m.type!=="root"&&m.parent){m=m.parent;p=m.queue}for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r];if(i.type==="comma"&&t.type==="brace"){if(r===1)p.push("");p.push("");continue}if(i.type==="close"){h.push(append(h.pop(),p,d));continue}if(i.value&&i.type!=="open"){p.push(append(p.pop(),i.value));continue}if(i.nodes){walk(i,t)}}return p};return c.flatten(walk(t))};t.exports=expand},2467:(t,r,i)=>{"use strict";const o=i(3625);const{MAX_LENGTH:a,CHAR_BACKSLASH:c,CHAR_BACKTICK:l,CHAR_COMMA:u,CHAR_DOT:h,CHAR_LEFT_PARENTHESES:d,CHAR_RIGHT_PARENTHESES:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_RIGHT_SQUARE_BRACKET:b,CHAR_DOUBLE_QUOTE:v,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:w,CHAR_ZERO_WIDTH_NOBREAK_SPACE:E}=i(487);const parse=(t,r={})=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}let i=r||{};let S=typeof i.maxLength==="number"?Math.min(a,i.maxLength):a;if(t.length>S){throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${S})`)}let O={type:"root",input:t,nodes:[]};let R=[O];let x=O;let A=O;let T=0;let k=t.length;let C=0;let P=0;let I;let L={};const advance=()=>t[C++];const push=t=>{if(t.type==="text"&&A.type==="dot"){A.type="text"}if(A&&A.type==="text"&&t.type==="text"){A.value+=t.value;return}x.nodes.push(t);t.parent=x;t.prev=A;A=t;return t};push({type:"bos"});while(C<k){x=R[R.length-1];I=advance();if(I===E||I===w){continue}if(I===c){push({type:"text",value:(r.keepEscaping?I:"")+advance()});continue}if(I===b){push({type:"text",value:"\\"+I});continue}if(I===y){T++;let t=true;let r;while(C<k&&(r=advance())){I+=r;if(r===y){T++;continue}if(r===c){I+=advance();continue}if(r===b){T--;if(T===0){break}}}push({type:"text",value:I});continue}if(I===d){x=push({type:"paren",nodes:[]});R.push(x);push({type:"text",value:I});continue}if(I===p){if(x.type!=="paren"){push({type:"text",value:I});continue}x=R.pop();push({type:"text",value:I});x=R[R.length-1];continue}if(I===v||I===_||I===l){let t=I;let i;if(r.keepQuotes!==true){I=""}while(C<k&&(i=advance())){if(i===c){I+=i+advance();continue}if(i===t){if(r.keepQuotes===true)I+=i;break}I+=i}push({type:"text",value:I});continue}if(I===m){P++;let t=A.value&&A.value.slice(-1)==="$"||x.dollar===true;let r={type:"brace",open:true,close:false,dollar:t,depth:P,commas:0,ranges:0,nodes:[]};x=push(r);R.push(x);push({type:"open",value:I});continue}if(I===g){if(x.type!=="brace"){push({type:"text",value:I});continue}let t="close";x=R.pop();x.close=true;push({type:t,value:I});P--;x=R[R.length-1];continue}if(I===u&&P>0){if(x.ranges>0){x.ranges=0;let t=x.nodes.shift();x.nodes=[t,{type:"text",value:o(x)}]}push({type:"comma",value:I});x.commas++;continue}if(I===h&&P>0&&x.commas===0){let t=x.nodes;if(P===0||t.length===0){push({type:"text",value:I});continue}if(A.type==="dot"){x.range=[];A.value+=I;A.type="range";if(x.nodes.length!==3&&x.nodes.length!==5){x.invalid=true;x.ranges=0;A.type="text";continue}x.ranges++;x.args=[];continue}if(A.type==="range"){t.pop();let r=t[t.length-1];r.value+=A.value+I;A=r;x.ranges--;continue}push({type:"dot",value:I});continue}push({type:"text",value:I})}do{x=R.pop();if(x.type!=="root"){x.nodes.forEach((t=>{if(!t.nodes){if(t.type==="open")t.isOpen=true;if(t.type==="close")t.isClose=true;if(!t.nodes)t.type="text";t.invalid=true}}));let t=R[R.length-1];let r=t.nodes.indexOf(x);t.nodes.splice(r,1,...x.nodes)}}while(R.length>0);push({type:"eos"});return O};t.exports=parse},3625:(t,r,i)=>{"use strict";const o=i(2456);t.exports=(t,r={})=>{let stringify=(t,i={})=>{let a=r.escapeInvalid&&o.isInvalidBrace(i);let c=t.invalid===true&&r.escapeInvalid===true;let l="";if(t.value){if((a||c)&&o.isOpenOrClose(t)){return"\\"+t.value}return t.value}if(t.value){return t.value}if(t.nodes){for(let r of t.nodes){l+=stringify(r)}}return l};return stringify(t)}},2456:(t,r)=>{"use strict";r.isInteger=t=>{if(typeof t==="number"){return Number.isInteger(t)}if(typeof t==="string"&&t.trim()!==""){return Number.isInteger(Number(t))}return false};r.find=(t,r)=>t.nodes.find((t=>t.type===r));r.exceedsLimit=(t,i,o=1,a)=>{if(a===false)return false;if(!r.isInteger(t)||!r.isInteger(i))return false;return(Number(i)-Number(t))/Number(o)>=a};r.escapeNode=(t,r=0,i)=>{let o=t.nodes[r];if(!o)return;if(i&&o.type===i||o.type==="open"||o.type==="close"){if(o.escaped!==true){o.value="\\"+o.value;o.escaped=true}}};r.encloseBrace=t=>{if(t.type!=="brace")return false;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}return false};r.isInvalidBrace=t=>{if(t.type!=="brace")return false;if(t.invalid===true||t.dollar)return true;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}if(t.open!==true||t.close!==true){t.invalid=true;return true}return false};r.isOpenOrClose=t=>{if(t.type==="open"||t.type==="close"){return true}return t.open===true||t.close===true};r.reduce=t=>t.reduce(((t,r)=>{if(r.type==="text")t.push(r.value);if(r.type==="range")r.type="text";return t}),[]);r.flatten=(...t)=>{const r=[];const flat=t=>{for(let i=0;i<t.length;i++){let o=t[i];Array.isArray(o)?flat(o,r):o!==void 0&&r.push(o)}return r};flat(t);return r}},9201:(t,r,i)=>{"use strict";const{V4MAPPED:o,ADDRCONFIG:a,ALL:c,promises:{Resolver:l},lookup:u}=i(9523);const{promisify:h}=i(3837);const d=i(2037);const p=Symbol("cacheableLookupCreateConnection");const m=Symbol("cacheableLookupInstance");const g=Symbol("expires");const y=typeof c==="number";const verifyAgent=t=>{if(!(t&&typeof t.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=t=>{for(const r of t){if(r.family===6){continue}r.address=`::ffff:${r.address}`;r.family=6}};const getIfaceInfo=()=>{let t=false;let r=false;for(const i of Object.values(d.networkInterfaces())){for(const o of i){if(o.internal){continue}if(o.family==="IPv6"){r=true}else{t=true}if(t&&r){return{has4:t,has6:r}}}}return{has4:t,has6:r}};const isIterable=t=>Symbol.iterator in t;const ignoreNoResultErrors=t=>t.catch((t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT"){return[]}throw t}));const b={ttl:true};const v={all:true};const _={all:true,family:4};const w={all:true,family:6};class CacheableLookup{constructor({cache:t=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:o=.15,resolver:a=new l,lookup:c=u}={}){this.maxTtl=r;this.errorTtl=o;this._cache=t;this._resolver=a;this._dnsLookup=c&&h(c);if(this._resolver instanceof l){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=h(this._resolver.resolve4.bind(this._resolver));this._resolve6=h(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=i;if(i>0){const t=setInterval((()=>{this._hostnamesToFallback.clear()}),i*1e3);if(t.unref){t.unref()}this._fallbackInterval=t}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(t){this.clear();this._resolver.setServers(t)}get servers(){return this._resolver.getServers()}lookup(t,r,i){if(typeof r==="function"){i=r;r={}}else if(typeof r==="number"){r={family:r}}if(!i){throw new Error("Callback must be a function.")}this.lookupAsync(t,r).then((t=>{if(r.all){i(null,t)}else{i(null,t.address,t.family,t.expires,t.ttl)}}),i)}async lookupAsync(t,r={}){if(typeof r==="number"){r={family:r}}let i=await this.query(t);if(r.family===6){const t=i.filter((t=>t.family===6));if(r.hints&o){if(y&&r.hints&c||t.length===0){map4to6(i)}else{i=t}}else{i=t}}else if(r.family===4){i=i.filter((t=>t.family===4))}if(r.hints&a){const{_iface:t}=this;i=i.filter((r=>r.family===6?t.has6:t.has4))}if(i.length===0){const r=new Error(`cacheableLookup ENOTFOUND ${t}`);r.code="ENOTFOUND";r.hostname=t;throw r}if(r.all){return i}return i[0]}async query(t){let r=await this._cache.get(t);if(!r){const i=this._pending[t];if(i){r=await i}else{const i=this.queryAndCache(t);this._pending[t]=i;try{r=await i}finally{delete this._pending[t]}}}r=r.map((t=>({...t})));return r}async _resolve(t){const[r,i]=await Promise.all([ignoreNoResultErrors(this._resolve4(t,b)),ignoreNoResultErrors(this._resolve6(t,b))]);let o=0;let a=0;let c=0;const l=Date.now();for(const t of r){t.family=4;t.expires=l+t.ttl*1e3;o=Math.max(o,t.ttl)}for(const t of i){t.family=6;t.expires=l+t.ttl*1e3;a=Math.max(a,t.ttl)}if(r.length>0){if(i.length>0){c=Math.min(o,a)}else{c=o}}else{c=a}return{entries:[...r,...i],cacheTtl:c}}async _lookup(t){try{const[r,i]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(t,_)),ignoreNoResultErrors(this._dnsLookup(t,w))]);return{entries:[...r,...i],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(t,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3;r[g]=Date.now()+i;try{await this._cache.set(t,r,i)}catch(t){this.lookupAsync=async()=>{const r=new Error("Cache Error. Please recreate the CacheableLookup instance.");r.cause=t;throw r}}if(isIterable(this._cache)){this._tick(i)}}}async queryAndCache(t){if(this._hostnamesToFallback.has(t)){return this._dnsLookup(t,v)}let r=await this._resolve(t);if(r.entries.length===0&&this._dnsLookup){r=await this._lookup(t);if(r.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(t)}}const i=r.entries.length===0?this.errorTtl:r.cacheTtl;await this._set(t,r.entries,i);return r.entries}_tick(t){const r=this._nextRemovalTime;if(!r||t<r){clearTimeout(this._removalTimeout);this._nextRemovalTime=t;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let t=Infinity;const r=Date.now();for(const[i,o]of this._cache){const a=o[g];if(r>=a){this._cache.delete(i)}else if(a<t){t=a}}if(t!==Infinity){this._tick(t-r)}}),t);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(t){verifyAgent(t);if(p in t){throw new Error("CacheableLookup has been already installed")}t[p]=t.createConnection;t[m]=this;t.createConnection=(r,i)=>{if(!("lookup"in r)){r.lookup=this.lookup}return t[p](r,i)}}uninstall(t){verifyAgent(t);if(t[p]){if(t[m]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}t.createConnection=t[p];delete t[p];delete t[m]}}updateInterfaceInfo(){const{_iface:t}=this;this._iface=getIfaceInfo();if(t.has4&&!this._iface.has4||t.has6&&!this._iface.has6){this._cache.clear()}}clear(t){if(t){this._cache.delete(t);return}this._cache.clear()}}t.exports=CacheableLookup;t.exports["default"]=CacheableLookup},3846:(t,r,i)=>{"use strict";const o=i(2361);const a=i(7310);const c=i(5521);const l=i(9580);const u=i(3485);const h=i(1762);const d=i(7976);const p=i(2812);const m=i(5326);class CacheableRequest{constructor(t,r){if(typeof t!=="function"){throw new TypeError("Parameter `request` must be a function")}this.cache=new m({uri:typeof r==="string"&&r,store:typeof r!=="string"&&r,namespace:"cacheable-request"});return this.createCacheableRequest(t)}createCacheableRequest(t){return(r,i)=>{let m;if(typeof r==="string"){m=normalizeUrlObject(a.parse(r));r={}}else if(r instanceof a.URL){m=normalizeUrlObject(a.parse(r.toString()));r={}}else{const[t,...i]=(r.path||"").split("?");const o=i.length>0?`?${i.join("?")}`:"";m=normalizeUrlObject({...r,pathname:t,search:o})}r={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...r,...urlObjectToRequestOptions(m)};r.headers=d(r.headers);const g=new o;const y=c(a.format(m),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});const b=`${r.method}:${y}`;let v=false;let _=false;const makeRequest=r=>{_=true;let o=false;let a;const c=new Promise((t=>{a=()=>{if(!o){o=true;t()}}}));const handler=t=>{if(v&&!r.forceRefresh){t.status=t.statusCode;const i=u.fromObject(v.cachePolicy).revalidatedPolicy(r,t);if(!i.modified){const r=i.policy.responseHeaders();t=new h(v.statusCode,r,v.body,v.url);t.cachePolicy=i.policy;t.fromCache=true}}if(!t.fromCache){t.cachePolicy=new u(r,t,r);t.fromCache=false}let a;if(r.cache&&t.cachePolicy.storable()){a=p(t);(async()=>{try{const i=l.buffer(t);await Promise.race([c,new Promise((r=>t.once("end",r)))]);if(o){return}const a=await i;const u={cachePolicy:t.cachePolicy.toObject(),url:t.url,statusCode:t.fromCache?v.statusCode:t.statusCode,body:a};let h=r.strictTtl?t.cachePolicy.timeToLive():undefined;if(r.maxTtl){h=h?Math.min(h,r.maxTtl):r.maxTtl}await this.cache.set(b,u,h)}catch(t){g.emit("error",new CacheableRequest.CacheError(t))}})()}else if(r.cache&&v){(async()=>{try{await this.cache.delete(b)}catch(t){g.emit("error",new CacheableRequest.CacheError(t))}})()}g.emit("response",a||t);if(typeof i==="function"){i(a||t)}};try{const i=t(r,handler);i.once("error",a);i.once("abort",a);g.emit("request",i)}catch(t){g.emit("error",new CacheableRequest.RequestError(t))}};(async()=>{const get=async t=>{await Promise.resolve();const r=t.cache?await this.cache.get(b):undefined;if(typeof r==="undefined"){return makeRequest(t)}const o=u.fromObject(r.cachePolicy);if(o.satisfiesWithoutRevalidation(t)&&!t.forceRefresh){const t=o.responseHeaders();const a=new h(r.statusCode,t,r.body,r.url);a.cachePolicy=o;a.fromCache=true;g.emit("response",a);if(typeof i==="function"){i(a)}}else{v=r;t.headers=o.revalidationHeaders(t);makeRequest(t)}};const errorHandler=t=>g.emit("error",new CacheableRequest.CacheError(t));this.cache.once("error",errorHandler);g.on("response",(()=>this.cache.removeListener("error",errorHandler)));try{await get(r)}catch(t){if(r.automaticFailover&&!_){makeRequest(r)}g.emit("error",new CacheableRequest.CacheError(t))}})();return g}}}function urlObjectToRequestOptions(t){const r={...t};r.path=`${t.pathname||"/"}${t.search||""}`;delete r.pathname;delete r.search;return r}function normalizeUrlObject(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}CacheableRequest.RequestError=class extends Error{constructor(t){super(t.message);this.name="RequestError";Object.assign(this,t)}};CacheableRequest.CacheError=class extends Error{constructor(t){super(t.message);this.name="CacheError";Object.assign(this,t)}};t.exports=CacheableRequest},1085:(t,r,i)=>{"use strict";const o=i(7147);const a=i(1017);const c=o.lchown?"lchown":"chown";const l=o.lchownSync?"lchownSync":"chownSync";const u=o.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(t,r,i)=>{try{return o[l](t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const chownSync=(t,r,i)=>{try{return o.chownSync(t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const h=u?(t,r,i,a)=>c=>{if(!c||c.code!=="EISDIR")a(c);else o.chown(t,r,i,a)}:(t,r,i,o)=>o;const d=u?(t,r,i)=>{try{return lchownSync(t,r,i)}catch(o){if(o.code!=="EISDIR")throw o;chownSync(t,r,i)}}:(t,r,i)=>lchownSync(t,r,i);const p=process.version;let readdir=(t,r,i)=>o.readdir(t,r,i);let readdirSync=(t,r)=>o.readdirSync(t,r);if(/^v4\./.test(p))readdir=(t,r,i)=>o.readdir(t,i);const chown=(t,r,i,a)=>{o[c](t,r,i,h(t,r,i,(t=>{a(t&&t.code!=="ENOENT"?t:null)})))};const chownrKid=(t,r,i,c,l)=>{if(typeof r==="string")return o.lstat(a.resolve(t,r),((o,a)=>{if(o)return l(o.code!=="ENOENT"?o:null);a.name=r;chownrKid(t,a,i,c,l)}));if(r.isDirectory()){chownr(a.resolve(t,r.name),i,c,(o=>{if(o)return l(o);const u=a.resolve(t,r.name);chown(u,i,c,l)}))}else{const o=a.resolve(t,r.name);chown(o,i,c,l)}};const chownr=(t,r,i,o)=>{readdir(t,{withFileTypes:true},((a,c)=>{if(a){if(a.code==="ENOENT")return o();else if(a.code!=="ENOTDIR"&&a.code!=="ENOTSUP")return o(a)}if(a||!c.length)return chown(t,r,i,o);let l=c.length;let u=null;const then=a=>{if(u)return;if(a)return o(u=a);if(--l===0)return chown(t,r,i,o)};c.forEach((o=>chownrKid(t,o,r,i,then)))}))};const chownrKidSync=(t,r,i,c)=>{if(typeof r==="string"){try{const i=o.lstatSync(a.resolve(t,r));i.name=r;r=i}catch(t){if(t.code==="ENOENT")return;else throw t}}if(r.isDirectory())chownrSync(a.resolve(t,r.name),i,c);d(a.resolve(t,r.name),i,c)};const chownrSync=(t,r,i)=>{let o;try{o=readdirSync(t,{withFileTypes:true})}catch(o){if(o.code==="ENOENT")return;else if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return d(t,r,i);else throw o}if(o&&o.length)o.forEach((o=>chownrKidSync(t,o,r,i)));return d(t,r,i)};t.exports=chownr;chownr.sync=chownrSync},2812:(t,r,i)=>{"use strict";const o=i(2781).PassThrough;const a=i(9958);const cloneResponse=t=>{if(!(t&&t.pipe)){throw new TypeError("Parameter `response` must be a response stream.")}const r=new o;a(t,r);return t.pipe(r)};t.exports=cloneResponse},1062:t=>{t.exports=function(t,i){var o=[];for(var a=0;a<t.length;a++){var c=i(t[a],a);if(r(c))o.push.apply(o,c);else o.push(c)}return o};var r=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}},7863:(t,r,i)=>{"use strict";const o=i(5842);class CpFileError extends o{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpFileError"}}t.exports=CpFileError},4404:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(6284);const c=i(8465);const l=i(2248);const u=i(7863);const h=o(a.stat);const d=o(a.lstat);const p=o(a.utimes);const m=o(a.chmod);r.closeSync=a.closeSync.bind(a);r.createWriteStream=a.createWriteStream.bind(a);r.createReadStream=async(t,r)=>{const i=a.createReadStream(t,r);try{await l(i,["readable","end"])}catch(r){throw new u(`Cannot read from \`${t}\`: ${r.message}`,r)}return i};r.stat=t=>h(t).catch((r=>{throw new u(`Cannot stat path \`${t}\`: ${r.message}`,r)}));r.lstat=t=>d(t).catch((r=>{throw new u(`lstat \`${t}\` failed: ${r.message}`,r)}));r.utimes=(t,r,i)=>p(t,r,i).catch((r=>{throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}));r.chmod=(t,r)=>m(t,r).catch((r=>{throw new u(`chmod \`${t}\` failed: ${r.message}`,r)}));r.statSync=t=>{try{return a.statSync(t)}catch(r){throw new u(`stat \`${t}\` failed: ${r.message}`,r)}};r.utimesSync=(t,r,i)=>{try{return a.utimesSync(t,r,i)}catch(r){throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}};r.makeDir=(t,r)=>c(t,{...r,fs:a}).catch((r=>{throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}));r.makeDirSync=(t,r)=>{try{c.sync(t,{...r,fs:a})}catch(r){throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}};r.copyFileSync=(t,r,i)=>{try{a.copyFileSync(t,r,i)}catch(i){throw new u(`Cannot copy from \`${t}\` to \`${r}\`: ${i.message}`,i)}}},654:(t,r,i)=>{"use strict";const o=i(1017);const{constants:a}=i(7147);const c=i(2248);const l=i(7863);const u=i(4404);const h=i(9537);const cpFileAsync=async(t,r,i,a)=>{let h;const d=await u.stat(t);a.size=d.size;const p=await u.createReadStream(t);await u.makeDir(o.dirname(r),{mode:i.directoryMode});const m=u.createWriteStream(r,{flags:i.overwrite?"w":"wx"});p.on("data",(()=>{a.writtenBytes=m.bytesWritten}));p.once("error",(r=>{h=new l(`Cannot read from \`${t}\`: ${r.message}`,r);m.end()}));let g=false;try{const t=c(m,"close");p.pipe(m);await t;a.writtenBytes=a.size;g=true}catch(t){throw new l(`Cannot write to \`${r}\`: ${t.message}`,t)}if(h){throw h}if(g){const i=await u.lstat(t);return Promise.all([u.utimes(r,i.atime,i.mtime),u.chmod(r,i.mode)])}};const cpFile=(t,r,i)=>{if(!t||!r){return Promise.reject(new l("`source` and `destination` required"))}i={overwrite:true,...i};const a=new h(o.resolve(t),o.resolve(r));const c=cpFileAsync(t,r,i,a);c.on=(...t)=>{a.on(...t);return c};return c};t.exports=cpFile;const checkSourceIsFile=(t,r)=>{if(t.isDirectory()){throw Object.assign(new l(`EISDIR: illegal operation on a directory '${r}'`),{errno:-21,code:"EISDIR",source:r})}};t.exports.sync=(t,r,i)=>{if(!t||!r){throw new l("`source` and `destination` required")}i={overwrite:true,...i};const c=u.statSync(t);checkSourceIsFile(c,t);u.makeDirSync(o.dirname(r),{mode:i.directoryMode});const h=i.overwrite?null:a.COPYFILE_EXCL;try{u.copyFileSync(t,r,h)}catch(t){if(!i.overwrite&&t.code==="EEXIST"){return}throw t}u.utimesSync(r,c.atime,c.mtime)}},9537:(t,r,i)=>{"use strict";const o=i(2361);const a=new WeakMap;class ProgressEmitter extends o{constructor(t,r){super();this._sourcePath=t;this._destinationPath=r}get writtenBytes(){return a.get(this)}set writtenBytes(t){a.set(this,t);this.emitProgress()}emitProgress(){const{size:t,writtenBytes:r}=this;this.emit("progress",{sourcePath:this._sourcePath,destinationPath:this._destinationPath,size:t,writtenBytes:r,percent:r===t?1:r/t})}}t.exports=ProgressEmitter},7328:(t,r,i)=>{"use strict";const o=i(2081);const a=i(3529);const c=i(9170);function spawn(t,r,i){const l=a(t,r,i);const u=o.spawn(l.command,l.args,l.options);c.hookChildProcess(u,l);return u}function spawnSync(t,r,i){const l=a(t,r,i);const u=o.spawnSync(l.command,l.args,l.options);u.error=u.error||c.verifyENOENTSync(u.status,l);return u}t.exports=spawn;t.exports.spawn=spawn;t.exports.sync=spawnSync;t.exports._parse=a;t.exports._enoent=c},9170:t=>{"use strict";const r=process.platform==="win32";function notFoundError(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function hookChildProcess(t,i){if(!r){return}const o=t.emit;t.emit=function(r,a){if(r==="exit"){const r=verifyENOENT(a,i,"spawn");if(r){return o.call(t,"error",r)}}return o.apply(t,arguments)}}function verifyENOENT(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawn")}return null}function verifyENOENTSync(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawnSync")}return null}t.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},3529:(t,r,i)=>{"use strict";const o=i(1017);const a=i(5499);const c=i(1024);const l=i(7091);const u=process.platform==="win32";const h=/\.(?:com|exe)$/i;const d=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(t){t.file=a(t);const r=t.file&&l(t.file);if(r){t.args.unshift(t.file);t.command=r;return a(t)}return t.file}function parseNonShell(t){if(!u){return t}const r=detectShebang(t);const i=!h.test(r);if(t.options.forceShell||i){const i=d.test(r);t.command=o.normalize(t.command);t.command=c.command(t.command);t.args=t.args.map((t=>c.argument(t,i)));const a=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${a}"`];t.command=process.env.comspec||"cmd.exe";t.options.windowsVerbatimArguments=true}return t}function parse(t,r,i){if(r&&!Array.isArray(r)){i=r;r=null}r=r?r.slice(0):[];i=Object.assign({},i);const o={command:t,args:r,options:i,file:undefined,original:{command:t,args:r}};return i.shell?o:parseNonShell(o)}t.exports=parse},1024:t=>{"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(t){t=t.replace(r,"^$1");return t}function escapeArgument(t,i){t=`${t}`;t=t.replace(/(\\*)"/g,'$1$1\\"');t=t.replace(/(\\*)$/,"$1$1");t=`"${t}"`;t=t.replace(r,"^$1");if(i){t=t.replace(r,"^$1")}return t}t.exports.command=escapeCommand;t.exports.argument=escapeArgument},7091:(t,r,i)=>{"use strict";const o=i(7147);const a=i(7256);function readShebang(t){const r=150;const i=Buffer.alloc(r);let c;try{c=o.openSync(t,"r");o.readSync(c,i,0,r,0);o.closeSync(c)}catch(t){}return a(i.toString())}t.exports=readShebang},5499:(t,r,i)=>{"use strict";const o=i(1017);const a=i(8085);const c=i(7460);function resolveCommandAttempt(t,r){const i=t.options.env||process.env;const l=process.cwd();const u=t.options.cwd!=null;const h=u&&process.chdir!==undefined&&!process.chdir.disabled;if(h){try{process.chdir(t.options.cwd)}catch(t){}}let d;try{d=a.sync(t.command,{path:i[c({env:i})],pathExt:r?o.delimiter:undefined})}catch(t){}finally{if(h){process.chdir(l)}}if(d){d=o.resolve(u?t.options.cwd:"",d)}return d}function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,true)}t.exports=resolveCommand},1599:(t,r,i)=>{"use strict";const{Transform:o,PassThrough:a}=i(2781);const c=i(9796);const l=i(2693);t.exports=t=>{const r=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(r)){return t}const i=r==="br";if(i&&typeof c.createBrotliDecompress!=="function"){t.destroy(new Error("Brotli is not supported on Node.js < 12"));return t}let u=true;const h=new o({transform(t,r,i){u=false;i(null,t)},flush(t){t()}});const d=new a({autoDestroy:false,destroy(r,i){t.destroy();i(r)}});const p=i?c.createBrotliDecompress():c.createUnzip();p.once("error",(r=>{if(u&&!t.readable){d.end();return}d.destroy(r)}));l(t,d);t.pipe(h).pipe(p).pipe(d);return d}},3110:t=>{"use strict";
2
+ (()=>{var t={6491:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},6325:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const c=10;const l=10;const u=o>c;const h=o===c&&a>=l;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},1659:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(4715);const a=i(8907);const c=i(3486);r.Settings=c.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},4715:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(3645);const a=i(5341);const c=i(6325);const l=i(946);const u=i(3253);function read(t,r,i){if(!r.stats&&c.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,c)=>{if(o!==null){callFailureCallback(i,o);return}const l=c.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,l);return}const h=l.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=l.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((c,h)=>{if(c!==null){callFailureCallback(i,c);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,c)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:l.fs.createDirentFromStats(i,c)};if(r.stats){u.stats=c}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},3253:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},8907:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(3645);const a=i(6325);const c=i(946);const l=i(3253);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:l.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=c.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=l.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:c.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},3486:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(3645);const c=i(6491);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=c.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},2926:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},946:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(2926);r.fs=o},2243:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},3645:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(6948);const a=i(6750);const c=i(1917);r.Settings=c.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},6948:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},6750:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},1917:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2243);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},4328:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(4306);const a=i(2686);const c=i(8918);const l=i(8831);r.Settings=l.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new c.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},4306:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1293);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2686:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(1293);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},8918:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9476);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},1293:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(1659);const c=i(4241);const l=i(1652);const u=i(8376);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=c(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!l.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=l.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(l.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&l.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},1652:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},8376:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1652);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},9476:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1659);const a=i(1652);const c=i(8376);class SyncReader extends c.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},8831:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(1659);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},8950:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(t){return i.includes(t)}const o=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...i];function isObjectTypeName(t){return o.includes(t)}const a=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(t){return a.includes(t)}function isOfType(t){return r=>typeof r===t}const{toString:c}=Object.prototype;const getObjectType=t=>{const r=c.call(t).slice(8,-1);if(/HTML\w+Element/.test(r)&&is.domElement(t)){return"HTMLElement"}if(isObjectTypeName(r)){return r}return undefined};const isObjectOfType=t=>r=>getObjectType(r)===t;function is(t){if(t===null){return"null"}switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(t)){return"Observable"}if(is.array(t)){return"Array"}if(is.buffer(t)){return"Buffer"}const r=getObjectType(t);if(r){return r}if(t instanceof String||t instanceof Boolean||t instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const l=isOfType("number");is.number=t=>l(t)&&!is.nan(t);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=t=>t===null;is.class_=t=>is.function_(t)&&t.toString().startsWith("class ");is.boolean=t=>t===true||t===false;is.symbol=isOfType("symbol");is.numericString=t=>is.string(t)&&!is.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));is.array=(t,r)=>{if(!Array.isArray(t)){return false}if(!is.function_(r)){return true}return t.every(r)};is.buffer=t=>{var r,i,o,a;return(a=(o=(i=(r=t)===null||r===void 0?void 0:r.constructor)===null||i===void 0?void 0:i.isBuffer)===null||o===void 0?void 0:o.call(i,t))!==null&&a!==void 0?a:false};is.blob=t=>isObjectOfType("Blob")(t);is.nullOrUndefined=t=>is.null_(t)||is.undefined(t);is.object=t=>!is.null_(t)&&(typeof t==="object"||is.function_(t));is.iterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.iterator])};is.asyncIterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.asyncIterator])};is.generator=t=>{var r,i;return is.iterable(t)&&is.function_((r=t)===null||r===void 0?void 0:r.next)&&is.function_((i=t)===null||i===void 0?void 0:i.throw)};is.asyncGenerator=t=>is.asyncIterable(t)&&is.function_(t.next)&&is.function_(t.throw);is.nativePromise=t=>isObjectOfType("Promise")(t);const hasPromiseAPI=t=>{var r,i;return is.function_((r=t)===null||r===void 0?void 0:r.then)&&is.function_((i=t)===null||i===void 0?void 0:i.catch)};is.promise=t=>is.nativePromise(t)||hasPromiseAPI(t);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=t=>getObjectType(t)==="AsyncGeneratorFunction";is.asyncFunction=t=>getObjectType(t)==="AsyncFunction";is.boundFunction=t=>is.function_(t)&&!t.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=t=>isObjectOfType("Map")(t);is.set=t=>isObjectOfType("Set")(t);is.weakMap=t=>isObjectOfType("WeakMap")(t);is.weakSet=t=>isObjectOfType("WeakSet")(t);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(t,r)=>Object.values(r).includes(t);is.directInstanceOf=(t,r)=>Object.getPrototypeOf(t)===r.prototype;is.urlInstance=t=>isObjectOfType("URL")(t);is.urlString=t=>{if(!is.string(t)){return false}try{new URL(t);return true}catch(t){return false}};is.truthy=t=>Boolean(t);is.falsy=t=>!t;is.nan=t=>Number.isNaN(t);is.primitive=t=>is.null_(t)||isPrimitiveTypeName(typeof t);is.integer=t=>Number.isInteger(t);is.safeInteger=t=>Number.isSafeInteger(t);is.plainObject=t=>{if(c.call(t)!=="[object Object]"){return false}const r=Object.getPrototypeOf(t);return r===null||r===Object.getPrototypeOf({})};is.typedArray=t=>isTypedArrayName(getObjectType(t));const isValidLength=t=>is.safeInteger(t)&&t>=0;is.arrayLike=t=>!is.nullOrUndefined(t)&&!is.function_(t)&&isValidLength(t.length);is.inRange=(t,r)=>{if(is.number(r)){return t>=Math.min(0,r)&&t<=Math.max(r,0)}if(is.array(r)&&r.length===2){return t>=Math.min(...r)&&t<=Math.max(...r)}throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};const u=1;const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=t=>is.object(t)&&t.nodeType===u&&is.string(t.nodeName)&&!is.plainObject(t)&&h.every((r=>r in t));is.observable=t=>{var r,i,o,a;if(!t){return false}if(t===((i=(r=t)[Symbol.observable])===null||i===void 0?void 0:i.call(r))){return true}if(t===((a=(o=t)["@@observable"])===null||a===void 0?void 0:a.call(o))){return true}return false};is.nodeStream=t=>is.object(t)&&is.function_(t.pipe)&&!is.observable(t);is.infinite=t=>t===Infinity||t===-Infinity;const isAbsoluteMod2=t=>r=>is.integer(r)&&Math.abs(r%2)===t;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=t=>is.array(t)&&t.length===0;is.nonEmptyArray=t=>is.array(t)&&t.length>0;is.emptyString=t=>is.string(t)&&t.length===0;const isWhiteSpaceString=t=>is.string(t)&&!/\S/.test(t);is.emptyStringOrWhitespace=t=>is.emptyString(t)||isWhiteSpaceString(t);is.nonEmptyString=t=>is.string(t)&&t.length>0;is.nonEmptyStringAndNotWhitespace=t=>is.string(t)&&!is.emptyStringOrWhitespace(t);is.emptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length===0;is.nonEmptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length>0;is.emptySet=t=>is.set(t)&&t.size===0;is.nonEmptySet=t=>is.set(t)&&t.size>0;is.emptyMap=t=>is.map(t)&&t.size===0;is.nonEmptyMap=t=>is.map(t)&&t.size>0;is.propertyKey=t=>is.any([is.string,is.number,is.symbol],t);is.formData=t=>isObjectOfType("FormData")(t);is.urlSearchParams=t=>isObjectOfType("URLSearchParams")(t);const predicateOnArray=(t,r,i)=>{if(!is.function_(r)){throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`)}if(i.length===0){throw new TypeError("Invalid number of values")}return t.call(i,r)};is.any=(t,...r)=>{const i=is.array(t)?t:[t];return i.some((t=>predicateOnArray(Array.prototype.some,t,r)))};is.all=(t,...r)=>predicateOnArray(Array.prototype.every,t,r);const assertType=(t,r,i,o={})=>{if(!t){const{multipleValues:t}=o;const a=t?`received values of types ${[...new Set(i.map((t=>`\`${is(t)}\``)))].join(", ")}`:`received value of type \`${is(i)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${a}.`)}};r.assert={undefined:t=>assertType(is.undefined(t),"undefined",t),string:t=>assertType(is.string(t),"string",t),number:t=>assertType(is.number(t),"number",t),bigint:t=>assertType(is.bigint(t),"bigint",t),function_:t=>assertType(is.function_(t),"Function",t),null_:t=>assertType(is.null_(t),"null",t),class_:t=>assertType(is.class_(t),"Class",t),boolean:t=>assertType(is.boolean(t),"boolean",t),symbol:t=>assertType(is.symbol(t),"symbol",t),numericString:t=>assertType(is.numericString(t),"string with a number",t),array:(t,r)=>{const i=assertType;i(is.array(t),"Array",t);if(r){t.forEach(r)}},buffer:t=>assertType(is.buffer(t),"Buffer",t),blob:t=>assertType(is.blob(t),"Blob",t),nullOrUndefined:t=>assertType(is.nullOrUndefined(t),"null or undefined",t),object:t=>assertType(is.object(t),"Object",t),iterable:t=>assertType(is.iterable(t),"Iterable",t),asyncIterable:t=>assertType(is.asyncIterable(t),"AsyncIterable",t),generator:t=>assertType(is.generator(t),"Generator",t),asyncGenerator:t=>assertType(is.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>assertType(is.nativePromise(t),"native Promise",t),promise:t=>assertType(is.promise(t),"Promise",t),generatorFunction:t=>assertType(is.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>assertType(is.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>assertType(is.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>assertType(is.boundFunction(t),"Function",t),regExp:t=>assertType(is.regExp(t),"RegExp",t),date:t=>assertType(is.date(t),"Date",t),error:t=>assertType(is.error(t),"Error",t),map:t=>assertType(is.map(t),"Map",t),set:t=>assertType(is.set(t),"Set",t),weakMap:t=>assertType(is.weakMap(t),"WeakMap",t),weakSet:t=>assertType(is.weakSet(t),"WeakSet",t),int8Array:t=>assertType(is.int8Array(t),"Int8Array",t),uint8Array:t=>assertType(is.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>assertType(is.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>assertType(is.int16Array(t),"Int16Array",t),uint16Array:t=>assertType(is.uint16Array(t),"Uint16Array",t),int32Array:t=>assertType(is.int32Array(t),"Int32Array",t),uint32Array:t=>assertType(is.uint32Array(t),"Uint32Array",t),float32Array:t=>assertType(is.float32Array(t),"Float32Array",t),float64Array:t=>assertType(is.float64Array(t),"Float64Array",t),bigInt64Array:t=>assertType(is.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>assertType(is.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>assertType(is.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>assertType(is.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>assertType(is.dataView(t),"DataView",t),enumCase:(t,r)=>assertType(is.enumCase(t,r),"EnumCase",t),urlInstance:t=>assertType(is.urlInstance(t),"URL",t),urlString:t=>assertType(is.urlString(t),"string with a URL",t),truthy:t=>assertType(is.truthy(t),"truthy",t),falsy:t=>assertType(is.falsy(t),"falsy",t),nan:t=>assertType(is.nan(t),"NaN",t),primitive:t=>assertType(is.primitive(t),"primitive",t),integer:t=>assertType(is.integer(t),"integer",t),safeInteger:t=>assertType(is.safeInteger(t),"integer",t),plainObject:t=>assertType(is.plainObject(t),"plain object",t),typedArray:t=>assertType(is.typedArray(t),"TypedArray",t),arrayLike:t=>assertType(is.arrayLike(t),"array-like",t),domElement:t=>assertType(is.domElement(t),"HTMLElement",t),observable:t=>assertType(is.observable(t),"Observable",t),nodeStream:t=>assertType(is.nodeStream(t),"Node.js Stream",t),infinite:t=>assertType(is.infinite(t),"infinite number",t),emptyArray:t=>assertType(is.emptyArray(t),"empty array",t),nonEmptyArray:t=>assertType(is.nonEmptyArray(t),"non-empty array",t),emptyString:t=>assertType(is.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>assertType(is.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>assertType(is.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>assertType(is.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>assertType(is.emptyObject(t),"empty object",t),nonEmptyObject:t=>assertType(is.nonEmptyObject(t),"non-empty object",t),emptySet:t=>assertType(is.emptySet(t),"empty set",t),nonEmptySet:t=>assertType(is.nonEmptySet(t),"non-empty set",t),emptyMap:t=>assertType(is.emptyMap(t),"empty map",t),nonEmptyMap:t=>assertType(is.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>assertType(is.propertyKey(t),"PropertyKey",t),formData:t=>assertType(is.formData(t),"FormData",t),urlSearchParams:t=>assertType(is.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>assertType(is.evenInteger(t),"even integer",t),oddInteger:t=>assertType(is.oddInteger(t),"odd integer",t),directInstanceOf:(t,r)=>assertType(is.directInstanceOf(t,r),"T",t),inRange:(t,r)=>assertType(is.inRange(t,r),"in range",t),any:(t,...r)=>assertType(is.any(t,...r),"predicate returns truthy for any value",r,{multipleValues:true}),all:(t,...r)=>assertType(is.all(t,...r),"predicate returns truthy for all values",r,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(r.assert,{class:{value:r.assert.class_},function:{value:r.assert.function_},null:{value:r.assert.null_}});r["default"]=is;t.exports=is;t.exports["default"]=is;t.exports.assert=r.assert},1176:(t,r,i)=>{var o=i(2012);function retry(t,r){function run(i,a){var c=r||{};var l;if(!("randomize"in c)){c.randomize=true}l=o.operation(c);function bail(t){a(t||new Error("Aborted"))}function onError(t,r){if(t.bail){bail(t);return}if(!l.retry(t)){a(l.mainError())}else if(c.onRetry){c.onRetry(t,r)}}function runAttempt(r){var o;try{o=t(bail,r)}catch(t){onError(t,r);return}Promise.resolve(o).then(i).catch((function catchIt(t){onError(t,r)}))}l.attempt(runAttempt)}return new Promise(run)}t.exports=retry},155:t=>{"use strict";t.exports=balanced;function balanced(t,r,i){if(t instanceof RegExp)t=maybeMatch(t,i);if(r instanceof RegExp)r=maybeMatch(r,i);var o=range(t,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+t.length,o[1]),post:i.slice(o[1]+r.length)}}function maybeMatch(t,r){var i=r.match(t);return i?i[0]:null}balanced.range=range;function range(t,r,i){var o,a,c,l,u;var h=i.indexOf(t);var d=i.indexOf(r,h+1);var p=h;if(h>=0&&d>0){if(t===r){return[h,d]}o=[];c=i.length;while(p>=0&&!u){if(p==h){o.push(p);h=i.indexOf(t,p+1)}else if(o.length==1){u=[o.pop(),d]}else{a=o.pop();if(a<c){c=a;l=d}d=i.indexOf(r,p+1)}p=h<d&&h>=0?h:d}if(o.length){u=[c,l]}}return u}},7847:(t,r,i)=>{var o=i(1062);var a=i(155);t.exports=expandTop;var c="\0SLASH"+Math.random()+"\0";var l="\0OPEN"+Math.random()+"\0";var u="\0CLOSE"+Math.random()+"\0";var h="\0COMMA"+Math.random()+"\0";var d="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(c).split("\\{").join(l).split("\\}").join(u).split("\\,").join(h).split("\\.").join(d)}function unescapeBraces(t){return t.split(c).join("\\").split(l).join("{").split(u).join("}").split(h).join(",").split(d).join(".")}function parseCommaParts(t){if(!t)return[""];var r=[];var i=a("{","}",t);if(!i)return t.split(",");var o=i.pre;var c=i.body;var l=i.post;var u=o.split(",");u[u.length-1]+="{"+c+"}";var h=parseCommaParts(l);if(l.length){u[u.length-1]+=h.shift();u.push.apply(u,h)}r.push.apply(r,u);return r}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function identity(t){return t}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,r){return t<=r}function gte(t,r){return t>=r}function expand(t,r){var i=[];var c=a("{","}",t);if(!c||/\$$/.test(c.pre))return[t];var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body);var h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body);var d=l||h;var p=c.body.indexOf(",")>=0;if(!d&&!p){if(c.post.match(/,.*\}/)){t=c.pre+"{"+c.body+u+c.post;return expand(t)}return[t]}var m;if(d){m=c.body.split(/\.\./)}else{m=parseCommaParts(c.body);if(m.length===1){m=expand(m[0],false).map(embrace);if(m.length===1){var g=c.post.length?expand(c.post,false):[""];return g.map((function(t){return c.pre+m[0]+t}))}}}var y=c.pre;var g=c.post.length?expand(c.post,false):[""];var b;if(d){var v=numeric(m[0]);var _=numeric(m[1]);var w=Math.max(m[0].length,m[1].length);var E=m.length==3?Math.abs(numeric(m[2])):1;var S=lte;var O=_<v;if(O){E*=-1;S=gte}var R=m.some(isPadded);b=[];for(var x=v;S(x,_);x+=E){var A;if(h){A=String.fromCharCode(x);if(A==="\\")A=""}else{A=String(x);if(R){var T=w-A.length;if(T>0){var k=new Array(T+1).join("0");if(x<0)A="-"+k+A.slice(1);else A=k+A}}}b.push(A)}}else{b=o(m,(function(t){return expand(t,false)}))}for(var C=0;C<b.length;C++){for(var P=0;P<g.length;P++){var I=y+b[C]+g[P];if(!r||d||I)i.push(I)}}return i}},1570:(t,r,i)=>{"use strict";const o=i(3625);const a=i(4666);const c=i(6183);const l=i(2467);const braces=(t,r={})=>{let i=[];if(Array.isArray(t)){for(let o of t){let t=braces.create(o,r);if(Array.isArray(t)){i.push(...t)}else{i.push(t)}}}else{i=[].concat(braces.create(t,r))}if(r&&r.expand===true&&r.nodupes===true){i=[...new Set(i)]}return i};braces.parse=(t,r={})=>l(t,r);braces.stringify=(t,r={})=>{if(typeof t==="string"){return o(braces.parse(t,r),r)}return o(t,r)};braces.compile=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}return a(t,r)};braces.expand=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}let i=c(t,r);if(r.noempty===true){i=i.filter(Boolean)}if(r.nodupes===true){i=[...new Set(i)]}return i};braces.create=(t,r={})=>{if(t===""||t.length<3){return[t]}return r.expand!==true?braces.compile(t,r):braces.expand(t,r)};t.exports=braces},4666:(t,r,i)=>{"use strict";const o=i(442);const a=i(2456);const compile=(t,r={})=>{let walk=(t,i={})=>{let c=a.isInvalidBrace(i);let l=t.invalid===true&&r.escapeInvalid===true;let u=c===true||l===true;let h=r.escapeInvalid===true?"\\":"";let d="";if(t.isOpen===true){return h+t.value}if(t.isClose===true){return h+t.value}if(t.type==="open"){return u?h+t.value:"("}if(t.type==="close"){return u?h+t.value:")"}if(t.type==="comma"){return t.prev.type==="comma"?"":u?t.value:"|"}if(t.value){return t.value}if(t.nodes&&t.ranges>0){let i=a.reduce(t.nodes);let c=o(...i,{...r,wrap:false,toRegex:true});if(c.length!==0){return i.length>1&&c.length>1?`(${c})`:c}}if(t.nodes){for(let r of t.nodes){d+=walk(r,t)}}return d};return walk(t)};t.exports=compile},487:t=>{"use strict";t.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},6183:(t,r,i)=>{"use strict";const o=i(442);const a=i(3625);const c=i(2456);const append=(t="",r="",i=false)=>{let o=[];t=[].concat(t);r=[].concat(r);if(!r.length)return t;if(!t.length){return i?c.flatten(r).map((t=>`{${t}}`)):r}for(let a of t){if(Array.isArray(a)){for(let t of a){o.push(append(t,r,i))}}else{for(let t of r){if(i===true&&typeof t==="string")t=`{${t}}`;o.push(Array.isArray(t)?append(a,t,i):a+t)}}}return c.flatten(o)};const expand=(t,r={})=>{let i=r.rangeLimit===void 0?1e3:r.rangeLimit;let walk=(t,l={})=>{t.queue=[];let u=l;let h=l.queue;while(u.type!=="brace"&&u.type!=="root"&&u.parent){u=u.parent;h=u.queue}if(t.invalid||t.dollar){h.push(append(h.pop(),a(t,r)));return}if(t.type==="brace"&&t.invalid!==true&&t.nodes.length===2){h.push(append(h.pop(),["{}"]));return}if(t.nodes&&t.ranges>0){let l=c.reduce(t.nodes);if(c.exceedsLimit(...l,r.step,i)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let u=o(...l,r);if(u.length===0){u=a(t,r)}h.push(append(h.pop(),u));t.nodes=[];return}let d=c.encloseBrace(t);let p=t.queue;let m=t;while(m.type!=="brace"&&m.type!=="root"&&m.parent){m=m.parent;p=m.queue}for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r];if(i.type==="comma"&&t.type==="brace"){if(r===1)p.push("");p.push("");continue}if(i.type==="close"){h.push(append(h.pop(),p,d));continue}if(i.value&&i.type!=="open"){p.push(append(p.pop(),i.value));continue}if(i.nodes){walk(i,t)}}return p};return c.flatten(walk(t))};t.exports=expand},2467:(t,r,i)=>{"use strict";const o=i(3625);const{MAX_LENGTH:a,CHAR_BACKSLASH:c,CHAR_BACKTICK:l,CHAR_COMMA:u,CHAR_DOT:h,CHAR_LEFT_PARENTHESES:d,CHAR_RIGHT_PARENTHESES:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_RIGHT_SQUARE_BRACKET:b,CHAR_DOUBLE_QUOTE:v,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:w,CHAR_ZERO_WIDTH_NOBREAK_SPACE:E}=i(487);const parse=(t,r={})=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}let i=r||{};let S=typeof i.maxLength==="number"?Math.min(a,i.maxLength):a;if(t.length>S){throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${S})`)}let O={type:"root",input:t,nodes:[]};let R=[O];let x=O;let A=O;let T=0;let k=t.length;let C=0;let P=0;let I;let L={};const advance=()=>t[C++];const push=t=>{if(t.type==="text"&&A.type==="dot"){A.type="text"}if(A&&A.type==="text"&&t.type==="text"){A.value+=t.value;return}x.nodes.push(t);t.parent=x;t.prev=A;A=t;return t};push({type:"bos"});while(C<k){x=R[R.length-1];I=advance();if(I===E||I===w){continue}if(I===c){push({type:"text",value:(r.keepEscaping?I:"")+advance()});continue}if(I===b){push({type:"text",value:"\\"+I});continue}if(I===y){T++;let t=true;let r;while(C<k&&(r=advance())){I+=r;if(r===y){T++;continue}if(r===c){I+=advance();continue}if(r===b){T--;if(T===0){break}}}push({type:"text",value:I});continue}if(I===d){x=push({type:"paren",nodes:[]});R.push(x);push({type:"text",value:I});continue}if(I===p){if(x.type!=="paren"){push({type:"text",value:I});continue}x=R.pop();push({type:"text",value:I});x=R[R.length-1];continue}if(I===v||I===_||I===l){let t=I;let i;if(r.keepQuotes!==true){I=""}while(C<k&&(i=advance())){if(i===c){I+=i+advance();continue}if(i===t){if(r.keepQuotes===true)I+=i;break}I+=i}push({type:"text",value:I});continue}if(I===m){P++;let t=A.value&&A.value.slice(-1)==="$"||x.dollar===true;let r={type:"brace",open:true,close:false,dollar:t,depth:P,commas:0,ranges:0,nodes:[]};x=push(r);R.push(x);push({type:"open",value:I});continue}if(I===g){if(x.type!=="brace"){push({type:"text",value:I});continue}let t="close";x=R.pop();x.close=true;push({type:t,value:I});P--;x=R[R.length-1];continue}if(I===u&&P>0){if(x.ranges>0){x.ranges=0;let t=x.nodes.shift();x.nodes=[t,{type:"text",value:o(x)}]}push({type:"comma",value:I});x.commas++;continue}if(I===h&&P>0&&x.commas===0){let t=x.nodes;if(P===0||t.length===0){push({type:"text",value:I});continue}if(A.type==="dot"){x.range=[];A.value+=I;A.type="range";if(x.nodes.length!==3&&x.nodes.length!==5){x.invalid=true;x.ranges=0;A.type="text";continue}x.ranges++;x.args=[];continue}if(A.type==="range"){t.pop();let r=t[t.length-1];r.value+=A.value+I;A=r;x.ranges--;continue}push({type:"dot",value:I});continue}push({type:"text",value:I})}do{x=R.pop();if(x.type!=="root"){x.nodes.forEach((t=>{if(!t.nodes){if(t.type==="open")t.isOpen=true;if(t.type==="close")t.isClose=true;if(!t.nodes)t.type="text";t.invalid=true}}));let t=R[R.length-1];let r=t.nodes.indexOf(x);t.nodes.splice(r,1,...x.nodes)}}while(R.length>0);push({type:"eos"});return O};t.exports=parse},3625:(t,r,i)=>{"use strict";const o=i(2456);t.exports=(t,r={})=>{let stringify=(t,i={})=>{let a=r.escapeInvalid&&o.isInvalidBrace(i);let c=t.invalid===true&&r.escapeInvalid===true;let l="";if(t.value){if((a||c)&&o.isOpenOrClose(t)){return"\\"+t.value}return t.value}if(t.value){return t.value}if(t.nodes){for(let r of t.nodes){l+=stringify(r)}}return l};return stringify(t)}},2456:(t,r)=>{"use strict";r.isInteger=t=>{if(typeof t==="number"){return Number.isInteger(t)}if(typeof t==="string"&&t.trim()!==""){return Number.isInteger(Number(t))}return false};r.find=(t,r)=>t.nodes.find((t=>t.type===r));r.exceedsLimit=(t,i,o=1,a)=>{if(a===false)return false;if(!r.isInteger(t)||!r.isInteger(i))return false;return(Number(i)-Number(t))/Number(o)>=a};r.escapeNode=(t,r=0,i)=>{let o=t.nodes[r];if(!o)return;if(i&&o.type===i||o.type==="open"||o.type==="close"){if(o.escaped!==true){o.value="\\"+o.value;o.escaped=true}}};r.encloseBrace=t=>{if(t.type!=="brace")return false;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}return false};r.isInvalidBrace=t=>{if(t.type!=="brace")return false;if(t.invalid===true||t.dollar)return true;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}if(t.open!==true||t.close!==true){t.invalid=true;return true}return false};r.isOpenOrClose=t=>{if(t.type==="open"||t.type==="close"){return true}return t.open===true||t.close===true};r.reduce=t=>t.reduce(((t,r)=>{if(r.type==="text")t.push(r.value);if(r.type==="range")r.type="text";return t}),[]);r.flatten=(...t)=>{const r=[];const flat=t=>{for(let i=0;i<t.length;i++){let o=t[i];Array.isArray(o)?flat(o,r):o!==void 0&&r.push(o)}return r};flat(t);return r}},9201:(t,r,i)=>{"use strict";const{V4MAPPED:o,ADDRCONFIG:a,ALL:c,promises:{Resolver:l},lookup:u}=i(9523);const{promisify:h}=i(3837);const d=i(2037);const p=Symbol("cacheableLookupCreateConnection");const m=Symbol("cacheableLookupInstance");const g=Symbol("expires");const y=typeof c==="number";const verifyAgent=t=>{if(!(t&&typeof t.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=t=>{for(const r of t){if(r.family===6){continue}r.address=`::ffff:${r.address}`;r.family=6}};const getIfaceInfo=()=>{let t=false;let r=false;for(const i of Object.values(d.networkInterfaces())){for(const o of i){if(o.internal){continue}if(o.family==="IPv6"){r=true}else{t=true}if(t&&r){return{has4:t,has6:r}}}}return{has4:t,has6:r}};const isIterable=t=>Symbol.iterator in t;const ignoreNoResultErrors=t=>t.catch((t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT"){return[]}throw t}));const b={ttl:true};const v={all:true};const _={all:true,family:4};const w={all:true,family:6};class CacheableLookup{constructor({cache:t=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:o=.15,resolver:a=new l,lookup:c=u}={}){this.maxTtl=r;this.errorTtl=o;this._cache=t;this._resolver=a;this._dnsLookup=c&&h(c);if(this._resolver instanceof l){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=h(this._resolver.resolve4.bind(this._resolver));this._resolve6=h(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=i;if(i>0){const t=setInterval((()=>{this._hostnamesToFallback.clear()}),i*1e3);if(t.unref){t.unref()}this._fallbackInterval=t}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(t){this.clear();this._resolver.setServers(t)}get servers(){return this._resolver.getServers()}lookup(t,r,i){if(typeof r==="function"){i=r;r={}}else if(typeof r==="number"){r={family:r}}if(!i){throw new Error("Callback must be a function.")}this.lookupAsync(t,r).then((t=>{if(r.all){i(null,t)}else{i(null,t.address,t.family,t.expires,t.ttl)}}),i)}async lookupAsync(t,r={}){if(typeof r==="number"){r={family:r}}let i=await this.query(t);if(r.family===6){const t=i.filter((t=>t.family===6));if(r.hints&o){if(y&&r.hints&c||t.length===0){map4to6(i)}else{i=t}}else{i=t}}else if(r.family===4){i=i.filter((t=>t.family===4))}if(r.hints&a){const{_iface:t}=this;i=i.filter((r=>r.family===6?t.has6:t.has4))}if(i.length===0){const r=new Error(`cacheableLookup ENOTFOUND ${t}`);r.code="ENOTFOUND";r.hostname=t;throw r}if(r.all){return i}return i[0]}async query(t){let r=await this._cache.get(t);if(!r){const i=this._pending[t];if(i){r=await i}else{const i=this.queryAndCache(t);this._pending[t]=i;try{r=await i}finally{delete this._pending[t]}}}r=r.map((t=>({...t})));return r}async _resolve(t){const[r,i]=await Promise.all([ignoreNoResultErrors(this._resolve4(t,b)),ignoreNoResultErrors(this._resolve6(t,b))]);let o=0;let a=0;let c=0;const l=Date.now();for(const t of r){t.family=4;t.expires=l+t.ttl*1e3;o=Math.max(o,t.ttl)}for(const t of i){t.family=6;t.expires=l+t.ttl*1e3;a=Math.max(a,t.ttl)}if(r.length>0){if(i.length>0){c=Math.min(o,a)}else{c=o}}else{c=a}return{entries:[...r,...i],cacheTtl:c}}async _lookup(t){try{const[r,i]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(t,_)),ignoreNoResultErrors(this._dnsLookup(t,w))]);return{entries:[...r,...i],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(t,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3;r[g]=Date.now()+i;try{await this._cache.set(t,r,i)}catch(t){this.lookupAsync=async()=>{const r=new Error("Cache Error. Please recreate the CacheableLookup instance.");r.cause=t;throw r}}if(isIterable(this._cache)){this._tick(i)}}}async queryAndCache(t){if(this._hostnamesToFallback.has(t)){return this._dnsLookup(t,v)}let r=await this._resolve(t);if(r.entries.length===0&&this._dnsLookup){r=await this._lookup(t);if(r.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(t)}}const i=r.entries.length===0?this.errorTtl:r.cacheTtl;await this._set(t,r.entries,i);return r.entries}_tick(t){const r=this._nextRemovalTime;if(!r||t<r){clearTimeout(this._removalTimeout);this._nextRemovalTime=t;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let t=Infinity;const r=Date.now();for(const[i,o]of this._cache){const a=o[g];if(r>=a){this._cache.delete(i)}else if(a<t){t=a}}if(t!==Infinity){this._tick(t-r)}}),t);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(t){verifyAgent(t);if(p in t){throw new Error("CacheableLookup has been already installed")}t[p]=t.createConnection;t[m]=this;t.createConnection=(r,i)=>{if(!("lookup"in r)){r.lookup=this.lookup}return t[p](r,i)}}uninstall(t){verifyAgent(t);if(t[p]){if(t[m]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}t.createConnection=t[p];delete t[p];delete t[m]}}updateInterfaceInfo(){const{_iface:t}=this;this._iface=getIfaceInfo();if(t.has4&&!this._iface.has4||t.has6&&!this._iface.has6){this._cache.clear()}}clear(t){if(t){this._cache.delete(t);return}this._cache.clear()}}t.exports=CacheableLookup;t.exports["default"]=CacheableLookup},3846:(t,r,i)=>{"use strict";const o=i(2361);const a=i(7310);const c=i(5521);const l=i(9580);const u=i(3485);const h=i(1762);const d=i(7976);const p=i(2812);const m=i(5326);class CacheableRequest{constructor(t,r){if(typeof t!=="function"){throw new TypeError("Parameter `request` must be a function")}this.cache=new m({uri:typeof r==="string"&&r,store:typeof r!=="string"&&r,namespace:"cacheable-request"});return this.createCacheableRequest(t)}createCacheableRequest(t){return(r,i)=>{let m;if(typeof r==="string"){m=normalizeUrlObject(a.parse(r));r={}}else if(r instanceof a.URL){m=normalizeUrlObject(a.parse(r.toString()));r={}}else{const[t,...i]=(r.path||"").split("?");const o=i.length>0?`?${i.join("?")}`:"";m=normalizeUrlObject({...r,pathname:t,search:o})}r={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...r,...urlObjectToRequestOptions(m)};r.headers=d(r.headers);const g=new o;const y=c(a.format(m),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});const b=`${r.method}:${y}`;let v=false;let _=false;const makeRequest=r=>{_=true;let o=false;let a;const c=new Promise((t=>{a=()=>{if(!o){o=true;t()}}}));const handler=t=>{if(v&&!r.forceRefresh){t.status=t.statusCode;const i=u.fromObject(v.cachePolicy).revalidatedPolicy(r,t);if(!i.modified){const r=i.policy.responseHeaders();t=new h(v.statusCode,r,v.body,v.url);t.cachePolicy=i.policy;t.fromCache=true}}if(!t.fromCache){t.cachePolicy=new u(r,t,r);t.fromCache=false}let a;if(r.cache&&t.cachePolicy.storable()){a=p(t);(async()=>{try{const i=l.buffer(t);await Promise.race([c,new Promise((r=>t.once("end",r)))]);if(o){return}const a=await i;const u={cachePolicy:t.cachePolicy.toObject(),url:t.url,statusCode:t.fromCache?v.statusCode:t.statusCode,body:a};let h=r.strictTtl?t.cachePolicy.timeToLive():undefined;if(r.maxTtl){h=h?Math.min(h,r.maxTtl):r.maxTtl}await this.cache.set(b,u,h)}catch(t){g.emit("error",new CacheableRequest.CacheError(t))}})()}else if(r.cache&&v){(async()=>{try{await this.cache.delete(b)}catch(t){g.emit("error",new CacheableRequest.CacheError(t))}})()}g.emit("response",a||t);if(typeof i==="function"){i(a||t)}};try{const i=t(r,handler);i.once("error",a);i.once("abort",a);g.emit("request",i)}catch(t){g.emit("error",new CacheableRequest.RequestError(t))}};(async()=>{const get=async t=>{await Promise.resolve();const r=t.cache?await this.cache.get(b):undefined;if(typeof r==="undefined"){return makeRequest(t)}const o=u.fromObject(r.cachePolicy);if(o.satisfiesWithoutRevalidation(t)&&!t.forceRefresh){const t=o.responseHeaders();const a=new h(r.statusCode,t,r.body,r.url);a.cachePolicy=o;a.fromCache=true;g.emit("response",a);if(typeof i==="function"){i(a)}}else{v=r;t.headers=o.revalidationHeaders(t);makeRequest(t)}};const errorHandler=t=>g.emit("error",new CacheableRequest.CacheError(t));this.cache.once("error",errorHandler);g.on("response",(()=>this.cache.removeListener("error",errorHandler)));try{await get(r)}catch(t){if(r.automaticFailover&&!_){makeRequest(r)}g.emit("error",new CacheableRequest.CacheError(t))}})();return g}}}function urlObjectToRequestOptions(t){const r={...t};r.path=`${t.pathname||"/"}${t.search||""}`;delete r.pathname;delete r.search;return r}function normalizeUrlObject(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}CacheableRequest.RequestError=class extends Error{constructor(t){super(t.message);this.name="RequestError";Object.assign(this,t)}};CacheableRequest.CacheError=class extends Error{constructor(t){super(t.message);this.name="CacheError";Object.assign(this,t)}};t.exports=CacheableRequest},1085:(t,r,i)=>{"use strict";const o=i(7147);const a=i(1017);const c=o.lchown?"lchown":"chown";const l=o.lchownSync?"lchownSync":"chownSync";const u=o.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(t,r,i)=>{try{return o[l](t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const chownSync=(t,r,i)=>{try{return o.chownSync(t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const h=u?(t,r,i,a)=>c=>{if(!c||c.code!=="EISDIR")a(c);else o.chown(t,r,i,a)}:(t,r,i,o)=>o;const d=u?(t,r,i)=>{try{return lchownSync(t,r,i)}catch(o){if(o.code!=="EISDIR")throw o;chownSync(t,r,i)}}:(t,r,i)=>lchownSync(t,r,i);const p=process.version;let readdir=(t,r,i)=>o.readdir(t,r,i);let readdirSync=(t,r)=>o.readdirSync(t,r);if(/^v4\./.test(p))readdir=(t,r,i)=>o.readdir(t,i);const chown=(t,r,i,a)=>{o[c](t,r,i,h(t,r,i,(t=>{a(t&&t.code!=="ENOENT"?t:null)})))};const chownrKid=(t,r,i,c,l)=>{if(typeof r==="string")return o.lstat(a.resolve(t,r),((o,a)=>{if(o)return l(o.code!=="ENOENT"?o:null);a.name=r;chownrKid(t,a,i,c,l)}));if(r.isDirectory()){chownr(a.resolve(t,r.name),i,c,(o=>{if(o)return l(o);const u=a.resolve(t,r.name);chown(u,i,c,l)}))}else{const o=a.resolve(t,r.name);chown(o,i,c,l)}};const chownr=(t,r,i,o)=>{readdir(t,{withFileTypes:true},((a,c)=>{if(a){if(a.code==="ENOENT")return o();else if(a.code!=="ENOTDIR"&&a.code!=="ENOTSUP")return o(a)}if(a||!c.length)return chown(t,r,i,o);let l=c.length;let u=null;const then=a=>{if(u)return;if(a)return o(u=a);if(--l===0)return chown(t,r,i,o)};c.forEach((o=>chownrKid(t,o,r,i,then)))}))};const chownrKidSync=(t,r,i,c)=>{if(typeof r==="string"){try{const i=o.lstatSync(a.resolve(t,r));i.name=r;r=i}catch(t){if(t.code==="ENOENT")return;else throw t}}if(r.isDirectory())chownrSync(a.resolve(t,r.name),i,c);d(a.resolve(t,r.name),i,c)};const chownrSync=(t,r,i)=>{let o;try{o=readdirSync(t,{withFileTypes:true})}catch(o){if(o.code==="ENOENT")return;else if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return d(t,r,i);else throw o}if(o&&o.length)o.forEach((o=>chownrKidSync(t,o,r,i)));return d(t,r,i)};t.exports=chownr;chownr.sync=chownrSync},2812:(t,r,i)=>{"use strict";const o=i(2781).PassThrough;const a=i(9958);const cloneResponse=t=>{if(!(t&&t.pipe)){throw new TypeError("Parameter `response` must be a response stream.")}const r=new o;a(t,r);return t.pipe(r)};t.exports=cloneResponse},1062:t=>{t.exports=function(t,i){var o=[];for(var a=0;a<t.length;a++){var c=i(t[a],a);if(r(c))o.push.apply(o,c);else o.push(c)}return o};var r=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}},7863:(t,r,i)=>{"use strict";const o=i(5842);class CpFileError extends o{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpFileError"}}t.exports=CpFileError},4404:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(6284);const c=i(8465);const l=i(2248);const u=i(7863);const h=o(a.stat);const d=o(a.lstat);const p=o(a.utimes);const m=o(a.chmod);r.closeSync=a.closeSync.bind(a);r.createWriteStream=a.createWriteStream.bind(a);r.createReadStream=async(t,r)=>{const i=a.createReadStream(t,r);try{await l(i,["readable","end"])}catch(r){throw new u(`Cannot read from \`${t}\`: ${r.message}`,r)}return i};r.stat=t=>h(t).catch((r=>{throw new u(`Cannot stat path \`${t}\`: ${r.message}`,r)}));r.lstat=t=>d(t).catch((r=>{throw new u(`lstat \`${t}\` failed: ${r.message}`,r)}));r.utimes=(t,r,i)=>p(t,r,i).catch((r=>{throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}));r.chmod=(t,r)=>m(t,r).catch((r=>{throw new u(`chmod \`${t}\` failed: ${r.message}`,r)}));r.statSync=t=>{try{return a.statSync(t)}catch(r){throw new u(`stat \`${t}\` failed: ${r.message}`,r)}};r.utimesSync=(t,r,i)=>{try{return a.utimesSync(t,r,i)}catch(r){throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}};r.makeDir=(t,r)=>c(t,{...r,fs:a}).catch((r=>{throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}));r.makeDirSync=(t,r)=>{try{c.sync(t,{...r,fs:a})}catch(r){throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}};r.copyFileSync=(t,r,i)=>{try{a.copyFileSync(t,r,i)}catch(i){throw new u(`Cannot copy from \`${t}\` to \`${r}\`: ${i.message}`,i)}}},654:(t,r,i)=>{"use strict";const o=i(1017);const{constants:a}=i(7147);const c=i(2248);const l=i(7863);const u=i(4404);const h=i(9537);const cpFileAsync=async(t,r,i,a)=>{let h;const d=await u.stat(t);a.size=d.size;const p=await u.createReadStream(t);await u.makeDir(o.dirname(r),{mode:i.directoryMode});const m=u.createWriteStream(r,{flags:i.overwrite?"w":"wx"});p.on("data",(()=>{a.writtenBytes=m.bytesWritten}));p.once("error",(r=>{h=new l(`Cannot read from \`${t}\`: ${r.message}`,r);m.end()}));let g=false;try{const t=c(m,"close");p.pipe(m);await t;a.writtenBytes=a.size;g=true}catch(t){throw new l(`Cannot write to \`${r}\`: ${t.message}`,t)}if(h){throw h}if(g){const i=await u.lstat(t);return Promise.all([u.utimes(r,i.atime,i.mtime),u.chmod(r,i.mode)])}};const cpFile=(t,r,i)=>{if(!t||!r){return Promise.reject(new l("`source` and `destination` required"))}i={overwrite:true,...i};const a=new h(o.resolve(t),o.resolve(r));const c=cpFileAsync(t,r,i,a);c.on=(...t)=>{a.on(...t);return c};return c};t.exports=cpFile;const checkSourceIsFile=(t,r)=>{if(t.isDirectory()){throw Object.assign(new l(`EISDIR: illegal operation on a directory '${r}'`),{errno:-21,code:"EISDIR",source:r})}};t.exports.sync=(t,r,i)=>{if(!t||!r){throw new l("`source` and `destination` required")}i={overwrite:true,...i};const c=u.statSync(t);checkSourceIsFile(c,t);u.makeDirSync(o.dirname(r),{mode:i.directoryMode});const h=i.overwrite?null:a.COPYFILE_EXCL;try{u.copyFileSync(t,r,h)}catch(t){if(!i.overwrite&&t.code==="EEXIST"){return}throw t}u.utimesSync(r,c.atime,c.mtime)}},9537:(t,r,i)=>{"use strict";const o=i(2361);const a=new WeakMap;class ProgressEmitter extends o{constructor(t,r){super();this._sourcePath=t;this._destinationPath=r}get writtenBytes(){return a.get(this)}set writtenBytes(t){a.set(this,t);this.emitProgress()}emitProgress(){const{size:t,writtenBytes:r}=this;this.emit("progress",{sourcePath:this._sourcePath,destinationPath:this._destinationPath,size:t,writtenBytes:r,percent:r===t?1:r/t})}}t.exports=ProgressEmitter},7328:(t,r,i)=>{"use strict";const o=i(2081);const a=i(3529);const c=i(9170);function spawn(t,r,i){const l=a(t,r,i);const u=o.spawn(l.command,l.args,l.options);c.hookChildProcess(u,l);return u}function spawnSync(t,r,i){const l=a(t,r,i);const u=o.spawnSync(l.command,l.args,l.options);u.error=u.error||c.verifyENOENTSync(u.status,l);return u}t.exports=spawn;t.exports.spawn=spawn;t.exports.sync=spawnSync;t.exports._parse=a;t.exports._enoent=c},9170:t=>{"use strict";const r=process.platform==="win32";function notFoundError(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function hookChildProcess(t,i){if(!r){return}const o=t.emit;t.emit=function(r,a){if(r==="exit"){const r=verifyENOENT(a,i,"spawn");if(r){return o.call(t,"error",r)}}return o.apply(t,arguments)}}function verifyENOENT(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawn")}return null}function verifyENOENTSync(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawnSync")}return null}t.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},3529:(t,r,i)=>{"use strict";const o=i(1017);const a=i(5499);const c=i(1024);const l=i(7091);const u=process.platform==="win32";const h=/\.(?:com|exe)$/i;const d=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(t){t.file=a(t);const r=t.file&&l(t.file);if(r){t.args.unshift(t.file);t.command=r;return a(t)}return t.file}function parseNonShell(t){if(!u){return t}const r=detectShebang(t);const i=!h.test(r);if(t.options.forceShell||i){const i=d.test(r);t.command=o.normalize(t.command);t.command=c.command(t.command);t.args=t.args.map((t=>c.argument(t,i)));const a=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${a}"`];t.command=process.env.comspec||"cmd.exe";t.options.windowsVerbatimArguments=true}return t}function parse(t,r,i){if(r&&!Array.isArray(r)){i=r;r=null}r=r?r.slice(0):[];i=Object.assign({},i);const o={command:t,args:r,options:i,file:undefined,original:{command:t,args:r}};return i.shell?o:parseNonShell(o)}t.exports=parse},1024:t=>{"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(t){t=t.replace(r,"^$1");return t}function escapeArgument(t,i){t=`${t}`;t=t.replace(/(\\*)"/g,'$1$1\\"');t=t.replace(/(\\*)$/,"$1$1");t=`"${t}"`;t=t.replace(r,"^$1");if(i){t=t.replace(r,"^$1")}return t}t.exports.command=escapeCommand;t.exports.argument=escapeArgument},7091:(t,r,i)=>{"use strict";const o=i(7147);const a=i(7256);function readShebang(t){const r=150;const i=Buffer.alloc(r);let c;try{c=o.openSync(t,"r");o.readSync(c,i,0,r,0);o.closeSync(c)}catch(t){}return a(i.toString())}t.exports=readShebang},5499:(t,r,i)=>{"use strict";const o=i(1017);const a=i(8085);const c=i(7460);function resolveCommandAttempt(t,r){const i=t.options.env||process.env;const l=process.cwd();const u=t.options.cwd!=null;const h=u&&process.chdir!==undefined&&!process.chdir.disabled;if(h){try{process.chdir(t.options.cwd)}catch(t){}}let d;try{d=a.sync(t.command,{path:i[c({env:i})],pathExt:r?o.delimiter:undefined})}catch(t){}finally{if(h){process.chdir(l)}}if(d){d=o.resolve(u?t.options.cwd:"",d)}return d}function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,true)}t.exports=resolveCommand},1599:(t,r,i)=>{"use strict";const{Transform:o,PassThrough:a}=i(2781);const c=i(9796);const l=i(2693);t.exports=t=>{const r=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(r)){return t}const i=r==="br";if(i&&typeof c.createBrotliDecompress!=="function"){t.destroy(new Error("Brotli is not supported on Node.js < 12"));return t}let u=true;const h=new o({transform(t,r,i){u=false;i(null,t)},flush(t){t()}});const d=new a({autoDestroy:false,destroy(r,i){t.destroy();i(r)}});const p=i?c.createBrotliDecompress():c.createUnzip();p.once("error",(r=>{if(u&&!t.readable){d.end();return}d.destroy(r)}));l(t,d);t.pipe(h).pipe(p).pipe(d);return d}},3110:t=>{"use strict";
3
3
  /*!
4
4
  * @description Recursive object extending
5
5
  * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
@@ -63,4 +63,4 @@ var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}
63
63
  *
64
64
  * Copyright (c) 2015-present, Jon Schlinkert.
65
65
  * Released under the MIT License.
66
- */const o=i(8387);const toRegexRange=(t,r,i)=>{if(o(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(r===void 0||t===r){return String(t)}if(o(r)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let a={relaxZeros:true,...i};if(typeof a.strictZeros==="boolean"){a.relaxZeros=a.strictZeros===false}let c=String(a.relaxZeros);let l=String(a.shorthand);let u=String(a.capture);let h=String(a.wrap);let d=t+":"+r+"="+c+l+u+h;if(toRegexRange.cache.hasOwnProperty(d)){return toRegexRange.cache[d].result}let p=Math.min(t,r);let m=Math.max(t,r);if(Math.abs(p-m)===1){let i=t+"|"+r;if(a.capture){return`(${i})`}if(a.wrap===false){return i}return`(?:${i})`}let g=hasPadding(t)||hasPadding(r);let y={min:t,max:r,a:p,b:m};let b=[];let v=[];if(g){y.isPadded=g;y.maxLen=String(y.max).length}if(p<0){let t=m<0?Math.abs(m):1;v=splitToPatterns(t,Math.abs(p),y,a);p=y.a=0}if(m>=0){b=splitToPatterns(p,m,y,a)}y.negatives=v;y.positives=b;y.result=collatePatterns(v,b,a);if(a.capture===true){y.result=`(${y.result})`}else if(a.wrap!==false&&b.length+v.length>1){y.result=`(?:${y.result})`}toRegexRange.cache[d]=y;return y.result};function collatePatterns(t,r,i){let o=filterPatterns(t,r,"-",false,i)||[];let a=filterPatterns(r,t,"",false,i)||[];let c=filterPatterns(t,r,"-?",true,i)||[];let l=o.concat(c).concat(a);return l.join("|")}function splitToRanges(t,r){let i=1;let o=1;let a=countNines(t,i);let c=new Set([r]);while(t<=a&&a<=r){c.add(a);i+=1;a=countNines(t,i)}a=countZeros(r+1,o)-1;while(t<a&&a<=r){c.add(a);o+=1;a=countZeros(r+1,o)-1}c=[...c];c.sort(compare);return c}function rangeToPattern(t,r,i){if(t===r){return{pattern:t,count:[],digits:0}}let o=zip(t,r);let a=o.length;let c="";let l=0;for(let t=0;t<a;t++){let[r,a]=o[t];if(r===a){c+=r}else if(r!=="0"||a!=="9"){c+=toCharacterClass(r,a,i)}else{l++}}if(l){c+=i.shorthand===true?"\\d":"[0-9]"}return{pattern:c,count:[l],digits:a}}function splitToPatterns(t,r,i,o){let a=splitToRanges(t,r);let c=[];let l=t;let u;for(let t=0;t<a.length;t++){let r=a[t];let h=rangeToPattern(String(l),String(r),o);let d="";if(!i.isPadded&&u&&u.pattern===h.pattern){if(u.count.length>1){u.count.pop()}u.count.push(h.count[0]);u.string=u.pattern+toQuantifier(u.count);l=r+1;continue}if(i.isPadded){d=padZeros(r,i,o)}h.string=d+h.pattern+toQuantifier(h.count);c.push(h);l=r+1;u=h}return c}function filterPatterns(t,r,i,o,a){let c=[];for(let a of t){let{string:t}=a;if(!o&&!contains(r,"string",t)){c.push(i+t)}if(o&&contains(r,"string",t)){c.push(i+t)}}return c}function zip(t,r){let i=[];for(let o=0;o<t.length;o++)i.push([t[o],r[o]]);return i}function compare(t,r){return t>r?1:r>t?-1:0}function contains(t,r,i){return t.some((t=>t[r]===i))}function countNines(t,r){return Number(String(t).slice(0,-r)+"9".repeat(r))}function countZeros(t,r){return t-t%Math.pow(10,r)}function toQuantifier(t){let[r=0,i=""]=t;if(i||r>1){return`{${r+(i?","+i:"")}}`}return""}function toCharacterClass(t,r,i){return`[${t}${r-t===1?"":"-"}${r}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,r,i){if(!r.isPadded){return t}let o=Math.abs(r.maxLen-String(t).length);let a=i.relaxZeros!==false;switch(o){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:{return a?`0{0,${o}}`:`0{${o}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},2817:(t,r,i)=>{const{URL:o}=i(7310);const{join:a}=i(1017);const c=i(7147);const{promisify:l}=i(3837);const{tmpdir:u}=i(2037);const h=i(2404);const d=l(c.writeFile);const p=l(c.mkdir);const m=l(c.readFile);const compareVersions=(t,r)=>t.localeCompare(r,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,r)=>{const i=u();const o=a(i,"update-check");if(!c.existsSync(o)){await p(o)}let l=`${t.name}-${r}.json`;if(t.scope){l=`${t.scope}-${l}`}return a(o,l)};const evaluateCache=async(t,r,i)=>{if(c.existsSync(t)){const o=await m(t,"utf8");const{lastUpdate:a,latest:c}=JSON.parse(o);const l=a+i;if(l>r){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,r,i)=>{const o=JSON.stringify({latest:r,lastUpdate:i});await d(t,o,"utf8")};const loadPackage=(t,r)=>new Promise(((o,a)=>{const c={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(r){c.headers.authorization=`${r.type} ${r.token}`}const{get:l}=i(t.protocol==="https:"?5687:3685);l(c,(t=>{const{statusCode:r}=t;if(r!==200){const i=new Error(`Request failed with code ${r}`);i.code=r;a(i);t.resume();return}let i="";t.setEncoding("utf8");t.on("data",(t=>{i+=t}));t.on("end",(()=>{try{const t=JSON.parse(i);o(t)}catch(t){a(t)}}))})).on("error",a).on("timeout",a)}));const getMostRecent=async({full:t,scope:r},a)=>{const c=h(r);const l=new o(t,c);let u=null;try{u=await loadPackage(l)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=i(6377);const r=t(c,{recursive:true});u=await loadPackage(l,r)}else{throw t}}const d=u["dist-tags"][a];if(!d){throw new Error(`Distribution tag ${a} is not available`)}return d};const g={interval:36e5,distTag:"latest"};const getDetails=t=>{const r={full:encode(t)};if(t.includes("/")){const i=t.split("/");r.scope=i[0];r.name=i[1]}else{r.scope=null;r.name=t}return r};t.exports=async(t,r)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const i=getDetails(t.name);const o=Date.now();const{distTag:a,interval:c}=Object.assign({},g,r);const l=await getFile(i,a);let u=null;let h=true;({shouldCheck:h,latest:u}=await evaluateCache(l,o,c));if(h){u=await getMostRecent(i,a);await updateCache(l,u,o)}const d=compareVersions(t.version,u);if(d===-1){return{latest:u,fromCache:!h}}return null}},8085:(t,r,i)=>{const o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const a=i(1017);const c=o?";":":";const l=i(2212);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,r)=>{const i=r.colon||c;const a=t.match(/\//)||o&&t.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(i)];const l=o?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const u=o?l.split(i):[""];if(o){if(t.indexOf(".")!==-1&&u[0]!=="")u.unshift("")}return{pathEnv:a,pathExt:u,pathExtExe:l}};const which=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}if(!r)r={};const{pathEnv:o,pathExt:c,pathExtExe:u}=getPathInfo(t,r);const h=[];const step=i=>new Promise(((c,l)=>{if(i===o.length)return r.all&&h.length?c(h):l(getNotFoundError(t));const u=o[i];const d=/^".*"$/.test(u)?u.slice(1,-1):u;const p=a.join(d,t);const m=!d&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(subStep(m,i,0))}));const subStep=(t,i,o)=>new Promise(((a,d)=>{if(o===c.length)return a(step(i+1));const p=c[o];l(t+p,{pathExt:u},((c,l)=>{if(!c&&l){if(r.all)h.push(t+p);else return a(t+p)}return a(subStep(t,i,o+1))}))}));return i?step(0).then((t=>i(null,t)),i):step(0)};const whichSync=(t,r)=>{r=r||{};const{pathEnv:i,pathExt:o,pathExtExe:c}=getPathInfo(t,r);const u=[];for(let h=0;h<i.length;h++){const d=i[h];const p=/^".*"$/.test(d)?d.slice(1,-1):d;const m=a.join(p,t);const g=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;for(let t=0;t<o.length;t++){const i=g+o[t];try{const t=l.sync(i,{pathExt:c});if(t){if(r.all)u.push(i);else return i}}catch(t){}}}if(r.all&&u.length)return u;if(r.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},2928:t=>{t.exports=wrappy;function wrappy(t,r){if(t&&r)return wrappy(t)(r);if(typeof t!=="function")throw new TypeError("need wrapper function");Object.keys(t).forEach((function(r){wrapper[r]=t[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var i=0;i<r.length;i++){r[i]=arguments[i]}var o=t.apply(this,r);var a=r[r.length-1];if(typeof o==="function"&&o!==a){Object.keys(a).forEach((function(t){o[t]=a[t]}))}return o}}},6077:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},605:(t,r,i)=>{"use strict";t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var r=this;if(!(r instanceof Yallist)){r=new Yallist}r.tail=null;r.head=null;r.length=0;if(t&&typeof t.forEach==="function"){t.forEach((function(t){r.push(t)}))}else if(arguments.length>0){for(var i=0,o=arguments.length;i<o;i++){r.push(arguments[i])}}return r}Yallist.prototype.removeNode=function(t){if(t.list!==this){throw new Error("removing node which does not belong to this list")}var r=t.next;var i=t.prev;if(r){r.prev=i}if(i){i.next=r}if(t===this.head){this.head=r}if(t===this.tail){this.tail=i}t.list.length--;t.next=null;t.prev=null;t.list=null;return r};Yallist.prototype.unshiftNode=function(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}var r=this.head;t.list=this;t.next=r;if(r){r.prev=t}this.head=t;if(!this.tail){this.tail=t}this.length++};Yallist.prototype.pushNode=function(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}var r=this.tail;t.list=this;t.prev=r;if(r){r.next=t}this.tail=t;if(!this.head){this.head=t}this.length++};Yallist.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++){push(this,arguments[t])}return this.length};Yallist.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++){unshift(this,arguments[t])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var t=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return t};Yallist.prototype.shift=function(){if(!this.head){return undefined}var t=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return t};Yallist.prototype.forEach=function(t,r){r=r||this;for(var i=this.head,o=0;i!==null;o++){t.call(r,i.value,o,this);i=i.next}};Yallist.prototype.forEachReverse=function(t,r){r=r||this;for(var i=this.tail,o=this.length-1;i!==null;o--){t.call(r,i.value,o,this);i=i.prev}};Yallist.prototype.get=function(t){for(var r=0,i=this.head;i!==null&&r<t;r++){i=i.next}if(r===t&&i!==null){return i.value}};Yallist.prototype.getReverse=function(t){for(var r=0,i=this.tail;i!==null&&r<t;r++){i=i.prev}if(r===t&&i!==null){return i.value}};Yallist.prototype.map=function(t,r){r=r||this;var i=new Yallist;for(var o=this.head;o!==null;){i.push(t.call(r,o.value,this));o=o.next}return i};Yallist.prototype.mapReverse=function(t,r){r=r||this;var i=new Yallist;for(var o=this.tail;o!==null;){i.push(t.call(r,o.value,this));o=o.prev}return i};Yallist.prototype.reduce=function(t,r){var i;var o=this.head;if(arguments.length>1){i=r}else if(this.head){o=this.head.next;i=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=0;o!==null;a++){i=t(i,o.value,a);o=o.next}return i};Yallist.prototype.reduceReverse=function(t,r){var i;var o=this.tail;if(arguments.length>1){i=r}else if(this.tail){o=this.tail.prev;i=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=this.length-1;o!==null;a--){i=t(i,o.value,a);o=o.prev}return i};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var r=0,i=this.head;i!==null;r++){t[r]=i.value;i=i.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var r=0,i=this.tail;i!==null;r++){t[r]=i.value;i=i.prev}return t};Yallist.prototype.slice=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}for(;a!==null&&o<r;o++,a=a.next){i.push(a.value)}return i};Yallist.prototype.sliceReverse=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=this.length,a=this.tail;a!==null&&o>r;o--){a=a.prev}for(;a!==null&&o>t;o--,a=a.prev){i.push(a.value)}return i};Yallist.prototype.splice=function(t,r,...i){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}var c=[];for(var o=0;a&&o<r;o++){c.push(a.value);a=this.removeNode(a)}if(a===null){a=this.tail}if(a!==this.head&&a!==this.tail){a=a.prev}for(var o=0;o<i.length;o++){a=insert(this,a,i[o])}return c};Yallist.prototype.reverse=function(){var t=this.head;var r=this.tail;for(var i=t;i!==null;i=i.prev){var o=i.prev;i.prev=i.next;i.next=o}this.head=r;this.tail=t;return this};function insert(t,r,i){var o=r===t.head?new Node(i,null,r,t):new Node(i,r,r.next,t);if(o.next===null){t.tail=o}if(o.prev===null){t.head=o}t.length++;return o}function push(t,r){t.tail=new Node(r,t.tail,null,t);if(!t.head){t.head=t.tail}t.length++}function unshift(t,r){t.head=new Node(r,null,t.head,t);if(!t.tail){t.tail=t.head}t.length++}function Node(t,r,i,o){if(!(this instanceof Node)){return new Node(t,r,i,o)}this.list=o;this.value=t;if(r){r.next=this;this.prev=r}else{this.prev=null}if(i){i.prev=this;this.next=i}else{this.next=null}}try{i(6077)(Yallist)}catch(t){}},5979:(t,r,i)=>{"use strict";i.r(r);const o=10;const wrapAnsi16=(t=0)=>r=>`[${r+t}m`;const wrapAnsi256=(t=0)=>r=>`[${38+t};5;${r}m`;const wrapAnsi16m=(t=0)=>(r,i,o)=>`[${38+t};2;${r};${i};${o}m`;function assembleStyles(){const t=new Map;const r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright;r.bgColor.bgGray=r.bgColor.bgBlackBright;r.color.grey=r.color.blackBright;r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(const[i,o]of Object.entries(r)){for(const[i,a]of Object.entries(o)){r[i]={open:`[${a[0]}m`,close:`[${a[1]}m`};o[i]=r[i];t.set(a[0],a[1])}Object.defineProperty(r,i,{value:o,enumerable:false})}Object.defineProperty(r,"codes",{value:t,enumerable:false});r.color.close="";r.bgColor.close="";r.color.ansi=wrapAnsi16();r.color.ansi256=wrapAnsi256();r.color.ansi16m=wrapAnsi16m();r.bgColor.ansi=wrapAnsi16(o);r.bgColor.ansi256=wrapAnsi256(o);r.bgColor.ansi16m=wrapAnsi16m(o);Object.defineProperties(r,{rgbToAnsi256:{value:(t,r,i)=>{if(t===r&&r===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value:t=>{const r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r){return[0,0,0]}let{colorString:i}=r.groups;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,o&255]},enumerable:false},hexToAnsi256:{value:t=>r.rgbToAnsi256(...r.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value:t=>{if(t<8){return 30+t}if(t<16){return 90+(t-8)}let r;let i;let o;if(t>=232){r=((t-232)*10+8)/255;i=r;o=r}else{t-=16;const a=t%36;r=Math.floor(t/36)/5;i=Math.floor(a/6)/5;o=a%6/5}const a=Math.max(r,i,o)*2;if(a===0){return 30}let c=30+(Math.round(o)<<2|Math.round(i)<<1|Math.round(r));if(a===2){c+=60}return c},enumerable:false},rgbToAnsi:{value:(t,i,o)=>r.ansi256ToAnsi(r.rgbToAnsi256(t,i,o)),enumerable:false},hexToAnsi:{value:t=>r.ansi256ToAnsi(r.hexToAnsi256(t)),enumerable:false}});return r}const a=assembleStyles();const c=a;const l=require("node:process");const u=require("node:os");const h=require("node:tty");function hasFlag(t,r=l.argv){const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1||o<a)}const{env:d}=l;let p;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){p=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){p=1}function envForceColor(){if("FORCE_COLOR"in d){if(d.FORCE_COLOR==="true"){return 1}if(d.FORCE_COLOR==="false"){return 0}return d.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(d.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:r,sniffFlags:i=true}={}){const o=envForceColor();if(o!==undefined){p=o}const a=i?p:o;if(a===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if(t&&!r&&a===undefined){return 0}const c=a||0;if(d.TERM==="dumb"){return c}if(l.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in d){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in d))||d.CI_NAME==="codeship"){return 1}return c}if("TEAMCITY_VERSION"in d){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0}if("TF_BUILD"in d&&"AGENT_NAME"in d){return 1}if(d.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in d){const t=Number.parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)){return 1}if("COLORTERM"in d){return 1}return c}function createSupportsColor(t,r={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...r});return translateLevel(i)}const m={stdout:createSupportsColor({isTTY:h.isatty(1)}),stderr:createSupportsColor({isTTY:h.isatty(2)})};const g=m;function stringReplaceAll(t,r,i){let o=t.indexOf(r);if(o===-1){return t}const a=r.length;let c=0;let l="";do{l+=t.substr(c,o-c)+r+i;c=o+a;o=t.indexOf(r,c)}while(o!==-1);l+=t.slice(c);return l}function stringEncaseCRLFWithFirstIndex(t,r,i,o){let a=0;let c="";do{const l=t[o-1]==="\r";c+=t.substr(a,(l?o-1:o)-a)+r+(l?"\r\n":"\n")+i;a=o+1;o=t.indexOf("\n",a)}while(o!==-1);c+=t.slice(a);return c}const{stdout:y,stderr:b}=g;const v=Symbol("GENERATOR");const _=Symbol("STYLER");const w=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const S=Object.create(null);const applyOptions=(t,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=y?y.level:0;t.level=r.level===undefined?i:r.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,r]of Object.entries(c)){S[t]={get(){const i=createBuilder(this,createStyler(r.open,r.close,this[_]),this[w]);Object.defineProperty(this,t,{value:i});return i}}}S.visible={get(){const t=createBuilder(this,this[_],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,r,i,...o)=>{if(t==="rgb"){if(r==="ansi16m"){return c[i].ansi16m(...o)}if(r==="ansi256"){return c[i].ansi256(c.rgbToAnsi256(...o))}return c[i].ansi(c.rgbToAnsi(...o))}if(t==="hex"){return getModelAnsi("rgb",r,i,...c.hexToRgb(...o))}return c[i][t](...o)};const O=["rgb","hex","ansi256"];for(const t of O){S[t]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"color",...i),c.color.close,this[_]);return createBuilder(this,o,this[w])}}};const r="bg"+t[0].toUpperCase()+t.slice(1);S[r]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"bgColor",...i),c.bgColor.close,this[_]);return createBuilder(this,o,this[w])}}}}const R=Object.defineProperties((()=>{}),{...S,level:{enumerable:true,get(){return this[v].level},set(t){this[v].level=t}}});const createStyler=(t,r,i)=>{let o;let a;if(i===undefined){o=t;a=r}else{o=i.openAll+t;a=r+i.closeAll}return{open:t,close:r,openAll:o,closeAll:a,parent:i}};const createBuilder=(t,r,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,R);builder[v]=t;builder[_]=r;builder[w]=i;return builder};const applyStyle=(t,r)=>{if(t.level<=0||!r){return t[w]?"":r}let i=t[_];if(i===undefined){return r}const{openAll:o,closeAll:a}=i;if(r.includes("")){while(i!==undefined){r=stringReplaceAll(r,i.close,i.open);i=i.parent}}const c=r.indexOf("\n");if(c!==-1){r=stringEncaseCRLFWithFirstIndex(r,a,o,c)}return o+r+a};Object.defineProperties(createChalk.prototype,S);const x=createChalk();const A=createChalk({level:b?b.level:0});const T=x;var k=i(2492);const{program:C,createCommand:P,createArgument:I,createOption:L,CommanderError:N,InvalidArgumentError:M,Command:D,Argument:j,Option:$,Help:H}=k;var B=i(2817);var U=i.n(B);var q=i(7328);var G=i.n(q);var V=i(1017);var z=i.n(V);var W=i(7147);var Y=i.n(W);function isSetup(){try{const t=Y().statSync(z().join(process.cwd(),".hyperbook"));if(!t.isDirectory()){throw Error()}}catch(t){console.log(T.red("Could not find .hyperbook folder. Be sure to run `hyperbook setup`."));return false}try{Y().statSync(z().join(process.cwd(),".hyperbook","node_modules",".bin","next"))}catch(t){console.log(T.red("Could not find next binary in the .hyperbook folder. Be sure to run `hyperbook setup`."));return false}return true}async function readHyperbook(){return new Promise(((t,r)=>{Y().readFile(z().join(process.cwd(),"hyperbook.json"),((i,o)=>{if(i){console.log(T.red("Could not find 'hyperbook.json'. Make sure you are in the right directory."));r()}else{const r=JSON.parse(o.toString());t(r)}}))}))}async function runBuild(){const t=isSetup();if(!t){return}const r=await readHyperbook();if(r===null||r===void 0?void 0:r.basePath){Y().writeFileSync(z().join(process.cwd(),".hyperbook","next.config.js"),`\nmodule.exports = {\n basePath: '${r.basePath}',\n typescript: {\n ignoreBuildErrors: true,\n }\n}\n `)}return new Promise(((t,r)=>{const i="npm";const o=["run","build"];const a=G()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}async function runDev(){const t=isSetup();if(!t){return}return new Promise(((t,r)=>{const i="npm";const o=["run","dev"];const a=G()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}var K=i(2081);function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,K.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,K.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}var X=i(2037);var Z=i.n(X);const Q=require("node:events");const J=require("node:path");function indentString(t,r=1,i={}){const{indent:o=" ",includeEmptyLines:a=false}=i;if(typeof t!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(r<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``)}if(typeof o!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof o}\``)}if(r===0){return t}const c=a?/^/gm:/^(?!\s*$)/gm;return t.replace(c,o.repeat(r))}function escapeStringRegexp(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ee=/\s+at.*[(\s](.*)\)?/;const te=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;const re=typeof X.homedir==="undefined"?"":X.homedir().replace(/\\/g,"/");function cleanStack(t,{pretty:r=false,basePath:i}={}){const o=i&&new RegExp(`(at | \\()${escapeStringRegexp(i.replace(/\\/g,"/"))}`,"g");if(typeof t!=="string"){return undefined}return t.replace(/\\/g,"/").split("\n").filter((t=>{const r=t.match(ee);if(r===null||!r[1]){return true}const i=r[1];if(i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")){return false}return!te.test(i)})).filter((t=>t.trim()!=="")).map((t=>{if(o){t=t.replace(o,"$1")}if(r){t=t.replace(ee,((t,r)=>t.replace(r,r.replace(re,"~"))))}return t})).join("\n")}const cleanInternalStack=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t)){throw new TypeError(`Expected input to be an Array, got ${typeof t}`)}t=t.map((t=>{if(t instanceof Error){return t}if(t!==null&&typeof t==="object"){return Object.assign(new Error(t.message),t)}return new Error(t)}));let r=t.map((t=>typeof t.stack==="string"?cleanInternalStack(cleanStack(t.stack)):String(t))).join("\n");r="\n"+indentString(r,4);super(r);this.#e=t}get errors(){return this.#e.slice()}}async function pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true}={}){return new Promise(((a,c)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const l=[];const u=[];const h=new Map;let d=false;let p=false;let m=false;let g=0;let y=0;const b=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{d=true;p=true;c(t)};const next=async()=>{if(p){return}const t=await b.next();const i=y;y++;if(t.done){m=true;if(g===0&&!p){if(!o&&u.length>0){reject(new AggregateError(u));return}p=true;if(!h.size){a(l);return}const t=[];for(const[r,i]of l.entries()){if(h.get(r)===se){continue}t.push(i)}a(t)}return}g++;(async()=>{try{const o=await t.value;if(p){return}const a=await r(o,i);if(a===se){h.set(i,a)}l[i]=a;g--;await next()}catch(t){if(o){reject(t)}else{u.push(t);g--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(m||d){break}}})()}))}const se=Symbol("skip");function arrify(t){if(t===null||t===undefined){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]}var ie=i(654);async function pFilter(t,r,i){const o=await pMap(t,((t,i)=>Promise.all([r(t,i),t])),i);return o.filter((t=>Boolean(t[0]))).map((t=>t[1]))}const ne=require("node:fs");var oe=i(1382);var ae=i(3924);var ce=i(5352);var le=i(6302);function slash(t){const r=/^\\\\\?\\/.test(t);const i=/[^\u0000-\u0080]+/.test(t);if(r||i){return t}return t.replace(/\\/g,"/")}const ue=require("node:url");const he=require("node:stream");const toPath=t=>t instanceof URL?(0,ue.fileURLToPath)(t):t;class FilterStream extends he.Transform{constructor(t){super({objectMode:true,transform(r,i,o){o(undefined,t(r)?r:undefined)}})}}const isNegativePattern=t=>t[0]==="!";const fe={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:true,dot:true};const de="**/.gitignore";const applyBaseToPattern=(t,r)=>isNegativePattern(t)?"!"+J.posix.join(r,t.slice(1)):J.posix.join(r,t);const parseIgnoreFile=(t,r)=>{const i=slash(J.relative(r,J.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,i)))};const toRelativePath=(t,r)=>{r=slash(r);if(J.isAbsolute(t)){if(slash(t).startsWith(r)){return J.relative(r,t)}throw new Error(`Path ${t} is not in cwd ${r}`)}return t};const getIsIgnoredPredicate=(t,r)=>{const i=t.flatMap((t=>parseIgnoreFile(t,r)));const o=le().add(i);return t=>{t=toPath(t);t=toRelativePath(t,r);return o.ignores(slash(t))}};const normalizeOptions=(t={})=>({cwd:toPath(t.cwd)||l.cwd()});const isIgnoredByIgnoreFiles=async(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=await ae(t,{cwd:i,...fe});const a=await Promise.all(o.map((async t=>({filePath:t,content:await ne.promises.readFile(t,"utf8")}))));return getIsIgnoredPredicate(a,i)};const isIgnoredByIgnoreFilesSync=(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=ae.sync(t,{cwd:i,...fe});const a=o.map((t=>({filePath:t,content:ne.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(a,i)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(de,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(de,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t.cwd){return}let r;try{r=ne.statSync(t.cwd)}catch{return}if(!r.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={ignore:[],expandDirectories:true,...t,cwd:toPath(t.cwd)};checkCwdOption(t);return t};const normalizeArguments=t=>async(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const normalizeArgumentsSync=t=>(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:r,gitignore:i}=t;const o=r?toPatternsArray(r):[];if(i){o.push(de)}return o};const getFilter=async t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&await isIgnoredByIgnoreFiles(r,{cwd:t.cwd}))};const getFilterSync=t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&isIgnoredByIgnoreFilesSync(r,{cwd:t.cwd}))};const createFilterFunction=t=>{const r=new Set;return i=>{const o=i.path||i;const a=J.normalize(o);const c=r.has(a)||t&&t(o);r.add(a);return!c}};const unionFastGlobResults=(t,r)=>t.flat().filter((t=>r(t)));const unionFastGlobStreams=(t,r)=>oe(t).pipe(new FilterStream((t=>r(t))));const convertNegativePatterns=(t,r)=>{const i=[];while(t.length>0){const o=t.findIndex((t=>isNegativePattern(t)));if(o===-1){i.push({patterns:t,options:r});break}const a=t[o].slice(1);for(const t of i){t.options.ignore.push(a)}if(o!==0){i.push({patterns:t.slice(0,o),options:{...r,ignore:[...r.ignore,a]}})}t=t.slice(o+1)}return i};const getDirGlobOptions=(t,r)=>({...r?{cwd:r}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const c=getDirGlobOptions(a,o);const l=o?{cwd:o}:undefined;return Promise.all(i.map((async t=>{let{patterns:r,options:i}=t;[r,i.ignore]=await Promise.all([ce(r,c),ce(i.ignore,l)]);return{patterns:r,options:i}})))};const generateTasksSync=(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const c=getDirGlobOptions(a,o);const l=o?{cwd:o}:undefined;return i.map((t=>{let{patterns:r,options:i}=t;r=ce.sync(r,c);i.ignore=ce.sync(i.ignore,l);return{patterns:r,options:i}}))};const pe=normalizeArguments((async(t,r)=>{const[i,o]=await Promise.all([generateTasks(t,r),getFilter(r)]);const a=await Promise.all(i.map((t=>ae(t.patterns,t.options))));return unionFastGlobResults(a,o)}));const me=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>ae.sync(t.patterns,t.options)));return unionFastGlobResults(a,o)}));const ge=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>ae.stream(t.patterns,t.options)));return unionFastGlobStreams(a,o)}));const ye=normalizeArgumentsSync(((t,r)=>t.some((t=>ae.isDynamicPattern(t,r)))));const be=normalizeArguments(generateTasks);const ve=normalizeArgumentsSync(generateTasksSync);var _e=i(1224);var we=i(5842);class CpyError extends we{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpyError"}}const Ee=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"];const Se=new RegExp(Ee.join("|"));function isJunk(t){return Se.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,r,i){this.path=t;this.originalPath=t;this.destination=r;this.options=i;this.isDirectory=false;if(!ye(t)&&ne.existsSync(t)&&ne.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return J.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const r=t.findIndex((t=>t?ye(t):false));const i=t.slice(0,r).join("/");if(i){return J.isAbsolute(i)?i:J.join(this.options.cwd,i)}return this.destination}hasMagic(){return ye(this.options.flat?this.path:this.originalPath)}getMatches(){let t=me(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(J.basename(t))))}return t}}const Oe=(u.cpus().length||1)*2;const Re={ignoreJunk:true,flat:false,cwd:l.cwd()};class Entry{constructor(t,r,i){this.path=t.split("/").join(J.sep);this.relativePath=r.split("/").join(J.sep);this.pattern=i;Object.freeze(this)}get name(){return J.basename(this.path)}get nameWithoutExtension(){return J.basename(this.path,J.extname(this.path))}get extension(){return J.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>_e.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:r,options:i})=>{if(t.pattern.hasMagic()){if(i.flat){if(J.isAbsolute(r)){return J.join(r,t.name)}return J.join(i.cwd,r,t.name)}return J.join(r,J.relative(t.pattern.normalizedPath,t.path))}if(J.isAbsolute(r)){return J.join(r,t.name)}if(t.pattern.isDirectory&&J.relative(i.cwd,t.path).startsWith("..")){return J.join(i.cwd,r,J.basename(t.pattern.originalPath),J.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return J.join(i.cwd,r,J.basename(t.pattern.originalPath),J.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&i.flat){return J.join(i.cwd,r,J.basename(t.pattern.originalPath))}return J.join(i.cwd,r,J.relative(i.cwd,t.path))};const renameFile=(t,r)=>{const i=J.basename(t,J.extname(t));const o=J.extname(t);const a=J.dirname(t);if(typeof r==="string"){return J.join(a,r)}if(typeof r==="function"){return J.join(a,`${r(i)}${o}`)}return t};function cpy(t,r,{concurrency:i=Oe,...o}={}){const a=new Map;const c=new Q;o={...Re,...o};const l=(async()=>{let l=[];let u=0;let h=0;let d=expandPatternsWithBraceExpansion(arrify(t)).map((t=>t.replace(/\\/g,"/")));const p=d.filter((t=>!t.startsWith("!")));const m=d.filter((t=>t.startsWith("!")));if(p.length===0||!r){throw new CpyError("`source` and `destination` required")}d=d.map((t=>new GlobPattern(t,r,{...o,ignore:m})));for(const t of d){let r=[];try{r=t.getMatches()}catch(r){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${r.message}`,r)}if(r.length===0&&!ye(t.originalPath)&&!ye(m)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}l=[...l,...r.map((r=>new Entry(r,J.relative(o.cwd,r),t)))]}if(o.filter!==undefined){l=await pFilter(l,o.filter,{concurrency:1024})}if(l.length===0){c.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const r=a.get(t.sourcePath)||{writtenBytes:0,percent:0};if(r.writtenBytes!==t.writtenBytes||r.percent!==t.percent){h-=r.writtenBytes;h+=t.writtenBytes;if(t.percent===1&&r.percent!==1){u++}a.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});c.emit("progress",{totalFiles:l.length,percent:u/l.length,completedFiles:u,completedSize:h})}};return pMap(l,(async t=>{const i=renameFile(preprocessDestinationPath({entry:t,destination:r,options:o}),o.rename);try{await ie(t.path,i,o).on("progress",fileProgressHandler)}catch(r){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${i}\`: ${r.message}`,r)}return i}),{concurrency:i})})();l.on=(...t)=>{c.on(...t);return l};return l}var xe=i(6718);var Ae=i.n(xe);function isFolderEmpty(t,r){const i=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const o=Y().readdirSync(t).filter((t=>!i.includes(t))).filter((t=>!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${T.green(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=Y().lstatSync(z().join(t,r));if(i.isDirectory()){console.log(` ${T.blue(r)}/`)}else{console.log(` ${r}`)}}catch{console.log(` ${r}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await Y().promises.access(t,(Y().constants||Y()).W_OK);return true}catch(t){return false}}async function makeDir(t,r={recursive:true}){await Y().promises.mkdir(t,r)}var Te=i(2625);var ke=i.n(Te);function isInGitRepository(){try{(0,K.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,K.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,K.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,K.execSync)("git init",{stdio:"ignore"});r=true;(0,K.execSync)("git checkout -b main",{stdio:"ignore"});(0,K.execSync)("git add -A",{stdio:"ignore"});(0,K.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(i){if(r){try{ke().sync(z().join(t,".git"))}catch(t){}}return false}}var Ce=i(8950);class CancelError extends Error{constructor(t){super(t||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(t){return(...r)=>new PCancelable(((i,o,a)=>{r.push(a);t(...r).then(i,o)}))}constructor(t){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((r,i)=>{this._reject=i;const onResolve=t=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;r(t)}};const onReject=t=>{this._isPending=false;i(t)};const onCancel=t=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(t)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}});t(onResolve,onReject,onCancel)}))}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const t of this._cancelHandlers){t()}}catch(t){this._reject(t);return}}if(this._rejectOnCancel){this._reject(new CancelError(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(t){return Ce.object(t)&&"_onResponse"in t}class RequestError extends Error{constructor(t,r,i){super(t);Object.defineProperty(this,"input",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"stack",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=r.code??"ERR_GOT_REQUEST_ERROR";this.input=r.input;if(isRequest(i)){Object.defineProperty(this,"request",{enumerable:false,value:i});Object.defineProperty(this,"response",{enumerable:false,value:i.response});this.options=i.options}else{this.options=i}this.timings=this.request?.timings;if(Ce.string(r.stack)&&Ce.string(this.stack)){const t=this.stack.indexOf(this.message)+this.message.length;const i=this.stack.slice(t).split("\n").reverse();const o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split("\n").reverse();while(o.length>0&&o[0]===i[0]){i.shift()}this.stack=`${this.stack.slice(0,t)}${i.reverse().join("\n")}${o.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t);this.name="MaxRedirectsError";this.code="ERR_TOO_MANY_REDIRECTS"}}class HTTPError extends RequestError{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request);this.name="HTTPError";this.code="ERR_NON_2XX_3XX_RESPONSE"}}class CacheError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="CacheError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}}class UploadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="UploadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}class TimeoutError extends RequestError{constructor(t,r,i){super(t.message,t,i);Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.event=t.event;this.timings=r}}class ReadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="ReadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class RetryError extends RequestError{constructor(t){super("Retrying",{},t);this.name="RetryError";this.code="ERR_RETRYING"}}const Pe=require("node:buffer");const Ie=require("node:http");var Le=i(2361);var Ne=i(3837);var Me=i(2966);const timer=t=>{if(t.timings){return t.timings}const r={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};t.timings=r;const handleError=t=>{t.once(Le.errorMonitor,(()=>{r.error=Date.now();r.phases.total=r.error-r.start}))};handleError(t);const onAbort=()=>{r.abort=Date.now();r.phases.total=r.abort-r.start};t.prependOnceListener("abort",onAbort);const onSocket=t=>{r.socket=Date.now();r.phases.wait=r.socket-r.start;if(Ne.types.isProxy(t)){return}const lookupListener=()=>{r.lookup=Date.now();r.phases.dns=r.lookup-r.socket};t.prependOnceListener("lookup",lookupListener);Me(t,{connect:()=>{r.connect=Date.now();if(r.lookup===undefined){t.removeListener("lookup",lookupListener);r.lookup=r.connect;r.phases.dns=r.lookup-r.socket}r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now();r.phases.tls=r.secureConnect-r.connect}})};if(t.socket){onSocket(t.socket)}else{t.prependOnceListener("socket",onSocket)}const onUpload=()=>{r.upload=Date.now();r.phases.request=r.upload-(r.secureConnect??r.connect)};if(t.writableFinished){onUpload()}else{t.prependOnceListener("finish",onUpload)}t.prependOnceListener("response",(i=>{r.response=Date.now();r.phases.firstByte=r.response-r.upload;i.timings=r;handleError(i);i.prependOnceListener("end",(()=>{t.off("abort",onAbort);i.off("aborted",onAbort);if(r.phases.total){return}r.end=Date.now();r.phases.download=r.end-r.response;r.phases.total=r.end-r.start}));i.prependOnceListener("aborted",onAbort)}));return r};const De=timer;var je=i(3846);var $e=i(1599);var Fe=i(7981);const He="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let t=16;let r="";while(t--){r+=He[Math.random()*He.length<<0]}return r}const Be=createBoundary;const getType=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function isPlainObject(t){if(getType(t)!=="object"){return false}const r=Object.getPrototypeOf(t);if(r===null||r===undefined){return true}const i=r.constructor&&r.constructor.toString();return i===Object.toString()}const Ue=isPlainObject;const normalizeValue=t=>String(t).replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n");const qe=normalizeValue;const escapeName=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");const Ge=escapeName;const isFunction=t=>typeof t==="function";const Ve=isFunction;const isFileLike=t=>Boolean(t&&typeof t==="object"&&Ve(t.constructor)&&t[Symbol.toStringTag]==="File"&&Ve(t.stream)&&t.name!=null&&t.size!=null&&t.lastModified!=null);const isFormData=t=>Boolean(t&&Ve(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&Ve(t.append)&&Ve(t.getAll)&&Ve(t.entries)&&Ve(t[Symbol.iterator]));const ze=isFormData;var We=undefined&&undefined.__classPrivateFieldSet||function(t,r,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,i):a?a.value=i:r.set(t,i),i};var Ye=undefined&&undefined.__classPrivateFieldGet||function(t,r,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!o:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:r.get(t)};var Ke,Xe,Ze,Qe,Je,et,tt,rt,st,it;const nt={enableAdditionalHeaders:false};class FormDataEncoder{constructor(t,r,i){Ke.add(this);Xe.set(this,"\r\n");Ze.set(this,void 0);Qe.set(this,void 0);Je.set(this,"-".repeat(2));et.set(this,new TextEncoder);tt.set(this,void 0);rt.set(this,void 0);st.set(this,void 0);if(!isFormData(t)){throw new TypeError("Expected first argument to be a FormData instance.")}let o;if(Ue(r)){i=r}else{o=r}if(!o){o=Be()}if(typeof o!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(i&&!Ue(i)){throw new TypeError("Expected options argument to be an object.")}We(this,rt,t,"f");We(this,st,{...nt,...i},"f");We(this,Ze,Ye(this,et,"f").encode(Ye(this,Xe,"f")),"f");We(this,Qe,Ye(this,Ze,"f").byteLength,"f");this.boundary=`form-data-boundary-${o}`;this.contentType=`multipart/form-data; boundary=${this.boundary}`;We(this,tt,Ye(this,et,"f").encode(`${Ye(this,Je,"f")}${this.boundary}${Ye(this,Je,"f")}${Ye(this,Xe,"f").repeat(2)}`),"f");this.contentLength=String(this.getContentLength());this.headers=Object.freeze({"Content-Type":this.contentType,"Content-Length":this.contentLength});Object.defineProperties(this,{boundary:{writable:false,configurable:false},contentType:{writable:false,configurable:false},contentLength:{writable:false,configurable:false},headers:{writable:false,configurable:false}})}getContentLength(){let t=0;for(const[r,i]of Ye(this,rt,"f")){const o=isFileLike(i)?i:Ye(this,et,"f").encode(qe(i));t+=Ye(this,Ke,"m",it).call(this,r,o).byteLength;t+=isFileLike(o)?o.size:o.byteLength;t+=Ye(this,Qe,"f")}return t+Ye(this,tt,"f").byteLength}*values(){for(const[t,r]of Ye(this,rt,"f").entries()){const i=isFileLike(r)?r:Ye(this,et,"f").encode(qe(r));yield Ye(this,Ke,"m",it).call(this,t,i);yield i;yield Ye(this,Ze,"f")}yield Ye(this,tt,"f")}async*encode(){for(const t of this.values()){if(isFileLike(t)){yield*t.stream()}else{yield t}}}[(Xe=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,st=new WeakMap,Ke=new WeakSet,it=function _FormDataEncoder_getFieldHeader(t,r){let i="";i+=`${Ye(this,Je,"f")}${this.boundary}${Ye(this,Xe,"f")}`;i+=`Content-Disposition: form-data; name="${Ge(t)}"`;if(isFileLike(r)){i+=`; filename="${Ge(r.name)}"${Ye(this,Xe,"f")}`;i+=`Content-Type: ${r.type||"application/octet-stream"}`}if(Ye(this,st,"f").enableAdditionalHeaders===true){i+=`${Ye(this,Xe,"f")}Content-Length: ${isFileLike(r)?r.size:r.byteLength}`}return Ye(this,et,"f").encode(`${i}${Ye(this,Xe,"f").repeat(2)}`)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}}const ot=null&&FormDataEncoder;const at=require("node:util");function is_form_data_isFormData(t){return Ce.nodeStream(t)&&Ce.function_(t.getBoundary)}async function getBodySize(t,r){if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(Ce.string(t)){return Pe.Buffer.byteLength(t)}if(Ce.buffer(t)){return t.length}if(is_form_data_isFormData(t)){return(0,at.promisify)(t.getLength.bind(t))()}return undefined}function proxyEvents(t,r,i){const o={};for(const a of i){const eventFunction=(...t)=>{r.emit(a,...t)};o[a]=eventFunction;t.on(a,eventFunction)}return()=>{for(const[r,i]of Object.entries(o)){t.off(r,i)}}}const ct=require("node:net");function unhandle(){const t=[];return{once(r,i,o){r.once(i,o);t.push({origin:r,event:i,fn:o})},unhandleAll(){for(const r of t){const{origin:t,event:i,fn:o}=r;t.removeListener(i,o)}t.length=0}}}const ut=Symbol("reentry");const noop=()=>{};class timed_out_TimeoutError extends Error{constructor(t,r){super(`Timeout awaiting '${r}' for ${t}ms`);Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:r});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.code="ETIMEDOUT"}}function timedOut(t,r,i){if(ut in t){return noop}t[ut]=true;const o=[];const{once:a,unhandleAll:c}=unhandle();const addTimeout=(t,r,i)=>{const a=setTimeout(r,t,t,i);a.unref?.();const cancel=()=>{clearTimeout(a)};o.push(cancel);return cancel};const{host:l,hostname:u}=i;const timeoutHandler=(r,i)=>{t.destroy(new timed_out_TimeoutError(r,i))};const cancelTimeouts=()=>{for(const t of o){t()}c()};t.once("error",(r=>{cancelTimeouts();if(t.listenerCount("error")===0){throw r}}));if(typeof r.request!=="undefined"){const i=addTimeout(r.request,timeoutHandler,"request");a(t,"response",(t=>{a(t,"end",i)}))}if(typeof r.socket!=="undefined"){const{socket:i}=r;const socketTimeoutHandler=()=>{timeoutHandler(i,"socket")};t.setTimeout(i,socketTimeoutHandler);o.push((()=>{t.removeListener("timeout",socketTimeoutHandler)}))}const h=typeof r.lookup!=="undefined";const d=typeof r.connect!=="undefined";const p=typeof r.secureConnect!=="undefined";const m=typeof r.send!=="undefined";if(h||d||p||m){a(t,"socket",(o=>{const{socketPath:c}=t;if(o.connecting){const t=Boolean(c??ct.isIP(u??l??"")!==0);if(h&&!t&&typeof o.address().address==="undefined"){const t=addTimeout(r.lookup,timeoutHandler,"lookup");a(o,"lookup",t)}if(d){const timeConnect=()=>addTimeout(r.connect,timeoutHandler,"connect");if(t){a(o,"connect",timeConnect())}else{a(o,"lookup",(t=>{if(t===null){a(o,"connect",timeConnect())}}))}}if(p&&i.protocol==="https:"){a(o,"connect",(()=>{const t=addTimeout(r.secureConnect,timeoutHandler,"secureConnect");a(o,"secureConnect",t)}))}}if(m){const timeRequest=()=>addTimeout(r.send,timeoutHandler,"send");if(o.connecting){a(o,"connect",(()=>{a(t,"upload-complete",timeRequest())}))}else{a(t,"upload-complete",timeRequest())}}}))}if(typeof r.response!=="undefined"){a(t,"upload-complete",(()=>{const i=addTimeout(r.response,timeoutHandler,"response");a(t,"response",i)}))}if(typeof r.read!=="undefined"){a(t,"response",(t=>{const i=addTimeout(r.read,timeoutHandler,"read");a(t,"end",i)}))}return cancelTimeouts}function urlToOptions(t){t=t;const r={protocol:t.protocol,hostname:Ce.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};if(Ce.string(t.port)&&t.port.length>0){r.port=Number(t.port)}if(t.username||t.password){r.auth=`${t.username||""}:${t.password||""}`}return r}class WeakableMap{constructor(){Object.defineProperty(this,"weakMap",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"map",{enumerable:true,configurable:true,writable:true,value:void 0});this.weakMap=new WeakMap;this.map=new Map}set(t,r){if(typeof t==="object"){this.weakMap.set(t,r)}else{this.map.set(t,r)}}get(t){if(typeof t==="object"){return this.weakMap.get(t)}return this.map.get(t)}has(t){if(typeof t==="object"){return this.weakMap.has(t)}return this.map.has(t)}}const calculateRetryDelay=({attemptCount:t,retryOptions:r,error:i,retryAfter:o,computedValue:a})=>{if(i.name==="RetryError"){return 1}if(t>r.limit){return 0}const c=r.methods.includes(i.options.method);const l=r.errorCodes.includes(i.code);const u=i.response&&r.statusCodes.includes(i.response.statusCode);if(!c||!l&&!u){return 0}if(i.response){if(o){if(o>a){return 0}return o}if(i.response.statusCode===413){return 0}}const h=Math.random()*r.noise;return Math.min(2**(t-1)*1e3,r.backoffLimit)+h};const ht=calculateRetryDelay;const ft=require("node:tls");const dt=require("node:https");function lowercaseKeys(t){return Object.fromEntries(Object.entries(t).map((([t,r])=>[t.toLowerCase(),r])))}var pt=i(9201);var mt=i(7331);function parseLinkHeader(t){const r=[];const i=t.split(",");for(const o of i){const[i,...a]=o.split(";");const c=i.trim();if(c[0]!=="<"||c[c.length-1]!==">"){throw new Error(`Invalid format of the Link header reference: ${c}`)}const l=c.slice(1,-1);const u={};if(a.length===0){throw new Error(`Unexpected end of Link header parameters: ${a.join(";")}`)}for(const r of a){const i=r.trim();const o=i.indexOf("=");if(o===-1){throw new Error(`Failed to parse Link header: ${t}`)}const a=i.slice(0,o).trim();const c=i.slice(o+1).trim();u[a]=c}r.push({reference:l,parameters:u})}return r}const[yt,bt]=l.versions.node.split(".").map((t=>Number(t)));function validateSearchParameters(t){for(const r in t){const i=t[r];Ce.assert.any([Ce.string,Ce.number,Ce.boolean,Ce.null_,Ce.undefined],i)}}const vt=new Map;let _t;const getGlobalDnsCache=()=>{if(_t){return _t}_t=new pt;return _t};const wt={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(t){if(t.request.options.responseType==="json"){return t.body}return JSON.parse(t.body)},paginate({response:t}){const r=t.headers.link;if(typeof r!=="string"||r.trim()===""){return false}const i=parseLinkHeader(r);const o=i.find((t=>t.parameters.rel==="next"||t.parameters.rel==='"next"'));if(o){return{url:new ue.URL(o.reference,t.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined};const cloneInternals=t=>{const{hooks:r,retry:i}=t;const o={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...i,errorCodes:[...i.errorCodes],methods:[...i.methods],statusCodes:[...i.statusCodes]},timeout:{...t.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:t.searchParams?new ue.URLSearchParams(t.searchParams):undefined,pagination:{...t.pagination}};if(o.url!==undefined){o.prefixUrl=""}return o};const cloneRaw=t=>{const{hooks:r,retry:i}=t;const o={...t};if(Ce.object(t.context)){o.context={...t.context}}if(Ce.object(t.cacheOptions)){o.cacheOptions={...t.cacheOptions}}if(Ce.object(t.https)){o.https={...t.https}}if(Ce.object(t.cacheOptions)){o.cacheOptions={...o.cacheOptions}}if(Ce.object(t.agent)){o.agent={...t.agent}}if(Ce.object(t.headers)){o.headers={...t.headers}}if(Ce.object(i)){o.retry={...i};if(Ce.array(i.errorCodes)){o.retry.errorCodes=[...i.errorCodes]}if(Ce.array(i.methods)){o.retry.methods=[...i.methods]}if(Ce.array(i.statusCodes)){o.retry.statusCodes=[...i.statusCodes]}}if(Ce.object(t.timeout)){o.timeout={...t.timeout}}if(Ce.object(r)){o.hooks={...r};if(Ce.array(r.init)){o.hooks.init=[...r.init]}if(Ce.array(r.beforeRequest)){o.hooks.beforeRequest=[...r.beforeRequest]}if(Ce.array(r.beforeError)){o.hooks.beforeError=[...r.beforeError]}if(Ce.array(r.beforeRedirect)){o.hooks.beforeRedirect=[...r.beforeRedirect]}if(Ce.array(r.beforeRetry)){o.hooks.beforeRetry=[...r.beforeRetry]}if(Ce.array(r.afterResponse)){o.hooks.afterResponse=[...r.afterResponse]}}if(Ce.object(t.pagination)){o.pagination={...t.pagination}}return o};const getHttp2TimeoutOption=t=>{const r=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter((t=>typeof t==="number"));if(r.length>0){return Math.min(...r)}return undefined};const init=(t,r,i)=>{const o=t.hooks?.init;if(o){for(const t of o){t(r,i)}}};class Options{constructor(t,r,i){Object.defineProperty(this,"_unixOptions",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_internals",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_merging",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_init",{enumerable:true,configurable:true,writable:true,value:void 0});Ce.assert.any([Ce.string,Ce.urlInstance,Ce.object,Ce.undefined],t);Ce.assert.any([Ce.object,Ce.undefined],r);Ce.assert.any([Ce.object,Ce.undefined],i);if(t instanceof Options||r instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(i?._internals??i??wt);this._init=[...i?._init??[]];this._merging=false;this._unixOptions=undefined;try{if(Ce.plainObject(t)){try{this.merge(t);this.merge(r)}finally{this.url=t.url}}else{try{this.merge(r)}finally{if(r?.url!==undefined){if(t===undefined){this.url=r.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(t!==undefined){this.url=t}}}}catch(t){t.options=this;throw t}}merge(t){if(!t){return}if(t instanceof Options){for(const r of t._init){this.merge(r)}return}t=cloneRaw(t);init(this,t,this);init(t,t,this);this._merging=true;if("isStream"in t){this.isStream=t.isStream}try{let r=false;for(const i in t){if(i==="mutableDefaults"||i==="handlers"){continue}if(i==="url"){continue}if(!(i in this)){throw new Error(`Unexpected option: ${i}`)}this[i]=t[i];r=true}if(r){this._init.push(t)}}finally{this._merging=false}}get request(){return this._internals.request}set request(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.request=t}get agent(){return this._internals.agent}set agent(t){Ce.assert.plainObject(t);for(const r in t){if(!(r in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${r}`)}Ce.assert.any([Ce.object,Ce.undefined],t[r])}if(this._merging){Object.assign(this._internals.agent,t)}else{this._internals.agent={...t}}}get h2session(){return this._internals.h2session}set h2session(t){this._internals.h2session=t}get decompress(){return this._internals.decompress}set decompress(t){Ce.assert.boolean(t);this._internals.decompress=t}get timeout(){return this._internals.timeout}set timeout(t){Ce.assert.plainObject(t);for(const r in t){if(!(r in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${r}`)}Ce.assert.any([Ce.number,Ce.undefined],t[r])}if(this._merging){Object.assign(this._internals.timeout,t)}else{this._internals.timeout={...t}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(t){Ce.assert.any([Ce.string,Ce.urlInstance],t);if(t===""){this._internals.prefixUrl="";return}t=t.toString();if(!t.endsWith("/")){t+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:r}=this._internals.url;this._internals.url.href=t+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=t}get body(){return this._internals.body}set body(t){Ce.assert.any([Ce.string,Ce.buffer,Ce.nodeStream,Ce.generator,Ce.asyncGenerator,ze,Ce.undefined],t);if(Ce.nodeStream(t)){Ce.assert.truthy(t.readable)}if(t!==undefined){Ce.assert.undefined(this._internals.form);Ce.assert.undefined(this._internals.json)}this._internals.body=t}get form(){return this._internals.form}set form(t){Ce.assert.any([Ce.plainObject,Ce.undefined],t);if(t!==undefined){Ce.assert.undefined(this._internals.body);Ce.assert.undefined(this._internals.json)}this._internals.form=t}get json(){return this._internals.json}set json(t){Ce.assert.any([Ce.object,Ce.undefined],t);if(t!==undefined){Ce.assert.undefined(this._internals.body);Ce.assert.undefined(this._internals.form)}this._internals.json=t}get url(){return this._internals.url}set url(t){Ce.assert.any([Ce.string,Ce.urlInstance,Ce.undefined],t);if(t===undefined){this._internals.url=undefined;return}if(Ce.string(t)&&t.startsWith("/")){throw new Error("`url` must not start with a slash")}const r=`${this.prefixUrl}${t.toString()}`;const i=new ue.URL(r);this._internals.url=i;decodeURI(r);if(i.protocol==="unix:"){i.href=`http://unix${i.pathname}${i.search}`}if(i.protocol!=="http:"&&i.protocol!=="https:"){const t=new Error(`Unsupported protocol: ${i.protocol}`);t.code="ERR_UNSUPPORTED_PROTOCOL";throw t}if(this._internals.username){i.username=this._internals.username;this._internals.username=""}if(this._internals.password){i.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){i.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(i.hostname==="unix"){const t=/(?<socketPath>.+?):(?<path>.+)/.exec(`${i.pathname}${i.search}`);if(t?.groups){const{socketPath:r,path:i}=t.groups;this._unixOptions={socketPath:r,path:i,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(t){Ce.assert.any([Ce.object,Ce.undefined],t);if(t===undefined){this._internals.cookieJar=undefined;return}let{setCookie:r,getCookieString:i}=t;Ce.assert.function_(r);Ce.assert.function_(i);if(r.length===4&&i.length===0){r=(0,at.promisify)(r.bind(t));i=(0,at.promisify)(i.bind(t));this._internals.cookieJar={setCookie:r,getCookieString:i}}else{this._internals.cookieJar=t}}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(t){Ce.assert.boolean(t);this._internals.ignoreInvalidCookies=t}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new ue.URLSearchParams}return this._internals.searchParams}set searchParams(t){Ce.assert.any([Ce.string,Ce.object,Ce.undefined],t);const r=this._internals.url;if(t===undefined){this._internals.searchParams=undefined;if(r){r.search=""}return}const i=this.searchParams;let o;if(Ce.string(t)){o=new ue.URLSearchParams(t)}else if(t instanceof ue.URLSearchParams){o=t}else{validateSearchParameters(t);o=new ue.URLSearchParams;for(const r in t){const a=t[r];if(a===null){o.append(r,"")}else if(a===undefined){i.delete(r)}else{o.append(r,a)}}}if(this._merging){for(const t of o.keys()){i.delete(t)}for(const[t,r]of o){i.append(t,r)}}else if(r){r.search=i.toString()}else{this._internals.searchParams=i}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(t){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.dnsLookup=t}get dnsCache(){return this._internals.dnsCache}set dnsCache(t){Ce.assert.any([Ce.object,Ce.boolean,Ce.undefined],t);if(t===true){this._internals.dnsCache=getGlobalDnsCache()}else if(t===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=t}}get context(){return this._internals.context}set context(t){Ce.assert.object(t);if(this._merging){Object.assign(this._internals.context,t)}else{this._internals.context={...t}}}get hooks(){return this._internals.hooks}set hooks(t){Ce.assert.object(t);for(const r in t){if(!(r in this._internals.hooks)){throw new Error(`Unexpected hook event: ${r}`)}const i=r;const o=t;const a=o[i];Ce.assert.any([Ce.array,Ce.undefined],a);if(a){for(const t of a){Ce.assert.function_(t)}}if(this._merging){if(a){this._internals.hooks[i].push(...a)}}else{if(!a){throw new Error(`Missing hook event: ${r}`)}this._internals.hooks[r]=[...a]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(t){Ce.assert.boolean(t);this._internals.followRedirect=t}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(t){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(t){Ce.assert.number(t);this._internals.maxRedirects=t}get cache(){return this._internals.cache}set cache(t){Ce.assert.any([Ce.object,Ce.string,Ce.boolean,Ce.undefined],t);if(t===true){this._internals.cache=vt}else if(t===false){this._internals.cache=undefined}else{this._internals.cache=t}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(t){Ce.assert.boolean(t);this._internals.throwHttpErrors=t}get username(){const t=this._internals.url;const r=t?t.username:this._internals.username;return decodeURIComponent(r)}set username(t){Ce.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.username=i}else{this._internals.username=i}}get password(){const t=this._internals.url;const r=t?t.password:this._internals.password;return decodeURIComponent(r)}set password(t){Ce.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.password=i}else{this._internals.password=i}}get http2(){return this._internals.http2}set http2(t){Ce.assert.boolean(t);this._internals.http2=t}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(t){Ce.assert.boolean(t);this._internals.allowGetBody=t}get headers(){return this._internals.headers}set headers(t){Ce.assert.plainObject(t);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(t))}else{this._internals.headers=lowercaseKeys(t)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(t){Ce.assert.boolean(t);this._internals.methodRewriting=t}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(t){if(t!==undefined&&t!==4&&t!==6){throw new TypeError(`Invalid DNS lookup IP version: ${t}`)}this._internals.dnsLookupIpVersion=t}get parseJson(){return this._internals.parseJson}set parseJson(t){Ce.assert.function_(t);this._internals.parseJson=t}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(t){Ce.assert.function_(t);this._internals.stringifyJson=t}get retry(){return this._internals.retry}set retry(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.function_,Ce.undefined],t.calculateDelay);Ce.assert.any([Ce.number,Ce.undefined],t.maxRetryAfter);Ce.assert.any([Ce.number,Ce.undefined],t.limit);Ce.assert.any([Ce.array,Ce.undefined],t.methods);Ce.assert.any([Ce.array,Ce.undefined],t.statusCodes);Ce.assert.any([Ce.array,Ce.undefined],t.errorCodes);Ce.assert.any([Ce.number,Ce.undefined],t.noise);if(t.noise&&Math.abs(t.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${t.noise}`)}for(const r in t){if(!(r in this._internals.retry)){throw new Error(`Unexpected retry option: ${r}`)}}if(this._merging){Object.assign(this._internals.retry,t)}else{this._internals.retry={...t}}const{retry:r}=this._internals;r.methods=[...new Set(r.methods.map((t=>t.toUpperCase())))];r.statusCodes=[...new Set(r.statusCodes)];r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(t){Ce.assert.any([Ce.string,Ce.undefined],t);this._internals.localAddress=t}get method(){return this._internals.method}set method(t){Ce.assert.string(t);this._internals.method=t.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.createConnection=t}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.boolean,Ce.undefined],t.shared);Ce.assert.any([Ce.number,Ce.undefined],t.cacheHeuristic);Ce.assert.any([Ce.number,Ce.undefined],t.immutableMinTimeToLive);Ce.assert.any([Ce.boolean,Ce.undefined],t.ignoreCargoCult);for(const r in t){if(!(r in this._internals.cacheOptions)){throw new Error(`Cache option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,t)}else{this._internals.cacheOptions={...t}}}get https(){return this._internals.https}set https(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.boolean,Ce.undefined],t.rejectUnauthorized);Ce.assert.any([Ce.function_,Ce.undefined],t.checkServerIdentity);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.certificateAuthority);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.key);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.certificate);Ce.assert.any([Ce.string,Ce.undefined],t.passphrase);Ce.assert.any([Ce.string,Ce.buffer,Ce.array,Ce.undefined],t.pfx);Ce.assert.any([Ce.array,Ce.undefined],t.alpnProtocols);Ce.assert.any([Ce.string,Ce.undefined],t.ciphers);Ce.assert.any([Ce.string,Ce.buffer,Ce.undefined],t.dhparam);Ce.assert.any([Ce.string,Ce.undefined],t.signatureAlgorithms);Ce.assert.any([Ce.string,Ce.undefined],t.minVersion);Ce.assert.any([Ce.string,Ce.undefined],t.maxVersion);Ce.assert.any([Ce.boolean,Ce.undefined],t.honorCipherOrder);Ce.assert.any([Ce.number,Ce.undefined],t.tlsSessionLifetime);Ce.assert.any([Ce.string,Ce.undefined],t.ecdhCurve);Ce.assert.any([Ce.string,Ce.buffer,Ce.array,Ce.undefined],t.certificateRevocationLists);for(const r in t){if(!(r in this._internals.https)){throw new Error(`HTTPS option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,t)}else{this._internals.https={...t}}}get encoding(){return this._internals.encoding}set encoding(t){if(t===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}Ce.assert.any([Ce.string,Ce.undefined],t);this._internals.encoding=t}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(t){Ce.assert.boolean(t);this._internals.resolveBodyOnly=t}get isStream(){return this._internals.isStream}set isStream(t){Ce.assert.boolean(t);this._internals.isStream=t}get responseType(){return this._internals.responseType}set responseType(t){if(t===undefined){this._internals.responseType="text";return}if(t!=="text"&&t!=="buffer"&&t!=="json"){throw new Error(`Invalid \`responseType\` option: ${t}`)}this._internals.responseType=t}get pagination(){return this._internals.pagination}set pagination(t){Ce.assert.object(t);if(this._merging){Object.assign(this._internals.pagination,t)}else{this._internals.pagination=t}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(t){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(t){Ce.assert.boolean(t);this._internals.setHost=t}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(t){Ce.assert.any([Ce.number,Ce.undefined],t);this._internals.maxHeaderSize=t}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](t,r){return(0,at.inspect)(this._internals,r)}createNativeRequestOptions(){const t=this._internals;const r=t.url;let i;if(r.protocol==="https:"){i=t.http2?t.agent:t.agent.https}else{i=t.agent.http}const{https:o}=t;let{pfx:a}=o;if(Ce.array(a)&&Ce.plainObject(a[0])){a=a.map((t=>({buf:t.buffer,passphrase:t.passphrase})))}return{...t.cacheOptions,...this._unixOptions,ALPNProtocols:o.alpnProtocols,ca:o.certificateAuthority,cert:o.certificate,key:o.key,passphrase:o.passphrase,pfx:o.pfx,rejectUnauthorized:o.rejectUnauthorized,checkServerIdentity:o.checkServerIdentity??ft.checkServerIdentity,ciphers:o.ciphers,honorCipherOrder:o.honorCipherOrder,minVersion:o.minVersion,maxVersion:o.maxVersion,sigalgs:o.signatureAlgorithms,sessionTimeout:o.tlsSessionLifetime,dhparam:o.dhparam,ecdhCurve:o.ecdhCurve,crl:o.certificateRevocationLists,lookup:t.dnsLookup??t.dnsCache?.lookup,family:t.dnsLookupIpVersion,agent:i,setHost:t.setHost,method:t.method,maxHeaderSize:t.maxHeaderSize,localAddress:t.localAddress,headers:t.headers,createConnection:t.createConnection,timeout:t.http2?getHttp2TimeoutOption(t):undefined,h2session:t.h2session}}getRequestFunction(){const t=this._internals.url;const{request:r}=this._internals;if(!r&&t){return this.getFallbackRequestFunction()}return r}getFallbackRequestFunction(){const t=this._internals.url;if(!t){return}if(t.protocol==="https:"){if(this._internals.http2){if(yt<15||yt===15&&bt<10){const t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");t.code="EUNSUPPORTED";throw t}return mt.auto}return dt.request}return Ie.request}freeze(){const t=this._internals;Object.freeze(t);Object.freeze(t.hooks);Object.freeze(t.hooks.afterResponse);Object.freeze(t.hooks.beforeError);Object.freeze(t.hooks.beforeRedirect);Object.freeze(t.hooks.beforeRequest);Object.freeze(t.hooks.beforeRetry);Object.freeze(t.hooks.init);Object.freeze(t.https);Object.freeze(t.cacheOptions);Object.freeze(t.agent);Object.freeze(t.headers);Object.freeze(t.timeout);Object.freeze(t.retry);Object.freeze(t.retry.errorCodes);Object.freeze(t.retry.methods);Object.freeze(t.retry.statusCodes);Object.freeze(t.context)}}const isResponseOk=t=>{const{statusCode:r}=t;const i=t.request.options.followRedirect?299:399;return r>=200&&r<=i||r===304};class ParseError extends RequestError{constructor(t,r){const{options:i}=r.request;super(`${t.message} in "${i.url.toString()}"`,t,r.request);this.name="ParseError";this.code="ERR_BODY_PARSE_FAILURE"}}const parseBody=(t,r,i,o)=>{const{rawBody:a}=t;try{if(r==="text"){return a.toString(o)}if(r==="json"){return a.length===0?"":i(a.toString(o))}if(r==="buffer"){return a}}catch(r){throw new ParseError(r,t)}throw new ParseError({message:`Unknown body type '${r}'`,name:"Error"},t)};function isClientRequest(t){return t.writable&&!t.writableEnded}const Et=isClientRequest;const St=Ce.string(l.versions.brotli);const Ot=new Set(["GET","HEAD"]);const Rt=new WeakableMap;const xt=new Set([300,301,302,303,304,307,308]);const At=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends he.Duplex{constructor(t,r,i){super({autoDestroy:false,highWaterMark:0});Object.defineProperty(this,"constructor",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_noPipe",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"requestUrl",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"redirectUrls",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"retryCount",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopRetry",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_downloadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_uploadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopReading",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_pipedServerResponses",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_responseSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_bodySize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_unproxyEvents",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_isFromCache",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cannotHaveBody",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_triggerRead",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cancelTimeouts",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_nativeResponse",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_flushed",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_aborted",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_requestInitialized",{enumerable:true,configurable:true,writable:true,value:void 0});this._downloadedSize=0;this._uploadedSize=0;this._stopReading=false;this._pipedServerResponses=new Set;this._cannotHaveBody=false;this._unproxyEvents=core_noop;this._triggerRead=false;this._cancelTimeouts=core_noop;this._jobs=[];this._flushed=false;this._requestInitialized=false;this._aborted=false;this.redirectUrls=[];this.retryCount=0;this._stopRetry=core_noop;const unlockWrite=()=>{this._unlockWrite()};const lockWrite=()=>{this._lockWrite()};this.on("pipe",(t=>{t.prependListener("data",unlockWrite);t.on("data",lockWrite);t.prependListener("end",unlockWrite);t.on("end",lockWrite)}));this.on("unpipe",(t=>{t.off("data",unlockWrite);t.off("data",lockWrite);t.off("end",unlockWrite);t.off("end",lockWrite)}));this.on("pipe",(t=>{if(t.headers){Object.assign(this.options.headers,t.headers)}}));this.on("newListener",(t=>{if(t==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(t,r,i);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url}catch(t){const{options:r}=t;if(r){this.options=r}this.flush=async()=>{this.flush=async()=>{};this.destroy(t)};return}const{json:o,body:a,form:c}=this.options;if(o||a||c){this._lockWrite()}if(Ce.nodeStream(a)){a.once("error",(t=>{if(this._flushed){this._beforeError(new UploadError(t,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(t,this))}}}))}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const t of this._jobs){t()}this._jobs.length=0;this._requestInitialized=true}catch(t){this._beforeError(t)}}_beforeError(t){if(this._stopReading){return}const{response:r,options:i}=this;const o=this.retryCount+(t.name==="RetryError"?0:1);this._stopReading=true;if(!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}const a=t;void(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed){r.setEncoding(this.readableEncoding);const t=await this._setRawBody(r);if(t){r.body=r.rawBody.toString()}}if(this.listenerCount("retry")!==0){let c;try{let t;if(r&&"retry-after"in r.headers){t=Number(r.headers["retry-after"]);if(Number.isNaN(t)){t=Date.parse(r.headers["retry-after"])-Date.now();if(t<=0){t=1}}else{t*=1e3}}const l=i.retry;c=await l.calculateDelay({attemptCount:o,retryOptions:l,error:a,retryAfter:t,computedValue:ht({attemptCount:o,retryOptions:l,error:a,retryAfter:t,computedValue:l.maxRetryAfter??i.timeout.request??Number.POSITIVE_INFINITY})})}catch(t){void this._error(new RequestError(t.message,t,this));return}if(c){await new Promise((t=>{const r=setTimeout(t,c);this._stopRetry=()=>{clearTimeout(r);t()}}));if(this.destroyed){return}try{for(const t of this.options.hooks.beforeRetry){await t(a,this.retryCount+1)}}catch(r){void this._error(new RequestError(r.message,t,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",this.retryCount+1,t,(t=>{const r=new Request(i.url,t,i);r.retryCount=this.retryCount+1;l.nextTick((()=>{void r.flush()}));return r}));return}}void this._error(a)})()}_read(){this._triggerRead=true;const{response:t}=this;if(t&&!this._stopReading){if(t.readableLength){this._triggerRead=false}let r;while((r=t.read())!==null){this._downloadedSize+=r.length;const t=this.downloadProgress;if(t.percent<1){this.emit("downloadProgress",t)}this.push(r)}}}_write(t,r,i){const write=()=>{this._writeRequest(t,r,i)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(t){const endRequest=()=>{if(!this._request||this._request.destroyed){t();return}this._request.end((r=>{if(this._request._writableState?.errored){return}if(!r){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request.emit("upload-complete")}t(r)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(t,r){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();if(this.options){const{body:t}=this.options;if(Ce.nodeStream(t)){t.destroy()}}if(this._request){this._request.destroy()}if(t!==null&&!Ce.undefined(t)&&!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}r(t)}pipe(t,r){if(t instanceof Ie.ServerResponse){this._pipedServerResponses.add(t)}return super.pipe(t,r)}unpipe(t){if(t instanceof Ie.ServerResponse){this._pipedServerResponses.delete(t)}super.unpipe(t);return this}_lockWrite(){const onLockedWrite=()=>{throw new TypeError("The payload has been already provided")};this.write=onLockedWrite;this.end=onLockedWrite}_unlockWrite(){this.write=super.write;this.end=super.end}async _finalizeBody(){const{options:t}=this;const{headers:r}=t;const i=!Ce.undefined(t.form);const o=!Ce.undefined(t.json);const a=!Ce.undefined(t.body);const c=Ot.has(t.method)&&!(t.method==="GET"&&t.allowGetBody);this._cannotHaveBody=c;if(i||o||a){if(c){throw new TypeError(`The \`${t.method}\` method cannot be used with a body`)}const o=!Ce.string(r["content-type"]);if(a){if(ze(t.body)){const i=new FormDataEncoder(t.body);if(o){r["content-type"]=i.headers["Content-Type"]}r["content-length"]=i.headers["Content-Length"];t.body=i.encode()}if(is_form_data_isFormData(t.body)&&o){r["content-type"]=`multipart/form-data; boundary=${t.body.getBoundary()}`}}else if(i){if(o){r["content-type"]="application/x-www-form-urlencoded"}const{form:i}=t;t.form=undefined;t.body=new ue.URLSearchParams(i).toString()}else{if(o){r["content-type"]="application/json"}const{json:i}=t;t.json=undefined;t.body=t.stringifyJson(i)}const l=await getBodySize(t.body,t.headers);if(Ce.undefined(r["content-length"])&&Ce.undefined(r["transfer-encoding"])&&!c&&!Ce.undefined(l)){r["content-length"]=String(l)}}else if(c){this._lockWrite()}else{this._unlockWrite()}if(t.responseType==="json"&&!("accept"in t.headers)){t.headers.accept="application/json"}this._bodySize=Number(r["content-length"])||undefined}async _onResponseBase(t){if(this.isAborted){return}const{options:r}=this;const{url:i}=r;this._nativeResponse=t;if(r.decompress){t=$e(t)}const o=t.statusCode;const a=t;a.statusMessage=a.statusMessage?a.statusMessage:Ie.STATUS_CODES[o];a.url=r.url.toString();a.requestUrl=this.requestUrl;a.redirectUrls=this.redirectUrls;a.request=this;a.isFromCache=this._nativeResponse.fromCache??false;a.ip=this.ip;a.retryCount=this.retryCount;this._isFromCache=a.isFromCache;this._responseSize=Number(t.headers["content-length"])||undefined;this.response=a;t.once("end",(()=>{this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress)}));t.once("error",(r=>{this._aborted=true;t.destroy();this._beforeError(new ReadError(r,this))}));t.once("aborted",(()=>{this._aborted=true;this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}));this.emit("downloadProgress",this.downloadProgress);const c=t.headers["set-cookie"];if(Ce.object(r.cookieJar)&&c){let t=c.map((async t=>r.cookieJar.setCookie(t,i.toString())));if(r.ignoreInvalidCookies){t=t.map((async t=>{try{await t}catch{}}))}try{await Promise.all(t)}catch(t){this._beforeError(t);return}}if(this.isAborted){return}if(r.followRedirect&&t.headers.location&&xt.has(o)){t.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=r.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;const c=new Options(undefined,undefined,this.options);const l=o===303&&c.method!=="GET"&&c.method!=="HEAD";if(l||c.methodRewriting){c.method="GET";c.body=undefined;c.json=undefined;c.form=undefined;delete c.headers["content-length"]}try{const r=Pe.Buffer.from(t.headers.location,"binary").toString();const o=new ue.URL(r,i);if(o.hostname!==i.hostname||o.port!==i.port){if("host"in c.headers){delete c.headers.host}if("cookie"in c.headers){delete c.headers.cookie}if("authorization"in c.headers){delete c.headers.authorization}if(c.username||c.password){c.username="";c.password=""}}else{o.username=c.username;o.password=c.password}this.redirectUrls.push(o);c.prefixUrl="";c.url=o;for(const t of c.hooks.beforeRedirect){await t(c,a)}this.emit("redirect",c,a);this.options=c;await this._makeRequest()}catch(t){this._beforeError(t);return}return}if(r.isStream&&r.throwHttpErrors&&!isResponseOk(a)){this._beforeError(new HTTPError(a));return}t.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{t.resume()}));this.on("pause",(()=>{t.pause()}));t.once("end",(()=>{this.push(null)}));if(this._noPipe){const r=await this._setRawBody();if(r){this.emit("response",t)}return}this.emit("response",t);for(const i of this._pipedServerResponses){if(i.headersSent){continue}for(const o in t.headers){const a=r.decompress?o!=="content-encoding":true;const c=t.headers[o];if(a){i.setHeader(o,c)}}i.statusCode=o}}async _setRawBody(t=this){if(t.readableEnded){return false}try{const r=await(0,Fe.buffer)(t);if(!this.isAborted){this.response.rawBody=r;return true}}catch{}return false}async _onResponse(t){try{await this._onResponseBase(t)}catch(t){this._beforeError(t)}}_onRequest(t){const{options:r}=this;const{timeout:i,url:o}=r;De(t);if(this.options.http2){t.setTimeout(0)}this._cancelTimeouts=timedOut(t,i,o);const a=r.cache?"cacheableResponse":"response";t.once(a,(t=>{void this._onResponse(t)}));t.once("error",(r=>{this._aborted=true;t.destroy();r=r instanceof timed_out_TimeoutError?new TimeoutError(r,this.timings,this):new RequestError(r.message,r,this);this._beforeError(r)}));this._unproxyEvents=proxyEvents(t,this,At);this._request=t;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",t)}async _asyncWrite(t){return new Promise(((r,i)=>{super.write(t,(t=>{if(t){i(t);return}r()}))}))}_sendBody(){const{body:t}=this.options;const r=this.redirectUrls.length===0?this:this._request??this;if(Ce.nodeStream(t)){t.pipe(r)}else if(Ce.generator(t)||Ce.asyncGenerator(t)){(async()=>{try{for await(const r of t){await this._asyncWrite(r)}super.end()}catch(t){this._beforeError(t)}})()}else{this._unlockWrite();if(!Ce.undefined(t)){this._writeRequest(t,undefined,(()=>{}));r.end();this._lockWrite()}else if(this._cannotHaveBody||this._noPipe){r.end();this._lockWrite()}}}_prepareCache(t){if(!Rt.has(t)){Rt.set(t,new je(((t,r)=>{const i=t._request(t,r);if(Ce.promise(i)){i.once=(t,r)=>{if(t==="error"){(async()=>{try{await i}catch(t){r(t)}})()}else if(t==="abort"){(async()=>{try{const t=await i;t.once("abort",r)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${t}`)}return i}}return i}),t))}}async _createCacheableRequest(t,r){return new Promise(((i,o)=>{Object.assign(r,urlToOptions(t));let a;const c=Rt.get(r.cache)(r,(async t=>{t._readableState.autoDestroy=false;if(a){const fix=()=>{if(t.req){t.complete=t.req.res.complete}};t.prependOnceListener("end",fix);fix();(await a).emit("cacheableResponse",t)}i(t)}));c.once("error",o);c.once("request",(async t=>{a=t;i(a)}))}))}async _makeRequest(){const{options:t}=this;const{headers:r,username:i,password:o}=t;const a=t.cookieJar;for(const t in r){if(Ce.undefined(r[t])){delete r[t]}else if(Ce.null_(r[t])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(t.decompress&&Ce.undefined(r["accept-encoding"])){r["accept-encoding"]=St?"gzip, deflate, br":"gzip, deflate"}if(i||o){const t=Pe.Buffer.from(`${i}:${o}`).toString("base64");r.authorization=`Basic ${t}`}if(a){const i=await a.getCookieString(t.url.toString());if(Ce.nonEmptyString(i)){r.cookie=i}}t.prefixUrl="";let c;for(const r of t.hooks.beforeRequest){const i=await r(t);if(!Ce.undefined(i)){c=()=>i;break}}if(!c){c=t.getRequestFunction()}const l=t.url;this._requestOptions=t.createNativeRequestOptions();if(t.cache){this._requestOptions._request=c;this._requestOptions.cache=t.cache;this._prepareCache(t.cache)}const u=t.cache?this._createCacheableRequest:c;try{let r=u(l,this._requestOptions);if(Ce.promise(r)){r=await r}if(Ce.undefined(r)){r=t.getFallbackRequestFunction()(l,this._requestOptions);if(Ce.promise(r)){r=await r}}if(Et(r)){this._onRequest(r)}else if(this.writable){this.once("finish",(()=>{void this._onResponse(r)}));this._sendBody()}else{void this._onResponse(r)}}catch(t){if(t instanceof je.CacheError){throw new CacheError(t,this)}throw t}}async _error(t){try{for(const r of this.options.hooks.beforeError){t=await r(t)}}catch(r){t=new RequestError(r.message,r,this)}this.destroy(t)}_writeRequest(t,r,i){if(!this._request||this._request.destroyed){return}this._request.write(t,r,(o=>{if(!o){this._uploadedSize+=Pe.Buffer.byteLength(t,r);const i=this.uploadProgress;if(i.percent<1){this.emit("uploadProgress",i)}}i(o)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let t;if(this._responseSize){t=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){t=1}else{t=0}return{percent:t,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let t;if(this._bodySize){t=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){t=1}else{t=0}return{percent:t,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}}class types_CancelError extends RequestError{constructor(t){super("Promise was canceled",{},t);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const Tt=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(t){let r;let i;let o;const a=new Q.EventEmitter;const c=new PCancelable(((l,u,h)=>{h((()=>{r.destroy()}));h.shouldReject=false;h((()=>{u(new types_CancelError(r))}));const makeRequest=d=>{h((()=>{}));const p=t??new Request(undefined,undefined,o);p.retryCount=d;p._noPipe=true;r=p;p.once("response",(async t=>{const r=(t.headers["content-encoding"]??"").toLowerCase();const o=r==="gzip"||r==="deflate"||r==="br";const{options:a}=p;if(o&&!a.decompress){t.body=t.rawBody}else{try{t.body=parseBody(t,a.responseType,a.parseJson,a.encoding)}catch(r){t.body=t.rawBody.toString();if(isResponseOk(t)){p._beforeError(r);return}}}try{const r=a.hooks.afterResponse;for(const[i,o]of r.entries()){t=await o(t,(async t=>{a.merge(t);a.prefixUrl="";if(t.url){a.url=t.url}a.hooks.afterResponse=a.hooks.afterResponse.slice(0,i);throw new RetryError(p)}));if(!(Ce.object(t)&&Ce.number(t.statusCode)&&!Ce.nullOrUndefined(t.body))){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(t){p._beforeError(t);return}i=t;if(!isResponseOk(t)){p._beforeError(new HTTPError(t));return}p.destroy();l(p.options.resolveBodyOnly?t.body:t)}));const onError=t=>{if(c.isCanceled){return}const{options:r}=p;if(t instanceof HTTPError&&!r.throwHttpErrors){const{response:r}=t;p.destroy();l(p.options.resolveBodyOnly?r.body:r);return}u(t)};p.once("error",onError);const m=p.options?.body;p.once("retry",((r,i)=>{t=undefined;const a=p.options.body;if(m===a&&Ce.nodeStream(a)){i.message="Cannot retry with consumed body stream";onError(i);return}o=p.options;makeRequest(r)}));proxyEvents(p,a,Tt);if(Ce.undefined(t)){void p.flush()}};makeRequest(0)}));c.on=(t,r)=>{a.on(t,r);return c};const shortcut=t=>{const r=(async()=>{await c;const{options:r}=i.request;return parseBody(i,t,r.parseJson,r.encoding)})();Object.defineProperties(r,Object.getOwnPropertyDescriptors(c));return r};c.json=()=>{if(r.options){const{headers:t}=r.options;if(!r.writableFinished&&!("accept"in t)){t.accept="application/json"}}return shortcut("json")};c.buffer=()=>shortcut("buffer");c.text=()=>shortcut("text");return c}const delay=async t=>new Promise((r=>{setTimeout(r,t)}));const isGotInstance=t=>Ce.function_(t);const kt=["get","post","put","patch","head","delete"];const create=t=>{t={options:new Options(undefined,undefined,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults};Object.defineProperty(t,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(r,i,o=t.options)=>{const a=new Request(r,i,o);let c;const lastHandler=t=>{a.options=t;a._noPipe=!t.isStream;void a.flush();if(t.isStream){return a}if(!c){c=asPromise(a)}return c};let l=0;const iterateHandlers=r=>{const i=t.handlers[l++]??lastHandler;const o=i(r,iterateHandlers);if(Ce.promise(o)&&!a.options.isStream){if(!c){c=asPromise(a)}if(o!==c){const t=Object.getOwnPropertyDescriptors(c);for(const r in t){if(r in o){delete t[r]}}Object.defineProperties(o,t);o.cancel=c.cancel}}return o};return iterateHandlers(a.options)};got.extend=(...r)=>{const i=new Options(undefined,undefined,t.options);const o=[...t.handlers];let a;for(const t of r){if(isGotInstance(t)){i.merge(t.defaults.options);o.push(...t.defaults.handlers);a=t.defaults.mutableDefaults}else{i.merge(t);if(t.handlers){o.push(...t.handlers)}a=t.mutableDefaults}}return create({options:i,handlers:o,mutableDefaults:Boolean(a)})};const paginateEach=async function*(r,i){let o=new Options(r,i,t.options);o.resolveBodyOnly=false;const{pagination:a}=o;Ce.assert.function_(a.transform);Ce.assert.function_(a.shouldContinue);Ce.assert.function_(a.filter);Ce.assert.function_(a.paginate);Ce.assert.number(a.countLimit);Ce.assert.number(a.requestLimit);Ce.assert.number(a.backoff);const c=[];let{countLimit:l}=a;let u=0;while(u<a.requestLimit){if(u!==0){await delay(a.backoff)}const t=await got(undefined,undefined,o);const r=await a.transform(t);const i=[];Ce.assert.array(r);for(const t of r){if(a.filter({item:t,currentItems:i,allItems:c})){if(!a.shouldContinue({item:t,currentItems:i,allItems:c})){return}yield t;if(a.stackAllItems){c.push(t)}i.push(t);if(--l<=0){return}}}const h=a.paginate({response:t,currentItems:i,allItems:c});if(h===false){return}if(h===t.request.options){o=t.request.options}else{o.merge(h);Ce.assert.any([Ce.urlInstance,Ce.undefined],h.url);if(h.url!==undefined){o.prefixUrl="";o.url=h.url}}u++}};got.paginate=paginateEach;got.paginate.all=async(t,r)=>{const i=[];for await(const o of paginateEach(t,r)){i.push(o)}return i};got.paginate.each=paginateEach;got.stream=(t,r)=>got(t,{...r,isStream:true});for(const t of kt){got[t]=(r,i)=>got(r,{...i,method:t});got.stream[t]=(r,i)=>got(r,{...i,method:t,isStream:true})}if(!t.mutableDefaults){Object.freeze(t.handlers);t.options.freeze()}Object.defineProperty(got,"defaults",{value:t,writable:false,configurable:false,enumerable:true});return got};const Ct=create;const Pt={options:new Options,handlers:[],mutableDefaults:false};const It=Ct(Pt);const Lt=It;var Nt=i(1470);var Mt=i(2781);const Dt=(0,Ne.promisify)(Mt.Stream.pipeline);async function isUrlOk(t){const r=await Lt.head(t).catch((t=>t));return r.statusCode===200}async function getRepoInfo(t,r){const[,i,o,a,c,...l]=t.pathname.split("/");const u=r?r.replace(/^\//,""):l.join("/");if(a===undefined){const t=await Lt(`https://api.github.com/repos/${i}/${o}`).catch((t=>t));if(t.statusCode!==200){return}const r=JSON.parse(t.body);return{username:i,name:o,branch:r["default_branch"],filePath:u}}const h=r?`${c}/${l.join("/")}`.replace(new RegExp(`/${u}|/$`),""):c;if(i&&o&&h&&a==="tree"){return{username:i,name:o,branch:h,filePath:u}}}function hasRepo({username:t,name:r,branch:i,filePath:o}){const a=`https://api.github.com/repos/${t}/${r}/contents`;const c=`${o?`/${o}`:""}/package.json`;return isUrlOk(a+c+`?ref=${i}`)}function hasTemplate(t){return isUrlOk(`https://api.github.com/repos/openpatch/hyperbook/contents/templates/${encodeURIComponent(t)}/package.json`)}function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){return Dt(Lt.stream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),Nt.extract({cwd:t,strip:a?a.split("/").length+1:1},[`${i}-${o}${a?`/${a}`:""}`]))}async function getTemplateInfo(t){let r;if(t){let i;try{i=new URL(t)}catch(t){if(t.code!=="ERR_INVALID_URL"){console.error(t);process.exit(1)}}if(i){if(i.origin!=="https://github.com"){console.error(`Invalid URL: ${T.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}r=await getRepoInfo(i);if(!r){console.error(`Found invalid GitHub URL: ${T.red(`"${t}"`)}. Please fix the URL and try again.`);process.exit(1)}const o=await hasRepo(r);if(!o){console.error(`Could not locate the repository for ${T.red(`"${t}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(t!=="__internal-testing-retry"){const r=await hasTemplate(t);if(!r){console.error(`Could not locate an template named ${T.red(`"${t}"`)}. It could be due to the following:\n`,`1. Your spelling of template ${T.red(`"${t}"`)} might be incorrect.\n`,`2. You might not be connected to the internet.`);process.exit(1)}}}return r}var jt=i(1176);var $t=i.n(jt);function install(t,r,{packageManager:i,isOnline:o,devDependencies:a}){const c=[];const l=[];return new Promise(((u,h)=>{let d;let p=i;const m=i==="yarn";if(r&&r.length){if(m){d=["add","--exact"];if(!o)d.push("--offline");d.push("--cwd",t);if(a)d.push("--dev");d.push(...r)}else{d=["install","--save-exact"];d.push(a?"--save-dev":"--save");d.push(...r)}}else{d=["install"];if(!o){console.log(T.yellow("You appear to be offline."));if(m){console.log(T.yellow("Falling back to the local Yarn cache."));console.log();d.push("--offline")}else{console.log()}}}if(m){d.push(...l)}else{d.push(...c)}const g=G()(p,d,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});g.on("close",(t=>{if(t!==0){h({command:`${p} ${d.join(" ")}`});return}u()}))}))}var Ft=i(9523);var Ht=i.n(Ft);var Bt=i(7310);var Ut=i.n(Bt);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,K.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}function getOnline(){return new Promise((t=>{Ht().lookup("registry.yarnpkg.com",(r=>{if(!r){return t(true)}const i=getProxy();if(!i){return t(false)}const{hostname:o}=Ut().parse(i);if(!o){return t(false)}Ht().lookup(o,(r=>{t(r==null)}))}))}))}async function makeSymlink(t,r){return new Promise(((i,o)=>{Y().symlink(t,r,(t=>{if(t){o()}else{i()}}))}))}class DownloadError extends Error{}async function runSetup(t,r,i){if(!i){i=process.cwd()}if(!t){const r=await readHyperbook();t=r.template}if(!t){t="https://github.com/openpatch/hyperbook/tree/main/templates/simple"}if(!r){r=await getTemplateInfo(t)}const o=z().join(i,".hyperbook");console.log("Removing old template");ke().sync(o);await makeDir(o);const a=await getOnline();try{if(r){const i=r;console.log(`Downloading files from repo ${T.cyan(t)}. This might take a moment.`);console.log();await $t()((()=>downloadAndExtractRepo(o,i)),{retries:3})}}catch(t){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(t)?t.message:t+"")}console.log("Installing packages. This might take a couple of minutes.");console.log();await install(o,null,{packageManager:"npm",isOnline:a});console.log();ke().sync(z().join(o,"book"));ke().sync(z().join(o,"public"));ke().sync(z().join(o,"glossary"));ke().sync(z().join(o,"hyperbook.json"));await makeSymlink(z().join(i,"book"),z().join(o,"book"));await makeSymlink(z().join(i,"public"),z().join(o,"public"));await makeSymlink(z().join(i,"glossary"),z().join(o,"glossary"));await makeSymlink(z().join(i,"hyperbook.json"),z().join(o,"hyperbook.json"))}async function runNew({programName:t,bookPath:r,template:o}){if(typeof r==="string"){r=r.trim()}if(!r){const t=await Ae()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){r=t.path.trim()}}if(!r){console.log();console.log("Please specify the book directory:");console.log(` ${T.cyan(t)} ${T.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${T.cyan(t)} ${T.green("my-new-book")}`);console.log();console.log(`Run ${T.cyan(`${t} --help`)} to see all options.`);process.exit(1)}let a=await getTemplateInfo(o);const c=z().resolve(r);if(!await isWriteable(z().dirname(c))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const l=z().basename(c);await makeDir(c);if(!isFolderEmpty(c,l)){process.exit(1)}const u=process.cwd();console.log(`Creating a new hyperbook in ${T.green(c)}.`);console.log();process.chdir(c);const{description:h}=await Ae()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:d}=await Ae()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:p}=await Ae()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:m}=await Ae()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(m==="custom"){const t=await Ae()({type:"text",name:"license",message:"Which custom license you want to use?"});m=t.license}const{language:g}=await Ae()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const y={name:l,version:"0.0.0",description:h,license:m,author:{name:d,url:p},language:g};Y().writeFileSync(z().join(c,"hyperbook.json"),JSON.stringify(y,null,2)+Z().EOL);console.log();const b=i.ab+"templates";await cpy("default/**",c,{cwd:i.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});await runSetup(o,a,c);if(tryGitInit(c)){console.log("Initialized a git repository.");console.log()}let v;if(z().join(u,l)===r){v=l}else{v=r}console.log(`${T.green("Success!")} Created ${l} at ${r}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(T.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(T.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(T.cyan(" cd"),v);console.log(` ${T.cyan(`hyperbook dev`)}`);console.log()}const qt=JSON.parse('{"name":"hyperbook","version":"0.4.0","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"},"devDependencies":{"@types/async-retry":"1.4.3","@types/cross-spawn":"6.0.2","@types/prompts":"2.0.14","@types/rimraf":"3.0.2","@types/tar":"6.1.1","@vercel/ncc":"0.33.3","async-retry":"1.3.3","chalk":"5.0.1","commander":"9.0.0","cpy":"9.0.1","cross-spawn":"7.0.3","got":"12.0.2","prompts":"2.4.2","rimraf":"3.0.2","tar":"6.1.11","update-check":"1.5.4"}}');const Gt=new D;Gt.name(qt.name).version(qt.version);Gt.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${T.green("<book-directory>")} [options]`).option("-t, --template [name]|[github-url]",`\n A template for your hyperbook. You can use an template name\n from the official hyperbook repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).action((async(t,r)=>{await notifyUpdate();const i=typeof r.template==="string"&&r.template.trim();await runNew({programName:Gt.name(),bookPath:t,template:i})}));Gt.command("dev").description("start the development server for a hyperbook").action((async()=>{await runDev()}));Gt.command("setup").description("downloads the latest version of the template of a hyperbook").action((async()=>{await runSetup()}));Gt.command("build").description("build a hyperbook").action((async()=>{await runBuild()}));Gt.parse(process.argv);const Vt=U()(qt).catch((()=>null));async function notifyUpdate(){try{const t=await Vt;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(T.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+T.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}},9491:t=>{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2057:t=>{"use strict";t.exports=require("constants")},6113:t=>{"use strict";t.exports=require("crypto")},9523:t=>{"use strict";t.exports=require("dns")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5158:t=>{"use strict";t.exports=require("http2")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},6821:t=>{"use strict";t.exports=require("tls")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},2492:(t,r,i)=>{const{Argument:o}=i(8644);const{Command:a}=i(5915);const{CommanderError:c,InvalidArgumentError:l}=i(1917);const{Help:u}=i(3498);const{Option:h}=i(5156);r=t.exports=new a;r.program=r;r.Argument=o;r.Command=a;r.CommanderError=c;r.Help=u;r.InvalidArgumentError=l;r.InvalidOptionArgumentError=l;r.Option=h},8644:(t,r,i)=>{const{InvalidArgumentError:o}=i(1917);class Argument{constructor(t,r){this.description=r||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const r=t.name()+(t.variadic===true?"...":"");return t.required?"<"+r+">":"["+r+"]"}r.Argument=Argument;r.humanReadableArgName=humanReadableArgName},5915:(t,r,i)=>{const o=i(2361).EventEmitter;const a=i(2081);const c=i(1017);const l=i(7147);const{Argument:u,humanReadableArgName:h}=i(8644);const{CommanderError:d}=i(1917);const{Help:p}=i(3498);const{Option:m,splitOptionFlags:g}=i(5156);const{suggestSimilar:y}=i(7919);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>process.stdout.write(t),writeErr:t=>process.stderr.write(t),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:undefined,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:undefined,outputError:(t,r)=>r(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,r,i){let o=r;let a=i;if(typeof o==="object"&&o!==null){a=o;o=null}a=a||{};const[,c,l]=t.match(/([^ ]+) *(.*)/);const u=this.createCommand(c);if(o){u.description(o);u._executableHandler=true}if(a.isDefault)this._defaultCommandName=u._name;u._hidden=!!(a.noHelp||a.hidden);u._executableFile=a.executableFile||null;if(l)u.arguments(l);this.commands.push(u);u.parent=this;u.copyInheritedSettings(this);if(o)return this;return u}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new p,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,r){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}r=r||{};if(r.isDefault)this._defaultCommandName=t._name;if(r.noHelp||r.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,r){return new u(t,r)}argument(t,r,i,o){const a=this.createArgument(t,r);if(typeof i==="function"){a.default(o).argParser(i)}else{a.default(i)}this.addArgument(a);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this._args.slice(-1)[0];if(r&&r.variadic){throw new Error(`only the last argument can be variadic '${r.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,r){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=r||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,r){const i=["preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(r)}else{this._lifeCycleHooks[t]=[r]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,r,i){if(this._exitCallback){this._exitCallback(new d(t,r,i))}process.exit(t)}action(t){const listener=r=>{const i=this._args.length;const o=r.slice(0,i);if(this._storeOptionsAsProperties){o[i]=this}else{o[i]=this.opts()}o.push(this);return t.apply(this,o)};this._actionHandler=listener;return this}createOption(t,r){return new m(t,r)}addOption(t){const r=t.name();const i=t.attributeName();if(t.negate){const r=t.long.replace(/^--no-/,"--");if(!this._findOption(r)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const c=this.getOptionValue(i);if(r!==null&&t.parseArg){try{r=t.parseArg(r,c)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}else if(r!==null&&t.variadic){r=t._concatValue(r,c)}if(r==null){if(t.negate){r=false}else if(t.isBoolean()||t.optional){r=true}else{r=""}}this.setOptionValueWithSource(i,r,a)};this.on("option:"+r,(r=>{const i=`error: option '${t.flags}' argument '${r}' is invalid.`;handleOptionValue(r,i,"cli")}));if(t.envVar){this.on("optionEnv:"+r,(r=>{const i=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;handleOptionValue(r,i,"env")}))}return this}_optionEx(t,r,i,o,a){if(typeof r==="object"&&r instanceof m){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const c=this.createOption(r,i);c.makeOptionMandatory(!!t.mandatory);if(typeof o==="function"){c.default(a).argParser(o)}else if(o instanceof RegExp){const t=o;o=(r,i)=>{const o=t.exec(r);return o?o[0]:i};c.default(a).argParser(o)}else{c.default(o)}return this.addOption(c)}option(t,r,i,o){return this._optionEx({},t,r,i,o)}requiredOption(t,r,i,o){return this._optionEx({mandatory:true},t,r,i,o)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}return this}setOptionValueWithSource(t,r,i){this.setOptionValue(t,r);this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}r=r||{};if(t===undefined){t=process.argv;if(process.versions&&process.versions.electron){r.from="electron"}}this.rawArgs=t.slice();let i;switch(r.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(process.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,r){const i=this._prepareUserArgs(t,r);this._parseCommand([],i);return this}async parseAsync(t,r){const i=this._prepareUserArgs(t,r);await this._parseCommand([],i);return this}_executeSubCommand(t,r){r=r.slice();let i=false;const o=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,r){const i=c.resolve(t,r);if(l.existsSync(i))return i;if(o.includes(c.extname(r)))return undefined;const a=o.find((t=>l.existsSync(`${i}${t}`)));if(a)return`${i}${a}`;return undefined}this._checkForMissingMandatoryOptions();let u=t._executableFile||`${this._name}-${t._name}`;let h=this._executableDir||"";if(this._scriptPath){let t;try{t=l.realpathSync(this._scriptPath)}catch(r){t=this._scriptPath}h=c.resolve(c.dirname(t),h)}if(h){let r=findFile(h,u);if(!r&&!t._executableFile&&this._scriptPath){const i=c.basename(this._scriptPath,c.extname(this._scriptPath));if(i!==this._name){r=findFile(h,`${i}-${t._name}`)}}u=r||u}i=o.includes(c.extname(u));let p;if(process.platform!=="win32"){if(i){r.unshift(u);r=incrementNodeInspectorPort(process.execArgv).concat(r);p=a.spawn(process.argv[0],r,{stdio:"inherit"})}else{p=a.spawn(u,r,{stdio:"inherit"})}}else{r.unshift(u);r=incrementNodeInspectorPort(process.execArgv).concat(r);p=a.spawn(process.execPath,r,{stdio:"inherit"})}if(!p.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{process.on(t,(()=>{if(p.killed===false&&p.exitCode===null){p.kill(t)}}))}))}const m=this._exitCallback;if(!m){p.on("close",process.exit.bind(process))}else{p.on("close",(()=>{m(new d(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}p.on("error",(r=>{if(r.code==="ENOENT"){const r=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${u}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${r}`;throw new Error(i)}else if(r.code==="EACCES"){throw new Error(`'${u}' not executable`)}if(!m){process.exit(1)}else{const t=new d(1,"commander.executeSubCommandAsync","(error)");t.nestedError=r;m(t)}}));this.runningCommand=p}_dispatchSubcommand(t,r,i){const o=this._findCommand(t);if(!o)this.help({error:true});if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}_checkNumberOfArguments(){this._args.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){try{o=t.parseArg(r,i)}catch(i){if(i.code==="commander.invalidArgument"){const o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}return o};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(i<this.args.length){o=this.args.slice(i);if(r.parseArg){o=o.reduce(((t,i)=>myParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(i<this.args.length){o=this.args[i];if(r.parseArg){o=myParseArg(r,o,r.defaultValue)}}t[i]=o}));this.processedArgs=t}_chainOrCall(t,r){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>r()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[r]!==undefined)).forEach((t=>{t._lifeCycleHooks[r].forEach((r=>{o.push({hookedCommand:t,callback:r})}))}));if(r==="postAction"){o.reverse()}o.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();t=t.concat(i.operands);r=i.unknown;this.args=t.concat(r);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),r)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const o=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(o,t,r)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(o)){checkForUnknownOptions();this._processArguments();this.parent.emit(o,t,r)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,r)}if(this.listenerCount("command:*")){this.emit("command:*",t,r)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((r=>r._name===t||r._aliases.includes(t)))}_findOption(t){return this.options.find((r=>r.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((r=>{if(r.mandatory&&t.getOptionValue(r.attributeName())===undefined){t.missingMandatoryOptionValue(r)}}))}}parseOptions(t){const r=[];const i=[];let o=r;const a=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let c=null;while(a.length){const t=a.shift();if(t==="--"){if(o===i)o.push(t);o.push(...a);break}if(c&&!maybeOption(t)){this.emit(`option:${c.name()}`,t);continue}c=null;if(maybeOption(t)){const r=this._findOption(t);if(r){if(r.required){const t=a.shift();if(t===undefined)this.optionMissingArgument(r);this.emit(`option:${r.name()}`,t)}else if(r.optional){let t=null;if(a.length>0&&!maybeOption(a[0])){t=a.shift()}this.emit(`option:${r.name()}`,t)}else{this.emit(`option:${r.name()}`)}c=r.variadic?r:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const r=this._findOption(`-${t[1]}`);if(r){if(r.required||r.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${r.name()}`,t.slice(2))}else{this.emit(`option:${r.name()}`);a.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const r=t.indexOf("=");const i=this._findOption(t.slice(0,r));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(r+1));continue}}if(maybeOption(t)){o=i}if((this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(t)){r.push(t);if(a.length>0)i.push(...a);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(t);if(a.length>0)r.push(...a);break}else if(this._defaultCommandName){i.push(t);if(a.length>0)i.push(...a);break}}if(this._passThroughOptions){o.push(t);if(a.length>0)o.push(...a);break}o.push(t)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const r=this.options.length;for(let i=0;i<r;i++){const r=this.options[i].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,r)=>Object.assign(t,r.opts())),{})}error(t,r){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=r||{};const o=i.exitCode||1;const a=i.code||"commander.error";this._exit(o,a,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in process.env){const r=t.attributeName();if(this.getOptionValue(r)===undefined||["default","config","env"].includes(this.getOptionValueSource(r))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,process.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}missingArgument(t){const r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){const r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let o=this;do{const t=o.createHelp().visibleOptions(o).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);o=o.parent}while(o&&!o._enablePositionalOptions);r=y(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this._args.length;const i=r===1?"":"s";const o=this.parent?` for '${this.name()}'`:"";const a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let r="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));r=y(t,i)}const i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===undefined)return this._version;this._version=t;r=r||"-V, --version";i=i||"output the version number";const o=this.createOption(r,i);this._versionOptionName=o.attributeName();this.options.push(o);this.on("option:"+o.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,r){if(t===undefined&&r===undefined)return this._description;this._description=t;if(r){this._argsDescription=r}return this}alias(t){if(t===undefined)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){r=this.commands[this.commands.length-1]}if(t===r._name)throw new Error("Command alias can't be the same as its name");r._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>h(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=c.basename(t,c.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const r=this.createHelp();if(r.helpWidth===undefined){r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return r.formatHelp(this,r)}_getHelpContext(t){t=t||{};const r={error:!!t.error};let i;if(r.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}r.write=t.write||i;r.command=this;return r}outputHelp(t){let r;if(typeof t==="function"){r=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let o=this.helpInformation(i);if(r){o=r(o);if(typeof o!=="string"&&!Buffer.isBuffer(o)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(o);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=r||this._helpDescription;const i=g(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let r=process.exitCode||0;if(r===0&&t&&typeof t!=="function"&&t.error){r=1}this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const o=`${t}Help`;this.on(o,(t=>{let i;if(typeof r==="function"){i=r({error:t.error,command:t.command})}else{i=r}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,r){const i=t._hasHelpOption&&r.find((r=>r===t._helpLongFlag||r===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let r;let i="127.0.0.1";let o="9229";let a;if((a=t.match(/^(--inspect(-brk)?)$/))!==null){r=a[1]}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){r=a[1];if(/^\d+$/.test(a[3])){o=a[3]}else{i=a[3]}}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){r=a[1];i=a[3];o=a[4]}if(r&&o!=="0"){return`${r}=${i}:${parseInt(o)+1}`}return t}))}function getCommandAndParents(t){const r=[];for(let i=t;i;i=i.parent){r.push(i)}return r}r.Command=Command},1917:(t,r)=>{class CommanderError extends Error{constructor(t,r,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=r;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}r.CommanderError=CommanderError;r.InvalidArgumentError=InvalidArgumentError},3498:(t,r,i)=>{const{humanReadableArgName:o}=i(8644);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,o]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const a=t.createCommand(i).helpOption(false);a.description(t._helpCommandDescription);if(o)a.arguments(o);r.push(a)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const o=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||o){let a;if(!i){a=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!o){a=t.createOption(t._helpShortFlag,t._helpDescription)}else{a=t.createOption(t._helpFlags,t._helpDescription)}r.push(a)}if(this.sortOptions){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");r.sort(((t,r)=>getSortKey(t).localeCompare(getSortKey(r))))}return r}visibleArguments(t){if(t._argsDescription){t._args.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const r=t._args.map((t=>o(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce(((t,i)=>Math.max(t,r.subcommandTerm(i).length)),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce(((t,i)=>Math.max(t,r.optionTerm(i).length)),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce(((t,i)=>Math.max(t,r.argumentTerm(i).length)),0)}commandUsage(t){let r=t._name;if(t._aliases[0]){r=r+"|"+t._aliases[0]}let i="";for(let r=t.parent;r;r=r.parent){i=r.name()+" "+i}return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.description()}optionDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){r.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){r.push(`env: ${t.envVar}`)}if(r.length>0){return`${t.description} (${r.join(", ")})`}return t.description}argumentDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(r.length>0){const i=`(${r.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,r){const i=r.padWidth(t,r);const o=r.helpWidth||80;const a=2;const c=2;function formatItem(t,l){if(l){const u=`${t.padEnd(i+c)}${l}`;return r.wrap(u,o-a,i+c)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(a))}let l=[`Usage: ${r.commandUsage(t)}`,""];const u=r.commandDescription(t);if(u.length>0){l=l.concat([u,""])}const h=r.visibleArguments(t).map((t=>formatItem(r.argumentTerm(t),r.argumentDescription(t))));if(h.length>0){l=l.concat(["Arguments:",formatList(h),""])}const d=r.visibleOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(d.length>0){l=l.concat(["Options:",formatList(d),""])}const p=r.visibleCommands(t).map((t=>formatItem(r.subcommandTerm(t),r.subcommandDescription(t))));if(p.length>0){l=l.concat(["Commands:",formatList(p),""])}return l.join("\n")}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){if(t.match(/[\n]\s+/))return t;const a=r-i;if(a<o)return t;const c=t.substr(0,i);const l=t.substr(i);const u=" ".repeat(i);const h=new RegExp(".{1,"+(a-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");const d=l.match(h)||[];return c+d.map(((t,r)=>{if(t.slice(-1)==="\n"){t=t.slice(0,t.length-1)}return(r>0?u:"")+t.trimRight()})).join("\n")}}r.Help=Help},5156:(t,r,i)=>{const{InvalidArgumentError:o}=i(1917);class Option{constructor(t,r){this.flags=t;this.description=r||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}preset(t){this.presetArg=t;return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}function camelcase(t){return t.split("-").reduce(((t,r)=>t+r[0].toUpperCase()+r.slice(1)))}function splitOptionFlags(t){let r;let i;const o=t.split(/[ |,]+/);if(o.length>1&&!/^[[<]/.test(o[1]))r=o.shift();i=o.shift();if(!r&&/^-[^-]$/.test(i)){r=i;i=undefined}return{shortFlag:r,longFlag:i}}r.Option=Option;r.splitOptionFlags=splitOptionFlags},7919:(t,r)=>{const i=3;function editDistance(t,r){if(Math.abs(t.length-r.length)>i)return Math.max(t.length,r.length);const o=[];for(let r=0;r<=t.length;r++){o[r]=[r]}for(let t=0;t<=r.length;t++){o[0][t]=t}for(let i=1;i<=r.length;i++){for(let a=1;a<=t.length;a++){let c=1;if(t[a-1]===r[i-1]){c=0}else{c=1}o[a][i]=Math.min(o[a-1][i]+1,o[a][i-1]+1,o[a-1][i-1]+c);if(a>1&&i>1&&t[a-1]===r[i-2]&&t[a-2]===r[i-1]){o[a][i]=Math.min(o[a][i],o[a-2][i-2]+1)}}}return o[t.length][r.length]}function suggestSimilar(t,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const o=t.startsWith("--");if(o){t=t.slice(2);r=r.map((t=>t.slice(2)))}let a=[];let c=i;const l=.4;r.forEach((r=>{if(r.length<=1)return;const i=editDistance(t,r);const o=Math.max(t.length,r.length);const u=(o-i)/o;if(u>l){if(i<c){c=i;a=[r]}else if(i===c){a.push(r)}}}));a.sort(((t,r)=>t.localeCompare(r)));if(o){a=a.map((t=>`--${t}`))}if(a.length>1){return`\n(Did you mean one of ${a.join(", ")}?)`}if(a.length===1){return`\n(Did you mean ${a[0]}?)`}return""}r.suggestSimilar=suggestSimilar}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var c=true;try{t[i](a,a.exports,__nccwpck_require__);c=false}finally{if(c)delete r[i]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(5979);module.exports=i})();
66
+ */const o=i(8387);const toRegexRange=(t,r,i)=>{if(o(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(r===void 0||t===r){return String(t)}if(o(r)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let a={relaxZeros:true,...i};if(typeof a.strictZeros==="boolean"){a.relaxZeros=a.strictZeros===false}let c=String(a.relaxZeros);let l=String(a.shorthand);let u=String(a.capture);let h=String(a.wrap);let d=t+":"+r+"="+c+l+u+h;if(toRegexRange.cache.hasOwnProperty(d)){return toRegexRange.cache[d].result}let p=Math.min(t,r);let m=Math.max(t,r);if(Math.abs(p-m)===1){let i=t+"|"+r;if(a.capture){return`(${i})`}if(a.wrap===false){return i}return`(?:${i})`}let g=hasPadding(t)||hasPadding(r);let y={min:t,max:r,a:p,b:m};let b=[];let v=[];if(g){y.isPadded=g;y.maxLen=String(y.max).length}if(p<0){let t=m<0?Math.abs(m):1;v=splitToPatterns(t,Math.abs(p),y,a);p=y.a=0}if(m>=0){b=splitToPatterns(p,m,y,a)}y.negatives=v;y.positives=b;y.result=collatePatterns(v,b,a);if(a.capture===true){y.result=`(${y.result})`}else if(a.wrap!==false&&b.length+v.length>1){y.result=`(?:${y.result})`}toRegexRange.cache[d]=y;return y.result};function collatePatterns(t,r,i){let o=filterPatterns(t,r,"-",false,i)||[];let a=filterPatterns(r,t,"",false,i)||[];let c=filterPatterns(t,r,"-?",true,i)||[];let l=o.concat(c).concat(a);return l.join("|")}function splitToRanges(t,r){let i=1;let o=1;let a=countNines(t,i);let c=new Set([r]);while(t<=a&&a<=r){c.add(a);i+=1;a=countNines(t,i)}a=countZeros(r+1,o)-1;while(t<a&&a<=r){c.add(a);o+=1;a=countZeros(r+1,o)-1}c=[...c];c.sort(compare);return c}function rangeToPattern(t,r,i){if(t===r){return{pattern:t,count:[],digits:0}}let o=zip(t,r);let a=o.length;let c="";let l=0;for(let t=0;t<a;t++){let[r,a]=o[t];if(r===a){c+=r}else if(r!=="0"||a!=="9"){c+=toCharacterClass(r,a,i)}else{l++}}if(l){c+=i.shorthand===true?"\\d":"[0-9]"}return{pattern:c,count:[l],digits:a}}function splitToPatterns(t,r,i,o){let a=splitToRanges(t,r);let c=[];let l=t;let u;for(let t=0;t<a.length;t++){let r=a[t];let h=rangeToPattern(String(l),String(r),o);let d="";if(!i.isPadded&&u&&u.pattern===h.pattern){if(u.count.length>1){u.count.pop()}u.count.push(h.count[0]);u.string=u.pattern+toQuantifier(u.count);l=r+1;continue}if(i.isPadded){d=padZeros(r,i,o)}h.string=d+h.pattern+toQuantifier(h.count);c.push(h);l=r+1;u=h}return c}function filterPatterns(t,r,i,o,a){let c=[];for(let a of t){let{string:t}=a;if(!o&&!contains(r,"string",t)){c.push(i+t)}if(o&&contains(r,"string",t)){c.push(i+t)}}return c}function zip(t,r){let i=[];for(let o=0;o<t.length;o++)i.push([t[o],r[o]]);return i}function compare(t,r){return t>r?1:r>t?-1:0}function contains(t,r,i){return t.some((t=>t[r]===i))}function countNines(t,r){return Number(String(t).slice(0,-r)+"9".repeat(r))}function countZeros(t,r){return t-t%Math.pow(10,r)}function toQuantifier(t){let[r=0,i=""]=t;if(i||r>1){return`{${r+(i?","+i:"")}}`}return""}function toCharacterClass(t,r,i){return`[${t}${r-t===1?"":"-"}${r}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,r,i){if(!r.isPadded){return t}let o=Math.abs(r.maxLen-String(t).length);let a=i.relaxZeros!==false;switch(o){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:{return a?`0{0,${o}}`:`0{${o}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},2817:(t,r,i)=>{const{URL:o}=i(7310);const{join:a}=i(1017);const c=i(7147);const{promisify:l}=i(3837);const{tmpdir:u}=i(2037);const h=i(2404);const d=l(c.writeFile);const p=l(c.mkdir);const m=l(c.readFile);const compareVersions=(t,r)=>t.localeCompare(r,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,r)=>{const i=u();const o=a(i,"update-check");if(!c.existsSync(o)){await p(o)}let l=`${t.name}-${r}.json`;if(t.scope){l=`${t.scope}-${l}`}return a(o,l)};const evaluateCache=async(t,r,i)=>{if(c.existsSync(t)){const o=await m(t,"utf8");const{lastUpdate:a,latest:c}=JSON.parse(o);const l=a+i;if(l>r){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,r,i)=>{const o=JSON.stringify({latest:r,lastUpdate:i});await d(t,o,"utf8")};const loadPackage=(t,r)=>new Promise(((o,a)=>{const c={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(r){c.headers.authorization=`${r.type} ${r.token}`}const{get:l}=i(t.protocol==="https:"?5687:3685);l(c,(t=>{const{statusCode:r}=t;if(r!==200){const i=new Error(`Request failed with code ${r}`);i.code=r;a(i);t.resume();return}let i="";t.setEncoding("utf8");t.on("data",(t=>{i+=t}));t.on("end",(()=>{try{const t=JSON.parse(i);o(t)}catch(t){a(t)}}))})).on("error",a).on("timeout",a)}));const getMostRecent=async({full:t,scope:r},a)=>{const c=h(r);const l=new o(t,c);let u=null;try{u=await loadPackage(l)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=i(6377);const r=t(c,{recursive:true});u=await loadPackage(l,r)}else{throw t}}const d=u["dist-tags"][a];if(!d){throw new Error(`Distribution tag ${a} is not available`)}return d};const g={interval:36e5,distTag:"latest"};const getDetails=t=>{const r={full:encode(t)};if(t.includes("/")){const i=t.split("/");r.scope=i[0];r.name=i[1]}else{r.scope=null;r.name=t}return r};t.exports=async(t,r)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const i=getDetails(t.name);const o=Date.now();const{distTag:a,interval:c}=Object.assign({},g,r);const l=await getFile(i,a);let u=null;let h=true;({shouldCheck:h,latest:u}=await evaluateCache(l,o,c));if(h){u=await getMostRecent(i,a);await updateCache(l,u,o)}const d=compareVersions(t.version,u);if(d===-1){return{latest:u,fromCache:!h}}return null}},8085:(t,r,i)=>{const o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const a=i(1017);const c=o?";":":";const l=i(2212);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,r)=>{const i=r.colon||c;const a=t.match(/\//)||o&&t.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(i)];const l=o?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const u=o?l.split(i):[""];if(o){if(t.indexOf(".")!==-1&&u[0]!=="")u.unshift("")}return{pathEnv:a,pathExt:u,pathExtExe:l}};const which=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}if(!r)r={};const{pathEnv:o,pathExt:c,pathExtExe:u}=getPathInfo(t,r);const h=[];const step=i=>new Promise(((c,l)=>{if(i===o.length)return r.all&&h.length?c(h):l(getNotFoundError(t));const u=o[i];const d=/^".*"$/.test(u)?u.slice(1,-1):u;const p=a.join(d,t);const m=!d&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(subStep(m,i,0))}));const subStep=(t,i,o)=>new Promise(((a,d)=>{if(o===c.length)return a(step(i+1));const p=c[o];l(t+p,{pathExt:u},((c,l)=>{if(!c&&l){if(r.all)h.push(t+p);else return a(t+p)}return a(subStep(t,i,o+1))}))}));return i?step(0).then((t=>i(null,t)),i):step(0)};const whichSync=(t,r)=>{r=r||{};const{pathEnv:i,pathExt:o,pathExtExe:c}=getPathInfo(t,r);const u=[];for(let h=0;h<i.length;h++){const d=i[h];const p=/^".*"$/.test(d)?d.slice(1,-1):d;const m=a.join(p,t);const g=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;for(let t=0;t<o.length;t++){const i=g+o[t];try{const t=l.sync(i,{pathExt:c});if(t){if(r.all)u.push(i);else return i}}catch(t){}}}if(r.all&&u.length)return u;if(r.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},2928:t=>{t.exports=wrappy;function wrappy(t,r){if(t&&r)return wrappy(t)(r);if(typeof t!=="function")throw new TypeError("need wrapper function");Object.keys(t).forEach((function(r){wrapper[r]=t[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var i=0;i<r.length;i++){r[i]=arguments[i]}var o=t.apply(this,r);var a=r[r.length-1];if(typeof o==="function"&&o!==a){Object.keys(a).forEach((function(t){o[t]=a[t]}))}return o}}},6077:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},605:(t,r,i)=>{"use strict";t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var r=this;if(!(r instanceof Yallist)){r=new Yallist}r.tail=null;r.head=null;r.length=0;if(t&&typeof t.forEach==="function"){t.forEach((function(t){r.push(t)}))}else if(arguments.length>0){for(var i=0,o=arguments.length;i<o;i++){r.push(arguments[i])}}return r}Yallist.prototype.removeNode=function(t){if(t.list!==this){throw new Error("removing node which does not belong to this list")}var r=t.next;var i=t.prev;if(r){r.prev=i}if(i){i.next=r}if(t===this.head){this.head=r}if(t===this.tail){this.tail=i}t.list.length--;t.next=null;t.prev=null;t.list=null;return r};Yallist.prototype.unshiftNode=function(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}var r=this.head;t.list=this;t.next=r;if(r){r.prev=t}this.head=t;if(!this.tail){this.tail=t}this.length++};Yallist.prototype.pushNode=function(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}var r=this.tail;t.list=this;t.prev=r;if(r){r.next=t}this.tail=t;if(!this.head){this.head=t}this.length++};Yallist.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++){push(this,arguments[t])}return this.length};Yallist.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++){unshift(this,arguments[t])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var t=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return t};Yallist.prototype.shift=function(){if(!this.head){return undefined}var t=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return t};Yallist.prototype.forEach=function(t,r){r=r||this;for(var i=this.head,o=0;i!==null;o++){t.call(r,i.value,o,this);i=i.next}};Yallist.prototype.forEachReverse=function(t,r){r=r||this;for(var i=this.tail,o=this.length-1;i!==null;o--){t.call(r,i.value,o,this);i=i.prev}};Yallist.prototype.get=function(t){for(var r=0,i=this.head;i!==null&&r<t;r++){i=i.next}if(r===t&&i!==null){return i.value}};Yallist.prototype.getReverse=function(t){for(var r=0,i=this.tail;i!==null&&r<t;r++){i=i.prev}if(r===t&&i!==null){return i.value}};Yallist.prototype.map=function(t,r){r=r||this;var i=new Yallist;for(var o=this.head;o!==null;){i.push(t.call(r,o.value,this));o=o.next}return i};Yallist.prototype.mapReverse=function(t,r){r=r||this;var i=new Yallist;for(var o=this.tail;o!==null;){i.push(t.call(r,o.value,this));o=o.prev}return i};Yallist.prototype.reduce=function(t,r){var i;var o=this.head;if(arguments.length>1){i=r}else if(this.head){o=this.head.next;i=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=0;o!==null;a++){i=t(i,o.value,a);o=o.next}return i};Yallist.prototype.reduceReverse=function(t,r){var i;var o=this.tail;if(arguments.length>1){i=r}else if(this.tail){o=this.tail.prev;i=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=this.length-1;o!==null;a--){i=t(i,o.value,a);o=o.prev}return i};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var r=0,i=this.head;i!==null;r++){t[r]=i.value;i=i.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var r=0,i=this.tail;i!==null;r++){t[r]=i.value;i=i.prev}return t};Yallist.prototype.slice=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}for(;a!==null&&o<r;o++,a=a.next){i.push(a.value)}return i};Yallist.prototype.sliceReverse=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=this.length,a=this.tail;a!==null&&o>r;o--){a=a.prev}for(;a!==null&&o>t;o--,a=a.prev){i.push(a.value)}return i};Yallist.prototype.splice=function(t,r,...i){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}var c=[];for(var o=0;a&&o<r;o++){c.push(a.value);a=this.removeNode(a)}if(a===null){a=this.tail}if(a!==this.head&&a!==this.tail){a=a.prev}for(var o=0;o<i.length;o++){a=insert(this,a,i[o])}return c};Yallist.prototype.reverse=function(){var t=this.head;var r=this.tail;for(var i=t;i!==null;i=i.prev){var o=i.prev;i.prev=i.next;i.next=o}this.head=r;this.tail=t;return this};function insert(t,r,i){var o=r===t.head?new Node(i,null,r,t):new Node(i,r,r.next,t);if(o.next===null){t.tail=o}if(o.prev===null){t.head=o}t.length++;return o}function push(t,r){t.tail=new Node(r,t.tail,null,t);if(!t.head){t.head=t.tail}t.length++}function unshift(t,r){t.head=new Node(r,null,t.head,t);if(!t.tail){t.tail=t.head}t.length++}function Node(t,r,i,o){if(!(this instanceof Node)){return new Node(t,r,i,o)}this.list=o;this.value=t;if(r){r.next=this;this.prev=r}else{this.prev=null}if(i){i.prev=this;this.next=i}else{this.next=null}}try{i(6077)(Yallist)}catch(t){}},3288:(t,r,i)=>{"use strict";i.r(r);const o=10;const wrapAnsi16=(t=0)=>r=>`[${r+t}m`;const wrapAnsi256=(t=0)=>r=>`[${38+t};5;${r}m`;const wrapAnsi16m=(t=0)=>(r,i,o)=>`[${38+t};2;${r};${i};${o}m`;function assembleStyles(){const t=new Map;const r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright;r.bgColor.bgGray=r.bgColor.bgBlackBright;r.color.grey=r.color.blackBright;r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(const[i,o]of Object.entries(r)){for(const[i,a]of Object.entries(o)){r[i]={open:`[${a[0]}m`,close:`[${a[1]}m`};o[i]=r[i];t.set(a[0],a[1])}Object.defineProperty(r,i,{value:o,enumerable:false})}Object.defineProperty(r,"codes",{value:t,enumerable:false});r.color.close="";r.bgColor.close="";r.color.ansi=wrapAnsi16();r.color.ansi256=wrapAnsi256();r.color.ansi16m=wrapAnsi16m();r.bgColor.ansi=wrapAnsi16(o);r.bgColor.ansi256=wrapAnsi256(o);r.bgColor.ansi16m=wrapAnsi16m(o);Object.defineProperties(r,{rgbToAnsi256:{value:(t,r,i)=>{if(t===r&&r===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value:t=>{const r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r){return[0,0,0]}let{colorString:i}=r.groups;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,o&255]},enumerable:false},hexToAnsi256:{value:t=>r.rgbToAnsi256(...r.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value:t=>{if(t<8){return 30+t}if(t<16){return 90+(t-8)}let r;let i;let o;if(t>=232){r=((t-232)*10+8)/255;i=r;o=r}else{t-=16;const a=t%36;r=Math.floor(t/36)/5;i=Math.floor(a/6)/5;o=a%6/5}const a=Math.max(r,i,o)*2;if(a===0){return 30}let c=30+(Math.round(o)<<2|Math.round(i)<<1|Math.round(r));if(a===2){c+=60}return c},enumerable:false},rgbToAnsi:{value:(t,i,o)=>r.ansi256ToAnsi(r.rgbToAnsi256(t,i,o)),enumerable:false},hexToAnsi:{value:t=>r.ansi256ToAnsi(r.hexToAnsi256(t)),enumerable:false}});return r}const a=assembleStyles();const c=a;const l=require("node:process");const u=require("node:os");const h=require("node:tty");function hasFlag(t,r=l.argv){const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1||o<a)}const{env:d}=l;let p;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){p=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){p=1}function envForceColor(){if("FORCE_COLOR"in d){if(d.FORCE_COLOR==="true"){return 1}if(d.FORCE_COLOR==="false"){return 0}return d.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(d.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:r,sniffFlags:i=true}={}){const o=envForceColor();if(o!==undefined){p=o}const a=i?p:o;if(a===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if(t&&!r&&a===undefined){return 0}const c=a||0;if(d.TERM==="dumb"){return c}if(l.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in d){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in d))||d.CI_NAME==="codeship"){return 1}return c}if("TEAMCITY_VERSION"in d){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0}if("TF_BUILD"in d&&"AGENT_NAME"in d){return 1}if(d.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in d){const t=Number.parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)){return 1}if("COLORTERM"in d){return 1}return c}function createSupportsColor(t,r={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...r});return translateLevel(i)}const m={stdout:createSupportsColor({isTTY:h.isatty(1)}),stderr:createSupportsColor({isTTY:h.isatty(2)})};const g=m;function stringReplaceAll(t,r,i){let o=t.indexOf(r);if(o===-1){return t}const a=r.length;let c=0;let l="";do{l+=t.substr(c,o-c)+r+i;c=o+a;o=t.indexOf(r,c)}while(o!==-1);l+=t.slice(c);return l}function stringEncaseCRLFWithFirstIndex(t,r,i,o){let a=0;let c="";do{const l=t[o-1]==="\r";c+=t.substr(a,(l?o-1:o)-a)+r+(l?"\r\n":"\n")+i;a=o+1;o=t.indexOf("\n",a)}while(o!==-1);c+=t.slice(a);return c}const{stdout:y,stderr:b}=g;const v=Symbol("GENERATOR");const _=Symbol("STYLER");const w=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const S=Object.create(null);const applyOptions=(t,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=y?y.level:0;t.level=r.level===undefined?i:r.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,r]of Object.entries(c)){S[t]={get(){const i=createBuilder(this,createStyler(r.open,r.close,this[_]),this[w]);Object.defineProperty(this,t,{value:i});return i}}}S.visible={get(){const t=createBuilder(this,this[_],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,r,i,...o)=>{if(t==="rgb"){if(r==="ansi16m"){return c[i].ansi16m(...o)}if(r==="ansi256"){return c[i].ansi256(c.rgbToAnsi256(...o))}return c[i].ansi(c.rgbToAnsi(...o))}if(t==="hex"){return getModelAnsi("rgb",r,i,...c.hexToRgb(...o))}return c[i][t](...o)};const O=["rgb","hex","ansi256"];for(const t of O){S[t]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"color",...i),c.color.close,this[_]);return createBuilder(this,o,this[w])}}};const r="bg"+t[0].toUpperCase()+t.slice(1);S[r]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"bgColor",...i),c.bgColor.close,this[_]);return createBuilder(this,o,this[w])}}}}const R=Object.defineProperties((()=>{}),{...S,level:{enumerable:true,get(){return this[v].level},set(t){this[v].level=t}}});const createStyler=(t,r,i)=>{let o;let a;if(i===undefined){o=t;a=r}else{o=i.openAll+t;a=r+i.closeAll}return{open:t,close:r,openAll:o,closeAll:a,parent:i}};const createBuilder=(t,r,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,R);builder[v]=t;builder[_]=r;builder[w]=i;return builder};const applyStyle=(t,r)=>{if(t.level<=0||!r){return t[w]?"":r}let i=t[_];if(i===undefined){return r}const{openAll:o,closeAll:a}=i;if(r.includes("")){while(i!==undefined){r=stringReplaceAll(r,i.close,i.open);i=i.parent}}const c=r.indexOf("\n");if(c!==-1){r=stringEncaseCRLFWithFirstIndex(r,a,o,c)}return o+r+a};Object.defineProperties(createChalk.prototype,S);const x=createChalk();const A=createChalk({level:b?b.level:0});const T=x;var k=i(621);const{program:C,createCommand:P,createArgument:I,createOption:L,CommanderError:N,InvalidArgumentError:M,Command:D,Argument:j,Option:$,Help:H}=k;var B=i(2817);var U=i.n(B);var q=i(7328);var G=i.n(q);var V=i(1017);var z=i.n(V);var W=i(7147);var Y=i.n(W);function isSetup(){try{const t=Y().statSync(z().join(process.cwd(),".hyperbook"));if(!t.isDirectory()){throw Error()}}catch(t){console.log(T.red("Could not find .hyperbook folder. Be sure to run `hyperbook setup`."));return false}try{Y().statSync(z().join(process.cwd(),".hyperbook","node_modules",".bin","next"))}catch(t){console.log(T.red("Could not find next binary in the .hyperbook folder. Be sure to run `hyperbook setup`."));return false}return true}async function readHyperbook(){return new Promise(((t,r)=>{Y().readFile(z().join(process.cwd(),"hyperbook.json"),((i,o)=>{if(i){console.log(T.red("Could not find 'hyperbook.json'. Make sure you are in the right directory."));r()}else{const r=JSON.parse(o.toString());t(r)}}))}))}async function runBuild(){const t=isSetup();if(!t){return}const r=await readHyperbook();if(r===null||r===void 0?void 0:r.basePath){Y().writeFileSync(z().join(process.cwd(),".hyperbook","next.config.js"),`\nmodule.exports = {\n basePath: '${r.basePath}',\n typescript: {\n ignoreBuildErrors: true,\n }\n}\n `)}return new Promise(((t,r)=>{const i="npm";const o=["run","build"];const a=G()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}async function runDev(){const t=isSetup();if(!t){return}return new Promise(((t,r)=>{const i="npm";const o=["run","dev"];const a=G()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}var K=i(2081);function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,K.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,K.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}var X=i(2037);var Z=i.n(X);const Q=require("node:events");const J=require("node:path");function indentString(t,r=1,i={}){const{indent:o=" ",includeEmptyLines:a=false}=i;if(typeof t!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(r<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``)}if(typeof o!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof o}\``)}if(r===0){return t}const c=a?/^/gm:/^(?!\s*$)/gm;return t.replace(c,o.repeat(r))}function escapeStringRegexp(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ee=/\s+at.*[(\s](.*)\)?/;const te=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;const re=typeof X.homedir==="undefined"?"":X.homedir().replace(/\\/g,"/");function cleanStack(t,{pretty:r=false,basePath:i}={}){const o=i&&new RegExp(`(at | \\()${escapeStringRegexp(i.replace(/\\/g,"/"))}`,"g");if(typeof t!=="string"){return undefined}return t.replace(/\\/g,"/").split("\n").filter((t=>{const r=t.match(ee);if(r===null||!r[1]){return true}const i=r[1];if(i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")){return false}return!te.test(i)})).filter((t=>t.trim()!=="")).map((t=>{if(o){t=t.replace(o,"$1")}if(r){t=t.replace(ee,((t,r)=>t.replace(r,r.replace(re,"~"))))}return t})).join("\n")}const cleanInternalStack=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t)){throw new TypeError(`Expected input to be an Array, got ${typeof t}`)}t=t.map((t=>{if(t instanceof Error){return t}if(t!==null&&typeof t==="object"){return Object.assign(new Error(t.message),t)}return new Error(t)}));let r=t.map((t=>typeof t.stack==="string"?cleanInternalStack(cleanStack(t.stack)):String(t))).join("\n");r="\n"+indentString(r,4);super(r);this.#e=t}get errors(){return this.#e.slice()}}async function pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true}={}){return new Promise(((a,c)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const l=[];const u=[];const h=new Map;let d=false;let p=false;let m=false;let g=0;let y=0;const b=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{d=true;p=true;c(t)};const next=async()=>{if(p){return}const t=await b.next();const i=y;y++;if(t.done){m=true;if(g===0&&!p){if(!o&&u.length>0){reject(new AggregateError(u));return}p=true;if(!h.size){a(l);return}const t=[];for(const[r,i]of l.entries()){if(h.get(r)===se){continue}t.push(i)}a(t)}return}g++;(async()=>{try{const o=await t.value;if(p){return}const a=await r(o,i);if(a===se){h.set(i,a)}l[i]=a;g--;await next()}catch(t){if(o){reject(t)}else{u.push(t);g--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(m||d){break}}})()}))}const se=Symbol("skip");function arrify(t){if(t===null||t===undefined){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]}var ie=i(654);async function pFilter(t,r,i){const o=await pMap(t,((t,i)=>Promise.all([r(t,i),t])),i);return o.filter((t=>Boolean(t[0]))).map((t=>t[1]))}const ne=require("node:fs");var oe=i(1382);var ae=i(3924);var ce=i(5352);var le=i(6302);function slash(t){const r=/^\\\\\?\\/.test(t);const i=/[^\u0000-\u0080]+/.test(t);if(r||i){return t}return t.replace(/\\/g,"/")}const ue=require("node:url");const he=require("node:stream");const toPath=t=>t instanceof URL?(0,ue.fileURLToPath)(t):t;class FilterStream extends he.Transform{constructor(t){super({objectMode:true,transform(r,i,o){o(undefined,t(r)?r:undefined)}})}}const isNegativePattern=t=>t[0]==="!";const fe={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:true,dot:true};const de="**/.gitignore";const applyBaseToPattern=(t,r)=>isNegativePattern(t)?"!"+J.posix.join(r,t.slice(1)):J.posix.join(r,t);const parseIgnoreFile=(t,r)=>{const i=slash(J.relative(r,J.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,i)))};const toRelativePath=(t,r)=>{r=slash(r);if(J.isAbsolute(t)){if(slash(t).startsWith(r)){return J.relative(r,t)}throw new Error(`Path ${t} is not in cwd ${r}`)}return t};const getIsIgnoredPredicate=(t,r)=>{const i=t.flatMap((t=>parseIgnoreFile(t,r)));const o=le().add(i);return t=>{t=toPath(t);t=toRelativePath(t,r);return o.ignores(slash(t))}};const normalizeOptions=(t={})=>({cwd:toPath(t.cwd)||l.cwd()});const isIgnoredByIgnoreFiles=async(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=await ae(t,{cwd:i,...fe});const a=await Promise.all(o.map((async t=>({filePath:t,content:await ne.promises.readFile(t,"utf8")}))));return getIsIgnoredPredicate(a,i)};const isIgnoredByIgnoreFilesSync=(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=ae.sync(t,{cwd:i,...fe});const a=o.map((t=>({filePath:t,content:ne.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(a,i)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(de,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(de,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t.cwd){return}let r;try{r=ne.statSync(t.cwd)}catch{return}if(!r.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={ignore:[],expandDirectories:true,...t,cwd:toPath(t.cwd)};checkCwdOption(t);return t};const normalizeArguments=t=>async(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const normalizeArgumentsSync=t=>(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:r,gitignore:i}=t;const o=r?toPatternsArray(r):[];if(i){o.push(de)}return o};const getFilter=async t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&await isIgnoredByIgnoreFiles(r,{cwd:t.cwd}))};const getFilterSync=t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&isIgnoredByIgnoreFilesSync(r,{cwd:t.cwd}))};const createFilterFunction=t=>{const r=new Set;return i=>{const o=i.path||i;const a=J.normalize(o);const c=r.has(a)||t&&t(o);r.add(a);return!c}};const unionFastGlobResults=(t,r)=>t.flat().filter((t=>r(t)));const unionFastGlobStreams=(t,r)=>oe(t).pipe(new FilterStream((t=>r(t))));const convertNegativePatterns=(t,r)=>{const i=[];while(t.length>0){const o=t.findIndex((t=>isNegativePattern(t)));if(o===-1){i.push({patterns:t,options:r});break}const a=t[o].slice(1);for(const t of i){t.options.ignore.push(a)}if(o!==0){i.push({patterns:t.slice(0,o),options:{...r,ignore:[...r.ignore,a]}})}t=t.slice(o+1)}return i};const getDirGlobOptions=(t,r)=>({...r?{cwd:r}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const c=getDirGlobOptions(a,o);const l=o?{cwd:o}:undefined;return Promise.all(i.map((async t=>{let{patterns:r,options:i}=t;[r,i.ignore]=await Promise.all([ce(r,c),ce(i.ignore,l)]);return{patterns:r,options:i}})))};const generateTasksSync=(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const c=getDirGlobOptions(a,o);const l=o?{cwd:o}:undefined;return i.map((t=>{let{patterns:r,options:i}=t;r=ce.sync(r,c);i.ignore=ce.sync(i.ignore,l);return{patterns:r,options:i}}))};const pe=normalizeArguments((async(t,r)=>{const[i,o]=await Promise.all([generateTasks(t,r),getFilter(r)]);const a=await Promise.all(i.map((t=>ae(t.patterns,t.options))));return unionFastGlobResults(a,o)}));const me=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>ae.sync(t.patterns,t.options)));return unionFastGlobResults(a,o)}));const ge=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>ae.stream(t.patterns,t.options)));return unionFastGlobStreams(a,o)}));const ye=normalizeArgumentsSync(((t,r)=>t.some((t=>ae.isDynamicPattern(t,r)))));const be=normalizeArguments(generateTasks);const ve=normalizeArgumentsSync(generateTasksSync);var _e=i(1224);var we=i(5842);class CpyError extends we{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpyError"}}const Ee=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"];const Se=new RegExp(Ee.join("|"));function isJunk(t){return Se.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,r,i){this.path=t;this.originalPath=t;this.destination=r;this.options=i;this.isDirectory=false;if(!ye(t)&&ne.existsSync(t)&&ne.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return J.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const r=t.findIndex((t=>t?ye(t):false));const i=t.slice(0,r).join("/");if(i){return J.isAbsolute(i)?i:J.join(this.options.cwd,i)}return this.destination}hasMagic(){return ye(this.options.flat?this.path:this.originalPath)}getMatches(){let t=me(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(J.basename(t))))}return t}}const Oe=(u.cpus().length||1)*2;const Re={ignoreJunk:true,flat:false,cwd:l.cwd()};class Entry{constructor(t,r,i){this.path=t.split("/").join(J.sep);this.relativePath=r.split("/").join(J.sep);this.pattern=i;Object.freeze(this)}get name(){return J.basename(this.path)}get nameWithoutExtension(){return J.basename(this.path,J.extname(this.path))}get extension(){return J.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>_e.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:r,options:i})=>{if(t.pattern.hasMagic()){if(i.flat){if(J.isAbsolute(r)){return J.join(r,t.name)}return J.join(i.cwd,r,t.name)}return J.join(r,J.relative(t.pattern.normalizedPath,t.path))}if(J.isAbsolute(r)){return J.join(r,t.name)}if(t.pattern.isDirectory&&J.relative(i.cwd,t.path).startsWith("..")){return J.join(i.cwd,r,J.basename(t.pattern.originalPath),J.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return J.join(i.cwd,r,J.basename(t.pattern.originalPath),J.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&i.flat){return J.join(i.cwd,r,J.basename(t.pattern.originalPath))}return J.join(i.cwd,r,J.relative(i.cwd,t.path))};const renameFile=(t,r)=>{const i=J.basename(t,J.extname(t));const o=J.extname(t);const a=J.dirname(t);if(typeof r==="string"){return J.join(a,r)}if(typeof r==="function"){return J.join(a,`${r(i)}${o}`)}return t};function cpy(t,r,{concurrency:i=Oe,...o}={}){const a=new Map;const c=new Q;o={...Re,...o};const l=(async()=>{let l=[];let u=0;let h=0;let d=expandPatternsWithBraceExpansion(arrify(t)).map((t=>t.replace(/\\/g,"/")));const p=d.filter((t=>!t.startsWith("!")));const m=d.filter((t=>t.startsWith("!")));if(p.length===0||!r){throw new CpyError("`source` and `destination` required")}d=d.map((t=>new GlobPattern(t,r,{...o,ignore:m})));for(const t of d){let r=[];try{r=t.getMatches()}catch(r){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${r.message}`,r)}if(r.length===0&&!ye(t.originalPath)&&!ye(m)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}l=[...l,...r.map((r=>new Entry(r,J.relative(o.cwd,r),t)))]}if(o.filter!==undefined){l=await pFilter(l,o.filter,{concurrency:1024})}if(l.length===0){c.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const r=a.get(t.sourcePath)||{writtenBytes:0,percent:0};if(r.writtenBytes!==t.writtenBytes||r.percent!==t.percent){h-=r.writtenBytes;h+=t.writtenBytes;if(t.percent===1&&r.percent!==1){u++}a.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});c.emit("progress",{totalFiles:l.length,percent:u/l.length,completedFiles:u,completedSize:h})}};return pMap(l,(async t=>{const i=renameFile(preprocessDestinationPath({entry:t,destination:r,options:o}),o.rename);try{await ie(t.path,i,o).on("progress",fileProgressHandler)}catch(r){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${i}\`: ${r.message}`,r)}return i}),{concurrency:i})})();l.on=(...t)=>{c.on(...t);return l};return l}var xe=i(6718);var Ae=i.n(xe);function isFolderEmpty(t,r){const i=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const o=Y().readdirSync(t).filter((t=>!i.includes(t))).filter((t=>!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${T.green(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=Y().lstatSync(z().join(t,r));if(i.isDirectory()){console.log(` ${T.blue(r)}/`)}else{console.log(` ${r}`)}}catch{console.log(` ${r}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await Y().promises.access(t,(Y().constants||Y()).W_OK);return true}catch(t){return false}}async function makeDir(t,r={recursive:true}){await Y().promises.mkdir(t,r)}var Te=i(2625);var ke=i.n(Te);function isInGitRepository(){try{(0,K.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,K.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,K.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,K.execSync)("git init",{stdio:"ignore"});r=true;(0,K.execSync)("git checkout -b main",{stdio:"ignore"});(0,K.execSync)("git add -A",{stdio:"ignore"});(0,K.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(i){if(r){try{ke().sync(z().join(t,".git"))}catch(t){}}return false}}var Ce=i(8950);class CancelError extends Error{constructor(t){super(t||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(t){return(...r)=>new PCancelable(((i,o,a)=>{r.push(a);t(...r).then(i,o)}))}constructor(t){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((r,i)=>{this._reject=i;const onResolve=t=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;r(t)}};const onReject=t=>{this._isPending=false;i(t)};const onCancel=t=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(t)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}});t(onResolve,onReject,onCancel)}))}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const t of this._cancelHandlers){t()}}catch(t){this._reject(t);return}}if(this._rejectOnCancel){this._reject(new CancelError(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(t){return Ce.object(t)&&"_onResponse"in t}class RequestError extends Error{constructor(t,r,i){super(t);Object.defineProperty(this,"input",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"stack",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=r.code??"ERR_GOT_REQUEST_ERROR";this.input=r.input;if(isRequest(i)){Object.defineProperty(this,"request",{enumerable:false,value:i});Object.defineProperty(this,"response",{enumerable:false,value:i.response});this.options=i.options}else{this.options=i}this.timings=this.request?.timings;if(Ce.string(r.stack)&&Ce.string(this.stack)){const t=this.stack.indexOf(this.message)+this.message.length;const i=this.stack.slice(t).split("\n").reverse();const o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split("\n").reverse();while(o.length>0&&o[0]===i[0]){i.shift()}this.stack=`${this.stack.slice(0,t)}${i.reverse().join("\n")}${o.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t);this.name="MaxRedirectsError";this.code="ERR_TOO_MANY_REDIRECTS"}}class HTTPError extends RequestError{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request);this.name="HTTPError";this.code="ERR_NON_2XX_3XX_RESPONSE"}}class CacheError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="CacheError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}}class UploadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="UploadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}class TimeoutError extends RequestError{constructor(t,r,i){super(t.message,t,i);Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.event=t.event;this.timings=r}}class ReadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="ReadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class RetryError extends RequestError{constructor(t){super("Retrying",{},t);this.name="RetryError";this.code="ERR_RETRYING"}}const Pe=require("node:buffer");const Ie=require("node:http");var Le=i(2361);var Ne=i(3837);var Me=i(2966);const timer=t=>{if(t.timings){return t.timings}const r={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};t.timings=r;const handleError=t=>{t.once(Le.errorMonitor,(()=>{r.error=Date.now();r.phases.total=r.error-r.start}))};handleError(t);const onAbort=()=>{r.abort=Date.now();r.phases.total=r.abort-r.start};t.prependOnceListener("abort",onAbort);const onSocket=t=>{r.socket=Date.now();r.phases.wait=r.socket-r.start;if(Ne.types.isProxy(t)){return}const lookupListener=()=>{r.lookup=Date.now();r.phases.dns=r.lookup-r.socket};t.prependOnceListener("lookup",lookupListener);Me(t,{connect:()=>{r.connect=Date.now();if(r.lookup===undefined){t.removeListener("lookup",lookupListener);r.lookup=r.connect;r.phases.dns=r.lookup-r.socket}r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now();r.phases.tls=r.secureConnect-r.connect}})};if(t.socket){onSocket(t.socket)}else{t.prependOnceListener("socket",onSocket)}const onUpload=()=>{r.upload=Date.now();r.phases.request=r.upload-(r.secureConnect??r.connect)};if(t.writableFinished){onUpload()}else{t.prependOnceListener("finish",onUpload)}t.prependOnceListener("response",(i=>{r.response=Date.now();r.phases.firstByte=r.response-r.upload;i.timings=r;handleError(i);i.prependOnceListener("end",(()=>{t.off("abort",onAbort);i.off("aborted",onAbort);if(r.phases.total){return}r.end=Date.now();r.phases.download=r.end-r.response;r.phases.total=r.end-r.start}));i.prependOnceListener("aborted",onAbort)}));return r};const De=timer;var je=i(3846);var $e=i(1599);var Fe=i(7981);const He="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let t=16;let r="";while(t--){r+=He[Math.random()*He.length<<0]}return r}const Be=createBoundary;const getType=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function isPlainObject(t){if(getType(t)!=="object"){return false}const r=Object.getPrototypeOf(t);if(r===null||r===undefined){return true}const i=r.constructor&&r.constructor.toString();return i===Object.toString()}const Ue=isPlainObject;const normalizeValue=t=>String(t).replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n");const qe=normalizeValue;const escapeName=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");const Ge=escapeName;const isFunction=t=>typeof t==="function";const Ve=isFunction;const isFileLike=t=>Boolean(t&&typeof t==="object"&&Ve(t.constructor)&&t[Symbol.toStringTag]==="File"&&Ve(t.stream)&&t.name!=null&&t.size!=null&&t.lastModified!=null);const isFormData=t=>Boolean(t&&Ve(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&Ve(t.append)&&Ve(t.getAll)&&Ve(t.entries)&&Ve(t[Symbol.iterator]));const ze=isFormData;var We=undefined&&undefined.__classPrivateFieldSet||function(t,r,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,i):a?a.value=i:r.set(t,i),i};var Ye=undefined&&undefined.__classPrivateFieldGet||function(t,r,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!o:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:r.get(t)};var Ke,Xe,Ze,Qe,Je,et,tt,rt,st,it;const nt={enableAdditionalHeaders:false};class FormDataEncoder{constructor(t,r,i){Ke.add(this);Xe.set(this,"\r\n");Ze.set(this,void 0);Qe.set(this,void 0);Je.set(this,"-".repeat(2));et.set(this,new TextEncoder);tt.set(this,void 0);rt.set(this,void 0);st.set(this,void 0);if(!isFormData(t)){throw new TypeError("Expected first argument to be a FormData instance.")}let o;if(Ue(r)){i=r}else{o=r}if(!o){o=Be()}if(typeof o!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(i&&!Ue(i)){throw new TypeError("Expected options argument to be an object.")}We(this,rt,t,"f");We(this,st,{...nt,...i},"f");We(this,Ze,Ye(this,et,"f").encode(Ye(this,Xe,"f")),"f");We(this,Qe,Ye(this,Ze,"f").byteLength,"f");this.boundary=`form-data-boundary-${o}`;this.contentType=`multipart/form-data; boundary=${this.boundary}`;We(this,tt,Ye(this,et,"f").encode(`${Ye(this,Je,"f")}${this.boundary}${Ye(this,Je,"f")}${Ye(this,Xe,"f").repeat(2)}`),"f");this.contentLength=String(this.getContentLength());this.headers=Object.freeze({"Content-Type":this.contentType,"Content-Length":this.contentLength});Object.defineProperties(this,{boundary:{writable:false,configurable:false},contentType:{writable:false,configurable:false},contentLength:{writable:false,configurable:false},headers:{writable:false,configurable:false}})}getContentLength(){let t=0;for(const[r,i]of Ye(this,rt,"f")){const o=isFileLike(i)?i:Ye(this,et,"f").encode(qe(i));t+=Ye(this,Ke,"m",it).call(this,r,o).byteLength;t+=isFileLike(o)?o.size:o.byteLength;t+=Ye(this,Qe,"f")}return t+Ye(this,tt,"f").byteLength}*values(){for(const[t,r]of Ye(this,rt,"f").entries()){const i=isFileLike(r)?r:Ye(this,et,"f").encode(qe(r));yield Ye(this,Ke,"m",it).call(this,t,i);yield i;yield Ye(this,Ze,"f")}yield Ye(this,tt,"f")}async*encode(){for(const t of this.values()){if(isFileLike(t)){yield*t.stream()}else{yield t}}}[(Xe=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,st=new WeakMap,Ke=new WeakSet,it=function _FormDataEncoder_getFieldHeader(t,r){let i="";i+=`${Ye(this,Je,"f")}${this.boundary}${Ye(this,Xe,"f")}`;i+=`Content-Disposition: form-data; name="${Ge(t)}"`;if(isFileLike(r)){i+=`; filename="${Ge(r.name)}"${Ye(this,Xe,"f")}`;i+=`Content-Type: ${r.type||"application/octet-stream"}`}if(Ye(this,st,"f").enableAdditionalHeaders===true){i+=`${Ye(this,Xe,"f")}Content-Length: ${isFileLike(r)?r.size:r.byteLength}`}return Ye(this,et,"f").encode(`${i}${Ye(this,Xe,"f").repeat(2)}`)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}}const ot=null&&FormDataEncoder;const at=require("node:util");function is_form_data_isFormData(t){return Ce.nodeStream(t)&&Ce.function_(t.getBoundary)}async function getBodySize(t,r){if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(Ce.string(t)){return Pe.Buffer.byteLength(t)}if(Ce.buffer(t)){return t.length}if(is_form_data_isFormData(t)){return(0,at.promisify)(t.getLength.bind(t))()}return undefined}function proxyEvents(t,r,i){const o={};for(const a of i){const eventFunction=(...t)=>{r.emit(a,...t)};o[a]=eventFunction;t.on(a,eventFunction)}return()=>{for(const[r,i]of Object.entries(o)){t.off(r,i)}}}const ct=require("node:net");function unhandle(){const t=[];return{once(r,i,o){r.once(i,o);t.push({origin:r,event:i,fn:o})},unhandleAll(){for(const r of t){const{origin:t,event:i,fn:o}=r;t.removeListener(i,o)}t.length=0}}}const ut=Symbol("reentry");const noop=()=>{};class timed_out_TimeoutError extends Error{constructor(t,r){super(`Timeout awaiting '${r}' for ${t}ms`);Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:r});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.code="ETIMEDOUT"}}function timedOut(t,r,i){if(ut in t){return noop}t[ut]=true;const o=[];const{once:a,unhandleAll:c}=unhandle();const addTimeout=(t,r,i)=>{const a=setTimeout(r,t,t,i);a.unref?.();const cancel=()=>{clearTimeout(a)};o.push(cancel);return cancel};const{host:l,hostname:u}=i;const timeoutHandler=(r,i)=>{t.destroy(new timed_out_TimeoutError(r,i))};const cancelTimeouts=()=>{for(const t of o){t()}c()};t.once("error",(r=>{cancelTimeouts();if(t.listenerCount("error")===0){throw r}}));if(typeof r.request!=="undefined"){const i=addTimeout(r.request,timeoutHandler,"request");a(t,"response",(t=>{a(t,"end",i)}))}if(typeof r.socket!=="undefined"){const{socket:i}=r;const socketTimeoutHandler=()=>{timeoutHandler(i,"socket")};t.setTimeout(i,socketTimeoutHandler);o.push((()=>{t.removeListener("timeout",socketTimeoutHandler)}))}const h=typeof r.lookup!=="undefined";const d=typeof r.connect!=="undefined";const p=typeof r.secureConnect!=="undefined";const m=typeof r.send!=="undefined";if(h||d||p||m){a(t,"socket",(o=>{const{socketPath:c}=t;if(o.connecting){const t=Boolean(c??ct.isIP(u??l??"")!==0);if(h&&!t&&typeof o.address().address==="undefined"){const t=addTimeout(r.lookup,timeoutHandler,"lookup");a(o,"lookup",t)}if(d){const timeConnect=()=>addTimeout(r.connect,timeoutHandler,"connect");if(t){a(o,"connect",timeConnect())}else{a(o,"lookup",(t=>{if(t===null){a(o,"connect",timeConnect())}}))}}if(p&&i.protocol==="https:"){a(o,"connect",(()=>{const t=addTimeout(r.secureConnect,timeoutHandler,"secureConnect");a(o,"secureConnect",t)}))}}if(m){const timeRequest=()=>addTimeout(r.send,timeoutHandler,"send");if(o.connecting){a(o,"connect",(()=>{a(t,"upload-complete",timeRequest())}))}else{a(t,"upload-complete",timeRequest())}}}))}if(typeof r.response!=="undefined"){a(t,"upload-complete",(()=>{const i=addTimeout(r.response,timeoutHandler,"response");a(t,"response",i)}))}if(typeof r.read!=="undefined"){a(t,"response",(t=>{const i=addTimeout(r.read,timeoutHandler,"read");a(t,"end",i)}))}return cancelTimeouts}function urlToOptions(t){t=t;const r={protocol:t.protocol,hostname:Ce.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};if(Ce.string(t.port)&&t.port.length>0){r.port=Number(t.port)}if(t.username||t.password){r.auth=`${t.username||""}:${t.password||""}`}return r}class WeakableMap{constructor(){Object.defineProperty(this,"weakMap",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"map",{enumerable:true,configurable:true,writable:true,value:void 0});this.weakMap=new WeakMap;this.map=new Map}set(t,r){if(typeof t==="object"){this.weakMap.set(t,r)}else{this.map.set(t,r)}}get(t){if(typeof t==="object"){return this.weakMap.get(t)}return this.map.get(t)}has(t){if(typeof t==="object"){return this.weakMap.has(t)}return this.map.has(t)}}const calculateRetryDelay=({attemptCount:t,retryOptions:r,error:i,retryAfter:o,computedValue:a})=>{if(i.name==="RetryError"){return 1}if(t>r.limit){return 0}const c=r.methods.includes(i.options.method);const l=r.errorCodes.includes(i.code);const u=i.response&&r.statusCodes.includes(i.response.statusCode);if(!c||!l&&!u){return 0}if(i.response){if(o){if(o>a){return 0}return o}if(i.response.statusCode===413){return 0}}const h=Math.random()*r.noise;return Math.min(2**(t-1)*1e3,r.backoffLimit)+h};const ht=calculateRetryDelay;const ft=require("node:tls");const dt=require("node:https");function lowercaseKeys(t){return Object.fromEntries(Object.entries(t).map((([t,r])=>[t.toLowerCase(),r])))}var pt=i(9201);var mt=i(7331);function parseLinkHeader(t){const r=[];const i=t.split(",");for(const o of i){const[i,...a]=o.split(";");const c=i.trim();if(c[0]!=="<"||c[c.length-1]!==">"){throw new Error(`Invalid format of the Link header reference: ${c}`)}const l=c.slice(1,-1);const u={};if(a.length===0){throw new Error(`Unexpected end of Link header parameters: ${a.join(";")}`)}for(const r of a){const i=r.trim();const o=i.indexOf("=");if(o===-1){throw new Error(`Failed to parse Link header: ${t}`)}const a=i.slice(0,o).trim();const c=i.slice(o+1).trim();u[a]=c}r.push({reference:l,parameters:u})}return r}const[yt,bt]=l.versions.node.split(".").map((t=>Number(t)));function validateSearchParameters(t){for(const r in t){const i=t[r];Ce.assert.any([Ce.string,Ce.number,Ce.boolean,Ce.null_,Ce.undefined],i)}}const vt=new Map;let _t;const getGlobalDnsCache=()=>{if(_t){return _t}_t=new pt;return _t};const wt={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(t){if(t.request.options.responseType==="json"){return t.body}return JSON.parse(t.body)},paginate({response:t}){const r=t.headers.link;if(typeof r!=="string"||r.trim()===""){return false}const i=parseLinkHeader(r);const o=i.find((t=>t.parameters.rel==="next"||t.parameters.rel==='"next"'));if(o){return{url:new ue.URL(o.reference,t.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined};const cloneInternals=t=>{const{hooks:r,retry:i}=t;const o={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...i,errorCodes:[...i.errorCodes],methods:[...i.methods],statusCodes:[...i.statusCodes]},timeout:{...t.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:t.searchParams?new ue.URLSearchParams(t.searchParams):undefined,pagination:{...t.pagination}};if(o.url!==undefined){o.prefixUrl=""}return o};const cloneRaw=t=>{const{hooks:r,retry:i}=t;const o={...t};if(Ce.object(t.context)){o.context={...t.context}}if(Ce.object(t.cacheOptions)){o.cacheOptions={...t.cacheOptions}}if(Ce.object(t.https)){o.https={...t.https}}if(Ce.object(t.cacheOptions)){o.cacheOptions={...o.cacheOptions}}if(Ce.object(t.agent)){o.agent={...t.agent}}if(Ce.object(t.headers)){o.headers={...t.headers}}if(Ce.object(i)){o.retry={...i};if(Ce.array(i.errorCodes)){o.retry.errorCodes=[...i.errorCodes]}if(Ce.array(i.methods)){o.retry.methods=[...i.methods]}if(Ce.array(i.statusCodes)){o.retry.statusCodes=[...i.statusCodes]}}if(Ce.object(t.timeout)){o.timeout={...t.timeout}}if(Ce.object(r)){o.hooks={...r};if(Ce.array(r.init)){o.hooks.init=[...r.init]}if(Ce.array(r.beforeRequest)){o.hooks.beforeRequest=[...r.beforeRequest]}if(Ce.array(r.beforeError)){o.hooks.beforeError=[...r.beforeError]}if(Ce.array(r.beforeRedirect)){o.hooks.beforeRedirect=[...r.beforeRedirect]}if(Ce.array(r.beforeRetry)){o.hooks.beforeRetry=[...r.beforeRetry]}if(Ce.array(r.afterResponse)){o.hooks.afterResponse=[...r.afterResponse]}}if(Ce.object(t.pagination)){o.pagination={...t.pagination}}return o};const getHttp2TimeoutOption=t=>{const r=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter((t=>typeof t==="number"));if(r.length>0){return Math.min(...r)}return undefined};const init=(t,r,i)=>{const o=t.hooks?.init;if(o){for(const t of o){t(r,i)}}};class Options{constructor(t,r,i){Object.defineProperty(this,"_unixOptions",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_internals",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_merging",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_init",{enumerable:true,configurable:true,writable:true,value:void 0});Ce.assert.any([Ce.string,Ce.urlInstance,Ce.object,Ce.undefined],t);Ce.assert.any([Ce.object,Ce.undefined],r);Ce.assert.any([Ce.object,Ce.undefined],i);if(t instanceof Options||r instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(i?._internals??i??wt);this._init=[...i?._init??[]];this._merging=false;this._unixOptions=undefined;try{if(Ce.plainObject(t)){try{this.merge(t);this.merge(r)}finally{this.url=t.url}}else{try{this.merge(r)}finally{if(r?.url!==undefined){if(t===undefined){this.url=r.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(t!==undefined){this.url=t}}}}catch(t){t.options=this;throw t}}merge(t){if(!t){return}if(t instanceof Options){for(const r of t._init){this.merge(r)}return}t=cloneRaw(t);init(this,t,this);init(t,t,this);this._merging=true;if("isStream"in t){this.isStream=t.isStream}try{let r=false;for(const i in t){if(i==="mutableDefaults"||i==="handlers"){continue}if(i==="url"){continue}if(!(i in this)){throw new Error(`Unexpected option: ${i}`)}this[i]=t[i];r=true}if(r){this._init.push(t)}}finally{this._merging=false}}get request(){return this._internals.request}set request(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.request=t}get agent(){return this._internals.agent}set agent(t){Ce.assert.plainObject(t);for(const r in t){if(!(r in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${r}`)}Ce.assert.any([Ce.object,Ce.undefined],t[r])}if(this._merging){Object.assign(this._internals.agent,t)}else{this._internals.agent={...t}}}get h2session(){return this._internals.h2session}set h2session(t){this._internals.h2session=t}get decompress(){return this._internals.decompress}set decompress(t){Ce.assert.boolean(t);this._internals.decompress=t}get timeout(){return this._internals.timeout}set timeout(t){Ce.assert.plainObject(t);for(const r in t){if(!(r in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${r}`)}Ce.assert.any([Ce.number,Ce.undefined],t[r])}if(this._merging){Object.assign(this._internals.timeout,t)}else{this._internals.timeout={...t}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(t){Ce.assert.any([Ce.string,Ce.urlInstance],t);if(t===""){this._internals.prefixUrl="";return}t=t.toString();if(!t.endsWith("/")){t+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:r}=this._internals.url;this._internals.url.href=t+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=t}get body(){return this._internals.body}set body(t){Ce.assert.any([Ce.string,Ce.buffer,Ce.nodeStream,Ce.generator,Ce.asyncGenerator,ze,Ce.undefined],t);if(Ce.nodeStream(t)){Ce.assert.truthy(t.readable)}if(t!==undefined){Ce.assert.undefined(this._internals.form);Ce.assert.undefined(this._internals.json)}this._internals.body=t}get form(){return this._internals.form}set form(t){Ce.assert.any([Ce.plainObject,Ce.undefined],t);if(t!==undefined){Ce.assert.undefined(this._internals.body);Ce.assert.undefined(this._internals.json)}this._internals.form=t}get json(){return this._internals.json}set json(t){Ce.assert.any([Ce.object,Ce.undefined],t);if(t!==undefined){Ce.assert.undefined(this._internals.body);Ce.assert.undefined(this._internals.form)}this._internals.json=t}get url(){return this._internals.url}set url(t){Ce.assert.any([Ce.string,Ce.urlInstance,Ce.undefined],t);if(t===undefined){this._internals.url=undefined;return}if(Ce.string(t)&&t.startsWith("/")){throw new Error("`url` must not start with a slash")}const r=`${this.prefixUrl}${t.toString()}`;const i=new ue.URL(r);this._internals.url=i;decodeURI(r);if(i.protocol==="unix:"){i.href=`http://unix${i.pathname}${i.search}`}if(i.protocol!=="http:"&&i.protocol!=="https:"){const t=new Error(`Unsupported protocol: ${i.protocol}`);t.code="ERR_UNSUPPORTED_PROTOCOL";throw t}if(this._internals.username){i.username=this._internals.username;this._internals.username=""}if(this._internals.password){i.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){i.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(i.hostname==="unix"){const t=/(?<socketPath>.+?):(?<path>.+)/.exec(`${i.pathname}${i.search}`);if(t?.groups){const{socketPath:r,path:i}=t.groups;this._unixOptions={socketPath:r,path:i,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(t){Ce.assert.any([Ce.object,Ce.undefined],t);if(t===undefined){this._internals.cookieJar=undefined;return}let{setCookie:r,getCookieString:i}=t;Ce.assert.function_(r);Ce.assert.function_(i);if(r.length===4&&i.length===0){r=(0,at.promisify)(r.bind(t));i=(0,at.promisify)(i.bind(t));this._internals.cookieJar={setCookie:r,getCookieString:i}}else{this._internals.cookieJar=t}}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(t){Ce.assert.boolean(t);this._internals.ignoreInvalidCookies=t}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new ue.URLSearchParams}return this._internals.searchParams}set searchParams(t){Ce.assert.any([Ce.string,Ce.object,Ce.undefined],t);const r=this._internals.url;if(t===undefined){this._internals.searchParams=undefined;if(r){r.search=""}return}const i=this.searchParams;let o;if(Ce.string(t)){o=new ue.URLSearchParams(t)}else if(t instanceof ue.URLSearchParams){o=t}else{validateSearchParameters(t);o=new ue.URLSearchParams;for(const r in t){const a=t[r];if(a===null){o.append(r,"")}else if(a===undefined){i.delete(r)}else{o.append(r,a)}}}if(this._merging){for(const t of o.keys()){i.delete(t)}for(const[t,r]of o){i.append(t,r)}}else if(r){r.search=i.toString()}else{this._internals.searchParams=i}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(t){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.dnsLookup=t}get dnsCache(){return this._internals.dnsCache}set dnsCache(t){Ce.assert.any([Ce.object,Ce.boolean,Ce.undefined],t);if(t===true){this._internals.dnsCache=getGlobalDnsCache()}else if(t===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=t}}get context(){return this._internals.context}set context(t){Ce.assert.object(t);if(this._merging){Object.assign(this._internals.context,t)}else{this._internals.context={...t}}}get hooks(){return this._internals.hooks}set hooks(t){Ce.assert.object(t);for(const r in t){if(!(r in this._internals.hooks)){throw new Error(`Unexpected hook event: ${r}`)}const i=r;const o=t;const a=o[i];Ce.assert.any([Ce.array,Ce.undefined],a);if(a){for(const t of a){Ce.assert.function_(t)}}if(this._merging){if(a){this._internals.hooks[i].push(...a)}}else{if(!a){throw new Error(`Missing hook event: ${r}`)}this._internals.hooks[r]=[...a]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(t){Ce.assert.boolean(t);this._internals.followRedirect=t}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(t){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(t){Ce.assert.number(t);this._internals.maxRedirects=t}get cache(){return this._internals.cache}set cache(t){Ce.assert.any([Ce.object,Ce.string,Ce.boolean,Ce.undefined],t);if(t===true){this._internals.cache=vt}else if(t===false){this._internals.cache=undefined}else{this._internals.cache=t}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(t){Ce.assert.boolean(t);this._internals.throwHttpErrors=t}get username(){const t=this._internals.url;const r=t?t.username:this._internals.username;return decodeURIComponent(r)}set username(t){Ce.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.username=i}else{this._internals.username=i}}get password(){const t=this._internals.url;const r=t?t.password:this._internals.password;return decodeURIComponent(r)}set password(t){Ce.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.password=i}else{this._internals.password=i}}get http2(){return this._internals.http2}set http2(t){Ce.assert.boolean(t);this._internals.http2=t}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(t){Ce.assert.boolean(t);this._internals.allowGetBody=t}get headers(){return this._internals.headers}set headers(t){Ce.assert.plainObject(t);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(t))}else{this._internals.headers=lowercaseKeys(t)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(t){Ce.assert.boolean(t);this._internals.methodRewriting=t}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(t){if(t!==undefined&&t!==4&&t!==6){throw new TypeError(`Invalid DNS lookup IP version: ${t}`)}this._internals.dnsLookupIpVersion=t}get parseJson(){return this._internals.parseJson}set parseJson(t){Ce.assert.function_(t);this._internals.parseJson=t}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(t){Ce.assert.function_(t);this._internals.stringifyJson=t}get retry(){return this._internals.retry}set retry(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.function_,Ce.undefined],t.calculateDelay);Ce.assert.any([Ce.number,Ce.undefined],t.maxRetryAfter);Ce.assert.any([Ce.number,Ce.undefined],t.limit);Ce.assert.any([Ce.array,Ce.undefined],t.methods);Ce.assert.any([Ce.array,Ce.undefined],t.statusCodes);Ce.assert.any([Ce.array,Ce.undefined],t.errorCodes);Ce.assert.any([Ce.number,Ce.undefined],t.noise);if(t.noise&&Math.abs(t.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${t.noise}`)}for(const r in t){if(!(r in this._internals.retry)){throw new Error(`Unexpected retry option: ${r}`)}}if(this._merging){Object.assign(this._internals.retry,t)}else{this._internals.retry={...t}}const{retry:r}=this._internals;r.methods=[...new Set(r.methods.map((t=>t.toUpperCase())))];r.statusCodes=[...new Set(r.statusCodes)];r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(t){Ce.assert.any([Ce.string,Ce.undefined],t);this._internals.localAddress=t}get method(){return this._internals.method}set method(t){Ce.assert.string(t);this._internals.method=t.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.createConnection=t}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.boolean,Ce.undefined],t.shared);Ce.assert.any([Ce.number,Ce.undefined],t.cacheHeuristic);Ce.assert.any([Ce.number,Ce.undefined],t.immutableMinTimeToLive);Ce.assert.any([Ce.boolean,Ce.undefined],t.ignoreCargoCult);for(const r in t){if(!(r in this._internals.cacheOptions)){throw new Error(`Cache option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,t)}else{this._internals.cacheOptions={...t}}}get https(){return this._internals.https}set https(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.boolean,Ce.undefined],t.rejectUnauthorized);Ce.assert.any([Ce.function_,Ce.undefined],t.checkServerIdentity);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.certificateAuthority);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.key);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.certificate);Ce.assert.any([Ce.string,Ce.undefined],t.passphrase);Ce.assert.any([Ce.string,Ce.buffer,Ce.array,Ce.undefined],t.pfx);Ce.assert.any([Ce.array,Ce.undefined],t.alpnProtocols);Ce.assert.any([Ce.string,Ce.undefined],t.ciphers);Ce.assert.any([Ce.string,Ce.buffer,Ce.undefined],t.dhparam);Ce.assert.any([Ce.string,Ce.undefined],t.signatureAlgorithms);Ce.assert.any([Ce.string,Ce.undefined],t.minVersion);Ce.assert.any([Ce.string,Ce.undefined],t.maxVersion);Ce.assert.any([Ce.boolean,Ce.undefined],t.honorCipherOrder);Ce.assert.any([Ce.number,Ce.undefined],t.tlsSessionLifetime);Ce.assert.any([Ce.string,Ce.undefined],t.ecdhCurve);Ce.assert.any([Ce.string,Ce.buffer,Ce.array,Ce.undefined],t.certificateRevocationLists);for(const r in t){if(!(r in this._internals.https)){throw new Error(`HTTPS option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,t)}else{this._internals.https={...t}}}get encoding(){return this._internals.encoding}set encoding(t){if(t===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}Ce.assert.any([Ce.string,Ce.undefined],t);this._internals.encoding=t}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(t){Ce.assert.boolean(t);this._internals.resolveBodyOnly=t}get isStream(){return this._internals.isStream}set isStream(t){Ce.assert.boolean(t);this._internals.isStream=t}get responseType(){return this._internals.responseType}set responseType(t){if(t===undefined){this._internals.responseType="text";return}if(t!=="text"&&t!=="buffer"&&t!=="json"){throw new Error(`Invalid \`responseType\` option: ${t}`)}this._internals.responseType=t}get pagination(){return this._internals.pagination}set pagination(t){Ce.assert.object(t);if(this._merging){Object.assign(this._internals.pagination,t)}else{this._internals.pagination=t}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(t){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(t){Ce.assert.boolean(t);this._internals.setHost=t}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(t){Ce.assert.any([Ce.number,Ce.undefined],t);this._internals.maxHeaderSize=t}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](t,r){return(0,at.inspect)(this._internals,r)}createNativeRequestOptions(){const t=this._internals;const r=t.url;let i;if(r.protocol==="https:"){i=t.http2?t.agent:t.agent.https}else{i=t.agent.http}const{https:o}=t;let{pfx:a}=o;if(Ce.array(a)&&Ce.plainObject(a[0])){a=a.map((t=>({buf:t.buffer,passphrase:t.passphrase})))}return{...t.cacheOptions,...this._unixOptions,ALPNProtocols:o.alpnProtocols,ca:o.certificateAuthority,cert:o.certificate,key:o.key,passphrase:o.passphrase,pfx:o.pfx,rejectUnauthorized:o.rejectUnauthorized,checkServerIdentity:o.checkServerIdentity??ft.checkServerIdentity,ciphers:o.ciphers,honorCipherOrder:o.honorCipherOrder,minVersion:o.minVersion,maxVersion:o.maxVersion,sigalgs:o.signatureAlgorithms,sessionTimeout:o.tlsSessionLifetime,dhparam:o.dhparam,ecdhCurve:o.ecdhCurve,crl:o.certificateRevocationLists,lookup:t.dnsLookup??t.dnsCache?.lookup,family:t.dnsLookupIpVersion,agent:i,setHost:t.setHost,method:t.method,maxHeaderSize:t.maxHeaderSize,localAddress:t.localAddress,headers:t.headers,createConnection:t.createConnection,timeout:t.http2?getHttp2TimeoutOption(t):undefined,h2session:t.h2session}}getRequestFunction(){const t=this._internals.url;const{request:r}=this._internals;if(!r&&t){return this.getFallbackRequestFunction()}return r}getFallbackRequestFunction(){const t=this._internals.url;if(!t){return}if(t.protocol==="https:"){if(this._internals.http2){if(yt<15||yt===15&&bt<10){const t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");t.code="EUNSUPPORTED";throw t}return mt.auto}return dt.request}return Ie.request}freeze(){const t=this._internals;Object.freeze(t);Object.freeze(t.hooks);Object.freeze(t.hooks.afterResponse);Object.freeze(t.hooks.beforeError);Object.freeze(t.hooks.beforeRedirect);Object.freeze(t.hooks.beforeRequest);Object.freeze(t.hooks.beforeRetry);Object.freeze(t.hooks.init);Object.freeze(t.https);Object.freeze(t.cacheOptions);Object.freeze(t.agent);Object.freeze(t.headers);Object.freeze(t.timeout);Object.freeze(t.retry);Object.freeze(t.retry.errorCodes);Object.freeze(t.retry.methods);Object.freeze(t.retry.statusCodes);Object.freeze(t.context)}}const isResponseOk=t=>{const{statusCode:r}=t;const i=t.request.options.followRedirect?299:399;return r>=200&&r<=i||r===304};class ParseError extends RequestError{constructor(t,r){const{options:i}=r.request;super(`${t.message} in "${i.url.toString()}"`,t,r.request);this.name="ParseError";this.code="ERR_BODY_PARSE_FAILURE"}}const parseBody=(t,r,i,o)=>{const{rawBody:a}=t;try{if(r==="text"){return a.toString(o)}if(r==="json"){return a.length===0?"":i(a.toString(o))}if(r==="buffer"){return a}}catch(r){throw new ParseError(r,t)}throw new ParseError({message:`Unknown body type '${r}'`,name:"Error"},t)};function isClientRequest(t){return t.writable&&!t.writableEnded}const Et=isClientRequest;const St=Ce.string(l.versions.brotli);const Ot=new Set(["GET","HEAD"]);const Rt=new WeakableMap;const xt=new Set([300,301,302,303,304,307,308]);const At=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends he.Duplex{constructor(t,r,i){super({autoDestroy:false,highWaterMark:0});Object.defineProperty(this,"constructor",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_noPipe",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"requestUrl",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"redirectUrls",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"retryCount",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopRetry",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_downloadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_uploadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopReading",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_pipedServerResponses",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_responseSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_bodySize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_unproxyEvents",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_isFromCache",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cannotHaveBody",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_triggerRead",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cancelTimeouts",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_nativeResponse",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_flushed",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_aborted",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_requestInitialized",{enumerable:true,configurable:true,writable:true,value:void 0});this._downloadedSize=0;this._uploadedSize=0;this._stopReading=false;this._pipedServerResponses=new Set;this._cannotHaveBody=false;this._unproxyEvents=core_noop;this._triggerRead=false;this._cancelTimeouts=core_noop;this._jobs=[];this._flushed=false;this._requestInitialized=false;this._aborted=false;this.redirectUrls=[];this.retryCount=0;this._stopRetry=core_noop;const unlockWrite=()=>{this._unlockWrite()};const lockWrite=()=>{this._lockWrite()};this.on("pipe",(t=>{t.prependListener("data",unlockWrite);t.on("data",lockWrite);t.prependListener("end",unlockWrite);t.on("end",lockWrite)}));this.on("unpipe",(t=>{t.off("data",unlockWrite);t.off("data",lockWrite);t.off("end",unlockWrite);t.off("end",lockWrite)}));this.on("pipe",(t=>{if(t.headers){Object.assign(this.options.headers,t.headers)}}));this.on("newListener",(t=>{if(t==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(t,r,i);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url}catch(t){const{options:r}=t;if(r){this.options=r}this.flush=async()=>{this.flush=async()=>{};this.destroy(t)};return}const{json:o,body:a,form:c}=this.options;if(o||a||c){this._lockWrite()}if(Ce.nodeStream(a)){a.once("error",(t=>{if(this._flushed){this._beforeError(new UploadError(t,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(t,this))}}}))}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const t of this._jobs){t()}this._jobs.length=0;this._requestInitialized=true}catch(t){this._beforeError(t)}}_beforeError(t){if(this._stopReading){return}const{response:r,options:i}=this;const o=this.retryCount+(t.name==="RetryError"?0:1);this._stopReading=true;if(!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}const a=t;void(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed){r.setEncoding(this.readableEncoding);const t=await this._setRawBody(r);if(t){r.body=r.rawBody.toString()}}if(this.listenerCount("retry")!==0){let c;try{let t;if(r&&"retry-after"in r.headers){t=Number(r.headers["retry-after"]);if(Number.isNaN(t)){t=Date.parse(r.headers["retry-after"])-Date.now();if(t<=0){t=1}}else{t*=1e3}}const l=i.retry;c=await l.calculateDelay({attemptCount:o,retryOptions:l,error:a,retryAfter:t,computedValue:ht({attemptCount:o,retryOptions:l,error:a,retryAfter:t,computedValue:l.maxRetryAfter??i.timeout.request??Number.POSITIVE_INFINITY})})}catch(t){void this._error(new RequestError(t.message,t,this));return}if(c){await new Promise((t=>{const r=setTimeout(t,c);this._stopRetry=()=>{clearTimeout(r);t()}}));if(this.destroyed){return}try{for(const t of this.options.hooks.beforeRetry){await t(a,this.retryCount+1)}}catch(r){void this._error(new RequestError(r.message,t,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",this.retryCount+1,t,(t=>{const r=new Request(i.url,t,i);r.retryCount=this.retryCount+1;l.nextTick((()=>{void r.flush()}));return r}));return}}void this._error(a)})()}_read(){this._triggerRead=true;const{response:t}=this;if(t&&!this._stopReading){if(t.readableLength){this._triggerRead=false}let r;while((r=t.read())!==null){this._downloadedSize+=r.length;const t=this.downloadProgress;if(t.percent<1){this.emit("downloadProgress",t)}this.push(r)}}}_write(t,r,i){const write=()=>{this._writeRequest(t,r,i)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(t){const endRequest=()=>{if(!this._request||this._request.destroyed){t();return}this._request.end((r=>{if(this._request._writableState?.errored){return}if(!r){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request.emit("upload-complete")}t(r)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(t,r){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();if(this.options){const{body:t}=this.options;if(Ce.nodeStream(t)){t.destroy()}}if(this._request){this._request.destroy()}if(t!==null&&!Ce.undefined(t)&&!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}r(t)}pipe(t,r){if(t instanceof Ie.ServerResponse){this._pipedServerResponses.add(t)}return super.pipe(t,r)}unpipe(t){if(t instanceof Ie.ServerResponse){this._pipedServerResponses.delete(t)}super.unpipe(t);return this}_lockWrite(){const onLockedWrite=()=>{throw new TypeError("The payload has been already provided")};this.write=onLockedWrite;this.end=onLockedWrite}_unlockWrite(){this.write=super.write;this.end=super.end}async _finalizeBody(){const{options:t}=this;const{headers:r}=t;const i=!Ce.undefined(t.form);const o=!Ce.undefined(t.json);const a=!Ce.undefined(t.body);const c=Ot.has(t.method)&&!(t.method==="GET"&&t.allowGetBody);this._cannotHaveBody=c;if(i||o||a){if(c){throw new TypeError(`The \`${t.method}\` method cannot be used with a body`)}const o=!Ce.string(r["content-type"]);if(a){if(ze(t.body)){const i=new FormDataEncoder(t.body);if(o){r["content-type"]=i.headers["Content-Type"]}r["content-length"]=i.headers["Content-Length"];t.body=i.encode()}if(is_form_data_isFormData(t.body)&&o){r["content-type"]=`multipart/form-data; boundary=${t.body.getBoundary()}`}}else if(i){if(o){r["content-type"]="application/x-www-form-urlencoded"}const{form:i}=t;t.form=undefined;t.body=new ue.URLSearchParams(i).toString()}else{if(o){r["content-type"]="application/json"}const{json:i}=t;t.json=undefined;t.body=t.stringifyJson(i)}const l=await getBodySize(t.body,t.headers);if(Ce.undefined(r["content-length"])&&Ce.undefined(r["transfer-encoding"])&&!c&&!Ce.undefined(l)){r["content-length"]=String(l)}}else if(c){this._lockWrite()}else{this._unlockWrite()}if(t.responseType==="json"&&!("accept"in t.headers)){t.headers.accept="application/json"}this._bodySize=Number(r["content-length"])||undefined}async _onResponseBase(t){if(this.isAborted){return}const{options:r}=this;const{url:i}=r;this._nativeResponse=t;if(r.decompress){t=$e(t)}const o=t.statusCode;const a=t;a.statusMessage=a.statusMessage?a.statusMessage:Ie.STATUS_CODES[o];a.url=r.url.toString();a.requestUrl=this.requestUrl;a.redirectUrls=this.redirectUrls;a.request=this;a.isFromCache=this._nativeResponse.fromCache??false;a.ip=this.ip;a.retryCount=this.retryCount;this._isFromCache=a.isFromCache;this._responseSize=Number(t.headers["content-length"])||undefined;this.response=a;t.once("end",(()=>{this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress)}));t.once("error",(r=>{this._aborted=true;t.destroy();this._beforeError(new ReadError(r,this))}));t.once("aborted",(()=>{this._aborted=true;this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}));this.emit("downloadProgress",this.downloadProgress);const c=t.headers["set-cookie"];if(Ce.object(r.cookieJar)&&c){let t=c.map((async t=>r.cookieJar.setCookie(t,i.toString())));if(r.ignoreInvalidCookies){t=t.map((async t=>{try{await t}catch{}}))}try{await Promise.all(t)}catch(t){this._beforeError(t);return}}if(this.isAborted){return}if(r.followRedirect&&t.headers.location&&xt.has(o)){t.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=r.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;const c=new Options(undefined,undefined,this.options);const l=o===303&&c.method!=="GET"&&c.method!=="HEAD";if(l||c.methodRewriting){c.method="GET";c.body=undefined;c.json=undefined;c.form=undefined;delete c.headers["content-length"]}try{const r=Pe.Buffer.from(t.headers.location,"binary").toString();const o=new ue.URL(r,i);if(o.hostname!==i.hostname||o.port!==i.port){if("host"in c.headers){delete c.headers.host}if("cookie"in c.headers){delete c.headers.cookie}if("authorization"in c.headers){delete c.headers.authorization}if(c.username||c.password){c.username="";c.password=""}}else{o.username=c.username;o.password=c.password}this.redirectUrls.push(o);c.prefixUrl="";c.url=o;for(const t of c.hooks.beforeRedirect){await t(c,a)}this.emit("redirect",c,a);this.options=c;await this._makeRequest()}catch(t){this._beforeError(t);return}return}if(r.isStream&&r.throwHttpErrors&&!isResponseOk(a)){this._beforeError(new HTTPError(a));return}t.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{t.resume()}));this.on("pause",(()=>{t.pause()}));t.once("end",(()=>{this.push(null)}));if(this._noPipe){const r=await this._setRawBody();if(r){this.emit("response",t)}return}this.emit("response",t);for(const i of this._pipedServerResponses){if(i.headersSent){continue}for(const o in t.headers){const a=r.decompress?o!=="content-encoding":true;const c=t.headers[o];if(a){i.setHeader(o,c)}}i.statusCode=o}}async _setRawBody(t=this){if(t.readableEnded){return false}try{const r=await(0,Fe.buffer)(t);if(!this.isAborted){this.response.rawBody=r;return true}}catch{}return false}async _onResponse(t){try{await this._onResponseBase(t)}catch(t){this._beforeError(t)}}_onRequest(t){const{options:r}=this;const{timeout:i,url:o}=r;De(t);if(this.options.http2){t.setTimeout(0)}this._cancelTimeouts=timedOut(t,i,o);const a=r.cache?"cacheableResponse":"response";t.once(a,(t=>{void this._onResponse(t)}));t.once("error",(r=>{this._aborted=true;t.destroy();r=r instanceof timed_out_TimeoutError?new TimeoutError(r,this.timings,this):new RequestError(r.message,r,this);this._beforeError(r)}));this._unproxyEvents=proxyEvents(t,this,At);this._request=t;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",t)}async _asyncWrite(t){return new Promise(((r,i)=>{super.write(t,(t=>{if(t){i(t);return}r()}))}))}_sendBody(){const{body:t}=this.options;const r=this.redirectUrls.length===0?this:this._request??this;if(Ce.nodeStream(t)){t.pipe(r)}else if(Ce.generator(t)||Ce.asyncGenerator(t)){(async()=>{try{for await(const r of t){await this._asyncWrite(r)}super.end()}catch(t){this._beforeError(t)}})()}else{this._unlockWrite();if(!Ce.undefined(t)){this._writeRequest(t,undefined,(()=>{}));r.end();this._lockWrite()}else if(this._cannotHaveBody||this._noPipe){r.end();this._lockWrite()}}}_prepareCache(t){if(!Rt.has(t)){Rt.set(t,new je(((t,r)=>{const i=t._request(t,r);if(Ce.promise(i)){i.once=(t,r)=>{if(t==="error"){(async()=>{try{await i}catch(t){r(t)}})()}else if(t==="abort"){(async()=>{try{const t=await i;t.once("abort",r)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${t}`)}return i}}return i}),t))}}async _createCacheableRequest(t,r){return new Promise(((i,o)=>{Object.assign(r,urlToOptions(t));let a;const c=Rt.get(r.cache)(r,(async t=>{t._readableState.autoDestroy=false;if(a){const fix=()=>{if(t.req){t.complete=t.req.res.complete}};t.prependOnceListener("end",fix);fix();(await a).emit("cacheableResponse",t)}i(t)}));c.once("error",o);c.once("request",(async t=>{a=t;i(a)}))}))}async _makeRequest(){const{options:t}=this;const{headers:r,username:i,password:o}=t;const a=t.cookieJar;for(const t in r){if(Ce.undefined(r[t])){delete r[t]}else if(Ce.null_(r[t])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(t.decompress&&Ce.undefined(r["accept-encoding"])){r["accept-encoding"]=St?"gzip, deflate, br":"gzip, deflate"}if(i||o){const t=Pe.Buffer.from(`${i}:${o}`).toString("base64");r.authorization=`Basic ${t}`}if(a){const i=await a.getCookieString(t.url.toString());if(Ce.nonEmptyString(i)){r.cookie=i}}t.prefixUrl="";let c;for(const r of t.hooks.beforeRequest){const i=await r(t);if(!Ce.undefined(i)){c=()=>i;break}}if(!c){c=t.getRequestFunction()}const l=t.url;this._requestOptions=t.createNativeRequestOptions();if(t.cache){this._requestOptions._request=c;this._requestOptions.cache=t.cache;this._prepareCache(t.cache)}const u=t.cache?this._createCacheableRequest:c;try{let r=u(l,this._requestOptions);if(Ce.promise(r)){r=await r}if(Ce.undefined(r)){r=t.getFallbackRequestFunction()(l,this._requestOptions);if(Ce.promise(r)){r=await r}}if(Et(r)){this._onRequest(r)}else if(this.writable){this.once("finish",(()=>{void this._onResponse(r)}));this._sendBody()}else{void this._onResponse(r)}}catch(t){if(t instanceof je.CacheError){throw new CacheError(t,this)}throw t}}async _error(t){try{for(const r of this.options.hooks.beforeError){t=await r(t)}}catch(r){t=new RequestError(r.message,r,this)}this.destroy(t)}_writeRequest(t,r,i){if(!this._request||this._request.destroyed){return}this._request.write(t,r,(o=>{if(!o){this._uploadedSize+=Pe.Buffer.byteLength(t,r);const i=this.uploadProgress;if(i.percent<1){this.emit("uploadProgress",i)}}i(o)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let t;if(this._responseSize){t=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){t=1}else{t=0}return{percent:t,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let t;if(this._bodySize){t=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){t=1}else{t=0}return{percent:t,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}}class types_CancelError extends RequestError{constructor(t){super("Promise was canceled",{},t);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const Tt=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(t){let r;let i;let o;const a=new Q.EventEmitter;const c=new PCancelable(((l,u,h)=>{h((()=>{r.destroy()}));h.shouldReject=false;h((()=>{u(new types_CancelError(r))}));const makeRequest=d=>{h((()=>{}));const p=t??new Request(undefined,undefined,o);p.retryCount=d;p._noPipe=true;r=p;p.once("response",(async t=>{const r=(t.headers["content-encoding"]??"").toLowerCase();const o=r==="gzip"||r==="deflate"||r==="br";const{options:a}=p;if(o&&!a.decompress){t.body=t.rawBody}else{try{t.body=parseBody(t,a.responseType,a.parseJson,a.encoding)}catch(r){t.body=t.rawBody.toString();if(isResponseOk(t)){p._beforeError(r);return}}}try{const r=a.hooks.afterResponse;for(const[i,o]of r.entries()){t=await o(t,(async t=>{a.merge(t);a.prefixUrl="";if(t.url){a.url=t.url}a.hooks.afterResponse=a.hooks.afterResponse.slice(0,i);throw new RetryError(p)}));if(!(Ce.object(t)&&Ce.number(t.statusCode)&&!Ce.nullOrUndefined(t.body))){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(t){p._beforeError(t);return}i=t;if(!isResponseOk(t)){p._beforeError(new HTTPError(t));return}p.destroy();l(p.options.resolveBodyOnly?t.body:t)}));const onError=t=>{if(c.isCanceled){return}const{options:r}=p;if(t instanceof HTTPError&&!r.throwHttpErrors){const{response:r}=t;p.destroy();l(p.options.resolveBodyOnly?r.body:r);return}u(t)};p.once("error",onError);const m=p.options?.body;p.once("retry",((r,i)=>{t=undefined;const a=p.options.body;if(m===a&&Ce.nodeStream(a)){i.message="Cannot retry with consumed body stream";onError(i);return}o=p.options;makeRequest(r)}));proxyEvents(p,a,Tt);if(Ce.undefined(t)){void p.flush()}};makeRequest(0)}));c.on=(t,r)=>{a.on(t,r);return c};const shortcut=t=>{const r=(async()=>{await c;const{options:r}=i.request;return parseBody(i,t,r.parseJson,r.encoding)})();Object.defineProperties(r,Object.getOwnPropertyDescriptors(c));return r};c.json=()=>{if(r.options){const{headers:t}=r.options;if(!r.writableFinished&&!("accept"in t)){t.accept="application/json"}}return shortcut("json")};c.buffer=()=>shortcut("buffer");c.text=()=>shortcut("text");return c}const delay=async t=>new Promise((r=>{setTimeout(r,t)}));const isGotInstance=t=>Ce.function_(t);const kt=["get","post","put","patch","head","delete"];const create=t=>{t={options:new Options(undefined,undefined,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults};Object.defineProperty(t,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(r,i,o=t.options)=>{const a=new Request(r,i,o);let c;const lastHandler=t=>{a.options=t;a._noPipe=!t.isStream;void a.flush();if(t.isStream){return a}if(!c){c=asPromise(a)}return c};let l=0;const iterateHandlers=r=>{const i=t.handlers[l++]??lastHandler;const o=i(r,iterateHandlers);if(Ce.promise(o)&&!a.options.isStream){if(!c){c=asPromise(a)}if(o!==c){const t=Object.getOwnPropertyDescriptors(c);for(const r in t){if(r in o){delete t[r]}}Object.defineProperties(o,t);o.cancel=c.cancel}}return o};return iterateHandlers(a.options)};got.extend=(...r)=>{const i=new Options(undefined,undefined,t.options);const o=[...t.handlers];let a;for(const t of r){if(isGotInstance(t)){i.merge(t.defaults.options);o.push(...t.defaults.handlers);a=t.defaults.mutableDefaults}else{i.merge(t);if(t.handlers){o.push(...t.handlers)}a=t.mutableDefaults}}return create({options:i,handlers:o,mutableDefaults:Boolean(a)})};const paginateEach=async function*(r,i){let o=new Options(r,i,t.options);o.resolveBodyOnly=false;const{pagination:a}=o;Ce.assert.function_(a.transform);Ce.assert.function_(a.shouldContinue);Ce.assert.function_(a.filter);Ce.assert.function_(a.paginate);Ce.assert.number(a.countLimit);Ce.assert.number(a.requestLimit);Ce.assert.number(a.backoff);const c=[];let{countLimit:l}=a;let u=0;while(u<a.requestLimit){if(u!==0){await delay(a.backoff)}const t=await got(undefined,undefined,o);const r=await a.transform(t);const i=[];Ce.assert.array(r);for(const t of r){if(a.filter({item:t,currentItems:i,allItems:c})){if(!a.shouldContinue({item:t,currentItems:i,allItems:c})){return}yield t;if(a.stackAllItems){c.push(t)}i.push(t);if(--l<=0){return}}}const h=a.paginate({response:t,currentItems:i,allItems:c});if(h===false){return}if(h===t.request.options){o=t.request.options}else{o.merge(h);Ce.assert.any([Ce.urlInstance,Ce.undefined],h.url);if(h.url!==undefined){o.prefixUrl="";o.url=h.url}}u++}};got.paginate=paginateEach;got.paginate.all=async(t,r)=>{const i=[];for await(const o of paginateEach(t,r)){i.push(o)}return i};got.paginate.each=paginateEach;got.stream=(t,r)=>got(t,{...r,isStream:true});for(const t of kt){got[t]=(r,i)=>got(r,{...i,method:t});got.stream[t]=(r,i)=>got(r,{...i,method:t,isStream:true})}if(!t.mutableDefaults){Object.freeze(t.handlers);t.options.freeze()}Object.defineProperty(got,"defaults",{value:t,writable:false,configurable:false,enumerable:true});return got};const Ct=create;const Pt={options:new Options,handlers:[],mutableDefaults:false};const It=Ct(Pt);const Lt=It;var Nt=i(1470);var Mt=i(2781);const Dt=(0,Ne.promisify)(Mt.Stream.pipeline);async function isUrlOk(t){const r=await Lt.head(t).catch((t=>t));return r.statusCode===200}async function getRepoInfo(t,r){const[,i,o,a,c,...l]=t.pathname.split("/");const u=r?r.replace(/^\//,""):l.join("/");if(a===undefined){const t=await Lt(`https://api.github.com/repos/${i}/${o}`).catch((t=>t));if(t.statusCode!==200){return}const r=JSON.parse(t.body);return{username:i,name:o,branch:r["default_branch"],filePath:u}}const h=r?`${c}/${l.join("/")}`.replace(new RegExp(`/${u}|/$`),""):c;if(i&&o&&h&&a==="tree"){return{username:i,name:o,branch:h,filePath:u}}}function hasRepo({username:t,name:r,branch:i,filePath:o}){const a=`https://api.github.com/repos/${t}/${r}/contents`;const c=`${o?`/${o}`:""}/package.json`;return isUrlOk(a+c+`?ref=${i}`)}function hasTemplate(t){return isUrlOk(`https://api.github.com/repos/openpatch/hyperbook/contents/templates/${encodeURIComponent(t)}/package.json`)}function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){return Dt(Lt.stream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),Nt.extract({cwd:t,strip:a?a.split("/").length+1:1},[`${i}-${o}${a?`/${a}`:""}`]))}async function getTemplateInfo(t){let r;if(t){let i;try{i=new URL(t)}catch(t){if(t.code!=="ERR_INVALID_URL"){console.error(t);process.exit(1)}}if(i){if(i.origin!=="https://github.com"){console.error(`Invalid URL: ${T.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}r=await getRepoInfo(i);if(!r){console.error(`Found invalid GitHub URL: ${T.red(`"${t}"`)}. Please fix the URL and try again.`);process.exit(1)}const o=await hasRepo(r);if(!o){console.error(`Could not locate the repository for ${T.red(`"${t}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(t!=="__internal-testing-retry"){const r=await hasTemplate(t);if(!r){console.error(`Could not locate an template named ${T.red(`"${t}"`)}. It could be due to the following:\n`,`1. Your spelling of template ${T.red(`"${t}"`)} might be incorrect.\n`,`2. You might not be connected to the internet.`);process.exit(1)}}}return r}var jt=i(1176);var $t=i.n(jt);function install(t,r,{packageManager:i,isOnline:o,devDependencies:a}){const c=[];const l=[];return new Promise(((u,h)=>{let d;let p=i;const m=i==="yarn";if(r&&r.length){if(m){d=["add","--exact"];if(!o)d.push("--offline");d.push("--cwd",t);if(a)d.push("--dev");d.push(...r)}else{d=["install","--save-exact"];d.push(a?"--save-dev":"--save");d.push(...r)}}else{d=["install"];if(!o){console.log(T.yellow("You appear to be offline."));if(m){console.log(T.yellow("Falling back to the local Yarn cache."));console.log();d.push("--offline")}else{console.log()}}}if(m){d.push(...l)}else{d.push(...c)}const g=G()(p,d,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});g.on("close",(t=>{if(t!==0){h({command:`${p} ${d.join(" ")}`});return}u()}))}))}var Ft=i(9523);var Ht=i.n(Ft);var Bt=i(7310);var Ut=i.n(Bt);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,K.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}function getOnline(){return new Promise((t=>{Ht().lookup("registry.yarnpkg.com",(r=>{if(!r){return t(true)}const i=getProxy();if(!i){return t(false)}const{hostname:o}=Ut().parse(i);if(!o){return t(false)}Ht().lookup(o,(r=>{t(r==null)}))}))}))}async function makeSymlink(t,r){return new Promise(((i,o)=>{Y().symlink(t,r,(t=>{if(t){o()}else{i()}}))}))}class DownloadError extends Error{}async function runSetup(t,r,i){if(!i){i=process.cwd()}if(!t){const r=await readHyperbook();t=r.template}if(!t){t="https://github.com/openpatch/hyperbook/tree/main/templates/simple"}if(!r){r=await getTemplateInfo(t)}const o=z().join(i,".hyperbook");console.log("Removing old template");ke().sync(o);await makeDir(o);const a=await getOnline();try{if(r){const i=r;console.log(`Downloading files from repo ${T.cyan(t)}. This might take a moment.`);console.log();await $t()((()=>downloadAndExtractRepo(o,i)),{retries:3})}}catch(t){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(t)?t.message:t+"")}console.log("Installing packages. This might take a couple of minutes.");console.log();await install(o,null,{packageManager:"npm",isOnline:a});console.log();ke().sync(z().join(o,"book"));ke().sync(z().join(o,"public"));ke().sync(z().join(o,"glossary"));ke().sync(z().join(o,"hyperbook.json"));await makeSymlink(z().join(i,"book"),z().join(o,"book"));await makeSymlink(z().join(i,"public"),z().join(o,"public"));await makeSymlink(z().join(i,"glossary"),z().join(o,"glossary"));await makeSymlink(z().join(i,"hyperbook.json"),z().join(o,"hyperbook.json"))}async function runNew({programName:t,bookPath:r,template:o}){if(typeof r==="string"){r=r.trim()}if(!r){const t=await Ae()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){r=t.path.trim()}}if(!r){console.log();console.log("Please specify the book directory:");console.log(` ${T.cyan(t)} ${T.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${T.cyan(t)} ${T.green("my-new-book")}`);console.log();console.log(`Run ${T.cyan(`${t} --help`)} to see all options.`);process.exit(1)}let a=await getTemplateInfo(o);const c=z().resolve(r);if(!await isWriteable(z().dirname(c))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const l=z().basename(c);await makeDir(c);if(!isFolderEmpty(c,l)){process.exit(1)}const u=process.cwd();console.log(`Creating a new hyperbook in ${T.green(c)}.`);console.log();process.chdir(c);const{description:h}=await Ae()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:d}=await Ae()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:p}=await Ae()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:m}=await Ae()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(m==="custom"){const t=await Ae()({type:"text",name:"license",message:"Which custom license you want to use?"});m=t.license}const{language:g}=await Ae()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const y={name:l,version:"0.0.0",description:h,license:m,author:{name:d,url:p},language:g};Y().writeFileSync(z().join(c,"hyperbook.json"),JSON.stringify(y,null,2)+Z().EOL);console.log();const b=i.ab+"templates";await cpy("default/**",c,{cwd:i.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});await runSetup(o,a,c);if(tryGitInit(c)){console.log("Initialized a git repository.");console.log()}let v;if(z().join(u,l)===r){v=l}else{v=r}console.log(`${T.green("Success!")} Created ${l} at ${r}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(T.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(T.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(T.cyan(" cd"),v);console.log(` ${T.cyan(`hyperbook dev`)}`);console.log()}const qt=JSON.parse('{"name":"hyperbook","version":"0.4.1","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"},"devDependencies":{"@types/async-retry":"1.4.3","@types/cross-spawn":"6.0.2","@types/prompts":"2.0.14","@types/rimraf":"3.0.2","@types/tar":"6.1.1","@vercel/ncc":"0.33.3","async-retry":"1.3.3","chalk":"5.0.1","commander":"9.1.0","cpy":"9.0.1","cross-spawn":"7.0.3","got":"12.0.2","prompts":"2.4.2","rimraf":"3.0.2","tar":"6.1.11","update-check":"1.5.4"}}');const Gt=new D;Gt.name(qt.name).version(qt.version);Gt.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${T.green("<book-directory>")} [options]`).option("-t, --template [name]|[github-url]",`\n A template for your hyperbook. You can use an template name\n from the official hyperbook repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).action((async(t,r)=>{await notifyUpdate();const i=typeof r.template==="string"&&r.template.trim();await runNew({programName:Gt.name(),bookPath:t,template:i})}));Gt.command("dev").description("start the development server for a hyperbook").action((async()=>{await runDev()}));Gt.command("setup").description("downloads the latest version of the template of a hyperbook").action((async()=>{await runSetup()}));Gt.command("build").description("build a hyperbook").action((async()=>{await runBuild()}));Gt.parseAsync(process.argv);const Vt=U()(qt).catch((()=>null));async function notifyUpdate(){try{const t=await Vt;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(T.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+T.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}},9491:t=>{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2057:t=>{"use strict";t.exports=require("constants")},6113:t=>{"use strict";t.exports=require("crypto")},9523:t=>{"use strict";t.exports=require("dns")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5158:t=>{"use strict";t.exports=require("http2")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},6821:t=>{"use strict";t.exports=require("tls")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},621:(t,r,i)=>{const{Argument:o}=i(9787);const{Command:a}=i(5117);const{CommanderError:c,InvalidArgumentError:l}=i(2383);const{Help:u}=i(199);const{Option:h}=i(6362);r=t.exports=new a;r.program=r;r.Argument=o;r.Command=a;r.CommanderError=c;r.Help=u;r.InvalidArgumentError=l;r.InvalidOptionArgumentError=l;r.Option=h},9787:(t,r,i)=>{const{InvalidArgumentError:o}=i(2383);class Argument{constructor(t,r){this.description=r||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const r=t.name()+(t.variadic===true?"...":"");return t.required?"<"+r+">":"["+r+"]"}r.Argument=Argument;r.humanReadableArgName=humanReadableArgName},5117:(t,r,i)=>{const o=i(2361).EventEmitter;const a=i(2081);const c=i(1017);const l=i(7147);const u=i(7282);const{Argument:h,humanReadableArgName:d}=i(9787);const{CommanderError:p}=i(2383);const{Help:m}=i(199);const{Option:g,splitOptionFlags:y}=i(6362);const{suggestSimilar:b}=i(6639);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>u.stdout.write(t),writeErr:t=>u.stderr.write(t),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:undefined,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:undefined,outputError:(t,r)=>r(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,r,i){let o=r;let a=i;if(typeof o==="object"&&o!==null){a=o;o=null}a=a||{};const[,c,l]=t.match(/([^ ]+) *(.*)/);const u=this.createCommand(c);if(o){u.description(o);u._executableHandler=true}if(a.isDefault)this._defaultCommandName=u._name;u._hidden=!!(a.noHelp||a.hidden);u._executableFile=a.executableFile||null;if(l)u.arguments(l);this.commands.push(u);u.parent=this;u.copyInheritedSettings(this);if(o)return this;return u}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new m,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,r){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}r=r||{};if(r.isDefault)this._defaultCommandName=t._name;if(r.noHelp||r.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,r){return new h(t,r)}argument(t,r,i,o){const a=this.createArgument(t,r);if(typeof i==="function"){a.default(o).argParser(i)}else{a.default(i)}this.addArgument(a);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this._args.slice(-1)[0];if(r&&r.variadic){throw new Error(`only the last argument can be variadic '${r.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,r){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=r||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,r){const i=["preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(r)}else{this._lifeCycleHooks[t]=[r]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,r,i){if(this._exitCallback){this._exitCallback(new p(t,r,i))}u.exit(t)}action(t){const listener=r=>{const i=this._args.length;const o=r.slice(0,i);if(this._storeOptionsAsProperties){o[i]=this}else{o[i]=this.opts()}o.push(this);return t.apply(this,o)};this._actionHandler=listener;return this}createOption(t,r){return new g(t,r)}addOption(t){const r=t.name();const i=t.attributeName();if(t.negate){const r=t.long.replace(/^--no-/,"--");if(!this._findOption(r)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const c=this.getOptionValue(i);if(r!==null&&t.parseArg){try{r=t.parseArg(r,c)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}else if(r!==null&&t.variadic){r=t._concatValue(r,c)}if(r==null){if(t.negate){r=false}else if(t.isBoolean()||t.optional){r=true}else{r=""}}this.setOptionValueWithSource(i,r,a)};this.on("option:"+r,(r=>{const i=`error: option '${t.flags}' argument '${r}' is invalid.`;handleOptionValue(r,i,"cli")}));if(t.envVar){this.on("optionEnv:"+r,(r=>{const i=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;handleOptionValue(r,i,"env")}))}return this}_optionEx(t,r,i,o,a){if(typeof r==="object"&&r instanceof g){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const c=this.createOption(r,i);c.makeOptionMandatory(!!t.mandatory);if(typeof o==="function"){c.default(a).argParser(o)}else if(o instanceof RegExp){const t=o;o=(r,i)=>{const o=t.exec(r);return o?o[0]:i};c.default(a).argParser(o)}else{c.default(o)}return this.addOption(c)}option(t,r,i,o){return this._optionEx({},t,r,i,o)}requiredOption(t,r,i,o){return this._optionEx({mandatory:true},t,r,i,o)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}return this}setOptionValueWithSource(t,r,i){this.setOptionValue(t,r);this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}r=r||{};if(t===undefined){t=u.argv;if(u.versions&&u.versions.electron){r.from="electron"}}this.rawArgs=t.slice();let i;switch(r.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(u.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,r){const i=this._prepareUserArgs(t,r);this._parseCommand([],i);return this}async parseAsync(t,r){const i=this._prepareUserArgs(t,r);await this._parseCommand([],i);return this}_executeSubCommand(t,r){r=r.slice();let i=false;const o=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,r){const i=c.resolve(t,r);if(l.existsSync(i))return i;if(o.includes(c.extname(r)))return undefined;const a=o.find((t=>l.existsSync(`${i}${t}`)));if(a)return`${i}${a}`;return undefined}this._checkForMissingMandatoryOptions();let h=t._executableFile||`${this._name}-${t._name}`;let d=this._executableDir||"";if(this._scriptPath){let t;try{t=l.realpathSync(this._scriptPath)}catch(r){t=this._scriptPath}d=c.resolve(c.dirname(t),d)}if(d){let r=findFile(d,h);if(!r&&!t._executableFile&&this._scriptPath){const i=c.basename(this._scriptPath,c.extname(this._scriptPath));if(i!==this._name){r=findFile(d,`${i}-${t._name}`)}}h=r||h}i=o.includes(c.extname(h));let m;if(u.platform!=="win32"){if(i){r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.argv[0],r,{stdio:"inherit"})}else{m=a.spawn(h,r,{stdio:"inherit"})}}else{r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.execPath,r,{stdio:"inherit"})}if(!m.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{u.on(t,(()=>{if(m.killed===false&&m.exitCode===null){m.kill(t)}}))}))}const g=this._exitCallback;if(!g){m.on("close",u.exit.bind(u))}else{m.on("close",(()=>{g(new p(u.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}m.on("error",(r=>{if(r.code==="ENOENT"){const r=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${h}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${r}`;throw new Error(i)}else if(r.code==="EACCES"){throw new Error(`'${h}' not executable`)}if(!g){u.exit(1)}else{const t=new p(1,"commander.executeSubCommandAsync","(error)");t.nestedError=r;g(t)}}));this.runningCommand=m}_dispatchSubcommand(t,r,i){const o=this._findCommand(t);if(!o)this.help({error:true});if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}_checkNumberOfArguments(){this._args.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){try{o=t.parseArg(r,i)}catch(i){if(i.code==="commander.invalidArgument"){const o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}return o};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(i<this.args.length){o=this.args.slice(i);if(r.parseArg){o=o.reduce(((t,i)=>myParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(i<this.args.length){o=this.args[i];if(r.parseArg){o=myParseArg(r,o,r.defaultValue)}}t[i]=o}));this.processedArgs=t}_chainOrCall(t,r){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>r()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[r]!==undefined)).forEach((t=>{t._lifeCycleHooks[r].forEach((r=>{o.push({hookedCommand:t,callback:r})}))}));if(r==="postAction"){o.reverse()}o.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();t=t.concat(i.operands);r=i.unknown;this.args=t.concat(r);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),r)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const o=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(o,t,r)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(o)){checkForUnknownOptions();this._processArguments();this.parent.emit(o,t,r)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,r)}if(this.listenerCount("command:*")){this.emit("command:*",t,r)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((r=>r._name===t||r._aliases.includes(t)))}_findOption(t){return this.options.find((r=>r.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((r=>{if(r.mandatory&&t.getOptionValue(r.attributeName())===undefined){t.missingMandatoryOptionValue(r)}}))}}_checkForConflictingOptions(){const t=this.options.filter((t=>{const r=t.attributeName();if(this.getOptionValue(r)===undefined){return false}return this.getOptionValueSource(r)!=="default"}));const r=t.filter((t=>t.conflictsWith.length>0));r.forEach((r=>{const i=t.find((t=>r.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(r,i)}}))}parseOptions(t){const r=[];const i=[];let o=r;const a=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let c=null;while(a.length){const t=a.shift();if(t==="--"){if(o===i)o.push(t);o.push(...a);break}if(c&&!maybeOption(t)){this.emit(`option:${c.name()}`,t);continue}c=null;if(maybeOption(t)){const r=this._findOption(t);if(r){if(r.required){const t=a.shift();if(t===undefined)this.optionMissingArgument(r);this.emit(`option:${r.name()}`,t)}else if(r.optional){let t=null;if(a.length>0&&!maybeOption(a[0])){t=a.shift()}this.emit(`option:${r.name()}`,t)}else{this.emit(`option:${r.name()}`)}c=r.variadic?r:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const r=this._findOption(`-${t[1]}`);if(r){if(r.required||r.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${r.name()}`,t.slice(2))}else{this.emit(`option:${r.name()}`);a.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const r=t.indexOf("=");const i=this._findOption(t.slice(0,r));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(r+1));continue}}if(maybeOption(t)){o=i}if((this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(t)){r.push(t);if(a.length>0)i.push(...a);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(t);if(a.length>0)r.push(...a);break}else if(this._defaultCommandName){i.push(t);if(a.length>0)i.push(...a);break}}if(this._passThroughOptions){o.push(t);if(a.length>0)o.push(...a);break}o.push(t)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const r=this.options.length;for(let i=0;i<r;i++){const r=this.options[i].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,r)=>Object.assign(t,r.opts())),{})}error(t,r){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=r||{};const o=i.exitCode||1;const a=i.code||"commander.error";this._exit(o,a,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in u.env){const r=t.attributeName();if(this.getOptionValue(r)===undefined||["default","config","env"].includes(this.getOptionValueSource(r))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,u.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}missingArgument(t){const r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){const r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){const findBestOptionFromValue=t=>{const r=t.attributeName();const i=this.getOptionValue(r);const o=this.options.find((t=>t.negate&&r===t.attributeName()));const a=this.options.find((t=>!t.negate&&r===t.attributeName()));if(o&&(o.presetArg===undefined&&i===false||o.presetArg!==undefined&&i===o.presetArg)){return o}return a||t};const getErrorMessage=t=>{const r=findBestOptionFromValue(t);const i=r.attributeName();const o=this.getOptionValueSource(i);if(o==="env"){return`environment variable '${r.envVar}'`}return`option '${r.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let o=this;do{const t=o.createHelp().visibleOptions(o).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);o=o.parent}while(o&&!o._enablePositionalOptions);r=b(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this._args.length;const i=r===1?"":"s";const o=this.parent?` for '${this.name()}'`:"";const a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let r="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));r=b(t,i)}const i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===undefined)return this._version;this._version=t;r=r||"-V, --version";i=i||"output the version number";const o=this.createOption(r,i);this._versionOptionName=o.attributeName();this.options.push(o);this.on("option:"+o.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,r){if(t===undefined&&r===undefined)return this._description;this._description=t;if(r){this._argsDescription=r}return this}alias(t){if(t===undefined)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){r=this.commands[this.commands.length-1]}if(t===r._name)throw new Error("Command alias can't be the same as its name");r._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>d(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=c.basename(t,c.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const r=this.createHelp();if(r.helpWidth===undefined){r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return r.formatHelp(this,r)}_getHelpContext(t){t=t||{};const r={error:!!t.error};let i;if(r.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}r.write=t.write||i;r.command=this;return r}outputHelp(t){let r;if(typeof t==="function"){r=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let o=this.helpInformation(i);if(r){o=r(o);if(typeof o!=="string"&&!Buffer.isBuffer(o)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(o);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=r||this._helpDescription;const i=y(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let r=u.exitCode||0;if(r===0&&t&&typeof t!=="function"&&t.error){r=1}this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const o=`${t}Help`;this.on(o,(t=>{let i;if(typeof r==="function"){i=r({error:t.error,command:t.command})}else{i=r}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,r){const i=t._hasHelpOption&&r.find((r=>r===t._helpLongFlag||r===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let r;let i="127.0.0.1";let o="9229";let a;if((a=t.match(/^(--inspect(-brk)?)$/))!==null){r=a[1]}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){r=a[1];if(/^\d+$/.test(a[3])){o=a[3]}else{i=a[3]}}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){r=a[1];i=a[3];o=a[4]}if(r&&o!=="0"){return`${r}=${i}:${parseInt(o)+1}`}return t}))}function getCommandAndParents(t){const r=[];for(let i=t;i;i=i.parent){r.push(i)}return r}r.Command=Command},2383:(t,r)=>{class CommanderError extends Error{constructor(t,r,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=r;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}r.CommanderError=CommanderError;r.InvalidArgumentError=InvalidArgumentError},199:(t,r,i)=>{const{humanReadableArgName:o}=i(9787);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,o]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const a=t.createCommand(i).helpOption(false);a.description(t._helpCommandDescription);if(o)a.arguments(o);r.push(a)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const o=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||o){let a;if(!i){a=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!o){a=t.createOption(t._helpShortFlag,t._helpDescription)}else{a=t.createOption(t._helpFlags,t._helpDescription)}r.push(a)}if(this.sortOptions){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");r.sort(((t,r)=>getSortKey(t).localeCompare(getSortKey(r))))}return r}visibleArguments(t){if(t._argsDescription){t._args.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const r=t._args.map((t=>o(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce(((t,i)=>Math.max(t,r.subcommandTerm(i).length)),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce(((t,i)=>Math.max(t,r.optionTerm(i).length)),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce(((t,i)=>Math.max(t,r.argumentTerm(i).length)),0)}commandUsage(t){let r=t._name;if(t._aliases[0]){r=r+"|"+t._aliases[0]}let i="";for(let r=t.parent;r;r=r.parent){i=r.name()+" "+i}return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.description()}optionDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){r.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){r.push(`env: ${t.envVar}`)}if(r.length>0){return`${t.description} (${r.join(", ")})`}return t.description}argumentDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(r.length>0){const i=`(${r.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,r){const i=r.padWidth(t,r);const o=r.helpWidth||80;const a=2;const c=2;function formatItem(t,l){if(l){const u=`${t.padEnd(i+c)}${l}`;return r.wrap(u,o-a,i+c)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(a))}let l=[`Usage: ${r.commandUsage(t)}`,""];const u=r.commandDescription(t);if(u.length>0){l=l.concat([u,""])}const h=r.visibleArguments(t).map((t=>formatItem(r.argumentTerm(t),r.argumentDescription(t))));if(h.length>0){l=l.concat(["Arguments:",formatList(h),""])}const d=r.visibleOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(d.length>0){l=l.concat(["Options:",formatList(d),""])}const p=r.visibleCommands(t).map((t=>formatItem(r.subcommandTerm(t),r.subcommandDescription(t))));if(p.length>0){l=l.concat(["Commands:",formatList(p),""])}return l.join("\n")}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){if(t.match(/[\n]\s+/))return t;const a=r-i;if(a<o)return t;const c=t.substr(0,i);const l=t.substr(i);const u=" ".repeat(i);const h=new RegExp(".{1,"+(a-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");const d=l.match(h)||[];return c+d.map(((t,r)=>{if(t.slice(-1)==="\n"){t=t.slice(0,t.length-1)}return(r>0?u:"")+t.trimRight()})).join("\n")}}r.Help=Help},6362:(t,r,i)=>{const{InvalidArgumentError:o}=i(2383);class Option{constructor(t,r){this.flags=t;this.description=r||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[]}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}function camelcase(t){return t.split("-").reduce(((t,r)=>t+r[0].toUpperCase()+r.slice(1)))}function splitOptionFlags(t){let r;let i;const o=t.split(/[ |,]+/);if(o.length>1&&!/^[[<]/.test(o[1]))r=o.shift();i=o.shift();if(!r&&/^-[^-]$/.test(i)){r=i;i=undefined}return{shortFlag:r,longFlag:i}}r.Option=Option;r.splitOptionFlags=splitOptionFlags},6639:(t,r)=>{const i=3;function editDistance(t,r){if(Math.abs(t.length-r.length)>i)return Math.max(t.length,r.length);const o=[];for(let r=0;r<=t.length;r++){o[r]=[r]}for(let t=0;t<=r.length;t++){o[0][t]=t}for(let i=1;i<=r.length;i++){for(let a=1;a<=t.length;a++){let c=1;if(t[a-1]===r[i-1]){c=0}else{c=1}o[a][i]=Math.min(o[a-1][i]+1,o[a][i-1]+1,o[a-1][i-1]+c);if(a>1&&i>1&&t[a-1]===r[i-2]&&t[a-2]===r[i-1]){o[a][i]=Math.min(o[a][i],o[a-2][i-2]+1)}}}return o[t.length][r.length]}function suggestSimilar(t,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const o=t.startsWith("--");if(o){t=t.slice(2);r=r.map((t=>t.slice(2)))}let a=[];let c=i;const l=.4;r.forEach((r=>{if(r.length<=1)return;const i=editDistance(t,r);const o=Math.max(t.length,r.length);const u=(o-i)/o;if(u>l){if(i<c){c=i;a=[r]}else if(i===c){a.push(r)}}}));a.sort(((t,r)=>t.localeCompare(r)));if(o){a=a.map((t=>`--${t}`))}if(a.length>1){return`\n(Did you mean one of ${a.join(", ")}?)`}if(a.length===1){return`\n(Did you mean ${a[0]}?)`}return""}r.suggestSimilar=suggestSimilar}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var c=true;try{t[i](a,a.exports,__nccwpck_require__);c=false}finally{if(c)delete r[i]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(3288);module.exports=i})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbook",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "@vercel/ncc": "0.33.3",
34
34
  "async-retry": "1.3.3",
35
35
  "chalk": "5.0.1",
36
- "commander": "9.0.0",
36
+ "commander": "9.1.0",
37
37
  "cpy": "9.0.1",
38
38
  "cross-spawn": "7.0.3",
39
39
  "got": "12.0.2",