You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
229 lines
497 KiB
229 lines
497 KiB
2 years ago
|
var jk=Object.create;var an=Object.defineProperty;var Dk=Object.getOwnPropertyDescriptor;var Fk=Object.getOwnPropertyNames;var $k=Object.getPrototypeOf,Hk=Object.prototype.hasOwnProperty;var Gk=(r,e,t)=>e in r?an(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Bk=(r,e)=>()=>(r&&(e=r(r=0)),e);var b=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ed=(r,e)=>{for(var t in e)an(r,t,{get:e[t],enumerable:!0})},Uk=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Fk(e))!Hk.call(r,s)&&s!==t&&an(r,s,{get:()=>e[s],enumerable:!(i=Dk(e,s))||i.enumerable});return r};var $=(r,e,t)=>(t=r!=null?jk($k(r)):{},Uk(e||!r||!r.__esModule?an(t,"default",{value:r,enumerable:!0}):t,r));var Fa=(r,e,t)=>(Gk(r,typeof e!="symbol"?e+"":e,t),t);var dd=b((dr,fd)=>{var Jk=require("events").EventEmitter,Ba=require("child_process").spawn,fr=require("path"),Ua=require("fs"),zi=class{constructor(e,t){this.flags=e,this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=hd(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.description=t||"",this.defaultValue=void 0}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Xk(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}},Gr=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Br=class extends Jk{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._args=[],this.rawArgs=null,this._scriptPath=null,this._name=e||"",this._optionValues={},this._storeOptionsAsProperties=!0,this._storeOptionsAsPropertiesCalled=!1,this._passCommandToAction=!0,this._actionResults=[],this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._hasImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command"}command(e,t,i){let s=t,n=i;typeof s=="object"&&s!==null&&(n=s,s=null),n=n||{};let o=e.split(/ +/),a=this.createCommand(o.shift());return s&&(a.description(s),a._executableHandler=!0),n.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(n.noHelp||n.hidden),a._hasHelpOption=this._hasHelpOption,a._helpFlags=this._helpFlags,a._helpDescription=this._helpDescription,a._helpShortFlag=this._helpShortFlag,a._helpLongFlag=this._helpLongFlag,a._helpCommandName=this._helpCommandName,a._helpCommandnameAndArgs=this._helpCommandnameAndArgs,a._helpCommandDescription=this._helpCommandDescription,a._exitCallback=this._exitCallback,a._storeOptionsAsProperties=this._storeOptionsAsProperties,a._passCommandToAction=this._passCommandToAction,a._combineFlagAndOptionalValue=this._combineFlagAndOptionalValue,a._executableFile=n.executableFile||null,this.commands.push(a),a._parseExpectedArgs(o),a.parent=this,s?this:a}createCommand(e){return new Br(e)}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");function i(s){s.forEach(n=>{if(n._executableHandler&&!n._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${n.name()}`);i(n.commands)})}return i(e.commands),t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}arguments(e){return this._parseExpectedArgs(e.split(/ +/))}addHelpCommand(e,t){return e===!1?this._hasImplicitHelpCommand=!1:(this._hasImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCom
|
||
|
- call storeOptionsAsProperties(false) to store option values safely,
|
||
|
- or call storeOptionsAsProperties(true) to suppress this check,
|
||
|
- or change option name
|
||
|
|
||
|
Read more on https://git.io/JJc0W`)}_optionEx(e,t,i,s,n){let o=new zi(t,i),a=o.name(),l=o.attributeName();if(o.mandatory=!!e.mandatory,this._checkForOptionNameClash(o),typeof s!="function")if(s instanceof RegExp){let u=s;s=(c,f)=>{let h=u.exec(c);return h?h[0]:f}}else n=s,s=null;if(o.negate||o.optional||o.required||typeof n=="boolean"){if(o.negate){let u=o.long.replace(/^--no-/,"--");n=this._findOption(u)?this._getOptionValue(l):!0}n!==void 0&&(this._setOptionValue(l,n),o.defaultValue=n)}return this.options.push(o),this.on("option:"+a,u=>{let c=this._getOptionValue(l);u!==null&&s?u=s(u,c===void 0?n:c):u!==null&&o.variadic&&(c===n||!Array.isArray(c)?u=[u]:u=c.concat(u)),typeof c=="boolean"||typeof c>"u"?u==null?this._setOptionValue(l,o.negate?!1:n||!0):this._setOptionValue(l,u):u!==null&&this._setOptionValue(l,o.negate?!1:u)}),this}option(e,t,i,s){return this._optionEx({},e,t,i,s)}requiredOption(e,t,i,s){return this._optionEx({mandatory:!0},e,t,i,s)}combineFlagAndOptionalValue(e){return this._combineFlagAndOptionalValue=e===void 0||e,this}allowUnknownOption(e){return this._allowUnknownOption=e===void 0||e,this}storeOptionsAsProperties(e){if(this._storeOptionsAsPropertiesCalled=!0,this._storeOptionsAsProperties=e===void 0||e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}passCommandToAction(e){return this._passCommandToAction=e===void 0||e,this}_setOptionValue(e,t){this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t}_getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}parse(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=process.argv,process.versions&&process.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let i;switch(t.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._scriptPath&&process.mainModule&&(this._scriptPath=process.mainModule.filename),this._name=this._name||this._scriptPath&&fr.basename(this._scriptPath,fr.extname(this._scriptPath)),this._parseCommand([],i),this}parseAsync(e,t){return this.parse(e,t),Promise.all(this._actionResults).then(()=>this)}_executeSubCommand(e,t){t=t.slice();let i=!1,s=[".js",".ts",".tsx",".mjs"];this._checkForMissingMandatoryOptions();let n=this._scriptPath;!n&&process.mainModule&&(n=process.mainModule.filename);let o;try{let h=Ua.realpathSync(n);o=fr.dirname(h)}catch{o="."}let a=fr.basename(n,fr.extname(n))+"-"+e._name;e._executableFile&&(a=e._executableFile);let l=fr.join(o,a);Ua.existsSync(l)?a=l:s.forEach(h=>{Ua.existsSync(`${l}${h}`)&&(a=`${l}${h}`)}),i=s.includes(fr.extname(a));let u;process.platform!=="win32"?i?(t.unshift(a),t=ud(process.execArgv).concat(t),u=Ba(process.argv[0],t,{stdio:"inherit"})):u=Ba(a,t,{stdio:"inherit"}):(t.unshift(a),t=ud(process.execArgv).concat(t),u=Ba(process.execPath,t,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{process.on(h,()=>{u.killed===!1&&u.exitCode===null&&u.kill(h)})});let f=this._exitCallback;f?u.on("close",()=>{f(new Gr(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):u.on("close",process.exit.bind(process)),u.on("error",h=>{if(h.code==="ENOENT"){let d=`'${a}' does not exist
|
||
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
||
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name`;throw new Error(d)}else if(h.code==="EACCES")throw new Error(`'${a}' not executable`);if(!f)process.exit(1);else{let d=new Gr(1,"commander.executeSubCommandAsync","(error)");d.nestedError=h,f(d)}}),this.runningCommand=u}_dispatchSubcommand(e,t,i){let s=this._findCommand(e);s||this._helpAndError(),s._executableHandler?this._executeSubCommand(s,t.concat(i)):s._parseCommand(t,i)}_parseCommand(e,t){let i=this.parseOptions(t);if(e=e.concat(i.operands),t=i.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))this._dispatchSubcommand(e[0],e.slice(1),t);else if(this._lazyHasImplicitHelpCommand()&&e[0]===this._helpCommandName)e.length===1?this.help():this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);else if(this._defaultCommandName)ad(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);else if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this._helpAndError(),ad(this,i.unknown),this._checkForMissingMandatoryOptions(),i.unknown.length>0&&this.unknownOption(i.unknown[0]),this._actionHandler){let s=this.args.slice();this._args.forEach((n,o)=>{n.required&&s[o]==null?this.missingArgument(n.name):n.variadic&&(s[o]=s.splice(o))}),this._actionHandler(s),this.emit("command:"+this.name(),e,t)}else e.length?this._findCommand("*")?this._dispatchSubcommand("*",e,t):this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length&&this.unknownCommand():this.commands.length&&this._helpAndError()}_findCommand(e){if(!!e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(t=>{t.mandatory&&e._getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})}parseOptions(e){let t=[],i=[],s=t,n=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;n.length;){let l=n.shift();if(l==="--"){s===i&&s.push(l),s.push(...n);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let u=this._findOption(l);if(u){if(u.required){let c=n.shift();c===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,c)}else if(u.optional){let c=null;n.length>0&&!o(n[0])&&(c=n.shift()),this.emit(`option:${u.name()}`,c)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),n.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),c=this._findOption(l.slice(0,u));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,l.slice(u+1));continue}}l.length>1&&l[0]==="-"&&(s=i),s.push(l)}return{operands:t,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let i=0;i<t;i++){let s=this.options[i].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}missingArgument(e){let t=`error: missing required argument '${e}'`;console.error(t),this._exit(1,"commander.missingArgument",t)}optionMissingArgument(e,t){let i;t?i=`error: option '${e.flags}' argument missing, got '${t}'`:i=`error: option '${e.flags}' argument missing`,console.error(i),this._exit(1,"commander.optionMissingArgument",i)}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;console.error(t),this._exit(1,"commander.missingMandatoryOptionValue",t)}unknownOption(e){if(this._allowUnknownOption)return;let t=`error: unknown option '${e}'`;console.error(t),this._exit(1,"commander.unknownOption",t)}unknownCommand(){let e=[this.name()];for(let s=this.parent;s;s=s.parent)e.unshift(s.name());let t=e.join(" "),i=`error: unknown command '${this.args[0]}'.`+(this._hasHelpOption?` See '${t} ${this._helpLongFlag}'.`:"");console.error(i),this._exit(1,"commander.unknownCommand
|
||
|
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,this._argsDescription=t,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this._args.map(i=>ld(i));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}prepareCommands(){let e=this.commands.filter(t=>!t._hidden).map(t=>{let i=t._args.map(s=>ld(s)).join(" ");return[t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(i?" "+i:""),t._description]});return this._lazyHasImplicitHelpCommand()&&e.push([this._helpCommandnameAndArgs,this._helpCommandDescription]),e}largestCommandLength(){return this.prepareCommands().reduce((t,i)=>Math.max(t,i[0].length),0)}largestOptionLength(){let e=[].slice.call(this.options);return e.push({flags:this._helpFlags}),e.reduce((t,i)=>Math.max(t,i.flags.length),0)}largestArgLength(){return this._args.reduce((e,t)=>Math.max(e,t.name.length),0)}padWidth(){let e=this.largestOptionLength();return this._argsDescription&&this._args.length&&this.largestArgLength()>e&&(e=this.largestArgLength()),this.commands&&this.commands.length&&this.largestCommandLength()>e&&(e=this.largestCommandLength()),e}optionHelp(){let e=this.padWidth(),i=(process.stdout.columns||80)-e-4;function s(l,u){return za(l,e)+" "+od(u,i,e+2)}let n=this.options.map(l=>{let u=l.description+(!l.negate&&l.defaultValue!==void 0?" (default: "+JSON.stringify(l.defaultValue)+")":"");return s(l.flags,u)}),o=this._hasHelpOption&&this._helpShortFlag&&!this._findOption(this._helpShortFlag),a=this._hasHelpOption&&!this._findOption(this._helpLongFlag);if(o||a){let l=this._helpFlags;o?a||(l=this._helpShortFlag):l=this._helpLongFlag,n.push(s(l,this._helpDescription))}return n.join(`
|
||
|
`)}commandHelp(){if(!this.commands.length&&!this._lazyHasImplicitHelpCommand())return"";let e=this.prepareCommands(),t=this.padWidth(),s=(process.stdout.columns||80)-t-4;return["Commands:",e.map(n=>{let o=n[1]?" "+n[1]:"";return(o?za(n[0],t):n[0])+od(o,s,t+2)}).join(`
|
||
|
`).replace(/^/gm," "),""].join(`
|
||
|
`)}helpInformation(){let e=[];if(this._description){e=[this._description,""];let l=this._argsDescription;if(l&&this._args.length){let u=this.padWidth(),f=(process.stdout.columns||80)-u-5;e.push("Arguments:"),this._args.forEach(h=>{e.push(" "+za(h.name,u)+" "+cd(l[h.name]||"",f,u+4))}),e.push("")}}let t=this._name;this._aliases[0]&&(t=t+"|"+this._aliases[0]);let i="";for(let l=this.parent;l;l=l.parent)i=l.name()+" "+i;let s=["Usage: "+i+t+" "+this.usage(),""],n=[],o=this.commandHelp();o&&(n=[o]);let a=[];return(this._hasHelpOption||this.options.length>0)&&(a=["Options:",""+this.optionHelp().replace(/^/gm," "),""]),s.concat(e).concat(a).concat(n).join(`
|
||
|
`)}outputHelp(e){e||(e=i=>i);let t=e(this.helpInformation());if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("outputHelp callback must return a string or a Buffer");process.stdout.write(t),this.emit(this._helpLongFlag)}helpOption(e,t){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;let i=hd(this._helpFlags);return this._helpShortFlag=i.shortFlag,this._helpLongFlag=i.longFlag,this}help(e){this.outputHelp(e),this._exit(process.exitCode||0,"commander.help","(outputHelp)")}_helpAndError(){this.outputHelp(),this._exit(1,"commander.help","(outputHelp)")}};dr=fd.exports=new Br;dr.program=dr;dr.Command=Br;dr.Option=zi;dr.CommanderError=Gr;function Xk(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function za(r,e){let t=Math.max(0,e-r.length);return r+Array(t+1).join(" ")}function cd(r,e,t){let i=new RegExp(".{1,"+(e-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g");return(r.match(i)||[]).map((n,o)=>(n.slice(-1)===`
|
||
|
`&&(n=n.slice(0,n.length-1)),(o>0&&t?Array(t+1).join(" "):"")+n.trimRight())).join(`
|
||
|
`)}function od(r,e,t){return r.match(/[\n]\s+/)||e<40?r:cd(r,e,t)}function ad(r,e){r._hasHelpOption&&e.find(i=>i===r._helpLongFlag||i===r._helpShortFlag)&&(r.outputHelp(),r._exit(0,"commander.helpDisplayed","(outputHelp)"))}function ld(r){let e=r.name+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}function hd(r){let e,t,i=r.split(/[ |,]+/);return i.length>1&&!/^[[<]/.test(i[1])&&(e=i.shift()),t=i.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}function ud(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",s="9229",n;return(n=e.match(/^(--inspect(-brk)?)$/))!==null?t=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=n[1],/^\d+$/.test(n[3])?s=n[3]:i=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=n[1],i=n[3],s=n[4]),t&&s!=="0"?`${t}=${i}:${parseInt(s)+1}`:e})}});var Wa=b((tD,un)=>{var{lstat:Qk,lstatSync:Zk,readdir:pd,readdirSync:md,Dirent:eC}=require("fs"),{sep:gd}=require("path");if(eC)un.exports={readdirSync:md,readdir:pd};else{let r=function(e,t){return{name:e,isFile:()=>t.isFile(),isDirectory:()=>t.isDirectory()}};eD=r,un.exports.readdir=function(e,t,i){pd(e,(s,n)=>{if(s)return process.nextTick(i,s,null);if(!n.length)return process.nextTick(i,null,[]);let o=[];for(let a=0;a<n.length;++a){let l=n[a],u=`${e}${gd}${l}`;Qk(u,(c,f)=>{if(c)return process.nextTick(i,c,null);o[o.length]=r(l,f),o.length===n.length&&process.nextTick(i,null,o)})}})},un.exports.readdirSync=function(e){let t=md(e),i=[];for(let s=0;s<t.length;++s){let n=t[s],o=`${e}${gd}${n}`,a=Zk(o);i[i.length]=r(n,a)}return i}}var eD});var bd=b((rD,yd)=>{var{sep:tC,normalize:rC}=require("path");function iC(r){let e=rC(r);return e.length>1&&e[e.length-1]===tC&&(e=e.substring(0,e.length-1)),e}yd.exports={cleanPath:iC}});var wd=b((iD,pe)=>{var{sep:sC}=require("path");pe.exports.getArray=function(r){return r.paths};pe.exports.getArrayGroup=function(){return[""].slice(0,0)};pe.exports.pushFileFilterAndCount=function(r){return function(e,t,i,s){r.some(n=>n(e))&&s.counts.files++}};pe.exports.pushFileFilter=function(r){return function(e,t){r.some(i=>i(e))&&t.push(e)}};pe.exports.pushFileCount=function(r,e,t,i){i.counts.files++};pe.exports.pushFile=function(r,e){e.push(r)};pe.exports.pushDir=function(r,e){e.push(r)};pe.exports.joinPathWithBasePath=function(r,e){return`${e}${sC}${r}`};pe.exports.joinPath=function(r){return r};pe.exports.walkDirExclude=function(r){return function(e,t,i,s,n,o){r(s,i,n)||pe.exports.walkDir(e,t,i,s,n,o)}};pe.exports.walkDir=function(r,e,t,i,s,n){e.queue++,e.counts.dirs++,r(e,t,s,n)};pe.exports.groupFiles=function(r,e,t){t.counts.files+=e.length,t.paths.push({dir:r,files:e})};pe.exports.empty=function(){};pe.exports.callbackInvokerOnlyCountsSync=function(r){return r.counts};pe.exports.callbackInvokerDefaultSync=function(r){return r.paths};pe.exports.callbackInvokerOnlyCountsAsync=vd("counts");pe.exports.callbackInvokerDefaultAsync=vd("paths");function nC(r,e,t,i){if(r){i||e(r,null);return}e(null,t)}function vd(r){return function(e,t){nC(e,t.callback,t[r],t.options.suppressErrors)}}});var Ya=b((sD,Ad)=>{var{sep:xd,resolve:oC}=require("path"),{cleanPath:aC}=bd(),te=wd(),lC={withFileTypes:!0};function uC(r,e,t,i){e.resolvePaths&&(r=oC(r)),e.normalizePath&&(r=aC(r));let s={paths:[""].slice(0,0),queue:0,counts:{files:0,dirs:0},options:e,callback:t};return _d(e,i),{state:s,callbackInvoker:Va,dir:r}}function cC(r,e,t,i,s,n){Sd(t,e.paths),t===xd&&(t="");let o=Od(e);for(var a=0;a<i.length;++a){let l=i[a];if(l.isFile()){let u=kd(l.name,t);Wi(u,o,t,e)}else if(l.isDirectory()){let u=`${t}${xd}${l.name}`;Ed(r,e,u,l.name,s-1,n)}}Cd(t,o,e)}function _d(r,e){let{filters:t,onlyCountsVar:i,includeBasePath:s,includeDirs:n,groupVar:o,excludeFn:a}=r;hC(t,i),Sd=n?te.pushDir:te.empty,kd=s?te.joinPathWithBasePath:te.joinPath,Ed=a?te.walkDirExclude(a):te.walkDir,Cd=o?te.groupFiles:te.empty,Od=o?te.getArrayGroup:te.getArray,fC(i,e)}Ad.exports={buildFunctions:_d,init:uC,walkSingleDir:cC,readdirOpts:lC};function hC(r,e){r.length&&e?Wi=te.pushFileFilterAndCount(r):r.
|
||
|
|
||
|
`,UO="IHDR",zp="CgBI";In.PNG={validate(r){if(BO===r.toString("ascii",1,8)){let e=r.toString("ascii",12,16);if(e===zp&&(e=r.toString("ascii",28,32)),e!==UO)throw new TypeError("Invalid PNG");return!0}return!1},calculate(r){return r.toString("ascii",12,16)===zp?{height:r.readUInt32BE(36),width:r.readUInt32BE(32)}:{height:r.readUInt32BE(20),width:r.readUInt32BE(16)}}}});var Kp=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.PNM=void 0;var Yp={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},zO=Object.keys(Yp),Vp={default:r=>{let e=[];for(;r.length>0;){let t=r.shift();if(t[0]!=="#"){e=t.split(" ");break}}if(e.length===2)return{height:parseInt(e[1],10),width:parseInt(e[0],10)};throw new TypeError("Invalid PNM")},pam:r=>{let e={};for(;r.length>0;){let t=r.shift();if(t.length>16||t.charCodeAt(0)>128)continue;let[i,s]=t.split(" ");if(i&&s&&(e[i.toLowerCase()]=parseInt(s,10)),e.height&&e.width)break}if(e.height&&e.width)return{height:e.height,width:e.width};throw new TypeError("Invalid PAM")}};Mn.PNM={validate(r){let e=r.toString("ascii",0,2);return zO.includes(e)},calculate(r){let e=r.toString("ascii",0,2),t=Yp[e],i=r.toString("ascii",3).split(/[\r\n]+/);return(Vp[t]||Vp.default)(i)}}});var Jp=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.PSD=void 0;Pn.PSD={validate(r){return r.toString("ascii",0,4)==="8BPS"},calculate(r){return{height:r.readUInt32BE(14),width:r.readUInt32BE(18)}}}});var Zp=b(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.SVG=void 0;var Xp=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/,Ln={height:/\sheight=(['"])([^%]+?)\1/,root:Xp,viewbox:/\sviewBox=(['"])(.+?)\1/i,width:/\swidth=(['"])([^%]+?)\1/},Cl=2.54,Qp={in:96,cm:96/Cl,em:16,ex:8,m:96/Cl*100,mm:96/Cl/10,pc:96/72/12,pt:96/72,px:1},WO=new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(Qp).join("|")})?$`);function qn(r){let e=WO.exec(r);if(!!e)return Math.round(Number(e[1])*(Qp[e[2]]||1))}function VO(r){let e=r.split(" ");return{height:qn(e[3]),width:qn(e[2])}}function YO(r){let e=r.match(Ln.width),t=r.match(Ln.height),i=r.match(Ln.viewbox);return{height:t&&qn(t[2]),viewbox:i&&VO(i[2]),width:e&&qn(e[2])}}function KO(r){return{height:r.height,width:r.width}}function JO(r,e){let t=e.width/e.height;return r.width?{height:Math.floor(r.width/t),width:r.width}:r.height?{height:r.height,width:Math.floor(r.height*t)}:{height:e.height,width:e.width}}Nn.SVG={validate(r){let e=String(r);return Xp.test(e)},calculate(r){let e=r.toString("utf8").match(Ln.root);if(e){let t=YO(e[0]);if(t.width&&t.height)return KO(t);if(t.viewbox)return JO(t,t.viewbox)}throw new TypeError("Invalid SVG")}}});var em=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.TIFF=void 0;var jn=require("fs"),Yr=El();function XO(r,e,t){let i=Yr.readUInt(r,32,4,t),s=1024,n=jn.statSync(e).size;i+s>n&&(s=n-i-10);let o=Buffer.alloc(s),a=jn.openSync(e,"r");return jn.readSync(a,o,0,s,i),jn.closeSync(a),o.slice(2)}function QO(r,e){let t=Yr.readUInt(r,16,8,e);return(Yr.readUInt(r,16,10,e)<<16)+t}function ZO(r){if(r.length>24)return r.slice(12)}function eA(r,e){let t={},i=r;for(;i&&i.length;){let s=Yr.readUInt(i,16,0,e),n=Yr.readUInt(i,16,2,e),o=Yr.readUInt(i,32,4,e);if(s===0)break;o===1&&(n===3||n===4)&&(t[s]=QO(i,e)),i=ZO(i)}return t}function tA(r){let e=r.toString("ascii",0,2);if(e==="II")return"LE";if(e==="MM")return"BE"}var rA=["49492a00","4d4d002a"];Dn.TIFF={validate(r){return rA.includes(r.toString("hex",0,4))},calculate(r,e){if(!e)throw new TypeError("Tiff doesn't support buffer");let t=tA(r)==="BE",i=XO(r,e,t),s=eA(i,t),n=s[256],o=s[257];if(!n||!o)throw new TypeError("Invalid Tiff. Missing tags");return{height:o,width:n}}}});var tm=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.WEBP=void 0;function iA(r){return{height:1+r.readUIntLE(7,3),width:1+r.readUIntLE(4,3)}}function sA(r){return{height:1+((r[4]&15)<<10|r[3]<<2|(r[2]&192)>>6),width:1+((r[2]&63)<<8|r[1])}}function nA(r){return{height:r.readInt16LE(8)&16383,width:r.readInt16LE(6)&16383}}Fn.WEBP={valida
|
||
|
`,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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Hm=b((o5,$m)=>{"use strict";var QA=Un(),{MAX_LENGTH:jm,CHAR_BACKSLASH:Nl,CHAR_BACKTICK:ZA,CHAR_COMMA:eT,CHAR_DOT:tT,CHAR_LEFT_PARENTHESES:rT,CHAR_RIGHT_PARENTHESES:iT,CHAR_LEFT_CURLY_BRACE:sT,CHAR_RIGHT_CURLY_BRACE:nT,CHAR_LEFT_SQUARE_BRACKET:Dm,CHAR_RIGHT_SQUARE_BRACKET:Fm,CHAR_DOUBLE_QUOTE:oT,CHAR_SINGLE_QUOTE:aT,CHAR_NO_BREAK_SPACE:lT,CHAR_ZERO_WIDTH_NOBREAK_SPACE:uT}=Nm(),cT=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},i=typeof t.maxLength=="number"?Math.min(jm,t.maxLength):jm;if(r.length>i)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${i})`);let s={type:"root",input:r,nodes:[]},n=[s],o=s,a=s,l=0,u=r.length,c=0,f=0,h,d={},p=()=>r[c++],g=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(g({type:"bos"});c<u;)if(o=n[n.length-1],h=p(),!(h===uT||h===lT)){if(h===Nl){g({type:"text",value:(e.keepEscaping?h:"")+p()});continue}if(h===Fm){g({type:"text",value:"\\"+h});continue}if(h===Dm){l++;let y=!0,m;for(;c<u&&(m=p());){if(h+=m,m===Dm){l++;continue}if(m===Nl){h+=p();continue}if(m===Fm&&(l--,l===0))break}g({type:"text",value:h});continue}if(h===rT){o=g({type:"paren",nodes:[]}),n.push(o),g({type:"text",value:h});continue}if(h===iT){if(o.type!=="paren"){g({type:"text",value:h});continue}o=n.pop(),g({type:"text",value:h}),o=n[n.length-1];continue}if(h===oT||h===aT||h===ZA){let y=h,m;for(e.keepQuotes!==!0&&(h="");c<u&&(m=p());){if(m===Nl){h+=m+p();continue}if(m===y){e.keepQuotes===!0&&(h+=m);break}h+=m}g({type:"text",value:h});continue}if(h===sT){f++;let y=a.value&&a.value.slice(-1)==="$"||o.dollar===!0;o=g({type:"brace",open:!0,close:!1,dollar:y,depth:f,commas:0,ranges:0,nodes:[]}),n.push(o),g({type:"open",value:h});continue}if(h===nT){if(o.type!=="brace"){g({type:"text",value:h});continue}let y="close";o=n.pop(),o.close=!0,g({type:y,value:h}),f--,o=n[n.length-1];continue}if(h===eT&&f>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:QA(o)}]}g({type:"comma",value:h}),o.commas++;continue}if(h===tT&&f>0&&o.commas===0){let y=o.nodes;if(f===0||y.length===0){g({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let m=y[y.length-1];m.value+=a.value+h,a=m,o.ranges--;continue}g({type:"dot",value:h});continue}g({type:"text",value:h})}do if(o=n.pop(),o.type!=="root"){o.nodes.forEach(v=>{v.nodes||(v.type==="open"&&(v.isOpen=!0),v.type==="close"&&(v.isClose=!0),v.nodes||(v.type="text"),v.invalid=!0)});let y=n[n.length-1],m=y.nodes.indexOf(o);y.nodes.splice(m,1,...o.nodes)}while(n.length>0);return g({type:"eos"}),s};$m.exports=cT});var Um=b((a5,Bm)=>{"use strict";var Gm=Un(),hT=Im(),fT=Lm(),dT=Hm(),$e=(r,e={})=>{let t=[];if(Array.isArray(r))for(let i of r){let s=$e.create(i,e);Array.isArray(s)?t.push(...s):t.push(s)}else t=[].concat($e.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};$e.parse=(r,e={})=>dT(r,e);$e.stringify=(r,e={})=>Gm(typeof r=="string"?$e.parse(r,e):r,e);$e.compile=(r,e={})=>(typeof r=="string"&&(r=$e.parse(r,e)),hT(r,e));$e.expand=(r,e={})=>{typeof r=="string"&&(r=$e.parse(r,e));let t=fT(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};$e.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?$e.compile(r,e):$e.expand(r,e);Bm.exports=$e});var Dl=b((l5,Ym)=>{"use strict";var Wm=require("util"),Vm=Um(),lt=nl(),jl=Yi(),zm=r=>r===""||r==="./",se=(r,e,t)=>{e=[].concat(e),r=[].concat(r);let i=new Set,s=new Set,n=new Set,o=0,a=c=>{n.add(c.outpu
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return n=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function mR(r,e){if(!!r){if(typeof r=="string")return Gg(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Gg(r,e)}}function Gg(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}var gR=io(),Ug=ue(),Bg=Ug.erase,yR=Ug.cursor,bR=r=>[...gR(r)].length;zg.exports=function(r,e){if(!e)return Bg.line+yR.to(0);let t=0,i=r.split(/\r?\n/);var s=pR(i),n;try{for(s.s();!(n=s.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(bR(o)-1,0)/e)}}catch(o){s.e(o)}finally{s.f()}return Bg.lines(t)}});var iu=b((R5,Vg)=>{"use strict";var os={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},vR={arrowUp:os.arrowUp,arrowDown:os.arrowDown,arrowLeft:os.arrowLeft,arrowRight:os.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},wR=process.platform==="win32"?vR:os;Vg.exports=wR});var Kg=b((I5,Yg)=>{"use strict";var ii=ae(),_r=iu(),su=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"😃".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),xR=r=>su[r]||su.default,as=Object.freeze({aborted:ii.red(_r.cross),done:ii.green(_r.tick),exited:ii.yellow(_r.cross),default:ii.cyan("?")}),_R=(r,e,t)=>e?as.aborted:t?as.exited:r?as.done:as.default,SR=r=>ii.gray(r?_r.ellipsis:_r.pointerSmall),ER=(r,e)=>ii.gray(r?e?_r.pointerSmall:"+":_r.line);Yg.exports={styles:su,render:xR,symbols:as,symbol:_R,delimiter:SR,item:ER}});var Xg=b((M5,Jg)=>{"use strict";var kR=io();Jg.exports=function(r,e){let t=String(kR(r)||"").split(/\r?\n/);return e?t.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):t.length}});var Zg=b((P5,Qg)=>{"use strict";Qg.exports=(r,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(r||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
|
||
|
`)).join(`
|
||
|
`)}});var ty=b((L5,ey)=>{"use strict";ey.exports=(r,e,t)=>{t=t||e;let i=Math.min(e-t,r-Math.floor(t/2));i<0&&(i=0);let s=Math.min(i+t,e);return{startIndex:i,endIndex:s}}});var Qe=b((q5,ry)=>{"use strict";ry.exports={action:Fg(),clear:Wg(),style:Kg(),strip:io(),figures:iu(),lines:Xg(),wrap:Zg(),entriesToDisplay:ty()}});var kt=b((N5,ny)=>{"use strict";var iy=require("readline"),CR=Qe(),OR=CR.action,AR=require("events"),sy=ue(),TR=sy.beep,RR=sy.cursor,IR=ae(),nu=class extends AR{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=iy.createInterface({input:this.in,escapeCodeTimeout:50});iy.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=OR(o,i);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(RR.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(TR)}render(){this.onRender(IR),this.firstRender&&(this.firstRender=!1)}};ny.exports=nu});var cy=b((j5,uy)=>{"use strict";function oy(r,e,t,i,s,n,o){try{var a=r[n](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(i,s)}function ay(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(l){oy(n,i,s,o,a,"next",l)}function a(l){oy(n,i,s,o,a,"throw",l)}o(void 0)})}}var so=ae(),MR=kt(),ly=ue(),PR=ly.erase,ls=ly.cursor,no=Qe(),ou=no.style,au=no.clear,LR=no.lines,qR=no.figures,lu=class extends MR{constructor(e={}){super(e),this.transform=ou.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=au("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=so.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}validate(){var e=this;return ay(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ay(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
||
|
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ls.down(LR(this.outputError,this.out.columns)-1)+au(this.outputError,this.out.columns)),this.out.write(au(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ou.symbol(this.done,this.aborted),so.bold(this.msg),ou.delimiter(this.done),this.red?so.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
||
|
`).reduce((e,t,i)=>e+`
|
||
|
${i?" ":qR.pointerSmall} ${so.red().italic(t)}`,"")),this.out.write(PR.line+ls.to(0)+this.outputText+ls.save+this.outputError+ls.restore+ls.move(this.cursorOffset,0)))}};uy.exports=lu});var py=b((D5,dy)=>{"use strict";var Ct=ae(),NR=kt(),us=Qe(),hy=us.style,fy=us.clear,oo=us.figures,jR=us.wrap,DR=us.entriesToDisplay,FR=ue(),$R=FR.cursor,uu=class extends NR{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?i:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=fy("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write($R.hide):this.out.write(fy(this.outputText,this.out.columns)),super.render();let e=DR(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,i=e.endIndex;if(this.outputText=[hy.symbol(this.done,this.aborted),Ct.bold(this.msg),hy.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Ct.yellow(this.warn):Ct.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
||
|
`;for(let s=t;s<i;s++){let n,o,a="",l=this.choices[s];s===t&&t>0?o=oo.arrowUp:s===i-1&&i<this.choices.length?o=oo.arrowDown:o=" ",l.disabled?(n=this.cursor===s?Ct.gray().underline(l.title):Ct.strikethrough().gray(l.title),o=(this.cursor===s?Ct.bold().gray(oo.pointer)+" ":" ")+o):(n=this.cursor===s?Ct.cyan().underline(l.title):l.title,o=(this.cursor===s?Ct.cyan(oo.pointer)+" ":" ")+o,l.description&&this.cursor===s&&(a=` - ${l.description}`,(o.length+n.length+a.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(a=`
|
||
|
`+jR(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${Ct.gray(a)}
|
||
|
`}}this.out.write(this.outputText)}};dy.exports=uu});var wy=b((F5,vy)=>{"use strict";var ao=ae(),HR=kt(),yy=Qe(),my=yy.style,GR=yy.clear,by=ue(),gy=by.cursor,BR=by.erase,cu=class extends HR{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(gy.hide):this.out.write(GR(this.outputText,this.out.columns)),super.render(),this.outputText=[my.symbol(this.done,this.aborted),ao.bold(this.msg),my.delimiter(this.done),this.value?this.inactive:ao.cyan().underline(this.inactive),ao.gray("/"),this.value?ao.cyan().underline(this.active):this.active].join(" "),this.out.write(BR.line+gy.to(0)+this.outputText))}};vy.exports=cu});var ht=b(($5,xy)=>{"use strict";var si=class{constructor({token:e,date:t,parts:i,locales:s}){this.token=e,this.date=t||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,i)=>i>e&&t instanceof si)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((i,s)=>s>t&&i instanceof si)}toString(){return String(this.date)}};xy.exports=si});var Sy=b((H5,_y)=>{"use strict";var UR=ht(),hu=class extends UR{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};_y.exports=hu});var ky=b((G5,Ey)=>{"use strict";var zR=ht(),WR=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),fu=class extends zR{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+WR(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Ey.exports=fu});var Oy=b((B5,Cy)=>{"use strict";var VR=ht(),du=class extends VR{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Cy.exports=du});var Ty=b((U5,Ay)=>{"use strict";var YR=ht(),pu=class extends YR{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ay.exports=pu});var Iy=b((z5,Ry)=>{"use strict";var KR=ht(),mu=class extends KR{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ry.exports=mu});var Py=b((W5,My)=>{"use strict";var JR=ht(),gu=class extends JR{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};My.exports=gu});var qy=b((V5,Ly)=>{"use strict";var XR=ht(),yu=class extends XR{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();r
|
||
|
`),this.close()}validate(){var e=this;return Hy(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Hy(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
||
|
`),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof zy)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Uy.hide):this.out.write(By(this.outputText,this.out.columns)),super.render(),this.outputText=[Gy.symbol(this.done,this.aborted),vu.bold(this.msg),Gy.delimiter(!1),this.parts.reduce((e,t,i)=>e.concat(i===this.cursor&&!this.done?vu.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
||
|
`).reduce((e,t,i)=>e+`
|
||
|
${i?" ":e2.pointerSmall} ${vu.red().italic(t)}`,"")),this.out.write(t2.line+Uy.to(0)+this.outputText))}};Yy.exports=wu});var rb=b((X5,tb)=>{"use strict";function Jy(r,e,t,i,s,n,o){try{var a=r[n](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(i,s)}function Xy(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(l){Jy(n,i,s,o,a,"next",l)}function a(l){Jy(n,i,s,o,a,"throw",l)}o(void 0)})}}var lo=ae(),f2=kt(),eb=ue(),uo=eb.cursor,d2=eb.erase,co=Qe(),_u=co.style,p2=co.figures,Qy=co.clear,m2=co.lines,g2=/[0-9]/,Su=r=>r!==void 0,Zy=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Eu=class extends f2{constructor(e={}){super(e),this.transform=_u.render(e.style),this.msg=e.message,this.initial=Su(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Su(e.min)?e.min:-1/0,this.max=Su(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=lo.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Zy(e,this.round)}`),this._value=Zy(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||g2.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}validate(){var e=this;return Xy(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Xy(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
|
||
|
`),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(uo.down(m2(this.outputError,this.out.columns)-1)+Qy(this.outputError,this.out.columns)),this.out.write(Qy(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[_u.symbol(this.done,this.aborted),lo.bold(this.msg),_u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?lo[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
||
|
`).reduce((e,t,i)=>e+`
|
||
|
${i?" ":p2.pointerSmall} ${lo.red().italic(t)}`,"")),this.out.write(d2.line+uo.to(0)+this.outputText+uo.save+this.outputError+uo.restore))}};tb.exports=Eu});var Cu=b((Q5,nb)=>{"use strict";var ft=ae(),y2=ue(),b2=y2.cursor,v2=kt(),cs=Qe(),ib=cs.clear,Yt=cs.figures,sb=cs.style,w2=cs.wrap,x2=cs.entriesToDisplay,ku=class extends v2{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?i:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=ib("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
||
|
Instructions:
|
||
|
${Yt.arrowUp}/${Yt.arrowDown}: Highlight option
|
||
|
${Yt.arrowLeft}/${Yt.arrowRight}/[space]: Toggle selection
|
||
|
`+(this.maxChoices===void 0?` a: Toggle all
|
||
|
`:"")+" enter/return: Complete answer":""}renderOption(e,t,i,s){let n=(t.selected?ft.green(Yt.radioOn):Yt.radioOff)+" "+s+" ",o,a;return t.disabled?o=e===i?ft.gray().underline(t.title):ft.strikethrough().gray(t.title):(o=e===i?ft.cyan().underline(t.title):t.title,e===i&&t.description&&(a=` - ${t.description}`,(n.length+o.length+a.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(a=`
|
||
|
`+w2(t.description,{margin:n.length,width:this.out.columns})))),n+o+ft.gray(a||"")}paginateOptions(e){if(e.length===0)return ft.red("No matches for this query.");let t=x2(this.cursor,e.length,this.optionsPerPage),i=t.startIndex,s=t.endIndex,n,o=[];for(let a=i;a<s;a++)a===i&&i>0?n=Yt.arrowUp:a===s-1&&s<e.length?n=Yt.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return`
|
||
|
`+o.join(`
|
||
|
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[ft.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(ft.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(b2.hide),super.render();let e=[sb.symbol(this.done,this.aborted),ft.bold(this.msg),sb.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ft.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ib(e,this.out.columns)}};nb.exports=ku});var fb=b((Z5,hb)=>{"use strict";function ob(r,e,t,i,s,n,o){try{var a=r[n](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(i,s)}function _2(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(l){ob(n,i,s,o,a,"next",l)}function a(l){ob(n,i,s,o,a,"throw",l)}o(void 0)})}}var hs=ae(),S2=kt(),cb=ue(),E2=cb.erase,ab=cb.cursor,fs=Qe(),Ou=fs.style,lb=fs.clear,Au=fs.figures,k2=fs.wrap,C2=fs.entriesToDisplay,ub=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),O2=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),A2=(r,e)=>{let t=r.findIndex(i=>i.value===e||i.title===e);return t>-1?t:void 0},Tu=class extends S2{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:A2(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Ou.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=lb("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ub(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return _2(function*(){let i=t.completing=t.suggest(t.input,t.choices),s=yield i;if(t.completing!==i)return;t.suggestions=s.map((o,a,l)=>({title:O2(l,a),value:ub(l,a),description:o.description})),t.completing=!1;let n=Math.max(s.length-1,0);t.moveSelect(Math.min(n,t.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}_(e,t){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,i,s){let n,o=i?Au.arrowUp:s?Au.arrowDown:" ",a=t?hs.cyan().underline(e.title):e.title;return o=(t?hs.cyan(Au.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
|
||
|
`+k2(e.description,{margin:3,width:this.out.columns}))),o+" "+a+hs.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ab.hide):this.out.write(lb(this.outputText,this.out.columns)),super.render();let e=C2(this.select,this.choices.length,this.limit),t=e.startIndex,i=e.endIndex;if(this.outputText=[Ou.symbol(this.done,this.aborted,this.exited),hs.bold(this.msg),Ou.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(t,i).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===i-1&&i<this.choices.length)).join(`
|
||
|
`);this.outputText+=`
|
||
|
`+(s||hs.gray(this.fallback.title))}this.out.write(E2.line+ab.to(0)+this.outputText)}};hb.exports=Tu});var gb=b((eF,mb)=>{"use strict";var At=ae(),T2=ue(),R2=T2.cursor,I2=Cu(),Iu=Qe(),db=Iu.clear,pb=Iu.style,ni=Iu.figures,Ru=class extends I2{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=db("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(i=>i===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
||
|
Instructions:
|
||
|
${ni.arrowUp}/${ni.arrowDown}: Highlight option
|
||
|
${ni.arrowLeft}/${ni.arrowRight}/[space]: Toggle selection
|
||
|
[a,b,c]/delete: Filter choices
|
||
|
enter/return: Complete answer
|
||
|
`:""}renderCurrentInput(){return`
|
||
|
Filtered results for: ${this.inputValue?this.inputValue:At.gray("Enter something to filter")}
|
||
|
`}renderOption(e,t,i){let s;return t.disabled?s=e===i?At.gray().underline(t.title):At.strikethrough().gray(t.title):s=e===i?At.cyan().underline(t.title):t.title,(t.selected?At.green(ni.radioOn):ni.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[At.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(At.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(R2.hide),super.render();let e=[pb.symbol(this.done,this.aborted),At.bold(this.msg),pb.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=At.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=db(e,this.out.columns)}};mb.exports=Ru});var Sb=b((tF,_b)=>{"use strict";var yb=ae(),M2=kt(),wb=Qe(),bb=wb.style,P2=wb.clear,xb=ue(),L2=xb.erase,vb=xb.cursor,Mu=class extends M2{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(vb.hide):this.out.write(P2(this.outputText,this.out.columns)),super.render(),this.outputText=[bb.symbol(this.done,this.aborted),yb.bold(this.msg),bb.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:yb.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(L2.line+vb.to(0)+this.outputText))}};_b.exports=Mu});var kb=b((rF,Eb)=>{"use strict";Eb.exports={TextPrompt:cy(),SelectPrompt:py(),TogglePrompt:wy(),DatePrompt:Ky(),NumberPrompt:rb(),MultiselectPrompt:Cu(),AutocompletePrompt:fb(),AutocompleteMultiselectPrompt:gb(),ConfirmPrompt:Sb()}});var Ob=b(Cb=>{"use strict";var Pe=Cb,q2=kb(),ho=r=>r;function dt(r,e,t={}){return new Promise((i,s)=>{let n=new q2[r](e),o=t.onAbort||ho,a=t.onSubmit||ho,l=t.onExit||ho;n.on("state",e.onState||ho),n.on("submit",u=>i(a(u))),n.on("exit",u=>i(l(u))),n.on("abort",u=>s(o(u)))})}Pe.text=r=>dt("TextPrompt",r);Pe.password=r=>(r.style="password",Pe.text(r));Pe.invisible=r=>(r.style="invisible",Pe.text(r));Pe.number=r=>dt("NumberPrompt",r);Pe.date=r=>dt("DatePrompt",r);Pe.confirm=r=>dt("ConfirmPrompt",r);Pe.list=r=>{let e=r.separator||",";return dt("TextPrompt",r,{onSubmit:t=>t.split(e).map(i=>i.trim())})};Pe.toggle=r=>dt("TogglePrompt",r);Pe.select=r=>dt("SelectPrompt",r);Pe.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return dt("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};Pe.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return dt("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var N2=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Pe.autocomplete=r=>(r.suggest=r.suggest||N2,r.choices=[].concat(r.choices||[]),dt("AutocompletePrompt",r))});var qb=b((sF,Lb)=>{"use strict";function Ab(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function Tb(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ab(Object(t),!0).forEach(function(i){j2(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ab(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function j2(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function D2(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=F2(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var i=0,s=function(){};return{s,n:function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return n=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function F2(r,e){if(!!r){if(typeof r=="string")return Rb(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rb(r,e)}}function Rb(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}function Ib(r,e,t,i,s,n,o){try{var a=r[n](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(i,s)}function Mb(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function o(l){Ib(n,i,s,o,a,"next",l)}function a(l){Ib(n,i,s,o,a,"throw",l)}o(void 0)})}}var Pu=Ob(),$2=["suggest","format","onState","validate","onRender","type"],Pb=()=>{};function Kt(){return Lu.apply(this,arguments)}function Lu(){return Lu=Mb(function*(r=[],{onSubmit:e=Pb,onCancel:t=Pb}={}){let i={},s=Kt._override||{};r=[].concat(r);let n,o,a,l,u,c,f=function(){var y=Mb(function*(m,v,S=!1){if(!(!S&&m.validate&&m.validate(v)!==!0))return m.format?yield m.format(v,i):v});return function(v,S){return y.apply(this,arguments)}}();var h=D2(r),d;try{for(h.s();!(d=h.n()).done;){o=d.value;var p=o;if(l=p.name,u=p.type,typeof u=="function"&&(u=yield u(n,Tb({},i),o),o.type=u),!!u){for(let y in o){if($2.includes(y))continue;let m=o[y];o[y]=typeof m=="function"?yield m(n,Tb({},i),c):m}if(c=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(l=g.name,u=g.type,Pu[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(s[o.name]!==void 0&&(n=yield f(o,s[o.name]),n!==void 0)){i[l]=n;continue}try{n=Kt._injected?H2(Kt._injected,o.initial):yield Pu[u](o),i[l]=n=yield f(o,n,!0),a=yield e(o,n,i)}catch{a=!(yield t(o,i))}if(a)return i}}}catch(y){h.e(y)}finally{h.f()}return i}),Lu.apply(this,arguments)}function H2(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function G2(r){Kt._injected=(Kt._injected||[]).concat(r)}function B2(r){Kt._override=Object.assign({},r)}Lb.exports=Object.assign(Kt,{prompt:Kt,prompts:Pu,inject:G2,override:B2})});var jb=b((nF,Nb)=>{"use strict";Nb.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var fo=b((oF,Db)=>{"use strict";Db.exports=r=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof r=="string"?r.replace(t,""):r}});var Hb=b((aF,$b)=>{"use strict";var U2=fo(),{erase:Fb,cursor:z2}=ue(),W2=r=>[...U2(r)].length;$b.exports=function(r,e){if(!e)return Fb.line+z2.to(0);let t=0,i=r.split(/\r?\n/);for(let s of i)t+=1+Math.floor(Math.max(W2(s)-1,0)/e);return Fb.lines(t)}});var qu=b((lF,Gb)=>{"use strict";var ds={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},V2={arrowUp:ds.arrowUp,arrowDown:ds.arrowDown,arrowLeft:ds.arrowLeft,arrowRight:ds.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},Y2=process.pla
|
||
|
`)).join(`
|
||
|
`)}});var Jb=b((fF,Kb)=>{"use strict";Kb.exports=(r,e,t)=>{t=t||e;let i=Math.min(e-t,r-Math.floor(t/2));i<0&&(i=0);let s=Math.min(i+t,e);return{startIndex:i,endIndex:s}}});var Ze=b((dF,Xb)=>{"use strict";Xb.exports={action:jb(),clear:Hb(),style:Ub(),strip:fo(),figures:qu(),lines:Wb(),wrap:Yb(),entriesToDisplay:Jb()}});var Tt=b((pF,Zb)=>{"use strict";var Qb=require("readline"),{action:eI}=Ze(),tI=require("events"),{beep:rI,cursor:iI}=ue(),sI=ae(),ju=class extends tI{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=Qb.createInterface({input:this.in,escapeCodeTimeout:50});Qb.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=eI(o,i);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(iI.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(rI)}render(){this.onRender(sI),this.firstRender&&(this.firstRender=!1)}};Zb.exports=ju});var tv=b((mF,ev)=>{var po=ae(),nI=Tt(),{erase:oI,cursor:ms}=ue(),{style:Du,clear:Fu,lines:aI,figures:lI}=Ze(),$u=class extends nI{constructor(e={}){super(e),this.transform=Du.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=Fu("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=po.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ms.down(aI(this.outputError,this.out.columns)-1)+Fu(this.outputError,this.out.columns)),this.out.write(Fu(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Du.symbol(this.done,this.aborted),po.bold(this.msg),Du.delimiter(this.done),this.red?po.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
||
|
`).reduce((e,t,i)=>e+`
|
||
|
${i?" ":lI.pointerSmall} ${po.red().italic(t)}`,"")),this.out.write(oI.line+ms.to(0)+this.outputText+ms.save+this.outputError+ms.restore+ms.move(this.cursorOffset,0)))}};ev.exports=$u});var nv=b((gF,sv)=>{"use strict";var Rt=ae(),uI=Tt(),{style:rv,clear:iv,figures:mo,wrap:cI,entriesToDisplay:hI}=Ze(),{cursor:fI}=ue(),Hu=class extends uI{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?i:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=iv("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(fI.hide):this.out.write(iv(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=hI(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[rv.symbol(this.done,this.aborted),Rt.bold(this.msg),rv.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rt.yellow(this.warn):Rt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
||
|
`;for(let i=e;i<t;i++){let s,n,o="",a=this.choices[i];i===e&&e>0?n=mo.arrowUp:i===t-1&&t<this.choices.length?n=mo.arrowDown:n=" ",a.disabled?(s=this.cursor===i?Rt.gray().underline(a.title):Rt.strikethrough().gray(a.title),n=(this.cursor===i?Rt.bold().gray(mo.pointer)+" ":" ")+n):(s=this.cursor===i?Rt.cyan().underline(a.title):a.title,n=(this.cursor===i?Rt.cyan(mo.pointer)+" ":" ")+n,a.description&&this.cursor===i&&(o=` - ${a.description}`,(n.length+s.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
|
||
|
`+cI(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${Rt.gray(o)}
|
||
|
`}}this.out.write(this.outputText)}};sv.exports=Hu});var uv=b((yF,lv)=>{var go=ae(),dI=Tt(),{style:ov,clear:pI}=Ze(),{cursor:av,erase:mI}=ue(),Gu=class extends dI{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(av.hide):this.out.write(pI(this.outputText,this.out.columns)),super.render(),this.outputText=[ov.symbol(this.done,this.aborted),go.bold(this.msg),ov.delimiter(this.done),this.value?this.inactive:go.cyan().underline(this.inactive),go.gray("/"),this.value?go.cyan().underline(this.active):this.active].join(" "),this.out.write(mI.line+av.to(0)+this.outputText))}};lv.exports=Gu});var pt=b((bF,cv)=>{"use strict";var ai=class{constructor({token:e,date:t,parts:i,locales:s}){this.token=e,this.date=t||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,i)=>i>e&&t instanceof ai)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((i,s)=>s>t&&i instanceof ai)}toString(){return String(this.date)}};cv.exports=ai});var fv=b((vF,hv)=>{"use strict";var gI=pt(),Bu=class extends gI{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};hv.exports=Bu});var pv=b((wF,dv)=>{"use strict";var yI=pt(),bI=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Uu=class extends yI{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+bI(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};dv.exports=Uu});var gv=b((xF,mv)=>{"use strict";var vI=pt(),zu=class extends vI{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};mv.exports=zu});var bv=b((_F,yv)=>{"use strict";var wI=pt(),Wu=class extends wI{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};yv.exports=Wu});var wv=b((SF,vv)=>{"use strict";var xI=pt(),Vu=class extends xI{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};vv.exports=Vu});var _v=b((EF,xv)=>{"use strict";var _I=pt(),Yu=class extends _I{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};xv.exports=Yu});var Ev=b((kF,Sv)=>{"use strict";var SI=pt(),Ku=class extends SI{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();r
|
||
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof Mv)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Iv.hide):this.out.write(Rv(this.outputText,this.out.columns)),super.render(),this.outputText=[Tv.symbol(this.done,this.aborted),Xu.bold(this.msg),Tv.delimiter(!1),this.parts.reduce((e,t,i)=>e.concat(i===this.cursor&&!this.done?Xu.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
||
|
`).reduce((e,t,i)=>e+`
|
||
|
${i?" ":CI.pointerSmall} ${Xu.red().italic(t)}`,"")),this.out.write(OI.line+Iv.to(0)+this.outputText))}};Lv.exports=Qu});var Fv=b((TF,Dv)=>{var yo=ae(),DI=Tt(),{cursor:bo,erase:FI}=ue(),{style:Zu,figures:$I,clear:Nv,lines:HI}=Ze(),GI=/[0-9]/,ec=r=>r!==void 0,jv=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},tc=class extends DI{constructor(e={}){super(e),this.transform=Zu.render(e.style),this.msg=e.message,this.initial=ec(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ec(e.min)?e.min:-1/0,this.max=ec(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=yo.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${jv(e,this.round)}`),this._value=jv(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||GI.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(bo.down(HI(this.outputError,this.out.columns)-1)+Nv(this.outputError,this.out.columns)),this.out.write(Nv(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Zu.symbol(this.done,this.aborted),yo.bold(this.msg),Zu.delimiter(this.done),!this.done||!this.done&&!this.placeholder?yo[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
||
|
`).reduce((e,t,i)=>e+`
|
||
|
${i?" ":$I.pointerSmall} ${yo.red().italic(t)}`,"")),this.out.write(FI.line+bo.to(0)+this.outputText+bo.save+this.outputError+bo.restore))}};Dv.exports=tc});var ic=b((RF,Gv)=>{"use strict";var mt=ae(),{cursor:BI}=ue(),UI=Tt(),{clear:$v,figures:Jt,style:Hv,wrap:zI,entriesToDisplay:WI}=Ze(),rc=class extends UI{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,i)=>(typeof t=="string"&&(t={title:t,value:i}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?i:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=$v("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
||
|
Instructions:
|
||
|
${Jt.arrowUp}/${Jt.arrowDown}: Highlight option
|
||
|
${Jt.arrowLeft}/${Jt.arrowRight}/[space]: Toggle selection
|
||
|
`+(this.maxChoices===void 0?` a: Toggle all
|
||
|
`:"")+" enter/return: Complete answer":""}renderOption(e,t,i,s){let n=(t.selected?mt.green(Jt.radioOn):Jt.radioOff)+" "+s+" ",o,a;return t.disabled?o=e===i?mt.gray().underline(t.title):mt.strikethrough().gray(t.title):(o=e===i?mt.cyan().underline(t.title):t.title,e===i&&t.description&&(a=` - ${t.description}`,(n.length+o.length+a.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(a=`
|
||
|
`+zI(t.description,{margin:n.length,width:this.out.columns})))),n+o+mt.gray(a||"")}paginateOptions(e){if(e.length===0)return mt.red("No matches for this query.");let{startIndex:t,endIndex:i}=WI(this.cursor,e.length,this.optionsPerPage),s,n=[];for(let o=t;o<i;o++)o===t&&t>0?s=Jt.arrowUp:o===i-1&&i<e.length?s=Jt.arrowDown:s=" ",n.push(this.renderOption(this.cursor,e[o],o,s));return`
|
||
|
`+n.join(`
|
||
|
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[mt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(mt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(BI.hide),super.render();let e=[Hv.symbol(this.done,this.aborted),mt.bold(this.msg),Hv.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=mt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=$v(e,this.out.columns)}};Gv.exports=rc});var Vv=b((IF,Wv)=>{"use strict";var gs=ae(),VI=Tt(),{erase:YI,cursor:Bv}=ue(),{style:sc,clear:Uv,figures:nc,wrap:KI,entriesToDisplay:JI}=Ze(),zv=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),XI=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),QI=(r,e)=>{let t=r.findIndex(i=>i.value===e||i.title===e);return t>-1?t:void 0},oc=class extends VI{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:QI(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=sc.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Uv("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=zv(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),i=await t;if(this.completing!==t)return;this.suggestions=i.map((n,o,a)=>({title:XI(a,o),value:zv(a,o),description:n.description})),this.completing=!1;let s=Math.max(i.length-1,0);this.moveSelect(Math.min(s,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}_(e,t){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,i,s){let n,o=i?nc.arrowUp:s?nc.arrowDown:" ",a=t?gs.cyan().underline(e.title):e.title;return o=(t?gs.cyan(nc.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
|
||
|
`+KI(e.description,{margin:3,width:this.out.columns}))),o+" "+a+gs.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Bv.hide):this.out.write(Uv(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=JI(this.select,this.choices.length,this.limit);if(this.outputText=[sc.symbol(this.done,this.aborted,this.exited),gs.bold(this.msg),sc.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,t).map((s,n)=>this.renderOption(s,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
|
||
|
`);this.outputText+=`
|
||
|
`+(i||gs.gray(this.fallback.title))}this.out.write(YI.line+Bv.to(0)+this.outputText)}};Wv.exports=oc});var Xv=b((MF,Jv)=>{"use strict";var It=ae(),{cursor:ZI}=ue(),eM=ic(),{clear:Yv,style:Kv,figures:li}=Ze(),ac=class extends eM{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Yv("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(i=>i===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
||
|
Instructions:
|
||
|
${li.arrowUp}/${li.arrowDown}: Highlight option
|
||
|
${li.arrowLeft}/${li.arrowRight}/[space]: Toggle selection
|
||
|
[a,b,c]/delete: Filter choices
|
||
|
enter/return: Complete answer
|
||
|
`:""}renderCurrentInput(){return`
|
||
|
Filtered results for: ${this.inputValue?this.inputValue:It.gray("Enter something to filter")}
|
||
|
`}renderOption(e,t,i){let s;return t.disabled?s=e===i?It.gray().underline(t.title):It.strikethrough().gray(t.title):s=e===i?It.cyan().underline(t.title):t.title,(t.selected?It.green(li.radioOn):li.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[It.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(It.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ZI.hide),super.render();let e=[Kv.symbol(this.done,this.aborted),It.bold(this.msg),Kv.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=It.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Yv(e,this.out.columns)}};Jv.exports=ac});var rw=b((PF,tw)=>{var Qv=ae(),tM=Tt(),{style:Zv,clear:rM}=Ze(),{erase:iM,cursor:ew}=ue(),lc=class extends tM{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
||
|
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(ew.hide):this.out.write(rM(this.outputText,this.out.columns)),super.render(),this.outputText=[Zv.symbol(this.done,this.aborted),Qv.bold(this.msg),Zv.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Qv.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(iM.line+ew.to(0)+this.outputText))}};tw.exports=lc});var sw=b((LF,iw)=>{"use strict";iw.exports={TextPrompt:tv(),SelectPrompt:nv(),TogglePrompt:uv(),DatePrompt:qv(),NumberPrompt:Fv(),MultiselectPrompt:ic(),AutocompletePrompt:Vv(),AutocompleteMultiselectPrompt:Xv(),ConfirmPrompt:rw()}});var ow=b(nw=>{"use strict";var Le=nw,sM=sw(),vo=r=>r;function gt(r,e,t={}){return new Promise((i,s)=>{let n=new sM[r](e),o=t.onAbort||vo,a=t.onSubmit||vo,l=t.onExit||vo;n.on("state",e.onState||vo),n.on("submit",u=>i(a(u))),n.on("exit",u=>i(l(u))),n.on("abort",u=>s(o(u)))})}Le.text=r=>gt("TextPrompt",r);Le.password=r=>(r.style="password",Le.text(r));Le.invisible=r=>(r.style="invisible",Le.text(r));Le.number=r=>gt("NumberPrompt",r);Le.date=r=>gt("DatePrompt",r);Le.confirm=r=>gt("ConfirmPrompt",r);Le.list=r=>{let e=r.separator||",";return gt("TextPrompt",r,{onSubmit:t=>t.split(e).map(i=>i.trim())})};Le.toggle=r=>gt("TogglePrompt",r);Le.select=r=>gt("SelectPrompt",r);Le.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return gt("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};Le.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(i=>i.selected).map(i=>i.value);return gt("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var nM=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Le.autocomplete=r=>(r.suggest=r.suggest||nM,r.choices=[].concat(r.choices||[]),gt("AutocompletePrompt",r))});var uw=b((NF,lw)=>{"use strict";var uc=ow(),oM=["suggest","format","onState","validate","onRender","type"],aw=()=>{};async function Xt(r=[],{onSubmit:e=aw,onCancel:t=aw}={}){let i={},s=Xt._override||{};r=[].concat(r);let n,o,a,l,u,c,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,i):d};for(o of r)if({name:l,type:u}=o,typeof u=="function"&&(u=await u(n,{...i},o),o.type=u),!!u){for(let h in o){if(oM.includes(h))continue;let d=o[h];o[h]=typeof d=="function"?await d(n,{...i},c):d}if(c=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:l,type:u}=o,uc[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(s[o.name]!==void 0&&(n=await f(o,s[o.name]),n!==void 0)){i[l]=n;continue}try{n=Xt._injected?aM(Xt._injected,o.initial):await uc[u](o),i[l]=n=await f(o,n,!0),a=await e(o,n,i)}catch{a=!await t(o,i)}if(a)return i}return i}function aM(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function lM(r){Xt._injected=(Xt._injected||[]).concat(r)}function uM(r){Xt._override=Object.assign({},r)}lw.exports=Object.assign(Xt,{prompt:Xt,prompts:uc,inject:lM,override:uM})});var cc=b((jF,cw)=>{function cM(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<r.length;e++){if(t[e]>r[e])return!1;if(r[e]>t[e])return!0}return!1}cw.exports=cM("8.6.0")?qb():uw()});var fw=b((DF,hw)=>{var hc=class{constructor(e){this.value=e,this.next=void 0}},fc=class{constructor(){this.clear()}enqueue(e){let t=new hc(e);this._head?(this._tail.next=t,this._tail=t):(this._head=t,this._tail=t),this._size++}dequeue(){let e=this._head;if(!!e)return this._head=this._head.next,this._size--,e.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e.value,e=e.next}};hw.exports=fc});var pw=b((FF,dw)=>{"use strict";var hM=fw(),fM=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up
|
||
|
`:`
|
||
|
`.charCodeAt(),t=typeof r=="string"?"\r":"\r".charCodeAt();return r[r.length-1]===e&&(r=r.slice(0,r.length-1)),r[r.length-1]===t&&(r=r.slice(0,r.length-1)),r}});var b0=b((n6,bs)=>{"use strict";var ys=require("path"),g0=bc(),y0=r=>{r={cwd:process.cwd(),path:process.env[g0()],execPath:process.execPath,...r};let e,t=ys.resolve(r.cwd),i=[];for(;e!==t;)i.push(ys.join(t,"node_modules/.bin")),e=t,t=ys.resolve(t,"..");let s=ys.resolve(r.cwd,r.execPath,"..");return i.push(s),i.concat(r.path).join(ys.delimiter)};bs.exports=y0;bs.exports.default=y0;bs.exports.env=r=>{r={env:process.env,...r};let e={...r.env},t=g0({env:e});return r.path=e[t],e[t]=bs.exports(r),e}});var w0=b((o6,Oc)=>{"use strict";var v0=(r,e)=>{for(let t of Reflect.ownKeys(e))Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t));return r};Oc.exports=v0;Oc.exports.default=v0});var _0=b((a6,ko)=>{"use strict";var VM=w0(),Eo=new WeakMap,x0=(r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,i=0,s=r.displayName||r.name||"<anonymous>",n=function(...o){if(Eo.set(n,++i),i===1)t=r.apply(this,o),r=null;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return t};return VM(n,r),Eo.set(n,i),n};ko.exports=x0;ko.exports.default=x0;ko.exports.callCount=r=>{if(!Eo.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return Eo.get(r)}});var S0=b(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.SIGNALS=void 0;var YM=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:
|
||
|
${i.message}`:g,v=[m,e,r].filter(Boolean).join(`
|
||
|
`);return y?(i.originalMessage=i.message,i.message=v):i=new Error(v),i.shortMessage=m,i.command=o,i.escapedCommand=a,i.exitCode=n,i.signal=s,i.signalDescription=h,i.stdout=r,i.stderr=e,t!==void 0&&(i.all=t),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=Boolean(l),i.isCanceled=u,i.killed=c&&!l,i};T0.exports=dP});var M0=b((d6,Tc)=>{"use strict";var Ao=["stdin","stdout","stderr"],pP=r=>Ao.some(e=>r[e]!==void 0),I0=r=>{if(!r)return;let{stdio:e}=r;if(e===void 0)return Ao.map(i=>r[i]);if(pP(r))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ao.map(i=>`\`${i}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let t=Math.max(e.length,Ao.length);return Array.from({length:t},(i,s)=>e[s])};Tc.exports=I0;Tc.exports.node=r=>{let e=I0(r);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var P0=b((p6,To)=>{To.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&To.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&To.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var D0=b((m6,gi)=>{var W=global.process;typeof W!="object"||!W?gi.exports=function(){}:(L0=require("assert"),pi=P0(),q0=/^win/i.test(W.platform),vs=require("events"),typeof vs!="function"&&(vs=vs.EventEmitter),W.__signal_exit_emitter__?ye=W.__signal_exit_emitter__:(ye=W.__signal_exit_emitter__=new vs,ye.count=0,ye.emitted={}),ye.infinite||(ye.setMaxListeners(1/0),ye.infinite=!0),gi.exports=function(r,e){if(global.process===W){L0.equal(typeof r,"function","a callback must be provided for exit handler"),mi===!1&&Rc();var t="exit";e&&e.alwaysLast&&(t="afterexit");var i=function(){ye.removeListener(t,r),ye.listeners("exit").length===0&&ye.listeners("afterexit").length===0&&Ro()};return ye.on(t,r),i}},Ro=function(){!mi||global.process!==W||(mi=!1,pi.forEach(function(e){try{W.removeListener(e,Io[e])}catch{}}),W.emit=Mo,W.reallyExit=Ic,ye.count-=1)},gi.exports.unload=Ro,Er=function(e,t,i){ye.emitted[e]||(ye.emitted[e]=!0,ye.emit(e,t,i))},Io={},pi.forEach(function(r){Io[r]=function(){if(W===global.process){var t=W.listeners(r);t.length===ye.count&&(Ro(),Er("exit",null,r),Er("afterexit",null,r),q0&&r==="SIGHUP"&&(r="SIGINT"),W.kill(W.pid,r))}}}),gi.exports.signals=function(){return pi},mi=!1,Rc=function(){mi||W!==global.process||(mi=!0,ye.count+=1,pi=pi.filter(function(e){try{return W.on(e,Io[e]),!0}catch{return!1}}),W.emit=j0,W.reallyExit=N0)},gi.exports.load=Rc,Ic=W.reallyExit,N0=function(e){W===global.process&&(W.exitCode=e||0,Er("exit",W.exitCode,null),Er("afterexit",W.exitCode,null),Ic.call(W,W.exitCode))},Mo=W.emit,j0=function(e,t){if(e==="exit"&&W===global.process){t!==void 0&&(W.exitCode=t);var i=Mo.apply(this,arguments);return Er("exit",W.exitCode,null),Er("afterexit",W.exitCode,null),i}else return Mo.apply(this,arguments)});var L0,pi,q0,vs,ye,Ro,Er,Io,mi,Rc,Ic,N0,Mo,j0});var $0=b((g6,F0)=>{"use strict";var mP=require("os"),gP=D0(),yP=1e3*5,bP=(r,e="SIGTERM",t={})=>{let i=r(e);return vP(r,e,t,i),i},vP=(r,e,t,i)=>{if(!wP(e,t,i))return;let s=_P(t),n=setTimeout(()=>{r("SIGKILL")},s);n.unref&&n.unref()},wP=(r,{forceKillAfterTimeout:e},t)=>xP(r)&&e!==!1&&t,xP=r=>r===mP.constants.signals.SIGTERM||typeof r=="string"&&r.toUpperCase()==="SIGTERM",_P=({forceKillAfterTimeout:r=!0})=>{if(r===!0)return yP;if(!Number.isFinite(r)||r<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`);return r},SP=(r,e)=>{r.kill()&&(e.isCanceled=!0)},EP=(r,e,t)=>{r.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},kP=(r,{timeout:e,killSignal:t="SIGTERM"},i)=>{if(e===0||e===void 0)return i;let s,n=new Promise((a,l)=>{s=setTimeout(()=>{EP(r,t,l)},e)}),o=i.finally(()=>{clearTimeout(s)});return Promise.race([n,o])},CP=({timeout:r})=>{if(r!==void 0&&(!Number.isFinite(r
|
||
|
`;u+=" exitCode: `"+a+"`\n",u+=" signalCode: `"+l+"`\n",u+=" workerpool.script: `"+t.script+"`\n",u+=" spawnArgs: `"+o.spawnargs+"`\n",u+=" spawnfile: `"+o.spawnfile+"`\n",u+=" stdout: `"+o.stdout+"`\n",u+=" stderr: `"+o.stderr+"`\n",s(new Error(u))}),this.processing=Object.create(null),this.terminating=!1,this.terminated=!1,this.terminationHandler=null,this.lastId=0}xi.prototype.methods=function(){return this.exec("methods")};xi.prototype.exec=function(r,e,t,i){t||(t=Do.defer());var s=++this.lastId;this.processing[s]={id:s,resolver:t,options:i};var n={id:s,method:r,params:e};this.terminated?t.reject(new Error("Worker is terminated")):this.worker.ready?this.worker.send(n):this.requestQueue.push(n);var o=this;return t.promise.catch(function(a){if(a instanceof Do.CancellationError||a instanceof Do.TimeoutError)return delete o.processing[s],o.terminateAndNotify(!0).then(function(){throw a},function(l){throw l});throw a})};xi.prototype.busy=function(){return Object.keys(this.processing).length>0};xi.prototype.terminate=function(r,e){var t=this;if(r){for(var i in this.processing)this.processing[i]!==void 0&&this.processing[i].resolver.reject(new Error("Worker terminated"));this.processing=Object.create(null)}if(typeof e=="function"&&(this.terminationHandler=e),this.busy())this.terminating=!0;else{var s=function(o){if(t.terminated=!0,t.worker!=null&&t.worker.removeAllListeners&&t.worker.removeAllListeners("message"),t.worker=null,t.terminating=!1,t.terminationHandler)t.terminationHandler(o,t);else if(o)throw o};if(this.worker)if(typeof this.worker.kill=="function"){if(this.worker.killed){s(new Error("worker already killed!"));return}if(this.worker.isChildProcess){var n=setTimeout(function(){t.worker.kill()},xL);this.worker.once("exit",function(){clearTimeout(n),t.worker.killed=!0,s()}),this.worker.ready?this.worker.send(R1):this.worker.requestQueue.push(R1)}else this.worker.kill(),this.worker.killed=!0,s();return}else if(typeof this.worker.terminate=="function")this.worker.terminate(),this.worker.killed=!0;else throw new Error("Failed to terminate worker");s()}};xi.prototype.terminateAndNotify=function(r,e){var t=Do.defer();return e&&(t.promise.timeout=e),this.terminate(r,function(i,s){i?t.reject(i):t.resolve(s)}),t.promise};Or.exports=xi;Or.exports._tryRequireWorkerThreads=Zc;Or.exports._setupProcessWorker=Qc;Or.exports._setupBrowserWorker=Jc;Or.exports._setupWorkerThreadWorker=Xc;Or.exports.ensureWorkerThreads=L1});var D1=b((N6,j1)=>{"use strict";var N1=65535;j1.exports=eh;function eh(){this.ports=Object.create(null),this.length=0}eh.prototype.nextAvailableStartingAt=function(r){for(;this.ports[r]===!0;)r++;if(r>=N1)throw new Error("WorkerPool debug port limit reached: "+r+">= "+N1);return this.ports[r]=!0,this.length++,r};eh.prototype.releasePort=function(r){delete this.ports[r],this.length--}});var U1=b((j6,B1)=>{var th=jo(),F1=q1(),kL=No(),CL=D1(),$1=new CL;function tt(r,e){typeof r=="string"?this.script=r||null:(this.script=null,e=r),this.workers=[],this.tasks=[],e=e||{},this.forkArgs=e.forkArgs||[],this.forkOpts=e.forkOpts||{},this.debugPortStart=e.debugPortStart||43210,this.nodeWorker=e.nodeWorker,this.workerType=e.workerType||e.nodeWorker||"auto",this.maxQueueSize=e.maxQueueSize||1/0,e&&"maxWorkers"in e?(OL(e.maxWorkers),this.maxWorkers=e.maxWorkers):this.maxWorkers=Math.max((kL.cpus||4)-1,1),e&&"minWorkers"in e&&(e.minWorkers==="max"?this.minWorkers=this.maxWorkers:(AL(e.minWorkers),this.minWorkers=e.minWorkers,this.maxWorkers=Math.max(this.minWorkers,this.maxWorkers)),this._ensureMinWorkers()),this._boundNext=this._next.bind(this),this.workerType==="thread"&&F1.ensureWorkerThreads()}tt.prototype.exec=function(r,e,t){if(e&&!Array.isArray(e))throw new TypeError('Array expected as argument "params"');if(typeof r=="string"){var i=th.defer();if(this.tasks.length>=this.maxQueueSize)throw new Error("Max queue size of "+this.maxQueueSize+" reached");var s=this.tasks,n={method:r,params:e,resolver:i,timeout:null,options:t};s.push(n);var o=i.promise.timeout;return i.promise.timeout=function(l){return s.in
|
||
|
`.charCodeAt(0),ks=" ".charCodeAt(0),Ho="\f".charCodeAt(0),Go=" ".charCodeAt(0),Bo="\r".charCodeAt(0),LL="[".charCodeAt(0),qL="]".charCodeAt(0),NL="(".charCodeAt(0),jL=")".charCodeAt(0),DL="{".charCodeAt(0),FL="}".charCodeAt(0),$L=";".charCodeAt(0),HL="*".charCodeAt(0),GL=":".charCodeAt(0),BL="@".charCodeAt(0),Uo=/[\t\n\f\r "#'()/;[\\\]{}]/g,zo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,UL=/.[\n"'(/\\]/,K1=/[\da-f]/i;J1.exports=function(e,t={}){let i=e.css.valueOf(),s=t.ignoreErrors,n,o,a,l,u,c,f,h,d,p,g=i.length,y=0,m=[],v=[];function S(){return y}function w(C){throw e.error("Unclosed "+C,y)}function _(){return v.length===0&&y>=g}function A(C){if(v.length)return v.pop();if(y>=g)return;let T=C?C.ignoreUnclosed:!1;switch(n=i.charCodeAt(y),n){case $o:case ks:case Go:case Bo:case Ho:{o=y;do o+=1,n=i.charCodeAt(o);while(n===ks||n===$o||n===Go||n===Bo||n===Ho);p=["space",i.slice(y,o)],y=o-1;break}case LL:case qL:case DL:case FL:case GL:case $L:case jL:{let R=String.fromCharCode(n);p=[R,R,y];break}case NL:{if(h=m.length?m.pop()[1]:"",d=i.charCodeAt(y+1),h==="url"&&d!==nh&&d!==V1&&d!==ks&&d!==$o&&d!==Go&&d!==Ho&&d!==Bo){o=y;do{if(c=!1,o=i.indexOf(")",o+1),o===-1)if(s||T){o=y;break}else w("bracket");for(f=o;i.charCodeAt(f-1)===Fo;)f-=1,c=!c}while(c);p=["brackets",i.slice(y,o+1),y,o],y=o}else o=i.indexOf(")",y+1),l=i.slice(y,o+1),o===-1||UL.test(l)?p=["(","(",y]:(p=["brackets",l,y,o],y=o);break}case nh:case V1:{a=n===nh?"'":'"',o=y;do{if(c=!1,o=i.indexOf(a,o+1),o===-1)if(s||T){o=y+1;break}else w("string");for(f=o;i.charCodeAt(f-1)===Fo;)f-=1,c=!c}while(c);p=["string",i.slice(y,o+1),y,o],y=o;break}case BL:{Uo.lastIndex=y+1,Uo.test(i),Uo.lastIndex===0?o=i.length-1:o=Uo.lastIndex-2,p=["at-word",i.slice(y,o+1),y,o],y=o;break}case Fo:{for(o=y,u=!0;i.charCodeAt(o+1)===Fo;)o+=1,u=!u;if(n=i.charCodeAt(o+1),u&&n!==Y1&&n!==ks&&n!==$o&&n!==Go&&n!==Bo&&n!==Ho&&(o+=1,K1.test(i.charAt(o)))){for(;K1.test(i.charAt(o+1));)o+=1;i.charCodeAt(o+1)===ks&&(o+=1)}p=["word",i.slice(y,o+1),y,o],y=o;break}default:{n===Y1&&i.charCodeAt(y+1)===HL?(o=i.indexOf("*/",y+2)+1,o===0&&(s||T?o=i.length:w("comment")),p=["comment",i.slice(y,o+1),y,o],y=o):(zo.lastIndex=y+1,zo.test(i),zo.lastIndex===0?o=i.length-1:o=zo.lastIndex-2,p=["word",i.slice(y,o+1),y,o],m.push(p),y=o);break}}return y++,p}function O(C){v.push(C)}return{back:O,nextToken:A,endOfFile:_,position:S}}});var ah=b((H6,Z1)=>{"use strict";var Oe=to(),zL=oh(),X1;function WL(r){X1=r}var VL={brackets:Oe.cyan,"at-word":Oe.cyan,comment:Oe.gray,string:Oe.green,class:Oe.yellow,hash:Oe.magenta,call:Oe.cyan,"(":Oe.cyan,")":Oe.cyan,"{":Oe.yellow,"}":Oe.yellow,"[":Oe.yellow,"]":Oe.yellow,":":Oe.yellow,";":Oe.yellow};function YL([r,e],t){if(r==="word"){if(e[0]===".")return"class";if(e[0]==="#")return"hash"}if(!t.endOfFile()){let i=t.nextToken();if(t.back(i),i[0]==="brackets"||i[0]==="(")return"call"}return r}function Q1(r){let e=zL(new X1(r),{ignoreErrors:!0}),t="";for(;!e.endOfFile();){let i=e.nextToken(),s=VL[YL(i,e)];s?t+=i[1].split(/\r?\n/).map(n=>s(n)).join(`
|
||
|
`):t+=i[1]}return t}Q1.registerInput=WL;Z1.exports=Q1});var Wo=b((G6,rx)=>{"use strict";var ex=to(),tx=ah(),Ar=class extends Error{constructor(e,t,i,s,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),s&&(this.source=s),o&&(this.plugin=o),typeof t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ar)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=ex.isColorSupported),tx&&e&&(t=tx(t));let i=t.split(/\r?\n/),s=Math.max(this.line-3,0),n=Math.min(this.line+2,i.length),o=String(n).length,a,l;if(e){let{bold:u,red:c,gray:f}=ex.createColors(!0);a=h=>u(c(h)),l=h=>f(h)}else a=l=u=>u;return i.slice(s,n).map((u,c)=>{let f=s+1+c,h=" "+(" "+f).slice(-o)+" | ";if(f===this.line){let d=l(h.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(h)+u+`
|
||
|
`+d+a("^")}return" "+l(h)+u}).join(`
|
||
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
||
|
|
||
|
`+e+`
|
||
|
`),this.name+": "+this.message+e}};rx.exports=Ar;Ar.default=Ar});var Vo=b((B6,lh)=>{"use strict";lh.exports.isClean=Symbol("isClean");lh.exports.my=Symbol("my")});var uh=b((U6,sx)=>{"use strict";var ix={colon:": ",indent:" ",beforeDecl:`
|
||
|
`,beforeRule:`
|
||
|
`,beforeOpen:" ",beforeClose:`
|
||
|
`,beforeComment:`
|
||
|
`,after:`
|
||
|
`,emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:!1};function KL(r){return r[0].toUpperCase()+r.slice(1)}var Cs=class{constructor(e){this.builder=e}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}document(e){this.body(e)}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),s=e.prop+i+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}atrule(e,t){let i="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?i+=e.raws.afterName:s&&(i+=" "),e.nodes)this.block(e,i+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(i+s+n,e)}}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||i)}}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start");let s;e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}raw(e,t,i){let s;if(i||(i=t),t&&(s=e.raws[t],typeof s<"u"))return s;let n=e.parent;if(i==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return ix[i];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[i]<"u")return o.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+KL(i);this[a]?s=this[a](o,e):o.walk(l=>{if(s=l.raws[t],typeof s<"u")return!1})}return typeof s>"u"&&(s=ix[i]),o.rawCache[i]=s,s}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t<"u"))return!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(i=>{let s=i.parent;if(s&&s!==e&&s.parent&&s.parent===e&&typeof i.raws.before<"u"){let n=i.raws.before.split(`
|
||
|
`);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawBeforeComment(e,t){let i;return e.walkComments(s=>{if(typeof s.raws.before<"u")return i=s.raws.before,i.includes(`
|
||
|
`)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(t,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(e,t){let i;return e.walkDecls(s=>{if(typeof s.raws.before<"u")return i=s.raws.before,i.includes(`
|
||
|
`)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(t,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return t=i.raws.before,t.includes(`
|
||
|
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return t=i.raws.after,t.includes(`
|
||
|
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t<"u"))return!1}),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return t=i.raws.between.replace(/[^\s:]/g,""),!1}),t}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&s.type!=="root";)n+=1,s=s.parent;if(i.includes(`
|
||
|
`)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)i+=o}return i}rawValue(e,t){let i=e[t],s=e.raws[t];return s&&s.value===i?s.raw:i}};sx.exports=Cs;Cs.default=Cs});var Os=b((z6,nx)=>{"use strict";var JL=uh();function ch(r,e){new JL(e).stringify(r)}nx.exports=ch;ch.default=ch});var Ts=b((W6,ox)=>{"use strict";var{isClean:Yo,my:XL}=Vo(),QL=Wo(),ZL=uh(),eq=Os();function hh(r,e){let t=new r.constructor;for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i)||i==="proxyCache")continue;let s=r[i],n=typeof s;i==="parent"&&n==="object"?e&&(t[i]=e):i==="source"?t[i]=s:Array.isArray(s)?t[i]=s.map(o=>hh(o,t)):(n==="object"&&s!==null&&(s=hh(s)),t[i]=s)}return t}var As=class{constructor(e={}){this.raws={},this[Yo]=!1,this[XL]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[t]=e[t]}error(e,t={}){if(this.source){let{start:i,end:s}=this.rangeBy(t);return this.source.input.error(e,{line:i.line,column:i.column},{line:s.line,column:s.column},t)}return new QL(e)}warn(e,t,i){let s={node:this};for(let n in i)s[n]=i[n];return e.warn(t,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=eq){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}assign(e={}){for(let t in e)this[t]=e[t];return this}clone(e={}){let t=hh(this);for(let i in e)t[i]=e[i];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}replaceWith(...e){if(this.parent){let t=this,i=!1;for(let s of e)s===this?i=!0:i?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);i||this.remove()}return this}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}raw(e,t){return new ZL().raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}toJSON(e,t){let i={},s=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))i[o]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)i[o]=a.toJSON(null,t);else if(o==="source"){let l=t.get(a.input);l==null&&(l=n,t.set(a.input,n),n++),i[o]={inputId:l,start:a.start,end:a.end}}else i[o]=a}return s&&(i.inputs=[...t.keys()].map(o=>o.toJSON())),i}positionInside(e){let t=this.toString(),i=this.source.start.column,s=this.source.start.line;for(let n=0;n<e;n++)t[n]===`
|
||
|
`?(i=1,s+=1):i+=1;return{line:s,column:i}}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let i=this.toString().indexOf(e.word);i!==-1&&(t=this.positionInside(i))}return t}rangeBy(e){let t={line:this.source.start.line,column:this.source.start.column},i=this.source.end?{line:this.source.end.line,column:this.source.end.column+1}:{line:t.line,column:t.column+1};if(e.word){let s=this.toString().indexOf(e.word);s!==-1&&(t=this.positionInside(s),i=this.positionInside(s+e.word.length))}else e.start?t={line:e.start.line,column:e.start.column}:e.index&&(t=this.positionInside(e.index)),e.end?i={line:e.end.line,column:e.end.column}:e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1));return(i.line<t.line||i.line===t.line&&i.column<=t.column)&&(i={line:t.line,column:t.column+1}),{start:t,end:i}}getProxyProcessor(){return{set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0},get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]}}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}markDirty(){if(this[Yo]){this[Yo]=!1;let e=this;for(;e=e.parent;)e[Yo]=!1}}get proxyOf(){return this}};ox.exports=As;As.default=As});var Is=b((V6,ax)=>{"use strict";var tq=Ts(),Rs=class extends tq{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};ax.exports=Rs;Rs.default=Rs});var ux=b(fh=>{var lx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");fh.encode=function(r){if(0<=r&&r<lx.length)return lx[r];throw new TypeError("Must be between 0 and 63: "+r)};fh.decode=function(r){var e=65,t=90,i=97,s=122,n=48,o=57,a=43,l=47,u=26,c=52;return e<=r&&r<=t?r-e:i<=r&&r<=s?r-i+u:n<=r&&r<=o?r-n+c:r==a?62:r==l?63:-1}});var mh=b(ph=>{var cx=ux(),dh=5,hx=1<<dh,fx=hx-1,dx=hx;function rq(r){return r<0?(-r<<1)+1:(r<<1)+0}function iq(r){var e=(r&1)===1,t=r>>1;return e?-t:t}ph.encode=function(e){var t="",i,s=rq(e);do i=s&fx,s>>>=dh,s>0&&(i|=dx),t+=cx.encode(i);while(s>0);return t};ph.decode=function(e,t,i){var s=e.length,n=0,o=0,a,l;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(l=cx.decode(e.charCodeAt(t++)),l===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));a=!!(l&dx),l&=fx,n=n+(l<<o),o+=dh}while(a);i.value=iq(n),i.rest=t}});var Si=b(be=>{function sq(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}be.getArg=sq;var px=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,nq=/^data:.+\,.+$/;function Ms(r){var e=r.match(px);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}be.urlParse=Ms;function _i(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}be.urlGenerate=_i;var oq=32;function aq(r){var e=[];return function(t){for(var i=0;i<e.length;i++)if(e[i].input===t){var s=e[0];return e[0]=e[i],e[i]=s,e[0].result}var n=r(t);return e.unshift({input:t,result:n}),e.length>oq&&e.pop(),n}}var gh=aq(function(e){var t=e,i=Ms(e);if(i){if(!i.path)return e;t=i.path}for(var s=be.isAbsolute(t),n=[],o=0,a=0;;)if(o=a,a=t.indexOf("/",o),a===-1){n.push(t.slice(o));break}else for(n.push(t.slice(o,a));a<t.length&&t[a]==="/";)a++;for(var l,u=0,a=n.length-1;a>=0;a--)l=n[a],l==="."?n.splice(a,1):l===".."?u++:u>0&&(l===""?(n.splice(a+1,u),u=0):(n.splice(a,2),u--));return t=n.join("/"),t===""&&(t=s?"/":"."),i?(i.path=t,_i(i)):t});be.normalize=gh;function mx(r,e){r===""&&(r="."),e===""&&(e=".");var t=Ms(e),i=Ms(r);if(i&&(r=i.path||"/"),t&&!t.scheme)return i&&(t.scheme=i.sch
|
||
|
`);i=new Array(n.length);let o=0;for(let a=0,l=n.length;a<l;a++)i[a]=o,o+=n[a].length+1;this[Oh]=i}t=i[i.length-1];let s=0;if(e>=t)s=i.length-1;else{let n=i.length-2,o;for(;s<n;)if(o=s+(n-s>>1),e<i[o])n=o-1;else if(e>=i[o+1])s=o+1;else{s=o;break}}return{line:s+1,col:e-i[s]+1}}error(e,t,i,s={}){let n,o,a;if(t&&typeof t=="object"){let u=t,c=i;if(typeof t.offset=="number"){let f=this.fromOffset(u.offset);t=f.line,i=f.col}else t=u.line,i=u.column;if(typeof c.offset=="number"){let f=this.fromOffset(c.offset);o=f.line,a=f.col}else o=c.line,a=c.column}else if(!i){let u=this.fromOffset(t);t=u.line,i=u.col}let l=this.origin(t,i,o,a);return l?n=new Fx(e,l.endLine===void 0?l.line:{line:l.line,column:l.column},l.endLine===void 0?l.column:{line:l.endLine,column:l.endColumn},l.source,l.file,s.plugin):n=new Fx(e,o===void 0?t:{line:t,column:i},o===void 0?i:{line:o,column:a},this.css,this.file,s.plugin),n.input={line:t,column:i,endLine:o,endColumn:a,source:this.css},this.file&&(ta&&(n.input.url=ta(this.file).toString()),n.input.file=this.file),n}origin(e,t,i,s){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({line:e,column:t});if(!o.source)return!1;let a;typeof i=="number"&&(a=n.originalPositionFor({line:i,column:s}));let l;Th(o.source)?l=ta(o.source):l=new URL(o.source,this.map.consumer().sourceRoot||ta(this.map.mapFile));let u={url:l.toString(),line:o.line,column:o.column,endLine:a&&a.line,endColumn:a&&a.column};if(l.protocol==="file:")if(Dx)u.file=Dx(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ah(this.map.consumer().sourceRoot||this.map.root||".",e)}get from(){return this.file||this.id}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Hx.exports=Ci;Ci.default=Ci;Ch&&Ch.registerInput&&Ch.registerInput(Ci)});var Ih=b((l4,Vx)=>{"use strict";var{SourceMapConsumer:Bx,SourceMapGenerator:ra}=ea(),{dirname:ia,resolve:Ux,relative:zx,sep:Wx}=require("path"),{pathToFileURL:Gx}=require("url"),Dq=Ns(),Fq=Boolean(Bx&&ra),$q=Boolean(ia&&Ux&&zx&&Wx),Rh=class{constructor(e,t,i,s){this.stringify=e,this.mapOpts=i.map||{},this.root=t,this.opts=i,this.css=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Dq(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let i=t.source.input.from;if(i&&!e[i]){e[i]=!0;let s=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||ia(e.file),s;this.mapOpts.sourcesContent===!1?(s=new Bx(e.text),s.sourcesContent&&(s.sourcesContent=s.sourcesContent.map(()=>null))):s=e.consumer(),this.map.applySourceMap(s,t,this.to
|
||
|
`;this.css.includes(`\r
|
||
|
`)&&(t=`\r
|
||
|
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ra.fromSourceMap(e)}else this.map=new ra({file:this.outputFile()}),this.map.addMapping({source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",generated:{line:1,column:0},original:{line:1,column:0}});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}path(e){if(e.indexOf("<")===0||/^\w+:\/\//.test(e)||this.mapOpts.absolute)return e;let t=this.opts.to?ia(this.opts.to):".";return typeof this.mapOpts.annotation=="string"&&(t=ia(Ux(t,this.mapOpts.annotation))),e=zx(t,e),e}toUrl(e){return Wx==="\\"&&(e=e.replace(/\\/g,"/")),encodeURI(e).replace(/[#?]/g,encodeURIComponent)}toFileUrl(e){if(Gx)return Gx(e).toString();throw new Error("`map.absolute` option is not available in this PostCSS build")}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}generateString(){this.css="",this.map=new ra({file:this.outputFile()});let e=1,t=1,i="<no source>",s={source:"",generated:{line:0,column:0},original:{line:0,column:0}},n,o;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(s.generated.line=e,s.generated.column=t-1,l.source&&l.source.start?(s.source=this.sourcePath(l),s.original.line=l.source.start.line,s.original.column=l.source.start.column-1,this.map.addMapping(s)):(s.source=i,s.original.line=1,s.original.column=0,this.map.addMapping(s))),n=a.match(/\n/g),n?(e+=n.length,o=a.lastIndexOf(`
|
||
|
`),t=a.length-o):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(l.type!=="decl"||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(s.source=this.sourcePath(l),s.original.line=l.source.end.line,s.original.column=l.source.end.column-1,s.generated.line=e,s.generated.column=t-2,this.map.addMapping(s)):(s.source=i,s.original.line=1,s.original.column=0,s.generated.line=e,s.generated.column=t-1,this.map.addMapping(s)))}})}generate(){if(this.clearAnnotation(),$q&&Fq&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}};Vx.exports=Rh});var Ds=b((u4,Yx)=>{"use strict";var Hq=Ts(),js=class extends Hq{constructor(e){super(e),this.type="comment"}};Yx.exports=js;js.default=js});var tr=b((c4,i_)=>{"use strict";var{isClean:Kx,my:Jx}=Vo(),Xx=Is(),Qx=Ds(),Gq=Ts(),Zx,Mh,Ph,e_;function t_(r){return r.map(e=>(e.nodes&&(e.nodes=t_(e.nodes)),delete e.source,e))}function r_(r){if(r[Kx]=!1,r.proxyOf.nodes)for(let e of r.proxyOf.nodes)r_(e)}var Be=class extends Gq{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),i,s;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],s=e(this.proxyOf.nodes[i],i),s!==!1);)this.indexes[t]+=1;return delete this.indexes[t],s}walk(e){return this.each((t,i)=>{let s;try{s=e(t,i)}catch(n){throw t.addToError(n)}return s!==!1&&t.walk&&(s=t.walk(e)),s})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,s)}):this.walk((i,s)=>{if(i.type==="decl"&&i.prop===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="decl")return t(i,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,s)}):this.walk((i,s)=>{if(i.type==="rule"&&i.selector===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="rule")return t(i,s)}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,s)}):this.walk((i,s)=>{if(i.type==="atrule"&&i.name===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="atrule")return t(i,s)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}append(...e){for(let t of e){let i=this.normalize(t,this.last);for(let s of i)this.proxyOf.nodes.push(s)}return this.markDirty(),this}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,this.first,"prepend").reverse();for(let s of i)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+i.length}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let i=this.index(e),s=e===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[i],s).reverse();i=this.index(e);for(let a of n)this.proxyOf.nodes.splice(i,0,a);let o;for(let a in this.indexes)o=this.indexes[a],i<=o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}insertAfter(e,t){let i=this.index(e),s=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let o of s)this.proxyOf.nodes.splice(i+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],i<n&&(this.indexes[o]=n+s.length);return this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,i))}),this.markDirty(),this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}get first(){if(!!this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(!!this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}normalize(e,t){if(typeof e==
|
||
|
`," "];return Hs.split(r,e)},comma(r){return Hs.split(r,[","],!0)}};y_.exports=Hs;Hs.default=Hs});var aa=b((b4,v_)=>{"use strict";var b_=tr(),zq=Nh(),Ti=class extends b_{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return zq.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}};v_.exports=Ti;Ti.default=Ti;b_.registerRule(Ti)});var S_=b((v4,__)=>{"use strict";var Wq=Is(),Vq=oh(),Yq=Ds(),Kq=oa(),Jq=Ai(),w_=aa(),x_={empty:!0,space:!0};function Xq(r){for(let e=r.length-1;e>=0;e--){let t=r[e],i=t[3]||t[2];if(i)return i}}var jh=class{constructor(e){this.input=e,this.root=new Jq,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{offset:0,line:1,column:1}}}createTokenizer(){this.tokenizer=Vq(this.input)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}comment(e){let t=new Yq;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]);let i=e[1].slice(2,-2);if(/^\s*$/.test(i))t.text="",t.raws.left=i,t.raws.right="";else{let s=i.match(/^(\s*)([^]*\S)(\s*)$/);t.text=s[2],t.raws.left=s[1],t.raws.right=s[3]}}emptyRule(e){let t=new w_;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}other(e){let t=!1,i=null,s=!1,n=null,o=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(i=u[0],l.push(u),i==="("||i==="[")n||(n=u),o.push(i==="("?")":"]");else if(a&&s&&i==="{")n||(n=u),o.push("}");else if(o.length===0)if(i===";")if(s){this.decl(l,a);return}else break;else if(i==="{"){this.rule(l);return}else if(i==="}"){this.tokenizer.back(l.pop()),t=!0;break}else i===":"&&(s=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}rule(e){e.pop();let t=new w_;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}decl(e,t){let i=new Wq;this.init(i,e[0][2]);let s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(s[3]||s[2]||Xq(e));e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){i.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),i.raws.between+=n[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let o=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){i.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(i.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),f="";for(let h=u;h>0;h--){let d=c[h][0];if(f.trim().indexOf("!")===0&&d!=="space")break;f=c.pop()[1]+f}f.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=f,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(i.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(i,"value",o.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}atrule(e){let t=new Kq;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,s,n,o=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?u.push(i==="("?")":"]"
|
||
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
||
|
https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new Hh().version,a}let n;return Object.defineProperty(s,"postcss",{get(){return n||(n=s()),n}}),s.process=function(o,a,l){return K([s(l)]).process(o,a)},s};K.stringify=TN;K.parse=LN;K.fromJSON=RN;K.list=qN;K.comment=r=>new j_(r);K.atRule=r=>new D_(r);K.decl=r=>new q_(r);K.rule=r=>new F_(r);K.root=r=>new $_(r);K.document=r=>new N_(r);K.CssSyntaxError=CN;K.Declaration=q_;K.Container=AN;K.Processor=Hh;K.Document=N_;K.Comment=j_;K.Warning=IN;K.AtRule=D_;K.Result=MN;K.Input=PN;K.Rule=F_;K.Root=$_;K.Node=NN;ON.registerPostcss(K);H_.exports=K;K.default=K});var U_=b(qe=>{function DN(r){return r?r.toArray?r.toArray():r:[]}var Uh=qe.BALANCED_PAIRS=[["(",")"],["[","]"],["{","}"],["{{","}}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["TAG_START","TAG_END"],["STYLE_START","STYLE_END"],["BLOCK_PARAM_START","BLOCK_PARAM_END"]],Z4=qe.BITWISE_OPERATORS={"|":!0,"&":!0,"!&":!0,"~":!0,"|=":!0,"&=":!0,"~=":!0,"^=":!0,"^":!0,"<<":!0,"<<=":!0,">>":!0,">>=":!0},e$=qe.ASSIGNMENT_OPERATORS={"=":!0,"=?":!0,"??=":!0,"||=":!0,"&&=":!0,"|=":!0,"|=?":!0,"&=":!0,"&=?":!0,"^=":!0,"^=?":!0,"~=":!0,"~=?":!0},B_=qe.INVERSES={};for(let r=0,e=Uh.length,t;r<e;r++)t=Uh[r],da=t[0],pa=t[1],B_[pa]=da,B_[da]=pa,Uh[da]=pa;var da,pa,t$=qe.ALL_KEYWORDS=["true","false","null","this","delete","typeof","in","instanceof","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","return","undefined","then","unless","until","loop","of","by","when","def","tag","do","elif","begin","var","let","self","await","import","and","or","is","isnt","not","yes","no","isa","case","nil","require"],r$=qe.TOK={TERMINATOR:"TERMINATOR",INDENT:"INDENT",OUTDENT:"OUTDENT",DEF_BODY:"DEF_BODY",THEN:"THEN",CATCH:"CATCH"},i$=qe.OPERATOR_ALIASES={and:"&&",or:"||",is:"==",isnt:"!=",isa:"instanceof"},s$=qe.HEREGEX_OMIT=/\s+(?:#.*)?/g,n$=qe.HEREGEX=/^\/{3}([\s\S]+?)\/{3}([a-z]{0,8})(?!\w)/,o$=qe.TAG_GLOBAL_ATTRIBUTES={itemid:1,itemprop:1,itemref:1,itemscope:1,itemtype:1,enterkeyhint:1,autofocus:1,autocapitalize:1,autocomplete:1,accesskey:1,inputmode:1,spellcheck:1,translate:1,is:1},a$=qe.SYSVAR_PREFIX={TAG:"τ",FLIP:"ω",VALUE:"υ",CACHE:"ρ",KEY:"κ",ANY:"φ",B:"Θ",T:"τ",C:"ρ",V:"υ",K:"κ",D:"Δ"},ma=qe.TAG_TYPES={"":[-1,{id:1,className:"class",slot:1,part:1,elementTiming:"elementtiming"}],HTML:[-1,{title:1,lang:1,translate:1,dir:1,accessKey:"accesskey",draggable:1,spellcheck:1,autocapitalize:1,inputMode:"inputmode",style:1,tabIndex:"tabindex",enterKeyHint:"enterkeyhint"}],HTMLAnchor:[1,{target:1,download:1,ping:1,rel:1,relList:"rel",hreflang:1,type:1,referrerPolicy:"referrerpolicy",coords:1,charset:1,name:1,rev:1,shape:1,href:1}],HTMLArea:[1,{alt:1,coords:1,download:1,shape:1,target:1,ping:1,rel:1,relList:"rel",referrerPolicy:"referrerpolicy",href:1}],HTMLMedia:[1,{src:1,crossOrigin:"crossorigin",preload:1,controlsList:"controlslist"}],HTMLAudio:[4,{}],HTMLBase:[1,{href:1,target:1}],HTMLQuote:[1,{cite:1}],HTMLBody:[1,{text:1,link:1,vLink:"vlink",aLink:"alink",bgColor:"bgcolor",background:1}],HTMLBR:[1,{clear:1}],HTMLButton:[1,{formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",name:1,type:1,value:1}],HTMLCanvas:[1,{width:1,height:1}],HTMLTableCaption:[1,{align:1}],HTMLTableCol:[1,{span:1,align:1,ch:"char",chOff:"charoff",vAlign:"valign",width:1}],HTMLData:[1,{value:1}],HTMLDataList:[1,{}],HTMLMod:[1,{cite:1,dateTime:"datetime"}],HTMLDetails:[1,{}],HTMLDialog:[1,{}],HTMLDiv:[1,{align:1}],HTMLDList:[1,{}],HTMLEmbed:[1,{src:1,type:1,width:1,height:1,align:1,name:1}],HTMLFieldSet:[1,{name:1}],HTMLForm:[1,{acceptCharset:"accept-charset",action:1,autocomplete:1,enctype:1,encoding:"enctype",method:1,name:1,target:1}],HTMLHeading:[1,{align:1}],HTMLHead:[1,{}],HTMLHR:[1,{align:1,color:1,size:1,width:1}],HTMLHtml:[1,{version:1}],HTMLIFrame:[1,{src:1,srcdoc:1,name:1,sandbox:1,width:1,height:1,referrerPolicy:"referrerpolicy",csp:1,allow:1,a
|
||
|
|
||
|
`),k())}function k(P){if(P||m--,y++,g===y&&m===0&&s!==void 0)return s(p||null)}}});var PS=b((U$,MS)=>{var IS={};MS.exports=IS;var RS={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(RS).forEach(function(r){var e=RS[r],t=IS[r]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var qS=b((z$,LS)=>{"use strict";LS.exports=function(r,e){e=e||process.argv;var t=e.indexOf("--"),i=/^-{1,2}/.test(r)?"":"--",s=e.indexOf(i+r);return s!==-1&&(t===-1?!0:s<t)}});var jS=b((W$,NS)=>{"use strict";var QN=require("os"),it=qS(),Re=process.env,Li=void 0;it("no-color")||it("no-colors")||it("color=false")?Li=!1:(it("color")||it("colors")||it("color=true")||it("color=always"))&&(Li=!0);"FORCE_COLOR"in Re&&(Li=Re.FORCE_COLOR.length===0||parseInt(Re.FORCE_COLOR,10)!==0);function ZN(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function ej(r){if(Li===!1)return 0;if(it("color=16m")||it("color=full")||it("color=truecolor"))return 3;if(it("color=256"))return 2;if(r&&!r.isTTY&&Li!==!0)return 0;var e=Li?1:0;if(process.platform==="win32"){var t=QN.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in Re)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(s){return s in Re})||Re.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Re)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Re.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Re){var i=parseInt((Re.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Re.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Re.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Re.TERM)||"COLORTERM"in Re?1:(Re.TERM==="dumb",e)}function af(r){var e=ej(r);return ZN(e)}NS.exports={supportsColor:af,stdout:af(process.stdout),stderr:af(process.stderr)}});var FS=b((V$,DS)=>{DS.exports=function(e,t){var i="";e=e||"Run the trap, drop the bass",e=e.split("");var s={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return e.forEach(function(n){n=n.toLowerCase();var o=s[n]||[" "],a=Math.floor(Math.random()*o.length);typeof s[n]<"u"?i+=s[n][a]:i+=n}),i}});var HS=b((Y$,$S)=>{$S.exports=function(e,t){e=e||" he is here ";var i={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀"
|
||
|
`)!=-1,i=this._styles,s=i.length;s--;){var n=Nr[i[s]];e=n.open+e.replace(n.closeRe,n.open)+n.close,t&&(e=e.replace(rj,function(o){return n.close+o+n.open}))}return e}G.setTheme=function(r){if(typeof r=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in r)(function(t){G[t]=function(i){if(typeof r[t]=="object"){var s=i;for(var n in r[t])s=G[r[t][n]](s);return s}return G[r[t]](i)}})(e)};function aj(){var r={};return Object.keys(ZS).forEach(function(e){r[e]={get:function(){return QS([e])}}}),r}var lj=function(e,t){var i=t.split("");return i=i.map(e),i.join("")};G.trap=FS();G.zalgo=HS();G.maps={};G.maps.america=BS()(G);G.maps.zebra=zS()(G);G.maps.rainbow=VS()(G);G.maps.random=KS()(G);for(JS in G.maps)(function(r){G[r]=function(e){return lj(G.maps[r],e)}})(JS);var JS;XS(G,aj())});var rE=b((tH,tE)=>{var ke=lf();tE.exports=function(){var r=function(i,s){String.prototype.__defineGetter__(i,s)};r("strip",function(){return ke.strip(this)}),r("stripColors",function(){return ke.strip(this)}),r("trap",function(){return ke.trap(this)}),r("zalgo",function(){return ke.zalgo(this)}),r("zebra",function(){return ke.zebra(this)}),r("rainbow",function(){return ke.rainbow(this)}),r("random",function(){return ke.random(this)}),r("america",function(){return ke.america(this)});var e=Object.keys(ke.styles);e.forEach(function(i){r(i,function(){return ke.stylize(this,i)})});function t(i){var s=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(i).forEach(function(n){if(s.indexOf(n)!==-1)console.log("warn: ".red+("String.prototype"+n).magenta+" is probably something you don't want to override. Ignoring style name");else if(typeof i[n]=="string")ke[n]=ke[i[n]],r(n,function(){return ke[n](this)});else{var o=function(a){for(var l=a||this,u=0;u<i[n].length;u++)l=ke[i[n][u]](l);return l};r(n,o),ke[n]=function(a){return o(a)}}})}ke.setTheme=function(i){if(typeof i=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}else t(i)}}});var sE=b((rH,iE)=>{var uj=lf();iE.exports=uj;rE()()});var lE=b((iH,aE)=>{function cj(r){let e;return r?(e=r.toIterable)?e.call(r):r:[]}var qi=console.log,uf=process.cwd(),hj=__dirname;sE();var Ni=require("fs"),jt=require("path"),cf=cc(),df=Cc();function Js(r="Quit"){return console.error(r.red),process.exit()}var hf={default:{path:"default",name:"Default",desc:"Client only application (Imba bundler)"},vite:{path:"vite",name:"Vite",desc:"Client only application (Vite bundler)"},express:{path:"express",name:"Express",desc:"Full stack application (Imba bundler)"},vitest:{path:"vitest",name:"Vitest",desc:"Client only application with vitest (Vite bundler)"},module:{path:"module",name:"Module",desc:"A module that can be used in any JavaScript project (Vite bundler)"}},fj=[".git","dist","node_modules","package-lock.json"];function oE(r,e){var t;if(!fj.includes(jt.basename(r)))if(jt.basename(e)==="_gitignore"&&(e=jt.join(jt.dirname(e),".gitignore")),Ni.statSync(r).isDirectory()){Ni.mkdirSync(e,{recursive:!0}),t=[];for(let i of cj(Ni.readdirSync(r)))t.push(oE(jt.resolve(r,i),jt.resolve(e,i
|
||
|
Created <`+n.name+"> project named '"+l+"' in "+u).green)}catch(c){Js(`
|
||
|
Failed to copy project:
|
||
|
|
||
|
`+c)}qi(`
|
||
|
Installing dependencies`.bold);try{s!=="."&&process.chdir(a),df.sync("npm",["pkg","set","name="+l]),df.sync("npm",["up","-S"],{stdio:"inherit"})}catch(c){qi((`
|
||
|
Failed to install dependencies:
|
||
|
|
||
|
`+c).red)}return qi(`
|
||
|
Install the vscode extension for an optimal experience:
|
||
|
`+"https://marketplace.visualstudio.com/items?itemName=scrimba.vsimba".blue+`
|
||
|
|
||
|
Join the Imba community on discord for help and friendly discussions:
|
||
|
`+"https://discord.gg/mkcbkRw".blue+`
|
||
|
|
||
|
Get started:
|
||
|
|
||
|
`+"➜".cyan+" cd "+s+`
|
||
|
`+"➜".cyan+` npm run dev
|
||
|
`)}aE.exports=dj});var uE=b((sH,pj)=>{pj.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var hE=b((nH,Ea)=>{var mj=require("fs"),cE=require("path"),gj=require("os"),yj=uE(),bj=yj.version,vj=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function wj(r){let e={},t=r.toString();t=t.replace(/\r\n?/mg,`
|
||
|
`);let i;for(;(i=vj.exec(t))!=null;){let s=i[1],n=i[2]||"";n=n.trim();let o=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(n=n.replace(/\\n/g,`
|
||
|
`),n=n.replace(/\\r/g,"\r")),e[s]=n}return e}function pf(r){console.log(`[dotenv@${bj}][DEBUG] ${r}`)}function xj(r){return r[0]==="~"?cE.join(gj.homedir(),r.slice(1)):r}function _j(r){let e=cE.resolve(process.cwd(),".env"),t="utf8",i=Boolean(r&&r.debug),s=Boolean(r&&r.override);r&&(r.path!=null&&(e=xj(r.path)),r.encoding!=null&&(t=r.encoding));try{let n=Sa.parse(mj.readFileSync(e,{encoding:t}));return Object.keys(n).forEach(function(o){Object.prototype.hasOwnProperty.call(process.env,o)?(s===!0&&(process.env[o]=n[o]),i&&pf(s===!0?`"${o}" is already defined in \`process.env\` and WAS overwritten`:`"${o}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[o]=n[o]}),{parsed:n}}catch(n){return i&&pf(`Failed to load ${e} ${n.message}`),{error:n}}}var Sa={config:_j,parse:wj};Ea.exports.config=Sa.config;Ea.exports.parse=Sa.parse;Ea.exports=Sa});var fE=b(mf=>{var jr=require("path"),nr=process.platform==="win32",sr=require("fs"),Sj=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function Ej(){var r;if(Sj){var e=new Error;r=t}else r=i;return r;function t(s){s&&(e.message=s.message,s=e,i(s))}function i(s){if(s){if(process.throwDeprecation)throw s;if(!process.noDeprecation){var n="fs: missing callback "+(s.stack||s.message);process.traceDeprecation?console.trace(n):console.error(n)}}}}function kj(r){return typeof r=="function"?r:Ej()}var oH=jr.normalize;nr?Dt=/(.*?)(?:[\/\\]+|$)/g:Dt=/(.*?)(?:[\/]+|$)/g;var Dt;nr?Xs=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/:Xs=/^[\/]*/;var Xs;mf.realpathSync=function(e,t){if(e=jr.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var i=e,s={},n={},o,a,l,u;c();function c(){var y=Xs.exec(e);o=y[0].length,a=y[0],l=y[0],u="",nr&&!n[l]&&(sr.lstatSync(l),n[l]=!0)}for(;o<e.length;){Dt.lastIndex=o;var f=Dt.exec(e);if(u=a,a+=f[0],l=u+f[1],o=Dt.lastIndex,!(n[l]||t&&t[l]===l)){var h;if(t&&Object.prototype.hasOwnProperty.call(t,l))h=t[l];else{var d=sr.lstatSync(l);if(!d.isSymbolicLink()){n[l]=!0,t&&(t[l]=l);continue}var p=null;if(!nr){var g=d.dev.toString(32)+":"+d.ino.toString(32);s.hasOwnProperty(g)&&(p=s[g])}p===null&&(sr.statSync(l),p=sr.readlinkSync(l)),h=jr.resolve(u,p),t&&(t[l]=h),nr||(s[g]=p)}e=jr.resolve(h,e.slice(o)),c()}}return t&&(t[i]=e),e};mf.realpath=function(e,t,i){if(typeof i!="function"&&(i=kj(t),t=null),e=jr.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(i.bind(null,null,t[e]));var s=e,n={},o={},a,l,u,c;f();function f(){var y=Xs.exec(e);a=y[0].length,l=y[0],u=y[0],c="",nr&&!o[u]?sr.lstat(u,function(m){if(m)return i(m);o[u]=!0,h()}):process.nextTick(h)}function h(){if(a>=e.length)return t&&(t[s]=e),i(null,e);Dt.lastIndex=a;var y=Dt.exec(e);return c=l,l+=y[0],u=c+y[1],a=Dt.lastIndex,o[u]||t&&t[u]===u?process.nextTick(h):t&&Object.prototype.hasOwnProperty.call(t,u)?g(t[u]):sr.lstat(u,d)}function d(y,m){if(y)return i(y);if(!m.isSymbolicLink())return o[u]=!0,t&&(t[u]=u),process.nextTick(h);if(!nr){var v=m.dev.toString(32)+":"+m.ino.toString(32);if(n.hasOwnProperty(v))return p(null,n[v],u)}sr.stat(u,function(S){if(S)return i(S);sr.readlink(u,function(w,_){nr||(n[v]=_),p(w,_)})})}function p(y,m,v){if(y)return i(y);var S=jr.resolve(c,m);t&&(t[v]=S),g(S)}function g(y){e=jr.resolve(y,e.slice(a)),f()}}});var vf=b((lH,gE)=>{gE.exports=or;or.realpath=or;or.sync=bf;or.realpathSync=bf;or.monkeypatch=Oj;or.unmonkeypatch=Aj;var ji=require("fs"),gf=ji.realpath,yf=ji.realpathSync,Cj=process.version,dE=/^v[0-5]\./.test(Cj),pE=fE();function mE(r){return r&&r.syscall==="realpath"&&(r.code==="ELOOP"||r.code==="ENOMEM"||r.code==="ENAMETOOLONG")}function or(r,e,t){if(dE)return gf(r,e,t);typeof e=="function"&&(t=e,e=null),gf(r,e,function(i,s){mE(i)?pE.realpath(r,e,t):t(i,s)})}function bf(r,e){if(dE)return yf(r,e);try{return yf(r,e)}catch(t){if(mE(t))return pE.realpathSync(r,e);throw t}}function Oj(){ji.realpath=or,ji.realpathSync=bf}function Aj(){ji.realpath=gf,ji.realpathSync=yf}});var bE=b((uH,yE)=>{yE.exports=function(r,e){for(var t=[],i=0;i<r.length;i++){var s=e(r[i],i);Tj(s)?t.push.apply(t,s):t.push(s)}return t}
|
||
|
%s`,_,_,v,i);var A=v.type==="*"?Sf:v.type==="?"?_f:"\\"+v.type;s=!0,i=i.slice(0,v.reStart)+A+"\\("+_}p(),n&&(i+="\\\\");var O=!1;switch(i.charAt(0)){case"[":case".":case"(":O=!0}for(var C=a.length-1;C>-1;C--){var T=a[C],R=i.slice(0,T.reStart),x=i.slice(T.reStart,T.reEnd-8),j=i.slice(T.reEnd-8,T.reEnd),F=i.slice(T.reEnd);j+=F;var ge=R.split("(").length-1,E=F;for(g=0;g<ge;g++)E=E.replace(/\)[+*?]?/,"");F=E;var k="";F===""&&e!==ka&&(k="$");var P=R+x+F+k+j;i=P}if(i!==""&&s&&(i="(?=.)"+i),O&&(i=h+i),e===ka)return[i,s];if(!s)return Yj(r);var M=t.nocase?"i":"";try{var D=new RegExp("^"+i+"$",M)}catch{return new RegExp("$.")}return D._glob=r,D._src=i,D}Ue.makeRe=function(r,e){return new _e(r,e||{}).makeRe()};_e.prototype.makeRe=Vj;function Vj(){if(this.regexp||this.regexp===!1)return this.regexp;var r=this.set;if(!r.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?Sf:e.dot?Fj:$j,i=e.nocase?"i":"",s=r.map(function(n){return n.map(function(o){return o===Ef?t:typeof o=="string"?Kj(o):o._src}).join("\\/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,i)}catch{this.regexp=!1}return this.regexp}Ue.match=function(r,e,t){t=t||{};var i=new _e(e,t);return r=r.filter(function(s){return i.match(s)}),i.options.nonull&&!r.length&&r.push(e),r};_e.prototype.match=function(e,t){if(typeof t>"u"&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;var i=this.options;Qs.sep!=="/"&&(e=e.split(Qs.sep).join("/")),e=e.split(LE),this.debug(this.pattern,"split",e);var s=this.set;this.debug(this.pattern,"set",s);var n,o;for(o=e.length-1;o>=0&&(n=e[o],!n);o--);for(o=0;o<s.length;o++){var a=s[o],l=e;i.matchBase&&a.length===1&&(l=[n]);var u=this.matchOne(l,a,t);if(u)return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate};_e.prototype.matchOne=function(r,e,t){var i=this.options;this.debug("matchOne",{this:this,file:r,pattern:e}),this.debug("matchOne",r.length,e.length);for(var s=0,n=0,o=r.length,a=e.length;s<o&&n<a;s++,n++){this.debug("matchOne loop");var l=e[n],u=r[s];if(this.debug(e,l,u),l===!1)return!1;if(l===Ef){this.debug("GLOBSTAR",[e,l,u]);var c=s,f=n+1;if(f===a){for(this.debug("** at the end");s<o;s++)if(r[s]==="."||r[s]===".."||!i.dot&&r[s].charAt(0)===".")return!1;return!0}for(;c<o;){var h=r[c];if(this.debug(`
|
||
|
globstar while`,r,c,e,f,h),this.matchOne(r.slice(c),e.slice(f),t))return this.debug("globstar found match!",c,o,h),!0;if(h==="."||h===".."||!i.dot&&h.charAt(0)==="."){this.debug("dot detected!",r,c,e,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(t&&(this.debug(`
|
||
|
>>> no match, partial?`,r,c,e,f),c===o))}var d;if(typeof l=="string"?(d=u===l,this.debug("string match",l,u,d)):(d=u.match(l),this.debug("pattern match",l,u,d)),!d)return!1}if(s===o&&n===a)return!0;if(s===o)return t;if(n===a)return s===o-1&&r[s]==="";throw new Error("wtf?")};function Yj(r){return r.replace(/\\(.)/g,"$1")}function Kj(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var Ta=b((dH,Aa)=>{"use strict";function jE(r){return r.charAt(0)==="/"}function DE(r){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,t=e.exec(r),i=t[1]||"",s=Boolean(i&&i.charAt(1)!==":");return Boolean(t[2]||s)}Aa.exports=process.platform==="win32"?DE:jE;Aa.exports.posix=jE;Aa.exports.win32=DE});var Cf=b(lr=>{lr.setopts=t3;lr.ownProp=FE;lr.makeAbs=Zs;lr.finish=r3;lr.mark=i3;lr.isIgnored=HE;lr.childrenIgnored=s3;function FE(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Jj=require("fs"),Fi=require("path"),Xj=Oa(),$E=Ta(),kf=Xj.Minimatch;function Qj(r,e){return r.localeCompare(e,"en")}function Zj(r,e){r.ignore=e.ignore||[],Array.isArray(r.ignore)||(r.ignore=[r.ignore]),r.ignore.length&&(r.ignore=r.ignore.map(e3))}function e3(r){var e=null;if(r.slice(-3)==="/**"){var t=r.replace(/(\/\*\*)+$/,"");e=new kf(t,{dot:!0})}return{matcher:new kf(r,{dot:!0}),gmatcher:e}}function t3(r,e,t){if(t||(t={}),t.matchBase&&e.indexOf("/")===-1){if(t.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}r.silent=!!t.silent,r.pattern=e,r.strict=t.strict!==!1,r.realpath=!!t.realpath,r.realpathCache=t.realpathCache||Object.create(null),r.follow=!!t.follow,r.dot=!!t.dot,r.mark=!!t.mark,r.nodir=!!t.nodir,r.nodir&&(r.mark=!0),r.sync=!!t.sync,r.nounique=!!t.nounique,r.nonull=!!t.nonull,r.nosort=!!t.nosort,r.nocase=!!t.nocase,r.stat=!!t.stat,r.noprocess=!!t.noprocess,r.absolute=!!t.absolute,r.fs=t.fs||Jj,r.maxLength=t.maxLength||1/0,r.cache=t.cache||Object.create(null),r.statCache=t.statCache||Object.create(null),r.symlinks=t.symlinks||Object.create(null),Zj(r,t),r.changedCwd=!1;var i=process.cwd();FE(t,"cwd")?(r.cwd=Fi.resolve(t.cwd),r.changedCwd=r.cwd!==i):r.cwd=i,r.root=t.root||Fi.resolve(r.cwd,"/"),r.root=Fi.resolve(r.root),process.platform==="win32"&&(r.root=r.root.replace(/\\/g,"/")),r.cwdAbs=$E(r.cwd)?r.cwd:Zs(r,r.cwd),process.platform==="win32"&&(r.cwdAbs=r.cwdAbs.replace(/\\/g,"/")),r.nomount=!!t.nomount,t.nonegate=!0,t.nocomment=!0,r.minimatch=new kf(e,t),r.options=r.minimatch.options}function r3(r){for(var e=r.nounique,t=e?[]:Object.create(null),i=0,s=r.matches.length;i<s;i++){var n=r.matches[i];if(!n||Object.keys(n).length===0){if(r.nonull){var o=r.minimatch.globSet[i];e?t.push(o):t[o]=!0}}else{var a=Object.keys(n);e?t.push.apply(t,a):a.forEach(function(l){t[l]=!0})}}if(e||(t=Object.keys(t)),r.nosort||(t=t.sort(Qj)),r.mark){for(var i=0;i<t.length;i++)t[i]=r._mark(t[i]);r.nodir&&(t=t.filter(function(l){var u=!/\/$/.test(l),c=r.cache[l]||r.cache[Zs(r,l)];return u&&c&&(u=c!=="DIR"&&!Array.isArray(c)),u}))}r.ignore.length&&(t=t.filter(function(l){return!HE(r,l)})),r.found=t}function i3(r,e){var t=Zs(r,e),i=r.cache[t],s=e;if(i){var n=i==="DIR"||Array.isArray(i),o=e.slice(-1)==="/";if(n&&!o?s+="/":!n&&o&&(s=s.slice(0,-1)),s!==e){var a=Zs(r,s);r.statCache[a]=r.statCache[t],r.cache[a]=r.cache[t]}}return s}function Zs(r,e){var t=e;return e.charAt(0)==="/"?t=Fi.join(r.root,e):$E(e)||e===""?t=e:r.changedCwd?t=Fi.resolve(r.cwd,e):t=Fi.resolve(e),process.platform==="win32"&&(t=t.replace(/\\/g,"/")),t}function HE(r,e){return r.ignore.length?r.ignore.some(function(t){return t.matcher.match(e)||!!(t.gmatcher&&t.gmatcher.match(e))}):!1}function s3(r,e){return r.ignore.length?r.ignore.some(function(t){return!!(t.gmatcher&&t.gmatcher.match(e))}):!1}});var WE=b((bH,zE)=>{zE.exports=UE;UE.GlobSync=me;var n3=vf(),GE=Oa(),mH=GE.Minimatch,gH=Tf().Glob,yH=require("util"),Of=require("path"),BE=require("assert"),Ra=Ta(),Dr=Cf(),o3=Dr.setopts,Af=Dr.ownProp,a3=Dr.childrenIgnored,l3=Dr.isIgnored;function UE(r,e){if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
|
||
|
See: https://github.com/isaacs/node-glob/issues/167`);return new me(r,e).found}function me(r,e){if(!r)throw new Error("must provide pattern");if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
|
||
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof me))return new me(r,e);if(o3(this,r,e),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var i=0;i<t;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}me.prototype._finish=function(){if(BE(this instanceof me),this.realpath){var r=this;this.matches.forEach(function(e,t){var i=r.matches[t]=Object.create(null);for(var s in e)try{s=r._makeAbs(s);var n=n3.realpathSync(s,r.realpathCache);i[n]=!0}catch(o){if(o.syscall==="stat")i[r._makeAbs(s)]=!0;else throw o}})}Dr.finish(this)};me.prototype._process=function(r,e,t){BE(this instanceof me);for(var i=0;typeof r[i]=="string";)i++;var s;switch(i){case r.length:this._processSimple(r.join("/"),e);return;case 0:s=null;break;default:s=r.slice(0,i).join("/");break}var n=r.slice(i),o;s===null?o=".":((Ra(s)||Ra(r.join("/")))&&(!s||!Ra(s))&&(s="/"+s),o=s);var a=this._makeAbs(o);if(!a3(this,o)){var l=n[0]===GE.GLOBSTAR;l?this._processGlobStar(s,o,a,n,e,t):this._processReaddir(s,o,a,n,e,t)}};me.prototype._processReaddir=function(r,e,t,i,s,n){var o=this._readdir(t,n);if(!!o){for(var a=i[0],l=!!this.minimatch.negate,u=a._glob,c=this.dot||u.charAt(0)===".",f=[],h=0;h<o.length;h++){var d=o[h];if(d.charAt(0)!=="."||c){var p;l&&!r?p=!d.match(a):p=d.match(a),p&&f.push(d)}}var g=f.length;if(g!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[s]||(this.matches[s]=Object.create(null));for(var h=0;h<g;h++){var d=f[h];r&&(r.slice(-1)!=="/"?d=r+"/"+d:d=r+d),d.charAt(0)==="/"&&!this.nomount&&(d=Of.join(this.root,d)),this._emitMatch(s,d)}return}i.shift();for(var h=0;h<g;h++){var d=f[h],y;r?y=[r,d]:y=[d],this._process(y.concat(i),s,n)}}}};me.prototype._emitMatch=function(r,e){if(!l3(this,e)){var t=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=t),!this.matches[r][e]){if(this.nodir){var i=this.cache[t];if(i==="DIR"||Array.isArray(i))return}this.matches[r][e]=!0,this.stat&&this._stat(e)}}};me.prototype._readdirInGlobStar=function(r){if(this.follow)return this._readdir(r,!1);var e,t,i;try{t=this.fs.lstatSync(r)}catch(n){if(n.code==="ENOENT")return null}var s=t&&t.isSymbolicLink();return this.symlinks[r]=s,!s&&t&&!t.isDirectory()?this.cache[r]="FILE":e=this._readdir(r,!1),e};me.prototype._readdir=function(r,e){var t;if(e&&!Af(this.symlinks,r))return this._readdirInGlobStar(r);if(Af(this.cache,r)){var i=this.cache[r];if(!i||i==="FILE")return null;if(Array.isArray(i))return i}try{return this._readdirEntries(r,this.fs.readdirSync(r))}catch(s){return this._readdirError(r,s),null}};me.prototype._readdirEntries=function(r,e){if(!this.mark&&!this.stat)for(var t=0;t<e.length;t++){var i=e[t];r==="/"?i=r+i:i=r+"/"+i,this.cache[i]=!0}return this.cache[r]=e,e};me.prototype._readdirError=function(r,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var t=this._makeAbs(r);if(this.cache[t]="FILE",t===this.cwdAbs){var i=new Error(e.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=e.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=!1;break;default:if(this.cache[this._makeAbs(r)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};me.prototype._processGlobStar=function(r,e,t,i,s,n){var o=this._readdir(t,n);if(!!o){var a=i.slice(1),l=r?[r]:[],u=l.concat(a);this._process(u,s,!1);var c=o.length,f=this.symlinks[t];if(!(f&&n))for(var h=0;h<c;h++){var d=o[h];if(!(d.charAt(0)==="."&&!this.dot)){var p=l.concat(o[h],a);this._process(p,s,!0);var g=l.concat(o[h],i);this._process(g,s,!0)}}}};me.prototype._processSimple=function(r,e){var t=this._stat(r);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!t){if(r&&Ra(r)&&!this.nomount){var i=/[\/\\]$/.test(r);r.charAt(0)==="/"?r=Of.join(this.root,r):(r=Of.resolve(this.root,r),i&&(r+="/"))}process.platform==="win32"&&(r=r.replace(/\\/g,"/")),this._emitMatch(e,r)}};me.prototype._stat=function(r){var e=this._makeAbs(r),t=r.slice(-1)==="/";if(r.length>this.maxLength)return!1;if(!this.stat&&Af(this.cache,e)){var o=this.cache[e];if(Array.isArray(o)&&(o="DIR"),!
|
||
|
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")n.push({token:a.token+t.tokenPostfix,open:pr(t,a.open),close:pr(t,a.close)});else throw z(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=n,t.noThrow=!0,t}var mr=class{constructor(e,t,i){this.offset=e|0,this.type=t,this.language=i,this.kind=0,this.mods=0,this.value=null,this.stack=null}toString(){return this.value||""}get span(){return{offset:this.offset,length:this.value?this.value.length:0}}get indent(){return 0}get startOffset(){return this.offset}get endOffset(){return this.offset+(this.value?this.value.length:0)}clone(){let e=new mr(this.offset,this.type,this.language);return e.value=this.value,e.stack=this.stack,e}match(e){if(typeof e=="string")if(e.indexOf(" ")>0)e=e.split(" ");else{let t=this.type.indexOf(e);return e[0]=="."?t>=0:t==0}if(e instanceof Array)for(let t of e){let i=this.type.indexOf(t);if(t[0]=="."?i>=0:i==0)return!0}return e instanceof RegExp?e.test(this.type):!1}},mn=class{constructor(e,t){this.tokens=e,this.endState=t}};var xp=10;function Ji(r,e){return r.split(".")[e]}var dl=class{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new Ht(e,t);let i=Ht.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new Ht(e,t),this._entries[i]=s,s)}},zr=dl;zr._INSTANCE=new dl(xp);var Ht=class{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}get indent(){return this.state.lastIndexOf(" ")-this.state.indexOf(" ")}get scope(){return this.part(2)}get detail(){return this.part(2)}part(e){return this.state.split(".")[e]}equals(e){return Ht._equals(this,e)}push(e){return zr.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return zr.create(this.parent,e)}},pl=class{static create(e){return this._INSTANCE.create(e)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e){if(e!==null&&e.depth>=this._maxCacheDepth)return new Vr(e);let t=Ht.getStackElementId(e),i=this._entries[t];return i||(i=new Vr(e),this._entries[t]=i,i)}},Wr=pl;Wr._INSTANCE=new pl(xp);var Vr=class{constructor(e){this.stack=e}clone(){return Wr.create(this.stack)}equals(e){return!(!(e instanceof Vr)||!this.stack.equals(e.stack))}},fl=class{constructor(){this._tokens=[],this._language=null,this._lastToken=new mr(0,"start","imba"),this._lastTokenType=null}enterMode(e,t){this._language=t}emit(e,t,i){this._lastTokenType;let s=new mr(e,t,this._language);return this._lastTokenType=t,this._lastToken=s,this._tokens.push(s),s}finalize(e){return new mn(this._tokens,e)}},gn=class{constructor(e,t){this._modeId=e,this._lexer=t,this._profile=!1}dispose(){}getLoadStatus(){return{loaded:!0}}getInitialState(){let e=zr.create(null,this._lexer.start);return Wr.create(e)}tokenize(e,t,i){let s=new fl,n=this._tokenize(e,t,i,s);return s.finalize(n)}_tokenize(e,t,i,s){return this._myTokenize(e,t,i,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_rescope(e,t,i,s){let n=(e||"").split("-"),o=(t||"").split("-");if(e==t)return;let a=1;for(;n[a]&&n[a]==o[a];)a++;let l=n.length;for(;l>a;)i.push("pop."+n[--l]+"."+l);for(;o.length>a;){let u="push."+o[a++]+"."+(a-1);if(s){let c=Ji(s,1);u+="."+c}i.push(u)}}_myTokenize(e,t,i,s){s.enterMode(i,this._modeId);let n=e.length,o=t.stack,a=null,l=0,u=this._profile,c=null,f=!0,h=[],d=0,p=[],g=null,y=-1;for(;f||l<n;){if(d++,d>1e3){if(l==y)throw console.log("infinite recursion",l,n,o,s),"infinite recursion in tokenizer?";y=l,d=0}let m=l,v=o.depth,S=c?c.groups.length:0,w=o.state,_=null,A=null,O=null,C=null;if(
|
||
|
export default /* @__PURE__ */ Object.assign({
|
||
|
url: url, type: 'svg',toString: function(){ return this.url;}
|
||
|
},`+JSON.stringify(s)+")"}})}},Ul=class extends Ye{compile(e){var t=this;return t.memo(e.format,async function(){let i=await t.read(),s=Ep({body:i}),n=[],o=[];n.push('import {html} from "imba/src/imba/assets.imba"');for(let l=0,u=Gt(s.imports),c=u.length;l<c;l++){let f=u[l],h=f.path,d="";f.tagType=="img"?d="":f.tagType=="script"?d="web":f.tagType=="style"&&(d="css"),d&&h.indexOf("?")==-1&&(h=h+"?"+d),n.push("import ref"+l+" from '"+h+"';"),o.push("ref"+l)}let a=JSON.stringify(s.contents);return n.push("export const URLS = ["+o.join(",")+"];"),n.push("export default html("+a+",URLS);"),{js:n.join(`
|
||
|
`),html:s.contents}})}},ut=class extends Ye{compile(e){var t=this;return t.memo(e.format,async function(){let i=await Promise.resolve((0,ig.default)(t.abs)),s="import url from './"+t.name+`';
|
||
|
export default /* @__PURE__ */ {
|
||
|
url: url,
|
||
|
type: 'image',
|
||
|
width: `+(i.width||0)+`,
|
||
|
height: `+(i.height||0)+`,
|
||
|
toString: function(){ return this.url;}
|
||
|
}`;return{width:i.width,height:i.height,js:s}})}},Xn=class extends Ye{static[Wt](){return this.prototype[Bt]=Qm,this}constructor(){super(...arguments),this[Bt]===Qm&&this[Ut]&&this[Ut]()}load(){try{this.raw=this.readSync(),this.data=JSON.parse(this.raw)}catch{this.data={}}return this}save(){let e=JSON.stringify(this.data,null,2);return e!=this.raw&&(this.raw=e,this.writeSync(e)),this}};Xn[Wt]();var zt=class extends Xe{static[Wt](){return this.prototype[Bt]=Zm,this}constructor(e,t){super(),this.cwd=ct.default.resolve(e),this.program=t,this.nodemap={},this.existsCache={},this.changelog=new gr,this[He]=null,this[rs]=new Xr,this[mT]={},this[Bt]===Zm&&this[Ut]&&this[Ut]()}toString(){return this.cwd}valueOf(){return this.cwd}existsSync(e){let t=this.nodemap[e];return t?t.existsSync():this.existsCache[e]!=null?this.existsCache[e]:this.existsCache[e]=this.nodefs.existsSync(this.resolve(e))}lookup(e,t=Ye){var i;return e=this.relative(e),(i=this.nodemap)[e]||(i[e]=t.create(this,e,this.resolve(e)))}nodes(e){var t=this;return e.map(function(i){return t.lookup(i)})}get nodefs(){return this.program.volume||tg.default}get files(){return this[He]||this.prescan(),this[He]}get cache(){return this.program.cache}resolve(...e){return ct.default.resolve(this.cwd,...e)}relative(e){return ct.default.relative(this.cwd,this.resolve(e)).split(ct.default.sep).join(ct.default.posix.sep)}writeFile(e,t){return this.nodefs.promises.writeFile(this.resolve(e),t)}unlink(e,t){return this.nodefs.promises.unlink(this.resolve(e))}readFile(e,t="utf8"){return this.nodefs.promises.readFile(this.resolve(e),t)}stat(e){return this.nodefs.promises.stat(this.resolve(e)).then(function(t){return t}).catch(function(){return sg})}touchFile(e){return this.changelog.mark(e),this.lookup(e).touch(),this.emit("change")}addFile(e){return this.changelog.mark(e),this.lookup(e).register(),this.emit("change")}removeFile(e){return this.changelog.mark(e),this.lookup(e).deregister(),this.emit("change")}prescan(e=null){var t;if(this[He])return this[He];this[He]=e||this.crawl();for(let i=0,s=Gt(this[He]),n=s.length;i<n;i++){let o=s[i],a=o.lastIndexOf("."),l=a==-1?".*":o.slice(a);((t=this[He])[l]||(t[l]=[])).push(o)}return this[He]}reset(){return this[He]=null,this}glob(e=[],t=null,i=null){var s=this;this.prescan();let n=this[rs];if(i&&(n=this[rs].withExtension(i)),e instanceof RegExp&&!t)return n.filter(function(a){return e.test(a.rel)});if(typeof e=="string")if(e.indexOf("*")>=0)e=[e];else return new Xr(this.existsSync(e)?this.lookup(e):null);if(!e||e.length==0){if(!t)return n.slice(0);e=["*"]}let o=gT(n.paths,e,{ignore:t});return new Xr(...o.map(function(a){return s.nodemap[a]}))}find(e,t=null){this.prescan();let i=t?[]:this[He];if(typeof t=="string"&&(t=t.split(",")),t instanceof Array)for(let s=0,n=Gt(t),o=n.length;s<o;s++){let a=n[s];i=i.concat(this[He]["."+a]||[])}return i.filter(function(s){return e.test(s)})}scan(e){this.prescan();let t=[];for(let i=0,s=Gt(this[He]),n=s.length;i<n;i++){let o=s[i],a=!1;e instanceof RegExp&&(a=e.test(o),a&&t.push(this.lookup(o)))}return t}fromJSON(e,t){var i,s;let n=[];for(let o=0,a=Gt(this.res),l=a.length;o<l;o++){let u=a[o],c=u.dir,f=c.slice(this.slice),h=(i=this.nodemap)[f]||(i[f]=new is(this,f,c));for(let d=0,p=Gt(u.files),g=p.length;d<g;d++){let y=p[d],m=f+"/"+y,v=c+"/"+y;((s=this.nodemap)[m]||(s[m]=vr.create(this,m,v))).register(),n.push(m)}}return!0}crawl(e={}){var t,i,s;let n=this.cwd.length+1,o=function(l){return l[0]!="."},a=!0;if(this.nodefs.toJSON){let l=this.nodefs.toJSON(),u=[];for(let c=0,f=Object.keys(l),h=f.length,d,p;c<h;c++){d=f[c],p=l[d];let g=d.slice(n);((t=this.nodemap)[g]||(t[g]=vr.create(this,g,d))).register(),u.push(g)}return u}else{let u=new rg.fdir().crawlWithOptions(this.cwd,{includeBasePath:!a,group:a,includeDirs:!1,maxDepth:8,filters:[o],exclude:function(f,h,d){return d==7&&(e.includeRoots&&!e.includeRoots[f]||e.excludeRoots&&e.excludeRoots[f])?!0:/^(\.|node_modules)/.test(f)}}).sync();if(!a)return u.map(function(f){return f.slice(n)});let c=[];for(let f=0,h=Gt(u),d=h.length;f<d;f++){let p=h[f],g=p.dir,y=g.slice(n),
|
||
|
|
||
|
`)),!i)return!1;let n=await Promise.resolve().then(()=>$(cc())),{install:o}=await n.prompt({type:"confirm",name:"install",message:kr.default.reset("Do you want to install "+kr.default.green(s)+"?")});if(o){for(let a=0,l=Fc(t),u=l.length;a<u;a++){let c=l[a];await(await Promise.resolve().then(()=>(p1(),d1))).installPackage(c,{dev:!0})}return process.stderr.write(kr.default.yellow(`
|
||
|
Packages `+s+` installed, re-run the command to start.
|
||
|
`)),process.exit(yL),!0}return!1}function Gc(r){let e;return r?(e=r.toIterable)?e.call(r):r:[]}var Mt=Symbol.for("#__init__"),y1=Symbol.for("#__initor__"),b1=Symbol.for("#__inited__"),Bc=Symbol.for("#next"),bL=Symbol.for("#prev"),vL=Symbol.for("#listening"),Uc=Symbol.for("#hash"),v1=Symbol(),Vc=class{[Mt](e=null){var t;this.runner=e&&(t=e.runner)!==void 0?t:null,this.fork=e&&(t=e.fork)!==void 0?t:null,this.args=e&&(t=e.args)!==void 0?t:{},this.mode=e&&(t=e.mode)!==void 0?t:"cluster",this.name=e&&(t=e.name)!==void 0?t:"worker",this.restarts=e&&(t=e.restarts)!==void 0?t:0}get manifest(){return this.runner.manifest||{}}get bundle(){return this.runner.bundle}constructor(e,t){this[Mt](t),this.options=t,this.runner=e,this.atime=Date.now(),this.state="closed",this.log=new hr({prefix:["%bold%dim",this.name,": "]}),this.current=null,this.restarts=0}start(){var e=this;if(this.current&&this.current[Bc])return;let t=this.runner.o,i=this.bundle.result.main,s={windowsHide:!0,args:t.extras,exec:i,execArgv:[t.inspect&&"--inspect",(t.sourcemap||this.bundle.sourcemappedΦ)&&"--enable-source-maps"].filter(function(l){return l})},n={IMBA_RESTARTS:this.restarts,IMBA_SERVE:!0,IMBA_PATH:t.imbaPath,IMBA_OUTDIR:t.outdir,IMBA_WORKER_NR:this.options.number,IMBA_CLUSTER:!this.bundle.forkΦ,IMBA_LOGLEVEL:process.env.IMBA_LOGLEVEL||"warning",PORT:process.env.PORT||t.port,VITE:t.vite};for(let l=0,u=Object.keys(n),c=u.length,f,h;l<c;l++)f=u[l],h=n[f],h===!1&&(n[f]="");if(this.bundle.forkΦ&&!t.vite)return s.env=Object.assign({},process.env,n),this.fork=w1.default.fork(bt.default.resolve(i),s.args,s),this.fork.on("exit",function(l){return process.exit(l)}),this.fork;zc.default.setupMaster(s);let o=zc.default.fork(n);o.nr=this.restarts++;let a=o[bL]=this.current;return a&&(a[Bc]=o,a?.send?.(["emit","reloading"])),o.on("exit",function(l,u){if(u)return e.log.info("killed by signal: %d",u);if(l!=0)return e.log.error("exited with error code: %red",l);if(!o[Bc])return e.log.info("exited")}),o.on("listening",function(l){return t[vL]=l,t.vite||e.log.success("listening on %address",l),a?.send?.(["emit","reloaded"])}),o.on("error",function(){return e.log.info("%red","errorerd")}),o.on("message",async function(l,u){if(l.type=="fetch"){let c=await e.runner.fetchModule(l.id);o?.send?.(JSON.stringify({type:"fetched",id:l.id,md:c}))}else if(l.type=="resolve"){let c=l.payload.id,f=l.payload.importer,h=JSON.stringify({type:"resolved",output:await e.runner.resolveId(c,f),input:{id:c,importer:f}});o.send(h)}if(l=="exit"&&(console.log("exit"),process.exit()),l=="reload")return console.log("RELOAD MESSAGE"),e.reload()}),e.current=o}broadcast(e){return this.current?.send?.(e)}reload(){return this.start(),this}},wi=class extends Xe{static[Mt](){return this.prototype[y1]=v1,this}[Mt](e=null){var t;super[Mt]&&super[Mt](...arguments),this.viteNodeServer=e?e.viteNodeServer:void 0,this.viteServer=e?e.viteServer:void 0,this.fileToRun=e?e.fileToRun:void 0,this._rerunTimer=e?e._rerunTimer:void 0,this.restartsCount=e&&(t=e.restartsCount)!==void 0?t:0,this.watcherΞdebounce=e&&(t=e.watcherΞdebounce)!==void 0?t:100}constructor(e,t){super(),super[Mt]||this[Mt](),this.o=t,this.bundle=e,this.workers=new Set,this.fileToRun=bt.default.resolve(e.cwd,this.o.name),this[y1]===v1&&this[b1]&&this[b1]()}fetchModule(e){return this.viteNodeServer.fetchModule(e)}resolveId(e){return this.viteNodeServer.resolveId(e)}handleFileChanged(e){var t=this;if(e==this.fileToRun)return!0;let i=this.viteServer.moduleGraph.getModuleById(e);if(!i||this.o.skipReloadingFor&&Wc.default.isMatch(e,this.o.skipReloadingFor))return!1;let s=!1;return i.importers.forEach(function(n){if(!n.id)return;if(t.handleFileChanged(n.id))return s=!0}),s}scheduleΞreload(){var e=this;let t=this.restartsCount;if(clearTimeout(this._rerunTimer),this.restartsCount===t)return e._rerunTimer=setTimeout(function(){if(e.restartsCount===t)return e.reload()},e.watcherΞdebounce)}async initVite(){var e=this;let t=new RegExp(_1.builtinModules.join("|"),"gi"),i=await import("vite"),s=await import("vite-node/server"),n=bi(Zt,["vite.config.server.ts","
|
||
|
`,r:"\r",t:" ",f:"\f","\\":"\\","'":"'"},W_={n:`
|
||
|
`,r:"\r",t:" ",f:"\f","\\":"\\",'"':'"'};function GN(r,e,t,i,s,n){var o,a,l,u,c;return u=r.length,o=null,l=function(f,h){var d,p,g;for(g="",e++,o=r.charAt(e);e<u;){if(o===f)return e++,g;if(o==="\\")if(e++,o=r.charAt(e),o===f)g+=f;else if(d=h[o])g+=d;else if(ga(o)){for(p=o,e++,o=r.charAt(e);ga(o);)p+=o,e++,o=r.charAt(e);o===" "&&(e++,o=r.charAt(e)),g+=String.fromCharCode(parseInt(p,16));continue}else g+=o;else g+=o;e++,o=r.charAt(e)}return g},a=function(f){var h="";for(o=r.charAt(e);e<u;){if($N(o)||f&&f[o])h+=o;else if(o==="\\"){if(e++,e>=u)throw Error("Expected symbol but end of file reached.");if(o=r.charAt(e),Y_[o])h+=o;else if(ga(o)){var d=o;for(e++,o=r.charAt(e);ga(o);)d+=o,e++,o=r.charAt(e);o===" "&&(e++,o=r.charAt(e)),h+=String.fromCharCode(parseInt(d,16));continue}else h+=o}else return h;e++,o=r.charAt(e)}return h},c=function(){o=r.charAt(e);for(var f=!1;o===" "||o===" "||o===`
|
||
|
`||o==="\r"||o==="\f";)f=!0,e++,o=r.charAt(e);return f},this.parse=function(){var f=this.parseSelector();if(e<u)throw Error('Rule expected but "'+r.charAt(e)+'" found.');return f},this.parseSelector=function(){var f,h=f=this.parseSingleSelector();for(o=r.charAt(e);o===",";){if(e++,c(),f.type!=="selectors"&&(f={type:"selectors",selectors:[h]}),h=this.parseSingleSelector(),!h)throw Error('Rule expected after ",".');f.selectors.push(h)}return f},this.parseSingleSelector=function(){c();let f=r.slice(e,e+4).match(/^(\>{1,3}|\+|~)/);var h={type:"ruleSet"},d=f?Object.assign([],{type:"rule",isScope:!0}):this.parseRule();if(!d)return null;for(var p=h;d&&(d.type="rule",p==d||(p.rule=d,p=d),c(),o=r.charAt(e),!(e>=u||o===","||o===")"));)if(s[o]){var g=o;if(g==">"&&r.charAt(e+1)==">"&&r.charAt(e+2)==">"?(g=">>>",e=e+3):g==">"&&r.charAt(e+1)==">"?(g=">>",e=e+2):e++,c(),d=this.parseRule(null),!d)if(g==">"||g==">>>"||g==">>")d=Vh({tagName:"*"});else throw Error('Rule expected after "'+g+'".');d.nestingOperator=g}else d=this.parseRule(p),d&&(d.nestingOperator=null);return h},this.parseSubRule=function(f="is",h=!1,d=!1){let p={name:f,valueType:"selector",up:!0};if(h){let g=this.parseRule();g.type="rule",p.value={type:"ruleSet",rule:g},d&&(p.after=g.rule=Vh({tagName:"*",nestingOperator:null,type:"rule"}))}else{let g=this.parseSelector();p.value=g}return p},this.parseRule=function(f){for(var h=null,d=!1,p=!1,g=!1,y=!1,m={},v=0;e<u;){if(o=r.charAt(e),m={},o=="!"&&(g=!0,o=r.charAt(++e),h=h||f,m.not=!0),o=="@"&&r.charAt(e+1)==".")h=h||f,m.implicitScope=!0,e++,o=".";else if(o=="@"&&r.charAt(e+1)=="@")m.closest=!0,h=h||f,e++;else if(o=="."&&r.charAt(e+1)=="."){y=m,h=h||f,e++;let T=r.charAt(e+1);(T=="%"||T=="$"||T=="@")&&(o=T,e++)}for(;o=="^";)o=r.charAt(++e),h=h||f,v++;if(m.up=v,m.closest=y,o==="&")e++,(h=h||[]).isScope=!0;else if(o==="^"){e++;let T=this.parseSubRule("is",!0,!0);(h=h||f||[]).push(T)}else if(o==="*")e++,(h=h||[]).tagName="*";else if(FN(o)||o==="\\")(h=h||[]).tagName=a();else if(o==="$")e++,m.flag="$"+a(),m.ref=!0,(h=h||[]).push(m);else if(o==="%")e++,m.flag=o+a(),(h=h||[]).push(m);else if(o==="."){e++;let T=r.charAt(e++);T+=a({}),m.flag=T,(h=h||[]).push(m)}else if(o==="#")e++,(h=h||[]).id=a();else if(o==="["){e++,c();var S=m.attr={name:a()};if(c(),o==="]")e++;else{var w="";if(i[o]&&(w=o,e++,o=r.charAt(e)),e>=u)throw Error('Expected "=" but end of file reached.');if(o!=="=")throw Error('Expected "=" but "'+o+'" found.');S.operator=w+"=",e++,c();var _="";if(S.valueType="string",o==='"')_=l('"',W_);else if(o==="'")_=l("'",z_);else if(n&&o==="$")e++,_=a(),S.valueType="substitute";else{for(;e<u&&o!=="]";)_+=o,e++,o=r.charAt(e);_=_.trim()}if(c(),e>=u)throw Error('Expected "]" but end of file reached.');if(o!=="]")throw Error('Expected "]" but "'+o+'" found.');e++,S.value=_}(h=h||[]).push(m)}else if(o===":"||o==="@"){if(o==":"&&r.charAt(e+1)==":"){(h=h||f||[]).pseudoElement=a({":":!0});continue}e++,m.name=o;var A=m,O=a({"~":!0,"+":!0,".":!1,">":!0,"<":!0});if(O=="unimportant"){d=!0,m.type="unimportant",(h=h||f||[]).push(m);continue}if(m.name+=O,m.pseudo=O,o==="("){e++;var C="";if(c(),t[O]==="selector")A.valueType="selector",C=this.parseSelector();else{if(A.valueType=t[O]||"string",o==='"')C=l('"',W_);else if(o==="'")C=l("'",z_);else if(n&&o==="$")e++,C=a(),A.valueType="substitute";else{for(;e<u&&o!==")";)C+=o,e++,o=r.charAt(e);C=C.trim()}c()}if(e>=u)throw Error('Expected ")" but end of file reached.');if(o!==")")throw Error('Expected ")" but "'+o+'" found.');e++,A.value=C}(h=h||f||[]).push(m)}else break}return h},this}Ee.prototype.parse=function(r){var e=new GN(r,0,this.pseudos,this.attrEqualityMods,this.ruleNestingOperators,this.substitutesEnabled);return e.parse()};Ee.prototype.escapeIdentifier=function(r){for(var e="",t=0,i=r.length;t<i;){var s=r.charAt(t);if(Y_[s])e+="\\"+s;else if(s==="_"||s==="-"||s>="A"&&s<="Z"||s>="a"&&s<="z"||t!==0&&s>="0"&&s<="9")e+=s;else{var n=s.charCodeAt(0);if((n&63488)===55296){var o=r.charCodeAt(t++);if((n&64512)!==55296||(o&64512)!==56320)throw Error("UCS-2(decode): illegal sequence");n=((n&1023)<<10)+
|
||
|
`+t.banner:"")},footer:{js:t.footer||"//__FOOT__"},splitting:t.splitting,sourcemap:this.program.sourcemap===!1?!1:(this.webΦ,!0),minifySyntax:!0,minifyWhitespace:this.minifyΦ&&t.format!="html",minifyIdentifiers:this.minifyΦ&&t.format!="html",incremental:!!this.watcher,legalComments:"inline",loader:Object.assign({},lg,t.loader||{}),write:!1,charset:"utf8",metafile:!0,external:c,tsconfig:t.tsconfig,nodePaths:(t.nodePaths||[]).slice(0),plugins:(t.plugins||[]).concat({name:"imba",setup:this.plugin.bind(this)}),pure:["Symbol.for","Symbol"],treeShaking:t.treeShaking||!0,supported:{"for-await":!0},resolveExtensions:[".imba",".imba1",".ts",".mjs",".cjs",".js",".svg"]},this.esoptions.entryPoints?.sort?.(),this.esoptions.sourcemap&&!this.devΦ&&(this.esoptions.sourcesContent=!1),this.mainΦ&&!this.webΦ&&(this.esoptions.entryNames="[dir]/[name]"),this.mainΦ&&(this.esoptions.external=[]),this.webΦ&&t.ref&&!this.workerΦ&&(this.esoptions.entryNames=""+this.assetsDir+"/[name].[hash]"),t.ref&&t.format!="html"&&t.ref!="web"&&(this.esoptions.outbase=this.fs.cwd),t.esbuild&&mg(this.esoptions,t.esbuild,"esbuild"),this.imbaoptions={platform:t.platform,css:"external",hmr:this.program.hmr||!1,mode:this.program.mode},t.sourcesContent!==void 0&&(this.esoptions.sourcesContent=t.sourcesContent),t.platform=="worker"&&(this.imbaoptions.platform="node"),t.target&&(this.esoptions.target=t.target),this.nodeishΦ&&this.runΦ&&t.target){let d=process.version.replace(/^v(?=\d)/,"node");this.esoptions.target=[d]}t.format=="css"&&(this.esoptions.format="esm"),this.htmlΦ&&(this.esoptions.format="esm",this.esoptions.minify=!1,this.esoptions.sourcemap=!1,this.esoptions.entryNames="[dir]/[name]",this.esoptions.loader[".json"]="file"),this.workerΦ?this.esoptions.outExtension={".js":".worker.js"}:this.iifeΦ?this.esoptions.outExtension={".js":".iife.js"}:this.esoptions.format=="esm"&&this.nodeishΦ&&(this.esoptions.outExtension={".js":".mjs"}),(i={webworker:[".webworker.imba",".worker.imba"],serviceworker:[".serviceworker.imba",".webworker.imba",".worker.imba"],nodeworker:[".nodeworker.imba",".worker.imba",".node.imba"],worker:[".imba.web-pkg.js",".worker.imba"],node:[".node.imba"],browser:[".web.imba"],web:[".web.imba"]}[t.platform||this.esoptions.platform])&&this.esoptions.resolveExtensions.unshift(...i);let h=(s=this.esoptions).define||(s.define={});if(h[n="globalThis.DEBUG_IMBA"]||(h[n]=!this.productionΦ),!this.nodeishΦ){let d=t.env||(this.productionΦ?"production":"development");h.global="globalThis",h["process.platform"]="'web'",h["process.browser"]="true",this.esoptions.inject=[X.default.resolve(this.program.imbaPath,"polyfills","buffer","index.js"),X.default.resolve(this.program.imbaPath,"polyfills","__inject__.js")],this.esoptions.inject=[],this.esoptions.nodePaths.push(X.default.resolve(this.program.imbaPath,"polyfills"))}if(h[o="globalThis.IMBA_HMR"]||(h[o]=String(this.hmrΦ)),h[a="globalThis.IMBA_DEV"]||(h[a]=String(this.hmrΦ)),h[l="globalThis.IMBA_RUN"]||(h[l]=String(this.runΦ)),this.nodeishΦ&&this.mainΦ&&this.esmΦ&&(this.esoptions.banner.js+=`
|
||
|
import { createRequire as $require$ } from "module"; let require = $require$(import.meta.url);`),this.program.dotvars){this.webishΦ;for(let d=this.program.dotvars,p=0,g=Object.keys(d),y=g.length,m,v;p<y;p++)m=g[p],v=d[m],h["process.env."+m]=JSON.stringify(v);this.webishΦ&&(h["process.env"]="{}")}t.bundle==!1&&(this.esoptions.bundle=!1,u=this.esoptions.external,delete this.esoptions.external),t.splitting&&this.esoptions.format!="esm"&&this.log.error("code-splitting not allowed when format is not esm"),this.mainΦ&&(this.log.ts("created main bundle"),this.manifest={}),this[hS]===SS&&this[fS]&&this[fS]()}addEntrypoint(e){return this.entryPoints.indexOf(e)<0&&this.entryPoints.push(e),this.entryPoints.sort(),this}setup(){return this}watchPath(e){return this[Pi][e]||(this[Pi][e]=1,this.parent?this.parent.watchPath(e):this.watcher&&e.indexOf(":")==-1&&this.watcher.add(e.slice(0,e.lastIndexOf("/")))),this}resolveConfigPreset(e=[]){let t=e.join("&"),i=Symbol.for(t),s=this.imbaconfig;if(s[i])return s[i];let n={presets:[],ref:t},o=this.imbaconfig.options;for(let a=0,l=ce(e),u=l.length;a<u;a++){let c=l[a],f=o[c]||{};n.presets.push(f);let h=f,d=[f];for(;h.extends&&d.length<10;)d.unshift(h=o[h.extends]);for(let p=0,g=ce(d),y=g.length;p<y;p++){let m=g[p];Object.assign(n,m)}}return s[i]=n}resolveTemplate(e){let t=X.default.resolve(this.program.imbaPath,"src","templates",e);return Te.default.existsSync(t)?t:null}plugin(e){var t=this;let i=this.externals||[],s=this.program.imbaPath,n=function(l){return/\.imba$/.test(l)&&l.indexOf("styles:")!=0},o=function(l){let u=JSON.stringify(l);return`import {asset} from 'imba/src/imba/assets.imba';
|
||
|
export default asset(`+u+")"},a=async function(l){return await e.resolve(l.path,{resolveDir:l.resolveDir,namespace:""})};if(this.o.resolve){let l=new RegExp("^("+Object.keys(this.o.resolve).join("|")+")$");e.onResolve({filter:l},function(u){let c=t.o.resolve[u.path];return c=c&&c[t.platform]||c,c})}return t.mainΦ&&t.serveΦ&&e.onResolve({namespace:"file",filter:/.*/},async function(l){if(l.kind=="entry-point"){let u=l.path.split(".").pop(),c=t.resolveTemplate("serve-"+u+".imba")||t.resolveTemplate("serve-web.imba"),f=await e.resolve(l.path,{resolveDir:l.resolveDir});return{path:c,namespace:"file",pluginData:{__ENTRYPOINT__:f.path,resolveDir:l.resolveDir}}}if(l.path=="__ENTRYPOINT__"){let u=await e.resolve(t.entryPoints[0],{resolveDir:t.fs.cwd});return{path:l.pluginData?.__ENTRYPOINT__||u.path,pluginData:{path:l.path,asset:!0,kind:l.kind}}}}),t.mainΦ&&e.onResolve({filter:/\.html$/,namespace:"file"},async function(l){if(l.kind=="entry-point")return{path:(await a(l)).path,namespace:"file",pluginData:{path:l.path,kind:l.kind,serve:!t.buildΦ}};if(l.kind=="import-statement")return{path:(await a(l)).path,pluginData:{asset:!0,path:l.path,kind:l.kind}}}),e.onResolve({filter:/^\*\?css$/},function(l){return t.root.hasGlobStylesheet=!0,{path:"*?css",namespace:"css"}}),e.onResolve({filter:/\?(as=)?([\w\-\,\.\&]+)$/},async function(l){let u;if(l.namespace=="")return;if(t.o.format=="css")return{path:"_",namespace:"imba-raw"};let[c,f]=l.path.split("?"),h=f.replace(/^as=/,"").split(/[&\-]/g);if(f.match(/^(url|dataurl|binary|raw|text|base64|file|copy|img|svg|styles|bundle|external)/))return;let d;if(c=="__ENTRYPOINT__"?d={path:t.fs.resolve(t.entryPoints[0]),suffix:"?"+f}:d=await a(l),(u=og[f])&&(u=u[t.webishΦ?"web":"node"],u&&!l.pluginData))return{namespace:"wrap",suffix:d.suffix,path:d.path,pluginData:u};if(!d)return;let p=t.resolveConfigPreset(h),g=t.fs.relative(d.path);return{path:g+d.suffix,namespace:"entry",pluginData:{config:p,path:g}}}),e.onResolve({filter:/^imba(\/|$)/},function(l){if(t.peerDependencies.indexOf("imba")>=0)return null;if(l.path=="imba")return t.o.format=="css"?{path:l.path,external:!0}:{path:X.default.resolve(s,"index.imba"),namespace:"file"};let u=l.path.slice(l.path.indexOf("/")+1),c=X.default.resolve(s,u),f=["",".imba"];(u=="program"||u=="compiler")&&f.unshift(".imba.js");for(let h=0,d=ce(f),p=d.length;h<p;h++){let g=d[h];if(Te.default.existsSync(c+g))return{path:c+g}}return null}),e.onResolve({filter:/^_styles_$/},function({importer:l}){return{path:l,suffix:"?styles",namespace:"file"}}),e.onResolve({namespace:"file",filter:/.*/},async function(l){if(l.pluginData=="skip"||l.path.indexOf("data:")==0)return null;let u=l.path,c=/^(\/|\w\:\/)/.test(u),f=u[0]==".",h=!c&&!f,d=h&&u.match(/^(@[\w\.\-]+\/)?\w[\w\.\-]*/)[0]||null,p=u.split("?")[1]||"",g=i.indexOf(u)>=0||h&&i.indexOf(d)>=0||p=="external",y=p?u.split("?")[0]:u;if(p=="style")return null;if(u.indexOf("node:")==0)return{external:!0};if(ag.indexOf(u)>=0&&!t.webΦ)return{external:!0,path:u};if(p=="bundle"){let v={importer:l.importer,resolveDir:l.resolveDir,namespace:"",kind:t.esmΦ?"import-statement":"require-call",pluginData:"skip"};return{path:(await e.resolve(y,v)).path}}if(p=="external"&&(!t.nodeishΦ||!t.runΦ))return{path:y,external:!0};if(h&&t.nodeishΦ&&t.runΦ&&!t.standaloneΦ){if(i.indexOf("!"+u)>=0&&p!="external")return null;let v=!1,S={importer:l.importer,resolveDir:l.resolveDir,namespace:"",kind:t.esmΦ?"import-statement":"require-call",pluginData:"skip"},w=await e.resolve(l.path,S);if(w.path){let _=w.path.split("node_modules")[0];X.default.relative(_,t.outdir).indexOf("../")!=0&&(v=!0)}if(g&&v)return{external:!0,path:y};if(g)return{external:!0,path:w.path}}if(g)return t.program.bundle?null:{external:!0};let m=/(\.(svg|png|jpe?g|gif|tiff|webp))$/.test(u);if(c)return l.kind=="url-token"?{external:!0}:null;if(p=="img")return{path:(await a(l)).path};if(n(l.importer)&&m&&l.kind!="url-token"){let v=await a(l);if(v?.path)return{path:v.path,suffix:"?js"}}if(u.match(/\.json(\?copy)?$/)){let v=await a(l);if(l.importer?.match?.(/\.html$/))return{path:v.p
|
||
|
import './`+h.name+"?styles';":"";return y=g?`
|
||
|
import '_styles_';`:"",p[t]||(p[t]={loader:"js",contents:Vs.strip(p.js||"")+y,errors:(p.errors||[]).map(function(v){return Yl(v,{file:h.abs,namespace:u})}),warnings:(p.warnings||[]).map(function(v){return Yl(v,{file:h.abs,namespace:u})}),resolveDir:h.absdir,pluginData:c})})}build(e=!1){var t=this,i;return(i=t.buildcache)[t]||(i[t]=new Promise(async function(s){if((t.built!=!0?(t.built=!0,!0):!1)||e){t.mainΦ&&t.log.info("starting to build in %path",t.program.outdir),t.workers=await W1(),t.log.debug("build "+t.entryPoints.join(",")+" "+t.o.format+"|"+t.o.platform+" "+t.nr);try{t.builder=new _a({previous:t.builder}),t.result=await ES.build(t.esoptions),t.firstBuild=t.result,t.lastResult=t.result}catch(n){t.result=n}await t.transform(t.result),t.mainΦ&&await t.write(t.result),t.watcher||(t.workers.stop(),t.workers=null),t.watcher&&t.mainΦ&&(t[bS]!=!0?(t[bS]=!0,!0):!1)&&(t.watcher.start(),t.watcher.on("touch",function(n){return t.log.debug("watcher touch",n),clearTimeout(t[ef]),t[ef]=setTimeout(function(){return clearTimeout(t[ef]),t.log.debug("try rebuild",!!t.buildcache[t],t.o.watch),t.rebuild()},100)}))}return t[Ys]={},s(t.result)}))}rebuild({force:e=!1}={}){var t=this,i;return this.built&&this.result&&this.result.rebuild instanceof Function?(i=t.buildcache)[t]||(i[t]=new Promise(async function(s){if(t.mainΦ&&t.log.debug("starting rebuild!",!!t.watcher,e),t.watcher&&!e){let a=t.watcher.sync(t),l=!1;for(let u=0,c=ce(a),f=c.length;u<f;u++){let[h,d]=c[u];(t[Pi][h]||d!=1)&&(l=!0)}if(t.mainΦ&&l&&t.log.debug("changes demanding a resolve?",a),!l)return t[Ys]={},s(t.result)}let n=t.lastResult,o=!1;try{t.builder=new _a({previous:t.builder});let a=await t.firstBuild.rebuild();t.result=a,t.lastResult=t.result}catch(a){t.log.debug("error when rebuilding",a),o=!0,t.result=a}return await t.transform(t.result,n),t.mainΦ&&await t.write(t.result,n),t[Ys]={},s(t.result)})):this.build(!0)}collectStyleInputs(e,t,i=[],s=[]){if(e instanceof Array){for(let n=0,o=ce(e),a=o.length;n<a;n++){let l=o[n];this.collectStyleInputs(l,t,i,s)}return i}if(s.indexOf(e)>=0)return i;s.push(e),e.path.match(/(^styles:)|(\.css$)|(\?styles?$)/)&&i.indexOf(e)==-1&&(i.find(function(n){return n.path==e.path})||i.push(e));for(let n=0,o=ce(e.imports),a=o.length;n<a;n++){let l=o[n];l.path.match(/\?css$/)||this.collectStyleInputs(l,t,i,s)}return e.asset&&t&&this.collectStyleInputs(e.asset.source,t,i,s),i}transformCompiledHTML(e,t,i,s){let n={},o={},a=s;t.replace(/(\w+_default\d*) = \"(.*)\"/g,function(u,c,f){let h;return(h=a[f])?n[c]=h.url||h.path:n[c]=o[f]||f});let l=t.match(/URLS = \[(.*)\]/)[1].split(/\,\s*/g).map(function(u){return n[u]});return i&&i.html?i.html.replace(/ASSET_REF_(\d+)/g,function(c,f){return l[parseInt(f)]}):t}async transform(e,t){var i=this;let s=Date.now();if(e instanceof Error){for(let h=0,d=ce(e.errors),p=d.length;h<p;h++){let g=d[h];this.watchPath(g.location.file)}return e.rebuild=t&&t.rebuild.bind(t),e.meta={inputs:{},outputs:{},urls:{},errors:e.errors,warnings:e.warnings},e}let n=e.outputFiles||[],o=e.metafile;if(o=e.meta={ref:this.o.ref,format:this.o.format,platform:this.o.platform,inputs:o.inputs,outputs:o.outputs,errors:[].concat(e.errors||[]),warnings:[].concat(e.warnings||[]),entries:{},urls:{}},process.env.DEBUG){let h=X.default.resolve(this.fs.cwd,"dist");o.entryPoints=this.esoptions.entryPoints;let d={entryPoints:o.entryPoints,files:n.map(function(p){return[p.path,i.fs.relative(p.path)]}),outputs:Object.keys(o.outputs),inputs:Object.keys(o.inputs),full:o};try{Te.default.mkdirSync(h)}catch{}Te.default.writeFileSync(X.default.resolve(h,"manifest."+i.nr+".json"),JSON.stringify(d,null,4))}let a=o.inputs,l=o.outputs;for(let h=0,d=ce(n),p=d.length;h<p;h++){let g=d[h],y=i.fs.relative(g.path);l[y]?(l[y].fullpath=g.path,l[y][Lr]=g,l[y][qr]=g.contents,l[y],g[YN]=l[y]):console.log("could not map the file to anything!!",g.path,y,Object.keys(l),i.fs.cwd,i.esoptions.outdir)}for(let h=o.outputs,d=0,p=Object.keys(h),g=p.length,y,m;d<g;d++)if(y=p[d],m=h[y],i.root.builder.outputs.add(m),l[y+".map"]&&(m.map=l[y+".map"]),m.entryPoint){let v=m.entry
|
||
|
`);for(let P=0,M=ce(k),D=M.length;P<D;P++){let B=M[P];w.raw.push([E.slice(0)])}S+=F+`
|
||
|
`}}let _=ei(S),A="index."+_+".css",O=X.default.resolve(this.fs.cwd,this.esoptions.outdir,this.assetsDir||".",A);w.file=A,this.esoptions.sourcemap&&(S+=`
|
||
|
/*# sourceMappingURL=./`+A+".map */");let C={[tf]:"output",_:"output",type:"css",public:!0,path:O,hash:_,fullpath:O,virtual:!1,url:this.urlForOutputPath(O),entryId:"*?css",imports:[],[qr]:S};C.asset=C,this.builder.entries["*?css"]=C,l["*?css"]=C,d.push(C),this.esoptions.sourcemap&&(w.mappings=CS.encode(w.raw),i=w.raw,delete w.raw,d.push({path:C.path+".map",fullpath:C.fullpath+".map",hash:_,public:!0,[qr]:JSON.stringify(w,null,2)}))}}for(let m=0,v=ce(d),S=v.length;m<S;m++){let w=v[m];if(w.public&&this.pubdir&&w.resolved!=!0&&(w.resolved=!0,!0)){let _=X.default.resolve(this.fs.cwd,w.path),A=X.default.relative(this.esoptions.outdir,_),O=X.default.resolve(this.esoptions.outdir,this.pubdir,A);w.fullpath=O,w.path=X.default.relative(this.fs.cwd,O)}}for(let m=0,v=ce(d),S=v.length;m<S;m++){let w=v[m];!w.entryId||(f[w.entryId]={url:w.url,path:w.fullpath})}for(let m=0,v=ce(d),S=v.length;m<S;m++){let w=v[m];if(!(w.url&&w.imports)||w.type=="map")continue;let _=f[w.url]={},A=w.imports.map(function(O){return O.url});A.length&&(_.imports=A)}this.log.ts("resolved public paths");for(let m=0,v=ce(d),S=v.length,w;m<S;m++){let _=v[m];if(_.type=="html"){let O=(_.entryPoint||"").replace(/^\w+\:/,"");if(w=this.builder.meta[O]){let C=this.transformCompiledHTML(_,_[Lr].text,w,f);_[rf]=_[qr]=C}}if(_.type=="js"||_.type=="mjs"){let A=_[rf]||_[Lr].text,O="";if(_.hash||_.hash||(_.hash=ei(A)),!_.public){let R=["globalThis.IMBA_MANIFEST="+JSON.stringify(f),"globalThis.IMBA_ASSETS_PATH='"+this.assetsDir+"'"];o&&this.program.tmpdir&&R.push("globalThis.IMBA_STATICDIR='"+o+"'"),O=R.join(";")}_.public&&this.hmrΦ&&(O="(globalThis.IMBA_LOADED || (globalThis.IMBA_LOADED={}))['"+_.url+"']=true;"),O&&(A=A.replace("//__HEAD__",O));let C=/\/([\/\*])# sourceMappingURL=([\/\w\.\-\%]+\.map)/g,T=X.default.basename(_.path);A=A.replace(C,function(R,x,j){return"/"+x+"# sourceMappingURL=./"+T+".map"}),_[rf]=_[qr]=A}}this.log.ts("injected head in assets");for(let m=0,v=ce(d),S=v.length;m<S;m++){let w=v[m];if(w.type=="map"&&w.public&&w[Lr]){let _=w[Lr].text,A=w[Lr].path,O=sf.default.pathToFileURL(X.default.dirname(A));_='{"sourceRoot": "'+O+'",'+_.slice(1),w[qr]=_}}this.log.ts("rewrote sourcemaps"),h.path="manifest.json",f.main=this.outfs.relative(p.fullpath),e.main=p.fullpath,e.hash=p.hash,this.log.ts("ready to write");let g=this.outfs.lookup("manifest.json");for(let m=0,v=ce(d),S=v.length;m<S;m++){let w=v[m];h.outputs[w.path]=w}let y=ei(d.map(function(m){return m.hash}).sort().join("-"));if(this[xS]!=y&&(this[xS]=y,!0)){if(!this.builtΦ&&!this.program.keep&&!this.program.tmpdir&&n&&this.cleanOutDir(),!this.builtΦ&&this.program.tmpdir&&this.nodeΦ&&this.program.nodeModulesPath)try{Te.default.symlinkSync(this.program.nodeModulesPath,X.default.resolve(this.program.tmpdir,"node_modules"),"dir")}catch(m){console.log("error here",m)}for(let m=0,v=ce(d),S=v.length;m<S;m++){let w=v[m],_=w.path;if(this.buildΦ&&this.staticΦ&&!w.public||w.virtual)continue;await this.outfs.lookup(w.fullpath).write(w[qr],w.hash)}o&&!this.program.tmpdir&&await this.copyPublicFiles(),await g.write(JSON.stringify(f,null,2),h.hash),this.program[_S]?this.log.info("built %bold in %ms - %heap (%address)",this.entryPoints[0],this.builder.elapsed,this.program[_S]):this.log.info("built %bold in %ms - %heap",this.entryPoints[0],this.builder.elapsed),this.builtΦ=!0,this.emit("built",e)}return e}};Je[Nt]();var of=$(require("path")),AS=$(require("fs")),TS=require("crypto");function JN(r){let e;return r?(e=r.toIterable)?e.call(r):r:[]}var XN=Symbol.for("#key"),nf={},OS={},Ks=class{constructor(e){this[XN]=Symbol(),this.o=e,this.dir=this.o.cachedir,this.nodefs=e.volume||AS.default,this.aliaspath=this.dir&&of.default.resolve(this.dir,".imba-aliases"),this.aliasmap=[],this.aliascache={},this.data={aliases:{},cache:{}},this.mintime=this.o.mtime||0,this.persistToDisk=!!this.dir,this.idFaucet=gg(),this.preload()}preload(){if(!this.persistToDisk)return;this.nodefs.existsSync(this.dir)||this.nodefs.mkdirSync(this.dir);let e=this.nodefs.readdirSync(this.dir);for(let t=0,i=JN(e),s=i.length;t<s;t++){let n=i[t];this.cache[n
|
||
|
`,"utf8"),this.refreshAliasMap()):this.aliasmap.push(e),t=this.aliasmap.indexOf(e)),t>=0)return this.aliascache[e]=this.idFaucet(t);throw console.log("key not added?",e,this.aliasmap),"could not add key to aliasmap"}async getKeyValue(e){let t=this.fullKeyPath(e),i=await this.nodefs.promises.readFile(t,"utf8");return JSON.parse(i)}setKeyValue(e,t){if(!this.persistToDisk)return;let i=this.fullKeyPath(e),s=JSON.stringify(t);return this.nodefs.promises.writeFile(i,s)}memo(e,t,i){var s=this;let n=this.normalizeKey(e);this.mintime>t&&(t=this.mintime);let o=this.cache[n];return o&&o.time>=t||(this.getKeyTime(n)>t?o=this.cache[n]={time:Date.now(),promise:this.getKeyValue(n)}:(o=this.cache[n]={time:Date.now(),promise:i()},o.promise.then(function(l){return s.setKeyValue(n,l)}))),o.promise}};var Rk=require("child_process");var Ik=$(lE()),Mk=$(hE()),Jf=$(Ck()),Xf=$(Ak());function U3(r){let e;return r?(e=r.toIterable)?e.call(r):r:[]}var Tk=Symbol.for("#parsed"),z3=Symbol.for("#IMBA_OPTIONS"),ja={int:function(r){return parseInt(r)},i:function(r){return r=="max"?0:parseInt(r)},v:function(r,e){return e+1}},W3=Jl(nt.default.resolve(__dirname,".."))||{},Pk={},ur=process.argv.slice(0),V3={M:{minify:!1},m:{minify:!0},S:{sourcemap:!1},s:{sourcemap:!0}},Y3={true:!0,false:!1,null:null,undefined:void 0};for(let r=0,e=U3(ur),t=e.length;r<t;r++){let i=e[r];if(!!i&&i.match(/^\-\-(\w+)(\.\w+)+$/)){let s=ur[r+1],n=i.slice(2).split("."),o=Pk;for(ur[r]=null;n[1];)o=o[n[0]]||(o[n[0]]={}),n.shift();let a=V3[n[0]];a?Object.assign(o,a):(s.indexOf(" ")>=0&&(s=s.split(/\,\s*|\s+/g)),s=Y3[s]||s,o[n[0]]=s,ur[r]=null,ur[r+1]=null)}}ur=ur.filter(function(r){return r!==null});function Lk(r,e=[]){if(r[Tk])return r;let t=r._name;r.opts instanceof Function&&(r=r.opts());let i=r.cwd||(r.cwd=process.cwd());if(r.imbaPath||(r.imbaPath=nt.default.resolve(__dirname,"..")),r.command=t,r.extras=e,r.config=pg(i,r.config||"imbaconfig.json"),r.package=Jl(i)||{},r.dotenv=Kl(".env",i),r.nodeModulesPath=eo("node_modules",i),r.dotenv&&(r.dotvars=Mk.parse(r.dotenv.body)),r.esm&&(r.as==null?r.as="esm":r.as),r.verbose>1?r.loglevel||(r.loglevel="debug"):r.verbose&&(r.loglevel||(r.loglevel="info")),r.development&&(r.minify==null?r.minify=!1:r.minify,r.sourcemap==null?r.sourcemap=!0:r.sourcemap,r.watch==null?r.watch=!0:r.watch,r.hmr=!0,r.mode="development"),r.production&&(r.minify==null?r.minify=!0:r.minify,r.sourcemap==null?r.sourcemap=!1:r.sourcemap,r.hmr=!1,r.mode="production"),t=="build"&&(r.minify==null?r.minify=!0:r.minify,r.mode==null?r.mode="production":r.mode,r.sourcemap==null?r.sourcemap=!1:r.sourcemap,r.loglevel||(r.loglevel="info"),r.outdir||(r.outdir="dist")),r.web&&t!="build"&&(t=r.command="serve"),r.web&&t!="serve"&&(r.as==null?r.as="web":r.as),t=="serve"&&(r.watch=!0,r.hmr=!0),r.watch&&(r.loglevel||(r.loglevel="info"),r.mode=="development"&&(r.hmr=!0)),r.force)r.mtime=Date.now();else{let s=[__filename,nt.default.resolve(__dirname,"..","workers.imba.js"),nt.default.resolve(__dirname,"..","dist","compiler.cjs")];r.mtime=Math.max(...s.map(function(n){return st.default.statSync(n).mtimeMs}))}return r.loglevel||(r.loglevel="warning"),r.cachedir=dg(r),globalThis[z3]=r,r[Tk]=!0,r}function K3(r){r=Lk(r);let e="vite.config.server.js";if(st.default.existsSync(e)&&!r.force)return console.log("You already have a vite.config.server in your project. Delete it or use `imba eject --force` to overwrite");let t=st.default.readFileSync(Zt,"utf-8");st.default.writeFileSync(e,t.replace(/\/\/eject\s/g,"")),console.log("✅ vite.config.server.mjs has been successfully "+(r.force?"overwritten":"created"));let i="test-setup.js";if(st.default.existsSync(i)&&!r.force)return console.log("You already have a test-setup.js in your project. Delete it or use `imba eject --force` to overwrite");let s=st.default.readFileSync(g1,"utf-8");return st.default.writeFileSync(i,s),console.log("✅ test-setup.js has been successfully "+(r.force?"overwritten":"created")),console.log("💎 You can still run the project using imba <server.imba> --vite and it will pick your config"),console.log("💎 Run `vite build
|
||
|
/*!
|
||
|
* Tmp
|
||
|
*
|
||
|
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||
|
*
|
||
|
* MIT Licensed
|
||
|
*/
|
||
|
/*!
|
||
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
||
|
* Licensed under the MIT License.
|
||
|
*/
|
||
|
/*!
|
||
|
* is-number <https://github.com/jonschlinkert/is-number>
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
/*!
|
||
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
||
|
*
|
||
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/
|