@likec4/mcp 1.58.0 → 1.59.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/chunks/libs/@chevrotain/cst-dts-gen.mjs +1 -0
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
- package/dist/chunks/libs/@hono/mcp.mjs +6 -6
- package/dist/chunks/libs/@hono/node-server.mjs +3 -1
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +4 -11
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +33 -33
- package/dist/chunks/libs/chokidar.mjs +2 -2
- package/dist/chunks/libs/chroma-js.mjs +2 -2
- package/dist/chunks/libs/eventemitter3.mjs +1 -1
- package/dist/chunks/libs/graphology-dag.mjs +1 -1
- package/dist/chunks/libs/graphology.mjs +1 -1
- package/dist/chunks/libs/hast-util-sanitize.mjs +1 -1
- package/dist/chunks/libs/hast-util-to-html.mjs +2 -2
- package/dist/chunks/libs/hono.mjs +1 -1
- package/dist/chunks/libs/immer.mjs +1 -1
- package/dist/chunks/libs/langium.mjs +9 -22
- package/dist/chunks/libs/markdown-table.mjs +1 -1
- package/dist/chunks/libs/mdast-util-from-markdown.mjs +2 -2
- package/dist/chunks/libs/mdast-util-gfm.mjs +1 -1
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/micromark-extension-gfm.mjs +1 -1
- package/dist/chunks/libs/mnemonist.mjs +1 -1
- package/dist/chunks/libs/nano-spawn.mjs +1 -1
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/picomatch.mjs +1 -0
- package/dist/chunks/libs/remark-github-blockquote-alert.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/unified.mjs +1 -1
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/src.mjs +102 -101
- package/dist/cli.mjs +3 -3
- package/package.json +18 -18
- package/dist/chunks/libs/@chevrotain/gast.mjs +0 -1
- package/dist/chunks/libs/@lume/kiwi.mjs +0 -1
- package/dist/chunks/libs/fdir.mjs +0 -1
- package/dist/chunks/libs/json5.mjs +0 -14
- package/dist/chunks/libs/which.mjs +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`)}function resolveValue(e){return typeof e==`function`?e():e}var CLIError=class extends Error{code;constructor(e,t){super(e),this.name=`CLIError`,this.code=t}};function parseRawArgs(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),a=t.alias||{},o=t.default||{},s=new Map,c=new Map;for(let[e,t]of Object.entries(a)){let n=t;for(let t of n)s.set(e,t),c.has(t)||c.set(t,[]),c.get(t).push(e),s.set(t,e),c.has(e)||c.set(e,[]),c.get(e).push(t)}let l={};function getType(e){if(n.has(e))return`boolean`;let t=c.get(e)||[];for(let e of t)if(n.has(e))return`boolean`;return`string`}function isStringType(e){if(r.has(e))return!0;let t=c.get(e)||[];for(let e of t)if(r.has(e))return!0;return!1}let u=new Set([...n,...r,...Object.keys(a),...Object.values(a).flat(),...Object.keys(o)]);for(let e of u)l[e]||(l[e]={type:getType(e),default:o[e]});for(let[e,t]of s.entries())e.length===1&&l[t]&&!l[t].short&&(l[t].short=e);let d=[],f={};for(let t=0;t<e.length;t++){let n=e[t];if(n===`--`){d.push(...e.slice(t));break}if(n.startsWith(`--no-`)){let e=n.slice(5);f[e]=!0;continue}d.push(n)}let p;try{p=i({args:d,options:Object.keys(l).length>0?l:void 0,allowPositionals:!0,strict:!1})}catch{p={values:{},positionals:d}}let m={_:[]};m._=p.positionals;for(let[e,t]of Object.entries(p.values)){let n=t;getType(e)===`boolean`&&typeof t==`string`?n=t!==`false`:isStringType(e)&&typeof t==`boolean`&&(n=``),m[e]=n}for(let[e]of Object.entries(f)){m[e]=!1;let t=s.get(e);t&&(m[t]=!1);let n=c.get(e);if(n)for(let e of n)m[e]=!1}for(let[e,t]of s.entries())m[e]!==void 0&&m[t]===void 0&&(m[t]=m[e]),m[t]!==void 0&&m[e]===void 0&&(m[e]=m[t]),m[e]!==m[t]&&o[t]===m[t]&&(m[t]=m[e]);return m}const s=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR===`1`||e.TERM===`dumb`||e.TEST||e.CI})(),_c=(e,t=39)=>n=>s?n:`\u001B[${e}m${n}\u001B[${t}m`,c=_c(1,22),l=_c(36),u=_c(90),d=_c(4,24);function parseArgs$1(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=resolveArgs(t);for(let e of r){if(e.type===`positional`)continue;e.type===`string`||e.type===`enum`?n.string.push(e.name):e.type===`boolean`&&n.boolean.push(e.name),e.default!==void 0&&(n.default[e.name]=e.default),e.alias&&(n.alias[e.name]=e.alias);let t=camelCase(e.name),r=kebabCase(e.name);if(t!==e.name||r!==e.name){let i=toArray(n.alias[e.name]||[]);t!==e.name&&!i.includes(t)&&i.push(t),r!==e.name&&!i.includes(r)&&i.push(r),i.length>0&&(n.alias[e.name]=i)}}let i=parseRawArgs(e,n),[...a]=i._,o=new Proxy(i,{get(e,t){return e[t]??e[camelCase(t)]??e[kebabCase(t)]}});for(let[,e]of r.entries())if(e.type===`positional`){let t=a.shift();if(t!==void 0)o[e.name]=t;else if(e.default===void 0&&e.required!==!1)throw new CLIError(`Missing required positional argument: ${e.name.toUpperCase()}`,`EARG`);else o[e.name]=e.default}else if(e.type===`enum`){let t=o[e.name],n=e.options||[];if(t!==void 0&&n.length>0&&!n.includes(t))throw new CLIError(`Invalid value for argument: ${l(`--${e.name}`)} (${l(t)}). Expected one of: ${n.map(e=>l(e)).join(`, `)}.`,`EARG`)}else if(e.required&&o[e.name]===void 0)throw new CLIError(`Missing required argument: --${e.name}`,`EARG`);return o}e(parseArgs$1,`parseArgs`);function resolveArgs(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:toArray(r.alias)});return t}async function resolvePlugins(e){return Promise.all(e.map(e=>resolveValue(e)))}function defineCommand(e){return e}async function runCommand(e,t){let n=await resolveValue(e.args||{}),r=parseArgs$1(t.rawArgs,n),i={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},a=await resolvePlugins(e.plugins??[]),o,s;try{for(let e of a)await e.setup?.(i);typeof e.setup==`function`&&await e.setup(i);let r=await resolveValue(e.subCommands);if(r&&Object.keys(r).length>0){let i=findSubCommandIndex(t.rawArgs,n),a=t.rawArgs[i];if(a){let e=await _findSubCommand(r,a);if(!e)throw new CLIError(`Unknown command ${l(a)}`,`E_UNKNOWN_COMMAND`);await runCommand(e,{rawArgs:t.rawArgs.slice(i+1)})}else{let n=await resolveValue(e.default);if(n){if(e.run)throw new CLIError(`Cannot specify both 'run' and 'default' on the same command.`,`E_DEFAULT_CONFLICT`);let i=await _findSubCommand(r,n);if(!i)throw new CLIError(`Default sub command ${l(n)} not found in subCommands.`,`E_UNKNOWN_COMMAND`);await runCommand(i,{rawArgs:t.rawArgs})}else if(!e.run)throw new CLIError(`No command specified.`,`E_NO_COMMAND`)}}typeof e.run==`function`&&(o=await e.run(i))}catch(e){s=e}let c=[];if(typeof e.cleanup==`function`)try{await e.cleanup(i)}catch(e){c.push(e)}for(let e of[...a].reverse())try{await e.cleanup?.(i)}catch(e){c.push(e)}if(s)throw s;if(c.length===1)throw c[0];if(c.length>1)throw Error(`Multiple cleanup errors`,{cause:c});return{result:o}}async function resolveSubCommand(e,t,n){let r=await resolveValue(e.subCommands);if(r&&Object.keys(r).length>0){let n=findSubCommandIndex(t,await resolveValue(e.args||{})),i=t[n],a=await _findSubCommand(r,i);if(a)return resolveSubCommand(a,t.slice(n+1),e)}return[e,n]}async function _findSubCommand(e,t){if(t in e)return resolveValue(e[t]);for(let n of Object.values(e)){let e=await resolveValue(n),r=await resolveValue(e?.meta);if(r?.alias&&toArray(r.alias).includes(t))return e}}function findSubCommandIndex(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r===`--`)return-1;if(r.startsWith(`-`)){!r.includes(`=`)&&_isValueFlag(r,t)&&n++;continue}return n}return-1}function _isValueFlag(e,t){let n=e.replace(/^-{1,2}/,``),r=camelCase(n);for(let[e,i]of Object.entries(t))if(
|
|
2
|
+
import{r as e}from"./chunks/rolldown-runtime.mjs";import{n as t,r as n}from"./chunks/src.mjs";import{resolve as r}from"node:path";import{parseArgs as i}from"node:util";const a=/\d/,o=[`-`,`_`,`/`,`.`];function isUppercase(e=``){if(!a.test(e))return e!==e.toLowerCase()}function splitByCase(e,t){let n=t??o,r=[];if(!e||typeof e!=`string`)return r;let i=``,a,s;for(let t of e){let e=n.includes(t);if(e===!0){r.push(i),i=``,a=void 0;continue}let o=isUppercase(t);if(s===!1){if(a===!1&&o===!0){r.push(i),i=t,a=o;continue}if(a===!0&&o===!1&&i.length>1){let e=i.at(-1);r.push(i.slice(0,Math.max(0,i.length-1))),i=e+t,a=o;continue}}i+=t,a=o,s=e}return r.push(i),r}function upperFirst(e){return e?e[0].toUpperCase()+e.slice(1):``}function lowerFirst(e){return e?e[0].toLowerCase()+e.slice(1):``}function pascalCase(e,t){return e?(Array.isArray(e)?e:splitByCase(e)).map(e=>upperFirst(t?.normalize?e.toLowerCase():e)).join(``):``}function camelCase(e,t){return lowerFirst(pascalCase(e||``,t))}function kebabCase(e,t){return e?(Array.isArray(e)?e:splitByCase(e)).map(e=>e.toLowerCase()).join(t??`-`):``}function snakeCase(e){return kebabCase(e||``,`_`)}function toArray(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function formatLineColumns(e,t=``){let n=[];for(let t of e)for(let[e,r]of t.entries())n[e]=Math.max(n[e]||0,r.length);return e.map(e=>e.map((e,r)=>t+e[r===0?`padStart`:`padEnd`](n[r])).join(` `)).join(`
|
|
3
|
+
`)}function resolveValue(e){return typeof e==`function`?e():e}var CLIError=class extends Error{code;constructor(e,t){super(e),this.name=`CLIError`,this.code=t}};function parseRawArgs(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),a=t.alias||{},o=t.default||{},s=new Map,c=new Map;for(let[e,t]of Object.entries(a)){let n=t;for(let t of n)s.set(e,t),c.has(t)||c.set(t,[]),c.get(t).push(e),s.set(t,e),c.has(e)||c.set(e,[]),c.get(e).push(t)}let l={};function getType(e){if(n.has(e))return`boolean`;let t=c.get(e)||[];for(let e of t)if(n.has(e))return`boolean`;return`string`}function isStringType(e){if(r.has(e))return!0;let t=c.get(e)||[];for(let e of t)if(r.has(e))return!0;return!1}let u=new Set([...n,...r,...Object.keys(a),...Object.values(a).flat(),...Object.keys(o)]);for(let e of u)l[e]||(l[e]={type:getType(e),default:o[e]});for(let[e,t]of s.entries())e.length===1&&l[t]&&!l[t].short&&(l[t].short=e);let d=[],f={};for(let t=0;t<e.length;t++){let n=e[t];if(n===`--`){d.push(...e.slice(t));break}if(n.startsWith(`--no-`)){let e=n.slice(5);f[e]=!0;continue}d.push(n)}let p;try{p=i({args:d,options:Object.keys(l).length>0?l:void 0,allowPositionals:!0,strict:!1})}catch{p={values:{},positionals:d}}let m={_:[]};m._=p.positionals;for(let[e,t]of Object.entries(p.values)){let n=t;getType(e)===`boolean`&&typeof t==`string`?n=t!==`false`:isStringType(e)&&typeof t==`boolean`&&(n=``),m[e]=n}for(let[e]of Object.entries(f)){m[e]=!1;let t=s.get(e);t&&(m[t]=!1);let n=c.get(e);if(n)for(let e of n)m[e]=!1}for(let[e,t]of s.entries())m[e]!==void 0&&m[t]===void 0&&(m[t]=m[e]),m[t]!==void 0&&m[e]===void 0&&(m[e]=m[t]),m[e]!==m[t]&&o[t]===m[t]&&(m[t]=m[e]);return m}const s=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR===`1`||e.TERM===`dumb`||e.TEST||e.CI})(),_c=(e,t=39)=>n=>s?n:`\u001B[${e}m${n}\u001B[${t}m`,c=_c(1,22),l=_c(36),u=_c(90),d=_c(4,24);function parseArgs$1(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=resolveArgs(t);for(let e of r){if(e.type===`positional`)continue;e.type===`string`||e.type===`enum`?n.string.push(e.name):e.type===`boolean`&&n.boolean.push(e.name),e.default!==void 0&&(n.default[e.name]=e.default),e.alias&&(n.alias[e.name]=e.alias);let t=camelCase(e.name),r=kebabCase(e.name);if(t!==e.name||r!==e.name){let i=toArray(n.alias[e.name]||[]);t!==e.name&&!i.includes(t)&&i.push(t),r!==e.name&&!i.includes(r)&&i.push(r),i.length>0&&(n.alias[e.name]=i)}}let i=parseRawArgs(e,n),[...a]=i._,o=new Proxy(i,{get(e,t){return e[t]??e[camelCase(t)]??e[kebabCase(t)]}});for(let[,e]of r.entries())if(e.type===`positional`){let t=a.shift();if(t!==void 0)o[e.name]=t;else if(e.default===void 0&&e.required!==!1)throw new CLIError(`Missing required positional argument: ${e.name.toUpperCase()}`,`EARG`);else o[e.name]=e.default}else if(e.type===`enum`){let t=o[e.name],n=e.options||[];if(t!==void 0&&n.length>0&&!n.includes(t))throw new CLIError(`Invalid value for argument: ${l(`--${e.name}`)} (${l(t)}). Expected one of: ${n.map(e=>l(e)).join(`, `)}.`,`EARG`)}else if(e.required&&o[e.name]===void 0)throw new CLIError(`Missing required argument: --${e.name}`,`EARG`);return o}e(parseArgs$1,`parseArgs`);function resolveArgs(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:toArray(r.alias)});return t}async function resolvePlugins(e){return Promise.all(e.map(e=>resolveValue(e)))}function defineCommand(e){return e}async function runCommand(e,t){let n=await resolveValue(e.args||{}),r=parseArgs$1(t.rawArgs,n),i={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},a=await resolvePlugins(e.plugins??[]),o,s;try{for(let e of a)await e.setup?.(i);typeof e.setup==`function`&&await e.setup(i);let r=await resolveValue(e.subCommands);if(r&&Object.keys(r).length>0){let i=findSubCommandIndex(t.rawArgs,n),a=t.rawArgs[i];if(a){let e=await _findSubCommand(r,a);if(!e)throw new CLIError(`Unknown command ${l(a)}`,`E_UNKNOWN_COMMAND`);await runCommand(e,{rawArgs:t.rawArgs.slice(i+1)})}else{let n=await resolveValue(e.default);if(n){if(e.run)throw new CLIError(`Cannot specify both 'run' and 'default' on the same command.`,`E_DEFAULT_CONFLICT`);let i=await _findSubCommand(r,n);if(!i)throw new CLIError(`Default sub command ${l(n)} not found in subCommands.`,`E_UNKNOWN_COMMAND`);await runCommand(i,{rawArgs:t.rawArgs})}else if(!e.run)throw new CLIError(`No command specified.`,`E_NO_COMMAND`)}}typeof e.run==`function`&&(o=await e.run(i))}catch(e){s=e}let c=[];if(typeof e.cleanup==`function`)try{await e.cleanup(i)}catch(e){c.push(e)}for(let e of[...a].reverse())try{await e.cleanup?.(i)}catch(e){c.push(e)}if(s)throw s;if(c.length===1)throw c[0];if(c.length>1)throw Error(`Multiple cleanup errors`,{cause:c});return{result:o}}async function resolveSubCommand(e,t,n){let r=await resolveValue(e.subCommands);if(r&&Object.keys(r).length>0){let n=findSubCommandIndex(t,await resolveValue(e.args||{})),i=t[n],a=await _findSubCommand(r,i);if(a)return resolveSubCommand(a,t.slice(n+1),e)}return[e,n]}async function _findSubCommand(e,t){if(t in e)return resolveValue(e[t]);for(let n of Object.values(e)){let e=await resolveValue(n),r=await resolveValue(e?.meta);if(r?.alias&&toArray(r.alias).includes(t))return e}}function findSubCommandIndex(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r===`--`)return-1;if(r.startsWith(`-`)){!r.includes(`=`)&&_isValueFlag(r,t)&&n++;continue}return n}return-1}function _isValueFlag(e,t){let n=e.replace(/^-{1,2}/,``),r=camelCase(n);for(let[e,i]of Object.entries(t))if((i.type===`string`||i.type===`enum`)&&(r===camelCase(e)||(Array.isArray(i.alias)?i.alias:i.alias?[i.alias]:[]).includes(n)))return!0;return!1}async function showUsage(e,t){try{console.log(await renderUsage(e,t)+`
|
|
4
4
|
`)}catch(e){console.error(e)}}const f=/^no[-A-Z]/;async function renderUsage(e,t){let n=await resolveValue(e.meta||{}),r=resolveArgs(await resolveValue(e.args||{})),i=await resolveValue(t?.meta||{}),a=`${i.name?`${i.name} `:``}`+(n.name||process.argv[1]),o=[],s=[],p=[],m=[];for(let e of r)if(e.type===`positional`){let t=e.name.toUpperCase(),n=e.required!==!1&&e.default===void 0;s.push([l(t+renderValueHint(e)),renderDescription(e,n)]),m.push(n?`<${t}>`:`[${t}]`)}else{let t=e.required===!0&&e.default===void 0,n=[...(e.alias||[]).map(e=>`-${e}`),`--${e.name}`].join(`, `)+renderValueHint(e);if(o.push([l(n),renderDescription(e,t)]),e.type===`boolean`&&(e.default===!0||e.negativeDescription)&&!f.test(e.name)){let n=[...(e.alias||[]).map(e=>`--no-${e}`),`--no-${e.name}`].join(`, `);o.push([l(n),[e.negativeDescription,t?u(`(Required)`):``].filter(Boolean).join(` `)])}t&&m.push(`--${e.name}`+renderValueHint(e))}if(e.subCommands){let t=[],n=await resolveValue(e.subCommands);for(let[e,r]of Object.entries(n)){let n=await resolveValue((await resolveValue(r))?.meta);if(n?.hidden)continue;let i=toArray(n?.alias),a=[e,...i].join(`, `);p.push([l(a),n?.description||``]),t.push(e,...i)}m.push(t.join(`|`))}let h=[],g=n.version||i.version;h.push(u(`${n.description} (${a+(g?` v${g}`:``)})`),``);let _=o.length>0||s.length>0;return h.push(`${d(c(`USAGE`))} ${l(`${a}${_?` [OPTIONS]`:``} ${m.join(` `)}`)}`,``),s.length>0&&(h.push(d(c(`ARGUMENTS`)),``),h.push(formatLineColumns(s,` `)),h.push(``)),o.length>0&&(h.push(d(c(`OPTIONS`)),``),h.push(formatLineColumns(o,` `)),h.push(``)),p.length>0&&(h.push(d(c(`COMMANDS`)),``),h.push(formatLineColumns(p,` `)),h.push(``,`Use ${l(`${a} <command> --help`)} for more information about a command.`)),h.filter(e=>typeof e==`string`).join(`
|
|
5
5
|
`)}function renderValueHint(e){let t=e.valueHint?`=<${e.valueHint}>`:``,n=t||`=<${snakeCase(e.name)}>`;return!e.type||e.type===`positional`||e.type===`boolean`?t:e.type===`enum`&&e.options?.length?`=<${e.options.join(`|`)}>`:n}function renderDescription(e,t){let n=t?u(`(Required)`):``,r=e.default===void 0?``:u(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(` `)}async function runMain(e,t={}){let n=t.rawArgs||process.argv.slice(2),r=t.showUsage||showUsage;try{let t=await _resolveBuiltinFlags(e);if(t.help.length>0&&n.some(e=>t.help.includes(e)))await r(...await resolveSubCommand(e,n)),process.exit(0);else if(n.length===1&&t.version.includes(n[0])){let t=typeof e.meta==`function`?await e.meta():await e.meta;if(!t?.version)throw new CLIError(`No version specified`,`E_NO_VERSION`);console.log(t.version)}else await runCommand(e,{rawArgs:n})}catch(t){t instanceof CLIError?(await r(...await resolveSubCommand(e,n)),console.error(t.message)):console.error(t,`
|
|
6
|
-
`),process.exit(1)}}async function _resolveBuiltinFlags(e){let t=await resolveValue(e.args||{}),n=new Set,r=new Set;for(let[e,i]of Object.entries(t)){n.add(e);for(let e of toArray(i.alias))r.add(e)}return{help:_getBuiltinFlags(`help`,`h`,n,r),version:_getBuiltinFlags(`version`,`v`,n,r)}}function _getBuiltinFlags(e,t,n,r){return n.has(e)||r.has(e)?[]:n.has(t)||r.has(t)?[`--${e}`]:[`--${e}`,`-${t}`]}runMain(defineCommand({meta:{name:`likec4-mcp-server`,description:`LikeC4 MCP server`},args:{stdio:{type:`boolean`,description:`use stdio transport (default)`,required:!1},http:{type:`boolean`,description:`use streamable http transport`,required:!1},port:{type:`string`,description:`change http port`,valueHint:`number`,required:!1},graphviz:{type:`enum`,options:[`binary`,`wasm`],description:`use binary or wasm graphviz`,default:`wasm`,required:!1},watch:{type:`boolean`,description:`disable watch for changes`,default:!0,required:!1},workspace:{type:`positional`,description:`change workspace, can be set by LIKEC4_WORKSPACE env`,valueHint:`directory`,required:!1,default:process.env.LIKEC4_WORKSPACE||`.`}},setup({args:e}){if(e.stdio&&(e.http||e.port))throw Error(`stdio and http are mutually exclusive`)},async run({args:e}){let i=e.stdio||!e.http&&!e.port,a=e.port?parseInt(e.port):33335,o=r(e.workspace||`.`);e.watch&&n.warn`watch for changes enabled, use ${`--no-watch`} to consume less resources`,await t({workspacePath:o,graphviz:e.graphviz,mcp:i?`stdio`:{port:a},configureLogger:!0,watch:e.watch})}})).catch(e=>{n.error(e),process.exit(1)});
|
|
6
|
+
`),process.exit(1)}}async function _resolveBuiltinFlags(e){let t=await resolveValue(e.args||{}),n=new Set,r=new Set;for(let[e,i]of Object.entries(t)){n.add(e);for(let e of toArray(i.alias))r.add(e)}return{help:_getBuiltinFlags(`help`,`h`,n,r),version:_getBuiltinFlags(`version`,`v`,n,r)}}function _getBuiltinFlags(e,t,n,r){return n.has(e)||r.has(e)?[]:n.has(t)||r.has(t)?[`--${e}`]:[`--${e}`,`-${t}`]}runMain(defineCommand({meta:{name:`likec4-mcp-server`,description:`LikeC4 MCP server`},args:{stdio:{type:`boolean`,description:`use stdio transport (default)`,required:!1},http:{type:`boolean`,description:`use streamable http transport`,required:!1},port:{type:`string`,description:`change http port`,valueHint:`number`,required:!1},graphviz:{type:`enum`,options:[`binary`,`wasm`],description:`use binary or wasm graphviz`,default:`wasm`,required:!1},watch:{type:`boolean`,description:`disable watch for changes`,default:!0,required:!1},workspace:{type:`positional`,description:`change workspace, can be set by LIKEC4_WORKSPACE env`,valueHint:`directory`,required:!1,default:process.env.LIKEC4_WORKSPACE||`.`}},setup({args:e}){if(e.stdio&&(e.http||e.port))throw Error(`stdio and http are mutually exclusive`)},async run({args:e}){let i=e.stdio||!e.http&&!e.port,a=e.port?parseInt(e.port):33335,o=r(e.workspace||`.`);e.watch&&n.warn`watch for changes enabled, use ${`--no-watch`} to consume less resources`,await t({workspacePath:o,graphviz:e.graphviz,mcp:i?`stdio`:{port:a},configureLogger:!0,watch:e.watch})}})).catch(e=>{n.error(e),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@likec4/mcp",
|
|
3
3
|
"description": "Model Context Protocol server for LikeC4",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.59.0",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
7
7
|
"homepage": "https://likec4.dev",
|
|
8
8
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -41,40 +41,40 @@
|
|
|
41
41
|
"server"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@hpcc-js/wasm-graphviz": "1.
|
|
44
|
+
"@hpcc-js/wasm-graphviz": "1.22.2",
|
|
45
45
|
"bundle-require": "^5.1.0",
|
|
46
|
-
"esbuild": "0.28.
|
|
46
|
+
"esbuild": "0.28.1",
|
|
47
47
|
"std-env": "^4.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@hono/mcp": "^0.3.0",
|
|
51
|
-
"@hono/node-server": "^
|
|
51
|
+
"@hono/node-server": "^2.0.8",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
53
53
|
"@types/node": "~22.19.19",
|
|
54
|
-
"@vitest/ui": "4.1.
|
|
54
|
+
"@vitest/ui": "4.1.9",
|
|
55
55
|
"citty": "^0.2.2",
|
|
56
56
|
"defu": "^6.1.7",
|
|
57
|
-
"hono": "^4.12.
|
|
57
|
+
"hono": "^4.12.27",
|
|
58
58
|
"langium": "3.5.0",
|
|
59
59
|
"remeda": "^2.37.0",
|
|
60
60
|
"tinyrainbow": "^3.1.0",
|
|
61
|
-
"tsdown": "^0.22.
|
|
62
|
-
"tsx": "4.22.
|
|
63
|
-
"turbo": "2.
|
|
61
|
+
"tsdown": "^0.22.9",
|
|
62
|
+
"tsx": "4.22.5",
|
|
63
|
+
"turbo": "2.10.5",
|
|
64
64
|
"typescript": "6.0.3",
|
|
65
65
|
"type-fest": "^4.41.0",
|
|
66
66
|
"unctx": "^2.5.0",
|
|
67
|
-
"vitest": "4.1.
|
|
67
|
+
"vitest": "4.1.9",
|
|
68
68
|
"vscode-uri": "3.1.0",
|
|
69
69
|
"zod": "^4.4.3",
|
|
70
|
-
"@likec4/config": "1.
|
|
71
|
-
"@likec4/
|
|
72
|
-
"@likec4/devops": "1.
|
|
73
|
-
"@likec4/language-
|
|
74
|
-
"@likec4/
|
|
75
|
-
"@likec4/
|
|
76
|
-
"@likec4/
|
|
77
|
-
"@likec4/
|
|
70
|
+
"@likec4/config": "1.59.0",
|
|
71
|
+
"@likec4/language-server": "1.59.0",
|
|
72
|
+
"@likec4/devops": "1.59.0",
|
|
73
|
+
"@likec4/language-services": "1.59.0",
|
|
74
|
+
"@likec4/layouts": "1.59.0",
|
|
75
|
+
"@likec4/core": "1.59.0",
|
|
76
|
+
"@likec4/tsconfig": "1.59.0",
|
|
77
|
+
"@likec4/log": "1.59.0"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"typecheck": "tsc -b --verbose",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../rolldown-runtime.mjs";var e=typeof global==`object`&&global&&global.Object===Object&&global,t=typeof self==`object`&&self&&self.Object===Object&&self,n=e||t||Function(`return this`)(),r=n.Symbol,i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r?r.toStringTag:void 0;function getRawTag(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch{}var i=o.call(e);return r&&(t?e[s]=n:delete e[s]),i}var c=Object.prototype.toString;function objectToString(e){return c.call(e)}var l=`[object Null]`,u=`[object Undefined]`,d=r?r.toStringTag:void 0;function baseGetTag(e){return e==null?e===void 0?u:l:d&&d in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return typeof e==`object`&&!!e}var f=`[object Symbol]`;function isSymbol(e){return typeof e==`symbol`||isObjectLike(e)&&baseGetTag(e)==f}function arrayMap(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var p=Array.isArray,m=1/0,h=r?r.prototype:void 0,g=h?h.toString:void 0;function baseToString(e){if(typeof e==`string`)return e;if(p(e))return arrayMap(e,baseToString)+``;if(isSymbol(e))return g?g.call(e):``;var t=e+``;return t==`0`&&1/e==-m?`-0`:t}var _=/\s/;function trimmedEndIndex(e){for(var t=e.length;t--&&_.test(e.charAt(t)););return t}var v=/^\s+/;function baseTrim(e){return e&&e.slice(0,trimmedEndIndex(e)+1).replace(v,``)}function isObject(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var y=NaN,ee=/^[-+]0x[0-9a-f]+$/i,te=/^0b[01]+$/i,ne=/^0o[0-7]+$/i,re=parseInt;function toNumber(e){if(typeof e==`number`)return e;if(isSymbol(e))return y;if(isObject(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=isObject(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=baseTrim(e);var n=te.test(e);return n||ne.test(e)?re(e.slice(2),n?2:8):ee.test(e)?y:+e}var b=1/0,ie=17976931348623157e292;function toFinite(e){return e?(e=toNumber(e),e===b||e===-b?(e<0?-1:1)*ie:e===e?e:0):e===0?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function identity(e){return e}var ae=`[object AsyncFunction]`,oe=`[object Function]`,se=`[object GeneratorFunction]`,ce=`[object Proxy]`;function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==oe||t==se||t==ae||t==ce}var x=n[`__core-js_shared__`],le=function(){var e=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function isMasked(e){return!!le&&le in e}var ue=Function.prototype.toString;function toSource(e){if(e!=null){try{return ue.call(e)}catch{}try{return e+``}catch{}}return``}var de=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,pe=Function.prototype,me=Object.prototype,he=pe.toString,ge=me.hasOwnProperty,_e=RegExp(`^`+he.call(ge).replace(de,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function baseIsNative(e){return!isObject(e)||isMasked(e)?!1:(isFunction(e)?_e:fe).test(toSource(e))}function getValue(e,t){return e?.[t]}function getNative(e,t){var n=getValue(e,t);return baseIsNative(n)?n:void 0}var S=getNative(n,`WeakMap`);function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ve=800,ye=16,be=Date.now;function shortOut(e){var t=0,n=0;return function(){var r=be(),i=ye-(r-n);if(n=r,i>0){if(++t>=ve)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function constant(e){return function(){return e}}var C=function(){try{var e=getNative(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),xe=shortOut(C?function(e,t){return C(e,`toString`,{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity);function arrayEach(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function baseFindIndex(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function baseIsNaN(e){return e!==e}function strictIndexOf(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function baseIndexOf(e,t,n){return t===t?strictIndexOf(e,t,n):baseFindIndex(e,baseIsNaN,n)}var Se=9007199254740991,Ce=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var n=typeof e;return t??=Se,!!t&&(n==`number`||n!=`symbol`&&Ce.test(e))&&e>-1&&e%1==0&&e<t}function baseAssignValue(e,t,n){t==`__proto__`&&C?C(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function eq(e,t){return e===t||e!==e&&t!==t}var we=Object.prototype.hasOwnProperty;function assignValue(e,t,n){var r=e[t];(!(we.call(e,t)&&eq(r,n))||n===void 0&&!(t in e))&&baseAssignValue(e,t,n)}function copyObject(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?baseAssignValue(n,s,c):assignValue(n,s,c)}return n}var w=Math.max;function overRest(e,t,n){return t=w(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=w(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),apply(e,this,s)}}function baseRest(e,t){return xe(overRest(e,t,identity),e+``)}var Te=9007199254740991;function isLength(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Te}function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isIterateeCall(e,t,n){if(!isObject(n))return!1;var r=typeof t;return(r==`number`?isArrayLike(n)&&isIndex(t,n.length):r==`string`&&t in n)?eq(n[t],e):!1}function createAssigner(e){return baseRest(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&isIterateeCall(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Ee=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ee)}function baseTimes(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var De=`[object Arguments]`;function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==De}var T=Object.prototype,Oe=T.hasOwnProperty,ke=T.propertyIsEnumerable,E=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&Oe.call(e,`callee`)&&!ke.call(e,`callee`)};function stubFalse(){return!1}var D=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ae=D&&typeof module==`object`&&module&&!module.nodeType&&module,je=Ae&&Ae.exports===D?n.Buffer:void 0,O=(je?je.isBuffer:void 0)||stubFalse,Me=`[object Arguments]`,Ne=`[object Array]`,Pe=`[object Boolean]`,Fe=`[object Date]`,Ie=`[object Error]`,Le=`[object Function]`,Re=`[object Map]`,ze=`[object Number]`,Be=`[object Object]`,Ve=`[object RegExp]`,He=`[object Set]`,Ue=`[object String]`,We=`[object WeakMap]`,Ge=`[object ArrayBuffer]`,Ke=`[object DataView]`,qe=`[object Float32Array]`,Je=`[object Float64Array]`,Ye=`[object Int8Array]`,Xe=`[object Int16Array]`,Ze=`[object Int32Array]`,Qe=`[object Uint8Array]`,$e=`[object Uint8ClampedArray]`,et=`[object Uint16Array]`,tt=`[object Uint32Array]`,k={};k[qe]=k[Je]=k[Ye]=k[Xe]=k[Ze]=k[Qe]=k[$e]=k[et]=k[tt]=!0,k[Me]=k[Ne]=k[Ge]=k[Pe]=k[Ke]=k[Fe]=k[Ie]=k[Le]=k[Re]=k[ze]=k[Be]=k[Ve]=k[He]=k[Ue]=k[We]=!1;function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!k[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}var A=typeof exports==`object`&&exports&&!exports.nodeType&&exports,j=A&&typeof module==`object`&&module&&!module.nodeType&&module,M=j&&j.exports===A&&e.process,N=function(){try{return j&&j.require&&j.require(`util`).types||M&&M.binding&&M.binding(`util`)}catch{}}(),P=N&&N.isTypedArray,F=P?baseUnary(P):baseIsTypedArray,nt=Object.prototype.hasOwnProperty;function arrayLikeKeys(e,t){var n=p(e),r=!n&&E(e),i=!n&&!r&&O(e),a=!n&&!r&&!i&&F(e),o=n||r||i||a,s=o?baseTimes(e.length,String):[],c=s.length;for(var l in e)(t||nt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||isIndex(l,c)))&&s.push(l);return s}function overArg(e,t){return function(n){return e(t(n))}}var rt=overArg(Object.keys,Object),it=Object.prototype.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return rt(e);var t=[];for(var n in Object(e))it.call(e,n)&&n!=`constructor`&&t.push(n);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var at=Object.prototype.hasOwnProperty,I=createAssigner(function(e,t){if(isPrototype(t)||isArrayLike(t)){copyObject(t,keys(t),e);return}for(var n in t)at.call(t,n)&&assignValue(e,n,t[n])});function nativeKeysIn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),n=[];for(var r in e)r==`constructor`&&(t||!ot.call(e,r))||n.push(r);return n}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/;function isKey(e,t){if(p(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||isSymbol(e)?!0:ct.test(e)||!st.test(e)||t!=null&&e in Object(t)}var L=getNative(Object,`create`);function hashClear(){this.__data__=L?L(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var lt=`__lodash_hash_undefined__`,ut=Object.prototype.hasOwnProperty;function hashGet(e){var t=this.__data__;if(L){var n=t[e];return n===lt?void 0:n}return ut.call(t,e)?t[e]:void 0}var dt=Object.prototype.hasOwnProperty;function hashHas(e){var t=this.__data__;return L?t[e]!==void 0:dt.call(t,e)}var ft=`__lodash_hash_undefined__`;function hashSet(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=L&&t===void 0?ft:t,this}function Hash(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var n=e.length;n--;)if(eq(e[n][0],t))return n;return-1}var pt=Array.prototype.splice;function listCacheDelete(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?!1:(n==t.length-1?t.pop():pt.call(t,n,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?void 0:t[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var n=this.__data__,r=assocIndexOf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ListCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var R=getNative(n,`Map`);function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(R||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function getMapData(e,t){var n=e.__data__;return isKeyable(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=+!!t,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var n=getMapData(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function MapCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var mt=`Expected a function`;function memoize(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(mt);var memoized=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=memoized.cache;if(i.has(r))return i.get(r);var a=e.apply(this,n);return memoized.cache=i.set(r,a)||i,a};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var ht=500;function memoizeCapped(e){var t=memoize(e,function(e){return n.size===ht&&n.clear(),e}),n=t.cache;return t}var gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_t=/\\(\\)?/g,vt=memoizeCapped(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(gt,function(e,n,r,i){t.push(r?i.replace(_t,`$1`):n||e)}),t});function toString(e){return e==null?``:baseToString(e)}function castPath(e,t){return p(e)?e:isKey(e,t)?[e]:vt(toString(e))}var yt=1/0;function toKey(e){if(typeof e==`string`||isSymbol(e))return e;var t=e+``;return t==`0`&&1/e==-yt?`-0`:t}function baseGet(e,t){t=castPath(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[toKey(t[n++])];return n&&n==r?e:void 0}function get(e,t,n){var r=e==null?void 0:baseGet(e,t);return r===void 0?n:r}function arrayPush(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bt=overArg(Object.getPrototypeOf,Object);function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}var xt=200;function stackSet(e,t){var n=this.__data__;if(n instanceof ListCache){var r=n.__data__;if(!R||r.length<xt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new MapCache(r)}return n.set(e,t),this.size=n.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;function arrayFilter(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function stubArray(){return[]}var St=Object.prototype.propertyIsEnumerable,Ct=Object.getOwnPropertySymbols,z=Ct?function(e){return e==null?[]:(e=Object(e),arrayFilter(Ct(e),function(t){return St.call(e,t)}))}:stubArray,B=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)arrayPush(t,z(e)),e=bt(e);return t}:stubArray;function baseGetAllKeys(e,t,n){var r=t(e);return p(e)?r:arrayPush(r,n(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,z)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,B)}var V=getNative(n,`DataView`),H=getNative(n,`Promise`),U=getNative(n,`Set`),W=`[object Map]`,wt=`[object Object]`,G=`[object Promise]`,K=`[object Set]`,q=`[object WeakMap]`,J=`[object DataView]`,Tt=toSource(V),Et=toSource(R),Dt=toSource(H),Ot=toSource(U),kt=toSource(S),getTag=baseGetTag;(V&&getTag(new V(new ArrayBuffer(1)))!=J||R&&getTag(new R)!=W||H&&getTag(H.resolve())!=G||U&&getTag(new U)!=K||S&&getTag(new S)!=q)&&(getTag=function(e){var t=baseGetTag(e),n=t==wt?e.constructor:void 0,r=n?toSource(n):``;if(r)switch(r){case Tt:return J;case Et:return W;case Dt:return G;case Ot:return K;case kt:return q}return t});var Y=getTag,X=n.Uint8Array,At=`__lodash_hash_undefined__`;function setCacheAdd(e){return this.__data__.set(e,At),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new MapCache;++t<n;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arraySome(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}var jt=1,Mt=2;function equalArrays(e,t,n,r,i,a){var o=n&jt,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Mt?new SetCache:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!arraySome(t,function(e,t){if(!cacheHas(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function mapToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function setToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Nt=1,Pt=2,Ft=`[object Boolean]`,It=`[object Date]`,Lt=`[object Error]`,Rt=`[object Map]`,zt=`[object Number]`,Bt=`[object RegExp]`,Vt=`[object Set]`,Ht=`[object String]`,Ut=`[object Symbol]`,Wt=`[object ArrayBuffer]`,Gt=`[object DataView]`,Kt=r?r.prototype:void 0,Z=Kt?Kt.valueOf:void 0;function equalByTag(e,t,n,r,i,a,o){switch(n){case Gt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wt:return!(e.byteLength!=t.byteLength||!a(new X(e),new X(t)));case Ft:case It:case zt:return eq(+e,+t);case Lt:return e.name==t.name&&e.message==t.message;case Bt:case Ht:return e==t+``;case Rt:var s=mapToArray;case Vt:var c=r&Nt;if(s||=setToArray,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Pt,o.set(e,t);var u=equalArrays(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ut:if(Z)return Z.call(e)==Z.call(t)}return!1}var qt=1,Jt=Object.prototype.hasOwnProperty;function equalObjects(e,t,n,r,i,a){var o=n&qt,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Jt.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Yt=1,Xt=`[object Arguments]`,Zt=`[object Array]`,Q=`[object Object]`,Qt=Object.prototype.hasOwnProperty;function baseIsEqualDeep(e,t,n,r,i,a){var o=p(e),s=p(t),c=o?Zt:Y(e),l=s?Zt:Y(t);c=c==Xt?Q:c,l=l==Xt?Q:l;var u=c==Q,d=l==Q,f=c==l;if(f&&O(e)){if(!O(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Stack,o||F(e)?equalArrays(e,t,n,r,i,a):equalByTag(e,t,c,n,r,i,a);if(!(n&Yt)){var m=u&&Qt.call(e,`__wrapped__`),h=d&&Qt.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new Stack,i(g,_,n,r,a)}}return f?(a||=new Stack,equalObjects(e,t,n,r,i,a)):!1}function baseIsEqual(e,t,n,r,i){return e===t?!0:e==null||t==null||!isObjectLike(e)&&!isObjectLike(t)?e!==e&&t!==t:baseIsEqualDeep(e,t,n,r,baseIsEqual,i)}var $t=1,en=2;function baseIsMatch(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Stack;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?baseIsEqual(u,l,$t|en,r,d):f))return!1}}return!0}function isStrictComparable(e){return e===e&&!isObject(e)}function getMatchData(e){for(var t=keys(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,isStrictComparable(i)]}return t}function matchesStrictComparable(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function baseMatches(e){var t=getMatchData(e);return t.length==1&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(n){return n===e||baseIsMatch(n,e,t)}}function baseHasIn(e,t){return e!=null&&t in Object(e)}function hasPath(e,t,n){t=castPath(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=toKey(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&isLength(i)&&isIndex(o,i)&&(p(e)||E(e)))}function hasIn(e,t){return e!=null&&hasPath(e,t,baseHasIn)}var tn=1,nn=2;function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(n){var r=get(n,e);return r===void 0&&r===t?hasIn(n,e):baseIsEqual(t,r,tn|nn)}}function baseProperty(e){return function(t){return t?.[e]}}function basePropertyDeep(e){return function(t){return baseGet(t,e)}}function property(e){return isKey(e)?baseProperty(toKey(e)):basePropertyDeep(e)}function baseIteratee(e){return typeof e==`function`?e:e==null?identity:typeof e==`object`?p(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function createBaseFor(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var rn=createBaseFor();function baseForOwn(e,t){return e&&rn(e,t,keys)}function createBaseEach(e,t){return function(n,r){if(n==null)return n;if(!isArrayLike(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var $=createBaseEach(baseForOwn);function castFunction(e){return typeof e==`function`?e:identity}function forEach(e,t){return(p(e)?arrayEach:$)(e,castFunction(t))}function arrayEvery(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function baseEvery(e,t){var n=!0;return $(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function every(e,t,n){var r=p(e)?arrayEvery:baseEvery;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function baseMap(e,t){var n=-1,r=isArrayLike(e)?Array(e.length):[];return $(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function map(e,t){return(p(e)?arrayMap:baseMap)(e,baseIteratee(t,3))}var an=`[object String]`;function isString(e){return typeof e==`string`||!p(e)&&isObjectLike(e)&&baseGetTag(e)==an}function baseValues(e,t){return arrayMap(t,function(t){return e[t]})}function values(e){return e==null?[]:baseValues(e,keys(e))}var on=Math.max;function includes(e,t,n,r){e=isArrayLike(e)?e:values(e),n=n&&!r?toInteger(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),isString(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&baseIndexOf(e,t,n)>-1}var sn=`[object RegExp]`;function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==sn}var cn=N&&N.isRegExp,ln=cn?baseUnary(cn):baseIsRegExp;function baseSet(e,t,n,r){if(!isObject(e))return e;t=castPath(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=toKey(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=isObject(u)?u:isIndex(t[i+1])?[]:{})}assignValue(s,c,l),s=s[c]}return e}function basePickBy(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=baseGet(e,o);n(s,o)&&baseSet(a,castPath(o,e),s)}return a}function pickBy(e,t){if(e==null)return{};var n=arrayMap(getAllKeysIn(e),function(e){return[e]});return t=baseIteratee(t),basePickBy(e,n,function(e,n){return t(e,n[0])})}function baseSome(e,t){var n;return $(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function some(e,t,n){var r=p(e)?arraySome:baseSome;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function tokenLabel(e){return hasTokenLabel(e)?e.LABEL:e.name}function hasTokenLabel(e){return isString(e.LABEL)&&e.LABEL!==``}var AbstractProduction=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),forEach(this.definition,t=>{t.accept(e)})}},NonTerminal=class extends AbstractProduction{constructor(e){super([]),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},Rule=class extends AbstractProduction{constructor(e){super(e.definition),this.orgText=``,I(this,pickBy(e,e=>e!==void 0))}},Alternative=class extends AbstractProduction{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,I(this,pickBy(e,e=>e!==void 0))}},Option=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatory=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatoryWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Repetition=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Alternation=class extends AbstractProduction{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,I(this,pickBy(e,e=>e!==void 0))}},Terminal=class{constructor(e){this.idx=1,I(this,pickBy(e,e=>e!==void 0))}accept(e){e.visit(this)}};function serializeGrammar(e){return map(e,serializeProduction)}function serializeProduction(e){function convertDefinition(e){return map(e,serializeProduction)}if(e instanceof NonTerminal){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return isString(e.label)&&(t.label=e.label),t}else if(e instanceof Alternative)return{type:`Alternative`,definition:convertDefinition(e.definition)};else if(e instanceof Option)return{type:`Option`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof RepetitionMandatory)return{type:`RepetitionMandatory`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof RepetitionMandatoryWithSeparator)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};else if(e instanceof RepetitionWithSeparator)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};else if(e instanceof Repetition)return{type:`Repetition`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof Alternation)return{type:`Alternation`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof Terminal){let t={type:`Terminal`,name:e.terminalType.name,label:tokenLabel(e.terminalType),idx:e.idx};isString(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ln(n)?n.source:n),t}else if(e instanceof Rule)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:convertDefinition(e.definition)};else throw Error(`non exhaustive match`)}var GAstVisitor=class{visit(e){let t=e;switch(t.constructor){case NonTerminal:return this.visitNonTerminal(t);case Alternative:return this.visitAlternative(t);case Option:return this.visitOption(t);case RepetitionMandatory:return this.visitRepetitionMandatory(t);case RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Repetition:return this.visitRepetition(t);case Alternation:return this.visitAlternation(t);case Terminal:return this.visitTerminal(t);case Rule:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function isSequenceProd(e){return e instanceof Alternative||e instanceof Option||e instanceof Repetition||e instanceof RepetitionMandatory||e instanceof RepetitionMandatoryWithSeparator||e instanceof RepetitionWithSeparator||e instanceof Terminal||e instanceof Rule}function isOptionalProd(e,t=[]){return e instanceof Option||e instanceof Repetition||e instanceof RepetitionWithSeparator?!0:e instanceof Alternation?some(e.definition,e=>isOptionalProd(e,t)):e instanceof NonTerminal&&includes(t,e)?!1:e instanceof AbstractProduction?(e instanceof NonTerminal&&t.push(e),every(e.definition,e=>isOptionalProd(e,t))):!1}function isBranchingProd(e){return e instanceof Alternation}function getProductionDslName(e){if(e instanceof NonTerminal)return`SUBRULE`;if(e instanceof Option)return`OPTION`;if(e instanceof Alternation)return`OR`;if(e instanceof RepetitionMandatory)return`AT_LEAST_ONE`;if(e instanceof RepetitionMandatoryWithSeparator)return`AT_LEAST_ONE_SEP`;if(e instanceof RepetitionWithSeparator)return`MANY_SEP`;if(e instanceof Repetition)return`MANY`;if(e instanceof Terminal)return`CONSUME`;throw Error(`non exhaustive match`)}export{isIterateeCall as $,cacheHas as A,Stack as B,map as C,baseIteratee as D,$ as E,getAllKeysIn as F,keys as G,arrayPush as H,getAllKeys as I,N as J,baseKeys as K,B as L,X as M,Y as N,hasPath as O,U as P,isPrototype as Q,z as R,isString as S,forEach as T,keysIn as U,bt as V,I as W,O as X,baseUnary as Y,E as Z,some as _,n as _t,GAstVisitor as a,baseAssignValue as at,includes as b,NonTerminal as c,arrayEach as ct,RepetitionMandatory as d,toInteger as dt,isArrayLike as et,RepetitionMandatoryWithSeparator as f,isObject as ft,serializeGrammar as g,r as gt,Terminal as h,isObjectLike as ht,isSequenceProd as i,eq as it,SetCache as j,setToArray as k,Option as l,isFunction as lt,Rule as m,arrayMap as mt,isBranchingProd as n,copyObject as nt,Alternation as o,baseIndexOf as ot,RepetitionWithSeparator as p,p as pt,F as q,isOptionalProd as r,assignValue as rt,Alternative as s,baseFindIndex as st,getProductionDslName as t,baseRest as tt,Repetition as u,identity as ut,pickBy as v,every as w,values as x,ln as y,arrayFilter as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../rolldown-runtime.mjs";function createMap(){return new e}var e=class IndexedMap{index={};array=[];size(){return this.array.length}empty(){return this.array.length===0}itemAt(e){return this.array[e]}contains(e){return this.index[e.id()]!==void 0}find(e){let t=this.index[e.id()];return t===void 0?void 0:this.array[t]}setDefault(e,n){let r=this.index[e.id()];if(r===void 0){let r=new t(e,n());return this.index[e.id()]=this.array.length,this.array.push(r),r}else return this.array[r]}insert(e,n){let r=new t(e,n),i=this.index[e.id()];return i===void 0?(this.index[e.id()]=this.array.length,this.array.push(r)):this.array[i]=r,r}erase(e){let t=this.index[e.id()];if(t===void 0)return;this.index[e.id()]=void 0;let n=this.array[t],r=this.array.pop();return n!==r&&(this.array[t]=r,this.index[r.first.id()]=t),n}copy(){let e=new IndexedMap;for(let t=0;t<this.array.length;t++){let n=this.array[t].copy();e.array[t]=n,e.index[n.first.id()]=t}return e}},t=class Pair{first;second;constructor(e,t){this.first=e,this.second=t}copy(){return new Pair(this.first,this.second)}},Variable=class{constructor(e=``){this._name=e}id(){return this._id}name(){return this._name}setName(e){this._name=e}context(){return this._context}setContext(e){this._context=e}value(){return this._value}setValue(e){this._value=e}plus(e){return new r(this,e)}minus(e){return new r(this,typeof e==`number`?-e:[-1,e])}multiply(e){return new r([e,this])}divide(e){return new r([1/e,this])}toJSON(){return{name:this._name,value:this._value}}toString(){return this._context+`[`+this._name+`:`+this._value+`]`}_name;_value=0;_context=null;_id=n++};let n=0;var r=class Expression{constructor(){let e=parseArgs(arguments);this._terms=e.terms,this._constant=e.constant}terms(){return this._terms}constant(){return this._constant}value(){let e=this._constant;for(let t=0,n=this._terms.size();t<n;t++){let n=this._terms.itemAt(t);e+=n.first.value()*n.second}return e}plus(e){return new Expression(this,e)}minus(e){return new Expression(this,typeof e==`number`?-e:[-1,e])}multiply(e){return new Expression([e,this])}divide(e){return new Expression([1/e,this])}isConstant(){return this._terms.size()==0}toString(){let e=this._terms.array.map(function(e){return e.second+`*`+e.first.toString()}).join(` + `);return!this.isConstant()&&this._constant!==0&&(e+=` + `),e+=this._constant,e}_terms;_constant};function parseArgs(e){let t=0,factory=()=>0,n=createMap();for(let i=0,a=e.length;i<a;++i){let a=e[i];if(typeof a==`number`)t+=a;else if(a instanceof Variable)n.setDefault(a,factory).second+=1;else if(a instanceof r){t+=a.constant();let e=a.terms();for(let t=0,r=e.size();t<r;t++){let r=e.itemAt(t);n.setDefault(r.first,factory).second+=r.second}}else if(a instanceof Array){if(a.length!==2)throw Error(`array must have length 2`);let e=a[0],i=a[1];if(typeof e!=`number`)throw Error(`array item 0 must be a number`);if(i instanceof Variable)n.setDefault(i,factory).second+=e;else if(i instanceof r){t+=i.constant()*e;let r=i.terms();for(let t=0,i=r.size();t<i;t++){let i=r.itemAt(t);n.setDefault(i.first,factory).second+=i.second*e}}else throw Error(`array item 1 must be a variable or expression`)}else throw Error(`invalid Expression argument: `+a)}return{terms:n,constant:t}}var i=class Strength{static create(e,t,n,r=1){let i=0;return i+=Math.max(0,Math.min(1e3,e*r))*1e6,i+=Math.max(0,Math.min(1e3,t*r))*1e3,i+=Math.max(0,Math.min(1e3,n*r)),i}static required=Strength.create(1e3,1e3,1e3);static strong=Strength.create(1,0,0);static medium=Strength.create(0,1,0);static weak=Strength.create(0,0,1);static clip(e){return Math.max(0,Math.min(Strength.required,e))}},a;(function(e){e[e.Le=0]=`Le`,e[e.Ge=1]=`Ge`,e[e.Eq=2]=`Eq`})(a||={});var Constraint=class{constructor(e,t,n,a=i.required){this._operator=t,this._strength=i.clip(a),n===void 0&&e instanceof r?this._expression=e:this._expression=e.minus(n)}id(){return this._id}expression(){return this._expression}op(){return this._operator}strength(){return this._strength}toString(){return this._expression.toString()+` `+[`<=`,`>=`,`=`][this._operator]+` 0 (`+this._strength.toString()+`)`}_expression;_operator;_strength;_id=o++};let o=0;var Solver=class{maxIterations=1e3;constructor(){}createConstraint(e,t,n,r=i.required){let a=new Constraint(e,t,n,r);return this.addConstraint(a),a}addConstraint(e){if(this._cnMap.find(e)!==void 0)throw Error(`duplicate constraint`);let t=this._createRow(e),n=t.row,r=t.tag,i=this._chooseSubject(n,r);if(i.type()===s.Invalid&&n.allDummies())if(nearZero(n.constant()))i=r.marker;else throw Error(`unsatisfiable constraint`);if(i.type()===s.Invalid){if(!this._addWithArtificialVariable(n))throw Error(`unsatisfiable constraint`)}else n.solveFor(i),this._substitute(i,n),this._rowMap.insert(i,n);this._cnMap.insert(e,r),this._optimize(this._objective)}removeConstraint(e){let t=this._cnMap.erase(e);if(t===void 0)throw Error(`unknown constraint`);this._removeConstraintEffects(e,t.second);let n=t.second.marker,r=this._rowMap.erase(n);if(r===void 0){let e=this._getMarkerLeavingSymbol(n);if(e.type()===s.Invalid)throw Error(`failed to find leaving row`);r=this._rowMap.erase(e),r.second.solveForEx(e,n),this._substitute(n,r.second)}this._optimize(this._objective)}hasConstraint(e){return this._cnMap.contains(e)}getConstraints(){return this._cnMap.array.map(({first:e})=>e)}addEditVariable(e,t){if(this._editMap.find(e)!==void 0)throw Error(`duplicate edit variable`);if(t=i.clip(t),t===i.required)throw Error(`bad required strength`);let n=new Constraint(new r(e),a.Eq,void 0,t);this.addConstraint(n);let o={tag:this._cnMap.find(n).second,constraint:n,constant:0};this._editMap.insert(e,o)}removeEditVariable(e){let t=this._editMap.erase(e);if(t===void 0)throw Error(`unknown edit variable`);this.removeConstraint(t.second.constraint)}hasEditVariable(e){return this._editMap.contains(e)}suggestValue(e,t){let n=this._editMap.find(e);if(n===void 0)throw Error(`unknown edit variable`);let r=this._rowMap,i=n.second,a=t-i.constant;i.constant=t;let o=i.tag.marker,c=r.find(o);if(c!==void 0){c.second.add(-a)<0&&this._infeasibleRows.push(o),this._dualOptimize();return}let l=i.tag.other;if(c=r.find(l),c!==void 0){c.second.add(a)<0&&this._infeasibleRows.push(l),this._dualOptimize();return}for(let e=0,t=r.size();e<t;++e){let t=r.itemAt(e),n=t.second,i=n.coefficientFor(o);i!==0&&n.add(a*i)<0&&t.first.type()!==s.External&&this._infeasibleRows.push(t.first)}this._dualOptimize()}updateVariables(){let e=this._varMap,t=this._rowMap;for(let n=0,r=e.size();n<r;++n){let r=e.itemAt(n),i=t.find(r.second);i===void 0?r.first.setValue(0):r.first.setValue(i.second.constant())}}_getVarSymbol(e){let factory=()=>this._makeSymbol(s.External);return this._varMap.setDefault(e,factory).second}_createRow(e){let t=e.expression(),n=new l(t.constant()),r=t.terms();for(let e=0,t=r.size();e<t;++e){let t=r.itemAt(e);if(!nearZero(t.second)){let e=this._getVarSymbol(t.first),r=this._rowMap.find(e);r===void 0?n.insertSymbol(e,t.second):n.insertRow(r.second,t.second)}}let o=this._objective,u=e.strength(),d={marker:c,other:c};switch(e.op()){case a.Le:case a.Ge:{let t=e.op()===a.Le?1:-1,r=this._makeSymbol(s.Slack);if(d.marker=r,n.insertSymbol(r,t),u<i.required){let e=this._makeSymbol(s.Error);d.other=e,n.insertSymbol(e,-t),o.insertSymbol(e,u)}break}case a.Eq:if(u<i.required){let e=this._makeSymbol(s.Error),t=this._makeSymbol(s.Error);d.marker=e,d.other=t,n.insertSymbol(e,-1),n.insertSymbol(t,1),o.insertSymbol(e,u),o.insertSymbol(t,u)}else{let e=this._makeSymbol(s.Dummy);d.marker=e,n.insertSymbol(e)}break}return n.constant()<0&&n.reverseSign(),{row:n,tag:d}}_chooseSubject(e,t){let n=e.cells();for(let e=0,t=n.size();e<t;++e){let t=n.itemAt(e);if(t.first.type()===s.External)return t.first}let r=t.marker.type();return(r===s.Slack||r===s.Error)&&e.coefficientFor(t.marker)<0?t.marker:(r=t.other.type(),(r===s.Slack||r===s.Error)&&e.coefficientFor(t.other)<0?t.other:c)}_addWithArtificialVariable(e){let t=this._makeSymbol(s.Slack);this._rowMap.insert(t,e.copy()),this._artificial=e.copy(),this._optimize(this._artificial);let n=nearZero(this._artificial.constant());this._artificial=null;let r=this._rowMap.erase(t);if(r!==void 0){let e=r.second;if(e.isConstant())return n;let i=this._anyPivotableSymbol(e);if(i.type()===s.Invalid)return!1;e.solveForEx(t,i),this._substitute(i,e),this._rowMap.insert(i,e)}let i=this._rowMap;for(let e=0,n=i.size();e<n;++e)i.itemAt(e).second.removeSymbol(t);return this._objective.removeSymbol(t),n}_substitute(e,t){let n=this._rowMap;for(let r=0,i=n.size();r<i;++r){let i=n.itemAt(r);i.second.substitute(e,t),i.second.constant()<0&&i.first.type()!==s.External&&this._infeasibleRows.push(i.first)}this._objective.substitute(e,t),this._artificial&&this._artificial.substitute(e,t)}_optimize(e){let t=0;for(;t<this.maxIterations;){let n=this._getEnteringSymbol(e);if(n.type()===s.Invalid)return;let r=this._getLeavingSymbol(n);if(r.type()===s.Invalid)throw Error(`the objective is unbounded`);let i=this._rowMap.erase(r).second;i.solveForEx(r,n),this._substitute(n,i),this._rowMap.insert(n,i),t++}throw Error(`solver iterations exceeded`)}_dualOptimize(){let e=this._rowMap,t=this._infeasibleRows;for(;t.length!==0;){let n=t.pop(),r=e.find(n);if(r!==void 0&&r.second.constant()<0){let t=this._getDualEnteringSymbol(r.second);if(t.type()===s.Invalid)throw Error(`dual optimize failed`);let i=r.second;e.erase(n),i.solveForEx(n,t),this._substitute(t,i),e.insert(t,i)}}}_getEnteringSymbol(e){let t=e.cells();for(let e=0,n=t.size();e<n;++e){let n=t.itemAt(e),r=n.first;if(n.second<0&&r.type()!==s.Dummy)return r}return c}_getDualEnteringSymbol(e){let t=Number.MAX_VALUE,n=c,r=e.cells();for(let e=0,i=r.size();e<i;++e){let i=r.itemAt(e),a=i.first,o=i.second;if(o>0&&a.type()!==s.Dummy){let e=this._objective.coefficientFor(a)/o;e<t&&(t=e,n=a)}}return n}_getLeavingSymbol(e){let t=Number.MAX_VALUE,n=c,r=this._rowMap;for(let i=0,a=r.size();i<a;++i){let a=r.itemAt(i),o=a.first;if(o.type()!==s.External){let r=a.second,i=r.coefficientFor(e);if(i<0){let e=-r.constant()/i;e<t&&(t=e,n=o)}}}return n}_getMarkerLeavingSymbol(e){let t=Number.MAX_VALUE,n=t,r=t,i=c,a=i,o=i,l=i,u=this._rowMap;for(let t=0,i=u.size();t<i;++t){let i=u.itemAt(t),c=i.second,d=c.coefficientFor(e);if(d===0)continue;let f=i.first;if(f.type()===s.External)l=f;else if(d<0){let e=-c.constant()/d;e<n&&(n=e,a=f)}else{let e=c.constant()/d;e<r&&(r=e,o=f)}}return a===i?o===i?l:o:a}_removeConstraintEffects(e,t){t.marker.type()===s.Error&&this._removeMarkerEffects(t.marker,e.strength()),t.other.type()===s.Error&&this._removeMarkerEffects(t.other,e.strength())}_removeMarkerEffects(e,t){let n=this._rowMap.find(e);n===void 0?this._objective.insertSymbol(e,-t):this._objective.insertRow(n.second,-t)}_anyPivotableSymbol(e){let t=e.cells();for(let e=0,n=t.size();e<n;++e){let n=t.itemAt(e),r=n.first.type();if(r===s.Slack||r===s.Error)return n.first}return c}_makeSymbol(e){return new Symbol(e,this._idTick++)}_cnMap=createCnMap();_rowMap=createRowMap();_varMap=createVarMap();_editMap=createEditMap();_infeasibleRows=[];_objective=new l;_artificial=null;_idTick=0};function nearZero(e){let t=1e-8;return e<0?-e<t:e<t}function createCnMap(){return createMap()}function createRowMap(){return createMap()}function createVarMap(){return createMap()}function createEditMap(){return createMap()}var s;(function(e){e[e.Invalid=0]=`Invalid`,e[e.External=1]=`External`,e[e.Slack=2]=`Slack`,e[e.Error=3]=`Error`,e[e.Dummy=4]=`Dummy`})(s||={});var Symbol=class{constructor(e,t){this._id=t,this._type=e}id(){return this._id}type(){return this._type}_id;_type};let c=new Symbol(s.Invalid,-1);var l=class Row{constructor(e=0){this._constant=e}cells(){return this._cellMap}constant(){return this._constant}isConstant(){return this._cellMap.empty()}allDummies(){let e=this._cellMap;for(let t=0,n=e.size();t<n;++t)if(e.itemAt(t).first.type()!==s.Dummy)return!1;return!0}copy(){let e=new Row(this._constant);return e._cellMap=this._cellMap.copy(),e}add(e){return this._constant+=e}insertSymbol(e,t=1){let n=this._cellMap.setDefault(e,()=>0);nearZero(n.second+=t)&&this._cellMap.erase(e)}insertRow(e,t=1){this._constant+=e._constant*t;let n=e._cellMap;for(let e=0,r=n.size();e<r;++e){let r=n.itemAt(e);this.insertSymbol(r.first,r.second*t)}}removeSymbol(e){this._cellMap.erase(e)}reverseSign(){this._constant=-this._constant;let e=this._cellMap;for(let t=0,n=e.size();t<n;++t){let n=e.itemAt(t);n.second=-n.second}}solveFor(e){let t=this._cellMap,n=-1/t.erase(e).second;this._constant*=n;for(let e=0,r=t.size();e<r;++e)t.itemAt(e).second*=n}solveForEx(e,t){this.insertSymbol(e,-1),this.solveFor(t)}coefficientFor(e){let t=this._cellMap.find(e);return t===void 0?0:t.second}substitute(e,t){let n=this._cellMap.erase(e);n!==void 0&&this.insertRow(t,n.second)}_cellMap=createMap();_constant};export{Variable as a,i,Constraint as n,a as r,Solver as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,t}from"../rolldown-runtime.mjs";var n=t((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePath=t.convertSlashes=t.cleanPath=void 0;let n=e(`node:path`);function cleanPath(e){let t=(0,n.normalize)(e);return t.length>1&&t[t.length-1]===n.sep&&(t=t.substring(0,t.length-1)),t}t.cleanPath=cleanPath;let r=/[\\/]/g;function convertSlashes(e,t){return e.replace(r,t)}t.convertSlashes=convertSlashes;function normalizePath(e,t){let{resolvePaths:r,normalizePath:i,pathSeparator:a}=t,o=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return r&&(e=(0,n.resolve)(e)),(i||o)&&(e=cleanPath(e)),e===`.`?``:convertSlashes(e[e.length-1]===a?e:e+a,a)}t.normalizePath=normalizePath})),r=t((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.build=t.joinDirectoryPath=t.joinPathWithBasePath=void 0;let r=e(`node:path`),i=n();function joinPathWithBasePath(e,t){return t+e}t.joinPathWithBasePath=joinPathWithBasePath;function joinPathWithRelativePath(e,t){return function(n,a){return a.startsWith(e)?a.replace(e,``)+n:(0,i.convertSlashes)((0,r.relative)(e,a),t.pathSeparator)+t.pathSeparator+n}}function joinPath(e){return e}function joinDirectoryPath(e,t,n){return t+e+n}t.joinDirectoryPath=joinDirectoryPath;function build(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?joinPathWithRelativePath(e,t):r?joinPathWithBasePath:joinPath}t.build=build})),i=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.build=void 0;function pushDirectoryWithRelativePath(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function pushDirectoryFilterWithRelativePath(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}let pushDirectory=(e,t)=>{t.push(e||`.`)},pushDirectoryFilter=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},empty=()=>{};function build(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?pushDirectoryFilterWithRelativePath(e):pushDirectoryWithRelativePath(e):r&&r.length?pushDirectoryFilter:pushDirectory:empty}e.build=build})),a=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.build=void 0;let pushFileFilterAndCount=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},pushFileFilter=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},pushFileCount=(e,t,n,r)=>{n.files++},pushFile=(e,t)=>{t.push(e)},empty=()=>{};function build(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?empty:n&&n.length?r?pushFileFilterAndCount:pushFileFilter:r?pushFileCount:pushFile}e.build=build})),o=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.build=void 0;let getArray=e=>e,getArrayGroup=()=>[``].slice(0,0);function build(e){return e.group?getArrayGroup:getArray}e.build=build})),s=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.build=void 0;let groupFiles=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},empty=()=>{};function build(e){return e.group?groupFiles:empty}e.build=build})),c=t((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.build=void 0;let r=n(e(`node:fs`)),resolveSymlinksAsync=function(e,t,n){let{queue:i,options:{suppressErrors:a}}=t;i.enqueue(),r.default.stat(e,(r,o)=>{if(r){i.dequeue(a?null:r,t);return}n(o,e),i.dequeue(null,t)})},resolveSymlinksWithRealPathsAsync=function(e,t,n){let{queue:i,options:{suppressErrors:a}}=t;i.enqueue(),r.default.realpath(e,(e,o)=>{if(e){i.dequeue(a?null:e,t);return}r.default.lstat(o,(e,r)=>{n(r,o),i.dequeue(null,t)})})},resolveSymlinksSync=function(e,t,n){try{n(r.default.statSync(e),e)}catch(e){if(!t.options.suppressErrors)throw e}},resolveSymlinksWithRealPathsSync=function(e,t,n){try{let t=r.default.realpathSync(e);n(r.default.lstatSync(t),t)}catch(e){if(!t.options.suppressErrors)throw e}};function build(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:e.useRealPaths?t?resolveSymlinksWithRealPathsSync:resolveSymlinksWithRealPathsAsync:t?resolveSymlinksSync:resolveSymlinksAsync}t.build=build})),l=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.build=void 0;let onlyCountsSync=e=>e.counts,groupsSync=e=>e.groups,defaultSync=e=>e.paths,limitFilesSync=e=>e.paths.slice(0,e.options.maxFiles),onlyCountsAsync=(e,t,n)=>(report(t,n,e.counts,e.options.suppressErrors),null),defaultAsync=(e,t,n)=>(report(t,n,e.paths,e.options.suppressErrors),null),limitFilesAsync=(e,t,n)=>(report(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),groupsAsync=(e,t,n)=>(report(t,n,e.groups,e.options.suppressErrors),null);function report(e,t,n,r){t(e&&!r?e:null,n)}function build(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?onlyCountsSync:onlyCountsAsync:r?t?groupsSync:groupsAsync:i?t?limitFilesSync:limitFilesAsync:t?defaultSync:defaultAsync}e.build=build})),u=t((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.build=void 0;let r=n(e(`node:fs`)),i={withFileTypes:!0},walkAsync=(e,t,n,a)=>{if(e.queue.enqueue(),n<0){e.queue.dequeue(null,e);return}e.counts.directories++,r.default.readdir(t||`.`,i,function process(r,i=[]){a(i,t,n),e.queue.dequeue(e.options.suppressErrors?null:r,e)})},walkSync=(e,t,n,a)=>{if(n<0)return;e.counts.directories++;let o=[];try{o=r.default.readdirSync(t||`.`,i)}catch(t){if(!e.options.suppressErrors)throw t}a(o,t,n)};function build(e){return e?walkSync:walkAsync}t.build=build})),d=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Queue=void 0;var Queue=class{onQueueEmpty;count=0;constructor(e){this.onQueueEmpty=e}enqueue(){this.count++}dequeue(e,t){(--this.count===0||e)&&this.onQueueEmpty(e,t)}};e.Queue=Queue})),f=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Counter=void 0;var Counter=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}};e.Counter=Counter})),p=t((t=>{var p=t&&t.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),m=t&&t.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),h=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&p(t,e,n);return m(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Walker=void 0;let g=e(`node:path`),_=n(),v=h(r()),y=h(i()),b=h(a()),x=h(o()),S=h(s()),C=h(c()),w=h(l()),T=h(u()),E=d(),D=f();var Walker=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=w.build(t,this.isSynchronous),this.state={paths:[``].slice(0,0),groups:[],counts:new D.Counter,options:t,queue:new E.Queue((e,t)=>this.callbackInvoker(t,e,n))},this.root=(0,_.normalizePath)(e,this.state.options),this.joinPath=v.build(this.root,t),this.pushDirectory=y.build(this.root,t),this.pushFile=b.build(t),this.getArray=x.build(t),this.groupFiles=S.build(t),this.resolveSymlink=C.build(t,this.isSynchronous),this.walkDirectory=T.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l}}=this.state;if(l&&l.aborted||c&&r.length>c)return;this.pushDirectory(t,r,i);let u=this.getArray(this.state.paths);for(let r=0;r<e.length;++r){let c=e[r];if(c.isFile()||c.isSymbolicLink()&&!a&&!o){let e=this.joinPath(c.name,t);this.pushFile(e,u,this.state.counts,i)}else if(c.isDirectory()){let e=v.joinDirectoryPath(c.name,t,this.state.options.pathSeparator);if(s&&s(c.name,e))continue;this.walkDirectory(this.state,e,n-1,this.walk)}else if(c.isSymbolicLink()&&this.resolveSymlink){let e=v.joinPathWithBasePath(c.name,t);this.resolveSymlink(e,this.state,(e,t)=>{if(e.isDirectory()){if(t=(0,_.normalizePath)(t,this.state.options),s&&s(c.name,t))return;this.walkDirectory(this.state,t,n-1,this.walk)}else{let e=(0,g.basename)(t),n=(0,_.normalizePath)((0,g.dirname)(t),this.state.options);t=this.joinPath(e,n),this.pushFile(t,u,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,u)}};t.Walker=Walker})),m=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callback=e.promise=void 0;let t=p();function promise(e,t){return new Promise((n,r)=>{callback(e,t,(e,t)=>{if(e)return r(e);n(t)})})}e.promise=promise;function callback(e,n,r){new t.Walker(e,n,r).start()}e.callback=callback})),h=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sync=void 0;let t=p();function sync(e,n){return new t.Walker(e,n).start()}e.sync=sync})),g=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.APIBuilder=void 0;let t=m(),n=h();var APIBuilder=class{root;options;constructor(e,t){this.root=e,this.options=t}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(e){(0,t.callback)(this.root,this.options,e)}sync(){return(0,n.sync)(this.root,this.options)}};e.APIBuilder=APIBuilder})),_=t(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),v=t((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=_();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),y=t(((e,t)=>{let n=v(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:y}=_(),isPathSeparator=e=>e===l||e===a,depth=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},scan=(e,t)=>{let _=t||{},v=e.length-1,b=_.parts===!0||_.scanToEnd===!0,x=[],S=[],C=[],w=e,T=-1,E=0,D=0,O=!1,k=!1,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=0,z,B,V={value:``,depth:0,isGlob:!1},eos=()=>T>=v,peek=()=>w.charCodeAt(T+1),advance=()=>(z=B,w.charCodeAt(++T));for(;T<v;){B=advance();let e;if(B===a){P=V.backslashes=!0,B=advance(),B===u&&(N=!0);continue}if(N===!0||B===u){for(R++;eos()!==!0&&(B=advance());){if(B===a){P=V.backslashes=!0,advance();continue}if(B===u){R++;continue}if(N!==!0&&B===s&&(B=advance())===s){if(O=V.isBrace=!0,A=V.isGlob=!0,L=!0,b===!0)continue;break}if(N!==!0&&B===o){if(O=V.isBrace=!0,A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===h&&(R--,R===0)){N=!1,O=V.isBrace=!0,L=!0;break}}if(b===!0)continue;break}if(B===l){if(x.push(T),S.push(V),V={value:``,depth:0,isGlob:!1},L===!0)continue;if(z===s&&T===E+1){E+=2;continue}D=T+1;continue}if(_.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&peek()===d){if(A=V.isGlob=!0,j=V.isExtglob=!0,L=!0,B===c&&T===E&&(I=!0),b===!0){for(;eos()!==!0&&(B=advance());){if(B===a){P=V.backslashes=!0,B=advance();continue}if(B===g){A=V.isGlob=!0,L=!0;break}}continue}break}if(B===r){if(z===r&&(M=V.isGlobstar=!0),A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===m){if(A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===f){for(;eos()!==!0&&(e=advance());){if(e===a){P=V.backslashes=!0,advance();continue}if(e===y){k=V.isBracket=!0,A=V.isGlob=!0,L=!0;break}}if(b===!0)continue;break}if(_.nonegate!==!0&&B===c&&T===E){F=V.negated=!0,E++;continue}if(_.noparen!==!0&&B===d){if(A=V.isGlob=!0,b===!0){for(;eos()!==!0&&(B=advance());){if(B===d){P=V.backslashes=!0,B=advance();continue}if(B===g){L=!0;break}}continue}break}if(A===!0){if(L=!0,b===!0)continue;break}}_.noext===!0&&(j=!1,A=!1);let H=w,U=``,W=``;E>0&&(U=w.slice(0,E),w=w.slice(E),D-=E),H&&A===!0&&D>0?(H=w.slice(0,D),W=w.slice(D)):A===!0?(H=``,W=w):H=w,H&&H!==``&&H!==`/`&&H!==w&&isPathSeparator(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),_.unescape===!0&&(W&&=n.removeBackslashes(W),H&&P===!0&&(H=n.removeBackslashes(H)));let G={prefix:U,input:e,start:E,base:H,glob:W,isBrace:O,isBracket:k,isGlob:A,isExtglob:j,isGlobstar:M,negated:F,negatedExtglob:I};if(_.tokens===!0&&(G.maxDepth=0,isPathSeparator(B)||S.push(V),G.tokens=S),_.parts===!0||_.tokens===!0){let t;for(let n=0;n<x.length;n++){let r=t?t+1:E,i=x[n],a=e.slice(r,i);_.tokens&&(n===0&&E!==0?(S[n].isPrefix=!0,S[n].value=U):S[n].value=a,depth(S[n]),G.maxDepth+=S[n].depth),(n!==0||a!==``)&&C.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);C.push(n),_.tokens&&(S[S.length-1].value=n,depth(S[S.length-1]),G.maxDepth+=S[S.length-1].depth)}G.slashes=x,G.parts=C}return G};t.exports=scan})),b=t(((e,t)=>{let n=_(),r=v(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,expandRange=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,splitTopLevel=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},isPlainBranch=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},normalizeSimpleBranch=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(isPlainBranch(t))return t.replace(/\\(.)/g,`$1`)},hasRepeatedCharPrefixOverlap=e=>{let t=e.map(normalizeSimpleBranch).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},parseRepeatedExtglob=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},getStarExtglobSequenceOutput=e=>{let t=0,n=[];for(;t<e.length;){let r=parseRepeatedExtglob(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=splitTopLevel(r.body).map(e=>e.trim());if(i.length!==1)return;let a=normalizeSimpleBranch(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},repeatedExtglobRecursion=e=>{let t=0,n=e.trim(),r=parseRepeatedExtglob(n);for(;r;)t++,n=r.body.trim(),r=parseRepeatedExtglob(n);return t},analyzeRepeatedExtglob=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=splitTopLevel(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||hasRepeatedCharPrefixOverlap(i)))return{risky:!0};for(let e of i){let t=getStarExtglobSequenceOutput(e);if(t)return{risky:!0,safeOutput:t};if(repeatedExtglobRecursion(e)>r)return{risky:!0}}return{risky:!1}},parse=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let l={...t},u=typeof l.maxLength==`number`?Math.min(i,l.maxLength):i,d=e.length;if(d>u)throw SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${u}`);let f={type:`bos`,value:``,output:l.prepend||``},p=[f],m=l.capture?``:`?:`,h=n.globChars(l.windows),g=n.extglobChars(h),{DOT_LITERAL:_,PLUS_LITERAL:v,SLASH_LITERAL:y,ONE_CHAR:b,DOTS_SLASH:x,NO_DOT:S,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK:T,QMARK_NO_DOT:E,STAR:D,START_ANCHOR:O}=h,globstar=e=>`(${m}(?:(?!${O}${e.dot?x:_}).)*?)`,k=l.dot?``:S,A=l.dot?T:E,j=l.bash===!0?globstar(l):D;l.capture&&(j=`(${j})`),typeof l.noext==`boolean`&&(l.noextglob=l.noext);let M={input:e,index:-1,start:0,dot:l.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:p};e=r.removePrefix(e,M),d=e.length;let N=[],P=[],F=[],I=f,L,eos=()=>M.index===d-1,R=M.peek=(t=1)=>e[M.index+t],z=M.advance=()=>e[++M.index]||``,remaining=()=>e.slice(M.index+1),consume=(e=``,t=0)=>{M.consumed+=e,M.index+=t},append=e=>{M.output+=e.output==null?e.value:e.output,consume(e.value)},negate=()=>{let e=1;for(;R()===`!`&&(R(2)!==`(`||R(3)===`?`);)z(),M.start++,e++;return e%2==0?!1:(M.negated=!0,M.start++,!0)},increment=e=>{M[e]++,F.push(e)},decrement=e=>{M[e]--,F.pop()},push=e=>{if(I.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||N.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-I.output.length),I.type=`star`,I.value=`*`,I.output=j,M.output+=I.output)}if(N.length&&e.type!==`paren`&&(N[N.length-1].inner+=e.value),(e.value||e.output)&&append(e),I&&I.type===`text`&&e.type===`text`){I.output=(I.output||I.value)+e.value,I.value+=e.value;return}e.prev=I,p.push(e),I=e},extglobOpen=(e,t)=>{let n={...g[t],conditions:1,inner:``};n.prev=I,n.parens=M.parens,n.output=M.output,n.startIndex=M.index,n.tokensIndex=p.length;let r=(l.capture?`(`:``)+n.open;increment(`parens`),push({type:e,value:t,output:M.output?``:b}),push({type:`paren`,extglob:!0,value:z(),output:r}),N.push(n)},extglobClose=n=>{let i=e.slice(n.startIndex,M.index+1),a=analyzeRepeatedExtglob(e.slice(n.startIndex+2,M.index),l);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:b)+(l.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=p[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<p.length;e++)p[e].value=``,p[e].output=``,delete p[e].suffix;M.output=n.output+t.output,M.backtrack=!0,push({type:`paren`,extglob:!0,value:L,output:``}),decrement(`parens`);return}let o=n.close+(l.capture?`)`:``),s;if(n.type===`negate`){let e=j;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=globstar(l)),(e!==j||eos()||/^\)+$/.test(remaining()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=remaining())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${parse(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(M.negatedExtglob=!0)}push({type:`paren`,extglob:!0,value:L,output:o}),decrement(`parens`)};if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?T.repeat(a.length):``):o===0?A+(a?T.repeat(a.length):``):T.repeat(r.length):i===`.`?_.repeat(r.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return n===!0&&(i=l.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&l.contains===!0?(M.output=e,M):(M.output=r.wrapOutput(i,M,t),M)}for(;!eos();){if(L=z(),L===`\0`)continue;if(L===`\\`){let e=R();if(e===`/`&&l.bash!==!0||e===`.`||e===`;`)continue;if(!e){L+=`\\`,push({type:`text`,value:L});continue}let t=/^\\+/.exec(remaining()),n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(L+=`\\`)),l.unescape===!0?L=z():L+=z(),M.brackets===0){push({type:`text`,value:L});continue}}if(M.brackets>0&&(L!==`]`||I.value===`[`||I.value===`[^`)){if(l.posix!==!1&&L===`:`){let e=I.value.slice(1);if(e.includes(`[`)&&(I.posix=!0,e.includes(`:`))){let e=I.value.lastIndexOf(`[`),t=I.value.slice(0,e),n=a[I.value.slice(e+2)];if(n){I.value=t+n,M.backtrack=!0,z(),!f.output&&p.indexOf(I)===1&&(f.output=b);continue}}}(L===`[`&&R()!==`:`||L===`-`&&R()===`]`)&&(L=`\\${L}`),L===`]`&&(I.value===`[`||I.value===`[^`)&&(L=`\\${L}`),l.posix===!0&&L===`!`&&I.value===`[`&&(L=`^`),I.value+=L,append({value:L});continue}if(M.quotes===1&&L!==`"`){L=r.escapeRegex(L),I.value+=L,append({value:L});continue}if(L===`"`){M.quotes=M.quotes===1?0:1,l.keepQuotes===!0&&push({type:`text`,value:L});continue}if(L===`(`){increment(`parens`),push({type:`paren`,value:L});continue}if(L===`)`){if(M.parens===0&&l.strictBrackets===!0)throw SyntaxError(syntaxError(`opening`,`(`));let e=N[N.length-1];if(e&&M.parens===e.parens+1){extglobClose(N.pop());continue}push({type:`paren`,value:L,output:M.parens?`)`:`\\)`}),decrement(`parens`);continue}if(L===`[`){if(l.nobracket===!0||!remaining().includes(`]`)){if(l.nobracket!==!0&&l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`]`));L=`\\${L}`}else increment(`brackets`);push({type:`bracket`,value:L});continue}if(L===`]`){if(l.nobracket===!0||I&&I.type===`bracket`&&I.value.length===1){push({type:`text`,value:L,output:`\\${L}`});continue}if(M.brackets===0){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`opening`,`[`));push({type:`text`,value:L,output:`\\${L}`});continue}decrement(`brackets`);let e=I.value.slice(1);if(I.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(L=`/${L}`),I.value+=L,append({value:L}),l.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(I.value);if(M.output=M.output.slice(0,-I.value.length),l.literalBrackets===!0){M.output+=t,I.value=t;continue}I.value=`(${m}${t}|${I.value})`,M.output+=I.value;continue}if(L===`{`&&l.nobrace!==!0){increment(`braces`);let e={type:`brace`,value:L,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};P.push(e),push(e);continue}if(L===`}`){let e=P[P.length-1];if(l.nobrace===!0||!e){push({type:`text`,value:L,output:L});continue}let t=`)`;if(e.dots===!0){let e=p.slice(),n=[];for(let t=e.length-1;t>=0&&(p.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=expandRange(n,l),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,L=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}push({type:`brace`,value:L,output:t}),decrement(`braces`),P.pop();continue}if(L===`|`){N.length>0&&N[N.length-1].conditions++,push({type:`text`,value:L});continue}if(L===`,`){let e=L,t=P[P.length-1];t&&F[F.length-1]===`braces`&&(t.comma=!0,e=`|`),push({type:`comma`,value:L,output:e});continue}if(L===`/`){if(I.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,p.pop(),I=f;continue}push({type:`slash`,value:L,output:y});continue}if(L===`.`){if(M.braces>0&&I.type===`dot`){I.value===`.`&&(I.output=_);let e=P[P.length-1];I.type=`dots`,I.output+=L,I.value+=L,e.dots=!0;continue}if(M.braces+M.parens===0&&I.type!==`bos`&&I.type!==`slash`){push({type:`text`,value:L,output:_});continue}push({type:`dot`,value:L,output:_});continue}if(L===`?`){if(!(I&&I.value===`(`)&&l.noextglob!==!0&&R()===`(`&&R(2)!==`?`){extglobOpen(`qmark`,L);continue}if(I&&I.type===`paren`){let e=R(),t=L;(I.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(remaining()))&&(t=`\\${L}`),push({type:`text`,value:L,output:t});continue}if(l.dot!==!0&&(I.type===`slash`||I.type===`bos`)){push({type:`qmark`,value:L,output:E});continue}push({type:`qmark`,value:L,output:T});continue}if(L===`!`){if(l.noextglob!==!0&&R()===`(`&&(R(2)!==`?`||!/[!=<:]/.test(R(3)))){extglobOpen(`negate`,L);continue}if(l.nonegate!==!0&&M.index===0){negate();continue}}if(L===`+`){if(l.noextglob!==!0&&R()===`(`&&R(2)!==`?`){extglobOpen(`plus`,L);continue}if(I&&I.value===`(`||l.regex===!1){push({type:`plus`,value:L,output:v});continue}if(I&&(I.type===`bracket`||I.type===`paren`||I.type===`brace`)||M.parens>0){push({type:`plus`,value:L});continue}push({type:`plus`,value:v});continue}if(L===`@`){if(l.noextglob!==!0&&R()===`(`&&R(2)!==`?`){push({type:`at`,extglob:!0,value:L,output:``});continue}push({type:`text`,value:L});continue}if(L!==`*`){(L===`$`||L===`^`)&&(L=`\\${L}`);let e=o.exec(remaining());e&&(L+=e[0],M.index+=e[0].length),push({type:`text`,value:L});continue}if(I&&(I.type===`globstar`||I.star===!0)){I.type=`star`,I.star=!0,I.value+=L,I.output=j,M.backtrack=!0,M.globstar=!0,consume(L);continue}let t=remaining();if(l.noextglob!==!0&&/^\([^?]/.test(t)){extglobOpen(`star`,L);continue}if(I.type===`star`){if(l.noglobstar===!0){consume(L);continue}let n=I.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(l.bash===!0&&(!i||t[0]&&t[0]!==`/`)){push({type:`star`,value:L,output:``});continue}let o=M.braces>0&&(n.type===`comma`||n.type===`brace`),s=N.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){push({type:`star`,value:L,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),consume(`/**`,3)}if(n.type===`bos`&&eos()){I.type=`globstar`,I.value+=L,I.output=globstar(l),M.output=I.output,M.globstar=!0,consume(L);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&eos()){M.output=M.output.slice(0,-(n.output+I.output).length),n.output=`(?:${n.output}`,I.type=`globstar`,I.output=globstar(l)+(l.strictSlashes?`)`:`|$)`),I.value+=L,M.globstar=!0,M.output+=n.output+I.output,consume(L);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(n.output+I.output).length),n.output=`(?:${n.output}`,I.type=`globstar`,I.output=`${globstar(l)}${y}|${y}${e})`,I.value+=L,M.output+=n.output+I.output,M.globstar=!0,consume(L+z()),push({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){I.type=`globstar`,I.value+=L,I.output=`(?:^|${y}|${globstar(l)}${y})`,M.output=I.output,M.globstar=!0,consume(L+z()),push({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-I.output.length),I.type=`globstar`,I.output=globstar(l),I.value+=L,M.output+=I.output,M.globstar=!0,consume(L);continue}let n={type:`star`,value:L,output:j};if(l.bash===!0){n.output=`.*?`,(I.type===`bos`||I.type===`slash`)&&(n.output=k+n.output),push(n);continue}if(I&&(I.type===`bracket`||I.type===`paren`)&&l.regex===!0){n.output=L,push(n);continue}(M.index===M.start||I.type===`slash`||I.type===`dot`)&&(I.type===`dot`?(M.output+=C,I.output+=C):l.dot===!0?(M.output+=w,I.output+=w):(M.output+=k,I.output+=k),R()!==`*`&&(M.output+=b,I.output+=b)),push(n)}for(;M.brackets>0;){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`]`));M.output=r.escapeLast(M.output,`[`),decrement(`brackets`)}for(;M.parens>0;){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`)`));M.output=r.escapeLast(M.output,`(`),decrement(`parens`)}for(;M.braces>0;){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`}`));M.output=r.escapeLast(M.output,`{`),decrement(`braces`)}if(l.strictSlashes!==!0&&(I.type===`star`||I.type===`bracket`)&&push({type:`maybe_slash`,value:``,output:`${y}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};parse.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let globstar=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,create=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+globstar(a);case`**/*`:return`(?:${v}${globstar(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${globstar(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${globstar(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=create(t[1]);return n?n+l+t[2]:void 0}}},C=create(r.removePrefix(e,x));return C&&a.strictSlashes!==!0&&(C+=`${u}?`),C},t.exports=parse})),x=t(((e,t)=>{let n=y(),r=b(),i=v(),a=_(),isObject=e=>e&&typeof e==`object`&&!Array.isArray(e),picomatch=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>picomatch(e,t,n)),arrayMatcher=e=>{for(let t of r){let n=t(e);if(n)return n}return!1};return arrayMatcher}let r=isObject(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,o=r?picomatch.compileRe(e,t):picomatch.makeRe(e,t,!1,!0),s=o.state;delete o.state;let isIgnored=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(i.ignore,e,n)}let matcher=(n,r=!1)=>{let{isMatch:c,match:l,output:u}=picomatch.test(n,o,t,{glob:e,posix:a}),d={glob:e,state:s,regex:o,posix:a,input:n,output:u,match:l,isMatch:c};return typeof i.onResult==`function`&&i.onResult(d),c===!1?(d.isMatch=!1,r?d:!1):isIgnored(n)?(typeof i.onIgnore==`function`&&i.onIgnore(d),d.isMatch=!1,r?d:!1):(typeof i.onMatch==`function`&&i.onMatch(d),r?d:!0)};return n&&(matcher.state=s),matcher};picomatch.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},s=o.format||(a?i.toPosixSlashes:null),c=e===r,l=c&&s?s(e):e;return c===!1&&(l=s?s(e):e,c=l===r),(c===!1||o.capture===!0)&&(c=o.matchBase===!0||o.basename===!0?picomatch.matchBase(e,t,n,a):t.exec(l)),{isMatch:!!c,match:c,output:l}},picomatch.matchBase=(e,t,n)=>(t instanceof RegExp?t:picomatch.makeRe(t,n)).test(i.basename(e)),picomatch.isMatch=(e,t,n)=>picomatch(t,n)(e),picomatch.parse=(e,t)=>Array.isArray(e)?e.map(e=>picomatch.parse(e,t)):r(e,{...t,fastpaths:!1}),picomatch.scan=(e,t)=>n(e,t),picomatch.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let c=picomatch.toRegex(s,t);return r===!0&&(c.state=e),c},picomatch.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),picomatch.compileRe(a,t,n,i)},picomatch.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},picomatch.constants=a,t.exports=picomatch})),S=t(((e,t)=>{let n=x(),r=v();function picomatch(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(picomatch,n),t.exports=picomatch})),C=t((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;let n=e(`node:path`),r=g();var i=null;try{e.resolve(`picomatch`),i=S()}catch{}var Builder=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:n.sep,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new r.APIBuilder(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new r.APIBuilder(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||i;if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}};t.Builder=Builder})),w=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),T=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.fdir=void 0;let r=C();Object.defineProperty(e,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(w(),e)}));export{S as n,T as t};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{t.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,t.exports.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,t.exports.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/})),n=e(((e,n)=>{let r=t();n.exports={isSpaceSeparator(e){return typeof e==`string`&&r.Space_Separator.test(e)},isIdStartChar(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`$`||e===`_`||r.ID_Start.test(e))},isIdContinueChar(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`_`||e===``||e===``||r.ID_Continue.test(e))},isDigit(e){return typeof e==`string`&&/[0-9]/.test(e)},isHexDigit(e){return typeof e==`string`&&/[0-9A-Fa-f]/.test(e)}}})),r=e(((e,t)=>{let r=n(),i,a,o,s,c,l,u,d,f;t.exports=function parse(e,t){i=String(e),a=`start`,o=[],s=0,c=1,l=0,u=void 0,d=void 0,f=void 0;do u=lex(),y[a]();while(u.type!==`eof`);return typeof t==`function`?internalize({"":f},``,t):f};function internalize(e,t,n){let r=e[t];if(typeof r==`object`&&r)if(Array.isArray(r))for(let e=0;e<r.length;e++){let t=String(e),i=internalize(r,t,n);i===void 0?delete r[t]:Object.defineProperty(r,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}else for(let e in r){let t=internalize(r,e,n);t===void 0?delete r[e]:Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,r)}let p,m,h,g,_;function lex(){for(p=`default`,m=``,h=!1,g=1;;){_=peek();let e=v[p]();if(e)return e}}function peek(){if(i[s])return String.fromCodePoint(i.codePointAt(s))}function read(){let e=peek();return e===`
|
|
2
|
-
`?(c++,l=0):e?l+=e.length:l++,e&&(s+=e.length),e}let v={default(){switch(_){case` `:case`\v`:case`\f`:case` `:case`\xA0`:case``:case`
|
|
3
|
-
`:case`\r`:case`\u2028`:case`\u2029`:read();return;case`/`:read(),p=`comment`;return;case void 0:return read(),newToken(`eof`)}if(r.isSpaceSeparator(_)){read();return}return v[a]()},comment(){switch(_){case`*`:read(),p=`multiLineComment`;return;case`/`:read(),p=`singleLineComment`;return}throw invalidChar(read())},multiLineComment(){switch(_){case`*`:read(),p=`multiLineCommentAsterisk`;return;case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(_){case`*`:read();return;case`/`:read(),p=`default`;return;case void 0:throw invalidChar(read())}read(),p=`multiLineComment`},singleLineComment(){switch(_){case`
|
|
4
|
-
`:case`\r`:case`\u2028`:case`\u2029`:read(),p=`default`;return;case void 0:return read(),newToken(`eof`)}read()},value(){switch(_){case`{`:case`[`:return newToken(`punctuator`,read());case`n`:return read(),literal(`ull`),newToken(`null`,null);case`t`:return read(),literal(`rue`),newToken(`boolean`,!0);case`f`:return read(),literal(`alse`),newToken(`boolean`,!1);case`-`:case`+`:read()===`-`&&(g=-1),p=`sign`;return;case`.`:m=read(),p=`decimalPointLeading`;return;case`0`:m=read(),p=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:m=read(),p=`decimalInteger`;return;case`I`:return read(),literal(`nfinity`),newToken(`numeric`,1/0);case`N`:return read(),literal(`aN`),newToken(`numeric`,NaN);case`"`:case`'`:h=read()===`"`,m=``,p=`string`;return}throw invalidChar(read())},identifierNameStartEscape(){if(_!==`u`)throw invalidChar(read());read();let e=unicodeEscape();switch(e){case`$`:case`_`:break;default:if(!r.isIdStartChar(e))throw invalidIdentifier();break}m+=e,p=`identifierName`},identifierName(){switch(_){case`$`:case`_`:case``:case``:m+=read();return;case`\\`:read(),p=`identifierNameEscape`;return}if(r.isIdContinueChar(_)){m+=read();return}return newToken(`identifier`,m)},identifierNameEscape(){if(_!==`u`)throw invalidChar(read());read();let e=unicodeEscape();switch(e){case`$`:case`_`:case``:case``:break;default:if(!r.isIdContinueChar(e))throw invalidIdentifier();break}m+=e,p=`identifierName`},sign(){switch(_){case`.`:m=read(),p=`decimalPointLeading`;return;case`0`:m=read(),p=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:m=read(),p=`decimalInteger`;return;case`I`:return read(),literal(`nfinity`),newToken(`numeric`,g*(1/0));case`N`:return read(),literal(`aN`),newToken(`numeric`,NaN)}throw invalidChar(read())},zero(){switch(_){case`.`:m+=read(),p=`decimalPoint`;return;case`e`:case`E`:m+=read(),p=`decimalExponent`;return;case`x`:case`X`:m+=read(),p=`hexadecimal`;return}return newToken(`numeric`,g*0)},decimalInteger(){switch(_){case`.`:m+=read(),p=`decimalPoint`;return;case`e`:case`E`:m+=read(),p=`decimalExponent`;return}if(r.isDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},decimalPointLeading(){if(r.isDigit(_)){m+=read(),p=`decimalFraction`;return}throw invalidChar(read())},decimalPoint(){switch(_){case`e`:case`E`:m+=read(),p=`decimalExponent`;return}if(r.isDigit(_)){m+=read(),p=`decimalFraction`;return}return newToken(`numeric`,g*Number(m))},decimalFraction(){switch(_){case`e`:case`E`:m+=read(),p=`decimalExponent`;return}if(r.isDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},decimalExponent(){switch(_){case`+`:case`-`:m+=read(),p=`decimalExponentSign`;return}if(r.isDigit(_)){m+=read(),p=`decimalExponentInteger`;return}throw invalidChar(read())},decimalExponentSign(){if(r.isDigit(_)){m+=read(),p=`decimalExponentInteger`;return}throw invalidChar(read())},decimalExponentInteger(){if(r.isDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},hexadecimal(){if(r.isHexDigit(_)){m+=read(),p=`hexadecimalInteger`;return}throw invalidChar(read())},hexadecimalInteger(){if(r.isHexDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},string(){switch(_){case`\\`:read(),m+=escape();return;case`"`:if(h)return read(),newToken(`string`,m);m+=read();return;case`'`:if(!h)return read(),newToken(`string`,m);m+=read();return;case`
|
|
5
|
-
`:case`\r`:throw invalidChar(read());case`\u2028`:case`\u2029`:separatorChar(_);break;case void 0:throw invalidChar(read())}m+=read()},start(){switch(_){case`{`:case`[`:return newToken(`punctuator`,read())}p=`value`},beforePropertyName(){switch(_){case`$`:case`_`:m=read(),p=`identifierName`;return;case`\\`:read(),p=`identifierNameStartEscape`;return;case`}`:return newToken(`punctuator`,read());case`"`:case`'`:h=read()===`"`,p=`string`;return}if(r.isIdStartChar(_)){m+=read(),p=`identifierName`;return}throw invalidChar(read())},afterPropertyName(){if(_===`:`)return newToken(`punctuator`,read());throw invalidChar(read())},beforePropertyValue(){p=`value`},afterPropertyValue(){switch(_){case`,`:case`}`:return newToken(`punctuator`,read())}throw invalidChar(read())},beforeArrayValue(){if(_===`]`)return newToken(`punctuator`,read());p=`value`},afterArrayValue(){switch(_){case`,`:case`]`:return newToken(`punctuator`,read())}throw invalidChar(read())},end(){throw invalidChar(read())}};function newToken(e,t){return{type:e,value:t,line:c,column:l}}function literal(e){for(let t of e){if(peek()!==t)throw invalidChar(read());read()}}function escape(){switch(peek()){case`b`:return read(),`\b`;case`f`:return read(),`\f`;case`n`:return read(),`
|
|
6
|
-
`;case`r`:return read(),`\r`;case`t`:return read(),` `;case`v`:return read(),`\v`;case`0`:if(read(),r.isDigit(peek()))throw invalidChar(read());return`\0`;case`x`:return read(),hexEscape();case`u`:return read(),unicodeEscape();case`
|
|
7
|
-
`:case`\u2028`:case`\u2029`:return read(),``;case`\r`:return read(),peek()===`
|
|
8
|
-
`&&read(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw invalidChar(read());case void 0:throw invalidChar(read())}return read()}function hexEscape(){let e=``,t=peek();if(!r.isHexDigit(t)||(e+=read(),t=peek(),!r.isHexDigit(t)))throw invalidChar(read());return e+=read(),String.fromCodePoint(parseInt(e,16))}function unicodeEscape(){let e=``,t=4;for(;t-- >0;){let t=peek();if(!r.isHexDigit(t))throw invalidChar(read());e+=read()}return String.fromCodePoint(parseInt(e,16))}let y={start(){if(u.type===`eof`)throw invalidEOF();push()},beforePropertyName(){switch(u.type){case`identifier`:case`string`:d=u.value,a=`afterPropertyName`;return;case`punctuator`:pop();return;case`eof`:throw invalidEOF()}},afterPropertyName(){if(u.type===`eof`)throw invalidEOF();a=`beforePropertyValue`},beforePropertyValue(){if(u.type===`eof`)throw invalidEOF();push()},beforeArrayValue(){if(u.type===`eof`)throw invalidEOF();if(u.type===`punctuator`&&u.value===`]`){pop();return}push()},afterPropertyValue(){if(u.type===`eof`)throw invalidEOF();switch(u.value){case`,`:a=`beforePropertyName`;return;case`}`:pop()}},afterArrayValue(){if(u.type===`eof`)throw invalidEOF();switch(u.value){case`,`:a=`beforeArrayValue`;return;case`]`:pop()}},end(){}};function push(){let e;switch(u.type){case`punctuator`:switch(u.value){case`{`:e={};break;case`[`:e=[];break}break;case`null`:case`boolean`:case`numeric`:case`string`:e=u.value;break}if(f===void 0)f=e;else{let t=o[o.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,d,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)o.push(e),a=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{let e=o[o.length-1];a=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}}function pop(){o.pop();let e=o[o.length-1];a=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function invalidChar(e){return syntaxError(e===void 0?`JSON5: invalid end of input at ${c}:${l}`:`JSON5: invalid character '${formatChar(e)}' at ${c}:${l}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${c}:${l}`)}function invalidIdentifier(){return l-=5,syntaxError(`JSON5: invalid identifier character at ${c}:${l}`)}function separatorChar(e){console.warn(`JSON5: '${formatChar(e)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(e){let t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){let t=e.charCodeAt(0).toString(16);return`\\x`+(`00`+t).substring(t.length)}return e}function syntaxError(e){let t=SyntaxError(e);return t.lineNumber=c,t.columnNumber=l,t}})),i=e(((e,t)=>{let r=n();t.exports=function stringify(e,t,n){let i=[],a=``,o,s,c=``,l;if(typeof t==`object`&&t&&!Array.isArray(t)&&(n=t.space,l=t.quote,t=t.replacer),typeof t==`function`)s=t;else if(Array.isArray(t)){o=[];for(let e of t){let t;typeof e==`string`?t=e:(typeof e==`number`||e instanceof String||e instanceof Number)&&(t=String(e)),t!==void 0&&o.indexOf(t)<0&&o.push(t)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n==`number`?n>0&&(n=Math.min(10,Math.floor(n)),c=` `.substr(0,n)):typeof n==`string`&&(c=n.substr(0,10)),serializeProperty(``,{"":e});function serializeProperty(e,t){let n=t[e];switch(n!=null&&(typeof n.toJSON5==`function`?n=n.toJSON5(e):typeof n.toJSON==`function`&&(n=n.toJSON(e))),s&&(n=s.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return`null`;case!0:return`true`;case!1:return`false`}if(typeof n==`string`)return quoteString(n,!1);if(typeof n==`number`)return String(n);if(typeof n==`object`)return Array.isArray(n)?serializeArray(n):serializeObject(n)}function quoteString(e){let t={"'":.1,'"':.2},n={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},i=``;for(let a=0;a<e.length;a++){let o=e[a];switch(o){case`'`:case`"`:t[o]++,i+=o;continue;case`\0`:if(r.isDigit(e[a+1])){i+=`\\x00`;continue}}if(n[o]){i+=n[o];continue}if(o<` `){let e=o.charCodeAt(0).toString(16);i+=`\\x`+(`00`+e).substring(e.length);continue}i+=o}let a=l||Object.keys(t).reduce((e,n)=>t[e]<t[n]?e:n);return i=i.replace(new RegExp(a,`g`),n[a]),a+i+a}function serializeObject(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=o||Object.keys(e),r=[];for(let t of n){let n=serializeProperty(t,e);if(n!==void 0){let e=serializeKey(t)+`:`;c!==``&&(e+=` `),e+=n,r.push(e)}}let s;if(r.length===0)s=`{}`;else{let e;if(c===``)e=r.join(`,`),s=`{`+e+`}`;else{let n=`,
|
|
9
|
-
`+a;e=r.join(n),s=`{
|
|
10
|
-
`+a+e+`,
|
|
11
|
-
`+t+`}`}}return i.pop(),a=t,s}function serializeKey(e){if(e.length===0)return quoteString(e,!0);let t=String.fromCodePoint(e.codePointAt(0));if(!r.isIdStartChar(t))return quoteString(e,!0);for(let n=t.length;n<e.length;n++)if(!r.isIdContinueChar(String.fromCodePoint(e.codePointAt(n))))return quoteString(e,!0);return e}function serializeArray(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=[];for(let t=0;t<e.length;t++){let r=serializeProperty(String(t),e);n.push(r===void 0?`null`:r)}let r;if(n.length===0)r=`[]`;else if(c===``)r=`[`+n.join(`,`)+`]`;else{let e=`,
|
|
12
|
-
`+a,i=n.join(e);r=`[
|
|
13
|
-
`+a+i+`,
|
|
14
|
-
`+t+`]`}return i.pop(),a=t,r}}})),a=e(((e,t)=>{t.exports={parse:r(),stringify:i()}}));export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,o as n,r,s as i,t as a}from"../rolldown-runtime.mjs";import{stat as o}from"node:fs/promises";import{statSync as s}from"node:fs";var c=r({isexe:()=>l,sync:()=>u}),l,u,d,checkMode,f=t((()=>{l=e(async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return d(await o(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`isexe`),u=e((e,t={})=>{let{ignoreErrors:n=!1}=t;try{return d(s(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`sync`),d=e((e,t)=>e.isFile()&&checkMode(e,t),`checkStat`),checkMode=(e,t)=>{let n=t.uid??process.getuid?.(),r=t.groups??process.getgroups?.()??[],i=t.gid??process.getgid?.()??r[0];if(n===void 0||i===void 0)throw Error(`cannot get uid or gid`);let a=new Set([i,...r]),o=e.mode,s=e.uid,c=e.gid;return!!(o&1||o&8&&a.has(c)||o&64&&s===n||o&72&&n===0)}})),p=r({isexe:()=>m,sync:()=>h}),m,h,checkPathExt,checkStat,g=t((()=>{m=e(async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return checkStat(await o(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`isexe`),h=e((e,t={})=>{let{ignoreErrors:n=!1}=t;try{return checkStat(s(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`sync`),checkPathExt=(e,t)=>{let{pathExt:n=process.env.PATHEXT||``}=t,r=n.split(`;`);if(r.indexOf(``)!==-1)return!0;for(let t=0;t<r.length;t++){let n=r[t].toLowerCase(),i=e.substring(e.length-n.length).toLowerCase();if(n&&i===n)return!0}return!1},checkStat=(e,t,n)=>e.isFile()&&checkPathExt(t,n)})),_=t((()=>{})),v=r({isexe:()=>b,posix:()=>c,sync:()=>x,win32:()=>p}),y,b,x,S=t((()=>{f(),g(),_(),y=(process.env._ISEXE_TEST_PLATFORM_||process.platform)===`win32`?p:c,b=y.isexe,x=y.sync})),C=a(((e,t)=>{let{isexe:r,sync:a}=(S(),i(v)),{join:o,delimiter:s,sep:c,posix:l}=n(`node:path`),u=process.platform===`win32`,d=new RegExp(`[${l.sep}${c===l.sep?``:c}]`.replace(/(\\)/g,`\\$1`)),f=RegExp(`^\\.${d.source}`),getNotFoundError=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),getPathInfo=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=s})=>{let i=e.match(d)?[``]:[...u?[process.cwd()]:[],...(t||``).split(r)];if(u){let t=n||[`.EXE`,`.CMD`,`.BAT`,`.COM`].join(r),a=t.split(r).flatMap(e=>[e,e.toLowerCase()]);return e.includes(`.`)&&a[0]!==``&&a.unshift(``),{pathEnv:i,pathExt:a,pathExtExe:t}}return{pathEnv:i,pathExt:[``]}},getPathPart=(e,t)=>{let n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&f.test(t)?t.slice(0,2):``)+o(n,t)},which=async(e,t={})=>{let{pathEnv:n,pathExt:i,pathExtExe:a}=getPathInfo(e,t),o=[];for(let s of n){let n=getPathPart(s,e);for(let e of i){let i=n+e;if(await r(i,{pathExt:a,ignoreErrors:!0})){if(!t.all)return i;o.push(i)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw getNotFoundError(e)},whichSync=(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=getPathInfo(e,t),o=[];for(let s of n){let n=getPathPart(s,e);for(let e of r){let r=n+e;if(a(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw getNotFoundError(e)};t.exports=which,which.sync=whichSync}));export{C as t};
|