likec4 1.55.0 → 1.56.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/__app__/chunks/ColorSchemeToggle.mjs +1 -0
- package/__app__/chunks/DiagramActorProvider.mjs +10 -0
- package/__app__/chunks/Fallback.mjs +1 -0
- package/__app__/chunks/Header.mjs +13 -0
- package/__app__/chunks/IconRenderer.mjs +1 -0
- package/__app__/chunks/LikeC4Diagram.mjs +19 -0
- package/__app__/chunks/LikeC4ModelContext.mjs +1 -0
- package/__app__/chunks/LikeC4ModelContext2.mjs +1 -0
- package/__app__/chunks/LikeC4Styles.mjs +48 -0
- package/__app__/chunks/NavigationPanel.mjs +1 -0
- package/__app__/chunks/StaticLikeC4Diagram.mjs +1 -0
- package/__app__/chunks/ViewReact.mjs +1 -0
- package/__app__/chunks/__root.mjs +1 -0
- package/__app__/chunks/adhoc-editor.mjs +1 -0
- package/__app__/chunks/hooks.mjs +1 -0
- package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -0
- package/__app__/chunks/libs/@floating-ui/core.mjs +1 -0
- package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -0
- package/__app__/chunks/libs/@floating-ui/react.mjs +1 -0
- package/__app__/chunks/libs/@mantine/core.mjs +41 -0
- package/__app__/chunks/libs/@mantine/hooks.mjs +1 -0
- package/__app__/chunks/libs/@nanostores/react.mjs +1 -0
- package/__app__/chunks/libs/@react-hookz/web.mjs +1 -0
- package/__app__/chunks/libs/@tabler/icons-react.mjs +15 -0
- package/__app__/chunks/libs/@tanstack/history.mjs +1 -0
- package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -0
- package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -0
- package/__app__/chunks/libs/@xstate/react.mjs +1 -0
- package/__app__/chunks/libs/@xstate/store.mjs +1 -0
- package/__app__/chunks/libs/@xyflow/react.mjs +7 -0
- package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/collection.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/core.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/react.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -0
- package/__app__/chunks/libs/bezier-js.mjs +1 -0
- package/__app__/chunks/libs/d3-path.mjs +1 -0
- package/__app__/chunks/libs/d3-shape.mjs +1 -0
- package/__app__/chunks/libs/fast-equals.mjs +1 -0
- package/__app__/chunks/libs/framer-motion.mjs +9 -0
- package/__app__/chunks/libs/html-to-image.mjs +2 -0
- package/__app__/chunks/libs/motion-dom.mjs +1 -0
- package/__app__/chunks/libs/motion.mjs +1 -0
- package/__app__/chunks/libs/nanostores.mjs +1 -0
- package/__app__/chunks/libs/react-error-boundary.mjs +1 -0
- package/__app__/chunks/libs/react-resizable-panels.mjs +1 -0
- package/__app__/chunks/libs/remeda.mjs +1 -0
- package/__app__/chunks/libs/xstate.mjs +1 -0
- package/__app__/chunks/libs/zod.mjs +39 -0
- package/__app__/chunks/rolldown-runtime.mjs +1 -0
- package/__app__/chunks/safeCtx.mjs +1 -0
- package/__app__/chunks/searchParams.mjs +1 -0
- package/__app__/chunks/single-index.mjs +1 -0
- package/__app__/chunks/styled-system.mjs +1 -0
- package/__app__/chunks/styles.css.mjs +1 -0
- package/__app__/chunks/useLikeC4Project.mjs +1 -0
- package/__app__/chunks/useUpdateEffect.mjs +1 -0
- package/__app__/codegen/react.mjs +11 -0
- package/__app__/codegen/webcomponent.mjs +790 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +1 -0
- package/__app__/src/pages/AdHocViewEditor.mjs +1 -0
- package/__app__/src/pages/EmbedPage.mjs +1 -0
- package/__app__/src/pages/ExportPage.mjs +1 -0
- package/__app__/src/pages/ProjectsOverview.mjs +1 -0
- package/__app__/src/pages/ViewAsD2.mjs +1 -0
- package/__app__/src/pages/ViewAsDot.mjs +1 -0
- package/__app__/src/pages/ViewAsMmd.mjs +1 -0
- package/__app__/src/pages/ViewAsPuml.mjs +1 -0
- package/__app__/src/pages/ViewEditor.mjs +1 -0
- package/__app__/src/pages/ViewReact.mjs +1 -0
- package/__app__/src/routeTree.gen.mjs +1 -0
- package/__app__/src/routes/__root.mjs +1 -0
- package/__app__/src/routes/_single/adhoc.mjs +1 -0
- package/__app__/src/routes/_single/embed._viewId.mjs +1 -0
- package/__app__/src/routes/_single/export._viewId.mjs +1 -0
- package/__app__/src/routes/_single/route.mjs +1 -0
- package/__app__/src/routes/_single/single-index.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.d2.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.dot.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.index.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.mmd.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.puml.mjs +1 -0
- package/__app__/src/routes/_single/webcomponent._.mjs +33 -0
- package/__app__/src/routes/index.mjs +1 -0
- package/__app__/src/routes/project._projectId/-components.mjs +1 -0
- package/__app__/src/routes/project._projectId/adhoc.mjs +1 -0
- package/__app__/src/routes/project._projectId/embed._viewId.mjs +1 -0
- package/__app__/src/routes/project._projectId/export._viewId.mjs +1 -0
- package/__app__/src/routes/project._projectId/index.mjs +1 -0
- package/__app__/src/routes/project._projectId/route.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.index.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +1 -0
- package/__app__/src/routes/projects.mjs +1 -0
- package/__app__/src/style.css +1 -1
- package/dist/chunks/filenames.mjs +17 -0
- package/dist/{_chunks → chunks}/index.d.mts +2 -1
- package/dist/{_chunks → chunks}/index2.d.mts +71 -12
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -0
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -0
- package/dist/chunks/libs/@chevrotain/utils.mjs +1 -0
- package/dist/chunks/libs/@hono/mcp.mjs +45 -0
- package/dist/chunks/libs/@hono/node-server.mjs +1 -0
- package/dist/{_chunks → chunks}/libs/@logtape/logtape.d.mts +2 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -0
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -0
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +12 -0
- package/dist/chunks/libs/ajv.mjs +1 -0
- package/dist/chunks/libs/ansi-align.mjs +2 -0
- package/dist/chunks/libs/ansi-regex.mjs +1 -0
- package/dist/chunks/libs/ansi-styles.mjs +1 -0
- package/dist/chunks/libs/atomically.mjs +1 -0
- package/dist/chunks/libs/birpc.mjs +1 -0
- package/dist/chunks/libs/boxen.mjs +22 -0
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -0
- package/dist/chunks/libs/chevrotain.mjs +58 -0
- package/dist/chunks/libs/conf.mjs +1 -0
- package/dist/chunks/libs/defu.mjs +1 -0
- package/dist/chunks/libs/destr.mjs +1 -0
- package/dist/chunks/libs/eventemitter3.mjs +1 -0
- package/dist/chunks/libs/find-up-simple.mjs +1 -0
- package/dist/chunks/libs/get-port.mjs +1 -0
- package/dist/chunks/libs/hono.mjs +1 -0
- package/dist/chunks/libs/is-docker.mjs +1 -0
- package/dist/chunks/libs/is-error-instance.mjs +1 -0
- package/dist/chunks/libs/is-inside-container.mjs +1 -0
- package/dist/chunks/libs/is-plain-obj.mjs +1 -0
- package/dist/chunks/libs/isexe.mjs +1 -0
- package/dist/chunks/libs/json5.mjs +14 -0
- package/dist/chunks/libs/khroma.mjs +1 -0
- package/dist/chunks/libs/ky.mjs +3 -0
- package/dist/{_chunks → chunks}/libs/langium.d.mts +4 -4
- package/dist/chunks/libs/langium.mjs +32 -0
- package/dist/chunks/libs/merge-error-cause.mjs +2 -0
- package/dist/chunks/libs/p-debounce.mjs +1 -0
- package/dist/chunks/libs/p-limit.mjs +1 -0
- package/dist/chunks/libs/p-queue.mjs +1 -0
- package/dist/chunks/libs/p-timeout.mjs +1 -0
- package/dist/chunks/libs/package-manager-detector.mjs +1 -0
- package/dist/chunks/libs/package-up.mjs +1 -0
- package/dist/chunks/libs/pako.mjs +1 -0
- package/dist/chunks/libs/parse-ms.mjs +1 -0
- package/dist/chunks/libs/pathe.mjs +1 -0
- package/dist/chunks/libs/picomatch.mjs +1 -0
- package/dist/chunks/libs/pretty-ms.mjs +1 -0
- package/dist/chunks/libs/remeda.mjs +1 -0
- package/dist/chunks/libs/safe-stringify.mjs +1 -0
- package/dist/chunks/libs/strip-indent.mjs +1 -0
- package/dist/chunks/libs/tinyrainbow.mjs +1 -0
- package/dist/{_chunks → chunks}/libs/ts-graphviz.d.mts +2 -0
- package/dist/chunks/libs/ts-graphviz.mjs +4 -0
- package/dist/chunks/libs/ufo.mjs +1 -0
- package/dist/chunks/libs/unstorage.mjs +1 -0
- package/dist/chunks/libs/which.mjs +1 -0
- package/dist/chunks/libs/word-wrap.mjs +12 -0
- package/dist/{_chunks → chunks}/libs/zod.d.mts +2 -0
- package/dist/chunks/node.mjs +76 -0
- package/dist/chunks/plugin.mjs +400 -0
- package/dist/chunks/rolldown-runtime.mjs +1 -0
- package/dist/chunks/sequence-view.mjs +1 -0
- package/dist/cli/index.mjs +262 -123
- package/dist/config/index.d.mts +1 -2
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +4 -8
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +2 -1
- package/dist/model/index.mjs +1 -1
- package/dist/vite-plugin/index.d.mts +38 -8
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/{_chunks → vite-plugin/internal/chunks}/libs/@nanostores/react.d.mts +2 -56
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/nanostores.d.mts +59 -0
- package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +1 -0
- package/dist/vite-plugin/{internal.d.mts → internal/index.d.mts} +12 -3
- package/dist/vite-plugin/internal/index.mjs +1 -0
- package/package.json +37 -57
- package/react/index.d.mts +2 -28
- package/react/index.mjs +50520 -53827
- package/vite-plugin/internal/package.json +2 -2
- package/vite-plugin-modules.d.ts +14 -0
- package/__app__/react/likec4.tsx +0 -25
- package/__app__/src/ProjectsOverview.js +0 -16
- package/__app__/src/const.js +0 -19
- package/__app__/src/likec4.js +0 -21225
- package/__app__/src/main.js +0 -7
- package/__app__/src/routes/index.js +0 -324
- package/__app__/src/routes/projects.js +0 -189
- package/__app__/src/routes/single.js +0 -1924
- package/__app__/src/vendors.js +0 -52672
- package/__app__/src/webcomponent.js +0 -68
- package/dist/THIRD-PARTY-LICENSES.md +0 -1609
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +0 -30
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +0 -9
- package/dist/_chunks/libs/@chevrotain/types.d.mts +0 -1
- package/dist/_chunks/libs/@chevrotain/utils.mjs +0 -1
- package/dist/_chunks/libs/@hono/mcp.mjs +0 -45
- package/dist/_chunks/libs/@hono/node-server.mjs +0 -1
- package/dist/_chunks/libs/@logtape/logtape.mjs +0 -4
- package/dist/_chunks/libs/@lume/kiwi.mjs +0 -1
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
- package/dist/_chunks/libs/@nanostores/react.mjs +0 -1
- package/dist/_chunks/libs/ajv.mjs +0 -1
- package/dist/_chunks/libs/ansi-align.mjs +0 -2
- package/dist/_chunks/libs/ansi-regex.mjs +0 -1
- package/dist/_chunks/libs/ansi-styles.mjs +0 -1
- package/dist/_chunks/libs/atomically.mjs +0 -1
- package/dist/_chunks/libs/birpc.mjs +0 -1
- package/dist/_chunks/libs/boxen.mjs +0 -22
- package/dist/_chunks/libs/chevrotain-allstar.mjs +0 -2
- package/dist/_chunks/libs/chevrotain.mjs +0 -58
- package/dist/_chunks/libs/conf.mjs +0 -1
- package/dist/_chunks/libs/defu.mjs +0 -1
- package/dist/_chunks/libs/destr.mjs +0 -1
- package/dist/_chunks/libs/esm-env.mjs +0 -1
- package/dist/_chunks/libs/eventemitter3.mjs +0 -1
- package/dist/_chunks/libs/fast-equals.mjs +0 -1
- package/dist/_chunks/libs/find-up-simple.mjs +0 -1
- package/dist/_chunks/libs/get-port.mjs +0 -1
- package/dist/_chunks/libs/is-docker.mjs +0 -1
- package/dist/_chunks/libs/is-error-instance.mjs +0 -1
- package/dist/_chunks/libs/is-inside-container.mjs +0 -1
- package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/_chunks/libs/isexe.mjs +0 -1
- package/dist/_chunks/libs/json5.mjs +0 -14
- package/dist/_chunks/libs/khroma.mjs +0 -1
- package/dist/_chunks/libs/ky.mjs +0 -3
- package/dist/_chunks/libs/langium.mjs +0 -33
- package/dist/_chunks/libs/merge-error-cause.mjs +0 -2
- package/dist/_chunks/libs/p-limit.mjs +0 -1
- package/dist/_chunks/libs/p-queue.mjs +0 -1
- package/dist/_chunks/libs/p-timeout.mjs +0 -1
- package/dist/_chunks/libs/package-manager-detector.mjs +0 -1
- package/dist/_chunks/libs/package-up.mjs +0 -1
- package/dist/_chunks/libs/pako.mjs +0 -1
- package/dist/_chunks/libs/parse-ms.mjs +0 -1
- package/dist/_chunks/libs/pathe.mjs +0 -1
- package/dist/_chunks/libs/picomatch.mjs +0 -1
- package/dist/_chunks/libs/pretty-ms.mjs +0 -1
- package/dist/_chunks/libs/remeda.mjs +0 -2
- package/dist/_chunks/libs/safe-stringify.mjs +0 -1
- package/dist/_chunks/libs/strip-indent.mjs +0 -1
- package/dist/_chunks/libs/tinyrainbow.mjs +0 -1
- package/dist/_chunks/libs/ts-graphviz.mjs +0 -4
- package/dist/_chunks/libs/ufo.mjs +0 -1
- package/dist/_chunks/libs/unstorage.mjs +0 -1
- package/dist/_chunks/libs/which.mjs +0 -1
- package/dist/_chunks/libs/word-wrap.mjs +0 -12
- package/dist/_chunks/node.mjs +0 -76
- package/dist/_chunks/rolldown-runtime.mjs +0 -1
- package/dist/_chunks/sequence.mjs +0 -1
- package/dist/_chunks/src.mjs +0 -17
- package/dist/_chunks/src2.mjs +0 -499
- package/dist/vite-plugin/internal.mjs +0 -1
- /package/dist/{_chunks → chunks}/libs/vscode-languageserver.mjs +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useCallback as e,useRef as t,useSyncExternalStore as n}from"react";let r=Symbol(`clean`),i=[],a=0,o=0;const s=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=a+4;t<i.length;)i[t]===e?i.splice(t,4):t+=4;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){o++;let s=!i.length;for(let a of t)i.push(a,n.value,e,r);if(s){for(a=0;a<i.length;a+=4)i[a](i[a+1],i[a+2],i[a+3]);i.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return process.env.NODE_ENV!==`production`&&(n[r]=()=>{t=[],n.lc=0,n.off()}),n};let c=(e,t,n,r)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+10](),delete e.events[n+10])}),l=(e,t)=>{let n=n=>{let r=t(n);r&&e.events[6].push(r)};return c(e,n,5,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let i=e.off;if(e.events[6]=[],e.off=()=>{i(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[6])t();e.events[6]=[]}},1e3)},process.env.NODE_ENV!==`production`){let t=e[r];e[r]=()=>{for(let t of e.events[6])t();e.events[6]=[],e.active=!1,t()}}return()=>{e.listen=n,e.off=i}})},u={};function d(e){u[e]||(u[e]=!0,typeof console<`u`&&console.warn&&(console.groupCollapsed(`Nano Stores: `+e),console.trace(`Source of deprecated call`),console.groupEnd()))}let f=(e,t,n)=>{Array.isArray(e)||(e=[e]);let r,i,a=()=>{if(i===o)return;i=o;let n=e.map(e=>e.get());if(!r||n.some((e,t)=>e!==r[t])){r=n;let e=t(...n);e&&e.then&&e.t?(process.env.NODE_ENV!==`production`&&d(`Use @nanostores/async for async computed. We will remove Promise support in computed() in Nano Stores 2.0`),e.then(e=>{r===n&&c.set(e)})):(c.set(e),i=o)}},c=s(void 0),u=c.get;c.get=()=>(a(),u());let f,p=n?()=>{clearTimeout(f),f=setTimeout(a)}:a;return l(c,()=>{let t=e.map(e=>e.listen(p));return a(),()=>{for(let e of t)e()}}),c};const p=(e,t)=>f(e,t),m=(e,t)=>f(e,t,!0);function h(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}const g=(e={})=>{let t=s(e);return t.setKey=function(e,n){let r=t.value;n===void 0&&e in t.value?(t.value={...t.value},delete t.value[e],t.notify(r,e)):t.value[e]!==n&&(t.value={...t.value,[e]:n},t.notify(r,e))},t};let _=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function v(r,{keys:i,deps:a=[r,i],ssr:o}={}){let s=t();s.current=r.get();let c=e(e=>(_(s,e)(r.value),i?.length>0?h(r,i,_(s,e)):r.listen(_(s,e))),a),l=()=>s.current,u=l;return o&&`init`in r&&(u=o===`initial`?()=>r.init:o),n(c,l,u)}export{s as a,p as i,g as n,m as r,v as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"../rolldown-runtime.mjs";import{A as t,C as n,D as r,E as i,O as a,S as o,T as s,_ as c,b as l,g as u,h as d,k as f,v as p,w as m,x as h,y as g}from"./@modelcontextprotocol/sdk.mjs";var _=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;let n=t(),r=a(),i=m(),s=o(),c={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>l(e,e.schema)};function l(e,t){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[t]=!0;let o=(0,n._)`${r.default.dynamicAnchors}${(0,n.getProperty)(t)}`,s=a.errSchemaPath===`#`?a.validateName:u(e);i.if((0,n._)`!${o}`,()=>i.assign(o,s))}e.dynamicAnchor=l;function u(e){let{schemaEnv:t,schema:n,self:r}=e.it,{root:a,baseId:o,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new i.SchemaEnv({schema:n,schemaId:u,root:a,baseId:o,localRefs:c,meta:l});return i.compileSchema.call(r,d),(0,s.getValidate)(e,d)}e.default=c})),v=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;let n=t(),r=a(),i=o(),s={keyword:`$dynamicRef`,schemaType:`string`,code:e=>c(e,e.schema)};function c(e,t){let{gen:a,keyword:o,it:s}=e;if(t[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=t.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let t=a.let(`_v`,(0,n._)`${r.default.dynamicAnchors}${(0,n.getProperty)(c)}`);a.if(t,u(t,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,i.callRef)(e,t),a.let(n,!0)}):()=>(0,i.callRef)(e,t)}}e.dynamicRef=c,e.default=s})),y=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=_(),n=f();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),b=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=v();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),x=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=_(),n=v(),r=y(),i=b();e.default=[t.default,n.default,r.default,i.default]})),S=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=g();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),C=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=g();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),w=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=f();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),T=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(),n=C(),r=w();e.default=[t.default,n.default,r.default]})),E=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=t(),r=f(),i=a();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,n._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:t,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof n.Name?t.if((0,n._)`${u} !== true`,()=>t.forIn(`key`,o,e=>t.if(f(u,e),()=>d(e)))):u!==!0&&t.forIn(`key`,o,e=>u===void 0?d(e):t.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,n._)`${s} === ${i.default.errors}`);function d(i){if(a===!1){e.setParams({unevaluatedProperty:i}),e.error(),l||t.break();return}if(!(0,r.alwaysValidSchema)(c,a)){let a=t.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:i,dataPropType:r.Type.Str},a),l||t.if((0,n.not)(a),()=>t.break())}}function f(e,t){return(0,n._)`!${e} || !${e}[${t}]`}function p(e,t){let r=[];for(let i in e)e[i]===!0&&r.push((0,n._)`${t} !== ${i}`);return(0,n.and)(...r)}}}})),D=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=t(),r=f();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{gen:t,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=t.const(`len`,(0,n._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,n._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,r.alwaysValidSchema)(o,i)){let r=t.var(`valid`,(0,n._)`${c} <= ${s}`);t.if((0,n.not)(r),()=>l(r,s)),e.ok(r)}o.items=!0;function l(i,a){t.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:r.Type.Num},i),o.allErrors||t.if((0,n.not)(i),()=>t.break())})}}}})),O=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(),n=D();e.default=[t.default,n.default]})),k=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(),n=l(),r=p(),i=x(),a=T(),o=O(),s=c(),d=u();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,d.metadataVocabulary,d.contentVocabulary,a.default,o.default]})),A=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),j=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),M=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),N=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),P=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),F=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),I=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),L=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),R=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=A(),n=j(),r=M(),i=N(),a=P(),o=F(),s=I(),c=L(),l=[`/properties`];function u(e){return[t,n,r,i,a,u(this,o),s,u(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=u})),z=e(((e,a)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let o=n(),c=k(),l=d(),u=R(),f=`https://json-schema.org/draft/2020-12/schema`;var p=class extends o.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),c.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(l.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(u.default.call(this,e),this.refs[`http://json-schema.org/schema`]=f)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(f)?f:void 0)}};e.Ajv2020=p,a.exports=e=p,a.exports.Ajv2020=p,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=p;var m=r();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return m.KeywordCxt}});var h=t();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return h._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return h.CodeGen}});var g=i();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return g.default}});var _=s();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return _.default}})}));export{z as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{t.exports=({onlyFirst:e=!1}={})=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}})),n=e(((e,n)=>{let r=t();n.exports=e=>typeof e==`string`?e.replace(r(),``):e})),r=e(((e,t)=>{let n=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);t.exports=n,t.exports.default=n})),i=e(((e,t)=>{t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}})),a=e(((e,t)=>{let a=n(),o=r(),s=i(),c=e=>{if(typeof e!=`string`||e.length===0||(e=a(e),e.length===0))return 0;e=e.replace(s(),` `);let t=0;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);r<=31||r>=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,t+=o(r)?2:1)}return t};t.exports=c,t.exports.default=c})),o=e(((e,t)=>{let n=a();function r(e,t){if(!e)return e;t||={};let r=t.align||`center`;if(r===`left`)return e;let a=t.split||`
|
|
2
|
-
`,s=t.pad||` `,c=r===`right`?o:i,l=!1;Array.isArray(e)||(l=!0,e=String(e).split(a));let u,d=0;return e=e.map(function(e){return e=String(e),u=n(e),d=Math.max(u,d),{str:e,width:u}}).map(function(e){return Array(c(d,e.width)+1).join(s)+e.str}),l?e.join(a):e}r.left=function e(t){return r(t,{align:`left`})},r.center=function e(t){return r(t,{align:`center`})},r.right=function e(t){return r(t,{align:`right`})},t.exports=r;function i(e,t){return Math.floor((e-t)/2)}function o(e,t){return e-t}}));export{o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}export{e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=(e=0)=>t=>`\u001B[${t+e}m`,t=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,n=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(r.modifier);const i=Object.keys(r.color),a=Object.keys(r.bgColor);[...i,...a];function o(){let i=new Map;for(let[e,t]of Object.entries(r)){for(let[e,n]of Object.entries(t))r[e]={open:`\u001B[${n[0]}m`,close:`\u001B[${n[1]}m`},t[e]=r[e],i.set(n[0],n[1]);Object.defineProperty(r,e,{value:t,enumerable:!1})}return Object.defineProperty(r,`codes`,{value:i,enumerable:!1}),r.color.close=`\x1B[39m`,r.bgColor.close=`\x1B[49m`,r.color.ansi=e(),r.color.ansi256=t(),r.color.ansi16m=n(),r.bgColor.ansi=e(10),r.bgColor.ansi256=t(10),r.bgColor.ansi16m=n(10),Object.defineProperties(r,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>r.rgbToAnsi256(...r.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>r.ansi256ToAnsi(r.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>r.ansi256ToAnsi(r.hexToAnsi256(e)),enumerable:!1}}),r}const s=o();export{s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{promisify as e}from"node:util";import t from"node:path";import n from"node:os";import r from"node:fs";import i from"node:process";const a=(e,t)=>function n(...r){return e.apply(void 0,r).catch(t)},o=(e,t)=>function n(...r){try{return e.apply(void 0,r)}catch(e){return t(e)}},s=i.getuid?!i.getuid():!1,c=()=>void 0,l={isChangeErrorOk:e=>{if(!l.isNodeError(e))return!1;let{code:t}=e;return t===`ENOSYS`||!s&&(t===`EINVAL`||t===`EPERM`)},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!l.isNodeError(e))return!1;let{code:t}=e;return t===`EMFILE`||t===`ENFILE`||t===`EAGAIN`||t===`EBUSY`||t===`EACCESS`||t===`EACCES`||t===`EACCS`||t===`EPERM`},onChangeError:e=>{if(!l.isNodeError(e)||!l.isChangeErrorOk(e))throw e}};var u=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=1e4,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||=setInterval(this.tick,this.interval)},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=e=>{this.queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise(e=>{let t=()=>this.remove(n),n=()=>e(t);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),e()}}}}},d=new u;const f=(e,t)=>function n(r){return function n(...i){return d.schedule().then(a=>{let o=e=>(a(),e),s=e=>{if(a(),Date.now()>=r)throw e;if(t(e)){let e=Math.round(100*Math.random());return new Promise(t=>setTimeout(t,e)).then(()=>n.apply(void 0,i))}throw e};return e.apply(void 0,i).then(o,s)})}},p=(e,t)=>function n(r){return function n(...i){try{return e.apply(void 0,i)}catch(e){if(Date.now()>r)throw e;if(t(e))return n.apply(void 0,i);throw e}}},m={attempt:{chmod:a(e(r.chmod),l.onChangeError),chown:a(e(r.chown),l.onChangeError),close:a(e(r.close),c),fsync:a(e(r.fsync),c),mkdir:a(e(r.mkdir),c),realpath:a(e(r.realpath),c),stat:a(e(r.stat),c),unlink:a(e(r.unlink),c),chmodSync:o(r.chmodSync,l.onChangeError),chownSync:o(r.chownSync,l.onChangeError),closeSync:o(r.closeSync,c),existsSync:o(r.existsSync,c),fsyncSync:o(r.fsync,c),mkdirSync:o(r.mkdirSync,c),realpathSync:o(r.realpathSync,c),statSync:o(r.statSync,c),unlinkSync:o(r.unlinkSync,c)},retry:{close:f(e(r.close),l.isRetriableError),fsync:f(e(r.fsync),l.isRetriableError),open:f(e(r.open),l.isRetriableError),readFile:f(e(r.readFile),l.isRetriableError),rename:f(e(r.rename),l.isRetriableError),stat:f(e(r.stat),l.isRetriableError),write:f(e(r.write),l.isRetriableError),writeFile:f(e(r.writeFile),l.isRetriableError),closeSync:p(r.closeSync,l.isRetriableError),fsyncSync:p(r.fsyncSync,l.isRetriableError),openSync:p(r.openSync,l.isRetriableError),readFileSync:p(r.readFileSync,l.isRetriableError),renameSync:p(r.renameSync,l.isRetriableError),statSync:p(r.statSync,l.isRetriableError),writeSync:p(r.writeSync,l.isRetriableError),writeFileSync:p(r.writeFileSync,l.isRetriableError)}},h={},g=n.userInfo().uid,_=n.userInfo().gid,v=!!i.getuid;i.getuid&&i.getuid();const y=e=>e instanceof Error&&`code`in e,b=e=>typeof e==`string`,x=e=>e===void 0,S=i.platform===`linux`,C=i.platform===`win32`,w=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`];C||w.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),S&&w.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`);var T=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(let e of this.callbacks)e();e&&(C&&e!==`SIGINT`&&e!==`SIGTERM`&&e!==`SIGKILL`?i.kill(i.pid,`SIGTERM`):i.kill(i.pid,e))}},this.hook=()=>{i.once(`exit`,()=>this.exit());for(let e of w)try{i.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}};const E=new T().register,D={store:{},create:e=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6);return`${e}${`.tmp-${Date.now().toString().slice(-10)}${t}`}`},get:(e,t,n=!0)=>{let r=D.truncate(t(e));if(r in D.store)return D.get(e,t,n);D.store[r]=n;let i=()=>delete D.store[r];return[r,i]},purge:e=>{D.store[e]&&(delete D.store[e],m.attempt.unlink(e))},purgeSync:e=>{D.store[e]&&(delete D.store[e],m.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(let e in D.store)D.purgeSync(e)},truncate:e=>{let n=t.basename(e);if(n.length<=128)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(n);if(!r)return e;let i=n.length-128;return`${e.slice(0,-n.length)}${r[1]}${r[2].slice(0,-i)}${r[3]}`}};E(D.purgeSyncAll);function O(e,n,r=h){if(b(r))return O(e,n,{encoding:r});let i=Date.now()+((r.timeout??1e3)||-1),a=null,o=null,s=null;try{let c=m.attempt.realpathSync(e),l=!!c;e=c||e,[o,a]=D.get(e,r.tmpCreate||D.create,r.tmpPurge!==!1);let u=v&&x(r.chown),d=x(r.mode);if(l&&(u||d)){let t=m.attempt.statSync(e);t&&(r={...r},u&&(r.chown={uid:t.uid,gid:t.gid}),d&&(r.mode=t.mode))}if(!l){let n=t.dirname(e);m.attempt.mkdirSync(n,{mode:511,recursive:!0})}s=m.retry.openSync(i)(o,`w`,r.mode||438),r.tmpCreated&&r.tmpCreated(o),b(n)?m.retry.writeSync(i)(s,n,0,r.encoding||`utf8`):x(n)||m.retry.writeSync(i)(s,n,0,n.length,0),r.fsync!==!1&&(r.fsyncWait===!1?m.attempt.fsync(s):m.retry.fsyncSync(i)(s)),m.retry.closeSync(i)(s),s=null,r.chown&&(r.chown.uid!==g||r.chown.gid!==_)&&m.attempt.chownSync(o,r.chown.uid,r.chown.gid),r.mode&&r.mode!==438&&m.attempt.chmodSync(o,r.mode);try{m.retry.renameSync(i)(o,e)}catch(t){if(!y(t)||t.code!==`ENAMETOOLONG`)throw t;m.retry.renameSync(i)(o,D.truncate(e))}a(),o=null}finally{s&&m.attempt.closeSync(s),o&&D.purge(o)}}export{O as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const t=Math.random.bind(Math);function n(e=21){let n=``,r=e;for(;r--;)n+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[t()*64|0];return n}const r=e=>e,i=r,{clearTimeout:a,setTimeout:o}=globalThis;function s(t,s){let{post:c,on:l,off:u=()=>{},eventNames:d=[],serialize:f=r,deserialize:p=i,resolver:m,bind:h=`rpc`,timeout:g=6e4,proxify:_=!0}=s,v=!1,y=new Map,b,x;async function S(t,r,i,l){if(v)throw Error(`[birpc] rpc is closed, cannot call "${t}"`);let u={m:t,a:r,t:`q`};l&&(u.o=!0);let d=async e=>c(f(e));if(i){await d(u);return}if(b)try{await b}finally{b=void 0}let{promise:p,resolve:m,reject:h}=e(),_=n();u.i=_;let S;async function C(e=u){return g>=0&&(S=o(()=>{try{if(s.onTimeoutError?.call(x,t,r)!==!0)throw Error(`[birpc] timeout on calling "${t}"`)}catch(e){h(e)}y.delete(_)},g),typeof S==`object`&&(S=S.unref?.())),y.set(_,{resolve:m,reject:h,timeoutId:S,method:t}),await d(e),p}try{s.onRequest?await s.onRequest.call(x,u,C,m):await C()}catch(e){if(s.onGeneralError?.call(x,e)!==!0)throw e;return}finally{a(S),y.delete(_)}return p}let C={$call:(e,...t)=>S(e,t,!1),$callOptional:(e,...t)=>S(e,t,!1,!0),$callEvent:(e,...t)=>S(e,t,!0),$callRaw:e=>S(e.method,e.args,e.event,e.optional),$rejectPendingCalls:T,get $closed(){return v},get $meta(){return s.meta},$close:w,$functions:t};x=_?new Proxy({},{get(e,n){if(Object.prototype.hasOwnProperty.call(C,n))return C[n];if(n===`then`&&!d.includes(`then`)&&!(`then`in t))return;let r=(...e)=>S(n,e,!0);if(d.includes(n))return r.asEvent=r,r;let i=(...e)=>S(n,e,!1);return i.asEvent=r,i}}):C;function w(e){v=!0,y.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),y.clear(),u(E)}function T(e){let t=Array.from(y.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return y.clear(),t}async function E(e,...n){let r;try{r=p(e)}catch(e){if(s.onGeneralError?.call(x,e)!==!0)throw e;return}if(r.t===`q`){let{m:e,a:i,o:a}=r,o,l,u=await(m?m.call(x,e,t[e]):t[e]);if(a&&(u||=()=>void 0),!u)l=Error(`[birpc] function "${e}" not found`);else try{o=await u.apply(h===`rpc`?x:t,i)}catch(e){l=e}if(r.i){if(l&&s.onFunctionError&&s.onFunctionError.call(x,l,e,i)===!0)return;if(!l)try{await c(f({t:`s`,i:r.i,r:o}),...n);return}catch(t){if(l=t,s.onGeneralError?.call(x,t,e,i)!==!0)throw t}try{await c(f({t:`s`,i:r.i,e:l}),...n)}catch(t){if(s.onGeneralError?.call(x,t,e,i)!==!0)throw t}}}else{let{i:e,r:t,e:n}=r,i=y.get(e);i&&(a(i.timeoutId),n?i.reject(n):i.resolve(t)),y.delete(e)}}return b=l(E),x}export{s as t};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{s as e,t}from"../rolldown-runtime.mjs";import{t as n}from"./ansi-regex.mjs";import{t as r}from"./ansi-align.mjs";import{t as i}from"./ansi-styles.mjs";import a from"node:os";import o from"node:process";import s from"node:tty";const c=n();function l(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(c,``)}function u(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function d(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function ee(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function te(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ne(e,{ambiguousAsWide:t=!1}={}){return te(e),d(e)||ee(e)||t&&u(e)?2:1}var re=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;const ie=new Intl.Segmenter,ae=/^\p{Default_Ignorable_Code_Point}$/u;function f(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=l(e)),e.length===0)return 0;let i=0,a={ambiguousAsWide:!n};for(let{segment:t}of ie.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!ae.test(t)){if(re().test(t)){i+=2;continue}i+=ne(e,a)}}return i}const p=(e=0)=>t=>`\u001B[${t+e}m`,m=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,h=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,g={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(g.modifier);const oe=Object.keys(g.color),se=Object.keys(g.bgColor);[...oe,...se];function ce(){let e=new Map;for(let[t,n]of Object.entries(g)){for(let[t,r]of Object.entries(n))g[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=g[t],e.set(r[0],r[1]);Object.defineProperty(g,t,{value:n,enumerable:!1})}return Object.defineProperty(g,`codes`,{value:e,enumerable:!1}),g.color.close=`\x1B[39m`,g.bgColor.close=`\x1B[49m`,g.color.ansi=p(),g.color.ansi256=m(),g.color.ansi16m=h(),g.bgColor.ansi=p(10),g.bgColor.ansi256=m(10),g.bgColor.ansi16m=h(10),Object.defineProperties(g,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>g.rgbToAnsi256(...g.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>g.ansi256ToAnsi(g.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>g.ansi256ToAnsi(g.hexToAnsi256(e)),enumerable:!1}}),g}const _=ce();function v(e,t=globalThis.Deno?globalThis.Deno.args:o.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:y}=o;let b;v(`no-color`)||v(`no-colors`)||v(`color=false`)||v(`color=never`)?b=0:(v(`color`)||v(`colors`)||v(`color=true`)||v(`color=always`))&&(b=1);function le(){if(`FORCE_COLOR`in y)return y.FORCE_COLOR===`true`?1:y.FORCE_COLOR===`false`?0:y.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(y.FORCE_COLOR,10),3)}function ue(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function de(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=le();r!==void 0&&(b=r);let i=n?b:r;if(i===0)return 0;if(n){if(v(`color=16m`)||v(`color=full`)||v(`color=truecolor`))return 3;if(v(`color=256`))return 2}if(`TF_BUILD`in y&&`AGENT_NAME`in y)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(y.TERM===`dumb`)return s;if(o.platform===`win32`){let e=a.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in y)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in y)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in y)||y.CI_NAME===`codeship`?1:s;if(`TEAMCITY_VERSION`in y)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(y.TEAMCITY_VERSION)?1:0;if(y.COLORTERM===`truecolor`||y.TERM===`xterm-kitty`)return 3;if(`TERM_PROGRAM`in y){let e=Number.parseInt((y.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(y.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(y.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(y.TERM)||`COLORTERM`in y?1:s}function x(e,t={}){return ue(de(e,{streamIsTTY:e&&e.isTTY,...t}))}const fe={stdout:x({isTTY:s.isatty(1)}),stderr:x({isTTY:s.isatty(2)})};function pe(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function me(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
|
|
2
|
-
`:`
|
|
3
|
-
`)+n,i=r+1,r=e.indexOf(`
|
|
4
|
-
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:S,stderr:C}=fe,w=Symbol(`GENERATOR`),T=Symbol(`STYLER`),E=Symbol(`IS_EMPTY`),D=[`ansi`,`ansi`,`ansi256`,`ansi16m`],O=Object.create(null),he=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=S?S.level:0;e.level=t.level===void 0?n:t.level},ge=e=>{let t=(...e)=>e.join(` `);return he(t,e),Object.setPrototypeOf(t,k.prototype),t};function k(e){return ge(e)}Object.setPrototypeOf(k.prototype,Function.prototype);for(let[e,t]of Object.entries(_))O[e]={get(){let n=M(this,j(t.open,t.close,this[T]),this[E]);return Object.defineProperty(this,e,{value:n}),n}};O.visible={get(){let e=M(this,this[T],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const A=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?_[n].ansi16m(...r):t===`ansi256`?_[n].ansi256(_.rgbToAnsi256(...r)):_[n].ansi(_.rgbToAnsi(...r)):e===`hex`?A(`rgb`,t,n,..._.hexToRgb(...r)):_[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){O[e]={get(){let{level:t}=this;return function(...n){let r=j(A(e,D[t],`color`,...n),_.color.close,this[T]);return M(this,r,this[E])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);O[t]={get(){let{level:t}=this;return function(...n){let r=j(A(e,D[t],`bgColor`,...n),_.bgColor.close,this[T]);return M(this,r,this[E])}}}}const _e=Object.defineProperties(()=>{},{...O,level:{enumerable:!0,get(){return this[w].level},set(e){this[w].level=e}}}),j=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},M=(e,t,n)=>{let r=(...e)=>ve(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,_e),r[w]=e,r[T]=t,r[E]=n,r},ve=(e,t)=>{if(e.level<=0||!t)return e[E]?``:t;let n=e[T];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=pe(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
5
|
-
`);return a!==-1&&(t=me(t,i,r,a)),r+t+i};Object.defineProperties(k.prototype,O);const N=k();k({level:C?C.level:0});function P(e){let t=0;for(let n of e.split(`
|
|
6
|
-
`))t=Math.max(t,f(n));return t}var ye=t(((e,t)=>{t.exports={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}}})),be=t(((e,t)=>{let n=ye();t.exports=n,t.exports.default=n}));const xe=/[\p{Lu}]/u,Se=/[\p{Ll}]/u,F=/^[\p{Lu}](?![\p{Lu}])/gu,I=/([\p{Alpha}\p{N}_]|$)/u,L=/[_.\- ]+/,Ce=RegExp(`^`+L.source),R=new RegExp(L.source+I.source,`gu`),z=RegExp(`\\d+`+I.source,`gu`),we=(e,t,n,r)=>{let i=!1,a=!1,o=!1,s=!1;for(let c=0;c<e.length;c++){let l=e[c];s=c>2?e[c-3]===`-`:!0,i&&xe.test(l)?(e=e.slice(0,c)+`-`+e.slice(c),i=!1,o=a,a=!0,c++):a&&o&&Se.test(l)&&(!s||r)?(e=e.slice(0,c-1)+`-`+e.slice(c-1),o=a,a=!1,i=!0):(i=t(l)===l&&n(l)!==l,o=a,a=n(l)===l&&t(l)!==l)}return e},Te=(e,t)=>(F.lastIndex=0,e.replaceAll(F,e=>t(e))),Ee=(e,t)=>(R.lastIndex=0,z.lastIndex=0,e.replaceAll(z,(n,r,i)=>[`_`,`-`].includes(e.charAt(i+n.length))?n:t(n)).replaceAll(R,(e,n)=>t(n)));function De(e,t){if(!(typeof e==`string`||Array.isArray(e)))throw TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},e=Array.isArray(e)?e.map(e=>e.trim()).filter(e=>e.length).join(`-`):e.trim(),e.length===0)return``;let n=t.locale===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t.locale),r=t.locale===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(t.locale);return e.length===1?L.test(e)?``:t.pascalCase?r(e):n(e):(e!==n(e)&&(e=we(e,n,r,t.preserveConsecutiveUppercase)),e=e.replace(Ce,``),e=t.preserveConsecutiveUppercase?Te(e,n):n(e),t.pascalCase&&(e=r(e.charAt(0))+e.slice(1)),Ee(e,r))}const B=new Set([`\x1B`,``]),V=`]8;;`,H=e=>`${B.values().next().value}[${e}m`,U=e=>`${B.values().next().value}${V}${e}`,Oe=e=>e.split(` `).map(e=>f(e)),W=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=f(l(e.at(-1)));for(let[t,s]of r.entries()){let c=f(s);if(o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),B.has(s)&&(i=!0,a=r.slice(t+1,t+1+4).join(``)===V),i){a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1);continue}o+=c,o===n&&t<r.length-1&&(e.push(``),o=0)}!o&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},ke=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(f(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ae=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,a,o,s=Oe(e),c=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(c[c.length-1]=c.at(-1).trimStart());let e=f(c.at(-1));if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),e=0),(e>0||n.trim===!1)&&(c[c.length-1]+=` `,e++)),n.hard&&s[r]>t){let n=t-e,a=1+Math.floor((s[r]-n-1)/t);Math.floor((s[r]-1)/t)<a&&c.push(``),W(c,i,t);continue}if(e+s[r]>t&&e>0&&s[r]>0){if(n.wordWrap===!1&&e<t){W(c,i,t);continue}c.push(``)}if(e+s[r]>t&&n.wordWrap===!1){W(c,i,t);continue}c[c.length-1]+=i}n.trim!==!1&&(c=c.map(e=>ke(e)));let l=c.join(`
|
|
7
|
-
`),u=[...l],d=0;for(let[e,t]of u.entries()){if(r+=t,B.has(t)){let{groups:e}=RegExp(`(?:\\[(?<code>\\d+)m|\\${V}(?<uri>.*))`).exec(l.slice(d))||{groups:{}};if(e.code!==void 0){let t=Number.parseFloat(e.code);a=t===39?void 0:t}else e.uri!==void 0&&(o=e.uri.length===0?void 0:e.uri)}let n=i.codes.get(Number(a));u[e+1]===`
|
|
8
|
-
`?(o&&(r+=U(``)),a&&n&&(r+=H(n))):t===`
|
|
9
|
-
`&&(a&&n&&(r+=H(a)),o&&(r+=U(o))),d+=t.length}return r};function G(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
10
|
-
`,`
|
|
11
|
-
`).split(`
|
|
12
|
-
`).map(e=>Ae(e,t,n)).join(`
|
|
13
|
-
`)}var je=e(be(),1),K=e(r(),1);const q=`none`,J=()=>{let{env:e,stdout:t,stderr:n}=o;return t?.columns?t.columns:n?.columns?n.columns:e.COLUMNS?Number.parseInt(e.COLUMNS,10):80},Y=e=>typeof e==`number`?{top:e,right:e*3,bottom:e,left:e*3}:{top:0,right:0,bottom:0,left:0,...e},X=e=>e===q?0:2,Me=e=>{let t=[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`,`left`,`right`,`top`,`bottom`],n;if(e===q){e={};for(let n of t)e[n]=``}if(typeof e==`string`){if(n=je.default[e],!n)throw TypeError(`Invalid border style: ${e}`)}else{typeof e?.vertical==`string`&&(e.left=e.vertical,e.right=e.vertical),typeof e?.horizontal==`string`&&(e.top=e.horizontal,e.bottom=e.horizontal);for(let n of t)if(e[n]===null||typeof e[n]!=`string`)throw TypeError(`Invalid border style: ${n}`);n=e}return n},Ne=(e,t,n)=>{let r=``,i=f(e);switch(n){case`left`:r=e+t.slice(i);break;case`right`:r=t.slice(i)+e;break;default:t=t.slice(i),t.length%2==1?(t=t.slice(Math.floor(t.length/2)),r=t.slice(1)+e+t):(t=t.slice(t.length/2),r=t+e+t);break}return r},Pe=(e,{padding:t,width:n,textAlignment:r,height:i})=>{e=(0,K.default)(e,{align:r});let a=e.split(`
|
|
14
|
-
`),o=P(e),s=n-t.left-t.right;if(o>s){let e=[];for(let t of a){let n=(0,K.default)(G(t,s,{hard:!0}),{align:r}).split(`
|
|
15
|
-
`),i=Math.max(...n.map(e=>f(e)));for(let t of n){let n;switch(r){case`center`:n=` `.repeat((s-i)/2)+t;break;case`right`:n=` `.repeat(s-i)+t;break;default:n=t;break}e.push(n)}}a=e}r===`center`&&o<s?a=a.map(e=>` `.repeat((s-o)/2)+e):r===`right`&&o<s&&(a=a.map(e=>` `.repeat(s-o)+e));let c=` `.repeat(t.left),l=` `.repeat(t.right);return a=a.map(e=>{let t=c+e+l;return t+` `.repeat(n-f(t))}),t.top>0&&(a=[...Array.from({length:t.top}).fill(` `.repeat(n)),...a]),t.bottom>0&&(a=[...a,...Array.from({length:t.bottom}).fill(` `.repeat(n))]),i&&a.length>i?a=a.slice(0,i):i&&a.length<i&&(a=[...a,...Array.from({length:i-a.length}).fill(` `.repeat(n))]),a.join(`
|
|
16
|
-
`)},Fe=(e,t,n)=>{let r=e=>{let t=n.borderColor?Re(n.borderColor)(e):e;return n.dimBorder?N.dim(t):t},i=e=>n.backgroundColor?ze(n.backgroundColor)(e):e,a=Me(n.borderStyle),o=J(),s=` `.repeat(n.margin.left);if(n.float===`center`){let e=Math.max((o-t-X(n.borderStyle))/2,0);s=` `.repeat(e)}else if(n.float===`right`){let e=Math.max(o-t-n.margin.right-X(n.borderStyle),0);s=` `.repeat(e)}let c=``;n.margin.top&&(c+=`
|
|
17
|
-
`.repeat(n.margin.top)),(n.borderStyle!==q||n.title)&&(c+=r(s+a.topLeft+(n.title?Ne(n.title,a.top.repeat(t),n.titleAlignment):a.top.repeat(t))+a.topRight)+`
|
|
18
|
-
`);let l=e.split(`
|
|
19
|
-
`);return c+=l.map(e=>s+r(a.left)+i(e)+r(a.right)).join(`
|
|
20
|
-
`),n.borderStyle!==q&&(c+=`
|
|
21
|
-
`+r(s+a.bottomLeft+a.bottom.repeat(t)+a.bottomRight)),n.margin.bottom&&(c+=`
|
|
22
|
-
`.repeat(n.margin.bottom)),c},Ie=e=>{if(e.fullscreen&&o?.stdout){let t=[o.stdout.columns,o.stdout.rows];typeof e.fullscreen==`function`&&(t=e.fullscreen(...t)),e.width||=t[0],e.height||=t[1]}return e.width&&=Math.max(1,e.width-X(e.borderStyle)),e.height&&=Math.max(1,e.height-X(e.borderStyle)),e},Z=(e,t)=>t===q?e:` ${e} `,Le=(e,t)=>{t=Ie(t);let n=t.width!==void 0,r=J(),i=X(t.borderStyle),a=r-t.margin.left-t.margin.right-i,o=P(G(e,r-i,{hard:!0,trim:!1}))+t.padding.left+t.padding.right;if(t.title&&n?(t.title=t.title.slice(0,Math.max(0,t.width-2)),t.title&&=Z(t.title,t.borderStyle)):t.title&&(t.title=t.title.slice(0,Math.max(0,a-2)),t.title&&(t.title=Z(t.title,t.borderStyle),f(t.title)>o&&(t.width=f(t.title)))),t.width||=o,!n){if(t.margin.left&&t.margin.right&&t.width>a){let e=(r-t.width-i)/(t.margin.left+t.margin.right);t.margin.left=Math.max(0,Math.floor(t.margin.left*e)),t.margin.right=Math.max(0,Math.floor(t.margin.right*e))}t.width=Math.min(t.width,r-i-t.margin.left-t.margin.right)}return t.width-(t.padding.left+t.padding.right)<=0&&(t.padding.left=0,t.padding.right=0),t.height&&t.height-(t.padding.top+t.padding.bottom)<=0&&(t.padding.top=0,t.padding.bottom=0),t},Q=e=>e.match(/^#(?:[0-f]{3}){1,2}$/i),$=e=>typeof e==`string`&&(N[e]??Q(e)),Re=e=>Q(e)?N.hex(e):N[e],ze=e=>Q(e)?N.bgHex(e):N[De([`bg`,e])];function Be(e,t){if(t={padding:0,borderStyle:`single`,dimBorder:!1,textAlignment:`left`,float:`left`,titleAlignment:`left`,...t},t.align&&(t.textAlignment=t.align),t.borderColor&&!$(t.borderColor))throw Error(`${t.borderColor} is not a valid borderColor`);if(t.backgroundColor&&!$(t.backgroundColor))throw Error(`${t.backgroundColor} is not a valid backgroundColor`);return t.padding=Y(t.padding),t.margin=Y(t.margin),t=Le(e,t),e=Pe(e,t),Fe(e,t.width,t)}export{Be as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,l as t,r as n,u as r}from"./chevrotain.mjs";import{C as i,E as a,L as o,N as s,P as c,_ as l,c as u,d,f,h as p,l as m,o as h,p as g,q as _,u as v,x as y,z as b}from"./@chevrotain/cst-dts-gen.mjs";function x(e,t,n){return`${e.name}_${t}_${n}`}var S=class{constructor(e){this.target=e}isEpsilon(){return!1}},C=class extends S{constructor(e,t){super(e),this.tokenType=t}},w=class extends S{constructor(e){super(e)}isEpsilon(){return!0}},T=class extends S{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}};function ee(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};te(t,e);let n=e.length;for(let r=0;r<n;r++){let n=e[r],i=k(t,n,n);i!==void 0&&ce(t,n,i)}return t}function te(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r],i=R(e,n,void 0,{type:2}),a=R(e,n,void 0,{type:7});i.stop=a,e.ruleToStartState.set(n,i),e.ruleToStopState.set(n,a)}}function E(e,t,n){return n instanceof p?I(e,t,n.terminalType,n):n instanceof u?se(e,t,n):n instanceof h?ie(e,t,n):n instanceof m?ae(e,t,n):n instanceof v?D(e,t,n):n instanceof g?O(e,t,n):n instanceof d?ne(e,t,n):n instanceof f?re(e,t,n):k(e,t,n)}function D(e,t,n){let r=R(e,t,n,{type:5});return M(e,r),j(e,t,n,N(e,t,r,n,k(e,t,n)))}function O(e,t,n){let r=R(e,t,n,{type:5});return M(e,r),j(e,t,n,N(e,t,r,n,k(e,t,n)),I(e,t,n.separator,n))}function ne(e,t,n){let r=R(e,t,n,{type:4});return M(e,r),A(e,t,n,N(e,t,r,n,k(e,t,n)))}function re(e,t,n){let r=R(e,t,n,{type:4});return M(e,r),A(e,t,n,N(e,t,r,n,k(e,t,n)),I(e,t,n.separator,n))}function ie(e,t,n){let r=R(e,t,n,{type:1});return M(e,r),N(e,t,r,n,...c(n.definition,n=>E(e,t,n)))}function ae(e,t,n){let r=R(e,t,n,{type:1});return M(e,r),oe(e,t,n,N(e,t,r,n,k(e,t,n)))}function k(e,t,n){let r=o(c(n.definition,n=>E(e,t,n)),e=>e!==void 0);return r.length===1?r[0]:r.length===0?void 0:F(e,r)}function A(e,t,n,r,i){let a=r.left,o=r.right,s=R(e,t,n,{type:11});M(e,s);let c=R(e,t,n,{type:12});return a.loopback=s,c.loopback=s,e.decisionMap[x(t,i?`RepetitionMandatoryWithSeparator`:`RepetitionMandatory`,n.idx)]=s,L(o,s),i===void 0?(L(s,a),L(s,c)):(L(s,c),L(s,i.left),L(i.right,a)),{left:a,right:c}}function j(e,t,n,r,i){let a=r.left,o=r.right,s=R(e,t,n,{type:10});M(e,s);let c=R(e,t,n,{type:12}),l=R(e,t,n,{type:9});return s.loopback=l,c.loopback=l,L(s,a),L(s,c),L(o,l),i===void 0?L(l,s):(L(l,c),L(l,i.left),L(i.right,a)),e.decisionMap[x(t,i?`RepetitionWithSeparator`:`Repetition`,n.idx)]=s,{left:s,right:c}}function oe(e,t,n,r){let i=r.left,a=r.right;return L(i,a),e.decisionMap[x(t,`Option`,n.idx)]=i,r}function M(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function N(e,t,n,r,...i){let a=R(e,t,r,{type:8,start:n});n.end=a;for(let e of i)e===void 0?L(n,a):(L(n,e.left),L(e.right,a));let o={left:n,right:a};return e.decisionMap[x(t,P(r),r.idx)]=n,o}function P(e){if(e instanceof h)return`Alternation`;if(e instanceof m)return`Option`;if(e instanceof v)return`Repetition`;if(e instanceof g)return`RepetitionWithSeparator`;if(e instanceof d)return`RepetitionMandatory`;if(e instanceof f)return`RepetitionMandatoryWithSeparator`;throw Error(`Invalid production type encountered`)}function F(e,t){let n=t.length;for(let r=0;r<n-1;r++){let n=t[r],i;n.left.transitions.length===1&&(i=n.left.transitions[0]);let a=i instanceof T,o=i,s=t[r+1].left;n.left.type===1&&n.right.type===1&&i!==void 0&&(a&&o.followState===n.right||i.target===n.right)?(a?o.followState=s:i.target=s,B(e,n.right)):L(n.right,s)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function I(e,t,n,r){let i=R(e,t,r,{type:1}),a=R(e,t,r,{type:1});return z(i,new C(a,n)),{left:i,right:a}}function se(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),a=R(e,t,n,{type:1}),o=R(e,t,n,{type:1});return z(a,new T(i,r,o)),{left:a,right:o}}function ce(e,t,n){let r=e.ruleToStartState.get(t);L(r,n.left);let i=e.ruleToStopState.get(t);return L(n.right,i),{left:r,right:i}}function L(e,t){z(e,new w(t))}function R(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function z(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function B(e,t){e.states.splice(e.states.indexOf(t),1)}const V={};var H=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=U(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return c(this.configs,e=>e.alt)}get key(){let e=``;for(let t in this.map)e+=t+`:`;return e}};function U(e,t=!0){return`${t?`a${e.alt}`:``}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join(`_`)}`}function W(e,t){let n={};return r=>{let i=r.toString(),a=n[i];return a===void 0?(a={atnStartState:e,decision:t,states:{}},n[i]=a,a):a}}var G=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e=``,t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?`1`:`0`;return e}};const K=new G;var le=class extends n{constructor(e){super(),this.logging=e?.logging??(e=>console.log(e))}initialize(e){this.atn=ee(e.rules),this.dfas=J(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:a}=t,o=this.dfas,s=this.logging,l=x(r,`Alternation`,n),u=this.atn.decisionMap[l].decision,d=c(e({maxLookahead:1,occurrence:n,prodType:`Alternation`,rule:r}),e=>c(e,e=>e[0]));if(q(d,!1)&&!a){let e=y(d,(e,t,n)=>(b(t,t=>{t&&(e[t.tokenTypeIdx]=n,b(t.categoryMatches,t=>{e[t]=n}))}),e),{});return i?function(t){let n=e[this.LA(1).tokenTypeIdx];if(t!==void 0&&n!==void 0){let e=t[n]?.GATE;if(e!==void 0&&e.call(this)===!1)return}return n}:function(){return e[this.LA(1).tokenTypeIdx]}}else if(i)return function(e){let t=new G,n=e===void 0?0:e.length;for(let r=0;r<n;r++){let n=e?.[r].GATE;t.set(r,n===void 0||n.call(this))}let r=Y.call(this,o,u,t,s);return typeof r==`number`?r:void 0};else return function(){let e=Y.call(this,o,u,K,s);return typeof e==`number`?e:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:o}=t,s=this.dfas,l=this.logging,u=x(r,i,n),d=this.atn.decisionMap[u].decision,f=c(e({maxLookahead:1,occurrence:n,prodType:i,rule:r}),e=>c(e,e=>e[0]));if(q(f)&&f[0][0]&&!o){let e=f[0],t=_(e);if(t.length===1&&a(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=y(t,(e,t)=>(t!==void 0&&(e[t.tokenTypeIdx]=!0,b(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}return function(){let e=Y.call(this,s,d,K,l);return typeof e==`object`?!1:e===0}}};function q(e,t=!0){let n=new Set;for(let r of e){let e=new Set;for(let i of r){if(i===void 0){if(t)break;return!1}let r=[i.tokenTypeIdx].concat(i.categoryMatches);for(let t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function J(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=W(e.decisionStates[r],r);return n}function Y(e,t,n,r){let i=e[t](n),a=i.start;return a===void 0&&(a=Q(i,X(be(i.atnStartState))),i.start=a),ue.apply(this,[i,a,n,r])}function ue(e,t,n,r){let i=t,a=1,o=[],s=this.LA(a++);for(;;){let t=ge(i,s);if(t===void 0&&(t=de.apply(this,[e,i,s,a,n,r])),t===V)return he(o,i,s);if(t.isAcceptState===!0)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function de(e,t,n,r,a,o){let s=_e(t.configs,n,a);if(s.size===0)return Z(e,t,n,V),V;let c=X(s),l=ye(s,a);if(l!==void 0)c.isAcceptState=!0,c.prediction=l,c.configs.uniqueAlt=l;else if(we(s)){let t=i(s.alts);c.isAcceptState=!0,c.prediction=t,c.configs.uniqueAlt=t,fe.apply(this,[e,r,s.alts,o])}return c=Z(e,t,n,c),c}function fe(e,t,n,r){let i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);let a=e.atnStartState,o=a.rule,s=a.production;r(pe({topLevelRule:o,ambiguityIndices:n,production:s,prefixPath:i}))}function pe(e){let n=c(e.prefixPath,e=>t(e)).join(`, `),r=e.production.idx===0?``:e.production.idx,i=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(`, `)}> in <${me(e.production)}${r}> inside <${e.topLevelRule.name}> Rule,\n<${n}> may appears as a prefix path in all these alternatives.\n`;return i+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
2
|
-
For Further details.`,i}function me(e){if(e instanceof u)return`SUBRULE`;if(e instanceof m)return`OPTION`;if(e instanceof h)return`OR`;if(e instanceof d)return`AT_LEAST_ONE`;if(e instanceof f)return`AT_LEAST_ONE_SEP`;if(e instanceof g)return`MANY_SEP`;if(e instanceof v)return`MANY`;if(e instanceof p)return`CONSUME`;throw Error(`non exhaustive match`)}function he(e,t,n){return{actualToken:n,possibleTokenTypes:l(s(t.configs.elements,e=>e.state.transitions).filter(e=>e instanceof C).map(e=>e.tokenType),e=>e.tokenTypeIdx),tokenPath:e}}function ge(e,t){return e.edges[t.tokenTypeIdx]}function _e(e,t,n){let r=new H,i=[];for(let a of e.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===7){i.push(a);continue}let e=a.state.transitions.length;for(let n=0;n<e;n++){let e=a.state.transitions[n],i=ve(e,t);i!==void 0&&r.add({state:i,alt:a.alt,stack:a.stack})}}let a;if(i.length===0&&r.size===1&&(a=r),a===void 0){a=new H;for(let e of r.elements)$(e,a)}if(i.length>0&&!Se(a))for(let e of i)a.add(e);return a}function ve(e,t){if(e instanceof C&&r(t,e.tokenType))return e.target}function ye(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function X(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function Z(e,t,n,r){return r=Q(e,r),t.edges[n.tokenTypeIdx]=r,r}function Q(e,t){if(t===V)return t;let n=t.configs.key,r=e.states[n];return r===void 0?(t.configs.finalize(),e.states[n]=t,t):r}function be(e){let t=new H,n=e.transitions.length;for(let r=0;r<n;r++)$({state:e.transitions[r].target,alt:r,stack:[]},t);return t}function $(e,t){let n=e.state;if(n.type===7){if(e.stack.length>0){let n=[...e.stack];$({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let r=n.transitions[i],a=xe(e,r);a!==void 0&&$(a,t)}}function xe(e,t){if(t instanceof w)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof T){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function Se(e){for(let t of e.elements)if(t.state.type===7)return!0;return!1}function Ce(e){for(let t of e.elements)if(t.state.type!==7)return!1;return!0}function we(e){if(Ce(e))return!0;let t=Te(e.elements);return Ee(t)&&!De(t)}function Te(e){let t=new Map;for(let n of e){let e=U(n,!1),r=t.get(e);r===void 0&&(r={},t.set(e,r)),r[n.alt]=!0}return t}function Ee(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function De(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}export{le as t};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./@chevrotain/regexp-to-ast.mjs";import{$ as n,A as r,B as i,D as a,E as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,M as m,N as h,O as g,P as _,Q as v,R as y,S as b,T as x,U as S,V as C,W as ee,X as w,Y as T,Z as E,a as D,b as O,c as k,d as A,et as j,f as M,g as te,h as N,i as ne,j as P,k as F,l as I,m as L,n as re,o as ie,p as ae,q as R,r as oe,s as z,t as B,u as V,v as se,w as H,x as U,y as ce,z as W}from"./@chevrotain/cst-dts-gen.mjs";import{i as le,n as ue,r as de,t as fe}from"./@chevrotain/utils.mjs";var pe=class{walk(e,t=[]){W(e.definition,(n,r)=>{let i=C(e.definition,r+1);if(n instanceof k)this.walkProdRef(n,i,t);else if(n instanceof N)this.walkTerminal(n,i,t);else if(n instanceof z)this.walkFlat(n,i,t);else if(n instanceof I)this.walkOption(n,i,t);else if(n instanceof A)this.walkAtLeastOne(n,i,t);else if(n instanceof M)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ae)this.walkManySep(n,i,t);else if(n instanceof V)this.walkMany(n,i,t);else if(n instanceof ie)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new I({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=me(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new I({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=me(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);W(e.definition,e=>{let t=new z({definition:[e]});this.walk(t,r)})}};function me(e,t,n){return[new I({definition:[new N({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function he(e){if(e instanceof k)return he(e.referencedRule);if(e instanceof N)return ve(e);if(ne(e))return ge(e);if(re(e))return _e(e);throw Error(`non exhaustive match`)}function ge(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=oe(a),t=t.concat(he(a)),r+=1,i=n.length>r;return se(t)}function _e(e){return se(R(_(e.definition,e=>he(e))))}function ve(e){return[e.terminalType]}const ye=`_~IN~_`;var be=class extends pe{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Se(e.referencedRule,e.idx)+this.topProd.name,i=he(new z({definition:t.concat(n)}));this.follows[r]=i}};function xe(e){let t={};return W(e,e=>{d(t,new be(e).startWalking())}),t}function Se(e,t){return e.name+t+ye}let Ce={};const we=new e;function Te(e){let t=e.toString();if(Ce.hasOwnProperty(t))return Ce[t];{let e=we.pattern(t);return Ce[t]=e,e}}function Ee(){Ce={}}const De=`Complement Sets are not supported for first char optimization`,Oe=`Unable to use "first char" lexer optimizations:
|
|
2
|
-
`;function ke(e,t=!1){try{let t=Te(e);return Ae(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===De)t&&le(`${Oe}\tUnable to optimize: < ${e.toString()} >\n Complement Sets cannot be automatically optimized.
|
|
3
|
-
This will disable the lexer's first char optimizations.
|
|
4
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n=``;t&&(n=`
|
|
5
|
-
This will disable the lexer's first char optimizations.
|
|
6
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),de(`${Oe}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Ae(e,t,n){switch(e.type){case`Disjunction`:for(let r=0;r<e.value.length;r++)Ae(e.value[r],t,n);break;case`Alternative`:let r=e.value;for(let e=0;e<r.length;e++){let i=r[e];switch(i.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}let a=i;switch(a.type){case`Character`:je(a.value,t,n);break;case`Set`:if(a.complement===!0)throw Error(De);W(a.value,e=>{if(typeof e==`number`)je(e,t,n);else{let r=e;if(n===!0)for(let e=r.from;e<=r.to;e++)je(e,t,n);else{for(let e=r.from;e<=r.to&&e<ht;e++)je(e,t,n);if(r.to>=ht){let e=r.from>=ht?r.from:ht,n=r.to,i=K(e),a=K(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case`Group`:Ae(a.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}let o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type===`Group`&&Pe(a)===!1||a.type!==`Group`&&o===!1)break}break;default:throw Error(`non exhaustive match!`)}return F(t)}function je(e,t,n){let r=K(e);t[r]=r,n===!0&&Me(e,t)}function Me(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let e=K(r.charCodeAt(0));t[e]=e}else{let e=n.toLowerCase();if(e!==n){let n=K(e.charCodeAt(0));t[n]=n}}}function Ne(e,t){return u(e.value,e=>{if(typeof e==`number`)return g(t,e);{let n=e;return u(t,e=>n.from<=e&&e<=n.to)!==void 0}})}function Pe(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?j(e.value)?y(e.value,Pe):Pe(e.value):!1}var Fe=class extends t{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case`Lookahead`:this.visitLookahead(e);return;case`NegativeLookahead`:this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){g(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Ne(e,this.targetCharCodes)===void 0&&(this.found=!0):Ne(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Ie(e,t){if(t instanceof RegExp){let n=Te(t),r=new Fe(e);return r.visit(n),r.found}else return u(t,t=>g(e,t.charCodeAt(0)))!==void 0}const G=`PATTERN`,Le=`defaultMode`,Re=`modes`;let ze=typeof RegExp(`(?:)`).sticky==`boolean`;function Be(e,t){t=ee(t,{useSticky:ze,debug:!1,safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`
|
|
7
|
-
`],tracer:(e,t)=>t()});let n=t.tracer;n(`initCharCodeToOptimizedIndexMap`,()=>{_t()});let i;n(`Reject Lexer.NA`,()=>{i=O(e,e=>e[G]===J.NA)});let s=!1,c;n(`Transform Patterns`,()=>{s=!1,c=_(i,e=>{let n=e[G];if(x(n)){let e=n.source;return e.length===1&&e!==`^`&&e!==`$`&&e!==`.`&&!n.ignoreCase?e:e.length===2&&e[0]===`\\`&&!g([`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`],e[1])?e[1]:t.useSticky?it(n):rt(n)}else if(E(n))return s=!0,{exec:n};else if(typeof n==`object`)return s=!0,n;else if(typeof n==`string`){if(n.length===1)return n;{let e=n.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`),r=new RegExp(e);return t.useSticky?it(r):rt(r)}}else throw Error(`non exhaustive match`)})});let l,u,d,f,p;n(`misc mapping`,()=>{l=_(i,e=>e.tokenTypeIdx),u=_(i,e=>{let t=e.GROUP;if(t!==J.SKIPPED){if(r(t))return t;if(H(t))return!1;throw Error(`non exhaustive match`)}}),d=_(i,e=>{let t=e.LONGER_ALT;if(t)return j(t)?_(t,e=>a(i,e)):[a(i,t)]}),f=_(i,e=>e.PUSH_MODE),p=_(i,e=>P(e,`POP_MODE`))});let m;n(`Line Terminator Handling`,()=>{let e=pt(t.lineTerminatorCharacters);m=_(i,e=>!1),t.positionTracking!==`onlyOffset`&&(m=_(i,t=>P(t,`LINE_BREAKS`)?!!t.LINE_BREAKS:dt(t,e)===!1&&Ie(e,t.PATTERN)))});let h,v,y,b;n(`Misc Mapping #2`,()=>{h=_(i,ct),v=_(c,lt),y=U(i,(e,t)=>{let n=t.GROUP;return r(n)&&n!==J.SKIPPED&&(e[n]=[]),e},{}),b=_(c,(e,t)=>({pattern:c[t],longerAlt:d[t],canLineTerminator:m[t],isCustom:h[t],short:v[t],group:u[t],push:f[t],pop:p[t],tokenTypeIdx:l[t],tokenType:i[t]}))});let S=!0,C=[];return t.safeMode||n(`First Char Optimization`,()=>{C=U(i,(e,n,r)=>{if(typeof n.PATTERN==`string`)mt(e,K(n.PATTERN.charCodeAt(0)),b[r]);else if(j(n.START_CHARS_HINT)){let t;W(n.START_CHARS_HINT,n=>{let i=K(typeof n==`string`?n.charCodeAt(0):n);t!==i&&(t=i,mt(e,i,b[r]))})}else if(x(n.PATTERN))if(n.PATTERN.unicode)S=!1,t.ensureOptimizations&&de(`${Oe}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
8
|
-
This will disable the lexer's first char optimizations.
|
|
9
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let i=ke(n.PATTERN,t.ensureOptimizations);o(i)&&(S=!1),W(i,t=>{mt(e,t,b[r])})}else t.ensureOptimizations&&de(`${Oe}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n This will disable the lexer's first char optimizations.
|
|
10
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),S=!1;return e},[])}),{emptyGroups:y,patternIdxToConfig:b,charCodeToPatternIdxToConfig:C,hasCustom:s,canBeOptimized:S}}function Ve(e,t){let n=[],r=Ue(e);n=n.concat(r.errors);let i=We(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(He(a)),n=n.concat(Qe(a)),n=n.concat($e(a,t)),n=n.concat(et(a)),n}function He(e){let t=[],n=p(e,e=>x(e[G]));return t=t.concat(Ke(n)),t=t.concat(Ye(n)),t=t.concat(Xe(n)),t=t.concat(Ze(n)),t=t.concat(qe(n)),t}function Ue(e){let t=p(e,e=>!P(e,G));return{errors:_(t,e=>({message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:q.MISSING_PATTERN,tokenTypes:[e]})),valid:S(e,t)}}function We(e){let t=p(e,e=>{let t=e[G];return!x(t)&&!E(t)&&!P(t,`exec`)&&!r(t)});return{errors:_(t,e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:q.INVALID_PATTERN,tokenTypes:[e]})),valid:S(e,t)}}const Ge=/[^\\][$]/;function Ke(e){class n extends t{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return _(p(e,e=>{let t=e.PATTERN;try{let e=Te(t),r=new n;return r.visit(e),r.found}catch{return Ge.test(t.source)}}),e=>({message:`Unexpected RegExp Anchor Error:
|
|
11
|
-
Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
12
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}function qe(e){return _(p(e,e=>e.PATTERN.test(``)),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:q.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}const Je=/[^\\[][\^]|^\^/;function Ye(e){class n extends t{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return _(p(e,e=>{let t=e.PATTERN;try{let e=Te(t),r=new n;return r.visit(e),r.found}catch{return Je.test(t.source)}}),e=>({message:`Unexpected RegExp Anchor Error:
|
|
13
|
-
Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
14
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function Xe(e){return _(p(e,e=>{let t=e[G];return t instanceof RegExp&&(t.multiline||t.global)}),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:q.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function Ze(e){let t=[],n=_(e,n=>U(e,(e,r)=>n.PATTERN.source===r.PATTERN.source&&!g(t,r)&&r.PATTERN!==J.NA?(t.push(r),e.push(r),e):e,[]));return n=c(n),_(p(n,e=>e.length>1),e=>{let t=_(e,e=>e.name);return{message:`The same RegExp pattern ->${s(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:q.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function Qe(e){return _(p(e,e=>{if(!P(e,`GROUP`))return!1;let t=e.GROUP;return t!==J.SKIPPED&&t!==J.NA&&!r(t)}),e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:q.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function $e(e,t){return _(p(e,e=>e.PUSH_MODE!==void 0&&!g(t,e.PUSH_MODE)),e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:q.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function et(e){let t=[],n=U(e,(e,t,n)=>{let i=t.PATTERN;return i===J.NA||(r(i)?e.push({str:i,idx:n,tokenType:t}):x(i)&&nt(i)&&e.push({str:i.source,idx:n,tokenType:t})),e},[]);return W(e,(e,r)=>{W(n,({str:n,idx:i,tokenType:a})=>{if(r<i&&tt(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:q.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function tt(e,t){if(x(t)){let n=t.exec(e);return n!==null&&n.index===0}else if(E(t))return t(e,0,[],{});else if(P(t,`exec`))return t.exec(e,0,[],{});else if(typeof t==`string`)return t===e;else throw Error(`non exhaustive match`)}function nt(e){return u([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],t=>e.source.indexOf(t)!==-1)===void 0}function rt(e){let t=e.ignoreCase?`i`:``;return RegExp(`^(?:${e.source})`,t)}function it(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function at(e,t,n){let r=[];return P(e,Le)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+Le+`> property in its definition
|
|
15
|
-
`,type:q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),P(e,Re)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+Re+`> property in its definition
|
|
16
|
-
`,type:q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),P(e,Re)&&P(e,Le)&&!P(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Le}: <${e.defaultMode}>which does not exist\n`,type:q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),P(e,Re)&&W(e.modes,(e,t)=>{W(e,(n,i)=>{H(n)?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>\n`,type:q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):P(n,`LONGER_ALT`)&&W(j(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT],i=>{!H(i)&&!g(e,i)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${t}>\n`,type:q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}function ot(e,t,n){let r=[],i=!1,a=O(c(R(F(e.modes))),e=>e[G]===J.NA),o=pt(n);return t&&W(a,e=>{let t=dt(e,o);if(t!==!1){let n={message:ft(e,t),type:t.issue,tokenType:e};r.push(n)}else P(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):Ie(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
17
|
-
This Lexer has been defined to track line and column information,
|
|
18
|
-
But none of the Token Types can be identified as matching a line terminator.
|
|
19
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
20
|
-
for details.`,type:q.NO_LINE_BREAKS_FLAGS}),r}function st(e){let t={};return W(T(e),n=>{let r=e[n];if(j(r))t[n]=[];else throw Error(`non exhaustive match`)}),t}function ct(e){let t=e.PATTERN;if(x(t))return!1;if(E(t)||P(t,`exec`))return!0;if(r(t))return!1;throw Error(`non exhaustive match`)}function lt(e){return r(e)&&e.length===1?e.charCodeAt(0):!1}const ut={test:function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let t=e.charCodeAt(n);if(t===10)return this.lastIndex=n+1,!0;if(t===13)return e.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function dt(e,t){if(P(e,`LINE_BREAKS`))return!1;if(x(e.PATTERN)){try{Ie(t,e.PATTERN)}catch(e){return{issue:q.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}else if(r(e.PATTERN))return!1;else if(ct(e))return{issue:q.CUSTOM_LINE_BREAK};else throw Error(`non exhaustive match`)}function ft(e,t){if(t.issue===q.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
21
|
-
\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===q.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
22
|
-
\tThe problem is in the <${e.name}> Token Type\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}function pt(e){return _(e,e=>r(e)?e.charCodeAt(0):e)}function mt(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}const ht=256;let gt=[];function K(e){return e<256?e:gt[e]}function _t(){if(o(gt)){gt=Array(65536);for(let e=0;e<65536;e++)gt[e]=e>255?255+~~(e/255):e}}function vt(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}function yt(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}let bt=1;const xt={};function St(e){let t=Ct(e);wt(t),Et(t),Tt(t),W(t,e=>{e.isParent=e.categoryMatches.length>0})}function Ct(e){let t=f(e),n=e,r=!0;for(;r;){n=c(R(_(n,e=>e.CATEGORIES)));let e=S(n,t);t=t.concat(e),o(e)?r=!1:n=e}return t}function wt(e){W(e,e=>{Ot(e)||(xt[bt]=e,e.tokenTypeIdx=bt++),kt(e)&&!j(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),kt(e)||(e.CATEGORIES=[]),At(e)||(e.categoryMatches=[]),jt(e)||(e.categoryMatchesMap={})})}function Tt(e){W(e,e=>{e.categoryMatches=[],W(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(xt[n].tokenTypeIdx)})})}function Et(e){W(e,e=>{Dt([],e)})}function Dt(e,t){W(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),W(t.CATEGORIES,n=>{let r=e.concat(t);g(r,n)||Dt(r,n)})}function Ot(e){return P(e,`tokenTypeIdx`)}function kt(e){return P(e,`CATEGORIES`)}function At(e){return P(e,`categoryMatches`)}function jt(e){return P(e,`categoryMatchesMap`)}function Mt(e){return P(e,`tokenTypeIdx`)}const Nt={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,n,r,i){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`}};var q;(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`,e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]=`MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE`})(q||={});const Pt={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
23
|
-
`,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Nt,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Pt);var J=class{constructor(e,t=Pt){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=ue(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}else return t()},typeof t==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
24
|
-
a boolean 2nd argument is no longer supported`);this.config=d({},Pt,t);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n==`number`&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,()=>{let n,r=!0;this.TRACE_INIT(`Lexer Config handling`,()=>{if(this.config.lineTerminatorsPattern===Pt.lineTerminatorsPattern)this.config.lineTerminatorsPattern=ut;else if(this.config.lineTerminatorCharacters===Pt.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
25
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),j(e)?n={modes:{defaultMode:f(e)},defaultMode:Le}:(r=!1,n=f(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT(`performRuntimeChecks`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(at(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT(`performWarningRuntimeChecks`,()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(ot(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},W(n.modes,(e,t)=>{n.modes[t]=O(e,e=>H(e))});let i=T(n.modes);if(W(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),this.config.skipValidations===!1&&this.TRACE_INIT(`validatePatterns`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ve(e,i))}),o(this.lexerDefinitionErrors)){St(e);let r;this.TRACE_INIT(`analyzeTokenTypes`,()=>{r=Be(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=d({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!o(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let e=_(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------
|
|
26
|
-
`);throw Error(`Errors detected in definition of Lexer:
|
|
27
|
-
`+e)}W(this.lexerDefinitionWarning,e=>{le(e.message)}),this.TRACE_INIT(`Choosing sub-methods implementations`,()=>{if(ze?(this.chopInput=v,this.match=this.matchWithTest):(this.updateLastIndex=w,this.match=this.matchWithExec),r&&(this.handleModes=w),this.trackStartLines===!1&&(this.computeNewColumn=v),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=w),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT(`Failed Optimization Warnings`,()=>{let e=U(this.canModeBeOptimized,(e,t,n)=>(t===!1&&e.push(n),e),[]);if(t.ensureOptimizations&&!o(e))throw Error(`Lexer Modes: < ${e.join(`, `)} > cannot be optimized.\n Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
28
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT(`clearRegExpParserCache`,()=>{Ee()}),this.TRACE_INIT(`toFastProperties`,()=>{fe(this)})})}tokenize(e,t=this.defaultMode){if(!o(this.lexerDefinitionErrors)){let e=_(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------
|
|
29
|
-
`);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
30
|
-
`+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,o,s,c,u,d,f,p,m,h,g,_,v=e,y=v.length,b=0,x=0,S=this.hasCustom?0:Math.floor(e.length/10),C=Array(S),ee=[],w=this.trackStartLines?1:void 0,T=this.trackStartLines?1:void 0,E=st(this.emptyGroups),D=this.trackStartLines,O=this.config.lineTerminatorsPattern,k=0,A=[],j=[],M=[],te=[];Object.freeze(te);let N;function ne(){return A}function P(e){let t=K(e),n=j[t];return n===void 0?te:n}let F=e=>{if(M.length===1&&e.tokenType.PUSH_MODE===void 0){let t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);ee.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{M.pop();let e=l(M);A=this.patternIdxToConfig[e],j=this.charCodeToPatternIdxToConfig[e],k=A.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;N=j&&t?P:ne}};function I(e){M.push(e),j=this.charCodeToPatternIdxToConfig[e],A=this.patternIdxToConfig[e],k=A.length,k=A.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;N=j&&t?P:ne}I.call(this,t);let L,re=this.config.recoveryEnabled;for(;b<y;){s=null;let t=v.charCodeAt(b),l=N(t),S=l.length;for(n=0;n<S;n++){L=l[n];let r=L.pattern;c=null;let d=L.short;if(d===!1?L.isCustom===!0?(_=r.exec(v,b,C,E),_===null?s=null:(s=_[0],_.payload!==void 0&&(c=_.payload))):(this.updateLastIndex(r,b),s=this.match(r,e,b)):t===d&&(s=r),s!==null){if(o=L.longerAlt,o!==void 0){let t=o.length;for(i=0;i<t;i++){let t=A[o[i]],n=t.pattern;if(u=null,t.isCustom===!0?(_=n.exec(v,b,C,E),_===null?a=null:(a=_[0],_.payload!==void 0&&(u=_.payload))):(this.updateLastIndex(n,b),a=this.match(n,e,b)),a&&a.length>s.length){s=a,c=u,L=t;break}}}break}}if(s!==null){if(d=s.length,f=L.group,f!==void 0&&(p=L.tokenTypeIdx,m=this.createTokenInstance(s,b,p,L.tokenType,w,T,d),this.handlePayload(m,c),f===!1?x=this.addToken(C,x,m):E[f].push(m)),e=this.chopInput(e,d),b+=d,T=this.computeNewColumn(T,d),D===!0&&L.canLineTerminator===!0){let e=0,t,n;O.lastIndex=0;do t=O.test(s),t===!0&&(n=O.lastIndex-1,e++);while(t===!0);e!==0&&(w+=e,T=d-n,this.updateTokenEndLineColumnLocation(m,f,n,e,w,T,d))}this.handleModes(L,F,I,m)}else{let t=b,n=w,i=T,a=re===!1;for(;a===!1&&b<y;)for(e=this.chopInput(e,1),b++,r=0;r<k;r++){let t=A[r],n=t.pattern,i=t.short;if(i===!1?t.isCustom===!0?a=n.exec(v,b,C,E)!==null:(this.updateLastIndex(n,b),a=n.exec(e)!==null):v.charCodeAt(b)===i&&(a=!0),a===!0)break}if(h=b-t,T=this.computeNewColumn(T,h),g=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,t,h,n,i),ee.push({offset:t,line:n,column:i,length:h,message:g}),re===!1)break}}return this.hasCustom||(C.length=x),{tokens:C,groups:E,errors:ee}}handleModes(e,t,n,r){if(e.pop===!0){let i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,n,r,i,a,o){let s,c;t!==void 0&&(s=n===o-1,c=s?-1:0,r===1&&s===!0||(e.endLine=i+c,e.endColumn=a-1+-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}matchWithTest(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null}matchWithExec(e,t){let n=e.exec(t);return n===null?null:n[0]}};J.SKIPPED=`This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.`,J.NA=/NOT_APPLICABLE/;function Ft(e){return It(e)?e.LABEL:e.name}function It(e){return r(e.LABEL)&&e.LABEL!==``}const Lt=`categories`,Rt=`label`,zt=`group`,Bt=`push_mode`,Vt=`pop_mode`,Ht=`longer_alt`,Ut=`line_breaks`,Wt=`start_chars_hint`;function Gt(e){return Kt(e)}function Kt(e){let t=e.pattern,n={};if(n.name=e.name,H(t)||(n.PATTERN=t),P(e,`parent`))throw`The parent property is no longer supported.
|
|
31
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return P(e,Lt)&&(n.CATEGORIES=e[Lt]),St([n]),P(e,Rt)&&(n.LABEL=e[Rt]),P(e,zt)&&(n.GROUP=e[zt]),P(e,Vt)&&(n.POP_MODE=e[Vt]),P(e,Bt)&&(n.PUSH_MODE=e[Bt]),P(e,Ht)&&(n.LONGER_ALT=e[Ht]),P(e,Ut)&&(n.LINE_BREAKS=e[Ut]),P(e,Wt)&&(n.START_CHARS_HINT=e[Wt]),n}const Y=Gt({name:`EOF`,pattern:J.NA});St([Y]);function qt(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function Jt(e,t){return vt(e,t)}const Yt={buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:r}){return`Expecting ${It(e)?`--> ${Ft(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return`Redundant input, expecting EOF but found: `+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let a=`
|
|
32
|
-
but found: '`+s(t).image+`'`;return r?`Expecting: `+r+a:`Expecting: one of these possible Token sequences:\n${_(_(U(e,(e,t)=>e.concat(t),[]),e=>`[${_(e,e=>Ft(e)).join(`, `)}]`),(e,t)=>` ${t+1}. ${e}`).join(`
|
|
33
|
-
`)}`+a},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i=`
|
|
34
|
-
but found: '`+s(t).image+`'`;return n?`Expecting: `+n+i:`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${_(e,e=>`[${_(e,e=>Ft(e)).join(`,`)}]`).join(` ,`)}>`+i}};Object.freeze(Yt);const Xt={buildRuleNotFoundError(e,t){return`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-
|
|
35
|
-
inside top level rule: ->`+e.name+`<-`}},X={buildDuplicateFoundError(e,t){function n(e){return e instanceof N?e.terminalType.name:e instanceof k?e.nonTerminalName:``}let r=e.name,i=s(t),a=i.idx,o=B(i),c=n(i),l=`->${o}${a>0?a:``}<- ${c?`with argument: ->${c}<-`:``}
|
|
36
|
-
appears more than once (${t.length} times) in the top level rule: ->${r}<-.
|
|
37
|
-
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
38
|
-
`;return l=l.replace(/[ \t]+/g,` `),l=l.replace(/\s\s+/g,`
|
|
39
|
-
`),l},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=_(e.prefixPath,e=>Ft(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(` ,`)}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){let t=_(e.prefixPath,e=>Ft(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(` ,`)}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
40
|
-
For Further details.`,r},buildEmptyRepetitionError(e){let t=B(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError(e){return`deprecated`},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --> ${_(e.leftRecursionPath,e=>e.name).concat([t]).join(` --> `)}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return`deprecated`},buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof L?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function Zt(e,t){let n=new Qt(e,t);return n.resolveRefs(),n.errors}var Qt=class extends D{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){W(F(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:$.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},$t=class extends pe{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=f(this.path.ruleStack).reverse(),this.occurrenceStack=f(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){o(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},en=class extends $t{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found&&(this.possibleTokTypes=he(new z({definition:t.concat(n)})),this.found=!0)}},tn=class extends pe{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},nn=class extends tn{walkMany(e,t,n){if(e.idx===this.occurrence){let e=s(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof N&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},rn=class extends tn{walkManySep(e,t,n){if(e.idx===this.occurrence){let e=s(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof N&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},an=class extends tn{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=s(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof N&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},on=class extends tn{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=s(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof N&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}};function sn(e,t,n=[]){n=f(n);let r=[],i=0;function a(t){return t.concat(C(e,i+1))}function s(e){let i=sn(a(e),t,n);return r.concat(i)}for(;n.length<t&&i<e.length;){let t=e[i];if(t instanceof z||t instanceof k)return s(t.definition);if(t instanceof I)r=s(t.definition);else if(t instanceof A)return s(t.definition.concat([new V({definition:t.definition})]));else if(t instanceof M)return s([new z({definition:t.definition}),new V({definition:[new N({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof ae)r=s(t.definition.concat([new V({definition:[new N({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof V)r=s(t.definition.concat([new V({definition:t.definition})]));else if(t instanceof ie)return W(t.definition,e=>{o(e.definition)===!1&&(r=s(e.definition))}),r;else if(t instanceof N)n.push(t.terminalType);else throw Error(`non exhaustive match`);i++}return r.push({partialPath:n,suffixDef:C(e,i)}),r}function cn(e,t,n,r){let a=`EXIT_NONE_TERMINAL`,s=[a],c=`EXIT_ALTERNATIVE`,u=!1,d=t.length,p=d-r-1,m=[],h=[];for(h.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!o(h);){let e=h.pop();if(e===c){u&&l(h).idx<=p&&h.pop();continue}let r=e.def,g=e.idx,_=e.ruleStack,v=e.occurrenceStack;if(o(r))continue;let y=r[0];if(y===a){let e={idx:g,def:C(r),ruleStack:i(_),occurrenceStack:i(v)};h.push(e)}else if(y instanceof N)if(g<d-1){let e=g+1,i=t[e];if(n(i,y.terminalType)){let t={idx:e,def:C(r),ruleStack:_,occurrenceStack:v};h.push(t)}}else if(g===d-1)m.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:_,occurrenceStack:v}),u=!0;else throw Error(`non exhaustive match`);else if(y instanceof k){let e=f(_);e.push(y.nonTerminalName);let t=f(v);t.push(y.idx);let n={idx:g,def:y.definition.concat(s,C(r)),ruleStack:e,occurrenceStack:t};h.push(n)}else if(y instanceof I){let e={idx:g,def:C(r),ruleStack:_,occurrenceStack:v};h.push(e),h.push(c);let t={idx:g,def:y.definition.concat(C(r)),ruleStack:_,occurrenceStack:v};h.push(t)}else if(y instanceof A){let e=new V({definition:y.definition,idx:y.idx}),t={idx:g,def:y.definition.concat([e],C(r)),ruleStack:_,occurrenceStack:v};h.push(t)}else if(y instanceof M){let e=new V({definition:[new N({terminalType:y.separator})].concat(y.definition),idx:y.idx}),t={idx:g,def:y.definition.concat([e],C(r)),ruleStack:_,occurrenceStack:v};h.push(t)}else if(y instanceof ae){let e={idx:g,def:C(r),ruleStack:_,occurrenceStack:v};h.push(e),h.push(c);let t=new V({definition:[new N({terminalType:y.separator})].concat(y.definition),idx:y.idx}),n={idx:g,def:y.definition.concat([t],C(r)),ruleStack:_,occurrenceStack:v};h.push(n)}else if(y instanceof V){let e={idx:g,def:C(r),ruleStack:_,occurrenceStack:v};h.push(e),h.push(c);let t=new V({definition:y.definition,idx:y.idx}),n={idx:g,def:y.definition.concat([t],C(r)),ruleStack:_,occurrenceStack:v};h.push(n)}else if(y instanceof ie)for(let e=y.definition.length-1;e>=0;e--){let t={idx:g,def:y.definition[e].definition.concat(C(r)),ruleStack:_,occurrenceStack:v};h.push(t),h.push(c)}else if(y instanceof z)h.push({idx:g,def:y.definition.concat(C(r)),ruleStack:_,occurrenceStack:v});else if(y instanceof L)h.push(ln(y,g,_,v));else throw Error(`non exhaustive match`)}return m}function ln(e,t,n,r){let i=f(n);i.push(e.name);let a=f(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}var Z;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(Z||={});function un(e){if(e instanceof I||e===`Option`)return Z.OPTION;if(e instanceof V||e===`Repetition`)return Z.REPETITION;if(e instanceof A||e===`RepetitionMandatory`)return Z.REPETITION_MANDATORY;if(e instanceof M||e===`RepetitionMandatoryWithSeparator`)return Z.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ae||e===`RepetitionWithSeparator`)return Z.REPETITION_WITH_SEPARATOR;if(e instanceof ie||e===`Alternation`)return Z.ALTERNATION;throw Error(`non exhaustive match`)}function dn(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=un(r);return a===Z.ALTERNATION?Sn(t,n,i):Cn(t,n,a,i)}function fn(e,t,n,r,i,a){let o=Sn(e,t,n);return a(o,r,En(o)?yt:vt,i)}function pn(e,t,n,r,i,a){let o=Cn(e,t,i,n),s=En(o)?yt:vt;return a(o[0],s,r)}function mn(e,t,n,r){let i=e.length,a=y(e,e=>y(e,e=>e.length===1));if(t)return function(t){let r=_(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(!(o!==void 0&&o.call(this)===!1))nextPath:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),r[e])===!1)continue nextPath;return t}}};if(a&&!r){let t=U(_(e,e=>R(e)),(e,t,n)=>(W(t,t=>{P(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),W(t.categoryMatches,t=>{P(e,t)||(e[t]=n)})}),e),{});return function(){return t[this.LA(1).tokenTypeIdx]}}else return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;nextPath:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),i[e])===!1)continue nextPath;return t}}}}function hn(e,t,n){let r=y(e,e=>e.length===1),i=e.length;if(r&&!n){let t=R(e);if(t.length===1&&o(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=U(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,W(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}else return function(){nextPath:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(t(this.LA(e+1),r[e])===!1)continue nextPath;return!0}return!1}}var gn=class extends pe{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(r),!0):!1}walkOption(e,t,n){this.checkIsTarget(e,Z.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,Z.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},_n=class extends D{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Z.OPTION)}visitRepetition(e){this.checkIsTarget(e,Z.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Z.ALTERNATION)}};function vn(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function yn(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function bn(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(i[t[e]]===!0)return!1}return!0}function xn(e,t){let n=_(e,e=>sn([e],1)),r=vn(n.length),i=_(n,e=>{let t={};return W(e,e=>{W(yn(e.partialPath),e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=vn(n.length);for(let s=0;s<n.length;s++){let c=n[s];for(let n=0;n<c.length;n++){let l=c[n].partialPath,u=c[n].suffixDef,d=yn(l);if(bn(i,d,s)||o(u)||l.length===t){let e=r[s];if(wn(e,l)===!1){e.push(l);for(let e=0;e<d.length;e++){let t=d[e];i[s][t]=!0}}}else{let t=sn(u,e+1,l);a[s]=a[s].concat(t),W(t,e=>{W(yn(e.partialPath),e=>{i[s][e]=!0})})}}}}return r}function Sn(e,t,n,r){let i=new _n(e,Z.ALTERNATION,r);return t.accept(i),xn(i.result,n)}function Cn(e,t,n,r){let i=new _n(e,n);t.accept(i);let a=i.result,o=new gn(t,e,n).startWalking();return xn([new z({definition:a}),new z({definition:o})],r)}function wn(e,t){compareOtherPath:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(!(n===i||i.categoryMatchesMap[n.tokenTypeIdx]!==void 0))continue compareOtherPath}return!0}}return!1}function Tn(e,t){return e.length<t.length&&y(e,(e,n)=>{let r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}function En(e){return y(e,e=>y(e,e=>y(e,e=>o(e.categoryMatches))))}function Dn(e){return _(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:$.CUSTOM_LOOKAHEAD_VALIDATION},e))}function On(e,t,n,r){let i=h(e,e=>kn(e,n)),a=Gn(e,t,n),o=h(e,e=>Vn(e,n)),s=h(e,t=>Nn(t,e,r,n));return i.concat(a,o,s)}function kn(e,t){let n=new Mn;e.accept(n);let r=n.allProductions;return _(F(b(m(r,An),e=>e.length>1)),n=>{let r=s(n),i=t.buildDuplicateFoundError(e,n),a=B(r),o={message:i,type:$.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},c=jn(r);return c&&(o.parameter=c),o})}function An(e){return`${B(e)}_#_${e.idx}_#_${jn(e)}`}function jn(e){return e instanceof N?e.terminalType.name:e instanceof k?e.nonTerminalName:``}var Mn=class extends D{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function Nn(e,t,n,r){let i=[];if(U(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:$.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function Pn(e,t,n){let r=[],i;return g(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:$.INVALID_RULE_OVERRIDE,ruleName:e})),r}function Fn(e,t,n,r=[]){let i=[],a=In(t.definition);if(o(a))return[];{let t=e.name;g(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:$.LEFT_RECURSION,ruleName:t});let o=h(S(a,r.concat([e])),t=>{let i=f(r);return i.push(t),Fn(e,t,n,i)});return i.concat(o)}}function In(e){let t=[];if(o(e))return t;let n=s(e);if(n instanceof k)t.push(n.referencedRule);else if(n instanceof z||n instanceof I||n instanceof A||n instanceof M||n instanceof ae||n instanceof V)t=t.concat(In(n.definition));else if(n instanceof ie)t=R(_(n.definition,e=>In(e.definition)));else if(!(n instanceof N))throw Error(`non exhaustive match`);let r=oe(n),i=e.length>1;if(r&&i){let n=C(e);return t.concat(In(n))}else return t}var Ln=class extends D{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Rn(e,t){let n=new Ln;e.accept(n);let r=n.alternations;return h(r,n=>h(i(n.definition),(r,i)=>o(cn([r],[],vt,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:$.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}function zn(e,t,n){let r=new Ln;e.accept(r);let i=r.alternations;return i=O(i,e=>e.ignoreAmbiguities===!0),h(i,r=>{let i=r.idx,a=Sn(i,e,r.maxLookahead||t,r),o=Un(a,r,e,n),s=Wn(a,r,e,n);return o.concat(s)})}var Bn=class extends D{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function Vn(e,t){let n=new Ln;e.accept(n);let r=n.alternations;return h(r,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:$.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}function Hn(e,t,n){let r=[];return W(e,e=>{let i=new Bn;e.accept(i);let a=i.allProductions;W(a,i=>{let a=un(i),s=i.maxLookahead||t,c=i.idx,l=Cn(c,e,a,s)[0];if(o(R(l))){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:$.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}function Un(e,t,n,r){let i=[];return _(U(e,(n,r,a)=>(t.definition[a].ignoreAmbiguities===!0||W(r,r=>{let o=[a];W(e,(e,n)=>{a!==n&&wn(e,r)&&t.definition[n].ignoreAmbiguities!==!0&&o.push(n)}),o.length>1&&!wn(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),e=>{let i=_(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:$.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}function Wn(e,t,n,r){let i=U(e,(e,t,n)=>{let r=_(t,e=>({idx:n,path:e}));return e.concat(r)},[]);return c(h(i,e=>{if(t.definition[e.idx].ignoreAmbiguities===!0)return[];let a=e.idx,o=e.path;return _(p(i,e=>t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<a&&Tn(e.path,o)),e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:$.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}))}function Gn(e,t,n){let r=[],i=_(t,e=>e.name);return W(e,e=>{let t=e.name;if(g(i,t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:$.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}function Kn(e){let t=ee(e,{errMsgProvider:Xt}),n={};return W(e.rules,e=>{n[e.name]=e}),Zt(n,t.errMsgProvider)}function qn(e){return e=ee(e,{errMsgProvider:X}),On(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}const Jn=`MismatchedTokenException`,Yn=`NoViableAltException`,Xn=`EarlyExitException`,Zn=`NotAllInputParsedException`,Qn=[Jn,Yn,Xn,Zn];Object.freeze(Qn);function $n(e){return g(Qn,e.name)}var er=class extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},tr=class extends er{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Jn}},nr=class extends er{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Yn}},rr=class extends er{constructor(e,t){super(e,t),this.name=Zn}},ir=class extends er{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Xn}};const ar={},or=`InRuleRecoveryException`;var sr=class extends Error{constructor(e){super(e),this.name=or}},cr=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=P(e,`recoveryEnabled`)?e.recoveryEnabled:Q.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=lr)}getTokenToInsert(e){let t=qt(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let a=this.findReSyncTokenType(),o=this.exportLexerState(),s=[],c=!1,l=this.LA(1),u=this.LA(1),d=()=>{let e=this.LA(0),t=new tr(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),l,this.LA(0));t.resyncedTokens=i(s),this.SAVE_ERROR(t)};for(;!c;)if(this.tokenMatcher(u,r)){d();return}else if(n.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,a)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,s));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new sr(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||o(t))return!1;let n=this.LA(1);return u(t,e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return g(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=u(e,e=>Jt(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return ar;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return _(e,(n,r)=>r===0?ar:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return R(_(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===ar)return[Y];let t=e.ruleName+e.idxInCallingRule+ye+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Y)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return i(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:f(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return _(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function lr(e,t,n,r,i,a,o){let s=this.getKeyForAutomaticLookahead(r,i),c=this.firstAfterRepMap[s];if(c===void 0){let e=this.getCurrRuleFullName(),t=this.getGAstProductions()[e];c=new a(t,i).startWalking(),this.firstAfterRepMap[s]=c}let l=c.token,u=c.occurrence,d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&l===void 0&&(l=Y,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}const ur=1024,dr=1280,fr=1536;function pr(e,t,n){return n|t|e}var mr=class{constructor(e){this.maxLookahead=e?.maxLookahead??Q.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(o(t)){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return h(e,e=>Fn(e,e,X))}validateEmptyOrAlternatives(e){return h(e,e=>Rn(e,X))}validateAmbiguousAlternationAlternatives(e,t){return h(e,e=>zn(e,t,X))}validateSomeNonEmptyLookaheadPath(e,t){return Hn(e,t,X)}buildLookaheadForAlternation(e){return fn(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,mn)}buildLookaheadForOptional(e){return pn(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,un(e.prodType),hn)}},hr=class{initLooksAhead(e){this.dynamicTokensEnabled=P(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:Q.dynamicTokensEnabled,this.maxLookahead=P(e,`maxLookahead`)?e.maxLookahead:Q.maxLookahead,this.lookaheadStrategy=P(e,`lookaheadStrategy`)?e.lookaheadStrategy:new mr({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){W(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=vr(e);W(t,t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${B(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=pr(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),W(n,t=>{this.computeLookaheadFunc(e,t.idx,768,`Repetition`,t.maxLookahead,B(t))}),W(r,t=>{this.computeLookaheadFunc(e,t.idx,512,`Option`,t.maxLookahead,B(t))}),W(i,t=>{this.computeLookaheadFunc(e,t.idx,ur,`RepetitionMandatory`,t.maxLookahead,B(t))}),W(a,t=>{this.computeLookaheadFunc(e,t.idx,fr,`RepetitionMandatoryWithSeparator`,t.maxLookahead,B(t))}),W(o,t=>{this.computeLookaheadFunc(e,t.idx,dr,`RepetitionWithSeparator`,t.maxLookahead,B(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=pr(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return pr(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},gr=class extends D{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};const _r=new gr;function vr(e){_r.reset(),e.accept(_r);let t=_r.dslMethods;return _r.reset(),t}function yr(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function br(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function xr(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function Sr(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}function Cr(e,t){Object.defineProperty(e,`name`,{enumerable:!1,configurable:!0,writable:!1,value:t})}function wr(e,t){let n=T(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}function Tr(e,t){let n=function(){};return Cr(n,e+`BaseSemantics`),n.prototype={visit:function(e,t){if(j(e)&&(e=e[0]),!H(e))return this[e.name](e.children,t)},validateVisitor:function(){let e=Or(this,t);if(!o(e)){let t=_(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join(`
|
|
41
|
-
|
|
42
|
-
`).replace(/\n/g,`
|
|
43
|
-
`)}`)}}},n.prototype.constructor=n,n._RULE_NAMES=t,n}function Er(e,t,n){let r=function(){};Cr(r,e+`BaseSemanticsWithDefaults`);let i=Object.create(n.prototype);return W(t,e=>{i[e]=wr}),r.prototype=i,r.prototype.constructor=r,r}var Dr;(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(Dr||={});function Or(e,t){return kr(e,t)}function kr(e,t){return c(_(p(t,t=>E(e[t])===!1),t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Dr.MISSING_METHOD,methodName:t})))}var Ar=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=P(e,`nodeLocationTracking`)?e.nodeLocationTracking:Q.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=w,this.cstFinallyStateUpdate=w,this.cstPostTerminal=w,this.cstPostNonTerminal=w,this.cstPostRule=w;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=br,this.setNodeLocationFromNode=br,this.cstPostRule=w,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=w,this.setNodeLocationFromNode=w,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=yr,this.setNodeLocationFromNode=yr,this.cstPostRule=w,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=w,this.setNodeLocationFromNode=w,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=w,this.setNodeLocationFromNode=w,this.cstPostRule=w,this.setInitialNodeLocation=w;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];xr(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];Sr(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(H(this.baseCstVisitorConstructor)){let e=Tr(this.className,T(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(H(this.baseCstVisitorWithDefaultsConstructor)){let e=Er(this.className,T(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},jr=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):qr}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?qr:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},Mr=class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Jr){if(g(this.definedRulesNames,e)){let t={message:X.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:$.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Jr){let r=Pn(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if($n(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return te(F(this.gastProductionsCache))}},Nr=class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=yt,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},P(t,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
44
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
45
|
-
For Further details.`);if(j(e)){if(o(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
46
|
-
Note that the first argument for the parser constructor
|
|
47
|
-
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
48
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
49
|
-
For Further details.`)}if(j(e))this.tokensMap=U(e,(e,t)=>(e[t.name]=t,e),{});else if(P(e,`modes`)&&y(R(F(e.modes)),Mt))this.tokensMap=U(se(R(F(e.modes))),(e,t)=>(e[t.name]=t,e),{});else if(n(e))this.tokensMap=f(e);else throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap.EOF=Y,this.tokenMatcher=y(P(e,`modes`)?R(F(e.modes)):F(e),e=>o(e.categoryMatches))?yt:vt,St(F(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=P(n,`resyncEnabled`)?n.resyncEnabled:Jr.resyncEnabled,i=P(n,`recoveryValueFunc`)?n.recoveryValueFunc:Jr.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return o=this.outputCst===!0?function n(...o){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,o);let n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function n(...o){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,o)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){let r=this.RULE_STACK.length===1,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if($n(e)){let t=e;if(i){let r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r))if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}else return n(e);else{if(this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}}else if(r)return this.moveToTerminatedState(),n(e);else throw t}else throw e}optionInternal(e,t){let n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof e!=`function`){i=e.DEF;let t=e.GATE;if(t!==void 0){let e=r;r=()=>t.call(this)&&e.call(this)}}else i=e;if(r.call(this)===!0)return i.call(this)}atLeastOneInternal(e,t){let n=this.getKeyForAutomaticLookahead(ur,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=()=>e.call(this)&&t.call(this)}}else i=t;if(r.call(this)===!0){let e=this.doSingleRepetition(i);for(;r.call(this)===!0&&e===!0;)e=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,Z.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],r,ur,e,an)}atLeastOneSepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(fr,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=()=>this.tokenMatcher(this.LA(1),i);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,on],t,fr,e,on)}else throw this.raiseEarlyExitException(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=()=>e.call(this)&&t.call(this)}}else i=t;let a=!0;for(;r.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],r,768,e,nn,a)}manySepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(dr,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=()=>this.tokenMatcher(this.LA(1),i);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,rn],t,dr,e,rn)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,fr,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=this.getKeyForAutomaticLookahead(256,t),r=j(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(i!==void 0)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new rr(t,e))}}subruleInternal(e,t,n){let r;try{let i=n===void 0?void 0:n.ARGS;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw $n(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{let t=this.LA(1);this.tokenMatcher(t,e)===!0?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r,i=this.LA(0);throw r=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new tr(r,t,i))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&n.name===`MismatchedTokenException`&&!this.isBackTracking()){let r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===or?n:e}}else throw n}saveRecogState(){let e=this.errors,t=f(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Y)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},Pr=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=P(e,`errorMessageProvider`)?e.errorMessageProvider:Q.errorMessageProvider}SAVE_ERROR(e){if($n(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:f(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)}get errors(){return f(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],a=Cn(e,i,t,this.maxLookahead)[0],o=[];for(let e=1;e<=this.maxLookahead;e++)o.push(this.LA(e));let s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new ir(s,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),r=this.getGAstProductions()[n],i=Sn(e,r,this.maxLookahead),a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));let o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new nr(s,this.LA(1),o))}},Fr=class{initContentAssist(){}computeContentAssist(e,t){let n=this.gastProductionsCache[e];if(H(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return cn([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=s(e.ruleStack),n=this.getGAstProductions()[t];return new en(n,e).startWalking()}};const Ir={description:`This Object indicates the Parser is during Recording Phase`};Object.freeze(Ir);const Lr=Gt({name:`RECORDING_PHASE_TOKEN`,pattern:J.NA});St([Lr]);const Rr=qt(Lr,`This IToken indicates the Parser is in Recording Phase
|
|
50
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Rr);const zr={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
51
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};var Br=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,()=>{for(let e=0;e<10;e++){let t=e>0?e:``;this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,()=>{let e=this;for(let t=0;t<10;t++){let n=t>0?t:``;delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return qr}topLevelRuleRecord(e,t){try{let n=new L({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(e.KNOWN_RECORDER_ERROR!==!0)try{e.message+=`
|
|
52
|
-
This error was thrown during the "grammar recording phase" For more info see:
|
|
53
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}}optionInternalRecord(e,t){return Vr.call(this,I,e,t)}atLeastOneInternalRecord(e,t){Vr.call(this,A,t,e)}atLeastOneSepFirstInternalRecord(e,t){Vr.call(this,M,t,e,!0)}manyInternalRecord(e,t){Vr.call(this,V,t,e)}manySepFirstInternalRecord(e,t){Vr.call(this,ae,t,e,!0)}orInternalRecord(e,t){return Hr.call(this,e,t)}subruleInternalRecord(e,t,n){if(Wr(t),!e||P(e,`ruleName`)===!1){let n=Error(`<SUBRULE${Ur(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=l(this.recordingProdStack),i=e.ruleName,a=new k({idx:t,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?zr:Ir}consumeInternalRecord(e,t,n){if(Wr(t),!Ot(e)){let n=Error(`<CONSUME${Ur(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=l(this.recordingProdStack),i=new N({idx:t,terminalType:e,label:n?.LABEL});return r.definition.push(i),Rr}};function Vr(e,t,n,r=!1){Wr(n);let i=l(this.recordingProdStack),a=E(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),P(t,`MAX_LOOKAHEAD`)&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),Ir}function Hr(e,t){Wr(t);let n=l(this.recordingProdStack),r=j(e)===!1,i=r===!1?e:e.DEF,a=new ie({definition:[],idx:t,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===!0});return P(e,`MAX_LOOKAHEAD`)&&(a.maxLookahead=e.MAX_LOOKAHEAD),a.hasPredicates=ce(i,e=>E(e.GATE)),n.definition.push(a),W(i,e=>{let t=new z({definition:[]});a.definition.push(t),P(e,`IGNORE_AMBIGUITIES`)?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:P(e,`GATE`)&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Ir}function Ur(e){return e===0?``:`${e}`}function Wr(e){if(e<0||e>255){let t=Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than 256`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var Gr=class{initPerformanceTracer(e){if(P(e,`traceInitPerf`)){let t=e.traceInitPerf,n=typeof t==`number`;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Q.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=ue(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}else return t()}};function Kr(e,t){t.forEach(t=>{let n=t.prototype;Object.getOwnPropertyNames(n).forEach(r=>{if(r===`constructor`)return;let i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]})})}const qr=qt(Y,``,NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(qr);const Q=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Yt,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),Jr=Object.freeze({recoveryValueFunc:()=>void 0,resyncEnabled:!0});var $;(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`,e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]=`CUSTOM_LOOKAHEAD_VALIDATION`})($||={});function Yr(e=void 0){return function(){return e}}var Xr=class e{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT(`performSelfAnalysis`,()=>{let t;this.selfAnalysisDone=!0;let n=this.className;this.TRACE_INIT(`toFastProps`,()=>{fe(this)}),this.TRACE_INIT(`Grammar Recording`,()=>{try{this.enableRecording(),W(this.definedRulesNames,e=>{let t=this[e].originalGrammarAction,n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT(`Grammar Resolving`,()=>{r=Kn({rules:F(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT(`Grammar Validations`,()=>{if(o(r)&&this.skipValidations===!1){let e=qn({rules:F(this.gastProductionsCache),tokenTypes:F(this.tokensMap),errMsgProvider:X,grammarName:n}),t=Dn({lookaheadStrategy:this.lookaheadStrategy,rules:F(this.gastProductionsCache),tokenTypes:F(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(e,t)}}),o(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT(`computeAllProdsFollows`,()=>{this.resyncFollows=xe(F(this.gastProductionsCache))}),this.TRACE_INIT(`ComputeLookaheadFunctions`,()=>{var e,t;(t=(e=this.lookaheadStrategy).initialize)==null||t.call(e,{rules:F(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(F(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!o(this.definitionErrors))throw t=_(this.definitionErrors,e=>e.message),Error(`Parser Definition Errors detected:\n ${t.join(`
|
|
54
|
-
-------------------------------
|
|
55
|
-
`)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),P(t,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
56
|
-
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
57
|
-
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
58
|
-
For further details.`);this.skipValidations=P(t,`skipValidations`)?t.skipValidations:Q.skipValidations}};Xr.DEFER_DEFINITION_ERRORS_HANDLING=!1,Kr(Xr,[cr,hr,Ar,jr,Nr,Mr,Pr,Fr,Br,Gr]);var Zr=class extends Xr{constructor(e,t=Q){let n=f(t);n.outputCst=!1,super(e,n)}};export{Yt as a,qt as c,J as d,Nt as f,dn as i,Ft as l,Zr as n,Y as o,mr as r,Gt as s,Yr as t,Jt as u};
|