@mavenagi/apps 1.0.12 → 1.0.14-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"module";var t={3220:(e,t,r)=>{const n=r(5317);const o=r(8291);const i=r(2691);function spawn(e,t,r){const u=o(e,t,r);const s=n.spawn(u.command,u.args,u.options);i.hookChildProcess(s,u);return s}function spawnSync(e,t,r){const u=o(e,t,r);const s=n.spawnSync(u.command,u.args,u.options);s.error=s.error||i.verifyENOENTSync(s.status,u);return s}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=o;e.exports._enoent=i},2691:e=>{const t=process.platform==="win32";function notFoundError(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function hookChildProcess(e,r){if(!t){return}const n=e.emit;e.emit=function(t,o){if(t==="exit"){const t=verifyENOENT(o,r);if(t){return n.call(e,"error",t)}}return n.apply(e,arguments)}}function verifyENOENT(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawn")}return null}function verifyENOENTSync(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawnSync")}return null}e.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},8291:(e,t,r)=>{const n=r(6928);const o=r(8032);const i=r(6878);const u=r(2537);const s=process.platform==="win32";const a=/\.(?:com|exe)$/i;const c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(e){e.file=o(e);const t=e.file&&u(e.file);if(t){e.args.unshift(e.file);e.command=t;return o(e)}return e.file}function parseNonShell(e){if(!s){return e}const t=detectShebang(e);const r=!a.test(t);if(e.options.forceShell||r){const r=c.test(t);e.command=n.normalize(e.command);e.command=i.command(e.command);e.args=e.args.map((e=>i.argument(e,r)));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`];e.command=process.env.comspec||"cmd.exe";e.options.windowsVerbatimArguments=true}return e}function parse(e,t,r){if(t&&!Array.isArray(t)){r=t;t=null}t=t?t.slice(0):[];r=Object.assign({},r);const n={command:e,args:t,options:r,file:undefined,original:{command:e,args:t}};return r.shell?n:parseNonShell(n)}e.exports=parse},6878:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(e){e=e.replace(t,"^$1");return e}function escapeArgument(e,r){e=`${e}`;e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');e=e.replace(/(?=(\\+?)?)\1$/,"$1$1");e=`"${e}"`;e=e.replace(t,"^$1");if(r){e=e.replace(t,"^$1")}return e}e.exports.command=escapeCommand;e.exports.argument=escapeArgument},2537:(e,t,r)=>{const n=r(9896);const o=r(934);function readShebang(e){const t=150;const r=Buffer.alloc(t);let i;try{i=n.openSync(e,"r");n.readSync(i,r,0,t,0);n.closeSync(i)}catch(e){}return o(r.toString())}e.exports=readShebang},8032:(e,t,r)=>{const n=r(6928);const o=r(20);const i=r(8251);function resolveCommandAttempt(e,t){const r=e.options.env||process.env;const u=process.cwd();const s=e.options.cwd!=null;const a=s&&process.chdir!==undefined&&!process.chdir.disabled;if(a){try{process.chdir(e.options.cwd)}catch(e){}}let c;try{c=o.sync(e.command,{path:r[i({env:r})],pathExt:t?n.delimiter:undefined})}catch(e){}finally{if(a){process.chdir(u)}}if(c){c=n.resolve(s?e.options.cwd:"",c)}return c}function resolveCommand(e){return resolveCommandAttempt(e)||resolveCommandAttempt(e,true)}e.exports=resolveCommand},20:(e,t,r)=>{const n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const o=r(6928);const i=n?";":":";const u=r(7210);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||i;const o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const u=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const s=n?u.split(r):[""];if(n){if(e.indexOf(".")!==-1&&s[0]!=="")s.unshift("")}return{pathEnv:o,pathExt:s,pathExtExe:u}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:n,pathExt:i,pathExtExe:s}=getPathInfo(e,t);const a=[];const step=r=>new Promise(((i,u)=>{if(r===n.length)return t.all&&a.length?i(a):u(getNotFoundError(e));const s=n[r];const c=/^".*"$/.test(s)?s.slice(1,-1):s;const l=o.join(c,e);const D=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;i(subStep(D,r,0))}));const subStep=(e,r,n)=>new Promise(((o,c)=>{if(n===i.length)return o(step(r+1));const l=i[n];u(e+l,{pathExt:s},((i,u)=>{if(!i&&u){if(t.all)a.push(e+l);else return o(e+l)}return o(subStep(e,r,n+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:i}=getPathInfo(e,t);const s=[];for(let a=0;a<r.length;a++){const c=r[a];const l=/^".*"$/.test(c)?c.slice(1,-1):c;const D=o.join(l,e);const f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+D:D;for(let e=0;e<n.length;e++){const r=f+n[e];try{const e=u.sync(r,{pathExt:i});if(e){if(t.all)s.push(r);else return r}}catch(e){}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},5426:(e,t,r)=>{const n=r(6928);const o=r(5317);const i=r(3220);const u=r(4588);const s=r(7221);const a=r(163);const c=r(8244);const l=r(9487);const{spawnedKill:D,spawnedCancel:f,setupTimeout:d,validateTimeout:p,setExitHandler:h}=r(5676);const{handleInput:g,getSpawnedResult:m,makeAllStream:y,validateInputSync:F}=r(7828);const{mergePromise:b,getSpawnedPromise:E}=r(6163);const{joinCommand:C,parseCommand:v,getEscapedCommand:w}=r(4835);const A=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{const i=t?{...process.env,...e}:e;if(r){return s.env({env:i,cwd:n,execPath:o})}return i};const handleArguments=(e,t,r={})=>{const o=i._parse(e,t,r);e=o.command;t=o.args;r=o.options;r={maxBuffer:A,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...r};r.env=getEnv(r);r.stdio=l(r);if(process.platform==="win32"&&n.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:r,parsed:o}};const handleOutput=(e,t,r)=>{if(typeof t!=="string"&&!Buffer.isBuffer(t)){return r===undefined?undefined:""}if(e.stripFinalNewline){return u(t)}return t};const execa=(e,t,r)=>{const n=handleArguments(e,t,r);const i=C(e,t);const u=w(e,t);p(n.options);let s;try{s=o.spawn(n.file,n.args,n.options)}catch(e){const t=new o.ChildProcess;const r=Promise.reject(c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:u,parsed:n,timedOut:false,isCanceled:false,killed:false}));return b(t,r)}const l=E(s);const F=d(s,n.options,l);const v=h(s,n.options,F);const A={isCanceled:false};s.kill=D.bind(null,s.kill.bind(s));s.cancel=f.bind(null,s,A);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:r,timedOut:o},a,l,D]=await m(s,n.options,v);const f=handleOutput(n.options,a);const d=handleOutput(n.options,l);const p=handleOutput(n.options,D);if(e||t!==0||r!==null){const a=c({error:e,exitCode:t,signal:r,stdout:f,stderr:d,all:p,command:i,escapedCommand:u,parsed:n,timedOut:o,isCanceled:A.isCanceled,killed:s.killed});if(!n.options.reject){return a}throw a}return{command:i,escapedCommand:u,exitCode:0,stdout:f,stderr:d,all:p,failed:false,timedOut:false,isCanceled:false,killed:false}};const O=a(handlePromise);g(s,n.options.input);s.all=y(s,n.options);return b(s,O)};e.exports=execa;e.exports.sync=(e,t,r)=>{const n=handleArguments(e,t,r);const i=C(e,t);const u=w(e,t);F(n.options);let s;try{s=o.spawnSync(n.file,n.args,n.options)}catch(e){throw c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:u,parsed:n,timedOut:false,isCanceled:false,killed:false})}const a=handleOutput(n.options,s.stdout,s.error);const l=handleOutput(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){const e=c({stdout:a,stderr:l,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:u,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:false,killed:s.signal!==null});if(!n.options.reject){return e}throw e}return{command:i,escapedCommand:u,exitCode:0,stdout:a,stderr:l,failed:false,timedOut:false,isCanceled:false,killed:false}};e.exports.command=(e,t)=>{const[r,...n]=v(e);return execa(r,n,t)};e.exports.commandSync=(e,t)=>{const[r,...n]=v(e);return execa.sync(r,n,t)};e.exports.node=(e,t,r={})=>{if(t&&!Array.isArray(t)&&typeof t==="object"){r=t;t=[]}const n=l.node(r);const o=process.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:i=process.execPath,nodeOptions:u=o}=r;return execa(i,[...u,e,...Array.isArray(t)?t:[]],{...r,stdin:undefined,stdout:undefined,stderr:undefined,stdio:n,shell:false})}},4835:e=>{const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const t=/^[\w.-]+$/;const r=/"/g;const escapeArg=e=>{if(typeof e!=="string"||t.test(e)){return e}return`"${e.replace(r,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const n=/ +/g;const parseCommand=e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${r}`}else{t.push(r)}}return t};e.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},8244:(e,t,r)=>{const{signalsByName:n}=r(9280);const getErrorPrefix=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:u})=>{if(e){return`timed out after ${t} milliseconds`}if(u){return"was canceled"}if(r!==undefined){return`failed with ${r}`}if(n!==undefined){return`was killed with ${n} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:r,error:o,signal:i,exitCode:u,command:s,escapedCommand:a,timedOut:c,isCanceled:l,killed:D,parsed:{options:{timeout:f}}})=>{u=u===null?undefined:u;i=i===null?undefined:i;const d=i===undefined?undefined:n[i].description;const p=o&&o.code;const h=getErrorPrefix({timedOut:c,timeout:f,errorCode:p,signal:i,signalDescription:d,exitCode:u,isCanceled:l});const g=`Command ${h}: ${s}`;const m=Object.prototype.toString.call(o)==="[object Error]";const y=m?`${g}\n${o.message}`:g;const F=[y,t,e].filter(Boolean).join("\n");if(m){o.originalMessage=o.message;o.message=F}else{o=new Error(F)}o.shortMessage=y;o.command=s;o.escapedCommand=a;o.exitCode=u;o.signal=i;o.signalDescription=d;o.stdout=e;o.stderr=t;if(r!==undefined){o.all=r}if("bufferedData"in o){delete o.bufferedData}o.failed=true;o.timedOut=Boolean(c);o.isCanceled=l;o.killed=D&&!c;return o};e.exports=makeError},5676:(e,t,r)=>{const n=r(857);const o=r(1521);const i=1e3*5;const spawnedKill=(e,t="SIGTERM",r={})=>{const n=e(t);setKillTimeout(e,t,r,n);return n};const setKillTimeout=(e,t,r,n)=>{if(!shouldForceKill(t,r,n)){return}const o=getForceKillAfterTimeout(r);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},r)=>isSigterm(e)&&t!==false&&r;const isSigterm=e=>e===n.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return i}if(!Number.isFinite(e)||e<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}return e};const spawnedCancel=(e,t)=>{const r=e.kill();if(r){t.isCanceled=true}};const timeoutKill=(e,t,r)=>{e.kill(t);r(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===undefined){return n}let o;const i=new Promise(((n,i)=>{o=setTimeout((()=>{timeoutKill(e,r,i)}),t)}));const u=n.finally((()=>{clearTimeout(o)}));return Promise.race([i,u])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:r},n)=>{if(!t||r){return n}const i=o((()=>{e.kill()}));return n.finally((()=>{i()}))};e.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},6163:e=>{const t=(async()=>{})().constructor.prototype;const r=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));const mergePromise=(e,t)=>{for(const[n,o]of r){const r=typeof t==="function"?(...e)=>Reflect.apply(o.value,t(),e):o.value.bind(t);Reflect.defineProperty(e,n,{...o,value:r})}return e};const getSpawnedPromise=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})}));e.on("error",(e=>{r(e)}));if(e.stdin){e.stdin.on("error",(e=>{r(e)}))}}));e.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},9487:e=>{const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:r}=e;if(r===undefined){return t.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof r==="string"){return r}if(!Array.isArray(r)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``)}const n=Math.max(r.length,t.length);return Array.from({length:n},((e,t)=>r[t]))};e.exports=normalizeStdio;e.exports.node=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]}},7828:(e,t,r)=>{const n=r(7277);const o=r(3221);const i=r(2993);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(n(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const r=i();if(e.stdout){r.add(e.stdout)}if(e.stderr){r.add(e.stderr)}return r};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!e||!r){return}if(t){return o(e,{encoding:t,maxBuffer:n})}return o.buffer(e,{maxBuffer:n})};const getSpawnedResult=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},u)=>{const s=getStreamPromise(e,{encoding:n,buffer:o,maxBuffer:i});const a=getStreamPromise(t,{encoding:n,buffer:o,maxBuffer:i});const c=getStreamPromise(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([u,s,a,c])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},getBufferedData(e,s),getBufferedData(t,a),getBufferedData(r,c)])}};const validateInputSync=({input:e})=>{if(n(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};e.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},1521:(e,t,r)=>{var n=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(n)){e.exports=function(){return function(){}}}else{var o=r(2613);var i=r(2280);var u=/^win/i.test(n.platform);var s=r(4434);if(typeof s!=="function"){s=s.EventEmitter}var a;if(n.__signal_exit_emitter__){a=n.__signal_exit_emitter__}else{a=n.__signal_exit_emitter__=new s;a.count=0;a.emitted={}}if(!a.infinite){a.setMaxListeners(Infinity);a.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}o.equal(typeof e,"function","a callback must be provided for exit handler");if(f===false){d()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){a.removeListener(r,e);if(a.listeners("exit").length===0&&a.listeners("afterexit").length===0){c()}};a.on(r,e);return remove};var c=function unload(){if(!f||!processOk(global.process)){return}f=false;i.forEach((function(e){try{n.removeListener(e,D[e])}catch(e){}}));n.emit=g;n.reallyExit=p;a.count-=1};e.exports.unload=c;var l=function emit(e,t,r){if(a.emitted[e]){return}a.emitted[e]=true;a.emit(e,t,r)};var D={};i.forEach((function(e){D[e]=function listener(){if(!processOk(global.process)){return}var t=n.listeners(e);if(t.length===a.count){c();l("exit",null,e);l("afterexit",null,e);if(u&&e==="SIGHUP"){e="SIGINT"}n.kill(n.pid,e)}}}));e.exports.signals=function(){return i};var f=false;var d=function load(){if(f||!processOk(global.process)){return}f=true;a.count+=1;i=i.filter((function(e){try{n.on(e,D[e]);return true}catch(e){return false}}));n.emit=m;n.reallyExit=h};e.exports.load=d;var p=n.reallyExit;var h=function processReallyExit(e){if(!processOk(global.process)){return}n.exitCode=e||0;l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);p.call(n,n.exitCode)};var g=n.emit;var m=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){n.exitCode=t}var r=g.apply(this,arguments);l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);return r}else{return g.apply(this,arguments)}}}},2280:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},9103:e=>{e.exports=function getCallerFile(e){if(e===void 0){e=2}if(e>=Error.stackTraceLimit){throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`")}var t=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var r=(new Error).stack;Error.prepareStackTrace=t;if(r!==null&&typeof r==="object"){return r[e]?r[e].getFileName():undefined}}},324:(e,t,r)=>{const{PassThrough:n}=r(2203);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const o=r==="buffer";let i=false;if(t){i=!(r||o)}else{r=r||"utf8"}if(o){r=null}const u=new n({objectMode:i});if(r){u.setEncoding(r)}let s=0;const a=[];u.on("data",(e=>{a.push(e);if(i){s=a.length}else{s+=e.length}}));u.getBufferedValue=()=>{if(t){return a}return o?Buffer.concat(a,s):a.join("")};u.getBufferedLength=()=>s;return u}},3221:(e,t,r)=>{const{constants:n}=r(181);const o=r(2203);const{promisify:i}=r(9023);const u=r(324);const s=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:r}=t;const o=u(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=n.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await s(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},8534:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGNALS=void 0;const r=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];t.SIGNALS=r},9280:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.signalsByNumber=t.signalsByName=void 0;var n=r(857);var o=r(6280);var i=r(576);const getSignalsByName=function(){const e=(0,o.getSignals)();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:r,description:n,supported:o,action:i,forced:u,standard:s}){return{...e,[t]:{name:t,number:r,description:n,supported:o,action:i,forced:u,standard:s}}};const u=getSignalsByName();t.signalsByName=u;const getSignalsByNumber=function(){const e=(0,o.getSignals)();const t=i.SIGRTMAX+1;const r=Array.from({length:t},((t,r)=>getSignalByNumber(r,e)));return Object.assign({},...r)};const getSignalByNumber=function(e,t){const r=findSignalByNumber(e,t);if(r===undefined){return{}}const{name:n,description:o,supported:i,action:u,forced:s,standard:a}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:u,forced:s,standard:a}}};const findSignalByNumber=function(e,t){const r=t.find((({name:t})=>n.constants.signals[t]===e));if(r!==undefined){return r}return t.find((t=>t.number===e))};const s=getSignalsByNumber();t.signalsByNumber=s},576:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGRTMAX=t.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const e=n-r+1;return Array.from({length:e},getRealtimeSignal)};t.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:r+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const r=34;const n=64;t.SIGRTMAX=n},6280:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getSignals=void 0;var n=r(857);var o=r(8534);var i=r(576);const getSignals=function(){const e=(0,i.getRealtimeSignals)();const t=[...o.SIGNALS,...e].map(normalizeSignal);return t};t.getSignals=getSignals;const normalizeSignal=function({name:e,number:t,description:r,action:o,forced:i=false,standard:u}){const{signals:{[e]:s}}=n.constants;const a=s!==undefined;const c=a?s:t;return{name:e,number:c,description:r,supported:a,action:o,forced:i,standard:u}}},7277:e=>{const isStream=e=>e!==null&&typeof e==="object"&&typeof e.pipe==="function";isStream.writable=e=>isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object";isStream.readable=e=>isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object";isStream.duplex=e=>isStream.writable(e)&&isStream.readable(e);isStream.transform=e=>isStream.duplex(e)&&typeof e._transform==="function";e.exports=isStream},7210:(e,t,r)=>{var n=r(9896);var o;if(process.platform==="win32"||global.TESTING_WINDOWS){o=r(6431)}else{o=r(2891)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,r){if(typeof t==="function"){r=t;t={}}if(!r){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(r,n){isexe(e,t||{},(function(e,t){if(e){n(e)}else{r(t)}}))}))}o(e,t||{},(function(e,n){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;n=false}}r(e,n)}))}function sync(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},2891:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(9896);function isexe(e,t,r){n.stat(e,(function(e,n){r(e,e?false:checkStat(n,t))}))}function sync(e,t){return checkStat(n.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var r=e.mode;var n=e.uid;var o=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var u=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var s=parseInt("100",8);var a=parseInt("010",8);var c=parseInt("001",8);var l=s|a;var D=r&c||r&a&&o===u||r&s&&n===i||r&l&&i===0;return D}},6431:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(9896);function checkPathExt(e,t){var r=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!r){return true}r=r.split(";");if(r.indexOf("")!==-1){return true}for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o){return true}}return false}function checkStat(e,t,r){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,r)}function isexe(e,t,r){n.stat(e,(function(n,o){r(n,n?false:checkStat(o,e,t))}))}function sync(e,t){return checkStat(n.statSync(e),e,t)}},2993:(e,t,r)=>{const{PassThrough:n}=r(2203);e.exports=function(){var e=[];var t=new n({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(r){if(Array.isArray(r)){r.forEach(add);return this}e.push(r);r.once("end",remove.bind(null,r));r.once("error",t.emit.bind(t,"error"));r.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(r){e=e.filter((function(e){return e!==r}));if(!e.length&&t.readable){t.end()}}}},1098:e=>{const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},7221:(e,t,r)=>{const n=r(6928);const o=r(8251);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[o()],execPath:process.execPath,...e};let t;let r=n.resolve(e.cwd);const i=[];while(t!==r){i.push(n.join(r,"node_modules/.bin"));t=r;r=n.resolve(r,"..")}const u=n.resolve(e.cwd,e.execPath,"..");i.push(u);return i.concat(e.path).join(n.delimiter)};e.exports=npmRunPath;e.exports["default"]=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const r={...t.env};const n=o({env:r});t.path=r[n];r[n]=e.exports(t);return r}},163:(e,t,r)=>{const n=r(1098);const o=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let i=0;const u=e.displayName||e.name||"<anonymous>";const onetime=function(...n){o.set(onetime,++i);if(i===1){r=e.apply(this,n);e=null}else if(t.throw===true){throw new Error(`Function \`${u}\` can only be called once`)}return r};n(onetime,e);o.set(onetime,i);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!o.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return o.get(e)}},8251:e=>{const pathKey=(e={})=>{const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports["default"]=pathKey},934:(e,t,r)=>{const n=r(1368);e.exports=(e="")=>{const t=e.match(n);if(!t){return null}const[r,o]=t[0].replace(/#! ?/,"").split(" ");const i=r.split("/").pop();if(i==="env"){return o}return o?`${i} ${o}`:i}},1368:e=>{e.exports=/^#!(.*)/},4588:e=>{e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},5470:e=>{e.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},2732:e=>{e.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},1719:(e,t,r)=>{r.a(e,(async(e,t)=>{try{var n=r(5317);var o=r.n(n);var i=r(1943);var u=r.n(i);var s=r(9309);var a=r(8745);var c=r(2142);const prepare=async()=>{await u().access("src").catch((()=>{throw new Error("src directory not found. Make sure all your source code is in the src directory.")}));await u().access("src/pages").then((()=>{throw new Error("pages directory found. Only NextJS App Router is supported. Convert your app to use App Router and delete the pages directory.")})).catch((()=>{}));await u().rm("src/app/mavenagi-cgi",{recursive:true,force:true});await u().mkdir("src/app/mavenagi-cgi",{recursive:true});await Promise.all([u().writeFile("src/app/mavenagi-cgi/next.ts",`// @ts-nocheck\n${c.S}`),...Object.entries({"pre-install":"preInstall","post-install":"postInstall",uninstall:"uninstall",feedbacks:"feedbackCreatedOrUpdated",conversations:"conversationCreatedOrUpdated","inbox-items":"inboxItemCreatedOrUpdated",events:"eventCreatedOrUpdated","execute-action":"executeAction","knowledge-base-refreshed":"knowledgeBaseRefreshed","handle-message":"handleMessage"}).map((async([e,t])=>{await u().mkdir(`src/app/mavenagi-cgi/v1/${e}`,{recursive:true});const r=await u().readFile(`src/index.ts`,"utf8");const n=r.includes("export const runtime = 'edge'")||r.includes('export const runtime = "edge"');if(n){throw new Error("Edge runtime is no longer supported. Remove the runtime export from index.ts.")}await u().writeFile(`src/app/mavenagi-cgi/v1/${e}/route.ts`,`// @ts-nocheck\nimport {${t}} from '../../next'\nimport userWorker from '../../../..'\n\nexport const POST = ${t}\n`)}))])};await(0,a.A)(process.argv.slice(2)).scriptName("mavenagi").usage("$0 <cmd> [args]").command("build","build",(async()=>{await prepare();(0,n.execFileSync)(await(0,s.o0)(),["run","build"],{stdio:"inherit"});process.exit(0)})).command("dev","dev",(async()=>{await prepare();(0,n.execFileSync)(await(0,s.o0)(),["run","dev"],{stdio:"inherit"});process.exit(0)})).help().argv;t()}catch(e){t(e)}}),1)},2142:(e,t,r)=>{r.d(t,{S:()=>n});const n=`var Zn=Object.defineProperty;var ei=(e,r)=>{for(var t in r)Zn(e,t,{get:r[t],enumerable:!0})};var Y=new TextEncoder,V=new TextDecoder,vs=2**32;function Zr(...e){let r=e.reduce((i,{length:a})=>i+a,0),t=new Uint8Array(r),n=0;for(let i of e)t.set(i,n),n+=i.length;return t}function et(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let r=atob(e),t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t}function F(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:V.decode(e),{alphabet:"base64url"});let r=e;r instanceof Uint8Array&&(r=V.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/").replace(/\\s/g,"");try{return et(r)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}var T=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(r,t){super(r,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},N=class extends T{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},fe=class extends T{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},Ae=class extends T{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},z=class extends T{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var w=class extends T{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Q=class extends T{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var le=class extends T{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Z=class extends T{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(r="no applicable key found in the JSON Web Key Set",t){super(r,t)}},ze=class extends T{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(r="multiple matching keys found in the JSON Web Key Set",t){super(r,t)}},Pe=class extends T{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(r="request timed out",t){super(r,t)}},Te=class extends T{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(r="signature verification failed",t){super(r,t)}};function B(e,r="algorithm.name"){return new TypeError(\`CryptoKey does not support this operation, its \${r} must be \${e}\`)}function ee(e,r){return e.name===r}function hr(e){return parseInt(e.name.slice(4),10)}function oi(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function ni(e,r){if(r&&!e.usages.includes(r))throw new TypeError(\`CryptoKey does not support this operation, its usages must include \${r}.\`)}function rt(e,r,t){switch(r){case"HS256":case"HS384":case"HS512":{if(!ee(e.algorithm,"HMAC"))throw B("HMAC");let n=parseInt(r.slice(2),10);if(hr(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!ee(e.algorithm,"RSASSA-PKCS1-v1_5"))throw B("RSASSA-PKCS1-v1_5");let n=parseInt(r.slice(2),10);if(hr(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!ee(e.algorithm,"RSA-PSS"))throw B("RSA-PSS");let n=parseInt(r.slice(2),10);if(hr(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!ee(e.algorithm,"Ed25519"))throw B("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!ee(e.algorithm,r))throw B(r);break}case"ES256":case"ES384":case"ES512":{if(!ee(e.algorithm,"ECDSA"))throw B("ECDSA");let n=oi(r);if(e.algorithm.namedCurve!==n)throw B(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}ni(e,t)}function tt(e,r,...t){if(t=t.filter(Boolean),t.length>2){let n=t.pop();e+=\`one of type \${t.join(", ")}, or \${n}.\`}else t.length===2?e+=\`one of type \${t[0]} or \${t[1]}.\`:e+=\`of type \${t[0]}.\`;return r==null?e+=\` Received \${r}\`:typeof r=="function"&&r.name?e+=\` Received function \${r.name}\`:typeof r=="object"&&r!=null&&r.constructor?.name&&(e+=\` Received an instance of \${r.constructor.name}\`),e}var ot=(e,...r)=>tt("Key must be ",e,...r);function vr(e,r,...t){return tt(\`Key for the \${e} algorithm must be \`,r,...t)}function xr(e){return e?.[Symbol.toStringTag]==="CryptoKey"}function _r(e){return e?.[Symbol.toStringTag]==="KeyObject"}var Sr=e=>xr(e)||_r(e);var nt=(...e)=>{let r=e.filter(Boolean);if(r.length===0||r.length===1)return!0;let t;for(let n of r){let i=Object.keys(n);if(!t||t.size===0){t=new Set(i);continue}for(let a of i){if(t.has(a))return!1;t.add(a)}}return!0};function ii(e){return typeof e=="object"&&e!==null}var j=e=>{if(!ii(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r};var it=(e,r)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:t}=r.algorithm;if(typeof t!="number"||t<2048)throw new TypeError(\`\${e} requires key modulusLength to be 2048 bits or larger\`)}};function ai(e){let r,t;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":r={name:e.alg},t=e.priv?["sign"]:["verify"];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:\`SHA-\${parseInt(e.alg.slice(-3),10)||1}\`},t=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":r={name:"ECDSA",namedCurve:"P-256"},t=e.d?["sign"]:["verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},t=e.d?["sign"]:["verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":r={name:"Ed25519"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new z('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:t}}var re=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:t}=ai(e),n={...e};return n.kty!=="AKP"&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,r,e.ext??!(e.d||e.priv),e.key_ops??t)};async function at(e,r,t){if(!j(e))throw new TypeError("JWK must be an object");let n;switch(r??=e.alg,n??=t?.extractable??e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return F(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new z('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return re({...e,alg:r,ext:n});case"AKP":{if(typeof e.alg!="string"||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(r!==void 0&&r!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return re({...e,ext:n})}case"EC":case"OKP":return re({...e,alg:r,ext:n});default:throw new z('Unsupported "kty" (Key Type) Parameter value')}}var st=(e,r,t,n,i)=>{if(i.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return new Set;if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(c=>typeof c!="string"||c.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;t!==void 0?a=new Map([...Object.entries(t),...r.entries()]):a=r;for(let c of n.crit){if(!a.has(c))throw new z(\`Extension Header Parameter "\${c}" is not recognized\`);if(i[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" is missing\`);if(a.get(c)&&n[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" MUST be integrity protected\`)}return new Set(n.crit)};var ct=(e,r)=>{if(r!==void 0&&(!Array.isArray(r)||r.some(t=>typeof t!="string")))throw new TypeError(\`"\${e}" option must be an array of strings\`);if(r)return new Set(r)};function pe(e){return j(e)&&typeof e.kty=="string"}function ut(e){return e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string")}function ft(e){return e.kty!=="oct"&&typeof e.d>"u"&&typeof e.priv>"u"}function lt(e){return e.kty==="oct"&&typeof e.k=="string"}var te,pt=async(e,r,t,n=!1)=>{te||=new WeakMap;let i=te.get(e);if(i?.[t])return i[t];let a=await re({...r,alg:t});return n&&Object.freeze(e),i?i[t]=a:te.set(e,{[t]:a}),a},ci=(e,r)=>{te||=new WeakMap;let t=te.get(e);if(t?.[r])return t[r];let n=e.type==="public",i=!!n,a;if(e.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}a=e.toCryptoKey(e.asymmetricKeyType,i,n?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(r!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let c;switch(r){case"RSA-OAEP":c="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":c="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":c="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":c="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:c},i,n?["encrypt"]:["decrypt"]);a=e.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:c},i,[n?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){let u=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!u)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&u==="P-256"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES384"&&u==="P-384"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES512"&&u==="P-521"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r.startsWith("ECDH-ES")&&(a=e.toCryptoKey({name:"ECDH",namedCurve:u},i,n?[]:["deriveBits"]))}if(!a)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return t?t[r]=a:te.set(e,{[r]:a}),a},mt=async(e,r)=>{if(e instanceof Uint8Array||xr(e))return e;if(_r(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return ci(e,r)}catch(n){if(n instanceof TypeError)throw n}let t=e.export({format:"jwk"});return pt(e,t,r)}if(pe(e))return e.k?F(e.k):pt(e,e,r,!0);throw new Error("unreachable")};var oe=e=>e?.[Symbol.toStringTag],wr=(e,r,t)=>{if(r.use!==void 0){let n;switch(t){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(r.use!==n)throw new TypeError(\`Invalid key for this operation, its "use" must be "\${n}" when present\`)}if(r.alg!==void 0&&r.alg!==e)throw new TypeError(\`Invalid key for this operation, its "alg" must be "\${e}" when present\`);if(Array.isArray(r.key_ops)){let n;switch(!0){case(t==="sign"||t==="verify"):case e==="dir":case e.includes("CBC-HS"):n=t;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?n=t==="encrypt"?"wrapKey":"unwrapKey":n=t;break;case(t==="encrypt"&&e.startsWith("RSA")):n="wrapKey";break;case t==="decrypt":n=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(n&&r.key_ops?.includes?.(n)===!1)throw new TypeError(\`Invalid key for this operation, its "key_ops" must include "\${n}" when present\`)}return!0},ui=(e,r,t)=>{if(!(r instanceof Uint8Array)){if(pe(r)){if(lt(r)&&wr(e,r,t))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Sr(r))throw new TypeError(vr(e,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError(\`\${oe(r)} instances for symmetric algorithms must be of type "secret"\`)}},fi=(e,r,t)=>{if(pe(r))switch(t){case"decrypt":case"sign":if(ut(r)&&wr(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(ft(r)&&wr(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Sr(r))throw new TypeError(vr(e,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError(\`\${oe(r)} instances for asymmetric algorithms must not be of type "secret"\`);if(r.type==="public")switch(t){case"sign":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm signing must be of type "private"\`);case"decrypt":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm decryption must be of type "private"\`);default:break}if(r.type==="private")switch(t){case"verify":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm verifying must be of type "public"\`);case"encrypt":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm encryption must be of type "public"\`);default:break}},dt=(e,r,t)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?ui(e,r,t):fi(e,r,t)};var yt=(e,r)=>{let t=\`SHA-\${e.slice(-3)}\`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:t,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:t,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:t,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:t,name:"ECDSA",namedCurve:r.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new z(\`alg \${e} is not supported either by JOSE or your javascript runtime\`)}};var bt=async(e,r,t)=>{if(r instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(ot(r,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",r,{hash:\`SHA-\${e.slice(-3)}\`,name:"HMAC"},!1,[t])}return rt(r,e,t),r};var gt=async(e,r,t,n)=>{let i=await bt(e,r,"verify");it(e,i);let a=yt(e,i.algorithm);try{return await crypto.subtle.verify(a,i,t,n)}catch{return!1}};async function ht(e,r,t){if(!j(e))throw new w("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new w('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new w("JWS Protected Header incorrect type");if(e.payload===void 0)throw new w("JWS Payload missing");if(typeof e.signature!="string")throw new w("JWS Signature missing or incorrect type");if(e.header!==void 0&&!j(e.header))throw new w("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{let I=F(e.protected);n=JSON.parse(V.decode(I))}catch{throw new w("JWS Protected Header is invalid")}if(!nt(n,e.header))throw new w("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...e.header},a=st(w,new Map([["b64",!0]]),t?.crit,n,i),c=!0;if(a.has("b64")&&(c=n.b64,typeof c!="boolean"))throw new w('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=i;if(typeof u!="string"||!u)throw new w('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=t&&ct("algorithms",t.algorithms);if(l&&!l.has(u))throw new Ae('"alg" (Algorithm) Header Parameter value not allowed');if(c){if(typeof e.payload!="string")throw new w("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new w("JWS Payload must be a string or an Uint8Array instance");let f=!1;typeof r=="function"&&(r=await r(n,e),f=!0),dt(u,r,"verify");let p=Zr(Y.encode(e.protected??""),Y.encode("."),typeof e.payload=="string"?Y.encode(e.payload):e.payload),y;try{y=F(e.signature)}catch{throw new w("Failed to base64url decode the signature")}let _=await mt(r,u);if(!await gt(u,_,y,p))throw new Te;let b;if(c)try{b=F(e.payload)}catch{throw new w("Failed to base64url decode the payload")}else typeof e.payload=="string"?b=Y.encode(e.payload):b=e.payload;let h={payload:b};return e.protected!==void 0&&(h.protectedHeader=n),e.header!==void 0&&(h.unprotectedHeader=e.header),f?{...h,key:_}:h}async function vt(e,r,t){if(e instanceof Uint8Array&&(e=V.decode(e)),typeof e!="string")throw new w("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:a,length:c}=e.split(".");if(c!==3)throw new w("Invalid Compact JWS");let u=await ht({payload:i,protected:n,signature:a},r,t),l={payload:u.payload,protectedHeader:u.protectedHeader};return typeof r=="function"?{...l,key:u.key}:l}var xt=e=>Math.floor(e.getTime()/1e3);var li=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Er=e=>{let r=li.exec(e);if(!r||r[4]&&r[1])throw new TypeError("Invalid time period format");let t=parseFloat(r[2]),n=r[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(t);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(t*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(t*3600);break;case"day":case"days":case"d":i=Math.round(t*86400);break;case"week":case"weeks":case"w":i=Math.round(t*604800);break;default:i=Math.round(t*31557600);break}return r[1]==="-"||r[4]==="ago"?-i:i};var _t=e=>e.includes("/")?e.toLowerCase():\`application/\${e.toLowerCase()}\`,pi=(e,r)=>typeof e=="string"?r.includes(e):Array.isArray(e)?r.some(Set.prototype.has.bind(new Set(e))):!1;function St(e,r,t={}){let n;try{n=JSON.parse(V.decode(r))}catch{}if(!j(n))throw new Q("JWT Claims Set must be a top-level JSON object");let{typ:i}=t;if(i&&(typeof e.typ!="string"||_t(e.typ)!==_t(i)))throw new N('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:c,subject:u,audience:l,maxTokenAge:f}=t,p=[...a];f!==void 0&&p.push("iat"),l!==void 0&&p.push("aud"),u!==void 0&&p.push("sub"),c!==void 0&&p.push("iss");for(let b of new Set(p.reverse()))if(!(b in n))throw new N(\`missing required "\${b}" claim\`,n,b,"missing");if(c&&!(Array.isArray(c)?c:[c]).includes(n.iss))throw new N('unexpected "iss" claim value',n,"iss","check_failed");if(u&&n.sub!==u)throw new N('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!pi(n.aud,typeof l=="string"?[l]:l))throw new N('unexpected "aud" claim value',n,"aud","check_failed");let y;switch(typeof t.clockTolerance){case"string":y=Er(t.clockTolerance);break;case"number":y=t.clockTolerance;break;case"undefined":y=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:_}=t,g=xt(_||new Date);if((n.iat!==void 0||f)&&typeof n.iat!="number")throw new N('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new N('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>g+y)throw new N('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new N('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=g-y)throw new fe('"exp" claim timestamp check failed',n,"exp","check_failed")}if(f){let b=g-n.iat,h=typeof f=="number"?f:Er(f);if(b-y>h)throw new fe('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(b<0-y)throw new N('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}async function Re(e,r,t){let n=await vt(e,r,t);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new Q("JWTs MUST NOT use unencoded payload");let a={payload:St(n.protectedHeader,n.payload,t),protectedHeader:n.protectedHeader};return typeof r=="function"?{...a,key:n.key}:a}function mi(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new z('Unsupported "alg" value for a JSON Web Key Set')}}function di(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(yi)}function yi(e){return j(e)}var Or=class{#t;#a=new WeakMap;constructor(r){if(!di(r))throw new le("JSON Web Key Set malformed");this.#t=structuredClone(r)}jwks(){return this.#t}async getKey(r,t){let{alg:n,kid:i}={...r,...t?.header},a=mi(n),c=this.#t.keys.filter(f=>{let p=a===f.kty;if(p&&typeof i=="string"&&(p=i===f.kid),p&&(typeof f.alg=="string"||a==="AKP")&&(p=n===f.alg),p&&typeof f.use=="string"&&(p=f.use==="sig"),p&&Array.isArray(f.key_ops)&&(p=f.key_ops.includes("verify")),p)switch(n){case"ES256":p=f.crv==="P-256";break;case"ES384":p=f.crv==="P-384";break;case"ES512":p=f.crv==="P-521";break;case"Ed25519":case"EdDSA":p=f.crv==="Ed25519";break}return p}),{0:u,length:l}=c;if(l===0)throw new Z;if(l!==1){let f=new ze,p=this.#a;throw f[Symbol.asyncIterator]=async function*(){for(let y of c)try{yield await wt(p,y,n)}catch{}},f}return wt(this.#a,u,n)}};async function wt(e,r,t){let n=e.get(r)||e.set(r,{}).get(r);if(n[t]===void 0){let i=await at({...r,ext:!0},t);if(i instanceof Uint8Array||i.type!=="public")throw new le("JSON Web Key Set members must be public keys");n[t]=i}return n[t]}function Ir(e){let r=new Or(e),t=async(n,i)=>r.getKey(n,i);return Object.defineProperties(t,{jwks:{value:()=>structuredClone(r.jwks()),enumerable:!1,configurable:!1,writable:!1}}),t}function bi(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var Ar;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Ar="jose/v6.1.0");var Et=Symbol();async function gi(e,r,t,n=fetch){let i=await n(e,{method:"GET",signal:t,redirect:"manual",headers:r}).catch(a=>{throw a.name==="TimeoutError"?new Pe:a});if(i.status!==200)throw new T("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new T("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var je=Symbol();function hi(e,r){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=r||!("jwks"in e)||!j(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,j))}var zr=class{#t;#a;#c;#s;#o;#e;#r;#u;#n;#i;constructor(r,t){if(!(r instanceof URL))throw new TypeError("url must be an instance of URL");this.#t=new URL(r.href),this.#a=typeof t?.timeoutDuration=="number"?t?.timeoutDuration:5e3,this.#c=typeof t?.cooldownDuration=="number"?t?.cooldownDuration:3e4,this.#s=typeof t?.cacheMaxAge=="number"?t?.cacheMaxAge:6e5,this.#r=new Headers(t?.headers),Ar&&!this.#r.has("User-Agent")&&this.#r.set("User-Agent",Ar),this.#r.has("accept")||(this.#r.set("accept","application/json"),this.#r.append("accept","application/jwk-set+json")),this.#u=t?.[Et],t?.[je]!==void 0&&(this.#i=t?.[je],hi(t?.[je],this.#s)&&(this.#o=this.#i.uat,this.#n=Ir(this.#i.jwks)))}pendingFetch(){return!!this.#e}coolingDown(){return typeof this.#o=="number"?Date.now()<this.#o+this.#c:!1}fresh(){return typeof this.#o=="number"?Date.now()<this.#o+this.#s:!1}jwks(){return this.#n?.jwks()}async getKey(r,t){(!this.#n||!this.fresh())&&await this.reload();try{return await this.#n(r,t)}catch(n){if(n instanceof Z&&this.coolingDown()===!1)return await this.reload(),this.#n(r,t);throw n}}async reload(){this.#e&&bi()&&(this.#e=void 0),this.#e||=gi(this.#t.href,this.#r,AbortSignal.timeout(this.#a),this.#u).then(r=>{this.#n=Ir(r),this.#i&&(this.#i.uat=Date.now(),this.#i.jwks=r),this.#o=Date.now(),this.#e=void 0}).catch(r=>{throw this.#e=void 0,r}),await this.#e}};function Pr(e,r){let t=new zr(e,r),n=async(i,a)=>t.getKey(i,a);return Object.defineProperties(n,{coolingDown:{get:()=>t.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>t.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>t.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>t.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>t.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}function vi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Tr=xi();function xi(){var e,r,t,n,i,a,c,u,l=typeof window<"u"&&typeof window.document<"u";if(l)return{type:"browser",version:window.navigator.userAgent};var f=typeof globalThis<"u"&&((r=globalThis)===null||r===void 0||(e=r.navigator)===null||e===void 0?void 0:e.userAgent)==="Cloudflare-Workers";if(f)return{type:"workerd"};var p=typeof EdgeRuntime=="string";if(p)return{type:"edge-runtime"};var y=(typeof self>"u"?"undefined":vi(self))==="object"&&typeof((t=self)===null||t===void 0?void 0:t.importScripts)=="function"&&(((n=self.constructor)===null||n===void 0?void 0:n.name)==="DedicatedWorkerGlobalScope"||((i=self.constructor)===null||i===void 0?void 0:i.name)==="ServiceWorkerGlobalScope"||((a=self.constructor)===null||a===void 0?void 0:a.name)==="SharedWorkerGlobalScope");if(y)return{type:"web-worker"};var _=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";if(_)return{type:"deno",version:Deno.version.deno};var g=typeof Bun<"u"&&typeof Bun.version<"u";if(g)return{type:"bun",version:Bun.version};var b=typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!(!((c=process.versions)===null||c===void 0)&&c.node);if(b)return{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])};var h=typeof navigator<"u"&&((u=navigator)===null||u===void 0?void 0:u.product)==="ReactNative";return h?{type:"react-native"}:{type:"unknown"}}var o={};ei(o,{JsonError:()=>De,ParseError:()=>ke,any:()=>Gt,bigint:()=>zt,boolean:()=>qt,booleanLiteral:()=>Ht,date:()=>Pt,discriminant:()=>so,enum_:()=>Me,getObjectLikeUtils:()=>K,getObjectUtils:()=>$,getSchemaUtils:()=>x,isProperty:()=>G,lazy:()=>Tt,lazyObject:()=>Wt,list:()=>Le,number:()=>$t,object:()=>Be,objectWithoutOptionalProperties:()=>Bt,optional:()=>Cr,property:()=>Dt,record:()=>ro,set:()=>to,string:()=>Xt,stringLiteral:()=>Ft,transform:()=>kr,undiscriminatedUnion:()=>ao,union:()=>uo,unknown:()=>Yt,withParsedProperties:()=>Br});var m={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function Si(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function Ot(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function v(e,r){return"Expected ".concat(r,". Received ").concat(wi(e),".")}function wi(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(Si(e,BigInt))return"BigInt";switch(typeof e>"u"?"undefined":Ot(e)){case"string":return'"'.concat(e,'"');case"bigint":case"number":case"boolean":case"undefined":return"".concat(e)}return typeof e>"u"?"undefined":Ot(e)}function Rr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ei(e){if(Array.isArray(e))return Rr(e)}function Oi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ii(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ai(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Oi(e,i,t[i])})}return e}function Pi(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ti(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ri(e){return Ei(e)||Ii(e)||ji(e)||Ai()}function ji(e,r){if(e){if(typeof e=="string")return Rr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rr(e,r)}}function A(e){return Ti(zi({},e),{json:It(e.json),parse:It(e.parse)})}function It(e){return function(r,t){var n=e(r,t),i=t??{},a=i.skipValidation,c=a===void 0?!1:a;return!n.ok&&c?(console.warn(["Failed to validate."].concat(Ri(n.errors.map(function(u){return" - "+(u.path.length>0?"".concat(u.path.join("."),": ").concat(u.message):u.message)}))).join(\`\n\`)),{ok:!0,value:r}):n}}function Ue(e){return e.path.length===0?e.message:"".concat(e.path.join(" -> "),": ").concat(e.message)}function Ui(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ni(e,r,t){return r=me(r),Mi(e,Ur()?Reflect.construct(r,t||[],me(e).constructor):r.apply(e,t))}function Di(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ne(e,r,t){return Ur()?Ne=Reflect.construct:Ne=function(i,a,c){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),f=new l;return c&&de(f,c.prototype),f},Ne.apply(null,arguments)}function Ci(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},me(e)}function ki(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&de(e,r)}function Ki(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Mi(e,r){return r&&(Bi(r)==="object"||typeof r=="function")?r:Ui(e)}function de(e,r){return de=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},de(e,r)}function Bi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function jr(e){var r=typeof Map=="function"?new Map:void 0;return jr=function(n){if(n===null||!Ki(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ne(n,arguments,me(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),de(i,n)},jr(e)}function Ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ur=function(){return!!e})()}var De=function(e){"use strict";ki(r,e);function r(t){Di(this,r);var n;return n=Ni(this,r,[t.map(Ue).join("; ")]),Ci(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r}(jr(Error));function Li(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wi(e,r,t){return r=ye(r),Gi(e,Dr()?Reflect.construct(r,t||[],ye(e).constructor):r.apply(e,t))}function Ji(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ce(e,r,t){return Dr()?Ce=Reflect.construct:Ce=function(i,a,c){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),f=new l;return c&&be(f,c.prototype),f},Ce.apply(null,arguments)}function Vi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ye(e)}function Fi(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&be(e,r)}function Hi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Gi(e,r){return r&&(qi(r)==="object"||typeof r=="function")?r:Li(e)}function be(e,r){return be=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},be(e,r)}function qi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Nr(e){var r=typeof Map=="function"?new Map:void 0;return Nr=function(n){if(n===null||!Hi(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ce(n,arguments,ye(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),be(i,n)},Nr(e)}function Dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dr=function(){return!!e})()}var ke=function(e){"use strict";Fi(r,e);function r(t){Ji(this,r);var n;return n=Wi(this,r,[t.map(Ue).join("; ")]),Vi(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r}(Nr(Error));function $i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ke(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){$i(e,i,t[i])})}return e}function x(e){return{nullable:function(){return Xi(e)},optional:function(){return Cr(e)},optionalNullable:function(){return Yi(e)},transform:function(r){return kr(e,r)},parseOrThrow:function(r,t){var n=e.parse(r,t);if(n.ok)return n.value;throw new ke(n.errors)},jsonOrThrow:function(r,t){var n=e.json(r,t);if(n.ok)return n.value;throw new De(n.errors)}}}function Xi(e){var r={parse:function(t,n){return t==null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.NULLABLE}};return Ke({},r,x(r))}function Cr(e){var r={parse:function(t,n){return t==null?{ok:!0,value:void 0}:e.parse(t,n)},json:function(t,n){return n?.omitUndefined&&t===void 0?{ok:!0,value:void 0}:t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.OPTIONAL}};return Ke({},r,x(r))}function Yi(e){var r={parse:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.OPTIONAL_NULLABLE}};return Ke({},r,x(r))}function kr(e,r){var t={parse:function(n,i){var a=e.parse(n,i);return a.ok?{ok:!0,value:r.transform(a.value)}:a},json:function(n,i){var a=r.untransform(n);return e.json(a,i)},getType:function(){return e.getType()}};return Ke({},t,x(t))}function Qi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Zi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Qi(e,i,t[i])})}return e}function At(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function zt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":At(r))==="bigint"?{ok:!0,value:r}:typeof r=="number"?{ok:!0,value:BigInt(r)}:{ok:!1,errors:[{path:i,message:v(r,"bigint | number")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":At(r))!=="bigint"?{ok:!1,errors:[{path:i,message:v(r,"bigint")}]}:{ok:!0,value:r}},getType:function(){return m.BIGINT}};return Zi({},A(e),x(e))}function ea(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ra(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function ta(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ea(e,i,t[i])})}return e}var oa=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;function Pt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return typeof r!="string"?{ok:!1,errors:[{path:i,message:v(r,"string")}]}:oa.test(r)?{ok:!0,value:new Date(r)}:{ok:!1,errors:[{path:i,message:v(r,"ISO 8601 date string")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return ra(r,Date)?{ok:!0,value:r.toISOString()}:{ok:!1,errors:[{path:i,message:v(r,"Date object")}]}},getType:function(){return m.DATE}};return ta({},A(e),x(e))}function na(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ia(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){na(e,i,t[i])})}return e}function R(e,r){return function(){var t={parse:r,json:r,getType:function(){return e}};return ia({},A(t),x(t))}}function Me(e){var r=new Set(e),t=R(m.ENUM,function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.allowUnrecognizedEnumValues,c=i.breadcrumbsPrefix,u=c===void 0?[]:c;return typeof n!="string"?{ok:!1,errors:[{path:u,message:v(n,"string")}]}:!r.has(n)&&!a?{ok:!1,errors:[{path:u,message:v(n,"enum")}]}:{ok:!0,value:n}});return t()}function aa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function sa(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){aa(e,i,t[i])})}return e}function Tt(e){var r=Kr(e);return sa({},r,x(r))}function Kr(e){return{parse:function(r,t){return ne(e).parse(r,t)},json:function(r,t){return ne(e).json(r,t)},getType:function(){return ne(e).getType()}}}function ne(e){var r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function ge(e){return Object.entries(e)}function Rt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ca(e){if(Array.isArray(e))return e}function ua(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function fa(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function la(e,r){return ca(e)||ua(e,r)||pa(e,r)||fa()}function pa(e,r){if(e){if(typeof e=="string")return Rt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rt(e,r)}}function he(e,r){var t=new Set(r);return Object.entries(e).reduce(function(n,i){var a=la(i,2),c=a[0],u=a[1];return t.has(c)&&(n[c]=u),n},{})}function ma(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function H(e){if((typeof e>"u"?"undefined":ma(e))!=="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function ve(e){return Object.keys(e)}function jt(e,r){var t=[],n=[],i=!0,a=!1,c=void 0;try{for(var u=e[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var f=l.value;r(f)?t.push(f):n.push(f)}}catch(p){a=!0,c=p}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw c}}return[t,n]}function Ut(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function da(e){if(Array.isArray(e))return e}function Nt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ya(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function ba(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Mr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Nt(e,i,t[i])})}return e}function ga(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ha(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function va(e,r){return da(e)||ya(e,r)||xa(e,r)||ba()}function xa(e,r){if(e){if(typeof e=="string")return Ut(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ut(e,r)}}function K(e){return{withParsedProperties:function(r){return Br(e,r)}}}function Br(e,r){var t={parse:function(n,i){var a=e.parse(n,i);if(!a.ok)return a;var c=Object.entries(r).reduce(function(u,l){var f=va(l,2),p=f[0],y=f[1];return ha(Mr({},u),Nt({},p,typeof y=="function"?y(a.value):y))},{});return{ok:!0,value:Mr({},a.value,c)}},json:function(n,i){if(!H(n)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:v(n,"object")}]}}var c=new Set(Object.keys(r)),u=he(n,Object.keys(n).filter(function(l){return!c.has(l)}));return e.json(u,i)},getType:function(){return e.getType()}};return Mr({},t,x(t),K(t))}function Dt(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function G(e){return e.isProperty}function Lr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _a(e){if(Array.isArray(e))return e}function Sa(e){if(Array.isArray(e))return Lr(e)}function wa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ea(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function Ia(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Aa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){wa(e,i,t[i])})}return e}function za(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function xe(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):za(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function _e(e,r){return _a(e)||Oa(e,r)||Mt(e,r)||Ia()}function C(e){return Sa(e)||Ea(e)||Mt(e)||Aa()}function Mt(e,r){if(e){if(typeof e=="string")return Lr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lr(e,r)}}function Be(e){var r={_getRawProperties:function(){return Object.entries(e).map(function(t){var n=_e(t,2),i=n[0],a=n[1];return G(a)?a.rawKey:i})},_getParsedProperties:function(){return ve(e)},parse:function(t,n){var i={},a=[],c=!0,u=!1,l=void 0;try{for(var f=ge(e)[Symbol.iterator](),p;!(c=(p=f.next()).done);c=!0){var y=_e(p.value,2),_=y[0],g=y[1],b=G(g)?g.rawKey:_,h=G(g)?g.valueSchema:g,I={rawKey:b,parsedKey:_,valueSchema:h};i[b]=I,Kt(h)&&a.push(b)}}catch(S){u=!0,l=S}finally{try{!c&&f.return!=null&&f.return()}finally{if(u)throw l}}return Ct({value:t,requiredKeys:a,getProperty:function(S){var D=i[S];if(D!=null)return{transformedKey:D.parsedKey,transform:function(k){var U;return D.valueSchema.parse(k,xe(M({},n),{breadcrumbsPrefix:C((U=n?.breadcrumbsPrefix)!==null&&U!==void 0?U:[]).concat([S])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:function(t,n){var i=[],a=!0,c=!1,u=void 0;try{for(var l=ge(e)[Symbol.iterator](),f;!(a=(f=l.next()).done);a=!0){var p=_e(f.value,2),y=p[0],_=p[1],g=G(_)?_.valueSchema:_;Kt(g)&&i.push(y)}}catch(b){c=!0,u=b}finally{try{!a&&l.return!=null&&l.return()}finally{if(c)throw u}}return Ct({value:t,requiredKeys:i,getProperty:function(b){var h=e[b];if(h!=null)return G(h)?{transformedKey:h.rawKey,transform:function(I){var S;return h.valueSchema.json(I,xe(M({},n),{breadcrumbsPrefix:C((S=n?.breadcrumbsPrefix)!==null&&S!==void 0?S:[]).concat([b])}))}}:{transformedKey:b,transform:function(I){var S;return h.json(I,xe(M({},n),{breadcrumbsPrefix:C((S=n?.breadcrumbsPrefix)!==null&&S!==void 0?S:[]).concat([b])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:function(){return m.OBJECT}};return M({},A(r),x(r),K(r),$(r))}function Ct(e){var r=e.value,t=e.requiredKeys,n=e.getProperty,i=e.unrecognizedObjectKeys,a=i===void 0?"fail":i,c=e.skipValidation,u=c===void 0?!1:c,l=e.breadcrumbsPrefix,f=l===void 0?[]:l,p;if(!H(r))return{ok:!1,errors:[{path:f,message:v(r,"object")}]};var y=new Set(t),_=[],g={},b=!0,h=!1,I=void 0;try{for(var S=Object.entries(r)[Symbol.iterator](),D;!(b=(D=S.next()).done);b=!0){var k=_e(D.value,2),U=k[0],yr=k[1],br=n(U);if(br!=null){y.delete(U);var gr=br.transform(yr);if(gr.ok)g[br.transformedKey]=gr.value;else{var Qr;g[U]=yr,(Qr=_).push.apply(Qr,C(gr.errors))}}else switch(a){case"fail":_.push({path:C(f).concat([U]),message:'Unexpected key "'.concat(U,'"')});break;case"strip":break;case"passthrough":g[U]=yr;break}}}catch(ue){h=!0,I=ue}finally{try{!b&&S.return!=null&&S.return()}finally{if(h)throw I}}return(p=_).push.apply(p,C(t.filter(function(ue){return y.has(ue)}).map(function(ue){return{path:f,message:'Missing required key "'.concat(ue,'"')}}))),_.length===0||u?{ok:!0,value:g}:{ok:!1,errors:_}}function $(e){return{extend:function(r){var t={_getParsedProperties:function(){return C(e._getParsedProperties()).concat(C(r._getParsedProperties()))},_getRawProperties:function(){return C(e._getRawProperties()).concat(C(r._getRawProperties()))},parse:function(n,i){return kt({extensionKeys:r._getRawProperties(),value:n,transformBase:function(a){return e.parse(a,i)},transformExtension:function(a){return r.parse(a,i)}})},json:function(n,i){return kt({extensionKeys:r._getParsedProperties(),value:n,transformBase:function(a){return e.json(a,i)},transformExtension:function(a){return r.json(a,i)}})},getType:function(){return m.OBJECT}};return M({},t,x(t),K(t),$(t))},passthrough:function(){var r={_getParsedProperties:function(){return e._getParsedProperties()},_getRawProperties:function(){return e._getRawProperties()},parse:function(t,n){var i=e.parse(t,xe(M({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:M({},t,i.value)}:i},json:function(t,n){var i=e.json(t,xe(M({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:M({},t,i.value)}:i},getType:function(){return m.OBJECT}};return M({},r,x(r),K(r),$(r))}}}function kt(e){var r=e.extensionKeys,t=e.value,n=e.transformBase,i=e.transformExtension,a=new Set(r),c=_e(jt(ve(t),function(y){return a.has(y)}),2),u=c[0],l=c[1],f=n(he(t,l)),p=i(he(t,u));return f.ok&&p.ok?{ok:!0,value:M({},f.value,p.value)}:{ok:!1,errors:C(f.ok?[]:f.errors).concat(C(p.ok?[]:p.errors))}}function Kt(e){return!Pa(e)}function Pa(e){switch(e.getType()){case m.ANY:case m.UNKNOWN:case m.OPTIONAL:case m.OPTIONAL_NULLABLE:return!0;default:return!1}}function Bt(e){return Be(e)}function Ta(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Lt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Ta(e,i,t[i])})}return e}function Ra(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ja(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ra(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Wt(e){var r=ja(Lt({},Kr(e)),{_getRawProperties:function(){return ne(e)._getRawProperties()},_getParsedProperties:function(){return ne(e)._getParsedProperties()}});return Lt({},r,x(r),K(r),$(r))}function Jr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ua(e){if(Array.isArray(e))return Jr(e)}function Na(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Da(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ca(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Na(e,i,t[i])})}return e}function ka(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Jt(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Se(e){return Ua(e)||Da(e)||Ka(e)||Ca()}function Ka(e,r){if(e){if(typeof e=="string")return Jr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jr(e,r)}}function Le(e){var r={parse:function(t,n){return Vt(t,function(i,a){var c;return e.parse(i,Jt(Wr({},n),{breadcrumbsPrefix:Se((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},json:function(t,n){return Vt(t,function(i,a){var c;return e.json(i,Jt(Wr({},n),{breadcrumbsPrefix:Se((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},getType:function(){return m.LIST}};return Wr({},A(r),x(r))}function Vt(e,r){if(!Array.isArray(e))return{ok:!1,errors:[{message:v(e,"list"),path:[]}]};var t=e.map(function(n,i){return r(n,i)});return t.reduce(function(n,i){if(n.ok&&i.ok)return{ok:!0,value:Se(n.value).concat([i.value])};var a=[];if(!n.ok){var c;(c=a).push.apply(c,Se(n.errors))}if(!i.ok){var u;(u=a).push.apply(u,Se(i.errors))}return{ok:!1,errors:a}},{ok:!0,value:[]})}function Ft(e){var r=R(m.STRING_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:v(t,'"'.concat(e,'"'))}]}});return r()}function Ht(e){var r=R(m.BOOLEAN_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:v(t,"".concat(e.toString()))}]}});return r()}var Gt=R(m.ANY,function(e){return{ok:!0,value:e}});var qt=R(m.BOOLEAN,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"boolean")}]}});var $t=R(m.NUMBER,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"number")}]}});var Xt=R(m.STRING,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"string")}]}});var Yt=R(m.UNKNOWN,function(e){return{ok:!0,value:e}});function Vr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ma(e){if(Array.isArray(e))return e}function Ba(e){if(Array.isArray(e))return Vr(e)}function Zt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function La(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function Ja(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Va(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ie(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Zt(e,i,t[i])})}return e}function Fa(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function we(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ha(e,r){return Ma(e)||Wa(e,r)||eo(e,r)||Ja()}function X(e){return Ba(e)||La(e)||eo(e)||Va()}function eo(e,r){if(e){if(typeof e=="string")return Vr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Vr(e,r)}}function ro(e,r){var t={parse:function(n,i){return Qt({value:n,isKeyNumeric:e.getType()===m.NUMBER,transformKey:function(a){var c;return e.parse(a,we(ie({},i),{breadcrumbsPrefix:X((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var u;return r.parse(a,we(ie({},i),{breadcrumbsPrefix:X((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},json:function(n,i){return Qt({value:n,isKeyNumeric:e.getType()===m.NUMBER,transformKey:function(a){var c;return e.json(a,we(ie({},i),{breadcrumbsPrefix:X((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var u;return r.json(a,we(ie({},i),{breadcrumbsPrefix:X((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},getType:function(){return m.RECORD}};return ie({},A(t),x(t))}function Qt(e){var r=e.value,t=e.isKeyNumeric,n=e.transformKey,i=e.transformValue,a=e.breadcrumbsPrefix,c=a===void 0?[]:a;return H(r)?ge(r).reduce(function(u,l){var f=Ha(l,2),p=f[0],y=f[1];if(y===void 0)return u;var _=u,g=p;if(t){var b=p.length>0?Number(p):NaN;isNaN(b)||(g=b)}var h=n(g),I=i(y,g);if(_.ok&&h.ok&&I.ok)return{ok:!0,value:we(ie({},_.value),Zt({},h.value,I.value))};var S=[];if(!_.ok){var D;(D=S).push.apply(D,X(_.errors))}if(!h.ok){var k;(k=S).push.apply(k,X(h.errors))}if(!I.ok){var U;(U=S).push.apply(U,X(I.errors))}return{ok:!1,errors:S}},{ok:!0,value:{}}):{ok:!1,errors:[{path:c,message:v(r,"object")}]}}function Fr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ga(e){if(Array.isArray(e))return Fr(e)}function qa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function $a(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function Xa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ya(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Qa(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){qa(e,i,t[i])})}return e}function Za(e){return Ga(e)||Xa(e)||es(e)||Ya()}function es(e,r){if(e){if(typeof e=="string")return Fr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fr(e,r)}}function to(e){var r=Le(e),t={parse:function(n,i){var a=r.parse(n,i);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:function(n,i){if(!$a(n,Set)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:v(n,"Set")}]}}var c=r.json(Za(n),i);return c},getType:function(){return m.SET}};return Qa({},A(t),x(t))}function oo(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function rs(e){if(Array.isArray(e))return e}function ts(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function os(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function ns(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function io(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ts(e,i,t[i])})}return e}function is(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function as(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):is(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ss(e,r){return rs(e)||os(e,r)||cs(e,r)||ns()}function cs(e,r){if(e){if(typeof e=="string")return oo(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oo(e,r)}}function ao(e){var r={parse:function(t,n){return no(function(i,a){return i.parse(t,a)},e,n)},json:function(t,n){return no(function(i,a){return i.json(t,a)},e,n)},getType:function(){return m.UNDISCRIMINATED_UNION}};return io({},A(r),x(r))}function no(e,r,t){var n=[],i=!0,a=!1,c=void 0;try{for(var u=r.entries()[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var f=ss(l.value,2),p=f[0],y=f[1],_=e(y,as(io({},t),{skipValidation:!1}));if(_.ok)return _;var g=!0,b=!1,h=void 0;try{for(var I=_.errors[Symbol.iterator](),S;!(g=(S=I.next()).done);g=!0){var D=S.value;n.push({path:D.path,message:"[Variant ".concat(p,"] ").concat(D.message)})}}catch(k){b=!0,h=k}finally{try{!g&&I.return!=null&&I.return()}finally{if(b)throw h}}}}catch(k){a=!0,c=k}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw c}}return{ok:!1,errors:n}}function so(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}function Hr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function us(e){if(Array.isArray(e))return Hr(e)}function Gr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function fs(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ls(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Gr(e,i,t[i])})}return e}function ps(e,r){if(e==null)return{};var t=ms(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function ms(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}function $r(e){return us(e)||fs(e)||bs(e)||ls()}function ds(e,r){if(Xr(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Xr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ys(e){var r=ds(e,"string");return Xr(r)==="symbol"?r:String(r)}function Xr(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function bs(e,r){if(e){if(typeof e=="string")return Hr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Hr(e,r)}}function uo(e,r){var t=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=Me(ve(r)),a={parse:function(c,u){return co({value:c,discriminant:t,transformedDiscriminant:n,transformDiscriminantValue:function(l){var f;return i.parse(l,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:$r((f=u?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([t])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.parse(l,u)},breadcrumbsPrefix:u?.breadcrumbsPrefix})},json:function(c,u){return co({value:c,discriminant:n,transformedDiscriminant:t,transformDiscriminantValue:function(l){var f;return i.json(l,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:$r((f=u?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([n])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.json(l,u)},breadcrumbsPrefix:u?.breadcrumbsPrefix})},getType:function(){return m.UNION}};return qr({},A(a),x(a),K(a))}function co(e){var r=e.value,t=e.discriminant,n=e.transformedDiscriminant,i=e.transformDiscriminantValue,a=e.getAdditionalPropertiesSchema,c=e.allowUnrecognizedUnionMembers,u=c===void 0?!1:c,l=e.transformAdditionalProperties,f=e.breadcrumbsPrefix,p=f===void 0?[]:f;if(!H(r))return{ok:!1,errors:[{path:p,message:v(r,"object")}]};var y=r[t],_=ps(r,[t].map(ys));if(y==null)return{ok:!1,errors:[{path:p,message:'Missing discriminant ("'.concat(t,'")')}]};var g=i(y);if(!g.ok)return{ok:!1,errors:g.errors};var b=a(g.value);if(b==null)return u?{ok:!0,value:qr(Gr({},n,g.value),_)}:{ok:!1,errors:[{path:$r(p).concat([t]),message:"Unexpected discriminant value"}]};var h=l(_,b);return h.ok?{ok:!0,value:qr(Gr({},n,y),h.value)}:h}var E=o.object({organizationId:o.string(),agentId:o.string(),settings:o.record(o.string(),o.unknown())});var fo=o.object({}).extend(E);var lo=o.object({}).extend(E);var po=o.object({}).extend(E);var mo=o.enum_(["AGENT","CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_BASE_VERSION","KNOWLEDGE_DOCUMENT","ACTION","USER","EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK","INBOX_ITEM","INBOX_ITEM_FIX","SEGMENT","CUSTOMER"]);var O=o.object({referenceId:o.string()});var P=o.object({type:mo,appId:o.string()}).extend(O);var d=o.object({organizationId:o.string(),agentId:o.string()}).extend(P);var We=o.enum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var yo=o.object({type:We,text:o.string().optional()});var bo=o.object({feedbackId:d,conversationId:d,conversationMessageId:d,userId:d.optional(),createdAt:o.date().optional()}).extend(yo);var go=o.object({feedbacks:o.list(bo)}).extend(E);var q=o.enum_(["BUTTON_CLICKED","LINK_CLICKED","CHAT_OPENED","CHAT_CLOSED","TEXT_INSERTED"]);var ho=o.object({id:d.optional(),userDisplayName:o.string().optional()});var vo=o.object({surveyQuestion:o.string().optional(),surveyAnswer:o.string().optional()});var Je=o.object({rating:o.number().optional(),thumbUp:o.boolean().optional(),survey:vo.optional()});var Ve=o.object({pageName:o.string().optional(),pageUrl:o.string().optional(),pageTitle:o.string().optional(),linkUrl:o.string().optional(),elementId:o.string().optional()});var ae=o.object({entityId:d,scopeEntityId:d.optional()});var xo=o.enum_(["WEB","API","SYSTEM"]);var _o=o.enum_(["DESKTOP","MOBILE","TABLET","OTHER"]);var So=o.enum_(["WINDOWS","MACOS","LINUX","ANDROID","IOS","OTHER"]);var wo=o.object({type:So.optional(),name:o.string().optional(),version:o.string().optional()});var Eo=o.object({type:_o,name:o.string().optional(),version:o.string().optional(),osInfo:wo.optional()});var Oo=o.enum_(["CHROME","FIREFOX","SAFARI","OPERA","EDGE","OTHER"]);var Io=o.object({type:Oo,name:o.string().optional(),version:o.string().optional(),userAgent:o.string().optional()});var Ao=o.object({city:o.string().optional(),state:o.string().optional(),country:o.string().optional(),region:o.string().optional(),latitude:o.number().optional(),longitude:o.number().optional()});var zo=o.object({ip:o.string().optional()});var Po=o.object({code:o.string().optional()});var To=o.object({type:xo,deviceInfo:Eo.optional(),browserInfo:Io.optional(),geoInfo:Ao.optional(),ipInfo:zo.optional(),languageInfo:Po.optional()});var Ro=o.object({id:o.string(),start:o.date().optional(),end:o.date().optional(),duration:o.number().optional()});var jo=o.object({additionalData:o.record(o.string(),o.string())});var se=o.object({timestamp:o.date().optional(),references:o.list(ae).optional(),sourceInfo:To.optional(),sessionInfo:Ro.optional(),contextInfo:jo.optional()});var Uo=o.object({id:d,eventName:q,userInfo:ho,feedbackInfo:o.list(Je).optional(),pageInfo:Ve.optional()}).extend(se);var Fe=o.enum_(["APP_INSTALLED","APP_UNINSTALLED","APP_UPDATED"]);var He=o.object({eventName:Fe}).extend(se);var No=o.object({id:d}).extend(He);var Ge=o.union("eventType",{userEvent:Uo,systemEvent:No}).transform({transform:function(e){return e},untransform:function(e){return e}});var Do=o.object({events:o.list(Ge)}).extend(E);var Co=o.object({conversations:o.list(d)}).extend(E);var ko=o.object({inboxItemIds:o.list(d)}).extend(E);var Ko=o.enum_(["EMAIL","PHONE_NUMBER"]);var qe=o.object({value:o.string(),type:Ko});var Mo=o.object({userId:O.optional(),userIdentifiers:o.list(qe),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string())});var Bo=o.object({actionId:o.string(),conversationId:d.optional(),conversationMetadata:o.record(o.string(),o.string()),parameters:o.record(o.string(),o.unknown()),user:Mo,transientData:o.record(o.string(),o.string()).optional()}).extend(E);var kd=o.object({response:o.string()});var Lo=o.object({knowledgeBaseId:O}).extend(E);var Wo=o.enum_(["PENDING","PROCESSING","ACCEPTED","REJECTED"]);var $e=o.object({type:o.string(),name:o.string().optional()});var ce=o.object({url:o.string().optional(),sizeBytes:o.number().optional(),status:Wo}).extend($e);var Xe=o.enum_(["SENDING","SENT","REJECTED","CANCELED","FAILED","UNKNOWN"]);var Jo=o.enum_(["NOT_ASKED","LLM_ENABLED","LLM_DISABLED"]);var Vo=o.enum_(["USER","HUMAN_AGENT","EXTERNAL_SYSTEM"]);var Ye=o.object({createdAt:o.date().optional(),updatedAt:o.date().optional()});var Fo=o.object({userId:O,text:o.string(),userMessageType:Vo}).extend(Ye);var Ho=o.object({conversationMessageId:d,language:o.string().optional(),attachments:o.list(ce),agentUserId:o.string().optional(),userDisplayName:o.string().optional(),status:Xe,responseState:Jo.optional()}).extend(Fo);var Go=o.enum_(["BOT_RESPONSE","BOT_SUGGESTION"]);var qo=o.object({text:o.string()});var Qe=o.enum_(["STRING","MULTILINE","BOOLEAN","NUMBER","DATETIME","DATE","TIME","EMAIL","SCHEMA","FILE","OAUTH"]);var Ze=o.object({label:o.string(),value:o.unknown()});var $o=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),suggestion:o.unknown().optional(),type:Qe,enumOptions:o.list(Ze).optional()});var Xo=o.object({id:o.string(),actionId:P,formLabel:o.string(),fields:o.list($o),submitLabel:o.string()});var Yo=o.object({buttonName:o.string(),url:o.string().optional()});var Qo=o.enum_(["HIGHCHARTS_TS"]);var Zo=o.object({label:o.string(),specSchema:Qo,spec:o.string()});var en=o.object({label:o.string().optional(),object:o.unknown()});var rn=o.union("type",{text:qo,actionForm:Xo,oauthButton:Yo,chart:Zo,object:en}).transform({transform:function(e){return e},untransform:function(e){return e}});var tn=o.object({title:o.string(),url:o.string()});var on=o.object({followupQuestions:o.list(o.string()),sources:o.list(tn),language:o.string().optional()});var Yr=o.object({knowledgeBaseId:P,documentId:P,documentName:o.string(),documentExcerpt:o.string()});var nn=o.object({knowledgeReviewed:o.list(Yr),knowledgeUtilized:o.list(Yr)});var er=o.object({actionId:P,actionName:o.string()});var an=o.union("valueType",{primitive:o.object({value:o.unknown()}),attachment:ce}).transform({transform:function(e){return e},untransform:function(e){return e}});var rr=o.object({actionParameters:o.record(o.string(),an),executionResult:o.string().optional(),executionError:o.string().optional()}).extend(er);var sn=o.object({actionsReviewed:o.list(er),actionsExecuted:o.list(rr)});var cn=o.object({}).extend(rr);var un=o.object({safetyCheckPassed:o.boolean()});var fn=o.object({userData:o.record(o.string(),o.string())});var ln=o.object({matchingSegmentIds:o.list(d)});var pn=o.union("type",{knowledge:nn,actions:sn,form:cn,safety:un,user:fn,segments:ln}).transform({transform:function(e){return e},untransform:function(e){return e}});var mn=o.object({items:o.list(pn)});var dn=o.object({conversationMessageId:d,botMessageType:Go,responses:o.list(rn),metadata:on,status:Xe,logic:mn.optional()}).extend(Ye);var tr=o.union("type",{user:Ho,bot:dn}).transform({transform:function(e){return e},untransform:function(e){return e}});var yn=o.object({conversationId:d,message:tr}).extend(E);var Nb=o.object({message:o.string().optional()});var bn=o.object({referenceId:o.string(),appId:o.string()});var Kb=o.object({name:o.string().optional()}).extend(bn);var or=o.enum_(["USER","SYSTEM"]);var nr=o.object({id:O});var qb=o.object({id:O,eventName:q,eventType:or,userInfo:nr.optional(),timestamp:o.date().optional(),reference:ae.optional()});var gn=o.object({id:O,eventName:q,userInfo:nr,feedbackInfo:o.list(Je).optional(),pageInfo:Ve.optional()}).extend(se);var hn=o.object({id:O}).extend(He);var cg=o.union("eventType",{userEvent:gn,systemEvent:hn}).transform({transform:function(e){return e},untransform:function(e){return e}});var vn=o.enum_(["CREATED_AT"]);var xn=o.object({search:o.string().optional(),createdAfter:o.date().optional(),createdBefore:o.date().optional(),references:o.list(ae).optional(),eventTypes:o.list(or).optional(),userEventNames:o.list(q).optional(),systemEventNames:o.list(Fe).optional(),agentUserIds:o.list(o.string()).optional(),legacyFeedbackTypes:o.list(We).optional(),hasEventText:o.boolean().optional()});var ir=o.object({page:o.number().optional(),size:o.number().optional(),sortDesc:o.boolean().optional()});var _g=o.object({sort:vn.optional(),filter:xn.optional()}).extend(ir);var _n=o.object({number:o.number(),size:o.number(),totalElements:o.number(),totalPages:o.number()});var Ig=o.object({events:o.list(Ge)}).extend(_n);var Sn=o.enum_(["text","array","complexarray","color","image","multiline","checkbox","dropdown","section","oauth"]);var ar=o.enum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var wn=o.object({pattern:o.string(),errorMessage:o.string()});var En=o.object({key:o.string(),displayName:o.string(),description:o.string().optional(),type:Sn,visibility:ar.optional(),required:o.boolean().optional(),defaultValue:o.unknown().optional(),validation:wn.optional(),fields:o.lazy(function(){return On}).optional(),dropdownOptions:o.list(o.string()).optional(),oauthProvider:o.string().optional(),oauthScopes:o.list(o.string()).optional(),oauthRedirectUri:o.string().optional(),oauthClientId:o.string().optional(),oauthServiceDesired:o.string().optional(),oauthAuthorizationUrl:o.string().optional(),oauthClientSecret:o.string().optional(),oauthTokenUrl:o.string().optional(),oauthAccountUrl:o.string().optional()});var On=o.list(o.lazyObject(function(){return En}));var In=o.object({value:o.string(),visibility:ar});var sr=o.object({identifiers:o.list(qe),data:o.record(o.string(),In)});var Jg=o.object({userId:O}).extend(sr);var Gg=o.object({userId:d,agentUserId:o.string(),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string())}).extend(sr);var Xg=o.object({sortId:o.string().optional()}).extend(ir);var An=o.enum_(["POSITIVE","NEGATIVE","NEUTRAL","MIXED","UNKNOWN"]);var zn=o.enum_(["GOOD","NEEDS_IMPROVEMENT","UNKNOWN"]);var Pn=o.enum_(["MISSING_KNOWLEDGE","MISSING_USER_INFORMATION","MISSING_ACTION","NEEDS_USER_CLARIFICATION","UNSUPPORTED_FORMAT","INTERRUPTED","UNSUPPORTED_USER_BEHAVIOR","UNKNOWN","NO_BOT_REPLIES"]);var Tn=o.object({actionIds:o.list(P),incompleteActionIds:o.list(P),insertCount:o.number(),thumbsUpCount:o.number(),thumbsDownCount:o.number(),userMessageCount:o.number(),handleTime:o.number().optional(),humanAgentResponseDelay:o.number().optional(),humanAgents:o.list(o.string()),humanAgentsWithInserts:o.list(o.string()),users:o.list(o.string())});var Rn=o.object({userRequest:o.string().optional(),agentResponse:o.string().optional(),resolutionStatus:o.string().optional(),category:o.string().optional(),sentiment:An.optional(),quality:zn.optional(),qualityReason:Pn.optional(),resolvedByMaven:o.boolean().optional(),primaryLanguage:o.string().optional(),predictedNps:o.number().optional()});var jn=o.object({conversationId:P});var cr=o.enum_(["SHORT","MEDIUM","LONG"]);var Un=o.enum_(["MARKDOWN","FORMS","IMAGES","CHARTS_HIGHCHARTS_TS","ASYNC","OAUTH_BUTTONS"]);var Nn=o.object({capabilities:o.list(Un),isCopilot:o.boolean(),responseLength:cr});var Dn=o.enum_(["CASUAL_BUDDY","EMPATHETIC_SUPPORTER","FORMAL_PROFESSIONAL","CONCISE_EXPERT","ENTHUSIASTIC_HELPER","PATIENT_EDUCATOR","PIRATE"]);var Cn=o.object({persona:Dn.optional(),availableKnowledgeBases:o.list(d).optional()});var ur=o.object({responseConfig:Nn.optional(),subject:o.string().optional(),url:o.string().optional(),createdAt:o.date().optional(),updatedAt:o.date().optional(),tags:o.set(o.string()).optional(),metadata:o.record(o.string(),o.string()).optional(),allMetadata:o.record(o.string(),o.record(o.string(),o.string())),conversationId:d,analysis:Rn,summary:Tn,deleted:o.boolean(),open:o.boolean(),llmEnabled:o.boolean(),simulationContext:Cn.optional()});var Ah=o.object({messages:o.list(tr),attachments:o.list(ce)}).extend(ur);var Th=o.object({}).extend(ur);var Nh=o.object({content:o.string().optional(),assetId:O.optional()}).extend($e);var kn=o.object({authorizationUrl:o.string(),tokenUrl:o.string(),clientId:o.string(),clientSecret:o.string(),scopes:o.list(o.string()),extraAuthParams:o.record(o.string(),o.string()).optional(),extraTokenParams:o.record(o.string(),o.string()).optional()});var Kn=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),hidden:o.boolean().optional(),type:Qe.optional(),enumOptions:o.list(Ze).optional(),schema:o.string().optional(),oauthConfiguration:kn.optional()});var Mn=o.object({name:o.string(),description:o.string(),userInteractionRequired:o.boolean(),buttonName:o.string().optional(),precondition:o.lazy(function(){return fr}).optional(),userFormParameters:o.list(Kn),language:o.string().optional()});var Bn=o.enum_(["ALWAYS","WHEN_RELEVANT","NEVER"]);var Gh=o.object({actionId:d,instructions:o.string().optional(),llmInclusionStatus:Bn,segmentId:d.optional(),preconditionExplanation:o.string().optional(),deleted:o.boolean()}).extend(Mn);var Ln=o.enum_(["NOT"]);var L=o.object({operator:Ln.optional()});var lr=o.object({key:o.string(),value:o.string().optional()}).extend(L);var Wn=o.object({tags:o.set(o.string())}).extend(L);var Jn=o.object({actionId:o.string(),appId:o.string().optional()}).extend(L);var Vn=o.object({useMarkdown:o.boolean().optional(),useForms:o.boolean().optional(),useImages:o.boolean().optional(),isCopilot:o.boolean().optional(),responseLength:cr.optional()}).extend(L);var Fn=o.object({appId:o.string()}).extend(L);var Hn=o.union("conversationPreconditionType",{tags:Wn,metadata:lr,actionExecuted:Jn,responseConfig:Vn,app:Fn}).transform({transform:function(e){return e},untransform:function(e){return e}});var fr=o.union("preconditionType",{user:lr,conversation:o.object({value:Hn}),group:o.lazyObject(function(){return Gn})}).transform({transform:function(e){return e},untransform:function(e){return e}});var qn=o.enum_(["AND","OR"]);var Gn=o.object({operator:qn,preconditions:o.list(o.lazy(function(){return fr}))});var Oe=o.object({knowledgeBaseId:P,documentId:P,title:o.string().optional(),snippet:o.string().optional()});var $n=o.enum_(["OPEN","USER_RESOLVED","SYSTEM_RESOLVED","REGRESSED","IGNORED"]);var Ev=o.enum_(["DUPLICATE_DOCUMENT","MISSING_KNOWLEDGE"]);var Xn=o.enum_(["LOW","MEDIUM","HIGH"]);var pr=o.object({id:d});var Ie=o.object({documentInformation:Oe}).extend(pr);var mr=o.object({id:d,createdAt:o.date(),updatedAt:o.date(),status:$n,severity:Xn});var Yn=o.object({recommendedFixes:o.list(Ie),otherFixes:o.list(Ie),sourceDocument:Oe,documents:o.list(Oe)}).extend(mr);var dr=o.object({suggestedTextTitle:o.string(),suggestedText:o.string()}).extend(pr);var Qn=o.object({fix:dr,conversations:o.list(jn)}).extend(mr);var qv=o.union("type",{duplicateDocuments:Yn,missingKnowledge:Qn}).transform({transform:function(e){return e},untransform:function(e){return e}});var Qv=o.union("type",{addDocument:dr,deactivateDocument:Ie}).transform({transform:function(e){return e},untransform:function(e){return e}});var ex=o.object({greaterThanOrEqual:o.number().optional(),lessThan:o.number().optional()});import W from"../..";async function J(e){let r=e.headers.get("authorization").replace("Bearer ","");if(process.env.MAVENAGI_WEBHOOK_SECRET){let a=await crypto.subtle.importKey("raw",Buffer.from(process.env.MAVENAGI_WEBHOOK_SECRET,"base64"),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);await Re(r,a,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID});return}let n=\`https://developers\${process.env.ENVIRONMENT===void 0?"":\`.\${process.env.ENVIRONMENT==="sandbox"?\`\${process.env.SANDBOX_USER}.sb\`:process.env.ENVIRONMENT}\`}.mavenagi-apis.com/.well-known/jwks\`,i=Pr(new URL(n));await Re(r,i,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID})}async function JS(e){await J(e);let{organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:u,user:l,transientData:f}=Bo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{let p=await W.executeAction?.({organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:u,user:l,transientData:f});return new Response(JSON.stringify({response:p}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){return console.error(p),p instanceof Error?new Response(p.message,{status:500}):new Response("No result returned",{status:204})}}async function VS(e){await J(e);let{organizationId:r,agentId:t,settings:n,feedbacks:i}=go.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.feedbackCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,feedbacks:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function FS(e){await J(e);let{organizationId:r,agentId:t,settings:n,conversations:i}=Co.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.conversationCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,conversations:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function HS(e){await J(e);let{organizationId:r,agentId:t,settings:n,inboxItemIds:i}=ko.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.inboxItemCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,inboxItemIds:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function GS(e){await J(e);let{organizationId:r,agentId:t,settings:n,events:i}=Do.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.eventCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,events:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function qS(e){await J(e);let{organizationId:r,agentId:t,settings:n,knowledgeBaseId:i}=Lo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.knowledgeBaseRefreshed?.({organizationId:r,agentId:t,knowledgeBaseId:i,settings:n}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function $S(e){await J(e);let{organizationId:r,agentId:t,settings:n,conversationId:i,message:a}=yn.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.handleMessage?.({organizationId:r,agentId:t,conversationId:i,message:a,settings:n}),new Response(null)}catch(c){return console.error(c),c instanceof Error?new Response(c.message,{status:500}):new Response("Unknown error",{status:500})}}async function XS(e){await J(e);let{organizationId:r,agentId:t,settings:n}=lo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.postInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function YS(e){await J(e);let{organizationId:r,agentId:t,settings:n}=fo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.preInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function QS(e){await J(e);let{organizationId:r,agentId:t,settings:n}=po.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.uninstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}export{FS as conversationCreatedOrUpdated,GS as eventCreatedOrUpdated,JS as executeAction,VS as feedbackCreatedOrUpdated,$S as handleMessage,HS as inboxItemCreatedOrUpdated,qS as knowledgeBaseRefreshed,XS as postInstall,YS as preInstall,QS as uninstall};\n`},2613:t=>{t.exports=e(import.meta.url)("assert")},181:t=>{t.exports=e(import.meta.url)("buffer")},5317:t=>{t.exports=e(import.meta.url)("child_process")},4434:t=>{t.exports=e(import.meta.url)("events")},9896:t=>{t.exports=e(import.meta.url)("fs")},1943:t=>{t.exports=e(import.meta.url)("fs/promises")},857:t=>{t.exports=e(import.meta.url)("os")},6928:t=>{t.exports=e(import.meta.url)("path")},2203:t=>{t.exports=e(import.meta.url)("stream")},9023:t=>{t.exports=e(import.meta.url)("util")},9309:(e,t,r)=>{r.d(t,{o0:()=>detect});var n=r(9896);var o=r(6928);var i=r(5426);async function pathExists(e){try{await n.promises.access(e);return true}catch{return false}}var u=new Map;function hasGlobalInstallation(e){const t=`has_global_${e}`;if(u.has(t)){return Promise.resolve(u.get(t))}return i(e,["--version"]).then((e=>/^\d+.\d+.\d+$/.test(e.stdout))).then((e=>{u.set(t,e);return e})).catch((()=>false))}function getTypeofLockFile(e="."){const t=`lockfile_${e}`;if(u.has(t)){return Promise.resolve(u.get(t))}return Promise.all([pathExists((0,o.resolve)(e,"yarn.lock")),pathExists((0,o.resolve)(e,"package-lock.json")),pathExists((0,o.resolve)(e,"pnpm-lock.yaml")),pathExists((0,o.resolve)(e,"bun.lockb"))]).then((([e,r,n,o])=>{let i=null;if(e){i="yarn"}else if(n){i="pnpm"}else if(o){i="bun"}else if(r){i="npm"}u.set(t,i);return i}))}var detect=async({cwd:e,includeGlobalBun:t}={})=>{const r=await getTypeofLockFile(e);if(r){return r}const[n,o,i]=await Promise.all([hasGlobalInstallation("yarn"),hasGlobalInstallation("pnpm"),t&&hasGlobalInstallation("bun")]);if(n){return"yarn"}if(o){return"pnpm"}if(i){return"bun"}return"npm"};function getNpmVersion(e){return execa(e||"npm",["--version"]).then((e=>e.stdout))}function clearCache(){return u.clear()}},8745:(t,r,n)=>{n.d(r,{A:()=>It});var o=n(2613);const i={right:alignRight,center:alignCenter};const u=0;const s=1;const a=2;const c=3;class UI{constructor(e){var t;this.width=e.width;this.wrap=(t=e.wrap)!==null&&t!==void 0?t:true;this.rows=[]}span(...e){const t=this.div(...e);t.span=true}resetOutput(){this.rows=[]}div(...e){if(e.length===0){this.div("")}if(this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==="string"){return this.applyLayoutDSL(e[0])}const t=e.map((e=>{if(typeof e==="string"){return this.colFromString(e)}return e}));this.rows.push(t);return t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split("\n").map((e=>e.split("\t")));let r=0;t.forEach((e=>{if(e.length>1&&l.stringWidth(e[0])>r){r=Math.min(Math.floor(this.width*.5),l.stringWidth(e[0]))}}));t.forEach((e=>{this.div(...e.map(((t,n)=>({text:t.trim(),padding:this.measurePadding(t),width:n===0&&e.length>1?r:undefined}))))}));return this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=l.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];this.rows.forEach((t=>{this.rowToString(t,e)}));return e.filter((e=>!e.hidden)).map((e=>e.text)).join("\n")}rowToString(e,t){this.rasterize(e).forEach(((r,n)=>{let o="";r.forEach(((r,u)=>{const{width:a}=e[u];const D=this.negatePadding(e[u]);let f=r;if(D>l.stringWidth(r)){f+=" ".repeat(D-l.stringWidth(r))}if(e[u].align&&e[u].align!=="left"&&this.wrap){const t=i[e[u].align];f=t(f,D);if(l.stringWidth(f)<D){f+=" ".repeat((a||0)-l.stringWidth(f)-1)}}const d=e[u].padding||[0,0,0,0];if(d[c]){o+=" ".repeat(d[c])}o+=addBorder(e[u],f,"| ");o+=f;o+=addBorder(e[u],f," |");if(d[s]){o+=" ".repeat(d[s])}if(n===0&&t.length>0){o=this.renderInline(o,t[t.length-1])}}));t.push({text:o.replace(/ +$/,""),span:e.span})}));return t}renderInline(e,t){const r=e.match(/^ */);const n=r?r[0].length:0;const o=t.text;const i=l.stringWidth(o.trimRight());if(!t.span){return e}if(!this.wrap){t.hidden=true;return o+e}if(n<i){return e}t.hidden=true;return o.trimRight()+" ".repeat(n-i)+e.trimLeft()}rasterize(e){const t=[];const r=this.columnWidths(e);let n;e.forEach(((e,o)=>{e.width=r[o];if(this.wrap){n=l.wrap(e.text,this.negatePadding(e),{hard:true}).split("\n")}else{n=e.text.split("\n")}if(e.border){n.unshift("."+"-".repeat(this.negatePadding(e)+2)+".");n.push("'"+"-".repeat(this.negatePadding(e)+2)+"'")}if(e.padding){n.unshift(...new Array(e.padding[u]||0).fill(""));n.push(...new Array(e.padding[a]||0).fill(""))}n.forEach(((e,r)=>{if(!t[r]){t.push([])}const n=t[r];for(let e=0;e<o;e++){if(n[e]===undefined){n.push("")}}n.push(e)}))}));return t}negatePadding(e){let t=e.width||0;if(e.padding){t-=(e.padding[c]||0)+(e.padding[s]||0)}if(e.border){t-=4}return t}columnWidths(e){if(!this.wrap){return e.map((e=>e.width||l.stringWidth(e.text)))}let t=e.length;let r=this.width;const n=e.map((e=>{if(e.width){t--;r-=e.width;return e.width}return undefined}));const o=t?Math.floor(r/t):0;return n.map(((t,r)=>{if(t===undefined){return Math.max(o,_minWidth(e[r]))}return t}))}}function addBorder(e,t,r){if(e.border){if(/[.']-+[.']/.test(t)){return""}if(t.trim().length!==0){return r}return" "}return""}function _minWidth(e){const t=e.padding||[];const r=1+(t[c]||0)+(t[s]||0);if(e.border){return r+4}return r}function getWindowWidth(){if(typeof process==="object"&&process.stdout&&process.stdout.columns){return process.stdout.columns}return 80}function alignRight(e,t){e=e.trim();const r=l.stringWidth(e);if(r<t){return" ".repeat(t-r)+e}return e}function alignCenter(e,t){e=e.trim();const r=l.stringWidth(e);if(r>=t){return e}return" ".repeat(t-r>>1)+e}let l;function cliui(e,t){l=t;return new UI({width:(e===null||e===void 0?void 0:e.width)||getWindowWidth(),wrap:e===null||e===void 0?void 0:e.wrap})}function ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const r=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${t})`,"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?undefined:"g")}const D=ansiRegex();function stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}return e.replace(D,"")}function isAmbiguous(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function lookup_isFullWidth(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function lookup_isWide(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function lookup_getCategory(e){if(isAmbiguous(e))return"ambiguous";if(lookup_isFullWidth(e))return"fullwidth";if(e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518){return"halfwidth"}if(e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630){return"narrow"}if(lookup_isWide(e))return"wide";return"neutral"}function validate(e){if(!Number.isSafeInteger(e)){throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}}function eastAsianWidthType(e){validate(e);return getCategory(e)}function eastAsianWidth(e,{ambiguousAsWide:t=false}={}){validate(e);if(lookup_isFullWidth(e)||lookup_isWide(e)||t&&isAmbiguous(e)){return 2}return 1}const _isNarrowWidth=e=>!(isFullWidth(e)||isWide(e));var f=n(2732);const d=new Intl.Segmenter;const p=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of d.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(p.test(t)){continue}if(f().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}function ansi_regex_ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const r=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${t})`,"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?undefined:"g")}const h=ansi_regex_ansiRegex();function strip_ansi_stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}return e.replace(h,"")}var g=n(5470);const m=new Intl.Segmenter;const y=/^\p{Default_Ignorable_Code_Point}$/u;function string_width_stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=strip_ansi_stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of m.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(y.test(t)){continue}if(g().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}const F=10;const wrapAnsi16=(e=0)=>t=>`[${t+e}m`;const wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`;const wrapAnsi16m=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`;const b={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const E=Object.keys(b.modifier);const C=Object.keys(b.color);const v=Object.keys(b.bgColor);const w=[...C,...v];function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(b)){for(const[t,n]of Object.entries(r)){b[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=b[t];e.set(n[0],n[1])}Object.defineProperty(b,t,{value:r,enumerable:false})}Object.defineProperty(b,"codes",{value:e,enumerable:false});b.color.close="[39m";b.bgColor.close="[49m";b.color.ansi=wrapAnsi16();b.color.ansi256=wrapAnsi256();b.color.ansi16m=wrapAnsi16m();b.bgColor.ansi=wrapAnsi16(F);b.bgColor.ansi256=wrapAnsi256(F);b.bgColor.ansi16m=wrapAnsi16m(F);Object.defineProperties(b,{rgbToAnsi256:{value:(e,t,r)=>{if(e===t&&t===r){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:false},hexToRgb:{value:e=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t){return[0,0,0]}let[r]=t;if(r.length===3){r=[...r].map((e=>e+e)).join("")}const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>b.rgbToAnsi256(...b.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value:e=>{if(e<8){return 30+e}if(e<16){return 90+(e-8)}let t;let r;let n;if(e>=232){t=((e-232)*10+8)/255;r=t;n=t}else{e-=16;const o=e%36;t=Math.floor(e/36)/5;r=Math.floor(o/6)/5;n=o%6/5}const o=Math.max(t,r,n)*2;if(o===0){return 30}let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));if(o===2){i+=60}return i},enumerable:false},rgbToAnsi:{value:(e,t,r)=>b.ansi256ToAnsi(b.rgbToAnsi256(e,t,r)),enumerable:false},hexToAnsi:{value:e=>b.ansi256ToAnsi(b.hexToAnsi256(e)),enumerable:false}});return b}const A=assembleStyles();const O=A;const S=new Set(["",""]);const B=39;const j="";const k="[";const x="]";const P="m";const _=`${x}8;;`;const wrapAnsiCode=e=>`${S.values().next().value}${k}${e}${P}`;const wrapAnsiHyperlink=e=>`${S.values().next().value}${_}${e}${j}`;const wordLengths=e=>e.split(" ").map((e=>string_width_stringWidth(e)));const wrapWord=(e,t,r)=>{const n=[...t];let o=false;let i=false;let u=string_width_stringWidth(strip_ansi_stripAnsi(e.at(-1)));for(const[t,s]of n.entries()){const a=string_width_stringWidth(s);if(u+a<=r){e[e.length-1]+=s}else{e.push(s);u=0}if(S.has(s)){o=true;const e=n.slice(t+1,t+1+_.length).join("");i=e===_}if(o){if(i){if(s===j){o=false;i=false}}else if(s===P){o=false}continue}u+=a;if(u===r&&t<n.length-1){e.push("");u=0}}if(!u&&e.at(-1).length>0&&e.length>1){e[e.length-2]+=e.pop()}};const stringVisibleTrimSpacesRight=e=>{const t=e.split(" ");let r=t.length;while(r>0){if(string_width_stringWidth(t[r-1])>0){break}r--}if(r===t.length){return e}return t.slice(0,r).join(" ")+t.slice(r).join("")};const exec=(e,t,r={})=>{if(r.trim!==false&&e.trim()===""){return""}let n="";let o;let i;const u=wordLengths(e);let s=[""];for(const[n,o]of e.split(" ").entries()){if(r.trim!==false){s[s.length-1]=s.at(-1).trimStart()}let e=string_width_stringWidth(s.at(-1));if(n!==0){if(e>=t&&(r.wordWrap===false||r.trim===false)){s.push("");e=0}if(e>0||r.trim===false){s[s.length-1]+=" ";e++}}if(r.hard&&u[n]>t){const r=t-e;const i=1+Math.floor((u[n]-r-1)/t);const a=Math.floor((u[n]-1)/t);if(a<i){s.push("")}wrapWord(s,o,t);continue}if(e+u[n]>t&&e>0&&u[n]>0){if(r.wordWrap===false&&e<t){wrapWord(s,o,t);continue}s.push("")}if(e+u[n]>t&&r.wordWrap===false){wrapWord(s,o,t);continue}s[s.length-1]+=o}if(r.trim!==false){s=s.map((e=>stringVisibleTrimSpacesRight(e)))}const a=s.join("\n");const c=[...a];let l=0;for(const[e,t]of c.entries()){n+=t;if(S.has(t)){const{groups:e}=new RegExp(`(?:\\${k}(?<code>\\d+)m|\\${_}(?<uri>.*)${j})`).exec(a.slice(l))||{groups:{}};if(e.code!==undefined){const t=Number.parseFloat(e.code);o=t===B?undefined:t}else if(e.uri!==undefined){i=e.uri.length===0?undefined:e.uri}}const r=O.codes.get(Number(o));if(c[e+1]==="\n"){if(i){n+=wrapAnsiHyperlink("")}if(o&&r){n+=wrapAnsiCode(r)}}else if(t==="\n"){if(o&&r){n+=wrapAnsiCode(o)}if(i){n+=wrapAnsiHyperlink(i)}}l+=t.length}return n};function wrapAnsi(e,t,r){return String(e).normalize().replaceAll("\r\n","\n").split("\n").map((e=>exec(e,t,r))).join("\n")}function ui(e){return cliui(e,{stringWidth:stringWidth,stripAnsi:stripAnsi,wrap:wrapAnsi})}var I=n(6928);var T=n(9896);function sync(e,t){let r=(0,I.resolve)(".",e);let n,o=(0,T.statSync)(r);if(!o.isDirectory()){r=(0,I.dirname)(r)}while(true){n=t(r,(0,T.readdirSync)(r));if(n)return(0,I.resolve)(r,n);r=(0,I.dirname)(n=r);if(n===r)break}}var N=n(9023);const M=e(import.meta.url)("url");
|
|
2
|
+
import{createRequire as e}from"module";var t={140:(e,t,r)=>{const n=r(317);const o=r(835);const i=r(731);function spawn(e,t,r){const s=o(e,t,r);const a=n.spawn(s.command,s.args,s.options);i.hookChildProcess(a,s);return a}function spawnSync(e,t,r){const s=o(e,t,r);const a=n.spawnSync(s.command,s.args,s.options);a.error=a.error||i.verifyENOENTSync(a.status,s);return a}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=o;e.exports._enoent=i},731:e=>{const t=process.platform==="win32";function notFoundError(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function hookChildProcess(e,r){if(!t){return}const n=e.emit;e.emit=function(t,o){if(t==="exit"){const t=verifyENOENT(o,r);if(t){return n.call(e,"error",t)}}return n.apply(e,arguments)}}function verifyENOENT(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawn")}return null}function verifyENOENTSync(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawnSync")}return null}e.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},835:(e,t,r)=>{const n=r(928);const o=r(392);const i=r(78);const s=r(353);const a=process.platform==="win32";const u=/\.(?:com|exe)$/i;const c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(e){e.file=o(e);const t=e.file&&s(e.file);if(t){e.args.unshift(e.file);e.command=t;return o(e)}return e.file}function parseNonShell(e){if(!a){return e}const t=detectShebang(e);const r=!u.test(t);if(e.options.forceShell||r){const r=c.test(t);e.command=n.normalize(e.command);e.command=i.command(e.command);e.args=e.args.map((e=>i.argument(e,r)));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`];e.command=process.env.comspec||"cmd.exe";e.options.windowsVerbatimArguments=true}return e}function parse(e,t,r){if(t&&!Array.isArray(t)){r=t;t=null}t=t?t.slice(0):[];r=Object.assign({},r);const n={command:e,args:t,options:r,file:undefined,original:{command:e,args:t}};return r.shell?n:parseNonShell(n)}e.exports=parse},78:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(e){e=e.replace(t,"^$1");return e}function escapeArgument(e,r){e=`${e}`;e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');e=e.replace(/(?=(\\+?)?)\1$/,"$1$1");e=`"${e}"`;e=e.replace(t,"^$1");if(r){e=e.replace(t,"^$1")}return e}e.exports.command=escapeCommand;e.exports.argument=escapeArgument},353:(e,t,r)=>{const n=r(896);const o=r(27);function readShebang(e){const t=150;const r=Buffer.alloc(t);let i;try{i=n.openSync(e,"r");n.readSync(i,r,0,t,0);n.closeSync(i)}catch(e){}return o(r.toString())}e.exports=readShebang},392:(e,t,r)=>{const n=r(928);const o=r(266);const i=r(848);function resolveCommandAttempt(e,t){const r=e.options.env||process.env;const s=process.cwd();const a=e.options.cwd!=null;const u=a&&process.chdir!==undefined&&!process.chdir.disabled;if(u){try{process.chdir(e.options.cwd)}catch(e){}}let c;try{c=o.sync(e.command,{path:r[i({env:r})],pathExt:t?n.delimiter:undefined})}catch(e){}finally{if(u){process.chdir(s)}}if(c){c=n.resolve(a?e.options.cwd:"",c)}return c}function resolveCommand(e){return resolveCommandAttempt(e)||resolveCommandAttempt(e,true)}e.exports=resolveCommand},90:e=>{e.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},48:(e,t,r)=>{const n=r(928);const o=r(317);const i=r(140);const s=r(191);const a=r(98);const u=r(897);const c=r(918);const l=r(281);const{spawnedKill:f,spawnedCancel:d,setupTimeout:p,validateTimeout:h,setExitHandler:m}=r(526);const{handleInput:g,getSpawnedResult:D,makeAllStream:y,validateInputSync:b}=r(218);const{mergePromise:v,getSpawnedPromise:E}=r(985);const{joinCommand:w,parseCommand:F,getEscapedCommand:C}=r(777);const A=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{const i=t?{...process.env,...e}:e;if(r){return a.env({env:i,cwd:n,execPath:o})}return i};const handleArguments=(e,t,r={})=>{const o=i._parse(e,t,r);e=o.command;t=o.args;r=o.options;r={maxBuffer:A,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...r};r.env=getEnv(r);r.stdio=l(r);if(process.platform==="win32"&&n.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:r,parsed:o}};const handleOutput=(e,t,r)=>{if(typeof t!=="string"&&!Buffer.isBuffer(t)){return r===undefined?undefined:""}if(e.stripFinalNewline){return s(t)}return t};const execa=(e,t,r)=>{const n=handleArguments(e,t,r);const i=w(e,t);const s=C(e,t);h(n.options);let a;try{a=o.spawn(n.file,n.args,n.options)}catch(e){const t=new o.ChildProcess;const r=Promise.reject(c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:false,isCanceled:false,killed:false}));return v(t,r)}const l=E(a);const b=p(a,n.options,l);const F=m(a,n.options,b);const A={isCanceled:false};a.kill=f.bind(null,a.kill.bind(a));a.cancel=d.bind(null,a,A);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:r,timedOut:o},u,l,f]=await D(a,n.options,F);const d=handleOutput(n.options,u);const p=handleOutput(n.options,l);const h=handleOutput(n.options,f);if(e||t!==0||r!==null){const u=c({error:e,exitCode:t,signal:r,stdout:d,stderr:p,all:h,command:i,escapedCommand:s,parsed:n,timedOut:o,isCanceled:A.isCanceled,killed:a.killed});if(!n.options.reject){return u}throw u}return{command:i,escapedCommand:s,exitCode:0,stdout:d,stderr:p,all:h,failed:false,timedOut:false,isCanceled:false,killed:false}};const O=u(handlePromise);g(a,n.options.input);a.all=y(a,n.options);return v(a,O)};e.exports=execa;e.exports.sync=(e,t,r)=>{const n=handleArguments(e,t,r);const i=w(e,t);const s=C(e,t);b(n.options);let a;try{a=o.spawnSync(n.file,n.args,n.options)}catch(e){throw c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:false,isCanceled:false,killed:false})}const u=handleOutput(n.options,a.stdout,a.error);const l=handleOutput(n.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){const e=c({stdout:u,stderr:l,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:n,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:false,killed:a.signal!==null});if(!n.options.reject){return e}throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:u,stderr:l,failed:false,timedOut:false,isCanceled:false,killed:false}};e.exports.command=(e,t)=>{const[r,...n]=F(e);return execa(r,n,t)};e.exports.commandSync=(e,t)=>{const[r,...n]=F(e);return execa.sync(r,n,t)};e.exports.node=(e,t,r={})=>{if(t&&!Array.isArray(t)&&typeof t==="object"){r=t;t=[]}const n=l.node(r);const o=process.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:i=process.execPath,nodeOptions:s=o}=r;return execa(i,[...s,e,...Array.isArray(t)?t:[]],{...r,stdin:undefined,stdout:undefined,stderr:undefined,stdio:n,shell:false})}},777:e=>{const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const t=/^[\w.-]+$/;const r=/"/g;const escapeArg=e=>{if(typeof e!=="string"||t.test(e)){return e}return`"${e.replace(r,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const n=/ +/g;const parseCommand=e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${r}`}else{t.push(r)}}return t};e.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},918:(e,t,r)=>{const{signalsByName:n}=r(725);const getErrorPrefix=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:s})=>{if(e){return`timed out after ${t} milliseconds`}if(s){return"was canceled"}if(r!==undefined){return`failed with ${r}`}if(n!==undefined){return`was killed with ${n} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:r,error:o,signal:i,exitCode:s,command:a,escapedCommand:u,timedOut:c,isCanceled:l,killed:f,parsed:{options:{timeout:d}}})=>{s=s===null?undefined:s;i=i===null?undefined:i;const p=i===undefined?undefined:n[i].description;const h=o&&o.code;const m=getErrorPrefix({timedOut:c,timeout:d,errorCode:h,signal:i,signalDescription:p,exitCode:s,isCanceled:l});const g=`Command ${m}: ${a}`;const D=Object.prototype.toString.call(o)==="[object Error]";const y=D?`${g}\n${o.message}`:g;const b=[y,t,e].filter(Boolean).join("\n");if(D){o.originalMessage=o.message;o.message=b}else{o=new Error(b)}o.shortMessage=y;o.command=a;o.escapedCommand=u;o.exitCode=s;o.signal=i;o.signalDescription=p;o.stdout=e;o.stderr=t;if(r!==undefined){o.all=r}if("bufferedData"in o){delete o.bufferedData}o.failed=true;o.timedOut=Boolean(c);o.isCanceled=l;o.killed=f&&!c;return o};e.exports=makeError},526:(e,t,r)=>{const n=r(857);const o=r(859);const i=1e3*5;const spawnedKill=(e,t="SIGTERM",r={})=>{const n=e(t);setKillTimeout(e,t,r,n);return n};const setKillTimeout=(e,t,r,n)=>{if(!shouldForceKill(t,r,n)){return}const o=getForceKillAfterTimeout(r);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},r)=>isSigterm(e)&&t!==false&&r;const isSigterm=e=>e===n.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return i}if(!Number.isFinite(e)||e<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}return e};const spawnedCancel=(e,t)=>{const r=e.kill();if(r){t.isCanceled=true}};const timeoutKill=(e,t,r)=>{e.kill(t);r(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===undefined){return n}let o;const i=new Promise(((n,i)=>{o=setTimeout((()=>{timeoutKill(e,r,i)}),t)}));const s=n.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:r},n)=>{if(!t||r){return n}const i=o((()=>{e.kill()}));return n.finally((()=>{i()}))};e.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},985:e=>{const t=(async()=>{})().constructor.prototype;const r=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));const mergePromise=(e,t)=>{for(const[n,o]of r){const r=typeof t==="function"?(...e)=>Reflect.apply(o.value,t(),e):o.value.bind(t);Reflect.defineProperty(e,n,{...o,value:r})}return e};const getSpawnedPromise=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})}));e.on("error",(e=>{r(e)}));if(e.stdin){e.stdin.on("error",(e=>{r(e)}))}}));e.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},281:e=>{const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:r}=e;if(r===undefined){return t.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof r==="string"){return r}if(!Array.isArray(r)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``)}const n=Math.max(r.length,t.length);return Array.from({length:n},((e,t)=>r[t]))};e.exports=normalizeStdio;e.exports.node=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]}},218:(e,t,r)=>{const n=r(796);const o=r(144);const i=r(491);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(n(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const r=i();if(e.stdout){r.add(e.stdout)}if(e.stderr){r.add(e.stderr)}return r};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!e||!r){return}if(t){return o(e,{encoding:t,maxBuffer:n})}return o.buffer(e,{maxBuffer:n})};const getSpawnedResult=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},s)=>{const a=getStreamPromise(e,{encoding:n,buffer:o,maxBuffer:i});const u=getStreamPromise(t,{encoding:n,buffer:o,maxBuffer:i});const c=getStreamPromise(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,u,c])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},getBufferedData(e,a),getBufferedData(t,u),getBufferedData(r,c)])}};const validateInputSync=({input:e})=>{if(n(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};e.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},80:e=>{e.exports=function getCallerFile(e){if(e===void 0){e=2}if(e>=Error.stackTraceLimit){throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`")}var t=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var r=(new Error).stack;Error.prepareStackTrace=t;if(r!==null&&typeof r==="object"){return r[e]?r[e].getFileName():undefined}}},893:(e,t,r)=>{const{PassThrough:n}=r(203);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const o=r==="buffer";let i=false;if(t){i=!(r||o)}else{r=r||"utf8"}if(o){r=null}const s=new n({objectMode:i});if(r){s.setEncoding(r)}let a=0;const u=[];s.on("data",(e=>{u.push(e);if(i){a=u.length}else{a+=e.length}}));s.getBufferedValue=()=>{if(t){return u}return o?Buffer.concat(u,a):u.join("")};s.getBufferedLength=()=>a;return s}},144:(e,t,r)=>{const{constants:n}=r(181);const o=r(203);const{promisify:i}=r(23);const s=r(893);const a=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:r}=t;const o=s(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=n.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await a(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},599:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGNALS=void 0;const r=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];t.SIGNALS=r},725:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.signalsByNumber=t.signalsByName=void 0;var n=r(857);var o=r(863);var i=r(673);const getSignalsByName=function(){const e=(0,o.getSignals)();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:r,description:n,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:r,description:n,supported:o,action:i,forced:s,standard:a}}};const s=getSignalsByName();t.signalsByName=s;const getSignalsByNumber=function(){const e=(0,o.getSignals)();const t=i.SIGRTMAX+1;const r=Array.from({length:t},((t,r)=>getSignalByNumber(r,e)));return Object.assign({},...r)};const getSignalByNumber=function(e,t){const r=findSignalByNumber(e,t);if(r===undefined){return{}}const{name:n,description:o,supported:i,action:s,forced:a,standard:u}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:u}}};const findSignalByNumber=function(e,t){const r=t.find((({name:t})=>n.constants.signals[t]===e));if(r!==undefined){return r}return t.find((t=>t.number===e))};const a=getSignalsByNumber();t.signalsByNumber=a},673:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGRTMAX=t.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const e=n-r+1;return Array.from({length:e},getRealtimeSignal)};t.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:r+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const r=34;const n=64;t.SIGRTMAX=n},863:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getSignals=void 0;var n=r(857);var o=r(599);var i=r(673);const getSignals=function(){const e=(0,i.getRealtimeSignals)();const t=[...o.SIGNALS,...e].map(normalizeSignal);return t};t.getSignals=getSignals;const normalizeSignal=function({name:e,number:t,description:r,action:o,forced:i=false,standard:s}){const{signals:{[e]:a}}=n.constants;const u=a!==undefined;const c=u?a:t;return{name:e,number:c,description:r,supported:u,action:o,forced:i,standard:s}}},796:e=>{const isStream=e=>e!==null&&typeof e==="object"&&typeof e.pipe==="function";isStream.writable=e=>isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object";isStream.readable=e=>isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object";isStream.duplex=e=>isStream.writable(e)&&isStream.readable(e);isStream.transform=e=>isStream.duplex(e)&&typeof e._transform==="function";e.exports=isStream},867:(e,t,r)=>{var n=r(896);var o;if(process.platform==="win32"||global.TESTING_WINDOWS){o=r(182)}else{o=r(680)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,r){if(typeof t==="function"){r=t;t={}}if(!r){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(r,n){isexe(e,t||{},(function(e,t){if(e){n(e)}else{r(t)}}))}))}o(e,t||{},(function(e,n){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;n=false}}r(e,n)}))}function sync(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},680:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(896);function isexe(e,t,r){n.stat(e,(function(e,n){r(e,e?false:checkStat(n,t))}))}function sync(e,t){return checkStat(n.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var r=e.mode;var n=e.uid;var o=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var s=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var a=parseInt("100",8);var u=parseInt("010",8);var c=parseInt("001",8);var l=a|u;var f=r&c||r&u&&o===s||r&a&&n===i||r&l&&i===0;return f}},182:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(896);function checkPathExt(e,t){var r=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!r){return true}r=r.split(";");if(r.indexOf("")!==-1){return true}for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o){return true}}return false}function checkStat(e,t,r){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,r)}function isexe(e,t,r){n.stat(e,(function(n,o){r(n,n?false:checkStat(o,e,t))}))}function sync(e,t){return checkStat(n.statSync(e),e,t)}},491:(e,t,r)=>{const{PassThrough:n}=r(203);e.exports=function(){var e=[];var t=new n({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(r){if(Array.isArray(r)){r.forEach(add);return this}e.push(r);r.once("end",remove.bind(null,r));r.once("error",t.emit.bind(t,"error"));r.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(r){e=e.filter((function(e){return e!==r}));if(!e.length&&t.readable){t.end()}}}},12:e=>{const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},98:(e,t,r)=>{const n=r(928);const o=r(848);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[o()],execPath:process.execPath,...e};let t;let r=n.resolve(e.cwd);const i=[];while(t!==r){i.push(n.join(r,"node_modules/.bin"));t=r;r=n.resolve(r,"..")}const s=n.resolve(e.cwd,e.execPath,"..");i.push(s);return i.concat(e.path).join(n.delimiter)};e.exports=npmRunPath;e.exports["default"]=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const r={...t.env};const n=o({env:r});t.path=r[n];r[n]=e.exports(t);return r}},897:(e,t,r)=>{const n=r(12);const o=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let i=0;const s=e.displayName||e.name||"<anonymous>";const onetime=function(...n){o.set(onetime,++i);if(i===1){r=e.apply(this,n);e=null}else if(t.throw===true){throw new Error(`Function \`${s}\` can only be called once`)}return r};n(onetime,e);o.set(onetime,i);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!o.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return o.get(e)}},848:e=>{const pathKey=(e={})=>{const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports["default"]=pathKey},27:(e,t,r)=>{const n=r(910);e.exports=(e="")=>{const t=e.match(n);if(!t){return null}const[r,o]=t[0].replace(/#! ?/,"").split(" ");const i=r.split("/").pop();if(i==="env"){return o}return o?`${i} ${o}`:i}},910:e=>{e.exports=/^#!(.*)/},859:(e,t,r)=>{var n=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(n)){e.exports=function(){return function(){}}}else{var o=r(613);var i=r(190);var s=/^win/i.test(n.platform);var a=r(434);if(typeof a!=="function"){a=a.EventEmitter}var u;if(n.__signal_exit_emitter__){u=n.__signal_exit_emitter__}else{u=n.__signal_exit_emitter__=new a;u.count=0;u.emitted={}}if(!u.infinite){u.setMaxListeners(Infinity);u.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}o.equal(typeof e,"function","a callback must be provided for exit handler");if(d===false){p()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){u.removeListener(r,e);if(u.listeners("exit").length===0&&u.listeners("afterexit").length===0){c()}};u.on(r,e);return remove};var c=function unload(){if(!d||!processOk(global.process)){return}d=false;i.forEach((function(e){try{n.removeListener(e,f[e])}catch(e){}}));n.emit=g;n.reallyExit=h;u.count-=1};e.exports.unload=c;var l=function emit(e,t,r){if(u.emitted[e]){return}u.emitted[e]=true;u.emit(e,t,r)};var f={};i.forEach((function(e){f[e]=function listener(){if(!processOk(global.process)){return}var t=n.listeners(e);if(t.length===u.count){c();l("exit",null,e);l("afterexit",null,e);if(s&&e==="SIGHUP"){e="SIGINT"}n.kill(n.pid,e)}}}));e.exports.signals=function(){return i};var d=false;var p=function load(){if(d||!processOk(global.process)){return}d=true;u.count+=1;i=i.filter((function(e){try{n.on(e,f[e]);return true}catch(e){return false}}));n.emit=D;n.reallyExit=m};e.exports.load=p;var h=n.reallyExit;var m=function processReallyExit(e){if(!processOk(global.process)){return}n.exitCode=e||0;l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);h.call(n,n.exitCode)};var g=n.emit;var D=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){n.exitCode=t}var r=g.apply(this,arguments);l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);return r}else{return g.apply(this,arguments)}}}},190:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},191:e=>{e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},266:(e,t,r)=>{const n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const o=r(928);const i=n?";":":";const s=r(867);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||i;const o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const s=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const a=n?s.split(r):[""];if(n){if(e.indexOf(".")!==-1&&a[0]!=="")a.unshift("")}return{pathEnv:o,pathExt:a,pathExtExe:s}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:n,pathExt:i,pathExtExe:a}=getPathInfo(e,t);const u=[];const step=r=>new Promise(((i,s)=>{if(r===n.length)return t.all&&u.length?i(u):s(getNotFoundError(e));const a=n[r];const c=/^".*"$/.test(a)?a.slice(1,-1):a;const l=o.join(c,e);const f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;i(subStep(f,r,0))}));const subStep=(e,r,n)=>new Promise(((o,c)=>{if(n===i.length)return o(step(r+1));const l=i[n];s(e+l,{pathExt:a},((i,s)=>{if(!i&&s){if(t.all)u.push(e+l);else return o(e+l)}return o(subStep(e,r,n+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:i}=getPathInfo(e,t);const a=[];for(let u=0;u<r.length;u++){const c=r[u];const l=/^".*"$/.test(c)?c.slice(1,-1):c;const f=o.join(l,e);const d=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let e=0;e<n.length;e++){const r=d+n[e];try{const e=s.sync(r,{pathExt:i});if(e){if(t.all)a.push(r);else return r}}catch(e){}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},446:(e,t,r)=>{r.a(e,(async(e,t)=>{try{var n=r(317);var o=r.n(n);var i=r(943);var s=r.n(i);var a=r(153);var u=r(246);var c=r(757);const prepare=async()=>{await s().access("src").catch((()=>{throw new Error("src directory not found. Make sure all your source code is in the src directory.")}));await s().access("src/pages").then((()=>{throw new Error("pages directory found. Only NextJS App Router is supported. Convert your app to use App Router and delete the pages directory.")})).catch((()=>{}));await s().rm("src/app/mavenagi-cgi",{recursive:true,force:true});await s().mkdir("src/app/mavenagi-cgi",{recursive:true});await Promise.all([s().writeFile("src/app/mavenagi-cgi/next.ts",`// @ts-nocheck\n${c.S}`),...Object.entries({"pre-install":"preInstall","post-install":"postInstall",uninstall:"uninstall",feedbacks:"feedbackCreatedOrUpdated",conversations:"conversationCreatedOrUpdated","inbox-items":"inboxItemCreatedOrUpdated",events:"eventCreatedOrUpdated","execute-action":"executeAction","knowledge-base-refreshed":"knowledgeBaseRefreshed","handle-message":"handleMessage"}).map((async([e,t])=>{await s().mkdir(`src/app/mavenagi-cgi/v1/${e}`,{recursive:true});const r=await s().readFile(`src/index.ts`,"utf8");const n=r.includes("export const runtime = 'edge'")||r.includes('export const runtime = "edge"');if(n){throw new Error("Edge runtime is no longer supported. Remove the runtime export from index.ts.")}await s().writeFile(`src/app/mavenagi-cgi/v1/${e}/route.ts`,`// @ts-nocheck\nimport {${t}} from '../../next'\nimport userWorker from '../../../..'\n\nexport const POST = ${t}\n`)}))])};await(0,u.A)(process.argv.slice(2)).scriptName("mavenagi").usage("$0 <cmd> [args]").command("build","build",(async()=>{await prepare();(0,n.execFileSync)(await(0,a.o0)(),["run","build"],{stdio:"inherit"});process.exit(0)})).command("dev","dev",(async()=>{await prepare();(0,n.execFileSync)(await(0,a.o0)(),["run","dev"],{stdio:"inherit"});process.exit(0)})).help().argv;t()}catch(e){t(e)}}),1)},757:(e,t,r)=>{r.d(t,{S:()=>n});const n=`var Aa=Object.defineProperty;var Pa=(e,r)=>{for(var o in r)Aa(e,o,{get:r[o],enumerable:!0})};var we=new TextEncoder,Q=new TextDecoder,Uu=2**32;function zt(...e){let r=e.reduce((i,{length:a})=>i+a,0),o=new Uint8Array(r),n=0;for(let i of e)o.set(i,n),n+=i.length;return o}function Me(e){let r=new Uint8Array(e.length);for(let o=0;o<e.length;o++){let n=e.charCodeAt(o);if(n>127)throw new TypeError("non-ASCII string encountered in encode()");r[o]=n}return r}function At(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let r=atob(e),o=new Uint8Array(r.length);for(let n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}function te(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:Q.decode(e),{alphabet:"base64url"});let r=e;r instanceof Uint8Array&&(r=Q.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/");try{return At(r)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}var N=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(r,o){super(r,o),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},k=class extends N{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(r,o,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:o}}),this.claim=n,this.reason=i,this.payload=o}},Ee=class extends N{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(r,o,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:o}}),this.claim=n,this.reason=i,this.payload=o}},Ke=class extends N{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},C=class extends N{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var z=class extends N{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},ue=class extends N{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var Ie=class extends N{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},le=class extends N{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(r="no applicable key found in the JSON Web Key Set",o){super(r,o)}},Le=class extends N{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(r="multiple matching keys found in the JSON Web Key Set",o){super(r,o)}},We=class extends N{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(r="request timed out",o){super(r,o)}},Fe=class extends N{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(r="signature verification failed",o){super(r,o)}};var V=(e,r="algorithm.name")=>new TypeError(\`CryptoKey does not support this operation, its \${r} must be \${e}\`),fe=(e,r)=>e.name===r;function Br(e){return parseInt(e.name.slice(4),10)}function Ta(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function Ra(e,r){if(r&&!e.usages.includes(r))throw new TypeError(\`CryptoKey does not support this operation, its usages must include \${r}.\`)}function Pt(e,r,o){switch(r){case"HS256":case"HS384":case"HS512":{if(!fe(e.algorithm,"HMAC"))throw V("HMAC");let n=parseInt(r.slice(2),10);if(Br(e.algorithm.hash)!==n)throw V(\`SHA-\${n}\`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!fe(e.algorithm,"RSASSA-PKCS1-v1_5"))throw V("RSASSA-PKCS1-v1_5");let n=parseInt(r.slice(2),10);if(Br(e.algorithm.hash)!==n)throw V(\`SHA-\${n}\`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!fe(e.algorithm,"RSA-PSS"))throw V("RSA-PSS");let n=parseInt(r.slice(2),10);if(Br(e.algorithm.hash)!==n)throw V(\`SHA-\${n}\`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!fe(e.algorithm,"Ed25519"))throw V("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!fe(e.algorithm,r))throw V(r);break}case"ES256":case"ES384":case"ES512":{if(!fe(e.algorithm,"ECDSA"))throw V("ECDSA");let n=Ta(r);if(e.algorithm.namedCurve!==n)throw V(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Ra(e,o)}function Tt(e,r,...o){if(o=o.filter(Boolean),o.length>2){let n=o.pop();e+=\`one of type \${o.join(", ")}, or \${n}.\`}else o.length===2?e+=\`one of type \${o[0]} or \${o[1]}.\`:e+=\`of type \${o[0]}.\`;return r==null?e+=\` Received \${r}\`:typeof r=="function"&&r.name?e+=\` Received function \${r.name}\`:typeof r=="object"&&r!=null&&r.constructor?.name&&(e+=\` Received an instance of \${r.constructor.name}\`),e}var Rt=(e,...r)=>Tt("Key must be ",e,...r),Mr=(e,r,...o)=>Tt(\`Key for the \${e} algorithm must be \`,r,...o);var Kr=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},Lr=e=>e?.[Symbol.toStringTag]==="KeyObject",Wr=e=>Kr(e)||Lr(e);function jt(...e){let r=e.filter(Boolean);if(r.length===0||r.length===1)return!0;let o;for(let n of r){let i=Object.keys(n);if(!o||o.size===0){o=new Set(i);continue}for(let a of i){if(o.has(a))return!1;o.add(a)}}return!0}var ja=e=>typeof e=="object"&&e!==null;function U(e){if(!ja(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ct(e,r){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:o}=r.algorithm;if(typeof o!="number"||o<2048)throw new TypeError(\`\${e} requires key modulusLength to be 2048 bits or larger\`)}}function Ca(e){let r,o;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":r={name:e.alg},o=e.priv?["sign"]:["verify"];break;default:throw new C('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:\`SHA-\${e.alg.slice(-3)}\`},o=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:\`SHA-\${e.alg.slice(-3)}\`},o=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:\`SHA-\${parseInt(e.alg.slice(-3),10)||1}\`},o=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new C('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":r={name:"ECDSA",namedCurve:"P-256"},o=e.d?["sign"]:["verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},o=e.d?["sign"]:["verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},o=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:e.crv},o=e.d?["deriveBits"]:[];break;default:throw new C('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":r={name:"Ed25519"},o=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:e.crv},o=e.d?["deriveBits"]:[];break;default:throw new C('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new C('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:o}}async function me(e){if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:o}=Ca(e),n={...e};return n.kty!=="AKP"&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,r,e.ext??!(e.d||e.priv),e.key_ops??o)}async function Nt(e,r,o){if(!U(e))throw new TypeError("JWK must be an object");let n;switch(r??=e.alg,n??=o?.extractable??e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return te(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new C('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return me({...e,alg:r,ext:n});case"AKP":{if(typeof e.alg!="string"||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(r!==void 0&&r!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return me({...e,ext:n})}case"EC":case"OKP":return me({...e,alg:r,ext:n});default:throw new C('Unsupported "kty" (Key Type) Parameter value')}}function Ut(e,r,o,n,i){if(i.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return new Set;if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(s=>typeof s!="string"||s.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;o!==void 0?a=new Map([...Object.entries(o),...r.entries()]):a=r;for(let s of n.crit){if(!a.has(s))throw new C(\`Extension Header Parameter "\${s}" is not recognized\`);if(i[s]===void 0)throw new e(\`Extension Header Parameter "\${s}" is missing\`);if(a.get(s)&&n[s]===void 0)throw new e(\`Extension Header Parameter "\${s}" MUST be integrity protected\`)}return new Set(n.crit)}function Dt(e,r){if(r!==void 0&&(!Array.isArray(r)||r.some(o=>typeof o!="string")))throw new TypeError(\`"\${e}" option must be an array of strings\`);if(r)return new Set(r)}var Oe=e=>U(e)&&typeof e.kty=="string",kt=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),Bt=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,Mt=e=>e.kty==="oct"&&typeof e.k=="string";var pe,Kt=async(e,r,o,n=!1)=>{pe||=new WeakMap;let i=pe.get(e);if(i?.[o])return i[o];let a=await me({...r,alg:o});return n&&Object.freeze(e),i?i[o]=a:pe.set(e,{[o]:a}),a},Ua=(e,r)=>{pe||=new WeakMap;let o=pe.get(e);if(o?.[r])return o[r];let n=e.type==="public",i=!!n,a;if(e.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}a=e.toCryptoKey(e.asymmetricKeyType,i,n?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(r!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let s;switch(r){case"RSA-OAEP":s="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":s="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":s="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":s="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:s},i,n?["encrypt"]:["decrypt"]);a=e.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:s},i,[n?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){let u=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!u)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&u==="P-256"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES384"&&u==="P-384"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES512"&&u==="P-521"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r.startsWith("ECDH-ES")&&(a=e.toCryptoKey({name:"ECDH",namedCurve:u},i,n?[]:["deriveBits"]))}if(!a)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return o?o[r]=a:pe.set(e,{[r]:a}),a};async function Lt(e,r){if(e instanceof Uint8Array||Kr(e))return e;if(Lr(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return Ua(e,r)}catch(n){if(n instanceof TypeError)throw n}let o=e.export({format:"jwk"});return Kt(e,o,r)}if(Oe(e))return e.k?te(e.k):Kt(e,e,r,!0);throw new Error("unreachable")}var de=e=>e?.[Symbol.toStringTag],Fr=(e,r,o)=>{if(r.use!==void 0){let n;switch(o){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(r.use!==n)throw new TypeError(\`Invalid key for this operation, its "use" must be "\${n}" when present\`)}if(r.alg!==void 0&&r.alg!==e)throw new TypeError(\`Invalid key for this operation, its "alg" must be "\${e}" when present\`);if(Array.isArray(r.key_ops)){let n;switch(!0){case(o==="sign"||o==="verify"):case e==="dir":case e.includes("CBC-HS"):n=o;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?n=o==="encrypt"?"wrapKey":"unwrapKey":n=o;break;case(o==="encrypt"&&e.startsWith("RSA")):n="wrapKey";break;case o==="decrypt":n=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(n&&r.key_ops?.includes?.(n)===!1)throw new TypeError(\`Invalid key for this operation, its "key_ops" must include "\${n}" when present\`)}return!0},Da=(e,r,o)=>{if(!(r instanceof Uint8Array)){if(Oe(r)){if(Mt(r)&&Fr(e,r,o))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Wr(r))throw new TypeError(Mr(e,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError(\`\${de(r)} instances for symmetric algorithms must be of type "secret"\`)}},ka=(e,r,o)=>{if(Oe(r))switch(o){case"decrypt":case"sign":if(kt(r)&&Fr(e,r,o))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(Bt(r)&&Fr(e,r,o))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Wr(r))throw new TypeError(Mr(e,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError(\`\${de(r)} instances for asymmetric algorithms must not be of type "secret"\`);if(r.type==="public")switch(o){case"sign":throw new TypeError(\`\${de(r)} instances for asymmetric algorithm signing must be of type "private"\`);case"decrypt":throw new TypeError(\`\${de(r)} instances for asymmetric algorithm decryption must be of type "private"\`)}if(r.type==="private")switch(o){case"verify":throw new TypeError(\`\${de(r)} instances for asymmetric algorithm verifying must be of type "public"\`);case"encrypt":throw new TypeError(\`\${de(r)} instances for asymmetric algorithm encryption must be of type "public"\`)}};function Wt(e,r,o){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":Da(e,r,o);break;default:ka(e,r,o)}}function Ft(e,r){let o=\`SHA-\${e.slice(-3)}\`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:o,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:o,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:o,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:o,name:"ECDSA",namedCurve:r.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new C(\`alg \${e} is not supported either by JOSE or your javascript runtime\`)}}async function Ht(e,r,o){if(r instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Rt(r,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",r,{hash:\`SHA-\${e.slice(-3)}\`,name:"HMAC"},!1,[o])}return Pt(r,e,o),r}async function Vt(e,r,o,n){let i=await Ht(e,r,"verify");Ct(e,i);let a=Ft(e,i.algorithm);try{return await crypto.subtle.verify(a,i,o,n)}catch{return!1}}async function Jt(e,r,o){if(!U(e))throw new z("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new z('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new z("JWS Protected Header incorrect type");if(e.payload===void 0)throw new z("JWS Payload missing");if(typeof e.signature!="string")throw new z("JWS Signature missing or incorrect type");if(e.header!==void 0&&!U(e.header))throw new z("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{let x=te(e.protected);n=JSON.parse(Q.decode(x))}catch{throw new z("JWS Protected Header is invalid")}if(!jt(n,e.header))throw new z("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...e.header},a=Ut(z,new Map([["b64",!0]]),o?.crit,n,i),s=!0;if(a.has("b64")&&(s=n.b64,typeof s!="boolean"))throw new z('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=i;if(typeof u!="string"||!u)throw new z('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=o&&Dt("algorithms",o.algorithms);if(l&&!l.has(u))throw new Ke('"alg" (Algorithm) Header Parameter value not allowed');if(s){if(typeof e.payload!="string")throw new z("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new z("JWS Payload must be a string or an Uint8Array instance");let m=!1;typeof r=="function"&&(r=await r(n,e),m=!0),Wt(u,r,"verify");let f=zt(e.protected!==void 0?Me(e.protected):new Uint8Array,Me("."),typeof e.payload=="string"?s?Me(e.payload):we.encode(e.payload):e.payload),d;try{d=te(e.signature)}catch{throw new z("Failed to base64url decode the signature")}let y=await Lt(r,u);if(!await Vt(u,y,d,f))throw new Fe;let p;if(s)try{p=te(e.payload)}catch{throw new z("Failed to base64url decode the payload")}else typeof e.payload=="string"?p=we.encode(e.payload):p=e.payload;let v={payload:p};return e.protected!==void 0&&(v.protectedHeader=n),e.header!==void 0&&(v.unprotectedHeader=e.header),m?{...v,key:y}:v}async function Gt(e,r,o){if(e instanceof Uint8Array&&(e=Q.decode(e)),typeof e!="string")throw new z("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:a,length:s}=e.split(".");if(s!==3)throw new z("Invalid Compact JWS");let u=await Jt({payload:i,protected:n,signature:a},r,o),l={payload:u.payload,protectedHeader:u.protectedHeader};return typeof r=="function"?{...l,key:u.key}:l}var Ba=e=>Math.floor(e.getTime()/1e3),Yt=60,Xt=Yt*60,Hr=Xt*24,Ma=Hr*7,Ka=Hr*365.25,La=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function qt(e){let r=La.exec(e);if(!r||r[4]&&r[1])throw new TypeError("Invalid time period format");let o=parseFloat(r[2]),n=r[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(o);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(o*Yt);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(o*Xt);break;case"day":case"days":case"d":i=Math.round(o*Hr);break;case"week":case"weeks":case"w":i=Math.round(o*Ma);break;default:i=Math.round(o*Ka);break}return r[1]==="-"||r[4]==="ago"?-i:i}var $t=e=>e.includes("/")?e.toLowerCase():\`application/\${e.toLowerCase()}\`,Wa=(e,r)=>typeof e=="string"?r.includes(e):Array.isArray(e)?r.some(Set.prototype.has.bind(new Set(e))):!1;function Qt(e,r,o={}){let n;try{n=JSON.parse(Q.decode(r))}catch{}if(!U(n))throw new ue("JWT Claims Set must be a top-level JSON object");let{typ:i}=o;if(i&&(typeof e.typ!="string"||$t(e.typ)!==$t(i)))throw new k('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:s,subject:u,audience:l,maxTokenAge:m}=o,f=[...a];m!==void 0&&f.push("iat"),l!==void 0&&f.push("aud"),u!==void 0&&f.push("sub"),s!==void 0&&f.push("iss");for(let p of new Set(f.reverse()))if(!(p in n))throw new k(\`missing required "\${p}" claim\`,n,p,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new k('unexpected "iss" claim value',n,"iss","check_failed");if(u&&n.sub!==u)throw new k('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!Wa(n.aud,typeof l=="string"?[l]:l))throw new k('unexpected "aud" claim value',n,"aud","check_failed");let d;switch(typeof o.clockTolerance){case"string":d=qt(o.clockTolerance);break;case"number":d=o.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:y}=o,b=Ba(y||new Date);if((n.iat!==void 0||m)&&typeof n.iat!="number")throw new k('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new k('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>b+d)throw new k('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new k('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=b-d)throw new Ee('"exp" claim timestamp check failed',n,"exp","check_failed")}if(m){let p=b-n.iat,v=typeof m=="number"?m:qt(m);if(p-d>v)throw new Ee('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(p<0-d)throw new k('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}async function He(e,r,o){let n=await Gt(e,r,o);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new ue("JWTs MUST NOT use unencoded payload");let a={payload:Qt(n.protectedHeader,n.payload,o),protectedHeader:n.protectedHeader};return typeof r=="function"?{...a,key:n.key}:a}function Fa(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new C('Unsupported "alg" value for a JSON Web Key Set')}}function Ha(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(Va)}function Va(e){return U(e)}var Vr=class{#t;#a=new WeakMap;constructor(r){if(!Ha(r))throw new Ie("JSON Web Key Set malformed");this.#t=structuredClone(r)}jwks(){return this.#t}async getKey(r,o){let{alg:n,kid:i}={...r,...o?.header},a=Fa(n),s=this.#t.keys.filter(m=>{let f=a===m.kty;if(f&&typeof i=="string"&&(f=i===m.kid),f&&(typeof m.alg=="string"||a==="AKP")&&(f=n===m.alg),f&&typeof m.use=="string"&&(f=m.use==="sig"),f&&Array.isArray(m.key_ops)&&(f=m.key_ops.includes("verify")),f)switch(n){case"ES256":f=m.crv==="P-256";break;case"ES384":f=m.crv==="P-384";break;case"ES512":f=m.crv==="P-521";break;case"Ed25519":case"EdDSA":f=m.crv==="Ed25519";break}return f}),{0:u,length:l}=s;if(l===0)throw new le;if(l!==1){let m=new Le,f=this.#a;throw m[Symbol.asyncIterator]=async function*(){for(let d of s)try{yield await Zt(f,d,n)}catch{}},m}return Zt(this.#a,u,n)}};async function Zt(e,r,o){let n=e.get(r)||e.set(r,{}).get(r);if(n[o]===void 0){let i=await Nt({...r,ext:!0},o);if(i instanceof Uint8Array||i.type!=="public")throw new Ie("JSON Web Key Set members must be public keys");n[o]=i}return n[o]}function Jr(e){let r=new Vr(e),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{jwks:{value:()=>structuredClone(r.jwks()),enumerable:!1,configurable:!1,writable:!1}}),o}function Ja(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var Gr;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Gr="jose/v6.1.3");var eo=Symbol();async function Ga(e,r,o,n=fetch){let i=await n(e,{method:"GET",signal:o,redirect:"manual",headers:r}).catch(a=>{throw a.name==="TimeoutError"?new We:a});if(i.status!==200)throw new N("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new N("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var Ve=Symbol();function qa(e,r){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=r||!("jwks"in e)||!U(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,U))}var qr=class{#t;#a;#c;#s;#o;#e;#r;#u;#n;#i;constructor(r,o){if(!(r instanceof URL))throw new TypeError("url must be an instance of URL");this.#t=new URL(r.href),this.#a=typeof o?.timeoutDuration=="number"?o?.timeoutDuration:5e3,this.#c=typeof o?.cooldownDuration=="number"?o?.cooldownDuration:3e4,this.#s=typeof o?.cacheMaxAge=="number"?o?.cacheMaxAge:6e5,this.#r=new Headers(o?.headers),Gr&&!this.#r.has("User-Agent")&&this.#r.set("User-Agent",Gr),this.#r.has("accept")||(this.#r.set("accept","application/json"),this.#r.append("accept","application/jwk-set+json")),this.#u=o?.[eo],o?.[Ve]!==void 0&&(this.#i=o?.[Ve],qa(o?.[Ve],this.#s)&&(this.#o=this.#i.uat,this.#n=Jr(this.#i.jwks)))}pendingFetch(){return!!this.#e}coolingDown(){return typeof this.#o=="number"?Date.now()<this.#o+this.#c:!1}fresh(){return typeof this.#o=="number"?Date.now()<this.#o+this.#s:!1}jwks(){return this.#n?.jwks()}async getKey(r,o){(!this.#n||!this.fresh())&&await this.reload();try{return await this.#n(r,o)}catch(n){if(n instanceof le&&this.coolingDown()===!1)return await this.reload(),this.#n(r,o);throw n}}async reload(){this.#e&&Ja()&&(this.#e=void 0),this.#e||=Ga(this.#t.href,this.#r,AbortSignal.timeout(this.#a),this.#u).then(r=>{this.#n=Jr(r),this.#i&&(this.#i.uat=Date.now(),this.#i.jwks=r),this.#o=Date.now(),this.#e=void 0}).catch(r=>{throw this.#e=void 0,r}),await this.#e}};function $r(e,r){let o=new qr(e,r),n=async(i,a)=>o.getKey(i,a);return Object.defineProperties(n,{coolingDown:{get:()=>o.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>o.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>o.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>o.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>o.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}function Yr(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function $a(e){if(Array.isArray(e))return Yr(e)}function oo(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function ro(e,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function no(e,r,o){return r&&ro(e.prototype,r),o&&ro(e,o),e}function se(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Ya(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oe(e){return $a(e)||Ya(e)||Qa(e)||Xa()}function Qa(e,r){if(e){if(typeof e=="string")return Yr(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Yr(e,r)}}var Z={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},ye,to=(ye={},se(ye,Z.Debug,1),se(ye,Z.Info,2),se(ye,Z.Warn,3),se(ye,Z.Error,4),ye),Za=(function(){"use strict";function e(){oo(this,e)}return no(e,[{key:"debug",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var s;(s=console).debug.apply(s,[o].concat(oe(i)))}},{key:"info",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var s;(s=console).info.apply(s,[o].concat(oe(i)))}},{key:"warn",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var s;(s=console).warn.apply(s,[o].concat(oe(i)))}},{key:"error",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var s;(s=console).error.apply(s,[o].concat(oe(i)))}}]),e})(),es=(function(){"use strict";function e(r){oo(this,e),se(this,"level",void 0),se(this,"logger",void 0),se(this,"silent",void 0),this.level=to[r.level],this.logger=r.logger,this.silent=r.silent}return no(e,[{key:"shouldLog",value:function(o){return!this.silent&&this.level<=to[o]}},{key:"isDebug",value:function(){return this.shouldLog(Z.Debug)}},{key:"debug",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(this.isDebug()){var s;(s=this.logger).debug.apply(s,[o].concat(oe(i)))}}},{key:"isInfo",value:function(){return this.shouldLog(Z.Info)}},{key:"info",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(this.isInfo()){var s;(s=this.logger).info.apply(s,[o].concat(oe(i)))}}},{key:"isWarn",value:function(){return this.shouldLog(Z.Warn)}},{key:"warn",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(this.isWarn()){var s;(s=this.logger).warn.apply(s,[o].concat(oe(i)))}}},{key:"isError",value:function(){return this.shouldLog(Z.Error)}},{key:"error",value:function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(this.isError()){var s;(s=this.logger).error.apply(s,[o].concat(oe(i)))}}}]),e})();var cf=new es({level:Z.Info,logger:new Za,silent:!0});function et(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function ns(e){if(Array.isArray(e))return e}function is(e){if(Array.isArray(e))return et(e)}function as(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function io(e,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ss(e,r,o){return r&&io(e.prototype,r),o&&io(e,o),e}function cs(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function us(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function ls(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fs(e,r){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var n=[],i=!0,a=!1,s,u;try{for(o=o.call(e);!(i=(s=o.next()).done)&&(n.push(s.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(a)throw u}}return n}}function ms(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ps(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Qr(e,r){return ns(e)||fs(e,r)||ao(e,r)||ms()}function ds(e){return is(e)||ls(e)||ao(e)||ps()}function ao(e,r){if(e){if(typeof e=="string")return et(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return et(e,r)}}function Zr(e,r){var o,n,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype),u=Object.defineProperty;return u(s,"next",{value:l(0)}),u(s,"throw",{value:l(1)}),u(s,"return",{value:l(2)}),typeof Symbol=="function"&&u(s,Symbol.iterator,{value:function(){return this}}),s;function l(f){return function(d){return m([f,d])}}function m(f){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(a=0)),a;)try{if(o=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return a.label++,{value:f[1],done:!1};case 5:a.label++,n=f[1],f=[0];continue;case 7:f=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){a=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){a.label=f[1];break}if(f[0]===6&&a.label<i[1]){a.label=i[1],i=f;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(f);break}i[2]&&a.ops.pop(),a.trys.pop();continue}f=r.call(e,a)}catch(d){f=[6,d],n=0}finally{o=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function ys(e){var r=typeof Symbol=="function"&&Symbol.iterator,o=r&&e[r],n=0;if(o)return o.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}var be;typeof globalThis.Headers<"u"?be=globalThis.Headers:be=(function(){"use strict";function e(r){var o=this;if(as(this,e),cs(this,"headers",void 0),this.headers=new Map,r)if(us(r,e))r.forEach(function(S,B){return o.append(B,S)});else if(Array.isArray(r)){var n=!0,i=!1,a=void 0;try{for(var s=r[Symbol.iterator](),u;!(n=(u=s.next()).done);n=!0){var l=Qr(u.value,2),m=l[0],f=l[1];if(typeof m=="string"&&typeof f=="string")this.append(m,f);else throw new TypeError("Each header entry must be a [string, string] tuple")}}catch(S){i=!0,a=S}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw a}}}else{var d=!0,y=!1,b=void 0;try{for(var p=Object.entries(r)[Symbol.iterator](),v;!(d=(v=p.next()).done);d=!0){var x=Qr(v.value,2),A=x[0],I=x[1];if(typeof I=="string")this.append(A,I);else throw new TypeError("Header values must be strings")}}catch(S){y=!0,b=S}finally{try{!d&&p.return!=null&&p.return()}finally{if(y)throw b}}}}return ss(e,[{key:"append",value:function(o,n){var i=o.toLowerCase(),a=this.headers.get(i)||[];this.headers.set(i,ds(a).concat([n]))}},{key:"delete",value:function(o){var n=o.toLowerCase();this.headers.delete(n)}},{key:"get",value:function(o){var n=o.toLowerCase(),i=this.headers.get(n);return i?i.join(", "):null}},{key:"has",value:function(o){var n=o.toLowerCase();return this.headers.has(n)}},{key:"set",value:function(o,n){var i=o.toLowerCase();this.headers.set(i,[n])}},{key:"forEach",value:function(o,n){var i=this,a=n?o.bind(n):o;this.headers.forEach(function(s,u){return a(s.join(", "),u,i)})}},{key:"getSetCookie",value:function(){return this.headers.get("set-cookie")||[]}},{key:"entries",value:function(){var o,n,i,a,s,u,l,m,f;return Zr(this,function(d){switch(d.label){case 0:o=!0,n=!1,i=void 0,d.label=1;case 1:d.trys.push([1,6,7,8]),a=this.headers.entries()[Symbol.iterator](),d.label=2;case 2:return(o=(s=a.next()).done)?[3,5]:(u=Qr(s.value,2),l=u[0],m=u[1],[4,[l,m.join(", ")]]);case 3:d.sent(),d.label=4;case 4:return o=!0,[3,2];case 5:return[3,8];case 6:return f=d.sent(),n=!0,i=f,[3,8];case 7:try{!o&&a.return!=null&&a.return()}finally{if(n)throw i}return[7];case 8:return[2]}})}},{key:"keys",value:function(){return Zr(this,function(o){switch(o.label){case 0:return[5,ys(this.headers.keys())];case 1:return o.sent(),[2]}})}},{key:"values",value:function(){var o,n,i,a,s,u,l;return Zr(this,function(m){switch(m.label){case 0:o=!0,n=!1,i=void 0,m.label=1;case 1:m.trys.push([1,6,7,8]),a=this.headers.values()[Symbol.iterator](),m.label=2;case 2:return(o=(s=a.next()).done)?[3,5]:(u=s.value,[4,u.join(", ")]);case 3:m.sent(),m.label=4;case 4:return o=!0,[3,2];case 5:return[3,8];case 6:return l=m.sent(),n=!0,i=l,[3,8];case 7:try{!o&&a.return!=null&&a.return()}finally{if(n)throw i}return[7];case 8:return[2]}})}},{key:Symbol.iterator,value:function(){return this.entries()}}]),e})();var so={headers:new be,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""},co={headers:new be,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function rt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function Ss(e){if(Array.isArray(e))return rt(e)}function _s(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lo(e,r,o,n,i,a,s){try{var u=e[a](s),l=u.value}catch(m){o(m);return}u.done?r(l):Promise.resolve(l).then(n,i)}function ws(e){return function(){var r=this,o=arguments;return new Promise(function(n,i){var a=e.apply(r,o);function s(l){lo(a,n,i,s,u,"next",l)}function u(l){lo(a,n,i,s,u,"throw",l)}s(void 0)})}}function Es(e,r,o){return r=ze(r),Rs(e,ot()?Reflect.construct(r,o||[],ze(e).constructor):r.apply(e,o))}function Is(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Je(e,r,o){return ot()?Je=Reflect.construct:Je=function(i,a,s){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),m=new l;return s&&Ae(m,s.prototype),m},Je.apply(null,arguments)}function fo(e,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Os(e,r,o){return r&&fo(e.prototype,r),o&&fo(e,o),e}function mo(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function ze(e){return ze=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},ze(e)}function zs(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&Ae(e,r)}function As(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ps(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ts(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rs(e,r){return r&&(js(r)==="object"||typeof r=="function")?r:_s(e)}function Ae(e,r){return Ae=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ae(e,r)}function po(e){return Ss(e)||Ps(e)||Cs(e)||Ts()}function js(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Cs(e,r){if(e){if(typeof e=="string")return rt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return rt(e,r)}}function tt(e){var r=typeof Map=="function"?new Map:void 0;return tt=function(n){if(n===null||!As(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Je(n,arguments,ze(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ae(i,n)},tt(e)}function ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ot=function(){return!!e})()}function Ns(e,r){var o,n,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype),u=Object.defineProperty;return u(s,"next",{value:l(0)}),u(s,"throw",{value:l(1)}),u(s,"return",{value:l(2)}),typeof Symbol=="function"&&u(s,Symbol.iterator,{value:function(){return this}}),s;function l(f){return function(d){return m([f,d])}}function m(f){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(a=0)),a;)try{if(o=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return a.label++,{value:f[1],done:!1};case 5:a.label++,n=f[1],f=[0];continue;case 7:f=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){a=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){a.label=f[1];break}if(f[0]===6&&a.label<i[1]){a.label=i[1],i=f;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(f);break}i[2]&&a.ops.pop(),a.trys.pop();continue}f=r.call(e,a)}catch(d){f=[6,d],n=0}finally{o=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var Us=(function(e){"use strict";zs(r,e);function r(o){Is(this,r);var n;return n=Es(this,r,[function(i){i(void 0)}]),mo(n,"innerPromise",void 0),mo(n,"unwrappedPromise",void 0),n.innerPromise=o,n}return Os(r,[{key:"unwrap",value:function(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(function(n){var i=n.data;return i})),this.unwrappedPromise}},{key:"then",value:function(n,i){return this.unwrap().then(n,i)}},{key:"catch",value:function(n){return this.unwrap().catch(n)}},{key:"finally",value:function(n){return this.unwrap().finally(n)}},{key:"withRawResponse",value:function(){return ws(function(){return Ns(this,function(n){switch(n.label){case 0:return[4,this.innerPromise];case 1:return[2,n.sent()]}})}).call(this)}}],[{key:"fromFunction",value:function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return new r(n.apply(void 0,po(a)))}},{key:"interceptFunction",value:function(n){return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r.fromPromise(n.apply(void 0,po(a)))}}},{key:"fromPromise",value:function(n){return new r(n)}},{key:"fromExecutor",value:function(n){var i=new Promise(n);return new r(i)}},{key:"fromResult",value:function(n){var i=Promise.resolve(n);return new r(i)}}]),r})(tt(Promise));function Ms(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Ks=Ls();function Ls(){var e,r,o,n,i,a,s,u=typeof window<"u"&&typeof window.document<"u";if(u)return{type:"browser",version:window.navigator.userAgent};var l=typeof globalThis<"u"&&((r=globalThis)===null||r===void 0||(e=r.navigator)===null||e===void 0?void 0:e.userAgent)==="Cloudflare-Workers";if(l)return{type:"workerd"};var m=typeof EdgeRuntime=="string";if(m)return{type:"edge-runtime"};var f=(typeof self>"u"?"undefined":Ms(self))==="object"&&typeof self?.importScripts=="function"&&(((o=self.constructor)===null||o===void 0?void 0:o.name)==="DedicatedWorkerGlobalScope"||((n=self.constructor)===null||n===void 0?void 0:n.name)==="ServiceWorkerGlobalScope"||((i=self.constructor)===null||i===void 0?void 0:i.name)==="SharedWorkerGlobalScope");if(f)return{type:"web-worker"};var d=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";if(d)return{type:"deno",version:Deno.version.deno};var y=typeof Bun<"u"&&typeof Bun.version<"u";if(y)return{type:"bun",version:Bun.version};var b=typeof navigator<"u"&&((a=navigator)===null||a===void 0?void 0:a.product)==="ReactNative";if(b)return{type:"react-native"};var p=typeof process<"u"?process:void 0,v=typeof p<"u"&&typeof((s=p.versions)===null||s===void 0?void 0:s.node)=="string";return v?{type:"node",version:p.versions.node,parsedVersion:Number(p.versions.node.split(".")[0])}:{type:"unknown"}}var t={};Pa(t,{JsonError:()=>$e,ParseError:()=>Xe,any:()=>ko,bigint:()=>vo,boolean:()=>Bo,booleanLiteral:()=>Uo,date:()=>go,discriminant:()=>Yo,enum_:()=>Ce,forwardCompatibleEnum_:()=>xo,getObjectLikeUtils:()=>L,getObjectUtils:()=>ce,getSchemaUtils:()=>w,isProperty:()=>re,lazy:()=>So,lazyObject:()=>jo,list:()=>er,never:()=>Mo,number:()=>Ko,object:()=>Ze,objectWithoutOptionalProperties:()=>To,optional:()=>ut,partialRecord:()=>Ho,property:()=>Io,record:()=>Fo,set:()=>Vo,string:()=>Lo,stringLiteral:()=>Do,transform:()=>lt,undiscriminatedUnion:()=>$o,union:()=>Qo,unknown:()=>Wo,withParsedProperties:()=>pt});var h={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function Ws(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function yo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function _(e,r){return"Expected ".concat(r,". Received ").concat(Fs(e),".")}function Fs(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(Ws(e,BigInt))return"BigInt";switch(typeof e>"u"?"undefined":yo(e)){case"string":return'"'.concat(e,'"');case"bigint":case"number":case"boolean":case"undefined":return"".concat(e)}return typeof e>"u"?"undefined":yo(e)}function nt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function Hs(e){if(Array.isArray(e))return nt(e)}function Vs(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Js(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gs(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qs(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){Vs(e,i,o[i])})}return e}function $s(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function Ys(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}),e}function Xs(e){return Hs(e)||Js(e)||Qs(e)||Gs()}function Qs(e,r){if(e){if(typeof e=="string")return nt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return nt(e,r)}}function R(e){return Ys(qs({},e),{json:bo(e.json),parse:bo(e.parse)})}function bo(e){return function(r,o){var n=e(r,o),i=o??{},a=i.skipValidation,s=a===void 0?!1:a;return!n.ok&&s?(console.warn(["Failed to validate."].concat(Xs(n.errors.map(function(u){return" - "+(u.path.length>0?"".concat(u.path.join("."),": ").concat(u.message):u.message)}))).join(\`\n\`)),{ok:!0,value:r}):n}}function Ge(e){return e.path.length===0?e.message:"".concat(e.path.join(" -> "),": ").concat(e.message)}function Zs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ec(e,r,o){return r=Pe(r),ac(e,at()?Reflect.construct(r,o||[],Pe(e).constructor):r.apply(e,o))}function rc(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function qe(e,r,o){return at()?qe=Reflect.construct:qe=function(i,a,s){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),m=new l;return s&&Te(m,s.prototype),m},qe.apply(null,arguments)}function tc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Pe(e){return Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Pe(e)}function oc(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&Te(e,r)}function nc(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function ic(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ac(e,r){return r&&(sc(r)==="object"||typeof r=="function")?r:Zs(e)}function Te(e,r){return Te=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Te(e,r)}function sc(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function it(e){var r=typeof Map=="function"?new Map:void 0;return it=function(n){if(n===null||!ic(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return qe(n,arguments,Pe(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Te(i,n)},it(e)}function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(at=function(){return!!e})()}var $e=(function(r){"use strict";oc(o,r);function o(n){rc(this,o);var i;return i=ec(this,o,[n.map(Ge).join("; ")]),tc(i,"errors",void 0),i.errors=n,Object.setPrototypeOf(i,(nc(this,o)?this.constructor:void 0).prototype),i.name=i.constructor.name,i}return o})(it(Error));function cc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uc(e,r,o){return r=Re(r),yc(e,ct()?Reflect.construct(r,o||[],Re(e).constructor):r.apply(e,o))}function lc(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ye(e,r,o){return ct()?Ye=Reflect.construct:Ye=function(i,a,s){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),m=new l;return s&&je(m,s.prototype),m},Ye.apply(null,arguments)}function fc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Re(e){return Re=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Re(e)}function mc(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&je(e,r)}function pc(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function dc(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function yc(e,r){return r&&(bc(r)==="object"||typeof r=="function")?r:cc(e)}function je(e,r){return je=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},je(e,r)}function bc(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function st(e){var r=typeof Map=="function"?new Map:void 0;return st=function(n){if(n===null||!dc(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ye(n,arguments,Re(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),je(i,n)},st(e)}function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ct=function(){return!!e})()}var Xe=(function(r){"use strict";mc(o,r);function o(n){lc(this,o);var i;return i=uc(this,o,[n.map(Ge).join("; ")]),fc(i,"errors",void 0),i.errors=n,Object.setPrototypeOf(i,(pc(this,o)?this.constructor:void 0).prototype),i.name=i.constructor.name,i}return o})(st(Error));function hc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Qe(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){hc(e,i,o[i])})}return e}function w(e){return{nullable:function(){return vc(e)},optional:function(){return ut(e)},optionalNullable:function(){return gc(e)},transform:function(o){return lt(e,o)},parseOrThrow:function(o,n){var i=e.parse(o,n);if(i.ok)return i.value;throw new Xe(i.errors)},jsonOrThrow:function(o,n){var i=e.json(o,n);if(i.ok)return i.value;throw new $e(i.errors)}}}function vc(e){var r={parse:function(n,i){return n==null?{ok:!0,value:null}:e.parse(n,i)},json:function(n,i){return n==null?{ok:!0,value:null}:e.json(n,i)},getType:function(){return h.NULLABLE}};return Qe({},r,w(r))}function ut(e){var r={parse:function(n,i){return n==null?{ok:!0,value:void 0}:e.parse(n,i)},json:function(n,i){return i?.omitUndefined&&n===void 0?{ok:!0,value:void 0}:n==null?{ok:!0,value:null}:e.json(n,i)},getType:function(){return h.OPTIONAL}};return Qe({},r,w(r))}function gc(e){var r={parse:function(n,i){return n===void 0?{ok:!0,value:void 0}:n===null?{ok:!0,value:null}:e.parse(n,i)},json:function(n,i){return n===void 0?{ok:!0,value:void 0}:n===null?{ok:!0,value:null}:e.json(n,i)},getType:function(){return h.OPTIONAL_NULLABLE}};return Qe({},r,w(r))}function lt(e,r){var o={parse:function(i,a){var s=e.parse(i,a);return s.ok?{ok:!0,value:r.transform(s.value)}:s},json:function(i,a){var s=r.untransform(i);return e.json(s,a)},getType:function(){return e.getType()}};return Qe({},o,w(o))}function xc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Sc(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){xc(e,i,o[i])})}return e}function ho(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function vo(){var e={parse:function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return(typeof o>"u"?"undefined":ho(o))==="bigint"?{ok:!0,value:o}:typeof o=="number"?{ok:!0,value:BigInt(o)}:{ok:!1,errors:[{path:a,message:_(o,"bigint | number")}]}},json:function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return(typeof o>"u"?"undefined":ho(o))!=="bigint"?{ok:!1,errors:[{path:a,message:_(o,"bigint")}]}:{ok:!0,value:o}},getType:function(){return h.BIGINT}};return Sc({},R(e),w(e))}function _c(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function wc(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function Ec(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){_c(e,i,o[i])})}return e}var Ic=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;function go(){var e={parse:function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return typeof o!="string"?{ok:!1,errors:[{path:a,message:_(o,"string")}]}:Ic.test(o)?{ok:!0,value:new Date(o)}:{ok:!1,errors:[{path:a,message:_(o,"ISO 8601 date string")}]}},json:function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return wc(o,Date)?{ok:!0,value:o.toISOString()}:{ok:!1,errors:[{path:a,message:_(o,"Date object")}]}},getType:function(){return h.DATE}};return Ec({},R(e),w(e))}function Oc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function zc(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){Oc(e,i,o[i])})}return e}function j(e,r){return function(){var o={parse:r,json:r,getType:function(){return e}};return zc({},R(o),w(o))}}function Ce(e){var r=new Set(e),o=j(h.ENUM,function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.allowUnrecognizedEnumValues,s=i.breadcrumbsPrefix,u=s===void 0?[]:s;return typeof n!="string"?{ok:!1,errors:[{path:u,message:_(n,"string")}]}:!r.has(n)&&!a?{ok:!1,errors:[{path:u,message:_(n,"enum")}]}:{ok:!0,value:n}});return o()}function xo(e){return Ce(e).transform({transform:function(o){return o},untransform:function(o){return o}})}function Ac(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Pc(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){Ac(e,i,o[i])})}return e}function So(e){var r=ft(e);return Pc({},r,w(r))}function ft(e){return{parse:function(o,n){return he(e).parse(o,n)},json:function(o,n){return he(e).json(o,n)},getType:function(){return he(e).getType()}}}function he(e){var r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function mt(e){return Object.entries(e)}function _o(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function Tc(e){if(Array.isArray(e))return e}function Rc(e,r){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var n=[],i=!0,a=!1,s,u;try{for(o=o.call(e);!(i=(s=o.next()).done)&&(n.push(s.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(a)throw u}}return n}}function jc(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Cc(e,r){return Tc(e)||Rc(e,r)||Nc(e,r)||jc()}function Nc(e,r){if(e){if(typeof e=="string")return _o(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _o(e,r)}}function Ne(e,r){var o=new Set(r);return Object.entries(e).reduce(function(n,i){var a=Cc(i,2),s=a[0],u=a[1];return o.has(s)&&(n[s]=u),n},{})}function Uc(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function ee(e){if((typeof e>"u"?"undefined":Uc(e))!=="object"||e===null)return!1;var r=Object.getPrototypeOf(e);return r===null?!0:Object.getPrototypeOf(r)===null}function Ue(e){return Object.keys(e)}function wo(e,r){var o=[],n=[],i=!0,a=!1,s=void 0;try{for(var u=e[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var m=l.value;r(m)?o.push(m):n.push(m)}}catch(f){a=!0,s=f}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw s}}return[o,n]}function Dc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Eo(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){Dc(e,i,o[i])})}return e}var kc=Object.prototype.hasOwnProperty;function L(e){return{withParsedProperties:function(o){return pt(e,o)}}}function pt(e,r){var o={parse:function(i,a){var s=e.parse(i,a);if(!s.ok)return s;var u={};for(var l in r)if(kc.call(r,l)){var m=r[l];u[l]=typeof m=="function"?m(s.value):m}return{ok:!0,value:Eo({},s.value,u)}},json:function(i,a){if(!ee(i)){var s;return{ok:!1,errors:[{path:(s=a?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],message:_(i,"object")}]}}var u=new Set(Object.keys(r)),l=Ne(i,Object.keys(i).filter(function(m){return!u.has(m)}));return e.json(l,a)},getType:function(){return e.getType()}};return Eo({},o,w(o),L(o))}function Io(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function re(e){return e.isProperty}function dt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function Bc(e){if(Array.isArray(e))return e}function Mc(e){if(Array.isArray(e))return dt(e)}function Kc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Lc(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wc(e,r){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var n=[],i=!0,a=!1,s,u;try{for(o=o.call(e);!(i=(s=o.next()).done)&&(n.push(s.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(a)throw u}}return n}}function Fc(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Hc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function W(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){Kc(e,i,o[i])})}return e}function Vc(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function De(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vc(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}),e}function ve(e,r){return Bc(e)||Wc(e,r)||Po(e,r)||Fc()}function F(e){return Mc(e)||Lc(e)||Po(e)||Hc()}function Oo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Po(e,r){if(e){if(typeof e=="string")return dt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return dt(e,r)}}var Jc=Object.prototype.hasOwnProperty;function Ze(e){var r;function o(){if(r==null){r={};var y=!0,b=!1,p=void 0;try{for(var v=mt(e)[Symbol.iterator](),x;!(y=(x=v.next()).done);y=!0){var A=ve(x.value,2),I=A[0],S=A[1],B=re(S)?S.rawKey:I,M=re(S)?S.valueSchema:S;r[B]={rawKey:B,parsedKey:I,valueSchema:M}}}catch(D){b=!0,p=D}finally{try{!y&&v.return!=null&&v.return()}finally{if(b)throw p}}}return r}var n,i,a,s;function u(){if(n==null){n=[],i=[];var y=!0,b=!1,p=void 0;try{for(var v=mt(e)[Symbol.iterator](),x;!(y=(x=v.next()).done);y=!0){var A=ve(x.value,2),I=A[0],S=A[1],B=re(S)?S.rawKey:I,M=re(S)?S.valueSchema:S;Gc(M)&&(n.push(B),i.push(I))}}catch(D){b=!0,p=D}finally{try{!y&&v.return!=null&&v.return()}finally{if(b)throw p}}a=new Set(n),s=new Set(i)}return n}function l(){return i==null&&u(),i}function m(){return a==null&&u(),a}function f(){return s==null&&u(),s}var d={_getRawProperties:function(){return Object.entries(e).map(function(b){var p=ve(b,2),v=p[0],x=p[1];return re(x)?x.rawKey:v})},_getParsedProperties:function(){return Ue(e)},parse:function(b,p){var v,x=(v=p?.breadcrumbsPrefix)!==null&&v!==void 0?v:[];return zo({value:b,requiredKeys:u(),requiredKeysSet:m(),getProperty:function(I){var S=o()[I];if(S!=null)return{transformedKey:S.parsedKey,transform:function(M){var D=F(x).concat([I]);return S.valueSchema.parse(M,De(W({},p),{breadcrumbsPrefix:D}))}}},unrecognizedObjectKeys:p?.unrecognizedObjectKeys,skipValidation:p?.skipValidation,breadcrumbsPrefix:x,omitUndefined:p?.omitUndefined})},json:function(b,p){var v,x=(v=p?.breadcrumbsPrefix)!==null&&v!==void 0?v:[];return zo({value:b,requiredKeys:l(),requiredKeysSet:f(),getProperty:function(I){var S=e[I];if(S!=null)return re(S)?{transformedKey:S.rawKey,transform:function(M){var D=F(x).concat([I]);return S.valueSchema.json(M,De(W({},p),{breadcrumbsPrefix:D}))}}:{transformedKey:I,transform:function(M){var D=F(x).concat([I]);return S.json(M,De(W({},p),{breadcrumbsPrefix:D}))}}},unrecognizedObjectKeys:p?.unrecognizedObjectKeys,skipValidation:p?.skipValidation,breadcrumbsPrefix:x,omitUndefined:p?.omitUndefined})},getType:function(){return h.OBJECT}};return W({},R(d),w(d),L(d),ce(d))}function zo(e){var r=e.value,o=e.requiredKeys,n=e.requiredKeysSet,i=e.getProperty,a=e.unrecognizedObjectKeys,s=a===void 0?"fail":a,u=e.skipValidation,l=u===void 0?!1:u,m=e.breadcrumbsPrefix,f=m===void 0?[]:m;if(!ee(r))return{ok:!1,errors:[{path:f,message:_(r,"object")}]};var d=o.length,y=[],b={};for(var p in r)if(Jc.call(r,p)){var v=r[p],x=i(p);if(x!=null){d>0&&n.has(p)&&d--;var A=x.transform(v);if(A.ok)b[x.transformedKey]=A.value;else{var I;b[p]=v,(I=y).push.apply(I,F(A.errors))}}else switch(s){case"fail":y.push({path:F(f).concat([p]),message:'Unexpected key "'.concat(p,'"')});break;case"strip":break;case"passthrough":b[p]=v;break}}if(d>0){var S=!0,B=!1,M=void 0;try{for(var D=o[Symbol.iterator](),It;!(S=(It=D.next()).done);S=!0){var Ot=It.value;Ot in r||y.push({path:f,message:'Missing required key "'.concat(Ot,'"')})}}catch(za){B=!0,M=za}finally{try{!S&&D.return!=null&&D.return()}finally{if(B)throw M}}}return y.length===0||l?{ok:!0,value:b}:{ok:!1,errors:y}}function ce(e){return{extend:function(o){var n={_getParsedProperties:function(){return F(e._getParsedProperties()).concat(F(o._getParsedProperties()))},_getRawProperties:function(){return F(e._getRawProperties()).concat(F(o._getRawProperties()))},parse:function(a,s){return Ao({extensionKeys:o._getRawProperties(),value:a,transformBase:function(l){return e.parse(l,s)},transformExtension:function(l){return o.parse(l,s)},breadcrumbsPrefix:s?.breadcrumbsPrefix})},json:function(a,s){return Ao({extensionKeys:o._getParsedProperties(),value:a,transformBase:function(l){return e.json(l,s)},transformExtension:function(l){return o.json(l,s)},breadcrumbsPrefix:s?.breadcrumbsPrefix})},getType:function(){return h.OBJECT}};return W({},n,w(n),L(n),ce(n))},passthrough:function(){var o=new Set(e._getRawProperties()),n=new Set(e._getParsedProperties()),i={_getParsedProperties:function(){return e._getParsedProperties()},_getRawProperties:function(){return e._getRawProperties()},parse:function(s,u){var l=e.parse(s,De(W({},u),{unrecognizedObjectKeys:"passthrough"}));if(!l.ok)return l;var m={};if((typeof s>"u"?"undefined":Oo(s))==="object"&&s!=null){var f=!0,d=!1,y=void 0;try{for(var b=Object.entries(s)[Symbol.iterator](),p;!(f=(p=b.next()).done);f=!0){var v=ve(p.value,2),x=v[0],A=v[1];o.has(x)||(m[x]=A)}}catch(I){d=!0,y=I}finally{try{!f&&b.return!=null&&b.return()}finally{if(d)throw y}}}return{ok:!0,value:W({},m,l.value)}},json:function(s,u){var l=e.json(s,De(W({},u),{unrecognizedObjectKeys:"passthrough"}));if(!l.ok)return l;var m={};if((typeof s>"u"?"undefined":Oo(s))==="object"&&s!=null){var f=!0,d=!1,y=void 0;try{for(var b=Object.entries(s)[Symbol.iterator](),p;!(f=(p=b.next()).done);f=!0){var v=ve(p.value,2),x=v[0],A=v[1];n.has(x)||(m[x]=A)}}catch(I){d=!0,y=I}finally{try{!f&&b.return!=null&&b.return()}finally{if(d)throw y}}}return{ok:!0,value:W({},m,l.value)}},getType:function(){return h.OBJECT}};return W({},i,w(i),L(i),ce(i))}}}function Ao(e){var r=e.extensionKeys,o=e.value,n=e.transformBase,i=e.transformExtension,a=e.breadcrumbsPrefix,s=a===void 0?[]:a;if(!ee(o))return{ok:!1,errors:[{path:s,message:_(o,"object")}]};var u=new Set(r),l=ve(wo(Ue(o),function(b){return u.has(b)}),2),m=l[0],f=l[1],d=n(Ne(o,f)),y=i(Ne(o,m));return d.ok&&y.ok?{ok:!0,value:W({},d.value,y.value)}:{ok:!1,errors:F(d.ok?[]:d.errors).concat(F(y.ok?[]:y.errors))}}function Gc(e){return!qc(e)}function qc(e){switch(e.getType()){case h.ANY:case h.UNKNOWN:case h.OPTIONAL:case h.OPTIONAL_NULLABLE:return!0;default:return!1}}function To(e){return Ze(e)}function $c(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Ro(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){$c(e,i,o[i])})}return e}function Yc(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function Xc(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yc(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}),e}function jo(e){var r=Xc(Ro({},ft(e)),{_getRawProperties:function(){return he(e)._getRawProperties()},_getParsedProperties:function(){return he(e)._getParsedProperties()}});return Ro({},r,w(r),L(r),ce(r))}function bt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function Qc(e){if(Array.isArray(e))return bt(e)}function Zc(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function eu(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ru(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function yt(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){Zc(e,i,o[i])})}return e}function tu(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function Co(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tu(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}),e}function ht(e){return Qc(e)||eu(e)||ou(e)||ru()}function ou(e,r){if(e){if(typeof e=="string")return bt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return bt(e,r)}}function er(e){var r={parse:function(n,i){return No(n,function(a,s){var u;return e.parse(a,Co(yt({},i),{breadcrumbsPrefix:ht((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["[".concat(s,"]")])}))})},json:function(n,i){return No(n,function(a,s){var u;return e.json(a,Co(yt({},i),{breadcrumbsPrefix:ht((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["[".concat(s,"]")])}))})},getType:function(){return h.LIST}};return yt({},R(r),w(r))}function No(e,r){if(!Array.isArray(e))return{ok:!1,errors:[{message:_(e,"list"),path:[]}]};for(var o=[],n=[],i=0;i<e.length;i++){var a=r(e[i],i);if(a.ok)o.push(a.value);else{var s;(s=n).push.apply(s,ht(a.errors))}}return n.length===0?{ok:!0,value:o}:{ok:!1,errors:n}}function Uo(e){var r=j(h.BOOLEAN_LITERAL,function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return o===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:_(o,"".concat(e.toString()))}]}});return r()}function Do(e){var r=j(h.STRING_LITERAL,function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return o===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:_(o,'"'.concat(e,'"'))}]}});return r()}var ko=j(h.ANY,function(e){return{ok:!0,value:e}});var Bo=j(h.BOOLEAN,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.breadcrumbsPrefix,n=o===void 0?[]:o;return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:_(e,"boolean")}]}});var Mo=j(h.NEVER,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.breadcrumbsPrefix,n=o===void 0?[]:o;return{ok:!1,errors:[{path:n,message:"Expected never"}]}});var Ko=j(h.NUMBER,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.breadcrumbsPrefix,n=o===void 0?[]:o;return typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:_(e,"number")}]}});var Lo=j(h.STRING,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.breadcrumbsPrefix,n=o===void 0?[]:o;return typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:_(e,"string")}]}});var Wo=j(h.UNKNOWN,function(e){return{ok:!0,value:e}});function vt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function nu(e){if(Array.isArray(e))return vt(e)}function iu(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function au(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function su(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){iu(e,i,o[i])})}return e}function cu(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function ne(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cu(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}),e}function G(e){return nu(e)||au(e)||uu(e)||su()}function uu(e,r){if(e){if(typeof e=="string")return vt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return vt(e,r)}}var lu=Object.prototype.hasOwnProperty;function Fo(e,r){var o={parse:function(i,a){return rr({value:i,isKeyNumeric:e.getType()===h.NUMBER,transformKey:function(u){var l;return e.parse(u,ne(J({},a),{breadcrumbsPrefix:G((l=a?.breadcrumbsPrefix)!==null&&l!==void 0?l:[]).concat(["".concat(u," (key)")])}))},transformValue:function(u,l){var m;return r.parse(u,ne(J({},a),{breadcrumbsPrefix:G((m=a?.breadcrumbsPrefix)!==null&&m!==void 0?m:[]).concat(["".concat(l)])}))},breadcrumbsPrefix:a?.breadcrumbsPrefix})},json:function(i,a){return rr({value:i,isKeyNumeric:e.getType()===h.NUMBER,transformKey:function(u){var l;return e.json(u,ne(J({},a),{breadcrumbsPrefix:G((l=a?.breadcrumbsPrefix)!==null&&l!==void 0?l:[]).concat(["".concat(u," (key)")])}))},transformValue:function(u,l){var m;return r.json(u,ne(J({},a),{breadcrumbsPrefix:G((m=a?.breadcrumbsPrefix)!==null&&m!==void 0?m:[]).concat(["".concat(l)])}))},breadcrumbsPrefix:a?.breadcrumbsPrefix})},getType:function(){return h.RECORD}};return J({},R(o),w(o))}function Ho(e,r){var o={parse:function(i,a){return rr({value:i,isKeyNumeric:e.getType()===h.NUMBER,transformKey:function(u){var l;return e.parse(u,ne(J({},a),{breadcrumbsPrefix:G((l=a?.breadcrumbsPrefix)!==null&&l!==void 0?l:[]).concat(["".concat(u," (key)")])}))},transformValue:function(u,l){var m;return r.parse(u,ne(J({},a),{breadcrumbsPrefix:G((m=a?.breadcrumbsPrefix)!==null&&m!==void 0?m:[]).concat(["".concat(l)])}))},breadcrumbsPrefix:a?.breadcrumbsPrefix})},json:function(i,a){return rr({value:i,isKeyNumeric:e.getType()===h.NUMBER,transformKey:function(u){var l;return e.json(u,ne(J({},a),{breadcrumbsPrefix:G((l=a?.breadcrumbsPrefix)!==null&&l!==void 0?l:[]).concat(["".concat(u," (key)")])}))},transformValue:function(u,l){var m;return r.json(u,ne(J({},a),{breadcrumbsPrefix:G((m=a?.breadcrumbsPrefix)!==null&&m!==void 0?m:[]).concat(["".concat(l)])}))},breadcrumbsPrefix:a?.breadcrumbsPrefix})},getType:function(){return h.RECORD}};return J({},R(o),w(o))}function rr(e){var r=e.value,o=e.isKeyNumeric,n=e.transformKey,i=e.transformValue,a=e.breadcrumbsPrefix,s=a===void 0?[]:a;if(!ee(r))return{ok:!1,errors:[{path:s,message:_(r,"object")}]};var u={},l=[];for(var m in r)if(lu.call(r,m)){var f=r[m];if(f!==void 0){var d=m;if(o){var y=m.length>0?Number(m):NaN;Number.isNaN(y)||(d=y)}var b=n(d),p=i(f,d);if(b.ok&&p.ok)u[b.value]=p.value;else{if(!b.ok){var v;(v=l).push.apply(v,G(b.errors))}if(!p.ok){var x;(x=l).push.apply(x,G(p.errors))}}}}return l.length===0?{ok:!0,value:u}:{ok:!1,errors:l}}function gt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function fu(e){if(Array.isArray(e))return gt(e)}function mu(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function pu(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function du(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yu(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function bu(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){mu(e,i,o[i])})}return e}function hu(e){return fu(e)||du(e)||vu(e)||yu()}function vu(e,r){if(e){if(typeof e=="string")return gt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return gt(e,r)}}function Vo(e){var r=er(e),o={parse:function(i,a){var s=r.parse(i,a);return s.ok?{ok:!0,value:new Set(s.value)}:s},json:function(i,a){if(!pu(i,Set)){var s;return{ok:!1,errors:[{path:(s=a?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],message:_(i,"Set")}]}}var u=r.json(hu(i),a);return u},getType:function(){return h.SET}};return bu({},R(o),w(o))}function Jo(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function gu(e){if(Array.isArray(e))return e}function xu(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Su(e,r){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var n=[],i=!0,a=!1,s,u;try{for(o=o.call(e);!(i=(s=o.next()).done)&&(n.push(s.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(a)throw u}}return n}}function _u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qo(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){xu(e,i,o[i])})}return e}function wu(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function Eu(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wu(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}),e}function Iu(e,r){return gu(e)||Su(e,r)||Ou(e,r)||_u()}function Ou(e,r){if(e){if(typeof e=="string")return Jo(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Jo(e,r)}}function $o(e){var r={parse:function(n,i){return Go(function(a,s){return a.parse(n,s)},e,i)},json:function(n,i){return Go(function(a,s){return a.json(n,s)},e,i)},getType:function(){return h.UNDISCRIMINATED_UNION}};return qo({},R(r),w(r))}function Go(e,r,o){var n=[],i=!0,a=!1,s=void 0;try{for(var u=r.entries()[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var m=Iu(l.value,2),f=m[0],d=m[1],y=e(d,Eu(qo({},o),{skipValidation:!1}));if(y.ok)return y;var b=!0,p=!1,v=void 0;try{for(var x=y.errors[Symbol.iterator](),A;!(b=(A=x.next()).done);b=!0){var I=A.value;n.push({path:I.path,message:"[Variant ".concat(f,"] ").concat(I.message)})}}catch(S){p=!0,v=S}finally{try{!b&&x.return!=null&&x.return()}finally{if(p)throw v}}}}catch(S){a=!0,s=S}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw s}}return{ok:!1,errors:n}}function Yo(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}function xt(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=e[o];return n}function zu(e){if(Array.isArray(e))return xt(e)}function St(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Au(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pu(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _t(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){St(e,i,o[i])})}return e}function wt(e){return zu(e)||Au(e)||Tu(e)||Pu()}function Tu(e,r){if(e){if(typeof e=="string")return xt(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return xt(e,r)}}var Ru=Object.prototype.hasOwnProperty;function Qo(e,r){var o=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=Ce(Ue(r)),a={parse:function(u,l){return Xo({value:u,discriminant:o,transformedDiscriminant:n,transformDiscriminantValue:function(f){var d;return i.parse(f,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:wt((d=l?.breadcrumbsPrefix)!==null&&d!==void 0?d:[]).concat([o])})},getAdditionalPropertiesSchema:function(f){return r[f]},allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(f,d){return d.parse(f,l)},breadcrumbsPrefix:l?.breadcrumbsPrefix})},json:function(u,l){return Xo({value:u,discriminant:n,transformedDiscriminant:o,transformDiscriminantValue:function(f){var d;return i.json(f,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:wt((d=l?.breadcrumbsPrefix)!==null&&d!==void 0?d:[]).concat([n])})},getAdditionalPropertiesSchema:function(f){return r[f]},allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(f,d){return d.json(f,l)},breadcrumbsPrefix:l?.breadcrumbsPrefix})},getType:function(){return h.UNION}};return _t({},R(a),w(a),L(a))}function Xo(e){var r=e.value,o=e.discriminant,n=e.transformedDiscriminant,i=e.transformDiscriminantValue,a=e.getAdditionalPropertiesSchema,s=e.allowUnrecognizedUnionMembers,u=s===void 0?!1:s,l=e.transformAdditionalProperties,m=e.breadcrumbsPrefix,f=m===void 0?[]:m;if(!ee(r))return{ok:!1,errors:[{path:f,message:_(r,"object")}]};var d=r[o],y={};for(var b in r)Ru.call(r,b)&&b!==o&&(y[b]=r[b]);if(d==null)return{ok:!1,errors:[{path:f,message:'Missing discriminant ("'.concat(o,'")')}]};var p=i(d);if(!p.ok)return{ok:!1,errors:p.errors};var v=a(p.value);if(v==null)return u?{ok:!0,value:_t(St({},n,p.value),y)}:{ok:!1,errors:[{path:wt(f).concat([o]),message:"Unexpected discriminant value"}]};var x=l(y,v);return x.ok?{ok:!0,value:_t(St({},n,d),x.value)}:x}var tr=t.object({label:t.string(),value:t.unknown()});var Zo=t.object({authorizationUrl:t.string(),tokenUrl:t.string(),clientId:t.string(),clientSecret:t.string(),scopes:t.list(t.string()),extraAuthParams:t.record(t.string(),t.string()).optional(),extraTokenParams:t.record(t.string(),t.string()).optional()});var or=t.forwardCompatibleEnum_(["STRING","MULTILINE","BOOLEAN","NUMBER","DATETIME","DATE","TIME","EMAIL","PHONE","SCHEMA","FILE","OAUTH"]);var en=t.object({id:t.string(),label:t.string(),description:t.string(),required:t.boolean(),hidden:t.boolean().optional(),type:or.optional(),enumOptions:t.list(tr).optional(),schema:t.string().optional(),oauthConfiguration:Zo.optional()});var rn=t.object({userInteractionRequired:t.boolean(),buttonName:t.string().optional(),precondition:t.lazy(function(){return nr}).optional(),userFormParameters:t.list(en),language:t.string().optional()});var tn=t.object({name:t.string(),description:t.string()}).extend(rn);var on=t.forwardCompatibleEnum_(["PENDING","PROCESSING","ACCEPTED","REJECTED"]);var ir=t.object({type:t.string(),name:t.string().optional()});var ge=t.object({url:t.string().optional(),sizeBytes:t.number().optional(),status:on}).extend(ir);var nn=t.union("valueType",{primitive:t.object({value:t.unknown()}),attachment:ge}).transform({transform:function(r){return r},untransform:function(r){return r}});var an=t.object({id:t.string(),label:t.string(),description:t.string(),required:t.boolean(),suggestion:t.unknown().optional(),type:or,enumOptions:t.list(tr).optional()});var P=t.object({referenceId:t.string()});var ar=t.forwardCompatibleEnum_(["AGENT","CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_BASE_VERSION","KNOWLEDGE_DOCUMENT","ACTION","USER","EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK","INBOX_ITEM","INBOX_ITEM_FIX","SEGMENT","CUSTOMER","INTELLIGENT_FIELD","CHARTER"]);var E=t.object({type:ar,appId:t.string()}).extend(P);var g=t.object({organizationId:t.string(),agentId:t.string()}).extend(E);var sn=t.forwardCompatibleEnum_(["ALWAYS","WHEN_RELEVANT","NEVER"]);var zb=t.object({actionId:g,instructions:t.string().optional(),llmInclusionStatus:sn,segmentId:g.optional(),preconditionExplanation:t.string().optional(),deleted:t.boolean()}).extend(tn);var cn=t.forwardCompatibleEnum_(["EMAIL","PHONE_NUMBER"]);var sr=t.object({value:t.string(),type:cn});var cr=t.object({referenceId:t.string(),appId:t.string()});var ur=t.forwardCompatibleEnum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var lr=t.object({value:t.string(),visibility:ur});var fr=t.object({userId:cr}).extend(lr);var un=t.object({userId:P.optional(),agentUserId:t.string().optional(),userIdentifiers:t.list(sr),allUserData:t.record(t.string(),t.record(t.string(),t.string())),defaultUserData:t.record(t.string(),t.string()),agentUserData:t.record(t.string(),t.list(fr))});var ln=t.forwardCompatibleEnum_(["NOT","CONTAINS","NOT_CONTAINS","CONTAINS_ANY","NOT_CONTAINS_ANY","CONTAINS_ALL","NOT_CONTAINS_ALL"]);var q=t.object({operator:ln.optional()});var mr=t.object({appId:t.string()}).extend(q);var pr=t.object({identifiers:t.list(sr),data:t.record(t.string(),lr)});var Zb=t.object({userId:P}).extend(pr);var nh=t.object({userId:g,agentUserId:t.string(),allUserData:t.record(t.string(),t.record(t.string(),t.string())),defaultUserData:t.record(t.string(),t.string()),agentUserData:t.record(t.string(),t.list(fr))}).extend(pr);var O=t.object({key:t.string(),displayName:t.string(),description:t.string().optional(),visibility:ur.optional(),required:t.boolean().optional()});var $=t.object({pattern:t.string(),errorMessage:t.string()});var fn=t.object({defaultValue:t.list(t.string()).optional(),validation:$.optional()}).extend(O);var dh=t.object({content:t.string().optional(),assetId:P.optional()}).extend(ir);var bh=t.object({page:t.number().optional(),size:t.number().optional(),sortDesc:t.boolean().optional()});var mn=t.object({fieldId:g,name:t.string(),entityId:g,value:t.unknown().optional(),confidence:t.number().optional(),rationale:t.string().optional(),createdAt:t.date().optional()});var pn=t.forwardCompatibleEnum_(["GOOD","NEEDS_IMPROVEMENT","UNKNOWN"]);var dn=t.forwardCompatibleEnum_(["MISSING_KNOWLEDGE","MISSING_USER_INFORMATION","MISSING_ACTION","NEEDS_USER_CLARIFICATION","UNSUPPORTED_FORMAT","INTERRUPTED","UNSUPPORTED_USER_BEHAVIOR","UNKNOWN","NO_BOT_REPLIES"]);var yn=t.forwardCompatibleEnum_(["UNKNOWN","ERROR","IN_PROGRESS","RESOLVED","ESCALATED","NEGATIVE_FEEDBACK","CONTENT_SAFETY_FLAGGED","PROMPT_ATTACK_FLAGGED","HANGUP","INELIGIBLE"]);var bn=t.forwardCompatibleEnum_(["POSITIVE","NEGATIVE","NEUTRAL","MIXED","UNKNOWN"]);var hn=t.object({userRequest:t.string().optional(),agentResponse:t.string().optional(),resolutionStatus:yn.optional(),category:t.string().optional(),sentiment:bn.optional(),quality:pn.optional(),qualityReason:dn.optional(),resolvedByMaven:t.boolean().optional(),primaryLanguage:t.string().optional(),predictedNps:t.number().optional(),csat:t.number().optional(),intelligentFieldValues:t.list(mn).optional()});var vn=t.object({actionIds:t.list(E),incompleteActionIds:t.list(E),insertCount:t.number(),thumbsUpCount:t.number(),thumbsDownCount:t.number(),handoffCount:t.number(),userMessageCount:t.number(),botMessageCount:t.number(),csat:t.number().optional(),handleTime:t.number().optional(),humanAgentResponseDelay:t.number().optional(),humanAgents:t.list(t.string()),humanAgentsWithInserts:t.list(t.string()),users:t.list(t.string()),userIdentifiers:t.list(t.string()),lastUserMessage:t.string().optional(),lastBotMessage:t.string().optional(),involvedAppIds:t.set(t.string())});var gn=t.forwardCompatibleEnum_(["MARKDOWN","FORMS","IMAGES","CHARTS_HIGHCHARTS_TS","ASYNC","OAUTH_BUTTONS"]);var H=t.object({entityId:g,scopeEntityId:g.optional()});var xn=t.object({entities:t.list(H)});var Sn=t.object({entityTypes:t.set(ar)});var _n=t.union("scopeType",{byEntities:xn,byEntityTypes:Sn}).transform({transform:function(r){return r},untransform:function(r){return r}});var dr=t.forwardCompatibleEnum_(["SHORT","MEDIUM","LONG"]);var wn=t.object({capabilities:t.list(gn),isCopilot:t.boolean(),responseLength:dr,contextFilter:_n.optional()});var En=t.forwardCompatibleEnum_(["CASUAL_BUDDY","EMPATHETIC_SUPPORTER","FORMAL_PROFESSIONAL","CONCISE_EXPERT","ENTHUSIASTIC_HELPER","PATIENT_EDUCATOR","PIRATE"]);var In=t.object({additionalPromptText:t.string().optional(),persona:En.optional(),availableKnowledgeBases:t.list(g).optional()});var yr=t.object({responseConfig:wn.optional(),subject:t.string().optional(),url:t.string().optional(),createdAt:t.date().optional(),updatedAt:t.date().optional(),tags:t.set(t.string()).optional(),metadata:t.record(t.string(),t.string()).optional(),allMetadata:t.record(t.string(),t.record(t.string(),t.string())),conversationId:g,analysis:hn,summary:vn,deleted:t.boolean(),open:t.boolean(),llmEnabled:t.boolean(),simulationContext:In.optional()});var br=t.object({page:t.number().optional(),size:t.number().optional(),sortDesc:t.boolean().optional()});var iv=t.object({sortId:t.string().optional()}).extend(br);var On=t.object({value:t.boolean()});var zn=t.object({id:t.string(),actionId:E,formLabel:t.string(),fields:t.list(an),submitLabel:t.string()});var An=t.forwardCompatibleEnum_(["HIGHCHARTS_TS"]);var Pn=t.object({label:t.string(),specSchema:An,spec:t.string()});var Tn=t.forwardCompatibleEnum_(["BOT_RESPONSE","BOT_SUGGESTION"]);var hr=t.object({actionId:E,actionName:t.string()});var vr=t.object({actionParameters:t.record(t.string(),nn),executionResult:t.string().optional(),executionError:t.string().optional()}).extend(hr);var Rn=t.object({actionsReviewed:t.list(hr),actionsExecuted:t.list(vr)});var jn=t.object({charterId:E,name:t.string(),segmentId:E.optional(),parentId:E.optional()});var Cn=t.object({matchedCharters:t.list(jn),evaluationTruncated:t.boolean()});var Nn=t.object({}).extend(vr);var Un=t.object({fieldId:E,name:t.string(),value:t.string().optional(),confidence:t.number().optional(),rationale:t.string().optional()});var Dn=t.object({refreshedFields:t.list(Un)});var Et=t.object({knowledgeBaseId:E,documentId:E,documentName:t.string(),documentExcerpt:t.string()});var kn=t.object({knowledgeReviewed:t.list(Et),knowledgeUtilized:t.list(Et)});var Bn=t.object({category:t.string(),harmfulContentDetected:t.boolean(),severity:t.number(),threshold:t.number()});var Mn=t.object({attackDetected:t.boolean(),harmfulContentDetected:t.boolean(),harmfulContentAnalysis:t.list(Bn)});var Kn=t.object({safetyCheckPassed:t.boolean(),report:Mn.optional()});var Ln=t.object({matchingSegmentIds:t.list(g)});var Wn=t.object({userData:t.record(t.string(),t.string())});var Fn=t.union("type",{knowledge:kn,actions:Rn,form:Nn,safety:Kn,user:Wn,segments:Ln,intelligentFields:Dn,charters:Cn}).transform({transform:function(r){return r},untransform:function(r){return r}});var Hn=t.object({items:t.list(Fn)});var Vn=t.object({buttonName:t.string(),url:t.string().optional()});var Jn=t.object({label:t.string().optional(),object:t.unknown()});var Gn=t.object({text:t.string()});var qn=t.union("type",{text:Gn,actionForm:zn,oauthButton:Vn,chart:Pn,object:Jn}).transform({transform:function(r){return r},untransform:function(r){return r}});var $n=t.object({title:t.string(),url:t.string()});var Yn=t.object({followupQuestions:t.list(t.string()),sources:t.list($n),language:t.string().optional()});var gr=t.object({createdAt:t.date().optional(),updatedAt:t.date().optional()});var xr=t.forwardCompatibleEnum_(["SENDING","SENT","REJECTED","CANCELED","FAILED","UNKNOWN"]);var Xn=t.object({conversationMessageId:g,botMessageType:Tn,responses:t.list(qn),metadata:Yn,status:xr,logic:Hn.optional()}).extend(gr);var Qn=t.forwardCompatibleEnum_(["CHROME","FIREFOX","SAFARI","OPERA","EDGE","OTHER"]);var Zn=t.object({type:Qn,name:t.string().optional(),version:t.string().optional(),userAgent:t.string().optional()});var zg=t.forwardCompatibleEnum_(["ACTION","TRIGGER"]);var ei=t.object({defaultValue:t.boolean().optional()}).extend(O);var ri=t.object({defaultValue:t.string().optional(),validation:$.optional()}).extend(O);var ti=t.object({fields:t.lazy(function(){return xe}).optional()}).extend(O);var oi=t.object({additionalData:t.record(t.string(),t.string())});var Sr=t.object({actionId:t.string(),appId:t.string().optional()}).extend(q);var ni=t.object({conversationId:E});var ii=t.forwardCompatibleEnum_(["USER","HUMAN_AGENT","EXTERNAL_SYSTEM"]);var ai=t.object({userId:P,text:t.string(),userMessageType:ii}).extend(gr);var si=t.forwardCompatibleEnum_(["NOT_ASKED","LLM_ENABLED","LLM_DISABLED"]);var ci=t.object({conversationMessageId:g,language:t.string().optional(),attachments:t.list(ge),agentUserId:t.string().optional(),userDisplayName:t.string().optional(),status:xr,responseState:si.optional()}).extend(ai);var _r=t.union("type",{user:ci,bot:Xn}).transform({transform:function(r){return r},untransform:function(r){return r}});var ui=t.forwardCompatibleEnum_(["EQ","NEQ","LT","LE","GT","GE"]);var li=t.object({operator:ui,value:t.number()});var fi=t.forwardCompatibleEnum_(["IN","NOT_IN"]);var mi=t.object({operator:fi,values:t.list(t.number())});var pi=t.union("opType",{comparison:li,membership:mi}).transform({transform:function(r){return r},untransform:function(r){return r}});var di=t.forwardCompatibleEnum_(["CONTAINS","NOT_CONTAINS"]);var yi=t.object({operator:di,value:t.string()});var bi=t.forwardCompatibleEnum_(["EQ","NEQ","CONTAINS_ANY","CONTAINS_NONE","CONTAINS_ALL","NOT_CONTAINS_ALL","SUBSET_OF","NOT_SUBSET_OF"]);var hi=t.object({operator:bi,values:t.set(t.string())});var vi=t.union("opType",{element:yi,relation:hi}).transform({transform:function(r){return r},untransform:function(r){return r}});var gi=t.forwardCompatibleEnum_(["EQ","NEQ","CONTAINS_SUBSTRING","NOT_CONTAINS_SUBSTRING","STARTS_WITH","NOT_STARTS_WITH","ENDS_WITH","NOT_ENDS_WITH"]);var xi=t.object({operator:gi,value:t.string()});var Si=t.forwardCompatibleEnum_(["IN","NOT_IN"]);var _i=t.object({operator:Si,values:t.list(t.string())});var wi=t.union("opType",{comparison:xi,membership:_i}).transform({transform:function(r){return r},untransform:function(r){return r}});var wr=t.union("fieldValidationType",{string:t.object({value:wi}),numeric:t.object({value:pi}),boolean:On,set:t.object({value:vi})}).transform({transform:function(r){return r},untransform:function(r){return r}});var Ei=t.object({fieldIdWithoutAgent:E,fieldCondition:wr});var ie=t.object({key:t.string(),value:t.string().optional(),values:t.list(t.string()).optional()}).extend(q);var Er=t.object({useMarkdown:t.boolean().optional(),useForms:t.boolean().optional(),useImages:t.boolean().optional(),isCopilot:t.boolean().optional(),responseLength:dr.optional()}).extend(q);var Ir=t.object({tags:t.set(t.string())}).extend(q);var Ii=t.union("conversationPreconditionType",{tags:Ir,metadata:ie,actionExecuted:Sr,responseConfig:Er,app:mr,intelligentField:Ei}).transform({transform:function(r){return r},untransform:function(r){return r}});var Oi=t.object({fieldIdWithoutAgent:E,name:t.string().optional(),fieldCondition:wr});var zi=t.union("conversationPreconditionType",{tags:Ir,metadata:ie,actionExecuted:Sr,responseConfig:Er,app:mr,intelligentField:Oi}).transform({transform:function(r){return r},untransform:function(r){return r}});var cS=t.object({}).extend(yr);var pS=t.object({messages:t.list(_r),attachments:t.list(ge)}).extend(yr);var Or=t.object({rating:t.number().optional(),maxRating:t.number().optional()});var Ai=t.forwardCompatibleEnum_(["DESKTOP","MOBILE","TABLET","OTHER"]);var Pi=t.forwardCompatibleEnum_(["WINDOWS","MACOS","LINUX","ANDROID","IOS","OTHER"]);var Ti=t.object({type:Pi.optional(),name:t.string().optional(),version:t.string().optional()});var Ri=t.object({type:Ai,name:t.string().optional(),version:t.string().optional(),osInfo:Ti.optional()});var ke=t.object({knowledgeBaseId:E,documentId:E,title:t.string().optional(),snippet:t.string().optional()});var ji=t.object({dropdownOptions:t.list(t.string()),defaultValue:t.string().optional()}).extend(O);var AS=t.object({name:t.string().optional()}).extend(cr);var TS=t.object({status:t.number().optional(),error:t.string().optional(),message:t.string().optional()});var Ci=t.object({id:t.string(),start:t.date().optional(),end:t.date().optional(),duration:t.number().optional()});var Ni=t.object({city:t.string().optional(),state:t.string().optional(),country:t.string().optional(),region:t.string().optional(),latitude:t.number().optional(),longitude:t.number().optional()});var Ui=t.object({ip:t.string().optional()});var Di=t.object({code:t.string().optional()});var ki=t.forwardCompatibleEnum_(["WEB","API","SYSTEM"]);var Bi=t.object({type:ki,deviceInfo:Ri.optional(),browserInfo:Zn.optional(),geoInfo:Ni.optional(),ipInfo:Ui.optional(),languageInfo:Di.optional()});var Se=t.object({timestamp:t.date().optional(),references:t.list(H).optional(),sourceInfo:Bi.optional(),sessionInfo:Ci.optional(),contextInfo:oi.optional()});var Mi=t.forwardCompatibleEnum_(["CREATED_AT","EVENT_NAME","EVENT_TYPE","APP","SESSION_ID","SOURCE_TYPE","SOURCE_LANGUAGE_CODE","SOURCE_DEVICE_TYPE","SOURCE_DEVICE_NAME","SOURCE_BROWSER_TYPE","SOURCE_BROWSER_NAME","SOURCE_GEO_CITY","SOURCE_GEO_STATE","SOURCE_GEO_COUNTRY","USER_REFERENCE_ID","AGENT_USER_ID","TIMESTAMP"]);var zr=t.forwardCompatibleEnum_(["USER","SYSTEM"]);var Ar=t.forwardCompatibleEnum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var Pr=t.forwardCompatibleEnum_(["APP_INSTALLED","APP_UNINSTALLED","APP_UPDATED"]);var ae=t.forwardCompatibleEnum_(["BUTTON_CLICKED","LINK_CLICKED","CHAT_OPENED","CHAT_CLOSED","TEXT_INSERTED","CSAT_SUBMITTED"]);var Ki=t.object({search:t.string().optional(),createdAfter:t.date().optional(),createdBefore:t.date().optional(),references:t.list(H).optional(),eventTypes:t.list(zr).optional(),userEventNames:t.list(ae).optional(),systemEventNames:t.list(Pr).optional(),agentUserIds:t.list(t.string()).optional(),legacyFeedbackTypes:t.list(Ar).optional(),hasEventText:t.boolean().optional()});var Tr=t.object({eventName:Pr}).extend(Se);var Li=t.object({id:P}).extend(Tr);var Rr=t.object({id:P});var Wi=t.object({surveyQuestion:t.string().optional(),surveyAnswer:t.string().optional()});var jr=t.object({rating:t.number().optional(),thumbUp:t.boolean().optional(),survey:Wi.optional()});var Cr=t.object({pageName:t.string().optional(),pageUrl:t.string().optional(),pageTitle:t.string().optional(),linkUrl:t.string().optional(),elementId:t.string().optional()});var Fi=t.object({id:P,eventName:ae,userInfo:Rr,csatInfo:Or.optional(),feedbackInfo:t.list(jr).optional(),pageInfo:Cr.optional()}).extend(Se);var A_=t.union("eventType",{userEvent:Fi,systemEvent:Li}).transform({transform:function(r){return r},untransform:function(r){return r}});var Hi=t.object({id:g}).extend(Tr);var Vi=t.object({id:g.optional(),userDisplayName:t.string().optional()});var Ji=t.object({id:g,createdAt:t.date().optional(),eventName:ae,userInfo:Vi,feedbackInfo:t.list(jr).optional(),csatInfo:Or.optional(),pageInfo:Cr.optional()}).extend(Se);var Nr=t.union("eventType",{userEvent:Ji,systemEvent:Hi}).transform({transform:function(r){return r},untransform:function(r){return r}});var $_=t.object({sort:Mi.optional(),filter:Ki.optional()}).extend(br);var Gi=t.object({number:t.number(),size:t.number(),totalElements:t.number(),totalPages:t.number()});var ew=t.object({events:t.list(Nr)}).extend(Gi);var tw=t.forwardCompatibleEnum_(["CONVERSATION_CREATED","FEEDBACK_CREATED","INBOX_ITEM_CREATED","EVENT_CREATED"]);var uw=t.object({id:P,eventName:ae,eventType:zr,userInfo:Rr.optional(),timestamp:t.date().optional(),reference:H.optional()});var qi=t.object({type:Ar,text:t.string().optional()});var $i=t.object({feedbackId:g,conversationId:g,conversationMessageId:g,userId:g.optional(),createdAt:t.date().optional()}).extend(qi);var Yi=t.forwardCompatibleEnum_(["string","number","boolean","object","array"]);var Xi=t.forwardCompatibleEnum_(["AWS_LAMBDA"]);var xw=t.object({id:t.number(),publicId:t.string(),appId:t.string(),runtime:Xi,organizationId:t.string().optional(),deletedAt:t.date().optional(),createdAt:t.date(),updatedAt:t.date(),versionId:t.number(),code:t.string(),parameters:t.record(t.string(),Yi),functionName:t.string(),versionCreatedAt:t.date(),versionUpdatedAt:t.date()});var Qi=t.object({defaultValue:t.string().optional()}).extend(O);var Zi=t.forwardCompatibleEnum_(["LOW","MEDIUM","HIGH"]);var ea=t.forwardCompatibleEnum_(["OPEN","USER_RESOLVED","SYSTEM_RESOLVED","REGRESSED","IGNORED"]);var _e=t.object({id:g,createdAt:t.date(),updatedAt:t.date(),status:ea,severity:Zi,tags:t.set(t.string()).optional()});var ra=t.object({metadata:t.record(t.string(),t.string()),title:t.string().optional(),description:t.string().optional(),externalUrl:t.string().optional(),assignee:H.optional(),references:t.list(H).optional()}).extend(_e);var Ur=t.object({id:g});var Be=t.object({documentInformation:ke}).extend(Ur);var ta=t.object({recommendedFixes:t.list(Be),otherFixes:t.list(Be),sourceDocument:ke,documents:t.list(ke)}).extend(_e);var Dr=t.object({suggestedTextTitle:t.string(),suggestedText:t.string()}).extend(Ur);var oa=t.object({fix:Dr,conversations:t.list(ni)}).extend(_e);var Xw=t.union("type",{duplicateDocuments:ta,missingKnowledge:oa,custom:ra}).transform({transform:function(r){return r},untransform:function(r){return r}});var rE=t.union("type",{addDocument:Dr,deactivateDocument:Be}).transform({transform:function(r){return r},untransform:function(r){return r}});var oE=t.forwardCompatibleEnum_(["DUPLICATE_DOCUMENT","MISSING_KNOWLEDGE","CUSTOM"]);var na=t.object({defaultValue:t.string().optional(),validation:$.optional()}).extend(O);var cE=t.object({greaterThanOrEqual:t.number().optional(),lessThan:t.number().optional()});var ia=t.object({defaultValue:t.number().optional(),validation:$.optional()}).extend(O);var aa=t.forwardCompatibleEnum_(["basic","post"]);var sa=t.object({oauthScopes:t.list(t.string()),scopeLabels:t.list(t.unknown()).optional(),oauthRedirectUri:t.string().optional(),oauthClientId:t.string().optional(),oauthAuthorizationUrl:t.string().optional(),oauthClientSecret:t.string().optional(),oauthTokenUrl:t.string().optional(),oauthAuthenticationMethod:aa.optional()}).extend(O);var ca=t.object({unionOptions:t.lazy(function(){return ua}),defaultValue:t.unknown().optional()}).extend(O);var gE=t.forwardCompatibleEnum_(["Name","Email","PhoneNumber","StreetAddress","CreditCardNumber","UsBankAccountNumber","UsSocialSecurityNumber","UsUkPassportNumber","UsDriversLicenseNumber","UsIndividualTaxpayerIdentification","Date","IpAddress","Url","AbaRoutingNumber","Age","SwiftCode","AuBankAccountNumber","AuBusinessNumber","AuCompanyNumber","AuDriversLicenseNumber","AuMedicalAccountNumber","AuPassportNumber","AuTaxFileNumber","CaBankAccountNumber","CaDriversLicenseNumber","CaHealthServiceNumber","CaPassportNumber","CaPersonalHealthIdentification","CaSocialInsuranceNumber","EsDni","EsSocialSecurityNumber","EsTaxIdentificationNumber","EuDebitCardNumber","EuDriversLicenseNumber","EuGpsCoordinates","EuNationalIdentificationNumber","EuPassportNumber","EuSocialSecurityNumber","EuTaxIdentificationNumber","FrDriversLicenseNumber","FrHealthInsuranceNumber","FrNationalId","FrPassportNumber","FrSocialSecurityNumber","FrTaxIdentificationNumber","FrValueAddedTaxNumber","InternationalBankingAccountNumber","NzBankAccountNumber","NzDriversLicenseNumber","NzInlandRevenueNumber","NzMinistryOfHealthNumber","NzSocialWelfareNumber","UkDriversLicenseNumber","UkElectoralRollNumber","UkNationalHealthNumber","UkNationalInsuranceNumber","UkUniqueTaxpayerNumber"]);var nr=t.union("preconditionType",{user:ie,conversation:t.object({value:Ii}),group:t.lazyObject(function(){return la})}).transform({transform:function(r){return r},untransform:function(r){return r}});var kr=t.forwardCompatibleEnum_(["AND","OR"]);var la=t.object({operator:kr,preconditions:t.list(t.lazy(function(){return nr}))});var fa=t.object({operator:kr,preconditions:t.list(t.lazy(function(){return ma}))});var ma=t.union("preconditionType",{user:ie,conversation:t.object({value:zi}),group:t.lazyObject(function(){return fa})}).transform({transform:function(r){return r},untransform:function(r){return r}});var pa=t.object({fields:t.lazy(function(){return xe}).optional()}).extend(O);var xe=t.list(t.lazy(function(){return da}));var ya=t.object({value:t.string(),displayName:t.string(),description:t.string().optional(),fields:t.lazy(function(){return xe})});var ua=t.list(t.lazyObject(function(){return ya}));var ba=t.object({defaultValue:t.string().optional(),validation:$.optional()}).extend(O);var da=t.union("type",{text:ba,multiline:na,array:fn,complexarray:t.lazyObject(function(){return ti}),color:ri,image:Qi,checkbox:ei,dropdown:ji,section:t.lazyObject(function(){return pa}),oauth:sa,number:ia,oneOf:t.lazyObject(function(){return ca})}).transform({transform:function(r){return r},untransform:function(r){return r}});var YE=t.forwardCompatibleEnum_(["text","array","complexarray","color","image","multiline","checkbox","dropdown","section","oauth","number","oneOf"]);var T=t.object({organizationId:t.string(),agentId:t.string(),settings:t.record(t.string(),t.unknown())});var ha=t.object({conversations:t.list(g)}).extend(T);var va=t.object({events:t.list(Nr)}).extend(T);var ga=t.object({actionId:t.string(),conversationId:g.optional(),conversationMetadata:t.record(t.string(),t.string()),parameters:t.record(t.string(),t.unknown()),user:un,transientData:t.record(t.string(),t.string()).optional()}).extend(T);var Xz=t.object({response:t.string()});var xa=t.object({feedbacks:t.list($i)}).extend(T);var Sa=t.object({conversationId:g,message:_r}).extend(T);var _a=t.object({inboxItemIds:t.list(g)}).extend(T);var wa=t.object({knowledgeBaseId:P}).extend(T);var Ea=t.object({}).extend(T);var Ia=t.object({}).extend(T);var Oa=t.object({}).extend(T);import Y from"../..";async function X(e){let r=e.headers.get("authorization").replace("Bearer ","");if(process.env.MAVENAGI_WEBHOOK_SECRET){let s=await crypto.subtle.importKey("raw",Buffer.from(process.env.MAVENAGI_WEBHOOK_SECRET,"base64"),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);await He(r,s,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID});return}let o=process.env.ENVIRONMENT===void 0?"":\`.\${process.env.ENVIRONMENT==="sandbox"?\`\${process.env.SANDBOX_USER}.sb\`:process.env.ENVIRONMENT}\`,i=\`https://developers\${process.env.RESIDENCY_ZONE?\`.\${process.env.RESIDENCY_ZONE}\`:""}\${o}.mavenagi-apis.com/.well-known/jwks\`,a=$r(new URL(i));await He(r,a,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID})}async function DA(e){await X(e);let{organizationId:r,agentId:o,settings:n,actionId:i,conversationId:a,conversationMetadata:s,parameters:u,user:l,transientData:m}=ga.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{let f=await Y.executeAction?.({organizationId:r,agentId:o,settings:n,actionId:i,conversationId:a,conversationMetadata:s,parameters:u,user:l,transientData:m});return new Response(JSON.stringify({response:f}),{status:200,headers:{"Content-Type":"application/json"}})}catch(f){return console.error(f),f instanceof Error?new Response(f.message,{status:500}):new Response("No result returned",{status:204})}}async function kA(e){await X(e);let{organizationId:r,agentId:o,settings:n,feedbacks:i}=xa.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.feedbackCreatedOrUpdated?.({organizationId:r,agentId:o,settings:n,feedbacks:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function BA(e){await X(e);let{organizationId:r,agentId:o,settings:n,conversations:i}=ha.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.conversationCreatedOrUpdated?.({organizationId:r,agentId:o,settings:n,conversations:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function MA(e){await X(e);let{organizationId:r,agentId:o,settings:n,inboxItemIds:i}=_a.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.inboxItemCreatedOrUpdated?.({organizationId:r,agentId:o,settings:n,inboxItemIds:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function KA(e){await X(e);let{organizationId:r,agentId:o,settings:n,events:i}=va.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.eventCreatedOrUpdated?.({organizationId:r,agentId:o,settings:n,events:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function LA(e){await X(e);let{organizationId:r,agentId:o,settings:n,knowledgeBaseId:i}=wa.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.knowledgeBaseRefreshed?.({organizationId:r,agentId:o,knowledgeBaseId:i,settings:n}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function WA(e){await X(e);let{organizationId:r,agentId:o,settings:n,conversationId:i,message:a}=Sa.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.handleMessage?.({organizationId:r,agentId:o,conversationId:i,message:a,settings:n}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function FA(e){await X(e);let{organizationId:r,agentId:o,settings:n}=Ea.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.postInstall?.({organizationId:r,agentId:o,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function HA(e){await X(e);let{organizationId:r,agentId:o,settings:n}=Ia.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.preInstall?.({organizationId:r,agentId:o,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function VA(e){await X(e);let{organizationId:r,agentId:o,settings:n}=Oa.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await Y.uninstall?.({organizationId:r,agentId:o,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}export{BA as conversationCreatedOrUpdated,KA as eventCreatedOrUpdated,DA as executeAction,kA as feedbackCreatedOrUpdated,WA as handleMessage,MA as inboxItemCreatedOrUpdated,LA as knowledgeBaseRefreshed,FA as postInstall,HA as preInstall,VA as uninstall};\n`},613:t=>{t.exports=e(import.meta.url)("assert")},181:t=>{t.exports=e(import.meta.url)("buffer")},317:t=>{t.exports=e(import.meta.url)("child_process")},434:t=>{t.exports=e(import.meta.url)("events")},896:t=>{t.exports=e(import.meta.url)("fs")},943:t=>{t.exports=e(import.meta.url)("fs/promises")},857:t=>{t.exports=e(import.meta.url)("os")},928:t=>{t.exports=e(import.meta.url)("path")},203:t=>{t.exports=e(import.meta.url)("stream")},23:t=>{t.exports=e(import.meta.url)("util")},153:(e,t,r)=>{r.d(t,{o0:()=>detect});var n=r(896);var o=r(928);var i=r(48);async function pathExists(e){try{await n.promises.access(e);return true}catch{return false}}var s=new Map;function hasGlobalInstallation(e){const t=`has_global_${e}`;if(s.has(t)){return Promise.resolve(s.get(t))}return i(e,["--version"]).then((e=>/^\d+.\d+.\d+$/.test(e.stdout))).then((e=>{s.set(t,e);return e})).catch((()=>false))}function getTypeofLockFile(e="."){const t=`lockfile_${e}`;if(s.has(t)){return Promise.resolve(s.get(t))}return Promise.all([pathExists((0,o.resolve)(e,"yarn.lock")),pathExists((0,o.resolve)(e,"package-lock.json")),pathExists((0,o.resolve)(e,"pnpm-lock.yaml")),pathExists((0,o.resolve)(e,"bun.lockb"))]).then((([e,r,n,o])=>{let i=null;if(e){i="yarn"}else if(n){i="pnpm"}else if(o){i="bun"}else if(r){i="npm"}s.set(t,i);return i}))}var detect=async({cwd:e,includeGlobalBun:t}={})=>{const r=await getTypeofLockFile(e);if(r){return r}const[n,o,i]=await Promise.all([hasGlobalInstallation("yarn"),hasGlobalInstallation("pnpm"),t&&hasGlobalInstallation("bun")]);if(n){return"yarn"}if(o){return"pnpm"}if(i){return"bun"}return"npm"};function getNpmVersion(e){return execa(e||"npm",["--version"]).then((e=>e.stdout))}function clearCache(){return s.clear()}},246:(t,r,n)=>{n.d(r,{A:()=>Jt});var o=n(613);const i={right:alignRight,center:alignCenter};const s=0;const a=1;const u=2;const c=3;class UI{constructor(e){var t;this.width=e.width;this.wrap=(t=e.wrap)!==null&&t!==void 0?t:true;this.rows=[]}span(...e){const t=this.div(...e);t.span=true}resetOutput(){this.rows=[]}div(...e){if(e.length===0){this.div("")}if(this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==="string"){return this.applyLayoutDSL(e[0])}const t=e.map((e=>{if(typeof e==="string"){return this.colFromString(e)}return e}));this.rows.push(t);return t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split("\n").map((e=>e.split("\t")));let r=0;t.forEach((e=>{if(e.length>1&&l.stringWidth(e[0])>r){r=Math.min(Math.floor(this.width*.5),l.stringWidth(e[0]))}}));t.forEach((e=>{this.div(...e.map(((t,n)=>({text:t.trim(),padding:this.measurePadding(t),width:n===0&&e.length>1?r:undefined}))))}));return this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=l.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];this.rows.forEach((t=>{this.rowToString(t,e)}));return e.filter((e=>!e.hidden)).map((e=>e.text)).join("\n")}rowToString(e,t){this.rasterize(e).forEach(((r,n)=>{let o="";r.forEach(((r,s)=>{const{width:u}=e[s];const f=this.negatePadding(e[s]);let d=r;if(f>l.stringWidth(r)){d+=" ".repeat(f-l.stringWidth(r))}if(e[s].align&&e[s].align!=="left"&&this.wrap){const t=i[e[s].align];d=t(d,f);if(l.stringWidth(d)<f){d+=" ".repeat((u||0)-l.stringWidth(d)-1)}}const p=e[s].padding||[0,0,0,0];if(p[c]){o+=" ".repeat(p[c])}o+=addBorder(e[s],d,"| ");o+=d;o+=addBorder(e[s],d," |");if(p[a]){o+=" ".repeat(p[a])}if(n===0&&t.length>0){o=this.renderInline(o,t[t.length-1])}}));t.push({text:o.replace(/ +$/,""),span:e.span})}));return t}renderInline(e,t){const r=e.match(/^ */);const n=r?r[0].length:0;const o=t.text;const i=l.stringWidth(o.trimRight());if(!t.span){return e}if(!this.wrap){t.hidden=true;return o+e}if(n<i){return e}t.hidden=true;return o.trimRight()+" ".repeat(n-i)+e.trimLeft()}rasterize(e){const t=[];const r=this.columnWidths(e);let n;e.forEach(((e,o)=>{e.width=r[o];if(this.wrap){n=l.wrap(e.text,this.negatePadding(e),{hard:true}).split("\n")}else{n=e.text.split("\n")}if(e.border){n.unshift("."+"-".repeat(this.negatePadding(e)+2)+".");n.push("'"+"-".repeat(this.negatePadding(e)+2)+"'")}if(e.padding){n.unshift(...new Array(e.padding[s]||0).fill(""));n.push(...new Array(e.padding[u]||0).fill(""))}n.forEach(((e,r)=>{if(!t[r]){t.push([])}const n=t[r];for(let e=0;e<o;e++){if(n[e]===undefined){n.push("")}}n.push(e)}))}));return t}negatePadding(e){let t=e.width||0;if(e.padding){t-=(e.padding[c]||0)+(e.padding[a]||0)}if(e.border){t-=4}return t}columnWidths(e){if(!this.wrap){return e.map((e=>e.width||l.stringWidth(e.text)))}let t=e.length;let r=this.width;const n=e.map((e=>{if(e.width){t--;r-=e.width;return e.width}return undefined}));const o=t?Math.floor(r/t):0;return n.map(((t,r)=>{if(t===undefined){return Math.max(o,_minWidth(e[r]))}return t}))}}function addBorder(e,t,r){if(e.border){if(/[.']-+[.']/.test(t)){return""}if(t.trim().length!==0){return r}return" "}return""}function _minWidth(e){const t=e.padding||[];const r=1+(t[c]||0)+(t[a]||0);if(e.border){return r+4}return r}function getWindowWidth(){if(typeof process==="object"&&process.stdout&&process.stdout.columns){return process.stdout.columns}return 80}function alignRight(e,t){e=e.trim();const r=l.stringWidth(e);if(r<t){return" ".repeat(t-r)+e}return e}function alignCenter(e,t){e=e.trim();const r=l.stringWidth(e);if(r>=t){return e}return" ".repeat(t-r>>1)+e}let l;function cliui(e,t){l=t;return new UI({width:(e===null||e===void 0?void 0:e.width)||getWindowWidth(),wrap:e===null||e===void 0?void 0:e.wrap})}function ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const r=`(?:\\u001B\\][\\s\\S]*?${t})`;const n="[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";const o=`${r}|${n}`;return new RegExp(o,e?undefined:"g")}const f=ansiRegex();function stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}if(!e.includes("")&&!e.includes("")){return e}return e.replace(f,"")}const d=161;const p=1114109;const h=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109];const m=12288;const g=65510;const D=[12288,12288,65281,65376,65504,65510];const y=8361;const b=65518;const v=null&&[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518];const E=32;const w=10630;const F=null&&[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630];const C=4352;const A=262141;const O=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];const utilities_isInRange=(e,t)=>{let r=0;let n=Math.floor(e.length/2)-1;while(r<=n){const o=Math.floor((r+n)/2);const i=o*2;if(t<e[i]){n=o-1}else if(t>e[i+1]){r=o+1}else{return true}}return false};const S=19968;const[j,k]=findWideFastPathRange(O);function findWideFastPathRange(e){let t=e[0];let r=e[1];for(let n=0;n<e.length;n+=2){const o=e[n];const i=e[n+1];if(S>=o&&S<=i){return[o,i]}if(i-o>r-t){t=o;r=i}}return[t,r]}const isAmbiguous=e=>{if(e<d||e>p){return false}return utilities_isInRange(h,e)};const isFullWidth=e=>{if(e<m||e>g){return false}return utilities_isInRange(D,e)};const isHalfWidth=e=>{if(e<halfwidthMinimalCodePoint||e>halfwidthMaximumCodePoint){return false}return isInRange(halfwidthRanges,e)};const isNarrow=e=>{if(e<narrowMinimalCodePoint||e>narrowMaximumCodePoint){return false}return isInRange(narrowRanges,e)};const isWide=e=>{if(e>=j&&e<=k){return true}if(e<C||e>A){return false}return utilities_isInRange(O,e)};function lookup_getCategory(e){if(isAmbiguous(e)){return"ambiguous"}if(isFullWidth(e)){return"fullwidth"}if(isHalfWidth(e)){return"halfwidth"}if(isNarrow(e)){return"narrow"}if(isWide(e)){return"wide"}return"neutral"}function validate(e){if(!Number.isSafeInteger(e)){throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}}function eastAsianWidthType(e){validate(e);return getCategory(e)}function eastAsianWidth(e,{ambiguousAsWide:t=false}={}){validate(e);if(isFullWidth(e)||isWide(e)||t&&isAmbiguous(e)){return 2}return 1}var x=n(90);const I=new Intl.Segmenter;const P=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of I.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(P.test(t)){continue}if(x().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}const _=10;const wrapAnsi16=(e=0)=>t=>`[${t+e}m`;const wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`;const wrapAnsi16m=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`;const T={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const N=Object.keys(T.modifier);const B=Object.keys(T.color);const R=Object.keys(T.bgColor);const M=[...B,...R];function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(T)){for(const[t,n]of Object.entries(r)){T[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=T[t];e.set(n[0],n[1])}Object.defineProperty(T,t,{value:r,enumerable:false})}Object.defineProperty(T,"codes",{value:e,enumerable:false});T.color.close="[39m";T.bgColor.close="[49m";T.color.ansi=wrapAnsi16();T.color.ansi256=wrapAnsi256();T.color.ansi16m=wrapAnsi16m();T.bgColor.ansi=wrapAnsi16(_);T.bgColor.ansi256=wrapAnsi256(_);T.bgColor.ansi16m=wrapAnsi16m(_);Object.defineProperties(T,{rgbToAnsi256:{value(e,t,r){if(e===t&&t===r){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:false},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t){return[0,0,0]}let[r]=t;if(r.length===3){r=[...r].map((e=>e+e)).join("")}const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>T.rgbToAnsi256(...T.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value(e){if(e<8){return 30+e}if(e<16){return 90+(e-8)}let t;let r;let n;if(e>=232){t=((e-232)*10+8)/255;r=t;n=t}else{e-=16;const o=e%36;t=Math.floor(e/36)/5;r=Math.floor(o/6)/5;n=o%6/5}const o=Math.max(t,r,n)*2;if(o===0){return 30}let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));if(o===2){i+=60}return i},enumerable:false},rgbToAnsi:{value:(e,t,r)=>T.ansi256ToAnsi(T.rgbToAnsi256(e,t,r)),enumerable:false},hexToAnsi:{value:e=>T.ansi256ToAnsi(T.hexToAnsi256(e)),enumerable:false}});return T}const U=assembleStyles();const L=U;const $=new Set(["",""]);const W=39;const K="";const z="[";const G="]";const H="m";const V=`${G}8;;`;const wrapAnsiCode=e=>`${$.values().next().value}${z}${e}${H}`;const wrapAnsiHyperlink=e=>`${$.values().next().value}${V}${e}${K}`;const wordLengths=e=>e.split(" ").map((e=>stringWidth(e)));const wrapWord=(e,t,r)=>{const n=[...t];let o=false;let i=false;let s=stringWidth(stripAnsi(e.at(-1)));for(const[t,a]of n.entries()){const u=stringWidth(a);if(s+u<=r){e[e.length-1]+=a}else{e.push(a);s=0}if($.has(a)){o=true;const e=n.slice(t+1,t+1+V.length).join("");i=e===V}if(o){if(i){if(a===K){o=false;i=false}}else if(a===H){o=false}continue}s+=u;if(s===r&&t<n.length-1){e.push("");s=0}}if(!s&&e.at(-1).length>0&&e.length>1){e[e.length-2]+=e.pop()}};const stringVisibleTrimSpacesRight=e=>{const t=e.split(" ");let r=t.length;while(r>0){if(stringWidth(t[r-1])>0){break}r--}if(r===t.length){return e}return t.slice(0,r).join(" ")+t.slice(r).join("")};const exec=(e,t,r={})=>{if(r.trim!==false&&e.trim()===""){return""}let n="";let o;let i;const s=wordLengths(e);let a=[""];for(const[n,o]of e.split(" ").entries()){if(r.trim!==false){a[a.length-1]=a.at(-1).trimStart()}let e=stringWidth(a.at(-1));if(n!==0){if(e>=t&&(r.wordWrap===false||r.trim===false)){a.push("");e=0}if(e>0||r.trim===false){a[a.length-1]+=" ";e++}}if(r.hard&&s[n]>t){const r=t-e;const i=1+Math.floor((s[n]-r-1)/t);const u=Math.floor((s[n]-1)/t);if(u<i){a.push("")}wrapWord(a,o,t);continue}if(e+s[n]>t&&e>0&&s[n]>0){if(r.wordWrap===false&&e<t){wrapWord(a,o,t);continue}a.push("")}if(e+s[n]>t&&r.wordWrap===false){wrapWord(a,o,t);continue}a[a.length-1]+=o}if(r.trim!==false){a=a.map((e=>stringVisibleTrimSpacesRight(e)))}const u=a.join("\n");const c=[...u];let l=0;for(const[e,t]of c.entries()){n+=t;if($.has(t)){const{groups:e}=new RegExp(`(?:\\${z}(?<code>\\d+)m|\\${V}(?<uri>.*)${K})`).exec(u.slice(l))||{groups:{}};if(e.code!==undefined){const t=Number.parseFloat(e.code);o=t===W?undefined:t}else if(e.uri!==undefined){i=e.uri.length===0?undefined:e.uri}}const r=L.codes.get(Number(o));if(c[e+1]==="\n"){if(i){n+=wrapAnsiHyperlink("")}if(o&&r){n+=wrapAnsiCode(r)}}else if(t==="\n"){if(o&&r){n+=wrapAnsiCode(o)}if(i){n+=wrapAnsiHyperlink(i)}}l+=t.length}return n};function wrapAnsi(e,t,r){return String(e).normalize().replaceAll("\r\n","\n").split("\n").map((e=>exec(e,t,r))).join("\n")}function ui(e){return cliui(e,{stringWidth:stringWidth,stripAnsi:stripAnsi,wrap:wrapAnsi})}var J=n(928);var q=n(896);function sync(e,t){let r=(0,J.resolve)(".",e);let n,o=(0,q.statSync)(r);if(!o.isDirectory()){r=(0,J.dirname)(r)}while(true){n=t(r,(0,q.readdirSync)(r));if(n)return(0,J.resolve)(r,n);r=(0,J.dirname)(n=r);if(n===r)break}}var Y=n(23);const X=e(import.meta.url)("url");
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
5
5
|
* Copyright (c) 2016, Contributors
|
|
6
6
|
* SPDX-License-Identifier: ISC
|
|
7
7
|
*/
|
|
8
|
-
function camelCase(e){const t=e!==e.toLowerCase()&&e!==e.toUpperCase();if(!t){e=e.toLowerCase()}if(e.indexOf("-")===-1&&e.indexOf("_")===-1){return e}else{let t="";let r=false;const n=e.match(/^-+/);for(let o=n?n[0].length:0;o<e.length;o++){let n=e.charAt(o);if(r){r=false;n=n.toUpperCase()}if(o!==0&&(n==="-"||n==="_")){r=true}else if(n!=="-"&&n!=="_"){t+=n}}return t}}function decamelize(e,t){const r=e.toLowerCase();t=t||"-";let n="";for(let o=0;o<e.length;o++){const i=r.charAt(o);const
|
|
8
|
+
function camelCase(e){const t=e!==e.toLowerCase()&&e!==e.toUpperCase();if(!t){e=e.toLowerCase()}if(e.indexOf("-")===-1&&e.indexOf("_")===-1){return e}else{let t="";let r=false;const n=e.match(/^-+/);for(let o=n?n[0].length:0;o<e.length;o++){let n=e.charAt(o);if(r){r=false;n=n.toUpperCase()}if(o!==0&&(n==="-"||n==="_")){r=true}else if(n!=="-"&&n!=="_"){t+=n}}return t}}function decamelize(e,t){const r=e.toLowerCase();t=t||"-";let n="";for(let o=0;o<e.length;o++){const i=r.charAt(o);const s=e.charAt(o);if(i!==s&&o>0){n+=`${t}${r.charAt(o)}`}else{n+=s}}return n}function looksLikeNumber(e){if(e===null||e===undefined)return false;if(typeof e==="number")return true;if(/^0x[0-9a-f]+$/i.test(e))return true;if(/^0[^.]/.test(e))return false;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright (c) 2016, Contributors
|
|
12
12
|
* SPDX-License-Identifier: ISC
|
|
13
13
|
*/
|
|
14
|
-
function tokenizeArgString(e){if(Array.isArray(e)){return e.map((e=>typeof e!=="string"?e+"":e))}e=e.trim();let t=0;let r=null;let n=null;let o=null;const i=[];for(let
|
|
14
|
+
function tokenizeArgString(e){if(Array.isArray(e)){return e.map((e=>typeof e!=="string"?e+"":e))}e=e.trim();let t=0;let r=null;let n=null;let o=null;const i=[];for(let s=0;s<e.length;s++){r=n;n=e.charAt(s);if(n===" "&&!o){if(!(r===" ")){t++}continue}if(n===o){o=null}else if((n==="'"||n==='"')&&!o){o=n}if(!i[t])i[t]="";i[t]+=n}return i}
|
|
15
15
|
/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright (c) 2016, Contributors
|
|
18
18
|
* SPDX-License-Identifier: ISC
|
|
19
19
|
*/
|
|
20
|
-
var
|
|
20
|
+
var Q;(function(e){e["BOOLEAN"]="boolean";e["STRING"]="string";e["NUMBER"]="number";e["ARRAY"]="array"})(Q||(Q={}));
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright (c) 2016, Contributors
|
|
24
24
|
* SPDX-License-Identifier: ISC
|
|
25
25
|
*/
|
|
26
|
-
let U;class YargsParser{constructor(e){U=e}parse(e,t){const r=Object.assign({alias:undefined,array:undefined,boolean:undefined,config:undefined,configObjects:undefined,configuration:undefined,coerce:undefined,count:undefined,default:undefined,envPrefix:undefined,narg:undefined,normalize:undefined,string:undefined,number:undefined,__:undefined,key:undefined},t);const n=tokenizeArgString(e);const o=typeof e==="string";const i=combineAliases(Object.assign(Object.create(null),r.alias));const u=Object.assign({"boolean-negation":true,"camel-case-expansion":true,"combine-arrays":false,"dot-notation":true,"duplicate-arguments-array":true,"flatten-duplicate-arrays":true,"greedy-arrays":true,"halt-at-non-option":false,"nargs-eats-options":false,"negation-prefix":"no-","parse-numbers":true,"parse-positional-numbers":true,"populate--":false,"set-placeholder-key":false,"short-option-groups":true,"strip-aliased":false,"strip-dashed":false,"unknown-options-as-args":false},r.configuration);const s=Object.assign(Object.create(null),r.default);const a=r.configObjects||[];const c=r.envPrefix;const l=u["populate--"];const D=l?"--":"_";const f=Object.create(null);const d=Object.create(null);const p=r.__||U.format;const h={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]};const g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;const m=new RegExp("^--"+u["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach((function(e){const t=typeof e==="object"?e.key:e;const r=Object.keys(e).map((function(e){const t={boolean:"bools",string:"strings",number:"numbers"};return t[e]})).filter(Boolean).pop();if(r){h[r][t]=true}h.arrays[t]=true;h.keys.push(t)}));[].concat(r.boolean||[]).filter(Boolean).forEach((function(e){h.bools[e]=true;h.keys.push(e)}));[].concat(r.string||[]).filter(Boolean).forEach((function(e){h.strings[e]=true;h.keys.push(e)}));[].concat(r.number||[]).filter(Boolean).forEach((function(e){h.numbers[e]=true;h.keys.push(e)}));[].concat(r.count||[]).filter(Boolean).forEach((function(e){h.counts[e]=true;h.keys.push(e)}));[].concat(r.normalize||[]).filter(Boolean).forEach((function(e){h.normalize[e]=true;h.keys.push(e)}));if(typeof r.narg==="object"){Object.entries(r.narg).forEach((([e,t])=>{if(typeof t==="number"){h.nargs[e]=t;h.keys.push(e)}}))}if(typeof r.coerce==="object"){Object.entries(r.coerce).forEach((([e,t])=>{if(typeof t==="function"){h.coercions[e]=t;h.keys.push(e)}}))}if(typeof r.config!=="undefined"){if(Array.isArray(r.config)||typeof r.config==="string"){[].concat(r.config).filter(Boolean).forEach((function(e){h.configs[e]=true}))}else if(typeof r.config==="object"){Object.entries(r.config).forEach((([e,t])=>{if(typeof t==="boolean"||typeof t==="function"){h.configs[e]=t}}))}}extendAliases(r.key,i,r.default,h.arrays);Object.keys(s).forEach((function(e){(h.aliases[e]||[]).forEach((function(t){s[t]=s[e]}))}));let y=null;checkConfiguration();let F=[];const b=Object.assign(Object.create(null),{_:[]});const E={};for(let e=0;e<n.length;e++){const t=n[e];const r=t.replace(/^-{3,}/,"---");let o;let i;let s;let a;let c;let l;if(t!=="--"&&/^-/.test(t)&&isUnknownOptionAsArg(t)){pushPositional(t)}else if(r.match(/^---+(=|$)/)){pushPositional(t);continue}else if(t.match(/^--.+=/)||!u["short-option-groups"]&&t.match(/^-.+=/)){a=t.match(/^--?([^=]+)=([\s\S]*)$/);if(a!==null&&Array.isArray(a)&&a.length>=3){if(checkAllAliases(a[1],h.arrays)){e=eatArray(e,a[1],n,a[2])}else if(checkAllAliases(a[1],h.nargs)!==false){e=eatNargs(e,a[1],n,a[2])}else{setArg(a[1],a[2],true)}}}else if(t.match(m)&&u["boolean-negation"]){a=t.match(m);if(a!==null&&Array.isArray(a)&&a.length>=2){i=a[1];setArg(i,checkAllAliases(i,h.arrays)?[false]:false)}}else if(t.match(/^--.+/)||!u["short-option-groups"]&&t.match(/^-[^-]+/)){a=t.match(/^--?(.+)/);if(a!==null&&Array.isArray(a)&&a.length>=2){i=a[1];if(checkAllAliases(i,h.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,h.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!c.match(/^-/)||c.match(g))&&!checkAllAliases(i,h.bools)&&!checkAllAliases(i,h.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-.\..+=/)){a=t.match(/^-([^=]+)=([\s\S]*)$/);if(a!==null&&Array.isArray(a)&&a.length>=3){setArg(a[1],a[2])}}else if(t.match(/^-.\..+/)&&!t.match(g)){c=n[e+1];a=t.match(/^-(.\..+)/);if(a!==null&&Array.isArray(a)&&a.length>=2){i=a[1];if(c!==undefined&&!c.match(/^-/)&&!checkAllAliases(i,h.bools)&&!checkAllAliases(i,h.counts)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}else if(t.match(/^-[^-]+/)&&!t.match(g)){s=t.slice(1,-1).split("");o=false;for(let r=0;r<s.length;r++){c=t.slice(r+2);if(s[r+1]&&s[r+1]==="="){l=t.slice(r+3);i=s[r];if(checkAllAliases(i,h.arrays)){e=eatArray(e,i,n,l)}else if(checkAllAliases(i,h.nargs)!==false){e=eatNargs(e,i,n,l)}else{setArg(i,l)}o=true;break}if(c==="-"){setArg(s[r],c);continue}if(/[A-Za-z]/.test(s[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(c)&&checkAllAliases(c,h.bools)===false){setArg(s[r],c);o=true;break}if(s[r+1]&&s[r+1].match(/\W/)){setArg(s[r],c);o=true;break}else{setArg(s[r],defaultValue(s[r]))}}i=t.slice(-1)[0];if(!o&&i!=="-"){if(checkAllAliases(i,h.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,h.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!/^(-|--)[^-]/.test(c)||c.match(g))&&!checkAllAliases(i,h.bools)&&!checkAllAliases(i,h.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-[0-9]$/)&&t.match(g)&&checkAllAliases(t.slice(1),h.bools)){i=t.slice(1);setArg(i,defaultValue(i))}else if(t==="--"){F=n.slice(e+1);break}else if(u["halt-at-non-option"]){F=n.slice(e);break}else{pushPositional(t)}}applyEnvVars(b,true);applyEnvVars(b,false);setConfig(b);setConfigObjects();applyDefaultsAndAliases(b,h.aliases,s,true);applyCoercions(b);if(u["set-placeholder-key"])setPlaceholderKeys(b);Object.keys(h.counts).forEach((function(e){if(!hasKey(b,e.split(".")))setArg(e,0)}));if(l&&F.length)b[D]=[];F.forEach((function(e){b[D].push(e)}));if(u["camel-case-expansion"]&&u["strip-dashed"]){Object.keys(b).filter((e=>e!=="--"&&e.includes("-"))).forEach((e=>{delete b[e]}))}if(u["strip-aliased"]){[].concat(...Object.keys(i).map((e=>i[e]))).forEach((e=>{if(u["camel-case-expansion"]&&e.includes("-")){delete b[e.split(".").map((e=>camelCase(e))).join(".")]}delete b[e]}))}function pushPositional(e){const t=maybeCoerceNumber("_",e);if(typeof t==="string"||typeof t==="number"){b._.push(t)}}function eatNargs(e,t,r,n){let o;let i=checkAllAliases(t,h.nargs);i=typeof i!=="number"||isNaN(i)?1:i;if(i===0){if(!isUndefined(n)){y=Error(p("Argument unexpected for: %s",t))}setArg(t,defaultValue(t));return e}let s=isUndefined(n)?0:1;if(u["nargs-eats-options"]){if(r.length-(e+1)+s<i){y=Error(p("Not enough arguments following: %s",t))}s=i}else{for(o=e+1;o<r.length;o++){if(!r[o].match(/^-[^0-9]/)||r[o].match(g)||isUnknownOptionAsArg(r[o]))s++;else break}if(s<i)y=Error(p("Not enough arguments following: %s",t))}let a=Math.min(s,i);if(!isUndefined(n)&&a>0){setArg(t,n);a--}for(o=e+1;o<a+e+1;o++){setArg(t,r[o])}return e+a}function eatArray(e,t,r,n){let i=[];let a=n||r[e+1];const c=checkAllAliases(t,h.nargs);if(checkAllAliases(t,h.bools)&&!/^(true|false)$/.test(a)){i.push(true)}else if(isUndefined(a)||isUndefined(n)&&/^-/.test(a)&&!g.test(a)&&!isUnknownOptionAsArg(a)){if(s[t]!==undefined){const e=s[t];i=Array.isArray(e)?e:[e]}}else{if(!isUndefined(n)){i.push(processValue(t,n,true))}for(let n=e+1;n<r.length;n++){if(!u["greedy-arrays"]&&i.length>0||c&&typeof c==="number"&&i.length>=c)break;a=r[n];if(/^-/.test(a)&&!g.test(a)&&!isUnknownOptionAsArg(a))break;e=n;i.push(processValue(t,a,o))}}if(typeof c==="number"&&(c&&i.length<c||isNaN(c)&&i.length===0)){y=Error(p("Not enough arguments following: %s",t))}setArg(t,i);return e}function setArg(e,t,r=o){if(/-/.test(e)&&u["camel-case-expansion"]){const t=e.split(".").map((function(e){return camelCase(e)})).join(".");addNewAlias(e,t)}const n=processValue(e,t,r);const i=e.split(".");setKey(b,i,n);if(h.aliases[e]){h.aliases[e].forEach((function(e){const t=e.split(".");setKey(b,t,n)}))}if(i.length>1&&u["dot-notation"]){(h.aliases[i[0]]||[]).forEach((function(t){let r=t.split(".");const o=[].concat(i);o.shift();r=r.concat(o);if(!(h.aliases[e]||[]).includes(r.join("."))){setKey(b,r,n)}}))}if(checkAllAliases(e,h.normalize)&&!checkAllAliases(e,h.arrays)){const r=[e].concat(h.aliases[e]||[]);r.forEach((function(e){Object.defineProperty(E,e,{enumerable:true,get(){return t},set(e){t=typeof e==="string"?U.normalize(e):e}})}))}}function addNewAlias(e,t){if(!(h.aliases[e]&&h.aliases[e].length)){h.aliases[e]=[t];f[t]=true}if(!(h.aliases[t]&&h.aliases[t].length)){addNewAlias(t,e)}}function processValue(e,t,r){if(r){t=stripQuotes(t)}if(checkAllAliases(e,h.bools)||checkAllAliases(e,h.counts)){if(typeof t==="string")t=t==="true"}let n=Array.isArray(t)?t.map((function(t){return maybeCoerceNumber(e,t)})):maybeCoerceNumber(e,t);if(checkAllAliases(e,h.counts)&&(isUndefined(n)||typeof n==="boolean")){n=increment()}if(checkAllAliases(e,h.normalize)&&checkAllAliases(e,h.arrays)){if(Array.isArray(t))n=t.map((e=>U.normalize(e)));else n=U.normalize(t)}return n}function maybeCoerceNumber(e,t){if(!u["parse-positional-numbers"]&&e==="_")return t;if(!checkAllAliases(e,h.strings)&&!checkAllAliases(e,h.bools)&&!Array.isArray(t)){const r=looksLikeNumber(t)&&u["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)));if(r||!isUndefined(t)&&checkAllAliases(e,h.numbers)){t=Number(t)}}return t}function setConfig(e){const t=Object.create(null);applyDefaultsAndAliases(t,h.aliases,s);Object.keys(h.configs).forEach((function(r){const n=e[r]||t[r];if(n){try{let e=null;const t=U.resolve(U.cwd(),n);const o=h.configs[r];if(typeof o==="function"){try{e=o(t)}catch(t){e=t}if(e instanceof Error){y=e;return}}else{e=U.require(t)}setConfigObject(e)}catch(t){if(t.name==="PermissionDenied")y=t;else if(e[r])y=Error(p("Invalid JSON config file: %s",n))}}}))}function setConfigObject(e,t){Object.keys(e).forEach((function(r){const n=e[r];const o=t?t+"."+r:r;if(typeof n==="object"&&n!==null&&!Array.isArray(n)&&u["dot-notation"]){setConfigObject(n,o)}else{if(!hasKey(b,o.split("."))||checkAllAliases(o,h.arrays)&&u["combine-arrays"]){setArg(o,n)}}}))}function setConfigObjects(){if(typeof a!=="undefined"){a.forEach((function(e){setConfigObject(e)}))}}function applyEnvVars(e,t){if(typeof c==="undefined")return;const r=typeof c==="string"?c:"";const n=U.env();Object.keys(n).forEach((function(o){if(r===""||o.lastIndexOf(r,0)===0){const i=o.split("__").map((function(e,t){if(t===0){e=e.substring(r.length)}return camelCase(e)}));if((t&&h.configs[i.join(".")]||!t)&&!hasKey(e,i)){setArg(i.join("."),n[o])}}}))}function applyCoercions(e){let t;const r=new Set;Object.keys(e).forEach((function(n){if(!r.has(n)){t=checkAllAliases(n,h.coercions);if(typeof t==="function"){try{const o=maybeCoerceNumber(n,t(e[n]));[].concat(h.aliases[n]||[],n).forEach((t=>{r.add(t);e[t]=o}))}catch(e){y=e}}}}))}function setPlaceholderKeys(e){h.keys.forEach((t=>{if(~t.indexOf("."))return;if(typeof e[t]==="undefined")e[t]=undefined}));return e}function applyDefaultsAndAliases(e,t,r,n=false){Object.keys(r).forEach((function(o){if(!hasKey(e,o.split("."))){setKey(e,o.split("."),r[o]);if(n)d[o]=true;(t[o]||[]).forEach((function(t){if(hasKey(e,t.split(".")))return;setKey(e,t.split("."),r[o])}))}}))}function hasKey(e,t){let r=e;if(!u["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){r=r[e]||{}}));const n=t[t.length-1];if(typeof r!=="object")return false;else return n in r}function setKey(e,t,r){let n=e;if(!u["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){e=sanitizeKey(e);if(typeof n==="object"&&n[e]===undefined){n[e]={}}if(typeof n[e]!=="object"||Array.isArray(n[e])){if(Array.isArray(n[e])){n[e].push({})}else{n[e]=[n[e],{}]}n=n[e][n[e].length-1]}else{n=n[e]}}));const o=sanitizeKey(t[t.length-1]);const i=checkAllAliases(t.join("."),h.arrays);const s=Array.isArray(r);let a=u["duplicate-arguments-array"];if(!a&&checkAllAliases(o,h.nargs)){a=true;if(!isUndefined(n[o])&&h.nargs[o]===1||Array.isArray(n[o])&&n[o].length===h.nargs[o]){n[o]=undefined}}if(r===increment()){n[o]=increment(n[o])}else if(Array.isArray(n[o])){if(a&&i&&s){n[o]=u["flatten-duplicate-arrays"]?n[o].concat(r):(Array.isArray(n[o][0])?n[o]:[n[o]]).concat([r])}else if(!a&&Boolean(i)===Boolean(s)){n[o]=r}else{n[o]=n[o].concat([r])}}else if(n[o]===undefined&&i){n[o]=s?r:[r]}else if(a&&!(n[o]===undefined||checkAllAliases(o,h.counts)||checkAllAliases(o,h.bools))){n[o]=[n[o],r]}else{n[o]=r}}function extendAliases(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){if(h.aliases[e])return;h.aliases[e]=[].concat(i[e]||[]);h.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&u["camel-case-expansion"]){const r=camelCase(t);if(r!==e&&h.aliases[e].indexOf(r)===-1){h.aliases[e].push(r);f[r]=true}}}));h.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&u["camel-case-expansion"]){const r=decamelize(t,"-");if(r!==e&&h.aliases[e].indexOf(r)===-1){h.aliases[e].push(r);f[r]=true}}}));h.aliases[e].forEach((function(t){h.aliases[t]=[e].concat(h.aliases[e].filter((function(e){return t!==e})))}))}))}))}function checkAllAliases(e,t){const r=[].concat(h.aliases[e]||[],e);const n=Object.keys(t);const o=r.find((e=>n.includes(e)));return o?t[o]:false}function hasAnyFlag(e){const t=Object.keys(h);const r=[].concat(t.map((e=>h[e])));return r.some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function hasFlagsMatching(e,...t){const r=[].concat(...t);return r.some((function(t){const r=e.match(t);return r&&hasAnyFlag(r[1])}))}function hasAllShortFlags(e){if(e.match(g)||!e.match(/^-[^-]+/)){return false}let t=true;let r;const n=e.slice(1).split("");for(let o=0;o<n.length;o++){r=e.slice(o+2);if(!hasAnyFlag(n[o])){t=false;break}if(n[o+1]&&n[o+1]==="="||r==="-"||/[A-Za-z]/.test(n[o])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(r)||n[o+1]&&n[o+1].match(/\W/)){break}}return t}function isUnknownOptionAsArg(e){return u["unknown-options-as-args"]&&isUnknownOption(e)}function isUnknownOption(e){e=e.replace(/^-{3,}/,"--");if(e.match(g)){return false}if(hasAllShortFlags(e)){return false}const t=/^-+([^=]+?)=[\s\S]*$/;const r=/^-+([^=]+?)$/;const n=/^-+([^=]+?)-$/;const o=/^-+([^=]+?\d+)$/;const i=/^-+([^=]+?)\W+.*$/;return!hasFlagsMatching(e,t,m,r,n,o,i)}function defaultValue(e){if(!checkAllAliases(e,h.bools)&&!checkAllAliases(e,h.counts)&&`${e}`in s){return s[e]}else{return defaultForType(guessType(e))}}function defaultForType(e){const t={[R.BOOLEAN]:true,[R.STRING]:"",[R.NUMBER]:undefined,[R.ARRAY]:[]};return t[e]}function guessType(e){let t=R.BOOLEAN;if(checkAllAliases(e,h.strings))t=R.STRING;else if(checkAllAliases(e,h.numbers))t=R.NUMBER;else if(checkAllAliases(e,h.bools))t=R.BOOLEAN;else if(checkAllAliases(e,h.arrays))t=R.ARRAY;return t}function isUndefined(e){return e===undefined}function checkConfiguration(){Object.keys(h.counts).find((e=>{if(checkAllAliases(e,h.arrays)){y=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",e));return true}else if(checkAllAliases(e,h.nargs)){y=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",e));return true}return false}))}return{aliases:Object.assign({},h.aliases),argv:Object.assign(E,b),configuration:u,defaulted:Object.assign({},d),error:y,newAliases:Object.assign({},f)}}}function combineAliases(e){const t=[];const r=Object.create(null);let n=true;Object.keys(e).forEach((function(r){t.push([].concat(e[r],r))}));while(n){n=false;for(let e=0;e<t.length;e++){for(let r=e+1;r<t.length;r++){const o=t[e].filter((function(e){return t[r].indexOf(e)!==-1}));if(o.length){t[e]=t[e].concat(t[r]);t.splice(r,1);n=true;break}}}}t.forEach((function(e){e=e.filter((function(e,t,r){return r.indexOf(e)===t}));const t=e.pop();if(t!==undefined&&typeof t==="string"){r[t]=e}}));return r}function increment(e){return e!==undefined?e+1:1}function sanitizeKey(e){if(e==="__proto__")return"___proto___";return e}function stripQuotes(e){return typeof e==="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}const $=e(import.meta.url)("node:module");
|
|
26
|
+
let Z;class YargsParser{constructor(e){Z=e}parse(e,t){const r=Object.assign({alias:undefined,array:undefined,boolean:undefined,config:undefined,configObjects:undefined,configuration:undefined,coerce:undefined,count:undefined,default:undefined,envPrefix:undefined,narg:undefined,normalize:undefined,string:undefined,number:undefined,__:undefined,key:undefined},t);const n=tokenizeArgString(e);const o=typeof e==="string";const i=combineAliases(Object.assign(Object.create(null),r.alias));const s=Object.assign({"boolean-negation":true,"camel-case-expansion":true,"combine-arrays":false,"dot-notation":true,"duplicate-arguments-array":true,"flatten-duplicate-arrays":true,"greedy-arrays":true,"halt-at-non-option":false,"nargs-eats-options":false,"negation-prefix":"no-","parse-numbers":true,"parse-positional-numbers":true,"populate--":false,"set-placeholder-key":false,"short-option-groups":true,"strip-aliased":false,"strip-dashed":false,"unknown-options-as-args":false},r.configuration);const a=Object.assign(Object.create(null),r.default);const u=r.configObjects||[];const c=r.envPrefix;const l=s["populate--"];const f=l?"--":"_";const d=Object.create(null);const p=Object.create(null);const h=r.__||Z.format;const m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]};const g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;const D=new RegExp("^--"+s["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach((function(e){const t=typeof e==="object"?e.key:e;const r=Object.keys(e).map((function(e){const t={boolean:"bools",string:"strings",number:"numbers"};return t[e]})).filter(Boolean).pop();if(r){m[r][t]=true}m.arrays[t]=true;m.keys.push(t)}));[].concat(r.boolean||[]).filter(Boolean).forEach((function(e){m.bools[e]=true;m.keys.push(e)}));[].concat(r.string||[]).filter(Boolean).forEach((function(e){m.strings[e]=true;m.keys.push(e)}));[].concat(r.number||[]).filter(Boolean).forEach((function(e){m.numbers[e]=true;m.keys.push(e)}));[].concat(r.count||[]).filter(Boolean).forEach((function(e){m.counts[e]=true;m.keys.push(e)}));[].concat(r.normalize||[]).filter(Boolean).forEach((function(e){m.normalize[e]=true;m.keys.push(e)}));if(typeof r.narg==="object"){Object.entries(r.narg).forEach((([e,t])=>{if(typeof t==="number"){m.nargs[e]=t;m.keys.push(e)}}))}if(typeof r.coerce==="object"){Object.entries(r.coerce).forEach((([e,t])=>{if(typeof t==="function"){m.coercions[e]=t;m.keys.push(e)}}))}if(typeof r.config!=="undefined"){if(Array.isArray(r.config)||typeof r.config==="string"){[].concat(r.config).filter(Boolean).forEach((function(e){m.configs[e]=true}))}else if(typeof r.config==="object"){Object.entries(r.config).forEach((([e,t])=>{if(typeof t==="boolean"||typeof t==="function"){m.configs[e]=t}}))}}extendAliases(r.key,i,r.default,m.arrays);Object.keys(a).forEach((function(e){(m.aliases[e]||[]).forEach((function(t){a[t]=a[e]}))}));let y=null;checkConfiguration();let b=[];const v=Object.assign(Object.create(null),{_:[]});const E={};for(let e=0;e<n.length;e++){const t=n[e];const r=t.replace(/^-{3,}/,"---");let o;let i;let a;let u;let c;let l;if(t!=="--"&&/^-/.test(t)&&isUnknownOptionAsArg(t)){pushPositional(t)}else if(r.match(/^---+(=|$)/)){pushPositional(t);continue}else if(t.match(/^--.+=/)||!s["short-option-groups"]&&t.match(/^-.+=/)){u=t.match(/^--?([^=]+)=([\s\S]*)$/);if(u!==null&&Array.isArray(u)&&u.length>=3){if(checkAllAliases(u[1],m.arrays)){e=eatArray(e,u[1],n,u[2])}else if(checkAllAliases(u[1],m.nargs)!==false){e=eatNargs(e,u[1],n,u[2])}else{setArg(u[1],u[2],true)}}}else if(t.match(D)&&s["boolean-negation"]){u=t.match(D);if(u!==null&&Array.isArray(u)&&u.length>=2){i=u[1];setArg(i,checkAllAliases(i,m.arrays)?[false]:false)}}else if(t.match(/^--.+/)||!s["short-option-groups"]&&t.match(/^-[^-]+/)){u=t.match(/^--?(.+)/);if(u!==null&&Array.isArray(u)&&u.length>=2){i=u[1];if(checkAllAliases(i,m.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,m.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!c.match(/^-/)||c.match(g))&&!checkAllAliases(i,m.bools)&&!checkAllAliases(i,m.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-.\..+=/)){u=t.match(/^-([^=]+)=([\s\S]*)$/);if(u!==null&&Array.isArray(u)&&u.length>=3){setArg(u[1],u[2])}}else if(t.match(/^-.\..+/)&&!t.match(g)){c=n[e+1];u=t.match(/^-(.\..+)/);if(u!==null&&Array.isArray(u)&&u.length>=2){i=u[1];if(c!==undefined&&!c.match(/^-/)&&!checkAllAliases(i,m.bools)&&!checkAllAliases(i,m.counts)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}else if(t.match(/^-[^-]+/)&&!t.match(g)){a=t.slice(1,-1).split("");o=false;for(let r=0;r<a.length;r++){c=t.slice(r+2);if(a[r+1]&&a[r+1]==="="){l=t.slice(r+3);i=a[r];if(checkAllAliases(i,m.arrays)){e=eatArray(e,i,n,l)}else if(checkAllAliases(i,m.nargs)!==false){e=eatNargs(e,i,n,l)}else{setArg(i,l)}o=true;break}if(c==="-"){setArg(a[r],c);continue}if(/[A-Za-z]/.test(a[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(c)&&checkAllAliases(c,m.bools)===false){setArg(a[r],c);o=true;break}if(a[r+1]&&a[r+1].match(/\W/)){setArg(a[r],c);o=true;break}else{setArg(a[r],defaultValue(a[r]))}}i=t.slice(-1)[0];if(!o&&i!=="-"){if(checkAllAliases(i,m.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,m.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!/^(-|--)[^-]/.test(c)||c.match(g))&&!checkAllAliases(i,m.bools)&&!checkAllAliases(i,m.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-[0-9]$/)&&t.match(g)&&checkAllAliases(t.slice(1),m.bools)){i=t.slice(1);setArg(i,defaultValue(i))}else if(t==="--"){b=n.slice(e+1);break}else if(s["halt-at-non-option"]){b=n.slice(e);break}else{pushPositional(t)}}applyEnvVars(v,true);applyEnvVars(v,false);setConfig(v);setConfigObjects();applyDefaultsAndAliases(v,m.aliases,a,true);applyCoercions(v);if(s["set-placeholder-key"])setPlaceholderKeys(v);Object.keys(m.counts).forEach((function(e){if(!hasKey(v,e.split(".")))setArg(e,0)}));if(l&&b.length)v[f]=[];b.forEach((function(e){v[f].push(e)}));if(s["camel-case-expansion"]&&s["strip-dashed"]){Object.keys(v).filter((e=>e!=="--"&&e.includes("-"))).forEach((e=>{delete v[e]}))}if(s["strip-aliased"]){[].concat(...Object.keys(i).map((e=>i[e]))).forEach((e=>{if(s["camel-case-expansion"]&&e.includes("-")){delete v[e.split(".").map((e=>camelCase(e))).join(".")]}delete v[e]}))}function pushPositional(e){const t=maybeCoerceNumber("_",e);if(typeof t==="string"||typeof t==="number"){v._.push(t)}}function eatNargs(e,t,r,n){let o;let i=checkAllAliases(t,m.nargs);i=typeof i!=="number"||isNaN(i)?1:i;if(i===0){if(!isUndefined(n)){y=Error(h("Argument unexpected for: %s",t))}setArg(t,defaultValue(t));return e}let a=isUndefined(n)?0:1;if(s["nargs-eats-options"]){if(r.length-(e+1)+a<i){y=Error(h("Not enough arguments following: %s",t))}a=i}else{for(o=e+1;o<r.length;o++){if(!r[o].match(/^-[^0-9]/)||r[o].match(g)||isUnknownOptionAsArg(r[o]))a++;else break}if(a<i)y=Error(h("Not enough arguments following: %s",t))}let u=Math.min(a,i);if(!isUndefined(n)&&u>0){setArg(t,n);u--}for(o=e+1;o<u+e+1;o++){setArg(t,r[o])}return e+u}function eatArray(e,t,r,n){let i=[];let u=n||r[e+1];const c=checkAllAliases(t,m.nargs);if(checkAllAliases(t,m.bools)&&!/^(true|false)$/.test(u)){i.push(true)}else if(isUndefined(u)||isUndefined(n)&&/^-/.test(u)&&!g.test(u)&&!isUnknownOptionAsArg(u)){if(a[t]!==undefined){const e=a[t];i=Array.isArray(e)?e:[e]}}else{if(!isUndefined(n)){i.push(processValue(t,n,true))}for(let n=e+1;n<r.length;n++){if(!s["greedy-arrays"]&&i.length>0||c&&typeof c==="number"&&i.length>=c)break;u=r[n];if(/^-/.test(u)&&!g.test(u)&&!isUnknownOptionAsArg(u))break;e=n;i.push(processValue(t,u,o))}}if(typeof c==="number"&&(c&&i.length<c||isNaN(c)&&i.length===0)){y=Error(h("Not enough arguments following: %s",t))}setArg(t,i);return e}function setArg(e,t,r=o){if(/-/.test(e)&&s["camel-case-expansion"]){const t=e.split(".").map((function(e){return camelCase(e)})).join(".");addNewAlias(e,t)}const n=processValue(e,t,r);const i=e.split(".");setKey(v,i,n);if(m.aliases[e]){m.aliases[e].forEach((function(e){const t=e.split(".");setKey(v,t,n)}))}if(i.length>1&&s["dot-notation"]){(m.aliases[i[0]]||[]).forEach((function(t){let r=t.split(".");const o=[].concat(i);o.shift();r=r.concat(o);if(!(m.aliases[e]||[]).includes(r.join("."))){setKey(v,r,n)}}))}if(checkAllAliases(e,m.normalize)&&!checkAllAliases(e,m.arrays)){const r=[e].concat(m.aliases[e]||[]);r.forEach((function(e){Object.defineProperty(E,e,{enumerable:true,get(){return t},set(e){t=typeof e==="string"?Z.normalize(e):e}})}))}}function addNewAlias(e,t){if(!(m.aliases[e]&&m.aliases[e].length)){m.aliases[e]=[t];d[t]=true}if(!(m.aliases[t]&&m.aliases[t].length)){addNewAlias(t,e)}}function processValue(e,t,r){if(r){t=stripQuotes(t)}if(checkAllAliases(e,m.bools)||checkAllAliases(e,m.counts)){if(typeof t==="string")t=t==="true"}let n=Array.isArray(t)?t.map((function(t){return maybeCoerceNumber(e,t)})):maybeCoerceNumber(e,t);if(checkAllAliases(e,m.counts)&&(isUndefined(n)||typeof n==="boolean")){n=increment()}if(checkAllAliases(e,m.normalize)&&checkAllAliases(e,m.arrays)){if(Array.isArray(t))n=t.map((e=>Z.normalize(e)));else n=Z.normalize(t)}return n}function maybeCoerceNumber(e,t){if(!s["parse-positional-numbers"]&&e==="_")return t;if(!checkAllAliases(e,m.strings)&&!checkAllAliases(e,m.bools)&&!Array.isArray(t)){const r=looksLikeNumber(t)&&s["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)));if(r||!isUndefined(t)&&checkAllAliases(e,m.numbers)){t=Number(t)}}return t}function setConfig(e){const t=Object.create(null);applyDefaultsAndAliases(t,m.aliases,a);Object.keys(m.configs).forEach((function(r){const n=e[r]||t[r];if(n){try{let e=null;const t=Z.resolve(Z.cwd(),n);const o=m.configs[r];if(typeof o==="function"){try{e=o(t)}catch(t){e=t}if(e instanceof Error){y=e;return}}else{e=Z.require(t)}setConfigObject(e)}catch(t){if(t.name==="PermissionDenied")y=t;else if(e[r])y=Error(h("Invalid JSON config file: %s",n))}}}))}function setConfigObject(e,t){Object.keys(e).forEach((function(r){const n=e[r];const o=t?t+"."+r:r;if(typeof n==="object"&&n!==null&&!Array.isArray(n)&&s["dot-notation"]){setConfigObject(n,o)}else{if(!hasKey(v,o.split("."))||checkAllAliases(o,m.arrays)&&s["combine-arrays"]){setArg(o,n)}}}))}function setConfigObjects(){if(typeof u!=="undefined"){u.forEach((function(e){setConfigObject(e)}))}}function applyEnvVars(e,t){if(typeof c==="undefined")return;const r=typeof c==="string"?c:"";const n=Z.env();Object.keys(n).forEach((function(o){if(r===""||o.lastIndexOf(r,0)===0){const i=o.split("__").map((function(e,t){if(t===0){e=e.substring(r.length)}return camelCase(e)}));if((t&&m.configs[i.join(".")]||!t)&&!hasKey(e,i)){setArg(i.join("."),n[o])}}}))}function applyCoercions(e){let t;const r=new Set;Object.keys(e).forEach((function(n){if(!r.has(n)){t=checkAllAliases(n,m.coercions);if(typeof t==="function"){try{const o=maybeCoerceNumber(n,t(e[n]));[].concat(m.aliases[n]||[],n).forEach((t=>{r.add(t);e[t]=o}))}catch(e){y=e}}}}))}function setPlaceholderKeys(e){m.keys.forEach((t=>{if(~t.indexOf("."))return;if(typeof e[t]==="undefined")e[t]=undefined}));return e}function applyDefaultsAndAliases(e,t,r,n=false){Object.keys(r).forEach((function(o){if(!hasKey(e,o.split("."))){setKey(e,o.split("."),r[o]);if(n)p[o]=true;(t[o]||[]).forEach((function(t){if(hasKey(e,t.split(".")))return;setKey(e,t.split("."),r[o])}))}}))}function hasKey(e,t){let r=e;if(!s["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){r=r[e]||{}}));const n=t[t.length-1];if(typeof r!=="object")return false;else return n in r}function setKey(e,t,r){let n=e;if(!s["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){e=sanitizeKey(e);if(typeof n==="object"&&n[e]===undefined){n[e]={}}if(typeof n[e]!=="object"||Array.isArray(n[e])){if(Array.isArray(n[e])){n[e].push({})}else{n[e]=[n[e],{}]}n=n[e][n[e].length-1]}else{n=n[e]}}));const o=sanitizeKey(t[t.length-1]);const i=checkAllAliases(t.join("."),m.arrays);const a=Array.isArray(r);let u=s["duplicate-arguments-array"];if(!u&&checkAllAliases(o,m.nargs)){u=true;if(!isUndefined(n[o])&&m.nargs[o]===1||Array.isArray(n[o])&&n[o].length===m.nargs[o]){n[o]=undefined}}if(r===increment()){n[o]=increment(n[o])}else if(Array.isArray(n[o])){if(u&&i&&a){n[o]=s["flatten-duplicate-arrays"]?n[o].concat(r):(Array.isArray(n[o][0])?n[o]:[n[o]]).concat([r])}else if(!u&&Boolean(i)===Boolean(a)){n[o]=r}else{n[o]=n[o].concat([r])}}else if(n[o]===undefined&&i){n[o]=a?r:[r]}else if(u&&!(n[o]===undefined||checkAllAliases(o,m.counts)||checkAllAliases(o,m.bools))){n[o]=[n[o],r]}else{n[o]=r}}function extendAliases(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){if(m.aliases[e])return;m.aliases[e]=[].concat(i[e]||[]);m.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&s["camel-case-expansion"]){const r=camelCase(t);if(r!==e&&m.aliases[e].indexOf(r)===-1){m.aliases[e].push(r);d[r]=true}}}));m.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&s["camel-case-expansion"]){const r=decamelize(t,"-");if(r!==e&&m.aliases[e].indexOf(r)===-1){m.aliases[e].push(r);d[r]=true}}}));m.aliases[e].forEach((function(t){m.aliases[t]=[e].concat(m.aliases[e].filter((function(e){return t!==e})))}))}))}))}function checkAllAliases(e,t){const r=[].concat(m.aliases[e]||[],e);const n=Object.keys(t);const o=r.find((e=>n.includes(e)));return o?t[o]:false}function hasAnyFlag(e){const t=Object.keys(m);const r=[].concat(t.map((e=>m[e])));return r.some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function hasFlagsMatching(e,...t){const r=[].concat(...t);return r.some((function(t){const r=e.match(t);return r&&hasAnyFlag(r[1])}))}function hasAllShortFlags(e){if(e.match(g)||!e.match(/^-[^-]+/)){return false}let t=true;let r;const n=e.slice(1).split("");for(let o=0;o<n.length;o++){r=e.slice(o+2);if(!hasAnyFlag(n[o])){t=false;break}if(n[o+1]&&n[o+1]==="="||r==="-"||/[A-Za-z]/.test(n[o])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(r)||n[o+1]&&n[o+1].match(/\W/)){break}}return t}function isUnknownOptionAsArg(e){return s["unknown-options-as-args"]&&isUnknownOption(e)}function isUnknownOption(e){e=e.replace(/^-{3,}/,"--");if(e.match(g)){return false}if(hasAllShortFlags(e)){return false}const t=/^-+([^=]+?)=[\s\S]*$/;const r=/^-+([^=]+?)$/;const n=/^-+([^=]+?)-$/;const o=/^-+([^=]+?\d+)$/;const i=/^-+([^=]+?)\W+.*$/;return!hasFlagsMatching(e,t,D,r,n,o,i)}function defaultValue(e){if(!checkAllAliases(e,m.bools)&&!checkAllAliases(e,m.counts)&&`${e}`in a){return a[e]}else{return defaultForType(guessType(e))}}function defaultForType(e){const t={[Q.BOOLEAN]:true,[Q.STRING]:"",[Q.NUMBER]:undefined,[Q.ARRAY]:[]};return t[e]}function guessType(e){let t=Q.BOOLEAN;if(checkAllAliases(e,m.strings))t=Q.STRING;else if(checkAllAliases(e,m.numbers))t=Q.NUMBER;else if(checkAllAliases(e,m.bools))t=Q.BOOLEAN;else if(checkAllAliases(e,m.arrays))t=Q.ARRAY;return t}function isUndefined(e){return e===undefined}function checkConfiguration(){Object.keys(m.counts).find((e=>{if(checkAllAliases(e,m.arrays)){y=Error(h("Invalid configuration: %s, opts.count excludes opts.array.",e));return true}else if(checkAllAliases(e,m.nargs)){y=Error(h("Invalid configuration: %s, opts.count excludes opts.narg.",e));return true}return false}))}return{aliases:Object.assign({},m.aliases),argv:Object.assign(E,v),configuration:s,defaulted:Object.assign({},p),error:y,newAliases:Object.assign({},d)}}}function combineAliases(e){const t=[];const r=Object.create(null);let n=true;Object.keys(e).forEach((function(r){t.push([].concat(e[r],r))}));while(n){n=false;for(let e=0;e<t.length;e++){for(let r=e+1;r<t.length;r++){const o=t[e].filter((function(e){return t[r].indexOf(e)!==-1}));if(o.length){t[e]=t[e].concat(t[r]);t.splice(r,1);n=true;break}}}}t.forEach((function(e){e=e.filter((function(e,t,r){return r.indexOf(e)===t}));const t=e.pop();if(t!==undefined&&typeof t==="string"){r[t]=e}}));return r}function increment(e){return e!==undefined?e+1:1}function sanitizeKey(e){if(e==="__proto__")return"___proto___";return e}function stripQuotes(e){return typeof e==="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}const ee=e(import.meta.url)("node:module");
|
|
27
27
|
/**
|
|
28
28
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
29
29
|
*
|
|
@@ -31,4 +31,4 @@ let U;class YargsParser{constructor(e){U=e}parse(e,t){const r=Object.assign({ali
|
|
|
31
31
|
* Copyright (c) 2016, Contributors
|
|
32
32
|
* SPDX-License-Identifier: ISC
|
|
33
33
|
*/
|
|
34
|
-
var L,W,K;const z=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20;const G=(W=(L=process===null||process===void 0?void 0:process.versions)===null||L===void 0?void 0:L.node)!==null&&W!==void 0?W:(K=process===null||process===void 0?void 0:process.version)===null||K===void 0?void 0:K.slice(1);if(G){const e=Number(G.match(/^([^.]+)/)[1]);if(e<z){throw Error(`yargs parser supports a minimum Node.js version of ${z}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}}const H=process?process.env:{};const V=$.createRequire?(0,$.createRequire)(import.meta.url):undefined;const J=new YargsParser({cwd:process.cwd,env:()=>H,format:N.format,normalize:I.normalize,resolve:I.resolve,require:e=>{if(typeof V!=="undefined"){return V(e)}else if(e.match(/\.json$/)){return JSON.parse((0,T.readFileSync)(e,"utf8"))}else{throw Error("only .json config files are supported in ESM")}}});const q=function Parser(e,t){const r=J.parse(e.slice(),t);return r.argv};q.detailed=function(e,t){return J.parse(e.slice(),t)};q.camelCase=camelCase;q.decamelize=decamelize;q.looksLikeNumber=looksLikeNumber;const Y=q;function getProcessArgvBinIndex(){if(isBundledElectronApp())return 0;return 1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(e){return e.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}const X={fs:{readFileSync:T.readFileSync,writeFile:T.writeFile},format:N.format,resolve:I.resolve,exists:e=>{try{return(0,T.statSync)(e).isFile()}catch(e){return false}}};let Q;class Y18N{constructor(e){e=e||{};this.directory=e.directory||"./locales";this.updateFiles=typeof e.updateFiles==="boolean"?e.updateFiles:true;this.locale=e.locale||"en";this.fallbackToLanguage=typeof e.fallbackToLanguage==="boolean"?e.fallbackToLanguage:true;this.cache=Object.create(null);this.writeQueue=[]}__(...e){if(typeof arguments[0]!=="string"){return this._taggedLiteral(arguments[0],...arguments)}const t=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();cb=cb||function(){};if(!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]=t;this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}return Q.format.apply(Q.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments);const t=e.shift();const r=e.shift();const n=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();if(!this.cache[this.locale])this._readLocaleFile();let o=n===1?t:r;if(this.cache[this.locale][t]){const e=this.cache[this.locale][t];o=e[n===1?"one":"other"]}if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]={one:t,other:r};this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}const i=[o];if(~o.indexOf("%d"))i.push(n);return Q.format.apply(Q.format,i.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){if(!this.cache[this.locale])this._readLocaleFile();for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){this.cache[this.locale][t]=e[t]}}}_taggedLiteral(e,...t){let r="";e.forEach((function(e,n){const o=t[n+1];r+=e;if(typeof o!=="undefined"){r+="%s"}}));return this.__.apply(this,[r].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e);if(this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){const e=this;const t=this.writeQueue[0];const r=t.directory;const n=t.locale;const o=t.cb;const i=this._resolveLocaleFile(r,n);const u=JSON.stringify(this.cache[n],null,2);Q.fs.writeFile(i,u,"utf-8",(function(t){e.writeQueue.shift();if(e.writeQueue.length>0)e._processWriteQueue();o(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{if(Q.fs.readFileSync){e=JSON.parse(Q.fs.readFileSync(t,"utf-8"))}}catch(r){if(r instanceof SyntaxError){r.message="syntax error in "+t}if(r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let r=Q.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~t.lastIndexOf("_")){const n=Q.resolve(e,"./",t.split("_")[0]+".json");if(this._fileExistsSync(n))r=n}return r}_fileExistsSync(e){return Q.exists(e)}}function y18n(e,t){Q=t;const r=new Y18N(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const y18n_y18n=e=>y18n(e,X);const Z=y18n_y18n;var ee=n(9103);const te=e(import.meta.url)("node:fs");const re=(0,M.fileURLToPath)(import.meta.url);const ne=re.substring(0,re.lastIndexOf("node_modules"));const oe=(0,$.createRequire)(import.meta.url);const ie={assert:{notStrictEqual:o.notStrictEqual,strictEqual:o.strictEqual},cliui:ui,findUp:sync,getEnv:e=>process.env[e],inspect:N.inspect,getProcessArgvBin:getProcessArgvBin,mainFilename:ne||process.cwd(),Parser:Y,path:{basename:I.basename,dirname:I.dirname,extname:I.extname,relative:I.relative,resolve:I.resolve,join:I.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!=="undefined"?process.stdout.columns:null},readFileSync:te.readFileSync,readdirSync:te.readdirSync,require:oe,getCallerFile:()=>{const e=ee(3);return e.match(/^file:\/\//)?(0,M.fileURLToPath)(e):e},stringWidth:stringWidth,y18n:Z({directory:(0,I.resolve)(re,"../../../locales"),updateFiles:false})};function assertNotStrictEqual(e,t,r,n){r.assert.notStrictEqual(e,t,n)}function assertSingleKey(e,t){t.assert.strictEqual(typeof e,"string")}function objectKeys(e){return Object.keys(e)}function isPromise(e){return!!e&&!!e.then&&typeof e.then==="function"}class YError extends Error{constructor(e){super(e||"yargs error");this.name="YError";if(Error.captureStackTrace){Error.captureStackTrace(this,YError)}}}function parseCommand(e){const t=e.replace(/\s{2,}/g," ");const r=t.split(/\s+(?![^[]*]|[^<]*>)/);const n=/\.*[\][<>]/g;const o=r.shift();if(!o)throw new Error(`No command found in: ${e}`);const i={cmd:o.replace(n,""),demanded:[],optional:[]};r.forEach(((e,t)=>{let o=false;e=e.replace(/\s/g,"");if(/\.+[\]>]/.test(e)&&t===r.length-1)o=true;if(/^\[/.test(e)){i.optional.push({cmd:e.replace(n,"").split("|"),variadic:o})}else{i.demanded.push({cmd:e.replace(n,"").split("|"),variadic:o})}}));return i}const ue=["first","second","third","fourth","fifth","sixth"];function argsert(e,t,r){function parseArgs(){return typeof e==="object"?[{demanded:[],optional:[]},e,t]:[parseCommand(`cmd ${e}`),t,r]}try{let e=0;const[t,r,n]=parseArgs();const o=[].slice.call(r);while(o.length&&o[o.length-1]===undefined)o.pop();const i=n||o.length;if(i<t.demanded.length){throw new YError(`Not enough arguments provided. Expected ${t.demanded.length} but received ${o.length}.`)}const u=t.demanded.length+t.optional.length;if(i>u){throw new YError(`Too many arguments provided. Expected max ${u} but received ${i}.`)}t.demanded.forEach((t=>{const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}));t.optional.forEach((t=>{if(o.length===0)return;const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}))}catch(e){console.warn(e.stack)}}function guessType(e){if(Array.isArray(e)){return"array"}else if(e===null){return"null"}return typeof e}function argumentTypeError(e,t,r){throw new YError(`Invalid ${ue[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[];this.frozens=[];this.yargs=e}addMiddleware(e,t,r=true,n=false){argsert("<array|function> [boolean] [boolean] [boolean]",[e,t,r],arguments.length);if(Array.isArray(e)){for(let n=0;n<e.length;n++){if(typeof e[n]!=="function"){throw Error("middleware must be a function")}const o=e[n];o.applyBeforeValidation=t;o.global=r}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==="function"){const o=e;o.applyBeforeValidation=t;o.global=r;o.mutates=n;this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const r=this.yargs.getAliases();this.globalMiddleware=this.globalMiddleware.filter((e=>{const n=[...r[t]||[],t];if(!e.option)return true;else return!n.includes(e.option)}));e.option=t;return this.addMiddleware(e,true,true,true)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();if(e!==undefined)this.globalMiddleware=e}reset(){this.globalMiddleware=this.globalMiddleware.filter((e=>e.global))}}function commandMiddlewareFactory(e){if(!e)return[];return e.map((e=>{e.applyBeforeValidation=false;return e}))}function applyMiddleware(e,t,r,n){return r.reduce(((e,r)=>{if(r.applyBeforeValidation!==n){return e}if(r.mutates){if(r.applied)return e;r.applied=true}if(isPromise(e)){return e.then((e=>Promise.all([e,r(e,t)]))).then((([e,t])=>Object.assign(e,t)))}else{const n=r(e,t);return isPromise(n)?n.then((t=>Object.assign(e,t))):Object.assign(e,n)}}),e)}function maybeAsyncResult(e,t,r=e=>{throw e}){try{const r=isFunction(e)?e():e;return isPromise(r)?r.then((e=>t(e))):t(r)}catch(e){return r(e)}}function isFunction(e){return typeof e==="function"}const se=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,r,n){this.requireCache=new Set;this.handlers={};this.aliasMap={};this.frozens=[];this.shim=n;this.usage=e;this.globalMiddleware=r;this.validation=t}addDirectory(e,t,r,n){n=n||{};this.requireCache.add(r);const o=this.shim.path.resolve(this.shim.path.dirname(r),e);const i=this.shim.readdirSync(o,{recursive:n.recurse?true:false});if(!Array.isArray(n.extensions))n.extensions=["js"];const u=typeof n.visit==="function"?n.visit:e=>e;for(const e of i){const r=e.toString();if(n.exclude){let e=false;if(typeof n.exclude==="function"){e=n.exclude(r)}else{e=n.exclude.test(r)}if(e)continue}if(n.include){let e=false;if(typeof n.include==="function"){e=n.include(r)}else{e=n.include.test(r)}if(!e)continue}let i=false;for(const e of n.extensions){if(r.endsWith(e))i=true}if(i){const e=this.shim.path.join(o,r);const n=t(e);const i=Object.create(null,Object.getOwnPropertyDescriptors({...n}));const s=u(i,e,r);if(s){if(this.requireCache.has(e))continue;else this.requireCache.add(e);if(!i.command){i.command=this.shim.path.basename(e,this.shim.path.extname(e))}this.addHandler(i)}}}}addHandler(e,t,r,n,o,i){let u=[];const s=commandMiddlewareFactory(o);n=n||(()=>{});if(Array.isArray(e)){if(isCommandAndAliases(e)){[e,...u]=e}else{for(const t of e){this.addHandler(t)}}}else if(isCommandHandlerDefinition(e)){let t=Array.isArray(e.command)||typeof e.command==="string"?e.command:null;if(t===null){throw new Error(`No command name given for module: ${this.shim.inspect(e)}`)}if(e.aliases)t=[].concat(t).concat(e.aliases);this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(r)){this.addHandler([e].concat(u),t,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e==="string"){const o=parseCommand(e);u=u.map((e=>parseCommand(e).cmd));let a=false;const c=[o.cmd].concat(u).filter((e=>{if(se.test(e)){a=true;return false}return true}));if(c.length===0&&a)c.push("$0");if(a){o.cmd=c[0];u=c.slice(1);e=e.replace(se,o.cmd)}u.forEach((e=>{this.aliasMap[e]=o.cmd}));if(t!==false){this.usage.command(e,t,a,u,i)}this.handlers[o.cmd]={original:e,description:t,handler:n,builder:r||{},middlewares:s,deprecated:i,demanded:o.demanded,optional:o.optional};if(a)this.defaultCommand=this.handlers[o.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,r,n,o,i){const u=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand;const s=t.getInternalMethods().getContext();const a=s.commands.slice();const c=!e;if(e){s.commands.push(e);s.fullCommands.push(u.original)}const l=this.applyBuilderUpdateUsageAndParse(c,u,t,r.aliases,a,n,o,i);return isPromise(l)?l.then((e=>this.applyMiddlewareAndGetResult(c,u,e.innerArgv,s,o,e.aliases,t))):this.applyMiddlewareAndGetResult(c,u,l.innerArgv,s,o,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,r,n,o,i,u,s){const a=t.builder;let c=r;if(isCommandBuilderCallback(a)){r.getInternalMethods().getUsageInstance().freeze();const l=a(r.getInternalMethods().reset(n),s);if(isPromise(l)){return l.then((n=>{c=isYargsInstance(n)?n:r;return this.parseAndUpdateUsage(e,t,c,o,i,u)}))}}else if(isCommandBuilderOptionDefinitions(a)){r.getInternalMethods().getUsageInstance().freeze();c=r.getInternalMethods().reset(n);Object.keys(t.builder).forEach((e=>{c.option(e,a[e])}))}return this.parseAndUpdateUsage(e,t,c,o,i,u)}parseAndUpdateUsage(e,t,r,n,o,i){if(e)r.getInternalMethods().getUsageInstance().unfreeze(true);if(this.shouldUpdateUsage(r)){r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(n,t),t.description)}const u=r.getInternalMethods().runYargsParserAndExecuteCommands(null,undefined,true,o,i);return isPromise(u)?u.then((e=>({aliases:r.parsed.aliases,innerArgv:e}))):{aliases:r.parsed.aliases,innerArgv:u}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const r=se.test(t.original)?t.original.replace(se,"").trim():t.original;const n=e.filter((e=>!se.test(e)));n.push(r);return`$0 ${n.join(" ")}`}handleValidationAndGetResult(e,t,r,n,o,i,u,s){if(!i.getInternalMethods().getHasOutput()){const t=i.getInternalMethods().runValidation(o,s,i.parsed.error,e);r=maybeAsyncResult(r,(e=>{t(e);return e}))}if(t.handler&&!i.getInternalMethods().getHasOutput()){i.getInternalMethods().setHasOutput();const n=!!i.getOptions().configuration["populate--"];i.getInternalMethods().postProcess(r,n,false,false);r=applyMiddleware(r,i,u,false);r=maybeAsyncResult(r,(e=>{const r=t.handler(e);return isPromise(r)?r.then((()=>e)):e}));if(!e){i.getInternalMethods().getUsageInstance().cacheHelpMessage()}if(isPromise(r)&&!i.getInternalMethods().hasParseCallback()){r.catch((e=>{try{i.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}}))}}if(!e){n.commands.pop();n.fullCommands.pop()}return r}applyMiddlewareAndGetResult(e,t,r,n,o,i,u){let s={};if(o)return r;if(!u.getInternalMethods().getHasOutput()){s=this.populatePositionals(t,r,n,u)}const a=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);const c=applyMiddleware(r,u,a,true);return isPromise(c)?c.then((r=>this.handleValidationAndGetResult(e,t,r,n,i,u,a,s))):this.handleValidationAndGetResult(e,t,c,n,i,u,a,s)}populatePositionals(e,t,r,n){t._=t._.slice(r.commands.length);const o=e.demanded.slice(0);const i=e.optional.slice(0);const u={};this.validation.positionalCount(o.length,t._.length);while(o.length){const e=o.shift();this.populatePositional(e,t,u)}while(i.length){const e=i.shift();this.populatePositional(e,t,u)}t._=r.commands.concat(t._.map((e=>""+e)));this.postProcessPositionals(t,u,this.cmdToParseOptions(e.original),n);return u}populatePositional(e,t,r){const n=e.cmd[0];if(e.variadic){r[n]=t._.splice(0).map(String)}else{if(t._.length)r[n]=[String(t._.shift())]}}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}};const r=parseCommand(e);r.demanded.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n;t.demand[r]=true}));r.optional.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n}));return t}postProcessPositionals(e,t,r,n){const o=Object.assign({},n.getOptions());o.default=Object.assign(r.default,o.default);for(const e of Object.keys(r.alias)){o.alias[e]=(o.alias[e]||[]).concat(r.alias[e])}o.array=o.array.concat(r.array);o.config={};const i=[];Object.keys(t).forEach((e=>{t[e].map((t=>{if(o.configuration["unknown-options-as-args"])o.key[e]=true;i.push(`--${e}`);i.push(t)}))}));if(!i.length)return;const u=Object.assign({},o.configuration,{"populate--":false});const s=this.shim.Parser.detailed(i,Object.assign({},o,{configuration:u}));if(s.error){n.getInternalMethods().getUsageInstance().fail(s.error.message,s.error)}else{const r=Object.keys(t);Object.keys(t).forEach((e=>{r.push(...s.aliases[e])}));Object.keys(s.argv).forEach((o=>{if(r.includes(o)){if(!t[o])t[o]=s.argv[o];if(!this.isInConfigs(n,o)&&!this.isDefaulted(n,o)&&Object.prototype.hasOwnProperty.call(e,o)&&Object.prototype.hasOwnProperty.call(s.argv,o)&&(Array.isArray(e[o])||Array.isArray(s.argv[o]))){e[o]=[].concat(e[o],s.argv[o])}else{e[o]=s.argv[o]}}}))}}isDefaulted(e,t){const{default:r}=e.getOptions();return Object.prototype.hasOwnProperty.call(r,t)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:r}=e.getOptions();return r.some((e=>Object.prototype.hasOwnProperty.call(e,t)))||r.some((e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t))))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const t=se.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t)){return t(e,true)}else if(!isCommandBuilderDefinition(t)){Object.keys(t).forEach((r=>{e.option(r,t[r])}))}return undefined}extractDesc({describe:e,description:t,desc:r}){for(const n of[e,t,r]){if(typeof n==="string"||n===false)return n;assertNotStrictEqual(n,true,this.shim)}return false}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,undefined,this.shim);({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e)}reset(){this.handlers={};this.aliasMap={};this.defaultCommand=undefined;this.requireCache=new Set;return this}}function command(e,t,r,n){return new CommandInstance(e,t,r,n)}function isCommandBuilderDefinition(e){return typeof e==="object"&&!!e.builder&&typeof e.handler==="function"}function isCommandAndAliases(e){return e.every((e=>typeof e==="string"))}function isCommandBuilderCallback(e){return typeof e==="function"}function isCommandBuilderOptionDefinitions(e){return typeof e==="object"}function isCommandHandlerDefinition(e){return typeof e==="object"&&!Array.isArray(e)}function objFilter(e={},t=()=>true){const r={};objectKeys(e).forEach((n=>{if(t(n,e[n])){r[n]=e[n]}}));return r}function setBlocking(e){if(typeof process==="undefined")return;[process.stdout,process.stderr].forEach((t=>{const r=t;if(r._handle&&r.isTTY&&typeof r._handle.setBlocking==="function"){r._handle.setBlocking(e)}}))}function isBoolean(e){return typeof e==="boolean"}function usage(e,t){const r=t.y18n.__;const n={};const o=[];n.failFn=function failFn(e){o.push(e)};let i=null;let u=null;let s=true;n.showHelpOnFail=function showHelpOnFailFn(t=true,r){const[o,a]=typeof t==="string"?[true,t]:[t,r];if(e.getInternalMethods().isGlobalContext()){u=a}i=a;s=o;return n};let a=false;n.fail=function fail(t,r){const c=e.getInternalMethods().getLoggerInstance();if(o.length){for(let e=o.length-1;e>=0;--e){const i=o[e];if(isBoolean(i)){if(r)throw r;else if(t)throw Error(t)}else{i(t,r,n)}}}else{if(e.getExitProcess())setBlocking(true);if(!a){a=true;if(s){e.showHelp("error");c.error()}if(t||r)c.error(t||r);const n=i||u;if(n){if(t||r)c.error("");c.error(n)}}r=r||new YError(t);if(e.getExitProcess()){return e.exit(1)}else if(e.getInternalMethods().hasParseCallback()){return e.exit(1,r)}else{throw r}}};let c=[];let l=false;n.usage=(e,t)=>{if(e===null){l=true;c=[];return n}l=false;c.push([e,t||""]);return n};n.getUsage=()=>c;n.getUsageDisabled=()=>l;n.getPositionalGroupName=()=>r("Positionals:");let D=[];n.example=(e,t)=>{D.push([e,t||""])};let f=[];n.command=function command(e,t,r,n,o=false){if(r){f=f.map((e=>{e[2]=false;return e}))}f.push([e,t||"",r,n,o])};n.getCommands=()=>f;let d={};n.describe=function describe(e,t){if(Array.isArray(e)){e.forEach((e=>{n.describe(e,t)}))}else if(typeof e==="object"){Object.keys(e).forEach((t=>{n.describe(t,e[t])}))}else{d[e]=t}};n.getDescriptions=()=>d;let p=[];n.epilog=e=>{p.push(e)};let h=false;let g;n.wrap=e=>{h=true;g=e};n.getWrap=()=>{if(t.getEnv("YARGS_DISABLE_WRAP")){return null}if(!h){g=windowWidth();h=true}return g};const m="__yargsString__:";n.deferY18nLookup=e=>m+e;n.help=function help(){if(y)return y;normalizeAliases();const o=e.customScriptName?e.$0:t.path.basename(e.$0);const i=e.getDemandedOptions();const u=e.getDemandedCommands();const s=e.getDeprecatedOptions();const a=e.getGroups();const h=e.getOptions();let g=[];g=g.concat(Object.keys(d));g=g.concat(Object.keys(i));g=g.concat(Object.keys(u));g=g.concat(Object.keys(h.default));g=g.filter(filterHiddenOptions);g=Object.keys(g.reduce(((e,t)=>{if(t!=="_")e[t]=true;return e}),{}));const F=n.getWrap();const b=t.cliui({width:F,wrap:!!F});if(!l){if(c.length){c.forEach((e=>{b.div({text:`${e[0].replace(/\$0/g,o)}`});if(e[1]){b.div({text:`${e[1]}`,padding:[1,0,0,0]})}}));b.div()}else if(f.length){let e=null;if(u._){e=`${o} <${r("command")}>\n`}else{e=`${o} [${r("command")}]\n`}b.div(`${e}`)}}if(f.length>1||f.length===1&&!f[0][2]){b.div(r("Commands:"));const t=e.getInternalMethods().getContext();const n=t.commands.length?`${t.commands.join(" ")} `:"";if(e.getInternalMethods().getParserConfiguration()["sort-commands"]===true){f=f.sort(((e,t)=>e[0].localeCompare(t[0])))}const i=o?`${o} `:"";f.forEach((e=>{const t=`${i}${n}${e[0].replace(/^\$0 ?/,"")}`;b.span({text:t,padding:[0,2,0,2],width:maxWidth(f,F,`${o}${n}`)+4},{text:e[1]});const u=[];if(e[2])u.push(`[${r("default")}]`);if(e[3]&&e[3].length){u.push(`[${r("aliases:")} ${e[3].join(", ")}]`)}if(e[4]){if(typeof e[4]==="string"){u.push(`[${r("deprecated: %s",e[4])}]`)}else{u.push(`[${r("deprecated")}]`)}}if(u.length){b.div({text:u.join(" "),padding:[0,0,0,2],align:"right"})}else{b.div()}}));b.div()}const E=(Object.keys(h.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter((t=>!e.parsed.newAliases[t]&&E.every((e=>(h.alias[e]||[]).indexOf(t)===-1))));const C=r("Options:");if(!a[C])a[C]=[];addUngroupedKeys(g,h.alias,a,C);const isLongSwitch=e=>/^--/.test(getText(e));const v=Object.keys(a).filter((e=>a[e].length>0)).map((e=>{const t=a[e].filter(filterHiddenOptions).map((e=>{if(E.includes(e))return e;for(let t=0,r;(r=E[t])!==undefined;t++){if((h.alias[r]||[]).includes(e))return r}return e}));return{groupName:e,normalizedKeys:t}})).filter((({normalizedKeys:e})=>e.length>0)).map((({groupName:e,normalizedKeys:t})=>{const r=t.reduce(((t,r)=>{t[r]=[r].concat(h.alias[r]||[]).map((t=>{if(e===n.getPositionalGroupName())return t;else{return(/^[0-9]$/.test(t)?h.boolean.includes(r)?"-":"--":t.length>1?"--":"-")+t}})).sort(((e,t)=>isLongSwitch(e)===isLongSwitch(t)?0:isLongSwitch(e)?1:-1)).join(", ");return t}),{});return{groupName:e,normalizedKeys:t,switches:r}}));const w=v.filter((({groupName:e})=>e!==n.getPositionalGroupName())).some((({normalizedKeys:e,switches:t})=>!e.every((e=>isLongSwitch(t[e])))));if(w){v.filter((({groupName:e})=>e!==n.getPositionalGroupName())).forEach((({normalizedKeys:e,switches:t})=>{e.forEach((e=>{if(isLongSwitch(t[e])){t[e]=addIndentation(t[e],"-x, ".length)}}))}))}v.forEach((({groupName:t,normalizedKeys:o,switches:u})=>{b.div(t);o.forEach((t=>{const o=u[t];let a=d[t]||"";let c=null;if(a.includes(m))a=r(a.substring(m.length));if(h.boolean.includes(t))c=`[${r("boolean")}]`;if(h.count.includes(t))c=`[${r("count")}]`;if(h.string.includes(t))c=`[${r("string")}]`;if(h.normalize.includes(t))c=`[${r("string")}]`;if(h.array.includes(t))c=`[${r("array")}]`;if(h.number.includes(t))c=`[${r("number")}]`;const deprecatedExtra=e=>typeof e==="string"?`[${r("deprecated: %s",e)}]`:`[${r("deprecated")}]`;const l=[t in s?deprecatedExtra(s[t]):null,c,t in i?`[${r("required")}]`:null,h.choices&&h.choices[t]?`[${r("choices:")} ${n.stringifiedValues(h.choices[t])}]`:null,defaultString(h.default[t],h.defaultDescription[t])].filter(Boolean).join(" ");b.span({text:getText(o),padding:[0,2,0,2+getIndentation(o)],width:maxWidth(u,F)+4},a);const D=e.getInternalMethods().getUsageConfiguration()["hide-types"]===true;if(l&&!D)b.div({text:l,padding:[0,0,0,2],align:"right"});else b.div()}));b.div()}));if(D.length){b.div(r("Examples:"));D.forEach((e=>{e[0]=e[0].replace(/\$0/g,o)}));D.forEach((e=>{if(e[1]===""){b.div({text:e[0],padding:[0,2,0,2]})}else{b.div({text:e[0],padding:[0,2,0,2],width:maxWidth(D,F)+4},{text:e[1]})}}));b.div()}if(p.length>0){const e=p.map((e=>e.replace(/\$0/g,o))).join("\n");b.div(`${e}\n`)}return b.toString().replace(/\s*$/,"")};function maxWidth(e,r,n){let o=0;if(!Array.isArray(e)){e=Object.values(e).map((e=>[e]))}e.forEach((e=>{o=Math.max(t.stringWidth(n?`${n} ${getText(e[0])}`:getText(e[0]))+getIndentation(e[0]),o)}));if(r)o=Math.min(o,parseInt((r*.5).toString(),10));return o}function normalizeAliases(){const t=e.getDemandedOptions();const r=e.getOptions();(Object.keys(r.alias)||[]).forEach((o=>{r.alias[o].forEach((i=>{if(d[i])n.describe(o,d[i]);if(i in t)e.demandOption(o,t[i]);if(r.boolean.includes(i))e.boolean(o);if(r.count.includes(i))e.count(o);if(r.string.includes(i))e.string(o);if(r.normalize.includes(i))e.normalize(o);if(r.array.includes(i))e.array(o);if(r.number.includes(i))e.number(o)}))}))}let y;n.cacheHelpMessage=function(){y=this.help()};n.clearCachedHelpMessage=function(){y=undefined};n.hasCachedHelpMessage=function(){return!!y};function addUngroupedKeys(e,t,r,n){let o=[];let i=null;Object.keys(r).forEach((e=>{o=o.concat(r[e])}));e.forEach((e=>{i=[e].concat(t[e]);if(!i.some((e=>o.indexOf(e)!==-1))){r[n].push(e)}}));return o}function filterHiddenOptions(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}n.showHelp=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const o=typeof t==="function"?t:r[t];o(n.help())};n.functionDescription=e=>{const n=e.name?t.Parser.decamelize(e.name,"-"):r("generated-value");return["(",n,")"].join("")};n.stringifiedValues=function stringifiedValues(e,t){let r="";const n=t||", ";const o=[].concat(e);if(!e||!o.length)return r;o.forEach((e=>{if(r.length)r+=n;r+=JSON.stringify(e)}));return r};function defaultString(e,t){let n=`[${r("default:")} `;if(e===undefined&&!t)return null;if(t){n+=t}else{switch(typeof e){case"string":n+=`"${e}"`;break;case"object":n+=JSON.stringify(e);break;default:n+=e}}return`${n}]`}function windowWidth(){const e=80;if(t.process.stdColumns){return Math.min(e,t.process.stdColumns)}else{return e}}let F=null;n.version=e=>{F=e};n.showVersion=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const n=typeof t==="function"?t:r[t];n(F)};n.reset=function reset(e){i=null;a=false;c=[];l=false;p=[];D=[];f=[];d=objFilter(d,(t=>!e[t]));return n};const b=[];n.freeze=function freeze(){b.push({failMessage:i,failureOutput:a,usages:c,usageDisabled:l,epilogs:p,examples:D,commands:f,descriptions:d})};n.unfreeze=function unfreeze(e=false){const t=b.pop();if(!t)return;if(e){d={...t.descriptions,...d};f=[...t.commands,...f];c=[...t.usages,...c];D=[...t.examples,...D];p=[...t.epilogs,...p]}else{({failMessage:i,failureOutput:a,usages:c,usageDisabled:l,epilogs:p,examples:D,commands:f,descriptions:d}=t)}};return n}function isIndentedText(e){return typeof e==="object"}function addIndentation(e,t){return isIndentedText(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function getIndentation(e){return isIndentedText(e)?e.indentation:0}function getText(e){return isIndentedText(e)?e.text:e}const ae=`###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="\${COMP_WORDS[COMP_CWORD]}"\n args=("\${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk\n mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")\n mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |\n awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')\n\n # if no match was found, fall back to filename completion\n if [ \${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n`;const ce=`#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))\n IFS=$si\n if [[ \${#reply} -gt 0 ]]; then\n _describe 'values' reply\n else\n _default\n fi\n}\nif [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then\n _{{app_name}}_yargs_completions "$@"\nelse\n compdef _{{app_name}}_yargs_completions {{app_name}}\nfi\n###-end-{{app_name}}-completions-###\n`;class Completion{constructor(e,t,r,n){var o,i,u;this.yargs=e;this.usage=t;this.command=r;this.shim=n;this.completionKey="get-yargs-completions";this.aliases=null;this.customCompletionFunction=null;this.indexAfterLastReset=0;this.zshShell=(u=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((i=this.shim.getEnv("ZSH_NAME"))===null||i===void 0?void 0:i.includes("zsh")))!==null&&u!==void 0?u:false}defaultCompletion(e,t,r,n){const o=this.command.getCommandHandlers();for(let t=0,r=e.length;t<r;++t){if(o[e[t]]&&o[e[t]].builder){const r=o[e[t]].builder;if(isCommandBuilderCallback(r)){this.indexAfterLastReset=t+1;const e=this.yargs.getInternalMethods().reset();r(e,true);return e.argv}}}const i=[];this.commandCompletions(i,e,r);this.optionCompletions(i,e,t,r);this.choicesFromOptionsCompletions(i,e,t,r);this.choicesFromPositionalsCompletions(i,e,t,r);n(null,i)}commandCompletions(e,t,r){const n=this.yargs.getInternalMethods().getContext().commands;if(!r.match(/^-/)&&n[n.length-1]!==r&&!this.previousArgHasChoices(t)){this.usage.getCommands().forEach((r=>{const n=parseCommand(r[0]).cmd;if(t.indexOf(n)===-1){if(!this.zshShell){e.push(n)}else{const t=r[1]||"";e.push(n.replace(/:/g,"\\:")+":"+t)}}}))}}optionCompletions(e,t,r,n){if((n.match(/^-/)||n===""&&e.length===0)&&!this.previousArgHasChoices(t)){const r=this.yargs.getOptions();const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(r.key).forEach((i=>{const u=!!r.configuration["boolean-negation"]&&r.boolean.includes(i);const s=o.includes(i);if(!s&&!r.hiddenOptions.includes(i)&&!this.argsContainKey(t,i,u)){this.completeOptionKey(i,e,n,u&&!!r.default[i])}}))}}choicesFromOptionsCompletions(e,t,r,n){if(this.previousArgHasChoices(t)){const r=this.getPreviousArgChoices(t);if(r&&r.length>0){e.push(...r.map((e=>e.replace(/:/g,"\\:"))))}}}choicesFromPositionalsCompletions(e,t,r,n){if(n===""&&e.length>0&&this.previousArgHasChoices(t)){return}const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];const i=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1);const u=o[r._.length-i-1];if(!u){return}const s=this.yargs.getOptions().choices[u]||[];for(const t of s){if(t.startsWith(n)){e.push(t.replace(/:/g,"\\:"))}}}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1];let r="";if(!t.startsWith("-")&&e.length>1){r=t;t=e[e.length-2]}if(!t.startsWith("-"))return;const n=t.replace(/^-+/,"");const o=this.yargs.getOptions();const i=[n,...this.yargs.getAliases()[n]||[]];let u;for(const e of i){if(Object.prototype.hasOwnProperty.call(o.key,e)&&Array.isArray(o.choices[e])){u=o.choices[e];break}}if(u){return u.filter((e=>!r||e.startsWith(r)))}}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==undefined&&t.length>0}argsContainKey(e,t,r){const argsContains=t=>e.indexOf((/^[^0-9]$/.test(t)?"-":"--")+t)!==-1;if(argsContains(t))return true;if(r&&argsContains(`no-${t}`))return true;if(this.aliases){for(const e of this.aliases[t]){if(argsContains(e))return true}}return false}completeOptionKey(e,t,r,n){var o,i,u,s;let a=e;if(this.zshShell){const t=this.usage.getDescriptions();const r=(i=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||i===void 0?void 0:i.find((e=>{const r=t[e];return typeof r==="string"&&r.length>0}));const n=r?t[r]:undefined;const c=(s=(u=t[e])!==null&&u!==void 0?u:n)!==null&&s!==void 0?s:"";a=`${e.replace(/:/g,"\\:")}:${c.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const startsByTwoDashes=e=>/^--/.test(e);const isShortOption=e=>/^[^0-9]$/.test(e);const c=!startsByTwoDashes(r)&&isShortOption(e)?"-":"--";t.push(c+a);if(n){t.push(c+"no-"+a)}}customCompletion(e,t,r,n){assertNotStrictEqual(this.customCompletionFunction,null,this.shim);if(isSyncCompletionFunction(this.customCompletionFunction)){const e=this.customCompletionFunction(r,t);if(isPromise(e)){return e.then((e=>{this.shim.process.nextTick((()=>{n(null,e)}))})).catch((e=>{this.shim.process.nextTick((()=>{n(e,undefined)}))}))}return n(null,e)}else if(isFallbackCompletionFunction(this.customCompletionFunction)){return this.customCompletionFunction(r,t,((o=n)=>this.defaultCompletion(e,t,r,o)),(e=>{n(null,e)}))}else{return this.customCompletionFunction(r,t,(e=>{n(null,e)}))}}getCompletion(e,t){const r=e.length?e[e.length-1]:"";const n=this.yargs.parse(e,true);const o=this.customCompletionFunction?n=>this.customCompletion(e,n,r,t):n=>this.defaultCompletion(e,n,r,t);return isPromise(n)?n.then(o):o(n)}generateCompletionScript(e,t){let r=this.zshShell?ce:ae;const n=this.shim.path.basename(e);if(e.match(/\.js$/))e=`./${e}`;r=r.replace(/{{app_name}}/g,n);r=r.replace(/{{completion_command}}/g,t);return r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(e,t,r,n){return new Completion(e,t,r,n)}function isSyncCompletionFunction(e){return e.length<3}function isFallbackCompletionFunction(e){return e.length>3}function levenshtein(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const r=[];let n;for(n=0;n<=t.length;n++){r[n]=[n]}let o;for(o=0;o<=e.length;o++){r[0][o]=o}for(n=1;n<=t.length;n++){for(o=1;o<=e.length;o++){if(t.charAt(n-1)===e.charAt(o-1)){r[n][o]=r[n-1][o-1]}else{if(n>1&&o>1&&t.charAt(n-2)===e.charAt(o-1)&&t.charAt(n-1)===e.charAt(o-2)){r[n][o]=r[n-2][o-2]+1}else{r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1))}}}}return r[t.length][e.length]}const le=["$0","--","_"];function validation(e,t,r){const n=r.y18n.__;const o=r.y18n.__n;const i={};i.nonOptionCount=function nonOptionCount(r){const n=e.getDemandedCommands();const i=r._.length+(r["--"]?r["--"].length:0);const u=i-e.getInternalMethods().getContext().commands.length;if(n._&&(u<n._.min||u>n._.max)){if(u<n._.min){if(n._.minMsg!==undefined){t.fail(n._.minMsg?n._.minMsg.replace(/\$0/g,u.toString()).replace(/\$1/,n._.min.toString()):null)}else{t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",u,u.toString(),n._.min.toString()))}}else if(u>n._.max){if(n._.maxMsg!==undefined){t.fail(n._.maxMsg?n._.maxMsg.replace(/\$0/g,u.toString()).replace(/\$1/,n._.max.toString()):null)}else{t.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",u,u.toString(),n._.max.toString()))}}}};i.positionalCount=function positionalCount(e,r){if(r<e){t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r+"",e+""))}};i.requiredArguments=function requiredArguments(e,r){let n=null;for(const t of Object.keys(r)){if(!Object.prototype.hasOwnProperty.call(e,t)||typeof e[t]==="undefined"){n=n||{};n[t]=r[t]}}if(n){const e=[];for(const t of Object.keys(n)){const r=n[t];if(r&&e.indexOf(r)<0){e.push(r)}}const r=e.length?`\n${e.join("\n")}`:"";t.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(n).length,Object.keys(n).join(", ")+r))}};i.unknownArguments=function unknownArguments(r,n,u,s,a=true){var c;const l=e.getInternalMethods().getCommandInstance().getCommands();const D=[];const f=e.getInternalMethods().getContext();Object.keys(r).forEach((t=>{if(!le.includes(t)&&!Object.prototype.hasOwnProperty.call(u,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!i.isValidAndSomeAliasIsNotNew(t,n)){D.push(t)}}));if(a&&(f.commands.length>0||l.length>0||s)){r._.slice(f.commands.length).forEach((e=>{if(!l.includes(""+e)){D.push(""+e)}}))}if(a){const t=e.getDemandedCommands();const n=((c=t._)===null||c===void 0?void 0:c.max)||0;const o=f.commands.length+n;if(o<r._.length){r._.slice(o).forEach((e=>{e=String(e);if(!f.commands.includes(e)&&!D.includes(e)){D.push(e)}}))}}if(D.length){t.fail(o("Unknown argument: %s","Unknown arguments: %s",D.length,D.map((e=>e.trim()?e:`"${e}"`)).join(", ")))}};i.unknownCommands=function unknownCommands(r){const n=e.getInternalMethods().getCommandInstance().getCommands();const i=[];const u=e.getInternalMethods().getContext();if(u.commands.length>0||n.length>0){r._.slice(u.commands.length).forEach((e=>{if(!n.includes(""+e)){i.push(""+e)}}))}if(i.length>0){t.fail(o("Unknown command: %s","Unknown commands: %s",i.length,i.join(", ")));return true}else{return false}};i.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(t,r){if(!Object.prototype.hasOwnProperty.call(r,t)){return false}const n=e.parsed.newAliases;return[t,...r[t]].some((e=>!Object.prototype.hasOwnProperty.call(n,e)||!n[t]))};i.limitedChoices=function limitedChoices(r){const o=e.getOptions();const i={};if(!Object.keys(o.choices).length)return;Object.keys(r).forEach((e=>{if(le.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(o.choices,e)){[].concat(r[e]).forEach((t=>{if(o.choices[e].indexOf(t)===-1&&t!==undefined){i[e]=(i[e]||[]).concat(t)}}))}}));const u=Object.keys(i);if(!u.length)return;let s=n("Invalid values:");u.forEach((e=>{s+=`\n ${n("Argument: %s, Given: %s, Choices: %s",e,t.stringifiedValues(i[e]),t.stringifiedValues(o.choices[e]))}`}));t.fail(s)};let u={};i.implies=function implies(t,n){argsert("<string|object> [array|number|string]",[t,n],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.implies(e,t[e])}))}else{e.global(t);if(!u[t]){u[t]=[]}if(Array.isArray(n)){n.forEach((e=>i.implies(t,e)))}else{assertNotStrictEqual(n,undefined,r);u[t].push(n)}}};i.getImplied=function getImplied(){return u};function keyExists(e,t){const r=Number(t);t=isNaN(r)?t:r;if(typeof t==="number"){t=e._.length>=t}else if(t.match(/^--no-.+/)){t=t.match(/^--no-(.+)/)[1];t=!Object.prototype.hasOwnProperty.call(e,t)}else{t=Object.prototype.hasOwnProperty.call(e,t)}return t}i.implications=function implications(e){const r=[];Object.keys(u).forEach((t=>{const n=t;(u[t]||[]).forEach((t=>{let o=n;const i=t;o=keyExists(e,o);t=keyExists(e,t);if(o&&!t){r.push(` ${n} -> ${i}`)}}))}));if(r.length){let e=`${n("Implications failed:")}\n`;r.forEach((t=>{e+=t}));t.fail(e)}};let s={};i.conflicts=function conflicts(t,r){argsert("<string|object> [array|string]",[t,r],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.conflicts(e,t[e])}))}else{e.global(t);if(!s[t]){s[t]=[]}if(Array.isArray(r)){r.forEach((e=>i.conflicts(t,e)))}else{s[t].push(r)}}};i.getConflicting=()=>s;i.conflicting=function conflictingFn(o){Object.keys(o).forEach((e=>{if(s[e]){s[e].forEach((r=>{if(r&&o[e]!==undefined&&o[r]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,r))}}))}}));if(e.getInternalMethods().getParserConfiguration()["strip-dashed"]){Object.keys(s).forEach((e=>{s[e].forEach((i=>{if(i&&o[r.Parser.camelCase(e)]!==undefined&&o[r.Parser.camelCase(i)]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,i))}}))}))}};i.recommendCommands=function recommendCommands(e,r){const o=3;r=r.sort(((e,t)=>t.length-e.length));let i=null;let u=Infinity;for(let t=0,n;(n=r[t])!==undefined;t++){const t=levenshtein(e,n);if(t<=o&&t<u){u=t;i=n}}if(i)t.fail(n("Did you mean %s?",i))};i.reset=function reset(e){u=objFilter(u,(t=>!e[t]));s=objFilter(s,(t=>!e[t]));return i};const a=[];i.freeze=function freeze(){a.push({implied:u,conflicting:s})};i.unfreeze=function unfreeze(){const e=a.pop();assertNotStrictEqual(e,undefined,r);({implied:u,conflicting:s}=e)};return i}let De=[];let fe;function applyExtends(e,t,r,n){fe=n;let o={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!=="string")return o;const i=/\.json|\..*rc$/.test(e.extends);let u=null;if(!i){try{u=import.meta.resolve(e.extends)}catch(t){return e}}else{u=getPathToDefaultConfig(t,e.extends)}checkForCircularExtends(u);De.push(u);o=i?JSON.parse(fe.readFileSync(u,"utf8")):n.require(e.extends);delete e.extends;o=applyExtends(o,fe.path.dirname(u),r,fe)}De=[];return r?mergeDeep(o,e):Object.assign({},o,e)}function checkForCircularExtends(e){if(De.indexOf(e)>-1){throw new YError(`Circular extended configurations: '${e}'.`)}}function getPathToDefaultConfig(e,t){return fe.path.resolve(e,t)}function mergeDeep(e,t){const r={};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}Object.assign(r,e);for(const n of Object.keys(t)){if(isObject(t[n])&&isObject(r[n])){r[n]=mergeDeep(e[n],t[n])}else{r[n]=t[n]}}return r}var de=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r};var pe=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var he,ge,me,ye,Fe,be,Ee,Ce,ve,we,Ae,Oe,Se,Be,je,ke,xe,Pe,_e,Ie,Te,Ne,Me,Re,Ue,$e,Le,We,Ke,ze,Ge,He,Ve,Je,qe;function YargsFactory(e){return(t=[],r=e.process.cwd(),n)=>{const o=new YargsInstance(t,r,n,e);Object.defineProperty(o,"argv",{get:()=>o.parse(),enumerable:true});o.help();o.version();return o}}const Ye=Symbol("copyDoubleDash");const Xe=Symbol("copyDoubleDash");const Qe=Symbol("deleteFromParserHintObject");const Ze=Symbol("emitWarning");const et=Symbol("freeze");const tt=Symbol("getDollarZero");const rt=Symbol("getParserConfiguration");const nt=Symbol("getUsageConfiguration");const ot=Symbol("guessLocale");const it=Symbol("guessVersion");const ut=Symbol("parsePositionalNumbers");const st=Symbol("pkgUp");const at=Symbol("populateParserHintArray");const ct=Symbol("populateParserHintSingleValueDictionary");const lt=Symbol("populateParserHintArrayDictionary");const Dt=Symbol("populateParserHintDictionary");const ft=Symbol("sanitizeKey");const dt=Symbol("setKey");const pt=Symbol("unfreeze");const ht=Symbol("validateAsync");const gt=Symbol("getCommandInstance");const mt=Symbol("getContext");const yt=Symbol("getHasOutput");const Ft=Symbol("getLoggerInstance");const bt=Symbol("getParseContext");const Et=Symbol("getUsageInstance");const Ct=Symbol("getValidationInstance");const vt=Symbol("hasParseCallback");const wt=Symbol("isGlobalContext");const At=Symbol("postProcess");const Ot=Symbol("rebase");const St=Symbol("reset");const Bt=Symbol("runYargsParserAndExecuteCommands");const jt=Symbol("runValidation");const kt=Symbol("setHasOutput");const xt=Symbol("kTrackManuallySetKeys");const Pt="en_US";class YargsInstance{constructor(e=[],t,r,n){this.customScriptName=false;this.parsed=false;he.set(this,void 0);ge.set(this,void 0);me.set(this,{commands:[],fullCommands:[]});ye.set(this,null);Fe.set(this,null);be.set(this,"show-hidden");Ee.set(this,null);Ce.set(this,true);ve.set(this,{});we.set(this,true);Ae.set(this,[]);Oe.set(this,void 0);Se.set(this,{});Be.set(this,false);je.set(this,null);ke.set(this,true);xe.set(this,void 0);Pe.set(this,"");_e.set(this,void 0);Ie.set(this,void 0);Te.set(this,{});Ne.set(this,null);Me.set(this,null);Re.set(this,{});Ue.set(this,{});$e.set(this,void 0);Le.set(this,false);We.set(this,void 0);Ke.set(this,false);ze.set(this,false);Ge.set(this,false);He.set(this,void 0);Ve.set(this,{});Je.set(this,null);qe.set(this,void 0);de(this,We,n,"f");de(this,$e,e,"f");de(this,ge,t,"f");de(this,Ie,r,"f");de(this,Oe,new GlobalMiddleware(this),"f");this.$0=this[tt]();this[St]();de(this,he,pe(this,he,"f"),"f");de(this,He,pe(this,He,"f"),"f");de(this,qe,pe(this,qe,"f"),"f");de(this,_e,pe(this,_e,"f"),"f");pe(this,_e,"f").showHiddenOpt=pe(this,be,"f");de(this,xe,this[Xe](),"f");pe(this,We,"f").y18n.setLocale(Pt)}addHelpOpt(e,t){const r="help";argsert("[string|boolean] [string]",[e,t],arguments.length);if(pe(this,je,"f")){this[Qe](pe(this,je,"f"));de(this,je,null,"f")}if(e===false&&t===undefined)return this;de(this,je,typeof e==="string"?e:r,"f");this.boolean(pe(this,je,"f"));this.describe(pe(this,je,"f"),t||pe(this,He,"f").deferY18nLookup("Show help"));return this}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){argsert("[string|boolean] [string]",[e,t],arguments.length);if(e===false&&t===undefined)return this;const r=typeof e==="string"?e:pe(this,be,"f");this.boolean(r);this.describe(r,t||pe(this,He,"f").deferY18nLookup("Show hidden options"));pe(this,_e,"f").showHiddenOpt=r;return this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[lt](this.alias.bind(this),"alias",e,t);return this}array(e){argsert("<array|string>",[e],arguments.length);this[at]("array",e);this[xt](e);return this}boolean(e){argsert("<array|string>",[e],arguments.length);this[at]("boolean",e);this[xt](e);return this}check(e,t){argsert("<function> [boolean]",[e,t],arguments.length);this.middleware(((t,r)=>maybeAsyncResult((()=>e(t,r.getOptions())),(r=>{if(!r){pe(this,He,"f").fail(pe(this,We,"f").y18n.__("Argument check failed: %s",e.toString()))}else if(typeof r==="string"||r instanceof Error){pe(this,He,"f").fail(r.toString(),r)}return t}),(e=>{pe(this,He,"f").fail(e.message?e.message:e.toString(),e);return t}))),false,t);return this}choices(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[lt](this.choices.bind(this),"choices",e,t);return this}coerce(e,t){argsert("<object|string|array> [function]",[e,t],arguments.length);if(Array.isArray(e)){if(!t){throw new YError("coerce callback must be provided")}for(const r of e){this.coerce(r,t)}return this}else if(typeof e==="object"){for(const t of Object.keys(e)){this.coerce(t,e[t])}return this}if(!t){throw new YError("coerce callback must be provided")}const r=e;pe(this,_e,"f").key[r]=true;pe(this,Oe,"f").addCoerceMiddleware(((e,n)=>{var o;const i=(o=n.getAliases()[r])!==null&&o!==void 0?o:[];const u=[r,...i].filter((t=>Object.prototype.hasOwnProperty.call(e,t)));if(u.length===0){return e}return maybeAsyncResult((()=>t(e[u[0]])),(t=>{u.forEach((r=>{e[r]=t}));return e}),(e=>{throw new YError(e.message)}))}),r);return this}conflicts(e,t){argsert("<string|object> [string|array]",[e,t],arguments.length);pe(this,qe,"f").conflicts(e,t);return this}config(e="config",t,r){argsert("[object|string] [string|function] [function]",[e,t,r],arguments.length);if(typeof e==="object"&&!Array.isArray(e)){e=applyExtends(e,pe(this,ge,"f"),this[rt]()["deep-merge-config"]||false,pe(this,We,"f"));pe(this,_e,"f").configObjects=(pe(this,_e,"f").configObjects||[]).concat(e);return this}if(typeof t==="function"){r=t;t=undefined}this.describe(e,t||pe(this,He,"f").deferY18nLookup("Path to JSON config file"));(Array.isArray(e)?e:[e]).forEach((e=>{pe(this,_e,"f").config[e]=r||true}));return this}completion(e,t,r){argsert("[string] [string|boolean|function] [function]",[e,t,r],arguments.length);if(typeof t==="function"){r=t;t=undefined}de(this,Fe,e||pe(this,Fe,"f")||"completion","f");if(!t&&t!==false){t="generate completion script"}this.command(pe(this,Fe,"f"),t);if(r)pe(this,ye,"f").registerFunction(r);return this}command(e,t,r,n,o,i){argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,r,n,o,i],arguments.length);pe(this,he,"f").addHandler(e,t,r,n,o,i);return this}commands(e,t,r,n,o,i){return this.command(e,t,r,n,o,i)}commandDir(e,t){argsert("<string> [object]",[e,t],arguments.length);const r=pe(this,Ie,"f")||pe(this,We,"f").require;pe(this,he,"f").addDirectory(e,r,pe(this,We,"f").getCallerFile(),t);return this}count(e){argsert("<array|string>",[e],arguments.length);this[at]("count",e);this[xt](e);return this}default(e,t,r){argsert("<object|string|array> [*] [string]",[e,t,r],arguments.length);if(r){assertSingleKey(e,pe(this,We,"f"));pe(this,_e,"f").defaultDescription[e]=r}if(typeof t==="function"){assertSingleKey(e,pe(this,We,"f"));if(!pe(this,_e,"f").defaultDescription[e])pe(this,_e,"f").defaultDescription[e]=pe(this,He,"f").functionDescription(t);t=t.call()}this[ct](this.default.bind(this),"default",e,t);return this}defaults(e,t,r){return this.default(e,t,r)}demandCommand(e=1,t,r,n){argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,r,n],arguments.length);if(typeof t!=="number"){r=t;t=Infinity}this.global("_",false);pe(this,_e,"f").demandedCommands._={min:e,max:t,minMsg:r,maxMsg:n};return this}demand(e,t,r){if(Array.isArray(t)){t.forEach((e=>{assertNotStrictEqual(r,true,pe(this,We,"f"));this.demandOption(e,r)}));t=Infinity}else if(typeof t!=="number"){r=t;t=Infinity}if(typeof e==="number"){assertNotStrictEqual(r,true,pe(this,We,"f"));this.demandCommand(e,t,r,r)}else if(Array.isArray(e)){e.forEach((e=>{assertNotStrictEqual(r,true,pe(this,We,"f"));this.demandOption(e,r)}))}else{if(typeof r==="string"){this.demandOption(e,r)}else if(r===true||typeof r==="undefined"){this.demandOption(e)}}return this}demandOption(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[ct](this.demandOption.bind(this),"demandedOptions",e,t);return this}deprecateOption(e,t){argsert("<string> [string|boolean]",[e,t],arguments.length);pe(this,_e,"f").deprecatedOptions[e]=t;return this}describe(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[dt](e,true);pe(this,He,"f").describe(e,t);return this}detectLocale(e){argsert("<boolean>",[e],arguments.length);de(this,Ce,e,"f");return this}env(e){argsert("[string|boolean]",[e],arguments.length);if(e===false)delete pe(this,_e,"f").envPrefix;else pe(this,_e,"f").envPrefix=e||"";return this}epilogue(e){argsert("<string>",[e],arguments.length);pe(this,He,"f").epilog(e);return this}epilog(e){return this.epilogue(e)}example(e,t){argsert("<string|array> [string]",[e,t],arguments.length);if(Array.isArray(e)){e.forEach((e=>this.example(...e)))}else{pe(this,He,"f").example(e,t)}return this}exit(e,t){de(this,Be,true,"f");de(this,Ee,t,"f");if(pe(this,we,"f"))pe(this,We,"f").process.exit(e)}exitProcess(e=true){argsert("[boolean]",[e],arguments.length);de(this,we,e,"f");return this}fail(e){argsert("<function|boolean>",[e],arguments.length);if(typeof e==="boolean"&&e!==false){throw new YError("Invalid first argument. Expected function or boolean 'false'")}pe(this,He,"f").failFn(e);return this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){argsert("<array> [function]",[e,t],arguments.length);if(!t){return new Promise(((t,r)=>{pe(this,ye,"f").getCompletion(e,((e,n)=>{if(e)r(e);else t(n)}))}))}else{return pe(this,ye,"f").getCompletion(e,t)}}getDemandedOptions(){argsert([],0);return pe(this,_e,"f").demandedOptions}getDemandedCommands(){argsert([],0);return pe(this,_e,"f").demandedCommands}getDeprecatedOptions(){argsert([],0);return pe(this,_e,"f").deprecatedOptions}getDetectLocale(){return pe(this,Ce,"f")}getExitProcess(){return pe(this,we,"f")}getGroups(){return Object.assign({},pe(this,Se,"f"),pe(this,Ue,"f"))}getHelp(){de(this,Be,true,"f");if(!pe(this,He,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Bt](pe(this,$e,"f"),undefined,undefined,0,true);if(isPromise(e)){return e.then((()=>pe(this,He,"f").help()))}}const e=pe(this,he,"f").runDefaultBuilderOn(this);if(isPromise(e)){return e.then((()=>pe(this,He,"f").help()))}}return Promise.resolve(pe(this,He,"f").help())}getOptions(){return pe(this,_e,"f")}getStrict(){return pe(this,Ke,"f")}getStrictCommands(){return pe(this,ze,"f")}getStrictOptions(){return pe(this,Ge,"f")}global(e,t){argsert("<string|array> [boolean]",[e,t],arguments.length);e=[].concat(e);if(t!==false){pe(this,_e,"f").local=pe(this,_e,"f").local.filter((t=>e.indexOf(t)===-1))}else{e.forEach((e=>{if(!pe(this,_e,"f").local.includes(e))pe(this,_e,"f").local.push(e)}))}return this}group(e,t){argsert("<string|array> <string>",[e,t],arguments.length);const r=pe(this,Ue,"f")[t]||pe(this,Se,"f")[t];if(pe(this,Ue,"f")[t]){delete pe(this,Ue,"f")[t]}const n={};pe(this,Se,"f")[t]=(r||[]).concat(e).filter((e=>{if(n[e])return false;return n[e]=true}));return this}hide(e){argsert("<string>",[e],arguments.length);pe(this,_e,"f").hiddenOptions.push(e);return this}implies(e,t){argsert("<string|object> [number|string|array]",[e,t],arguments.length);pe(this,qe,"f").implies(e,t);return this}locale(e){argsert("[string]",[e],arguments.length);if(e===undefined){this[ot]();return pe(this,We,"f").y18n.getLocale()}de(this,Ce,false,"f");pe(this,We,"f").y18n.setLocale(e);return this}middleware(e,t,r){return pe(this,Oe,"f").addMiddleware(e,!!t,r)}nargs(e,t){argsert("<string|object|array> [number]",[e,t],arguments.length);this[ct](this.nargs.bind(this),"narg",e,t);return this}normalize(e){argsert("<array|string>",[e],arguments.length);this[at]("normalize",e);return this}number(e){argsert("<array|string>",[e],arguments.length);this[at]("number",e);this[xt](e);return this}option(e,t){argsert("<string|object> [object]",[e,t],arguments.length);if(typeof e==="object"){Object.keys(e).forEach((t=>{this.options(t,e[t])}))}else{if(typeof t!=="object"){t={}}this[xt](e);if(pe(this,Je,"f")&&(e==="version"||(t===null||t===void 0?void 0:t.alias)==="version")){this[Ze](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),undefined,"versionWarning")}pe(this,_e,"f").key[e]=true;if(t.alias)this.alias(e,t.alias);const r=t.deprecate||t.deprecated;if(r){this.deprecateOption(e,r)}const n=t.demand||t.required||t.require;if(n){this.demand(e,n)}if(t.demandOption){this.demandOption(e,typeof t.demandOption==="string"?t.demandOption:undefined)}if(t.conflicts){this.conflicts(e,t.conflicts)}if("default"in t){this.default(e,t.default)}if(t.implies!==undefined){this.implies(e,t.implies)}if(t.nargs!==undefined){this.nargs(e,t.nargs)}if(t.config){this.config(e,t.configParser)}if(t.normalize){this.normalize(e)}if(t.choices){this.choices(e,t.choices)}if(t.coerce){this.coerce(e,t.coerce)}if(t.group){this.group(e,t.group)}if(t.boolean||t.type==="boolean"){this.boolean(e);if(t.alias)this.boolean(t.alias)}if(t.array||t.type==="array"){this.array(e);if(t.alias)this.array(t.alias)}if(t.number||t.type==="number"){this.number(e);if(t.alias)this.number(t.alias)}if(t.string||t.type==="string"){this.string(e);if(t.alias)this.string(t.alias)}if(t.count||t.type==="count"){this.count(e)}if(typeof t.global==="boolean"){this.global(e,t.global)}if(t.defaultDescription){pe(this,_e,"f").defaultDescription[e]=t.defaultDescription}if(t.skipValidation){this.skipValidation(e)}const o=t.describe||t.description||t.desc;const i=pe(this,He,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(i,e)||typeof o==="string"){this.describe(e,o)}if(t.hidden){this.hide(e)}if(t.requiresArg){this.requiresArg(e)}}return this}options(e,t){return this.option(e,t)}parse(e,t,r){argsert("[string|array] [function|boolean|object] [function]",[e,t,r],arguments.length);this[et]();if(typeof e==="undefined"){e=pe(this,$e,"f")}if(typeof t==="object"){de(this,Me,t,"f");t=r}if(typeof t==="function"){de(this,Ne,t,"f");t=false}if(!t)de(this,$e,e,"f");if(pe(this,Ne,"f"))de(this,we,false,"f");const n=this[Bt](e,!!t);const o=this.parsed;pe(this,ye,"f").setParsed(this.parsed);if(isPromise(n)){return n.then((e=>{if(pe(this,Ne,"f"))pe(this,Ne,"f").call(this,pe(this,Ee,"f"),e,pe(this,Pe,"f"));return e})).catch((e=>{if(pe(this,Ne,"f")){pe(this,Ne,"f")(e,this.parsed.argv,pe(this,Pe,"f"))}throw e})).finally((()=>{this[pt]();this.parsed=o}))}else{if(pe(this,Ne,"f"))pe(this,Ne,"f").call(this,pe(this,Ee,"f"),n,pe(this,Pe,"f"));this[pt]();this.parsed=o}return n}parseAsync(e,t,r){const n=this.parse(e,t,r);return!isPromise(n)?Promise.resolve(n):n}parseSync(e,t,r){const n=this.parse(e,t,r);if(isPromise(n)){throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware")}return n}parserConfiguration(e){argsert("<object>",[e],arguments.length);de(this,Te,e,"f");return this}pkgConf(e,t){argsert("<string> [string]",[e,t],arguments.length);let r=null;const n=this[st](t||pe(this,ge,"f"));if(n[e]&&typeof n[e]==="object"){r=applyExtends(n[e],t||pe(this,ge,"f"),this[rt]()["deep-merge-config"]||false,pe(this,We,"f"));pe(this,_e,"f").configObjects=(pe(this,_e,"f").configObjects||[]).concat(r)}return this}positional(e,t){argsert("<string> <object>",[e,t],arguments.length);const r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,((e,t)=>{if(e==="type"&&!["string","number","boolean"].includes(t))return false;return r.includes(e)}));const n=pe(this,me,"f").fullCommands[pe(this,me,"f").fullCommands.length-1];const o=n?pe(this,he,"f").cmdToParseOptions(n):{array:[],alias:{},default:{},demand:{}};objectKeys(o).forEach((r=>{const n=o[r];if(Array.isArray(n)){if(n.indexOf(e)!==-1)t[r]=true}else{if(n[e]&&!(r in t))t[r]=n[e]}}));this.group(e,pe(this,He,"f").getPositionalGroupName());return this.option(e,t)}recommendCommands(e=true){argsert("[boolean]",[e],arguments.length);de(this,Le,e,"f");return this}required(e,t,r){return this.demand(e,t,r)}require(e,t,r){return this.demand(e,t,r)}requiresArg(e){argsert("<array|string|object> [number]",[e],arguments.length);if(typeof e==="string"&&pe(this,_e,"f").narg[e]){return this}else{this[ct](this.requiresArg.bind(this),"narg",e,NaN)}return this}showCompletionScript(e,t){argsert("[string] [string]",[e,t],arguments.length);e=e||this.$0;pe(this,xe,"f").log(pe(this,ye,"f").generateCompletionScript(e,t||pe(this,Fe,"f")||"completion"));return this}showHelp(e){argsert("[string|function]",[e],arguments.length);de(this,Be,true,"f");if(!pe(this,He,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Bt](pe(this,$e,"f"),undefined,undefined,0,true);if(isPromise(t)){t.then((()=>{pe(this,He,"f").showHelp(e)}));return this}}const t=pe(this,he,"f").runDefaultBuilderOn(this);if(isPromise(t)){t.then((()=>{pe(this,He,"f").showHelp(e)}));return this}}pe(this,He,"f").showHelp(e);return this}scriptName(e){this.customScriptName=true;this.$0=e;return this}showHelpOnFail(e,t){argsert("[boolean|string] [string]",[e,t],arguments.length);pe(this,He,"f").showHelpOnFail(e,t);return this}showVersion(e){argsert("[string|function]",[e],arguments.length);pe(this,He,"f").showVersion(e);return this}skipValidation(e){argsert("<array|string>",[e],arguments.length);this[at]("skipValidation",e);return this}strict(e){argsert("[boolean]",[e],arguments.length);de(this,Ke,e!==false,"f");return this}strictCommands(e){argsert("[boolean]",[e],arguments.length);de(this,ze,e!==false,"f");return this}strictOptions(e){argsert("[boolean]",[e],arguments.length);de(this,Ge,e!==false,"f");return this}string(e){argsert("<array|string>",[e],arguments.length);this[at]("string",e);this[xt](e);return this}terminalWidth(){argsert([],0);return pe(this,We,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){argsert("<object>",[e],arguments.length);de(this,Ce,false,"f");pe(this,We,"f").y18n.updateLocale(e);return this}usage(e,t,r,n){argsert("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,r,n],arguments.length);if(t!==undefined){assertNotStrictEqual(e,null,pe(this,We,"f"));if((e||"").match(/^\$0( |$)/)){return this.command(e,t,r,n)}else{throw new YError(".usage() description must start with $0 if being used as alias for .command()")}}else{pe(this,He,"f").usage(e);return this}}usageConfiguration(e){argsert("<object>",[e],arguments.length);de(this,Ve,e,"f");return this}version(e,t,r){const n="version";argsert("[boolean|string] [string] [string]",[e,t,r],arguments.length);if(pe(this,Je,"f")){this[Qe](pe(this,Je,"f"));pe(this,He,"f").version(undefined);de(this,Je,null,"f")}if(arguments.length===0){r=this[it]();e=n}else if(arguments.length===1){if(e===false){return this}r=e;e=n}else if(arguments.length===2){r=t;t=undefined}de(this,Je,typeof e==="string"?e:n,"f");t=t||pe(this,He,"f").deferY18nLookup("Show version number");pe(this,He,"f").version(r||undefined);this.boolean(pe(this,Je,"f"));this.describe(pe(this,Je,"f"),t);return this}wrap(e){argsert("<number|null|undefined>",[e],arguments.length);pe(this,He,"f").wrap(e);return this}[(he=new WeakMap,ge=new WeakMap,me=new WeakMap,ye=new WeakMap,Fe=new WeakMap,be=new WeakMap,Ee=new WeakMap,Ce=new WeakMap,ve=new WeakMap,we=new WeakMap,Ae=new WeakMap,Oe=new WeakMap,Se=new WeakMap,Be=new WeakMap,je=new WeakMap,ke=new WeakMap,xe=new WeakMap,Pe=new WeakMap,_e=new WeakMap,Ie=new WeakMap,Te=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Re=new WeakMap,Ue=new WeakMap,$e=new WeakMap,Le=new WeakMap,We=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Ge=new WeakMap,He=new WeakMap,Ve=new WeakMap,Je=new WeakMap,qe=new WeakMap,Ye)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch(e){}return e}[Xe](){return{log:(...e)=>{if(!this[vt]())console.log(...e);de(this,Be,true,"f");if(pe(this,Pe,"f").length)de(this,Pe,pe(this,Pe,"f")+"\n","f");de(this,Pe,pe(this,Pe,"f")+e.join(" "),"f")},error:(...e)=>{if(!this[vt]())console.error(...e);de(this,Be,true,"f");if(pe(this,Pe,"f").length)de(this,Pe,pe(this,Pe,"f")+"\n","f");de(this,Pe,pe(this,Pe,"f")+e.join(" "),"f")}}}[Qe](e){objectKeys(pe(this,_e,"f")).forEach((t=>{if((e=>e==="configObjects")(t))return;const r=pe(this,_e,"f")[t];if(Array.isArray(r)){if(r.includes(e))r.splice(r.indexOf(e),1)}else if(typeof r==="object"){delete r[e]}}));delete pe(this,He,"f").getDescriptions()[e]}[Ze](e,t,r){if(!pe(this,ve,"f")[r]){pe(this,We,"f").process.emitWarning(e,t);pe(this,ve,"f")[r]=true}}[et](){pe(this,Ae,"f").push({options:pe(this,_e,"f"),configObjects:pe(this,_e,"f").configObjects.slice(0),exitProcess:pe(this,we,"f"),groups:pe(this,Se,"f"),strict:pe(this,Ke,"f"),strictCommands:pe(this,ze,"f"),strictOptions:pe(this,Ge,"f"),completionCommand:pe(this,Fe,"f"),output:pe(this,Pe,"f"),exitError:pe(this,Ee,"f"),hasOutput:pe(this,Be,"f"),parsed:this.parsed,parseFn:pe(this,Ne,"f"),parseContext:pe(this,Me,"f")});pe(this,He,"f").freeze();pe(this,qe,"f").freeze();pe(this,he,"f").freeze();pe(this,Oe,"f").freeze()}[tt](){let e="";let t;if(/\b(node|iojs|electron)(\.exe)?$/.test(pe(this,We,"f").process.argv()[0])){t=pe(this,We,"f").process.argv().slice(1,2)}else{t=pe(this,We,"f").process.argv().slice(0,1)}e=t.map((e=>{const t=this[Ot](pe(this,ge,"f"),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e})).join(" ").trim();if(pe(this,We,"f").getEnv("_")&&pe(this,We,"f").getProcessArgvBin()===pe(this,We,"f").getEnv("_")){e=pe(this,We,"f").getEnv("_").replace(`${pe(this,We,"f").path.dirname(pe(this,We,"f").process.execPath())}/`,"")}return e}[rt](){return pe(this,Te,"f")}[nt](){return pe(this,Ve,"f")}[ot](){if(!pe(this,Ce,"f"))return;const e=pe(this,We,"f").getEnv("LC_ALL")||pe(this,We,"f").getEnv("LC_MESSAGES")||pe(this,We,"f").getEnv("LANG")||pe(this,We,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[it](){const e=this[st]();return e.version||"unknown"}[ut](e){const t=e["--"]?e["--"]:e._;for(let e=0,r;(r=t[e])!==undefined;e++){if(pe(this,We,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))){t[e]=Number(r)}}return e}[st](e){const t=e||"*";if(pe(this,Re,"f")[t])return pe(this,Re,"f")[t];let r={};try{let t=e||pe(this,We,"f").mainFilename;if(pe(this,We,"f").path.extname(t)){t=pe(this,We,"f").path.dirname(t)}const n=pe(this,We,"f").findUp(t,((e,t)=>{if(t.includes("package.json")){return"package.json"}else{return undefined}}));assertNotStrictEqual(n,undefined,pe(this,We,"f"));r=JSON.parse(pe(this,We,"f").readFileSync(n,"utf8"))}catch(e){}pe(this,Re,"f")[t]=r||{};return pe(this,Re,"f")[t]}[at](e,t){t=[].concat(t);t.forEach((t=>{t=this[ft](t);pe(this,_e,"f")[e].push(t)}))}[ct](e,t,r,n){this[Dt](e,t,r,n,((e,t,r)=>{pe(this,_e,"f")[e][t]=r}))}[lt](e,t,r,n){this[Dt](e,t,r,n,((e,t,r)=>{pe(this,_e,"f")[e][t]=(pe(this,_e,"f")[e][t]||[]).concat(r)}))}[Dt](e,t,r,n,o){if(Array.isArray(r)){r.forEach((t=>{e(t,n)}))}else if((e=>typeof e==="object")(r)){for(const t of objectKeys(r)){e(t,r[t])}}else{o(t,this[ft](r),n)}}[ft](e){if(e==="__proto__")return"___proto___";return e}[dt](e,t){this[ct](this[dt].bind(this),"key",e,t);return this}[pt](){var e,t,r,n,o,i,u,s,a,c,l,D;const f=pe(this,Ae,"f").pop();assertNotStrictEqual(f,undefined,pe(this,We,"f"));let d;e=this,t=this,r=this,n=this,o=this,i=this,u=this,s=this,a=this,c=this,l=this,D=this,({options:{set value(t){de(e,_e,t,"f")}}.value,configObjects:d,exitProcess:{set value(e){de(t,we,e,"f")}}.value,groups:{set value(e){de(r,Se,e,"f")}}.value,output:{set value(e){de(n,Pe,e,"f")}}.value,exitError:{set value(e){de(o,Ee,e,"f")}}.value,hasOutput:{set value(e){de(i,Be,e,"f")}}.value,parsed:this.parsed,strict:{set value(e){de(u,Ke,e,"f")}}.value,strictCommands:{set value(e){de(s,ze,e,"f")}}.value,strictOptions:{set value(e){de(a,Ge,e,"f")}}.value,completionCommand:{set value(e){de(c,Fe,e,"f")}}.value,parseFn:{set value(e){de(l,Ne,e,"f")}}.value,parseContext:{set value(e){de(D,Me,e,"f")}}.value}=f);pe(this,_e,"f").configObjects=d;pe(this,He,"f").unfreeze();pe(this,qe,"f").unfreeze();pe(this,he,"f").unfreeze();pe(this,Oe,"f").unfreeze()}[ht](e,t){return maybeAsyncResult(t,(t=>{e(t);return t}))}getInternalMethods(){return{getCommandInstance:this[gt].bind(this),getContext:this[mt].bind(this),getHasOutput:this[yt].bind(this),getLoggerInstance:this[Ft].bind(this),getParseContext:this[bt].bind(this),getParserConfiguration:this[rt].bind(this),getUsageConfiguration:this[nt].bind(this),getUsageInstance:this[Et].bind(this),getValidationInstance:this[Ct].bind(this),hasParseCallback:this[vt].bind(this),isGlobalContext:this[wt].bind(this),postProcess:this[At].bind(this),reset:this[St].bind(this),runValidation:this[jt].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[kt].bind(this)}}[gt](){return pe(this,he,"f")}[mt](){return pe(this,me,"f")}[yt](){return pe(this,Be,"f")}[Ft](){return pe(this,xe,"f")}[bt](){return pe(this,Me,"f")||{}}[Et](){return pe(this,He,"f")}[Ct](){return pe(this,qe,"f")}[vt](){return!!pe(this,Ne,"f")}[wt](){return pe(this,ke,"f")}[At](e,t,r,n){if(r)return e;if(isPromise(e))return e;if(!t){e=this[Ye](e)}const o=this[rt]()["parse-positional-numbers"]||this[rt]()["parse-positional-numbers"]===undefined;if(o){e=this[ut](e)}if(n){e=applyMiddleware(e,this,pe(this,Oe,"f").getMiddleware(),false)}return e}[St](e={}){de(this,_e,pe(this,_e,"f")||{},"f");const t={};t.local=pe(this,_e,"f").local||[];t.configObjects=pe(this,_e,"f").configObjects||[];const r={};t.local.forEach((t=>{r[t]=true;(e[t]||[]).forEach((e=>{r[e]=true}))}));Object.assign(pe(this,Ue,"f"),Object.keys(pe(this,Se,"f")).reduce(((e,t)=>{const n=pe(this,Se,"f")[t].filter((e=>!(e in r)));if(n.length>0){e[t]=n}return e}),{}));de(this,Se,{},"f");const n=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"];const o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];n.forEach((e=>{t[e]=(pe(this,_e,"f")[e]||[]).filter((e=>!r[e]))}));o.forEach((e=>{t[e]=objFilter(pe(this,_e,"f")[e],(e=>!r[e]))}));t.envPrefix=pe(this,_e,"f").envPrefix;de(this,_e,t,"f");de(this,He,pe(this,He,"f")?pe(this,He,"f").reset(r):usage(this,pe(this,We,"f")),"f");de(this,qe,pe(this,qe,"f")?pe(this,qe,"f").reset(r):validation(this,pe(this,He,"f"),pe(this,We,"f")),"f");de(this,he,pe(this,he,"f")?pe(this,he,"f").reset():command(pe(this,He,"f"),pe(this,qe,"f"),pe(this,Oe,"f"),pe(this,We,"f")),"f");if(!pe(this,ye,"f"))de(this,ye,completion(this,pe(this,He,"f"),pe(this,he,"f"),pe(this,We,"f")),"f");pe(this,Oe,"f").reset();de(this,Fe,null,"f");de(this,Pe,"","f");de(this,Ee,null,"f");de(this,Be,false,"f");this.parsed=false;return this}[Ot](e,t){return pe(this,We,"f").path.relative(e,t)}[Bt](e,t,r,n=0,o=false){var i,u,s,a;let c=!!r||o;e=e||pe(this,$e,"f");pe(this,_e,"f").__=pe(this,We,"f").y18n.__;pe(this,_e,"f").configuration=this[rt]();const l=!!pe(this,_e,"f").configuration["populate--"];const D=Object.assign({},pe(this,_e,"f").configuration,{"populate--":true});const f=pe(this,We,"f").Parser.detailed(e,Object.assign({},pe(this,_e,"f"),{configuration:{"parse-positional-numbers":false,...D}}));const d=Object.assign(f.argv,pe(this,Me,"f"));let p=undefined;const h=f.aliases;let g=false;let m=false;Object.keys(d).forEach((e=>{if(e===pe(this,je,"f")&&d[e]){g=true}else if(e===pe(this,Je,"f")&&d[e]){m=true}}));d.$0=this.$0;this.parsed=f;if(n===0){pe(this,He,"f").clearCachedHelpMessage()}try{this[ot]();if(t){return this[At](d,l,!!r,false)}if(pe(this,je,"f")){const e=[pe(this,je,"f")].concat(h[pe(this,je,"f")]||[]).filter((e=>e.length>1));if(e.includes(""+d._[d._.length-1])){d._.pop();g=true}}de(this,ke,false,"f");const D=pe(this,he,"f").getCommands();const y=((i=pe(this,ye,"f"))===null||i===void 0?void 0:i.completionKey)?[(u=pe(this,ye,"f"))===null||u===void 0?void 0:u.completionKey,...(a=this.getAliases()[(s=pe(this,ye,"f"))===null||s===void 0?void 0:s.completionKey])!==null&&a!==void 0?a:[]].some((e=>Object.prototype.hasOwnProperty.call(d,e))):false;const F=g||y||o;if(d._.length){if(D.length){let e;for(let t=n||0,i;d._[t]!==undefined;t++){i=String(d._[t]);if(D.includes(i)&&i!==pe(this,Fe,"f")){const e=pe(this,he,"f").runCommand(i,this,f,t+1,o,g||m||o);return this[At](e,l,!!r,false)}else if(!e&&i!==pe(this,Fe,"f")){e=i;break}}if(!pe(this,he,"f").hasDefaultCommand()&&pe(this,Le,"f")&&e&&!F){pe(this,qe,"f").recommendCommands(e,D)}}if(pe(this,Fe,"f")&&d._.includes(pe(this,Fe,"f"))&&!y){if(pe(this,we,"f"))setBlocking(true);this.showCompletionScript();this.exit(0)}}if(pe(this,he,"f").hasDefaultCommand()&&!F){const e=pe(this,he,"f").runCommand(null,this,f,0,o,g||m||o);return this[At](e,l,!!r,false)}if(y){if(pe(this,we,"f"))setBlocking(true);e=[].concat(e);const t=e.slice(e.indexOf(`--${pe(this,ye,"f").completionKey}`)+1);pe(this,ye,"f").getCompletion(t,((e,t)=>{if(e)throw new YError(e.message);(t||[]).forEach((e=>{pe(this,xe,"f").log(e)}));this.exit(0)}));return this[At](d,!l,!!r,false)}if(!pe(this,Be,"f")){if(g){if(pe(this,we,"f"))setBlocking(true);c=true;this.showHelp((e=>{pe(this,xe,"f").log(e);this.exit(0)}))}else if(m){if(pe(this,we,"f"))setBlocking(true);c=true;pe(this,He,"f").showVersion("log");this.exit(0)}}if(!c&&pe(this,_e,"f").skipValidation.length>0){c=Object.keys(d).some((e=>pe(this,_e,"f").skipValidation.indexOf(e)>=0&&d[e]===true))}if(!c){if(f.error)throw new YError(f.error.message);if(!y){const e=this[jt](h,{},f.error);if(!r){p=applyMiddleware(d,this,pe(this,Oe,"f").getMiddleware(),true)}p=this[ht](e,p!==null&&p!==void 0?p:d);if(isPromise(p)&&!r){p=p.then((()=>applyMiddleware(d,this,pe(this,Oe,"f").getMiddleware(),false)))}}}}catch(e){if(e instanceof YError)pe(this,He,"f").fail(e.message,e);else throw e}return this[At](p!==null&&p!==void 0?p:d,l,!!r,true)}[jt](e,t,r,n){const o={...this.getDemandedOptions()};return i=>{if(r)throw new YError(r.message);pe(this,qe,"f").nonOptionCount(i);pe(this,qe,"f").requiredArguments(i,o);let u=false;if(pe(this,ze,"f")){u=pe(this,qe,"f").unknownCommands(i)}if(pe(this,Ke,"f")&&!u){pe(this,qe,"f").unknownArguments(i,e,t,!!n)}else if(pe(this,Ge,"f")){pe(this,qe,"f").unknownArguments(i,e,{},false,false)}pe(this,qe,"f").limitedChoices(i);pe(this,qe,"f").implications(i);pe(this,qe,"f").conflicting(i)}}[kt](){de(this,Be,true,"f")}[xt](e){if(typeof e==="string"){pe(this,_e,"f").key[e]=true}else{for(const t of e){pe(this,_e,"f").key[t]=true}}}}function isYargsInstance(e){return!!e&&typeof e.getInternalMethods==="function"}const _t=YargsFactory(ie);const It=_t}};var r={};function __nccwpck_require__(e){var n=r[e];if(n!==undefined){return n.exports}var o=r[e]={exports:{}};var i=true;try{t[e](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete r[e]}return o.exports}(()=>{var e=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var t=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var r=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=e=>{if(e&&e.d<1){e.d=1;e.forEach((e=>e.r--));e.forEach((e=>e.r--?e.r++:e()))}};var wrapDeps=n=>n.map((n=>{if(n!==null&&typeof n==="object"){if(n[e])return n;if(n.then){var o=[];o.d=0;n.then((e=>{i[t]=e;resolveQueue(o)}),(e=>{i[r]=e;resolveQueue(o)}));var i={};i[e]=e=>e(o);return i}}var u={};u[e]=e=>{};u[t]=n;return u}));__nccwpck_require__.a=(n,o,i)=>{var u;i&&((u=[]).d=-1);var s=new Set;var a=n.exports;var c;var l;var D;var f=new Promise(((e,t)=>{D=t;l=e}));f[t]=a;f[e]=e=>(u&&e(u),s.forEach(e),f["catch"]((e=>{})));n.exports=f;o((n=>{c=wrapDeps(n);var o;var getResult=()=>c.map((e=>{if(e[r])throw e[r];return e[t]}));var i=new Promise((t=>{o=()=>t(getResult);o.r=0;var fnQueue=e=>e!==u&&!s.has(e)&&(s.add(e),e&&!e.d&&(o.r++,e.push(o)));c.map((t=>t[e](fnQueue)))}));return o.r?i:getResult()}),(e=>(e?D(f[r]=e):l(a),resolveQueue(u))));u&&u.d<0&&(u.d=0)}})();(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var n=__nccwpck_require__(1719);n=await n;
|
|
34
|
+
var te,re,ne;const oe=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20;const ie=(re=(te=process===null||process===void 0?void 0:process.versions)===null||te===void 0?void 0:te.node)!==null&&re!==void 0?re:(ne=process===null||process===void 0?void 0:process.version)===null||ne===void 0?void 0:ne.slice(1);if(ie){const e=Number(ie.match(/^([^.]+)/)[1]);if(e<oe){throw Error(`yargs parser supports a minimum Node.js version of ${oe}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}}const se=process?process.env:{};const ae=ee.createRequire?(0,ee.createRequire)(import.meta.url):undefined;const ue=new YargsParser({cwd:process.cwd,env:()=>se,format:Y.format,normalize:J.normalize,resolve:J.resolve,require:e=>{if(typeof ae!=="undefined"){return ae(e)}else if(e.match(/\.json$/)){return JSON.parse((0,q.readFileSync)(e,"utf8"))}else{throw Error("only .json config files are supported in ESM")}}});const ce=function Parser(e,t){const r=ue.parse(e.slice(),t);return r.argv};ce.detailed=function(e,t){return ue.parse(e.slice(),t)};ce.camelCase=camelCase;ce.decamelize=decamelize;ce.looksLikeNumber=looksLikeNumber;const le=ce;function getProcessArgvBinIndex(){if(isBundledElectronApp())return 0;return 1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(e){return e.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}const fe={fs:{readFileSync:q.readFileSync,writeFile:q.writeFile},format:Y.format,resolve:J.resolve,exists:e=>{try{return(0,q.statSync)(e).isFile()}catch(e){return false}}};let de;class Y18N{constructor(e){e=e||{};this.directory=e.directory||"./locales";this.updateFiles=typeof e.updateFiles==="boolean"?e.updateFiles:true;this.locale=e.locale||"en";this.fallbackToLanguage=typeof e.fallbackToLanguage==="boolean"?e.fallbackToLanguage:true;this.cache=Object.create(null);this.writeQueue=[]}__(...e){if(typeof arguments[0]!=="string"){return this._taggedLiteral(arguments[0],...arguments)}const t=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();cb=cb||function(){};if(!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]=t;this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}return de.format.apply(de.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments);const t=e.shift();const r=e.shift();const n=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();if(!this.cache[this.locale])this._readLocaleFile();let o=n===1?t:r;if(this.cache[this.locale][t]){const e=this.cache[this.locale][t];o=e[n===1?"one":"other"]}if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]={one:t,other:r};this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}const i=[o];if(~o.indexOf("%d"))i.push(n);return de.format.apply(de.format,i.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){if(!this.cache[this.locale])this._readLocaleFile();for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){this.cache[this.locale][t]=e[t]}}}_taggedLiteral(e,...t){let r="";e.forEach((function(e,n){const o=t[n+1];r+=e;if(typeof o!=="undefined"){r+="%s"}}));return this.__.apply(this,[r].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e);if(this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){const e=this;const t=this.writeQueue[0];const r=t.directory;const n=t.locale;const o=t.cb;const i=this._resolveLocaleFile(r,n);const s=JSON.stringify(this.cache[n],null,2);de.fs.writeFile(i,s,"utf-8",(function(t){e.writeQueue.shift();if(e.writeQueue.length>0)e._processWriteQueue();o(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{if(de.fs.readFileSync){e=JSON.parse(de.fs.readFileSync(t,"utf-8"))}}catch(r){if(r instanceof SyntaxError){r.message="syntax error in "+t}if(r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let r=de.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~t.lastIndexOf("_")){const n=de.resolve(e,"./",t.split("_")[0]+".json");if(this._fileExistsSync(n))r=n}return r}_fileExistsSync(e){return de.exists(e)}}function y18n(e,t){de=t;const r=new Y18N(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const y18n_y18n=e=>y18n(e,fe);const pe=y18n_y18n;var he=n(80);const me=e(import.meta.url)("node:fs");const ge=(0,X.fileURLToPath)(import.meta.url);const De=ge.substring(0,ge.lastIndexOf("node_modules"));const ye=(0,ee.createRequire)(import.meta.url);const be={assert:{notStrictEqual:o.notStrictEqual,strictEqual:o.strictEqual},cliui:ui,findUp:sync,getEnv:e=>process.env[e],inspect:Y.inspect,getProcessArgvBin:getProcessArgvBin,mainFilename:De||process.cwd(),Parser:le,path:{basename:J.basename,dirname:J.dirname,extname:J.extname,relative:J.relative,resolve:J.resolve,join:J.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!=="undefined"?process.stdout.columns:null},readFileSync:me.readFileSync,readdirSync:me.readdirSync,require:ye,getCallerFile:()=>{const e=he(3);return e.match(/^file:\/\//)?(0,X.fileURLToPath)(e):e},stringWidth:stringWidth,y18n:pe({directory:(0,J.resolve)(ge,"../../../locales"),updateFiles:false})};function assertNotStrictEqual(e,t,r,n){r.assert.notStrictEqual(e,t,n)}function assertSingleKey(e,t){t.assert.strictEqual(typeof e,"string")}function objectKeys(e){return Object.keys(e)}function isPromise(e){return!!e&&!!e.then&&typeof e.then==="function"}class YError extends Error{constructor(e){super(e||"yargs error");this.name="YError";if(Error.captureStackTrace){Error.captureStackTrace(this,YError)}}}function parseCommand(e){const t=e.replace(/\s{2,}/g," ");const r=t.split(/\s+(?![^[]*]|[^<]*>)/);const n=/\.*[\][<>]/g;const o=r.shift();if(!o)throw new Error(`No command found in: ${e}`);const i={cmd:o.replace(n,""),demanded:[],optional:[]};r.forEach(((e,t)=>{let o=false;e=e.replace(/\s/g,"");if(/\.+[\]>]/.test(e)&&t===r.length-1)o=true;if(/^\[/.test(e)){i.optional.push({cmd:e.replace(n,"").split("|"),variadic:o})}else{i.demanded.push({cmd:e.replace(n,"").split("|"),variadic:o})}}));return i}const ve=["first","second","third","fourth","fifth","sixth"];function argsert(e,t,r){function parseArgs(){return typeof e==="object"?[{demanded:[],optional:[]},e,t]:[parseCommand(`cmd ${e}`),t,r]}try{let e=0;const[t,r,n]=parseArgs();const o=[].slice.call(r);while(o.length&&o[o.length-1]===undefined)o.pop();const i=n||o.length;if(i<t.demanded.length){throw new YError(`Not enough arguments provided. Expected ${t.demanded.length} but received ${o.length}.`)}const s=t.demanded.length+t.optional.length;if(i>s){throw new YError(`Too many arguments provided. Expected max ${s} but received ${i}.`)}t.demanded.forEach((t=>{const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}));t.optional.forEach((t=>{if(o.length===0)return;const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}))}catch(e){console.warn(e.stack)}}function guessType(e){if(Array.isArray(e)){return"array"}else if(e===null){return"null"}return typeof e}function argumentTypeError(e,t,r){throw new YError(`Invalid ${ve[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[];this.frozens=[];this.yargs=e}addMiddleware(e,t,r=true,n=false){argsert("<array|function> [boolean] [boolean] [boolean]",[e,t,r],arguments.length);if(Array.isArray(e)){for(let n=0;n<e.length;n++){if(typeof e[n]!=="function"){throw Error("middleware must be a function")}const o=e[n];o.applyBeforeValidation=t;o.global=r}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==="function"){const o=e;o.applyBeforeValidation=t;o.global=r;o.mutates=n;this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const r=this.yargs.getAliases();this.globalMiddleware=this.globalMiddleware.filter((e=>{const n=[...r[t]||[],t];if(!e.option)return true;else return!n.includes(e.option)}));e.option=t;return this.addMiddleware(e,true,true,true)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();if(e!==undefined)this.globalMiddleware=e}reset(){this.globalMiddleware=this.globalMiddleware.filter((e=>e.global))}}function commandMiddlewareFactory(e){if(!e)return[];return e.map((e=>{e.applyBeforeValidation=false;return e}))}function applyMiddleware(e,t,r,n){return r.reduce(((e,r)=>{if(r.applyBeforeValidation!==n){return e}if(r.mutates){if(r.applied)return e;r.applied=true}if(isPromise(e)){return e.then((e=>Promise.all([e,r(e,t)]))).then((([e,t])=>Object.assign(e,t)))}else{const n=r(e,t);return isPromise(n)?n.then((t=>Object.assign(e,t))):Object.assign(e,n)}}),e)}function maybeAsyncResult(e,t,r=e=>{throw e}){try{const r=isFunction(e)?e():e;return isPromise(r)?r.then((e=>t(e))):t(r)}catch(e){return r(e)}}function isFunction(e){return typeof e==="function"}const Ee=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,r,n){this.requireCache=new Set;this.handlers={};this.aliasMap={};this.frozens=[];this.shim=n;this.usage=e;this.globalMiddleware=r;this.validation=t}addDirectory(e,t,r,n){n=n||{};this.requireCache.add(r);const o=this.shim.path.resolve(this.shim.path.dirname(r),e);const i=this.shim.readdirSync(o,{recursive:n.recurse?true:false});if(!Array.isArray(n.extensions))n.extensions=["js"];const s=typeof n.visit==="function"?n.visit:e=>e;for(const e of i){const r=e.toString();if(n.exclude){let e=false;if(typeof n.exclude==="function"){e=n.exclude(r)}else{e=n.exclude.test(r)}if(e)continue}if(n.include){let e=false;if(typeof n.include==="function"){e=n.include(r)}else{e=n.include.test(r)}if(!e)continue}let i=false;for(const e of n.extensions){if(r.endsWith(e))i=true}if(i){const e=this.shim.path.join(o,r);const n=t(e);const i=Object.create(null,Object.getOwnPropertyDescriptors({...n}));const a=s(i,e,r);if(a){if(this.requireCache.has(e))continue;else this.requireCache.add(e);if(!i.command){i.command=this.shim.path.basename(e,this.shim.path.extname(e))}this.addHandler(i)}}}}addHandler(e,t,r,n,o,i){let s=[];const a=commandMiddlewareFactory(o);n=n||(()=>{});if(Array.isArray(e)){if(isCommandAndAliases(e)){[e,...s]=e}else{for(const t of e){this.addHandler(t)}}}else if(isCommandHandlerDefinition(e)){let t=Array.isArray(e.command)||typeof e.command==="string"?e.command:null;if(t===null){throw new Error(`No command name given for module: ${this.shim.inspect(e)}`)}if(e.aliases)t=[].concat(t).concat(e.aliases);this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(r)){this.addHandler([e].concat(s),t,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e==="string"){const o=parseCommand(e);s=s.map((e=>parseCommand(e).cmd));let u=false;const c=[o.cmd].concat(s).filter((e=>{if(Ee.test(e)){u=true;return false}return true}));if(c.length===0&&u)c.push("$0");if(u){o.cmd=c[0];s=c.slice(1);e=e.replace(Ee,o.cmd)}s.forEach((e=>{this.aliasMap[e]=o.cmd}));if(t!==false){this.usage.command(e,t,u,s,i)}this.handlers[o.cmd]={original:e,description:t,handler:n,builder:r||{},middlewares:a,deprecated:i,demanded:o.demanded,optional:o.optional};if(u)this.defaultCommand=this.handlers[o.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,r,n,o,i){const s=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand;const a=t.getInternalMethods().getContext();const u=a.commands.slice();const c=!e;if(e){a.commands.push(e);a.fullCommands.push(s.original)}const l=this.applyBuilderUpdateUsageAndParse(c,s,t,r.aliases,u,n,o,i);return isPromise(l)?l.then((e=>this.applyMiddlewareAndGetResult(c,s,e.innerArgv,a,o,e.aliases,t))):this.applyMiddlewareAndGetResult(c,s,l.innerArgv,a,o,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,r,n,o,i,s,a){const u=t.builder;let c=r;if(isCommandBuilderCallback(u)){r.getInternalMethods().getUsageInstance().freeze();const l=u(r.getInternalMethods().reset(n),a);if(isPromise(l)){return l.then((n=>{c=isYargsInstance(n)?n:r;return this.parseAndUpdateUsage(e,t,c,o,i,s)}))}}else if(isCommandBuilderOptionDefinitions(u)){r.getInternalMethods().getUsageInstance().freeze();c=r.getInternalMethods().reset(n);Object.keys(t.builder).forEach((e=>{c.option(e,u[e])}))}return this.parseAndUpdateUsage(e,t,c,o,i,s)}parseAndUpdateUsage(e,t,r,n,o,i){if(e)r.getInternalMethods().getUsageInstance().unfreeze(true);if(this.shouldUpdateUsage(r)){r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(n,t),t.description)}const s=r.getInternalMethods().runYargsParserAndExecuteCommands(null,undefined,true,o,i);return isPromise(s)?s.then((e=>({aliases:r.parsed.aliases,innerArgv:e}))):{aliases:r.parsed.aliases,innerArgv:s}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const r=Ee.test(t.original)?t.original.replace(Ee,"").trim():t.original;const n=e.filter((e=>!Ee.test(e)));n.push(r);return`$0 ${n.join(" ")}`}handleValidationAndGetResult(e,t,r,n,o,i,s,a){if(!i.getInternalMethods().getHasOutput()){const t=i.getInternalMethods().runValidation(o,a,i.parsed.error,e);r=maybeAsyncResult(r,(e=>{t(e);return e}))}if(t.handler&&!i.getInternalMethods().getHasOutput()){i.getInternalMethods().setHasOutput();const n=!!i.getOptions().configuration["populate--"];i.getInternalMethods().postProcess(r,n,false,false);r=applyMiddleware(r,i,s,false);r=maybeAsyncResult(r,(e=>{const r=t.handler(e);return isPromise(r)?r.then((()=>e)):e}));if(!e){i.getInternalMethods().getUsageInstance().cacheHelpMessage()}if(isPromise(r)&&!i.getInternalMethods().hasParseCallback()){r.catch((e=>{try{i.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}}))}}if(!e){n.commands.pop();n.fullCommands.pop()}return r}applyMiddlewareAndGetResult(e,t,r,n,o,i,s){let a={};if(o)return r;if(!s.getInternalMethods().getHasOutput()){a=this.populatePositionals(t,r,n,s)}const u=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);const c=applyMiddleware(r,s,u,true);return isPromise(c)?c.then((r=>this.handleValidationAndGetResult(e,t,r,n,i,s,u,a))):this.handleValidationAndGetResult(e,t,c,n,i,s,u,a)}populatePositionals(e,t,r,n){t._=t._.slice(r.commands.length);const o=e.demanded.slice(0);const i=e.optional.slice(0);const s={};this.validation.positionalCount(o.length,t._.length);while(o.length){const e=o.shift();this.populatePositional(e,t,s)}while(i.length){const e=i.shift();this.populatePositional(e,t,s)}t._=r.commands.concat(t._.map((e=>""+e)));this.postProcessPositionals(t,s,this.cmdToParseOptions(e.original),n);return s}populatePositional(e,t,r){const n=e.cmd[0];if(e.variadic){r[n]=t._.splice(0).map(String)}else{if(t._.length)r[n]=[String(t._.shift())]}}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}};const r=parseCommand(e);r.demanded.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n;t.demand[r]=true}));r.optional.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n}));return t}postProcessPositionals(e,t,r,n){const o=Object.assign({},n.getOptions());o.default=Object.assign(r.default,o.default);for(const e of Object.keys(r.alias)){o.alias[e]=(o.alias[e]||[]).concat(r.alias[e])}o.array=o.array.concat(r.array);o.config={};const i=[];Object.keys(t).forEach((e=>{t[e].map((t=>{if(o.configuration["unknown-options-as-args"])o.key[e]=true;i.push(`--${e}`);i.push(t)}))}));if(!i.length)return;const s=Object.assign({},o.configuration,{"populate--":false});const a=this.shim.Parser.detailed(i,Object.assign({},o,{configuration:s}));if(a.error){n.getInternalMethods().getUsageInstance().fail(a.error.message,a.error)}else{const r=Object.keys(t);Object.keys(t).forEach((e=>{r.push(...a.aliases[e])}));Object.keys(a.argv).forEach((o=>{if(r.includes(o)){if(!t[o])t[o]=a.argv[o];if(!this.isInConfigs(n,o)&&!this.isDefaulted(n,o)&&Object.prototype.hasOwnProperty.call(e,o)&&Object.prototype.hasOwnProperty.call(a.argv,o)&&(Array.isArray(e[o])||Array.isArray(a.argv[o]))){e[o]=[].concat(e[o],a.argv[o])}else{e[o]=a.argv[o]}}}))}}isDefaulted(e,t){const{default:r}=e.getOptions();return Object.prototype.hasOwnProperty.call(r,t)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:r}=e.getOptions();return r.some((e=>Object.prototype.hasOwnProperty.call(e,t)))||r.some((e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t))))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const t=Ee.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t)){return t(e,true)}else if(!isCommandBuilderDefinition(t)){Object.keys(t).forEach((r=>{e.option(r,t[r])}))}return undefined}extractDesc({describe:e,description:t,desc:r}){for(const n of[e,t,r]){if(typeof n==="string"||n===false)return n;assertNotStrictEqual(n,true,this.shim)}return false}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,undefined,this.shim);({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e)}reset(){this.handlers={};this.aliasMap={};this.defaultCommand=undefined;this.requireCache=new Set;return this}}function command(e,t,r,n){return new CommandInstance(e,t,r,n)}function isCommandBuilderDefinition(e){return typeof e==="object"&&!!e.builder&&typeof e.handler==="function"}function isCommandAndAliases(e){return e.every((e=>typeof e==="string"))}function isCommandBuilderCallback(e){return typeof e==="function"}function isCommandBuilderOptionDefinitions(e){return typeof e==="object"}function isCommandHandlerDefinition(e){return typeof e==="object"&&!Array.isArray(e)}function objFilter(e={},t=()=>true){const r={};objectKeys(e).forEach((n=>{if(t(n,e[n])){r[n]=e[n]}}));return r}function setBlocking(e){if(typeof process==="undefined")return;[process.stdout,process.stderr].forEach((t=>{const r=t;if(r._handle&&r.isTTY&&typeof r._handle.setBlocking==="function"){r._handle.setBlocking(e)}}))}function isBoolean(e){return typeof e==="boolean"}function usage(e,t){const r=t.y18n.__;const n={};const o=[];n.failFn=function failFn(e){o.push(e)};let i=null;let s=null;let a=true;n.showHelpOnFail=function showHelpOnFailFn(t=true,r){const[o,u]=typeof t==="string"?[true,t]:[t,r];if(e.getInternalMethods().isGlobalContext()){s=u}i=u;a=o;return n};let u=false;n.fail=function fail(t,r){const c=e.getInternalMethods().getLoggerInstance();if(o.length){for(let e=o.length-1;e>=0;--e){const i=o[e];if(isBoolean(i)){if(r)throw r;else if(t)throw Error(t)}else{i(t,r,n)}}}else{if(e.getExitProcess())setBlocking(true);if(!u){u=true;if(a){e.showHelp("error");c.error()}if(t||r)c.error(t||r);const n=i||s;if(n){if(t||r)c.error("");c.error(n)}}r=r||new YError(t);if(e.getExitProcess()){return e.exit(1)}else if(e.getInternalMethods().hasParseCallback()){return e.exit(1,r)}else{throw r}}};let c=[];let l=false;n.usage=(e,t)=>{if(e===null){l=true;c=[];return n}l=false;c.push([e,t||""]);return n};n.getUsage=()=>c;n.getUsageDisabled=()=>l;n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(e,t)=>{f.push([e,t||""])};let d=[];n.command=function command(e,t,r,n,o=false){if(r){d=d.map((e=>{e[2]=false;return e}))}d.push([e,t||"",r,n,o])};n.getCommands=()=>d;let p={};n.describe=function describe(e,t){if(Array.isArray(e)){e.forEach((e=>{n.describe(e,t)}))}else if(typeof e==="object"){Object.keys(e).forEach((t=>{n.describe(t,e[t])}))}else{p[e]=t}};n.getDescriptions=()=>p;let h=[];n.epilog=e=>{h.push(e)};let m=false;let g;n.wrap=e=>{m=true;g=e};n.getWrap=()=>{if(t.getEnv("YARGS_DISABLE_WRAP")){return null}if(!m){g=windowWidth();m=true}return g};const D="__yargsString__:";n.deferY18nLookup=e=>D+e;n.help=function help(){if(y)return y;normalizeAliases();const o=e.customScriptName?e.$0:t.path.basename(e.$0);const i=e.getDemandedOptions();const s=e.getDemandedCommands();const a=e.getDeprecatedOptions();const u=e.getGroups();const m=e.getOptions();let g=[];g=g.concat(Object.keys(p));g=g.concat(Object.keys(i));g=g.concat(Object.keys(s));g=g.concat(Object.keys(m.default));g=g.filter(filterHiddenOptions);g=Object.keys(g.reduce(((e,t)=>{if(t!=="_")e[t]=true;return e}),{}));const b=n.getWrap();const v=t.cliui({width:b,wrap:!!b});if(!l){if(c.length){c.forEach((e=>{v.div({text:`${e[0].replace(/\$0/g,o)}`});if(e[1]){v.div({text:`${e[1]}`,padding:[1,0,0,0]})}}));v.div()}else if(d.length){let e=null;if(s._){e=`${o} <${r("command")}>\n`}else{e=`${o} [${r("command")}]\n`}v.div(`${e}`)}}if(d.length>1||d.length===1&&!d[0][2]){v.div(r("Commands:"));const t=e.getInternalMethods().getContext();const n=t.commands.length?`${t.commands.join(" ")} `:"";if(e.getInternalMethods().getParserConfiguration()["sort-commands"]===true){d=d.sort(((e,t)=>e[0].localeCompare(t[0])))}const i=o?`${o} `:"";d.forEach((e=>{const t=`${i}${n}${e[0].replace(/^\$0 ?/,"")}`;v.span({text:t,padding:[0,2,0,2],width:maxWidth(d,b,`${o}${n}`)+4},{text:e[1]});const s=[];if(e[2])s.push(`[${r("default")}]`);if(e[3]&&e[3].length){s.push(`[${r("aliases:")} ${e[3].join(", ")}]`)}if(e[4]){if(typeof e[4]==="string"){s.push(`[${r("deprecated: %s",e[4])}]`)}else{s.push(`[${r("deprecated")}]`)}}if(s.length){v.div({text:s.join(" "),padding:[0,0,0,2],align:"right"})}else{v.div()}}));v.div()}const E=(Object.keys(m.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter((t=>!e.parsed.newAliases[t]&&E.every((e=>(m.alias[e]||[]).indexOf(t)===-1))));const w=r("Options:");if(!u[w])u[w]=[];addUngroupedKeys(g,m.alias,u,w);const isLongSwitch=e=>/^--/.test(getText(e));const F=Object.keys(u).filter((e=>u[e].length>0)).map((e=>{const t=u[e].filter(filterHiddenOptions).map((e=>{if(E.includes(e))return e;for(let t=0,r;(r=E[t])!==undefined;t++){if((m.alias[r]||[]).includes(e))return r}return e}));return{groupName:e,normalizedKeys:t}})).filter((({normalizedKeys:e})=>e.length>0)).map((({groupName:e,normalizedKeys:t})=>{const r=t.reduce(((t,r)=>{t[r]=[r].concat(m.alias[r]||[]).map((t=>{if(e===n.getPositionalGroupName())return t;else{return(/^[0-9]$/.test(t)?m.boolean.includes(r)?"-":"--":t.length>1?"--":"-")+t}})).sort(((e,t)=>isLongSwitch(e)===isLongSwitch(t)?0:isLongSwitch(e)?1:-1)).join(", ");return t}),{});return{groupName:e,normalizedKeys:t,switches:r}}));const C=F.filter((({groupName:e})=>e!==n.getPositionalGroupName())).some((({normalizedKeys:e,switches:t})=>!e.every((e=>isLongSwitch(t[e])))));if(C){F.filter((({groupName:e})=>e!==n.getPositionalGroupName())).forEach((({normalizedKeys:e,switches:t})=>{e.forEach((e=>{if(isLongSwitch(t[e])){t[e]=addIndentation(t[e],"-x, ".length)}}))}))}F.forEach((({groupName:t,normalizedKeys:o,switches:s})=>{v.div(t);o.forEach((t=>{const o=s[t];let u=p[t]||"";let c=null;if(u.includes(D))u=r(u.substring(D.length));if(m.boolean.includes(t))c=`[${r("boolean")}]`;if(m.count.includes(t))c=`[${r("count")}]`;if(m.string.includes(t))c=`[${r("string")}]`;if(m.normalize.includes(t))c=`[${r("string")}]`;if(m.array.includes(t))c=`[${r("array")}]`;if(m.number.includes(t))c=`[${r("number")}]`;const deprecatedExtra=e=>typeof e==="string"?`[${r("deprecated: %s",e)}]`:`[${r("deprecated")}]`;const l=[t in a?deprecatedExtra(a[t]):null,c,t in i?`[${r("required")}]`:null,m.choices&&m.choices[t]?`[${r("choices:")} ${n.stringifiedValues(m.choices[t])}]`:null,defaultString(m.default[t],m.defaultDescription[t])].filter(Boolean).join(" ");v.span({text:getText(o),padding:[0,2,0,2+getIndentation(o)],width:maxWidth(s,b)+4},u);const f=e.getInternalMethods().getUsageConfiguration()["hide-types"]===true;if(l&&!f)v.div({text:l,padding:[0,0,0,2],align:"right"});else v.div()}));v.div()}));if(f.length){v.div(r("Examples:"));f.forEach((e=>{e[0]=e[0].replace(/\$0/g,o)}));f.forEach((e=>{if(e[1]===""){v.div({text:e[0],padding:[0,2,0,2]})}else{v.div({text:e[0],padding:[0,2,0,2],width:maxWidth(f,b)+4},{text:e[1]})}}));v.div()}if(h.length>0){const e=h.map((e=>e.replace(/\$0/g,o))).join("\n");v.div(`${e}\n`)}return v.toString().replace(/\s*$/,"")};function maxWidth(e,r,n){let o=0;if(!Array.isArray(e)){e=Object.values(e).map((e=>[e]))}e.forEach((e=>{o=Math.max(t.stringWidth(n?`${n} ${getText(e[0])}`:getText(e[0]))+getIndentation(e[0]),o)}));if(r)o=Math.min(o,parseInt((r*.5).toString(),10));return o}function normalizeAliases(){const t=e.getDemandedOptions();const r=e.getOptions();(Object.keys(r.alias)||[]).forEach((o=>{r.alias[o].forEach((i=>{if(p[i])n.describe(o,p[i]);if(i in t)e.demandOption(o,t[i]);if(r.boolean.includes(i))e.boolean(o);if(r.count.includes(i))e.count(o);if(r.string.includes(i))e.string(o);if(r.normalize.includes(i))e.normalize(o);if(r.array.includes(i))e.array(o);if(r.number.includes(i))e.number(o)}))}))}let y;n.cacheHelpMessage=function(){y=this.help()};n.clearCachedHelpMessage=function(){y=undefined};n.hasCachedHelpMessage=function(){return!!y};function addUngroupedKeys(e,t,r,n){let o=[];let i=null;Object.keys(r).forEach((e=>{o=o.concat(r[e])}));e.forEach((e=>{i=[e].concat(t[e]);if(!i.some((e=>o.indexOf(e)!==-1))){r[n].push(e)}}));return o}function filterHiddenOptions(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}n.showHelp=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const o=typeof t==="function"?t:r[t];o(n.help())};n.functionDescription=e=>{const n=e.name?t.Parser.decamelize(e.name,"-"):r("generated-value");return["(",n,")"].join("")};n.stringifiedValues=function stringifiedValues(e,t){let r="";const n=t||", ";const o=[].concat(e);if(!e||!o.length)return r;o.forEach((e=>{if(r.length)r+=n;r+=JSON.stringify(e)}));return r};function defaultString(e,t){let n=`[${r("default:")} `;if(e===undefined&&!t)return null;if(t){n+=t}else{switch(typeof e){case"string":n+=`"${e}"`;break;case"object":n+=JSON.stringify(e);break;default:n+=e}}return`${n}]`}function windowWidth(){const e=80;if(t.process.stdColumns){return Math.min(e,t.process.stdColumns)}else{return e}}let b=null;n.version=e=>{b=e};n.showVersion=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const n=typeof t==="function"?t:r[t];n(b)};n.reset=function reset(e){i=null;u=false;c=[];l=false;h=[];f=[];d=[];p=objFilter(p,(t=>!e[t]));return n};const v=[];n.freeze=function freeze(){v.push({failMessage:i,failureOutput:u,usages:c,usageDisabled:l,epilogs:h,examples:f,commands:d,descriptions:p})};n.unfreeze=function unfreeze(e=false){const t=v.pop();if(!t)return;if(e){p={...t.descriptions,...p};d=[...t.commands,...d];c=[...t.usages,...c];f=[...t.examples,...f];h=[...t.epilogs,...h]}else{({failMessage:i,failureOutput:u,usages:c,usageDisabled:l,epilogs:h,examples:f,commands:d,descriptions:p}=t)}};return n}function isIndentedText(e){return typeof e==="object"}function addIndentation(e,t){return isIndentedText(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function getIndentation(e){return isIndentedText(e)?e.indentation:0}function getText(e){return isIndentedText(e)?e.text:e}const we=`###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="\${COMP_WORDS[COMP_CWORD]}"\n args=("\${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk\n mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")\n mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |\n awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')\n\n # if no match was found, fall back to filename completion\n if [ \${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n`;const Fe=`#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))\n IFS=$si\n if [[ \${#reply} -gt 0 ]]; then\n _describe 'values' reply\n else\n _default\n fi\n}\nif [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then\n _{{app_name}}_yargs_completions "$@"\nelse\n compdef _{{app_name}}_yargs_completions {{app_name}}\nfi\n###-end-{{app_name}}-completions-###\n`;class Completion{constructor(e,t,r,n){var o,i,s;this.yargs=e;this.usage=t;this.command=r;this.shim=n;this.completionKey="get-yargs-completions";this.aliases=null;this.customCompletionFunction=null;this.indexAfterLastReset=0;this.zshShell=(s=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((i=this.shim.getEnv("ZSH_NAME"))===null||i===void 0?void 0:i.includes("zsh")))!==null&&s!==void 0?s:false}defaultCompletion(e,t,r,n){const o=this.command.getCommandHandlers();for(let t=0,r=e.length;t<r;++t){if(o[e[t]]&&o[e[t]].builder){const r=o[e[t]].builder;if(isCommandBuilderCallback(r)){this.indexAfterLastReset=t+1;const e=this.yargs.getInternalMethods().reset();r(e,true);return e.argv}}}const i=[];this.commandCompletions(i,e,r);this.optionCompletions(i,e,t,r);this.choicesFromOptionsCompletions(i,e,t,r);this.choicesFromPositionalsCompletions(i,e,t,r);n(null,i)}commandCompletions(e,t,r){const n=this.yargs.getInternalMethods().getContext().commands;if(!r.match(/^-/)&&n[n.length-1]!==r&&!this.previousArgHasChoices(t)){this.usage.getCommands().forEach((r=>{const n=parseCommand(r[0]).cmd;if(t.indexOf(n)===-1){if(!this.zshShell){e.push(n)}else{const t=r[1]||"";e.push(n.replace(/:/g,"\\:")+":"+t)}}}))}}optionCompletions(e,t,r,n){if((n.match(/^-/)||n===""&&e.length===0)&&!this.previousArgHasChoices(t)){const r=this.yargs.getOptions();const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(r.key).forEach((i=>{const s=!!r.configuration["boolean-negation"]&&r.boolean.includes(i);const a=o.includes(i);if(!a&&!r.hiddenOptions.includes(i)&&!this.argsContainKey(t,i,s)){this.completeOptionKey(i,e,n,s&&!!r.default[i])}}))}}choicesFromOptionsCompletions(e,t,r,n){if(this.previousArgHasChoices(t)){const r=this.getPreviousArgChoices(t);if(r&&r.length>0){e.push(...r.map((e=>e.replace(/:/g,"\\:"))))}}}choicesFromPositionalsCompletions(e,t,r,n){if(n===""&&e.length>0&&this.previousArgHasChoices(t)){return}const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];const i=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1);const s=o[r._.length-i-1];if(!s){return}const a=this.yargs.getOptions().choices[s]||[];for(const t of a){if(t.startsWith(n)){e.push(t.replace(/:/g,"\\:"))}}}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1];let r="";if(!t.startsWith("-")&&e.length>1){r=t;t=e[e.length-2]}if(!t.startsWith("-"))return;const n=t.replace(/^-+/,"");const o=this.yargs.getOptions();const i=[n,...this.yargs.getAliases()[n]||[]];let s;for(const e of i){if(Object.prototype.hasOwnProperty.call(o.key,e)&&Array.isArray(o.choices[e])){s=o.choices[e];break}}if(s){return s.filter((e=>!r||e.startsWith(r)))}}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==undefined&&t.length>0}argsContainKey(e,t,r){const argsContains=t=>e.indexOf((/^[^0-9]$/.test(t)?"-":"--")+t)!==-1;if(argsContains(t))return true;if(r&&argsContains(`no-${t}`))return true;if(this.aliases){for(const e of this.aliases[t]){if(argsContains(e))return true}}return false}completeOptionKey(e,t,r,n){var o,i,s,a;let u=e;if(this.zshShell){const t=this.usage.getDescriptions();const r=(i=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||i===void 0?void 0:i.find((e=>{const r=t[e];return typeof r==="string"&&r.length>0}));const n=r?t[r]:undefined;const c=(a=(s=t[e])!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:"";u=`${e.replace(/:/g,"\\:")}:${c.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const startsByTwoDashes=e=>/^--/.test(e);const isShortOption=e=>/^[^0-9]$/.test(e);const c=!startsByTwoDashes(r)&&isShortOption(e)?"-":"--";t.push(c+u);if(n){t.push(c+"no-"+u)}}customCompletion(e,t,r,n){assertNotStrictEqual(this.customCompletionFunction,null,this.shim);if(isSyncCompletionFunction(this.customCompletionFunction)){const e=this.customCompletionFunction(r,t);if(isPromise(e)){return e.then((e=>{this.shim.process.nextTick((()=>{n(null,e)}))})).catch((e=>{this.shim.process.nextTick((()=>{n(e,undefined)}))}))}return n(null,e)}else if(isFallbackCompletionFunction(this.customCompletionFunction)){return this.customCompletionFunction(r,t,((o=n)=>this.defaultCompletion(e,t,r,o)),(e=>{n(null,e)}))}else{return this.customCompletionFunction(r,t,(e=>{n(null,e)}))}}getCompletion(e,t){const r=e.length?e[e.length-1]:"";const n=this.yargs.parse(e,true);const o=this.customCompletionFunction?n=>this.customCompletion(e,n,r,t):n=>this.defaultCompletion(e,n,r,t);return isPromise(n)?n.then(o):o(n)}generateCompletionScript(e,t){let r=this.zshShell?Fe:we;const n=this.shim.path.basename(e);if(e.match(/\.js$/))e=`./${e}`;r=r.replace(/{{app_name}}/g,n);r=r.replace(/{{completion_command}}/g,t);return r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(e,t,r,n){return new Completion(e,t,r,n)}function isSyncCompletionFunction(e){return e.length<3}function isFallbackCompletionFunction(e){return e.length>3}function levenshtein(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const r=[];let n;for(n=0;n<=t.length;n++){r[n]=[n]}let o;for(o=0;o<=e.length;o++){r[0][o]=o}for(n=1;n<=t.length;n++){for(o=1;o<=e.length;o++){if(t.charAt(n-1)===e.charAt(o-1)){r[n][o]=r[n-1][o-1]}else{if(n>1&&o>1&&t.charAt(n-2)===e.charAt(o-1)&&t.charAt(n-1)===e.charAt(o-2)){r[n][o]=r[n-2][o-2]+1}else{r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1))}}}}return r[t.length][e.length]}const Ce=["$0","--","_"];function validation(e,t,r){const n=r.y18n.__;const o=r.y18n.__n;const i={};i.nonOptionCount=function nonOptionCount(r){const n=e.getDemandedCommands();const i=r._.length+(r["--"]?r["--"].length:0);const s=i-e.getInternalMethods().getContext().commands.length;if(n._&&(s<n._.min||s>n._.max)){if(s<n._.min){if(n._.minMsg!==undefined){t.fail(n._.minMsg?n._.minMsg.replace(/\$0/g,s.toString()).replace(/\$1/,n._.min.toString()):null)}else{t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s.toString(),n._.min.toString()))}}else if(s>n._.max){if(n._.maxMsg!==undefined){t.fail(n._.maxMsg?n._.maxMsg.replace(/\$0/g,s.toString()).replace(/\$1/,n._.max.toString()):null)}else{t.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",s,s.toString(),n._.max.toString()))}}}};i.positionalCount=function positionalCount(e,r){if(r<e){t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r+"",e+""))}};i.requiredArguments=function requiredArguments(e,r){let n=null;for(const t of Object.keys(r)){if(!Object.prototype.hasOwnProperty.call(e,t)||typeof e[t]==="undefined"){n=n||{};n[t]=r[t]}}if(n){const e=[];for(const t of Object.keys(n)){const r=n[t];if(r&&e.indexOf(r)<0){e.push(r)}}const r=e.length?`\n${e.join("\n")}`:"";t.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(n).length,Object.keys(n).join(", ")+r))}};i.unknownArguments=function unknownArguments(r,n,s,a,u=true){var c;const l=e.getInternalMethods().getCommandInstance().getCommands();const f=[];const d=e.getInternalMethods().getContext();Object.keys(r).forEach((t=>{if(!Ce.includes(t)&&!Object.prototype.hasOwnProperty.call(s,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!i.isValidAndSomeAliasIsNotNew(t,n)){f.push(t)}}));if(u&&(d.commands.length>0||l.length>0||a)){r._.slice(d.commands.length).forEach((e=>{if(!l.includes(""+e)){f.push(""+e)}}))}if(u){const t=e.getDemandedCommands();const n=((c=t._)===null||c===void 0?void 0:c.max)||0;const o=d.commands.length+n;if(o<r._.length){r._.slice(o).forEach((e=>{e=String(e);if(!d.commands.includes(e)&&!f.includes(e)){f.push(e)}}))}}if(f.length){t.fail(o("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((e=>e.trim()?e:`"${e}"`)).join(", ")))}};i.unknownCommands=function unknownCommands(r){const n=e.getInternalMethods().getCommandInstance().getCommands();const i=[];const s=e.getInternalMethods().getContext();if(s.commands.length>0||n.length>0){r._.slice(s.commands.length).forEach((e=>{if(!n.includes(""+e)){i.push(""+e)}}))}if(i.length>0){t.fail(o("Unknown command: %s","Unknown commands: %s",i.length,i.join(", ")));return true}else{return false}};i.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(t,r){if(!Object.prototype.hasOwnProperty.call(r,t)){return false}const n=e.parsed.newAliases;return[t,...r[t]].some((e=>!Object.prototype.hasOwnProperty.call(n,e)||!n[t]))};i.limitedChoices=function limitedChoices(r){const o=e.getOptions();const i={};if(!Object.keys(o.choices).length)return;Object.keys(r).forEach((e=>{if(Ce.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(o.choices,e)){[].concat(r[e]).forEach((t=>{if(o.choices[e].indexOf(t)===-1&&t!==undefined){i[e]=(i[e]||[]).concat(t)}}))}}));const s=Object.keys(i);if(!s.length)return;let a=n("Invalid values:");s.forEach((e=>{a+=`\n ${n("Argument: %s, Given: %s, Choices: %s",e,t.stringifiedValues(i[e]),t.stringifiedValues(o.choices[e]))}`}));t.fail(a)};let s={};i.implies=function implies(t,n){argsert("<string|object> [array|number|string]",[t,n],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.implies(e,t[e])}))}else{e.global(t);if(!s[t]){s[t]=[]}if(Array.isArray(n)){n.forEach((e=>i.implies(t,e)))}else{assertNotStrictEqual(n,undefined,r);s[t].push(n)}}};i.getImplied=function getImplied(){return s};function keyExists(e,t){const r=Number(t);t=isNaN(r)?t:r;if(typeof t==="number"){t=e._.length>=t}else if(t.match(/^--no-.+/)){t=t.match(/^--no-(.+)/)[1];t=!Object.prototype.hasOwnProperty.call(e,t)}else{t=Object.prototype.hasOwnProperty.call(e,t)}return t}i.implications=function implications(e){const r=[];Object.keys(s).forEach((t=>{const n=t;(s[t]||[]).forEach((t=>{let o=n;const i=t;o=keyExists(e,o);t=keyExists(e,t);if(o&&!t){r.push(` ${n} -> ${i}`)}}))}));if(r.length){let e=`${n("Implications failed:")}\n`;r.forEach((t=>{e+=t}));t.fail(e)}};let a={};i.conflicts=function conflicts(t,r){argsert("<string|object> [array|string]",[t,r],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.conflicts(e,t[e])}))}else{e.global(t);if(!a[t]){a[t]=[]}if(Array.isArray(r)){r.forEach((e=>i.conflicts(t,e)))}else{a[t].push(r)}}};i.getConflicting=()=>a;i.conflicting=function conflictingFn(o){Object.keys(o).forEach((e=>{if(a[e]){a[e].forEach((r=>{if(r&&o[e]!==undefined&&o[r]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,r))}}))}}));if(e.getInternalMethods().getParserConfiguration()["strip-dashed"]){Object.keys(a).forEach((e=>{a[e].forEach((i=>{if(i&&o[r.Parser.camelCase(e)]!==undefined&&o[r.Parser.camelCase(i)]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,i))}}))}))}};i.recommendCommands=function recommendCommands(e,r){const o=3;r=r.sort(((e,t)=>t.length-e.length));let i=null;let s=Infinity;for(let t=0,n;(n=r[t])!==undefined;t++){const t=levenshtein(e,n);if(t<=o&&t<s){s=t;i=n}}if(i)t.fail(n("Did you mean %s?",i))};i.reset=function reset(e){s=objFilter(s,(t=>!e[t]));a=objFilter(a,(t=>!e[t]));return i};const u=[];i.freeze=function freeze(){u.push({implied:s,conflicting:a})};i.unfreeze=function unfreeze(){const e=u.pop();assertNotStrictEqual(e,undefined,r);({implied:s,conflicting:a}=e)};return i}let Ae=[];let Oe;function applyExtends(e,t,r,n){Oe=n;let o={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!=="string")return o;const i=/\.json|\..*rc$/.test(e.extends);let s=null;if(!i){try{s=import.meta.resolve(e.extends)}catch(t){return e}}else{s=getPathToDefaultConfig(t,e.extends)}checkForCircularExtends(s);Ae.push(s);o=i?JSON.parse(Oe.readFileSync(s,"utf8")):n.require(e.extends);delete e.extends;o=applyExtends(o,Oe.path.dirname(s),r,Oe)}Ae=[];return r?mergeDeep(o,e):Object.assign({},o,e)}function checkForCircularExtends(e){if(Ae.indexOf(e)>-1){throw new YError(`Circular extended configurations: '${e}'.`)}}function getPathToDefaultConfig(e,t){return Oe.path.resolve(e,t)}function mergeDeep(e,t){const r={};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}Object.assign(r,e);for(const n of Object.keys(t)){if(isObject(t[n])&&isObject(r[n])){r[n]=mergeDeep(e[n],t[n])}else{r[n]=t[n]}}return r}var Se=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r};var je=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var ke,xe,Ie,Pe,_e,Te,Ne,Be,Re,Me,Ue,Le,$e,We,Ke,ze,Ge,He,Ve,Je,qe,Ye,Xe,Qe,Ze,et,tt,rt,nt,ot,it,st,at,ut,ct;function YargsFactory(e){return(t=[],r=e.process.cwd(),n)=>{const o=new YargsInstance(t,r,n,e);Object.defineProperty(o,"argv",{get:()=>o.parse(),enumerable:true});o.help();o.version();return o}}const lt=Symbol("copyDoubleDash");const ft=Symbol("copyDoubleDash");const dt=Symbol("deleteFromParserHintObject");const pt=Symbol("emitWarning");const ht=Symbol("freeze");const mt=Symbol("getDollarZero");const gt=Symbol("getParserConfiguration");const Dt=Symbol("getUsageConfiguration");const yt=Symbol("guessLocale");const bt=Symbol("guessVersion");const vt=Symbol("parsePositionalNumbers");const Et=Symbol("pkgUp");const wt=Symbol("populateParserHintArray");const Ft=Symbol("populateParserHintSingleValueDictionary");const Ct=Symbol("populateParserHintArrayDictionary");const At=Symbol("populateParserHintDictionary");const Ot=Symbol("sanitizeKey");const St=Symbol("setKey");const jt=Symbol("unfreeze");const kt=Symbol("validateAsync");const xt=Symbol("getCommandInstance");const It=Symbol("getContext");const Pt=Symbol("getHasOutput");const _t=Symbol("getLoggerInstance");const Tt=Symbol("getParseContext");const Nt=Symbol("getUsageInstance");const Bt=Symbol("getValidationInstance");const Rt=Symbol("hasParseCallback");const Mt=Symbol("isGlobalContext");const Ut=Symbol("postProcess");const Lt=Symbol("rebase");const $t=Symbol("reset");const Wt=Symbol("runYargsParserAndExecuteCommands");const Kt=Symbol("runValidation");const zt=Symbol("setHasOutput");const Gt=Symbol("kTrackManuallySetKeys");const Ht="en_US";class YargsInstance{constructor(e=[],t,r,n){this.customScriptName=false;this.parsed=false;ke.set(this,void 0);xe.set(this,void 0);Ie.set(this,{commands:[],fullCommands:[]});Pe.set(this,null);_e.set(this,null);Te.set(this,"show-hidden");Ne.set(this,null);Be.set(this,true);Re.set(this,{});Me.set(this,true);Ue.set(this,[]);Le.set(this,void 0);$e.set(this,{});We.set(this,false);Ke.set(this,null);ze.set(this,true);Ge.set(this,void 0);He.set(this,"");Ve.set(this,void 0);Je.set(this,void 0);qe.set(this,{});Ye.set(this,null);Xe.set(this,null);Qe.set(this,{});Ze.set(this,{});et.set(this,void 0);tt.set(this,false);rt.set(this,void 0);nt.set(this,false);ot.set(this,false);it.set(this,false);st.set(this,void 0);at.set(this,{});ut.set(this,null);ct.set(this,void 0);Se(this,rt,n,"f");Se(this,et,e,"f");Se(this,xe,t,"f");Se(this,Je,r,"f");Se(this,Le,new GlobalMiddleware(this),"f");this.$0=this[mt]();this[$t]();Se(this,ke,je(this,ke,"f"),"f");Se(this,st,je(this,st,"f"),"f");Se(this,ct,je(this,ct,"f"),"f");Se(this,Ve,je(this,Ve,"f"),"f");je(this,Ve,"f").showHiddenOpt=je(this,Te,"f");Se(this,Ge,this[ft](),"f");je(this,rt,"f").y18n.setLocale(Ht)}addHelpOpt(e,t){const r="help";argsert("[string|boolean] [string]",[e,t],arguments.length);if(je(this,Ke,"f")){this[dt](je(this,Ke,"f"));Se(this,Ke,null,"f")}if(e===false&&t===undefined)return this;Se(this,Ke,typeof e==="string"?e:r,"f");this.boolean(je(this,Ke,"f"));this.describe(je(this,Ke,"f"),t||je(this,st,"f").deferY18nLookup("Show help"));return this}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){argsert("[string|boolean] [string]",[e,t],arguments.length);if(e===false&&t===undefined)return this;const r=typeof e==="string"?e:je(this,Te,"f");this.boolean(r);this.describe(r,t||je(this,st,"f").deferY18nLookup("Show hidden options"));je(this,Ve,"f").showHiddenOpt=r;return this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[Ct](this.alias.bind(this),"alias",e,t);return this}array(e){argsert("<array|string>",[e],arguments.length);this[wt]("array",e);this[Gt](e);return this}boolean(e){argsert("<array|string>",[e],arguments.length);this[wt]("boolean",e);this[Gt](e);return this}check(e,t){argsert("<function> [boolean]",[e,t],arguments.length);this.middleware(((t,r)=>maybeAsyncResult((()=>e(t,r.getOptions())),(r=>{if(!r){je(this,st,"f").fail(je(this,rt,"f").y18n.__("Argument check failed: %s",e.toString()))}else if(typeof r==="string"||r instanceof Error){je(this,st,"f").fail(r.toString(),r)}return t}),(e=>{je(this,st,"f").fail(e.message?e.message:e.toString(),e);return t}))),false,t);return this}choices(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[Ct](this.choices.bind(this),"choices",e,t);return this}coerce(e,t){argsert("<object|string|array> [function]",[e,t],arguments.length);if(Array.isArray(e)){if(!t){throw new YError("coerce callback must be provided")}for(const r of e){this.coerce(r,t)}return this}else if(typeof e==="object"){for(const t of Object.keys(e)){this.coerce(t,e[t])}return this}if(!t){throw new YError("coerce callback must be provided")}const r=e;je(this,Ve,"f").key[r]=true;je(this,Le,"f").addCoerceMiddleware(((e,n)=>{var o;const i=(o=n.getAliases()[r])!==null&&o!==void 0?o:[];const s=[r,...i].filter((t=>Object.prototype.hasOwnProperty.call(e,t)));if(s.length===0){return e}return maybeAsyncResult((()=>t(e[s[0]])),(t=>{s.forEach((r=>{e[r]=t}));return e}),(e=>{throw new YError(e.message)}))}),r);return this}conflicts(e,t){argsert("<string|object> [string|array]",[e,t],arguments.length);je(this,ct,"f").conflicts(e,t);return this}config(e="config",t,r){argsert("[object|string] [string|function] [function]",[e,t,r],arguments.length);if(typeof e==="object"&&!Array.isArray(e)){e=applyExtends(e,je(this,xe,"f"),this[gt]()["deep-merge-config"]||false,je(this,rt,"f"));je(this,Ve,"f").configObjects=(je(this,Ve,"f").configObjects||[]).concat(e);return this}if(typeof t==="function"){r=t;t=undefined}this.describe(e,t||je(this,st,"f").deferY18nLookup("Path to JSON config file"));(Array.isArray(e)?e:[e]).forEach((e=>{je(this,Ve,"f").config[e]=r||true}));return this}completion(e,t,r){argsert("[string] [string|boolean|function] [function]",[e,t,r],arguments.length);if(typeof t==="function"){r=t;t=undefined}Se(this,_e,e||je(this,_e,"f")||"completion","f");if(!t&&t!==false){t="generate completion script"}this.command(je(this,_e,"f"),t);if(r)je(this,Pe,"f").registerFunction(r);return this}command(e,t,r,n,o,i){argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,r,n,o,i],arguments.length);je(this,ke,"f").addHandler(e,t,r,n,o,i);return this}commands(e,t,r,n,o,i){return this.command(e,t,r,n,o,i)}commandDir(e,t){argsert("<string> [object]",[e,t],arguments.length);const r=je(this,Je,"f")||je(this,rt,"f").require;je(this,ke,"f").addDirectory(e,r,je(this,rt,"f").getCallerFile(),t);return this}count(e){argsert("<array|string>",[e],arguments.length);this[wt]("count",e);this[Gt](e);return this}default(e,t,r){argsert("<object|string|array> [*] [string]",[e,t,r],arguments.length);if(r){assertSingleKey(e,je(this,rt,"f"));je(this,Ve,"f").defaultDescription[e]=r}if(typeof t==="function"){assertSingleKey(e,je(this,rt,"f"));if(!je(this,Ve,"f").defaultDescription[e])je(this,Ve,"f").defaultDescription[e]=je(this,st,"f").functionDescription(t);t=t.call()}this[Ft](this.default.bind(this),"default",e,t);return this}defaults(e,t,r){return this.default(e,t,r)}demandCommand(e=1,t,r,n){argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,r,n],arguments.length);if(typeof t!=="number"){r=t;t=Infinity}this.global("_",false);je(this,Ve,"f").demandedCommands._={min:e,max:t,minMsg:r,maxMsg:n};return this}demand(e,t,r){if(Array.isArray(t)){t.forEach((e=>{assertNotStrictEqual(r,true,je(this,rt,"f"));this.demandOption(e,r)}));t=Infinity}else if(typeof t!=="number"){r=t;t=Infinity}if(typeof e==="number"){assertNotStrictEqual(r,true,je(this,rt,"f"));this.demandCommand(e,t,r,r)}else if(Array.isArray(e)){e.forEach((e=>{assertNotStrictEqual(r,true,je(this,rt,"f"));this.demandOption(e,r)}))}else{if(typeof r==="string"){this.demandOption(e,r)}else if(r===true||typeof r==="undefined"){this.demandOption(e)}}return this}demandOption(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[Ft](this.demandOption.bind(this),"demandedOptions",e,t);return this}deprecateOption(e,t){argsert("<string> [string|boolean]",[e,t],arguments.length);je(this,Ve,"f").deprecatedOptions[e]=t;return this}describe(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[St](e,true);je(this,st,"f").describe(e,t);return this}detectLocale(e){argsert("<boolean>",[e],arguments.length);Se(this,Be,e,"f");return this}env(e){argsert("[string|boolean]",[e],arguments.length);if(e===false)delete je(this,Ve,"f").envPrefix;else je(this,Ve,"f").envPrefix=e||"";return this}epilogue(e){argsert("<string>",[e],arguments.length);je(this,st,"f").epilog(e);return this}epilog(e){return this.epilogue(e)}example(e,t){argsert("<string|array> [string]",[e,t],arguments.length);if(Array.isArray(e)){e.forEach((e=>this.example(...e)))}else{je(this,st,"f").example(e,t)}return this}exit(e,t){Se(this,We,true,"f");Se(this,Ne,t,"f");if(je(this,Me,"f"))je(this,rt,"f").process.exit(e)}exitProcess(e=true){argsert("[boolean]",[e],arguments.length);Se(this,Me,e,"f");return this}fail(e){argsert("<function|boolean>",[e],arguments.length);if(typeof e==="boolean"&&e!==false){throw new YError("Invalid first argument. Expected function or boolean 'false'")}je(this,st,"f").failFn(e);return this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){argsert("<array> [function]",[e,t],arguments.length);if(!t){return new Promise(((t,r)=>{je(this,Pe,"f").getCompletion(e,((e,n)=>{if(e)r(e);else t(n)}))}))}else{return je(this,Pe,"f").getCompletion(e,t)}}getDemandedOptions(){argsert([],0);return je(this,Ve,"f").demandedOptions}getDemandedCommands(){argsert([],0);return je(this,Ve,"f").demandedCommands}getDeprecatedOptions(){argsert([],0);return je(this,Ve,"f").deprecatedOptions}getDetectLocale(){return je(this,Be,"f")}getExitProcess(){return je(this,Me,"f")}getGroups(){return Object.assign({},je(this,$e,"f"),je(this,Ze,"f"))}getHelp(){Se(this,We,true,"f");if(!je(this,st,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Wt](je(this,et,"f"),undefined,undefined,0,true);if(isPromise(e)){return e.then((()=>je(this,st,"f").help()))}}const e=je(this,ke,"f").runDefaultBuilderOn(this);if(isPromise(e)){return e.then((()=>je(this,st,"f").help()))}}return Promise.resolve(je(this,st,"f").help())}getOptions(){return je(this,Ve,"f")}getStrict(){return je(this,nt,"f")}getStrictCommands(){return je(this,ot,"f")}getStrictOptions(){return je(this,it,"f")}global(e,t){argsert("<string|array> [boolean]",[e,t],arguments.length);e=[].concat(e);if(t!==false){je(this,Ve,"f").local=je(this,Ve,"f").local.filter((t=>e.indexOf(t)===-1))}else{e.forEach((e=>{if(!je(this,Ve,"f").local.includes(e))je(this,Ve,"f").local.push(e)}))}return this}group(e,t){argsert("<string|array> <string>",[e,t],arguments.length);const r=je(this,Ze,"f")[t]||je(this,$e,"f")[t];if(je(this,Ze,"f")[t]){delete je(this,Ze,"f")[t]}const n={};je(this,$e,"f")[t]=(r||[]).concat(e).filter((e=>{if(n[e])return false;return n[e]=true}));return this}hide(e){argsert("<string>",[e],arguments.length);je(this,Ve,"f").hiddenOptions.push(e);return this}implies(e,t){argsert("<string|object> [number|string|array]",[e,t],arguments.length);je(this,ct,"f").implies(e,t);return this}locale(e){argsert("[string]",[e],arguments.length);if(e===undefined){this[yt]();return je(this,rt,"f").y18n.getLocale()}Se(this,Be,false,"f");je(this,rt,"f").y18n.setLocale(e);return this}middleware(e,t,r){return je(this,Le,"f").addMiddleware(e,!!t,r)}nargs(e,t){argsert("<string|object|array> [number]",[e,t],arguments.length);this[Ft](this.nargs.bind(this),"narg",e,t);return this}normalize(e){argsert("<array|string>",[e],arguments.length);this[wt]("normalize",e);return this}number(e){argsert("<array|string>",[e],arguments.length);this[wt]("number",e);this[Gt](e);return this}option(e,t){argsert("<string|object> [object]",[e,t],arguments.length);if(typeof e==="object"){Object.keys(e).forEach((t=>{this.options(t,e[t])}))}else{if(typeof t!=="object"){t={}}this[Gt](e);if(je(this,ut,"f")&&(e==="version"||(t===null||t===void 0?void 0:t.alias)==="version")){this[pt](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),undefined,"versionWarning")}je(this,Ve,"f").key[e]=true;if(t.alias)this.alias(e,t.alias);const r=t.deprecate||t.deprecated;if(r){this.deprecateOption(e,r)}const n=t.demand||t.required||t.require;if(n){this.demand(e,n)}if(t.demandOption){this.demandOption(e,typeof t.demandOption==="string"?t.demandOption:undefined)}if(t.conflicts){this.conflicts(e,t.conflicts)}if("default"in t){this.default(e,t.default)}if(t.implies!==undefined){this.implies(e,t.implies)}if(t.nargs!==undefined){this.nargs(e,t.nargs)}if(t.config){this.config(e,t.configParser)}if(t.normalize){this.normalize(e)}if(t.choices){this.choices(e,t.choices)}if(t.coerce){this.coerce(e,t.coerce)}if(t.group){this.group(e,t.group)}if(t.boolean||t.type==="boolean"){this.boolean(e);if(t.alias)this.boolean(t.alias)}if(t.array||t.type==="array"){this.array(e);if(t.alias)this.array(t.alias)}if(t.number||t.type==="number"){this.number(e);if(t.alias)this.number(t.alias)}if(t.string||t.type==="string"){this.string(e);if(t.alias)this.string(t.alias)}if(t.count||t.type==="count"){this.count(e)}if(typeof t.global==="boolean"){this.global(e,t.global)}if(t.defaultDescription){je(this,Ve,"f").defaultDescription[e]=t.defaultDescription}if(t.skipValidation){this.skipValidation(e)}const o=t.describe||t.description||t.desc;const i=je(this,st,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(i,e)||typeof o==="string"){this.describe(e,o)}if(t.hidden){this.hide(e)}if(t.requiresArg){this.requiresArg(e)}}return this}options(e,t){return this.option(e,t)}parse(e,t,r){argsert("[string|array] [function|boolean|object] [function]",[e,t,r],arguments.length);this[ht]();if(typeof e==="undefined"){e=je(this,et,"f")}if(typeof t==="object"){Se(this,Xe,t,"f");t=r}if(typeof t==="function"){Se(this,Ye,t,"f");t=false}if(!t)Se(this,et,e,"f");if(je(this,Ye,"f"))Se(this,Me,false,"f");const n=this[Wt](e,!!t);const o=this.parsed;je(this,Pe,"f").setParsed(this.parsed);if(isPromise(n)){return n.then((e=>{if(je(this,Ye,"f"))je(this,Ye,"f").call(this,je(this,Ne,"f"),e,je(this,He,"f"));return e})).catch((e=>{if(je(this,Ye,"f")){je(this,Ye,"f")(e,this.parsed.argv,je(this,He,"f"))}throw e})).finally((()=>{this[jt]();this.parsed=o}))}else{if(je(this,Ye,"f"))je(this,Ye,"f").call(this,je(this,Ne,"f"),n,je(this,He,"f"));this[jt]();this.parsed=o}return n}parseAsync(e,t,r){const n=this.parse(e,t,r);return!isPromise(n)?Promise.resolve(n):n}parseSync(e,t,r){const n=this.parse(e,t,r);if(isPromise(n)){throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware")}return n}parserConfiguration(e){argsert("<object>",[e],arguments.length);Se(this,qe,e,"f");return this}pkgConf(e,t){argsert("<string> [string]",[e,t],arguments.length);let r=null;const n=this[Et](t||je(this,xe,"f"));if(n[e]&&typeof n[e]==="object"){r=applyExtends(n[e],t||je(this,xe,"f"),this[gt]()["deep-merge-config"]||false,je(this,rt,"f"));je(this,Ve,"f").configObjects=(je(this,Ve,"f").configObjects||[]).concat(r)}return this}positional(e,t){argsert("<string> <object>",[e,t],arguments.length);const r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,((e,t)=>{if(e==="type"&&!["string","number","boolean"].includes(t))return false;return r.includes(e)}));const n=je(this,Ie,"f").fullCommands[je(this,Ie,"f").fullCommands.length-1];const o=n?je(this,ke,"f").cmdToParseOptions(n):{array:[],alias:{},default:{},demand:{}};objectKeys(o).forEach((r=>{const n=o[r];if(Array.isArray(n)){if(n.indexOf(e)!==-1)t[r]=true}else{if(n[e]&&!(r in t))t[r]=n[e]}}));this.group(e,je(this,st,"f").getPositionalGroupName());return this.option(e,t)}recommendCommands(e=true){argsert("[boolean]",[e],arguments.length);Se(this,tt,e,"f");return this}required(e,t,r){return this.demand(e,t,r)}require(e,t,r){return this.demand(e,t,r)}requiresArg(e){argsert("<array|string|object> [number]",[e],arguments.length);if(typeof e==="string"&&je(this,Ve,"f").narg[e]){return this}else{this[Ft](this.requiresArg.bind(this),"narg",e,NaN)}return this}showCompletionScript(e,t){argsert("[string] [string]",[e,t],arguments.length);e=e||this.$0;je(this,Ge,"f").log(je(this,Pe,"f").generateCompletionScript(e,t||je(this,_e,"f")||"completion"));return this}showHelp(e){argsert("[string|function]",[e],arguments.length);Se(this,We,true,"f");if(!je(this,st,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Wt](je(this,et,"f"),undefined,undefined,0,true);if(isPromise(t)){t.then((()=>{je(this,st,"f").showHelp(e)}));return this}}const t=je(this,ke,"f").runDefaultBuilderOn(this);if(isPromise(t)){t.then((()=>{je(this,st,"f").showHelp(e)}));return this}}je(this,st,"f").showHelp(e);return this}scriptName(e){this.customScriptName=true;this.$0=e;return this}showHelpOnFail(e,t){argsert("[boolean|string] [string]",[e,t],arguments.length);je(this,st,"f").showHelpOnFail(e,t);return this}showVersion(e){argsert("[string|function]",[e],arguments.length);je(this,st,"f").showVersion(e);return this}skipValidation(e){argsert("<array|string>",[e],arguments.length);this[wt]("skipValidation",e);return this}strict(e){argsert("[boolean]",[e],arguments.length);Se(this,nt,e!==false,"f");return this}strictCommands(e){argsert("[boolean]",[e],arguments.length);Se(this,ot,e!==false,"f");return this}strictOptions(e){argsert("[boolean]",[e],arguments.length);Se(this,it,e!==false,"f");return this}string(e){argsert("<array|string>",[e],arguments.length);this[wt]("string",e);this[Gt](e);return this}terminalWidth(){argsert([],0);return je(this,rt,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){argsert("<object>",[e],arguments.length);Se(this,Be,false,"f");je(this,rt,"f").y18n.updateLocale(e);return this}usage(e,t,r,n){argsert("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,r,n],arguments.length);if(t!==undefined){assertNotStrictEqual(e,null,je(this,rt,"f"));if((e||"").match(/^\$0( |$)/)){return this.command(e,t,r,n)}else{throw new YError(".usage() description must start with $0 if being used as alias for .command()")}}else{je(this,st,"f").usage(e);return this}}usageConfiguration(e){argsert("<object>",[e],arguments.length);Se(this,at,e,"f");return this}version(e,t,r){const n="version";argsert("[boolean|string] [string] [string]",[e,t,r],arguments.length);if(je(this,ut,"f")){this[dt](je(this,ut,"f"));je(this,st,"f").version(undefined);Se(this,ut,null,"f")}if(arguments.length===0){r=this[bt]();e=n}else if(arguments.length===1){if(e===false){return this}r=e;e=n}else if(arguments.length===2){r=t;t=undefined}Se(this,ut,typeof e==="string"?e:n,"f");t=t||je(this,st,"f").deferY18nLookup("Show version number");je(this,st,"f").version(r||undefined);this.boolean(je(this,ut,"f"));this.describe(je(this,ut,"f"),t);return this}wrap(e){argsert("<number|null|undefined>",[e],arguments.length);je(this,st,"f").wrap(e);return this}[(ke=new WeakMap,xe=new WeakMap,Ie=new WeakMap,Pe=new WeakMap,_e=new WeakMap,Te=new WeakMap,Ne=new WeakMap,Be=new WeakMap,Re=new WeakMap,Me=new WeakMap,Ue=new WeakMap,Le=new WeakMap,$e=new WeakMap,We=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Ge=new WeakMap,He=new WeakMap,Ve=new WeakMap,Je=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,Qe=new WeakMap,Ze=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,nt=new WeakMap,ot=new WeakMap,it=new WeakMap,st=new WeakMap,at=new WeakMap,ut=new WeakMap,ct=new WeakMap,lt)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch(e){}return e}[ft](){return{log:(...e)=>{if(!this[Rt]())console.log(...e);Se(this,We,true,"f");if(je(this,He,"f").length)Se(this,He,je(this,He,"f")+"\n","f");Se(this,He,je(this,He,"f")+e.join(" "),"f")},error:(...e)=>{if(!this[Rt]())console.error(...e);Se(this,We,true,"f");if(je(this,He,"f").length)Se(this,He,je(this,He,"f")+"\n","f");Se(this,He,je(this,He,"f")+e.join(" "),"f")}}}[dt](e){objectKeys(je(this,Ve,"f")).forEach((t=>{if((e=>e==="configObjects")(t))return;const r=je(this,Ve,"f")[t];if(Array.isArray(r)){if(r.includes(e))r.splice(r.indexOf(e),1)}else if(typeof r==="object"){delete r[e]}}));delete je(this,st,"f").getDescriptions()[e]}[pt](e,t,r){if(!je(this,Re,"f")[r]){je(this,rt,"f").process.emitWarning(e,t);je(this,Re,"f")[r]=true}}[ht](){je(this,Ue,"f").push({options:je(this,Ve,"f"),configObjects:je(this,Ve,"f").configObjects.slice(0),exitProcess:je(this,Me,"f"),groups:je(this,$e,"f"),strict:je(this,nt,"f"),strictCommands:je(this,ot,"f"),strictOptions:je(this,it,"f"),completionCommand:je(this,_e,"f"),output:je(this,He,"f"),exitError:je(this,Ne,"f"),hasOutput:je(this,We,"f"),parsed:this.parsed,parseFn:je(this,Ye,"f"),parseContext:je(this,Xe,"f")});je(this,st,"f").freeze();je(this,ct,"f").freeze();je(this,ke,"f").freeze();je(this,Le,"f").freeze()}[mt](){let e="";let t;if(/\b(node|iojs|electron)(\.exe)?$/.test(je(this,rt,"f").process.argv()[0])){t=je(this,rt,"f").process.argv().slice(1,2)}else{t=je(this,rt,"f").process.argv().slice(0,1)}e=t.map((e=>{const t=this[Lt](je(this,xe,"f"),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e})).join(" ").trim();if(je(this,rt,"f").getEnv("_")&&je(this,rt,"f").getProcessArgvBin()===je(this,rt,"f").getEnv("_")){e=je(this,rt,"f").getEnv("_").replace(`${je(this,rt,"f").path.dirname(je(this,rt,"f").process.execPath())}/`,"")}return e}[gt](){return je(this,qe,"f")}[Dt](){return je(this,at,"f")}[yt](){if(!je(this,Be,"f"))return;const e=je(this,rt,"f").getEnv("LC_ALL")||je(this,rt,"f").getEnv("LC_MESSAGES")||je(this,rt,"f").getEnv("LANG")||je(this,rt,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[bt](){const e=this[Et]();return e.version||"unknown"}[vt](e){const t=e["--"]?e["--"]:e._;for(let e=0,r;(r=t[e])!==undefined;e++){if(je(this,rt,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))){t[e]=Number(r)}}return e}[Et](e){const t=e||"*";if(je(this,Qe,"f")[t])return je(this,Qe,"f")[t];let r={};try{let t=e||je(this,rt,"f").mainFilename;if(je(this,rt,"f").path.extname(t)){t=je(this,rt,"f").path.dirname(t)}const n=je(this,rt,"f").findUp(t,((e,t)=>{if(t.includes("package.json")){return"package.json"}else{return undefined}}));assertNotStrictEqual(n,undefined,je(this,rt,"f"));r=JSON.parse(je(this,rt,"f").readFileSync(n,"utf8"))}catch(e){}je(this,Qe,"f")[t]=r||{};return je(this,Qe,"f")[t]}[wt](e,t){t=[].concat(t);t.forEach((t=>{t=this[Ot](t);je(this,Ve,"f")[e].push(t)}))}[Ft](e,t,r,n){this[At](e,t,r,n,((e,t,r)=>{je(this,Ve,"f")[e][t]=r}))}[Ct](e,t,r,n){this[At](e,t,r,n,((e,t,r)=>{je(this,Ve,"f")[e][t]=(je(this,Ve,"f")[e][t]||[]).concat(r)}))}[At](e,t,r,n,o){if(Array.isArray(r)){r.forEach((t=>{e(t,n)}))}else if((e=>typeof e==="object")(r)){for(const t of objectKeys(r)){e(t,r[t])}}else{o(t,this[Ot](r),n)}}[Ot](e){if(e==="__proto__")return"___proto___";return e}[St](e,t){this[Ft](this[St].bind(this),"key",e,t);return this}[jt](){var e,t,r,n,o,i,s,a,u,c,l,f;const d=je(this,Ue,"f").pop();assertNotStrictEqual(d,undefined,je(this,rt,"f"));let p;e=this,t=this,r=this,n=this,o=this,i=this,s=this,a=this,u=this,c=this,l=this,f=this,({options:{set value(t){Se(e,Ve,t,"f")}}.value,configObjects:p,exitProcess:{set value(e){Se(t,Me,e,"f")}}.value,groups:{set value(e){Se(r,$e,e,"f")}}.value,output:{set value(e){Se(n,He,e,"f")}}.value,exitError:{set value(e){Se(o,Ne,e,"f")}}.value,hasOutput:{set value(e){Se(i,We,e,"f")}}.value,parsed:this.parsed,strict:{set value(e){Se(s,nt,e,"f")}}.value,strictCommands:{set value(e){Se(a,ot,e,"f")}}.value,strictOptions:{set value(e){Se(u,it,e,"f")}}.value,completionCommand:{set value(e){Se(c,_e,e,"f")}}.value,parseFn:{set value(e){Se(l,Ye,e,"f")}}.value,parseContext:{set value(e){Se(f,Xe,e,"f")}}.value}=d);je(this,Ve,"f").configObjects=p;je(this,st,"f").unfreeze();je(this,ct,"f").unfreeze();je(this,ke,"f").unfreeze();je(this,Le,"f").unfreeze()}[kt](e,t){return maybeAsyncResult(t,(t=>{e(t);return t}))}getInternalMethods(){return{getCommandInstance:this[xt].bind(this),getContext:this[It].bind(this),getHasOutput:this[Pt].bind(this),getLoggerInstance:this[_t].bind(this),getParseContext:this[Tt].bind(this),getParserConfiguration:this[gt].bind(this),getUsageConfiguration:this[Dt].bind(this),getUsageInstance:this[Nt].bind(this),getValidationInstance:this[Bt].bind(this),hasParseCallback:this[Rt].bind(this),isGlobalContext:this[Mt].bind(this),postProcess:this[Ut].bind(this),reset:this[$t].bind(this),runValidation:this[Kt].bind(this),runYargsParserAndExecuteCommands:this[Wt].bind(this),setHasOutput:this[zt].bind(this)}}[xt](){return je(this,ke,"f")}[It](){return je(this,Ie,"f")}[Pt](){return je(this,We,"f")}[_t](){return je(this,Ge,"f")}[Tt](){return je(this,Xe,"f")||{}}[Nt](){return je(this,st,"f")}[Bt](){return je(this,ct,"f")}[Rt](){return!!je(this,Ye,"f")}[Mt](){return je(this,ze,"f")}[Ut](e,t,r,n){if(r)return e;if(isPromise(e))return e;if(!t){e=this[lt](e)}const o=this[gt]()["parse-positional-numbers"]||this[gt]()["parse-positional-numbers"]===undefined;if(o){e=this[vt](e)}if(n){e=applyMiddleware(e,this,je(this,Le,"f").getMiddleware(),false)}return e}[$t](e={}){Se(this,Ve,je(this,Ve,"f")||{},"f");const t={};t.local=je(this,Ve,"f").local||[];t.configObjects=je(this,Ve,"f").configObjects||[];const r={};t.local.forEach((t=>{r[t]=true;(e[t]||[]).forEach((e=>{r[e]=true}))}));Object.assign(je(this,Ze,"f"),Object.keys(je(this,$e,"f")).reduce(((e,t)=>{const n=je(this,$e,"f")[t].filter((e=>!(e in r)));if(n.length>0){e[t]=n}return e}),{}));Se(this,$e,{},"f");const n=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"];const o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];n.forEach((e=>{t[e]=(je(this,Ve,"f")[e]||[]).filter((e=>!r[e]))}));o.forEach((e=>{t[e]=objFilter(je(this,Ve,"f")[e],(e=>!r[e]))}));t.envPrefix=je(this,Ve,"f").envPrefix;Se(this,Ve,t,"f");Se(this,st,je(this,st,"f")?je(this,st,"f").reset(r):usage(this,je(this,rt,"f")),"f");Se(this,ct,je(this,ct,"f")?je(this,ct,"f").reset(r):validation(this,je(this,st,"f"),je(this,rt,"f")),"f");Se(this,ke,je(this,ke,"f")?je(this,ke,"f").reset():command(je(this,st,"f"),je(this,ct,"f"),je(this,Le,"f"),je(this,rt,"f")),"f");if(!je(this,Pe,"f"))Se(this,Pe,completion(this,je(this,st,"f"),je(this,ke,"f"),je(this,rt,"f")),"f");je(this,Le,"f").reset();Se(this,_e,null,"f");Se(this,He,"","f");Se(this,Ne,null,"f");Se(this,We,false,"f");this.parsed=false;return this}[Lt](e,t){return je(this,rt,"f").path.relative(e,t)}[Wt](e,t,r,n=0,o=false){var i,s,a,u;let c=!!r||o;e=e||je(this,et,"f");je(this,Ve,"f").__=je(this,rt,"f").y18n.__;je(this,Ve,"f").configuration=this[gt]();const l=!!je(this,Ve,"f").configuration["populate--"];const f=Object.assign({},je(this,Ve,"f").configuration,{"populate--":true});const d=je(this,rt,"f").Parser.detailed(e,Object.assign({},je(this,Ve,"f"),{configuration:{"parse-positional-numbers":false,...f}}));const p=Object.assign(d.argv,je(this,Xe,"f"));let h=undefined;const m=d.aliases;let g=false;let D=false;Object.keys(p).forEach((e=>{if(e===je(this,Ke,"f")&&p[e]){g=true}else if(e===je(this,ut,"f")&&p[e]){D=true}}));p.$0=this.$0;this.parsed=d;if(n===0){je(this,st,"f").clearCachedHelpMessage()}try{this[yt]();if(t){return this[Ut](p,l,!!r,false)}if(je(this,Ke,"f")){const e=[je(this,Ke,"f")].concat(m[je(this,Ke,"f")]||[]).filter((e=>e.length>1));if(e.includes(""+p._[p._.length-1])){p._.pop();g=true}}Se(this,ze,false,"f");const f=je(this,ke,"f").getCommands();const y=((i=je(this,Pe,"f"))===null||i===void 0?void 0:i.completionKey)?[(s=je(this,Pe,"f"))===null||s===void 0?void 0:s.completionKey,...(u=this.getAliases()[(a=je(this,Pe,"f"))===null||a===void 0?void 0:a.completionKey])!==null&&u!==void 0?u:[]].some((e=>Object.prototype.hasOwnProperty.call(p,e))):false;const b=g||y||o;if(p._.length){if(f.length){let e;for(let t=n||0,i;p._[t]!==undefined;t++){i=String(p._[t]);if(f.includes(i)&&i!==je(this,_e,"f")){const e=je(this,ke,"f").runCommand(i,this,d,t+1,o,g||D||o);return this[Ut](e,l,!!r,false)}else if(!e&&i!==je(this,_e,"f")){e=i;break}}if(!je(this,ke,"f").hasDefaultCommand()&&je(this,tt,"f")&&e&&!b){je(this,ct,"f").recommendCommands(e,f)}}if(je(this,_e,"f")&&p._.includes(je(this,_e,"f"))&&!y){if(je(this,Me,"f"))setBlocking(true);this.showCompletionScript();this.exit(0)}}if(je(this,ke,"f").hasDefaultCommand()&&!b){const e=je(this,ke,"f").runCommand(null,this,d,0,o,g||D||o);return this[Ut](e,l,!!r,false)}if(y){if(je(this,Me,"f"))setBlocking(true);e=[].concat(e);const t=e.slice(e.indexOf(`--${je(this,Pe,"f").completionKey}`)+1);je(this,Pe,"f").getCompletion(t,((e,t)=>{if(e)throw new YError(e.message);(t||[]).forEach((e=>{je(this,Ge,"f").log(e)}));this.exit(0)}));return this[Ut](p,!l,!!r,false)}if(!je(this,We,"f")){if(g){if(je(this,Me,"f"))setBlocking(true);c=true;this.showHelp((e=>{je(this,Ge,"f").log(e);this.exit(0)}))}else if(D){if(je(this,Me,"f"))setBlocking(true);c=true;je(this,st,"f").showVersion("log");this.exit(0)}}if(!c&&je(this,Ve,"f").skipValidation.length>0){c=Object.keys(p).some((e=>je(this,Ve,"f").skipValidation.indexOf(e)>=0&&p[e]===true))}if(!c){if(d.error)throw new YError(d.error.message);if(!y){const e=this[Kt](m,{},d.error);if(!r){h=applyMiddleware(p,this,je(this,Le,"f").getMiddleware(),true)}h=this[kt](e,h!==null&&h!==void 0?h:p);if(isPromise(h)&&!r){h=h.then((()=>applyMiddleware(p,this,je(this,Le,"f").getMiddleware(),false)))}}}}catch(e){if(e instanceof YError)je(this,st,"f").fail(e.message,e);else throw e}return this[Ut](h!==null&&h!==void 0?h:p,l,!!r,true)}[Kt](e,t,r,n){const o={...this.getDemandedOptions()};return i=>{if(r)throw new YError(r.message);je(this,ct,"f").nonOptionCount(i);je(this,ct,"f").requiredArguments(i,o);let s=false;if(je(this,ot,"f")){s=je(this,ct,"f").unknownCommands(i)}if(je(this,nt,"f")&&!s){je(this,ct,"f").unknownArguments(i,e,t,!!n)}else if(je(this,it,"f")){je(this,ct,"f").unknownArguments(i,e,{},false,false)}je(this,ct,"f").limitedChoices(i);je(this,ct,"f").implications(i);je(this,ct,"f").conflicting(i)}}[zt](){Se(this,We,true,"f")}[Gt](e){if(typeof e==="string"){je(this,Ve,"f").key[e]=true}else{for(const t of e){je(this,Ve,"f").key[t]=true}}}}function isYargsInstance(e){return!!e&&typeof e.getInternalMethods==="function"}const Vt=YargsFactory(be);const Jt=Vt}};var r={};function __nccwpck_require__(e){var n=r[e];if(n!==undefined){return n.exports}var o=r[e]={exports:{}};var i=true;try{t[e](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete r[e]}return o.exports}(()=>{var e=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var t=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var r=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=e=>{if(e&&e.d<1){e.d=1;e.forEach((e=>e.r--));e.forEach((e=>e.r--?e.r++:e()))}};var wrapDeps=n=>n.map((n=>{if(n!==null&&typeof n==="object"){if(n[e])return n;if(n.then){var o=[];o.d=0;n.then((e=>{i[t]=e;resolveQueue(o)}),(e=>{i[r]=e;resolveQueue(o)}));var i={};i[e]=e=>e(o);return i}}var s={};s[e]=e=>{};s[t]=n;return s}));__nccwpck_require__.a=(n,o,i)=>{var s;i&&((s=[]).d=-1);var a=new Set;var u=n.exports;var c;var l;var f;var d=new Promise(((e,t)=>{f=t;l=e}));d[t]=u;d[e]=e=>(s&&e(s),a.forEach(e),d["catch"]((e=>{})));n.exports=d;o((n=>{c=wrapDeps(n);var o;var getResult=()=>c.map((e=>{if(e[r])throw e[r];return e[t]}));var i=new Promise((t=>{o=()=>t(getResult);o.r=0;var fnQueue=e=>e!==s&&!a.has(e)&&(a.add(e),e&&!e.d&&(o.r++,e.push(o)));c.map((t=>t[e](fnQueue)))}));return o.r?i:getResult()}),(e=>(e?f(d[r]=e):l(u),resolveQueue(s))));s&&s.d<0&&(s.d=0)}})();(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var n=__nccwpck_require__(446);n=await n;
|