likec4 1.55.1 → 1.57.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/AIChat2.mjs +2 -0
- package/__app__/chunks/DiagramActorProvider.mjs +10 -0
- package/__app__/chunks/EmbedPage.mjs +1 -0
- package/__app__/chunks/ExportPage.mjs +2 -0
- package/__app__/chunks/LikeC4Diagram.mjs +19 -0
- package/__app__/chunks/LikeC4Styles.mjs +48 -0
- package/__app__/chunks/Markdown.mjs +1 -0
- package/__app__/chunks/NavigationPanel.mjs +1 -0
- package/__app__/chunks/ViewReact.mjs +1 -0
- package/__app__/chunks/adhoc-editor.mjs +1 -0
- package/__app__/chunks/aichat.mjs +1 -0
- package/__app__/chunks/box.mjs +1 -0
- package/__app__/chunks/create-style-context.mjs +1 -0
- package/__app__/chunks/css.mjs +1 -0
- package/__app__/chunks/factory.mjs +1 -0
- package/__app__/chunks/hooks.mjs +1 -0
- package/__app__/chunks/hstack.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 +358 -0
- package/__app__/chunks/libs/@tanstack/ai-client.mjs +2 -0
- package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +1 -0
- package/__app__/chunks/libs/@tanstack/ai-react.mjs +1 -0
- package/__app__/chunks/libs/@tanstack/ai.mjs +2 -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/copy-anything.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/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/superjson.mjs +1 -0
- package/__app__/chunks/libs/zod.mjs +64 -0
- package/__app__/chunks/rolldown-runtime.mjs +1 -0
- package/__app__/chunks/styles.css.mjs +1 -0
- package/__app__/chunks/txt.mjs +1 -0
- package/__app__/chunks/useLikeC4Project.mjs +1 -0
- package/__app__/codegen/react.mjs +11 -0
- package/__app__/codegen/webcomponent.mjs +942 -0
- package/__app__/src/aichat/index.mjs +1 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +45 -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/style.css +1 -1
- package/config/schema.json +14 -41
- package/dist/chunks/enableServer.mjs +1 -0
- package/dist/chunks/filenames.mjs +17 -0
- package/dist/{_chunks → chunks}/index.d.mts +2 -1
- package/dist/{_chunks → chunks}/index2.d.mts +639 -388
- 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 +70 -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/@ts-graphviz/ast.mjs +3 -0
- package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -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 +9 -9
- 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 +3 -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/libs/ts-graphviz.mjs +1 -0
- package/dist/chunks/libs/ufo.mjs +1 -0
- package/dist/chunks/libs/unctx.mjs +1 -0
- package/dist/chunks/libs/unstorage.mjs +1 -0
- package/dist/chunks/libs/vscode-languageserver.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 +62 -25
- package/dist/chunks/node.mjs +93 -0
- package/dist/chunks/plugin.mjs +593 -0
- package/dist/chunks/rolldown-runtime.mjs +1 -0
- package/dist/chunks/sequence-view.mjs +1 -0
- package/dist/cli/index.mjs +188 -59
- package/dist/config/index.d.mts +1 -2
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +2 -135
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +3 -2
- package/dist/model/index.mjs +1 -1
- package/dist/vite-plugin/index.d.mts +90 -9
- package/dist/vite-plugin/index.mjs +1 -1
- 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.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/{_chunks/libs/@nanostores/react.d.mts → vite-plugin/internal/index.d.mts} +103 -45
- package/dist/vite-plugin/internal/index.mjs +1 -0
- package/package.json +74 -80
- package/react/index.d.mts +84 -78
- package/react/index.mjs +51954 -53701
- package/vite-plugin/internal/package.json +2 -2
- package/vite-plugin-modules.d.ts +18 -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 -21254
- package/__app__/src/main.js +0 -7
- package/__app__/src/routes/index.js +0 -324
- package/__app__/src/routes/projects.js +0 -193
- package/__app__/src/routes/single.js +0 -1983
- package/__app__/src/vendors.js +0 -52683
- 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.d.mts +0 -10
- 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/vscode-languageserver.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.d.mts +0 -44
- package/dist/vite-plugin/internal.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../rolldown-runtime.mjs";var e=typeof global==`object`&&global&&global.Object===Object&&global,t=typeof self==`object`&&self&&self.Object===Object&&self,n=e||t||Function(`return this`)(),r=n.Symbol,i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r?r.toStringTag:void 0;function getRawTag(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch{}var i=o.call(e);return r&&(t?e[s]=n:delete e[s]),i}var c=Object.prototype.toString;function objectToString(e){return c.call(e)}var l=`[object Null]`,u=`[object Undefined]`,d=r?r.toStringTag:void 0;function baseGetTag(e){return e==null?e===void 0?u:l:d&&d in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return typeof e==`object`&&!!e}var f=`[object Symbol]`;function isSymbol(e){return typeof e==`symbol`||isObjectLike(e)&&baseGetTag(e)==f}function arrayMap(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var p=Array.isArray,m=1/0,h=r?r.prototype:void 0,g=h?h.toString:void 0;function baseToString(e){if(typeof e==`string`)return e;if(p(e))return arrayMap(e,baseToString)+``;if(isSymbol(e))return g?g.call(e):``;var t=e+``;return t==`0`&&1/e==-m?`-0`:t}var _=/\s/;function trimmedEndIndex(e){for(var t=e.length;t--&&_.test(e.charAt(t)););return t}var v=/^\s+/;function baseTrim(e){return e&&e.slice(0,trimmedEndIndex(e)+1).replace(v,``)}function isObject(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var y=NaN,ee=/^[-+]0x[0-9a-f]+$/i,te=/^0b[01]+$/i,ne=/^0o[0-7]+$/i,re=parseInt;function toNumber(e){if(typeof e==`number`)return e;if(isSymbol(e))return y;if(isObject(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=isObject(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=baseTrim(e);var n=te.test(e);return n||ne.test(e)?re(e.slice(2),n?2:8):ee.test(e)?y:+e}var b=1/0,ie=17976931348623157e292;function toFinite(e){return e?(e=toNumber(e),e===b||e===-b?(e<0?-1:1)*ie:e===e?e:0):e===0?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function identity(e){return e}var ae=`[object AsyncFunction]`,oe=`[object Function]`,se=`[object GeneratorFunction]`,ce=`[object Proxy]`;function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==oe||t==se||t==ae||t==ce}var x=n[`__core-js_shared__`],le=function(){var e=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function isMasked(e){return!!le&&le in e}var ue=Function.prototype.toString;function toSource(e){if(e!=null){try{return ue.call(e)}catch{}try{return e+``}catch{}}return``}var de=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,pe=Function.prototype,me=Object.prototype,he=pe.toString,ge=me.hasOwnProperty,_e=RegExp(`^`+he.call(ge).replace(de,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function baseIsNative(e){return!isObject(e)||isMasked(e)?!1:(isFunction(e)?_e:fe).test(toSource(e))}function getValue(e,t){return e?.[t]}function getNative(e,t){var n=getValue(e,t);return baseIsNative(n)?n:void 0}var S=getNative(n,`WeakMap`);function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ve=800,ye=16,be=Date.now;function shortOut(e){var t=0,n=0;return function(){var r=be(),i=ye-(r-n);if(n=r,i>0){if(++t>=ve)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function constant(e){return function(){return e}}var C=function(){try{var e=getNative(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),xe=shortOut(C?function(e,t){return C(e,`toString`,{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity);function arrayEach(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function baseFindIndex(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function baseIsNaN(e){return e!==e}function strictIndexOf(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function baseIndexOf(e,t,n){return t===t?strictIndexOf(e,t,n):baseFindIndex(e,baseIsNaN,n)}var Se=9007199254740991,Ce=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var n=typeof e;return t??=Se,!!t&&(n==`number`||n!=`symbol`&&Ce.test(e))&&e>-1&&e%1==0&&e<t}function baseAssignValue(e,t,n){t==`__proto__`&&C?C(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function eq(e,t){return e===t||e!==e&&t!==t}var we=Object.prototype.hasOwnProperty;function assignValue(e,t,n){var r=e[t];(!(we.call(e,t)&&eq(r,n))||n===void 0&&!(t in e))&&baseAssignValue(e,t,n)}function copyObject(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?baseAssignValue(n,s,c):assignValue(n,s,c)}return n}var w=Math.max;function overRest(e,t,n){return t=w(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=w(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),apply(e,this,s)}}function baseRest(e,t){return xe(overRest(e,t,identity),e+``)}var Te=9007199254740991;function isLength(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Te}function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isIterateeCall(e,t,n){if(!isObject(n))return!1;var r=typeof t;return(r==`number`?isArrayLike(n)&&isIndex(t,n.length):r==`string`&&t in n)?eq(n[t],e):!1}function createAssigner(e){return baseRest(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&isIterateeCall(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Ee=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ee)}function baseTimes(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var De=`[object Arguments]`;function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==De}var T=Object.prototype,Oe=T.hasOwnProperty,ke=T.propertyIsEnumerable,E=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&Oe.call(e,`callee`)&&!ke.call(e,`callee`)};function stubFalse(){return!1}var D=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ae=D&&typeof module==`object`&&module&&!module.nodeType&&module,je=Ae&&Ae.exports===D?n.Buffer:void 0,O=(je?je.isBuffer:void 0)||stubFalse,Me=`[object Arguments]`,Ne=`[object Array]`,Pe=`[object Boolean]`,Fe=`[object Date]`,Ie=`[object Error]`,Le=`[object Function]`,Re=`[object Map]`,ze=`[object Number]`,Be=`[object Object]`,Ve=`[object RegExp]`,He=`[object Set]`,Ue=`[object String]`,We=`[object WeakMap]`,Ge=`[object ArrayBuffer]`,Ke=`[object DataView]`,qe=`[object Float32Array]`,Je=`[object Float64Array]`,Ye=`[object Int8Array]`,Xe=`[object Int16Array]`,Ze=`[object Int32Array]`,Qe=`[object Uint8Array]`,$e=`[object Uint8ClampedArray]`,et=`[object Uint16Array]`,tt=`[object Uint32Array]`,k={};k[qe]=k[Je]=k[Ye]=k[Xe]=k[Ze]=k[Qe]=k[$e]=k[et]=k[tt]=!0,k[Me]=k[Ne]=k[Ge]=k[Pe]=k[Ke]=k[Fe]=k[Ie]=k[Le]=k[Re]=k[ze]=k[Be]=k[Ve]=k[He]=k[Ue]=k[We]=!1;function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!k[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}var A=typeof exports==`object`&&exports&&!exports.nodeType&&exports,j=A&&typeof module==`object`&&module&&!module.nodeType&&module,M=j&&j.exports===A&&e.process,N=function(){try{return j&&j.require&&j.require(`util`).types||M&&M.binding&&M.binding(`util`)}catch{}}(),P=N&&N.isTypedArray,F=P?baseUnary(P):baseIsTypedArray,nt=Object.prototype.hasOwnProperty;function arrayLikeKeys(e,t){var n=p(e),r=!n&&E(e),i=!n&&!r&&O(e),a=!n&&!r&&!i&&F(e),o=n||r||i||a,s=o?baseTimes(e.length,String):[],c=s.length;for(var l in e)(t||nt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||isIndex(l,c)))&&s.push(l);return s}function overArg(e,t){return function(n){return e(t(n))}}var rt=overArg(Object.keys,Object),it=Object.prototype.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return rt(e);var t=[];for(var n in Object(e))it.call(e,n)&&n!=`constructor`&&t.push(n);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var at=Object.prototype.hasOwnProperty,I=createAssigner(function(e,t){if(isPrototype(t)||isArrayLike(t)){copyObject(t,keys(t),e);return}for(var n in t)at.call(t,n)&&assignValue(e,n,t[n])});function nativeKeysIn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),n=[];for(var r in e)r==`constructor`&&(t||!ot.call(e,r))||n.push(r);return n}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/;function isKey(e,t){if(p(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||isSymbol(e)?!0:ct.test(e)||!st.test(e)||t!=null&&e in Object(t)}var L=getNative(Object,`create`);function hashClear(){this.__data__=L?L(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var lt=`__lodash_hash_undefined__`,ut=Object.prototype.hasOwnProperty;function hashGet(e){var t=this.__data__;if(L){var n=t[e];return n===lt?void 0:n}return ut.call(t,e)?t[e]:void 0}var dt=Object.prototype.hasOwnProperty;function hashHas(e){var t=this.__data__;return L?t[e]!==void 0:dt.call(t,e)}var ft=`__lodash_hash_undefined__`;function hashSet(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=L&&t===void 0?ft:t,this}function Hash(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var n=e.length;n--;)if(eq(e[n][0],t))return n;return-1}var pt=Array.prototype.splice;function listCacheDelete(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?!1:(n==t.length-1?t.pop():pt.call(t,n,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?void 0:t[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var n=this.__data__,r=assocIndexOf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ListCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var R=getNative(n,`Map`);function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(R||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function getMapData(e,t){var n=e.__data__;return isKeyable(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=+!!t,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var n=getMapData(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function MapCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var mt=`Expected a function`;function memoize(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(mt);var memoized=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=memoized.cache;if(i.has(r))return i.get(r);var a=e.apply(this,n);return memoized.cache=i.set(r,a)||i,a};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var ht=500;function memoizeCapped(e){var t=memoize(e,function(e){return n.size===ht&&n.clear(),e}),n=t.cache;return t}var gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_t=/\\(\\)?/g,vt=memoizeCapped(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(gt,function(e,n,r,i){t.push(r?i.replace(_t,`$1`):n||e)}),t});function toString(e){return e==null?``:baseToString(e)}function castPath(e,t){return p(e)?e:isKey(e,t)?[e]:vt(toString(e))}var yt=1/0;function toKey(e){if(typeof e==`string`||isSymbol(e))return e;var t=e+``;return t==`0`&&1/e==-yt?`-0`:t}function baseGet(e,t){t=castPath(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[toKey(t[n++])];return n&&n==r?e:void 0}function get(e,t,n){var r=e==null?void 0:baseGet(e,t);return r===void 0?n:r}function arrayPush(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bt=overArg(Object.getPrototypeOf,Object);function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}var xt=200;function stackSet(e,t){var n=this.__data__;if(n instanceof ListCache){var r=n.__data__;if(!R||r.length<xt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new MapCache(r)}return n.set(e,t),this.size=n.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;function arrayFilter(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function stubArray(){return[]}var St=Object.prototype.propertyIsEnumerable,Ct=Object.getOwnPropertySymbols,z=Ct?function(e){return e==null?[]:(e=Object(e),arrayFilter(Ct(e),function(t){return St.call(e,t)}))}:stubArray,B=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)arrayPush(t,z(e)),e=bt(e);return t}:stubArray;function baseGetAllKeys(e,t,n){var r=t(e);return p(e)?r:arrayPush(r,n(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,z)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,B)}var V=getNative(n,`DataView`),H=getNative(n,`Promise`),U=getNative(n,`Set`),W=`[object Map]`,wt=`[object Object]`,G=`[object Promise]`,K=`[object Set]`,q=`[object WeakMap]`,J=`[object DataView]`,Tt=toSource(V),Et=toSource(R),Dt=toSource(H),Ot=toSource(U),kt=toSource(S),getTag=baseGetTag;(V&&getTag(new V(new ArrayBuffer(1)))!=J||R&&getTag(new R)!=W||H&&getTag(H.resolve())!=G||U&&getTag(new U)!=K||S&&getTag(new S)!=q)&&(getTag=function(e){var t=baseGetTag(e),n=t==wt?e.constructor:void 0,r=n?toSource(n):``;if(r)switch(r){case Tt:return J;case Et:return W;case Dt:return G;case Ot:return K;case kt:return q}return t});var Y=getTag,X=n.Uint8Array,At=`__lodash_hash_undefined__`;function setCacheAdd(e){return this.__data__.set(e,At),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new MapCache;++t<n;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arraySome(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}var jt=1,Mt=2;function equalArrays(e,t,n,r,i,a){var o=n&jt,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Mt?new SetCache:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!arraySome(t,function(e,t){if(!cacheHas(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function mapToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function setToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Nt=1,Pt=2,Ft=`[object Boolean]`,It=`[object Date]`,Lt=`[object Error]`,Rt=`[object Map]`,zt=`[object Number]`,Bt=`[object RegExp]`,Vt=`[object Set]`,Ht=`[object String]`,Ut=`[object Symbol]`,Wt=`[object ArrayBuffer]`,Gt=`[object DataView]`,Kt=r?r.prototype:void 0,Z=Kt?Kt.valueOf:void 0;function equalByTag(e,t,n,r,i,a,o){switch(n){case Gt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wt:return!(e.byteLength!=t.byteLength||!a(new X(e),new X(t)));case Ft:case It:case zt:return eq(+e,+t);case Lt:return e.name==t.name&&e.message==t.message;case Bt:case Ht:return e==t+``;case Rt:var s=mapToArray;case Vt:var c=r&Nt;if(s||=setToArray,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Pt,o.set(e,t);var u=equalArrays(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ut:if(Z)return Z.call(e)==Z.call(t)}return!1}var qt=1,Jt=Object.prototype.hasOwnProperty;function equalObjects(e,t,n,r,i,a){var o=n&qt,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Jt.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Yt=1,Xt=`[object Arguments]`,Zt=`[object Array]`,Q=`[object Object]`,Qt=Object.prototype.hasOwnProperty;function baseIsEqualDeep(e,t,n,r,i,a){var o=p(e),s=p(t),c=o?Zt:Y(e),l=s?Zt:Y(t);c=c==Xt?Q:c,l=l==Xt?Q:l;var u=c==Q,d=l==Q,f=c==l;if(f&&O(e)){if(!O(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Stack,o||F(e)?equalArrays(e,t,n,r,i,a):equalByTag(e,t,c,n,r,i,a);if(!(n&Yt)){var m=u&&Qt.call(e,`__wrapped__`),h=d&&Qt.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new Stack,i(g,_,n,r,a)}}return f?(a||=new Stack,equalObjects(e,t,n,r,i,a)):!1}function baseIsEqual(e,t,n,r,i){return e===t?!0:e==null||t==null||!isObjectLike(e)&&!isObjectLike(t)?e!==e&&t!==t:baseIsEqualDeep(e,t,n,r,baseIsEqual,i)}var $t=1,en=2;function baseIsMatch(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Stack;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?baseIsEqual(u,l,$t|en,r,d):f))return!1}}return!0}function isStrictComparable(e){return e===e&&!isObject(e)}function getMatchData(e){for(var t=keys(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,isStrictComparable(i)]}return t}function matchesStrictComparable(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function baseMatches(e){var t=getMatchData(e);return t.length==1&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(n){return n===e||baseIsMatch(n,e,t)}}function baseHasIn(e,t){return e!=null&&t in Object(e)}function hasPath(e,t,n){t=castPath(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=toKey(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&isLength(i)&&isIndex(o,i)&&(p(e)||E(e)))}function hasIn(e,t){return e!=null&&hasPath(e,t,baseHasIn)}var tn=1,nn=2;function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(n){var r=get(n,e);return r===void 0&&r===t?hasIn(n,e):baseIsEqual(t,r,tn|nn)}}function baseProperty(e){return function(t){return t?.[e]}}function basePropertyDeep(e){return function(t){return baseGet(t,e)}}function property(e){return isKey(e)?baseProperty(toKey(e)):basePropertyDeep(e)}function baseIteratee(e){return typeof e==`function`?e:e==null?identity:typeof e==`object`?p(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function createBaseFor(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var rn=createBaseFor();function baseForOwn(e,t){return e&&rn(e,t,keys)}function createBaseEach(e,t){return function(n,r){if(n==null)return n;if(!isArrayLike(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var $=createBaseEach(baseForOwn);function castFunction(e){return typeof e==`function`?e:identity}function forEach(e,t){return(p(e)?arrayEach:$)(e,castFunction(t))}function arrayEvery(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function baseEvery(e,t){var n=!0;return $(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function every(e,t,n){var r=p(e)?arrayEvery:baseEvery;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function baseMap(e,t){var n=-1,r=isArrayLike(e)?Array(e.length):[];return $(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function map(e,t){return(p(e)?arrayMap:baseMap)(e,baseIteratee(t,3))}var an=`[object String]`;function isString(e){return typeof e==`string`||!p(e)&&isObjectLike(e)&&baseGetTag(e)==an}function baseValues(e,t){return arrayMap(t,function(t){return e[t]})}function values(e){return e==null?[]:baseValues(e,keys(e))}var on=Math.max;function includes(e,t,n,r){e=isArrayLike(e)?e:values(e),n=n&&!r?toInteger(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),isString(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&baseIndexOf(e,t,n)>-1}var sn=`[object RegExp]`;function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==sn}var cn=N&&N.isRegExp,ln=cn?baseUnary(cn):baseIsRegExp;function baseSet(e,t,n,r){if(!isObject(e))return e;t=castPath(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=toKey(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=isObject(u)?u:isIndex(t[i+1])?[]:{})}assignValue(s,c,l),s=s[c]}return e}function basePickBy(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=baseGet(e,o);n(s,o)&&baseSet(a,castPath(o,e),s)}return a}function pickBy(e,t){if(e==null)return{};var n=arrayMap(getAllKeysIn(e),function(e){return[e]});return t=baseIteratee(t),basePickBy(e,n,function(e,n){return t(e,n[0])})}function baseSome(e,t){var n;return $(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function some(e,t,n){var r=p(e)?arraySome:baseSome;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function tokenLabel(e){return hasTokenLabel(e)?e.LABEL:e.name}function hasTokenLabel(e){return isString(e.LABEL)&&e.LABEL!==``}var AbstractProduction=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),forEach(this.definition,t=>{t.accept(e)})}},NonTerminal=class extends AbstractProduction{constructor(e){super([]),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},Rule=class extends AbstractProduction{constructor(e){super(e.definition),this.orgText=``,I(this,pickBy(e,e=>e!==void 0))}},Alternative=class extends AbstractProduction{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,I(this,pickBy(e,e=>e!==void 0))}},Option=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatory=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatoryWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Repetition=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Alternation=class extends AbstractProduction{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,I(this,pickBy(e,e=>e!==void 0))}},Terminal=class{constructor(e){this.idx=1,I(this,pickBy(e,e=>e!==void 0))}accept(e){e.visit(this)}};function serializeGrammar(e){return map(e,serializeProduction)}function serializeProduction(e){function convertDefinition(e){return map(e,serializeProduction)}if(e instanceof NonTerminal){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return isString(e.label)&&(t.label=e.label),t}else if(e instanceof Alternative)return{type:`Alternative`,definition:convertDefinition(e.definition)};else if(e instanceof Option)return{type:`Option`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof RepetitionMandatory)return{type:`RepetitionMandatory`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof RepetitionMandatoryWithSeparator)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};else if(e instanceof RepetitionWithSeparator)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};else if(e instanceof Repetition)return{type:`Repetition`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof Alternation)return{type:`Alternation`,idx:e.idx,definition:convertDefinition(e.definition)};else if(e instanceof Terminal){let t={type:`Terminal`,name:e.terminalType.name,label:tokenLabel(e.terminalType),idx:e.idx};isString(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ln(n)?n.source:n),t}else if(e instanceof Rule)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:convertDefinition(e.definition)};else throw Error(`non exhaustive match`)}var GAstVisitor=class{visit(e){let t=e;switch(t.constructor){case NonTerminal:return this.visitNonTerminal(t);case Alternative:return this.visitAlternative(t);case Option:return this.visitOption(t);case RepetitionMandatory:return this.visitRepetitionMandatory(t);case RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Repetition:return this.visitRepetition(t);case Alternation:return this.visitAlternation(t);case Terminal:return this.visitTerminal(t);case Rule:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function isSequenceProd(e){return e instanceof Alternative||e instanceof Option||e instanceof Repetition||e instanceof RepetitionMandatory||e instanceof RepetitionMandatoryWithSeparator||e instanceof RepetitionWithSeparator||e instanceof Terminal||e instanceof Rule}function isOptionalProd(e,t=[]){return e instanceof Option||e instanceof Repetition||e instanceof RepetitionWithSeparator?!0:e instanceof Alternation?some(e.definition,e=>isOptionalProd(e,t)):e instanceof NonTerminal&&includes(t,e)?!1:e instanceof AbstractProduction?(e instanceof NonTerminal&&t.push(e),every(e.definition,e=>isOptionalProd(e,t))):!1}function isBranchingProd(e){return e instanceof Alternation}function getProductionDslName(e){if(e instanceof NonTerminal)return`SUBRULE`;if(e instanceof Option)return`OPTION`;if(e instanceof Alternation)return`OR`;if(e instanceof RepetitionMandatory)return`AT_LEAST_ONE`;if(e instanceof RepetitionMandatoryWithSeparator)return`AT_LEAST_ONE_SEP`;if(e instanceof RepetitionWithSeparator)return`MANY_SEP`;if(e instanceof Repetition)return`MANY`;if(e instanceof Terminal)return`CONSUME`;throw Error(`non exhaustive match`)}export{isIterateeCall as $,cacheHas as A,Stack as B,map as C,baseIteratee as D,$ as E,getAllKeysIn as F,keys as G,arrayPush as H,getAllKeys as I,N as J,baseKeys as K,B as L,X as M,Y as N,hasPath as O,U as P,isPrototype as Q,z as R,isString as S,forEach as T,keysIn as U,bt as V,I as W,O as X,baseUnary as Y,E as Z,some as _,r as _t,GAstVisitor as a,baseAssignValue as at,includes as b,NonTerminal as c,arrayEach as ct,RepetitionMandatory as d,toInteger as dt,isArrayLike as et,RepetitionMandatoryWithSeparator as f,isObject as ft,serializeGrammar as g,isObjectLike as gt,Terminal as h,isSymbol as ht,isSequenceProd as i,eq as it,SetCache as j,setToArray as k,Option as l,isFunction as lt,Rule as m,arrayMap as mt,isBranchingProd as n,copyObject as nt,Alternation as o,baseIndexOf as ot,RepetitionWithSeparator as p,p as pt,F as q,isOptionalProd as r,assignValue as rt,Alternative as s,baseFindIndex as st,getProductionDslName as t,baseRest as tt,Repetition as u,identity as ut,pickBy as v,n as vt,every as w,values as x,ln as y,arrayFilter as z};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import"../../rolldown-runtime.mjs";function cc(e){return e.charCodeAt(0)}function insertToSet(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function addFlag(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function ASSERT_EXISTS(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function ASSERT_NEVER_REACH_HERE(){throw Error(`Internal Error - Should never get here!`)}function isCharacter(e){return e.type===`Character`}const e=[];for(let t=cc(`0`);t<=cc(`9`);t++)e.push(t);const t=[cc(`_`)].concat(e);for(let e=cc(`a`);e<=cc(`z`);e++)t.push(e);for(let e=cc(`A`);e<=cc(`Z`);e++)t.push(e);const n=[cc(` `),cc(`\f`),cc(`
|
|
2
|
+
`),cc(`\r`),cc(` `),cc(`\v`),cc(` `),cc(`\xA0`),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(` `),cc(`\u2028`),cc(`\u2029`),cc(` `),cc(` `),cc(` `),cc(``)],r=/[0-9a-fA-F]/,i=/[0-9]/,a=/[1-9]/;var RegExpParser=class{constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:addFlag(n,`global`);break;case`i`:addFlag(n,`ignoreCase`);break;case`m`:addFlag(n,`multiLine`);break;case`u`:addFlag(n,`unicode`);break;case`y`:addFlag(n,`sticky`);break}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break}ASSERT_EXISTS(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return ASSERT_NEVER_REACH_HERE()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`);break}if(e===!0&&t===void 0)return;ASSERT_EXISTS(t);break}if(!(e===!0&&t===void 0)&&ASSERT_EXISTS(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),ASSERT_EXISTS(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):ASSERT_NEVER_REACH_HERE()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[cc(`
|
|
3
|
+
`),cc(`\r`),cc(`\u2028`),cc(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let r,i=!1;switch(this.popChar()){case`d`:r=e;break;case`D`:r=e,i=!0;break;case`s`:r=n;break;case`S`:r=n,i=!0;break;case`w`:r=t;break;case`W`:r=t,i=!0;break}return ASSERT_EXISTS(r)?{type:`Set`,value:r,complement:i}:ASSERT_NEVER_REACH_HERE()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=cc(`\f`);break;case`n`:e=cc(`
|
|
4
|
+
`);break;case`r`:e=cc(`\r`);break;case`t`:e=cc(` `);break;case`v`:e=cc(`\v`);break}return ASSERT_EXISTS(e)?{type:`Character`,value:e}:ASSERT_NEVER_REACH_HERE()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:cc(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:cc(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:cc(this.popChar())}}}characterClass(){let e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){let t=this.classAtom();if(t.type,isCharacter(t)&&this.isRangeDash()){this.consumeChar(`-`);let n=this.classAtom();if(n.type,isCharacter(n)){if(n.value<t.value)throw Error(`Range out of order in character class`);e.push({from:t.value,to:n.value})}else insertToSet(t.value,e),e.push(cc(`-`)),insertToSet(n.value,e)}else insertToSet(t.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}}classAtom(){switch(this.peekChar()){case`]`:case`
|
|
6
|
+
`:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:cc(`\b`)};case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar(`(`),this.peekChar(0)){case`?`:this.consumeChar(`?`),this.consumeChar(`:`),e=!1;break;default:this.groupIdx++;break}let t=this.disjunction();this.consumeChar(`)`);let n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(a.test(e)===!1)throw Error(`Expecting a positive integer`);for(;i.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(i.test(e)===!1)throw Error(`Expecting an integer`);for(;i.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
|
|
7
|
+
`:case`\r`:case`\u2028`:case`\u2029`:case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:throw Error(`TBD`);default:return{type:`Character`,value:cc(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}}isRangeDash(){return this.peekChar()===`-`&&this.isClassAtom(1)}isDigit(){return i.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case`]`:case`
|
|
8
|
+
`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case`^`:case`$`:return!0;case`\\`:switch(this.peekChar(1)){case`b`:case`B`:return!0;default:return!1}case`(`:return this.peekChar(1)===`?`&&(this.peekChar(2)===`=`||this.peekChar(2)===`!`);default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:case`/`:case`
|
|
9
|
+
`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}parseHexDigits(e){let t=``;for(let n=0;n<e;n++){let e=this.popChar();if(r.test(e)===!1)throw Error(`Expecting a HexDecimal digits`);t+=e}return{type:`Character`,value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++}loc(e){return{begin:e,end:this.idx}}},BaseRegExpVisitor=class{visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this):this.visit(n))}}visit(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};export{RegExpParser as n,BaseRegExpVisitor as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../rolldown-runtime.mjs";function PRINT_ERROR(e){console&&console.error&&console.error(`Error: ${e}`)}function PRINT_WARNING(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function timer(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function toFastProperties(e){function FakeConstructor(){}FakeConstructor.prototype=e;let t=new FakeConstructor;function fakeAccess(){return typeof t.bar}return fakeAccess(),fakeAccess(),e}export{PRINT_WARNING as i,timer as n,PRINT_ERROR as r,toFastProperties as t};
|