From c842448139d9f1fd0af9e949469c9b36d838c9e8 Mon Sep 17 00:00:00 2001 From: lyngai Date: Thu, 3 Aug 2023 18:32:28 +0800 Subject: [PATCH] chore(*): upgrade mermaid@10.2.4 (#520) * chore(*): upgrade mermaid@10.2.4 Close #510 * chore(*): upgrade rollup and outdated plugins * feat(*): drop node 12 support BREAKING CHANGE: @tencent/cherry-markdown no longer supports node < 14 * chore(*): track dist files with lfs * chore(*): fix styles output path & update docs --- .gitattributes | 6 +- .github/workflows/build.yml | 2 +- .husky/post-checkout | 3 + .husky/post-commit | 3 + .husky/post-merge | 3 + .husky/pre-push | 3 + .nvmrc | 1 + README.CN.md | 4 +- README.md | 4 +- build/addons.build.js | 6 +- build/build.js | 2 +- build/rollup.base.config.js | 23 +- build/rollup.core.config.js | 3 +- build/rollup.engine.config.js | 2 +- .../cherry-code-block-mermaid-plugin.d.ts | 35 +- .../cherry-code-block-mermaid-plugin.js | 4 +- .../cherry-code-block-plantuml-plugin.d.ts | 9 +- .../cherry-code-block-plantuml-plugin.js | 4 +- dist/cherry-markdown.core.common.d.ts | 6 +- dist/cherry-markdown.core.common.js | 4 +- dist/cherry-markdown.core.d.ts | 6 +- dist/cherry-markdown.core.js | 4 +- dist/cherry-markdown.css | 4720 - dist/cherry-markdown.d.ts | 6 +- dist/cherry-markdown.engine.core.common.d.ts | 6 +- dist/cherry-markdown.engine.core.common.js | 4 +- dist/cherry-markdown.engine.core.d.ts | 6 +- dist/cherry-markdown.engine.core.esm.d.ts | 6 +- dist/cherry-markdown.engine.core.esm.js | 4 +- dist/cherry-markdown.engine.core.js | 4 +- dist/cherry-markdown.esm.d.ts | 6 +- dist/cherry-markdown.esm.js | 4 +- dist/cherry-markdown.js | 94801 +--------------- dist/cherry-markdown.js.map | 4 +- dist/cherry-markdown.min.css | 1 - dist/cherry-markdown.min.d.ts | 6 +- dist/cherry-markdown.min.js | 4 +- dist/fonts/ch-icon.eot | Bin 20200 -> 130 bytes dist/fonts/ch-icon.svg | 273 +- dist/fonts/ch-icon.ttf | Bin 20036 -> 130 bytes dist/fonts/ch-icon.woff | Bin 11652 -> 130 bytes dist/fonts/ch-icon.woff2 | Bin 9932 -> 129 bytes package.json | 34 +- types/global.d.ts | 7 +- yarn.lock | 2875 +- 45 files changed, 1677 insertions(+), 101231 deletions(-) create mode 100755 .husky/post-checkout create mode 100755 .husky/post-commit create mode 100755 .husky/post-merge create mode 100755 .husky/pre-push create mode 100644 .nvmrc delete mode 100644 dist/cherry-markdown.css delete mode 100644 dist/cherry-markdown.min.css diff --git a/.gitattributes b/.gitattributes index 724f5efe..c190d4d1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,7 @@ # Set the default behavior, in case people don't have core.autocrlf set. * text=auto - # Declare files that will always have LF line endings on checkout. * text eol=lf - # Denote all files that are truly binary and should not be modified. *.png binary *.jpg binary @@ -13,4 +11,6 @@ *.ttf binary *.woff binary *.woff2 binary -*.ico binary \ No newline at end of file +*.ico binary + +dist/** filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2c4f3ef..5030c607 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/.husky/post-checkout b/.husky/post-checkout new file mode 100755 index 00000000..c37815e2 --- /dev/null +++ b/.husky/post-checkout @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-checkout'.\n"; exit 2; } +git lfs post-checkout "$@" diff --git a/.husky/post-commit b/.husky/post-commit new file mode 100755 index 00000000..e5230c30 --- /dev/null +++ b/.husky/post-commit @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-commit'.\n"; exit 2; } +git lfs post-commit "$@" diff --git a/.husky/post-merge b/.husky/post-merge new file mode 100755 index 00000000..c99b752a --- /dev/null +++ b/.husky/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-merge'.\n"; exit 2; } +git lfs post-merge "$@" diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000..216e9152 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/pre-push'.\n"; exit 2; } +git lfs pre-push "$@" diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..835d07c4 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v14.20.1 diff --git a/README.CN.md b/README.CN.md index 23a79406..ec5e3ddc 100644 --- a/README.CN.md +++ b/README.CN.md @@ -88,11 +88,11 @@ npm install cherry-markdown --save 如果需要开启 `mermaid` 画图、表格自动转图表功能,需要同时添加`mermaid` 与`echarts`包。 -目前**Cherry**推荐的插件版本为`echarts@4.6.0`、`mermaid@8.11.1` +目前**Cherry**推荐的插件版本为`echarts@4.6.0`、`mermaid@9.4.3` ```bash # 安装mermaid依赖开启mermaid画图功能 -yarn add mermaid@8.11.1 +yarn add mermaid@9.4.3 # 安装echarts依赖开启表格自动转图表功能 yarn add echarts@4.6.0 ``` diff --git a/README.md b/README.md index 0ec2bed7..c1d07f44 100644 --- a/README.md +++ b/README.md @@ -90,11 +90,11 @@ npm install cherry-markdown --save If you need to enable the functions of `mermaid` drawing and table-to-chart, you need to add `mermaid` and `echarts` packages at the same time. -Currently, the plug-in version **Cherry** recommend is `echarts@4.6.0` `mermaid@8.11.1`. +Currently, the plug-in version **Cherry** recommend is `echarts@4.6.0` `mermaid@9.4.3`. ```bash # Install mermaid, enable mermaid and drawing function -yarn add mermaid@8.11.1 +yarn add mermaid@9.4.3 # Install echarts, turn on the table-to-chart function yarn add echarts@4.6.0 ``` diff --git a/build/addons.build.js b/build/addons.build.js index 8b36e3b0..e3338f9d 100644 --- a/build/addons.build.js +++ b/build/addons.build.js @@ -1,6 +1,5 @@ const babel = require('@rollup/plugin-babel').default; -// node-resolve升级会导致出现新问题 -const resolve = require('rollup-plugin-node-resolve'); +const resolve = require('@rollup/plugin-node-resolve'); const commonjs = require('@rollup/plugin-commonjs'); const eslint = require('@rollup/plugin-eslint'); const alias = require('@rollup/plugin-alias'); @@ -28,7 +27,7 @@ glob( ); const rollup = require('rollup'); -const { terser } = require('rollup-plugin-terser'); +const terser = require('@rollup/plugin-terser').default; /** * @@ -66,7 +65,6 @@ function buildAddons(entries) { ], }), resolve({ - ignoreGlobal: false, browser: true, }), typescript({ diff --git a/build/build.js b/build/build.js index 59222a6c..d870b45e 100644 --- a/build/build.js +++ b/build/build.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import baseConfig from './rollup.base.config'; const terserPlugin = (options = {}) => diff --git a/build/rollup.base.config.js b/build/rollup.base.config.js index a7dd837b..618a7f49 100644 --- a/build/rollup.base.config.js +++ b/build/rollup.base.config.js @@ -15,8 +15,7 @@ */ import path from 'path'; import babel from '@rollup/plugin-babel'; -// node-resolve升级会导致出现新问题 -import resolve from 'rollup-plugin-node-resolve'; +import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import scss from 'rollup-plugin-scss'; import eslint from '@rollup/plugin-eslint'; @@ -52,6 +51,8 @@ export default { globals: { jsdom: 'jsdom', }, + // disable code splitting + manualChunks: () => 'cherry', }, plugins: [ eslint({ @@ -61,13 +62,14 @@ export default { envReplacePlugin(), alias(aliasPluginOptions), resolve({ - ignoreGlobal: false, + // ignoreGlobal: false, browser: true, }), commonjs({ // non-CommonJS modules will be ignored, but you can also // specifically include/exclude files include: [/node_modules/, /src[\\/]libs/], // Default: undefined + exclude: [/node_modules[\\/](lodash-es|d3-.*[\\/]src|d3[\\/]src|dagre-d3-es)/], // exclude: [/src\/(?!libs)/], // exclude: [ 'node_modules/foo/**', 'node_modules/bar/**' ], // Default: undefined // these values can also be regular expressions @@ -95,7 +97,7 @@ export default { }), scss({ // Filename to write all styles to - output: IS_PRODUCTION ? 'dist/cherry-markdown.min.css' : 'dist/cherry-markdown.css', + fileName: IS_PRODUCTION ? 'cherry-markdown.min.css' : 'cherry-markdown.css', // Determine if node process should be terminated on error (default: false) failOnError: true, @@ -106,7 +108,7 @@ export default { }), babel({ babelHelpers: 'runtime', - exclude: [/node_modules[\\/](?!codemirror[\\/]src[\\/]|parse5)/], + exclude: [/node_modules[\\/](?!codemirror[\\/]src[\\/]|parse5|lodash-es|d3-.*[\\/]src|d3[\\/]src|dagre-d3-es)/], }), // TODO: 重构抽出为独立的插件 { @@ -138,16 +140,15 @@ export default { }, ], onwarn(warning, warn) { - // 忽略 mermaid 的 eval - if (warning.code === 'EVAL' && warning.id.indexOf('mermaid') !== -1) { - return; - } // 忽略 juice 的 circular dependency - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.importer.includes('node_modules/juice')) { + if ( + warning.code === 'CIRCULAR_DEPENDENCY' && + (warning.importer.includes('node_modules/juice') || warning.importer.includes('node_modules/d3-')) + ) { return; } warn(warning); }, - external: [/@babel[\\/]runtime/, 'jsdom'], + external: ['jsdom'], // external: ['echarts'] }; diff --git a/build/rollup.core.config.js b/build/rollup.core.config.js index 0af6c678..55194d96 100644 --- a/build/rollup.core.config.js +++ b/build/rollup.core.config.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import baseConfig from './rollup.base.config'; const terserPlugin = (options = {}) => @@ -40,6 +40,7 @@ const options = { sourcemap: false, compact: true, plugins: [terserPlugin()], + manualChunks: () => 'main', }, }; diff --git a/build/rollup.engine.config.js b/build/rollup.engine.config.js index 9525a058..0d139fe0 100644 --- a/build/rollup.engine.config.js +++ b/build/rollup.engine.config.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import baseConfig from './rollup.base.config'; // TODO: 新增完整版引擎构建, 目前引擎构建仅支持核心构建 diff --git a/dist/addons/cherry-code-block-mermaid-plugin.d.ts b/dist/addons/cherry-code-block-mermaid-plugin.d.ts index fe7e046d..81473856 100644 --- a/dist/addons/cherry-code-block-mermaid-plugin.d.ts +++ b/dist/addons/cherry-code-block-mermaid-plugin.d.ts @@ -1,32 +1,3 @@ -export default class MermaidCodeEngine { - static TYPE: string; - static install(cherryOptions: any, ...args: any[]): void; - constructor(mermaidOptions?: {}); - mermaidAPIRefs: any; - options: { - theme: string; - altFontFamily: string; - fontFamily: string; - themeCSS: string; - flowchart: { - useMaxWidth: boolean; - }; - sequence: { - useMaxWidth: boolean; - }; - startOnLoad: boolean; - logLevel: number; - }; - dom: any; - mermaidCanvas: any; - mountMermaidCanvas($engine: any): void; - /** - * 转换svg为img,如果出错则直出svg - * @param {string} svgCode - * @param {string} graphId - * @returns {string} - */ - convertMermaidSvgToImg(svgCode: string, graphId: string): string; - render(src: any, sign: any, $engine: any, config?: {}): any; - svg2img: any; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:f7e94c0e0790e3a81858a2788b170845f35dbda7a081f4c5ad677482e7b27128 +size 930 diff --git a/dist/addons/cherry-code-block-mermaid-plugin.js b/dist/addons/cherry-code-block-mermaid-plugin.js index d1702e75..a10559f1 100644 --- a/dist/addons/cherry-code-block-mermaid-plugin.js +++ b/dist/addons/cherry-code-block-mermaid-plugin.js @@ -1 +1,3 @@ -!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).CherryCodeBlockMermaidPlugin=r()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,r){return t(r={exports:{}},r.exports),r.exports}var n,o,i=function(t){return t&&t.Math==Math&&t},a=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")(),u=function(t){try{return!!t()}catch(t){return!0}},c=!u((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),f=Function.prototype,s=f.apply,l=f.call,p="object"==typeof Reflect&&Reflect.apply||(c?l.bind(s):function(){return l.apply(s,arguments)}),v=Function.prototype,y=v.bind,d=v.call,h=c&&y.bind(d,d),b=c?function(t){return t&&h(t)}:function(t){return t&&function(){return d.apply(t,arguments)}},m=function(t){return"function"==typeof t},g=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),w=Function.prototype.call,_=c?w.bind(w):function(){return w.apply(w,arguments)},O={}.propertyIsEnumerable,j=Object.getOwnPropertyDescriptor,S={f:j&&!O.call({1:2},1)?function(t){var r=j(this,t);return!!r&&r.enumerable}:O},P=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}},x=b({}.toString),A=b("".slice),T=function(t){return A(x(t),8,-1)},E=a.Object,F=b("".split),M=u((function(){return!E("z").propertyIsEnumerable(0)}))?function(t){return"String"==T(t)?F(t,""):E(t)}:E,I=a.TypeError,L=function(t){if(null==t)throw I("Can't call method on "+t);return t},C=function(t){return M(L(t))},k=function(t){return"object"==typeof t?null!==t:m(t)},R={},z=function(t){return m(t)?t:void 0},D=function(t,r){return arguments.length<2?z(R[t])||z(a[t]):R[t]&&R[t][r]||a[t]&&a[t][r]},B=b({}.isPrototypeOf),N=D("navigator","userAgent")||"",G=a.process,U=a.Deno,V=G&&G.versions||U&&U.version,$=V&&V.v8;$&&(o=(n=$.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&N&&(!(n=N.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=N.match(/Chrome\/(\d+)/))&&(o=+n[1]);var W=o,H=!!Object.getOwnPropertySymbols&&!u((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&W&&W<41})),q=H&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Y=a.Object,J=q?function(t){return"symbol"==typeof t}:function(t){var r=D("Symbol");return m(r)&&B(r.prototype,Y(t))},X=a.String,K=function(t){try{return X(t)}catch(t){return"Object"}},Q=a.TypeError,Z=function(t){if(m(t))return t;throw Q(K(t)+" is not a function")},tt=a.TypeError,rt=Object.defineProperty,et=a["__core-js_shared__"]||function(t,r){try{rt(a,t,{value:r,configurable:!0,writable:!0})}catch(e){a[t]=r}return r}("__core-js_shared__",{}),nt=e((function(t){(t.exports=function(t,r){return et[t]||(et[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.22.6",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.6/LICENSE",source:"https://github.com/zloirock/core-js"})})),ot=a.Object,it=function(t){return ot(L(t))},at=b({}.hasOwnProperty),ut=Object.hasOwn||function(t,r){return at(it(t),r)},ct=0,ft=Math.random(),st=b(1..toString),lt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+st(++ct+ft,36)},pt=nt("wks"),vt=a.Symbol,yt=vt&&vt.for,dt=q?vt:vt&&vt.withoutSetter||lt,ht=function(t){if(!ut(pt,t)||!H&&"string"!=typeof pt[t]){var r="Symbol."+t;H&&ut(vt,t)?pt[t]=vt[t]:pt[t]=q&&yt?yt(r):dt(r)}return pt[t]},bt=a.TypeError,mt=ht("toPrimitive"),gt=function(t,r){if(!k(t)||J(t))return t;var e,n,o=null==(e=t[mt])?void 0:Z(e);if(o){if(void 0===r&&(r="default"),n=_(o,t,r),!k(n)||J(n))return n;throw bt("Can't convert object to primitive value")}return void 0===r&&(r="number"),function(t,r){var e,n;if("string"===r&&m(e=t.toString)&&!k(n=_(e,t)))return n;if(m(e=t.valueOf)&&!k(n=_(e,t)))return n;if("string"!==r&&m(e=t.toString)&&!k(n=_(e,t)))return n;throw tt("Can't convert object to primitive value")}(t,r)},wt=function(t){var r=gt(t,"string");return J(r)?r:r+""},_t=a.document,Ot=k(_t)&&k(_t.createElement),jt=function(t){return Ot?_t.createElement(t):{}},St=!g&&!u((function(){return 7!=Object.defineProperty(jt("div"),"a",{get:function(){return 7}}).a})),Pt=Object.getOwnPropertyDescriptor,xt={f:g?Pt:function(t,r){if(t=C(t),r=wt(r),St)try{return Pt(t,r)}catch(t){}if(ut(t,r))return P(!_(S.f,t,r),t[r])}},At=/#|\.prototype\./,Tt=function(t,r){var e=Ft[Et(t)];return e==It||e!=Mt&&(m(r)?u(r):!!r)},Et=Tt.normalize=function(t){return String(t).replace(At,".").toLowerCase()},Ft=Tt.data={},Mt=Tt.NATIVE="N",It=Tt.POLYFILL="P",Lt=Tt,Ct=b(b.bind),kt=function(t,r){return Z(t),void 0===r?t:c?Ct(t,r):function(){return t.apply(r,arguments)}},Rt=g&&u((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),zt=a.String,Dt=a.TypeError,Bt=function(t){if(k(t))return t;throw Dt(zt(t)+" is not an object")},Nt=a.TypeError,Gt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Vt={f:g?Rt?function(t,r,e){if(Bt(t),r=wt(r),Bt(e),"function"==typeof t&&"prototype"===r&&"value"in e&&"writable"in e&&!e.writable){var n=Ut(t,r);n&&n.writable&&(t[r]=e.value,e={configurable:"configurable"in e?e.configurable:n.configurable,enumerable:"enumerable"in e?e.enumerable:n.enumerable,writable:!1})}return Gt(t,r,e)}:Gt:function(t,r,e){if(Bt(t),r=wt(r),Bt(e),St)try{return Gt(t,r,e)}catch(t){}if("get"in e||"set"in e)throw Nt("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},$t=g?function(t,r,e){return Vt.f(t,r,P(1,e))}:function(t,r,e){return t[r]=e,t},Wt=xt.f,Ht=function(t){var r=function(e,n,o){if(this instanceof r){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,o)}return p(t,this,arguments)};return r.prototype=t.prototype,r},qt=function(t,r){var e,n,o,i,u,c,f,s,l=t.target,p=t.global,v=t.stat,y=t.proto,d=p?a:v?a[l]:(a[l]||{}).prototype,h=p?R:R[l]||$t(R,l,{})[l],g=h.prototype;for(o in r)e=!Lt(p?o:l+(v?".":"#")+o,t.forced)&&d&&ut(d,o),u=h[o],e&&(c=t.dontCallGetSet?(s=Wt(d,o))&&s.value:d[o]),i=e&&c?c:r[o],e&&typeof u==typeof i||(f=t.bind&&e?kt(i,a):t.wrap&&e?Ht(i):y&&m(i)?b(i):i,(t.sham||i&&i.sham||u&&u.sham)&&$t(f,"sham",!0),$t(h,o,f),y&&(ut(R,n=l+"Prototype")||$t(R,n,{}),$t(R[n],o,i),t.real&&g&&!g[o]&&$t(g,o,i)))},Yt=Math.ceil,Jt=Math.floor,Xt=Math.trunc||function(t){var r=+t;return(r>0?Jt:Yt)(r)},Kt=function(t){var r=+t;return r!=r||0===r?0:Xt(r)},Qt=Math.max,Zt=Math.min,tr=function(t,r){var e=Kt(t);return e<0?Qt(e+r,0):Zt(e,r)},rr=Math.min,er=function(t){return(r=t.length)>0?rr(Kt(r),9007199254740991):0;var r},nr=function(t){return function(r,e,n){var o,i=C(r),a=er(i),u=tr(n,a);if(t&&e!=e){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===e)return t||u||0;return!t&&-1}},or={includes:nr(!0),indexOf:nr(!1)},ir={},ar=or.indexOf,ur=b([].push),cr=function(t,r){var e,n=C(t),o=0,i=[];for(e in n)!ut(ir,e)&&ut(n,e)&&ur(i,e);for(;r.length>o;)ut(n,e=r[o++])&&(~ar(i,e)||ur(i,e));return i},fr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],sr=Object.keys||function(t){return cr(t,fr)},lr=u((function(){sr(1)}));qt({target:"Object",stat:!0,forced:lr},{keys:function(t){return sr(it(t))}});var pr=R.Object.keys,vr={};vr[ht("toStringTag")]="z";var yr,dr="[object z]"===String(vr),hr=ht("toStringTag"),br=a.Object,mr="Arguments"==T(function(){return arguments}()),gr=dr?T:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=br(t),hr))?e:mr?T(r):"Object"==(n=T(r))&&m(r.callee)?"Arguments":n},wr=a.String,_r=function(t){if("Symbol"===gr(t))throw TypeError("Cannot convert a Symbol value to a string");return wr(t)},Or={f:g&&!Rt?Object.defineProperties:function(t,r){Bt(t);for(var e,n=C(r),o=sr(r),i=o.length,a=0;i>a;)Vt.f(t,e=o[a++],n[e]);return t}},jr=D("document","documentElement"),Sr=nt("keys"),Pr=function(t){return Sr[t]||(Sr[t]=lt(t))},xr=Pr("IE_PROTO"),Ar=function(){},Tr=function(t){return"`. - this.sequenceIndex = Number(c === CharCodes.Lt); - } - } - stateCDATASequence(c) { - if (c === Sequences.Cdata[this.sequenceIndex]) { - if (++this.sequenceIndex === Sequences.Cdata.length) { - this.state = State$2.InCommentLike; - this.currentSequence = Sequences.CdataEnd; - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - } - } - else { - this.sequenceIndex = 0; - this.state = State$2.InDeclaration; - this.stateInDeclaration(c); // Reconsume the character - } - } - /** - * When we wait for one specific character, we can speed things up - * by skipping through the buffer until we find it. - * - * @returns Whether the character was found. - */ - fastForwardTo(c) { - while (++this.index < this.buffer.length + this.offset) { - if (this.buffer.charCodeAt(this.index - this.offset) === c) { - return true; - } - } - /* - * We increment the index at the end of the `parse` loop, - * so set it to `buffer.length - 1` here. - * - * TODO: Refactor `parse` to increment index before calling states. - */ - this.index = this.buffer.length + this.offset - 1; - return false; - } - /** - * Comments and CDATA end with `-->` and `]]>`. - * - * Their common qualities are: - * - Their end sequences have a distinct character they start with. - * - That character is then repeated, so we have to check multiple repeats. - * - All characters but the start character of the sequence can be skipped. - */ - stateInCommentLike(c) { - if (c === this.currentSequence[this.sequenceIndex]) { - if (++this.sequenceIndex === this.currentSequence.length) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, this.index, 2); - } - else { - this.cbs.oncomment(this.sectionStart, this.index, 2); - } - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - this.state = State$2.Text; - } - } - else if (this.sequenceIndex === 0) { - // Fast-forward to the first character of the sequence - if (this.fastForwardTo(this.currentSequence[0])) { - this.sequenceIndex = 1; - } - } - else if (c !== this.currentSequence[this.sequenceIndex - 1]) { - // Allow long sequences, eg. --->, ]]]> - this.sequenceIndex = 0; - } - } - /** - * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name. - * - * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar). - * We allow anything that wouldn't end the tag. - */ - isTagStartChar(c) { - return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c); - } - startSpecial(sequence, offset) { - this.isSpecial = true; - this.currentSequence = sequence; - this.sequenceIndex = offset; - this.state = State$2.SpecialStartSequence; - } - stateBeforeTagName(c) { - if (c === CharCodes.ExclamationMark) { - this.state = State$2.BeforeDeclaration; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Questionmark) { - this.state = State$2.InProcessingInstruction; - this.sectionStart = this.index + 1; - } - else if (this.isTagStartChar(c)) { - const lower = c | 0x20; - this.sectionStart = this.index; - if (!this.xmlMode && lower === Sequences.TitleEnd[2]) { - this.startSpecial(Sequences.TitleEnd, 3); - } - else { - this.state = - !this.xmlMode && lower === Sequences.ScriptEnd[2] - ? State$2.BeforeSpecialS - : State$2.InTagName; - } - } - else if (c === CharCodes.Slash) { - this.state = State$2.BeforeClosingTagName; - } - else { - this.state = State$2.Text; - this.stateText(c); - } - } - stateInTagName(c) { - if (isEndOfTagSection(c)) { - this.cbs.onopentagname(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State$2.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - } - stateBeforeClosingTagName(c) { - if (isWhitespace$2(c)) ; - else if (c === CharCodes.Gt) { - this.state = State$2.Text; - } - else { - this.state = this.isTagStartChar(c) - ? State$2.InClosingTagName - : State$2.InSpecialComment; - this.sectionStart = this.index; - } - } - stateInClosingTagName(c) { - if (c === CharCodes.Gt || isWhitespace$2(c)) { - this.cbs.onclosetag(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State$2.AfterClosingTagName; - this.stateAfterClosingTagName(c); - } - } - stateAfterClosingTagName(c) { - // Skip everything until ">" - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.state = State$2.Text; - this.sectionStart = this.index + 1; - } - } - stateBeforeAttributeName(c) { - if (c === CharCodes.Gt) { - this.cbs.onopentagend(this.index); - if (this.isSpecial) { - this.state = State$2.InSpecialTag; - this.sequenceIndex = 0; - } - else { - this.state = State$2.Text; - } - this.baseState = this.state; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Slash) { - this.state = State$2.InSelfClosingTag; - } - else if (!isWhitespace$2(c)) { - this.state = State$2.InAttributeName; - this.sectionStart = this.index; - } - } - stateInSelfClosingTag(c) { - if (c === CharCodes.Gt) { - this.cbs.onselfclosingtag(this.index); - this.state = State$2.Text; - this.baseState = State$2.Text; - this.sectionStart = this.index + 1; - this.isSpecial = false; // Reset special state, in case of self-closing special tags - } - else if (!isWhitespace$2(c)) { - this.state = State$2.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - } - stateInAttributeName(c) { - if (c === CharCodes.Eq || isEndOfTagSection(c)) { - this.cbs.onattribname(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State$2.AfterAttributeName; - this.stateAfterAttributeName(c); - } - } - stateAfterAttributeName(c) { - if (c === CharCodes.Eq) { - this.state = State$2.BeforeAttributeValue; - } - else if (c === CharCodes.Slash || c === CharCodes.Gt) { - this.cbs.onattribend(QuoteType.NoValue, this.index); - this.state = State$2.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (!isWhitespace$2(c)) { - this.cbs.onattribend(QuoteType.NoValue, this.index); - this.state = State$2.InAttributeName; - this.sectionStart = this.index; - } - } - stateBeforeAttributeValue(c) { - if (c === CharCodes.DoubleQuote) { - this.state = State$2.InAttributeValueDq; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.SingleQuote) { - this.state = State$2.InAttributeValueSq; - this.sectionStart = this.index + 1; - } - else if (!isWhitespace$2(c)) { - this.sectionStart = this.index; - this.state = State$2.InAttributeValueNq; - this.stateInAttributeValueNoQuotes(c); // Reconsume token - } - } - handleInAttributeValue(c, quote) { - if (c === quote || - (!this.decodeEntities && this.fastForwardTo(quote))) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(quote === CharCodes.DoubleQuote - ? QuoteType.Double - : QuoteType.Single, this.index); - this.state = State$2.BeforeAttributeName; - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.baseState = this.state; - this.state = State$2.BeforeEntity; - } - } - stateInAttributeValueDoubleQuotes(c) { - this.handleInAttributeValue(c, CharCodes.DoubleQuote); - } - stateInAttributeValueSingleQuotes(c) { - this.handleInAttributeValue(c, CharCodes.SingleQuote); - } - stateInAttributeValueNoQuotes(c) { - if (isWhitespace$2(c) || c === CharCodes.Gt) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(QuoteType.Unquoted, this.index); - this.state = State$2.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.baseState = this.state; - this.state = State$2.BeforeEntity; - } - } - stateBeforeDeclaration(c) { - if (c === CharCodes.OpeningSquareBracket) { - this.state = State$2.CDATASequence; - this.sequenceIndex = 0; - } - else { - this.state = - c === CharCodes.Dash - ? State$2.BeforeComment - : State$2.InDeclaration; - } - } - stateInDeclaration(c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.ondeclaration(this.sectionStart, this.index); - this.state = State$2.Text; - this.sectionStart = this.index + 1; - } - } - stateInProcessingInstruction(c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.onprocessinginstruction(this.sectionStart, this.index); - this.state = State$2.Text; - this.sectionStart = this.index + 1; - } - } - stateBeforeComment(c) { - if (c === CharCodes.Dash) { - this.state = State$2.InCommentLike; - this.currentSequence = Sequences.CommentEnd; - // Allow short comments (eg. ) - this.sequenceIndex = 2; - this.sectionStart = this.index + 1; - } - else { - this.state = State$2.InDeclaration; - } - } - stateInSpecialComment(c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.oncomment(this.sectionStart, this.index, 0); - this.state = State$2.Text; - this.sectionStart = this.index + 1; - } - } - stateBeforeSpecialS(c) { - const lower = c | 0x20; - if (lower === Sequences.ScriptEnd[3]) { - this.startSpecial(Sequences.ScriptEnd, 4); - } - else if (lower === Sequences.StyleEnd[3]) { - this.startSpecial(Sequences.StyleEnd, 4); - } - else { - this.state = State$2.InTagName; - this.stateInTagName(c); // Consume the token again - } - } - stateBeforeEntity(c) { - // Start excess with 1 to include the '&' - this.entityExcess = 1; - this.entityResult = 0; - if (c === CharCodes.Num) { - this.state = State$2.BeforeNumericEntity; - } - else if (c === CharCodes.Amp) ; - else { - this.trieIndex = 0; - this.trieCurrent = this.entityTrie[0]; - this.state = State$2.InNamedEntity; - this.stateInNamedEntity(c); - } - } - stateInNamedEntity(c) { - this.entityExcess += 1; - this.trieIndex = decode_4(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c); - if (this.trieIndex < 0) { - this.emitNamedEntity(); - this.index--; - return; - } - this.trieCurrent = this.entityTrie[this.trieIndex]; - const masked = this.trieCurrent & decode_5.VALUE_LENGTH; - // If the branch is a value, store it and continue - if (masked) { - // The mask is the number of bytes of the value, including the current byte. - const valueLength = (masked >> 14) - 1; - // If we have a legacy entity while parsing strictly, just skip the number of bytes - if (!this.allowLegacyEntity() && c !== CharCodes.Semi) { - this.trieIndex += valueLength; - } - else { - // Add 1 as we have already incremented the excess - const entityStart = this.index - this.entityExcess + 1; - if (entityStart > this.sectionStart) { - this.emitPartial(this.sectionStart, entityStart); - } - // If this is a surrogate pair, consume the next two bytes - this.entityResult = this.trieIndex; - this.trieIndex += valueLength; - this.entityExcess = 0; - this.sectionStart = this.index + 1; - if (valueLength === 0) { - this.emitNamedEntity(); - } - } - } - } - emitNamedEntity() { - this.state = this.baseState; - if (this.entityResult === 0) { - return; - } - const valueLength = (this.entityTrie[this.entityResult] & decode_5.VALUE_LENGTH) >> - 14; - switch (valueLength) { - case 1: - this.emitCodePoint(this.entityTrie[this.entityResult] & - ~decode_5.VALUE_LENGTH); - break; - case 2: - this.emitCodePoint(this.entityTrie[this.entityResult + 1]); - break; - case 3: { - this.emitCodePoint(this.entityTrie[this.entityResult + 1]); - this.emitCodePoint(this.entityTrie[this.entityResult + 2]); - } - } - } - stateBeforeNumericEntity(c) { - if ((c | 0x20) === CharCodes.LowerX) { - this.entityExcess++; - this.state = State$2.InHexEntity; - } - else { - this.state = State$2.InNumericEntity; - this.stateInNumericEntity(c); - } - } - emitNumericEntity(strict) { - const entityStart = this.index - this.entityExcess - 1; - const numberStart = entityStart + 2 + Number(this.state === State$2.InHexEntity); - if (numberStart !== this.index) { - // Emit leading data if any - if (entityStart > this.sectionStart) { - this.emitPartial(this.sectionStart, entityStart); - } - this.sectionStart = this.index + Number(strict); - this.emitCodePoint(decode_7(this.entityResult)); - } - this.state = this.baseState; - } - stateInNumericEntity(c) { - if (c === CharCodes.Semi) { - this.emitNumericEntity(true); - } - else if (isNumber$1(c)) { - this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero); - this.entityExcess++; - } - else { - if (this.allowLegacyEntity()) { - this.emitNumericEntity(false); - } - else { - this.state = this.baseState; - } - this.index--; - } - } - stateInHexEntity(c) { - if (c === CharCodes.Semi) { - this.emitNumericEntity(true); - } - else if (isNumber$1(c)) { - this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero); - this.entityExcess++; - } - else if (isHexDigit(c)) { - this.entityResult = - this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10); - this.entityExcess++; - } - else { - if (this.allowLegacyEntity()) { - this.emitNumericEntity(false); - } - else { - this.state = this.baseState; - } - this.index--; - } - } - allowLegacyEntity() { - return (!this.xmlMode && - (this.baseState === State$2.Text || - this.baseState === State$2.InSpecialTag)); - } - /** - * Remove data that has already been consumed from the buffer. - */ - cleanup() { - // If we are inside of text or attributes, emit what we already have. - if (this.running && this.sectionStart !== this.index) { - if (this.state === State$2.Text || - (this.state === State$2.InSpecialTag && this.sequenceIndex === 0)) { - this.cbs.ontext(this.sectionStart, this.index); - this.sectionStart = this.index; - } - else if (this.state === State$2.InAttributeValueDq || - this.state === State$2.InAttributeValueSq || - this.state === State$2.InAttributeValueNq) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = this.index; - } - } - } - shouldContinue() { - return this.index < this.buffer.length + this.offset && this.running; - } - /** - * Iterates through the buffer, calling the function corresponding to the current state. - * - * States that are more likely to be hit are higher up, as a performance improvement. - */ - parse() { - while (this.shouldContinue()) { - const c = this.buffer.charCodeAt(this.index - this.offset); - if (this.state === State$2.Text) { - this.stateText(c); - } - else if (this.state === State$2.SpecialStartSequence) { - this.stateSpecialStartSequence(c); - } - else if (this.state === State$2.InSpecialTag) { - this.stateInSpecialTag(c); - } - else if (this.state === State$2.CDATASequence) { - this.stateCDATASequence(c); - } - else if (this.state === State$2.InAttributeValueDq) { - this.stateInAttributeValueDoubleQuotes(c); - } - else if (this.state === State$2.InAttributeName) { - this.stateInAttributeName(c); - } - else if (this.state === State$2.InCommentLike) { - this.stateInCommentLike(c); - } - else if (this.state === State$2.InSpecialComment) { - this.stateInSpecialComment(c); - } - else if (this.state === State$2.BeforeAttributeName) { - this.stateBeforeAttributeName(c); - } - else if (this.state === State$2.InTagName) { - this.stateInTagName(c); - } - else if (this.state === State$2.InClosingTagName) { - this.stateInClosingTagName(c); - } - else if (this.state === State$2.BeforeTagName) { - this.stateBeforeTagName(c); - } - else if (this.state === State$2.AfterAttributeName) { - this.stateAfterAttributeName(c); - } - else if (this.state === State$2.InAttributeValueSq) { - this.stateInAttributeValueSingleQuotes(c); - } - else if (this.state === State$2.BeforeAttributeValue) { - this.stateBeforeAttributeValue(c); - } - else if (this.state === State$2.BeforeClosingTagName) { - this.stateBeforeClosingTagName(c); - } - else if (this.state === State$2.AfterClosingTagName) { - this.stateAfterClosingTagName(c); - } - else if (this.state === State$2.BeforeSpecialS) { - this.stateBeforeSpecialS(c); - } - else if (this.state === State$2.InAttributeValueNq) { - this.stateInAttributeValueNoQuotes(c); - } - else if (this.state === State$2.InSelfClosingTag) { - this.stateInSelfClosingTag(c); - } - else if (this.state === State$2.InDeclaration) { - this.stateInDeclaration(c); - } - else if (this.state === State$2.BeforeDeclaration) { - this.stateBeforeDeclaration(c); - } - else if (this.state === State$2.BeforeComment) { - this.stateBeforeComment(c); - } - else if (this.state === State$2.InProcessingInstruction) { - this.stateInProcessingInstruction(c); - } - else if (this.state === State$2.InNamedEntity) { - this.stateInNamedEntity(c); - } - else if (this.state === State$2.BeforeEntity) { - this.stateBeforeEntity(c); - } - else if (this.state === State$2.InHexEntity) { - this.stateInHexEntity(c); - } - else if (this.state === State$2.InNumericEntity) { - this.stateInNumericEntity(c); - } - else { - // `this._state === State.BeforeNumericEntity` - this.stateBeforeNumericEntity(c); - } - this.index++; - } - this.cleanup(); - } - finish() { - if (this.state === State$2.InNamedEntity) { - this.emitNamedEntity(); - } - // If there is remaining data, emit it in a reasonable way - if (this.sectionStart < this.index) { - this.handleTrailingData(); - } - this.cbs.onend(); - } - /** Handle any trailing data. */ - handleTrailingData() { - const endIndex = this.buffer.length + this.offset; - if (this.state === State$2.InCommentLike) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, endIndex, 0); - } - else { - this.cbs.oncomment(this.sectionStart, endIndex, 0); - } - } - else if (this.state === State$2.InNumericEntity && - this.allowLegacyEntity()) { - this.emitNumericEntity(false); - // All trailing data will have been consumed - } - else if (this.state === State$2.InHexEntity && - this.allowLegacyEntity()) { - this.emitNumericEntity(false); - // All trailing data will have been consumed - } - else if (this.state === State$2.InTagName || - this.state === State$2.BeforeAttributeName || - this.state === State$2.BeforeAttributeValue || - this.state === State$2.AfterAttributeName || - this.state === State$2.InAttributeName || - this.state === State$2.InAttributeValueSq || - this.state === State$2.InAttributeValueDq || - this.state === State$2.InAttributeValueNq || - this.state === State$2.InClosingTagName) ; - else { - this.cbs.ontext(this.sectionStart, endIndex); - } - } - emitPartial(start, endIndex) { - if (this.baseState !== State$2.Text && - this.baseState !== State$2.InSpecialTag) { - this.cbs.onattribdata(start, endIndex); - } - else { - this.cbs.ontext(start, endIndex); - } - } - emitCodePoint(cp) { - if (this.baseState !== State$2.Text && - this.baseState !== State$2.InSpecialTag) { - this.cbs.onattribentity(cp); - } - else { - this.cbs.ontextentity(cp); - } - } - } - - const formTags = new Set([ - "input", - "option", - "optgroup", - "select", - "button", - "datalist", - "textarea", - ]); - const pTag = new Set(["p"]); - const tableSectionTags = new Set(["thead", "tbody"]); - const ddtTags = new Set(["dd", "dt"]); - const rtpTags = new Set(["rt", "rp"]); - const openImpliesClose = new Map([ - ["tr", new Set(["tr", "th", "td"])], - ["th", new Set(["th"])], - ["td", new Set(["thead", "th", "td"])], - ["body", new Set(["head", "link", "script"])], - ["li", new Set(["li"])], - ["p", pTag], - ["h1", pTag], - ["h2", pTag], - ["h3", pTag], - ["h4", pTag], - ["h5", pTag], - ["h6", pTag], - ["select", formTags], - ["input", formTags], - ["output", formTags], - ["button", formTags], - ["datalist", formTags], - ["textarea", formTags], - ["option", new Set(["option"])], - ["optgroup", new Set(["optgroup", "option"])], - ["dd", ddtTags], - ["dt", ddtTags], - ["address", pTag], - ["article", pTag], - ["aside", pTag], - ["blockquote", pTag], - ["details", pTag], - ["div", pTag], - ["dl", pTag], - ["fieldset", pTag], - ["figcaption", pTag], - ["figure", pTag], - ["footer", pTag], - ["form", pTag], - ["header", pTag], - ["hr", pTag], - ["main", pTag], - ["nav", pTag], - ["ol", pTag], - ["pre", pTag], - ["section", pTag], - ["table", pTag], - ["ul", pTag], - ["rt", rtpTags], - ["rp", rtpTags], - ["tbody", tableSectionTags], - ["tfoot", tableSectionTags], - ]); - const voidElements = new Set([ - "area", - "base", - "basefont", - "br", - "col", - "command", - "embed", - "frame", - "hr", - "img", - "input", - "isindex", - "keygen", - "link", - "meta", - "param", - "source", - "track", - "wbr", - ]); - const foreignContextElements = new Set(["math", "svg"]); - const htmlIntegrationElements = new Set([ - "mi", - "mo", - "mn", - "ms", - "mtext", - "annotation-xml", - "foreignobject", - "desc", - "title", - ]); - const reNameEnd = /\s|\//; - class Parser$1 { - constructor(cbs, options = {}) { - var _a, _b, _c, _d, _e; - this.options = options; - /** The start index of the last event. */ - this.startIndex = 0; - /** The end index of the last event. */ - this.endIndex = 0; - /** - * Store the start index of the current open tag, - * so we can update the start index for attributes. - */ - this.openTagStart = 0; - this.tagname = ""; - this.attribname = ""; - this.attribvalue = ""; - this.attribs = null; - this.stack = []; - this.foreignContext = []; - this.buffers = []; - this.bufferOffset = 0; - /** The index of the last written buffer. Used when resuming after a `pause()`. */ - this.writeIndex = 0; - /** Indicates whether the parser has finished running / `.end` has been called. */ - this.ended = false; - this.cbs = cbs !== null && cbs !== void 0 ? cbs : {}; - this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode; - this.lowerCaseAttributeNames = - (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode; - this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer$1)(this.options, this); - (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this); - } - // Tokenizer event handlers - /** @internal */ - ontext(start, endIndex) { - var _a, _b; - const data = this.getSlice(start, endIndex); - this.endIndex = endIndex - 1; - (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data); - this.startIndex = endIndex; - } - /** @internal */ - ontextentity(cp) { - var _a, _b; - /* - * Entities can be emitted on the character, or directly after. - * We use the section start here to get accurate indices. - */ - const idx = this.tokenizer.getSectionStart(); - this.endIndex = idx - 1; - (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, decode_6(cp)); - this.startIndex = idx; - } - isVoidElement(name) { - return !this.options.xmlMode && voidElements.has(name); - } - /** @internal */ - onopentagname(start, endIndex) { - this.endIndex = endIndex; - let name = this.getSlice(start, endIndex); - if (this.lowerCaseTagNames) { - name = name.toLowerCase(); - } - this.emitOpenTag(name); - } - emitOpenTag(name) { - var _a, _b, _c, _d; - this.openTagStart = this.startIndex; - this.tagname = name; - const impliesClose = !this.options.xmlMode && openImpliesClose.get(name); - if (impliesClose) { - while (this.stack.length > 0 && - impliesClose.has(this.stack[this.stack.length - 1])) { - const el = this.stack.pop(); - (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, el, true); - } - } - if (!this.isVoidElement(name)) { - this.stack.push(name); - if (foreignContextElements.has(name)) { - this.foreignContext.push(true); - } - else if (htmlIntegrationElements.has(name)) { - this.foreignContext.push(false); - } - } - (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name); - if (this.cbs.onopentag) - this.attribs = {}; - } - endOpenTag(isImplied) { - var _a, _b; - this.startIndex = this.openTagStart; - if (this.attribs) { - (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied); - this.attribs = null; - } - if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) { - this.cbs.onclosetag(this.tagname, true); - } - this.tagname = ""; - } - /** @internal */ - onopentagend(endIndex) { - this.endIndex = endIndex; - this.endOpenTag(false); - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - /** @internal */ - onclosetag(start, endIndex) { - var _a, _b, _c, _d, _e, _f; - this.endIndex = endIndex; - let name = this.getSlice(start, endIndex); - if (this.lowerCaseTagNames) { - name = name.toLowerCase(); - } - if (foreignContextElements.has(name) || - htmlIntegrationElements.has(name)) { - this.foreignContext.pop(); - } - if (!this.isVoidElement(name)) { - const pos = this.stack.lastIndexOf(name); - if (pos !== -1) { - if (this.cbs.onclosetag) { - let count = this.stack.length - pos; - while (count--) { - // We know the stack has sufficient elements. - this.cbs.onclosetag(this.stack.pop(), count !== 0); - } - } - else - this.stack.length = pos; - } - else if (!this.options.xmlMode && name === "p") { - // Implicit open before close - this.emitOpenTag("p"); - this.closeCurrentTag(true); - } - } - else if (!this.options.xmlMode && name === "br") { - // We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed. - (_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, "br"); - (_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, "br", {}, true); - (_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, "br", false); - } - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - /** @internal */ - onselfclosingtag(endIndex) { - this.endIndex = endIndex; - if (this.options.xmlMode || - this.options.recognizeSelfClosing || - this.foreignContext[this.foreignContext.length - 1]) { - this.closeCurrentTag(false); - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - else { - // Ignore the fact that the tag is self-closing. - this.onopentagend(endIndex); - } - } - closeCurrentTag(isOpenImplied) { - var _a, _b; - const name = this.tagname; - this.endOpenTag(isOpenImplied); - // Self-closing tags will be on the top of the stack - if (this.stack[this.stack.length - 1] === name) { - // If the opening tag isn't implied, the closing tag has to be implied. - (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied); - this.stack.pop(); - } - } - /** @internal */ - onattribname(start, endIndex) { - this.startIndex = start; - const name = this.getSlice(start, endIndex); - this.attribname = this.lowerCaseAttributeNames - ? name.toLowerCase() - : name; - } - /** @internal */ - onattribdata(start, endIndex) { - this.attribvalue += this.getSlice(start, endIndex); - } - /** @internal */ - onattribentity(cp) { - this.attribvalue += decode_6(cp); - } - /** @internal */ - onattribend(quote, endIndex) { - var _a, _b; - this.endIndex = endIndex; - (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double - ? '"' - : quote === QuoteType.Single - ? "'" - : quote === QuoteType.NoValue - ? undefined - : null); - if (this.attribs && - !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) { - this.attribs[this.attribname] = this.attribvalue; - } - this.attribvalue = ""; - } - getInstructionName(value) { - const idx = value.search(reNameEnd); - let name = idx < 0 ? value : value.substr(0, idx); - if (this.lowerCaseTagNames) { - name = name.toLowerCase(); - } - return name; - } - /** @internal */ - ondeclaration(start, endIndex) { - this.endIndex = endIndex; - const value = this.getSlice(start, endIndex); - if (this.cbs.onprocessinginstruction) { - const name = this.getInstructionName(value); - this.cbs.onprocessinginstruction(`!${name}`, `!${value}`); - } - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - /** @internal */ - onprocessinginstruction(start, endIndex) { - this.endIndex = endIndex; - const value = this.getSlice(start, endIndex); - if (this.cbs.onprocessinginstruction) { - const name = this.getInstructionName(value); - this.cbs.onprocessinginstruction(`?${name}`, `?${value}`); - } - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - /** @internal */ - oncomment(start, endIndex, offset) { - var _a, _b, _c, _d; - this.endIndex = endIndex; - (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset)); - (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c); - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - /** @internal */ - oncdata(start, endIndex, offset) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; - this.endIndex = endIndex; - const value = this.getSlice(start, endIndex - offset); - if (this.options.xmlMode || this.options.recognizeCDATA) { - (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a); - (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value); - (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e); - } - else { - (_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`); - (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j); - } - // Set `startIndex` for next node - this.startIndex = endIndex + 1; - } - /** @internal */ - onend() { - var _a, _b; - if (this.cbs.onclosetag) { - // Set the end index for all remaining tags - this.endIndex = this.startIndex; - for (let i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i], true)) - ; - } - (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a); - } - /** - * Resets the parser to a blank state, ready to parse a new HTML document - */ - reset() { - var _a, _b, _c, _d; - (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a); - this.tokenizer.reset(); - this.tagname = ""; - this.attribname = ""; - this.attribs = null; - this.stack.length = 0; - this.startIndex = 0; - this.endIndex = 0; - (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this); - this.buffers.length = 0; - this.bufferOffset = 0; - this.writeIndex = 0; - this.ended = false; - } - /** - * Resets the parser, then parses a complete document and - * pushes it to the handler. - * - * @param data Document to parse. - */ - parseComplete(data) { - this.reset(); - this.end(data); - } - getSlice(start, end) { - while (start - this.bufferOffset >= this.buffers[0].length) { - this.shiftBuffer(); - } - let str = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset); - while (end - this.bufferOffset > this.buffers[0].length) { - this.shiftBuffer(); - str += this.buffers[0].slice(0, end - this.bufferOffset); - } - return str; - } - shiftBuffer() { - this.bufferOffset += this.buffers[0].length; - this.writeIndex--; - this.buffers.shift(); - } - /** - * Parses a chunk of data and calls the corresponding callbacks. - * - * @param chunk Chunk to parse. - */ - write(chunk) { - var _a, _b; - if (this.ended) { - (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".write() after done!")); - return; - } - this.buffers.push(chunk); - if (this.tokenizer.running) { - this.tokenizer.write(chunk); - this.writeIndex++; - } - } - /** - * Parses the end of the buffer and clears the stack, calls onend. - * - * @param chunk Optional final chunk to parse. - */ - end(chunk) { - var _a, _b; - if (this.ended) { - (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, Error(".end() after done!")); - return; - } - if (chunk) - this.write(chunk); - this.ended = true; - this.tokenizer.end(); - } - /** - * Pauses parsing. The parser won't emit events until `resume` is called. - */ - pause() { - this.tokenizer.pause(); - } - /** - * Resumes parsing after `pause` was called. - */ - resume() { - this.tokenizer.resume(); - while (this.tokenizer.running && - this.writeIndex < this.buffers.length) { - this.tokenizer.write(this.buffers[this.writeIndex++]); - } - if (this.ended) - this.tokenizer.end(); - } - /** - * Alias of `write`, for backwards compatibility. - * - * @param chunk Chunk to parse. - * @deprecated - */ - parseChunk(chunk) { - this.write(chunk); - } - /** - * Alias of `end`, for backwards compatibility. - * - * @param chunk Optional final chunk to parse. - * @deprecated - */ - done(chunk) { - this.end(chunk); - } - } - - // Helper methods - /** - * Parses the data, returns the resulting document. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM builder. - */ - function parseDocument(data, options) { - const handler = new DomHandler(undefined, options); - new Parser$1(handler, options).end(data); - return handler.root; - } - - /** - * Types used in signatures of Cheerio methods. - * - * @category Cheerio - */ - const parse$4 = getParse((content, options, isDocument, context) => options.xmlMode || options._useHtmlParser2 - ? parseDocument(content, options) - : parseWithParse5(content, options, isDocument, context)); - // Duplicate docs due to https://github.com/TypeStrong/typedoc/issues/1616 - /** - * Create a querying function, bound to a document created from the provided markup. - * - * Note that similar to web browser contexts, this operation may introduce - * ``, ``, and `` elements; set `isDocument` to `false` to - * switch to fragment mode and disable this. - * - * @param content - Markup to be loaded. - * @param options - Options for the created instance. - * @param isDocument - Allows parser to be switched to fragment mode. - * @returns The loaded document. - * @see {@link https://cheerio.js.org#loading} for additional usage information. - */ - const load = getLoad(parse$4, (dom, options) => options.xmlMode || options._useHtmlParser2 - ? render(dom, options) - : renderWithParse5(dom)); - /** - * The default cheerio instance. - * - * @deprecated Use the function returned by `load` instead. - */ - var cheerio = load([]); - - var debug_1 = createCommonjsModule(function (module, exports) { - exports = module.exports = debug; - - function debug(label) { - return _debug.bind(null, label); - } - - function _debug(label) { - var args = [].slice.call(arguments, 1); - args.unshift('[' + label + ']'); - process.stderr.write(args.join(' ') + '\n'); - } - }); - - var lexer = createCommonjsModule(function (module, exports) { - - var debug = debug_1('lex'); - - exports = module.exports = lex; - - /** - * Convert a CSS string into an array of lexical tokens. - * - * @param {String} css CSS - * @returns {Array} lexical tokens - */ - function lex(css) { - - var buffer = ''; // Character accumulator - var ch; // Current character - var column = 0; // Current source column number - var cursor = -1; // Current source cursor position - var depth = 0; // Current nesting depth - var line = 1; // Current source line number - var state = 'before-selector'; // Current state - var stack = [state]; // State stack - var token = {}; // Current token - var tokens = []; // Token accumulator - - // Supported @-rules, in roughly descending order of usage probability. - var atRules = [ - 'media', - 'keyframes', - { name: '-webkit-keyframes', type: 'keyframes', prefix: '-webkit-' }, - { name: '-moz-keyframes', type: 'keyframes', prefix: '-moz-' }, - { name: '-ms-keyframes', type: 'keyframes', prefix: '-ms-' }, - { name: '-o-keyframes', type: 'keyframes', prefix: '-o-' }, - 'font-face', - { name: 'import', state: 'before-at-value' }, - { name: 'charset', state: 'before-at-value' }, - 'supports', - 'viewport', - { name: 'namespace', state: 'before-at-value' }, - 'document', - { name: '-moz-document', type: 'document', prefix: '-moz-' }, - 'page' - ]; - - // -- Functions ------------------------------------------------------------ - - /** - * Advance the character cursor and return the next character. - * - * @returns {String} The next character. - */ - function getCh() { - skip(); - return css[cursor]; - } - - /** - * Return the state at the given index in the stack. - * The stack is LIFO so indexing is from the right. - * - * @param {Number} [index=0] Index to return. - * @returns {String} state - */ - function getState(index) { - return index ? stack[stack.length - 1 - index] : state; - } - - /** - * Look ahead for a string beginning from the next position. The string - * being looked for must start at the next position. - * - * @param {String} str The string to look for. - * @returns {Boolean} Whether the string was found. - */ - function isNextString(str) { - var start = cursor + 1; - return (str === css.slice(start, start + str.length)); - } - - /** - * Find the start position of a substring beginning from the next - * position. The string being looked for may begin anywhere. - * - * @param {String} str The substring to look for. - * @returns {Number|false} The position, or `false` if not found. - */ - function find(str) { - var pos = css.slice(cursor).indexOf(str); - - return pos > 0 ? pos : false; - } - - /** - * Determine whether a character is next. - * - * @param {String} ch Character. - * @returns {Boolean} Whether the character is next. - */ - function isNextChar(ch) { - return ch === peek(1); - } - - /** - * Return the character at the given cursor offset. The offset is relative - * to the cursor, so negative values move backwards. - * - * @param {Number} [offset=1] Cursor offset. - * @returns {String} Character. - */ - function peek(offset) { - return css[cursor + (offset || 1)]; - } - - /** - * Remove the current state from the stack and set the new current state. - * - * @returns {String} The removed state. - */ - function popState() { - var removed = stack.pop(); - state = stack[stack.length - 1]; - - return removed; - } - - /** - * Set the current state and add it to the stack. - * - * @param {String} newState The new state. - * @returns {Number} The new stack length. - */ - function pushState(newState) { - state = newState; - stack.push(state); - - return stack.length; - } - - /** - * Replace the current state with a new state. - * - * @param {String} newState The new state. - * @returns {String} The replaced state. - */ - function replaceState(newState) { - var previousState = state; - stack[stack.length - 1] = state = newState; - - return previousState; - } - - /** - * Move the character cursor. Positive numbers move the cursor forward. - * Negative numbers are not supported! - * - * @param {Number} [n=1] Number of characters to skip. - */ - function skip(n) { - if ((n || 1) == 1) { - if (css[cursor] == '\n') { - line++; - column = 1; - } else { - column++; - } - cursor++; - } else { - var skipStr = css.slice(cursor, cursor + n).split('\n'); - if (skipStr.length > 1) { - line += skipStr.length - 1; - column = 1; - } - column += skipStr[skipStr.length - 1].length; - cursor = cursor + n; - } - } - - /** - * Add the current token to the pile and reset the buffer. - */ - function addToken() { - token.end = { - line: line, - col: column - }; - - tokens.push(token); - - buffer = ''; - token = {}; - } - - /** - * Set the current token. - * - * @param {String} type Token type. - */ - function initializeToken(type) { - token = { - type: type, - start: { - line: line, - col : column - } - }; - } - - while (ch = getCh()) { - - // column += 1; - - switch (ch) { - // Space - case ' ': - switch (getState()) { - case 'selector': - case 'value': - case 'value-paren': - case 'at-group': - case 'at-value': - case 'comment': - case 'double-string': - case 'single-string': - buffer += ch; - break; - } - break; - - // Newline or tab - case '\n': - case '\t': - case '\r': - case '\f': - switch (getState()) { - case 'value': - case 'value-paren': - case 'at-group': - case 'comment': - case 'single-string': - case 'double-string': - case 'selector': - buffer += ch; - break; - - case 'at-value': - // Tokenize an @-rule if a semi-colon was omitted. - if ('\n' === ch) { - token.value = buffer.trim(); - addToken(); - popState(); - } - break; - } - - // if ('\n' === ch) { - // column = 0; - // line += 1; - // } - break; - - case ':': - switch (getState()) { - case 'name': - token.name = buffer.trim(); - buffer = ''; - - replaceState('before-value'); - break; - - case 'before-selector': - buffer += ch; - - initializeToken('selector'); - pushState('selector'); - break; - - case 'before-value': - replaceState('value'); - buffer += ch; - break; - - default: - buffer += ch; - break; - } - break; - - case ';': - switch (getState()) { - case 'name': - case 'before-value': - case 'value': - // Tokenize a declaration - // if value is empty skip the declaration - if (buffer.trim().length > 0) { - token.value = buffer.trim(), - addToken(); - } - replaceState('before-name'); - break; - - case 'value-paren': - // Insignificant semi-colon - buffer += ch; - break; - - case 'at-value': - // Tokenize an @-rule - token.value = buffer.trim(); - addToken(); - popState(); - break; - - case 'before-name': - // Extraneous semi-colon - break; - - default: - buffer += ch; - break; - } - break; - - case '{': - switch (getState()) { - case 'selector': - // If the sequence is `\{` then assume that the brace should be escaped. - if (peek(-1) === '\\') { - buffer += ch; - break; - } - - // Tokenize a selector - token.text = buffer.trim(); - addToken(); - replaceState('before-name'); - depth = depth + 1; - break; - - case 'at-group': - // Tokenize an @-group - token.name = buffer.trim(); - - // XXX: @-rules are starting to get hairy - switch (token.type) { - case 'font-face': - case 'viewport' : - case 'page' : - pushState('before-name'); - break; - - default: - pushState('before-selector'); - } - - addToken(); - depth = depth + 1; - break; - - case 'name': - case 'at-rule': - // Tokenize a declaration or an @-rule - token.name = buffer.trim(); - addToken(); - pushState('before-name'); - depth = depth + 1; - break; - - case 'comment': - case 'double-string': - case 'single-string': - // Ignore braces in comments and strings - buffer += ch; - break; - case 'before-value': - replaceState('value'); - buffer += ch; - break; - } - - break; - - case '}': - switch (getState()) { - case 'before-name': - case 'name': - case 'before-value': - case 'value': - // If the buffer contains anything, it is a value - if (buffer) { - token.value = buffer.trim(); - } - - // If the current token has a name and a value it should be tokenized. - if (token.name && token.value) { - addToken(); - } - - // Leave the block - initializeToken('end'); - addToken(); - popState(); - - // We might need to leave again. - // XXX: What about 3 levels deep? - if ('at-group' === getState()) { - initializeToken('at-group-end'); - addToken(); - popState(); - } - - if (depth > 0) { - depth = depth - 1; - } - - break; - - case 'at-group': - case 'before-selector': - case 'selector': - // If the sequence is `\}` then assume that the brace should be escaped. - if (peek(-1) === '\\') { - buffer += ch; - break; - } - - if (depth > 0) { - // Leave block if in an at-group - if ('at-group' === getState(1)) { - initializeToken('at-group-end'); - addToken(); - } - } - - if (depth > 1) { - popState(); - } - - if (depth > 0) { - depth = depth - 1; - } - break; - - case 'double-string': - case 'single-string': - case 'comment': - // Ignore braces in comments and strings. - buffer += ch; - break; - } - - break; - - // Strings - case '"': - case "'": - switch (getState()) { - case 'double-string': - if ('"' === ch && '\\' !== peek(-1)) { - popState(); - } - break; - - case 'single-string': - if ("'" === ch && '\\' !== peek(-1)) { - popState(); - } - break; - - case 'before-at-value': - replaceState('at-value'); - pushState('"' === ch ? 'double-string' : 'single-string'); - break; - - case 'before-value': - replaceState('value'); - pushState('"' === ch ? 'double-string' : 'single-string'); - break; - - case 'comment': - // Ignore strings within comments. - break; - - default: - if ('\\' !== peek(-1)) { - pushState('"' === ch ? 'double-string' : 'single-string'); - } - } - - buffer += ch; - break; - - // Comments - case '/': - switch (getState()) { - case 'comment': - case 'double-string': - case 'single-string': - // Ignore - buffer += ch; - break; - - case 'before-value': - case 'selector': - case 'name': - case 'value': - if (isNextChar('*')) { - // Ignore comments in selectors, properties and values. They are - // difficult to represent in the AST. - var pos = find('*/'); - - if (pos) { - skip(pos + 1); - } - } else { - if (getState() == 'before-value') replaceState('value'); - buffer += ch; - } - break; - - default: - if (isNextChar('*')) { - // Create a comment token - initializeToken('comment'); - pushState('comment'); - skip(); - } - else { - buffer += ch; - } - break; - } - break; - - // Comment end or universal selector - case '*': - switch (getState()) { - case 'comment': - if (isNextChar('/')) { - // Tokenize a comment - token.text = buffer; // Don't trim()! - skip(); - addToken(); - popState(); - } - else { - buffer += ch; - } - break; - - case 'before-selector': - buffer += ch; - initializeToken('selector'); - pushState('selector'); - break; - - case 'before-value': - replaceState('value'); - buffer += ch; - break; - - default: - buffer += ch; - } - break; - - // @-rules - case '@': - switch (getState()) { - case 'comment': - case 'double-string': - case 'single-string': - buffer += ch; - break; - case 'before-value': - replaceState('value'); - buffer += ch; - break; - - default: - // Iterate over the supported @-rules and attempt to tokenize one. - var tokenized = false; - var name; - var rule; - - for (var j = 0, len = atRules.length; !tokenized && j < len; ++j) { - rule = atRules[j]; - name = rule.name || rule; - - if (!isNextString(name)) { continue; } - - tokenized = true; - - initializeToken(name); - pushState(rule.state || 'at-group'); - skip(name.length); - - if (rule.prefix) { - token.prefix = rule.prefix; - } - - if (rule.type) { - token.type = rule.type; - } - } - - if (!tokenized) { - // Keep on truckin' America! - buffer += ch; - } - break; - } - break; - - // Parentheses are tracked to disambiguate semi-colons, such as within a - // data URI. - case '(': - switch (getState()) { - case 'value': - pushState('value-paren'); - break; - case 'before-value': - replaceState('value'); - break; - } - - buffer += ch; - break; - - case ')': - switch (getState()) { - case 'value-paren': - popState(); - break; - case 'before-value': - replaceState('value'); - break; - } - - buffer += ch; - break; - - default: - switch (getState()) { - case 'before-selector': - initializeToken('selector'); - pushState('selector'); - break; - - case 'before-name': - initializeToken('property'); - replaceState('name'); - break; - - case 'before-value': - replaceState('value'); - break; - - case 'before-at-value': - replaceState('at-value'); - break; - } - - buffer += ch; - break; - } - } - - return tokens; - } - }); - - var parser = createCommonjsModule(function (module, exports) { - - var debug = debug_1('parse'); - - - exports = module.exports = parse; - - var _comments; // Whether comments are allowed. - var _depth; // Current block nesting depth. - var _position; // Whether to include line/column position. - var _tokens; // Array of lexical tokens. - - /** - * Convert a CSS string or array of lexical tokens into a `stringify`-able AST. - * - * @param {String} css CSS string or array of lexical token - * @param {Object} [options] - * @param {Boolean} [options.comments=false] allow comment nodes in the AST - * @returns {Object} `stringify`-able AST - */ - function parse(css, options) { - - options || (options = {}); - _comments = !!options.comments; - _position = !!options.position; - - _depth = 0; - - // Operate on a copy of the given tokens, or the lex()'d CSS string. - _tokens = Array.isArray(css) ? css.slice() : lexer(css); - - var rule; - var rules = []; - var token; - - while ((token = next())) { - rule = parseToken(token); - rule && rules.push(rule); - } - - return { - type: "stylesheet", - stylesheet: { - rules: rules - } - }; - } - - // -- Functions -------------------------------------------------------------- - - /** - * Build an AST node from a lexical token. - * - * @param {Object} token lexical token - * @param {Object} [override] object hash of properties that override those - * already in the token, or that will be added to the token. - * @returns {Object} AST node - */ - function astNode(token, override) { - override || (override = {}); - - var key; - var keys = ['type', 'name', 'value']; - var node = {}; - - // Avoiding [].forEach for performance reasons. - for (var i = 0; i < keys.length; ++i) { - key = keys[i]; - - if (token[key]) { - node[key] = override[key] || token[key]; - } - } - - keys = Object.keys(override); - - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - - if (!node[key]) { - node[key] = override[key]; - } - } - - if (_position) { - node.position = { - start: token.start, - end: token.end - }; - } - - return node; - } - - /** - * Remove a lexical token from the stack and return the removed token. - * - * @returns {Object} lexical token - */ - function next() { - var token = _tokens.shift(); - return token; - } - - // -- Parse* Functions --------------------------------------------------------- - - /** - * Convert an @-group lexical token to an AST node. - * - * @param {Object} token @-group lexical token - * @returns {Object} @-group AST node - */ - function parseAtGroup(token) { - _depth = _depth + 1; - - // As the @-group token is assembled, relevant token values are captured here - // temporarily. They will later be used as `tokenize()` overrides. - var overrides = {}; - - switch (token.type) { - case 'font-face': - case 'viewport' : - overrides.declarations = parseDeclarations(); - break; - - case 'page': - overrides.prefix = token.prefix; - overrides.declarations = parseDeclarations(); - break; - - default: - overrides.prefix = token.prefix; - overrides.rules = parseRules(); - } - - return astNode(token, overrides); - } - - /** - * Convert an @import lexical token to an AST node. - * - * @param {Object} token @import lexical token - * @returns {Object} @import AST node - */ - function parseAtImport(token) { - return astNode(token); - } - - /** - * Convert an @charset token to an AST node. - * - * @param {Object} token @charset lexical token - * @returns {Object} @charset node - */ - function parseCharset(token) { - return astNode(token); - } - - /** - * Convert a comment token to an AST Node. - * - * @param {Object} token comment lexical token - * @returns {Object} comment node - */ - function parseComment(token) { - return astNode(token, {text: token.text}); - } - - function parseNamespace(token) { - return astNode(token); - } - - /** - * Convert a property lexical token to a property AST node. - * - * @returns {Object} property node - */ - function parseProperty(token) { - return astNode(token); - } - - /** - * Convert a selector lexical token to a selector AST node. - * - * @param {Object} token selector lexical token - * @returns {Object} selector node - */ - function parseSelector(token) { - function trim(str) { - return str.trim(); - } - - return astNode(token, { - type: 'rule', - selectors: token.text.split(',').map(trim), - declarations: parseDeclarations() - }); - } - - /** - * Convert a lexical token to an AST node. - * - * @returns {Object|undefined} AST node - */ - function parseToken(token) { - switch (token.type) { - // Cases are listed in roughly descending order of probability. - case 'property': return parseProperty(token); - - case 'selector': return parseSelector(token); - - case 'at-group-end': _depth = _depth - 1; return; - - case 'media' : - case 'keyframes' :return parseAtGroup(token); - - case 'comment': if (_comments) { return parseComment(token); } break; - - case 'charset': return parseCharset(token); - case 'import': return parseAtImport(token); - - case 'namespace': return parseNamespace(token); - - case 'font-face': - case 'supports' : - case 'viewport' : - case 'document' : - case 'page' : return parseAtGroup(token); - } - } - - // -- Parse Helper Functions --------------------------------------------------- - - /** - * Iteratively parses lexical tokens from the stack into AST nodes until a - * conditional function returns `false`, at which point iteration terminates - * and any AST nodes collected are returned. - * - * @param {Function} conditionFn - * @param {Object} token the lexical token being parsed - * @returns {Boolean} `true` if the token should be parsed, `false` otherwise - * @return {Array} AST nodes - */ - function parseTokensWhile(conditionFn) { - var node; - var nodes = []; - var token; - - while ((token = next()) && (conditionFn && conditionFn(token))) { - node = parseToken(token); - node && nodes.push(node); - } - - // Place an unused non-`end` lexical token back onto the stack. - if (token && token.type !== 'end') { - _tokens.unshift(token); - } - - return nodes; - } - - /** - * Convert a series of tokens into a sequence of declaration AST nodes. - * - * @returns {Array} declaration nodes - */ - function parseDeclarations() { - return parseTokensWhile(function (token) { - return (token.type === 'property' || token.type === 'comment'); - }); - } - - /** - * Convert a series of tokens into a sequence of rule nodes. - * - * @returns {Array} rule nodes - */ - function parseRules() { - return parseTokensWhile(function () { return _depth; }); - } - }); - - var stringify_1 = createCommonjsModule(function (module, exports) { - - var debug = debug_1('stringify'); - - var _comments; // Whether comments are allowed in the stringified CSS. - var _compress; // Whether the stringified CSS should be compressed. - var _indentation; // Indentation option value. - var _level; // Current indentation level. - var _n; // Compression-aware newline character. - var _s; // Compression-aware space character. - - exports = module.exports = stringify; - - /** - * Convert a `stringify`-able AST into a CSS string. - * - * @param {Object} `stringify`-able AST - * @param {Object} [options] - * @param {Boolean} [options.comments=false] allow comments in the CSS - * @param {Boolean} [options.compress=false] compress whitespace - * @param {String} [options.indentation=''] indentation sequence - * @returns {String} CSS - */ - function stringify(ast, options) { - - options || (options = {}); - _indentation = options.indentation || ''; - _compress = !!options.compress; - _comments = !!options.comments; - _level = 1; - - if (_compress) { - _n = _s = ''; - } else { - _n = '\n'; - _s = ' '; - } - - var css = reduce(ast.stylesheet.rules, stringifyNode).join('\n').trim(); - - return css; - } - - // -- Functions -------------------------------------------------------------- - - /** - * Modify the indentation level, or return a compression-aware sequence of - * spaces equal to the current indentation level. - * - * @param {Number} [level=undefined] indentation level modifier - * @returns {String} sequence of spaces - */ - function indent(level) { - if (level) { - _level += level; - return; - } - - if (_compress) { return ''; } - - return Array(_level).join(_indentation || ''); - } - - // -- Stringify Functions ------------------------------------------------------ - - /** - * Stringify an @-rule AST node. - * - * Use `stringifyAtGroup()` when dealing with @-groups that may contain blocks - * such as @media. - * - * @param {String} type @-rule type. E.g., import, charset - * @returns {String} Stringified @-rule - */ - function stringifyAtRule(node) { - return '@' + node.type + ' ' + node.value + ';' + _n; - } - - /** - * Stringify an @-group AST node. - * - * Use `stringifyAtRule()` when dealing with @-rules that may not contain blocks - * such as @import. - * - * @param {Object} node @-group AST node - * @returns {String} - */ - function stringifyAtGroup(node) { - var label = ''; - var prefix = node.prefix || ''; - - if (node.name) { - label = ' ' + node.name; - } - - // FIXME: @-rule conditional logic is leaking everywhere. - var chomp = node.type !== 'page'; - - return '@' + prefix + node.type + label + _s + stringifyBlock(node, chomp) + _n; - } - - /** - * Stringify a comment AST node. - * - * @param {Object} node comment AST node - * @returns {String} - */ - function stringifyComment(node) { - if (!_comments) { return ''; } - - return '/*' + (node.text || '') + '*/' + _n; - } - - /** - * Stringify a rule AST node. - * - * @param {Object} node rule AST node - * @returns {String} - */ - function stringifyRule(node) { - var label; - - if (node.selectors) { - label = node.selectors.join(',' + _n); - } else { - label = '@' + node.type; - label += node.name ? ' ' + node.name : ''; - } - - return indent() + label + _s + stringifyBlock(node) + _n; - } - - - // -- Stringify Helper Functions ----------------------------------------------- - - /** - * Reduce an array by applying a function to each item and retaining the truthy - * results. - * - * When `item.type` is `'comment'` `stringifyComment` will be applied instead. - * - * @param {Array} items array to reduce - * @param {Function} fn function to call for each item in the array - * @returns {Mixed} Truthy values will be retained, falsy values omitted - * @returns {Array} retained results - */ - function reduce(items, fn) { - return items.reduce(function (results, item) { - var result = (item.type === 'comment') ? stringifyComment(item) : fn(item); - result && results.push(result); - return results; - }, []); - } - - /** - * Stringify an AST node with the assumption that it represents a block of - * declarations or other @-group contents. - * - * @param {Object} node AST node - * @returns {String} - */ - // FIXME: chomp should not be a magic boolean parameter - function stringifyBlock(node, chomp) { - var children = node.declarations; - var fn = stringifyDeclaration; - - if (node.rules) { - children = node.rules; - fn = stringifyRule; - } - - children = stringifyChildren(children, fn); - children && (children = _n + children + (chomp ? '' : _n)); - - return '{' + children + indent() + '}'; - } - - /** - * Stringify an array of child AST nodes by calling the given stringify function - * once for each child, and concatenating the results. - * - * @param {Array} children `node.rules` or `node.declarations` - * @param {Function} fn stringify function - * @returns {String} - */ - function stringifyChildren(children, fn) { - if (!children) { return ''; } - - indent(1); - var results = reduce(children, fn); - indent(-1); - - if (!results.length) { return ''; } - - return results.join(_n); - } - - /** - * Stringify a declaration AST node. - * - * @param {Object} node declaration AST node - * @returns {String} - */ - function stringifyDeclaration(node) { - if (node.type === 'property') { - return stringifyProperty(node); - } - } - - /** - * Stringify an AST node. - * - * @param {Object} node AST node - * @returns {String} - */ - function stringifyNode(node) { - switch (node.type) { - // Cases are listed in roughly descending order of probability. - case 'rule': return stringifyRule(node); - - case 'media' : - case 'keyframes': return stringifyAtGroup(node); - - case 'comment': return stringifyComment(node); - - case 'import' : - case 'charset' : - case 'namespace': return stringifyAtRule(node); - - case 'font-face': - case 'supports' : - case 'viewport' : - case 'document' : - case 'page' : return stringifyAtGroup(node); - } - } - - /** - * Stringify an AST property node. - * - * @param {Object} node AST property node - * @returns {String} - */ - function stringifyProperty(node) { - var name = node.name ? node.name + ':' + _s : ''; - - return indent() + name + node.value + ';'; - } - }); - - var mensch = { - lex : lexer, - parse: parser, - stringify: stringify_1 - }; - - // Notable changes from Slick.Parser 1.0.x - - // The parser now uses 2 classes: Expressions and Expression - // `new Expressions` produces an array-like object containing a list of Expression objects - // - Expressions::toString() produces a cleaned up expressions string - // `new Expression` produces an array-like object - // - Expression::toString() produces a cleaned up expression string - // The only exposed method is parse, which produces a (cached) `new Expressions` instance - // parsed.raw is no longer present, use .toString() - // parsed.expression is now useless, just use the indices - // parsed.reverse() has been removed for now, due to its apparent uselessness - // Other changes in the Expressions object: - // - classNames are now unique, and save both escaped and unescaped values - // - attributes now save both escaped and unescaped values - // - pseudos now save both escaped and unescaped values - - var escapeRe = /([-.*+?^${}()|[\]\/\\])/g, - unescapeRe = /\\/g; - - var escape$1 = function(string){ - // XRegExp v2.0.0-beta-3 - // « https://github.com/slevithan/XRegExp/blob/master/src/xregexp.js - return (string + "").replace(escapeRe, '\\$1') - }; - - var unescape$1 = function(string){ - return (string + "").replace(unescapeRe, '') - }; - - var slickRe = RegExp( - /* - #!/usr/bin/env ruby - puts "\t\t" + DATA.read.gsub(/\(\?x\)|\s+#.*$|\s+|\\$|\\n/,'') - __END__ - "(?x)^(?:\ - \\s* ( , ) \\s* # Separator \n\ - | \\s* ( + ) \\s* # Combinator \n\ - | ( \\s+ ) # CombinatorChildren \n\ - | ( + | \\* ) # Tag \n\ - | \\# ( + ) # ID \n\ - | \\. ( + ) # ClassName \n\ - | # Attribute \n\ - \\[ \ - \\s* (+) (?: \ - \\s* ([*^$!~|]?=) (?: \ - \\s* (?:\ - ([\"']?)(.*?)\\9 \ - )\ - ) \ - )? \\s* \ - \\](?!\\]) \n\ - | :+ ( + )(?:\ - \\( (?:\ - (?:([\"'])([^\\12]*)\\12)|((?:\\([^)]+\\)|[^()]*)+)\ - ) \\)\ - )?\ - )" - */ - "^(?:\\s*(,)\\s*|\\s*(+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)" - .replace(//, '[' + escape$1(">+~`!@$%^&={}\\;/g, '(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') - .replace(//g, '(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') - ); - - // Part - - var Part = function Part(combinator){ - this.combinator = combinator || " "; - this.tag = "*"; - }; - - Part.prototype.toString = function(){ - - if (!this.raw){ - - var xpr = "", k, part; - - xpr += this.tag || "*"; - if (this.id) xpr += "#" + this.id; - if (this.classes) xpr += "." + this.classList.join("."); - if (this.attributes) for (k = 0; part = this.attributes[k++];){ - xpr += "[" + part.name + (part.operator ? part.operator + '"' + part.value + '"' : '') + "]"; - } - if (this.pseudos) for (k = 0; part = this.pseudos[k++];){ - xpr += ":" + part.name; - if (part.value) xpr += "(" + part.value + ")"; - } - - this.raw = xpr; - - } - - return this.raw - }; - - // Expression - - var Expression = function Expression(){ - this.length = 0; - }; - - Expression.prototype.toString = function(){ - - if (!this.raw){ - - var xpr = ""; - - for (var j = 0, bit; bit = this[j++];){ - if (j !== 1) xpr += " "; - if (bit.combinator !== " ") xpr += bit.combinator + " "; - xpr += bit; - } - - this.raw = xpr; - - } - - return this.raw - }; - - var replacer$1 = function( - rawMatch, - - separator, - combinator, - combinatorChildren, - - tagName, - id, - className, - - attributeKey, - attributeOperator, - attributeQuote, - attributeValue, - - pseudoMarker, - pseudoClass, - pseudoQuote, - pseudoClassQuotedValue, - pseudoClassValue - ){ - - var expression, current; - - if (separator || !this.length){ - expression = this[this.length++] = new Expression; - if (separator) return '' - } - - if (!expression) expression = this[this.length - 1]; - - if (combinator || combinatorChildren || !expression.length){ - current = expression[expression.length++] = new Part(combinator); - } - - if (!current) current = expression[expression.length - 1]; - - if (tagName){ - - current.tag = unescape$1(tagName); - - } else if (id){ - - current.id = unescape$1(id); - - } else if (className){ - - var unescaped = unescape$1(className); - - var classes = current.classes || (current.classes = {}); - if (!classes[unescaped]){ - classes[unescaped] = escape$1(className); - var classList = current.classList || (current.classList = []); - classList.push(unescaped); - classList.sort(); - } - - } else if (pseudoClass){ - - pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue - - ;(current.pseudos || (current.pseudos = [])).push({ - type : pseudoMarker.length == 1 ? 'class' : 'element', - name : unescape$1(pseudoClass), - escapedName : escape$1(pseudoClass), - value : pseudoClassValue ? unescape$1(pseudoClassValue) : null, - escapedValue : pseudoClassValue ? escape$1(pseudoClassValue) : null - }); - - } else if (attributeKey){ - - attributeValue = attributeValue ? escape$1(attributeValue) : null - - ;(current.attributes || (current.attributes = [])).push({ - operator : attributeOperator, - name : unescape$1(attributeKey), - escapedName : escape$1(attributeKey), - value : attributeValue ? unescape$1(attributeValue) : null, - escapedValue : attributeValue ? escape$1(attributeValue) : null - }); - - } - - return '' - - }; - - // Expressions - - var Expressions = function Expressions(expression){ - this.length = 0; - - var self = this; - - var original = expression, replaced; - - while (expression){ - replaced = expression.replace(slickRe, function(){ - return replacer$1.apply(self, arguments) - }); - if (replaced === expression) throw new Error(original + ' is an invalid expression') - expression = replaced; - } - }; - - Expressions.prototype.toString = function(){ - if (!this.raw){ - var expressions = []; - for (var i = 0, expression; expression = this[i++];) expressions.push(expression); - this.raw = expressions.join(", "); - } - - return this.raw - }; - - var cache = {}; - - var parse$5 = function(expression){ - if (expression == null) return null - expression = ('' + expression).replace(/^\s+|\s+$/g, ''); - return cache[expression] || (cache[expression] = new Expressions(expression)) - }; - - var parser$1 = parse$5; - - var selector = createCommonjsModule(function (module, exports) { - - - - module.exports = exports = Selector; - - /** - * CSS selector constructor. - * - * @param {String} selector text - * @param {Array} optionally, precalculated specificity - * @api public - */ - - function Selector(text, styleAttribute) { - this.text = text; - this.spec = undefined; - this.styleAttribute = styleAttribute || false; - } - - /** - * Get parsed selector. - * - * @api public - */ - - Selector.prototype.parsed = function() { - if (!this.tokens) { this.tokens = parse(this.text); } - return this.tokens; - }; - - /** - * Lazy specificity getter - * - * @api public - */ - - Selector.prototype.specificity = function() { - var styleAttribute = this.styleAttribute; - if (!this.spec) { this.spec = specificity(this.text, this.parsed()); } - return this.spec; - - function specificity(text, parsed) { - var expressions = parsed || parse(text); - var spec = [styleAttribute ? 1 : 0, 0, 0, 0]; - var nots = []; - - for (var i = 0; i < expressions.length; i++) { - var expression = expressions[i]; - var pseudos = expression.pseudos; - - // id awards a point in the second column - if (expression.id) { spec[1]++; } - - // classes and attributes award a point each in the third column - if (expression.attributes) { spec[2] += expression.attributes.length; } - if (expression.classList) { spec[2] += expression.classList.length; } - - // tag awards a point in the fourth column - if (expression.tag && expression.tag !== '*') { spec[3]++; } - - // pseudos award a point each in the fourth column - if (pseudos) { - spec[3] += pseudos.length; - - for (var p = 0; p < pseudos.length; p++) { - if (pseudos[p].name === 'not') { - nots.push(pseudos[p].value); - spec[3]--; - } - } - } - } - - for (var ii = nots.length; ii--;) { - var not = specificity(nots[ii]); - for (var jj = 4; jj--;) { spec[jj] += not[jj]; } - } - - return spec; - } - }; - - /** - * Parses a selector and returns the tokens. - * - * @param {String} selector - * @api private. - */ - - function parse(text) { - try { - return parser$1(text)[0]; - } catch (e) { - return []; - } - } - }); - - var property = createCommonjsModule(function (module, exports) { - - module.exports = exports = Property; - - /** - * Module dependencies. - */ - - - - /** - * CSS property constructor. - * - * @param {String} property - * @param {String} value - * @param {Selector} selector the property originates from - * @param {Integer} priority 0 for normal properties, 2 for !important properties. - * @param {Array} additional array of integers representing more detailed priorities (sorting) - * @api public - */ - - function Property(prop, value, selector, priority, additionalPriority) { - this.prop = prop; - this.value = value; - this.selector = selector; - this.priority = priority || 0; - this.additionalPriority = additionalPriority || []; - } - - /** - * Compares with another Property based on Selector#specificity. - * - * @api public - */ - - Property.prototype.compareFunc = function(property) { - var a = []; - a.push.apply(a, this.selector.specificity()); - a.push.apply(a, this.additionalPriority); - a[0] += this.priority; - var b = []; - b.push.apply(b, property.selector.specificity()); - b.push.apply(b, property.additionalPriority); - b[0] += property.priority; - return utils$1.compareFunc(a, b); - }; - - Property.prototype.compare = function(property) { - var winner = this.compareFunc(property); - if (winner === 1) { - return this; - } - return property; - }; - - - /** - * Returns CSS property - * - * @api public - */ - - Property.prototype.toString = function() { - return this.prop + ': ' + this.value.replace(/['"]+/g, '') + ';'; - }; - }); - - var utils$1 = createCommonjsModule(function (module, exports) { - - /** - * Module dependencies. - */ - - - - - - exports.Selector = selector; - exports.Property = property; - - /** - * Returns an array of the selectors. - * - * @license Sizzle CSS Selector Engine - MIT - * @param {String} selectorText from mensch - * @api public - */ - - exports.extract = function extract(selectorText) { - var attr = 0; - var sels = []; - var sel = ''; - - for (var i = 0, l = selectorText.length; i < l; i++) { - var c = selectorText.charAt(i); - - if (attr) { - if (']' === c || ')' === c) { attr--; } - sel += c; - } else { - if (',' === c) { - sels.push(sel); - sel = ''; - } else { - if ('[' === c || '(' === c) { attr++; } - if (sel.length || (c !== ',' && c !== '\n' && c !== ' ')) { sel += c; } - } - } - } - - if (sel.length) { - sels.push(sel); - } - - return sels; - }; - - /** - * Returns a parse tree for a CSS source. - * If it encounters multiple selectors separated by a comma, it splits the - * tree. - * - * @param {String} css source - * @api public - */ - - exports.parseCSS = function(css) { - var parsed = mensch.parse(css, {position: true, comments: true}); - var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : []; - var ret = []; - - for (var i = 0, l = rules.length; i < l; i++) { - if (rules[i].type == 'rule') { - var rule = rules[i]; - var selectors = rule.selectors; - - for (var ii = 0, ll = selectors.length; ii < ll; ii++) { - ret.push([selectors[ii], rule.declarations]); - } - } - } - - return ret; - }; - - /** - * Returns preserved text for a CSS source. - * - * @param {String} css source - * @param {Object} options - * @api public - */ - - exports.getPreservedText = function(css, options, ignoredPseudos) { - var parsed = mensch.parse(css, {position: true, comments: true}); - var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : []; - var preserved = []; - var lastStart = null; - - for (var i = rules.length - 1; i >= 0; i--) { - if ((options.fontFaces && rules[i].type === 'font-face') || - (options.mediaQueries && rules[i].type === 'media') || - (options.keyFrames && rules[i].type === 'keyframes') || - (options.pseudos && rules[i].selectors && this.matchesPseudo(rules[i].selectors[0], ignoredPseudos))) { - preserved.unshift( - mensch.stringify( - { stylesheet: { rules: [ rules[i] ] }}, - { comments: false, indentation: ' ' } - ) - ); - } - lastStart = rules[i].position.start; - } - - if (preserved.length === 0) { - return false; - } - return '\n' + preserved.join('\n') + '\n'; - }; - - exports.normalizeLineEndings = function(text) { - return text.replace(/\r\n/g, '\n').replace(/\n/g, '\r\n'); - }; - - exports.matchesPseudo = function(needle, haystack) { - return haystack.find(function (element) { - return needle.indexOf(element) > -1; - }) - }; - - /** - * Compares two specificity vectors, returning the winning one. - * - * @param {Array} vector a - * @param {Array} vector b - * @return {Array} - * @api public - */ - - exports.compareFunc = function(a, b) { - var min = Math.min(a.length, b.length); - for (var i = 0; i < min; i++) { - if (a[i] === b[i]) { continue; } - if (a[i] > b[i]) { return 1; } - return -1; - } - - return a.length - b.length; - }; - - exports.compare = function(a, b) { - return exports.compareFunc(a, b) == 1 ? a : b; - }; - - exports.getDefaultOptions = function(options) { - var result = Object.assign({ - extraCss: '', - insertPreservedExtraCss: true, - applyStyleTags: true, - removeStyleTags: true, - preserveMediaQueries: true, - preserveFontFaces: true, - preserveKeyFrames: true, - preservePseudos: true, - applyWidthAttributes: true, - applyHeightAttributes: true, - applyAttributesTableElements: true, - url: '' - }, options); - - result.webResources = result.webResources || {}; - - return result; - }; - }); - var utils_1 = utils$1.Selector; - var utils_2 = utils$1.Property; - var utils_3 = utils$1.extract; - var utils_4 = utils$1.parseCSS; - var utils_5 = utils$1.getPreservedText; - var utils_6 = utils$1.normalizeLineEndings; - var utils_7 = utils$1.matchesPseudo; - var utils_8 = utils$1.compareFunc; - var utils_9 = utils$1.compare; - var utils_10 = utils$1.getDefaultOptions; - - var cheerio_1 = createCommonjsModule(function (module) { - - /** - * Module dependencies. - */ - - - - var cheerioLoad = function(html, options, encodeEntities) { - options = Object.assign({decodeEntities: false, _useHtmlParser2:true}, options); - html = encodeEntities(html); - return cheerio.load(html, options); - }; - - var createEntityConverters = function () { - var codeBlockLookup = []; - - var encodeCodeBlocks = function(html) { - var blocks = module.exports.codeBlocks; - Object.keys(blocks).forEach(function(key) { - var re = new RegExp(blocks[key].start + '([\\S\\s]*?)' + blocks[key].end, 'g'); - html = html.replace(re, function(match, subMatch) { - codeBlockLookup.push(match); - return 'JUICE_CODE_BLOCK_' + (codeBlockLookup.length - 1) + '_'; - }); - }); - return html; - }; - - var decodeCodeBlocks = function(html) { - for(var index = 0; index < codeBlockLookup.length; index++) { - var re = new RegExp('JUICE_CODE_BLOCK_' + index + '_(="")?', 'gi'); - html = html.replace(re, function() { - return codeBlockLookup[index]; - }); - } - return html; - }; - - return { - encodeEntities: encodeCodeBlocks, - decodeEntities: decodeCodeBlocks, - }; - }; - - /** - * Parses the input, calls the callback on the parsed DOM, and generates the output - * - * @param {String} html input html to be processed - * @param {Object} options for the parser - * @param {Function} callback to be invoked on the DOM - * @param {Array} callbackExtraArguments to be passed to the callback - * @return {String} resulting html - */ - module.exports = function(html, options, callback, callbackExtraArguments) { - var entityConverters = createEntityConverters(); - - var $ = cheerioLoad(html, options, entityConverters.encodeEntities); - var args = [ $ ]; - args.push.apply(args, callbackExtraArguments); - var doc = callback.apply(undefined, args) || $; - - if (options && options.xmlMode) { - return entityConverters.decodeEntities(doc.xml()); - } - return entityConverters.decodeEntities(doc.html()); - }; - - module.exports.codeBlocks = { - EJS: { start: '<%', end: '%>' }, - HBS: { start: '{{', end: '}}' } - }; - }); - var cheerio_2 = cheerio_1.codeBlocks; - - /** - * Converts a decimal number to roman numeral. - * https://stackoverflow.com/questions/9083037/convert-a-number-into-a-roman-numeral-in-javascript - * - * @param {Number} number - * @api private. - */ - var romanize = function(num) { - if (isNaN(num)) - return NaN; - var digits = String(+num).split(""), - key = ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM", - "","X","XX","XXX","XL","L","LX","LXX","LXXX","XC", - "","I","II","III","IV","V","VI","VII","VIII","IX"], - roman = "", - i = 3; - while (i--) - roman = (key[+digits.pop() + (i * 10)] || "") + roman; - return Array(+digits.join("") + 1).join("M") + roman; - }; - - /** - * Converts a decimal number to alphanumeric numeral. - * https://stackoverflow.com/questions/45787459/convert-number-to-alphabet-string-javascript - * - * @param {Number} number - * @api private. - */ - var alphanumeric = function(num) { - var s = '', t; - - while (num > 0) { - t = (num - 1) % 26; - s = String.fromCharCode(65 + t) + s; - num = (num - t)/26 | 0; - } - return s || undefined; - }; - - var numbers = { - romanize: romanize, - alphanumeric: alphanumeric - }; - - var inline = function makeJuiceClient(juiceClient) { - - juiceClient.ignoredPseudos = ['hover', 'active', 'focus', 'visited', 'link']; - juiceClient.widthElements = ['TABLE', 'TD', 'TH', 'IMG']; - juiceClient.heightElements = ['TABLE', 'TD', 'TH', 'IMG']; - juiceClient.tableElements = ['TABLE', 'TH', 'TR', 'TD', 'CAPTION', 'COLGROUP', 'COL', 'THEAD', 'TBODY', 'TFOOT']; - juiceClient.nonVisualElements = [ 'HEAD', 'TITLE', 'BASE', 'LINK', 'STYLE', 'META', 'SCRIPT', 'NOSCRIPT' ]; - juiceClient.styleToAttribute = { - 'background-color': 'bgcolor', - 'background-image': 'background', - 'text-align': 'align', - 'vertical-align': 'valign' - }; - juiceClient.excludedProperties = []; - - juiceClient.juiceDocument = juiceDocument; - juiceClient.inlineDocument = inlineDocument; - - function inlineDocument($, css, options) { - - options = options || {}; - var rules = utils$1.parseCSS(css); - var editedElements = []; - var styleAttributeName = 'style'; - var counters = {}; - - if (options.styleAttributeName) { - styleAttributeName = options.styleAttributeName; - } - - rules.forEach(handleRule); - editedElements.forEach(setStyleAttrs); - - if (options.inlinePseudoElements) { - editedElements.forEach(inlinePseudoElements); - } - - if (options.applyWidthAttributes) { - editedElements.forEach(function(el) { - setDimensionAttrs(el, 'width'); - }); - } - - if (options.applyHeightAttributes) { - editedElements.forEach(function(el) { - setDimensionAttrs(el, 'height'); - }); - } - - if (options.applyAttributesTableElements) { - editedElements.forEach(setAttributesOnTableElements); - } - - if (options.insertPreservedExtraCss && options.extraCss) { - var preservedText = utils$1.getPreservedText(options.extraCss, { - mediaQueries: options.preserveMediaQueries, - fontFaces: options.preserveFontFaces, - keyFrames: options.preserveKeyFrames - }); - if (preservedText) { - var $appendTo = null; - if (options.insertPreservedExtraCss !== true) { - $appendTo = $(options.insertPreservedExtraCss); - } else { - $appendTo = $('head'); - if (!$appendTo.length) { $appendTo = $('body'); } - if (!$appendTo.length) { $appendTo = $.root(); } - } - - $appendTo.first().append(''); - } - } - - function handleRule(rule) { - var sel = rule[0]; - var style = rule[1]; - var selector = new utils$1.Selector(sel); - var parsedSelector = selector.parsed(); - - if (!parsedSelector) { - return; - } - - var pseudoElementType = getPseudoElementType(parsedSelector); - - // skip rule if the selector has any pseudos which are ignored - for (var i = 0; i < parsedSelector.length; ++i) { - var subSel = parsedSelector[i]; - if (subSel.pseudos) { - for (var j = 0; j < subSel.pseudos.length; ++j) { - var subSelPseudo = subSel.pseudos[j]; - if (juiceClient.ignoredPseudos.indexOf(subSelPseudo.name) >= 0) { - return; - } - } - } - } - - if (pseudoElementType) { - var last = parsedSelector[parsedSelector.length - 1]; - var pseudos = last.pseudos; - last.pseudos = filterElementPseudos(last.pseudos); - sel = parsedSelector.toString(); - last.pseudos = pseudos; - } - - var els; - try { - els = $(sel); - } catch (err) { - // skip invalid selector - return; - } - - els.each(function() { - var el = this; - - if (el.name && juiceClient.nonVisualElements.indexOf(el.name.toUpperCase()) >= 0) { - return; - } - - if (pseudoElementType) { - var pseudoElPropName = 'pseudo' + pseudoElementType; - var pseudoEl = el[pseudoElPropName]; - if (!pseudoEl) { - pseudoEl = el[pseudoElPropName] = $('').get(0); - pseudoEl.pseudoElementType = pseudoElementType; - pseudoEl.pseudoElementParent = el; - pseudoEl.counterProps = el.counterProps; - el[pseudoElPropName] = pseudoEl; - } - el = pseudoEl; - } - - if (!el.styleProps) { - el.styleProps = {}; - - // if the element has inline styles, fake selector with topmost specificity - if ($(el).attr(styleAttributeName)) { - var cssText = '* { ' + $(el).attr(styleAttributeName) + ' } '; - addProps(utils$1.parseCSS(cssText)[0][1], new utils$1.Selector('"); - } - }, { - key: "computeStyle", - value: function computeStyle() { - // 计算需要append进富文本的style - var mathStyle = this.getStyleFromSheets('mjx-container'); - var cherryStyle = this.getStyleFromSheets('cherry'); - var echartStyle = ''; - return { - mathStyle: mathStyle, - echartStyle: echartStyle, - cherryStyle: cherryStyle - }; - } - /** - * 由于复制操作会随着预览区域的内容增加而耗时变长,所以需要增加“正在复制”的状态回显 - * 同时该状态也用于限频 - */ - - }, { - key: "toggleLoading", - value: function toggleLoading() { - // 切换loading状态 - if (this.isLoading) { - var loadingButton = document.querySelector('.icon-loading'); - loadingButton.outerHTML = ""); - } else { - var copyButton = document.querySelector('.ch-icon-copy'); - copyButton.outerHTML = '
'; - } - - this.isLoading = !this.isLoading; - } - /** - * 响应点击事件 - * 该按钮不会引发编辑区域的内容改动,所以不用处理用户在编辑区域的选中内容 - * @param {Event} e 点击事件 - */ - - }, { - key: "onClick", - value: function onClick(e) { - var _this2 = this; - - this.toggleLoading(); - var inlineCodeTheme = document.querySelector('.cherry').getAttribute('data-inline-code-theme'); - var codeBlockTheme = document.querySelector('.cherry').getAttribute('data-code-block-theme'); - - var _this$computeStyle = this.computeStyle(), - mathStyle = _this$computeStyle.mathStyle, - echartStyle = _this$computeStyle.echartStyle, - cherryStyle = _this$computeStyle.cherryStyle; - - var html = this.previewer.isPreviewerHidden() ? this.previewer.options.previewerCache.html : this.previewer.getValue(); // 将css样式以行内样式的形式插入到html内容里 - - this.adaptWechat(html).then(function (html) { - var _context7, _context8, _context9; - - copyToClip(client(concat$5(_context7 = concat$5(_context8 = concat$5(_context9 = "
\n
")).call(_context8, html, "
\n
")).call(_context7, mathStyle + echartStyle + cherryStyle))); - - _this2.toggleLoading(); - }); - } - }]); - - return Copy; - }(MenuBase); - - function convertImgToBase64(url, callback, outputFormat) { - return new promise$7(function (resolve) { - var canvas = - /** @type {HTMLCanvasElement}*/ - document.createElement('CANVAS'); - var ctx = canvas.getContext('2d'); - var img = new Image(); - img.crossOrigin = 'Anonymous'; - - img.onload = function () { - canvas.height = img.height; - canvas.width = img.width; - ctx.drawImage(img, 0, 0); - var dataURL = canvas.toDataURL(outputFormat || 'image/png'); - resolve(dataURL); - canvas = null; - }; - - img.src = url; - }); - } - - function _createSuper$1k(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1k(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1k() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 插入面板 - */ - - var Panel$1 = /*#__PURE__*/function (_MenuBase) { - _inherits(Panel, _MenuBase); - - var _super = _createSuper$1k(Panel); - - function Panel($cherry) { - var _context, _context2, _context3, _context4, _context5; - - var _this; - - _classCallCheck(this, Panel); - - _this = _super.call(this, $cherry); - - _this.setName('panel', 'tips'); - - _this.panelRule = getPanelRule().reg; - _this.subMenuConfig = [{ - iconName: 'tips', - name: 'tips', - onclick: bind$5(_context = _this.bindSubClick).call(_context, _assertThisInitialized(_this), 'primary') - }, { - iconName: 'info', - name: 'info', - onclick: bind$5(_context2 = _this.bindSubClick).call(_context2, _assertThisInitialized(_this), 'info') - }, { - iconName: 'warning', - name: 'warning', - onclick: bind$5(_context3 = _this.bindSubClick).call(_context3, _assertThisInitialized(_this), 'warning') - }, { - iconName: 'danger', - name: 'danger', - onclick: bind$5(_context4 = _this.bindSubClick).call(_context4, _assertThisInitialized(_this), 'danger') - }, { - iconName: 'success', - name: 'success', - onclick: bind$5(_context5 = _this.bindSubClick).call(_context5, _assertThisInitialized(_this), 'success') - }]; - return _this; - } - /** - * 从字符串中找打面板的name - * @param {string} str - * @returns {string | false} - */ - - - _createClass(Panel, [{ - key: "$getNameFromStr", - value: function $getNameFromStr(str) { - var ret = false; - this.panelRule.lastIndex = 0; - str.replace(this.panelRule, function (match, preLines, name, content) { - var $name = /\s/.test(trim$3(name).call(name)) ? trim$3(name).call(name).replace(/\s.*$/, '') : name; - ret = $name ? trim$3($name).call($name).toLowerCase() : ''; - return match; - }); - return ret; - } - }, { - key: "$getTitle", - value: function $getTitle(str) { - this.panelRule.lastIndex = 0; - str.replace(this.panelRule, function (match, preLines, name, content) { - var $name = trim$3(name).call(name); - - return /\s/.test($name) ? $name.replace(/[^\s]+\s/, '') : ''; - }); - return ''; - } - /** - * 响应点击事件 - * @param {string} selection 被用户选中的文本内容 - * @param {string} shortKey 快捷键参数 - * @returns {string} 回填到编辑器光标位置/选中文本区域的内容 - */ - - }, { - key: "onClick", - value: function onClick(selection) { - var _this2 = this, - _context9, - _context10; - - var shortKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var $selection = getSelection(this.editor.editor, selection, 'line', true) || '内容'; - var currentName = this.$getNameFromStr($selection); - var title = this.$getTitle($selection); - - if (currentName === false) { - // 如果没有命中面板语法,则尝试扩大选区 - this.getMoreSelection('::: ', '\n', function () { - var newSelection = _this2.editor.editor.getSelection(); - - var isMatch = _this2.$getNameFromStr(newSelection); - - if (isMatch !== false) { - $selection = newSelection; - currentName = isMatch; - title = _this2.$getTitle(newSelection); - } - - return isMatch !== false; - }); - } - - if (currentName !== false) { - // 如果命中了面板语法,则尝试去掉语法或者变更语法 - if (currentName === shortKey) { - // 去掉面板语法 - this.panelRule.lastIndex = 0; - return $selection.replace(this.panelRule, function (match, preLines, name, content) { - var _context6; - - var $name = trim$3(name).call(name); - - var $title = /\s/.test($name) ? $name.replace(/[^\s]+\s/, '') : ''; - return concat$5(_context6 = "".concat($title, "\n")).call(_context6, content); - }); - } // 修改name - - - this.registerAfterClickCb(function () { - _this2.setLessSelection('::: ', '\n'); - }); - this.panelRule.lastIndex = 0; - return $selection.replace(this.panelRule, function (match, preLines, name, content) { - var _context7, _context8; - - var $name = trim$3(name).call(name); - - var $title = /\s/.test($name) ? $name.replace(/[^\s]+\s/, '') : ''; - return concat$5(_context7 = concat$5(_context8 = "::: ".concat(shortKey, " ")).call(_context8, $title, "\n")).call(_context7, content.replace(/\n+$/, ''), "\n:::"); - }); - } - - this.registerAfterClickCb(function () { - _this2.setLessSelection('::: ', '\n'); - }); - $selection = $selection.replace(/^\n+/, ''); - - if (/\n/.test($selection)) { - if (!title) { - title = $selection.replace(/\n[\w\W]+$/, ''); - $selection = $selection.replace(/^[^\n]+\n/, ''); - } - } else { - title = title ? title : '标题'; - } - - return concat$5(_context9 = concat$5(_context10 = "::: ".concat(shortKey, " ")).call(_context10, title, "\n")).call(_context9, $selection, "\n:::").replace(/\n{2,}:::/g, '\n:::'); - } - }]); - - return Panel; - }(MenuBase); - - function _createSuper$1l(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1l(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1l() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 插入对齐方式 - */ - - var Justify = /*#__PURE__*/function (_Panel) { - _inherits(Justify, _Panel); - - var _super = _createSuper$1l(Justify); - - function Justify($cherry) { - var _context, _context2, _context3; - - var _this; - - _classCallCheck(this, Justify); - - _this = _super.call(this, $cherry); - - _this.setName('justify', 'justify'); - - _this.panelRule = getPanelRule().reg; - _this.subMenuConfig = [{ - iconName: 'justifyLeft', - name: '左对齐', - onclick: bind$5(_context = _this.bindSubClick).call(_context, _assertThisInitialized(_this), 'left') - }, { - iconName: 'justifyCenter', - name: '居中', - onclick: bind$5(_context2 = _this.bindSubClick).call(_context2, _assertThisInitialized(_this), 'center') - }, { - iconName: 'justifyRight', - name: '右对齐', - onclick: bind$5(_context3 = _this.bindSubClick).call(_context3, _assertThisInitialized(_this), 'right') - }]; - return _this; - } - - _createClass(Justify, [{ - key: "$getTitle", - value: function $getTitle() { - return ' '; - } - }]); - - return Justify; - }(Panel$1); - - function _createSuper$1m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1m(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1m() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 插入手风琴 - */ - - var Detail$1 = /*#__PURE__*/function (_MenuBase) { - _inherits(Detail, _MenuBase); - - var _super = _createSuper$1m(Detail); - - function Detail($cherry) { - var _this; - - _classCallCheck(this, Detail); - - _this = _super.call(this, $cherry); - - _this.setName('detail', 'insertFlow'); - - _this.detailRule = getDetailRule().reg; - return _this; - } - /** - * 响应点击事件 - * @param {string} selection 被用户选中的文本内容 - * @returns {string} 回填到编辑器光标位置/选中文本区域的内容 - */ - - - _createClass(Detail, [{ - key: "onClick", - value: function onClick(selection) { - var _this2 = this; - - var $selection = getSelection(this.editor.editor, selection, 'line', true) || '点击展开更多\n内容\n++- 默认展开\n内容\n++ 默认收起\n内容'; - this.detailRule.lastIndex = 0; - - if (!this.detailRule.test($selection)) { - // 如果没有命中手风琴语法,则尝试扩大选区 - this.getMoreSelection('+++ ', '\n', function () { - var newSelection = _this2.editor.editor.getSelection(); - - _this2.detailRule.lastIndex = 0; - - var isMatch = _this2.detailRule.test(newSelection); - - if (isMatch !== false) { - $selection = newSelection; - } - - return isMatch !== false; - }); - } - - this.detailRule.lastIndex = 0; - - if (this.detailRule.test($selection)) { - // 如果命中了手风琴语法,则去掉手风琴语法 - this.detailRule.lastIndex = 0; - return $selection.replace(this.detailRule, function (match, preLines, isOpen, title, content) { - var _context; - - return concat$5(_context = "".concat(title, "\n")).call(_context, content); - }); - } // 去掉开头的空格 - - - $selection = $selection.replace(/^\s+/, ''); // 如果选中的内容不包含换行,则强制增加一个换行 - - if (!/\n/.test($selection)) { - var _context2; - - $selection = concat$5(_context2 = "".concat($selection, "\n")).call(_context2, $selection); - } - - this.registerAfterClickCb(function () { - _this2.setLessSelection('+++ ', '\n'); - }); - return "+++ ".concat($selection, "\n+++").replace(/\n{2,}\+\+\+/g, '\n+++'); - } - }]); - - return Detail; - }(MenuBase); - - function _createSuper$1n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1n(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1n() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 打开draw.io画图对话框,点击确定后向编辑器插入图片语法 - */ - - var DrawIo = /*#__PURE__*/function (_MenuBase) { - _inherits(DrawIo, _MenuBase); - - var _super = _createSuper$1n(DrawIo); - - function DrawIo($cherry) { - var _this; - - _classCallCheck(this, DrawIo); - - _this = _super.call(this, $cherry); - - _this.setName('draw.io', 'draw.io'); - - _this.noIcon = true; - _this.drawioIframeUrl = $cherry.options.drawioIframeUrl; - return _this; - } - /** - * 响应点击事件 - * @param {string} selection 被用户选中的文本内容 - * @param {string} shortKey 快捷键参数,本函数不处理这个参数 - * @returns {string} 回填到编辑器光标位置/选中文本区域的内容 - */ - - - _createClass(DrawIo, [{ - key: "onClick", - value: function onClick(selection) { - var _this2 = this; - - if (!this.drawioIframeUrl) { - // 如果没有配置drawio的编辑页URL,则直接失效 - return selection; - } - - if (this.hasCacheOnce()) { - var _context; - - // @ts-ignore - var _this$getAndCleanCach = this.getAndCleanCacheOnce(), - xmlData = _this$getAndCleanCach.xmlData, - base64 = _this$getAndCleanCach.base64; - - var begin = '!['; - - var end = concat$5(_context = "](".concat(base64, "){data-type=drawio data-xml=")).call(_context, encodeURI(xmlData), "}"); - - this.registerAfterClickCb(function () { - _this2.setLessSelection(begin, end); - }); - return "".concat(begin, "\u5728\u9884\u89C8\u533A\u70B9\u51FB\u56FE\u7247\u91CD\u65B0\u7F16\u8F91draw.io").concat(end); - } // 插入图片,调用上传文件逻辑 - - - drawioDialog(this.drawioIframeUrl, '', function (data) { - _this2.setCacheOnce(data); - - _this2.fire(null); - }); - this.updateMarkdown = false; - return selection; - } - }]); - - return DrawIo; - }(MenuBase); - - // 目前不支持按需动态加载 - // 如果对CherryMarkdown构建后的文件大小有比较严格的要求,可以根据实际情况删减hook - - var HookList = { - bold: Bold, - italic: Italic, - '|': Split, - strikethrough: Strikethrough$1, - sub: Sub$1, - sup: Sup$1, - header: Header$1, - insert: Insert, - list: List$1, - ol: Ol, - ul: Ul, - checklist: Checklist, - graph: Graph, - size: Size$1, - h1: H1, - h2: H2, - h3: H3, - color: Color$1, - quote: Quote, - quickTable: QuickTable, - togglePreview: TogglePreview, - code: Code, - codeTheme: CodeTheme, - "export": Export, - settings: Settings, - fullScreen: FullScreen, - mobilePreview: MobilePreview, - copy: Copy, - undo: Undo, - redo: Redo, - underline: Underline$1, - switchModel: SwitchModel, - image: Image$2, - audio: Audio, - video: Video, - br: Br$1, - hr: Hr$1, - formula: Formula, - link: Link$1, - table: Table$1, - toc: Toc$1, - lineTable: LineTable, - barTable: BrTable, - pdf: Pdf, - word: Word, - ruby: Ruby$1, - theme: Theme, - file: File, - panel: Panel$1, - justify: Justify, - detail: Detail$1, - drawIo: DrawIo, - chatgpt: ChatGpt - }; - - var HookCenter$1 = /*#__PURE__*/function () { - function HookCenter(toolbar) { - _classCallCheck(this, HookCenter); - - this.toolbar = toolbar; - /** - * @type {{[key: string]: import('@/toolbars/MenuBase').default}} 保存所有菜单实例 - */ - - this.hooks = {}; - /** - * @type {string[]} 所有注册的菜单名称 - */ - - this.allMenusName = []; - /** - * @type {string[]} 一级菜单的名称 - */ - - this.level1MenusName = []; - /** - * @type {{ [parentName: string]: string[]}} 二级菜单的名称, e.g. {一级菜单名称: [二级菜单名称1, 二级菜单名称2]} - */ - - this.level2MenusName = {}; - this.init(); - } - - _createClass(HookCenter, [{ - key: "$newMenu", - value: function $newMenu(name) { - if (this.hooks[name]) { - return; - } - - var _this$toolbar$options = this.toolbar.options, - $cherry = _this$toolbar$options.$cherry, - customMenu = _this$toolbar$options.customMenu; - - if (HookList[name]) { - this.allMenusName.push(name); - this.hooks[name] = new HookList[name]($cherry); - } else if (customMenu !== undefined && customMenu !== null && customMenu[name]) { - this.allMenusName.push(name); // 如果是自定义菜单,传参兼容旧版 - - this.hooks[name] = new customMenu[name]($cherry); - } - } - /** - * 根据配置动态渲染、绑定工具栏 - * @returns - */ - - }, { - key: "init", - value: function init() { - var _this = this; - - var buttonConfig = this.toolbar.options.buttonConfig; - - forEach$3(buttonConfig).call(buttonConfig, function (item) { - if (typeof item === 'string') { - _this.level1MenusName.push(item); - - _this.$newMenu(item); - } else if (_typeof(item) === 'object') { - var keys = keys$3(item); - - if (keys.length === 1) { - var _context; - - // 只接受形如{ name: [ subMenu ] }的参数 - var _keys = _slicedToArray(keys, 1), - name = _keys[0]; - - _this.level1MenusName.push(name); - - _this.$newMenu(name); - - _this.level2MenusName[name] = item[name]; - - forEach$3(_context = item[name]).call(_context, function (subItem) { - _this.$newMenu(subItem); - }); - } - } - }); - } - }]); - - return HookCenter; - }(); - - var Toolbar = /*#__PURE__*/function () { - /** - * @type {Record} 外部获取 toolbarHandler - */ - function Toolbar(options) { - _classCallCheck(this, Toolbar); - - _defineProperty(this, "toolbarHandlers", {}); - - // 存储所有菜单的实例 - this.menus = {}; // 存储所有快捷键的影射 {快捷键: 菜单名称} - - this.shortcutKeyMap = {}; // 存储所有二级菜单面板 - - this.subMenus = {}; // 默认的菜单配置 - - this.options = { - dom: document.createElement('div'), - buttonConfig: ['bold'], - customMenu: [], - buttonRightConfig: [] - }; - - assign$2(this.options, options); - - this.$cherry = this.options.$cherry; - this.instanceId = this.$cherry.instanceId; - this.menus = new HookCenter$1(this); - this.drawMenus(); - this.init(); - } - - _createClass(Toolbar, [{ - key: "init", - value: function init() { - var _this = this; - - this.collectShortcutKey(); - this.collectToolbarHandler(); - Event$1.on(this.instanceId, Event$1.Events.cleanAllSubMenus, function () { - return _this.hideAllSubMenu(); - }); - } - }, { - key: "previewOnly", - value: function previewOnly() { - this.options.dom.classList.add('preview-only'); - Event$1.emit(this.instanceId, Event$1.Events.toolbarHide); - } - }, { - key: "showToolbar", - value: function showToolbar() { - this.options.dom.classList.remove('preview-only'); - Event$1.emit(this.instanceId, Event$1.Events.toolbarShow); - } - }, { - key: "isHasLevel2Menu", - value: function isHasLevel2Menu(name) { - // FIXME: return boolean - return this.menus.level2MenusName[name]; - } - }, { - key: "isHasConfigMenu", - value: function isHasConfigMenu(name) { - // FIXME: return boolean - return this.menus.hooks[name].subMenuConfig || []; - } - /** - * 判断是否有子菜单,目前有两种子菜单配置方式:1、通过`subMenuConfig`属性 2、通过`buttonConfig`配置属性 - * @param {string} name - * @returns {boolean} 是否有子菜单 - */ - - }, { - key: "isHasSubMenu", - value: function isHasSubMenu(name) { - return Boolean(this.isHasLevel2Menu(name) || this.isHasConfigMenu(name).length > 0); - } - /** - * 根据配置画出来一级工具栏 - */ - - }, { - key: "drawMenus", - value: function drawMenus() { - var _context, - _this2 = this, - _this$options$buttonR; - - var fragLeft = document.createDocumentFragment(); - var toolbarLeft = createElement('div', 'toolbar-left'); - - forEach$3(_context = this.menus.level1MenusName).call(_context, function (name) { - var btn = _this2.menus.hooks[name].createBtn(); - - btn.addEventListener('click', function (event) { - _this2.onClick(event, name); - }, false); - - if (_this2.isHasSubMenu(name)) { - btn.classList.add('cherry-toolbar-dropdown'); - } - - fragLeft.appendChild(btn); - }); - - toolbarLeft.appendChild(fragLeft); - this.options.dom.appendChild(toolbarLeft); - (_this$options$buttonR = this.options.buttonRightConfig) !== null && _this$options$buttonR !== void 0 && _this$options$buttonR.length ? this.drawRightMenus(this.options.buttonRightConfig) : null; - } - /** - * 根据配置画出来右侧一级工具栏 - */ - - }, { - key: "drawRightMenus", - value: function drawRightMenus(buttonRightConfig) { - var _context2; - - var toolbarRight = createElement('div', 'toolbar-right'); - var fragRight = document.createDocumentFragment(); - var rightOptions = { - options: { - $cherry: this.$cherry, - buttonConfig: buttonRightConfig, - customMenu: [] - } - }; - var rightMenus = new HookCenter$1(rightOptions); - - forEach$3(_context2 = rightMenus.level1MenusName).call(_context2, function (name) { - var btn = rightMenus.hooks[name].createBtn(); - btn.addEventListener('click', function (event) { - console.log('第一次点击'); - rightMenus.hooks[name].fire(event, name); - }, false); - fragRight.appendChild(btn); - }); - - toolbarRight.appendChild(fragRight); - this.options.dom.appendChild(toolbarRight); - } - }, { - key: "setSubMenuPosition", - value: function setSubMenuPosition(menuObj, subMenuObj) { - var pos = menuObj.getMenuPosition(); - subMenuObj.style.left = "".concat(pos.left + pos.width / 2, "px"); - subMenuObj.style.top = "".concat(pos.top + pos.height, "px"); - subMenuObj.style.position = menuObj.positionModel; - } - }, { - key: "drawSubMenus", - value: function drawSubMenus(name) { - var _this3 = this; - - this.subMenus[name] = createElement('div', 'cherry-dropdown', { - name: name - }); - this.setSubMenuPosition(this.menus.hooks[name], this.subMenus[name]); // 如果有配置的二级菜单 - - var level2MenusName = this.isHasLevel2Menu(name); - - if (level2MenusName) { - forEach$3(level2MenusName).call(level2MenusName, function (level2Name) { - var subMenu = _this3.menus.hooks[level2Name]; - - if (subMenu !== undefined && typeof subMenu.createBtn === 'function') { - var btn = subMenu.createBtn(true); // 二级菜单的dom认定为一级菜单的 - - subMenu.dom = subMenu.dom ? subMenu.dom : _this3.menus.hooks[name].dom; - btn.addEventListener('click', function (event) { - return _this3.onClick(event, level2Name, true); - }, false); - - _this3.subMenus[name].appendChild(btn); - } - }); - } // 兼容旧版本配置的二级菜单 - - - var subMenuConfig = this.isHasConfigMenu(name); - - if (subMenuConfig.length > 0) { - forEach$3(subMenuConfig).call(subMenuConfig, function (config) { - var btn = _this3.menus.hooks[name].createSubBtnByConfig(config); - - btn.addEventListener('click', function () { - return _this3.hideAllSubMenu(); - }, false); - - _this3.subMenus[name].appendChild(btn); - }); - } - - this.$cherry.wrapperDom.appendChild(this.subMenus[name]); - } - /** - * 处理点击事件 - */ - - }, { - key: "onClick", - value: function onClick(event, name) { - var focusEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var menu = this.menus.hooks[name]; - - if (!menu) { - return; - } - - if (this.isHasSubMenu(name) && !focusEvent) { - this.toggleSubMenu(name); - } else { - this.hideAllSubMenu(); - menu.fire(event, name); - } - } - /** - * 展开/收起二级菜单 - */ - - }, { - key: "toggleSubMenu", - value: function toggleSubMenu(name) { - if (!this.subMenus[name]) { - // 如果没有二级菜单,则先画出来,然后再显示 - this.hideAllSubMenu(); - this.drawSubMenus(name); - this.subMenus[name].style.display = 'block'; - return; - } - - if (this.subMenus[name].style.display === 'none') { - // 如果是隐藏的,则先隐藏所有二级菜单,再显示当前二级菜单 - this.hideAllSubMenu(); - this.subMenus[name].style.display = 'block'; - this.setSubMenuPosition(this.menus.hooks[name], this.subMenus[name]); - } else { - // 如果是显示的,则隐藏当前二级菜单 - this.subMenus[name].style.display = 'none'; - } - } - /** - * 隐藏所有的二级菜单 - */ - - }, { - key: "hideAllSubMenu", - value: function hideAllSubMenu() { - var _context3; - - forEach$3(_context3 = this.$cherry.wrapperDom.querySelectorAll('.cherry-dropdown')).call(_context3, function (dom) { - dom.style.display = 'none'; - }); - } - /** - * 收集快捷键 - */ - - }, { - key: "collectShortcutKey", - value: function collectShortcutKey() { - var _context4, - _this4 = this; - - forEach$3(_context4 = this.menus.allMenusName).call(_context4, function (name) { - var _this4$menus$hooks$na; - - (_this4$menus$hooks$na = _this4.menus.hooks[name].shortcutKeys) === null || _this4$menus$hooks$na === void 0 ? void 0 : forEach$3(_this4$menus$hooks$na).call(_this4$menus$hooks$na, function (key) { - _this4.shortcutKeyMap[key] = name; - }); - }); - } - }, { - key: "collectToolbarHandler", - value: function collectToolbarHandler() { - var _context5, - _this5 = this; - - this.toolbarHandlers = reduce$3(_context5 = this.menus.allMenusName).call(_context5, function (handlerMap, name) { - var menuHook = _this5.menus.hooks[name]; - - if (!menuHook) { - return handlerMap; - } - - handlerMap[name] = function (shortcut, _callback) { - if (typeof _callback === 'function') { - Logger.warn('MenuBase#onClick param callback is no longer supported. Please register the callback via MenuBase#registerAfterClickCb instead.'); - } - - menuHook.fire.call(menuHook, undefined, shortcut); - }; - - return handlerMap; - }, {}); - } - /** - * 监测是否有对应的快捷键 - * @param {KeyboardEvent} evt keydown 事件 - * @returns {boolean} 是否有对应的快捷键 - */ - - }, { - key: "matchShortcutKey", - value: function matchShortcutKey(evt) { - return !!this.shortcutKeyMap[this.getCurrentKey(evt)]; - } - /** - * 触发对应快捷键的事件 - * @param {KeyboardEvent} evt - */ - - }, { - key: "fireShortcutKey", - value: function fireShortcutKey(evt) { - var _this$menus$hooks$thi; - - var currentKey = this.getCurrentKey(evt); - (_this$menus$hooks$thi = this.menus.hooks[this.shortcutKeyMap[currentKey]]) === null || _this$menus$hooks$thi === void 0 ? void 0 : _this$menus$hooks$thi.fire(evt, currentKey); - } - /** - * 格式化当前按键,mac下的command按键转换为ctrl - * @param {KeyboardEvent} event - * @returns - */ - - }, { - key: "getCurrentKey", - value: function getCurrentKey(event) { - var key = ''; - - if (event.ctrlKey) { - key += 'Ctrl-'; - } - - if (event.altKey) { - key += 'Alt-'; - } - - if (event.metaKey && mac) { - key += 'Ctrl-'; - } // 如果存在shift键 - - - if (event.shiftKey) { - key += "Shift-"; - } // 如果还有第三个键 且不是 shift键 - - - if (event.key && event.key.toLowerCase() !== 'shift') { - key += event.key.toLowerCase(); - } - - return key; - } - }]); - - return Toolbar; - }(); - - function _createSuper$1o(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1o(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1o() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 在编辑区域选中文本时浮现的bubble工具栏 - */ - - var Bubble = /*#__PURE__*/function (_Toolbar) { - _inherits(Bubble, _Toolbar); - - var _super = _createSuper$1o(Bubble); - - function Bubble() { - _classCallCheck(this, Bubble); - - return _super.apply(this, arguments); - } - - _createClass(Bubble, [{ - key: "visible", - get: function get() { - var bubbleStyle = window.getComputedStyle(this.bubbleDom); - return bubbleStyle.display !== 'none' && bubbleStyle.visibility !== 'hidden'; - }, - set: - /** - * @type {'flex' | 'block'} - */ - // constructor(options) { - // super(options); - // } - function set(visible) { - var bubbleStyle = window.getComputedStyle(this.bubbleDom); - - if (visible) { - bubbleStyle.display === 'none' && (this.bubbleDom.style.display = Bubble.displayType); // bubbleStyle.visibility !== 'visible' && (this.bubbleBottom.style.visibility = 'visible'); - } else { - bubbleStyle.display !== 'none' && (this.bubbleDom.style.display = 'none'); // bubbleStyle.visibility !== 'hidden' && (this.bubbleBottom.style.visibility = 'hidden'); - } - } - }, { - key: "init", - value: function init() { - this.options.editor = this.$cherry.editor; - this.addSelectionChangeListener(); - this.bubbleDom = this.options.dom; - this.editorDom = this.options.editor.getEditorDom(); - this.initBubbleDom(); - this.editorDom.querySelector('.CodeMirror').appendChild(this.bubbleDom); - } - /** - * 计算编辑区域的偏移量 - * @returns {number} 编辑区域的滚动区域 - */ - - }, { - key: "getScrollTop", - value: function getScrollTop() { - return this.options.editor.editor.getScrollInfo().top; - } - /** - * 当编辑区域滚动的时候自动隐藏bubble工具栏和子工具栏 - */ - - }, { - key: "updatePositionWhenScroll", - value: function updatePositionWhenScroll() { - if (this.bubbleDom.style.display === Bubble.displayType) { - this.bubbleDom.style.marginTop = "".concat(_parseFloat$2(this.bubbleDom.dataset.scrollTop) - this.getScrollTop(), "px"); - } - } - /** - * 根据高度计算bubble工具栏出现的位置的高度 - * 根据宽度计算bubble工具栏出现的位置的left值,以及bubble工具栏三角箭头的left值 - * @param {number} top 高度 - * @param {number} width 选中文本内容的宽度 - */ - - }, { - key: "showBubble", - value: function showBubble(top, width) { - if (!this.visible) { - this.visible = true; - this.bubbleDom.style.marginTop = '0'; - this.bubbleDom.dataset.scrollTop = String(this.getScrollTop()); - } - - var positionLimit = this.editorDom.querySelector('.CodeMirror-lines').firstChild.getBoundingClientRect(); - var editorPosition = this.editorDom.getBoundingClientRect(); - var minLeft = positionLimit.left - editorPosition.left; - var maxLeft = positionLimit.width + minLeft; - var minTop = this.bubbleDom.offsetHeight * 2; - var $top = top; - - if ($top < minTop) { - // 如果高度小于编辑器的顶部,则让bubble工具栏出现在选中文本的下放 - $top += this.bubbleDom.offsetHeight - this.bubbleTop.getBoundingClientRect().height; - this.bubbleTop.style.display = 'block'; - this.bubbleBottom.style.display = 'none'; - } else { - // 反之出现在选中文本内容的上方 - $top -= this.bubbleDom.offsetHeight + 2 * this.bubbleBottom.getBoundingClientRect().height; - this.bubbleTop.style.display = 'none'; - this.bubbleBottom.style.display = 'block'; - } - - this.bubbleDom.style.top = "".concat($top, "px"); - var left = width - this.bubbleDom.offsetWidth / 2; - - if (left < minLeft) { - // 如果位置超过了编辑器的最左边,则控制bubble工具栏不超出编辑器最左边 - // 同时bubble工具栏上的箭头尽量指向选中文本内容的中间位置 - left = minLeft; - this.$setBubbleCursorPosition("".concat(width - minLeft, "px")); - } else if (left + this.bubbleDom.offsetWidth > maxLeft) { - // 如果位置超过了编辑器的最右边,则控制bubble工具栏不超出编辑器最右边 - // 同时bubble工具栏上的箭头尽量指向选中文本内容的中间位置 - left = maxLeft - this.bubbleDom.offsetWidth; - this.$setBubbleCursorPosition("".concat(width - left, "px")); - } else { - // 让bubble工具栏的箭头处于工具栏的中间位置 - this.$setBubbleCursorPosition('50%'); - } // 安全边距 20px - - - this.bubbleDom.style.left = "".concat(Math.max(20, left), "px"); - } - }, { - key: "hideBubble", - value: function hideBubble() { - this.visible = false; - } - /** - * 控制bubble工具栏的箭头的位置 - * @param {string} left 左偏移量 - */ - - }, { - key: "$setBubbleCursorPosition", - value: function $setBubbleCursorPosition() { - var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '50%'; - - if (left === '50%') { - this.bubbleTop.style.left = '50%'; - this.bubbleBottom.style.left = '50%'; - } else { - var $left = _parseFloat$2(left) < 10 ? '10px' : left; - this.bubbleTop.style.left = $left; - this.bubbleBottom.style.left = $left; - } - } - }, { - key: "initBubbleDom", - value: function initBubbleDom() { - var top = document.createElement('div'); - top.className = 'cherry-bubble-top'; - var bottom = document.createElement('div'); - bottom.className = 'cherry-bubble-bottom'; - this.bubbleTop = top; - this.bubbleBottom = bottom; - this.bubbleDom.appendChild(top); - this.bubbleDom.appendChild(bottom); // 默认不可见 - - this.visible = false; - } - }, { - key: "getBubbleDom", - value: function getBubbleDom() { - return this.bubbleDom; - } - }, { - key: "addSelectionChangeListener", - value: function addSelectionChangeListener() { - var _this = this; - - this.options.editor.addListener('change', function (codemirror) { - // 当编辑区内容变更时自动隐藏bubble工具栏 - _this.hideBubble(); - }); - this.options.editor.addListener('refresh', function (codemirror) { - // 当编辑区内容刷新时自动隐藏bubble工具栏 - _this.hideBubble(); - }); - this.options.editor.addListener('scroll', function (codemirror) { - // 当编辑区滚动时,需要实时同步bubble工具栏的位置 - _this.updatePositionWhenScroll(); - }); - this.options.editor.addListener('beforeSelectionChange', function (codemirror, info) { - // 当编辑区选中内容改变时,需要展示/隐藏bubble工具栏,并计算工具栏位置 - if (info.origin !== '*mouse' && (info.origin !== null || typeof info.origin === 'undefined')) { - return true; - } - - if (!info.ranges[0]) { - return true; - } - - var anchor = info.ranges[0].anchor.line * 1000000 + info.ranges[0].anchor.ch; - var head = info.ranges[0].head.line * 1000000 + info.ranges[0].head.ch; - var direction = 'asc'; - - if (anchor > head) { - direction = 'desc'; - } - - setTimeout$3(function () { - var selections = codemirror.getSelections(); - - if (selections.join('').length <= 0) { - _this.hideBubble(); - - return; - } - - var selectedObjs = codemirror.getWrapperElement().getElementsByClassName('CodeMirror-selected'); - - var editorPosition = _this.editorDom.getBoundingClientRect(); - - var width = 0; - var top = 0; - - if (_typeof(selectedObjs) !== 'object' || selectedObjs.length <= 0) { - _this.hideBubble(); - - return; - } - - for (var key = 0; key < selectedObjs.length; key++) { - var one = selectedObjs[key]; - var position = one.getBoundingClientRect(); - var targetTop = position.top - editorPosition.top; - - if (direction === 'asc') { - if (targetTop >= top) { - top = targetTop; - width = position.left - editorPosition.left + position.width / 2; - } - } else { - if (targetTop <= top || top <= 0) { - top = targetTop; - width = position.left - editorPosition.left + position.width / 2; - } - } - } - - _this.showBubble(top, width); - }, 10); - }); - } - }]); - - return Bubble; - }(Toolbar); - - _defineProperty(Bubble, "displayType", 'flex'); - - function _createSuper$1p(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1p(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1p() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 当光标处于编辑器新行起始位置时出现的浮动工具栏 - */ - - var FloatMenu = /*#__PURE__*/function (_Toolbar) { - _inherits(FloatMenu, _Toolbar); - - var _super = _createSuper$1p(FloatMenu); - - function FloatMenu() { - _classCallCheck(this, FloatMenu); - - return _super.apply(this, arguments); - } - - _createClass(FloatMenu, [{ - key: "init", - value: // constructor(options) { - // super(options); - // } - function init() { - this.editor = this.$cherry.editor; - this.editorDom = this.editor.getEditorDom(); - this.editorDom.querySelector('.CodeMirror-scroll').appendChild(this.options.dom); - this.initAction(); - } - }, { - key: "initAction", - value: function initAction() { - var self = this; - this.editor.addListener('cursorActivity', function (codemirror, evt) { - // 当编辑区光标位置改变时触发 - self.cursorActivity(evt, codemirror); - }); - this.editor.addListener('update', function (codemirror, evt) { - // 当编辑区内容改变时触发 - self.cursorActivity(evt, codemirror); - }); - this.editor.addListener('refresh', function (codemirror, evt) { - // 当编辑器刷新时触发 - setTimeout$3(function () { - self.cursorActivity(evt, codemirror); - }, 0); - }); - } - }, { - key: "update", - value: function update(evt, codeMirror) { - var pos = codeMirror.getCursor(); - - if (this.isHidden(pos.line, codeMirror)) { - this.options.dom.style.display = 'none'; - return false; - } - - this.options.dom.style.display = 'inline-block'; - } - /** - * 当光标激活时触发,当光标处于行起始位置时展示float工具栏;反之隐藏 - * @param {Event} evt - * @param {CodeMirror.Editor} codeMirror - * @returns - */ - - }, { - key: "cursorActivity", - value: function cursorActivity(evt, codeMirror) { - var pos = codeMirror.getCursor(); - var codeMirrorLines = document.querySelector('.cherry-editor .CodeMirror-lines'); - - if (!codeMirrorLines) { - return false; - } - - var computedLinesStyle = getComputedStyle(codeMirrorLines); - - var codeWrapPaddingLeft = _parseFloat$2(computedLinesStyle.paddingLeft); - - var codeWrapPaddingTop = _parseFloat$2(computedLinesStyle.paddingTop); // const cursorHandle = codeMirror.getLineHandle(pos.line); - // const verticalMiddle = cursorHandle.height * 1 / 2; - - - if (this.isHidden(pos.line, codeMirror)) { - this.options.dom.style.display = 'none'; - return false; - } - - this.options.dom.style.display = 'inline-block'; - this.options.dom.style.left = "".concat(codeWrapPaddingLeft, "px"); - this.options.dom.style.top = "".concat(this.getLineHeight(pos.line, codeMirror) + codeWrapPaddingTop, "px"); - } - /** - * 判断是否需要隐藏Float工具栏 - * 有选中内容,或者光标所在行有内容时隐藏float 工具栏 - * @param {number} line - * @param {CodeMirror.Editor} codeMirror - * @returns {boolean} 是否需要隐藏float工具栏,true:需要隐藏 - */ - - }, { - key: "isHidden", - value: function isHidden(line, codeMirror) { - var selections = codeMirror.getSelections(); - - if (selections.length > 1) { - return true; - } - - var selection = codeMirror.getSelection(); - - if (selection.length > 0) { - return true; - } - - if (codeMirror.getLine(line)) { - return true; - } - - return false; - } - /** - * 获取对应行的行高度,用来让float 工具栏在该行保持垂直居中 - * @param {number} line - * @param {CodeMirror.Editor} codeMirror - * @returns - */ - - }, { - key: "getLineHeight", - value: function getLineHeight(line, codeMirror) { - var height = 0; - codeMirror.getDoc().eachLine(0, line, function (line) { - height += line.height; - }); - return height; - } - }]); - - return FloatMenu; - }(Toolbar); - - function _createSuper$1q(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1q(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1q() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** - * 预览区域右侧悬浮的工具栏 - * 推荐放置跟编辑区域完全无关的工具栏 - * 比如复制预览区域内容、修改预览区域主题等 - */ - - var Sidebar = /*#__PURE__*/function (_Toolbar) { - _inherits(Sidebar, _Toolbar); - - var _super = _createSuper$1q(Sidebar); - - function Sidebar() { - _classCallCheck(this, Sidebar); - - return _super.apply(this, arguments); - } - - return _createClass(Sidebar); - }(Toolbar); - - /** - * This library modifies the diff-patch-match library by Neil Fraser - * by removing the patch and match functionality and certain advanced - * options in the diff function. The original license is as follows: - * - * === - * - * Diff Match and Patch - * - * Copyright 2006 Google Inc. - * http://code.google.com/p/google-diff-match-patch/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - /** - * The data structure representing a diff is an array of tuples: - * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] - * which means: delete 'Hello', add 'Goodbye' and keep ' world.' - */ - var DIFF_DELETE = -1; - var DIFF_INSERT = 1; - var DIFF_EQUAL = 0; - - - /** - * Find the differences between two texts. Simplifies the problem by stripping - * any common prefix or suffix off the texts before diffing. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info - * @return {Array} Array of diff tuples. - */ - function diff_main(text1, text2, cursor_pos, _fix_unicode) { - // Check for equality - if (text1 === text2) { - if (text1) { - return [[DIFF_EQUAL, text1]]; - } - return []; - } - - if (cursor_pos != null) { - var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos); - if (editdiff) { - return editdiff; - } - } - - // Trim off common prefix (speedup). - var commonlength = diff_commonPrefix(text1, text2); - var commonprefix = text1.substring(0, commonlength); - text1 = text1.substring(commonlength); - text2 = text2.substring(commonlength); - - // Trim off common suffix (speedup). - commonlength = diff_commonSuffix(text1, text2); - var commonsuffix = text1.substring(text1.length - commonlength); - text1 = text1.substring(0, text1.length - commonlength); - text2 = text2.substring(0, text2.length - commonlength); - - // Compute the diff on the middle block. - var diffs = diff_compute_(text1, text2); - - // Restore the prefix and suffix. - if (commonprefix) { - diffs.unshift([DIFF_EQUAL, commonprefix]); - } - if (commonsuffix) { - diffs.push([DIFF_EQUAL, commonsuffix]); - } - diff_cleanupMerge(diffs, _fix_unicode); - return diffs; - } - - /** - * Find the differences between two texts. Assumes that the texts do not - * have any common prefix or suffix. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - */ - function diff_compute_(text1, text2) { - var diffs; - - if (!text1) { - // Just add some text (speedup). - return [[DIFF_INSERT, text2]]; - } - - if (!text2) { - // Just delete some text (speedup). - return [[DIFF_DELETE, text1]]; - } - - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - var i = longtext.indexOf(shorttext); - if (i !== -1) { - // Shorter text is inside the longer text (speedup). - diffs = [ - [DIFF_INSERT, longtext.substring(0, i)], - [DIFF_EQUAL, shorttext], - [DIFF_INSERT, longtext.substring(i + shorttext.length)] - ]; - // Swap insertions for deletions if diff is reversed. - if (text1.length > text2.length) { - diffs[0][0] = diffs[2][0] = DIFF_DELETE; - } - return diffs; - } - - if (shorttext.length === 1) { - // Single character string. - // After the previous speedup, the character can't be an equality. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - } - - // Check to see if the problem can be split in two. - var hm = diff_halfMatch_(text1, text2); - if (hm) { - // A half-match was found, sort out the return data. - var text1_a = hm[0]; - var text1_b = hm[1]; - var text2_a = hm[2]; - var text2_b = hm[3]; - var mid_common = hm[4]; - // Send both pairs off for separate processing. - var diffs_a = diff_main(text1_a, text2_a); - var diffs_b = diff_main(text1_b, text2_b); - // Merge the results. - return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); - } - - return diff_bisect_(text1, text2); - } - - /** - * Find the 'middle snake' of a diff, split the problem in two - * and return the recursively constructed diff. - * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - * @private - */ - function diff_bisect_(text1, text2) { - // Cache the text lengths to prevent multiple calls. - var text1_length = text1.length; - var text2_length = text2.length; - var max_d = Math.ceil((text1_length + text2_length) / 2); - var v_offset = max_d; - var v_length = 2 * max_d; - var v1 = new Array(v_length); - var v2 = new Array(v_length); - // Setting all elements to -1 is faster in Chrome & Firefox than mixing - // integers and undefined. - for (var x = 0; x < v_length; x++) { - v1[x] = -1; - v2[x] = -1; - } - v1[v_offset + 1] = 0; - v2[v_offset + 1] = 0; - var delta = text1_length - text2_length; - // If the total number of characters is odd, then the front path will collide - // with the reverse path. - var front = (delta % 2 !== 0); - // Offsets for start and end of k loop. - // Prevents mapping of space beyond the grid. - var k1start = 0; - var k1end = 0; - var k2start = 0; - var k2end = 0; - for (var d = 0; d < max_d; d++) { - // Walk the front path one step. - for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { - var k1_offset = v_offset + k1; - var x1; - if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) { - x1 = v1[k1_offset + 1]; - } else { - x1 = v1[k1_offset - 1] + 1; - } - var y1 = x1 - k1; - while ( - x1 < text1_length && y1 < text2_length && - text1.charAt(x1) === text2.charAt(y1) - ) { - x1++; - y1++; - } - v1[k1_offset] = x1; - if (x1 > text1_length) { - // Ran off the right of the graph. - k1end += 2; - } else if (y1 > text2_length) { - // Ran off the bottom of the graph. - k1start += 2; - } else if (front) { - var k2_offset = v_offset + delta - k1; - if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) { - // Mirror x2 onto top-left coordinate system. - var x2 = text1_length - v2[k2_offset]; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - - // Walk the reverse path one step. - for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { - var k2_offset = v_offset + k2; - var x2; - if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) { - x2 = v2[k2_offset + 1]; - } else { - x2 = v2[k2_offset - 1] + 1; - } - var y2 = x2 - k2; - while ( - x2 < text1_length && y2 < text2_length && - text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1) - ) { - x2++; - y2++; - } - v2[k2_offset] = x2; - if (x2 > text1_length) { - // Ran off the left of the graph. - k2end += 2; - } else if (y2 > text2_length) { - // Ran off the top of the graph. - k2start += 2; - } else if (!front) { - var k1_offset = v_offset + delta - k2; - if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) { - var x1 = v1[k1_offset]; - var y1 = v_offset + x1 - k1_offset; - // Mirror x2 onto top-left coordinate system. - x2 = text1_length - x2; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - } - // Diff took too long and hit the deadline or - // number of diffs equals number of characters, no commonality at all. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - } - - /** - * Given the location of the 'middle snake', split the diff in two parts - * and recurse. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} x Index of split point in text1. - * @param {number} y Index of split point in text2. - * @return {Array} Array of diff tuples. - */ - function diff_bisectSplit_(text1, text2, x, y) { - var text1a = text1.substring(0, x); - var text2a = text2.substring(0, y); - var text1b = text1.substring(x); - var text2b = text2.substring(y); - - // Compute both diffs serially. - var diffs = diff_main(text1a, text2a); - var diffsb = diff_main(text1b, text2b); - - return diffs.concat(diffsb); - } - - /** - * Determine the common prefix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the start of each - * string. - */ - function diff_commonPrefix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerstart = 0; - while (pointermin < pointermid) { - if ( - text1.substring(pointerstart, pointermid) == - text2.substring(pointerstart, pointermid) - ) { - pointermin = pointermid; - pointerstart = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - - if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) { - pointermid--; - } - - return pointermid; - } - - /** - * Determine the common suffix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the end of each string. - */ - function diff_commonSuffix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerend = 0; - while (pointermin < pointermid) { - if ( - text1.substring(text1.length - pointermid, text1.length - pointerend) == - text2.substring(text2.length - pointermid, text2.length - pointerend) - ) { - pointermin = pointermid; - pointerend = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - - if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) { - pointermid--; - } - - return pointermid; - } - - /** - * Do the two texts share a substring which is at least half the length of the - * longer text? - * This speedup can produce non-minimal diffs. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {Array.} Five element Array, containing the prefix of - * text1, the suffix of text1, the prefix of text2, the suffix of - * text2 and the common middle. Or null if there was no match. - */ - function diff_halfMatch_(text1, text2) { - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { - return null; // Pointless. - } - - /** - * Does a substring of shorttext exist within longtext such that the substring - * is at least half the length of longtext? - * Closure, but does not reference any external variables. - * @param {string} longtext Longer string. - * @param {string} shorttext Shorter string. - * @param {number} i Start index of quarter length substring within longtext. - * @return {Array.} Five element Array, containing the prefix of - * longtext, the suffix of longtext, the prefix of shorttext, the suffix - * of shorttext and the common middle. Or null if there was no match. - * @private - */ - function diff_halfMatchI_(longtext, shorttext, i) { - // Start with a 1/4 length substring at position i as a seed. - var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); - var j = -1; - var best_common = ''; - var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; - while ((j = shorttext.indexOf(seed, j + 1)) !== -1) { - var prefixLength = diff_commonPrefix( - longtext.substring(i), shorttext.substring(j)); - var suffixLength = diff_commonSuffix( - longtext.substring(0, i), shorttext.substring(0, j)); - if (best_common.length < suffixLength + prefixLength) { - best_common = shorttext.substring( - j - suffixLength, j) + shorttext.substring(j, j + prefixLength); - best_longtext_a = longtext.substring(0, i - suffixLength); - best_longtext_b = longtext.substring(i + prefixLength); - best_shorttext_a = shorttext.substring(0, j - suffixLength); - best_shorttext_b = shorttext.substring(j + prefixLength); - } - } - if (best_common.length * 2 >= longtext.length) { - return [ - best_longtext_a, best_longtext_b, - best_shorttext_a, best_shorttext_b, best_common - ]; - } else { - return null; - } - } - - // First check if the second quarter is the seed for a half-match. - var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); - // Check again based on the third quarter. - var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2)); - var hm; - if (!hm1 && !hm2) { - return null; - } else if (!hm2) { - hm = hm1; - } else if (!hm1) { - hm = hm2; - } else { - // Both matched. Select the longest. - hm = hm1[4].length > hm2[4].length ? hm1 : hm2; - } - - // A half-match was found, sort out the return data. - var text1_a, text1_b, text2_a, text2_b; - if (text1.length > text2.length) { - text1_a = hm[0]; - text1_b = hm[1]; - text2_a = hm[2]; - text2_b = hm[3]; - } else { - text2_a = hm[0]; - text2_b = hm[1]; - text1_a = hm[2]; - text1_b = hm[3]; - } - var mid_common = hm[4]; - return [text1_a, text1_b, text2_a, text2_b, mid_common]; - } - - /** - * Reorder and merge like edit sections. Merge equalities. - * Any edit section can move as long as it doesn't cross an equality. - * @param {Array} diffs Array of diff tuples. - * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff - */ - function diff_cleanupMerge(diffs, fix_unicode) { - diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. - var pointer = 0; - var count_delete = 0; - var count_insert = 0; - var text_delete = ''; - var text_insert = ''; - var commonlength; - while (pointer < diffs.length) { - if (pointer < diffs.length - 1 && !diffs[pointer][1]) { - diffs.splice(pointer, 1); - continue; - } - switch (diffs[pointer][0]) { - case DIFF_INSERT: - - count_insert++; - text_insert += diffs[pointer][1]; - pointer++; - break; - case DIFF_DELETE: - count_delete++; - text_delete += diffs[pointer][1]; - pointer++; - break; - case DIFF_EQUAL: - var previous_equality = pointer - count_insert - count_delete - 1; - if (fix_unicode) { - // prevent splitting of unicode surrogate pairs. when fix_unicode is true, - // we assume that the old and new text in the diff are complete and correct - // unicode-encoded JS strings, but the tuple boundaries may fall between - // surrogate pairs. we fix this by shaving off stray surrogates from the end - // of the previous equality and the beginning of this equality. this may create - // empty equalities or a common prefix or suffix. for example, if AB and AC are - // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and - // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this - // particular case, both equalities go away, we absorb any previous inequalities, - // and we keep scanning for the next equality before rewriting the tuples. - if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) { - var stray = diffs[previous_equality][1].slice(-1); - diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1); - text_delete = stray + text_delete; - text_insert = stray + text_insert; - if (!diffs[previous_equality][1]) { - // emptied out previous equality, so delete it and include previous delete/insert - diffs.splice(previous_equality, 1); - pointer--; - var k = previous_equality - 1; - if (diffs[k] && diffs[k][0] === DIFF_INSERT) { - count_insert++; - text_insert = diffs[k][1] + text_insert; - k--; - } - if (diffs[k] && diffs[k][0] === DIFF_DELETE) { - count_delete++; - text_delete = diffs[k][1] + text_delete; - k--; - } - previous_equality = k; - } - } - if (starts_with_pair_end(diffs[pointer][1])) { - var stray = diffs[pointer][1].charAt(0); - diffs[pointer][1] = diffs[pointer][1].slice(1); - text_delete += stray; - text_insert += stray; - } - } - if (pointer < diffs.length - 1 && !diffs[pointer][1]) { - // for empty equality not at end, wait for next equality - diffs.splice(pointer, 1); - break; - } - if (text_delete.length > 0 || text_insert.length > 0) { - // note that diff_commonPrefix and diff_commonSuffix are unicode-aware - if (text_delete.length > 0 && text_insert.length > 0) { - // Factor out any common prefixes. - commonlength = diff_commonPrefix(text_insert, text_delete); - if (commonlength !== 0) { - if (previous_equality >= 0) { - diffs[previous_equality][1] += text_insert.substring(0, commonlength); - } else { - diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]); - pointer++; - } - text_insert = text_insert.substring(commonlength); - text_delete = text_delete.substring(commonlength); - } - // Factor out any common suffixes. - commonlength = diff_commonSuffix(text_insert, text_delete); - if (commonlength !== 0) { - diffs[pointer][1] = - text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1]; - text_insert = text_insert.substring(0, text_insert.length - commonlength); - text_delete = text_delete.substring(0, text_delete.length - commonlength); - } - } - // Delete the offending records and add the merged ones. - var n = count_insert + count_delete; - if (text_delete.length === 0 && text_insert.length === 0) { - diffs.splice(pointer - n, n); - pointer = pointer - n; - } else if (text_delete.length === 0) { - diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]); - pointer = pointer - n + 1; - } else if (text_insert.length === 0) { - diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]); - pointer = pointer - n + 1; - } else { - diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]); - pointer = pointer - n + 2; - } - } - if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) { - // Merge this equality with the previous one. - diffs[pointer - 1][1] += diffs[pointer][1]; - diffs.splice(pointer, 1); - } else { - pointer++; - } - count_insert = 0; - count_delete = 0; - text_delete = ''; - text_insert = ''; - break; - } - } - if (diffs[diffs.length - 1][1] === '') { - diffs.pop(); // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities - // which can be shifted sideways to eliminate an equality. - // e.g: ABAC -> ABAC - var changes = false; - pointer = 1; - // Intentionally ignore the first and last element (don't need checking). - while (pointer < diffs.length - 1) { - if (diffs[pointer - 1][0] === DIFF_EQUAL && - diffs[pointer + 1][0] === DIFF_EQUAL) { - // This is a single edit surrounded by equalities. - if (diffs[pointer][1].substring(diffs[pointer][1].length - - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) { - // Shift the edit over the previous equality. - diffs[pointer][1] = diffs[pointer - 1][1] + - diffs[pointer][1].substring(0, diffs[pointer][1].length - - diffs[pointer - 1][1].length); - diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; - diffs.splice(pointer - 1, 1); - changes = true; - } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == - diffs[pointer + 1][1]) { - // Shift the edit over the next equality. - diffs[pointer - 1][1] += diffs[pointer + 1][1]; - diffs[pointer][1] = - diffs[pointer][1].substring(diffs[pointer + 1][1].length) + - diffs[pointer + 1][1]; - diffs.splice(pointer + 1, 1); - changes = true; - } - } - pointer++; - } - // If shifts were made, the diff needs reordering and another shift sweep. - if (changes) { - diff_cleanupMerge(diffs, fix_unicode); - } - } - function is_surrogate_pair_start(charCode) { - return charCode >= 0xD800 && charCode <= 0xDBFF; - } - - function is_surrogate_pair_end(charCode) { - return charCode >= 0xDC00 && charCode <= 0xDFFF; - } - - function starts_with_pair_end(str) { - return is_surrogate_pair_end(str.charCodeAt(0)); - } - - function ends_with_pair_start(str) { - return is_surrogate_pair_start(str.charCodeAt(str.length - 1)); - } - - function remove_empty_tuples(tuples) { - var ret = []; - for (var i = 0; i < tuples.length; i++) { - if (tuples[i][1].length > 0) { - ret.push(tuples[i]); - } - } - return ret; - } - - function make_edit_splice(before, oldMiddle, newMiddle, after) { - if (ends_with_pair_start(before) || starts_with_pair_end(after)) { - return null; - } - return remove_empty_tuples([ - [DIFF_EQUAL, before], - [DIFF_DELETE, oldMiddle], - [DIFF_INSERT, newMiddle], - [DIFF_EQUAL, after] - ]); - } - - function find_cursor_edit_diff(oldText, newText, cursor_pos) { - // note: this runs after equality check has ruled out exact equality - var oldRange = typeof cursor_pos === 'number' ? - { index: cursor_pos, length: 0 } : cursor_pos.oldRange; - var newRange = typeof cursor_pos === 'number' ? - null : cursor_pos.newRange; - // take into account the old and new selection to generate the best diff - // possible for a text edit. for example, a text change from "xxx" to "xx" - // could be a delete or forwards-delete of any one of the x's, or the - // result of selecting two of the x's and typing "x". - var oldLength = oldText.length; - var newLength = newText.length; - if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) { - // see if we have an insert or delete before or after cursor - var oldCursor = oldRange.index; - var oldBefore = oldText.slice(0, oldCursor); - var oldAfter = oldText.slice(oldCursor); - var maybeNewCursor = newRange ? newRange.index : null; - editBefore: { - // is this an insert or delete right before oldCursor? - var newCursor = oldCursor + newLength - oldLength; - if (maybeNewCursor !== null && maybeNewCursor !== newCursor) { - break editBefore; - } - if (newCursor < 0 || newCursor > newLength) { - break editBefore; - } - var newBefore = newText.slice(0, newCursor); - var newAfter = newText.slice(newCursor); - if (newAfter !== oldAfter) { - break editBefore; - } - var prefixLength = Math.min(oldCursor, newCursor); - var oldPrefix = oldBefore.slice(0, prefixLength); - var newPrefix = newBefore.slice(0, prefixLength); - if (oldPrefix !== newPrefix) { - break editBefore; - } - var oldMiddle = oldBefore.slice(prefixLength); - var newMiddle = newBefore.slice(prefixLength); - return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter); - } - editAfter: { - // is this an insert or delete right after oldCursor? - if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) { - break editAfter; - } - var cursor = oldCursor; - var newBefore = newText.slice(0, cursor); - var newAfter = newText.slice(cursor); - if (newBefore !== oldBefore) { - break editAfter; - } - var suffixLength = Math.min(oldLength - cursor, newLength - cursor); - var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength); - var newSuffix = newAfter.slice(newAfter.length - suffixLength); - if (oldSuffix !== newSuffix) { - break editAfter; - } - var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength); - var newMiddle = newAfter.slice(0, newAfter.length - suffixLength); - return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix); - } - } - if (oldRange.length > 0 && newRange && newRange.length === 0) { - replaceRange: { - // see if diff could be a splice of the old selection range - var oldPrefix = oldText.slice(0, oldRange.index); - var oldSuffix = oldText.slice(oldRange.index + oldRange.length); - var prefixLength = oldPrefix.length; - var suffixLength = oldSuffix.length; - if (newLength < prefixLength + suffixLength) { - break replaceRange; - } - var newPrefix = newText.slice(0, prefixLength); - var newSuffix = newText.slice(newLength - suffixLength); - if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) { - break replaceRange; - } - var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength); - var newMiddle = newText.slice(prefixLength, newLength - suffixLength); - return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix); - } - } - - return null; - } - - function diff$1(text1, text2, cursor_pos) { - // only pass fix_unicode=true at the top level, not when diff_main is - // recursively invoked - return diff_main(text1, text2, cursor_pos, true); - } - - diff$1.INSERT = DIFF_INSERT; - diff$1.DELETE = DIFF_DELETE; - diff$1.EQUAL = DIFF_EQUAL; - - var diff_1$2 = diff$1; - - /** - * Copyright (C) 2021 THL A29 Limited, a Tencent company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * 更新内容时保持光标不变 - * @param {Number} pos 光标相对文档开头的偏移量 - * @param {String} oldContent 变更前的内容 - * @param {String} newContent 变更后的内容 - * @returns {Number} newPos 新的光标偏移量 - */ - - function getPosBydiffs(pos, oldContent, newContent) { - var diffs = diff_1$2(oldContent, newContent); - var newPos = pos; - var tmpPos = pos; - - for (var i = 0; i < diffs.length; i++) { - var val = diffs[i]; - - if (tmpPos <= 0) { - return newPos; - } - - var opType = val[0]; - var opLength = val[1].length; - - switch (opType) { - // 没有改变的内容 - case diff_1$2.EQUAL: - if (tmpPos <= opLength) { - return newPos; - } - - tmpPos -= opLength; - break; - // 删除的内容 - - case diff_1$2.DELETE: - if (tmpPos <= opLength) { - return newPos - opLength + tmpPos; - } - - tmpPos -= opLength; - newPos -= opLength; - break; - // 新增的内容 - - case diff_1$2.INSERT: - newPos += opLength; - break; - } - } - - return newPos; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - var _arrayEach = arrayEach; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = _overArg(Object.keys, Object); - - var _nativeKeys = nativeKeys; - - /** Used for built-in method references. */ - var objectProto$b = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty$a = objectProto$b.hasOwnProperty; - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!_isPrototype(object)) { - return _nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty$a.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - var _baseKeys = baseKeys; - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys$8(object) { - return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object); - } - - var keys_1 = keys$8; - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && _copyObject(source, keys_1(source), object); - } - - var _baseAssign = baseAssign; - - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && _copyObject(source, keysIn_1(source), object); - } - - var _baseAssignIn = baseAssignIn; - - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } - - var _arrayFilter = arrayFilter; - - /** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ - function stubArray() { - return []; - } - - var stubArray_1 = stubArray; - - /** Used for built-in method references. */ - var objectProto$c = Object.prototype; - - /** Built-in value references. */ - var propertyIsEnumerable$2 = objectProto$c.propertyIsEnumerable; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetSymbols = Object.getOwnPropertySymbols; - - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return _arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable$2.call(object, symbol); - }); - }; - - var _getSymbols = getSymbols; - - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return _copyObject(source, _getSymbols(source), object); - } - - var _copySymbols = copySymbols; - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - var _arrayPush = arrayPush; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetSymbols$1 = Object.getOwnPropertySymbols; - - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols$1 ? stubArray_1 : function(object) { - var result = []; - while (object) { - _arrayPush(result, _getSymbols(object)); - object = _getPrototype(object); - } - return result; - }; - - var _getSymbolsIn = getSymbolsIn; - - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return _copyObject(source, _getSymbolsIn(source), object); - } - - var _copySymbolsIn = copySymbolsIn; - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object)); - } - - var _baseGetAllKeys = baseGetAllKeys; - - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return _baseGetAllKeys(object, keys_1, _getSymbols); - } - - var _getAllKeys = getAllKeys; - - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn); - } - - var _getAllKeysIn = getAllKeysIn; - - /* Built-in method references that are verified to be native. */ - var DataView$1 = _getNative(_root, 'DataView'); - - var _DataView = DataView$1; - - /* Built-in method references that are verified to be native. */ - var Promise$2 = _getNative(_root, 'Promise'); - - var _Promise = Promise$2; - - /* Built-in method references that are verified to be native. */ - var Set$1 = _getNative(_root, 'Set'); - - var _Set = Set$1; - - /* Built-in method references that are verified to be native. */ - var WeakMap$2 = _getNative(_root, 'WeakMap'); - - var _WeakMap = WeakMap$2; - - /** `Object#toString` result references. */ - var mapTag$1 = '[object Map]', - objectTag$2 = '[object Object]', - promiseTag = '[object Promise]', - setTag$1 = '[object Set]', - weakMapTag$1 = '[object WeakMap]'; - - var dataViewTag$1 = '[object DataView]'; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = _toSource(_DataView), - mapCtorString = _toSource(_Map), - promiseCtorString = _toSource(_Promise), - setCtorString = _toSource(_Set), - weakMapCtorString = _toSource(_WeakMap); - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = _baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$1) || - (_Map && getTag(new _Map) != mapTag$1) || - (_Promise && getTag(_Promise.resolve()) != promiseTag) || - (_Set && getTag(new _Set) != setTag$1) || - (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) { - getTag = function(value) { - var result = _baseGetTag(value), - Ctor = result == objectTag$2 ? value.constructor : undefined, - ctorString = Ctor ? _toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag$1; - case mapCtorString: return mapTag$1; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag$1; - case weakMapCtorString: return weakMapTag$1; - } - } - return result; - }; - } - - var _getTag = getTag; - - /** Used for built-in method references. */ - var objectProto$d = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty$b = objectProto$d.hasOwnProperty; - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty$b.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - var _initCloneArray = initCloneArray; - - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - var _cloneDataView = cloneDataView; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - var _cloneRegExp = cloneRegExp; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined, - symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined; - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - var _cloneSymbol = cloneSymbol; - - /** `Object#toString` result references. */ - var boolTag$1 = '[object Boolean]', - dateTag$1 = '[object Date]', - mapTag$2 = '[object Map]', - numberTag$1 = '[object Number]', - regexpTag$1 = '[object RegExp]', - setTag$2 = '[object Set]', - stringTag$1 = '[object String]', - symbolTag$1 = '[object Symbol]'; - - var arrayBufferTag$1 = '[object ArrayBuffer]', - dataViewTag$2 = '[object DataView]', - float32Tag$1 = '[object Float32Array]', - float64Tag$1 = '[object Float64Array]', - int8Tag$1 = '[object Int8Array]', - int16Tag$1 = '[object Int16Array]', - int32Tag$1 = '[object Int32Array]', - uint8Tag$1 = '[object Uint8Array]', - uint8ClampedTag$1 = '[object Uint8ClampedArray]', - uint16Tag$1 = '[object Uint16Array]', - uint32Tag$1 = '[object Uint32Array]'; - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag$1: - return _cloneArrayBuffer(object); - - case boolTag$1: - case dateTag$1: - return new Ctor(+object); - - case dataViewTag$2: - return _cloneDataView(object, isDeep); - - case float32Tag$1: case float64Tag$1: - case int8Tag$1: case int16Tag$1: case int32Tag$1: - case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1: - return _cloneTypedArray(object, isDeep); - - case mapTag$2: - return new Ctor; - - case numberTag$1: - case stringTag$1: - return new Ctor(object); - - case regexpTag$1: - return _cloneRegExp(object); - - case setTag$2: - return new Ctor; - - case symbolTag$1: - return _cloneSymbol(object); - } - } - - var _initCloneByTag = initCloneByTag; - - /** `Object#toString` result references. */ - var mapTag$3 = '[object Map]'; - - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike_1(value) && _getTag(value) == mapTag$3; - } - - var _baseIsMap = baseIsMap; - - /* Node.js helper references. */ - var nodeIsMap = _nodeUtil && _nodeUtil.isMap; - - /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ - var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap; - - var isMap_1 = isMap; - - /** `Object#toString` result references. */ - var setTag$3 = '[object Set]'; - - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike_1(value) && _getTag(value) == setTag$3; - } - - var _baseIsSet = baseIsSet; - - /* Node.js helper references. */ - var nodeIsSet = _nodeUtil && _nodeUtil.isSet; - - /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ - var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet; - - var isSet_1 = isSet; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - - /** `Object#toString` result references. */ - var argsTag$2 = '[object Arguments]', - arrayTag$1 = '[object Array]', - boolTag$2 = '[object Boolean]', - dateTag$2 = '[object Date]', - errorTag$1 = '[object Error]', - funcTag$2 = '[object Function]', - genTag$1 = '[object GeneratorFunction]', - mapTag$4 = '[object Map]', - numberTag$2 = '[object Number]', - objectTag$3 = '[object Object]', - regexpTag$2 = '[object RegExp]', - setTag$4 = '[object Set]', - stringTag$2 = '[object String]', - symbolTag$2 = '[object Symbol]', - weakMapTag$2 = '[object WeakMap]'; - - var arrayBufferTag$2 = '[object ArrayBuffer]', - dataViewTag$3 = '[object DataView]', - float32Tag$2 = '[object Float32Array]', - float64Tag$2 = '[object Float64Array]', - int8Tag$2 = '[object Int8Array]', - int16Tag$2 = '[object Int16Array]', - int32Tag$2 = '[object Int32Array]', - uint8Tag$2 = '[object Uint8Array]', - uint8ClampedTag$2 = '[object Uint8ClampedArray]', - uint16Tag$2 = '[object Uint16Array]', - uint32Tag$2 = '[object Uint32Array]'; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag$2] = cloneableTags[arrayTag$1] = - cloneableTags[arrayBufferTag$2] = cloneableTags[dataViewTag$3] = - cloneableTags[boolTag$2] = cloneableTags[dateTag$2] = - cloneableTags[float32Tag$2] = cloneableTags[float64Tag$2] = - cloneableTags[int8Tag$2] = cloneableTags[int16Tag$2] = - cloneableTags[int32Tag$2] = cloneableTags[mapTag$4] = - cloneableTags[numberTag$2] = cloneableTags[objectTag$3] = - cloneableTags[regexpTag$2] = cloneableTags[setTag$4] = - cloneableTags[stringTag$2] = cloneableTags[symbolTag$2] = - cloneableTags[uint8Tag$2] = cloneableTags[uint8ClampedTag$2] = - cloneableTags[uint16Tag$2] = cloneableTags[uint32Tag$2] = true; - cloneableTags[errorTag$1] = cloneableTags[funcTag$2] = - cloneableTags[weakMapTag$2] = false; - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject_1(value)) { - return value; - } - var isArr = isArray_1(value); - if (isArr) { - result = _initCloneArray(value); - if (!isDeep) { - return _copyArray(value, result); - } - } else { - var tag = _getTag(value), - isFunc = tag == funcTag$2 || tag == genTag$1; - - if (isBuffer_1(value)) { - return _cloneBuffer(value, isDeep); - } - if (tag == objectTag$3 || tag == argsTag$2 || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : _initCloneObject(value); - if (!isDeep) { - return isFlat - ? _copySymbolsIn(value, _baseAssignIn(result, value)) - : _copySymbols(value, _baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = _initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new _Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet_1(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap_1(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? _getAllKeysIn : _getAllKeys) - : (isFlat ? keysIn_1 : keys_1); - - var props = isArr ? undefined : keysFunc(value); - _arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } - - var _baseClone = baseClone; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG$1 = 1, - CLONE_SYMBOLS_FLAG$1 = 4; - - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return _baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1); - } - - var cloneDeep_1 = cloneDeep; - - /** - * Copyright (C) 2021 THL A29 Limited, a Tencent company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - var callbacks = { - /** - * 全局的URL处理器 - * @param {string} url 来源url - * @param {'image'|'audio'|'video'|'autolink'|'link'} srcType 来源类型 - * @returns - */ - urlProcessor: function urlProcessor(url, srcType) { - return url; - }, - fileUpload: function fileUpload(file, callback) { - if (/video/i.test(file.type)) { - callback('images/demo-dog.png', { - name: "".concat(file.name.replace(/\.[^.]+$/, '')), - poster: 'images/demo-dog.png?poster=true', - isBorder: true, - isShadow: true, - isRadius: true - }); - } else { - callback('images/demo-dog.png', { - name: "".concat(file.name.replace(/\.[^.]+$/, '')), - isShadow: true - }); - } - }, - afterChange: function afterChange(text, html) {}, - afterInit: function afterInit(text, html) {}, - beforeImageMounted: function beforeImageMounted(srcProp, src) { - return { - srcProp: srcProp, - src: src - }; - }, - onClickPreview: function onClickPreview(event) {}, - onCopyCode: function onCopyCode(event, code) { - // 阻止默认的粘贴事件 - // return false; - // 对复制内容进行额外处理 - return code; - }, - // 获取中文的拼音 - changeString2Pinyin: function changeString2Pinyin(string) { - /** - * 推荐使用这个组件:https://github.com/liu11hao11/pinyin_js - * - * 可以在 ../scripts/pinyin/pinyin_dist.js 里直接引用 - */ - return string; - } - }; - /** @type {Partial} */ - - var defaultConfig = { - // 第三方包 - externals: {// externals - }, - // chatGpt的openai配置 - openai: { - apiKey: '', - // apiKey - // proxy: { - // host: '127.0.0.1', - // port: '7890', - // }, // http & https代理配置 - ignoreError: false // 是否忽略请求失败,默认忽略 - - }, - // 解析引擎配置 - engine: { - // 全局配置 - global: { - // 是否启用经典换行逻辑 - // true:一个换行会被忽略,两个以上连续换行会分割成段落, - // false: 一个换行会转成
,两个连续换行会分割成段落,三个以上连续换行会转成
并分割段落 - classicBr: false, - - /** - * 全局的URL处理器 - * @param {string} url 来源url - * @param {'image'|'audio'|'video'|'autolink'|'link'} srcType 来源类型 - * @returns - */ - urlProcessor: callbacks.urlProcessor, - - /** - * 额外允许渲染的html标签 - * 标签以英文竖线分隔,如:htmlWhiteList: 'iframe|script|style' - * 默认为空,默认允许渲染的html见src/utils/sanitize.js whiteList 属性 - * 需要注意: - * - 启用iframe、script等标签后,会产生xss注入,请根据实际场景判断是否需要启用 - * - 一般编辑权限可控的场景(如api文档系统)可以允许iframe、script等标签 - */ - htmlWhiteList: '' - }, - // 内置语法配置 - syntax: { - // 语法开关 - // 'hookName': false, - // 语法配置 - // 'hookName': { - // - // } - link: { - /** 生成的标签追加target属性的默认值 空:在标签里不会追加target属性, _blank:在标签里追加target="_blank"属性 */ - target: '', - - /** 生成的标签追加rel属性的默认值 空:在标签里不会追加rel属性, nofollow:在标签里追加rel="nofollow:在"属性*/ - rel: '' - }, - autoLink: { - /** 生成的标签追加target属性的默认值 空:在标签里不会追加target属性, _blank:在标签里追加target="_blank"属性 */ - target: '', - - /** 生成的标签追加rel属性的默认值 空:在标签里不会追加rel属性, nofollow:在标签里追加rel="nofollow:在"属性*/ - rel: '', - - /** 是否开启短链接 */ - enableShortLink: true, - - /** 短链接长度 */ - shortLinkLength: 20 - }, - list: { - listNested: false, - // 同级列表类型转换后变为子级 - indentSpace: 2 // 默认2个空格缩进 - - }, - table: { - enableChart: false // chartRenderEngine: EChartsTableEngine, - // externals: ['echarts'], - - }, - inlineCode: { - theme: 'red' - }, - codeBlock: { - theme: 'dark', - // 默认为深色主题 - wrap: true, - // 超出长度是否换行,false则显示滚动条 - lineNumber: true, - // 默认显示行号 - copyCode: true, - // 是否显示“复制”按钮 - customRenderer: {// 自定义语法渲染器 - }, - mermaid: { - svg2img: false // 是否将mermaid生成的画图变成img格式 - - }, - - /** - * indentedCodeBlock是缩进代码块是否启用的开关 - * - * 在6.X之前的版本中默认不支持该语法。 - * 因为cherry的开发团队认为该语法太丑了(容易误触) - * 开发团队希望用```代码块语法来彻底取代该语法 - * 但在后续的沟通中,开发团队发现在某些场景下该语法有更好的显示效果 - * 因此开发团队在6.X版本中才引入了该语法 - * 已经引用6.x以下版本的业务如果想做到用户无感知升级,可以去掉该语法: - * indentedCodeBlock:false - */ - indentedCodeBlock: true - }, - emoji: { - useUnicode: true // 是否使用unicode进行渲染 - - }, - fontEmphasis: { - /** - * 是否允许首尾空格 - * 首尾、前后的定义: 语法前**语法首+内容+语法尾**语法后 - * 例: - * true: - * __ hello __ ====> hello - * __hello__ ====> hello - * false: - * __ hello __ ====> _ hello _ - * __hello__ ====> hello - */ - allowWhitespace: false - }, - strikethrough: { - /** - * 是否必须有前后空格 - * 首尾、前后的定义: 语法前**语法首+内容+语法尾**语法后 - * 例: - * true: - * hello wor~~l~~d ====> hello wor~~l~~d - * hello wor ~~l~~ d ====> hello wor l d - * false: - * hello wor~~l~~d ====> hello world - * hello wor ~~l~~ d ====> hello wor l d - */ - needWhitespace: false - }, - mathBlock: { - engine: 'MathJax', - // katex或MathJax - src: '', - plugins: true // 默认加载插件 - - }, - inlineMath: { - engine: 'MathJax', - // katex或MathJax - src: '' - }, - toc: { - /** 默认只渲染一个目录 */ - allowMultiToc: false - }, - header: { - /** - * 标题的样式: - * - default 默认样式,标题前面有锚点 - * - autonumber 标题前面有自增序号锚点 - * - none 标题没有锚点 - */ - anchorStyle: 'default' - } - } - }, - editor: { - id: 'code', - // textarea 的id属性值 - name: 'code', - // textarea 的name属性值 - autoSave2Textarea: false, - // 是否自动将编辑区的内容回写到textarea里 - theme: 'default', - // depend on codemirror theme name: https://codemirror.net/demo/theme.htm - // 编辑器的高度,默认100%,如果挂载点存在内联设置的height则以内联样式为主 - height: '100%', - // defaultModel 编辑器初始化后的默认模式,一共有三种模式:1、双栏编辑预览模式;2、纯编辑模式;3、预览模式 - // edit&preview: 双栏编辑预览模式 - // editOnly: 纯编辑模式(没有预览,可通过toolbar切换成双栏或预览模式) - // previewOnly: 预览模式(没有编辑框,toolbar只显示“返回编辑”按钮,可通过toolbar切换成编辑模式) - defaultModel: 'edit&preview', - // 粘贴时是否自动将html转成markdown - convertWhenPaste: true, - codemirror: { - // 是否自动focus 默认为true - autofocus: true - }, - writingStyle: 'normal' // 书写风格,normal 普通 | typewriter 打字机 | focus 专注,默认normal - - }, - toolbars: { - theme: 'dark', - // light or dark - showToolbar: true, - // false:不展示顶部工具栏; true:展示工具栏; toolbars.showToolbar=false 与 toolbars.toolbar=false 等效 - toolbar: ['bold', 'italic', 'strikethrough', '|', 'color', 'header', 'ruby', '|', 'list', 'panel', // 'justify', // 对齐方式,默认不推荐这么“复杂”的样式要求 - 'detail', { - insert: ['image', 'audio', 'video', 'link', 'hr', 'br', 'code', 'formula', 'toc', 'table', 'line-table', 'bar-table', 'pdf', 'word'] - }, 'graph', 'settings'], - toolbarRight: [], - sidebar: [], - bubble: ['bold', 'italic', 'underline', 'strikethrough', 'sub', 'sup', 'quote', '|', 'size', 'color'], - // array or false - "float": ['h1', 'h2', 'h3', '|', 'checklist', 'quote', 'table', 'code'] // array or false - - }, - // 打开draw.io编辑页的url,如果为空则drawio按钮失效 - drawioIframeUrl: '', - // 上传文件的回调 - fileUpload: callbacks.fileUpload, - - /** - * 上传文件的时候用来指定文件类型 - */ - fileTypeLimitMap: { - video: 'video/*', - audio: 'audio/*', - image: 'image/*', - word: '.doc,.docx', - pdf: '.pdf', - file: '*' - }, - callback: { - afterChange: callbacks.afterChange, - afterInit: callbacks.afterInit, - beforeImageMounted: callbacks.beforeImageMounted, - // 预览区域点击事件,previewer.enablePreviewerBubble = true 时生效 - onClickPreview: callbacks.onClickPreview, - // 复制代码块代码时的回调 - onCopyCode: callbacks.onCopyCode, - // 把中文变成拼音的回调,当然也可以把中文变成英文、英文变成中文 - changeString2Pinyin: callbacks.changeString2Pinyin - }, - previewer: { - dom: false, - className: 'cherry-markdown', - // 是否启用预览区域编辑能力(目前支持编辑图片尺寸、编辑表格内容) - enablePreviewerBubble: true, - - /** - * 配置图片懒加载的逻辑 - * - 如果不希望图片懒加载,可配置成 lazyLoadImg = {noLoadImgNum: -1} - * - 如果希望所有图片都无脑懒加载,可配置成 lazyLoadImg = {noLoadImgNum: 0, autoLoadImgNum: -1} - * - 如果一共有15张图片,希望: - * 1、前5张图片(1~5)直接加载; - * 2、后5张图片(6~10)不论在不在视区内,都无脑懒加载; - * 3、其他图片(11~15)在视区内时,进行懒加载; - * 则配置应该为:lazyLoadImg = {noLoadImgNum: 5, autoLoadImgNum: 5} - */ - lazyLoadImg: { - // 加载图片时如果需要展示loading图,则配置loading图的地址 - loadingImgPath: '', - // 同一时间最多有几个图片请求,最大同时加载6张图片 - maxNumPerTime: 2, - // 不进行懒加载处理的图片数量,如果为0,即所有图片都进行懒加载处理, 如果设置为-1,则所有图片都不进行懒加载处理 - noLoadImgNum: 5, - // 首次自动加载几张图片(不论图片是否滚动到视野内),autoLoadImgNum = -1 表示会自动加载完所有图片 - autoLoadImgNum: 5, - // 针对加载失败的图片 或 beforeLoadOneImgCallback 返回false 的图片,最多尝试加载几次,为了防止死循环,最多5次。以图片的src为纬度统计重试次数 - maxTryTimesPerSrc: 2, - // 加载一张图片之前的回调函数,函数return false 会终止加载操作 - beforeLoadOneImgCallback: function beforeLoadOneImgCallback(img) { - return true; - }, - // 加载一张图片失败之后的回调函数 - failLoadOneImgCallback: function failLoadOneImgCallback(img) {}, - // 加载一张图片之后的回调函数,如果图片加载失败,则不会回调该函数 - afterLoadOneImgCallback: function afterLoadOneImgCallback(img) {}, - // 加载完所有图片后调用的回调函数 - afterLoadAllImgCallback: function afterLoadAllImgCallback() {} - } - }, - - /** - * 配置主题,第三方可以自行扩展主题 - */ - theme: [{ - className: 'default', - label: '默认' - }, { - className: 'dark', - label: '暗黑' - }, { - className: 'light', - label: '明亮' - }, { - className: 'green', - label: '清新' - }, { - className: 'red', - label: '热情' - }, { - className: 'violet', - label: '淡雅' - }, { - className: 'blue', - label: '清幽' - }], - // 预览页面不需要绑定事件 - isPreviewOnly: false, - // 预览区域跟随编辑器光标自动滚动 - autoScrollByCursor: true, - // 外层容器不存在时,是否强制输出到body上 - forceAppend: true, - // The locale Cherry is going to use. Locales live in /src/locales/ - locale: 'zh_CN' - }; - var defaultConfig$1 = cloneDeep_1(defaultConfig); - - /** - * Copyright (C) 2021 THL A29 Limited, a Tencent company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - var zhCn = { - bold: '加粗', - // 加粗 - code: '代码', - // 代码 - graph: '画图', - // 画图 - h1: '一级标题', - // 一级标题 - h2: '二级标题', - // 二级标题 - h3: '三级标题', - // 三级标题 - h4: '四级标题', - // 四级标题 - h5: '五级标题', - // 五级标题 - header: '标题', - // 标题 - insert: '插入', - // 插入 - italic: '斜体', - // 斜体 - list: '列表', - // 列表 - quickTable: '表格', - // 表格 - quote: '引用', - // 引用 - size: '大小', - // 大小 - color: '文字颜色&背景', - // 文字颜色&背景 - strikethrough: '删除线', - // 删除线 - sub: '下标', - // 下标 - sup: '上标', - // 上标 - togglePreview: '预览', - // 预览 - fullScreen: '全屏', - // 全屏 - image: '图片', - // 图片 - audio: '音频', - // 音频 - video: '视频', - // 视频 - link: '超链接', - // 超链接 - hr: '分隔线', - // 分隔线 - br: '换行', - // 换行 - toc: '目录', - // 目录 - pdf: 'pdf', - // pdf - word: 'word', - // word - table: '表格', - // 表格 - 'line-table': '折线表格', - // 折线表格 - 'bar-table': '柱状表格', - // 柱状表格 - formula: '公式', - // 公式 - insertFormula: '公式', - // 公式 - insertFlow: '流程图', - // 流程图 - insertSeq: '时序图', - // 时序图 - insertState: '状态图', - // 状态图 - insertClass: '类图', - // 类图 - insertPie: '饼图', - // 饼图 - insertGantt: '甘特图', - // 甘特图 - checklist: '清单', - // 清单 - ol: '有序列表', - // 有序列表 - ul: '无序列表', - // 无序列表 - undo: '撤销', - // 撤销 - redo: '恢复', - // 恢复 - previewClose: '关闭预览', - // 关闭预览 - codeTheme: '代码主题', - // 代码主题 - switchModel: '模式切换', - // 模式切换 - switchPreview: '预览', - // 预览 - switchEdit: '返回编辑', - // 返回编辑 - classicBr: '经典换行', - // 经典换行 - normalBr: '常规换行', - // 常规换行 - settings: '设置', - // 设置 - mobilePreview: '移动端预览', - // 移动端预览 - copy: '复制内容', - // 复制内容 - "export": '导出', - // 导出PDF、长图 - underline: '下划线', - // 下划线 - pinyin: '拼音', - // 拼音 - file: '文件', - pastePlain: '粘贴为纯文本格式', - // 粘贴为纯文本格式 - pasteMarkdown: '粘贴为markdown格式', - // 粘贴为markdown格式 - hide: '隐藏(ctrl+0)', - // 隐藏(ctrl+0) - exportToPdf: '导出PDF', - // 导出PDF - exportScreenshot: '导出长图', - // 导出长图 - exportMarkdownFile: '导出markdown', - // 导出markdown文件 - exportHTMLFile: '导出html', - // 导出预览区html文件 - theme: '主题', - // 导出长图 - panel: '面板', - // 导出长图 - detail: '手风琴', - // 手风琴 - 'H1 Heading': 'H1 一级标题', - 'H2 Heading': 'H2 二级标题', - 'H3 Heading': 'H3 三级标题', - complement: '续写', - summary: '总结' - }; - - /** - * Copyright (C) 2021 THL A29 Limited, a Tencent company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - var enUs = { - bold: 'Bold', - code: 'Code', - graph: 'Graph', - h1: 'Heading 1', - h2: 'Heading 2', - h3: 'Heading 3', - h4: 'Heading 4', - h5: 'Heading 5', - header: 'Header', - insert: 'Insert', - italic: 'Italic', - list: 'List', - quickTable: 'Quick Table', - quote: 'Quote', - size: 'Size', - color: 'Text Color & Background', - strikethrough: 'Strikethrough', - sub: 'Sub', - sup: 'Sup', - togglePreview: 'Toggle Preview', - fullScreen: 'Full Screen', - image: 'Image', - audio: 'Audio', - video: 'Video', - link: 'Link', - hr: 'Horizontal Rule', - br: 'New Line', - toc: 'Table Of Content', - pdf: 'PDF', - word: 'Word', - table: 'Table', - 'line-table': 'Line Table', - 'bar-table': 'Bar Table', - formula: 'Formula', - insertFormula: 'Insert Formula', - insertFlow: 'Insert Flow', - insertSeq: 'Insert Seq', - insertState: 'Insert State', - insertClass: 'Insert Class', - insertPie: 'Insert Pie', - insertGantt: 'Insert Gantt', - checklist: 'Checklist', - ol: 'Ordered List', - ul: 'Unordered List', - undo: 'Undo', - redo: 'Redo', - previewClose: 'Preview Close', - codeTheme: 'Code Theme', - switchModel: 'Switch Model', - switchPreview: 'Switch Preview', - switchEdit: 'Switch Edit', - classicBr: 'Classic New Line', - normalBr: 'Normal New Line', - settings: 'Settings', - mobilePreview: 'Mobile Preview', - copy: 'Copy', - "export": 'Export', - underline: 'Underline', - pinyin: 'Pinyin', - pastePlain: 'Paste as Plain Text', - pasteMarkdown: 'Paste as Markdown', - hide: 'Hide (ctrl+0)', - exportToPdf: 'Export to PDF', - exportScreenshot: 'Screenshot', - exportMarkdownFile: 'Export Markdown File', - exportHTMLFile: 'Export preview HTML File', - 'H1 Heading': 'H1 Heading', - 'H2 Heading': 'H1 Heading', - 'H3 Heading': 'H1 Heading', - complement: 'Complement', - summary: 'Summary' - }; - - /** - * Copyright (C) 2021 THL A29 Limited, a Tencent company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - var locales = { - zh_CN: zhCn, - en_US: enUs - }; - - function _createSuper$1r(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1r(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1r() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - - function filterOptions(options, whiteList, propTypes) { - var _context; - - var filteredOptions = {}; - - forEach$3(_context = keys$3(options)).call(_context, function (key) { - if (indexOf$8(whiteList).call(whiteList, key) === -1) { - return; - } - - if (_typeof(propTypes) === 'object') { - if (typeof propTypes[key] === 'string') { - if (_typeof(options[key]) === propTypes[key]) { - filteredOptions[key] = options[key]; - } - } else { - if (options[key] instanceof propTypes[key]) { - filteredOptions[key] = options[key]; - } - } - } else if (typeof propTypes === 'string') { - if (_typeof(options[key]) === propTypes) { - filteredOptions[key] = options[key]; - } - } - }); - - return filteredOptions; - } - - function createSyntaxHook(name, type, options) { - var _class; - - var BaseClass = type === HOOKS_TYPE_LIST.PAR ? ParagraphBase : SyntaxBase; - var optionsWhiteList = ['beforeMakeHtml', 'makeHtml', 'afterMakeHtml', 'rule', 'test']; - var filteredOptions = filterOptions(options, optionsWhiteList, 'function'); - var paragraphConfig = { - needCache: options.needCache, - defaultCache: options.defaultCache - }; - return _class = /*#__PURE__*/function (_BaseClass) { - _inherits(CustomSyntax, _BaseClass); - - var _super = _createSuper$1r(CustomSyntax); - - function CustomSyntax() { - var _this; - - var editorConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, CustomSyntax); - - if (type === HOOKS_TYPE_LIST.PAR) { - _this = _super.call(this, { - needCache: !!paragraphConfig.needCache, - defaultCache: paragraphConfig.defaultCache - }); - } else { - _this = _super.call(this); - } - - _this.config = editorConfig.config; - return _possibleConstructorReturn(_this); - } - - _createClass(CustomSyntax, [{ - key: "beforeMakeHtml", - value: function beforeMakeHtml() { - var _get2, _context2; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (filteredOptions.beforeMakeHtml) { - return filteredOptions.beforeMakeHtml.apply(this, args); - } - - return (_get2 = _get(_getPrototypeOf(CustomSyntax.prototype), "beforeMakeHtml", this)).call.apply(_get2, concat$5(_context2 = [this]).call(_context2, args)); - } - }, { - key: "makeHtml", - value: function makeHtml() { - var _get3, _context3; - - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (filteredOptions.makeHtml) { - return filteredOptions.makeHtml.apply(this, args); - } - - return (_get3 = _get(_getPrototypeOf(CustomSyntax.prototype), "makeHtml", this)).call.apply(_get3, concat$5(_context3 = [this]).call(_context3, args)); - } - }, { - key: "afterMakeHtml", - value: function afterMakeHtml() { - var _get4, _context4; - - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - if (filteredOptions.afterMakeHtml) { - return filteredOptions.afterMakeHtml.apply(this, args); - } - - return (_get4 = _get(_getPrototypeOf(CustomSyntax.prototype), "afterMakeHtml", this)).call.apply(_get4, concat$5(_context4 = [this]).call(_context4, args)); - } - }, { - key: "test", - value: function test() { - var _get5, _context5; - - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - if (filteredOptions.test) { - return filteredOptions.test.apply(this, args); - } - - return (_get5 = _get(_getPrototypeOf(CustomSyntax.prototype), "test", this)).call.apply(_get5, concat$5(_context5 = [this]).call(_context5, args)); - } - }, { - key: "rule", - value: function rule() { - var _get6, _context6; - - for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - - if (filteredOptions.rule) { - return filteredOptions.rule.apply(this, args); - } - - return (_get6 = _get(_getPrototypeOf(CustomSyntax.prototype), "rule", this)).call.apply(_get6, concat$5(_context6 = [this]).call(_context6, args)); - } - }]); - - return CustomSyntax; - }(BaseClass), _defineProperty(_class, "HOOK_NAME", name), _class; - } - function createMenuHook(name, options) { - var optionsWhiteList = ['subMenuConfig', 'onClick', 'shortcutKeys', 'iconName']; - var propTypes = { - subMenuConfig: Array, - onClick: 'function', - shortcutKeys: Array, - iconName: 'string' - }; - var filteredOptions = filterOptions(options, optionsWhiteList, propTypes); - return /*#__PURE__*/function (_MenuBase) { - _inherits(CustomMenu, _MenuBase); - - var _super2 = _createSuper$1r(CustomMenu); - - function CustomMenu(editorInstance) { - var _this2; - - _classCallCheck(this, CustomMenu); - - _this2 = _super2.call(this, editorInstance); - - if (!filteredOptions.iconName) { - _this2.noIcon = true; - } - - _this2.setName(name, filteredOptions.iconName); - - _this2.subMenuConfig = filteredOptions.subMenuConfig || []; - return _this2; - } - - _createClass(CustomMenu, [{ - key: "onClick", - value: function onClick() { - var _get7, _context7; - - for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - args[_key6] = arguments[_key6]; - } - - if (filteredOptions.onClick) { - return filteredOptions.onClick.apply(this, args); - } - - return (_get7 = _get(_getPrototypeOf(CustomMenu.prototype), "onClick", this)).call.apply(_get7, concat$5(_context7 = [this]).call(_context7, args)); - } - }, { - key: "shortcutKeys", - get: function get() { - if (filteredOptions.shortcutKeys) { - return filteredOptions.shortcutKeys; - } - - return []; - } - }]); - - return CustomMenu; - }(MenuBase); - } - - var constants = { - HOOKS_TYPE_LIST: HOOKS_TYPE_LIST - }; - var nodeIgnorePlugin = []; - - if (!isBrowser()) { - forEach$3(nodeIgnorePlugin).call(nodeIgnorePlugin, function (key) { - }); - } - - var VERSION$1 = "0.8.21-4b60dd76"; - var CherryStatic = /*#__PURE__*/function () { - function CherryStatic() { - _classCallCheck(this, CherryStatic); - } - - _createClass(CherryStatic, null, [{ - key: "usePlugin", - value: - /** - * @this {typeof import('./Cherry').default | typeof CherryStatic} - * @param {{ install: (defaultConfig: any, ...args: any[]) => void }} PluginClass 插件Class - * @param {...any} args 初始化插件的参数 - * @returns - */ - function usePlugin(PluginClass) { - var _context; - - if (this === CherryStatic) { - throw new Error('`usePlugin` is not allowed to called through CherryStatic class.'); - } // @ts-ignore - - - if (this.initialized) { - throw new Error('The function `usePlugin` should be called before Cherry is instantiated.'); - } // @ts-ignore - - - if (PluginClass.$cherry$mounted === true) { - return; - } // @ts-ignore - - - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - PluginClass.install.apply(PluginClass, concat$5(_context = [this.config.defaults]).call(_context, args)); // @ts-ignore - - PluginClass.$cherry$mounted = true; - } - }]); - - return CherryStatic; - }(); - - _defineProperty(CherryStatic, "createSyntaxHook", createSyntaxHook); - - _defineProperty(CherryStatic, "createMenuHook", createMenuHook); - - _defineProperty(CherryStatic, "constants", constants); - - _defineProperty(CherryStatic, "VERSION", VERSION$1); - - function ownKeys$9(object, enumerableOnly) { var keys = keys$3(object); if (getOwnPropertySymbols$2) { var symbols = getOwnPropertySymbols$2(object); enumerableOnly && (symbols = filter$3(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor$3(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } - - function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? forEach$3(_context5 = ownKeys$9(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : getOwnPropertyDescriptors$2 ? defineProperties$2(target, getOwnPropertyDescriptors$2(source)) : forEach$3(_context6 = ownKeys$9(Object(source))).call(_context6, function (key) { defineProperty$5(target, key, getOwnPropertyDescriptor$3(source, key)); }); } return target; } - - function _createSuper$1s(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1s(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct$4(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - - function _isNativeReflectConstruct$1s() { if (typeof Reflect === "undefined" || !construct$4) return false; if (construct$4.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct$4(Boolean, [], function () {})); return true; } catch (e) { return false; } } - /** @typedef {import('~types/cherry').CherryOptions} CherryOptions */ - - var Cherry = /*#__PURE__*/function (_CherryStatic) { - _inherits(Cherry, _CherryStatic); - - var _super = _createSuper$1s(Cherry); - - /** - * @protected - */ - - /** - * @readonly - */ - - /** - * @param {Partial} options - */ - function Cherry(options) { - var _context; - - var _this; - - _classCallCheck(this, Cherry); - - _this = _super.call(this); - Cherry.initialized = true; - var defaultConfigCopy = cloneDeep_1(Cherry.config.defaults); - _this.defaultToolbar = defaultConfigCopy.toolbars.toolbar; - $expectTarget(options, Object); - /** - * @property - * @type {Partial} - */ - - _this.options = mergeWith_1({}, defaultConfigCopy, options, customizer); // loading the locale - - _this.locale = locales[_this.options.locale]; - - if (typeof _this.options.engine.global.urlProcessor === 'function') { - _this.options.engine.global.urlProcessor = urlProcessorProxy(_this.options.engine.global.urlProcessor); - } - - _this.status = { - toolbar: 'show', - previewer: 'show', - editor: 'show' - }; - - if (_this.options.isPreviewOnly || _this.options.editor.defaultModel === 'previewOnly') { - _this.options.toolbars.showToolbar = false; - _this.options.editor.defaultModel = 'previewOnly'; - _this.status.editor = 'hide'; - _this.status.toolbar = 'hide'; - } - /** - * @property - * @type {string} 实例ID - */ - - - _this.instanceId = concat$5(_context = "cherry-".concat(new Date().getTime())).call(_context, Math.random()); - _this.options.instanceId = _this.instanceId; - /** - * @private - * @type {Engine} - */ - - _this.engine = new Engine(_this.options, _assertThisInitialized(_this)); - - _this.init(); - - return _this; - } - /** - * 初始化工具栏、编辑区、预览区等 - * @private - */ - - - _createClass(Cherry, [{ - key: "init", - value: function init() { - var _context2, - _this2 = this; - - var mountEl = this.options.id ? document.getElementById(this.options.id) : this.options.el; - - if (!mountEl) { - if (!this.options.forceAppend) { - return false; - } - - mountEl = document.createElement('div'); - mountEl.id = this.options.id || 'cherry-markdown'; - document.body.appendChild(mountEl); - } - - if (!mountEl.style.height) { - mountEl.style.height = this.options.editor.height; - } - - this.cherryDom = mountEl; // 蒙层dom,用来拖拽编辑区&预览区宽度时展示蒙层 - - var wrapperDom = this.createWrapper(); // 创建编辑区 - - var editor = this.createEditor(); // 创建预览区 - - var previewer = this.createPreviewer(); - - if (this.options.toolbars.showToolbar === false || this.options.toolbars.toolbar === false) { - // 即便配置了不展示工具栏,也要让工具栏加载对应的语法hook - wrapperDom.classList.add('cherry--no-toolbar'); - this.options.toolbars.toolbar = this.defaultToolbar; - } - - $expectTarget(this.options.toolbars.toolbar, Array); // 创建顶部工具栏 - - this.toolbar = this.createToolbar(); - var wrapperFragment = document.createDocumentFragment(); - wrapperFragment.appendChild(this.toolbar.options.dom); - wrapperFragment.appendChild(editor.options.editorDom); // 创建预览区域的侧边工具栏 - - this.createSidebar(wrapperFragment); - - if (!this.options.previewer.dom) { - wrapperFragment.appendChild(previewer.options.previewerDom); - } - - wrapperFragment.appendChild(previewer.options.virtualDragLineDom); - wrapperFragment.appendChild(previewer.options.editorMaskDom); - wrapperFragment.appendChild(previewer.options.previewerMaskDom); - wrapperDom.appendChild(wrapperFragment); - mountEl.appendChild(wrapperDom); - editor.init(previewer); // 创建bubble工具栏,所谓bubble工具栏,是指在编辑区选中文本时悬浮出现的工具栏 - - this.createBubble(); // 创建float工具栏,所谓float工具栏,是指当编辑区光标处于新行时,在行内联想出的工具栏 - - this.createFloatMenu(); - previewer.init(editor); - previewer.registerAfterUpdate(bind$5(_context2 = this.engine.mounted).call(_context2, this.engine)); // default value init - - this.initText(editor.editor); // 切换模式,有纯预览模式、纯编辑模式、双栏编辑模式 - - this.switchModel(this.options.editor.defaultModel); - Event$1.on(this.instanceId, Event$1.Events.toolbarHide, function () { - _this2.status.toolbar = 'hide'; - }); - Event$1.on(this.instanceId, Event$1.Events.toolbarShow, function () { - _this2.status.toolbar = 'show'; - }); - Event$1.on(this.instanceId, Event$1.Events.previewerClose, function () { - _this2.status.previewer = 'hide'; - }); - Event$1.on(this.instanceId, Event$1.Events.previewerOpen, function () { - _this2.status.previewer = 'show'; - }); - Event$1.on(this.instanceId, Event$1.Events.editorClose, function () { - _this2.status.editor = 'hide'; // 关闭编辑区时,需要清除所有高亮 - - _this2.previewer.highlightLine(0); - }); - Event$1.on(this.instanceId, Event$1.Events.editorOpen, function () { - _this2.status.editor = 'show'; - }); - } - /** - * 切换编辑模式 - * @param {'edit&preview'|'editOnly'|'previewOnly'} model 模式类型 - * 一般纯预览模式和纯编辑模式适合在屏幕较小的终端使用,比如手机移动端 - * - * @returns - */ - - }, { - key: "switchModel", - value: function switchModel() { - var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'edit&preview'; - - switch (model) { - case 'edit&preview': - if (this.previewer) { - this.previewer.editOnly(true); - this.previewer.recoverPreviewer(); - } - - if (this.toolbar) { - this.toolbar.showToolbar(); - } - - break; - - case 'editOnly': - if (!this.previewer.isPreviewerHidden()) { - this.previewer.editOnly(true); - } - - if (this.toolbar) { - this.toolbar.showToolbar(); - } - - break; - - case 'previewOnly': - this.previewer.previewOnly(); - this.toolbar && this.toolbar.previewOnly(); - break; - } - } - /** - * 获取实例id - * @returns {string} - * @public - */ - - }, { - key: "getInstanceId", - value: function getInstanceId() { - return this.instanceId; - } - /** - * 获取编辑器状态 - * @returns {Object} - */ - - }, { - key: "getStatus", - value: function getStatus() { - return this.status; - } - /** - * 获取编辑区内的markdown源码内容 - * @returns markdown源码内容 - */ - - }, { - key: "getValue", - value: function getValue() { - return this.editor.editor.getValue(); - } - /** - * 获取编辑区内的markdown源码内容 - * @returns markdown源码内容 - */ - - }, { - key: "getMarkdown", - value: function getMarkdown() { - return this.getValue(); - } - /** - * 获取CodeMirror实例 - * @returns CodeMirror实例 - */ - - }, { - key: "getCodeMirror", - value: function getCodeMirror() { - return this.editor.editor; - } - /** - * 获取预览区内的html内容 - * @param {boolean} wrapTheme 是否在外层包裹主题class - * @returns html内容 - */ - - }, { - key: "getHtml", - value: function getHtml() { - var wrapTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - return this.previewer.getValue(wrapTheme); - } - }, { - key: "getPreviewer", - value: function getPreviewer() { - return this.previewer; - } - /** - * 获取目录,目录由head1~6组成 - * @returns 标题head数组 - */ - - }, { - key: "getToc", - value: function getToc() { - var str = this.getHtml(); - /** @type {({level: number;id: string;text: string})[]} */ - - var headerList = []; - var headerRegex = /(.+?)<\/h[0-6]>/g; - str.replace(headerRegex, function (match, level, id, text) { - headerList.push({ - level: +level, - id: id, - text: text - }); - return match; - }); - return headerList; - } - /** - * 覆盖编辑区的内容 - * @param {string} content markdown内容 - * @param {boolean} keepCursor 是否保持光标位置 - * @returns - */ - - }, { - key: "setValue", - value: function setValue(content) { - var keepCursor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (keepCursor === false) { - return this.editor.editor.setValue(content); - } - - var codemirror = this.editor.editor; - var old = this.getValue(); - var pos = codemirror.getDoc().indexFromPos(codemirror.getCursor()); - var newPos = getPosBydiffs(pos, old, content); - var ret = codemirror.setValue(content); - var cursor = codemirror.getDoc().posFromIndex(newPos); - codemirror.setCursor(cursor); - return ret; - } - /** - * 在光标处或者指定行+偏移量插入内容 - * @param {string} content 被插入的文本 - * @param {boolean} [isSelect=false] 是否选中刚插入的内容 - * @param {[number, number]|false} [anchor=false] [x,y] 代表x+1行,y+1字符偏移量,默认false 会从光标处插入 - * @param {boolean} [focus=true] 保持编辑器处于focus状态 - * @returns - */ - - }, { - key: "insert", - value: function insert(content) { - var isSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var anchor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var focus = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - - if (anchor) { - this.editor.editor.setSelection({ - line: anchor[0], - ch: anchor[1] - }, { - line: anchor[0], - ch: anchor[1] - }); - } - - var ret = this.editor.editor.replaceSelection(content, isSelect ? 'around' : 'end'); - focus && this.editor.editor.focus(); - return ret; - } - /** - * 在光标处或者指定行+偏移量插入内容 - * @param {string} content 被插入的文本 - * @param {boolean} [isSelect=false] 是否选中刚插入的内容 - * @param {[number, number]|false} [anchor=false] [x,y] 代表x+1行,y+1字符偏移量,默认false 会从光标处插入 - * @param {boolean} [focus=true] 保持编辑器处于focus状态 - * @returns - */ - - }, { - key: "insertValue", - value: function insertValue(content) { - var isSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var anchor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var focus = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - return this.insert(content, isSelect, anchor, focus); - } - /** - * 强制重新渲染预览区域 - */ - - }, { - key: "refreshPreviewer", - value: function refreshPreviewer() { - try { - var markdownText = this.getValue(); - var html = this.engine.makeHtml(markdownText); - this.previewer.refresh(html); - } catch (e) { - throw new NestedError(e); - } - } - /** - * 覆盖编辑区的内容 - * @param {string} content markdown内容 - * @param {boolean} keepCursor 是否保持光标位置 - * @returns - */ - - }, { - key: "setMarkdown", - value: function setMarkdown(content) { - var keepCursor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return this.setValue(content, keepCursor); - } - /** - * @private - * @returns - */ - - }, { - key: "createWrapper", - value: function createWrapper() { - var toolbarTheme = this.options.toolbars.theme === 'dark' ? 'dark' : ''; // TODO: 完善类型 - - var inlineCodeTheme = - /** @type {{theme?: string;}} */ - this.options.engine.syntax.inlineCode.theme; - var codeBlockTheme = - /** @type {{theme?: string;}} */ - this.options.engine.syntax.codeBlock.theme; - if (codeBlockTheme === 'dark') codeBlockTheme = 'tomorrow-night';else if (codeBlockTheme === 'light') codeBlockTheme = 'solarized-light'; - var wrapperDom = createElement('div', ['cherry', 'clearfix', getThemeFromLocal(true)].join(' '), { - 'data-toolbarTheme': toolbarTheme, - 'data-inlineCodeTheme': inlineCodeTheme, - 'data-codeBlockTheme': codeBlockTheme - }); - this.wrapperDom = wrapperDom; - return wrapperDom; - } - /** - * @private - * @returns {Toolbar} - */ - - }, { - key: "createToolbar", - value: function createToolbar() { - var dom = createElement('div', 'cherry-toolbar'); - this.toolbar = new Toolbar({ - dom: dom, - $cherry: this, - buttonRightConfig: this.options.toolbars.toolbarRight, - buttonConfig: this.options.toolbars.toolbar, - customMenu: this.options.toolbars.customMenu - }); - return this.toolbar; - } - /** - * @private - * @returns - */ - - }, { - key: "createSidebar", - value: function createSidebar(wrapperFragment) { - if (this.options.toolbars.sidebar) { - $expectTarget(this.options.toolbars.sidebar, Array); - var externalClass = this.options.toolbars.theme === 'dark' ? 'dark' : ''; - var dom = createElement('div', "cherry-sidebar ".concat(externalClass)); - this.sidebar = new Sidebar({ - dom: dom, - $cherry: this, - buttonConfig: this.options.toolbars.sidebar, - customMenu: this.options.toolbars.customMenu - }); - wrapperFragment.appendChild(this.sidebar.options.dom); - } - } - /** - * @private - * @returns - */ - - }, { - key: "createFloatMenu", - value: function createFloatMenu() { - if (this.options.toolbars["float"]) { - var dom = createElement('div', 'cherry-floatmenu'); - $expectTarget(this.options.toolbars["float"], Array); - this.floatMenu = new FloatMenu({ - dom: dom, - $cherry: this, - buttonConfig: this.options.toolbars["float"], - customMenu: this.options.toolbars.customMenu - }); - } - } - /** - * @private - * @returns - */ - - }, { - key: "createBubble", - value: function createBubble() { - if (this.options.toolbars.bubble) { - var dom = createElement('div', 'cherry-bubble'); - $expectTarget(this.options.toolbars.bubble, Array); - this.bubble = new Bubble({ - dom: dom, - $cherry: this, - buttonConfig: this.options.toolbars.bubble, - customMenu: this.options.toolbars.customMenu, - engine: this.engine - }); - } - } - /** - * @private - * @returns {import('@/Editor').default} - */ - - }, { - key: "createEditor", - value: function createEditor() { - var _this$options$editor$, _this$options$editor$2, _context3, _context4; - - var textArea = createElement('textarea', '', { - id: (_this$options$editor$ = this.options.editor.id) !== null && _this$options$editor$ !== void 0 ? _this$options$editor$ : 'code', - name: (_this$options$editor$2 = this.options.editor.name) !== null && _this$options$editor$2 !== void 0 ? _this$options$editor$2 : 'code' - }); - textArea.textContent = this.options.value; - var editor = createElement('div', 'cherry-editor'); - editor.appendChild(textArea); - this.editor = new Editor(_objectSpread$8({ - $cherry: this, - editorDom: editor, - wrapperDom: this.wrapperDom, - value: this.options.value, - onKeydown: bind$5(_context3 = this.fireShortcutKey).call(_context3, this), - onChange: bind$5(_context4 = this.editText).call(_context4, this), - toolbars: this.options.toolbars, - fileUpload: this.options.fileUpload, - autoScrollByCursor: this.options.autoScrollByCursor - }, this.options.editor)); - return this.editor; - } - /** - * @private - * @returns {import('@/Previewer').default} - */ - - }, { - key: "createPreviewer", - value: function createPreviewer() { - /** @type {HTMLDivElement} */ - var previewer; - var anchorStyle = this.options.engine.syntax.header && this.options.engine.syntax.header.anchorStyle || 'default'; - var autonumberClass = anchorStyle === 'autonumber' ? ' head-num' : ''; - var _this$options$preview = this.options.previewer, - className = _this$options$preview.className, - dom = _this$options$preview.dom, - enablePreviewerBubble = _this$options$preview.enablePreviewerBubble; - var previewerClassName = ['cherry-previewer cherry-markdown', className || '', autonumberClass, getThemeFromLocal(true)].join(' '); - - if (dom) { - previewer = dom; - previewer.className += " ".concat(previewerClassName); - } else { - previewer = createElement('div', previewerClassName); - } - - var virtualDragLine = createElement('div', 'cherry-drag'); - var editorMask = createElement('div', 'cherry-editor-mask'); - var previewerMask = createElement('div', 'cherry-previewer-mask'); - this.previewer = new Previewer({ - $cherry: this, - virtualDragLineDom: virtualDragLine, - editorMaskDom: editorMask, - previewerMaskDom: previewerMask, - previewerDom: previewer, - value: this.options.value, - isPreviewOnly: this.options.isPreviewOnly, - enablePreviewerBubble: enablePreviewerBubble, - lazyLoadImg: this.options.previewer.lazyLoadImg - }); - return this.previewer; - } - /** - * @private - * @param {import('codemirror').Editor} codemirror - */ - - }, { - key: "initText", - value: function initText(codemirror) { - try { - var markdownText = codemirror.getValue(); - var html = this.engine.makeHtml(markdownText); - this.previewer.update(html); - - if (this.options.callback.afterInit) { - this.options.callback.afterInit(markdownText, html); - } - } catch (e) { - throw new NestedError(e); - } - } - /** - * @private - * @param {Event} _evt - * @param {import('codemirror').Editor} codemirror - */ - - }, { - key: "editText", - value: function editText(_evt, codemirror) { - var _this3 = this; - - try { - if (this.timer) { - clearTimeout(this.timer); - this.timer = null; - } - - this.timer = setTimeout$3(function () { - var markdownText = codemirror.getValue(); - - var html = _this3.engine.makeHtml(markdownText); - - _this3.previewer.update(html); - - if (_this3.options.callback.afterChange) { - _this3.options.callback.afterChange(markdownText, html); - } // 强制每次编辑(包括undo、redo)编辑器都会自动滚动到光标位置 - - - codemirror.scrollIntoView(null); - }, 50); - } catch (e) { - throw new NestedError(e); - } - } - /** - * @private - * @param {any} cb - */ - - }, { - key: "onChange", - value: function onChange(cb) { - this.editor.editor.on('change', function (codeMirror) { - cb({ - markdown: codeMirror.getValue() // 后续可以按需增加html或其他状态 - - }); - }); - } - /** - * @private - * @param {*} evt - */ - - }, { - key: "fireShortcutKey", - value: function fireShortcutKey(evt) { - if (this.toolbar.matchShortcutKey(evt)) { - // 快捷键 - evt.preventDefault(); - this.toolbar.fireShortcutKey(evt); - } - } - /** - * 导出预览区域内容 - * @public - * @param {String} type 'pdf':导出成pdf文件; 'img':导出成图片 - * @param {String} fileName 导出文件名 - */ - - }, { - key: "export", - value: function _export() { - var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pdf'; - var fileName = arguments.length > 1 ? arguments[1] : undefined; - this.previewer["export"](type, fileName); - } - /** - * 修改主题 - * @param {string} theme option.theme里的className - */ - - }, { - key: "setTheme", - value: function setTheme() { - var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default'; - changeTheme(this, theme); - } - /** - * 修改书写风格 - * @param {string} writingStyle normal 普通 | typewriter 打字机 | focus 专注 - */ - - }, { - key: "setWritingStyle", - value: function setWritingStyle(writingStyle) { - this.editor.setWritingStyle(writingStyle); - } - }]); - - return Cherry; - }(CherryStatic); - - _defineProperty(Cherry, "initialized", false); - - _defineProperty(Cherry, "config", { - /** @type {Partial} */ - defaults: defaultConfig$1 - }); - - /** - * Copyright (C) 2021 THL A29 Limited, a Tencent company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - if (window) { - // @ts-ignore - window.Cherry = Cherry; - } - - function ownKeys$a(object, enumerableOnly) { var keys = keys$3(object); if (getOwnPropertySymbols$2) { var symbols = getOwnPropertySymbols$2(object); enumerableOnly && (symbols = filter$3(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor$3(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } - - function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? forEach$3(_context4 = ownKeys$a(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : getOwnPropertyDescriptors$2 ? defineProperties$2(target, getOwnPropertyDescriptors$2(source)) : forEach$3(_context5 = ownKeys$a(Object(source))).call(_context5, function (key) { defineProperty$5(target, key, getOwnPropertyDescriptor$3(source, key)); }); } return target; } - var DEFAULT_OPTIONS = { - // TODO: themes - theme: 'default', - altFontFamily: 'sans-serif', - fontFamily: 'sans-serif', - themeCSS: '.label foreignObject { font-size: 90%; overflow: visible; } .label { font-family: sans-serif; }', - flowchart: { - useMaxWidth: false - }, - sequence: { - useMaxWidth: false - }, - startOnLoad: false, - logLevel: 5 // fontFamily: 'Arial, monospace' - - }; - - var MermaidCodeEngine = /*#__PURE__*/function () { - function MermaidCodeEngine() { - var mermaidOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, MermaidCodeEngine); - - _defineProperty(this, "mermaidAPIRefs", null); - - _defineProperty(this, "options", DEFAULT_OPTIONS); - - _defineProperty(this, "dom", null); - - _defineProperty(this, "mermaidCanvas", null); - - var mermaid = mermaidOptions.mermaid, - mermaidAPI = mermaidOptions.mermaidAPI; - - if (!mermaidAPI && !window.mermaidAPI && (!mermaid || !mermaid.mermaidAPI) && (!window.mermaid || !window.mermaid.mermaidAPI)) { - throw new Error('code-block-mermaid-plugin[init]: Package mermaid or mermaidAPI not found.'); - } - - this.options = _objectSpread$9(_objectSpread$9({}, DEFAULT_OPTIONS), mermaidOptions || {}); - this.mermaidAPIRefs = mermaidAPI || window.mermaidAPI || mermaid.mermaidAPI || window.mermaid.mermaidAPI; - delete this.options.mermaid; - delete this.options.mermaidAPI; - this.mermaidAPIRefs.initialize(this.options); - } - - _createClass(MermaidCodeEngine, [{ - key: "mountMermaidCanvas", - value: function mountMermaidCanvas($engine) { - if (this.mermaidCanvas && document.body.contains(this.mermaidCanvas)) { - return; - } - - this.mermaidCanvas = document.createElement('div'); - this.mermaidCanvas.style = 'width:1024px;opacity:0;position:fixed;top:100%;'; - var container = $engine.$cherry.wrapperDom || document.body; - container.appendChild(this.mermaidCanvas); - } - /** - * 转换svg为img,如果出错则直出svg - * @param {string} svgCode - * @param {string} graphId - * @returns {string} - */ - - }, { - key: "convertMermaidSvgToImg", - value: function convertMermaidSvgToImg(svgCode, graphId) { - var domParser = new DOMParser(); - var svgHtml; - - var injectSvgFallback = function injectSvgFallback(svg) { - return svg.replace('"); - } - } else { - svgHtml = injectSvgFallback(svgCode); - } - } catch (e) { - svgHtml = injectSvgFallback(svgCode); - } - - return svgHtml; - } - }, { - key: "render", - value: function render(src, sign, $engine) { - var _context3, - _config$svg2img, - _this = this; - - var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var $sign = sign; - - if (!$sign) { - $sign = Math.round(Math.random() * 100000000); - } - - this.mountMermaidCanvas($engine); - var html; // 多实例的情况下相同的内容ID相同会导致mermaid渲染异常 - // 需要通过添加时间戳使得多次渲染相同内容的图像ID唯一 - // 图像渲染节流在CodeBlock Hook内部控制 - - var graphId = concat$5(_context3 = "mermaid-".concat($sign, "-")).call(_context3, new Date().getTime()); - - this.svg2img = (_config$svg2img = config === null || config === void 0 ? void 0 : config.svg2img) !== null && _config$svg2img !== void 0 ? _config$svg2img : false; - - try { - this.mermaidAPIRefs.render(graphId, src, function (svgCode) { - var fixedSvg = svgCode.replace(/\s*markerUnits="0"/g, '').replace(/\s*x="NaN"/g, '').replace(/
/g, '
'); - html = _this.convertMermaidSvgToImg(fixedSvg, graphId); - }, this.mermaidCanvas); - } catch (e) { - return e === null || e === void 0 ? void 0 : e.str; - } - - return html; - } - }], [{ - key: "install", - value: function install(cherryOptions) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - mergeWith_1(cherryOptions, { - engine: { - syntax: { - codeBlock: { - customRenderer: { - mermaid: _construct(MermaidCodeEngine, args) - } - } - } - } - }); - } - }]); - - return MermaidCodeEngine; - }(); - - _defineProperty(MermaidCodeEngine, "TYPE", 'figure'); - - // @ts-nocheck - - /* - * $Id: rawdeflate.js,v 0.3 2009/03/01 19:05:05 dankogai Exp dankogai $ - * - * Original: - * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt - */ - // if run as a web worker, respond to messages by deflating them - var deflate = function () { - /* Copyright (C) 1999 Masanao Izumo - * Version: 1.0.1 - * LastModified: Dec 25 1999 - */ - - /* Interface: - * data = deflate(src); - */ - - /* constant parameters */ - var zip_WSIZE = 32768; // Sliding Window size - - var zip_STORED_BLOCK = 0; - var zip_STATIC_TREES = 1; - var zip_DYN_TREES = 2; - /* for deflate */ - - var zip_DEFAULT_LEVEL = 6; - var zip_INBUFSIZ = 32768; // Input buffer size - - var zip_INBUF_EXTRA = 64; // Extra buffer - - var zip_OUTBUFSIZ = 1024 * 8; - var zip_window_size = 2 * zip_WSIZE; - var zip_MIN_MATCH = 3; - var zip_MAX_MATCH = 258; - var zip_BITS = 16; // for SMALL_MEM - - var zip_LIT_BUFSIZE = 0x2000; - var zip_HASH_BITS = 13; // for MEDIUM_MEM - // var zip_LIT_BUFSIZE = 0x4000; - // var zip_HASH_BITS = 14; - // for BIG_MEM - // var zip_LIT_BUFSIZE = 0x8000; - // var zip_HASH_BITS = 15; - // if(zip_LIT_BUFSIZE > zip_INBUFSIZ) - // alert("error: zip_INBUFSIZ is too small"); - // if((zip_WSIZE<<1) > (1< zip_BITS-1) - // alert("error: zip_HASH_BITS is too large"); - // if(zip_HASH_BITS < 8 || zip_MAX_MATCH != 258) - // alert("error: Code too clever"); - - var zip_DIST_BUFSIZE = zip_LIT_BUFSIZE; - var zip_HASH_SIZE = 1 << zip_HASH_BITS; - var zip_HASH_MASK = zip_HASH_SIZE - 1; - var zip_WMASK = zip_WSIZE - 1; - var zip_NIL = 0; // Tail of hash chains - - var zip_TOO_FAR = 4096; - var zip_MIN_LOOKAHEAD = zip_MAX_MATCH + zip_MIN_MATCH + 1; - var zip_MAX_DIST = zip_WSIZE - zip_MIN_LOOKAHEAD; - var zip_SMALLEST = 1; - var zip_MAX_BITS = 15; - var zip_MAX_BL_BITS = 7; - var zip_LENGTH_CODES = 29; - var zip_LITERALS = 256; - var zip_END_BLOCK = 256; - var zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES; - var zip_D_CODES = 30; - var zip_BL_CODES = 19; - var zip_REP_3_6 = 16; - var zip_REPZ_3_10 = 17; - var zip_REPZ_11_138 = 18; - var zip_HEAP_SIZE = 2 * zip_L_CODES + 1; - - var zip_H_SHIFT = _parseInt$2((zip_HASH_BITS + zip_MIN_MATCH - 1) / zip_MIN_MATCH); - /* variables */ - - - var zip_free_queue; - var zip_qhead; - var zip_qtail; - var zip_initflag; - var zip_outbuf = null; - var zip_outcnt; - var zip_outoff; - var zip_complete; - var zip_window; - var zip_d_buf; - var zip_l_buf; - var zip_prev; - var zip_bi_buf; - var zip_bi_valid; - var zip_block_start; - var zip_ins_h; - var zip_hash_head; - var zip_prev_match; - var zip_match_available; - var zip_match_length; - var zip_prev_length; - var zip_strstart; - var zip_match_start; - var zip_eofile; - var zip_lookahead; - var zip_max_chain_length; - var zip_max_lazy_match; - var zip_compr_level; - var zip_good_match; - var zip_dyn_ltree; - var zip_dyn_dtree; - var zip_static_ltree; - var zip_static_dtree; - var zip_bl_tree; - var zip_l_desc; - var zip_d_desc; - var zip_bl_desc; - var zip_bl_count; - var zip_heap; - var zip_heap_len; - var zip_heap_max; - var zip_depth; - var zip_length_code; - var zip_dist_code; - var zip_base_length; - var zip_base_dist; - var zip_flag_buf; - var zip_last_lit; - var zip_last_dist; - var zip_last_flags; - var zip_flags; - var zip_flag_bit; - var zip_opt_len; - var zip_static_len; - var zip_deflate_data; - var zip_deflate_pos; - /* objects (deflate) */ - - function zip_DeflateCT() { - this.fc = 0; // frequency count or bit string - - this.dl = 0; // father node in Huffman tree or length of bit string - } - - function zip_DeflateTreeDesc() { - this.dyn_tree = null; // the dynamic tree - - this.static_tree = null; // corresponding static tree or NULL - - this.extra_bits = null; // extra bits for each code or NULL - - this.extra_base = 0; // base index for extra_bits - - this.elems = 0; // max number of elements in the tree - - this.max_length = 0; // max bit length for the codes - - this.max_code = 0; // largest code with non zero frequency - } - /* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ - - - function zip_DeflateConfiguration(a, b, c, d) { - this.good_length = a; // reduce lazy search above this match length - - this.max_lazy = b; // do not perform lazy search above this match length - - this.nice_length = c; // quit search above this match length - - this.max_chain = d; - } - - function zip_DeflateBuffer() { - this.next = null; - this.len = 0; - this.ptr = new Array(zip_OUTBUFSIZ); - this.off = 0; - } - /* constant tables */ - - - var zip_extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]; - var zip_extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]; - var zip_extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]; - var zip_bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - var zip_configuration_table = [new zip_DeflateConfiguration(0, 0, 0, 0), new zip_DeflateConfiguration(4, 4, 8, 4), new zip_DeflateConfiguration(4, 5, 16, 8), new zip_DeflateConfiguration(4, 6, 32, 32), new zip_DeflateConfiguration(4, 4, 16, 16), new zip_DeflateConfiguration(8, 16, 32, 32), new zip_DeflateConfiguration(8, 16, 128, 128), new zip_DeflateConfiguration(8, 32, 128, 256), new zip_DeflateConfiguration(32, 128, 258, 1024), new zip_DeflateConfiguration(32, 258, 258, 4096)]; - /* routines (deflate) */ - - function zip_deflate_start(level) { - var i; - if (!level) level = zip_DEFAULT_LEVEL;else if (level < 1) level = 1;else if (level > 9) level = 9; - zip_compr_level = level; - zip_initflag = false; - zip_eofile = false; - if (zip_outbuf != null) return; - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = new Array(zip_OUTBUFSIZ); - zip_window = new Array(zip_window_size); - zip_d_buf = new Array(zip_DIST_BUFSIZE); - zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA); - zip_prev = new Array(1 << zip_BITS); - zip_dyn_ltree = new Array(zip_HEAP_SIZE); - - for (i = 0; i < zip_HEAP_SIZE; i++) { - zip_dyn_ltree[i] = new zip_DeflateCT(); - } - - zip_dyn_dtree = new Array(2 * zip_D_CODES + 1); - - for (i = 0; i < 2 * zip_D_CODES + 1; i++) { - zip_dyn_dtree[i] = new zip_DeflateCT(); - } - - zip_static_ltree = new Array(zip_L_CODES + 2); - - for (i = 0; i < zip_L_CODES + 2; i++) { - zip_static_ltree[i] = new zip_DeflateCT(); - } - - zip_static_dtree = new Array(zip_D_CODES); - - for (i = 0; i < zip_D_CODES; i++) { - zip_static_dtree[i] = new zip_DeflateCT(); - } - - zip_bl_tree = new Array(2 * zip_BL_CODES + 1); - - for (i = 0; i < 2 * zip_BL_CODES + 1; i++) { - zip_bl_tree[i] = new zip_DeflateCT(); - } - - zip_l_desc = new zip_DeflateTreeDesc(); - zip_d_desc = new zip_DeflateTreeDesc(); - zip_bl_desc = new zip_DeflateTreeDesc(); - zip_bl_count = new Array(zip_MAX_BITS + 1); - zip_heap = new Array(2 * zip_L_CODES + 1); - zip_depth = new Array(2 * zip_L_CODES + 1); - zip_length_code = new Array(zip_MAX_MATCH - zip_MIN_MATCH + 1); - zip_dist_code = new Array(512); - zip_base_length = new Array(zip_LENGTH_CODES); - zip_base_dist = new Array(zip_D_CODES); - zip_flag_buf = new Array(_parseInt$2(zip_LIT_BUFSIZE / 8)); - } - - function zip_reuse_queue(p) { - p.next = zip_free_queue; - zip_free_queue = p; - } - - function zip_new_queue() { - var p; - - if (zip_free_queue != null) { - p = zip_free_queue; - zip_free_queue = zip_free_queue.next; - } else p = new zip_DeflateBuffer(); - - p.next = null; - p.len = p.off = 0; - return p; - } - - function zip_head1(i) { - return zip_prev[zip_WSIZE + i]; - } - - function zip_head2(i, val) { - return zip_prev[zip_WSIZE + i] = val; - } - /* put_byte is used for the compressed output, put_ubyte for the - * uncompressed output. However unlzw() uses window for its - * suffix table instead of its output buffer, so it does not use put_ubyte - * (to be cleaned up). - */ - - - function zip_put_byte(c) { - zip_outbuf[zip_outoff + zip_outcnt++] = c; - if (zip_outoff + zip_outcnt == zip_OUTBUFSIZ) zip_qoutbuf(); - } - /* Output a 16 bit value, lsb first */ - - - function zip_put_short(w) { - w &= 0xffff; - - if (zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) { - zip_outbuf[zip_outoff + zip_outcnt++] = w & 0xff; - zip_outbuf[zip_outoff + zip_outcnt++] = w >>> 8; - } else { - zip_put_byte(w & 0xff); - zip_put_byte(w >>> 8); - } - } - /* ========================================================================== - * Insert string s in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of s are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ - - - function zip_INSERT_STRING() { - zip_ins_h = (zip_ins_h << zip_H_SHIFT ^ zip_window[zip_strstart + zip_MIN_MATCH - 1] & 0xff) & zip_HASH_MASK; - zip_hash_head = zip_head1(zip_ins_h); - zip_prev[zip_strstart & zip_WMASK] = zip_hash_head; - zip_head2(zip_ins_h, zip_strstart); - } - /* Send a code of the given tree. c and tree must not have side effects */ - - - function zip_SEND_CODE(c, tree) { - zip_send_bits(tree[c].fc, tree[c].dl); - } - /* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. dist_code[256] and dist_code[257] are never - * used. - */ - - - function zip_D_CODE(dist) { - return (dist < 256 ? zip_dist_code[dist] : zip_dist_code[256 + (dist >> 7)]) & 0xff; - } - /* ========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ - - - function zip_SMALLER(tree, n, m) { - return tree[n].fc < tree[m].fc || tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]; - } - /* ========================================================================== - * read string data - */ - - - function zip_read_buff(buff, offset, n) { - var i; - - for (i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++) { - buff[offset + i] = zip_deflate_data.charCodeAt(zip_deflate_pos++) & 0xff; - } - - return i; - } - /* ========================================================================== - * Initialize the "longest match" routines for a new file - */ - - - function zip_lm_init() { - var j; - /* Initialize the hash table. */ - - for (j = 0; j < zip_HASH_SIZE; j++) { - // zip_head2(j, zip_NIL); - zip_prev[zip_WSIZE + j] = 0; - } - /* prev will be initialized on the fly */ - - /* Set the default configuration parameters: - */ - - - zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy; - zip_good_match = zip_configuration_table[zip_compr_level].good_length; - zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain; - zip_strstart = 0; - zip_block_start = 0; - zip_lookahead = zip_read_buff(zip_window, 0, 2 * zip_WSIZE); - - if (zip_lookahead <= 0) { - zip_eofile = true; - zip_lookahead = 0; - return; - } - - zip_eofile = false; - /* Make sure that we always have enough lookahead. This is important - * if input comes from a device such as a tty. - */ - - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) { - zip_fill_window(); - } - /* If lookahead < MIN_MATCH, ins_h is garbage, but this is - * not important since only literal bytes will be emitted. - */ - - - zip_ins_h = 0; - - for (j = 0; j < zip_MIN_MATCH - 1; j++) { - // UPDATE_HASH(ins_h, window[j]); - zip_ins_h = (zip_ins_h << zip_H_SHIFT ^ zip_window[j] & 0xff) & zip_HASH_MASK; - } - } - /* ========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - */ - - - function zip_longest_match(cur_match) { - var chain_length = zip_max_chain_length; // max hash chain length - - var scanp = zip_strstart; // current string - - var matchp; // matched string - - var len; // length of current match - - var best_len = zip_prev_length; // best match length so far - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - - var limit = zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL; - var strendp = zip_strstart + zip_MAX_MATCH; - var scan_end1 = zip_window[scanp + best_len - 1]; - var scan_end = zip_window[scanp + best_len]; - /* Do not waste too much time if we already have a good match: */ - - if (zip_prev_length >= zip_good_match) chain_length >>= 2; // Assert(encoder->strstart <= window_size-MIN_LOOKAHEAD, "insufficient lookahead"); - - do { - // Assert(cur_match < encoder->strstart, "no future"); - matchp = cur_match; - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2: - */ - - if (zip_window[matchp + best_len] != scan_end || zip_window[matchp + best_len - 1] != scan_end1 || zip_window[matchp] != zip_window[scanp] || zip_window[++matchp] != zip_window[scanp + 1]) { - continue; - } - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - - - scanp += 2; - matchp++; - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - - do {} while (zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && zip_window[++scanp] == zip_window[++matchp] && scanp < strendp); - - len = zip_MAX_MATCH - (strendp - scanp); - scanp = strendp - zip_MAX_MATCH; - - if (len > best_len) { - zip_match_start = cur_match; - best_len = len; - - { - if (len >= zip_MAX_MATCH) break; - } - - scan_end1 = zip_window[scanp + best_len - 1]; - scan_end = zip_window[scanp + best_len]; - } - } while ((cur_match = zip_prev[cur_match & zip_WMASK]) > limit && --chain_length != 0); - - return best_len; - } - /* ========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead, and sets eofile if end of input file. - * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0 - * OUT assertions: at least one byte has been read, or eofile is set; - * file reads are performed for at least two bytes (required for the - * translate_eol option). - */ - - - function zip_fill_window() { - var n; - var m; // Amount of free space at the end of the window. - - var more = zip_window_size - zip_lookahead - zip_strstart; - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - - if (more == -1) { - /* Very unlikely, but possible on 16 bit machine if strstart == 0 - * and lookahead == 1 (input done one byte at time) - */ - more--; - } else if (zip_strstart >= zip_WSIZE + zip_MAX_DIST) { - /* By the IN assertion, the window is not empty so we can't confuse - * more == 0 with more == 64K on a 16 bit machine. - */ - // Assert(window_size == (ulg)2*WSIZE, "no sliding with BIG_MEM"); - // System.arraycopy(window, WSIZE, window, 0, WSIZE); - for (n = 0; n < zip_WSIZE; n++) { - zip_window[n] = zip_window[n + zip_WSIZE]; - } - - zip_match_start -= zip_WSIZE; - zip_strstart -= zip_WSIZE; - /* we now have strstart >= MAX_DIST: */ - - zip_block_start -= zip_WSIZE; - - for (n = 0; n < zip_HASH_SIZE; n++) { - m = zip_head1(n); - zip_head2(n, m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL); - } - - for (n = 0; n < zip_WSIZE; n++) { - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - m = zip_prev[n]; - zip_prev[n] = m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL; - } - - more += zip_WSIZE; - } // At this point, more >= 2 - - - if (!zip_eofile) { - n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more); - if (n <= 0) zip_eofile = true;else zip_lookahead += n; - } - } - /* ========================================================================== - * Processes a new input file and return its compressed length. This - * function does not perform lazy evaluationof matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ - - - function zip_deflate_fast() { - while (zip_lookahead != 0 && zip_qhead == null) { - var flush; // set if current block must be flushed - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - - zip_INSERT_STRING(); - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - - if (zip_hash_head != zip_NIL && zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - - if (zip_match_length > zip_lookahead) zip_match_length = zip_lookahead; - } - - if (zip_match_length >= zip_MIN_MATCH) { - // check_match(strstart, match_start, match_length); - flush = zip_ct_tally(zip_strstart - zip_match_start, zip_match_length - zip_MIN_MATCH); - zip_lookahead -= zip_match_length; - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - - if (zip_match_length <= zip_max_lazy_match) { - zip_match_length--; // string at strstart already in hash table - - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since - * the next lookahead bytes will be emitted as literals. - */ - } while (--zip_match_length != 0); - - zip_strstart++; - } else { - zip_strstart += zip_match_length; - zip_match_length = 0; - zip_ins_h = zip_window[zip_strstart] & 0xff; // UPDATE_HASH(ins_h, window[strstart + 1]); - - zip_ins_h = (zip_ins_h << zip_H_SHIFT ^ zip_window[zip_strstart + 1] & 0xff) & zip_HASH_MASK; // #if MIN_MATCH != 3 - // Call UPDATE_HASH() MIN_MATCH-3 more times - // #endif - } - } else { - /* No match, output a literal byte */ - flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff); - zip_lookahead--; - zip_strstart++; - } - - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - - - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) { - zip_fill_window(); - } - } - } - - function zip_deflate_better() { - /* Process the input block. */ - while (zip_lookahead != 0 && zip_qhead == null) { - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - /* Find the longest match, discarding those <= prev_length. - */ - - zip_prev_length = zip_match_length; - zip_prev_match = zip_match_start; - zip_match_length = zip_MIN_MATCH - 1; - - if (zip_hash_head != zip_NIL && zip_prev_length < zip_max_lazy_match && zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - - if (zip_match_length > zip_lookahead) zip_match_length = zip_lookahead; - /* Ignore a length 3 match if it is too distant: */ - - if (zip_match_length == zip_MIN_MATCH && zip_strstart - zip_match_start > zip_TOO_FAR) { - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - zip_match_length--; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - - - if (zip_prev_length >= zip_MIN_MATCH && zip_match_length <= zip_prev_length) { - var flush; // set if current block must be flushed - // check_match(strstart - 1, prev_match, prev_length); - - flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match, zip_prev_length - zip_MIN_MATCH); - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. - */ - - zip_lookahead -= zip_prev_length - 1; - zip_prev_length -= 2; - - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since the - * next lookahead bytes will always be emitted as literals. - */ - } while (--zip_prev_length != 0); - - zip_match_available = 0; - zip_match_length = zip_MIN_MATCH - 1; - zip_strstart++; - - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - } else if (zip_match_available != 0) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - if (zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - - zip_strstart++; - zip_lookahead--; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - zip_match_available = 1; - zip_strstart++; - zip_lookahead--; - } - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - - - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) { - zip_fill_window(); - } - } - } - - function zip_init_deflate() { - if (zip_eofile) return; - zip_bi_buf = 0; - zip_bi_valid = 0; - zip_ct_init(); - zip_lm_init(); - zip_qhead = null; - zip_outcnt = 0; - zip_outoff = 0; - - if (zip_compr_level <= 3) { - zip_prev_length = zip_MIN_MATCH - 1; - zip_match_length = 0; - } else { - zip_match_length = zip_MIN_MATCH - 1; - zip_match_available = 0; - } - - zip_complete = false; - } - /* ========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ - - - function zip_deflate_internal(buff, off, buff_size) { - var n; - - if (!zip_initflag) { - zip_init_deflate(); - zip_initflag = true; - - if (zip_lookahead == 0) { - // empty - zip_complete = true; - return 0; - } - } - - if ((n = zip_qcopy(buff, off, buff_size)) == buff_size) return buff_size; - if (zip_complete) return n; - if (zip_compr_level <= 3) // optimized for speed - zip_deflate_fast();else zip_deflate_better(); - - if (zip_lookahead == 0) { - if (zip_match_available != 0) zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff); - zip_flush_block(1); - zip_complete = true; - } - - return n + zip_qcopy(buff, n + off, buff_size - n); - } - - function zip_qcopy(buff, off, buff_size) { - var n; - var i; - var j; - n = 0; - - while (zip_qhead != null && n < buff_size) { - i = buff_size - n; - if (i > zip_qhead.len) i = zip_qhead.len; // System.arraycopy(qhead.ptr, qhead.off, buff, off + n, i); - - for (j = 0; j < i; j++) { - buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j]; - } - - zip_qhead.off += i; - zip_qhead.len -= i; - n += i; - - if (zip_qhead.len == 0) { - var p; - p = zip_qhead; - zip_qhead = zip_qhead.next; - zip_reuse_queue(p); - } - } - - if (n == buff_size) return n; - - if (zip_outoff < zip_outcnt) { - i = buff_size - n; - if (i > zip_outcnt - zip_outoff) i = zip_outcnt - zip_outoff; // System.arraycopy(outbuf, outoff, buff, off + n, i); - - for (j = 0; j < i; j++) { - buff[off + n + j] = zip_outbuf[zip_outoff + j]; - } - - zip_outoff += i; - n += i; - if (zip_outcnt == zip_outoff) zip_outcnt = zip_outoff = 0; - } - - return n; - } - /* ========================================================================== - * Allocate the match buffer, initialize the various tables and save the - * location of the internal file attribute (ascii/binary) and method - * (DEFLATE/STORE). - */ - - - function zip_ct_init() { - var n; // iterates over tree elements - - var bits; // bit counter - - var length; // length value - - var code; // code value - - var dist; // distance index - - if (zip_static_dtree[0].dl != 0) return; // ct_init already called - - zip_l_desc.dyn_tree = zip_dyn_ltree; - zip_l_desc.static_tree = zip_static_ltree; - zip_l_desc.extra_bits = zip_extra_lbits; - zip_l_desc.extra_base = zip_LITERALS + 1; - zip_l_desc.elems = zip_L_CODES; - zip_l_desc.max_length = zip_MAX_BITS; - zip_l_desc.max_code = 0; - zip_d_desc.dyn_tree = zip_dyn_dtree; - zip_d_desc.static_tree = zip_static_dtree; - zip_d_desc.extra_bits = zip_extra_dbits; - zip_d_desc.extra_base = 0; - zip_d_desc.elems = zip_D_CODES; - zip_d_desc.max_length = zip_MAX_BITS; - zip_d_desc.max_code = 0; - zip_bl_desc.dyn_tree = zip_bl_tree; - zip_bl_desc.static_tree = null; - zip_bl_desc.extra_bits = zip_extra_blbits; - zip_bl_desc.extra_base = 0; - zip_bl_desc.elems = zip_BL_CODES; - zip_bl_desc.max_length = zip_MAX_BL_BITS; - zip_bl_desc.max_code = 0; // Initialize the mapping length (0..255) -> length code (0..28) - - length = 0; - - for (code = 0; code < zip_LENGTH_CODES - 1; code++) { - zip_base_length[code] = length; - - for (n = 0; n < 1 << zip_extra_lbits[code]; n++) { - zip_length_code[length++] = code; - } - } // Assert (length == 256, "ct_init: length != 256"); - - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - - - zip_length_code[length - 1] = code; - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - - dist = 0; - - for (code = 0; code < 16; code++) { - zip_base_dist[code] = dist; - - for (n = 0; n < 1 << zip_extra_dbits[code]; n++) { - zip_dist_code[dist++] = code; - } - } // Assert (dist == 256, "ct_init: dist != 256"); - - - dist >>= 7; // from now on, all distances are divided by 128 - - for (; code < zip_D_CODES; code++) { - zip_base_dist[code] = dist << 7; - - for (n = 0; n < 1 << zip_extra_dbits[code] - 7; n++) { - zip_dist_code[256 + dist++] = code; - } - } // Assert (dist == 256, "ct_init: 256+dist != 512"); - // Construct the codes of the static literal tree - - - for (bits = 0; bits <= zip_MAX_BITS; bits++) { - zip_bl_count[bits] = 0; - } - - n = 0; - - while (n <= 143) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - - while (n <= 255) { - zip_static_ltree[n++].dl = 9; - zip_bl_count[9]++; - } - - while (n <= 279) { - zip_static_ltree[n++].dl = 7; - zip_bl_count[7]++; - } - - while (n <= 287) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - - - zip_gen_codes(zip_static_ltree, zip_L_CODES + 1); - /* The static distance tree is trivial: */ - - for (n = 0; n < zip_D_CODES; n++) { - zip_static_dtree[n].dl = 5; - zip_static_dtree[n].fc = zip_bi_reverse(n, 5); - } // Initialize the first block of the first file: - - - zip_init_block(); - } - /* ========================================================================== - * Initialize a new block. - */ - - - function zip_init_block() { - var n; // iterates over tree elements - // Initialize the trees. - - for (n = 0; n < zip_L_CODES; n++) { - zip_dyn_ltree[n].fc = 0; - } - - for (n = 0; n < zip_D_CODES; n++) { - zip_dyn_dtree[n].fc = 0; - } - - for (n = 0; n < zip_BL_CODES; n++) { - zip_bl_tree[n].fc = 0; - } - - zip_dyn_ltree[zip_END_BLOCK].fc = 1; - zip_opt_len = zip_static_len = 0; - zip_last_lit = zip_last_dist = zip_last_flags = 0; - zip_flags = 0; - zip_flag_bit = 1; - } - /* ========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ - - - function zip_pqdownheap(tree, // the tree to restore - k) { - // node to move down - var v = zip_heap[k]; - var j = k << 1; // left son of k - - while (j <= zip_heap_len) { - // Set j to the smallest of the two sons: - if (j < zip_heap_len && zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j])) j++; // Exit if v is smaller than both sons - - if (zip_SMALLER(tree, v, zip_heap[j])) break; // Exchange v with the smallest son - - zip_heap[k] = zip_heap[j]; - k = j; // And continue down the tree, setting j to the left son of k - - j <<= 1; - } - - zip_heap[k] = v; - } - /* ========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ - - - function zip_gen_bitlen(desc) { - // the tree descriptor - var tree = desc.dyn_tree; - var extra = desc.extra_bits; - var base = desc.extra_base; - var max_code = desc.max_code; - var max_length = desc.max_length; - var stree = desc.static_tree; - var h; // heap index - - var n; - var m; // iterate over the tree elements - - var bits; // bit length - - var xbits; // extra bits - - var f; // frequency - - var overflow = 0; // number of elements with bit length too large - - for (bits = 0; bits <= zip_MAX_BITS; bits++) { - zip_bl_count[bits] = 0; - } - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - - - tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap - - for (h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) { - n = zip_heap[h]; - bits = tree[tree[n].dl].dl + 1; - - if (bits > max_length) { - bits = max_length; - overflow++; - } - - tree[n].dl = bits; // We overwrite tree[n].dl which is no longer needed - - if (n > max_code) continue; // not a leaf node - - zip_bl_count[bits]++; - xbits = 0; - if (n >= base) xbits = extra[n - base]; - f = tree[n].fc; - zip_opt_len += f * (bits + xbits); - if (stree != null) zip_static_len += f * (stree[n].dl + xbits); - } - - if (overflow == 0) return; // This happens for example on obj2 and pic of the Calgary corpus - // Find the first bit length which could increase: - - do { - bits = max_length - 1; - - while (zip_bl_count[bits] == 0) { - bits--; - } - - zip_bl_count[bits]--; // move one leaf down the tree - - zip_bl_count[bits + 1] += 2; // move one overflow item as its brother - - zip_bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - - overflow -= 2; - } while (overflow > 0); - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - - - for (bits = max_length; bits != 0; bits--) { - n = zip_bl_count[bits]; - - while (n != 0) { - m = zip_heap[--h]; - if (m > max_code) continue; - - if (tree[m].dl != bits) { - zip_opt_len += (bits - tree[m].dl) * tree[m].fc; - tree[m].fc = bits; - } - - n--; - } - } - } - /* ========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ - - - function zip_gen_codes(tree, // the tree to decorate - max_code) { - // largest code with non zero frequency - var next_code = new Array(zip_MAX_BITS + 1); // next code value for each bit length - - var code = 0; // running code value - - var bits; // bit index - - var n; // code index - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - - for (bits = 1; bits <= zip_MAX_BITS; bits++) { - code = code + zip_bl_count[bits - 1] << 1; - next_code[bits] = code; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - // Assert (code + encoder->bl_count[MAX_BITS]-1 == (1<> 1; n >= 1; n--) { - zip_pqdownheap(tree, n); - } - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - - - do { - n = zip_heap[zip_SMALLEST]; - zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--]; - zip_pqdownheap(tree, zip_SMALLEST); - m = zip_heap[zip_SMALLEST]; // m = node of next least frequency - // keep the nodes sorted by frequency - - zip_heap[--zip_heap_max] = n; - zip_heap[--zip_heap_max] = m; // Create a new node father of n and m - - tree[node].fc = tree[n].fc + tree[m].fc; // depth[node] = (char)(MAX(depth[n], depth[m]) + 1); - - if (zip_depth[n] > zip_depth[m] + 1) zip_depth[node] = zip_depth[n];else zip_depth[node] = zip_depth[m] + 1; - tree[n].dl = tree[m].dl = node; // and insert the new node in the heap - - zip_heap[zip_SMALLEST] = node++; - zip_pqdownheap(tree, zip_SMALLEST); - } while (zip_heap_len >= 2); - - zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST]; - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - - zip_gen_bitlen(desc); // The field len is now set, we can generate the bit codes - - zip_gen_codes(tree, max_code); - } - /* ========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. Updates opt_len to take into account the repeat - * counts. (The contribution of the bit length codes will be added later - * during the construction of bl_tree.) - */ - - - function zip_scan_tree(tree, // the tree to be scanned - max_code) { - // and its largest code of non zero frequency - var n; // iterates over all tree elements - - var prevlen = -1; // last emitted length - - var curlen; // length of current code - - var nextlen = tree[0].dl; // length of next code - - var count = 0; // repeat count of the current code - - var max_count = 7; // max repeat count - - var min_count = 4; // min repeat count - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - - tree[max_code + 1].dl = 0xffff; // guard - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) continue;else if (count < min_count) zip_bl_tree[curlen].fc += count;else if (curlen != 0) { - if (curlen != prevlen) zip_bl_tree[curlen].fc++; - zip_bl_tree[zip_REP_3_6].fc++; - } else if (count <= 10) zip_bl_tree[zip_REPZ_3_10].fc++;else zip_bl_tree[zip_REPZ_11_138].fc++; - count = 0; - prevlen = curlen; - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - /* ========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ - - - function zip_send_tree(tree, // the tree to be scanned - max_code) { - // and its largest code of non zero frequency - var n; // iterates over all tree elements - - var prevlen = -1; // last emitted length - - var curlen; // length of current code - - var nextlen = tree[0].dl; // length of next code - - var count = 0; // repeat count of the current code - - var max_count = 7; // max repeat count - - var min_count = 4; - /* guard already set */ - // min repeat count - - /* tree[max_code+1].dl = -1; */ - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { - zip_SEND_CODE(curlen, zip_bl_tree); - } while (--count != 0); - } else if (curlen != 0) { - if (curlen != prevlen) { - zip_SEND_CODE(curlen, zip_bl_tree); - count--; - } // Assert(count >= 3 && count <= 6, " 3_6?"); - - - zip_SEND_CODE(zip_REP_3_6, zip_bl_tree); - zip_send_bits(count - 3, 2); - } else if (count <= 10) { - zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree); - zip_send_bits(count - 3, 3); - } else { - zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree); - zip_send_bits(count - 11, 7); - } - - count = 0; - prevlen = curlen; - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - /* ========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ - - - function zip_build_bl_tree() { - var max_blindex; // index of last bit length code of non zero freq - // Determine the bit length frequencies for literal and distance trees - - zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code); - zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code); // Build the bit length tree: - - zip_build_tree(zip_bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - - for (max_blindex = zip_BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - - - zip_opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; // Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - // encoder->opt_len, encoder->static_len)); - - return max_blindex; - } - /* ========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ - - - function zip_send_all_trees(lcodes, dcodes, blcodes) { - // number of codes for each tree - var rank; // index in bl_order - // Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - // Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - // "too many codes"); - // Tracev((stderr, "\nbl counts: ")); - - zip_send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt - - zip_send_bits(dcodes - 1, 5); - zip_send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt - - for (rank = 0; rank < blcodes; rank++) { - // Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3); - } // send the literal tree - - - zip_send_tree(zip_dyn_ltree, lcodes - 1); // send the distance tree - - zip_send_tree(zip_dyn_dtree, dcodes - 1); - } - /* ========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ - - - function zip_flush_block(eof) { - // true if this is the last block for a file - var opt_lenb; - var static_lenb; // opt_len and static_len in bytes - - var max_blindex; // index of last bit length code of non zero freq - - var stored_len; // length of input block - - stored_len = zip_strstart - zip_block_start; - zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items - // Construct the literal and distance trees - - zip_build_tree(zip_l_desc); // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", - // encoder->opt_len, encoder->static_len)); - - zip_build_tree(zip_d_desc); // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", - // encoder->opt_len, encoder->static_len)); - - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - - max_blindex = zip_build_bl_tree(); // Determine the best encoding. Compute first the block length in bytes - - opt_lenb = zip_opt_len + 3 + 7 >> 3; - static_lenb = zip_static_len + 3 + 7 >> 3; // Trace((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ", - // opt_lenb, encoder->opt_len, - // static_lenb, encoder->static_len, stored_len, - // encoder->last_lit, encoder->last_dist)); - - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; - - if (stored_len + 4 <= opt_lenb && // 4: two words for the lengths - zip_block_start >= 0) { - var i; - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - - zip_send_bits((zip_STORED_BLOCK << 1) + eof, 3); - /* send block type */ - - zip_bi_windup(); - /* align on byte boundary */ - - zip_put_short(stored_len); - zip_put_short(~stored_len); // copy block - - /* - p = &window[block_start]; - for(i = 0; i < stored_len; i++) - put_byte(p[i]); - */ - - for (i = 0; i < stored_len; i++) { - zip_put_byte(zip_window[zip_block_start + i]); - } - } else if (static_lenb == opt_lenb) { - zip_send_bits((zip_STATIC_TREES << 1) + eof, 3); - zip_compress_block(zip_static_ltree, zip_static_dtree); - } else { - zip_send_bits((zip_DYN_TREES << 1) + eof, 3); - zip_send_all_trees(zip_l_desc.max_code + 1, zip_d_desc.max_code + 1, max_blindex + 1); - zip_compress_block(zip_dyn_ltree, zip_dyn_dtree); - } - - zip_init_block(); - if (eof != 0) zip_bi_windup(); - } - /* ========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ - - - function zip_ct_tally(dist, // distance of matched string - lc) { - // match length-MIN_MATCH or unmatched char (if dist==0) - zip_l_buf[zip_last_lit++] = lc; - - if (dist == 0) { - // lc is the unmatched char - zip_dyn_ltree[lc].fc++; - } else { - // Here, lc is the match length - MIN_MATCH - dist--; // dist = match distance - 1 - // Assert((ush)dist < (ush)MAX_DIST && - // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - // (ush)D_CODE(dist) < (ush)D_CODES, "ct_tally: bad match"); - - zip_dyn_ltree[zip_length_code[lc] + zip_LITERALS + 1].fc++; - zip_dyn_dtree[zip_D_CODE(dist)].fc++; - zip_d_buf[zip_last_dist++] = dist; - zip_flags |= zip_flag_bit; - } - - zip_flag_bit <<= 1; // Output the flags if they fill a byte - - if ((zip_last_lit & 7) == 0) { - zip_flag_buf[zip_last_flags++] = zip_flags; - zip_flags = 0; - zip_flag_bit = 1; - } // Try to guess if it is profitable to stop the current block here - - - if (zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) { - // Compute an upper bound for the compressed length - var out_length = zip_last_lit * 8; - var in_length = zip_strstart - zip_block_start; - var dcode; - - for (dcode = 0; dcode < zip_D_CODES; dcode++) { - out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]); - } - - out_length >>= 3; // Trace((stderr,"\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ", - // encoder->last_lit, encoder->last_dist, in_length, out_length, - // 100L - out_length*100L/in_length)); - - if (zip_last_dist < _parseInt$2(zip_last_lit / 2) && out_length < _parseInt$2(in_length / 2)) return true; - } - - return zip_last_lit == zip_LIT_BUFSIZE - 1 || zip_last_dist == zip_DIST_BUFSIZE; - /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ - } - /* ========================================================================== - * Send the block data compressed using the given Huffman trees - */ - - - function zip_compress_block(ltree, // literal tree - dtree) { - // distance tree - var dist; // distance of matched string - - var lc; // match length or unmatched char (if dist == 0) - - var lx = 0; // running index in l_buf - - var dx = 0; // running index in d_buf - - var fx = 0; // running index in flag_buf - - var flag = 0; // current flags - - var code; // the code to send - - var extra; // number of extra bits to send - - if (zip_last_lit != 0) do { - if ((lx & 7) == 0) flag = zip_flag_buf[fx++]; - lc = zip_l_buf[lx++] & 0xff; - - if ((flag & 1) == 0) { - zip_SEND_CODE(lc, ltree); - /* send a literal byte */ - // Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - // Here, lc is the match length - MIN_MATCH - code = zip_length_code[lc]; - zip_SEND_CODE(code + zip_LITERALS + 1, ltree); // send the length code - - extra = zip_extra_lbits[code]; - - if (extra != 0) { - lc -= zip_base_length[code]; - zip_send_bits(lc, extra); // send the extra length bits - } - - dist = zip_d_buf[dx++]; // Here, dist is the match distance - 1 - - code = zip_D_CODE(dist); // Assert (code < D_CODES, "bad d_code"); - - zip_SEND_CODE(code, dtree); // send the distance code - - extra = zip_extra_dbits[code]; - - if (extra != 0) { - dist -= zip_base_dist[code]; - zip_send_bits(dist, extra); // send the extra distance bits - } - } // literal or match pair ? - - - flag >>= 1; - } while (lx < zip_last_lit); - zip_SEND_CODE(zip_END_BLOCK, ltree); - } - /* ========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ - - - var zip_Buf_size = 16; // bit size of bi_buf - - function zip_send_bits(value, // value to send - length) { - // number of bits - - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (zip_bi_valid > zip_Buf_size - length) { - zip_bi_buf |= value << zip_bi_valid; - zip_put_short(zip_bi_buf); - zip_bi_buf = value >> zip_Buf_size - zip_bi_valid; - zip_bi_valid += length - zip_Buf_size; - } else { - zip_bi_buf |= value << zip_bi_valid; - zip_bi_valid += length; - } - } - /* ========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ - - - function zip_bi_reverse(code, // the value to invert - len) { - // its bit length - var res = 0; - - do { - res |= code & 1; - code >>= 1; - res <<= 1; - } while (--len > 0); - - return res >> 1; - } - /* ========================================================================== - * Write out any remaining bits in an incomplete byte. - */ - - - function zip_bi_windup() { - if (zip_bi_valid > 8) { - zip_put_short(zip_bi_buf); - } else if (zip_bi_valid > 0) { - zip_put_byte(zip_bi_buf); - } - - zip_bi_buf = 0; - zip_bi_valid = 0; - } - - function zip_qoutbuf() { - if (zip_outcnt != 0) { - var q; - var i; - q = zip_new_queue(); - if (zip_qhead == null) zip_qhead = zip_qtail = q;else zip_qtail = zip_qtail.next = q; - q.len = zip_outcnt - zip_outoff; // System.arraycopy(zip_outbuf, zip_outoff, q.ptr, 0, q.len); - - for (i = 0; i < q.len; i++) { - q.ptr[i] = zip_outbuf[zip_outoff + i]; - } - - zip_outcnt = zip_outoff = 0; - } - } - - return function deflate(str, level) { - var i; - var j; - zip_deflate_data = str; - zip_deflate_pos = 0; - if (typeof level === 'undefined') level = zip_DEFAULT_LEVEL; - zip_deflate_start(level); - var buff = new Array(1024); - var aout = []; - - while ((i = zip_deflate_internal(buff, 0, buff.length)) > 0) { - var cbuf = new Array(i); - - for (j = 0; j < i; j++) { - cbuf[j] = String.fromCharCode(buff[j]); - } - - aout[aout.length] = cbuf.join(''); - } - - zip_deflate_data = null; // G.C. - - return aout.join(''); - }; - }(); - - function ownKeys$b(object, enumerableOnly) { var keys = keys$3(object); if (getOwnPropertySymbols$2) { var symbols = getOwnPropertySymbols$2(object); enumerableOnly && (symbols = filter$3(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor$3(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } - - function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? forEach$3(_context4 = ownKeys$b(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : getOwnPropertyDescriptors$2 ? defineProperties$2(target, getOwnPropertyDescriptors$2(source)) : forEach$3(_context5 = ownKeys$b(Object(source))).call(_context5, function (key) { defineProperty$5(target, key, getOwnPropertyDescriptor$3(source, key)); }); } return target; } - - function encode64(data) { - var r = ''; - - for (var i = 0; i < data.length; i += 3) { - if (i + 2 === data.length) { - r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), 0); - } else if (i + 1 === data.length) { - r += append3bytes(data.charCodeAt(i), 0, 0); - } else { - r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), data.charCodeAt(i + 2)); - } - } - - return r; - } - - function append3bytes(b1, b2, b3) { - var c1 = b1 >> 2; - var c2 = (b1 & 0x3) << 4 | b2 >> 4; - var c3 = (b2 & 0xf) << 2 | b3 >> 6; - var c4 = b3 & 0x3f; - var r = ''; - r += encode6bit(c1 & 0x3f); - r += encode6bit(c2 & 0x3f); - r += encode6bit(c3 & 0x3f); - r += encode6bit(c4 & 0x3f); - return r; - } - - function encode6bit(b1) { - var b = b1; - - if (b < 10) { - return String.fromCharCode(48 + b); - } - - b -= 10; - - if (b < 26) { - return String.fromCharCode(65 + b); - } - - b -= 26; - - if (b < 26) { - return String.fromCharCode(97 + b); - } - - b -= 26; - - if (b === 0) { - return '-'; - } - - if (b === 1) { - return '_'; - } - - return '?'; - } - - function compress(s1, url) { - var _context; - - var s = unescape(encodeURIComponent(s1)); - return concat$5(_context = "".concat(url, "/svg/")).call(_context, encode64(deflate(s, 9))); - } - - var PlantUMLCodeEngine = /*#__PURE__*/function () { - function PlantUMLCodeEngine() { - var _plantUMLOptions$base; - - var plantUMLOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, PlantUMLCodeEngine); - - var defaultUrl = 'http://www.plantuml.com/plantuml'; - this.baseUrl = (_plantUMLOptions$base = plantUMLOptions.baseUrl) !== null && _plantUMLOptions$base !== void 0 ? _plantUMLOptions$base : defaultUrl; - } - - _createClass(PlantUMLCodeEngine, [{ - key: "render", - value: function render(src, sign) { - var _context2, _context3; - - var $sign = sign; - - if (!$sign) { - $sign = Math.round(Math.random() * 100000000); - } - - var graphId = concat$5(_context2 = "plantuml-".concat($sign, "-")).call(_context2, new Date().getTime()); - - return concat$5(_context3 = ""); - } - }], [{ - key: "install", - value: function install(cherryOptions, args) { - var _cherryOptions$engine; - - mergeWith_1(cherryOptions, { - engine: { - syntax: { - codeBlock: { - customRenderer: { - plantuml: new PlantUMLCodeEngine(_objectSpread$a(_objectSpread$a({}, args), (_cherryOptions$engine = cherryOptions.engine.syntax.plantuml) !== null && _cherryOptions$engine !== void 0 ? _cherryOptions$engine : {})) - } - } - } - } - }); - } - }]); - - return PlantUMLCodeEngine; - }(); - - /*! For license information please see mermaid.esm.min.mjs.LICENSE.txt */ - var t={2536:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,6],n=[1,7],r=[1,8],i=[1,9],a=[1,16],o=[1,11],s=[1,12],l=[1,13],u=[1,14],h=[1,15],f=[1,27],d=[1,33],p=[1,34],g=[1,35],y=[1,36],m=[1,37],b=[1,72],v=[1,73],_=[1,74],x=[1,75],k=[1,76],w=[1,77],T=[1,78],E=[1,38],C=[1,39],S=[1,40],A=[1,41],M=[1,42],N=[1,43],O=[1,44],D=[1,45],B=[1,46],L=[1,47],I=[1,48],F=[1,49],R=[1,50],P=[1,51],j=[1,52],z=[1,53],Y=[1,54],U=[1,55],$=[1,56],W=[1,57],q=[1,59],H=[1,60],V=[1,61],G=[1,62],X=[1,63],Z=[1,64],Q=[1,65],K=[1,66],J=[1,67],tt=[1,68],et=[1,69],nt=[24,52],rt=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],it=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],at=[1,94],ot=[1,95],st=[1,96],ct=[1,97],lt=[15,24,52],ut=[7,8,9,10,18,22,25,26,27,28],ht=[15,24,43,52],ft=[15,24,43,52,86,87,89,90],dt=[15,43],pt=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],gt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,directive:6,direction_tb:7,direction_bt:8,direction_rl:9,direction_lr:10,graphConfig:11,openDirective:12,typeDirective:13,closeDirective:14,NEWLINE:15,":":16,argDirective:17,open_directive:18,type_directive:19,arg_directive:20,close_directive:21,C4_CONTEXT:22,statements:23,EOF:24,C4_CONTAINER:25,C4_COMPONENT:26,C4_DYNAMIC:27,C4_DEPLOYMENT:28,otherStatements:29,diagramStatements:30,otherStatement:31,title:32,accDescription:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,boundaryStatement:39,boundaryStartStatement:40,boundaryStopStatement:41,boundaryStart:42,LBRACE:43,ENTERPRISE_BOUNDARY:44,attributes:45,SYSTEM_BOUNDARY:46,BOUNDARY:47,CONTAINER_BOUNDARY:48,NODE:49,NODE_L:50,NODE_R:51,RBRACE:52,diagramStatement:53,PERSON:54,PERSON_EXT:55,SYSTEM:56,SYSTEM_DB:57,SYSTEM_QUEUE:58,SYSTEM_EXT:59,SYSTEM_EXT_DB:60,SYSTEM_EXT_QUEUE:61,CONTAINER:62,CONTAINER_DB:63,CONTAINER_QUEUE:64,CONTAINER_EXT:65,CONTAINER_EXT_DB:66,CONTAINER_EXT_QUEUE:67,COMPONENT:68,COMPONENT_DB:69,COMPONENT_QUEUE:70,COMPONENT_EXT:71,COMPONENT_EXT_DB:72,COMPONENT_EXT_QUEUE:73,REL:74,BIREL:75,REL_U:76,REL_D:77,REL_L:78,REL_R:79,REL_B:80,REL_INDEX:81,UPDATE_EL_STYLE:82,UPDATE_REL_STYLE:83,UPDATE_LAYOUT_CONFIG:84,attribute:85,STR:86,STR_KEY:87,STR_VALUE:88,ATTRIBUTE:89,ATTRIBUTE_EMPTY:90,$accept:0,$end:1},terminals_:{2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.setDirection("TB");break;case 5:r.setDirection("BT");break;case 6:r.setDirection("RL");break;case 7:r.setDirection("LR");break;case 11:console.log("open_directive: ",a[s]),r.parseDirective("%%{","open_directive");break;case 12:break;case 13:a[s]=a[s].trim().replace(/'/g,'"'),console.log("arg_directive: ",a[s]),r.parseDirective(a[s],"arg_directive");break;case 14:console.log("close_directive: ",a[s]),r.parseDirective("}%%","close_directive","c4Context");break;case 15:case 16:case 17:case 18:case 19:r.setC4Type(a[s-3]);break;case 26:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 27:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 28:this.$=a[s].trim(),r.setTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:case 36:console.log(a[s-1],JSON.stringify(a[s])),a[s].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 37:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 38:console.log(a[s-1],JSON.stringify(a[s])),a[s].splice(2,0,"CONTAINER"),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 39:console.log(a[s-1],JSON.stringify(a[s])),r.addDeploymentNode("node",...a[s]),this.$=a[s];break;case 40:console.log(a[s-1],JSON.stringify(a[s])),r.addDeploymentNode("nodeL",...a[s]),this.$=a[s];break;case 41:console.log(a[s-1],JSON.stringify(a[s])),r.addDeploymentNode("nodeR",...a[s]),this.$=a[s];break;case 42:r.popBoundaryParseStack();break;case 46:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("person",...a[s]),this.$=a[s];break;case 47:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("external_person",...a[s]),this.$=a[s];break;case 48:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("system",...a[s]),this.$=a[s];break;case 49:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("system_db",...a[s]),this.$=a[s];break;case 50:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("system_queue",...a[s]),this.$=a[s];break;case 51:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("external_system",...a[s]),this.$=a[s];break;case 52:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("external_system_db",...a[s]),this.$=a[s];break;case 53:console.log(a[s-1],JSON.stringify(a[s])),r.addPersonOrSystem("external_system_queue",...a[s]),this.$=a[s];break;case 54:console.log(a[s-1],JSON.stringify(a[s])),r.addContainer("container",...a[s]),this.$=a[s];break;case 55:console.log(a[s-1],JSON.stringify(a[s])),r.addContainer("container_db",...a[s]),this.$=a[s];break;case 56:console.log(a[s-1],JSON.stringify(a[s])),r.addContainer("container_queue",...a[s]),this.$=a[s];break;case 57:console.log(a[s-1],JSON.stringify(a[s])),r.addContainer("external_container",...a[s]),this.$=a[s];break;case 58:console.log(a[s-1],JSON.stringify(a[s])),r.addContainer("external_container_db",...a[s]),this.$=a[s];break;case 59:console.log(a[s-1],JSON.stringify(a[s])),r.addContainer("external_container_queue",...a[s]),this.$=a[s];break;case 60:console.log(a[s-1],JSON.stringify(a[s])),r.addComponent("component",...a[s]),this.$=a[s];break;case 61:console.log(a[s-1],JSON.stringify(a[s])),r.addComponent("component_db",...a[s]),this.$=a[s];break;case 62:console.log(a[s-1],JSON.stringify(a[s])),r.addComponent("component_queue",...a[s]),this.$=a[s];break;case 63:console.log(a[s-1],JSON.stringify(a[s])),r.addComponent("external_component",...a[s]),this.$=a[s];break;case 64:console.log(a[s-1],JSON.stringify(a[s])),r.addComponent("external_component_db",...a[s]),this.$=a[s];break;case 65:console.log(a[s-1],JSON.stringify(a[s])),r.addComponent("external_component_queue",...a[s]),this.$=a[s];break;case 67:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("rel",...a[s]),this.$=a[s];break;case 68:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("birel",...a[s]),this.$=a[s];break;case 69:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("rel_u",...a[s]),this.$=a[s];break;case 70:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("rel_d",...a[s]),this.$=a[s];break;case 71:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("rel_l",...a[s]),this.$=a[s];break;case 72:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("rel_r",...a[s]),this.$=a[s];break;case 73:console.log(a[s-1],JSON.stringify(a[s])),r.addRel("rel_b",...a[s]),this.$=a[s];break;case 74:console.log(a[s-1],JSON.stringify(a[s])),a[s].splice(0,1),r.addRel("rel",...a[s]),this.$=a[s];break;case 75:console.log(a[s-1],JSON.stringify(a[s])),r.updateElStyle("update_el_style",...a[s]),this.$=a[s];break;case 76:console.log(a[s-1],JSON.stringify(a[s])),r.updateRelStyle("update_rel_style",...a[s]),this.$=a[s];break;case 77:console.log(a[s-1],JSON.stringify(a[s])),r.updateLayoutConfig("update_layout_config",...a[s]),this.$=a[s];break;case 78:console.log("PUSH ATTRIBUTE: ",a[s]),this.$=[a[s]];break;case 79:console.log("PUSH ATTRIBUTE: ",a[s-1]),a[s].unshift(a[s-1]),this.$=a[s];break;case 80:case 82:this.$=a[s].trim();break;case 81:console.log("kv: ",a[s-1],a[s]);let t={};t[a[s-1].trim()]=a[s].trim(),this.$=t;break;case 83:this.$="";}},table:[{3:1,4:2,5:3,6:4,7:e,8:n,9:r,10:i,11:5,12:10,18:a,22:o,25:s,26:l,27:u,28:h},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:e,8:n,9:r,10:i,11:5,12:10,18:a,22:o,25:s,26:l,27:u,28:h},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:f},t([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:d,33:p,34:g,36:y,38:m,39:58,40:70,42:71,44:b,46:v,47:_,48:x,49:k,50:w,51:T,53:32,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et},{23:79,29:29,30:30,31:31,32:d,33:p,34:g,36:y,38:m,39:58,40:70,42:71,44:b,46:v,47:_,48:x,49:k,50:w,51:T,53:32,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et},{23:80,29:29,30:30,31:31,32:d,33:p,34:g,36:y,38:m,39:58,40:70,42:71,44:b,46:v,47:_,48:x,49:k,50:w,51:T,53:32,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et},{23:81,29:29,30:30,31:31,32:d,33:p,34:g,36:y,38:m,39:58,40:70,42:71,44:b,46:v,47:_,48:x,49:k,50:w,51:T,53:32,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et},{23:82,29:29,30:30,31:31,32:d,33:p,34:g,36:y,38:m,39:58,40:70,42:71,44:b,46:v,47:_,48:x,49:k,50:w,51:T,53:32,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},t(nt,[2,20],{53:32,39:58,40:70,42:71,30:87,44:b,46:v,47:_,48:x,49:k,50:w,51:T,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et}),t(nt,[2,21]),t(rt,[2,23],{15:[1,88]}),t(nt,[2,43],{15:[1,89]}),t(it,[2,26]),t(it,[2,27]),{35:[1,90]},{37:[1,91]},t(it,[2,30]),{45:92,85:93,86:at,87:ot,89:st,90:ct},{45:98,85:93,86:at,87:ot,89:st,90:ct},{45:99,85:93,86:at,87:ot,89:st,90:ct},{45:100,85:93,86:at,87:ot,89:st,90:ct},{45:101,85:93,86:at,87:ot,89:st,90:ct},{45:102,85:93,86:at,87:ot,89:st,90:ct},{45:103,85:93,86:at,87:ot,89:st,90:ct},{45:104,85:93,86:at,87:ot,89:st,90:ct},{45:105,85:93,86:at,87:ot,89:st,90:ct},{45:106,85:93,86:at,87:ot,89:st,90:ct},{45:107,85:93,86:at,87:ot,89:st,90:ct},{45:108,85:93,86:at,87:ot,89:st,90:ct},{45:109,85:93,86:at,87:ot,89:st,90:ct},{45:110,85:93,86:at,87:ot,89:st,90:ct},{45:111,85:93,86:at,87:ot,89:st,90:ct},{45:112,85:93,86:at,87:ot,89:st,90:ct},{45:113,85:93,86:at,87:ot,89:st,90:ct},{45:114,85:93,86:at,87:ot,89:st,90:ct},{45:115,85:93,86:at,87:ot,89:st,90:ct},{45:116,85:93,86:at,87:ot,89:st,90:ct},t(lt,[2,66]),{45:117,85:93,86:at,87:ot,89:st,90:ct},{45:118,85:93,86:at,87:ot,89:st,90:ct},{45:119,85:93,86:at,87:ot,89:st,90:ct},{45:120,85:93,86:at,87:ot,89:st,90:ct},{45:121,85:93,86:at,87:ot,89:st,90:ct},{45:122,85:93,86:at,87:ot,89:st,90:ct},{45:123,85:93,86:at,87:ot,89:st,90:ct},{45:124,85:93,86:at,87:ot,89:st,90:ct},{45:125,85:93,86:at,87:ot,89:st,90:ct},{45:126,85:93,86:at,87:ot,89:st,90:ct},{45:127,85:93,86:at,87:ot,89:st,90:ct},{30:128,39:58,40:70,42:71,44:b,46:v,47:_,48:x,49:k,50:w,51:T,53:32,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et},{15:[1,130],43:[1,129]},{45:131,85:93,86:at,87:ot,89:st,90:ct},{45:132,85:93,86:at,87:ot,89:st,90:ct},{45:133,85:93,86:at,87:ot,89:st,90:ct},{45:134,85:93,86:at,87:ot,89:st,90:ct},{45:135,85:93,86:at,87:ot,89:st,90:ct},{45:136,85:93,86:at,87:ot,89:st,90:ct},{45:137,85:93,86:at,87:ot,89:st,90:ct},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},t(ut,[2,9]),{14:142,21:f},{21:[2,13]},{1:[2,15]},t(nt,[2,22]),t(rt,[2,24],{31:31,29:143,32:d,33:p,34:g,36:y,38:m}),t(nt,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:d,33:p,34:g,36:y,38:m,44:b,46:v,47:_,48:x,49:k,50:w,51:T,54:E,55:C,56:S,57:A,58:M,59:N,60:O,61:D,62:B,63:L,64:I,65:F,66:R,67:P,68:j,69:z,70:Y,71:U,72:$,73:W,74:q,75:H,76:V,77:G,78:X,79:Z,80:Q,81:K,82:J,83:tt,84:et}),t(it,[2,28]),t(it,[2,29]),t(lt,[2,46]),t(ht,[2,78],{85:93,45:145,86:at,87:ot,89:st,90:ct}),t(ft,[2,80]),{88:[1,146]},t(ft,[2,82]),t(ft,[2,83]),t(lt,[2,47]),t(lt,[2,48]),t(lt,[2,49]),t(lt,[2,50]),t(lt,[2,51]),t(lt,[2,52]),t(lt,[2,53]),t(lt,[2,54]),t(lt,[2,55]),t(lt,[2,56]),t(lt,[2,57]),t(lt,[2,58]),t(lt,[2,59]),t(lt,[2,60]),t(lt,[2,61]),t(lt,[2,62]),t(lt,[2,63]),t(lt,[2,64]),t(lt,[2,65]),t(lt,[2,67]),t(lt,[2,68]),t(lt,[2,69]),t(lt,[2,70]),t(lt,[2,71]),t(lt,[2,72]),t(lt,[2,73]),t(lt,[2,74]),t(lt,[2,75]),t(lt,[2,76]),t(lt,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},t(dt,[2,35]),t(dt,[2,36]),t(dt,[2,37]),t(dt,[2,38]),t(dt,[2,39]),t(dt,[2,40]),t(dt,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},t(rt,[2,25]),t(nt,[2,45]),t(ht,[2,79]),t(ft,[2,81]),t(lt,[2,31]),t(lt,[2,42]),t(pt,[2,32]),t(pt,[2,33],{15:[1,152]}),t(ut,[2,10]),t(pt,[2,34])],defaultActions:{2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},yt={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),18;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 10;case 5:return this.begin("type_directive"),19;case 6:return this.popState(),this.begin("arg_directive"),16;case 7:return this.popState(),this.popState(),21;case 8:return 20;case 9:return 32;case 10:return 33;case 11:return this.begin("acc_title"),34;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),36;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:this.popState();break;case 17:return "acc_descr_multiline_value";case 18:case 21:break;case 19:c;break;case 20:return 15;case 22:return 22;case 23:return 25;case 24:return 26;case 25:return 27;case 26:return 28;case 27:return this.begin("person_ext"),console.log("begin person_ext"),55;case 28:return this.begin("person"),console.log("begin person"),54;case 29:return this.begin("system_ext_queue"),console.log("begin system_ext_queue"),61;case 30:return this.begin("system_ext_db"),console.log("begin system_ext_db"),60;case 31:return this.begin("system_ext"),console.log("begin system_ext"),59;case 32:return this.begin("system_queue"),console.log("begin system_queue"),58;case 33:return this.begin("system_db"),console.log("begin system_db"),57;case 34:return this.begin("system"),console.log("begin system"),56;case 35:return this.begin("boundary"),console.log("begin boundary"),47;case 36:return this.begin("enterprise_boundary"),console.log("begin enterprise_boundary"),44;case 37:return this.begin("system_boundary"),console.log("begin system_boundary"),46;case 38:return this.begin("container_ext_queue"),console.log("begin container_ext_queue"),67;case 39:return this.begin("container_ext_db"),console.log("begin container_ext_db"),66;case 40:return this.begin("container_ext"),console.log("begin container_ext"),65;case 41:return this.begin("container_queue"),console.log("begin container_queue"),64;case 42:return this.begin("container_db"),console.log("begin container_db"),63;case 43:return this.begin("container"),console.log("begin container"),62;case 44:return this.begin("container_boundary"),console.log("begin container_boundary"),48;case 45:return this.begin("component_ext_queue"),console.log("begin component_ext_queue"),73;case 46:return this.begin("component_ext_db"),console.log("begin component_ext_db"),72;case 47:return this.begin("component_ext"),console.log("begin component_ext"),71;case 48:return this.begin("component_queue"),console.log("begin component_queue"),70;case 49:return this.begin("component_db"),console.log("begin component_db"),69;case 50:return this.begin("component"),console.log("begin component"),68;case 51:case 52:return this.begin("node"),console.log("begin node"),49;case 53:return this.begin("node_l"),console.log("begin node_l"),50;case 54:return this.begin("node_r"),console.log("begin node_r"),51;case 55:return this.begin("rel"),console.log("begin rel"),74;case 56:return this.begin("birel"),console.log("begin birel"),75;case 57:case 58:return this.begin("rel_u"),console.log("begin rel_u"),76;case 59:case 60:return this.begin("rel_d"),console.log("begin rel_d"),77;case 61:case 62:return this.begin("rel_l"),console.log("begin rel_l"),78;case 63:case 64:return this.begin("rel_r"),console.log("begin rel_r"),79;case 65:return this.begin("rel_b"),console.log("begin rel_b"),80;case 66:return this.begin("rel_index"),console.log("begin rel_index"),81;case 67:return this.begin("update_el_style"),console.log("begin update_el_style"),82;case 68:return this.begin("update_rel_style"),console.log("begin update_rel_style"),83;case 69:return this.begin("update_layout_config"),console.log("begin update_layout_config"),84;case 70:return "EOF_IN_STRUCT";case 71:return console.log("begin attribute with ATTRIBUTE_EMPTY"),this.begin("attribute"),"ATTRIBUTE_EMPTY";case 72:console.log("begin attribute"),this.begin("attribute");break;case 73:console.log("STOP attribute"),this.popState(),console.log("STOP diagram"),this.popState();break;case 74:return console.log(",,"),90;case 75:console.log(",");break;case 76:return console.log("ATTRIBUTE_EMPTY"),90;case 77:console.log("begin string"),this.begin("string");break;case 78:console.log("STOP string"),this.popState();break;case 79:return console.log("STR"),"STR";case 80:console.log("begin string_kv"),this.begin("string_kv");break;case 81:return console.log("STR_KEY"),this.begin("string_kv_key"),"STR_KEY";case 82:console.log("begin string_kv_value"),this.popState(),this.begin("string_kv_value");break;case 83:return console.log("STR_VALUE"),"STR_VALUE";case 84:console.log("STOP string_kv_value"),this.popState(),this.popState();break;case 85:return console.log("not STR"),"STR";case 86:return console.log("begin boundary block"),"LBRACE";case 87:return console.log("STOP boundary block"),"RBRACE";case 88:return "SPACE";case 89:return "EOL";case 90:return 24}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},string_kv_value:{rules:[83,84],inclusive:!1},string_kv_key:{rules:[82],inclusive:!1},string_kv:{rules:[81],inclusive:!1},string:{rules:[78,79],inclusive:!1},attribute:{rules:[73,74,75,76,77,80,85],inclusive:!1},update_layout_config:{rules:[70,71,72,73],inclusive:!1},update_rel_style:{rules:[70,71,72,73],inclusive:!1},update_el_style:{rules:[70,71,72,73],inclusive:!1},rel_b:{rules:[70,71,72,73],inclusive:!1},rel_r:{rules:[70,71,72,73],inclusive:!1},rel_l:{rules:[70,71,72,73],inclusive:!1},rel_d:{rules:[70,71,72,73],inclusive:!1},rel_u:{rules:[70,71,72,73],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[70,71,72,73],inclusive:!1},node_r:{rules:[70,71,72,73],inclusive:!1},node_l:{rules:[70,71,72,73],inclusive:!1},node:{rules:[70,71,72,73],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[70,71,72,73],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[70,71,72,73],inclusive:!1},component_ext:{rules:[70,71,72,73],inclusive:!1},component_queue:{rules:[70,71,72,73],inclusive:!1},component_db:{rules:[70,71,72,73],inclusive:!1},component:{rules:[70,71,72,73],inclusive:!1},container_boundary:{rules:[70,71,72,73],inclusive:!1},container_ext_queue:{rules:[],inclusive:!1},container_ext_db:{rules:[70,71,72,73],inclusive:!1},container_ext:{rules:[70,71,72,73],inclusive:!1},container_queue:{rules:[70,71,72,73],inclusive:!1},container_db:{rules:[70,71,72,73],inclusive:!1},container:{rules:[70,71,72,73],inclusive:!1},birel:{rules:[70,71,72,73],inclusive:!1},system_boundary:{rules:[70,71,72,73],inclusive:!1},enterprise_boundary:{rules:[70,71,72,73],inclusive:!1},boundary:{rules:[70,71,72,73],inclusive:!1},system_ext_queue:{rules:[70,71,72,73],inclusive:!1},system_ext_db:{rules:[70,71,72,73],inclusive:!1},system_ext:{rules:[70,71,72,73],inclusive:!1},system_queue:{rules:[70,71,72,73],inclusive:!1},system_db:{rules:[70,71,72,73],inclusive:!1},system:{rules:[70,71,72,73],inclusive:!1},person_ext:{rules:[70,71,72,73],inclusive:!1},person:{rules:[70,71,72,73],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,86,87,88,89,90],inclusive:!0}}};function mt(){this.yy={};}return gt.lexer=yt,mt.prototype=gt,gt.Parser=mt,new mt}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(555).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},1362:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,3],n=[1,7],r=[1,8],i=[1,9],a=[1,10],o=[1,13],s=[1,12],c=[1,16,25],l=[1,20],u=[1,31],h=[1,32],f=[1,33],d=[1,35],p=[1,38],g=[1,36],y=[1,37],m=[1,39],b=[1,40],v=[1,41],_=[1,42],x=[1,45],k=[1,46],w=[1,47],T=[1,48],E=[16,25],C=[1,62],S=[1,63],A=[1,64],M=[1,65],N=[1,66],O=[1,67],D=[1,68],B=[16,25,32,44,45,53,56,57,58,59,60,61,62,67,69],L=[16,25,30,32,44,45,49,53,56,57,58,59,60,61,62,67,69,84,85,86,87],I=[5,8,9,10,11,16,19,23,25],F=[53,84,85,86,87],R=[53,61,62,84,85,86,87],P=[53,56,57,58,59,60,84,85,86,87],j=[16,25,32],z=[1,100],Y={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statments:5,direction:6,directive:7,direction_tb:8,direction_bt:9,direction_rl:10,direction_lr:11,graphConfig:12,openDirective:13,typeDirective:14,closeDirective:15,NEWLINE:16,":":17,argDirective:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,CLASS_DIAGRAM:23,statements:24,EOF:25,statement:26,className:27,alphaNumToken:28,classLiteralName:29,GENERICTYPE:30,relationStatement:31,LABEL:32,classStatement:33,methodStatement:34,annotationStatement:35,clickStatement:36,cssClassStatement:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,CLASS:43,STYLE_SEPARATOR:44,STRUCT_START:45,members:46,STRUCT_STOP:47,ANNOTATION_START:48,ANNOTATION_END:49,MEMBER:50,SEPARATOR:51,relation:52,STR:53,relationType:54,lineType:55,AGGREGATION:56,EXTENSION:57,COMPOSITION:58,DEPENDENCY:59,LOLLIPOP:60,LINE:61,DOTTED_LINE:62,CALLBACK:63,LINK:64,LINK_TARGET:65,CLICK:66,CALLBACK_NAME:67,CALLBACK_ARGS:68,HREF:69,CSSCLASS:70,commentToken:71,textToken:72,graphCodeTokens:73,textNoTagsToken:74,TAGSTART:75,TAGEND:76,"==":77,"--":78,PCT:79,DEFAULT:80,SPACE:81,MINUS:82,keywords:83,UNICODE_TEXT:84,NUM:85,ALPHA:86,BQUOTE_STR:87,$accept:0,$end:1},terminals_:{2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"CLASS",44:"STYLE_SEPARATOR",45:"STRUCT_START",47:"STRUCT_STOP",48:"ANNOTATION_START",49:"ANNOTATION_END",50:"MEMBER",51:"SEPARATOR",53:"STR",56:"AGGREGATION",57:"EXTENSION",58:"COMPOSITION",59:"DEPENDENCY",60:"LOLLIPOP",61:"LINE",62:"DOTTED_LINE",63:"CALLBACK",64:"LINK",65:"LINK_TARGET",66:"CLICK",67:"CALLBACK_NAME",68:"CALLBACK_ARGS",69:"HREF",70:"CSSCLASS",73:"graphCodeTokens",75:"TAGSTART",76:"TAGEND",77:"==",78:"--",79:"PCT",80:"DEFAULT",81:"SPACE",82:"MINUS",83:"keywords",84:"UNICODE_TEXT",85:"NUM",86:"ALPHA",87:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[46,1],[46,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[52,3],[52,2],[52,2],[52,1],[54,1],[54,1],[54,1],[54,1],[54,1],[55,1],[55,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[71,1],[71,1],[72,1],[72,1],[72,1],[72,1],[72,1],[72,1],[72,1],[74,1],[74,1],[74,1],[74,1],[28,1],[28,1],[28,1],[29,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setDirection("TB");break;case 6:r.setDirection("BT");break;case 7:r.setDirection("RL");break;case 8:r.setDirection("LR");break;case 12:r.parseDirective("%%{","open_directive");break;case 13:r.parseDirective(a[s],"type_directive");break;case 14:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 15:r.parseDirective("}%%","close_directive","class");break;case 20:case 21:this.$=a[s];break;case 22:this.$=a[s-1]+a[s];break;case 23:case 24:this.$=a[s-1]+"~"+a[s];break;case 25:r.addRelation(a[s]);break;case 26:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 34:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 35:case 36:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 37:r.addClass(a[s]);break;case 38:r.addClass(a[s-2]),r.setCssClass(a[s-2],a[s]);break;case 39:r.addClass(a[s-3]),r.addMembers(a[s-3],a[s-1]);break;case 40:r.addClass(a[s-5]),r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 41:r.addAnnotation(a[s],a[s-2]);break;case 42:this.$=[a[s]];break;case 43:a[s].push(a[s-1]),this.$=a[s];break;case 44:case 46:case 47:break;case 45:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 48:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 49:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 50:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 51:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 52:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 53:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 54:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 55:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 56:this.$=r.relationType.AGGREGATION;break;case 57:this.$=r.relationType.EXTENSION;break;case 58:this.$=r.relationType.COMPOSITION;break;case 59:this.$=r.relationType.DEPENDENCY;break;case 60:this.$=r.relationType.LOLLIPOP;break;case 61:this.$=r.lineType.LINE;break;case 62:this.$=r.lineType.DOTTED_LINE;break;case 63:case 69:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 64:case 70:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 65:case 73:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 66:case 74:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 67:case 75:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 68:case 76:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 71:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 72:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 77:r.setCssClass(a[s-1],a[s]);}},table:[{3:1,4:2,5:e,6:4,7:5,8:n,9:r,10:i,11:a,12:6,13:11,19:o,23:s},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:e,6:4,7:5,8:n,9:r,10:i,11:a,12:6,13:11,19:o,23:s},{1:[2,9]},t(c,[2,5]),t(c,[2,6]),t(c,[2,7]),t(c,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:l},t([17,22],[2,13]),{6:30,7:29,8:n,9:r,10:i,11:a,13:11,19:o,24:21,26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:u,40:h,42:f,43:d,48:p,50:g,51:y,63:m,64:b,66:v,70:_,84:x,85:k,86:w,87:T},{16:[1,49]},{18:50,21:[1,51]},{16:[2,15]},{25:[1,52]},{16:[1,53],25:[2,17]},t(E,[2,25],{32:[1,54]}),t(E,[2,27]),t(E,[2,28]),t(E,[2,29]),t(E,[2,30]),t(E,[2,31]),t(E,[2,32]),t(E,[2,33]),{39:[1,55]},{41:[1,56]},t(E,[2,36]),t(E,[2,44],{52:57,54:60,55:61,32:[1,59],53:[1,58],56:C,57:S,58:A,59:M,60:N,61:O,62:D}),{27:69,28:43,29:44,84:x,85:k,86:w,87:T},t(E,[2,46]),t(E,[2,47]),{28:70,84:x,85:k,86:w},{27:71,28:43,29:44,84:x,85:k,86:w,87:T},{27:72,28:43,29:44,84:x,85:k,86:w,87:T},{27:73,28:43,29:44,84:x,85:k,86:w,87:T},{53:[1,74]},t(B,[2,20],{28:43,29:44,27:75,30:[1,76],84:x,85:k,86:w,87:T}),t(B,[2,21],{30:[1,77]}),t(L,[2,91]),t(L,[2,92]),t(L,[2,93]),t([16,25,30,32,44,45,53,56,57,58,59,60,61,62,67,69],[2,94]),t(I,[2,10]),{15:78,22:l},{22:[2,14]},{1:[2,16]},{6:30,7:29,8:n,9:r,10:i,11:a,13:11,19:o,24:79,25:[2,18],26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:u,40:h,42:f,43:d,48:p,50:g,51:y,63:m,64:b,66:v,70:_,84:x,85:k,86:w,87:T},t(E,[2,26]),t(E,[2,34]),t(E,[2,35]),{27:80,28:43,29:44,53:[1,81],84:x,85:k,86:w,87:T},{52:82,54:60,55:61,56:C,57:S,58:A,59:M,60:N,61:O,62:D},t(E,[2,45]),{55:83,61:O,62:D},t(F,[2,55],{54:84,56:C,57:S,58:A,59:M,60:N}),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,59]),t(R,[2,60]),t(P,[2,61]),t(P,[2,62]),t(E,[2,37],{44:[1,85],45:[1,86]}),{49:[1,87]},{53:[1,88]},{53:[1,89]},{67:[1,90],69:[1,91]},{28:92,84:x,85:k,86:w},t(B,[2,22]),t(B,[2,23]),t(B,[2,24]),{16:[1,93]},{25:[2,19]},t(j,[2,48]),{27:94,28:43,29:44,84:x,85:k,86:w,87:T},{27:95,28:43,29:44,53:[1,96],84:x,85:k,86:w,87:T},t(F,[2,54],{54:97,56:C,57:S,58:A,59:M,60:N}),t(F,[2,53]),{28:98,84:x,85:k,86:w},{46:99,50:z},{27:101,28:43,29:44,84:x,85:k,86:w,87:T},t(E,[2,63],{53:[1,102]}),t(E,[2,65],{53:[1,104],65:[1,103]}),t(E,[2,69],{53:[1,105],68:[1,106]}),t(E,[2,73],{53:[1,108],65:[1,107]}),t(E,[2,77]),t(I,[2,11]),t(j,[2,50]),t(j,[2,49]),{27:109,28:43,29:44,84:x,85:k,86:w,87:T},t(F,[2,52]),t(E,[2,38],{45:[1,110]}),{47:[1,111]},{46:112,47:[2,42],50:z},t(E,[2,41]),t(E,[2,64]),t(E,[2,66]),t(E,[2,67],{65:[1,113]}),t(E,[2,70]),t(E,[2,71],{53:[1,114]}),t(E,[2,74]),t(E,[2,75],{65:[1,115]}),t(j,[2,51]),{46:116,50:z},t(E,[2,39]),{47:[2,43]},t(E,[2,68]),t(E,[2,72]),t(E,[2,76]),{47:[1,117]},t(E,[2,40])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],51:[2,14],52:[2,16],79:[2,19],112:[2,43]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},U={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),19;case 1:return 8;case 2:return 9;case 3:return 10;case 4:return 11;case 5:return this.begin("type_directive"),20;case 6:return this.popState(),this.begin("arg_directive"),17;case 7:return this.popState(),this.popState(),22;case 8:return 21;case 9:case 10:case 19:case 27:break;case 11:return this.begin("acc_title"),38;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),40;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 37:case 40:case 43:case 46:case 49:case 52:this.popState();break;case 17:return "acc_descr_multiline_value";case 18:return 16;case 20:case 21:return 23;case 22:return this.begin("struct"),45;case 23:return "EDGE_STATE";case 24:return "EOF_IN_STRUCT";case 25:return "OPEN_IN_STRUCT";case 26:return this.popState(),47;case 28:return "MEMBER";case 29:return 43;case 30:return 70;case 31:return 63;case 32:return 64;case 33:return 66;case 34:return 48;case 35:return 49;case 36:this.begin("generic");break;case 38:return "GENERICTYPE";case 39:this.begin("string");break;case 41:return "STR";case 42:this.begin("bqstring");break;case 44:return "BQUOTE_STR";case 45:this.begin("href");break;case 47:return 69;case 48:this.begin("callback_name");break;case 50:this.popState(),this.begin("callback_args");break;case 51:return 67;case 53:return 68;case 54:case 55:case 56:case 57:return 65;case 58:case 59:return 57;case 60:case 61:return 59;case 62:return 58;case 63:return 56;case 64:return 60;case 65:return 61;case 66:return 62;case 67:return 32;case 68:return 44;case 69:return 82;case 70:return "DOT";case 71:return "PLUS";case 72:return 79;case 73:case 74:return "EQUALS";case 75:return 86;case 76:return "PUNCTUATION";case 77:return 85;case 78:return 84;case 79:return 81;case 80:return 25}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:\[\*\])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},callback_args:{rules:[52,53],inclusive:!1},callback_name:{rules:[49,50,51],inclusive:!1},href:{rules:[46,47],inclusive:!1},struct:{rules:[23,24,25,26,27,28],inclusive:!1},generic:{rules:[37,38],inclusive:!1},bqstring:{rules:[43,44],inclusive:!1},string:{rules:[40,41],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,29,30,31,32,33,34,35,36,39,42,45,48,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],inclusive:!0}}};function $(){this.yy={};}return Y.lexer=U,$.prototype=Y,Y.Parser=$,new $}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(8218).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},5890:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,5],r=[6,9,11,23,25,27,29,30,49],i=[1,17],a=[1,18],o=[1,19],s=[1,20],c=[1,21],l=[1,24],u=[1,29],h=[1,30],f=[1,31],d=[1,32],p=[6,9,11,15,20,23,25,27,29,30,42,43,44,45,49],g=[1,45],y=[30,46,47],m=[4,6,9,11,23,25,27,29,30,49],b=[42,43,44,45],v=[22,37],_=[1,64],x={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,entityName:17,relSpec:18,role:19,BLOCK_START:20,attributes:21,BLOCK_STOP:22,title:23,title_value:24,acc_title:25,acc_title_value:26,acc_descr:27,acc_descr_value:28,acc_descr_multiline_value:29,ALPHANUM:30,".":31,attribute:32,attributeType:33,attributeName:34,attributeKeyType:35,attributeComment:36,ATTRIBUTE_WORD:37,ATTRIBUTE_KEY:38,COMMENT:39,cardinality:40,relType:41,ZERO_OR_ONE:42,ZERO_OR_MORE:43,ONE_OR_MORE:44,ONLY_ONE:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,open_directive:49,type_directive:50,arg_directive:51,close_directive:52,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:".",37:"ATTRIBUTE_WORD",38:"ATTRIBUTE_KEY",39:"COMMENT",42:"ZERO_OR_ONE",43:"ZERO_OR_MORE",44:"ONE_OR_MORE",45:"ONLY_ONE",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,3],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[36,1],[18,3],[40,1],[40,1],[40,1],[40,1],[41,1],[41,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 3:case 7:case 8:this.$=[];break;case 4:a[s-1].push(a[s]),this.$=a[s-1];break;case 5:case 6:case 20:case 28:case 29:case 30:case 40:this.$=a[s];break;case 12:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 13:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s]);break;case 16:case 17:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 18:case 19:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 21:this.$=a[s-2]+a[s-1]+a[s];break;case 22:this.$=[a[s]];break;case 23:a[s].push(a[s-1]),this.$=a[s];break;case 24:this.$={attributeType:a[s-1],attributeName:a[s]};break;case 25:this.$={attributeType:a[s-2],attributeName:a[s-1],attributeKeyType:a[s]};break;case 26:this.$={attributeType:a[s-2],attributeName:a[s-1],attributeComment:a[s]};break;case 27:this.$={attributeType:a[s-3],attributeName:a[s-2],attributeKeyType:a[s-1],attributeComment:a[s]};break;case 31:case 39:this.$=a[s].replace(/"/g,"");break;case 32:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 33:this.$=r.Cardinality.ZERO_OR_ONE;break;case 34:this.$=r.Cardinality.ZERO_OR_MORE;break;case 35:this.$=r.Cardinality.ONE_OR_MORE;break;case 36:this.$=r.Cardinality.ONLY_ONE;break;case 37:this.$=r.Identification.NON_IDENTIFYING;break;case 38:this.$=r.Identification.IDENTIFYING;break;case 41:r.parseDirective("%%{","open_directive");break;case 42:r.parseDirective(a[s],"type_directive");break;case 43:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 44:r.parseDirective("}%%","close_directive","er");}},table:[{3:1,4:e,7:3,12:4,49:n},{1:[3]},t(r,[2,3],{5:6}),{3:7,4:e,7:3,12:4,49:n},{13:8,50:[1,9]},{50:[2,41]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:i,25:a,27:o,29:s,30:c,49:n},{1:[2,2]},{14:22,15:[1,23],52:l},t([15,52],[2,42]),t(r,[2,8],{1:[2,1]}),t(r,[2,4]),{7:15,10:25,12:4,17:16,23:i,25:a,27:o,29:s,30:c,49:n},t(r,[2,6]),t(r,[2,7]),t(r,[2,11]),t(r,[2,15],{18:26,40:28,20:[1,27],42:u,43:h,44:f,45:d}),{24:[1,33]},{26:[1,34]},{28:[1,35]},t(r,[2,19]),t(p,[2,20],{31:[1,36]}),{11:[1,37]},{16:38,51:[1,39]},{11:[2,44]},t(r,[2,5]),{17:40,30:c},{21:41,22:[1,42],32:43,33:44,37:g},{41:46,46:[1,47],47:[1,48]},t(y,[2,33]),t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(r,[2,16]),t(r,[2,17]),t(r,[2,18]),{17:49,30:c},t(m,[2,9]),{14:50,52:l},{52:[2,43]},{15:[1,51]},{22:[1,52]},t(r,[2,14]),{21:53,22:[2,22],32:43,33:44,37:g},{34:54,37:[1,55]},{37:[2,28]},{40:56,42:u,43:h,44:f,45:d},t(b,[2,37]),t(b,[2,38]),t(p,[2,21]),{11:[1,57]},{19:58,30:[1,60],48:[1,59]},t(r,[2,13]),{22:[2,23]},t(v,[2,24],{35:61,36:62,38:[1,63],39:_}),t([22,37,38,39],[2,29]),{30:[2,32]},t(m,[2,10]),t(r,[2,12]),t(r,[2,39]),t(r,[2,40]),t(v,[2,25],{36:65,39:_}),t(v,[2,26]),t([22,37,39],[2,30]),t(v,[2,31]),t(v,[2,27])],defaultActions:{5:[2,41],7:[2,2],24:[2,44],39:[2,43],45:[2,28],53:[2,23],56:[2,32]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},k={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("acc_title"),25;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),27;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return "acc_descr_multiline_value";case 7:return this.begin("open_directive"),49;case 8:return this.begin("type_directive"),50;case 9:return this.popState(),this.begin("arg_directive"),15;case 10:return this.popState(),this.popState(),52;case 11:return 51;case 12:case 13:case 15:case 20:case 25:break;case 14:return 11;case 16:return 9;case 17:return 48;case 18:return 4;case 19:return this.begin("block"),20;case 21:return 38;case 22:case 23:return 37;case 24:return 39;case 26:return this.popState(),22;case 27:case 40:return e.yytext[0];case 28:case 32:return 42;case 29:case 33:return 43;case 30:case 34:return 44;case 31:return 45;case 35:case 37:case 38:return 46;case 36:return 47;case 39:return 30;case 41:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[A-Za-z][A-Za-z0-9\-_\[\]]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\|o\b)/i,/^(?:\}o\b)/i,/^(?:\}\|)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},open_directive:{rules:[8],inclusive:!1},type_directive:{rules:[9,10],inclusive:!1},arg_directive:{rules:[10,11],inclusive:!1},block:{rules:[20,21,22,23,24,25,26,27],inclusive:!1},INITIAL:{rules:[0,2,4,7,12,13,14,15,16,17,18,19,28,29,30,31,32,33,34,35,36,37,38,39,40,41],inclusive:!0}}};function w(){this.yy={};}return x.lexer=k,w.prototype=x,x.Parser=w,new w}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(8009).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},3602:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,9],n=[1,7],r=[1,6],i=[1,8],a=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],o=[2,10],s=[1,20],c=[1,21],l=[1,22],u=[1,23],h=[1,30],f=[1,32],d=[1,33],p=[1,34],g=[1,62],y=[1,48],m=[1,52],b=[1,36],v=[1,37],_=[1,38],x=[1,39],k=[1,40],w=[1,56],T=[1,63],E=[1,51],C=[1,53],S=[1,55],A=[1,59],M=[1,60],N=[1,41],O=[1,42],D=[1,43],B=[1,44],L=[1,61],I=[1,50],F=[1,54],R=[1,57],P=[1,58],j=[1,49],z=[1,66],Y=[1,71],U=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$=[1,75],W=[1,74],q=[1,76],H=[20,21,23,81,82],V=[1,99],G=[1,104],X=[1,107],Z=[1,108],Q=[1,101],K=[1,106],J=[1,109],tt=[1,102],et=[1,114],nt=[1,113],rt=[1,103],it=[1,105],at=[1,110],ot=[1,111],st=[1,112],ct=[1,115],lt=[20,21,22,23,81,82],ut=[20,21,22,23,53,81,82],ht=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],ft=[20,21,23],dt=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],pt=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],gt=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],yt=[1,149],mt=[1,157],bt=[1,158],vt=[1,159],_t=[1,160],xt=[1,144],kt=[1,145],wt=[1,141],Tt=[1,152],Et=[1,153],Ct=[1,154],St=[1,155],At=[1,156],Mt=[1,161],Nt=[1,162],Ot=[1,147],Dt=[1,150],Bt=[1,146],Lt=[1,143],It=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],Ft=[1,165],Rt=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],Pt=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],jt=[12,21,22,24],zt=[22,106],Yt=[1,250],Ut=[1,245],$t=[1,246],Wt=[1,254],qt=[1,251],Ht=[1,248],Vt=[1,247],Gt=[1,249],Xt=[1,252],Zt=[1,253],Qt=[1,255],Kt=[1,273],Jt=[20,21,23,106],te=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113],ee={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,openDirective:6,typeDirective:7,closeDirective:8,separator:9,":":10,argDirective:11,open_directive:12,type_directive:13,arg_directive:14,close_directive:15,graphConfig:16,document:17,line:18,statement:19,SEMI:20,NEWLINE:21,SPACE:22,EOF:23,GRAPH:24,NODIR:25,DIR:26,FirstStmtSeperator:27,ending:28,endToken:29,spaceList:30,spaceListNewline:31,verticeStatement:32,styleStatement:33,linkStyleStatement:34,classDefStatement:35,classStatement:36,clickStatement:37,subgraph:38,text:39,SQS:40,SQE:41,end:42,direction:43,acc_title:44,acc_title_value:45,acc_descr:46,acc_descr_value:47,acc_descr_multiline_value:48,link:49,node:50,vertex:51,AMP:52,STYLE_SEPARATOR:53,idString:54,DOUBLECIRCLESTART:55,DOUBLECIRCLEEND:56,PS:57,PE:58,"(-":59,"-)":60,STADIUMSTART:61,STADIUMEND:62,SUBROUTINESTART:63,SUBROUTINEEND:64,VERTEX_WITH_PROPS_START:65,ALPHA:66,COLON:67,PIPE:68,CYLINDERSTART:69,CYLINDEREND:70,DIAMOND_START:71,DIAMOND_STOP:72,TAGEND:73,TRAPSTART:74,TRAPEND:75,INVTRAPSTART:76,INVTRAPEND:77,linkStatement:78,arrowText:79,TESTSTR:80,START_LINK:81,LINK:82,textToken:83,STR:84,keywords:85,STYLE:86,LINKSTYLE:87,CLASSDEF:88,CLASS:89,CLICK:90,DOWN:91,UP:92,textNoTags:93,textNoTagsToken:94,DEFAULT:95,stylesOpt:96,alphaNum:97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,HEX:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,MINUS:109,UNIT:110,BRKT:111,DOT:112,PCT:113,TAGSTART:114,alphaNumToken:115,idStringToken:116,alphaNumStatement:117,direction_tb:118,direction_bt:119,direction_rl:120,direction_lr:121,PUNCTUATION:122,UNICODE_TEXT:123,PLUS:124,EQUALS:125,MULT:126,UNDERSCORE:127,graphCodeTokens:128,ARROW_CROSS:129,ARROW_POINT:130,ARROW_CIRCLE:131,ARROW_OPEN:132,QUOTE:133,$accept:0,$end:1},terminals_:{2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",86:"STYLE",87:"LINKSTYLE",88:"CLASSDEF",89:"CLASS",90:"CLICK",91:"DOWN",92:"UP",95:"DEFAULT",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"HEX",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"MINUS",110:"UNIT",111:"BRKT",112:"DOT",113:"PCT",114:"TAGSTART",118:"direction_tb",119:"direction_bt",120:"direction_rl",121:"direction_lr",122:"PUNCTUATION",123:"UNICODE_TEXT",124:"PLUS",125:"EQUALS",126:"MULT",127:"UNDERSCORE",129:"ARROW_CROSS",130:"ARROW_POINT",131:"ARROW_CIRCLE",132:"ARROW_OPEN",133:"QUOTE"},productions_:[0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.parseDirective("%%{","open_directive");break;case 6:r.parseDirective(a[s],"type_directive");break;case 7:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 8:r.parseDirective("}%%","close_directive","flowchart");break;case 10:case 36:case 37:case 38:case 39:case 40:this.$=[];break;case 11:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 12:case 82:case 84:case 96:case 152:case 154:case 155:case 78:case 150:this.$=a[s];break;case 19:r.setDirection("TB"),this.$="TB";break;case 20:r.setDirection(a[s-1]),this.$=a[s-1];break;case 35:this.$=a[s-1].nodes;break;case 41:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 42:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 43:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 45:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 46:case 47:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 51:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 52:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 53:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 54:this.$={stmt:a[s],nodes:a[s]};break;case 55:case 123:case 125:this.$=[a[s]];break;case 56:this.$=a[s-4].concat(a[s]);break;case 57:this.$=[a[s-2]],r.setClass(a[s-2],a[s]);break;case 58:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"square");break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"doublecircle");break;case 60:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"circle");break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"ellipse");break;case 62:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"stadium");break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"subroutine");break;case 64:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"cylinder");break;case 66:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"round");break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"diamond");break;case 68:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"hexagon");break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"odd");break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"trapezoid");break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"inv_trapezoid");break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"lean_right");break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"lean_left");break;case 74:this.$=a[s],r.addVertex(a[s]);break;case 75:a[s-1].text=a[s],this.$=a[s-1];break;case 76:case 77:a[s-2].text=a[s-1],this.$=a[s-2];break;case 79:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1]};break;case 80:c=r.destructLink(a[s]),this.$={type:c.type,stroke:c.stroke,length:c.length};break;case 81:this.$=a[s-1];break;case 83:case 97:case 153:case 151:this.$=a[s-1]+""+a[s];break;case 98:case 99:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 100:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 101:case 109:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 102:case 110:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 103:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 104:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 105:case 111:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 106:case 112:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 107:case 113:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 108:case 114:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 115:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 116:case 118:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 117:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 119:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 120:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 121:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 122:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 124:case 126:a[s-2].push(a[s]),this.$=a[s-2];break;case 128:this.$=a[s-1]+a[s];break;case 156:this.$="v";break;case 157:this.$="-";break;case 158:this.$={stmt:"dir",value:"TB"};break;case 159:this.$={stmt:"dir",value:"BT"};break;case 160:this.$={stmt:"dir",value:"RL"};break;case 161:this.$={stmt:"dir",value:"LR"};}},table:[{3:1,4:2,5:3,6:5,12:e,16:4,21:n,22:r,24:i},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:e,16:4,21:n,22:r,24:i},t(a,o,{17:11}),{7:12,13:[1,13]},{16:14,21:n,22:r,24:i},{16:15,21:n,22:r,24:i},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:s,21:c,22:l,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:h,43:31,44:f,46:d,48:p,50:35,51:45,52:g,54:46,66:y,67:m,86:b,87:v,88:_,89:x,90:k,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,118:N,119:O,120:D,121:B,122:L,123:I,124:F,125:R,126:P,127:j},{8:64,10:[1,65],15:z},t([10,15],[2,6]),t(a,[2,17]),t(a,[2,18]),t(a,[2,19]),{20:[1,68],21:[1,69],22:Y,27:67,30:70},t(U,[2,11]),t(U,[2,12]),t(U,[2,13]),t(U,[2,14]),t(U,[2,15]),t(U,[2,16]),{9:72,20:$,21:W,23:q,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:$,21:W,23:q},{9:81,20:$,21:W,23:q},{9:82,20:$,21:W,23:q},{9:83,20:$,21:W,23:q},{9:84,20:$,21:W,23:q},{9:86,20:$,21:W,22:[1,85],23:q},t(U,[2,44]),{45:[1,87]},{47:[1,88]},t(U,[2,47]),t(H,[2,54],{30:89,22:Y}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:V,52:G,66:X,67:Z,84:[1,97],91:Q,97:96,98:[1,94],100:[1,95],105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(U,[2,158]),t(U,[2,159]),t(U,[2,160]),t(U,[2,161]),t(lt,[2,55],{53:[1,116]}),t(ut,[2,74],{116:129,40:[1,117],52:g,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:y,67:m,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:w,95:T,105:E,106:C,109:S,111:A,112:M,122:L,123:I,124:F,125:R,126:P,127:j}),t(ht,[2,150]),t(ht,[2,175]),t(ht,[2,176]),t(ht,[2,177]),t(ht,[2,178]),t(ht,[2,179]),t(ht,[2,180]),t(ht,[2,181]),t(ht,[2,182]),t(ht,[2,183]),t(ht,[2,184]),t(ht,[2,185]),t(ht,[2,186]),t(ht,[2,187]),t(ht,[2,188]),t(ht,[2,189]),t(ht,[2,190]),{9:130,20:$,21:W,23:q},{11:131,14:[1,132]},t(ft,[2,8]),t(a,[2,20]),t(a,[2,26]),t(a,[2,27]),{21:[1,133]},t(dt,[2,34],{30:134,22:Y}),t(U,[2,35]),{50:135,51:45,52:g,54:46,66:y,67:m,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,122:L,123:I,124:F,125:R,126:P,127:j},t(pt,[2,48]),t(pt,[2,49]),t(pt,[2,50]),t(gt,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:yt,24:mt,26:bt,38:vt,39:139,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),t(U,[2,36]),t(U,[2,37]),t(U,[2,38]),t(U,[2,39]),t(U,[2,40]),{22:yt,24:mt,26:bt,38:vt,39:163,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(It,o,{17:164}),t(U,[2,45]),t(U,[2,46]),t(H,[2,53],{52:Ft}),{26:V,52:G,66:X,67:Z,91:Q,97:166,102:[1,167],105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},{95:[1,168],103:169,105:[1,170]},{26:V,52:G,66:X,67:Z,91:Q,95:[1,171],97:172,105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},{26:V,52:G,66:X,67:Z,91:Q,97:173,105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ft,[2,101],{22:[1,174],99:[1,175]}),t(ft,[2,105],{22:[1,176]}),t(ft,[2,109],{115:100,117:178,22:[1,177],26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,122:rt,123:it,124:at,125:ot,126:st,127:ct}),t(ft,[2,111],{22:[1,179]}),t(Rt,[2,152]),t(Rt,[2,154]),t(Rt,[2,155]),t(Rt,[2,156]),t(Rt,[2,157]),t(Pt,[2,162]),t(Pt,[2,163]),t(Pt,[2,164]),t(Pt,[2,165]),t(Pt,[2,166]),t(Pt,[2,167]),t(Pt,[2,168]),t(Pt,[2,169]),t(Pt,[2,170]),t(Pt,[2,171]),t(Pt,[2,172]),t(Pt,[2,173]),t(Pt,[2,174]),{52:g,54:180,66:y,67:m,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,122:L,123:I,124:F,125:R,126:P,127:j},{22:yt,24:mt,26:bt,38:vt,39:181,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:182,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:184,42:_t,52:G,57:[1,183],66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:185,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:186,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:187,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{66:[1,188]},{22:yt,24:mt,26:bt,38:vt,39:189,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:190,42:_t,52:G,66:X,67:Z,71:[1,191],73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:192,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:193,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:194,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ht,[2,151]),t(jt,[2,3]),{8:195,15:z},{15:[2,7]},t(a,[2,28]),t(dt,[2,33]),t(H,[2,51],{30:196,22:Y}),t(gt,[2,75],{22:[1,197]}),{22:[1,198]},{22:yt,24:mt,26:bt,38:vt,39:199,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,73:xt,81:kt,82:[1,200],83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(Pt,[2,82]),t(Pt,[2,84]),t(Pt,[2,140]),t(Pt,[2,141]),t(Pt,[2,142]),t(Pt,[2,143]),t(Pt,[2,144]),t(Pt,[2,145]),t(Pt,[2,146]),t(Pt,[2,147]),t(Pt,[2,148]),t(Pt,[2,149]),t(Pt,[2,85]),t(Pt,[2,86]),t(Pt,[2,87]),t(Pt,[2,88]),t(Pt,[2,89]),t(Pt,[2,90]),t(Pt,[2,91]),t(Pt,[2,92]),t(Pt,[2,93]),t(Pt,[2,94]),t(Pt,[2,95]),{9:203,20:$,21:W,22:yt,23:q,24:mt,26:bt,38:vt,40:[1,202],42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{18:18,19:19,20:s,21:c,22:l,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:h,42:[1,204],43:31,44:f,46:d,48:p,50:35,51:45,52:g,54:46,66:y,67:m,86:b,87:v,88:_,89:x,90:k,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,118:N,119:O,120:D,121:B,122:L,123:I,124:F,125:R,126:P,127:j},{22:Y,30:205},{22:[1,206],26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,115:100,117:178,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},t(zt,[2,123]),{22:[1,211]},{22:[1,212],26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,115:100,117:178,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:[1,213],26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,115:100,117:178,122:rt,123:it,124:at,125:ot,126:st,127:ct},{84:[1,214]},t(ft,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},t(Rt,[2,153]),{84:[1,219],101:[1,220]},t(lt,[2,57],{116:129,52:g,66:y,67:m,91:w,95:T,105:E,106:C,109:S,111:A,112:M,122:L,123:I,124:F,125:R,126:P,127:j}),{22:yt,24:mt,26:bt,38:vt,41:[1,221],42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,56:[1,222],66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:223,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,58:[1,224],66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,60:[1,225],66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,62:[1,226],66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,64:[1,227],66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{67:[1,228]},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,70:[1,229],73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,72:[1,230],73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,39:231,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,41:[1,232],42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,73:xt,75:[1,233],77:[1,234],81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,73:xt,75:[1,236],77:[1,235],81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{9:237,20:$,21:W,23:q},t(H,[2,52],{52:Ft}),t(gt,[2,77]),t(gt,[2,76]),{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,68:[1,238],73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(gt,[2,79]),t(Pt,[2,83]),{22:yt,24:mt,26:bt,38:vt,39:239,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(It,o,{17:240}),t(U,[2,43]),{51:241,52:g,54:46,66:y,67:m,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,122:L,123:I,124:F,125:R,126:P,127:j},{22:Yt,66:Ut,67:$t,86:Wt,96:242,102:qt,105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{22:Yt,66:Ut,67:$t,86:Wt,96:256,102:qt,105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{22:Yt,66:Ut,67:$t,86:Wt,96:257,102:qt,104:[1,258],105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{22:Yt,66:Ut,67:$t,86:Wt,96:259,102:qt,104:[1,260],105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{105:[1,261]},{22:Yt,66:Ut,67:$t,86:Wt,96:262,102:qt,105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{22:Yt,66:Ut,67:$t,86:Wt,96:263,102:qt,105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{26:V,52:G,66:X,67:Z,91:Q,97:264,105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ft,[2,102]),{84:[1,265]},t(ft,[2,106],{22:[1,266]}),t(ft,[2,107]),t(ft,[2,110]),t(ft,[2,112],{22:[1,267]}),t(ft,[2,113]),t(ut,[2,58]),t(ut,[2,59]),{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,58:[1,268],66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ut,[2,66]),t(ut,[2,61]),t(ut,[2,62]),t(ut,[2,63]),{66:[1,269]},t(ut,[2,65]),t(ut,[2,67]),{22:yt,24:mt,26:bt,38:vt,42:_t,52:G,66:X,67:Z,72:[1,270],73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ut,[2,69]),t(ut,[2,70]),t(ut,[2,72]),t(ut,[2,71]),t(ut,[2,73]),t(jt,[2,4]),t([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:yt,24:mt,26:bt,38:vt,41:[1,271],42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{18:18,19:19,20:s,21:c,22:l,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:h,42:[1,272],43:31,44:f,46:d,48:p,50:35,51:45,52:g,54:46,66:y,67:m,86:b,87:v,88:_,89:x,90:k,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,118:N,119:O,120:D,121:B,122:L,123:I,124:F,125:R,126:P,127:j},t(lt,[2,56]),t(ft,[2,115],{106:Kt}),t(Jt,[2,125],{108:274,22:Yt,66:Ut,67:$t,86:Wt,102:qt,105:Ht,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt}),t(te,[2,127]),t(te,[2,129]),t(te,[2,130]),t(te,[2,131]),t(te,[2,132]),t(te,[2,133]),t(te,[2,134]),t(te,[2,135]),t(te,[2,136]),t(te,[2,137]),t(te,[2,138]),t(te,[2,139]),t(ft,[2,116],{106:Kt}),t(ft,[2,117],{106:Kt}),{22:[1,275]},t(ft,[2,118],{106:Kt}),{22:[1,276]},t(zt,[2,124]),t(ft,[2,98],{106:Kt}),t(ft,[2,99],{106:Kt}),t(ft,[2,100],{115:100,117:178,26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,122:rt,123:it,124:at,125:ot,126:st,127:ct}),t(ft,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:$,21:W,23:q},t(U,[2,42]),{22:Yt,66:Ut,67:$t,86:Wt,102:qt,105:Ht,107:283,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},t(te,[2,128]),{26:V,52:G,66:X,67:Z,91:Q,97:284,105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},{26:V,52:G,66:X,67:Z,91:Q,97:285,105:K,106:J,109:tt,111:et,112:nt,115:100,117:98,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ft,[2,108]),t(ft,[2,114]),t(ut,[2,60]),{22:yt,24:mt,26:bt,38:vt,39:286,42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:140,84:wt,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},t(ut,[2,68]),t(It,o,{17:287}),t(Jt,[2,126],{108:274,22:Yt,66:Ut,67:$t,86:Wt,102:qt,105:Ht,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt}),t(ft,[2,121],{115:100,117:178,22:[1,288],26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,122:rt,123:it,124:at,125:ot,126:st,127:ct}),t(ft,[2,122],{115:100,117:178,22:[1,289],26:V,52:G,66:X,67:Z,91:Q,105:K,106:J,109:tt,111:et,112:nt,122:rt,123:it,124:at,125:ot,126:st,127:ct}),{22:yt,24:mt,26:bt,38:vt,41:[1,290],42:_t,52:G,66:X,67:Z,73:xt,81:kt,83:201,85:151,86:Tt,87:Et,88:Ct,89:St,90:At,91:Mt,92:Nt,94:142,95:Ot,105:K,106:J,109:Dt,111:et,112:nt,113:Bt,114:Lt,115:148,122:rt,123:it,124:at,125:ot,126:st,127:ct},{18:18,19:19,20:s,21:c,22:l,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:h,42:[1,291],43:31,44:f,46:d,48:p,50:35,51:45,52:g,54:46,66:y,67:m,86:b,87:v,88:_,89:x,90:k,91:w,95:T,105:E,106:C,109:S,111:A,112:M,116:47,118:N,119:O,120:D,121:B,122:L,123:I,124:F,125:R,126:P,127:j},{22:Yt,66:Ut,67:$t,86:Wt,96:292,102:qt,105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},{22:Yt,66:Ut,67:$t,86:Wt,96:293,102:qt,105:Ht,107:243,108:244,109:Vt,110:Gt,111:Xt,112:Zt,113:Qt},t(ut,[2,64]),t(U,[2,41]),t(ft,[2,119],{106:Kt}),t(ft,[2,120],{106:Kt})],defaultActions:{2:[2,1],9:[2,5],10:[2,2],132:[2,7]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},ne={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),12;case 1:return this.begin("type_directive"),13;case 2:return this.popState(),this.begin("arg_directive"),10;case 3:return this.popState(),this.popState(),15;case 4:return 14;case 5:case 6:break;case 7:return this.begin("acc_title"),44;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),46;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:case 15:case 24:case 27:case 30:case 33:this.popState();break;case 13:return "acc_descr_multiline_value";case 14:this.begin("string");break;case 16:return "STR";case 17:return 86;case 18:return 95;case 19:return 87;case 20:return 104;case 21:return 88;case 22:return 89;case 23:this.begin("href");break;case 25:return 100;case 26:this.begin("callbackname");break;case 28:this.popState(),this.begin("callbackargs");break;case 29:return 98;case 31:return 99;case 32:this.begin("click");break;case 34:return 90;case 35:case 36:return t.lex.firstGraph()&&this.begin("dir"),24;case 37:return 38;case 38:return 42;case 39:case 40:case 41:case 42:return 101;case 43:return this.popState(),25;case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:return this.popState(),26;case 54:return 118;case 55:return 119;case 56:return 120;case 57:return 121;case 58:return 105;case 59:return 111;case 60:return 53;case 61:return 67;case 62:return 52;case 63:return 20;case 64:return 106;case 65:return 126;case 66:case 67:case 68:return 82;case 69:case 70:case 71:return 81;case 72:return 59;case 73:return 60;case 74:return 61;case 75:return 62;case 76:return 63;case 77:return 64;case 78:return 65;case 79:return 69;case 80:return 70;case 81:return 55;case 82:return 56;case 83:return 109;case 84:return 112;case 85:return 127;case 86:return 124;case 87:return 113;case 88:case 89:return 125;case 90:return 114;case 91:return 73;case 92:return 92;case 93:return "SEP";case 94:return 91;case 95:return 66;case 96:return 75;case 97:return 74;case 98:return 77;case 99:return 76;case 100:return 122;case 101:return 123;case 102:return 68;case 103:return 57;case 104:return 58;case 105:return 40;case 106:return 41;case 107:return 71;case 108:return 72;case 109:return 133;case 110:return 21;case 111:return 22;case 112:return 23}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\])/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[30,31],inclusive:!1},callbackname:{rules:[27,28,29],inclusive:!1},href:{rules:[24,25],inclusive:!1},click:{rules:[33,34],inclusive:!1},vertex:{rules:[],inclusive:!1},dir:{rules:[43,44,45,46,47,48,49,50,51,52,53],inclusive:!1},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],inclusive:!0}}};function re(){this.yy={};}return ee.lexer=ne,re.prototype=ee,ee.Parser=re,new re}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(5354).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},9959:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,3],n=[1,5],r=[7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39],i=[1,15],a=[1,16],o=[1,17],s=[1,18],c=[1,19],l=[1,20],u=[1,21],h=[1,22],f=[1,23],d=[1,24],p=[1,25],g=[1,26],y=[1,28],m=[1,30],b=[1,33],v=[5,7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39],_={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,gantt:5,document:6,EOF:7,line:8,SPACE:9,statement:10,NL:11,dateFormat:12,inclusiveEndDates:13,topAxis:14,axisFormat:15,excludes:16,includes:17,todayMarker:18,title:19,acc_title:20,acc_title_value:21,acc_descr:22,acc_descr_value:23,acc_descr_multiline_value:24,section:25,clickStatement:26,taskTxt:27,taskData:28,openDirective:29,typeDirective:30,closeDirective:31,":":32,argDirective:33,click:34,callbackname:35,callbackargs:36,href:37,clickStatementDebug:38,open_directive:39,type_directive:40,arg_directive:41,close_directive:42,$accept:0,$end:1},terminals_:{2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"excludes",17:"includes",18:"todayMarker",19:"title",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"taskTxt",28:"taskData",32:":",34:"click",35:"callbackname",36:"callbackargs",37:"href",39:"open_directive",40:"type_directive",41:"arg_directive",42:"close_directive"},productions_:[0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[26,2],[26,3],[26,3],[26,4],[26,3],[26,4],[26,2],[38,2],[38,3],[38,3],[38,4],[38,3],[38,4],[38,2],[29,1],[30,1],[33,1],[31,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 2:return a[s-1];case 3:case 7:case 8:this.$=[];break;case 4:a[s-1].push(a[s]),this.$=a[s-1];break;case 5:case 6:this.$=a[s];break;case 9:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 10:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 11:r.TopAxis(),this.$=a[s].substr(8);break;case 12:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 13:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 14:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 15:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 16:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 17:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 18:case 19:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 20:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 22:r.addTask(a[s-1],a[s]),this.$="task";break;case 26:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 27:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 28:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 29:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 30:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 31:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 32:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 33:case 39:this.$=a[s-1]+" "+a[s];break;case 34:case 35:case 37:this.$=a[s-2]+" "+a[s-1]+" "+a[s];break;case 36:case 38:this.$=a[s-3]+" "+a[s-2]+" "+a[s-1]+" "+a[s];break;case 40:r.parseDirective("%%{","open_directive");break;case 41:r.parseDirective(a[s],"type_directive");break;case 42:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 43:r.parseDirective("}%%","close_directive","gantt");}},table:[{3:1,4:2,5:e,29:4,39:n},{1:[3]},{3:6,4:2,5:e,29:4,39:n},t(r,[2,3],{6:7}),{30:8,40:[1,9]},{40:[2,40]},{1:[2,1]},{4:29,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:i,13:a,14:o,15:s,16:c,17:l,18:u,19:h,20:f,22:d,24:p,25:g,26:27,27:y,29:4,34:m,39:n},{31:31,32:[1,32],42:b},t([32,42],[2,41]),t(r,[2,8],{1:[2,2]}),t(r,[2,4]),{4:29,10:34,12:i,13:a,14:o,15:s,16:c,17:l,18:u,19:h,20:f,22:d,24:p,25:g,26:27,27:y,29:4,34:m,39:n},t(r,[2,6]),t(r,[2,7]),t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),t(r,[2,13]),t(r,[2,14]),t(r,[2,15]),t(r,[2,16]),{21:[1,35]},{23:[1,36]},t(r,[2,19]),t(r,[2,20]),t(r,[2,21]),{28:[1,37]},t(r,[2,23]),{35:[1,38],37:[1,39]},{11:[1,40]},{33:41,41:[1,42]},{11:[2,43]},t(r,[2,5]),t(r,[2,17]),t(r,[2,18]),t(r,[2,22]),t(r,[2,26],{36:[1,43],37:[1,44]}),t(r,[2,32],{35:[1,45]}),t(v,[2,24]),{31:46,42:b},{42:[2,42]},t(r,[2,27],{37:[1,47]}),t(r,[2,28]),t(r,[2,30],{36:[1,48]}),{11:[1,49]},t(r,[2,29]),t(r,[2,31]),t(v,[2,25])],defaultActions:{5:[2,40],6:[2,1],33:[2,43],42:[2,42]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},x={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),39;case 1:return this.begin("type_directive"),40;case 2:return this.popState(),this.begin("arg_directive"),32;case 3:return this.popState(),this.popState(),42;case 4:return 41;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 20:case 23:case 26:case 29:this.popState();break;case 11:return "acc_descr_multiline_value";case 12:case 13:case 14:case 16:case 17:case 18:break;case 15:return 11;case 19:this.begin("href");break;case 21:return 37;case 22:this.begin("callbackname");break;case 24:this.popState(),this.begin("callbackargs");break;case 25:return 35;case 27:return 36;case 28:this.begin("click");break;case 30:return 34;case 31:return 5;case 32:return 12;case 33:return 13;case 34:return 14;case 35:return 15;case 36:return 17;case 37:return 16;case 38:return 18;case 39:return "date";case 40:return 19;case 41:return "accDescription";case 42:return 25;case 43:return 27;case 44:return 28;case 45:return 32;case 46:return 7;case 47:return "INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[26,27],inclusive:!1},callbackname:{rules:[23,24,25],inclusive:!1},href:{rules:[20,21],inclusive:!1},click:{rules:[29,30],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],inclusive:!0}}};function k(){this.yy={};}return _.lexer=x,k.prototype=_,_.Parser=k,new k}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(6878).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},2553:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,4],n=[1,7],r=[1,5],i=[1,9],a=[1,6],o=[2,6],s=[1,16],c=[6,8,14,20,22,24,25,27,29,32,35,39,49,53],l=[8,14,20,22,24,25,27,29,32,35,39],u=[8,13,14,20,22,24,25,27,29,32,35,39],h=[1,26],f=[6,8,14,49,53],d=[8,14,53],p=[1,64],g=[1,65],y=[1,66],m=[8,14,33,38,41,53],b={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,GG:6,document:7,EOF:8,":":9,DIR:10,options:11,body:12,OPT:13,NL:14,line:15,statement:16,commitStatement:17,mergeStatement:18,cherryPickStatement:19,acc_title:20,acc_title_value:21,acc_descr:22,acc_descr_value:23,acc_descr_multiline_value:24,section:25,branchStatement:26,CHECKOUT:27,ID:28,BRANCH:29,ORDER:30,NUM:31,CHERRY_PICK:32,COMMIT_ID:33,STR:34,MERGE:35,COMMIT_TYPE:36,commitType:37,COMMIT_TAG:38,COMMIT:39,commit_arg:40,COMMIT_MSG:41,NORMAL:42,REVERSE:43,HIGHLIGHT:44,openDirective:45,typeDirective:46,closeDirective:47,argDirective:48,open_directive:49,type_directive:50,arg_directive:51,close_directive:52,";":53,$accept:0,$end:1},terminals_:{2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",28:"ID",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"MERGE",36:"COMMIT_TYPE",38:"COMMIT_TAG",39:"COMMIT",41:"COMMIT_MSG",42:"NORMAL",43:"REVERSE",44:"HIGHLIGHT",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive",53:";"},productions_:[0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[18,2],[18,4],[18,4],[18,4],[18,6],[18,6],[18,6],[18,6],[18,6],[18,6],[18,8],[18,8],[18,8],[18,8],[18,8],[18,8],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[40,0],[40,1],[37,1],[37,1],[37,1],[5,3],[5,5],[45,1],[46,1],[48,1],[47,1],[4,1],[4,1],[4,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return a[s];case 4:return a[s-1];case 5:return r.setDirection(a[s-3]),a[s-1];case 7:r.setOptions(a[s-1]),this.$=a[s];break;case 8:a[s-1]+=a[s],this.$=a[s-1];break;case 10:this.$=[];break;case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 12:this.$=a[s-1];break;case 17:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 18:case 19:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 20:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 22:r.checkout(a[s]);break;case 23:r.branch(a[s]);break;case 24:r.branch(a[s-2],a[s]);break;case 25:r.cherryPick(a[s]);break;case 26:r.merge(a[s],"","","");break;case 27:r.merge(a[s-2],a[s],"","");break;case 28:r.merge(a[s-2],"",a[s],"");break;case 29:r.merge(a[s-2],"","",a[s]);break;case 30:r.merge(a[s-4],a[s],"",a[s-2]);break;case 31:r.merge(a[s-4],"",a[s],a[s-2]);break;case 32:r.merge(a[s-4],"",a[s-2],a[s]);break;case 33:r.merge(a[s-4],a[s-2],a[s],"");break;case 34:r.merge(a[s-4],a[s-2],"",a[s]);break;case 35:r.merge(a[s-4],a[s],a[s-2],"");break;case 36:r.merge(a[s-6],a[s-4],a[s-2],a[s]);break;case 37:r.merge(a[s-6],a[s],a[s-4],a[s-2]);break;case 38:r.merge(a[s-6],a[s-4],a[s],a[s-2]);break;case 39:r.merge(a[s-6],a[s-2],a[s-4],a[s]);break;case 40:r.merge(a[s-6],a[s],a[s-2],a[s-4]);break;case 41:r.merge(a[s-6],a[s-2],a[s],a[s-4]);break;case 42:r.commit(a[s]);break;case 43:r.commit("","",r.commitType.NORMAL,a[s]);break;case 44:r.commit("","",a[s],"");break;case 45:r.commit("","",a[s],a[s-2]);break;case 46:r.commit("","",a[s-2],a[s]);break;case 47:r.commit("",a[s],r.commitType.NORMAL,"");break;case 48:r.commit("",a[s-2],r.commitType.NORMAL,a[s]);break;case 49:r.commit("",a[s],r.commitType.NORMAL,a[s-2]);break;case 50:r.commit("",a[s-2],a[s],"");break;case 51:r.commit("",a[s],a[s-2],"");break;case 52:r.commit("",a[s-4],a[s-2],a[s]);break;case 53:r.commit("",a[s-4],a[s],a[s-2]);break;case 54:r.commit("",a[s-2],a[s-4],a[s]);break;case 55:r.commit("",a[s],a[s-4],a[s-2]);break;case 56:r.commit("",a[s],a[s-2],a[s-4]);break;case 57:r.commit("",a[s-2],a[s],a[s-4]);break;case 58:r.commit(a[s],"",r.commitType.NORMAL,"");break;case 59:r.commit(a[s],"",r.commitType.NORMAL,a[s-2]);break;case 60:r.commit(a[s-2],"",r.commitType.NORMAL,a[s]);break;case 61:r.commit(a[s-2],"",a[s],"");break;case 62:r.commit(a[s],"",a[s-2],"");break;case 63:r.commit(a[s],a[s-2],r.commitType.NORMAL,"");break;case 64:r.commit(a[s-2],a[s],r.commitType.NORMAL,"");break;case 65:r.commit(a[s-4],"",a[s-2],a[s]);break;case 66:r.commit(a[s-4],"",a[s],a[s-2]);break;case 67:r.commit(a[s-2],"",a[s-4],a[s]);break;case 68:r.commit(a[s],"",a[s-4],a[s-2]);break;case 69:r.commit(a[s],"",a[s-2],a[s-4]);break;case 70:r.commit(a[s-2],"",a[s],a[s-4]);break;case 71:r.commit(a[s-4],a[s],a[s-2],"");break;case 72:r.commit(a[s-4],a[s-2],a[s],"");break;case 73:r.commit(a[s-2],a[s],a[s-4],"");break;case 74:r.commit(a[s],a[s-2],a[s-4],"");break;case 75:r.commit(a[s],a[s-4],a[s-2],"");break;case 76:r.commit(a[s-2],a[s-4],a[s],"");break;case 77:r.commit(a[s-4],a[s],r.commitType.NORMAL,a[s-2]);break;case 78:r.commit(a[s-4],a[s-2],r.commitType.NORMAL,a[s]);break;case 79:r.commit(a[s-2],a[s],r.commitType.NORMAL,a[s-4]);break;case 80:r.commit(a[s],a[s-2],r.commitType.NORMAL,a[s-4]);break;case 81:r.commit(a[s],a[s-4],r.commitType.NORMAL,a[s-2]);break;case 82:r.commit(a[s-2],a[s-4],r.commitType.NORMAL,a[s]);break;case 83:r.commit(a[s-6],a[s-4],a[s-2],a[s]);break;case 84:r.commit(a[s-6],a[s-4],a[s],a[s-2]);break;case 85:r.commit(a[s-6],a[s-2],a[s-4],a[s]);break;case 86:r.commit(a[s-6],a[s],a[s-4],a[s-2]);break;case 87:r.commit(a[s-6],a[s-2],a[s],a[s-4]);break;case 88:r.commit(a[s-6],a[s],a[s-2],a[s-4]);break;case 89:r.commit(a[s-4],a[s-6],a[s-2],a[s]);break;case 90:r.commit(a[s-4],a[s-6],a[s],a[s-2]);break;case 91:r.commit(a[s-2],a[s-6],a[s-4],a[s]);break;case 92:r.commit(a[s],a[s-6],a[s-4],a[s-2]);break;case 93:r.commit(a[s-2],a[s-6],a[s],a[s-4]);break;case 94:r.commit(a[s],a[s-6],a[s-2],a[s-4]);break;case 95:r.commit(a[s],a[s-4],a[s-2],a[s-6]);break;case 96:r.commit(a[s-2],a[s-4],a[s],a[s-6]);break;case 97:r.commit(a[s],a[s-2],a[s-4],a[s-6]);break;case 98:r.commit(a[s-2],a[s],a[s-4],a[s-6]);break;case 99:r.commit(a[s-4],a[s-2],a[s],a[s-6]);break;case 100:r.commit(a[s-4],a[s],a[s-2],a[s-6]);break;case 101:r.commit(a[s-2],a[s-4],a[s-6],a[s]);break;case 102:r.commit(a[s],a[s-4],a[s-6],a[s-2]);break;case 103:r.commit(a[s-2],a[s],a[s-6],a[s-4]);break;case 104:r.commit(a[s],a[s-2],a[s-6],a[s-4]);break;case 105:r.commit(a[s-4],a[s-2],a[s-6],a[s]);break;case 106:r.commit(a[s-4],a[s],a[s-6],a[s-2]);break;case 107:this.$="";break;case 108:this.$=a[s];break;case 109:this.$=r.commitType.NORMAL;break;case 110:this.$=r.commitType.REVERSE;break;case 111:this.$=r.commitType.HIGHLIGHT;break;case 114:r.parseDirective("%%{","open_directive");break;case 115:r.parseDirective(a[s],"type_directive");break;case 116:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 117:r.parseDirective("}%%","close_directive","gitGraph");}},table:[{3:1,4:2,5:3,6:e,8:n,14:r,45:8,49:i,53:a},{1:[3]},{3:10,4:2,5:3,6:e,8:n,14:r,45:8,49:i,53:a},{3:11,4:2,5:3,6:e,8:n,14:r,45:8,49:i,53:a},{7:12,8:o,9:[1,13],10:[1,14],11:15,14:s},t(c,[2,118]),t(c,[2,119]),t(c,[2,120]),{46:17,50:[1,18]},{50:[2,114]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:o,11:15,14:s},{9:[1,21]},t(l,[2,10],{12:22,13:[1,23]}),t(u,[2,9]),{9:[1,25],47:24,52:h},t([9,52],[2,115]),{1:[2,3]},{8:[1,27]},{7:28,8:o,11:15,14:s},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],35:[1,42],39:[1,41]},t(u,[2,8]),t(f,[2,112]),{48:45,51:[1,46]},t(f,[2,117]),{1:[2,4]},{8:[1,47]},t(l,[2,11]),{4:48,8:n,14:r,53:a},t(l,[2,13]),t(d,[2,14]),t(d,[2,15]),t(d,[2,16]),{21:[1,49]},{23:[1,50]},t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),{28:[1,51]},t(d,[2,107],{40:52,33:[1,55],34:[1,57],36:[1,54],38:[1,53],41:[1,56]}),{28:[1,58]},{33:[1,59]},{28:[1,60]},{47:61,52:h},{52:[2,116]},{1:[2,5]},t(l,[2,12]),t(d,[2,17]),t(d,[2,18]),t(d,[2,22]),t(d,[2,42]),{34:[1,62]},{37:63,42:p,43:g,44:y},{34:[1,67]},{34:[1,68]},t(d,[2,108]),t(d,[2,26],{33:[1,69],36:[1,70],38:[1,71]}),{34:[1,72]},t(d,[2,23],{30:[1,73]}),t(f,[2,113]),t(d,[2,43],{33:[1,75],36:[1,74],41:[1,76]}),t(d,[2,44],{33:[1,78],38:[1,77],41:[1,79]}),t(m,[2,109]),t(m,[2,110]),t(m,[2,111]),t(d,[2,47],{36:[1,81],38:[1,80],41:[1,82]}),t(d,[2,58],{33:[1,85],36:[1,84],38:[1,83]}),{34:[1,86]},{37:87,42:p,43:g,44:y},{34:[1,88]},t(d,[2,25]),{31:[1,89]},{37:90,42:p,43:g,44:y},{34:[1,91]},{34:[1,92]},{34:[1,93]},{34:[1,94]},{34:[1,95]},{34:[1,96]},{37:97,42:p,43:g,44:y},{34:[1,98]},{34:[1,99]},{37:100,42:p,43:g,44:y},{34:[1,101]},t(d,[2,27],{36:[1,102],38:[1,103]}),t(d,[2,28],{33:[1,105],38:[1,104]}),t(d,[2,29],{33:[1,106],36:[1,107]}),t(d,[2,24]),t(d,[2,45],{33:[1,108],41:[1,109]}),t(d,[2,49],{36:[1,110],41:[1,111]}),t(d,[2,59],{33:[1,113],36:[1,112]}),t(d,[2,46],{33:[1,114],41:[1,115]}),t(d,[2,51],{38:[1,116],41:[1,117]}),t(d,[2,62],{33:[1,119],38:[1,118]}),t(d,[2,48],{36:[1,120],41:[1,121]}),t(d,[2,50],{38:[1,122],41:[1,123]}),t(d,[2,63],{36:[1,124],38:[1,125]}),t(d,[2,60],{33:[1,127],36:[1,126]}),t(d,[2,61],{33:[1,129],38:[1,128]}),t(d,[2,64],{36:[1,130],38:[1,131]}),{37:132,42:p,43:g,44:y},{34:[1,133]},{34:[1,134]},{34:[1,135]},{34:[1,136]},{37:137,42:p,43:g,44:y},{34:[1,138]},{34:[1,139]},{37:140,42:p,43:g,44:y},{34:[1,141]},{37:142,42:p,43:g,44:y},{34:[1,143]},{34:[1,144]},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{34:[1,149]},{37:150,42:p,43:g,44:y},{34:[1,151]},{34:[1,152]},{34:[1,153]},{37:154,42:p,43:g,44:y},{34:[1,155]},{37:156,42:p,43:g,44:y},{34:[1,157]},{34:[1,158]},{34:[1,159]},{37:160,42:p,43:g,44:y},{34:[1,161]},t(d,[2,33],{38:[1,162]}),t(d,[2,34],{36:[1,163]}),t(d,[2,32],{33:[1,164]}),t(d,[2,35],{38:[1,165]}),t(d,[2,30],{36:[1,166]}),t(d,[2,31],{33:[1,167]}),t(d,[2,56],{41:[1,168]}),t(d,[2,69],{33:[1,169]}),t(d,[2,57],{41:[1,170]}),t(d,[2,80],{36:[1,171]}),t(d,[2,70],{33:[1,172]}),t(d,[2,79],{36:[1,173]}),t(d,[2,55],{41:[1,174]}),t(d,[2,68],{33:[1,175]}),t(d,[2,54],{41:[1,176]}),t(d,[2,74],{38:[1,177]}),t(d,[2,67],{33:[1,178]}),t(d,[2,73],{38:[1,179]}),t(d,[2,53],{41:[1,180]}),t(d,[2,81],{36:[1,181]}),t(d,[2,52],{41:[1,182]}),t(d,[2,75],{38:[1,183]}),t(d,[2,76],{38:[1,184]}),t(d,[2,82],{36:[1,185]}),t(d,[2,66],{33:[1,186]}),t(d,[2,77],{36:[1,187]}),t(d,[2,65],{33:[1,188]}),t(d,[2,71],{38:[1,189]}),t(d,[2,72],{38:[1,190]}),t(d,[2,78],{36:[1,191]}),{34:[1,192]},{37:193,42:p,43:g,44:y},{34:[1,194]},{34:[1,195]},{37:196,42:p,43:g,44:y},{34:[1,197]},{34:[1,198]},{34:[1,199]},{34:[1,200]},{37:201,42:p,43:g,44:y},{34:[1,202]},{37:203,42:p,43:g,44:y},{34:[1,204]},{34:[1,205]},{34:[1,206]},{34:[1,207]},{34:[1,208]},{34:[1,209]},{34:[1,210]},{37:211,42:p,43:g,44:y},{34:[1,212]},{34:[1,213]},{34:[1,214]},{37:215,42:p,43:g,44:y},{34:[1,216]},{37:217,42:p,43:g,44:y},{34:[1,218]},{34:[1,219]},{34:[1,220]},{37:221,42:p,43:g,44:y},t(d,[2,36]),t(d,[2,38]),t(d,[2,37]),t(d,[2,39]),t(d,[2,41]),t(d,[2,40]),t(d,[2,97]),t(d,[2,98]),t(d,[2,95]),t(d,[2,96]),t(d,[2,100]),t(d,[2,99]),t(d,[2,104]),t(d,[2,103]),t(d,[2,102]),t(d,[2,101]),t(d,[2,106]),t(d,[2,105]),t(d,[2,94]),t(d,[2,93]),t(d,[2,92]),t(d,[2,91]),t(d,[2,89]),t(d,[2,90]),t(d,[2,88]),t(d,[2,87]),t(d,[2,86]),t(d,[2,85]),t(d,[2,83]),t(d,[2,84])],defaultActions:{9:[2,114],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,116],47:[2,5]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},v={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),49;case 1:return this.begin("type_directive"),50;case 2:return this.popState(),this.begin("arg_directive"),9;case 3:return this.popState(),this.popState(),52;case 4:return 51;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 35:case 38:this.popState();break;case 11:return "acc_descr_multiline_value";case 12:return 14;case 13:case 14:case 15:break;case 16:return 6;case 17:return 39;case 18:return 33;case 19:return 36;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 38;case 25:return 29;case 26:return 30;case 27:return 35;case 28:return 32;case 29:return 27;case 30:case 31:return 10;case 32:return 9;case 33:return "CARET";case 34:this.begin("options");break;case 36:return 13;case 37:this.begin("string");break;case 39:return 34;case 40:return 31;case 41:return 28;case 42:return 8}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch\b)/i,/^(?:order:)/i,/^(?:merge\b)/i,/^(?:cherry-pick\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+)/i,/^(?:[a-zA-Z][-_\./a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},options:{rules:[35,36],inclusive:!1},string:{rules:[38,39],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,37,40,41,42],inclusive:!0}}};function _(){this.yy={};}return b.lexer=v,_.prototype=b,b.Parser=_,new _}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(8183).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},6765:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[6,9,10],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(t,e,n,r,i,a,o){switch(a.length,i){case 1:return r;case 4:break;case 6:r.setInfo(!0);}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},t(e,[2,3]),t(e,[2,4]),t(e,[2,5]),t(e,[2,6])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},r={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 4;case 1:return 9;case 2:return "space";case 3:return 10;case 4:return 6;case 5:return "TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}};function i(){this.yy={};}return n.lexer=r,i.prototype=n,n.Parser=i,new i}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(1428).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},7062:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,4],n=[1,5],r=[1,6],i=[1,7],a=[1,9],o=[1,11,13,15,17,19,20,26,27,28,29],s=[2,5],c=[1,6,11,13,15,17,19,20,26,27,28,29],l=[26,27,28],u=[2,8],h=[1,18],f=[1,19],d=[1,20],p=[1,21],g=[1,22],y=[1,23],m=[1,28],b=[6,26,27,28,29],v={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,PIE:6,document:7,showData:8,line:9,statement:10,txt:11,value:12,title:13,title_value:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,openDirective:21,typeDirective:22,closeDirective:23,":":24,argDirective:25,NEWLINE:26,";":27,EOF:28,open_directive:29,type_directive:30,arg_directive:31,close_directive:32,$accept:0,$end:1},terminals_:{2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.setShowData(!0);break;case 7:this.$=a[s-1];break;case 9:r.addSection(a[s-1],r.cleanupValue(a[s]));break;case 10:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 11:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 12:case 13:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 14:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 21:r.parseDirective("%%{","open_directive");break;case 22:r.parseDirective(a[s],"type_directive");break;case 23:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 24:r.parseDirective("}%%","close_directive","pie");}},table:[{3:1,4:2,5:3,6:e,21:8,26:n,27:r,28:i,29:a},{1:[3]},{3:10,4:2,5:3,6:e,21:8,26:n,27:r,28:i,29:a},{3:11,4:2,5:3,6:e,21:8,26:n,27:r,28:i,29:a},t(o,s,{7:12,8:[1,13]}),t(c,[2,18]),t(c,[2,19]),t(c,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},t(l,u,{21:8,9:16,10:17,5:24,1:[2,3],11:h,13:f,15:d,17:p,19:g,20:y,29:a}),t(o,s,{7:25}),{23:26,24:[1,27],32:m},t([24,32],[2,22]),t(o,[2,6]),{4:29,26:n,27:r,28:i},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},t(l,[2,13]),t(l,[2,14]),t(l,[2,15]),t(l,u,{21:8,9:16,10:17,5:24,1:[2,4],11:h,13:f,15:d,17:p,19:g,20:y,29:a}),t(b,[2,16]),{25:34,31:[1,35]},t(b,[2,24]),t(o,[2,7]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),{23:36,32:m},{32:[2,23]},t(b,[2,17])],defaultActions:{9:[2,21],10:[2,1],11:[2,2],35:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},_={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),29;case 1:return this.begin("type_directive"),30;case 2:return this.popState(),this.begin("arg_directive"),24;case 3:return this.popState(),this.popState(),32;case 4:return 31;case 5:case 6:case 8:case 9:break;case 7:return 26;case 10:return this.begin("title"),13;case 11:return this.popState(),"title_value";case 12:return this.begin("acc_title"),15;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),17;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:case 20:this.popState();break;case 18:return "acc_descr_multiline_value";case 19:this.begin("string");break;case 21:return "txt";case 22:return 6;case 23:return 8;case 24:return "value";case 25:return 28}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[11],inclusive:!1},string:{rules:[20,21],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],inclusive:!0}}};function x(){this.yy={};}return v.lexer=_,x.prototype=v,v.Parser=x,new x}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(4551).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},3176:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,3],n=[1,5],r=[1,6],i=[1,7],a=[1,8],o=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],s=[1,22],c=[2,13],l=[1,26],u=[1,27],h=[1,28],f=[1,29],d=[1,30],p=[1,31],g=[1,24],y=[1,32],m=[1,33],b=[1,36],v=[71,72],_=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],x=[1,56],k=[1,57],w=[1,58],T=[1,59],E=[1,60],C=[1,61],S=[1,62],A=[62,63],M=[1,74],N=[1,70],O=[1,71],D=[1,72],B=[1,73],L=[1,75],I=[1,79],F=[1,80],R=[1,77],P=[1,78],j=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72],z={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,openDirective:9,typeDirective:10,closeDirective:11,":":12,argDirective:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,requirementDef:23,elementDef:24,relationshipDef:25,requirementType:26,requirementName:27,STRUCT_START:28,requirementBody:29,ID:30,COLONSEP:31,id:32,TEXT:33,text:34,RISK:35,riskLevel:36,VERIFYMTHD:37,verifyType:38,STRUCT_STOP:39,REQUIREMENT:40,FUNCTIONAL_REQUIREMENT:41,INTERFACE_REQUIREMENT:42,PERFORMANCE_REQUIREMENT:43,PHYSICAL_REQUIREMENT:44,DESIGN_CONSTRAINT:45,LOW_RISK:46,MED_RISK:47,HIGH_RISK:48,VERIFY_ANALYSIS:49,VERIFY_DEMONSTRATION:50,VERIFY_INSPECTION:51,VERIFY_TEST:52,ELEMENT:53,elementName:54,elementBody:55,TYPE:56,type:57,DOCREF:58,ref:59,END_ARROW_L:60,relationship:61,LINE:62,END_ARROW_R:63,CONTAINS:64,COPIES:65,DERIVES:66,SATISFIES:67,VERIFIES:68,REFINES:69,TRACES:70,unqString:71,qString:72,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",39:"STRUCT_STOP",40:"REQUIREMENT",41:"FUNCTIONAL_REQUIREMENT",42:"INTERFACE_REQUIREMENT",43:"PERFORMANCE_REQUIREMENT",44:"PHYSICAL_REQUIREMENT",45:"DESIGN_CONSTRAINT",46:"LOW_RISK",47:"MED_RISK",48:"HIGH_RISK",49:"VERIFY_ANALYSIS",50:"VERIFY_DEMONSTRATION",51:"VERIFY_INSPECTION",52:"VERIFY_TEST",53:"ELEMENT",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 6:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 7:case 8:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 9:r.parseDirective("%%{","open_directive");break;case 10:r.parseDirective(a[s],"type_directive");break;case 11:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 12:r.parseDirective("}%%","close_directive","pie");break;case 13:this.$=[];break;case 19:r.addRequirement(a[s-3],a[s-4]);break;case 20:r.setNewReqId(a[s-2]);break;case 21:r.setNewReqText(a[s-2]);break;case 22:r.setNewReqRisk(a[s-2]);break;case 23:r.setNewReqVerifyMethod(a[s-2]);break;case 26:this.$=r.RequirementType.REQUIREMENT;break;case 27:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 28:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 29:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 30:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 32:this.$=r.RiskLevel.LOW_RISK;break;case 33:this.$=r.RiskLevel.MED_RISK;break;case 34:this.$=r.RiskLevel.HIGH_RISK;break;case 35:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 36:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 37:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 38:this.$=r.VerifyType.VERIFY_TEST;break;case 39:r.addElement(a[s-3]);break;case 40:r.setNewElementType(a[s-2]);break;case 41:r.setNewElementDocRef(a[s-2]);break;case 44:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 45:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 46:this.$=r.Relationships.CONTAINS;break;case 47:this.$=r.Relationships.COPIES;break;case 48:this.$=r.Relationships.DERIVES;break;case 49:this.$=r.Relationships.SATISFIES;break;case 50:this.$=r.Relationships.VERIFIES;break;case 51:this.$=r.Relationships.REFINES;break;case 52:this.$=r.Relationships.TRACES;}},table:[{3:1,4:2,6:e,9:4,14:n,16:r,18:i,19:a},{1:[3]},{3:10,4:2,5:[1,9],6:e,9:4,14:n,16:r,18:i,19:a},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},t(o,[2,8]),{20:[2,9]},{3:16,4:2,6:e,9:4,14:n,16:r,18:i,19:a},{1:[2,2]},{4:21,5:s,7:17,8:c,9:4,14:n,16:r,18:i,19:a,23:18,24:19,25:20,26:23,32:25,40:l,41:u,42:h,43:f,44:d,45:p,53:g,71:y,72:m},{11:34,12:[1,35],22:b},t([12,22],[2,10]),t(o,[2,6]),t(o,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:s,7:38,8:c,9:4,14:n,16:r,18:i,19:a,23:18,24:19,25:20,26:23,32:25,40:l,41:u,42:h,43:f,44:d,45:p,53:g,71:y,72:m},{4:21,5:s,7:39,8:c,9:4,14:n,16:r,18:i,19:a,23:18,24:19,25:20,26:23,32:25,40:l,41:u,42:h,43:f,44:d,45:p,53:g,71:y,72:m},{4:21,5:s,7:40,8:c,9:4,14:n,16:r,18:i,19:a,23:18,24:19,25:20,26:23,32:25,40:l,41:u,42:h,43:f,44:d,45:p,53:g,71:y,72:m},{4:21,5:s,7:41,8:c,9:4,14:n,16:r,18:i,19:a,23:18,24:19,25:20,26:23,32:25,40:l,41:u,42:h,43:f,44:d,45:p,53:g,71:y,72:m},{4:21,5:s,7:42,8:c,9:4,14:n,16:r,18:i,19:a,23:18,24:19,25:20,26:23,32:25,40:l,41:u,42:h,43:f,44:d,45:p,53:g,71:y,72:m},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},t(v,[2,26]),t(v,[2,27]),t(v,[2,28]),t(v,[2,29]),t(v,[2,30]),t(v,[2,31]),t(_,[2,55]),t(_,[2,56]),t(o,[2,4]),{13:51,21:[1,52]},t(o,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:x,65:k,66:w,67:T,68:E,69:C,70:S},{61:63,64:x,65:k,66:w,67:T,68:E,69:C,70:S},{11:64,22:b},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},t(A,[2,46]),t(A,[2,47]),t(A,[2,48]),t(A,[2,49]),t(A,[2,50]),t(A,[2,51]),t(A,[2,52]),{63:[1,68]},t(o,[2,5]),{5:M,29:69,30:N,33:O,35:D,37:B,39:L},{5:I,39:F,55:76,56:R,58:P},{32:81,71:y,72:m},{32:82,71:y,72:m},t(j,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:M,29:87,30:N,33:O,35:D,37:B,39:L},t(j,[2,25]),t(j,[2,39]),{31:[1,88]},{31:[1,89]},{5:I,39:F,55:90,56:R,58:P},t(j,[2,43]),t(j,[2,44]),t(j,[2,45]),{32:91,71:y,72:m},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},t(j,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},t(j,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:M,29:116,30:N,33:O,35:D,37:B,39:L},{5:M,29:117,30:N,33:O,35:D,37:B,39:L},{5:M,29:118,30:N,33:O,35:D,37:B,39:L},{5:M,29:119,30:N,33:O,35:D,37:B,39:L},{5:I,39:F,55:120,56:R,58:P},{5:I,39:F,55:121,56:R,58:P},t(j,[2,20]),t(j,[2,21]),t(j,[2,22]),t(j,[2,23]),t(j,[2,40]),t(j,[2,41])],defaultActions:{8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},Y={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),19;case 1:return this.begin("type_directive"),20;case 2:return this.popState(),this.begin("arg_directive"),12;case 3:return this.popState(),this.popState(),22;case 4:return 21;case 5:return "title";case 6:return this.begin("acc_title"),14;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),16;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 53:this.popState();break;case 12:return "acc_descr_multiline_value";case 13:return 5;case 14:case 15:case 16:break;case 17:return 8;case 18:return 6;case 19:return 28;case 20:return 39;case 21:return 31;case 22:return 30;case 23:return 33;case 24:return 35;case 25:return 37;case 26:return 40;case 27:return 41;case 28:return 42;case 29:return 43;case 30:return 44;case 31:return 45;case 32:return 46;case 33:return 47;case 34:return 48;case 35:return 49;case 36:return 50;case 37:return 51;case 38:return 52;case 39:return 53;case 40:return 64;case 41:return 65;case 42:return 66;case 43:return 67;case 44:return 68;case 45:return 69;case 46:return 70;case 47:return 56;case 48:return 58;case 49:return 60;case 50:return 63;case 51:return 62;case 52:this.begin("string");break;case 54:return "qString";case 55:return e.yytext=e.yytext.trim(),71}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[53,54],inclusive:!1},INITIAL:{rules:[0,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55],inclusive:!0}}};function U(){this.yy={};}return z.lexer=Y,U.prototype=z,z.Parser=U,new U}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(8800).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},6876:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,3],r=[1,5],i=[1,7],a=[2,5],o=[1,15],s=[1,17],c=[1,18],l=[1,19],u=[1,21],h=[1,22],f=[1,23],d=[1,29],p=[1,30],g=[1,31],y=[1,32],m=[1,33],b=[1,34],v=[1,35],_=[1,36],x=[1,37],k=[1,38],w=[1,39],T=[1,40],E=[1,43],C=[1,44],S=[1,45],A=[1,46],M=[1,47],N=[1,48],O=[1,51],D=[1,4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],B=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,53,58,59,60,61,69,79],L=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,52,53,58,59,60,61,69,79],I=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,51,53,58,59,60,61,69,79],F=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,53,58,59,60,61,69,79],R=[67,68,69],P=[1,121],j=[1,4,5,7,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],z={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,openDirective:11,typeDirective:12,closeDirective:13,":":14,argDirective:15,participant:16,actor:17,AS:18,restOfLine:19,participant_actor:20,signal:21,autonumber:22,NUM:23,off:24,activate:25,deactivate:26,note_statement:27,links_statement:28,link_statement:29,properties_statement:30,details_statement:31,title:32,legacy_title:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,loop:39,end:40,rect:41,opt:42,alt:43,else_sections:44,par:45,par_sections:46,critical:47,option_sections:48,break:49,option:50,and:51,else:52,note:53,placement:54,text2:55,over:56,actor_pair:57,links:58,link:59,properties:60,details:61,spaceList:62,",":63,left_of:64,right_of:65,signaltype:66,"+":67,"-":68,ACTOR:69,SOLID_OPEN_ARROW:70,DOTTED_OPEN_ARROW:71,SOLID_ARROW:72,DOTTED_ARROW:73,SOLID_CROSS:74,DOTTED_CROSS:75,SOLID_POINT:76,DOTTED_POINT:77,TXT:78,open_directive:79,type_directive:80,arg_directive:81,close_directive:82,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",20:"participant_actor",22:"autonumber",23:"NUM",24:"off",25:"activate",26:"deactivate",32:"title",33:"legacy_title",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",39:"loop",40:"end",41:"rect",42:"opt",43:"alt",45:"par",47:"critical",49:"break",50:"option",51:"and",52:"else",53:"note",56:"over",58:"links",59:"link",60:"properties",61:"details",63:",",64:"left_of",65:"right_of",67:"+",68:"-",69:"ACTOR",70:"SOLID_OPEN_ARROW",71:"DOTTED_OPEN_ARROW",72:"SOLID_ARROW",73:"DOTTED_ARROW",74:"SOLID_CROSS",75:"DOTTED_CROSS",76:"SOLID_POINT",77:"DOTTED_POINT",78:"TXT",79:"open_directive",80:"type_directive",81:"arg_directive",82:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[48,1],[48,4],[46,1],[46,4],[44,1],[44,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[62,2],[62,1],[57,3],[57,1],[54,1],[54,1],[21,5],[21,5],[21,4],[17,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[55,1],[11,1],[12,1],[15,1],[13,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 4:return r.apply(a[s]),a[s];case 5:case 9:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:case 56:this.$=a[s];break;case 12:a[s-3].type="addParticipant",a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 13:a[s-1].type="addParticipant",this.$=a[s-1];break;case 14:a[s-3].type="addActor",a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 15:a[s-1].type="addActor",this.$=a[s-1];break;case 17:this.$={type:"sequenceIndex",sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1]};break;case 22:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1]};break;case 28:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 29:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 30:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 31:case 32:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 33:a[s-1].unshift({type:"loopStart",loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 34:a[s-1].unshift({type:"rectStart",color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:"rectEnd",color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 35:a[s-1].unshift({type:"optStart",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:"altStart",altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:"parStart",parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:"criticalStart",criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:"breakStart",breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:"breakEnd",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 42:this.$=a[s-3].concat([{type:"option",optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 44:this.$=a[s-3].concat([{type:"and",parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 46:this.$=a[s-3].concat([{type:"else",altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 47:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 48:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 49:this.$=[a[s-1],{type:"addLinks",actor:a[s-1].actor,text:a[s]}];break;case 50:this.$=[a[s-1],{type:"addALink",actor:a[s-1].actor,text:a[s]}];break;case 51:this.$=[a[s-1],{type:"addProperties",actor:a[s-1].actor,text:a[s]}];break;case 52:this.$=[a[s-1],{type:"addDetails",actor:a[s-1].actor,text:a[s]}];break;case 55:this.$=[a[s-2],a[s]];break;case 57:this.$=r.PLACEMENT.LEFTOF;break;case 58:this.$=r.PLACEMENT.RIGHTOF;break;case 59:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1]}];break;case 60:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4]}];break;case 61:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 62:this.$={type:"addParticipant",actor:a[s]};break;case 63:this.$=r.LINETYPE.SOLID_OPEN;break;case 64:this.$=r.LINETYPE.DOTTED_OPEN;break;case 65:this.$=r.LINETYPE.SOLID;break;case 66:this.$=r.LINETYPE.DOTTED;break;case 67:this.$=r.LINETYPE.SOLID_CROSS;break;case 68:this.$=r.LINETYPE.DOTTED_CROSS;break;case 69:this.$=r.LINETYPE.SOLID_POINT;break;case 70:this.$=r.LINETYPE.DOTTED_POINT;break;case 71:this.$=r.parseMessage(a[s].trim().substring(1));break;case 72:r.parseDirective("%%{","open_directive");break;case 73:r.parseDirective(a[s],"type_directive");break;case 74:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 75:r.parseDirective("}%%","close_directive","sequence");}},table:[{3:1,4:e,5:n,6:4,7:r,11:6,79:i},{1:[3]},{3:8,4:e,5:n,6:4,7:r,11:6,79:i},{3:9,4:e,5:n,6:4,7:r,11:6,79:i},{3:10,4:e,5:n,6:4,7:r,11:6,79:i},t([1,4,5,16,20,22,25,26,32,33,34,36,38,39,41,42,43,45,47,49,53,58,59,60,61,69,79],a,{8:11}),{12:12,80:[1,13]},{80:[2,72]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,41:v,42:_,43:x,45:k,47:w,49:T,53:E,58:C,59:S,60:A,61:M,69:N,79:i},{13:49,14:[1,50],82:O},t([14,82],[2,73]),t(D,[2,6]),{6:41,10:52,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,41:v,42:_,43:x,45:k,47:w,49:T,53:E,58:C,59:S,60:A,61:M,69:N,79:i},t(D,[2,8]),t(D,[2,9]),{17:53,69:N},{17:54,69:N},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:N},{17:60,69:N},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},t(D,[2,28]),t(D,[2,29]),{35:[1,66]},{37:[1,67]},t(D,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},t(D,[2,40]),{66:75,70:[1,76],71:[1,77],72:[1,78],73:[1,79],74:[1,80],75:[1,81],76:[1,82],77:[1,83]},{54:84,56:[1,85],64:[1,86],65:[1,87]},{17:88,69:N},{17:89,69:N},{17:90,69:N},{17:91,69:N},t([5,18,63,70,71,72,73,74,75,76,77,78],[2,62]),{5:[1,92]},{15:93,81:[1,94]},{5:[2,75]},t(D,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},t(D,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},t(D,[2,20]),{5:[1,102]},{5:[1,103]},t(D,[2,23]),t(D,[2,24]),t(D,[2,25]),t(D,[2,26]),t(D,[2,27]),t(D,[2,30]),t(D,[2,31]),t(B,a,{8:104}),t(B,a,{8:105}),t(B,a,{8:106}),t(L,a,{44:107,8:108}),t(I,a,{46:109,8:110}),t(F,a,{48:111,8:112}),t(B,a,{8:113}),{17:116,67:[1,114],68:[1,115],69:N},t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{17:117,69:N},{17:119,57:118,69:N},{69:[2,57]},{69:[2,58]},{55:120,78:P},{55:122,78:P},{55:123,78:P},{55:124,78:P},t(j,[2,10]),{13:125,82:O},{82:[2,74]},{19:[1,126]},t(D,[2,13]),{19:[1,127]},t(D,[2,15]),{5:[1,128]},t(D,[2,18]),t(D,[2,19]),t(D,[2,21]),t(D,[2,22]),{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[1,129],41:v,42:_,43:x,45:k,47:w,49:T,53:E,58:C,59:S,60:A,61:M,69:N,79:i},{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[1,130],41:v,42:_,43:x,45:k,47:w,49:T,53:E,58:C,59:S,60:A,61:M,69:N,79:i},{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[1,131],41:v,42:_,43:x,45:k,47:w,49:T,53:E,58:C,59:S,60:A,61:M,69:N,79:i},{40:[1,132]},{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[2,45],41:v,42:_,43:x,45:k,47:w,49:T,52:[1,133],53:E,58:C,59:S,60:A,61:M,69:N,79:i},{40:[1,134]},{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[2,43],41:v,42:_,43:x,45:k,47:w,49:T,51:[1,135],53:E,58:C,59:S,60:A,61:M,69:N,79:i},{40:[1,136]},{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[2,41],41:v,42:_,43:x,45:k,47:w,49:T,50:[1,137],53:E,58:C,59:S,60:A,61:M,69:N,79:i},{4:o,5:s,6:41,9:14,10:16,11:6,16:c,17:42,20:l,21:20,22:u,25:h,26:f,27:24,28:25,29:26,30:27,31:28,32:d,33:p,34:g,36:y,38:m,39:b,40:[1,138],41:v,42:_,43:x,45:k,47:w,49:T,53:E,58:C,59:S,60:A,61:M,69:N,79:i},{17:139,69:N},{17:140,69:N},{55:141,78:P},{55:142,78:P},{55:143,78:P},{63:[1,144],78:[2,56]},{5:[2,49]},{5:[2,71]},{5:[2,50]},{5:[2,51]},{5:[2,52]},{5:[1,145]},{5:[1,146]},{5:[1,147]},t(D,[2,17]),t(D,[2,33]),t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),{19:[1,148]},t(D,[2,37]),{19:[1,149]},t(D,[2,38]),{19:[1,150]},t(D,[2,39]),{55:151,78:P},{55:152,78:P},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:N},t(j,[2,11]),t(D,[2,12]),t(D,[2,14]),t(L,a,{8:108,44:154}),t(I,a,{8:110,46:155}),t(F,a,{8:112,48:156}),{5:[2,59]},{5:[2,60]},{78:[2,55]},{40:[2,46]},{40:[2,44]},{40:[2,42]}],defaultActions:{7:[2,72],8:[2,1],9:[2,2],10:[2,3],51:[2,75],86:[2,57],87:[2,58],94:[2,74],120:[2,49],121:[2,71],122:[2,50],123:[2,51],124:[2,52],141:[2,61],142:[2,47],143:[2,48],151:[2,59],152:[2,60],153:[2,55],154:[2,46],155:[2,44],156:[2,42]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},Y={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),79;case 1:return this.begin("type_directive"),80;case 2:return this.popState(),this.begin("arg_directive"),14;case 3:return this.popState(),this.popState(),82;case 4:return 81;case 5:case 52:case 65:return 5;case 6:case 7:case 8:case 9:case 10:break;case 11:return 23;case 12:return this.begin("ID"),16;case 13:return this.begin("ID"),20;case 14:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),69;case 15:return this.popState(),this.popState(),this.begin("LINE"),18;case 16:return this.popState(),this.popState(),5;case 17:return this.begin("LINE"),39;case 18:return this.begin("LINE"),41;case 19:return this.begin("LINE"),42;case 20:return this.begin("LINE"),43;case 21:return this.begin("LINE"),52;case 22:return this.begin("LINE"),45;case 23:return this.begin("LINE"),51;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),50;case 26:return this.begin("LINE"),49;case 27:return this.popState(),19;case 28:return 40;case 29:return 64;case 30:return 65;case 31:return 58;case 32:return 59;case 33:return 60;case 34:return 61;case 35:return 56;case 36:return 53;case 37:return this.begin("ID"),25;case 38:return this.begin("ID"),26;case 39:return 32;case 40:return 33;case 41:return this.begin("acc_title"),34;case 42:return this.popState(),"acc_title_value";case 43:return this.begin("acc_descr"),36;case 44:return this.popState(),"acc_descr_value";case 45:this.begin("acc_descr_multiline");break;case 46:this.popState();break;case 47:return "acc_descr_multiline_value";case 48:return 7;case 49:return 22;case 50:return 24;case 51:return 63;case 53:return e.yytext=e.yytext.trim(),69;case 54:return 72;case 55:return 73;case 56:return 70;case 57:return 71;case 58:return 74;case 59:return 75;case 60:return 76;case 61:return 77;case 62:return 78;case 63:return 67;case 64:return 68;case 66:return "INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[46,47],inclusive:!1},acc_descr:{rules:[44],inclusive:!1},acc_title:{rules:[42],inclusive:!1},open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,14],inclusive:!1},ALIAS:{rules:[7,8,15,16],inclusive:!1},LINE:{rules:[7,8,27],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66],inclusive:!0}}};function U(){this.yy={};}return z.lexer=Y,U.prototype=z,z.Parser=U,new U}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(1993).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},3584:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,3],r=[1,5],i=[1,7],a=[2,5],o=[1,15],s=[1,17],c=[1,19],l=[1,20],u=[1,21],h=[1,22],f=[1,33],d=[1,23],p=[1,24],g=[1,25],y=[1,26],m=[1,27],b=[1,30],v=[1,31],_=[1,32],x=[1,35],k=[1,36],w=[1,37],T=[1,38],E=[1,34],C=[1,41],S=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],A=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],M=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],N=[4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],O={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,directive:6,SD:7,document:8,line:9,statement:10,idStatement:11,DESCR:12,"--\x3e":13,HIDE_EMPTY:14,scale:15,WIDTH:16,COMPOSIT_STATE:17,STRUCT_START:18,STRUCT_STOP:19,STATE_DESCR:20,AS:21,ID:22,FORK:23,JOIN:24,CHOICE:25,CONCURRENT:26,note:27,notePosition:28,NOTE_TEXT:29,direction:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,openDirective:36,typeDirective:37,closeDirective:38,":":39,argDirective:40,direction_tb:41,direction_bt:42,direction_rl:43,direction_lr:44,eol:45,";":46,EDGE_STATE:47,left_of:48,right_of:49,open_directive:50,type_directive:51,arg_directive:52,close_directive:53,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"--\x3e",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",39:":",41:"direction_tb",42:"direction_bt",43:"direction_rl",44:"direction_lr",46:";",47:"EDGE_STATE",48:"left_of",49:"right_of",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[45,1],[45,1],[11,1],[11,1],[28,1],[28,1],[36,1],[37,1],[40,1],[38,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 4:return r.setRootDoc(a[s]),a[s];case 5:this.$=[];break;case 6:"nl"!=a[s]&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 7:case 8:case 39:case 40:this.$=a[s];break;case 9:this.$="nl";break;case 10:this.$={stmt:"state",id:a[s],type:"default",description:""};break;case 11:this.$={stmt:"state",id:a[s-1],type:"default",description:r.trimColon(a[s])};break;case 12:this.$={stmt:"relation",state1:{stmt:"state",id:a[s-2],type:"default",description:""},state2:{stmt:"state",id:a[s],type:"default",description:""}};break;case 13:this.$={stmt:"relation",state1:{stmt:"state",id:a[s-3],type:"default",description:""},state2:{stmt:"state",id:a[s-1],type:"default",description:""},description:a[s].substr(1).trim()};break;case 17:this.$={stmt:"state",id:a[s-3],type:"default",description:"",doc:a[s-1]};break;case 18:var c=a[s],l=a[s-2].trim();if(a[s].match(":")){var u=a[s].split(":");c=u[0],l=[l,u[1]];}this.$={stmt:"state",id:c,type:"default",description:l};break;case 19:this.$={stmt:"state",id:a[s-3],type:"default",description:a[s-5],doc:a[s-1]};break;case 20:this.$={stmt:"state",id:a[s],type:"fork"};break;case 21:this.$={stmt:"state",id:a[s],type:"join"};break;case 22:this.$={stmt:"state",id:a[s],type:"choice"};break;case 23:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 24:this.$={stmt:"state",id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 33:r.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 34:r.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 35:r.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 36:r.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 43:r.parseDirective("%%{","open_directive");break;case 44:r.parseDirective(a[s],"type_directive");break;case 45:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 46:r.parseDirective("}%%","close_directive","state");}},table:[{3:1,4:e,5:n,6:4,7:r,36:6,50:i},{1:[3]},{3:8,4:e,5:n,6:4,7:r,36:6,50:i},{3:9,4:e,5:n,6:4,7:r,36:6,50:i},{3:10,4:e,5:n,6:4,7:r,36:6,50:i},t([1,4,5,14,15,17,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],a,{8:11}),{37:12,51:[1,13]},{51:[2,43]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:s,6:28,9:14,10:16,11:18,14:c,15:l,17:u,20:h,22:f,23:d,24:p,25:g,26:y,27:m,30:29,31:b,33:v,35:_,36:6,41:x,42:k,43:w,44:T,47:E,50:i},{38:39,39:[1,40],53:C},t([39,53],[2,44]),t(S,[2,6]),{6:28,10:42,11:18,14:c,15:l,17:u,20:h,22:f,23:d,24:p,25:g,26:y,27:m,30:29,31:b,33:v,35:_,36:6,41:x,42:k,43:w,44:T,47:E,50:i},t(S,[2,8]),t(S,[2,9]),t(S,[2,10],{12:[1,43],13:[1,44]}),t(S,[2,14]),{16:[1,45]},t(S,[2,16],{18:[1,46]}),{21:[1,47]},t(S,[2,20]),t(S,[2,21]),t(S,[2,22]),t(S,[2,23]),{28:48,29:[1,49],48:[1,50],49:[1,51]},t(S,[2,26]),t(S,[2,27]),{32:[1,52]},{34:[1,53]},t(S,[2,30]),t(A,[2,39]),t(A,[2,40]),t(S,[2,33]),t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(M,[2,31]),{40:54,52:[1,55]},t(M,[2,46]),t(S,[2,7]),t(S,[2,11]),{11:56,22:f,47:E},t(S,[2,15]),t(N,a,{8:57}),{22:[1,58]},{22:[1,59]},{21:[1,60]},{22:[2,41]},{22:[2,42]},t(S,[2,28]),t(S,[2,29]),{38:61,53:C},{53:[2,45]},t(S,[2,12],{12:[1,62]}),{4:o,5:s,6:28,9:14,10:16,11:18,14:c,15:l,17:u,19:[1,63],20:h,22:f,23:d,24:p,25:g,26:y,27:m,30:29,31:b,33:v,35:_,36:6,41:x,42:k,43:w,44:T,47:E,50:i},t(S,[2,18],{18:[1,64]}),{29:[1,65]},{22:[1,66]},t(M,[2,32]),t(S,[2,13]),t(S,[2,17]),t(N,a,{8:67}),t(S,[2,24]),t(S,[2,25]),{4:o,5:s,6:28,9:14,10:16,11:18,14:c,15:l,17:u,19:[1,68],20:h,22:f,23:d,24:p,25:g,26:y,27:m,30:29,31:b,33:v,35:_,36:6,41:x,42:k,43:w,44:T,47:E,50:i},t(S,[2,19])],defaultActions:{7:[2,43],8:[2,1],9:[2,2],10:[2,3],50:[2,41],51:[2,42],55:[2,45]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},D={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:case 33:return 41;case 1:case 34:return 42;case 2:case 35:return 43;case 3:case 36:return 44;case 4:return this.begin("open_directive"),50;case 5:return this.begin("type_directive"),51;case 6:return this.popState(),this.begin("arg_directive"),39;case 7:return this.popState(),this.popState(),53;case 8:return 52;case 9:case 10:case 12:case 13:case 14:case 15:case 46:case 52:break;case 11:case 66:return 5;case 16:return this.pushState("SCALE"),15;case 17:return 16;case 18:case 24:case 40:case 43:this.popState();break;case 19:return this.begin("acc_title"),31;case 20:return this.popState(),"acc_title_value";case 21:return this.begin("acc_descr"),33;case 22:return this.popState(),"acc_descr_value";case 23:this.begin("acc_descr_multiline");break;case 25:return "acc_descr_multiline_value";case 26:this.pushState("STATE");break;case 27:case 30:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),23;case 28:case 31:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),24;case 29:case 32:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),25;case 37:this.begin("STATE_STRING");break;case 38:return this.popState(),this.pushState("STATE_ID"),"AS";case 39:case 54:return this.popState(),"ID";case 41:return "STATE_DESCR";case 42:return 17;case 44:return this.popState(),this.pushState("struct"),18;case 45:return this.popState(),19;case 47:return this.begin("NOTE"),27;case 48:return this.popState(),this.pushState("NOTE_ID"),48;case 49:return this.popState(),this.pushState("NOTE_ID"),49;case 50:this.popState(),this.pushState("FLOATING_NOTE");break;case 51:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 53:return "NOTE_TEXT";case 55:return this.popState(),this.pushState("NOTE_TEXT"),22;case 56:return this.popState(),e.yytext=e.yytext.substr(2).trim(),29;case 57:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),29;case 58:case 59:return 7;case 60:return 14;case 61:return 47;case 62:return 22;case 63:return e.yytext=e.yytext.trim(),12;case 64:return 13;case 65:return 26;case 67:return "INVALID"}},rules:[/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[13,14],inclusive:!1},close_directive:{rules:[13,14],inclusive:!1},arg_directive:{rules:[7,8,13,14],inclusive:!1},type_directive:{rules:[6,7,13,14],inclusive:!1},open_directive:{rules:[5,13,14],inclusive:!1},struct:{rules:[13,14,26,33,34,35,36,45,46,47,61,62,63,64,65],inclusive:!1},FLOATING_NOTE_ID:{rules:[54],inclusive:!1},FLOATING_NOTE:{rules:[51,52,53],inclusive:!1},NOTE_TEXT:{rules:[56,57],inclusive:!1},NOTE_ID:{rules:[55],inclusive:!1},NOTE:{rules:[48,49,50],inclusive:!1},acc_descr_multiline:{rules:[24,25],inclusive:!1},acc_descr:{rules:[22],inclusive:!1},acc_title:{rules:[20],inclusive:!1},SCALE:{rules:[17,18],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[39],inclusive:!1},STATE_STRING:{rules:[40,41],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[13,14,27,28,29,30,31,32,37,38,42,43,44],inclusive:!1},ID:{rules:[13,14],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,12,14,15,16,19,21,23,26,44,47,58,59,60,61,62,63,64,66,67],inclusive:!0}}};function B(){this.yy={};}return O.lexer=D,B.prototype=O,O.Parser=B,new B}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(3069).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},9763:(t,e,n)=>{t=n.nmd(t);var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,5],r=[6,9,11,17,18,20,22,23,24,26],i=[1,15],a=[1,16],o=[1,17],s=[1,18],c=[1,19],l=[1,20],u=[1,24],h=[4,6,9,11,17,18,20,22,23,24,26],f={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,taskName:24,taskData:25,open_directive:26,type_directive:27,arg_directive:28,close_directive:29,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",24:"taskName",25:"taskData",26:"open_directive",27:"type_directive",28:"arg_directive",29:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:case 7:case 8:this.$=[];break;case 4:a[s-1].push(a[s]),this.$=a[s-1];break;case 5:case 6:this.$=a[s];break;case 11:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 16:r.addTask(a[s-1],a[s]),this.$="task";break;case 18:r.parseDirective("%%{","open_directive");break;case 19:r.parseDirective(a[s],"type_directive");break;case 20:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 21:r.parseDirective("}%%","close_directive","journey");}},table:[{3:1,4:e,7:3,12:4,26:n},{1:[3]},t(r,[2,3],{5:6}),{3:7,4:e,7:3,12:4,26:n},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:i,18:a,20:o,22:s,23:c,24:l,26:n},{1:[2,2]},{14:22,15:[1,23],29:u},t([15,29],[2,19]),t(r,[2,8],{1:[2,1]}),t(r,[2,4]),{7:21,10:25,12:4,17:i,18:a,20:o,22:s,23:c,24:l,26:n},t(r,[2,6]),t(r,[2,7]),t(r,[2,11]),{19:[1,26]},{21:[1,27]},t(r,[2,14]),t(r,[2,15]),{25:[1,28]},t(r,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},t(r,[2,5]),t(r,[2,12]),t(r,[2,13]),t(r,[2,16]),t(h,[2,9]),{14:32,29:u},{29:[2,20]},{11:[1,33]},t(h,[2,10])],defaultActions:{5:[2,18],7:[2,2],24:[2,21],31:[2,20]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t);},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,l=0,u=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function v(){var t;return "number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,T,E,C,S,A,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=v()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>h&&A.push("'"+this.terminals_[E]+"'");N=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:A});}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(l=p.yyleng,s=p.yytext,c=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},b&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(M,[s,l,c,g.yy,w[1],i,a].concat(d))))return T;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return !0}}return !0}},d={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e);},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t));},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return (t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return !1}return !1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return !1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t);},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return (t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t);},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),26;case 1:return this.begin("type_directive"),27;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),29;case 4:return 28;case 5:case 6:case 8:case 9:break;case 7:return 11;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return "acc_descr_multiline_value";case 19:return 23;case 20:return 24;case 21:return 25;case 22:return 15;case 23:return 6;case 24:return "INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],inclusive:!0}}};function p(){this.yy={};}return f.lexer=d,p.prototype=f,f.Parser=p,new p}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var r=n(9143).readFileSync(n(6470).normalize(t[1]),"utf8");return e.parser.parse(r)},n.c[n.s]===t&&e.main(process.argv.slice(1));},7967:(t,e)=>{e.N=void 0;var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,i=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^([^:]+):/gm,o=[".","/"];e.N=function(t){var e,s=(e=t||"",e.replace(r,(function(t,e){return String.fromCharCode(e)}))).replace(i,"").trim();if(!s)return "about:blank";if(function(t){return o.indexOf(t[0])>-1}(s))return s;var c=s.match(a);if(!c)return s;var l=c[0];return n.test(l)?"about:blank":s};},3841:t=>{t.exports=function(t,e){return t.intersect(e)};},6187:(t,e,n)=>{n.d(e,{Z:()=>fu});var r=n(1941),i=n.n(r),a={debug:1,info:2,warn:3,error:4,fatal:5},o={debug:function(){},info:function(){},warn:function(){},error:function(){},fatal:function(){}},s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"fatal";isNaN(t)&&(t=t.toLowerCase(),void 0!==a[t]&&(t=a[t])),o.trace=function(){},o.debug=function(){},o.info=function(){},o.warn=function(){},o.error=function(){},o.fatal=function(){},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c("FATAL"),"color: orange"):console.log.bind(console,"",c("FATAL"))),t<=a.error&&(o.error=console.error?console.error.bind(console,c("ERROR"),"color: orange"):console.log.bind(console,"",c("ERROR"))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c("WARN"),"color: orange"):console.log.bind(console,"",c("WARN"))),t<=a.info&&(o.info=console.info?console.info.bind(console,c("INFO"),"color: lightblue"):console.log.bind(console,"",c("INFO"))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c("DEBUG"),"color: lightgreen"):console.log.bind(console,"",c("DEBUG")));},c=function(t){var e=i()().format("ss.SSS");return "%c".concat(e," : ").concat(t," : ")},l=n(7543),u="comm",h="rule",f="decl",d=Math.abs,p=String.fromCharCode;function g(t){return t.trim()}function y(t,e,n){return t.replace(e,n)}function m(t,e){return t.indexOf(e)}function b(t,e){return 0|t.charCodeAt(e)}function v(t,e,n){return t.slice(e,n)}function _(t){return t.length}function x(t){return t.length}function k(t,e){return e.push(t),t}function w(t,e){for(var n="",r=x(t),i=0;i0?b(N,--A):0,C--,10===M&&(C=1,E--),M}function B(){return M=A2||R(M)>3?"":" "}function z(t,e){for(;--e&&B()&&!(M<48||M>102||M>57&&M<65||M>70&&M<97););return F(t,I()+(e<6&&32==L()&&32==B()))}function Y(t){for(;B();)switch(M){case t:return A;case 34:case 39:34!==t&&39!==t&&Y(M);break;case 40:41===t&&Y(t);break;case 92:B();}return A}function U(t,e){for(;B()&&t+M!==57&&(t+M!==84||47!==L()););return "/*"+F(e,A-1)+"*"+p(47===t?t:B())}function $(t){for(;!R(L());)B();return F(t,A)}function W(t){return function(t){return N="",t}(q("",null,null,null,[""],t=function(t){return E=C=1,S=_(N=t),A=0,[]}(t),0,[0],t))}function q(t,e,n,r,i,a,o,s,c){for(var l=0,u=0,h=o,f=0,d=0,g=0,b=1,v=1,x=1,w=0,T="",E=i,C=a,S=r,A=T;v;)switch(g=w,w=B()){case 40:if(108!=g&&58==A.charCodeAt(h-1)){-1!=m(A+=y(P(w),"&","&\f"),"&\f")&&(x=-1);break}case 34:case 39:case 91:A+=P(w);break;case 9:case 10:case 13:case 32:A+=j(g);break;case 92:A+=z(I()-1,7);continue;case 47:switch(L()){case 42:case 47:k(V(U(B(),I()),e,n),c);break;default:A+="/";}break;case 123*b:s[l++]=_(A)*x;case 125*b:case 59:case 0:switch(w){case 0:case 125:v=0;case 59+u:d>0&&_(A)-h&&k(d>32?G(A+";",r,n,h-1):G(y(A," ","")+";",r,n,h-2),c);break;case 59:A+=";";default:if(k(S=H(A,e,n,l,u,i,s,T,E=[],C=[],h),a),123===w)if(0===u)q(A,e,S,S,E,a,h,s,C);else switch(f){case 100:case 109:case 115:q(t,S,S,r&&k(H(t,S,S,0,0,i,s,T,i,E=[],h),C),i,C,h,s,r?E:C);break;default:q(A,S,S,S,[""],C,0,s,C);}}l=u=d=0,b=x=1,T=A="",h=o;break;case 58:h=1+_(A),d=g;default:if(b<1)if(123==w)--b;else if(125==w&&0==b++&&125==D())continue;switch(A+=p(w),w*b){case 38:x=u>0?1:(A+="\f",-1);break;case 44:s[l++]=(_(A)-1)*x,x=1;break;case 64:45===L()&&(A+=P(B())),f=L(),u=h=_(T=A+=$(I())),w++;break;case 45:45===g&&2==_(A)&&(b=0);}}return a}function H(t,e,n,r,i,a,o,s,c,l,u){for(var f=i-1,p=0===i?a:[""],m=x(p),b=0,_=0,k=0;b0?p[w]+" "+T:y(T,/&\f/g,p[w])))&&(c[k++]=E);return O(t,e,n,0===i?h:s,c,l,u)}function V(t,e,n){return O(t,e,n,u,p(M),v(t,2,-2),0)}function G(t,e,n,r){return O(t,e,n,f,v(t,0,r),v(t,r+1,-1),r)}const X="9.1.7";function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}const Q=function t(e,n,r){var i=Object.assign({depth:2,clobber:!1},r),a=i.depth,o=i.clobber;return Array.isArray(n)&&!Array.isArray(e)?(n.forEach((function(n){return t(e,n,r)})),e):Array.isArray(n)&&Array.isArray(e)?(n.forEach((function(t){-1===e.indexOf(t)&&e.push(t);})),e):void 0===e||a<=0?null!=e&&"object"===Z(e)&&"object"===Z(n)?Object.assign(e,n):n:(void 0!==n&&"object"===Z(e)&&"object"===Z(n)&&Object.keys(n).forEach((function(r){"object"!==Z(n[r])||void 0!==e[r]&&"object"!==Z(e[r])?(o||"object"!==Z(e[r])&&"object"!==Z(n[r]))&&(e[r]=n[r]):(void 0===e[r]&&(e[r]=Array.isArray(n[r])?[]:{}),e[r]=t(e[r],n[r],{depth:a-1,clobber:o}));})),e)},K={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return 2.55*n;t/=360,e/=100;const i=(n/=100)<.5?n*(1+e):n+e-n*e,a=2*n-i;switch(r){case"r":return 255*K.hue2rgb(a,i,t+1/3);case"g":return 255*K.hue2rgb(a,i,t);case"b":return 255*K.hue2rgb(a,i,t-1/3)}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),a=Math.min(t,e,n),o=(i+a)/2;if("l"===r)return 100*o;if(i===a)return 0;const s=i-a;if("s"===r)return 100*(o>.5?s/(2-i-a):s/(i+a));switch(i){case t:return 60*((e-n)/s+(ee>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(1e10*t)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},tt={};for(let t=0;t<=255;t++)tt[t]=J.unit.dec2hex(t);const et=new class{constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new class{constructor(){this.type=0;}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t;}reset(){this.type=0;}is(t){return this.type===t}};}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=0,this}_ensureHSL(){const t=this.data,{h:e,s:n,l:r}=t;void 0===e&&(t.h=J.channel.rgb2hsl(t,"h")),void 0===n&&(t.s=J.channel.rgb2hsl(t,"s")),void 0===r&&(t.l=J.channel.rgb2hsl(t,"l"));}_ensureRGB(){const t=this.data,{r:e,g:n,b:r}=t;void 0===e&&(t.r=J.channel.hsl2rgb(t,"r")),void 0===n&&(t.g=J.channel.hsl2rgb(t,"g")),void 0===r&&(t.b=J.channel.hsl2rgb(t,"b"));}get r(){const t=this.data,e=t.r;return this.type.is(2)||void 0===e?(this._ensureHSL(),J.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(2)||void 0===e?(this._ensureHSL(),J.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(2)||void 0===e?(this._ensureHSL(),J.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(1)||void 0===e?(this._ensureRGB(),J.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(1)||void 0===e?(this._ensureRGB(),J.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(1)||void 0===e?(this._ensureRGB(),J.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(1),this.changed=!0,this.data.r=t;}set g(t){this.type.set(1),this.changed=!0,this.data.g=t;}set b(t){this.type.set(1),this.changed=!0,this.data.b=t;}set h(t){this.type.set(2),this.changed=!0,this.data.h=t;}set s(t){this.type.set(2),this.changed=!0,this.data.s=t;}set l(t){this.type.set(2),this.changed=!0,this.data.l=t;}set a(t){this.changed=!0,this.data.a=t;}}({r:0,g:0,b:0,a:0},"transparent"),nt={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(35!==t.charCodeAt(0))return;const e=t.match(nt.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,c=o?8:4,l=a?0:-1,u=o?255:15;return et.set({r:(r>>c*(l+3)&u)*s,g:(r>>c*(l+2)&u)*s,b:(r>>c*(l+1)&u)*s,a:a?(r&u)*s/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${tt[Math.round(e)]}${tt[Math.round(n)]}${tt[Math.round(r)]}${tt[Math.round(255*i)]}`:`#${tt[Math.round(e)]}${tt[Math.round(n)]}${tt[Math.round(r)]}`}},rt=nt,it={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(it.hueRe);if(e){const[,t,n]=e;switch(n){case"grad":return J.channel.clamp.h(.9*parseFloat(t));case"rad":return J.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return J.channel.clamp.h(360*parseFloat(t))}}return J.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const n=t.match(it.re);if(!n)return;const[,r,i,a,o,s]=n;return et.set({h:it._hue2deg(r),s:J.channel.clamp.s(parseFloat(i)),l:J.channel.clamp.l(parseFloat(a)),a:o?J.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${J.lang.round(e)}, ${J.lang.round(n)}%, ${J.lang.round(r)}%, ${i})`:`hsl(${J.lang.round(e)}, ${J.lang.round(n)}%, ${J.lang.round(r)}%)`}},at=it,ot={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=ot.colors[t];if(e)return rt.parse(e)},stringify:t=>{const e=rt.stringify(t);for(const t in ot.colors)if(ot.colors[t]===e)return t}},st=ot,ct={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const n=t.match(ct.re);if(!n)return;const[,r,i,a,o,s,c,l,u]=n;return et.set({r:J.channel.clamp.r(i?2.55*parseFloat(r):parseFloat(r)),g:J.channel.clamp.g(o?2.55*parseFloat(a):parseFloat(a)),b:J.channel.clamp.b(c?2.55*parseFloat(s):parseFloat(s)),a:l?J.channel.clamp.a(u?parseFloat(l)/100:parseFloat(l)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${J.lang.round(e)}, ${J.lang.round(n)}, ${J.lang.round(r)}, ${J.lang.round(i)})`:`rgb(${J.lang.round(e)}, ${J.lang.round(n)}, ${J.lang.round(r)})`}},lt=ct,ut={format:{keyword:st,hex:rt,rgb:lt,rgba:lt,hsl:at,hsla:at},parse:t=>{if("string"!=typeof t)return t;const e=rt.parse(t)||lt.parse(t)||at.parse(t)||st.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(2)||void 0===t.data.r?at.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?lt.stringify(t):rt.stringify(t)},ht=(t,e)=>{const n=ut.parse(t);for(const t in e)n[t]=J.channel.clamp[t](e[t]);return ut.stringify(n)},ft=(t,e)=>{const n=ut.parse(t),r={};for(const t in e)e[t]&&(r[t]=n[t]+e[t]);return ht(t,r)},dt=(t,e,n=0,r=1)=>{if("number"!=typeof t)return ht(t,{a:e});const i=et.set({r:J.channel.clamp.r(t),g:J.channel.clamp.g(e),b:J.channel.clamp.b(n),a:J.channel.clamp.a(r)});return ut.stringify(i)},pt=(t,e=100)=>{const n=ut.parse(t);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,((t,e,n=50)=>{const{r,g:i,b:a,a:o}=ut.parse(t),{r:s,g:c,b:l,a:u}=ut.parse(e),h=n/100,f=2*h-1,d=o-u,p=((f*d==-1?f:(f+d)/(1+f*d))+1)/2,g=1-p;return dt(r*p+s*g,i*p+c*g,a*p+l*g,o*h+u*(1-h))})(n,t,e)},gt=(t,e,n)=>{const r=ut.parse(t),i=r[e],a=J.channel.clamp[e](i+n);return i!==a&&(r[e]=a),ut.stringify(r)},yt=(t,e)=>gt(t,"l",-e),mt=(t,e)=>gt(t,"l",e);var bt=function(t,e){return ft(t,e?{s:-40,l:10}:{s:-40,l:-10})};function vt(t){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function _t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).reduce((function(r,i){return Array.isArray(e[i])?r:"object"===Rt(e[i])&&null!==e[i]?[].concat(It(r),[n+i],It(t(e[i],""))):[].concat(It(r),[n+i])}),[])}(Pt,"");const zt=Pt;function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(t)}var Ut,$t=Object.freeze(zt),Wt=Q({},$t),qt=[],Ht=Q({},$t),Vt=function(t,e){for(var n=Q({},t),r={},i=0;i-1||e[n].indexOf(">")>-1||e[n].indexOf("url(data:")>-1)&&delete e[n],"object"===Yt(e[n])&&t(e[n]);}));},Qt=function(t){t.fontFamily&&(t.themeVariables&&t.themeVariables.fontFamily||(t.themeVariables={fontFamily:t.fontFamily})),qt.push(t),Vt(Wt,qt);},Kt=function(){Vt(Wt,qt=[]);},Jt=n(7856),te=n.n(Jt),ee=function(t){var e=t.replace(/\\u[\dA-F]{4}/gi,(function(t){return String.fromCharCode(parseInt(t.replace(/\\u/g,""),16))}));return e=(e=(e=e.replace(/\\x([0-9a-f]{2})/gi,(function(t,e){return String.fromCharCode(parseInt(e,16))}))).replace(/\\[\d\d\d]{3}/gi,(function(t){return String.fromCharCode(parseInt(t.replace(/\\/g,""),8))}))).replace(/\\[\d\d\d]{2}/gi,(function(t){return String.fromCharCode(parseInt(t.replace(/\\/g,""),8))}))},ne=function(t){for(var e="",n=0;n>=0;){if(!((n=t.indexOf("=0)){e+=t,n=-1;break}e+=t.substr(0,n),(n=(t=t.substr(n+1)).indexOf("<\/script>"))>=0&&(n+=9,t=t.substr(n));}var r=ee(e);return (r=(r=(r=(r=r.replace(/script>/gi,"#")).replace(/javascript:/gi,"#")).replace(/javascript&colon/gi,"#")).replace(/onerror=/gi,"onerror:")).replace(/');}else "loose"!==s.securityLevel&&(M=te().sanitize(M,{ADD_TAGS:["foreignobject"],ADD_ATTR:["dominant-baseline"]}));if(void 0!==n)switch(b){case"flowchart":case"flowchart-v2":n(M,la.bindFunctions);break;case"gantt":n(M,go.bindFunctions);break;case"class":case"classDiagram":n(M,fr.bindFunctions);break;default:n(M);}else o.debug("CB = undefined!");vs.forEach((function(t){t();})),vs=[];var D="sandbox"===s.securityLevel?"#i"+t:"#d"+t,B=(0, l.select)(D).node();if(null!==B&&"function"==typeof B.remove&&(0, l.select)(D).node().remove(),u)throw u;return M},parse:function(t,e){ru||(Vl(),ru=!0);var n=!1;try{var r=e||new Ql(t);return r.db.clear(),r.parse(t)}catch(t){if(n=!0,!fu.parseError)throw t;null!=t.str?fu.parseError(t.str,t.hash):fu.parseError(t);}return !n},parseDirective:function(t,e,n,r){try{if(void 0!==e)switch(e=e.trim(),n){case"open_directive":au={};break;case"type_directive":au.type=e.toLowerCase();break;case"arg_directive":au.args=JSON.parse(e);break;case"close_directive":(function(t,e,n){switch(o.debug("Directive type=".concat(e.type," with args:"),e.args),e.type){case"init":case"initialize":["config"].forEach((function(t){void 0!==e.args[t]&&("flowchart-v2"===n&&(n="flowchart"),e.args[n]=e.args[t],delete e.args[t]);})),o.debug("sanitize in handleDirective",e.args),Cn(e.args),o.debug("sanitize in handleDirective (done)",e.args),Qt(e.args);break;case"wrap":case"nowrap":t&&t.setWrap&&t.setWrap("wrap"===e.type);break;case"themeCss":o.warn("themeCss encountered");break;default:o.warn("Unhandled directive: source: '%%{".concat(e.type,": ").concat(JSON.stringify(e.args?e.args:{}),"}%%"),e);}})(t,au,r),au=null;}}catch(t){o.error("Error while rendering sequenceDiagram directive: ".concat(e," jison context: ").concat(n)),o.error(t.message);}},initialize:function(t){var e;null!=t&&t.fontFamily&&(null!==(e=t.themeVariables)&&void 0!==e&&e.fontFamily||(t.themeVariables={fontFamily:t.fontFamily})),function(t){Ut=Q({},t);}(t),null!=t&&t.theme&&Lt[t.theme]?t.themeVariables=Lt[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Lt.default.getThemeVariables(t.themeVariables));var n="object"===nu(t)?function(t){return Wt=Q({},$t),Wt=Q(Wt,t),t.theme&&Lt[t.theme]&&(Wt.themeVariables=Lt[t.theme].getThemeVariables(t.themeVariables)),Ht=Vt(Wt,qt),Wt}(t):Gt();ou(n),s(n.logLevel),ru||(Vl(),ru=!0);},getConfig:Xt,setConfig:function(t){return Q(Ht,t),Xt()},getSiteConfig:Gt,updateSiteConfig:function(t){return Wt=Q(Wt,t),Vt(Wt,qt),Wt},reset:function(){Kt();},globalReset:function(){Kt(),ou(Xt());},defaultConfig:$t});s(Xt().logLevel),Kt(Xt());const cu=su;var lu=function(){var t,e,n=cu.getConfig();arguments.length>=2?(void 0!==arguments[0]&&(hu.sequenceConfig=arguments[0]),t=arguments[1]):t=arguments[0],"function"==typeof arguments[arguments.length-1]?(e=arguments[arguments.length-1],o.debug("Callback function found")):void 0!==n.mermaid&&("function"==typeof n.mermaid.callback?(e=n.mermaid.callback,o.debug("Callback function found")):o.debug("No Callback function found")),t=void 0===t?document.querySelectorAll(".mermaid"):"string"==typeof t?document.querySelectorAll(t):t instanceof window.Node?[t]:t,o.debug("Start On Load before: "+hu.startOnLoad),void 0!==hu.startOnLoad&&(o.debug("Start On Load inner: "+hu.startOnLoad),cu.updateSiteConfig({startOnLoad:hu.startOnLoad})),void 0!==hu.ganttConfig&&cu.updateSiteConfig({gantt:hu.ganttConfig});for(var r,i=new An.initIdGenerator(n.deterministicIds,n.deterministicIDSeed),a=[],s=function(n){o.info("Rendering diagram: "+t[n].id,n);var s=t[n];if(s.getAttribute("data-processed"))return "continue";s.setAttribute("data-processed",!0);var c="mermaid-".concat(i.next());r=s.innerHTML,r=An.entityDecode(r).trim().replace(//gi,"
");var l=An.detectInit(r);l&&o.debug("Detected early reinit: ",l);try{cu.render(c,r,(function(t,n){s.innerHTML=t,void 0!==e&&e(c),n&&n(s);}),s);}catch(t){o.warn("Catching Error (bootstrap)",t),"function"==typeof hu.parseError&&hu.parseError({error:t,str:t.str,hash:t.hash,message:t.str}),a.push({error:t,str:t.str,hash:t.hash,message:t.str});}},c=0;c0)throw a[0]},uu=function(){hu.startOnLoad?cu.getConfig().startOnLoad&&hu.init():void 0===hu.startOnLoad&&(o.debug("In start, no config"),cu.getConfig().startOnLoad&&hu.init());};"undefined"!=typeof document&&window.addEventListener("load",(function(){uu();}),!1);var hu={startOnLoad:!0,htmlLabels:!0,diagrams:{},mermaidAPI:cu,parse:null!=cu?cu.parse:null,render:null!=cu?cu.render:null,init:function(){try{lu.apply(void 0,arguments);}catch(t){o.warn("Syntax Error rendering"),o.warn(t.str);}},initThrowsErrors:lu,initialize:function(t){void 0!==t.mermaid&&(void 0!==t.mermaid.startOnLoad&&(hu.startOnLoad=t.mermaid.startOnLoad),void 0!==t.mermaid.htmlLabels&&(hu.htmlLabels="false"!==t.mermaid.htmlLabels&&!1!==t.mermaid.htmlLabels)),cu.initialize(t);},contentLoaded:uu,setParseErrorHandler:function(t){hu.parseError=t;}};const fu=hu;},4949:(t,e,n)=>{t.exports={graphlib:n(6614),dagre:n(6478),intersect:n(8114),render:n(5787),util:n(8355),version:n(5689)};},9144:(t,e,n)=>{var r=n(8355);function i(t,e,n,i){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(a,n[i+"Style"]),n[i+"Class"]&&a.attr("class",n[i+"Class"]);}t.exports={default:i,normal:i,vee:function(t,e,n,i){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(a,n[i+"Style"]),n[i+"Class"]&&a.attr("class",n[i+"Class"]);},undirected:function(t,e,n,i){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(a,n[i+"Style"]),n[i+"Class"]&&a.attr("class",n[i+"Class"]);}};},5632:(t,e,n)=>{var r=n(8355),i=n(4322),a=n(1322);t.exports=function(t,e){var n,o=e.nodes().filter((function(t){return r.isSubgraph(e,t)})),s=t.selectAll("g.cluster").data(o,(function(t){return t}));return s.selectAll("*").remove(),s.enter().append("g").attr("class","cluster").attr("id",(function(t){return e.node(t).id})).style("opacity",0),s=t.selectAll("g.cluster"),r.applyTransition(s,e).style("opacity",1),s.each((function(t){var n=e.node(t),r=i.select(this);i.select(this).append("rect");var o=r.append("g").attr("class","label");a(o,n,n.clusterLabelPos);})),s.selectAll("rect").each((function(t){var n=e.node(t),a=i.select(this);r.applyStyle(a,n.style);})),n=s.exit?s.exit():s.selectAll(null),r.applyTransition(n,e).style("opacity",0).remove(),s};},6315:(t,e,n)=>{var r=n(1034),i=n(1322),a=n(8355),o=n(4322);t.exports=function(t,e){var n,s=t.selectAll("g.edgeLabel").data(e.edges(),(function(t){return a.edgeToId(t)})).classed("update",!0);return s.exit().remove(),s.enter().append("g").classed("edgeLabel",!0).style("opacity",0),(s=t.selectAll("g.edgeLabel")).each((function(t){var n=o.select(this);n.select(".label").remove();var a=e.edge(t),s=i(n,e.edge(t),0,0).classed("label",!0),c=s.node().getBBox();a.labelId&&s.attr("id",a.labelId),r.has(a,"width")||(a.width=c.width),r.has(a,"height")||(a.height=c.height);})),n=s.exit?s.exit():s.selectAll(null),a.applyTransition(n,e).style("opacity",0).remove(),s};},940:(t,e,n)=>{var r=n(1034),i=n(3042),a=n(8355),o=n(4322);function s(t,e){var n=(o.line||o.svg.line)().x((function(t){return t.x})).y((function(t){return t.y}));return (n.curve||n.interpolate)(t.curve),n(e)}t.exports=function(t,e,n){var c=t.selectAll("g.edgePath").data(e.edges(),(function(t){return a.edgeToId(t)})).classed("update",!0),l=function(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);return n.append("path").attr("class","path").attr("d",(function(t){var n=e.edge(t),i=e.node(t.v).elem;return s(n,r.range(n.points.length).map((function(){return e=(t=i).getBBox(),{x:(n=t.ownerSVGElement.getScreenCTM().inverse().multiply(t.getScreenCTM()).translate(e.width/2,e.height/2)).e,y:n.f};var t,e,n;})))})),n.append("defs"),n}(c,e);!function(t,e){var n=t.exit();a.applyTransition(n,e).style("opacity",0).remove();}(c,e);var u=void 0!==c.merge?c.merge(l):c;return a.applyTransition(u,e).style("opacity",1),u.each((function(t){var n=o.select(this),r=e.edge(t);r.elem=this,r.id&&n.attr("id",r.id),a.applyClass(n,r.class,(n.classed("update")?"update ":"")+"edgePath");})),u.selectAll("path.path").each((function(t){var n=e.edge(t);n.arrowheadId=r.uniqueId("arrowhead");var c=o.select(this).attr("marker-end",(function(){return "url("+(t=location.href,e=n.arrowheadId,t.split("#")[0]+"#"+e+")");var t,e;})).style("fill","none");a.applyTransition(c,e).attr("d",(function(t){return function(t,e){var n=t.edge(e),r=t.node(e.v),a=t.node(e.w),o=n.points.slice(1,n.points.length-1);return o.unshift(i(r,o[0])),o.push(i(a,o[o.length-1])),s(n,o)}(e,t)})),a.applyStyle(c,n.style);})),u.selectAll("defs *").remove(),u.selectAll("defs").each((function(t){var r=e.edge(t);(0, n[r.arrowhead])(o.select(this),r.arrowheadId,r,"arrowhead");})),u};},607:(t,e,n)=>{var r=n(1034),i=n(1322),a=n(8355),o=n(4322);t.exports=function(t,e,n){var s,c=e.nodes().filter((function(t){return !a.isSubgraph(e,t)})),l=t.selectAll("g.node").data(c,(function(t){return t})).classed("update",!0);return l.exit().remove(),l.enter().append("g").attr("class","node").style("opacity",0),(l=t.selectAll("g.node")).each((function(t){var s=e.node(t),c=o.select(this);a.applyClass(c,s.class,(c.classed("update")?"update ":"")+"node"),c.select("g.label").remove();var l=c.append("g").attr("class","label"),u=i(l,s),h=n[s.shape],f=r.pick(u.node().getBBox(),"width","height");s.elem=this,s.id&&c.attr("id",s.id),s.labelId&&l.attr("id",s.labelId),r.has(s,"width")&&(f.width=s.width),r.has(s,"height")&&(f.height=s.height),f.width+=s.paddingLeft+s.paddingRight,f.height+=s.paddingTop+s.paddingBottom,l.attr("transform","translate("+(s.paddingLeft-s.paddingRight)/2+","+(s.paddingTop-s.paddingBottom)/2+")");var d=o.select(this);d.select(".label-container").remove();var p=h(d,f,s).classed("label-container",!0);a.applyStyle(p,s.style);var g=p.node().getBBox();s.width=g.width,s.height=g.height;})),s=l.exit?l.exit():l.selectAll(null),a.applyTransition(s,e).style("opacity",0).remove(),l};},4322:(t,e,n)=>{var r;if(!r)try{r=n(7543);}catch(t){}r||(r=window.d3),t.exports=r;},6478:(t,e,n)=>{var r;try{r=n(681);}catch(t){}r||(r=window.dagre),t.exports=r;},6614:(t,e,n)=>{var r;try{r=n(8282);}catch(t){}r||(r=window.graphlib),t.exports=r;},8114:(t,e,n)=>{t.exports={node:n(3042),circle:n(6587),ellipse:n(3260),polygon:n(5337),rect:n(8049)};},6587:(t,e,n)=>{var r=n(3260);t.exports=function(t,e,n){return r(t,e,e,n)};},3260:t=>{t.exports=function(t,e,n,r){var i=t.x,a=t.y,o=i-r.x,s=a-r.y,c=Math.sqrt(e*e*s*s+n*n*o*o),l=Math.abs(e*n*o/c);r.x{function e(t,e){return t*e>0}t.exports=function(t,n,r,i){var a,o,s,c,l,u,h,f,d,p,g,y,m;if(!(a=n.y-t.y,s=t.x-n.x,l=n.x*t.y-t.x*n.y,d=a*r.x+s*r.y+l,p=a*i.x+s*i.y+l,0!==d&&0!==p&&e(d,p)||(o=i.y-r.y,c=r.x-i.x,u=i.x*r.y-r.x*i.y,h=o*t.x+c*t.y+u,f=o*n.x+c*n.y+u,0!==h&&0!==f&&e(h,f)||0==(g=a*c-o*s))))return y=Math.abs(g/2),{x:(m=s*u-c*l)<0?(m-y)/g:(m+y)/g,y:(m=o*l-a*u)<0?(m-y)/g:(m+y)/g}};},3042:t=>{t.exports=function(t,e){return t.intersect(e)};},5337:(t,e,n)=>{var r=n(6808);t.exports=function(t,e,n){var i=t.x,a=t.y,o=[],s=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY;e.forEach((function(t){s=Math.min(s,t.x),c=Math.min(c,t.y);}));for(var l=i-t.width/2-s,u=a-t.height/2-c,h=0;h1&&o.sort((function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),o=e.x-n.x,s=e.y-n.y,c=Math.sqrt(o*o+s*s);return a{t.exports=function(t,e){var n,r,i=t.x,a=t.y,o=e.x-i,s=e.y-a,c=t.width/2,l=t.height/2;return Math.abs(s)*c>Math.abs(o)*l?(s<0&&(l=-l),n=0===s?0:l*o/s,r=l):(o<0&&(c=-c),n=c,r=0===o?0:c*s/o),{x:i+n,y:a+r}};},8284:(t,e,n)=>{var r=n(8355);t.exports=function(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div");i.attr("xmlns","http://www.w3.org/1999/xhtml");var a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert((function(){return a}));break;default:i.html(a);}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var o=i.node().getBoundingClientRect();return n.attr("width",o.width).attr("height",o.height),n};},1322:(t,e,n)=>{var r=n(7318),i=n(8284),a=n(8287);t.exports=function(t,e,n){var o=e.label,s=t.append("g");"svg"===e.labelType?a(s,e):"string"!=typeof o||"html"===e.labelType?i(s,e):r(s,e);var c,l=s.node().getBBox();switch(n){case"top":c=-e.height/2;break;case"bottom":c=e.height/2-l.height;break;default:c=-l.height/2;}return s.attr("transform","translate("+-l.width/2+","+c+")"),s};},8287:(t,e,n)=>{var r=n(8355);t.exports=function(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n};},7318:(t,e,n)=>{var r=n(8355);t.exports=function(t,e){for(var n=t.append("text"),i=function(t){for(var e,n="",r=!1,i=0;i{var r;try{r={defaults:n(1747),each:n(6073),isFunction:n(3560),isPlainObject:n(8630),pick:n(9722),has:n(8721),range:n(6026),uniqueId:n(3955)};}catch(t){}r||(r=window._),t.exports=r;},6381:(t,e,n)=>{var r=n(8355),i=n(4322);t.exports=function(t,e){var n=t.filter((function(){return !i.select(this).classed("update")}));function a(t){var n=e.node(t);return "translate("+n.x+","+n.y+")"}n.attr("transform",a),r.applyTransition(t,e).style("opacity",1).attr("transform",a),r.applyTransition(n.selectAll("rect"),e).attr("width",(function(t){return e.node(t).width})).attr("height",(function(t){return e.node(t).height})).attr("x",(function(t){return -e.node(t).width/2})).attr("y",(function(t){return -e.node(t).height/2}));};},4577:(t,e,n)=>{var r=n(8355),i=n(4322),a=n(1034);t.exports=function(t,e){function n(t){var n=e.edge(t);return a.has(n,"x")?"translate("+n.x+","+n.y+")":""}t.filter((function(){return !i.select(this).classed("update")})).attr("transform",n),r.applyTransition(t,e).style("opacity",1).attr("transform",n);};},4849:(t,e,n)=>{var r=n(8355),i=n(4322);t.exports=function(t,e){function n(t){var n=e.node(t);return "translate("+n.x+","+n.y+")"}t.filter((function(){return !i.select(this).classed("update")})).attr("transform",n),r.applyTransition(t,e).style("opacity",1).attr("transform",n);};},5787:(t,e,n)=>{var r=n(1034),i=n(4322),a=n(6478).layout;t.exports=function(){var t=n(607),e=n(5632),i=n(6315),l=n(940),u=n(4849),h=n(4577),f=n(6381),d=n(4418),p=n(9144),g=function(n,g){!function(t){t.nodes().forEach((function(e){var n=t.node(e);r.has(n,"label")||t.children(e).length||(n.label=e),r.has(n,"paddingX")&&r.defaults(n,{paddingLeft:n.paddingX,paddingRight:n.paddingX}),r.has(n,"paddingY")&&r.defaults(n,{paddingTop:n.paddingY,paddingBottom:n.paddingY}),r.has(n,"padding")&&r.defaults(n,{paddingLeft:n.padding,paddingRight:n.padding,paddingTop:n.padding,paddingBottom:n.padding}),r.defaults(n,o),r.each(["paddingLeft","paddingRight","paddingTop","paddingBottom"],(function(t){n[t]=Number(n[t]);})),r.has(n,"width")&&(n._prevWidth=n.width),r.has(n,"height")&&(n._prevHeight=n.height);})),t.edges().forEach((function(e){var n=t.edge(e);r.has(n,"label")||(n.label=""),r.defaults(n,s);}));}(g);var y=c(n,"output"),m=c(y,"clusters"),b=c(y,"edgePaths"),v=i(c(y,"edgeLabels"),g),_=t(c(y,"nodes"),g,d);a(g),u(_,g),h(v,g),l(b,g,p);var x=e(m,g);f(x,g),function(t){r.each(t.nodes(),(function(e){var n=t.node(e);r.has(n,"_prevWidth")?n.width=n._prevWidth:delete n.width,r.has(n,"_prevHeight")?n.height=n._prevHeight:delete n.height,delete n._prevWidth,delete n._prevHeight;}));}(g);};return g.createNodes=function(e){return arguments.length?(t=e,g):t},g.createClusters=function(t){return arguments.length?(e=t,g):e},g.createEdgeLabels=function(t){return arguments.length?(i=t,g):i},g.createEdgePaths=function(t){return arguments.length?(l=t,g):l},g.shapes=function(t){return arguments.length?(d=t,g):d},g.arrows=function(t){return arguments.length?(p=t,g):p},g};var o={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},s={arrowhead:"normal",curve:i.curveLinear};function c(t,e){var n=t.select("g."+e);return n.empty()&&(n=t.append("g").attr("class",e)),n}},4418:(t,e,n)=>{var r=n(8049),i=n(3260),a=n(6587),o=n(5337);t.exports={rect:function(t,e,n){var i=t.insert("rect",":first-child").attr("rx",n.rx).attr("ry",n.ry).attr("x",-e.width/2).attr("y",-e.height/2).attr("width",e.width).attr("height",e.height);return n.intersect=function(t){return r(n,t)},i},ellipse:function(t,e,n){var r=e.width/2,a=e.height/2,o=t.insert("ellipse",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("rx",r).attr("ry",a);return n.intersect=function(t){return i(n,r,a,t)},o},circle:function(t,e,n){var r=Math.max(e.width,e.height)/2,i=t.insert("circle",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("r",r);return n.intersect=function(t){return a(n,r,t)},i},diamond:function(t,e,n){var r=e.width*Math.SQRT2/2,i=e.height*Math.SQRT2/2,a=[{x:0,y:-i},{x:-r,y:0},{x:0,y:i},{x:r,y:0}],s=t.insert("polygon",":first-child").attr("points",a.map((function(t){return t.x+","+t.y})).join(" "));return n.intersect=function(t){return o(n,a,t)},s}};},8355:(t,e,n)=>{var r=n(1034);t.exports={isSubgraph:function(t,e){return !!t.children(e).length},edgeToId:function(t){return a(t.v)+":"+a(t.w)+":"+a(t.name)},applyStyle:function(t,e){e&&t.attr("style",e);},applyClass:function(t,e,n){e&&t.attr("class",e).attr("class",n+" "+t.attr("class"));},applyTransition:function(t,e){var n=e.graph();if(r.isPlainObject(n)){var i=n.transition;if(r.isFunction(i))return i(t)}return t}};var i=/:/g;function a(t){return t?String(t).replace(i,"\\:"):""}},5689:t=>{t.exports="0.6.4";},681:(t,e,n)=>{t.exports={graphlib:n(574),layout:n(8123),debug:n(7570),util:{time:n(1138).time,notime:n(1138).notime},version:n(8177)};},2188:(t,e,n)=>{var r=n(8436),i=n(4079);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};return r.forEach(t.nodes(),(function a(o){r.has(i,o)||(i[o]=!0,n[o]=!0,r.forEach(t.outEdges(o),(function(t){r.has(n,t.w)?e.push(t):a(t.w);})),delete n[o]);})),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"));}));},undo:function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r);}}));}};},1133:(t,e,n)=>{var r=n(8436),i=n(1138);function a(t,e,n,r,a,o){var s={width:0,height:0,rank:o,borderType:e},c=a[e][o-1],l=i.addDummyNode(t,"border",s,n);a[e][o]=l,t.setParent(l,r),c&&t.setEdge(c,l,{weight:1});}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),o=t.node(n);if(i.length&&r.forEach(i,e),r.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var s=o.minRank,c=o.maxRank+1;s{var r=n(8436);function i(t){r.forEach(t.nodes(),(function(e){a(t.node(e));})),r.forEach(t.edges(),(function(e){a(t.edge(e));}));}function a(t){var e=t.width;t.width=t.height,t.height=e;}function o(t){t.y=-t.y;}function s(t){var e=t.x;t.x=t.y,t.y=e;}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t);},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){o(t.node(e));})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,o),r.has(n,"y")&&o(n);}));}(t),"lr"!==e&&"rl"!==e||(function(t){r.forEach(t.nodes(),(function(e){s(t.node(e));})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"x")&&s(n);}));}(t),i(t));}};},7822:t=>{function e(){var t={};t._next=t._prev=t,this._sentinel=t;}function n(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev;}function r(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=e,e.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return n(e),e},e.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&n(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e;},e.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,r)),n=n._prev;return "["+t.join(", ")+"]"};},7570:(t,e,n)=>{var r=n(8436),i=n(1138),a=n(574).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank);})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name);})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}));})),n}};},574:(t,e,n)=>{var r;try{r=n(8282);}catch(t){}r||(r=window.graphlib),t.exports=r;},4079:(t,e,n)=>{var r=n(8436),i=n(574).Graph,a=n(7822);t.exports=function(t,e){if(t.nodeCount()<=1)return [];var n=function(t,e){var n=new i,o=0,s=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0});})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),a=r+i;n.setEdge(t.v,t.w,a),s=Math.max(s,n.node(t.v).out+=i),o=Math.max(o,n.node(t.w).in+=i);}));var l=r.range(s+o+3).map((function(){return new a})),u=o+1;return r.forEach(n.nodes(),(function(t){c(l,u,n.node(t));})),{graph:n,buckets:l,zeroIdx:u}}(t,e||o),l=function(t,e,n){for(var r,i=[],a=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)s(t,e,n,r);for(;r=a.dequeue();)s(t,e,n,r);if(t.nodeCount())for(var c=e.length-2;c>0;--c)if(r=e[c].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(l,(function(e){return t.outEdges(e.v,e.w)})),!0)};var o=r.constant(1);function s(t,e,n,i,a){var o=a?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);a&&o.push({v:r.v,w:r.w}),s.out-=i,c(e,n,s);})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),a=r.w,o=t.node(a);o.in-=i,c(e,n,o);})),t.removeNode(i.v),o}function c(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n);}},8123:(t,e,n)=>{var r=n(8436),i=n(2188),a=n(5995),o=n(8093),s=n(1138).normalizeRanks,c=n(4219),l=n(1138).removeEmptyRanks,u=n(2981),h=n(1133),f=n(3258),d=n(3408),p=n(7873),g=n(1138),y=n(574).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new y({multigraph:!0,compound:!0}),n=C(t.graph());return e.setGraph(r.merge({},b,E(n,m),r.pick(n,v))),r.forEach(t.nodes(),(function(n){var i=C(t.node(n));e.setNode(n,r.defaults(E(i,_),x)),e.setParent(n,t.parent(n));})),r.forEach(t.edges(),(function(n){var i=C(t.edge(n));e.setEdge(n,r.merge({},w,E(i,k),r.pick(i,T)));})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset);}));}(t);})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e);}}));}(t);})),e(" acyclic",(function(){i.run(t);})),e(" nestingGraph.run",(function(){u.run(t);})),e(" rank",(function(){o(g.asNonCompoundGraph(t));})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};g.addDummyNode(t,"edge-proxy",i,"_ep");}}));}(t);})),e(" removeEmptyRanks",(function(){l(t);})),e(" nestingGraph.cleanup",(function(){u.cleanup(t);})),e(" normalizeRanks",(function(){s(t);})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank));})),t.graph().maxRank=e;}(t);})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e));}));}(t);})),e(" normalize.run",(function(){a.run(t);})),e(" parentDummyChains",(function(){c(t);})),e(" addBorderSegments",(function(){h(t);})),e(" order",(function(){d(t);})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var a=t.node(e);a.order=i+n,r.forEach(a.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:a.rank,order:i+ ++n,e:e.e,label:e.label},"_se");})),delete a.selfEdges;}));}));}(t);})),e(" adjustCoordinateSystem",(function(){f.adjust(t);})),e(" position",(function(){p(t);})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y;}}));}(t);})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),a=t.node(n.borderBottom),o=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-o.x),n.height=Math.abs(a.y-i.y),n.x=o.x+n.width/2,n.y=i.y+n.height/2;}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e);}));}(t);})),e(" normalize.undo",(function(){a.undo(t);})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;}}));}(t);})),e(" undoCoordinateSystem",(function(){f.undo(t);})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,a=0,o=t.graph(),s=o.marginx||0,c=o.marginy||0;function l(t){var r=t.x,o=t.y,s=t.width,c=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,o-c/2),a=Math.max(a,o+c/2);}r.forEach(t.nodes(),(function(e){l(t.node(e));})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&l(n);})),e-=s,i-=c,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i;})),r.forEach(t.edges(),(function(n){var a=t.edge(n);r.forEach(a.points,(function(t){t.x-=e,t.y-=i;})),r.has(a,"x")&&(a.x-=e),r.has(a,"y")&&(a.y-=i);})),o.width=n-e+s,o.height=a-i+c;}(t);})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),a=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=a),i.points.unshift(g.intersectRect(a,n)),i.points.push(g.intersectRect(o,r));}));}(t);})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse();}));}(t);})),e(" acyclic.undo",(function(){i.undo(t);}));}(e,n);})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height));})),r.forEach(t.edges(),(function(n){var i=t.edge(n),a=e.edge(n);i.points=a.points,r.has(a,"x")&&(i.x=a.x,i.y=a.y);})),t.graph().width=e.graph().width,t.graph().height=e.graph().height;}(t,e);}));}));};var m=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},v=["acyclicer","ranker","rankdir","align"],_=["width","height"],x={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function E(t,e){return r.mapValues(r.pick(t,e),Number)}function C(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t;})),e}},8436:(t,e,n)=>{var r;try{r={cloneDeep:n(361),constant:n(5703),defaults:n(1747),each:n(6073),filter:n(3105),find:n(3311),flatten:n(5564),forEach:n(4486),forIn:n(2620),has:n(8721),isUndefined:n(2353),last:n(928),map:n(5161),mapValues:n(6604),max:n(6162),merge:n(3857),min:n(3632),minBy:n(2762),now:n(7771),pick:n(9722),range:n(6026),reduce:n(4061),sortBy:n(9734),uniqueId:n(3955),values:n(2628),zipObject:n(7287)};}catch(t){}r||(r=window._),t.exports=r;},2981:(t,e,n)=>{var r=n(8436),i=n(1138);function a(t,e,n,o,s,c,l){var u=t.children(l);if(u.length){var h=i.addBorderNode(t,"_bt"),f=i.addBorderNode(t,"_bb"),d=t.node(l);t.setParent(h,l),d.borderTop=h,t.setParent(f,l),d.borderBottom=f,r.forEach(u,(function(r){a(t,e,n,o,s,c,r);var i=t.node(r),u=i.borderTop?i.borderTop:r,d=i.borderBottom?i.borderBottom:r,p=i.borderTop?o:2*o,g=u!==d?1:s-c[l]+1;t.setEdge(h,u,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,f,{weight:p,minlen:g,nestingEdge:!0});})),t.parent(l)||t.setEdge(e,h,{weight:0,minlen:s+c[l]});}else l!==e&&t.setEdge(e,l,{weight:0,minlen:n});}t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(i,a){var o=t.children(i);o&&o.length&&r.forEach(o,(function(t){n(t,a+1);})),e[i]=a;}return r.forEach(t.children(),(function(t){n(t,1);})),e}(t),o=r.max(r.values(n))-1,s=2*o+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=s;}));var c=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(r){a(t,e,s,c,o,n,r);})),t.graph().nodeRankFactor=s;},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e);}));}};},5995:(t,e,n)=>{var r=n(8436),i=n(1138);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,a,o=e.v,s=t.node(o).rank,c=e.w,l=t.node(c).rank,u=e.name,h=t.edge(e),f=h.labelRank;if(l!==s+1){for(t.removeEdge(e),a=0,++s;s{var r=n(8436);t.exports=function(t,e,n){var i,a={};r.forEach(n,(function(n){for(var r,o,s=t.parent(n);s;){if((r=t.parent(s))?(o=a[r],a[r]=s):(o=i,i=s),o&&o!==s)return void e.setEdge(o,s);s=r;}}));};},5439:(t,e,n)=>{var r=n(8436);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return {sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return {v:e,barycenter:i.sum/i.weight,weight:i.weight}}return {v:e}}))};},3128:(t,e,n)=>{var r=n(8436),i=n(574).Graph;t.exports=function(t,e,n){var a=function(t){for(var e;t.hasNode(e=r.uniqueId("_root")););return e}(t),o=new i({compound:!0}).setGraph({root:a}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),c=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(o.setNode(i),o.setParent(i,c||a),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,a=o.edge(n,i),s=r.isUndefined(a)?0:a.weight;o.setEdge(n,i,{weight:t.edge(e).weight+s});})),r.has(s,"minRank")&&o.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}));})),o};},6630:(t,e,n)=>{var r=n(8436);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),a=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return {pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),o=1;o0;)e%2&&(n+=c[e+1]),c[e=e-1>>1]+=t.weight;l+=t.weight*n;}))),l}t.exports=function(t,e){for(var n=0,r=1;r{var r=n(8436),i=n(2588),a=n(6630),o=n(1026),s=n(3128),c=n(5093),l=n(574).Graph,u=n(1138);function h(t,e,n){return r.map(e,(function(e){return s(t,e,n)}))}function f(t,e){var n=new l;r.forEach(t,(function(t){var i=t.graph().root,a=o(t,i,n,e);r.forEach(a.vs,(function(e,n){t.node(e).order=n;})),c(t,n,a.vs);}));}function d(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n;}));}));}t.exports=function(t){var e=u.maxRank(t),n=h(t,r.range(1,e+1),"inEdges"),o=h(t,r.range(e-1,-1,-1),"outEdges"),s=i(t);d(t,s);for(var c,l=Number.POSITIVE_INFINITY,p=0,g=0;g<4;++p,++g){f(p%2?n:o,p%4>=2),s=u.buildLayerMatrix(t);var y=a(t,s);y{var r=n(8436);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return !t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),a=r.map(r.range(i+1),(function(){return []})),o=r.sortBy(n,(function(e){return t.node(e).rank}));return r.forEach(o,(function n(i){if(!r.has(e,i)){e[i]=!0;var o=t.node(i);a[o.rank].push(i),r.forEach(t.successors(i),n);}})),a};},9567:(t,e,n)=>{var r=n(8436);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight);})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]));})),function(t){var e=[];function n(t){return function(e){var n,i,a,o;e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&(i=e,a=0,o=0,(n=t).weight&&(a+=n.barycenter*n.weight,o+=n.weight),i.weight&&(a+=i.barycenter*i.weight,o+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=a/o,n.weight=o,n.i=Math.min(i.i,n.i),i.merged=!0);}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n);}}for(;t.length;){var a=t.pop();e.push(a),r.forEach(a.in.reverse(),n(a)),r.forEach(a.out,i(a));}return r.map(r.filter(e,(function(t){return !t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return !t.indegree})))};},1026:(t,e,n)=>{var r=n(8436),i=n(5439),a=n(9567),o=n(7304);t.exports=function t(e,n,s,c){var l=e.children(n),u=e.node(n),h=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,d={};h&&(l=r.filter(l,(function(t){return t!==h&&t!==f})));var p=i(e,l);r.forEach(p,(function(n){if(e.children(n.v).length){var i=t(e,n.v,s,c);d[n.v]=i,r.has(i,"barycenter")&&(a=n,o=i,r.isUndefined(a.barycenter)?(a.barycenter=o.barycenter,a.weight=o.weight):(a.barycenter=(a.barycenter*a.weight+o.barycenter*o.weight)/(a.weight+o.weight),a.weight+=o.weight));}var a,o;}));var g=a(p,s);!function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0);}));}(g,d);var y=o(g,c);if(h&&(y.vs=r.flatten([h,y.vs,f],!0),e.predecessors(h).length)){var m=e.node(e.predecessors(h)[0]),b=e.node(e.predecessors(f)[0]);r.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+b.order)/(y.weight+2),y.weight+=2;}return y};},7304:(t,e,n)=>{var r=n(8436),i=n(1138);function a(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e){var n,o=i.partition(t,(function(t){return r.has(t,"barycenter")})),s=o.lhs,c=r.sortBy(o.rhs,(function(t){return -t.i})),l=[],u=0,h=0,f=0;s.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),f=a(l,c,f),r.forEach(s,(function(t){f+=t.vs.length,l.push(t.vs),u+=t.barycenter*t.weight,h+=t.weight,f=a(l,c,f);}));var d={vs:r.flatten(l,!0)};return h&&(d.barycenter=u/h,d.weight=h),d};},4219:(t,e,n)=>{var r=n(8436);t.exports=function(t){var e=function(t){var e={},n=0;return r.forEach(t.children(),(function i(a){var o=n;r.forEach(t.children(a),i),e[a]={low:o,lim:n++};})),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,a=function(t,e,n,r){var i,a,o=[],s=[],c=Math.min(e[n].low,e[r].low),l=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i);}while(i&&(e[i].low>c||l>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)s.push(i);return {path:o.concat(s.reverse()),lca:a}}(t,e,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=t.node(n),u){for(;(l=o[c])!==s&&t.node(l).maxRank{var r=n(8436),i=n(574).Graph,a=n(1138);function o(t,e){var n={};return r.reduce(e,(function(e,i){var a=0,o=0,s=e.length,l=r.last(i);return r.forEach(i,(function(e,u){var h=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=h?t.node(h).order:s;(h||e===l)&&(r.forEach(i.slice(o,u+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),o=i.order;!(os)&&c(n,e,l);}));}));}return r.reduce(e,(function(e,n){var a,o=-1,s=0;return r.forEach(n,(function(r,c){if("border"===t.node(r).dummy){var l=t.predecessors(r);l.length&&(a=t.node(l[0]).order,i(n,s,c,o,a),s=c,o=a);}i(n,s,n.length,a,e.length);})),n})),n}function c(t,e,n){if(e>n){var r=e;e=n,n=r;}var i=t[e];i||(t[e]=i={}),i[n]=!0;}function l(t,e,n){if(e>n){var i=e;e=n,n=i;}return r.has(t[e],n)}function u(t,e,n,i){var a={},o={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){a[t]=t,o[t]=t,s[t]=e;}));})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var c=i(t);if(c.length){c=r.sortBy(c,(function(t){return s[t]}));for(var u=(c.length-1)/2,h=Math.floor(u),f=Math.ceil(u);h<=f;++h){var d=c[h];o[t]===t&&e{var r=n(8436),i=n(1138),a=n(3573).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,a=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=a+i/2;})),a+=i+n;}));})(t=i.asNonCompoundGraph(t)),r.forEach(a(t),(function(e,n){t.node(n).x=e;}));};},300:(t,e,n)=>{var r=n(8436),i=n(574).Graph,a=n(6681).slack;function o(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var o=r.v,s=i===o?r.w:o;t.hasNode(s)||a(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s));}));})),t.nodeCount()}function s(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return a(e,n)}))}function c(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n;}));}t.exports=function(t){var e,n,r=new i({directed:!1}),l=t.nodes()[0],u=t.nodeCount();for(r.setNode(l,{});o(r,t){var r=n(6681).longestPath,i=n(300),a=n(2472);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){a(t);}(t);break;case"tight-tree":!function(t){r(t),i(t);}(t);break;case"longest-path":o(t);}};var o=r;},2472:(t,e,n)=>{var r=n(8436),i=n(300),a=n(6681).slack,o=n(6681).longestPath,s=n(574).alg.preorder,c=n(574).alg.postorder,l=n(1138).simplify;function u(t){t=l(t),o(t);var e,n=i(t);for(d(n),h(n,t);e=g(n);)m(n,t,e,y(n,t,e));}function h(t,e){var n=c(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=f(t,e,n);}(t,e,n);}));}function f(t,e,n){var i=t.node(n).parent,a=!0,o=e.edge(n,i),s=0;return o||(a=!1,o=e.edge(i,n)),s=o.weight,r.forEach(e.nodeEdges(n),(function(r){var o,c,l=r.v===n,u=l?r.w:r.v;if(u!==i){var h=l===a,f=e.edge(r).weight;if(s+=h?f:-f,o=n,c=u,t.hasEdge(o,c)){var d=t.edge(n,u).cutvalue;s+=h?-d:d;}}})),s}function d(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e);}function p(t,e,n,i,a){var o=n,s=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(a){r.has(e,a)||(n=p(t,e,n,a,i));})),s.low=o,s.lim=n++,a?s.parent=a:delete s.parent,n}function g(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function y(t,e,n){var i=n.v,o=n.w;e.hasEdge(i,o)||(i=n.w,o=n.v);var s=t.node(i),c=t.node(o),l=s,u=!1;s.lim>c.lim&&(l=c,u=!0);var h=r.filter(e.edges(),(function(e){return u===b(0,t.node(e.v),l)&&u!==b(0,t.node(e.w),l)}));return r.minBy(h,(function(t){return a(e,t)}))}function m(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),d(t),h(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return !e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen);}));}(t,e);}function b(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=u,u.initLowLimValues=d,u.initCutValues=h,u.calcCutValue=f,u.leaveEdge=g,u.enterEdge=y,u.exchangeEdges=m;},6681:(t,e,n)=>{var r=n(8436);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var a=t.node(i);if(r.has(e,i))return a.rank;e[i]=!0;var o=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return o!==Number.POSITIVE_INFINITY&&null!=o||(o=0),a.rank=o}));},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}};},1138:(t,e,n)=>{var r=n(8436),i=n(574).Graph;function a(t,e,n,i){var a;do{a=r.uniqueId(i);}while(t.hasNode(a));return n.dummy=e,t.setNode(a,n),a}function o(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:a,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n));})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)});})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n));})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n));})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight;})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight;})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,a=t.y,o=e.x-i,s=e.y-a,c=t.width/2,l=t.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*c>Math.abs(o)*l?(s<0&&(l=-l),n=l*o/s,r=l):(o<0&&(c=-c),n=c,r=c*s/o),{x:i+n,y:a+r}},buildLayerMatrix:function(t){var e=r.map(r.range(o(t)+1),(function(){return []}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),a=i.rank;r.isUndefined(a)||(e[a][i.order]=n);})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e);}));},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r);}));var i=0,a=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%a!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i;}));}));},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),a(t,"border",i,e)},maxRank:o,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t);})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms");}},notime:function(t,e){return e()}};},8177:t=>{t.exports="0.8.5";},7856:function(t){t.exports=function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return !1}}function r(t,i,a){return r=n()?Reflect.construct:function(t,n,r){var i=[null];i.push.apply(i,n);var a=new(Function.bind.apply(t,i));return r&&e(a,r.prototype),a},r.apply(null,arguments)}function i(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?n-1:0),i=1;i/gm),q=f(/^data-[\-\w.\u00B7-\uFFFF]/),H=f(/^aria-[\-\w]+$/),V=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=f(/^(?:\w+script|data):/i),X=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=f(/^html$/i),Q=function(){return "undefined"==typeof window?null:window},K=function(e,n){if("object"!==t(e)||"function"!=typeof e.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+a+" could not be created."),null}};return function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q(),r=function(t){return e(t)};if(r.version="2.4.0",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var a=n.document,o=n.document,s=n.DocumentFragment,c=n.HTMLTemplateElement,l=n.Node,u=n.Element,f=n.NodeFilter,d=n.NamedNodeMap,p=void 0===d?n.NamedNodeMap||n.MozNamedAttrMap:d,g=n.HTMLFormElement,y=n.DOMParser,m=n.trustedTypes,A=u.prototype,J=O(A,"cloneNode"),tt=O(A,"nextSibling"),et=O(A,"childNodes"),nt=O(A,"parentNode");if("function"==typeof c){var rt=o.createElement("template");rt.content&&rt.content.ownerDocument&&(o=rt.content.ownerDocument);}var it=K(m,a),at=it?it.createHTML(""):"",ot=o,st=ot.implementation,ct=ot.createNodeIterator,lt=ot.createDocumentFragment,ut=ot.getElementsByTagName,ht=a.importNode,ft={};try{ft=N(o).documentMode?o.documentMode:{};}catch(t){}var dt={};r.isSupported="function"==typeof nt&&st&&void 0!==st.createHTMLDocument&&9!==ft;var pt,gt,yt=$,mt=W,bt=q,vt=H,_t=G,xt=X,kt=V,wt=null,Tt=M({},[].concat(i(D),i(B),i(L),i(F),i(P))),Et=null,Ct=M({},[].concat(i(j),i(z),i(Y),i(U))),St=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),At=null,Mt=null,Nt=!0,Ot=!0,Dt=!1,Bt=!1,Lt=!1,It=!1,Ft=!1,Rt=!1,Pt=!1,jt=!1,zt=!0,Yt=!1,Ut="user-content-",$t=!0,Wt=!1,qt={},Ht=null,Vt=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Gt=null,Xt=M({},["audio","video","img","source","image","track"]),Zt=null,Qt=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Jt="http://www.w3.org/2000/svg",te="http://www.w3.org/1999/xhtml",ee=te,ne=!1,re=["application/xhtml+xml","text/html"],ie="text/html",ae=null,oe=o.createElement("form"),se=function(t){return t instanceof RegExp||t instanceof Function},ce=function(e){ae&&ae===e||(e&&"object"===t(e)||(e={}),e=N(e),pt=pt=-1===re.indexOf(e.PARSER_MEDIA_TYPE)?ie:e.PARSER_MEDIA_TYPE,gt="application/xhtml+xml"===pt?function(t){return t}:x,wt="ALLOWED_TAGS"in e?M({},e.ALLOWED_TAGS,gt):Tt,Et="ALLOWED_ATTR"in e?M({},e.ALLOWED_ATTR,gt):Ct,Zt="ADD_URI_SAFE_ATTR"in e?M(N(Qt),e.ADD_URI_SAFE_ATTR,gt):Qt,Gt="ADD_DATA_URI_TAGS"in e?M(N(Xt),e.ADD_DATA_URI_TAGS,gt):Xt,Ht="FORBID_CONTENTS"in e?M({},e.FORBID_CONTENTS,gt):Vt,At="FORBID_TAGS"in e?M({},e.FORBID_TAGS,gt):{},Mt="FORBID_ATTR"in e?M({},e.FORBID_ATTR,gt):{},qt="USE_PROFILES"in e&&e.USE_PROFILES,Nt=!1!==e.ALLOW_ARIA_ATTR,Ot=!1!==e.ALLOW_DATA_ATTR,Dt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Bt=e.SAFE_FOR_TEMPLATES||!1,Lt=e.WHOLE_DOCUMENT||!1,Rt=e.RETURN_DOM||!1,Pt=e.RETURN_DOM_FRAGMENT||!1,jt=e.RETURN_TRUSTED_TYPE||!1,Ft=e.FORCE_BODY||!1,zt=!1!==e.SANITIZE_DOM,Yt=e.SANITIZE_NAMED_PROPS||!1,$t=!1!==e.KEEP_CONTENT,Wt=e.IN_PLACE||!1,kt=e.ALLOWED_URI_REGEXP||kt,ee=e.NAMESPACE||te,e.CUSTOM_ELEMENT_HANDLING&&se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(St.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(St.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(St.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Bt&&(Ot=!1),Pt&&(Rt=!0),qt&&(wt=M({},i(P)),Et=[],!0===qt.html&&(M(wt,D),M(Et,j)),!0===qt.svg&&(M(wt,B),M(Et,z),M(Et,U)),!0===qt.svgFilters&&(M(wt,L),M(Et,z),M(Et,U)),!0===qt.mathMl&&(M(wt,F),M(Et,Y),M(Et,U))),e.ADD_TAGS&&(wt===Tt&&(wt=N(wt)),M(wt,e.ADD_TAGS,gt)),e.ADD_ATTR&&(Et===Ct&&(Et=N(Et)),M(Et,e.ADD_ATTR,gt)),e.ADD_URI_SAFE_ATTR&&M(Zt,e.ADD_URI_SAFE_ATTR,gt),e.FORBID_CONTENTS&&(Ht===Vt&&(Ht=N(Ht)),M(Ht,e.FORBID_CONTENTS,gt)),$t&&(wt["#text"]=!0),Lt&&M(wt,["html","head","body"]),wt.table&&(M(wt,["tbody"]),delete At.tbody),h&&h(e),ae=e);},le=M({},["mi","mo","mn","ms","mtext"]),ue=M({},["foreignobject","desc","title","annotation-xml"]),he=M({},["title","style","font","a","script"]),fe=M({},B);M(fe,L),M(fe,I);var de=M({},F);M(de,R);var pe=function(t){var e=nt(t);e&&e.tagName||(e={namespaceURI:te,tagName:"template"});var n=x(t.tagName),r=x(e.tagName);return t.namespaceURI===Jt?e.namespaceURI===te?"svg"===n:e.namespaceURI===Kt?"svg"===n&&("annotation-xml"===r||le[r]):Boolean(fe[n]):t.namespaceURI===Kt?e.namespaceURI===te?"math"===n:e.namespaceURI===Jt?"math"===n&&ue[r]:Boolean(de[n]):t.namespaceURI===te&&!(e.namespaceURI===Jt&&!ue[r])&&!(e.namespaceURI===Kt&&!le[r])&&!de[n]&&(he[n]||!fe[n])},ge=function(t){_(r.removed,{element:t});try{t.parentNode.removeChild(t);}catch(e){try{t.outerHTML=at;}catch(e){t.remove();}}},ye=function(t,e){try{_(r.removed,{attribute:e.getAttributeNode(t),from:e});}catch(t){_(r.removed,{attribute:null,from:e});}if(e.removeAttribute(t),"is"===t&&!Et[t])if(Rt||Pt)try{ge(e);}catch(t){}else try{e.setAttribute(t,"");}catch(t){}},me=function(t){var e,n;if(Ft)t=""+t;else {var r=k(t,/^[\r\n\t ]+/);n=r&&r[0];}"application/xhtml+xml"===pt&&(t=''+t+"");var i=it?it.createHTML(t):t;if(ee===te)try{e=(new y).parseFromString(i,pt);}catch(t){}if(!e||!e.documentElement){e=st.createDocument(ee,"template",null);try{e.documentElement.innerHTML=ne?"":i;}catch(t){}}var a=e.body||e.documentElement;return t&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),ee===te?ut.call(e,Lt?"html":"body")[0]:Lt?e.documentElement:a},be=function(t){return ct.call(t.ownerDocument||t,t,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},ve=function(t){return t instanceof g&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof p)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore)},_e=function(e){return "object"===t(l)?e instanceof l:e&&"object"===t(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},xe=function(t,e,n){dt[t]&&b(dt[t],(function(t){t.call(r,e,n,ae);}));},ke=function(t){var e;if(xe("beforeSanitizeElements",t,null),ve(t))return ge(t),!0;if(C(/[\u0080-\uFFFF]/,t.nodeName))return ge(t),!0;var n=gt(t.nodeName);if(xe("uponSanitizeElement",t,{tagName:n,allowedTags:wt}),t.hasChildNodes()&&!_e(t.firstElementChild)&&(!_e(t.content)||!_e(t.content.firstElementChild))&&C(/<[/\w]/g,t.innerHTML)&&C(/<[/\w]/g,t.textContent))return ge(t),!0;if("select"===n&&C(/