\n * ^^\n * $1$2\n */\n this.removeBrAfterBlock = new RegExp(`<(${allBlockNames})(>| [^>]*?>)[^\\\\S\\\\n]*?\\\\n`, 'ig');\n /**\n * remove newlines before end tag, and whitespaces before end tag will be preserved\n * e.g.\n *
text\\n
=>
text
\n * ^\n * $1\n */\n this.removeBrBeforeBlock = new RegExp(`\\\\n[^\\\\S\\\\n]*?<\\\\/(${allBlockNames})>[^\\\\S\\\\n]*?\\\\n`, 'ig');\n /**\n * remove newlines between end tag & start tag\n * e.g.\n *
\\n
=>
\\r
\n * ^ ^^ ^ ^^^^^^^^^^^^\n * $1 $2 $3 $4\n */\n this.removeNewlinesBetweenTags = new RegExp(\n `<\\\\/(${allBlockNames})>[^\\\\S\\\\n]*?\\\\n([^\\\\S\\\\n]*?)<(${allBlockNames})(>| [^>]*?>)`,\n 'ig',\n );\n }\n return textContainsHtml\n .replace(this.removeBrAfterBlock, '<$1$2')\n .replace(this.removeBrBeforeBlock, '$1>')\n .replace(this.removeNewlinesBetweenTags, '$1>\\r$2<$3$4'); // replace \\n to \\r\n }\n\n toHtml(str, sentenceMakeFunc) {\n return str;\n }\n\n makeHtml(str, sentenceMakeFunc) {\n return sentenceMakeFunc(str).html;\n }\n\n afterMakeHtml(html) {\n return this.restoreCache(html);\n }\n\n isContainsCache(str, fullMatch) {\n if (fullMatch) {\n // 如果是全匹配:不能包含CherryINPRAGRAPH\n const containsParagraphCache = /^(\\s*~~C\\d+I\\w+\\$\\s*)+$/g.test(str);\n const containsInParagraphCache = new RegExp(\n `~~C\\\\d+I${ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX}\\\\w+\\\\$`,\n 'g',\n ).test(str);\n return containsParagraphCache && !containsInParagraphCache;\n }\n // 如果是局部匹配: 不能只包含CherryINPRAGRAPH\n // const containsParagraphCache = /~~C\\d+I\\w+\\$/g.test(str);\n // const containsInParagraphCache = new RegExp(\n // `~~C\\\\d+I${ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX}\\\\w+\\\\$`, 'g').test(str);\n const containsNonInParagraphCache = new RegExp(\n `~~C\\\\d+I(?!${ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX})\\\\w+\\\\$`,\n 'g',\n ).test(str);\n return containsNonInParagraphCache;\n\n // return fullMatch ?\n // /^(\\s*~~C\\d+I\\w+\\$\\s*)+$/g.test(str) && !/^(\\s*~~C\\d+ICherryINPRAGRAPH\\w+\\$\\s*)+$/g.test(str) :\n // /~~C\\d+I\\w+\\$/g.test(str) && !(/~~C\\d+ICherryINPRAGRAPH\\w+\\$/g.test(str)\n // && !/~~C\\d+I(?!CherryINPRAGRAPH)\\w+\\$/g.test(str));\n }\n\n /**\n *\n * @param {string} html\n * @return\n */\n $splitHtmlByCache(html) {\n // ~~C0I(?!prefix)sign$\n const regex = new RegExp(`\\\\n*~~C\\\\d+I(?!${ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX})\\\\w+\\\\$\\\\n?`, 'g');\n return {\n caches: html.match(regex),\n contents: html.split(regex),\n };\n }\n\n makeExcludingCached(content, processor) {\n const { caches, contents } = this.$splitHtmlByCache(content);\n const paragraphs = contents.map(processor);\n let ret = '';\n for (let i = 0; i < paragraphs.length; i++) {\n ret += paragraphs[i];\n if (caches && caches[i]) {\n ret += caches[i].trim();\n }\n }\n return ret;\n }\n\n /**\n * 获取非捕获匹配丢掉的换行,适用于能被【嵌套】的段落语法\n *\n * @param {string} cache 需要返回的cache\n * @param {string} md 原始的md字符串\n * @param {boolean} alwaysAlone 是否能被【嵌套】,true:不能被嵌套,如标题、注释等;false:能被嵌套,如代码块、有序列表等\n * @return {string} str\n */\n getCacheWithSpace(cache, md, alwaysAlone = false) {\n const preSpace = md.match(/^\\n+/)?.[0] ?? '';\n const afterSpace = md.match(/\\n+$/)?.[0] ?? '';\n if (alwaysAlone) {\n return prependLineFeedForParagraph(md, cache);\n }\n return `${preSpace}${cache}${afterSpace}`;\n }\n\n /**\n * 获取行号,只负责向上计算\\n\n * 会计算cache的行号\n *\n * @param {string} md md内容\n * @param {string} preSpace 前置换行\n * @return {number} 行数\n */\n getLineCount(md, preSpace = '') {\n let content = md;\n /**\n * 前置换行个数,【注意】:前置换行个数不包括上文的最后一个\\n\n * 例:\n * - aa\\n\n * - bb\\n\n * \\n\n * cc\\n\n *\n * cc的前置换行个数为 1,bb后的\\n不计算在内\n * cc的正则为:/(?:^|\\n)(\\n*)xxxxxx/\n */\n let preLineCount = preSpace.match(/^\\n+/g)?.[0]?.length ?? 0;\n preLineCount = preLineCount === 1 ? 1 : 0; // 前置换行超过2个就交给BR进行渲染\n content = content.replace(/^\\n+/g, '');\n\n const regex = new RegExp(\n `\\n*~~C\\\\d+I(?:${ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX})?\\\\w+?_L(\\\\d+)\\\\$`,\n 'g',\n );\n let cacheLineCount = 0;\n content = content.replace(regex, (match, lineCount) => {\n cacheLineCount += parseInt(lineCount, 10);\n return match.replace(/^\\n+/g, '');\n });\n return preLineCount + cacheLineCount + (content.match(/\\n/g) || []).length + 1; // 实际内容所占行数,至少为1行\n }\n\n /**\n *\n * @param {string} str 渲染后的内容\n * @param {string} sign 签名\n * @param {number} lineCount md原文的行数\n * @return {string} cacheKey ~~C0I0_L1$\n */\n pushCache(str, sign = '', lineCount = 0) {\n if (!this.needCache) {\n return;\n }\n const $sign = sign || this.$engine.md5(str);\n this.cache[$sign] = {\n content: str,\n using: true,\n };\n return `${this.cacheKey}I${$sign}_L${lineCount}$`;\n }\n\n popCache(sign) {\n if (!this.needCache) {\n return;\n }\n return this.cache[sign].content || '';\n }\n\n resetCache() {\n if (!this.needCache) {\n return;\n }\n for (const key of Object.keys(this.cache)) {\n if (!this.cache[key].using) delete this.cache[key];\n }\n for (const key of Object.keys(this.cache)) {\n this.cache[key].using = false;\n }\n }\n\n restoreCache(html) {\n // restore cached content\n if (!this.needCache) {\n return html;\n }\n const regex = new RegExp(\n `${this.cacheKey}I((?:${ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX})?\\\\w+)\\\\$`,\n 'g',\n );\n const $html = html.replace(regex, (match, cacheSign) => this.popCache(cacheSign.replace(/_L\\d+$/, '')));\n this.resetCache();\n return $html;\n }\n\n /**\n *\n * @param {string} wholeMatch whole match\n */\n checkCache(wholeMatch, sentenceMakeFunc, lineCount = 0) {\n this.sign = this.$engine.md5(wholeMatch);\n // miss cache\n if (!this.cache[this.sign]) {\n return this.toHtml(wholeMatch, sentenceMakeFunc);\n }\n // hit & mark cache\n this.cache[this.sign].using = true;\n return `${this.cacheKey}I${this.sign}_L${lineCount}$`;\n }\n\n mounted() {\n // console.log('base mounted');\n }\n\n signWithCache(html) {\n return false;\n }\n}\n","// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it\nvar fails = require('../internals/fails');\n\nmodule.exports = fails(function () {\n if (typeof ArrayBuffer == 'function') {\n var buffer = new ArrayBuffer(8);\n // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe\n if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });\n }\n});\n","var fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible');\n\n// eslint-disable-next-line es-x/no-object-isextensible -- safe\nvar $isExtensible = Object.isExtensible;\nvar FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });\n\n// `Object.isExtensible` method\n// https://tc39.es/ecma262/#sec-object.isextensible\nmodule.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {\n if (!isObject(it)) return false;\n if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;\n return $isExtensible ? $isExtensible(it) : true;\n} : $isExtensible;\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing\n return Object.isExtensible(Object.preventExtensions({}));\n});\n","var $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar isObject = require('../internals/is-object');\nvar hasOwn = require('../internals/has-own-property');\nvar defineProperty = require('../internals/object-define-property').f;\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external');\nvar isExtensible = require('../internals/object-is-extensible');\nvar uid = require('../internals/uid');\nvar FREEZING = require('../internals/freezing');\n\nvar REQUIRED = false;\nvar METADATA = uid('meta');\nvar id = 0;\n\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, { value: {\n objectID: 'O' + id++, // object ID\n weakData: {} // weak collections IDs\n } });\n};\n\nvar fastKey = function (it, create) {\n // return a primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!hasOwn(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMetadata(it);\n // return object ID\n } return it[METADATA].objectID;\n};\n\nvar getWeakData = function (it, create) {\n if (!hasOwn(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMetadata(it);\n // return the store of weak collections IDs\n } return it[METADATA].weakData;\n};\n\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar enable = function () {\n meta.enable = function () { /* empty */ };\n REQUIRED = true;\n var getOwnPropertyNames = getOwnPropertyNamesModule.f;\n var splice = uncurryThis([].splice);\n var test = {};\n test[METADATA] = 1;\n\n // prevent exposing of metadata key\n if (getOwnPropertyNames(test).length) {\n getOwnPropertyNamesModule.f = function (it) {\n var result = getOwnPropertyNames(it);\n for (var i = 0, length = result.length; i < length; i++) {\n if (result[i] === METADATA) {\n splice(result, i, 1);\n break;\n }\n } return result;\n };\n\n $({ target: 'Object', stat: true, forced: true }, {\n getOwnPropertyNames: getOwnPropertyNamesExternalModule.f\n });\n }\n};\n\nvar meta = module.exports = {\n enable: enable,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\n\nhiddenKeys[METADATA] = true;\n","var global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar TypeError = global.TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","var global = require('../internals/global');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar TypeError = global.TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw TypeError('Incorrect invocation');\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar fails = require('../internals/fails');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar iterate = require('../internals/iterate');\nvar anInstance = require('../internals/an-instance');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar defineProperty = require('../internals/object-define-property').f;\nvar forEach = require('../internals/array-iteration').forEach;\nvar DESCRIPTORS = require('../internals/descriptors');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var exported = {};\n var Constructor;\n\n if (!DESCRIPTORS || !isCallable(NativeConstructor)\n || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))\n ) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.enable();\n } else {\n Constructor = wrapper(function (target, iterable) {\n setInternalState(anInstance(target, Prototype), {\n type: CONSTRUCTOR_NAME,\n collection: new NativeConstructor()\n });\n if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {\n createNonEnumerableProperty(Prototype, KEY, function (a, b) {\n var collection = getInternalState(this).collection;\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = collection[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n }\n });\n\n IS_WEAK || defineProperty(Prototype, 'size', {\n configurable: true,\n get: function () {\n return getInternalState(this).collection.size;\n }\n });\n }\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: true }, exported);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n","var defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else defineBuiltIn(target, key, src[key], options);\n } return target;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar create = require('../internals/object-create');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar bind = require('../internals/function-bind-context');\nvar anInstance = require('../internals/an-instance');\nvar iterate = require('../internals/iterate');\nvar defineIterator = require('../internals/define-iterator');\nvar setSpecies = require('../internals/set-species');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fastKey = require('../internals/internal-metadata').fastKey;\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key) return entry;\n }\n };\n\n defineBuiltIns(Prototype, {\n // `{ Map, Set }.prototype.clear()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.clear\n // https://tc39.es/ecma262/#sec-set.prototype.clear\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // `{ Map, Set }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.delete\n // https://tc39.es/ecma262/#sec-set.prototype.delete\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first == entry) state.first = next;\n if (state.last == entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.foreach\n // https://tc39.es/ecma262/#sec-set.prototype.foreach\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // `{ Map, Set}.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.has\n // https://tc39.es/ecma262/#sec-set.prototype.has\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n defineBuiltIns(Prototype, IS_MAP ? {\n // `Map.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-map.prototype.get\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // `Map.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-map.prototype.set\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // `Set.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-set.prototype.add\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineProperty(Prototype, 'size', {\n get: function () {\n return getInternalState(this).size;\n }\n });\n return Constructor;\n },\n setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.entries\n // https://tc39.es/ecma262/#sec-map.prototype.keys\n // https://tc39.es/ecma262/#sec-map.prototype.values\n // https://tc39.es/ecma262/#sec-map.prototype-@@iterator\n // https://tc39.es/ecma262/#sec-set.prototype.entries\n // https://tc39.es/ecma262/#sec-set.prototype.keys\n // https://tc39.es/ecma262/#sec-set.prototype.values\n // https://tc39.es/ecma262/#sec-set.prototype-@@iterator\n defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = undefined;\n return { value: undefined, done: true };\n }\n // return step by kind\n if (kind == 'keys') return { value: entry.key, done: false };\n if (kind == 'values') return { value: entry.value, done: false };\n return { value: [entry.key, entry.value], done: false };\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // `{ Map, Set }.prototype[@@species]` accessors\n // https://tc39.es/ecma262/#sec-get-map-@@species\n // https://tc39.es/ecma262/#sec-get-set-@@species\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Map` constructor\n// https://tc39.es/ecma262/#sec-map-objects\ncollection('Map', function (init) {\n return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","require('../../modules/es.array.iterator');\nrequire('../../modules/es.map');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Map;\n","var parent = require('../../es/map');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","var parent = require('../../stable/map');\n\nmodule.exports = parent;\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar aConstructor = require('../internals/a-constructor');\nvar iterate = require('../internals/iterate');\n\nvar push = [].push;\n\nmodule.exports = function from(source /* , mapFn, thisArg */) {\n var length = arguments.length;\n var mapFn = length > 1 ? arguments[1] : undefined;\n var mapping, array, n, boundFunction;\n aConstructor(this);\n mapping = mapFn !== undefined;\n if (mapping) aCallable(mapFn);\n if (source == undefined) return new this();\n array = [];\n if (mapping) {\n n = 0;\n boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined);\n iterate(source, function (nextItem) {\n call(push, array, boundFunction(nextItem, n++));\n });\n } else {\n iterate(source, push, { that: array });\n }\n return new this(array);\n};\n","var $ = require('../internals/export');\nvar from = require('../internals/collection-from');\n\n// `Map.from` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\n$({ target: 'Map', stat: true, forced: true }, {\n from: from\n});\n","'use strict';\nvar arraySlice = require('../internals/array-slice');\n\n// https://tc39.github.io/proposal-setmap-offrom/\nmodule.exports = function of() {\n return new this(arraySlice(arguments));\n};\n","var $ = require('../internals/export');\nvar of = require('../internals/collection-of');\n\n// `Map.of` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\n$({ target: 'Map', stat: true, forced: true }, {\n of: of\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\n\n// https://github.com/tc39/collection-methods\nmodule.exports = function deleteAll(/* ...elements */) {\n var collection = anObject(this);\n var remover = aCallable(collection['delete']);\n var allDeleted = true;\n var wasDeleted;\n for (var k = 0, len = arguments.length; k < len; k++) {\n wasDeleted = call(remover, collection, arguments[k]);\n allDeleted = allDeleted && wasDeleted;\n }\n return !!allDeleted;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar deleteAll = require('../internals/collection-delete-all');\n\n// `Map.prototype.deleteAll` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n deleteAll: deleteAll\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\n\n// `Map.prototype.emplace` method\n// https://github.com/thumbsupep/proposal-upsert\nmodule.exports = function emplace(key, handler) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var value = (call(has, map, key) && 'update' in handler)\n ? handler.update(call(get, map, key), key, map)\n : handler.insert(key, map);\n call(set, map, key, value);\n return value;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar emplace = require('../internals/map-emplace');\n\n// `Map.prototype.emplace` method\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n emplace: emplace\n});\n","var getIterator = require('../internals/get-iterator');\n\nmodule.exports = getIterator;\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar bind = require('../internals/function-bind-context');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.every` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n every: function every(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return !iterate(iterator, function (key, value, stop) {\n if (!boundFunction(value, key, map)) return stop();\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n","var anObject = require('../internals/an-object');\nvar aConstructor = require('../internals/a-constructor');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar speciesConstructor = require('../internals/species-constructor');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.filter` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n filter: function filter(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();\n var setter = aCallable(newMap.set);\n iterate(iterator, function (key, value) {\n if (boundFunction(value, key, map)) call(setter, newMap, key, value);\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar bind = require('../internals/function-bind-context');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.find` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n find: function find(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (key, value, stop) {\n if (boundFunction(value, key, map)) return stop(value);\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar bind = require('../internals/function-bind-context');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.findKey` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n findKey: function findKey(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (key, value, stop) {\n if (boundFunction(value, key, map)) return stop(key);\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar getIterator = require('../internals/get-iterator');\nvar iterate = require('../internals/iterate');\n\nvar push = uncurryThis([].push);\n\n// `Map.groupBy` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', stat: true, forced: true }, {\n groupBy: function groupBy(iterable, keyDerivative) {\n aCallable(keyDerivative);\n var iterator = getIterator(iterable);\n var newMap = new this();\n var has = aCallable(newMap.has);\n var get = aCallable(newMap.get);\n var set = aCallable(newMap.set);\n iterate(iterator, function (element) {\n var derivedKey = keyDerivative(element);\n if (!call(has, newMap, derivedKey)) call(set, newMap, derivedKey, [element]);\n else push(call(get, newMap, derivedKey), element);\n }, { IS_ITERATOR: true });\n return newMap;\n }\n});\n","// `SameValueZero` abstract operation\n// https://tc39.es/ecma262/#sec-samevaluezero\nmodule.exports = function (x, y) {\n // eslint-disable-next-line no-self-compare -- NaN check\n return x === y || x != x && y != y;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar sameValueZero = require('../internals/same-value-zero');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.includes` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n includes: function includes(searchElement) {\n return iterate(getMapIterator(anObject(this)), function (key, value, stop) {\n if (sameValueZero(value, searchElement)) return stop();\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar iterate = require('../internals/iterate');\nvar aCallable = require('../internals/a-callable');\n\n// `Map.keyBy` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', stat: true, forced: true }, {\n keyBy: function keyBy(iterable, keyDerivative) {\n var newMap = new this();\n aCallable(keyDerivative);\n var setter = aCallable(newMap.set);\n iterate(iterable, function (element) {\n call(setter, newMap, keyDerivative(element), element);\n });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.keyOf` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n keyOf: function keyOf(searchElement) {\n return iterate(getMapIterator(anObject(this)), function (key, value, stop) {\n if (value === searchElement) return stop(key);\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar speciesConstructor = require('../internals/species-constructor');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.mapKeys` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n mapKeys: function mapKeys(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();\n var setter = aCallable(newMap.set);\n iterate(iterator, function (key, value) {\n call(setter, newMap, boundFunction(value, key, map), value);\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar speciesConstructor = require('../internals/species-constructor');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.mapValues` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n mapValues: function mapValues(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();\n var setter = aCallable(newMap.set);\n iterate(iterator, function (key, value) {\n call(setter, newMap, key, boundFunction(value, key, map));\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar iterate = require('../internals/iterate');\n\n// `Map.prototype.merge` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n merge: function merge(iterable /* ...iterables */) {\n var map = anObject(this);\n var setter = aCallable(map.set);\n var argumentsLength = arguments.length;\n var i = 0;\n while (i < argumentsLength) {\n iterate(arguments[i++], setter, { that: map, AS_ENTRIES: true });\n }\n return map;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar anObject = require('../internals/an-object');\nvar aCallable = require('../internals/a-callable');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\nvar TypeError = global.TypeError;\n\n// `Map.prototype.reduce` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var noInitial = arguments.length < 2;\n var accumulator = noInitial ? undefined : arguments[1];\n aCallable(callbackfn);\n iterate(iterator, function (key, value) {\n if (noInitial) {\n noInitial = false;\n accumulator = value;\n } else {\n accumulator = callbackfn(accumulator, value, key, map);\n }\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n if (noInitial) throw TypeError('Reduce of empty map with no initial value');\n return accumulator;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar bind = require('../internals/function-bind-context');\nvar getMapIterator = require('../internals/get-map-iterator');\nvar iterate = require('../internals/iterate');\n\n// `Set.prototype.some` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n some: function some(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (key, value, stop) {\n if (boundFunction(value, key, map)) return stop();\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar aCallable = require('../internals/a-callable');\n\nvar TypeError = global.TypeError;\n\n// `Set.prototype.update` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n update: function update(key, callback /* , thunk */) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var length = arguments.length;\n aCallable(callback);\n var isPresentInMap = call(has, map, key);\n if (!isPresentInMap && length < 3) {\n throw TypeError('Updating absent value');\n }\n var value = isPresentInMap ? call(get, map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map);\n call(set, map, key, callback(value, key, map));\n return map;\n }\n});\n","'use strict';\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar anObject = require('../internals/an-object');\n\nvar TypeError = global.TypeError;\n\n// `Map.prototype.upsert` method\n// https://github.com/thumbsupep/proposal-upsert\nmodule.exports = function upsert(key, updateFn /* , insertFn */) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var insertFn = arguments.length > 2 ? arguments[2] : undefined;\n var value;\n if (!isCallable(updateFn) && !isCallable(insertFn)) {\n throw TypeError('At least one callback required');\n }\n if (call(has, map, key)) {\n value = call(get, map, key);\n if (isCallable(updateFn)) {\n value = updateFn(value);\n call(set, map, key, value);\n }\n } else if (isCallable(insertFn)) {\n value = insertFn();\n call(set, map, key, value);\n } return value;\n};\n","'use strict';\n// TODO: remove from `core-js@4`\nvar $ = require('../internals/export');\nvar upsert = require('../internals/map-upsert');\n\n// `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`)\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n upsert: upsert\n});\n","'use strict';\n// TODO: remove from `core-js@4`\nvar $ = require('../internals/export');\nvar upsert = require('../internals/map-upsert');\n\n// `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`)\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, {\n updateOrInsert: upsert\n});\n","var parent = require('../../actual/map');\nrequire('../../modules/esnext.map.from');\nrequire('../../modules/esnext.map.of');\nrequire('../../modules/esnext.map.delete-all');\nrequire('../../modules/esnext.map.emplace');\nrequire('../../modules/esnext.map.every');\nrequire('../../modules/esnext.map.filter');\nrequire('../../modules/esnext.map.find');\nrequire('../../modules/esnext.map.find-key');\nrequire('../../modules/esnext.map.group-by');\nrequire('../../modules/esnext.map.includes');\nrequire('../../modules/esnext.map.key-by');\nrequire('../../modules/esnext.map.key-of');\nrequire('../../modules/esnext.map.map-keys');\nrequire('../../modules/esnext.map.map-values');\nrequire('../../modules/esnext.map.merge');\nrequire('../../modules/esnext.map.reduce');\nrequire('../../modules/esnext.map.some');\nrequire('../../modules/esnext.map.update');\n// TODO: remove from `core-js@4`\nrequire('../../modules/esnext.map.upsert');\n// TODO: remove from `core-js@4`\nrequire('../../modules/esnext.map.update-or-insert');\n\nmodule.exports = parent;\n","module.exports = require('../../full/map');\n","module.exports = require(\"core-js-pure/features/map\");","var _indexOfInstanceProperty = require(\"@babel/runtime-corejs3/core-js/instance/index-of\");\n\nfunction _isNativeFunction(fn) {\n var _context;\n\n return _indexOfInstanceProperty(_context = Function.toString.call(fn)).call(_context, \"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var parent = require('../../stable/reflect/construct');\n\nmodule.exports = parent;\n","var parent = require('../../actual/reflect/construct');\n\nmodule.exports = parent;\n","module.exports = require('../../full/reflect/construct');\n","module.exports = require(\"core-js-pure/features/reflect/construct\");","var parent = require('../../stable/instance/bind');\n\nmodule.exports = parent;\n","var parent = require('../../actual/instance/bind');\n\nmodule.exports = parent;\n","module.exports = require('../../full/instance/bind');\n","module.exports = require(\"core-js-pure/features/instance/bind\");","var _Reflect$construct = require(\"@babel/runtime-corejs3/core-js/reflect/construct\");\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false;\n if (_Reflect$construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _Reflect$construct = require(\"@babel/runtime-corejs3/core-js/reflect/construct\");\n\nvar _bindInstanceProperty = require(\"@babel/runtime-corejs3/core-js/instance/bind\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = _Reflect$construct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n\n var Constructor = _bindInstanceProperty(Function).apply(Parent, a);\n\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _Map = require(\"@babel/runtime-corejs3/core-js/map\");\n\nvar _Object$create = require(\"@babel/runtime-corejs3/core-js/object/create\");\n\nvar getPrototypeOf = require(\"./getPrototypeOf.js\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nvar isNativeFunction = require(\"./isNativeFunction.js\");\n\nvar construct = require(\"./construct.js\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof _Map === \"function\" ? new _Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = _Object$create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * 三个地方的错误异常校验\n * 1. markdown 对象参数校验\n * 2. editText 用户输入校验,执行engine过程以防异常\n * 3. 自定义hook校验 对外开发者开发标准校验\n */\n\nexport const $expectTarget = (target, Constructor) => {\n if (\n (!Array.isArray(target) && typeof target !== Constructor.name.toLowerCase()) ||\n (!Array.isArray(target) && Constructor.name.toLowerCase() === 'array')\n ) {\n throw new TypeError(`parameter given must be ${Constructor.name}`);\n }\n\n return true;\n};\n\nexport const $expectInherit = (target, parent) => {\n if (!(target instanceof parent)) {\n throw new Error('the hook does not correctly inherit');\n }\n return true;\n};\n\nexport const $expectInstance = (target) => {\n if (typeof target !== 'object') {\n throw new Error('the hook must be a instance, not a class');\n }\n return true;\n};\n\n// ref: https://github.com/mdlavin/nested-error-stacks\nexport default class NestedError extends Error {\n constructor(message, nested) {\n super(message);\n this.name = 'Error';\n this.stack = this.buildStackTrace(nested);\n }\n\n buildStackTrace(nested) {\n const stack = nested && nested.stack ? nested.stack : '';\n const newStack = `${this.stack}\\nCaused By: ${stack}`;\n return newStack;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport SyntaxBase from './SyntaxBase';\nimport ParagraphBase from './ParagraphBase';\nimport { $expectTarget } from '@/utils/error';\nimport Logger from '@/Logger';\n\n/**\n * @typedef {import('~types/cherry').CherryOptions} CherryOptions\n * @typedef {import('~types/cherry').CherryEngineOptions} CherryEngineOptions\n * @typedef {import('~types/cherry').CustomSyntaxRegConfig} CustomSyntaxRegConfig\n * @typedef { (SyntaxBase | ParagraphBase) & { Cherry$$CUSTOM: true } } CustomSyntax\n * @typedef { (typeof SyntaxBase | typeof ParagraphBase) & { Cherry$$CUSTOM: true } } CustomSyntaxClass\n */\n\nconst WARN_DUPLICATED = -1;\nconst WARN_NOT_A_VALID_HOOK = -2;\n\n/**\n * 处理报错信息,在dev模式下才会输出报错信息\n * @param {number} type\n * @param {any} objClass\n * @param {number} index\n */\nfunction processWarning(type, objClass, index) {\n if (type === WARN_DUPLICATED) {\n Logger.warn(\n `Duplicate hook name [${objClass.HOOK_NAME}] found, hook [${objClass.toString()}] ${\n isNaN(index) ? '' : `at index [${index}] `\n }will not take effect.`,\n );\n } else if (type === WARN_NOT_A_VALID_HOOK) {\n Logger.warn(\n `Hook [${objClass.toString()}] ${\n isNaN(index) ? '' : `at index [${index}] `\n }is not a valid hook, and will not take effect.`,\n );\n }\n}\n\n/**\n * 是否一个合法的 HookClass\n * @param {any} HookClass\n * @returns { HookClass is (typeof SyntaxBase | typeof ParagraphBase) }\n */\nfunction isHookValid(HookClass) {\n return isProtoOfSyntaxBase(HookClass) || isProtoOfParagraphBase(HookClass);\n}\n\n/**\n * 传入的类是否 SyntaxBase 的子类\n * @param {any} value\n * @returns { value is typeof SyntaxBase }\n */\nfunction isProtoOfSyntaxBase(value) {\n return Object.prototype.isPrototypeOf.call(SyntaxBase, value);\n}\n\n/**\n * 传入的类是否 ParagraphBase 的子类\n * @param {any} value\n * @returns { value is typeof ParagraphBase }\n */\nfunction isProtoOfParagraphBase(value) {\n return Object.prototype.isPrototypeOf.call(ParagraphBase, value);\n}\n\n/**\n * 是否一个配置型的自定义语法\n * @param {any} value\n * @returns { value is CustomSyntaxRegConfig }\n */\nfunction isCustomSyntaxConfig(value) {\n const syntaxClass = /** @type {any} */ (/** @type {CustomSyntaxRegConfig} */ (value)?.syntaxClass);\n return isProtoOfSyntaxBase(syntaxClass) || isProtoOfParagraphBase(syntaxClass);\n}\n\n/**\n * 是否一个已注册的自定义语法hook类\n * @param {any} value\n * @returns { value is CustomSyntaxClass }\n */\nfunction isRegisteredCustomSyntaxClass(value) {\n return isHookValid(value) && /** @type {CustomSyntaxClass} */ (value)?.Cherry$$CUSTOM === true;\n}\n\n/**\n * 语法注册中心\n */\nexport default class HookCenter {\n /**\n *\n * @param {(typeof SyntaxBase)[]} hooksConfig\n * @param {Partial} editorConfig\n */\n constructor(hooksConfig, editorConfig, cherry) {\n this.$locale = cherry.locale;\n /**\n * @property\n * @type {Record} hookList hook 名称 -> hook 类型的映射\n */\n this.hookList = /** @type {any} */ ({});\n\n /**\n * @property\n * @type {Record} hookNameList hook 名称 -> hook 类型的映射\n */\n this.hookNameList = {};\n\n $expectTarget(hooksConfig, Array);\n this.registerInternalHooks(hooksConfig, editorConfig);\n this.registerCustomHooks(editorConfig.engine.customSyntax, editorConfig);\n }\n\n /**\n * 注册系统默认的语法hook\n * @param {any[]} hooksConfig 在hookconfig.js里定义的配置\n * @param {Partial} editorConfig 编辑器配置\n */\n registerInternalHooks(hooksConfig, editorConfig) {\n hooksConfig.forEach(\n /**\n *\n * @param {typeof SyntaxBase} HookClass\n * @param {number} index\n */\n (HookClass, index) => {\n const result = this.register(HookClass, editorConfig);\n processWarning(result, HookClass, index);\n },\n );\n }\n\n /**\n * 注册第三方的语法hook\n * @param {CherryEngineOptions['customSyntax']} customHooks 用户传入的配置\n * @param {Partial} editorConfig 编辑器配置\n */\n registerCustomHooks(customHooks, editorConfig) {\n if (!customHooks) {\n return;\n }\n const hookNames = Object.keys(customHooks);\n hookNames.forEach((hookName) => {\n /** @type {number} */\n let result;\n /** @type {typeof SyntaxBase} */\n let HookClass;\n const customHookConfig = {};\n const hookClassOrConfig = customHooks[hookName];\n if (isProtoOfSyntaxBase(hookClassOrConfig)) {\n HookClass = hookClassOrConfig;\n } else if (isCustomSyntaxConfig(hookClassOrConfig)) {\n HookClass = hookClassOrConfig.syntaxClass;\n customHookConfig.force = Boolean(hookClassOrConfig.force);\n if (hookClassOrConfig.before) {\n customHookConfig.before = hookClassOrConfig.before;\n } else if (hookClassOrConfig.after) {\n customHookConfig.after = hookClassOrConfig.after;\n }\n } else {\n return;\n }\n if (isHookValid(HookClass)) {\n // 自定义Hook标识\n Object.defineProperty(HookClass, 'Cherry$$CUSTOM', {\n enumerable: false,\n configurable: false,\n writable: false,\n value: true,\n });\n result = this.register(HookClass, editorConfig, customHookConfig);\n } else {\n result = WARN_NOT_A_VALID_HOOK;\n }\n processWarning(result, HookClass, undefined);\n });\n }\n\n getHookList() {\n return this.hookList;\n }\n\n getHookNameList() {\n return this.hookNameList;\n }\n\n /**\n *\n * @param {((...args: any[]) => any) | typeof SyntaxBase} HookClass\n * @param {Partial} editorConfig\n * @param {Omit} [customHookConfig]\n * @returns\n */\n register(HookClass, editorConfig, customHookConfig) {\n // filter Configs Here\n const { externals, engine } = editorConfig;\n const { syntax } = engine;\n\n /** @type {SyntaxBase | CustomSyntax} */\n let instance;\n\n /** @type {string} */\n let hookName;\n\n // 首先校验Hook是否合法\n if (!isHookValid(HookClass)) {\n // 可能是一个function hook\n if (typeof HookClass === 'function') {\n const funcHook = HookClass;\n instance = funcHook(editorConfig);\n if (!instance || !isHookValid(instance.constructor)) {\n return WARN_NOT_A_VALID_HOOK;\n }\n hookName = instance.getName();\n } else {\n return WARN_NOT_A_VALID_HOOK;\n }\n } else {\n hookName = HookClass.HOOK_NAME;\n // TODO: 需要考虑自定义 hook 配置的传入方式\n const config = syntax?.[hookName] || {};\n instance = new HookClass({ externals, config, globalConfig: engine.global });\n instance.afterInit(() => {\n instance.setLocale(this.$locale);\n });\n }\n // TODO: 待校验是否需要跳过禁用的自定义 hook\n // Skip Disabled Internal Hooks\n if (syntax[hookName] === false && !isRegisteredCustomSyntaxClass(HookClass)) {\n return;\n }\n // 下面处理的都是 CustomSyntax\n const hookType = instance.getType();\n if (this.hookNameList[hookName]) {\n // 内置 hook 重名\n if (!isRegisteredCustomSyntaxClass(HookClass)) {\n return WARN_DUPLICATED;\n }\n // 自定义 hook 重名且没有开启覆盖的选项\n if (!customHookConfig.force) {\n return WARN_DUPLICATED;\n }\n // 强制覆盖以前的Hook,所以需要移除\n const duplicateHookType = this.hookNameList[hookName].type;\n this.hookList[duplicateHookType] = this.hookList[duplicateHookType].filter((hook) => hook.getName() !== hookName);\n }\n this.hookNameList[hookName] = { type: hookType };\n this.hookList[hookType] = this.hookList[hookType] || [];\n // 内置Hook直接push到结尾\n if (!isRegisteredCustomSyntaxClass(HookClass)) {\n this.hookList[hookType].push(instance);\n return;\n }\n // 插入自定义Hook\n let insertIndex = -1;\n if (customHookConfig.before) {\n insertIndex = this.hookList[hookType].findIndex((hook) => hook.getName() === customHookConfig.before);\n if (insertIndex === -1) {\n Logger.warn(\n `Cannot find hook named [${customHookConfig.before}],\n custom hook [${hookName}] will append to the end of the hooks.`,\n );\n }\n } else if (customHookConfig.after) {\n insertIndex = this.hookList[hookType].findIndex((hook) => hook.getName() === customHookConfig.after);\n insertIndex === -1\n ? Logger.warn(\n `Cannot find hook named [${customHookConfig.after}],\n custom hook [${hookName}] will append to the end of the hooks.`,\n )\n : (insertIndex += 1); // 统一处理往前插入的逻辑,所以要插入某Hook之后,索引需要加一\n }\n // 无需插入或目标索引为数组结尾\n if (insertIndex < 0 || insertIndex >= this.hookList[hookType].length) {\n this.hookList[hookType].push(instance);\n } else {\n this.hookList[hookType].splice(insertIndex, 0, instance);\n }\n // console.log(this.hookList[hookType]);\n }\n}\n","var _Array$isArray = require(\"@babel/runtime-corejs3/core-js/array/is-array\");\n\nvar arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (_Array$isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nvar _getIteratorMethod = require(\"@babel/runtime-corejs3/core-js/get-iterator-method\");\n\nvar _Array$from = require(\"@babel/runtime-corejs3/core-js/array/from\");\n\nfunction _iterableToArray(iter) {\n if (typeof _Symbol !== \"undefined\" && _getIteratorMethod(iter) != null || iter[\"@@iterator\"] != null) return _Array$from(iter);\n}\n\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableRest = require(\"./nonIterableRest.js\");\n\nfunction _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();\n}\n\nmodule.exports = _toArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n *\n * @param {string} str\n * @param {{replacedText:string;begin:number;length:number;}[]} buffer\n */\nfunction replaceStringByBuffer(str, buffer) {\n if (!buffer.length) {\n return str;\n }\n const slicedString = [];\n let offset = 0;\n buffer.forEach((buf, index) => {\n slicedString.push(str.slice(offset, buf.begin));\n slicedString.push(buf.replacedText);\n offset = buf.begin + buf.length;\n if (index === buffer.length - 1) {\n slicedString.push(str.slice(offset));\n }\n });\n // console.log(slicedString, slicedString.join(''));\n return slicedString.join('');\n}\n\n/**\n * @param {string} str 原始字符串\n * @param {RegExp} regex 正则\n * @param {(...args: any[])=>string} replacer 字符串替换函数\n * @param {boolean} [continuousMatch=false] 是否连续匹配,主要用于需要后向断言的连续语法匹配\n * @param {number} [rollbackLength=1] 连续匹配时,每次指针回退的长度,默认为 1\n */\nexport function replaceLookbehind(str, regex, replacer, continuousMatch = false, rollbackLength = 1) {\n if (!regex) {\n return str;\n }\n // 从头开始匹配\n regex.lastIndex = 0;\n let args;\n let lastIndex = 0;\n const replaceBuffer = [];\n while ((args = regex.exec(str)) !== null) {\n const replaceInfo = {\n begin: args.index,\n length: args[0].length,\n };\n if (continuousMatch && args.index === lastIndex - rollbackLength) {\n const [match, , ...restArgs] = args;\n // 丢弃 leadingChar,需要调整begin和length\n replaceBuffer.push({\n begin: replaceInfo.begin + rollbackLength,\n length: replaceInfo.length - rollbackLength,\n replacedText: replacer(match.slice(rollbackLength), '', ...restArgs),\n });\n } else {\n replaceBuffer.push({\n ...replaceInfo,\n replacedText: replacer(...args),\n });\n }\n // console.log(args);\n lastIndex = regex.lastIndex;\n regex.lastIndex -= rollbackLength;\n }\n // 正则复位,避免影响其他逻辑\n regex.lastIndex = 0;\n return replaceStringByBuffer(str, replaceBuffer);\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport SyntaxBase from '@/core/SyntaxBase';\nimport { isLookbehindSupported } from '@/utils/regexp';\nimport { replaceLookbehind } from '@/utils/lookbehind-replace';\n\nexport default class Color extends SyntaxBase {\n static HOOK_NAME = 'fontColor';\n // constructor() {\n // super();\n // }\n\n toHtml(whole, leadingChar, m1, m2) {\n return `${leadingChar}${m2}`;\n }\n\n makeHtml(str) {\n if (isLookbehindSupported()) {\n return str.replace(this.RULE.reg, this.toHtml);\n }\n return replaceLookbehind(str, this.RULE.reg, this.toHtml, true, 1);\n }\n\n rule() {\n const ret = {\n begin: isLookbehindSupported() ? '((?${m2}`;\n }\n\n makeHtml(str) {\n if (isLookbehindSupported()) {\n return str.replace(this.RULE.reg, this.toHtml);\n }\n return replaceLookbehind(str, this.RULE.reg, this.toHtml, true, 1);\n }\n\n rule() {\n const ret = {\n begin: isLookbehindSupported() ? '((?${m3}`;\n }\n\n makeHtml(str) {\n if (!this.test(str)) {\n return str;\n }\n\n if (isLookbehindSupported()) {\n return str.replace(this.RULE.reg, this.toHtml);\n }\n return replaceLookbehind(str, this.RULE.reg, this.toHtml, true, 1);\n }\n\n rule() {\n const ret = {\n begin: isLookbehindSupported() ? '((?$2');\n }\n\n rule({ config } = { config: undefined }) {\n /** @type {Partial} */\n let ret = {};\n if (!!config.needWhitespace) {\n ret = { begin: '(^|[\\\\s])\\\\~T\\\\~T', end: '\\\\~T\\\\~T(?=\\\\s|$)', content: '([\\\\w\\\\W]+?)' };\n } else {\n ret = { begin: '(^|[^\\\\\\\\])\\\\~T\\\\~T', end: '\\\\~T\\\\~T', content: '([\\\\w\\\\W]+?)' };\n }\n ret.reg = new RegExp(ret.begin + ret.content + ret.end, 'g');\n return ret;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport SyntaxBase from '@/core/SyntaxBase';\nimport { isLookbehindSupported } from '@/utils/regexp';\nimport { replaceLookbehind } from '@/utils/lookbehind-replace';\n\nexport default class Sup extends SyntaxBase {\n static HOOK_NAME = 'sup';\n\n // constructor() {\n // super();\n // }\n\n toHtml(whole, leadingChar, m1) {\n return `${leadingChar}${m1}`;\n }\n\n makeHtml(str) {\n if (isLookbehindSupported()) {\n return str.replace(this.RULE.reg, this.toHtml);\n }\n return replaceLookbehind(str, this.RULE.reg, this.toHtml, true, 1);\n }\n\n rule() {\n const ret = {\n begin: isLookbehindSupported() ? '((?${m1}`;\n }\n\n makeHtml(str) {\n if (isLookbehindSupported()) {\n return str.replace(this.RULE.reg, this.toHtml);\n }\n return replaceLookbehind(str, this.RULE.reg, this.toHtml, true, 1);\n }\n\n rule() {\n const ret = {\n begin: isLookbehindSupported() ? '((?\n\nvar _self = (typeof window !== 'undefined')\n\t? window // if in browser\n\t: (\n\t\t(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)\n\t\t\t? self // if in worker\n\t\t\t: {} // if in node js\n\t);\n\n/**\n * Prism: Lightweight, robust, elegant syntax highlighting\n *\n * @license MIT \n * @author Lea Verou \n * @namespace\n * @public\n */\nvar Prism = (function (_self) {\n\n\t// Private helper vars\n\tvar lang = /(?:^|\\s)lang(?:uage)?-([\\w-]+)(?=\\s|$)/i;\n\tvar uniqueId = 0;\n\n\t// The grammar object for plaintext\n\tvar plainTextGrammar = {};\n\n\n\tvar _ = {\n\t\t/**\n\t\t * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the\n\t\t * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load\n\t\t * additional languages or plugins yourself.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.\n\t\t *\n\t\t * You obviously have to change this value before the automatic highlighting started. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.manual = true;\n\t\t * // add a new `.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n }\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n isTagStartChar(c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n }\n startSpecial(sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n }\n stateBeforeTagName(c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n const lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttributeName(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateInAttributeName(c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n }\n stateAfterAttributeName(c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateBeforeAttributeValue(c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n }\n handleInAttributeValue(c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n }\n stateInAttributeValueDoubleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n }\n stateInAttributeValueSingleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n }\n stateInAttributeValueNoQuotes(c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n }\n stateBeforeDeclaration(c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n }\n stateInDeclaration(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. )\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n }\n stateInSpecialComment(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n const lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n stateBeforeEntity(c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Num) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n }\n stateInNamedEntity(c) {\n this.entityExcess += 1;\n this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n const masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n const valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n const entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n }\n emitNamedEntity() {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n const valueLength = (this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1:\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~BinTrieFlags.VALUE_LENGTH);\n break;\n case 2:\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n }\n stateBeforeNumericEntity(c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n }\n emitNumericEntity(strict) {\n const entityStart = this.index - this.entityExcess - 1;\n const numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint(replaceCodePoint(this.entityResult));\n }\n this.state = this.baseState;\n }\n stateInNumericEntity(c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n }\n stateInHexEntity(c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n }\n allowLegacyEntity() {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n shouldContinue() {\n return this.index < this.buffer.length + this.offset && this.running;\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n if (this.state === State.Text) {\n this.stateText(c);\n }\n else if (this.state === State.SpecialStartSequence) {\n this.stateSpecialStartSequence(c);\n }\n else if (this.state === State.InSpecialTag) {\n this.stateInSpecialTag(c);\n }\n else if (this.state === State.CDATASequence) {\n this.stateCDATASequence(c);\n }\n else if (this.state === State.InAttributeValueDq) {\n this.stateInAttributeValueDoubleQuotes(c);\n }\n else if (this.state === State.InAttributeName) {\n this.stateInAttributeName(c);\n }\n else if (this.state === State.InCommentLike) {\n this.stateInCommentLike(c);\n }\n else if (this.state === State.InSpecialComment) {\n this.stateInSpecialComment(c);\n }\n else if (this.state === State.BeforeAttributeName) {\n this.stateBeforeAttributeName(c);\n }\n else if (this.state === State.InTagName) {\n this.stateInTagName(c);\n }\n else if (this.state === State.InClosingTagName) {\n this.stateInClosingTagName(c);\n }\n else if (this.state === State.BeforeTagName) {\n this.stateBeforeTagName(c);\n }\n else if (this.state === State.AfterAttributeName) {\n this.stateAfterAttributeName(c);\n }\n else if (this.state === State.InAttributeValueSq) {\n this.stateInAttributeValueSingleQuotes(c);\n }\n else if (this.state === State.BeforeAttributeValue) {\n this.stateBeforeAttributeValue(c);\n }\n else if (this.state === State.BeforeClosingTagName) {\n this.stateBeforeClosingTagName(c);\n }\n else if (this.state === State.AfterClosingTagName) {\n this.stateAfterClosingTagName(c);\n }\n else if (this.state === State.BeforeSpecialS) {\n this.stateBeforeSpecialS(c);\n }\n else if (this.state === State.InAttributeValueNq) {\n this.stateInAttributeValueNoQuotes(c);\n }\n else if (this.state === State.InSelfClosingTag) {\n this.stateInSelfClosingTag(c);\n }\n else if (this.state === State.InDeclaration) {\n this.stateInDeclaration(c);\n }\n else if (this.state === State.BeforeDeclaration) {\n this.stateBeforeDeclaration(c);\n }\n else if (this.state === State.BeforeComment) {\n this.stateBeforeComment(c);\n }\n else if (this.state === State.InProcessingInstruction) {\n this.stateInProcessingInstruction(c);\n }\n else if (this.state === State.InNamedEntity) {\n this.stateInNamedEntity(c);\n }\n else if (this.state === State.BeforeEntity) {\n this.stateBeforeEntity(c);\n }\n else if (this.state === State.InHexEntity) {\n this.stateInHexEntity(c);\n }\n else if (this.state === State.InNumericEntity) {\n this.stateInNumericEntity(c);\n }\n else {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n this.index++;\n }\n this.cleanup();\n }\n finish() {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitPartial(start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n }\n emitCodePoint(cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n }\n}\n//# sourceMappingURL=Tokenizer.js.map","import Tokenizer, { QuoteType } from \"./Tokenizer.js\";\nimport { fromCodePoint } from \"entities/lib/decode.js\";\nconst formTags = new Set([\n \"input\",\n \"option\",\n \"optgroup\",\n \"select\",\n \"button\",\n \"datalist\",\n \"textarea\",\n]);\nconst pTag = new Set([\"p\"]);\nconst tableSectionTags = new Set([\"thead\", \"tbody\"]);\nconst ddtTags = new Set([\"dd\", \"dt\"]);\nconst rtpTags = new Set([\"rt\", \"rp\"]);\nconst openImpliesClose = new Map([\n [\"tr\", new Set([\"tr\", \"th\", \"td\"])],\n [\"th\", new Set([\"th\"])],\n [\"td\", new Set([\"thead\", \"th\", \"td\"])],\n [\"body\", new Set([\"head\", \"link\", \"script\"])],\n [\"li\", new Set([\"li\"])],\n [\"p\", pTag],\n [\"h1\", pTag],\n [\"h2\", pTag],\n [\"h3\", pTag],\n [\"h4\", pTag],\n [\"h5\", pTag],\n [\"h6\", pTag],\n [\"select\", formTags],\n [\"input\", formTags],\n [\"output\", formTags],\n [\"button\", formTags],\n [\"datalist\", formTags],\n [\"textarea\", formTags],\n [\"option\", new Set([\"option\"])],\n [\"optgroup\", new Set([\"optgroup\", \"option\"])],\n [\"dd\", ddtTags],\n [\"dt\", ddtTags],\n [\"address\", pTag],\n [\"article\", pTag],\n [\"aside\", pTag],\n [\"blockquote\", pTag],\n [\"details\", pTag],\n [\"div\", pTag],\n [\"dl\", pTag],\n [\"fieldset\", pTag],\n [\"figcaption\", pTag],\n [\"figure\", pTag],\n [\"footer\", pTag],\n [\"form\", pTag],\n [\"header\", pTag],\n [\"hr\", pTag],\n [\"main\", pTag],\n [\"nav\", pTag],\n [\"ol\", pTag],\n [\"pre\", pTag],\n [\"section\", pTag],\n [\"table\", pTag],\n [\"ul\", pTag],\n [\"rt\", rtpTags],\n [\"rp\", rtpTags],\n [\"tbody\", tableSectionTags],\n [\"tfoot\", tableSectionTags],\n]);\nconst voidElements = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\nconst foreignContextElements = new Set([\"math\", \"svg\"]);\nconst htmlIntegrationElements = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignobject\",\n \"desc\",\n \"title\",\n]);\nconst reNameEnd = /\\s|\\//;\nexport class Parser {\n constructor(cbs, options = {}) {\n var _a, _b, _c, _d, _e;\n this.options = options;\n /** The start index of the last event. */\n this.startIndex = 0;\n /** The end index of the last event. */\n this.endIndex = 0;\n /**\n * Store the start index of the current open tag,\n * so we can update the start index for attributes.\n */\n this.openTagStart = 0;\n this.tagname = \"\";\n this.attribname = \"\";\n this.attribvalue = \"\";\n this.attribs = null;\n this.stack = [];\n this.foreignContext = [];\n this.buffers = [];\n this.bufferOffset = 0;\n /** The index of the last written buffer. Used when resuming after a `pause()`. */\n this.writeIndex = 0;\n /** Indicates whether the parser has finished running / `.end` has been called. */\n this.ended = false;\n this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};\n this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;\n this.lowerCaseAttributeNames =\n (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;\n this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer)(this.options, this);\n (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);\n }\n // Tokenizer event handlers\n /** @internal */\n ontext(start, endIndex) {\n var _a, _b;\n const data = this.getSlice(start, endIndex);\n this.endIndex = endIndex - 1;\n (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);\n this.startIndex = endIndex;\n }\n /** @internal */\n ontextentity(cp) {\n var _a, _b;\n /*\n * Entities can be emitted on the character, or directly after.\n * We use the section start here to get accurate indices.\n */\n const idx = this.tokenizer.getSectionStart();\n this.endIndex = idx - 1;\n (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, fromCodePoint(cp));\n this.startIndex = idx;\n }\n isVoidElement(name) {\n return !this.options.xmlMode && voidElements.has(name);\n }\n /** @internal */\n onopentagname(start, endIndex) {\n this.endIndex = endIndex;\n let name = this.getSlice(start, endIndex);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n this.emitOpenTag(name);\n }\n emitOpenTag(name) {\n var _a, _b, _c, _d;\n this.openTagStart = this.startIndex;\n this.tagname = name;\n const impliesClose = !this.options.xmlMode && openImpliesClose.get(name);\n if (impliesClose) {\n while (this.stack.length > 0 &&\n impliesClose.has(this.stack[this.stack.length - 1])) {\n const el = this.stack.pop();\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, el, true);\n }\n }\n if (!this.isVoidElement(name)) {\n this.stack.push(name);\n if (foreignContextElements.has(name)) {\n this.foreignContext.push(true);\n }\n else if (htmlIntegrationElements.has(name)) {\n this.foreignContext.push(false);\n }\n }\n (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);\n if (this.cbs.onopentag)\n this.attribs = {};\n }\n endOpenTag(isImplied) {\n var _a, _b;\n this.startIndex = this.openTagStart;\n if (this.attribs) {\n (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);\n this.attribs = null;\n }\n if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {\n this.cbs.onclosetag(this.tagname, true);\n }\n this.tagname = \"\";\n }\n /** @internal */\n onopentagend(endIndex) {\n this.endIndex = endIndex;\n this.endOpenTag(false);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onclosetag(start, endIndex) {\n var _a, _b, _c, _d, _e, _f;\n this.endIndex = endIndex;\n let name = this.getSlice(start, endIndex);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n if (foreignContextElements.has(name) ||\n htmlIntegrationElements.has(name)) {\n this.foreignContext.pop();\n }\n if (!this.isVoidElement(name)) {\n const pos = this.stack.lastIndexOf(name);\n if (pos !== -1) {\n if (this.cbs.onclosetag) {\n let count = this.stack.length - pos;\n while (count--) {\n // We know the stack has sufficient elements.\n this.cbs.onclosetag(this.stack.pop(), count !== 0);\n }\n }\n else\n this.stack.length = pos;\n }\n else if (!this.options.xmlMode && name === \"p\") {\n // Implicit open before close\n this.emitOpenTag(\"p\");\n this.closeCurrentTag(true);\n }\n }\n else if (!this.options.xmlMode && name === \"br\") {\n // We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed.\n (_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, \"br\");\n (_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, \"br\", {}, true);\n (_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, \"br\", false);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onselfclosingtag(endIndex) {\n this.endIndex = endIndex;\n if (this.options.xmlMode ||\n this.options.recognizeSelfClosing ||\n this.foreignContext[this.foreignContext.length - 1]) {\n this.closeCurrentTag(false);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n else {\n // Ignore the fact that the tag is self-closing.\n this.onopentagend(endIndex);\n }\n }\n closeCurrentTag(isOpenImplied) {\n var _a, _b;\n const name = this.tagname;\n this.endOpenTag(isOpenImplied);\n // Self-closing tags will be on the top of the stack\n if (this.stack[this.stack.length - 1] === name) {\n // If the opening tag isn't implied, the closing tag has to be implied.\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);\n this.stack.pop();\n }\n }\n /** @internal */\n onattribname(start, endIndex) {\n this.startIndex = start;\n const name = this.getSlice(start, endIndex);\n this.attribname = this.lowerCaseAttributeNames\n ? name.toLowerCase()\n : name;\n }\n /** @internal */\n onattribdata(start, endIndex) {\n this.attribvalue += this.getSlice(start, endIndex);\n }\n /** @internal */\n onattribentity(cp) {\n this.attribvalue += fromCodePoint(cp);\n }\n /** @internal */\n onattribend(quote, endIndex) {\n var _a, _b;\n this.endIndex = endIndex;\n (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double\n ? '\"'\n : quote === QuoteType.Single\n ? \"'\"\n : quote === QuoteType.NoValue\n ? undefined\n : null);\n if (this.attribs &&\n !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {\n this.attribs[this.attribname] = this.attribvalue;\n }\n this.attribvalue = \"\";\n }\n getInstructionName(value) {\n const idx = value.search(reNameEnd);\n let name = idx < 0 ? value : value.substr(0, idx);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n return name;\n }\n /** @internal */\n ondeclaration(start, endIndex) {\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex);\n if (this.cbs.onprocessinginstruction) {\n const name = this.getInstructionName(value);\n this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onprocessinginstruction(start, endIndex) {\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex);\n if (this.cbs.onprocessinginstruction) {\n const name = this.getInstructionName(value);\n this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n oncomment(start, endIndex, offset) {\n var _a, _b, _c, _d;\n this.endIndex = endIndex;\n (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset));\n (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n oncdata(start, endIndex, offset) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex - offset);\n if (this.options.xmlMode || this.options.recognizeCDATA) {\n (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);\n (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);\n (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);\n }\n else {\n (_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);\n (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onend() {\n var _a, _b;\n if (this.cbs.onclosetag) {\n // Set the end index for all remaining tags\n this.endIndex = this.startIndex;\n for (let i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i], true))\n ;\n }\n (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /**\n * Resets the parser to a blank state, ready to parse a new HTML document\n */\n reset() {\n var _a, _b, _c, _d;\n (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);\n this.tokenizer.reset();\n this.tagname = \"\";\n this.attribname = \"\";\n this.attribs = null;\n this.stack.length = 0;\n this.startIndex = 0;\n this.endIndex = 0;\n (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n this.buffers.length = 0;\n this.bufferOffset = 0;\n this.writeIndex = 0;\n this.ended = false;\n }\n /**\n * Resets the parser, then parses a complete document and\n * pushes it to the handler.\n *\n * @param data Document to parse.\n */\n parseComplete(data) {\n this.reset();\n this.end(data);\n }\n getSlice(start, end) {\n while (start - this.bufferOffset >= this.buffers[0].length) {\n this.shiftBuffer();\n }\n let str = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);\n while (end - this.bufferOffset > this.buffers[0].length) {\n this.shiftBuffer();\n str += this.buffers[0].slice(0, end - this.bufferOffset);\n }\n return str;\n }\n shiftBuffer() {\n this.bufferOffset += this.buffers[0].length;\n this.writeIndex--;\n this.buffers.shift();\n }\n /**\n * Parses a chunk of data and calls the corresponding callbacks.\n *\n * @param chunk Chunk to parse.\n */\n write(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(\".write() after done!\"));\n return;\n }\n this.buffers.push(chunk);\n if (this.tokenizer.running) {\n this.tokenizer.write(chunk);\n this.writeIndex++;\n }\n }\n /**\n * Parses the end of the buffer and clears the stack, calls onend.\n *\n * @param chunk Optional final chunk to parse.\n */\n end(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, Error(\".end() after done!\"));\n return;\n }\n if (chunk)\n this.write(chunk);\n this.ended = true;\n this.tokenizer.end();\n }\n /**\n * Pauses parsing. The parser won't emit events until `resume` is called.\n */\n pause() {\n this.tokenizer.pause();\n }\n /**\n * Resumes parsing after `pause` was called.\n */\n resume() {\n this.tokenizer.resume();\n while (this.tokenizer.running &&\n this.writeIndex < this.buffers.length) {\n this.tokenizer.write(this.buffers[this.writeIndex++]);\n }\n if (this.ended)\n this.tokenizer.end();\n }\n /**\n * Alias of `write`, for backwards compatibility.\n *\n * @param chunk Chunk to parse.\n * @deprecated\n */\n parseChunk(chunk) {\n this.write(chunk);\n }\n /**\n * Alias of `end`, for backwards compatibility.\n *\n * @param chunk Optional final chunk to parse.\n * @deprecated\n */\n done(chunk) {\n this.end(chunk);\n }\n}\n//# sourceMappingURL=Parser.js.map","import { Parser } from \"./Parser.js\";\nexport { Parser };\nimport { DomHandler, } from \"domhandler\";\nexport { DomHandler };\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nexport function parseDocument(data, options) {\n const handler = new DomHandler(undefined, options);\n new Parser(handler, options).end(data);\n return handler.root;\n}\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nexport function parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param cb A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nexport function createDomStream(cb, options, elementCb) {\n const handler = new DomHandler(cb, options, elementCb);\n return new Parser(handler, options);\n}\nexport { default as Tokenizer, } from \"./Tokenizer.js\";\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nimport * as ElementType from \"domelementtype\";\nexport { ElementType };\nimport { getFeed } from \"domutils\";\nexport { getFeed };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nexport function parseFeed(feed, options = { xmlMode: true }) {\n return getFeed(parseDOM(feed, options));\n}\nexport * as DomUtils from \"domutils\";\n// Old name for DomHandler\nexport { DomHandler as DefaultHandler };\n//# sourceMappingURL=index.js.map","/**\n * Types used in signatures of Cheerio methods.\n *\n * @category Cheerio\n */\nexport * from './types.js';\nimport { getLoad } from './load.js';\nimport { getParse } from './parse.js';\nimport { renderWithParse5, parseWithParse5 } from './parsers/parse5-adapter.js';\nimport renderWithHtmlparser2 from 'dom-serializer';\nimport { parseDocument as parseWithHtmlparser2 } from 'htmlparser2';\nconst parse = getParse((content, options, isDocument, context) => options.xmlMode || options._useHtmlParser2\n ? parseWithHtmlparser2(content, options)\n : parseWithParse5(content, options, isDocument, context));\n// Duplicate docs due to https://github.com/TypeStrong/typedoc/issues/1616\n/**\n * Create a querying function, bound to a document created from the provided markup.\n *\n * Note that similar to web browser contexts, this operation may introduce\n * ``, ``, and `` elements; set `isDocument` to `false` to\n * switch to fragment mode and disable this.\n *\n * @param content - Markup to be loaded.\n * @param options - Options for the created instance.\n * @param isDocument - Allows parser to be switched to fragment mode.\n * @returns The loaded document.\n * @see {@link https://cheerio.js.org#loading} for additional usage information.\n */\nexport const load = getLoad(parse, (dom, options) => options.xmlMode || options._useHtmlParser2\n ? renderWithHtmlparser2(dom, options)\n : renderWithParse5(dom));\n/**\n * The default cheerio instance.\n *\n * @deprecated Use the function returned by `load` instead.\n */\nexport default load([]);\nexport { html, xml, text } from './static.js';\nimport * as staticMethods from './static.js';\n/**\n * In order to promote consistency with the jQuery library, users are encouraged\n * to instead use the static method of the same name.\n *\n * @deprecated\n * @example\n *\n * ```js\n * const $ = cheerio.load('
');\n *\n * $.contains($('div').get(0), $('p').get(0));\n * //=> true\n *\n * $.contains($('p').get(0), $('div').get(0));\n * //=> false\n * ```\n *\n * @returns {boolean}\n */\nexport const { contains } = staticMethods;\n/**\n * In order to promote consistency with the jQuery library, users are encouraged\n * to instead use the static method of the same name.\n *\n * @deprecated\n * @example\n *\n * ```js\n * const $ = cheerio.load('');\n *\n * $.merge([1, 2], [3, 4]);\n * //=> [1, 2, 3, 4]\n * ```\n */\nexport const { merge } = staticMethods;\n/**\n * In order to promote consistency with the jQuery library, users are encouraged\n * to instead use the static method of the same name as it is defined on the\n * \"loaded\" Cheerio factory function.\n *\n * @deprecated See {@link static/parseHTML}.\n * @example\n *\n * ```js\n * const $ = cheerio.load('');\n * $.parseHTML('markup');\n * ```\n */\nexport const { parseHTML } = staticMethods;\n/**\n * Users seeking to access the top-level element of a parsed document should\n * instead use the `root` static method of a \"loaded\" Cheerio function.\n *\n * @deprecated\n * @example\n *\n * ```js\n * const $ = cheerio.load('');\n * $.root();\n * ```\n */\nexport const { root } = staticMethods;\n//# sourceMappingURL=index.js.map","exports = module.exports = debug;\n\nfunction debug(label) {\n return _debug.bind(null, label);\n}\n\nfunction _debug(label) {\n var args = [].slice.call(arguments, 1);\n args.unshift('[' + label + ']');\n process.stderr.write(args.join(' ') + '\\n');\n}","var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `lex()` and print the results.\n\nvar debug = require('./debug')('lex');\n\nexports = module.exports = lex;\n\n/**\n * Convert a CSS string into an array of lexical tokens.\n *\n * @param {String} css CSS\n * @returns {Array} lexical tokens\n */\nfunction lex(css) {\n var start; // Debug timer start.\n\n var buffer = ''; // Character accumulator\n var ch; // Current character\n var column = 0; // Current source column number\n var cursor = -1; // Current source cursor position\n var depth = 0; // Current nesting depth\n var line = 1; // Current source line number\n var state = 'before-selector'; // Current state\n var stack = [state]; // State stack\n var token = {}; // Current token\n var tokens = []; // Token accumulator\n\n // Supported @-rules, in roughly descending order of usage probability.\n var atRules = [\n 'media',\n 'keyframes',\n { name: '-webkit-keyframes', type: 'keyframes', prefix: '-webkit-' },\n { name: '-moz-keyframes', type: 'keyframes', prefix: '-moz-' },\n { name: '-ms-keyframes', type: 'keyframes', prefix: '-ms-' },\n { name: '-o-keyframes', type: 'keyframes', prefix: '-o-' },\n 'font-face',\n { name: 'import', state: 'before-at-value' },\n { name: 'charset', state: 'before-at-value' },\n 'supports',\n 'viewport',\n { name: 'namespace', state: 'before-at-value' },\n 'document',\n { name: '-moz-document', type: 'document', prefix: '-moz-' },\n 'page'\n ];\n\n // -- Functions ------------------------------------------------------------\n\n /**\n * Advance the character cursor and return the next character.\n *\n * @returns {String} The next character.\n */\n function getCh() {\n skip();\n return css[cursor];\n }\n\n /**\n * Return the state at the given index in the stack.\n * The stack is LIFO so indexing is from the right.\n *\n * @param {Number} [index=0] Index to return.\n * @returns {String} state\n */\n function getState(index) {\n return index ? stack[stack.length - 1 - index] : state;\n }\n\n /**\n * Look ahead for a string beginning from the next position. The string\n * being looked for must start at the next position.\n *\n * @param {String} str The string to look for.\n * @returns {Boolean} Whether the string was found.\n */\n function isNextString(str) {\n var start = cursor + 1;\n return (str === css.slice(start, start + str.length));\n }\n\n /**\n * Find the start position of a substring beginning from the next\n * position. The string being looked for may begin anywhere.\n *\n * @param {String} str The substring to look for.\n * @returns {Number|false} The position, or `false` if not found.\n */\n function find(str) {\n var pos = css.slice(cursor).indexOf(str);\n\n return pos > 0 ? pos : false;\n }\n\n /**\n * Determine whether a character is next.\n *\n * @param {String} ch Character.\n * @returns {Boolean} Whether the character is next.\n */\n function isNextChar(ch) {\n return ch === peek(1);\n }\n\n /**\n * Return the character at the given cursor offset. The offset is relative\n * to the cursor, so negative values move backwards.\n *\n * @param {Number} [offset=1] Cursor offset.\n * @returns {String} Character.\n */\n function peek(offset) {\n return css[cursor + (offset || 1)];\n }\n\n /**\n * Remove the current state from the stack and set the new current state.\n *\n * @returns {String} The removed state.\n */\n function popState() {\n var removed = stack.pop();\n state = stack[stack.length - 1];\n\n return removed;\n }\n\n /**\n * Set the current state and add it to the stack.\n *\n * @param {String} newState The new state.\n * @returns {Number} The new stack length.\n */\n function pushState(newState) {\n state = newState;\n stack.push(state);\n\n return stack.length;\n }\n\n /**\n * Replace the current state with a new state.\n *\n * @param {String} newState The new state.\n * @returns {String} The replaced state.\n */\n function replaceState(newState) {\n var previousState = state;\n stack[stack.length - 1] = state = newState;\n\n return previousState;\n }\n\n /**\n * Move the character cursor. Positive numbers move the cursor forward.\n * Negative numbers are not supported!\n *\n * @param {Number} [n=1] Number of characters to skip.\n */\n function skip(n) {\n if ((n || 1) == 1) {\n if (css[cursor] == '\\n') {\n line++;\n column = 1;\n } else {\n column++;\n }\n cursor++;\n } else {\n var skipStr = css.slice(cursor, cursor + n).split('\\n');\n if (skipStr.length > 1) {\n line += skipStr.length - 1;\n column = 1;\n }\n column += skipStr[skipStr.length - 1].length;\n cursor = cursor + n;\n }\n }\n\n /**\n * Add the current token to the pile and reset the buffer.\n */\n function addToken() {\n token.end = {\n line: line,\n col: column\n };\n\n DEBUG && debug('addToken:', JSON.stringify(token, null, 2));\n\n tokens.push(token);\n\n buffer = '';\n token = {};\n }\n\n /**\n * Set the current token.\n *\n * @param {String} type Token type.\n */\n function initializeToken(type) {\n token = {\n type: type,\n start: {\n line: line,\n col : column\n }\n };\n }\n\n // -- Main Loop ------------------------------------------------------------\n\n /*\n The main loop is a state machine that reads in one character at a time,\n and determines what to do based on the current state and character.\n This is implemented as a series of nested `switch` statements and the\n case orders have been mildly optimized based on rough probabilities\n calculated by processing a small sample of real-world CSS.\n\n Further optimization (such as a dispatch table) shouldn't be necessary\n since the total number of cases is very low.\n */\n\n TIMER && (start = Date.now());\n\n while (ch = getCh()) {\n DEBUG && debug(ch, getState());\n\n // column += 1;\n\n switch (ch) {\n // Space\n case ' ':\n switch (getState()) {\n case 'selector':\n case 'value':\n case 'value-paren':\n case 'at-group':\n case 'at-value':\n case 'comment':\n case 'double-string':\n case 'single-string':\n buffer += ch;\n break;\n }\n break;\n\n // Newline or tab\n case '\\n':\n case '\\t':\n case '\\r':\n case '\\f':\n switch (getState()) {\n case 'value':\n case 'value-paren':\n case 'at-group':\n case 'comment':\n case 'single-string':\n case 'double-string':\n case 'selector':\n buffer += ch;\n break;\n\n case 'at-value':\n // Tokenize an @-rule if a semi-colon was omitted.\n if ('\\n' === ch) {\n token.value = buffer.trim();\n addToken();\n popState();\n }\n break;\n }\n\n // if ('\\n' === ch) {\n // column = 0;\n // line += 1;\n // }\n break;\n\n case ':':\n switch (getState()) {\n case 'name':\n token.name = buffer.trim();\n buffer = '';\n\n replaceState('before-value');\n break;\n\n case 'before-selector':\n buffer += ch;\n\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n buffer += ch;\n break;\n }\n break;\n\n case ';':\n switch (getState()) {\n case 'name':\n case 'before-value':\n case 'value':\n // Tokenize a declaration\n // if value is empty skip the declaration\n if (buffer.trim().length > 0) {\n token.value = buffer.trim(),\n addToken();\n }\n replaceState('before-name');\n break;\n\n case 'value-paren':\n // Insignificant semi-colon\n buffer += ch;\n break;\n\n case 'at-value':\n // Tokenize an @-rule\n token.value = buffer.trim();\n addToken();\n popState();\n break;\n\n case 'before-name':\n // Extraneous semi-colon\n break;\n\n default:\n buffer += ch;\n break;\n }\n break;\n\n case '{':\n switch (getState()) {\n case 'selector':\n // If the sequence is `\\{` then assume that the brace should be escaped.\n if (peek(-1) === '\\\\') {\n buffer += ch;\n break;\n }\n\n // Tokenize a selector\n token.text = buffer.trim();\n addToken();\n replaceState('before-name');\n depth = depth + 1;\n break;\n\n case 'at-group':\n // Tokenize an @-group\n token.name = buffer.trim();\n\n // XXX: @-rules are starting to get hairy\n switch (token.type) {\n case 'font-face':\n case 'viewport' :\n case 'page' :\n pushState('before-name');\n break;\n\n default:\n pushState('before-selector');\n }\n\n addToken();\n depth = depth + 1;\n break;\n\n case 'name':\n case 'at-rule':\n // Tokenize a declaration or an @-rule\n token.name = buffer.trim();\n addToken();\n pushState('before-name');\n depth = depth + 1;\n break;\n\n case 'comment':\n case 'double-string':\n case 'single-string':\n // Ignore braces in comments and strings\n buffer += ch;\n break;\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n }\n\n break;\n\n case '}':\n switch (getState()) {\n case 'before-name':\n case 'name':\n case 'before-value':\n case 'value':\n // If the buffer contains anything, it is a value\n if (buffer) {\n token.value = buffer.trim();\n }\n\n // If the current token has a name and a value it should be tokenized.\n if (token.name && token.value) {\n addToken();\n }\n\n // Leave the block\n initializeToken('end');\n addToken();\n popState();\n\n // We might need to leave again.\n // XXX: What about 3 levels deep?\n if ('at-group' === getState()) {\n initializeToken('at-group-end');\n addToken();\n popState();\n }\n \n if (depth > 0) {\n depth = depth - 1;\n }\n\n break;\n\n case 'at-group':\n case 'before-selector':\n case 'selector':\n // If the sequence is `\\}` then assume that the brace should be escaped.\n if (peek(-1) === '\\\\') {\n buffer += ch;\n break;\n }\n\n if (depth > 0) {\n // Leave block if in an at-group\n if ('at-group' === getState(1)) {\n initializeToken('at-group-end');\n addToken();\n }\n }\n\n if (depth > 1) {\n popState();\n }\n\n if (depth > 0) {\n depth = depth - 1;\n }\n break;\n\n case 'double-string':\n case 'single-string':\n case 'comment':\n // Ignore braces in comments and strings.\n buffer += ch;\n break;\n }\n\n break;\n\n // Strings\n case '\"':\n case \"'\":\n switch (getState()) {\n case 'double-string':\n if ('\"' === ch && '\\\\' !== peek(-1)) {\n popState();\n }\n break;\n\n case 'single-string':\n if (\"'\" === ch && '\\\\' !== peek(-1)) {\n popState();\n }\n break;\n\n case 'before-at-value':\n replaceState('at-value');\n pushState('\"' === ch ? 'double-string' : 'single-string');\n break;\n\n case 'before-value':\n replaceState('value');\n pushState('\"' === ch ? 'double-string' : 'single-string');\n break;\n\n case 'comment':\n // Ignore strings within comments.\n break;\n\n default:\n if ('\\\\' !== peek(-1)) {\n pushState('\"' === ch ? 'double-string' : 'single-string');\n }\n }\n\n buffer += ch;\n break;\n\n // Comments\n case '/':\n switch (getState()) {\n case 'comment':\n case 'double-string':\n case 'single-string':\n // Ignore\n buffer += ch;\n break;\n\n case 'before-value':\n case 'selector':\n case 'name':\n case 'value':\n if (isNextChar('*')) {\n // Ignore comments in selectors, properties and values. They are\n // difficult to represent in the AST.\n var pos = find('*/');\n\n if (pos) {\n skip(pos + 1);\n }\n } else {\n if (getState() == 'before-value') replaceState('value');\n buffer += ch;\n }\n break;\n\n default:\n if (isNextChar('*')) {\n // Create a comment token\n initializeToken('comment');\n pushState('comment');\n skip();\n }\n else {\n buffer += ch;\n }\n break;\n }\n break;\n\n // Comment end or universal selector\n case '*':\n switch (getState()) {\n case 'comment':\n if (isNextChar('/')) {\n // Tokenize a comment\n token.text = buffer; // Don't trim()!\n skip();\n addToken();\n popState();\n }\n else {\n buffer += ch;\n }\n break;\n\n case 'before-selector':\n buffer += ch;\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n buffer += ch;\n }\n break;\n\n // @-rules\n case '@':\n switch (getState()) {\n case 'comment':\n case 'double-string':\n case 'single-string':\n buffer += ch;\n break;\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n // Iterate over the supported @-rules and attempt to tokenize one.\n var tokenized = false;\n var name;\n var rule;\n\n for (var j = 0, len = atRules.length; !tokenized && j < len; ++j) {\n rule = atRules[j];\n name = rule.name || rule;\n\n if (!isNextString(name)) { continue; }\n\n tokenized = true;\n\n initializeToken(name);\n pushState(rule.state || 'at-group');\n skip(name.length);\n\n if (rule.prefix) {\n token.prefix = rule.prefix;\n }\n\n if (rule.type) {\n token.type = rule.type;\n }\n }\n\n if (!tokenized) {\n // Keep on truckin' America!\n buffer += ch;\n }\n break;\n }\n break;\n\n // Parentheses are tracked to disambiguate semi-colons, such as within a\n // data URI.\n case '(':\n switch (getState()) {\n case 'value':\n pushState('value-paren');\n break;\n case 'before-value':\n replaceState('value');\n break;\n }\n\n buffer += ch;\n break;\n\n case ')':\n switch (getState()) {\n case 'value-paren':\n popState();\n break;\n case 'before-value':\n replaceState('value');\n break;\n }\n\n buffer += ch;\n break;\n\n default:\n switch (getState()) {\n case 'before-selector':\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-name':\n initializeToken('property');\n replaceState('name');\n break;\n\n case 'before-value':\n replaceState('value');\n break;\n\n case 'before-at-value':\n replaceState('at-value');\n break;\n }\n\n buffer += ch;\n break;\n }\n }\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return tokens;\n}\n","var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `parse()` and print the results.\n\nvar debug = require('./debug')('parse');\nvar lex = require('./lexer');\n\nexports = module.exports = parse;\n\nvar _comments; // Whether comments are allowed.\nvar _depth; // Current block nesting depth.\nvar _position; // Whether to include line/column position.\nvar _tokens; // Array of lexical tokens.\n\n/**\n * Convert a CSS string or array of lexical tokens into a `stringify`-able AST.\n *\n * @param {String} css CSS string or array of lexical token\n * @param {Object} [options]\n * @param {Boolean} [options.comments=false] allow comment nodes in the AST\n * @returns {Object} `stringify`-able AST\n */\nfunction parse(css, options) {\n var start; // Debug timer start.\n\n options || (options = {});\n _comments = !!options.comments;\n _position = !!options.position;\n\n _depth = 0;\n\n // Operate on a copy of the given tokens, or the lex()'d CSS string.\n _tokens = Array.isArray(css) ? css.slice() : lex(css);\n\n var rule;\n var rules = [];\n var token;\n\n TIMER && (start = Date.now());\n\n while ((token = next())) {\n rule = parseToken(token);\n rule && rules.push(rule);\n }\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return {\n type: \"stylesheet\",\n stylesheet: {\n rules: rules\n }\n };\n}\n\n// -- Functions --------------------------------------------------------------\n\n/**\n * Build an AST node from a lexical token.\n *\n * @param {Object} token lexical token\n * @param {Object} [override] object hash of properties that override those\n * already in the token, or that will be added to the token.\n * @returns {Object} AST node\n */\nfunction astNode(token, override) {\n override || (override = {});\n\n var key;\n var keys = ['type', 'name', 'value'];\n var node = {};\n\n // Avoiding [].forEach for performance reasons.\n for (var i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n if (token[key]) {\n node[key] = override[key] || token[key];\n }\n }\n\n keys = Object.keys(override);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n if (!node[key]) {\n node[key] = override[key];\n }\n }\n\n if (_position) {\n node.position = {\n start: token.start,\n end: token.end\n };\n }\n\n DEBUG && debug('astNode:', JSON.stringify(node, null, 2));\n\n return node;\n}\n\n/**\n * Remove a lexical token from the stack and return the removed token.\n *\n * @returns {Object} lexical token\n */\nfunction next() {\n var token = _tokens.shift();\n DEBUG && debug('next:', JSON.stringify(token, null, 2));\n return token;\n}\n\n// -- Parse* Functions ---------------------------------------------------------\n\n/**\n * Convert an @-group lexical token to an AST node.\n *\n * @param {Object} token @-group lexical token\n * @returns {Object} @-group AST node\n */\nfunction parseAtGroup(token) {\n _depth = _depth + 1;\n\n // As the @-group token is assembled, relevant token values are captured here\n // temporarily. They will later be used as `tokenize()` overrides.\n var overrides = {};\n\n switch (token.type) {\n case 'font-face':\n case 'viewport' :\n overrides.declarations = parseDeclarations();\n break;\n\n case 'page':\n overrides.prefix = token.prefix;\n overrides.declarations = parseDeclarations();\n break;\n\n default:\n overrides.prefix = token.prefix;\n overrides.rules = parseRules();\n }\n\n return astNode(token, overrides);\n}\n\n/**\n * Convert an @import lexical token to an AST node.\n *\n * @param {Object} token @import lexical token\n * @returns {Object} @import AST node\n */\nfunction parseAtImport(token) {\n return astNode(token);\n}\n\n/**\n * Convert an @charset token to an AST node.\n *\n * @param {Object} token @charset lexical token\n * @returns {Object} @charset node\n */\nfunction parseCharset(token) {\n return astNode(token);\n}\n\n/**\n * Convert a comment token to an AST Node.\n *\n * @param {Object} token comment lexical token\n * @returns {Object} comment node\n */\nfunction parseComment(token) {\n return astNode(token, {text: token.text});\n}\n\nfunction parseNamespace(token) {\n return astNode(token);\n}\n\n/**\n * Convert a property lexical token to a property AST node.\n *\n * @returns {Object} property node\n */\nfunction parseProperty(token) {\n return astNode(token);\n}\n\n/**\n * Convert a selector lexical token to a selector AST node.\n *\n * @param {Object} token selector lexical token\n * @returns {Object} selector node\n */\nfunction parseSelector(token) {\n function trim(str) {\n return str.trim();\n }\n\n return astNode(token, {\n type: 'rule',\n selectors: token.text.split(',').map(trim),\n declarations: parseDeclarations(token)\n });\n}\n\n/**\n * Convert a lexical token to an AST node.\n *\n * @returns {Object|undefined} AST node\n */\nfunction parseToken(token) {\n switch (token.type) {\n // Cases are listed in roughly descending order of probability.\n case 'property': return parseProperty(token);\n\n case 'selector': return parseSelector(token);\n\n case 'at-group-end': _depth = _depth - 1; return;\n\n case 'media' :\n case 'keyframes' :return parseAtGroup(token);\n\n case 'comment': if (_comments) { return parseComment(token); } break;\n\n case 'charset': return parseCharset(token);\n case 'import': return parseAtImport(token);\n\n case 'namespace': return parseNamespace(token);\n\n case 'font-face':\n case 'supports' :\n case 'viewport' :\n case 'document' :\n case 'page' : return parseAtGroup(token);\n }\n\n DEBUG && debug('parseToken: unexpected token:', JSON.stringify(token));\n}\n\n// -- Parse Helper Functions ---------------------------------------------------\n\n/**\n * Iteratively parses lexical tokens from the stack into AST nodes until a\n * conditional function returns `false`, at which point iteration terminates\n * and any AST nodes collected are returned.\n *\n * @param {Function} conditionFn\n * @param {Object} token the lexical token being parsed\n * @returns {Boolean} `true` if the token should be parsed, `false` otherwise\n * @return {Array} AST nodes\n */\nfunction parseTokensWhile(conditionFn) {\n var node;\n var nodes = [];\n var token;\n\n while ((token = next()) && (conditionFn && conditionFn(token))) {\n node = parseToken(token);\n node && nodes.push(node);\n }\n\n // Place an unused non-`end` lexical token back onto the stack.\n if (token && token.type !== 'end') {\n _tokens.unshift(token);\n }\n\n return nodes;\n}\n\n/**\n * Convert a series of tokens into a sequence of declaration AST nodes.\n *\n * @returns {Array} declaration nodes\n */\nfunction parseDeclarations() {\n return parseTokensWhile(function (token) {\n return (token.type === 'property' || token.type === 'comment');\n });\n}\n\n/**\n * Convert a series of tokens into a sequence of rule nodes.\n *\n * @returns {Array} rule nodes\n */\nfunction parseRules() {\n return parseTokensWhile(function () { return _depth; });\n}\n","var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `stringify()` and print the results.\n\nvar debug = require('./debug')('stringify');\n\nvar _comments; // Whether comments are allowed in the stringified CSS.\nvar _compress; // Whether the stringified CSS should be compressed.\nvar _indentation; // Indentation option value.\nvar _level; // Current indentation level.\nvar _n; // Compression-aware newline character.\nvar _s; // Compression-aware space character.\n\nexports = module.exports = stringify;\n\n/**\n * Convert a `stringify`-able AST into a CSS string.\n *\n * @param {Object} `stringify`-able AST\n * @param {Object} [options]\n * @param {Boolean} [options.comments=false] allow comments in the CSS\n * @param {Boolean} [options.compress=false] compress whitespace\n * @param {String} [options.indentation=''] indentation sequence\n * @returns {String} CSS\n */\nfunction stringify(ast, options) {\n var start; // Debug timer start.\n\n options || (options = {});\n _indentation = options.indentation || '';\n _compress = !!options.compress;\n _comments = !!options.comments;\n _level = 1;\n\n if (_compress) {\n _n = _s = '';\n } else {\n _n = '\\n';\n _s = ' ';\n }\n\n TIMER && (start = Date.now());\n\n var css = reduce(ast.stylesheet.rules, stringifyNode).join('\\n').trim();\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return css;\n}\n\n// -- Functions --------------------------------------------------------------\n\n/**\n * Modify the indentation level, or return a compression-aware sequence of\n * spaces equal to the current indentation level.\n *\n * @param {Number} [level=undefined] indentation level modifier\n * @returns {String} sequence of spaces\n */\nfunction indent(level) {\n if (level) {\n _level += level;\n return;\n }\n\n if (_compress) { return ''; }\n\n return Array(_level).join(_indentation || '');\n}\n\n// -- Stringify Functions ------------------------------------------------------\n\n/**\n * Stringify an @-rule AST node.\n *\n * Use `stringifyAtGroup()` when dealing with @-groups that may contain blocks\n * such as @media.\n *\n * @param {String} type @-rule type. E.g., import, charset\n * @returns {String} Stringified @-rule\n */\nfunction stringifyAtRule(node) {\n return '@' + node.type + ' ' + node.value + ';' + _n;\n}\n\n/**\n * Stringify an @-group AST node.\n *\n * Use `stringifyAtRule()` when dealing with @-rules that may not contain blocks\n * such as @import.\n *\n * @param {Object} node @-group AST node\n * @returns {String}\n */\nfunction stringifyAtGroup(node) {\n var label = '';\n var prefix = node.prefix || '';\n\n if (node.name) {\n label = ' ' + node.name;\n }\n\n // FIXME: @-rule conditional logic is leaking everywhere.\n var chomp = node.type !== 'page';\n\n return '@' + prefix + node.type + label + _s + stringifyBlock(node, chomp) + _n;\n}\n\n/**\n * Stringify a comment AST node.\n *\n * @param {Object} node comment AST node\n * @returns {String}\n */\nfunction stringifyComment(node) {\n if (!_comments) { return ''; }\n\n return '/*' + (node.text || '') + '*/' + _n;\n}\n\n/**\n * Stringify a rule AST node.\n *\n * @param {Object} node rule AST node\n * @returns {String}\n */\nfunction stringifyRule(node) {\n var label;\n\n if (node.selectors) {\n label = node.selectors.join(',' + _n);\n } else {\n label = '@' + node.type;\n label += node.name ? ' ' + node.name : '';\n }\n\n return indent() + label + _s + stringifyBlock(node) + _n;\n}\n\n\n// -- Stringify Helper Functions -----------------------------------------------\n\n/**\n * Reduce an array by applying a function to each item and retaining the truthy\n * results.\n *\n * When `item.type` is `'comment'` `stringifyComment` will be applied instead.\n *\n * @param {Array} items array to reduce\n * @param {Function} fn function to call for each item in the array\n * @returns {Mixed} Truthy values will be retained, falsy values omitted\n * @returns {Array} retained results\n */\nfunction reduce(items, fn) {\n return items.reduce(function (results, item) {\n var result = (item.type === 'comment') ? stringifyComment(item) : fn(item);\n result && results.push(result);\n return results;\n }, []);\n}\n\n/**\n * Stringify an AST node with the assumption that it represents a block of\n * declarations or other @-group contents.\n *\n * @param {Object} node AST node\n * @returns {String}\n */\n// FIXME: chomp should not be a magic boolean parameter\nfunction stringifyBlock(node, chomp) {\n var children = node.declarations;\n var fn = stringifyDeclaration;\n\n if (node.rules) {\n children = node.rules;\n fn = stringifyRule;\n }\n\n children = stringifyChildren(children, fn);\n children && (children = _n + children + (chomp ? '' : _n));\n\n return '{' + children + indent() + '}';\n}\n\n/**\n * Stringify an array of child AST nodes by calling the given stringify function\n * once for each child, and concatenating the results.\n *\n * @param {Array} children `node.rules` or `node.declarations`\n * @param {Function} fn stringify function\n * @returns {String}\n */\nfunction stringifyChildren(children, fn) {\n if (!children) { return ''; }\n\n indent(1);\n var results = reduce(children, fn);\n indent(-1);\n\n if (!results.length) { return ''; }\n\n return results.join(_n);\n}\n\n/**\n * Stringify a declaration AST node.\n *\n * @param {Object} node declaration AST node\n * @returns {String}\n */\nfunction stringifyDeclaration(node) {\n if (node.type === 'property') {\n return stringifyProperty(node);\n }\n\n DEBUG && debug('stringifyDeclaration: unexpected node:', JSON.stringify(node));\n}\n\n/**\n * Stringify an AST node.\n *\n * @param {Object} node AST node\n * @returns {String}\n */\nfunction stringifyNode(node) {\n switch (node.type) {\n // Cases are listed in roughly descending order of probability.\n case 'rule': return stringifyRule(node);\n\n case 'media' :\n case 'keyframes': return stringifyAtGroup(node);\n\n case 'comment': return stringifyComment(node);\n\n case 'import' :\n case 'charset' :\n case 'namespace': return stringifyAtRule(node);\n\n case 'font-face':\n case 'supports' :\n case 'viewport' :\n case 'document' :\n case 'page' : return stringifyAtGroup(node);\n }\n\n DEBUG && debug('stringifyNode: unexpected node: ' + JSON.stringify(node));\n}\n\n/**\n * Stringify an AST property node.\n *\n * @param {Object} node AST property node\n * @returns {String}\n */\nfunction stringifyProperty(node) {\n var name = node.name ? node.name + ':' + _s : '';\n\n return indent() + name + node.value + ';';\n}\n","module.exports = {\n lex : require('./lib/lexer'),\n parse: require('./lib/parser'),\n stringify: require('./lib/stringify')\n};\n","/*\r\nSlick Parser\r\n - originally created by the almighty Thomas Aylott <@subtlegradient> (http://subtlegradient.com)\r\n*/\"use strict\"\r\n\r\n// Notable changes from Slick.Parser 1.0.x\r\n\r\n// The parser now uses 2 classes: Expressions and Expression\r\n// `new Expressions` produces an array-like object containing a list of Expression objects\r\n// - Expressions::toString() produces a cleaned up expressions string\r\n// `new Expression` produces an array-like object\r\n// - Expression::toString() produces a cleaned up expression string\r\n// The only exposed method is parse, which produces a (cached) `new Expressions` instance\r\n// parsed.raw is no longer present, use .toString()\r\n// parsed.expression is now useless, just use the indices\r\n// parsed.reverse() has been removed for now, due to its apparent uselessness\r\n// Other changes in the Expressions object:\r\n// - classNames are now unique, and save both escaped and unescaped values\r\n// - attributes now save both escaped and unescaped values\r\n// - pseudos now save both escaped and unescaped values\r\n\r\nvar escapeRe = /([-.*+?^${}()|[\\]\\/\\\\])/g,\r\n unescapeRe = /\\\\/g\r\n\r\nvar escape = function(string){\r\n // XRegExp v2.0.0-beta-3\r\n // « https://github.com/slevithan/XRegExp/blob/master/src/xregexp.js\r\n return (string + \"\").replace(escapeRe, '\\\\$1')\r\n}\r\n\r\nvar unescape = function(string){\r\n return (string + \"\").replace(unescapeRe, '')\r\n}\r\n\r\nvar slickRe = RegExp(\r\n/*\r\n#!/usr/bin/env ruby\r\nputs \"\\t\\t\" + DATA.read.gsub(/\\(\\?x\\)|\\s+#.*$|\\s+|\\\\$|\\\\n/,'')\r\n__END__\r\n \"(?x)^(?:\\\r\n \\\\s* ( , ) \\\\s* # Separator \\n\\\r\n | \\\\s* ( + ) \\\\s* # Combinator \\n\\\r\n | ( \\\\s+ ) # CombinatorChildren \\n\\\r\n | ( + | \\\\* ) # Tag \\n\\\r\n | \\\\# ( + ) # ID \\n\\\r\n | \\\\. ( + ) # ClassName \\n\\\r\n | # Attribute \\n\\\r\n \\\\[ \\\r\n \\\\s* (+) (?: \\\r\n \\\\s* ([*^$!~|]?=) (?: \\\r\n \\\\s* (?:\\\r\n ([\\\"']?)(.*?)\\\\9 \\\r\n )\\\r\n ) \\\r\n )? \\\\s* \\\r\n \\\\](?!\\\\]) \\n\\\r\n | :+ ( + )(?:\\\r\n \\\\( (?:\\\r\n (?:([\\\"'])([^\\\\12]*)\\\\12)|((?:\\\\([^)]+\\\\)|[^()]*)+)\\\r\n ) \\\\)\\\r\n )?\\\r\n )\"\r\n*/\r\n\"^(?:\\\\s*(,)\\\\s*|\\\\s*(+)\\\\s*|(\\\\s+)|(+|\\\\*)|\\\\#(+)|\\\\.(+)|\\\\[\\\\s*(+)(?:\\\\s*([*^$!~|]?=)(?:\\\\s*(?:([\\\"']?)(.*?)\\\\9)))?\\\\s*\\\\](?!\\\\])|(:+)(+)(?:\\\\((?:(?:([\\\"'])([^\\\\13]*)\\\\13)|((?:\\\\([^)]+\\\\)|[^()]*)+))\\\\))?)\"\r\n .replace(//, '[' + escape(\">+~`!@$%^&={}\\\\;\") + ']')\r\n .replace(//g, '(?:[\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\r\n .replace(//g, '(?:[:\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\r\n)\r\n\r\n// Part\r\n\r\nvar Part = function Part(combinator){\r\n this.combinator = combinator || \" \"\r\n this.tag = \"*\"\r\n}\r\n\r\nPart.prototype.toString = function(){\r\n\r\n if (!this.raw){\r\n\r\n var xpr = \"\", k, part\r\n\r\n xpr += this.tag || \"*\"\r\n if (this.id) xpr += \"#\" + this.id\r\n if (this.classes) xpr += \".\" + this.classList.join(\".\")\r\n if (this.attributes) for (k = 0; part = this.attributes[k++];){\r\n xpr += \"[\" + part.name + (part.operator ? part.operator + '\"' + part.value + '\"' : '') + \"]\"\r\n }\r\n if (this.pseudos) for (k = 0; part = this.pseudos[k++];){\r\n xpr += \":\" + part.name\r\n if (part.value) xpr += \"(\" + part.value + \")\"\r\n }\r\n\r\n this.raw = xpr\r\n\r\n }\r\n\r\n return this.raw\r\n}\r\n\r\n// Expression\r\n\r\nvar Expression = function Expression(){\r\n this.length = 0\r\n}\r\n\r\nExpression.prototype.toString = function(){\r\n\r\n if (!this.raw){\r\n\r\n var xpr = \"\"\r\n\r\n for (var j = 0, bit; bit = this[j++];){\r\n if (j !== 1) xpr += \" \"\r\n if (bit.combinator !== \" \") xpr += bit.combinator + \" \"\r\n xpr += bit\r\n }\r\n\r\n this.raw = xpr\r\n\r\n }\r\n\r\n return this.raw\r\n}\r\n\r\nvar replacer = function(\r\n rawMatch,\r\n\r\n separator,\r\n combinator,\r\n combinatorChildren,\r\n\r\n tagName,\r\n id,\r\n className,\r\n\r\n attributeKey,\r\n attributeOperator,\r\n attributeQuote,\r\n attributeValue,\r\n\r\n pseudoMarker,\r\n pseudoClass,\r\n pseudoQuote,\r\n pseudoClassQuotedValue,\r\n pseudoClassValue\r\n){\r\n\r\n var expression, current\r\n\r\n if (separator || !this.length){\r\n expression = this[this.length++] = new Expression\r\n if (separator) return ''\r\n }\r\n\r\n if (!expression) expression = this[this.length - 1]\r\n\r\n if (combinator || combinatorChildren || !expression.length){\r\n current = expression[expression.length++] = new Part(combinator)\r\n }\r\n\r\n if (!current) current = expression[expression.length - 1]\r\n\r\n if (tagName){\r\n\r\n current.tag = unescape(tagName)\r\n\r\n } else if (id){\r\n\r\n current.id = unescape(id)\r\n\r\n } else if (className){\r\n\r\n var unescaped = unescape(className)\r\n\r\n var classes = current.classes || (current.classes = {})\r\n if (!classes[unescaped]){\r\n classes[unescaped] = escape(className)\r\n var classList = current.classList || (current.classList = [])\r\n classList.push(unescaped)\r\n classList.sort()\r\n }\r\n\r\n } else if (pseudoClass){\r\n\r\n pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue\r\n\r\n ;(current.pseudos || (current.pseudos = [])).push({\r\n type : pseudoMarker.length == 1 ? 'class' : 'element',\r\n name : unescape(pseudoClass),\r\n escapedName : escape(pseudoClass),\r\n value : pseudoClassValue ? unescape(pseudoClassValue) : null,\r\n escapedValue : pseudoClassValue ? escape(pseudoClassValue) : null\r\n })\r\n\r\n } else if (attributeKey){\r\n\r\n attributeValue = attributeValue ? escape(attributeValue) : null\r\n\r\n ;(current.attributes || (current.attributes = [])).push({\r\n operator : attributeOperator,\r\n name : unescape(attributeKey),\r\n escapedName : escape(attributeKey),\r\n value : attributeValue ? unescape(attributeValue) : null,\r\n escapedValue : attributeValue ? escape(attributeValue) : null\r\n })\r\n\r\n }\r\n\r\n return ''\r\n\r\n}\r\n\r\n// Expressions\r\n\r\nvar Expressions = function Expressions(expression){\r\n this.length = 0\r\n\r\n var self = this\r\n\r\n var original = expression, replaced\r\n\r\n while (expression){\r\n replaced = expression.replace(slickRe, function(){\r\n return replacer.apply(self, arguments)\r\n })\r\n if (replaced === expression) throw new Error(original + ' is an invalid expression')\r\n expression = replaced\r\n }\r\n}\r\n\r\nExpressions.prototype.toString = function(){\r\n if (!this.raw){\r\n var expressions = []\r\n for (var i = 0, expression; expression = this[i++];) expressions.push(expression)\r\n this.raw = expressions.join(\", \")\r\n }\r\n\r\n return this.raw\r\n}\r\n\r\nvar cache = {}\r\n\r\nvar parse = function(expression){\r\n if (expression == null) return null\r\n expression = ('' + expression).replace(/^\\s+|\\s+$/g, '')\r\n return cache[expression] || (cache[expression] = new Expressions(expression))\r\n}\r\n\r\nmodule.exports = parse\r\n","'use strict';\n\nvar parser = require('slick/parser');\n\nmodule.exports = exports = Selector;\n\n/**\n * CSS selector constructor.\n *\n * @param {String} selector text\n * @param {Array} optionally, precalculated specificity\n * @api public\n */\n\nfunction Selector(text, styleAttribute) {\n this.text = text;\n this.spec = undefined;\n this.styleAttribute = styleAttribute || false;\n}\n\n/**\n * Get parsed selector.\n *\n * @api public\n */\n\nSelector.prototype.parsed = function() {\n if (!this.tokens) { this.tokens = parse(this.text); }\n return this.tokens;\n};\n\n/**\n * Lazy specificity getter\n *\n * @api public\n */\n\nSelector.prototype.specificity = function() {\n var styleAttribute = this.styleAttribute;\n if (!this.spec) { this.spec = specificity(this.text, this.parsed()); }\n return this.spec;\n\n function specificity(text, parsed) {\n var expressions = parsed || parse(text);\n var spec = [styleAttribute ? 1 : 0, 0, 0, 0];\n var nots = [];\n\n for (var i = 0; i < expressions.length; i++) {\n var expression = expressions[i];\n var pseudos = expression.pseudos;\n\n // id awards a point in the second column\n if (expression.id) { spec[1]++; }\n\n // classes and attributes award a point each in the third column\n if (expression.attributes) { spec[2] += expression.attributes.length; }\n if (expression.classList) { spec[2] += expression.classList.length; }\n\n // tag awards a point in the fourth column\n if (expression.tag && expression.tag !== '*') { spec[3]++; }\n\n // pseudos award a point each in the fourth column\n if (pseudos) {\n spec[3] += pseudos.length;\n\n for (var p = 0; p < pseudos.length; p++) {\n if (pseudos[p].name === 'not') {\n nots.push(pseudos[p].value);\n spec[3]--;\n }\n }\n }\n }\n\n for (var ii = nots.length; ii--;) {\n var not = specificity(nots[ii]);\n for (var jj = 4; jj--;) { spec[jj] += not[jj]; }\n }\n\n return spec;\n }\n};\n\n/**\n * Parses a selector and returns the tokens.\n *\n * @param {String} selector\n * @api private.\n */\n\nfunction parse(text) {\n try {\n return parser(text)[0];\n } catch (e) {\n return [];\n }\n}\n","'use strict';\n\nmodule.exports = exports = Property;\n\n/**\n * Module dependencies.\n */\n\nvar utils = require('./utils');\n\n/**\n * CSS property constructor.\n *\n * @param {String} property\n * @param {String} value\n * @param {Selector} selector the property originates from\n * @param {Integer} priority 0 for normal properties, 2 for !important properties.\n * @param {Array} additional array of integers representing more detailed priorities (sorting)\n * @api public\n */\n\nfunction Property(prop, value, selector, priority, additionalPriority) {\n this.prop = prop;\n this.value = value;\n this.selector = selector;\n this.priority = priority || 0;\n this.additionalPriority = additionalPriority || [];\n}\n\n/**\n * Compares with another Property based on Selector#specificity.\n *\n * @api public\n */\n\nProperty.prototype.compareFunc = function(property) {\n var a = [];\n a.push.apply(a, this.selector.specificity());\n a.push.apply(a, this.additionalPriority);\n a[0] += this.priority;\n var b = [];\n b.push.apply(b, property.selector.specificity());\n b.push.apply(b, property.additionalPriority);\n b[0] += property.priority;\n return utils.compareFunc(a, b);\n};\n\nProperty.prototype.compare = function(property) {\n var winner = this.compareFunc(property);\n if (winner === 1) {\n return this;\n }\n return property;\n};\n\n\n/**\n * Returns CSS property\n *\n * @api public\n */\n\nProperty.prototype.toString = function() {\n return this.prop + ': ' + this.value.replace(/['\"]+/g, '') + ';';\n};\n","'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar mensch = require('mensch');\nvar Selector = require('./selector');\nvar Property = require('./property');\n\nexports.Selector = Selector;\nexports.Property = Property;\n\n/**\n * Returns an array of the selectors.\n *\n * @license Sizzle CSS Selector Engine - MIT\n * @param {String} selectorText from mensch\n * @api public\n */\n\nexports.extract = function extract(selectorText) {\n var attr = 0;\n var sels = [];\n var sel = '';\n\n for (var i = 0, l = selectorText.length; i < l; i++) {\n var c = selectorText.charAt(i);\n\n if (attr) {\n if (']' === c || ')' === c) { attr--; }\n sel += c;\n } else {\n if (',' === c) {\n sels.push(sel);\n sel = '';\n } else {\n if ('[' === c || '(' === c) { attr++; }\n if (sel.length || (c !== ',' && c !== '\\n' && c !== ' ')) { sel += c; }\n }\n }\n }\n\n if (sel.length) {\n sels.push(sel);\n }\n\n return sels;\n};\n\n/**\n * Returns a parse tree for a CSS source.\n * If it encounters multiple selectors separated by a comma, it splits the\n * tree.\n *\n * @param {String} css source\n * @api public\n */\n\nexports.parseCSS = function(css) {\n var parsed = mensch.parse(css, {position: true, comments: true});\n var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];\n var ret = [];\n\n for (var i = 0, l = rules.length; i < l; i++) {\n if (rules[i].type == 'rule') {\n var rule = rules[i];\n var selectors = rule.selectors;\n\n for (var ii = 0, ll = selectors.length; ii < ll; ii++) {\n ret.push([selectors[ii], rule.declarations]);\n }\n }\n }\n\n return ret;\n};\n\n/**\n * Returns preserved text for a CSS source.\n *\n * @param {String} css source\n * @param {Object} options\n * @api public\n */\n\nexports.getPreservedText = function(css, options, ignoredPseudos) {\n var parsed = mensch.parse(css, {position: true, comments: true});\n var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];\n var preserved = [];\n var lastStart = null;\n\n for (var i = rules.length - 1; i >= 0; i--) {\n if ((options.fontFaces && rules[i].type === 'font-face') ||\n (options.mediaQueries && rules[i].type === 'media') ||\n (options.keyFrames && rules[i].type === 'keyframes') ||\n (options.pseudos && rules[i].selectors && this.matchesPseudo(rules[i].selectors[0], ignoredPseudos))) {\n preserved.unshift(\n mensch.stringify(\n { stylesheet: { rules: [ rules[i] ] }},\n { comments: false, indentation: ' ' }\n )\n );\n }\n lastStart = rules[i].position.start;\n }\n\n if (preserved.length === 0) {\n return false;\n }\n return '\\n' + preserved.join('\\n') + '\\n';\n};\n\nexports.normalizeLineEndings = function(text) {\n return text.replace(/\\r\\n/g, '\\n').replace(/\\n/g, '\\r\\n');\n};\n\nexports.matchesPseudo = function(needle, haystack) {\n return haystack.find(function (element) {\n return needle.indexOf(element) > -1;\n })\n}\n\n/**\n * Compares two specificity vectors, returning the winning one.\n *\n * @param {Array} vector a\n * @param {Array} vector b\n * @return {Array}\n * @api public\n */\n\nexports.compareFunc = function(a, b) {\n var min = Math.min(a.length, b.length);\n for (var i = 0; i < min; i++) {\n if (a[i] === b[i]) { continue; }\n if (a[i] > b[i]) { return 1; }\n return -1;\n }\n\n return a.length - b.length;\n};\n\nexports.compare = function(a, b) {\n return exports.compareFunc(a, b) == 1 ? a : b;\n};\n\nexports.getDefaultOptions = function(options) {\n var result = Object.assign({\n extraCss: '',\n insertPreservedExtraCss: true,\n applyStyleTags: true,\n removeStyleTags: true,\n preserveMediaQueries: true,\n preserveFontFaces: true,\n preserveKeyFrames: true,\n preservePseudos: true,\n applyWidthAttributes: true,\n applyHeightAttributes: true,\n applyAttributesTableElements: true,\n url: ''\n }, options);\n\n result.webResources = result.webResources || {};\n\n return result;\n};\n","'use strict';\n\n/**\n * Module dependencies.\n */\nvar cheerio = require('cheerio');\nvar utils = require('./utils');\n\nvar cheerioLoad = function(html, options, encodeEntities) {\n options = Object.assign({decodeEntities: false, _useHtmlParser2:true}, options);\n html = encodeEntities(html);\n return cheerio.load(html, options);\n};\n\nvar createEntityConverters = function () {\n var codeBlockLookup = [];\n\n var encodeCodeBlocks = function(html) {\n var blocks = module.exports.codeBlocks;\n Object.keys(blocks).forEach(function(key) {\n var re = new RegExp(blocks[key].start + '([\\\\S\\\\s]*?)' + blocks[key].end, 'g');\n html = html.replace(re, function(match, subMatch) {\n codeBlockLookup.push(match);\n return 'JUICE_CODE_BLOCK_' + (codeBlockLookup.length - 1) + '_';\n });\n });\n return html;\n };\n\n var decodeCodeBlocks = function(html) {\n for(var index = 0; index < codeBlockLookup.length; index++) {\n var re = new RegExp('JUICE_CODE_BLOCK_' + index + '_(=\"\")?', 'gi');\n html = html.replace(re, function() {\n return codeBlockLookup[index];\n });\n }\n return html;\n };\n\n return {\n encodeEntities: encodeCodeBlocks,\n decodeEntities: decodeCodeBlocks,\n };\n};\n\n/**\n * Parses the input, calls the callback on the parsed DOM, and generates the output\n *\n * @param {String} html input html to be processed\n * @param {Object} options for the parser\n * @param {Function} callback to be invoked on the DOM\n * @param {Array} callbackExtraArguments to be passed to the callback\n * @return {String} resulting html\n */\nmodule.exports = function(html, options, callback, callbackExtraArguments) {\n var entityConverters = createEntityConverters();\n\n var $ = cheerioLoad(html, options, entityConverters.encodeEntities);\n var args = [ $ ];\n args.push.apply(args, callbackExtraArguments);\n var doc = callback.apply(undefined, args) || $;\n\n if (options && options.xmlMode) {\n return entityConverters.decodeEntities(doc.xml());\n }\n return entityConverters.decodeEntities(doc.html());\n};\n\nmodule.exports.codeBlocks = {\n EJS: { start: '<%', end: '%>' },\n HBS: { start: '{{', end: '}}' }\n};\n","'use strict';\n\n/**\n * Converts a decimal number to roman numeral.\n * https://stackoverflow.com/questions/9083037/convert-a-number-into-a-roman-numeral-in-javascript\n *\n * @param {Number} number\n * @api private.\n */\nexports.romanize = function(num) {\n if (isNaN(num))\n return NaN;\n var digits = String(+num).split(\"\"),\n key = [\"\",\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\n \"\",\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\n \"\",\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\"],\n roman = \"\",\n i = 3;\n while (i--)\n roman = (key[+digits.pop() + (i * 10)] || \"\") + roman;\n return Array(+digits.join(\"\") + 1).join(\"M\") + roman;\n}\n\n/**\n * Converts a decimal number to alphanumeric numeral.\n * https://stackoverflow.com/questions/45787459/convert-number-to-alphabet-string-javascript\n *\n * @param {Number} number\n * @api private.\n */\nexports.alphanumeric = function(num) {\n var s = '', t;\n\n while (num > 0) {\n t = (num - 1) % 26;\n s = String.fromCharCode(65 + t) + s;\n num = (num - t)/26 | 0;\n }\n return s || undefined;\n}","'use strict';\n\nvar utils = require('./utils');\nvar numbers = require('./numbers');\n\nmodule.exports = function makeJuiceClient(juiceClient) {\n\njuiceClient.ignoredPseudos = ['hover', 'active', 'focus', 'visited', 'link'];\njuiceClient.widthElements = ['TABLE', 'TD', 'TH', 'IMG'];\njuiceClient.heightElements = ['TABLE', 'TD', 'TH', 'IMG'];\njuiceClient.tableElements = ['TABLE', 'TH', 'TR', 'TD', 'CAPTION', 'COLGROUP', 'COL', 'THEAD', 'TBODY', 'TFOOT'];\njuiceClient.nonVisualElements = [ 'HEAD', 'TITLE', 'BASE', 'LINK', 'STYLE', 'META', 'SCRIPT', 'NOSCRIPT' ];\njuiceClient.styleToAttribute = {\n 'background-color': 'bgcolor',\n 'background-image': 'background',\n 'text-align': 'align',\n 'vertical-align': 'valign'\n};\njuiceClient.excludedProperties = [];\n\njuiceClient.juiceDocument = juiceDocument;\njuiceClient.inlineDocument = inlineDocument;\n\nfunction inlineDocument($, css, options) {\n\n options = options || {};\n var rules = utils.parseCSS(css);\n var editedElements = [];\n var styleAttributeName = 'style';\n var counters = {};\n\n if (options.styleAttributeName) {\n styleAttributeName = options.styleAttributeName;\n }\n\n rules.forEach(handleRule);\n editedElements.forEach(setStyleAttrs);\n\n if (options.inlinePseudoElements) {\n editedElements.forEach(inlinePseudoElements);\n }\n\n if (options.applyWidthAttributes) {\n editedElements.forEach(function(el) {\n setDimensionAttrs(el, 'width');\n });\n }\n\n if (options.applyHeightAttributes) {\n editedElements.forEach(function(el) {\n setDimensionAttrs(el, 'height');\n });\n }\n\n if (options.applyAttributesTableElements) {\n editedElements.forEach(setAttributesOnTableElements);\n }\n\n if (options.insertPreservedExtraCss && options.extraCss) {\n var preservedText = utils.getPreservedText(options.extraCss, {\n mediaQueries: options.preserveMediaQueries,\n fontFaces: options.preserveFontFaces,\n keyFrames: options.preserveKeyFrames\n });\n if (preservedText) {\n var $appendTo = null;\n if (options.insertPreservedExtraCss !== true) {\n $appendTo = $(options.insertPreservedExtraCss);\n } else {\n $appendTo = $('head');\n if (!$appendTo.length) { $appendTo = $('body'); }\n if (!$appendTo.length) { $appendTo = $.root(); }\n }\n\n $appendTo.first().append('');\n }\n }\n\n function handleRule(rule) {\n var sel = rule[0];\n var style = rule[1];\n var selector = new utils.Selector(sel);\n var parsedSelector = selector.parsed();\n\n if (!parsedSelector) {\n return;\n }\n\n var pseudoElementType = getPseudoElementType(parsedSelector);\n\n // skip rule if the selector has any pseudos which are ignored\n for (var i = 0; i < parsedSelector.length; ++i) {\n var subSel = parsedSelector[i];\n if (subSel.pseudos) {\n for (var j = 0; j < subSel.pseudos.length; ++j) {\n var subSelPseudo = subSel.pseudos[j];\n if (juiceClient.ignoredPseudos.indexOf(subSelPseudo.name) >= 0) {\n return;\n }\n }\n }\n }\n\n if (pseudoElementType) {\n var last = parsedSelector[parsedSelector.length - 1];\n var pseudos = last.pseudos;\n last.pseudos = filterElementPseudos(last.pseudos);\n sel = parsedSelector.toString();\n last.pseudos = pseudos;\n }\n\n var els;\n try {\n els = $(sel);\n } catch (err) {\n // skip invalid selector\n return;\n }\n\n els.each(function() {\n var el = this;\n\n if (el.name && juiceClient.nonVisualElements.indexOf(el.name.toUpperCase()) >= 0) {\n return;\n }\n\n if (pseudoElementType) {\n var pseudoElPropName = 'pseudo' + pseudoElementType;\n var pseudoEl = el[pseudoElPropName];\n if (!pseudoEl) {\n pseudoEl = el[pseudoElPropName] = $('').get(0);\n pseudoEl.pseudoElementType = pseudoElementType;\n pseudoEl.pseudoElementParent = el;\n pseudoEl.counterProps = el.counterProps;\n el[pseudoElPropName] = pseudoEl;\n }\n el = pseudoEl;\n }\n\n if (!el.styleProps) {\n el.styleProps = {};\n\n // if the element has inline styles, fake selector with topmost specificity\n if ($(el).attr(styleAttributeName)) {\n var cssText = '* { ' + $(el).attr(styleAttributeName) + ' } ';\n addProps(utils.parseCSS(cssText)[0][1], new utils.Selector('`;\n }\n\n computeStyle() {\n // 计算需要append进富文本的style\n const mathStyle = this.getStyleFromSheets('mjx-container');\n const cherryStyle = this.getStyleFromSheets('cherry');\n const echartStyle =\n '';\n return {\n mathStyle,\n echartStyle,\n cherryStyle,\n };\n }\n\n /**\n * 由于复制操作会随着预览区域的内容增加而耗时变长,所以需要增加“正在复制”的状态回显\n * 同时该状态也用于限频\n */\n toggleLoading() {\n // 切换loading状态\n if (this.isLoading) {\n const loadingButton = document.querySelector('.icon-loading');\n loadingButton.outerHTML = ``;\n } else {\n const copyButton = document.querySelector('.ch-icon-copy');\n copyButton.outerHTML = '';\n }\n this.isLoading = !this.isLoading;\n }\n\n /**\n * 响应点击事件\n * 该按钮不会引发编辑区域的内容改动,所以不用处理用户在编辑区域的选中内容\n * @param {Event} e 点击事件\n */\n onClick(e) {\n this.toggleLoading();\n const inlineCodeTheme = document.querySelector('.cherry').getAttribute('data-inline-code-theme');\n const codeBlockTheme = document.querySelector('.cherry').getAttribute('data-code-block-theme');\n const { mathStyle, echartStyle, cherryStyle } = this.computeStyle();\n const html = this.previewer.isPreviewerHidden()\n ? this.previewer.options.previewerCache.html\n : this.previewer.getValue();\n // 将css样式以行内样式的形式插入到html内容里\n this.adaptWechat(html).then((html) => {\n copyToClip(\n juice(\n `
\n
${html}
\n
${mathStyle + echartStyle + cherryStyle}`,\n ),\n );\n this.toggleLoading();\n });\n }\n}\n\n/**\n * 将图片转成base64,防止出现由于图片防盗链功能导致图裂的情况\n * @param {string} url 图片的地址\n * @param {Function} [callback] 回调函数,本函数不处理该参数\n * @param {string} [outputFormat]\n * @returns {Promise} img node\n */\nfunction convertImgToBase64(url, callback, outputFormat) {\n return new Promise((resolve) => {\n let canvas = /** @type {HTMLCanvasElement}*/ (document.createElement('CANVAS'));\n const ctx = canvas.getContext('2d');\n const img = new Image();\n img.crossOrigin = 'Anonymous';\n img.onload = function () {\n canvas.height = img.height;\n canvas.width = img.width;\n ctx.drawImage(img, 0, 0);\n const dataURL = canvas.toDataURL(outputFormat || 'image/png');\n resolve(dataURL);\n canvas = null;\n };\n img.src = url;\n });\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport MenuBase from '@/toolbars/MenuBase';\nimport { getPanelRule } from '@/utils/regexp';\nimport { getSelection } from '@/utils/selection';\n/**\n * 插入面板\n */\nexport default class Panel extends MenuBase {\n constructor($cherry) {\n super($cherry);\n this.setName('panel', 'tips');\n this.panelRule = getPanelRule().reg;\n this.subMenuConfig = [\n {\n iconName: 'tips',\n name: 'tips',\n onclick: this.bindSubClick.bind(this, 'primary'),\n },\n {\n iconName: 'info',\n name: 'info',\n onclick: this.bindSubClick.bind(this, 'info'),\n },\n {\n iconName: 'warning',\n name: 'warning',\n onclick: this.bindSubClick.bind(this, 'warning'),\n },\n {\n iconName: 'danger',\n name: 'danger',\n onclick: this.bindSubClick.bind(this, 'danger'),\n },\n {\n iconName: 'success',\n name: 'success',\n onclick: this.bindSubClick.bind(this, 'success'),\n },\n ];\n }\n\n /**\n * 从字符串中找打面板的name\n * @param {string} str\n * @returns {string | false}\n */\n $getNameFromStr(str) {\n let ret = false;\n this.panelRule.lastIndex = 0;\n str.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = /\\s/.test(name.trim()) ? name.trim().replace(/\\s.*$/, '') : name;\n ret = $name ? $name.trim().toLowerCase() : '';\n return match;\n });\n return ret;\n }\n\n $getTitle(str) {\n this.panelRule.lastIndex = 0;\n str.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = name.trim();\n return /\\s/.test($name) ? $name.replace(/[^\\s]+\\s/, '') : '';\n });\n return '';\n }\n\n /**\n * 响应点击事件\n * @param {string} selection 被用户选中的文本内容\n * @param {string} shortKey 快捷键参数\n * @returns {string} 回填到编辑器光标位置/选中文本区域的内容\n */\n onClick(selection, shortKey = '') {\n let $selection = getSelection(this.editor.editor, selection, 'line', true) || '内容';\n let currentName = this.$getNameFromStr($selection);\n let title = this.$getTitle($selection);\n if (currentName === false) {\n // 如果没有命中面板语法,则尝试扩大选区\n this.getMoreSelection('::: ', '\\n', () => {\n const newSelection = this.editor.editor.getSelection();\n const isMatch = this.$getNameFromStr(newSelection);\n if (isMatch !== false) {\n $selection = newSelection;\n currentName = isMatch;\n title = this.$getTitle(newSelection);\n }\n return isMatch !== false;\n });\n }\n if (currentName !== false) {\n // 如果命中了面板语法,则尝试去掉语法或者变更语法\n if (currentName === shortKey) {\n // 去掉面板语法\n this.panelRule.lastIndex = 0;\n return $selection.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = name.trim();\n const $title = /\\s/.test($name) ? $name.replace(/[^\\s]+\\s/, '') : '';\n return `${$title}\\n${content}`;\n });\n }\n // 修改name\n this.registerAfterClickCb(() => {\n this.setLessSelection('::: ', '\\n');\n });\n this.panelRule.lastIndex = 0;\n return $selection.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = name.trim();\n const $title = /\\s/.test($name) ? $name.replace(/[^\\s]+\\s/, '') : '';\n return `::: ${shortKey} ${$title}\\n${content.replace(/\\n+$/, '')}\\n:::`;\n });\n }\n this.registerAfterClickCb(() => {\n this.setLessSelection('::: ', '\\n');\n });\n $selection = $selection.replace(/^\\n+/, '');\n if (/\\n/.test($selection)) {\n if (!title) {\n title = $selection.replace(/\\n[\\w\\W]+$/, '');\n $selection = $selection.replace(/^[^\\n]+\\n/, '');\n }\n } else {\n title = title ? title : '标题';\n }\n return `::: ${shortKey} ${title}\\n${$selection}\\n:::`.replace(/\\n{2,}:::/g, '\\n:::');\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Panel from './Panel';\nimport { getPanelRule } from '@/utils/regexp';\n/**\n * 插入对齐方式\n */\nexport default class Justify extends Panel {\n constructor($cherry) {\n super($cherry);\n this.setName('justify', 'justify');\n this.panelRule = getPanelRule().reg;\n this.subMenuConfig = [\n {\n iconName: 'justifyLeft',\n name: '左对齐',\n onclick: this.bindSubClick.bind(this, 'left'),\n },\n {\n iconName: 'justifyCenter',\n name: '居中',\n onclick: this.bindSubClick.bind(this, 'center'),\n },\n {\n iconName: 'justifyRight',\n name: '右对齐',\n onclick: this.bindSubClick.bind(this, 'right'),\n },\n ];\n }\n\n $getTitle() {\n return ' ';\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport MenuBase from '@/toolbars/MenuBase';\nimport { getDetailRule } from '@/utils/regexp';\nimport { getSelection } from '@/utils/selection';\n/**\n * 插入手风琴\n */\nexport default class Detail extends MenuBase {\n constructor($cherry) {\n super($cherry);\n this.setName('detail', 'insertFlow');\n this.detailRule = getDetailRule().reg;\n }\n\n /**\n * 响应点击事件\n * @param {string} selection 被用户选中的文本内容\n * @returns {string} 回填到编辑器光标位置/选中文本区域的内容\n */\n onClick(selection) {\n let $selection =\n getSelection(this.editor.editor, selection, 'line', true) ||\n '点击展开更多\\n内容\\n++- 默认展开\\n内容\\n++ 默认收起\\n内容';\n this.detailRule.lastIndex = 0;\n if (!this.detailRule.test($selection)) {\n // 如果没有命中手风琴语法,则尝试扩大选区\n this.getMoreSelection('+++ ', '\\n', () => {\n const newSelection = this.editor.editor.getSelection();\n this.detailRule.lastIndex = 0;\n const isMatch = this.detailRule.test(newSelection);\n if (isMatch !== false) {\n $selection = newSelection;\n }\n return isMatch !== false;\n });\n }\n this.detailRule.lastIndex = 0;\n if (this.detailRule.test($selection)) {\n // 如果命中了手风琴语法,则去掉手风琴语法\n this.detailRule.lastIndex = 0;\n return $selection.replace(this.detailRule, (match, preLines, isOpen, title, content) => {\n return `${title}\\n${content}`;\n });\n }\n // 去掉开头的空格\n $selection = $selection.replace(/^\\s+/, '');\n // 如果选中的内容不包含换行,则强制增加一个换行\n if (!/\\n/.test($selection)) {\n $selection = `${$selection}\\n${$selection}`;\n }\n this.registerAfterClickCb(() => {\n this.setLessSelection('+++ ', '\\n');\n });\n return `+++ ${$selection}\\n+++`.replace(/\\n{2,}\\+\\+\\+/g, '\\n+++');\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport MenuBase from '@/toolbars/MenuBase';\nimport { drawioDialog } from '@/utils/dialog';\n/**\n * 打开draw.io画图对话框,点击确定后向编辑器插入图片语法\n */\nexport default class DrawIo extends MenuBase {\n constructor($cherry) {\n super($cherry);\n this.setName('draw.io', 'draw.io');\n this.noIcon = true;\n this.drawioIframeUrl = $cherry.options.drawioIframeUrl;\n }\n\n /**\n * 响应点击事件\n * @param {string} selection 被用户选中的文本内容\n * @param {string} shortKey 快捷键参数,本函数不处理这个参数\n * @returns {string} 回填到编辑器光标位置/选中文本区域的内容\n */\n onClick(selection, shortKey = '') {\n if (!this.drawioIframeUrl) {\n // 如果没有配置drawio的编辑页URL,则直接失效\n return selection;\n }\n if (this.hasCacheOnce()) {\n // @ts-ignore\n const { xmlData, base64 } = this.getAndCleanCacheOnce();\n const begin = '![';\n const end = `](${base64}){data-type=drawio data-xml=${encodeURI(xmlData)}}`;\n this.registerAfterClickCb(() => {\n this.setLessSelection(begin, end);\n });\n return `${begin}在预览区点击图片重新编辑draw.io${end}`;\n }\n // 插入图片,调用上传文件逻辑\n drawioDialog(this.drawioIframeUrl, '', (data) => {\n this.setCacheOnce(data);\n this.fire(null);\n });\n this.updateMarkdown = false;\n return selection;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * 工具栏各个实例的注册中心\n */\nimport Bold from './hooks/Bold';\nimport Italic from './hooks/Italic';\nimport Split from './hooks/Split';\nimport Strikethrough from './hooks/Strikethrough';\nimport Sub from './hooks/Sub';\nimport Sup from './hooks/Sup';\nimport Color from './hooks/Color';\nimport Header from './hooks/Header';\nimport Insert from './hooks/Insert';\nimport List from './hooks/List';\nimport Ol from './hooks/Ol';\nimport Ul from './hooks/Ul';\nimport CheckList from './hooks/CheckList';\nimport Graph from './hooks/Graph';\nimport Size from './hooks/Size';\nimport H1 from './hooks/H1';\nimport H2 from './hooks/H2';\nimport H3 from './hooks/H3';\nimport Quote from './hooks/Quote';\nimport QuickTable from './hooks/QuickTable';\nimport TogglePreview from './hooks/TogglePreview';\nimport FullScreen from './hooks/FullScreen';\nimport Undo from './hooks/Undo';\nimport Redo from './hooks/Redo';\nimport Code from './hooks/Code';\nimport CodeTheme from './hooks/CodeTheme';\nimport Export from './hooks/Export';\nimport Settings from './hooks/Settings';\nimport Underline from './hooks/Underline';\nimport SwitchModel from './hooks/SwitchModel';\nimport Image from './hooks/Image';\nimport Audio from './hooks/Audio';\nimport Video from './hooks/Video';\nimport Br from './hooks/Br';\nimport Hr from './hooks/Hr';\nimport Formula from './hooks/Formula';\nimport Link from './hooks/Link';\nimport Table from './hooks/Table';\nimport Toc from './hooks/Toc';\nimport LineTable from './hooks/LineTable';\nimport BarTable from './hooks/BarTable';\nimport Pdf from './hooks/Pdf';\nimport File from './hooks/File';\nimport Word from './hooks/Word';\nimport Ruby from './hooks/Ruby';\nimport Theme from './hooks/Theme';\nimport ChatGpt from './hooks/ChatGpt';\n// Sidebar\nimport MobilePreview from './hooks/MobilePreview';\nimport Copy from './hooks/Copy';\nimport Panel from './hooks/Panel';\nimport Justify from './hooks/Justify';\nimport Detail from './hooks/Detail';\nimport DrawIo from './hooks/DrawIo';\n\n// 定义默认支持的工具栏\n// 目前不支持按需动态加载\n// 如果对CherryMarkdown构建后的文件大小有比较严格的要求,可以根据实际情况删减hook\nconst HookList = {\n bold: Bold,\n italic: Italic,\n '|': Split,\n strikethrough: Strikethrough,\n sub: Sub,\n sup: Sup,\n header: Header,\n insert: Insert,\n list: List,\n ol: Ol,\n ul: Ul,\n checklist: CheckList,\n graph: Graph,\n size: Size,\n h1: H1,\n h2: H2,\n h3: H3,\n color: Color,\n quote: Quote,\n quickTable: QuickTable,\n togglePreview: TogglePreview,\n code: Code,\n codeTheme: CodeTheme,\n export: Export,\n settings: Settings,\n fullScreen: FullScreen,\n mobilePreview: MobilePreview,\n copy: Copy,\n undo: Undo,\n redo: Redo,\n underline: Underline,\n switchModel: SwitchModel,\n image: Image,\n audio: Audio,\n video: Video,\n br: Br,\n hr: Hr,\n formula: Formula,\n link: Link,\n table: Table,\n toc: Toc,\n lineTable: LineTable,\n barTable: BarTable,\n pdf: Pdf,\n word: Word,\n ruby: Ruby,\n theme: Theme,\n file: File,\n panel: Panel,\n justify: Justify,\n detail: Detail,\n drawIo: DrawIo,\n chatgpt: ChatGpt,\n};\n\nexport default class HookCenter {\n constructor(toolbar) {\n this.toolbar = toolbar;\n /**\n * @type {{[key: string]: import('@/toolbars/MenuBase').default}} 保存所有菜单实例\n */\n this.hooks = {};\n /**\n * @type {string[]} 所有注册的菜单名称\n */\n this.allMenusName = [];\n /**\n * @type {string[]} 一级菜单的名称\n */\n this.level1MenusName = [];\n /**\n * @type {{ [parentName: string]: string[]}} 二级菜单的名称, e.g. {一级菜单名称: [二级菜单名称1, 二级菜单名称2]}\n */\n this.level2MenusName = {};\n this.init();\n }\n\n $newMenu(name) {\n if (this.hooks[name]) {\n return;\n }\n const { $cherry, customMenu } = this.toolbar.options;\n if (HookList[name]) {\n this.allMenusName.push(name);\n this.hooks[name] = new HookList[name]($cherry);\n } else if (customMenu !== undefined && customMenu !== null && customMenu[name]) {\n this.allMenusName.push(name);\n // 如果是自定义菜单,传参兼容旧版\n this.hooks[name] = new customMenu[name]($cherry);\n }\n }\n\n /**\n * 根据配置动态渲染、绑定工具栏\n * @returns\n */\n init() {\n const { buttonConfig } = this.toolbar.options;\n buttonConfig.forEach((item) => {\n if (typeof item === 'string') {\n this.level1MenusName.push(item);\n this.$newMenu(item);\n } else if (typeof item === 'object') {\n const keys = Object.keys(item);\n if (keys.length === 1) {\n // 只接受形如{ name: [ subMenu ] }的参数\n const [name] = keys;\n this.level1MenusName.push(name);\n this.$newMenu(name);\n this.level2MenusName[name] = item[name];\n item[name].forEach((subItem) => {\n this.$newMenu(subItem);\n });\n }\n }\n });\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { mac } from 'codemirror/src/util/browser';\nimport HookCenter from './HookCenter';\nimport Event from '@/Event';\nimport { createElement } from '@/utils/dom';\nimport Logger from '@/Logger';\n\nexport default class Toolbar {\n /**\n * @type {Record} 外部获取 toolbarHandler\n */\n toolbarHandlers = {};\n\n constructor(options) {\n // 存储所有菜单的实例\n this.menus = {};\n // 存储所有快捷键的影射 {快捷键: 菜单名称}\n this.shortcutKeyMap = {};\n // 存储所有二级菜单面板\n this.subMenus = {};\n // 默认的菜单配置\n this.options = {\n dom: document.createElement('div'),\n buttonConfig: ['bold'],\n customMenu: [],\n buttonRightConfig: [],\n };\n\n Object.assign(this.options, options);\n this.$cherry = this.options.$cherry;\n this.instanceId = this.$cherry.instanceId;\n this.menus = new HookCenter(this);\n this.drawMenus();\n this.init();\n }\n\n init() {\n this.collectShortcutKey();\n this.collectToolbarHandler();\n Event.on(this.instanceId, Event.Events.cleanAllSubMenus, () => this.hideAllSubMenu());\n }\n\n previewOnly() {\n this.options.dom.classList.add('preview-only');\n Event.emit(this.instanceId, Event.Events.toolbarHide);\n }\n\n showToolbar() {\n this.options.dom.classList.remove('preview-only');\n Event.emit(this.instanceId, Event.Events.toolbarShow);\n }\n\n isHasLevel2Menu(name) {\n // FIXME: return boolean\n return this.menus.level2MenusName[name];\n }\n\n isHasConfigMenu(name) {\n // FIXME: return boolean\n return this.menus.hooks[name].subMenuConfig || [];\n }\n\n /**\n * 判断是否有子菜单,目前有两种子菜单配置方式:1、通过`subMenuConfig`属性 2、通过`buttonConfig`配置属性\n * @param {string} name\n * @returns {boolean} 是否有子菜单\n */\n isHasSubMenu(name) {\n return Boolean(this.isHasLevel2Menu(name) || this.isHasConfigMenu(name).length > 0);\n }\n\n /**\n * 根据配置画出来一级工具栏\n */\n drawMenus() {\n const fragLeft = document.createDocumentFragment();\n const toolbarLeft = createElement('div', 'toolbar-left');\n\n this.menus.level1MenusName.forEach((name) => {\n const btn = this.menus.hooks[name].createBtn();\n btn.addEventListener(\n 'click',\n (event) => {\n this.onClick(event, name);\n },\n false,\n );\n if (this.isHasSubMenu(name)) {\n btn.classList.add('cherry-toolbar-dropdown');\n }\n fragLeft.appendChild(btn);\n });\n\n toolbarLeft.appendChild(fragLeft);\n this.options.dom.appendChild(toolbarLeft);\n\n this.options.buttonRightConfig?.length ? this.drawRightMenus(this.options.buttonRightConfig) : null;\n }\n /**\n * 根据配置画出来右侧一级工具栏\n */\n drawRightMenus(buttonRightConfig) {\n const toolbarRight = createElement('div', 'toolbar-right');\n const fragRight = document.createDocumentFragment();\n const rightOptions = {\n options: {\n $cherry: this.$cherry,\n buttonConfig: buttonRightConfig,\n customMenu: [],\n },\n };\n\n const rightMenus = new HookCenter(rightOptions);\n\n rightMenus.level1MenusName.forEach((name) => {\n const btn = rightMenus.hooks[name].createBtn();\n btn.addEventListener(\n 'click',\n (event) => {\n console.log('第一次点击');\n rightMenus.hooks[name].fire(event, name);\n },\n false,\n );\n fragRight.appendChild(btn);\n });\n\n toolbarRight.appendChild(fragRight);\n this.options.dom.appendChild(toolbarRight);\n }\n\n drawSubMenus(name) {\n const menu = this.menus.hooks[name];\n const pos = menu.getMenuPosition();\n this.subMenus[name] = createElement('div', 'cherry-dropdown', { name });\n this.subMenus[name].style.left = `${pos.left + pos.width / 2}px`;\n this.subMenus[name].style.top = `${pos.top + pos.height}px`;\n this.subMenus[name].style.position = menu.positionModel;\n // 如果有配置的二级菜单\n const level2MenusName = this.isHasLevel2Menu(name);\n if (level2MenusName) {\n level2MenusName.forEach((level2Name) => {\n const subMenu = this.menus.hooks[level2Name];\n if (subMenu !== undefined && typeof subMenu.createBtn === 'function') {\n const btn = subMenu.createBtn(true);\n // 二级菜单的dom认定为一级菜单的\n subMenu.dom = subMenu.dom ? subMenu.dom : this.menus.hooks[name].dom;\n btn.addEventListener('click', (event) => this.onClick(event, level2Name, true), false);\n this.subMenus[name].appendChild(btn);\n }\n });\n }\n // 兼容旧版本配置的二级菜单\n const subMenuConfig = this.isHasConfigMenu(name);\n if (subMenuConfig.length > 0) {\n subMenuConfig.forEach((config) => {\n const btn = this.menus.hooks[name].createSubBtnByConfig(config);\n btn.addEventListener('click', () => this.hideAllSubMenu(), false);\n this.subMenus[name].appendChild(btn);\n });\n }\n this.$cherry.wrapperDom.appendChild(this.subMenus[name]);\n }\n\n /**\n * 处理点击事件\n */\n onClick(event, name, focusEvent = false) {\n const menu = this.menus.hooks[name];\n if (!menu) {\n return;\n }\n if (this.isHasSubMenu(name) && !focusEvent) {\n this.toggleSubMenu(name);\n } else {\n this.hideAllSubMenu();\n menu.fire(event, name);\n }\n }\n\n /**\n * 展开/收起二级菜单\n */\n toggleSubMenu(name) {\n if (!this.subMenus[name]) {\n // 如果没有二级菜单,则先画出来,然后再显示\n this.hideAllSubMenu();\n this.drawSubMenus(name);\n this.subMenus[name].style.display = 'block';\n return;\n }\n if (this.subMenus[name].style.display === 'none') {\n // 如果是隐藏的,则先隐藏所有二级菜单,再显示当前二级菜单\n this.hideAllSubMenu();\n this.subMenus[name].style.display = 'block';\n } else {\n // 如果是显示的,则隐藏当前二级菜单\n this.subMenus[name].style.display = 'none';\n }\n }\n\n /**\n * 隐藏所有的二级菜单\n */\n hideAllSubMenu() {\n this.$cherry.wrapperDom.querySelectorAll('.cherry-dropdown').forEach((dom) => {\n dom.style.display = 'none';\n });\n }\n\n /**\n * 收集快捷键\n */\n collectShortcutKey() {\n this.menus.allMenusName.forEach((name) => {\n this.menus.hooks[name].shortcutKeys?.forEach((key) => {\n this.shortcutKeyMap[key] = name;\n });\n });\n }\n\n collectToolbarHandler() {\n this.toolbarHandlers = this.menus.allMenusName.reduce((handlerMap, name) => {\n const menuHook = this.menus.hooks[name];\n if (!menuHook) {\n return handlerMap;\n }\n handlerMap[name] = (shortcut, _callback) => {\n if (typeof _callback === 'function') {\n Logger.warn(\n 'MenuBase#onClick param callback is no longer supported. Please register the callback via MenuBase#registerAfterClickCb instead.',\n );\n }\n menuHook.fire.call(menuHook, undefined, shortcut);\n };\n return handlerMap;\n }, {});\n }\n\n /**\n * 监测是否有对应的快捷键\n * @param {KeyboardEvent} evt keydown 事件\n * @returns {boolean} 是否有对应的快捷键\n */\n matchShortcutKey(evt) {\n return !!this.shortcutKeyMap[this.getCurrentKey(evt)];\n }\n\n /**\n * 触发对应快捷键的事件\n * @param {KeyboardEvent} evt\n */\n fireShortcutKey(evt) {\n const currentKey = this.getCurrentKey(evt);\n this.menus.hooks[this.shortcutKeyMap[currentKey]]?.fire(evt, currentKey);\n }\n\n /**\n * 格式化当前按键,mac下的command按键转换为ctrl\n * @param {KeyboardEvent} event\n * @returns\n */\n getCurrentKey(event) {\n let key = '';\n if (event.ctrlKey) {\n key += 'Ctrl-';\n }\n\n if (event.altKey) {\n key += 'Alt-';\n }\n\n if (event.metaKey && mac) {\n key += 'Ctrl-';\n }\n\n // 如果存在shift键\n if (event.shiftKey) {\n key += `Shift-`;\n }\n\n // 如果还有第三个键 且不是 shift键\n if (event.key && event.key.toLowerCase() !== 'shift') {\n key += event.key.toLowerCase();\n }\n\n return key;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Toolbar from './Toolbar';\n/**\n * 在编辑区域选中文本时浮现的bubble工具栏\n */\nexport default class Bubble extends Toolbar {\n /**\n * @type {'flex' | 'block'}\n */\n static displayType = 'flex';\n // constructor(options) {\n // super(options);\n // }\n\n set visible(visible) {\n const bubbleStyle = window.getComputedStyle(this.bubbleDom);\n if (visible) {\n bubbleStyle.display === 'none' && (this.bubbleDom.style.display = Bubble.displayType);\n // bubbleStyle.visibility !== 'visible' && (this.bubbleBottom.style.visibility = 'visible');\n } else {\n bubbleStyle.display !== 'none' && (this.bubbleDom.style.display = 'none');\n // bubbleStyle.visibility !== 'hidden' && (this.bubbleBottom.style.visibility = 'hidden');\n }\n }\n\n get visible() {\n const bubbleStyle = window.getComputedStyle(this.bubbleDom);\n return bubbleStyle.display !== 'none' && bubbleStyle.visibility !== 'hidden';\n }\n\n init() {\n this.options.editor = this.$cherry.editor;\n this.addSelectionChangeListener();\n this.bubbleDom = this.options.dom;\n this.editorDom = this.options.editor.getEditorDom();\n this.initBubbleDom();\n this.editorDom.querySelector('.CodeMirror').appendChild(this.bubbleDom);\n }\n\n /**\n * 计算编辑区域的偏移量\n * @returns {number} 编辑区域的滚动区域\n */\n getScrollTop() {\n return this.options.editor.editor.getScrollInfo().top;\n }\n\n /**\n * 当编辑区域滚动的时候自动隐藏bubble工具栏和子工具栏\n */\n updatePositionWhenScroll() {\n if (this.bubbleDom.style.display === Bubble.displayType) {\n this.bubbleDom.style.marginTop = `${parseFloat(this.bubbleDom.dataset.scrollTop) - this.getScrollTop()}px`;\n }\n }\n\n /**\n * 根据高度计算bubble工具栏出现的位置的高度\n * 根据宽度计算bubble工具栏出现的位置的left值,以及bubble工具栏三角箭头的left值\n * @param {number} top 高度\n * @param {number} width 选中文本内容的宽度\n */\n showBubble(top, width) {\n if (!this.visible) {\n this.visible = true;\n this.bubbleDom.style.marginTop = '0';\n this.bubbleDom.dataset.scrollTop = String(this.getScrollTop());\n }\n const positionLimit = this.editorDom.querySelector('.CodeMirror-lines').firstChild.getBoundingClientRect();\n const editorPosition = this.editorDom.getBoundingClientRect();\n const minLeft = positionLimit.left - editorPosition.left;\n const maxLeft = positionLimit.width + minLeft;\n const minTop = this.bubbleDom.offsetHeight * 2;\n let $top = top;\n if ($top < minTop) {\n // 如果高度小于编辑器的顶部,则让bubble工具栏出现在选中文本的下放\n $top += this.bubbleDom.offsetHeight - this.bubbleTop.getBoundingClientRect().height;\n this.bubbleTop.style.display = 'block';\n this.bubbleBottom.style.display = 'none';\n } else {\n // 反之出现在选中文本内容的上方\n $top -= this.bubbleDom.offsetHeight + 2 * this.bubbleBottom.getBoundingClientRect().height;\n this.bubbleTop.style.display = 'none';\n this.bubbleBottom.style.display = 'block';\n }\n this.bubbleDom.style.top = `${$top}px`;\n let left = width - this.bubbleDom.offsetWidth / 2;\n if (left < minLeft) {\n // 如果位置超过了编辑器的最左边,则控制bubble工具栏不超出编辑器最左边\n // 同时bubble工具栏上的箭头尽量指向选中文本内容的中间位置\n left = minLeft;\n this.$setBubbleCursorPosition(`${width - minLeft}px`);\n } else if (left + this.bubbleDom.offsetWidth > maxLeft) {\n // 如果位置超过了编辑器的最右边,则控制bubble工具栏不超出编辑器最右边\n // 同时bubble工具栏上的箭头尽量指向选中文本内容的中间位置\n left = maxLeft - this.bubbleDom.offsetWidth;\n this.$setBubbleCursorPosition(`${width - left}px`);\n } else {\n // 让bubble工具栏的箭头处于工具栏的中间位置\n this.$setBubbleCursorPosition('50%');\n }\n // 安全边距 20px\n this.bubbleDom.style.left = `${Math.max(20, left)}px`;\n }\n\n hideBubble() {\n this.visible = false;\n }\n\n /**\n * 控制bubble工具栏的箭头的位置\n * @param {string} left 左偏移量\n */\n $setBubbleCursorPosition(left = '50%') {\n if (left === '50%') {\n this.bubbleTop.style.left = '50%';\n this.bubbleBottom.style.left = '50%';\n } else {\n const $left = parseFloat(left) < 10 ? '10px' : left;\n this.bubbleTop.style.left = $left;\n this.bubbleBottom.style.left = $left;\n }\n }\n\n initBubbleDom() {\n const top = document.createElement('div');\n top.className = 'cherry-bubble-top';\n const bottom = document.createElement('div');\n bottom.className = 'cherry-bubble-bottom';\n this.bubbleTop = top;\n this.bubbleBottom = bottom;\n this.bubbleDom.appendChild(top);\n this.bubbleDom.appendChild(bottom);\n // 默认不可见\n this.visible = false;\n }\n\n getBubbleDom() {\n return this.bubbleDom;\n }\n\n addSelectionChangeListener() {\n this.options.editor.addListener('change', (codemirror) => {\n // 当编辑区内容变更时自动隐藏bubble工具栏\n this.hideBubble();\n });\n this.options.editor.addListener('refresh', (codemirror) => {\n // 当编辑区内容刷新时自动隐藏bubble工具栏\n this.hideBubble();\n });\n this.options.editor.addListener('scroll', (codemirror) => {\n // 当编辑区滚动时,需要实时同步bubble工具栏的位置\n this.updatePositionWhenScroll();\n });\n this.options.editor.addListener('beforeSelectionChange', (codemirror, info) => {\n // 当编辑区选中内容改变时,需要展示/隐藏bubble工具栏,并计算工具栏位置\n if (info.origin !== '*mouse' && (info.origin !== null || typeof info.origin === 'undefined')) {\n return true;\n }\n if (!info.ranges[0]) {\n return true;\n }\n const anchor = info.ranges[0].anchor.line * 1000000 + info.ranges[0].anchor.ch;\n const head = info.ranges[0].head.line * 1000000 + info.ranges[0].head.ch;\n let direction = 'asc';\n if (anchor > head) {\n direction = 'desc';\n }\n setTimeout(() => {\n const selections = codemirror.getSelections();\n if (selections.join('').length <= 0) {\n this.hideBubble();\n return;\n }\n const selectedObjs = codemirror.getWrapperElement().getElementsByClassName('CodeMirror-selected');\n const editorPosition = this.editorDom.getBoundingClientRect();\n let width = 0;\n let top = 0;\n if (typeof selectedObjs !== 'object' || selectedObjs.length <= 0) {\n this.hideBubble();\n return;\n }\n for (let key = 0; key < selectedObjs.length; key++) {\n const one = selectedObjs[key];\n const position = one.getBoundingClientRect();\n const targetTop = position.top - editorPosition.top;\n if (direction === 'asc') {\n if (targetTop >= top) {\n top = targetTop;\n width = position.left - editorPosition.left + position.width / 2;\n }\n } else {\n if (targetTop <= top || top <= 0) {\n top = targetTop;\n width = position.left - editorPosition.left + position.width / 2;\n }\n }\n }\n this.showBubble(top, width);\n }, 10);\n });\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Toolbar from './Toolbar';\n/**\n * 当光标处于编辑器新行起始位置时出现的浮动工具栏\n */\nexport default class FloatMenu extends Toolbar {\n // constructor(options) {\n // super(options);\n // }\n\n init() {\n this.editor = this.$cherry.editor;\n this.editorDom = this.editor.getEditorDom();\n this.editorDom.querySelector('.CodeMirror-scroll').appendChild(this.options.dom);\n this.initAction();\n }\n\n initAction() {\n const self = this;\n this.editor.addListener('cursorActivity', (codemirror, evt) => {\n // 当编辑区光标位置改变时触发\n self.cursorActivity(evt, codemirror);\n });\n\n this.editor.addListener('update', (codemirror, evt) => {\n // 当编辑区内容改变时触发\n self.cursorActivity(evt, codemirror);\n });\n\n this.editor.addListener('refresh', (codemirror, evt) => {\n // 当编辑器刷新时触发\n setTimeout(() => {\n self.cursorActivity(evt, codemirror);\n }, 0);\n });\n }\n\n update(evt, codeMirror) {\n const pos = codeMirror.getCursor();\n if (this.isHidden(pos.line, codeMirror)) {\n this.options.dom.style.display = 'none';\n return false;\n }\n this.options.dom.style.display = 'inline-block';\n }\n\n /**\n * 当光标激活时触发,当光标处于行起始位置时展示float工具栏;反之隐藏\n * @param {Event} evt\n * @param {CodeMirror.Editor} codeMirror\n * @returns\n */\n cursorActivity(evt, codeMirror) {\n const pos = codeMirror.getCursor();\n const codeMirrorLines = document.querySelector('.cherry-editor .CodeMirror-lines');\n if (!codeMirrorLines) {\n return false;\n }\n const computedLinesStyle = getComputedStyle(codeMirrorLines);\n const codeWrapPaddingLeft = parseFloat(computedLinesStyle.paddingLeft);\n const codeWrapPaddingTop = parseFloat(computedLinesStyle.paddingTop);\n // const cursorHandle = codeMirror.getLineHandle(pos.line);\n // const verticalMiddle = cursorHandle.height * 1 / 2;\n\n if (this.isHidden(pos.line, codeMirror)) {\n this.options.dom.style.display = 'none';\n return false;\n }\n this.options.dom.style.display = 'inline-block';\n this.options.dom.style.left = `${codeWrapPaddingLeft}px`;\n this.options.dom.style.top = `${this.getLineHeight(pos.line, codeMirror) + codeWrapPaddingTop}px`;\n }\n\n /**\n * 判断是否需要隐藏Float工具栏\n * 有选中内容,或者光标所在行有内容时隐藏float 工具栏\n * @param {number} line\n * @param {CodeMirror.Editor} codeMirror\n * @returns {boolean} 是否需要隐藏float工具栏,true:需要隐藏\n */\n isHidden(line, codeMirror) {\n const selections = codeMirror.getSelections();\n if (selections.length > 1) {\n return true;\n }\n const selection = codeMirror.getSelection();\n if (selection.length > 0) {\n return true;\n }\n if (codeMirror.getLine(line)) {\n return true;\n }\n return false;\n }\n\n /**\n * 获取对应行的行高度,用来让float 工具栏在该行保持垂直居中\n * @param {number} line\n * @param {CodeMirror.Editor} codeMirror\n * @returns\n */\n getLineHeight(line, codeMirror) {\n let height = 0;\n codeMirror.getDoc().eachLine(0, line, (line) => {\n height += line.height;\n });\n\n return height;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Toolbar from './Toolbar';\n/**\n * 预览区域右侧悬浮的工具栏\n * 推荐放置跟编辑区域完全无关的工具栏\n * 比如复制预览区域内容、修改预览区域主题等\n */\nexport default class Sidebar extends Toolbar {\n // constructor(options) {\n // super(options);\n // }\n}\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport diff from 'fast-diff';\n/**\n * 更新内容时保持光标不变\n * @param {Number} pos 光标相对文档开头的偏移量\n * @param {String} oldContent 变更前的内容\n * @param {String} newContent 变更后的内容\n * @returns {Number} newPos 新的光标偏移量\n */\nexport default function getPosBydiffs(pos, oldContent, newContent) {\n const diffs = diff(oldContent, newContent);\n let newPos = pos;\n let tmpPos = pos;\n for (let i = 0; i < diffs.length; i++) {\n const val = diffs[i];\n if (tmpPos <= 0) {\n return newPos;\n }\n const opType = val[0];\n const opLength = val[1].length;\n switch (opType) {\n // 没有改变的内容\n case diff.EQUAL:\n if (tmpPos <= opLength) {\n return newPos;\n }\n tmpPos -= opLength;\n break;\n // 删除的内容\n case diff.DELETE:\n if (tmpPos <= opLength) {\n return newPos - opLength + tmpPos;\n }\n tmpPos -= opLength;\n newPos -= opLength;\n break;\n // 新增的内容\n case diff.INSERT:\n newPos += opLength;\n break;\n }\n }\n return newPos;\n}\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst callbacks = {\n /**\n * 全局的URL处理器\n * @param {string} url 来源url\n * @param {'image'|'audio'|'video'|'autolink'|'link'} srcType 来源类型\n * @returns\n */\n urlProcessor: (url, srcType) => url,\n fileUpload(file, callback) {\n if (/video/i.test(file.type)) {\n callback('images/demo-dog.png', {\n name: `${file.name.replace(/\\.[^.]+$/, '')}`,\n poster: 'images/demo-dog.png?poster=true',\n isBorder: true,\n isShadow: true,\n isRadius: true,\n });\n } else {\n callback('images/demo-dog.png', { name: `${file.name.replace(/\\.[^.]+$/, '')}`, isShadow: true });\n }\n },\n afterChange: (text, html) => {},\n afterInit: (text, html) => {},\n beforeImageMounted: (srcProp, src) => ({ srcProp, src }),\n onClickPreview: (event) => {},\n onCopyCode: (event, code) => {\n // 阻止默认的粘贴事件\n // return false;\n // 对复制内容进行额外处理\n return code;\n },\n // 获取中文的拼音\n changeString2Pinyin: (string) => {\n /**\n * 推荐使用这个组件:https://github.com/liu11hao11/pinyin_js\n *\n * 可以在 ../scripts/pinyin/pinyin_dist.js 里直接引用\n */\n return string;\n },\n};\n\n/** @type {Partial} */\nconst defaultConfig = {\n // 第三方包\n externals: {\n // externals\n },\n // 解析引擎配置\n engine: {\n // 全局配置\n global: {\n // 是否启用经典换行逻辑\n // true:一个换行会被忽略,两个以上连续换行会分割成段落,\n // false: 一个换行会转成 ,两个连续换行会分割成段落,三个以上连续换行会转成 并分割段落\n classicBr: false,\n /**\n * 全局的URL处理器\n * @param {string} url 来源url\n * @param {'image'|'audio'|'video'|'autolink'|'link'} srcType 来源类型\n * @returns\n */\n urlProcessor: callbacks.urlProcessor,\n /**\n * 额外允许渲染的html标签\n * 标签以英文竖线分隔,如:htmlWhiteList: 'iframe|script|style'\n * 默认为空,默认允许渲染的html见src/utils/sanitize.js whiteList 属性\n * 需要注意:\n * - 启用iframe、script等标签后,会产生xss注入,请根据实际场景判断是否需要启用\n * - 一般编辑权限可控的场景(如api文档系统)可以允许iframe、script等标签\n */\n htmlWhiteList: '',\n },\n // 内置语法配置\n syntax: {\n // 语法开关\n // 'hookName': false,\n // 语法配置\n // 'hookName': {\n //\n // }\n autoLink: {\n /** 是否开启短链接 */\n enableShortLink: true,\n /** 短链接长度 */\n shortLinkLength: 20,\n },\n list: {\n listNested: false, // 同级列表类型转换后变为子级\n indentSpace: 2, // 默认2个空格缩进\n },\n table: {\n enableChart: false,\n // chartRenderEngine: EChartsTableEngine,\n // externals: ['echarts'],\n },\n inlineCode: {\n theme: 'red',\n },\n codeBlock: {\n theme: 'dark', // 默认为深色主题\n wrap: true, // 超出长度是否换行,false则显示滚动条\n lineNumber: true, // 默认显示行号\n copyCode: true, // 是否显示“复制”按钮\n customRenderer: {\n // 自定义语法渲染器\n },\n mermaid: {\n svg2img: false, // 是否将mermaid生成的画图变成img格式\n },\n /**\n * indentedCodeBlock是缩进代码块是否启用的开关\n *\n * 在6.X之前的版本中默认不支持该语法。\n * 因为cherry的开发团队认为该语法太丑了(容易误触)\n * 开发团队希望用```代码块语法来彻底取代该语法\n * 但在后续的沟通中,开发团队发现在某些场景下该语法有更好的显示效果\n * 因此开发团队在6.X版本中才引入了该语法\n * 已经引用6.x以下版本的业务如果想做到用户无感知升级,可以去掉该语法:\n * indentedCodeBlock:false\n */\n indentedCodeBlock: true,\n },\n emoji: {\n useUnicode: true, // 是否使用unicode进行渲染\n },\n fontEmphasis: {\n /**\n * 是否允许首尾空格\n * 首尾、前后的定义: 语法前**语法首+内容+语法尾**语法后\n * 例:\n * true:\n * __ hello __ ====> hello \n * __hello__ ====> hello\n * false:\n * __ hello __ ====> _ hello _\n * __hello__ ====> hello\n */\n allowWhitespace: false,\n },\n strikethrough: {\n /**\n * 是否必须有前后空格\n * 首尾、前后的定义: 语法前**语法首+内容+语法尾**语法后\n * 例:\n * true:\n * hello wor~~l~~d ====> hello wor~~l~~d\n * hello wor ~~l~~ d ====> hello wor l d\n * false:\n * hello wor~~l~~d ====> hello world\n * hello wor ~~l~~ d ====> hello wor l d\n */\n needWhitespace: false,\n },\n mathBlock: {\n engine: 'MathJax', // katex或MathJax\n src: '',\n plugins: true, // 默认加载插件\n },\n inlineMath: {\n engine: 'MathJax', // katex或MathJax\n src: '',\n },\n toc: {\n /** 默认只渲染一个目录 */\n allowMultiToc: false,\n },\n header: {\n /**\n * 标题的样式:\n * - default 默认样式,标题前面有锚点\n * - autonumber 标题前面有自增序号锚点\n * - none 标题没有锚点\n */\n anchorStyle: 'default',\n },\n },\n },\n editor: {\n id: 'code', // textarea 的id属性值\n name: 'code', // textarea 的name属性值\n autoSave2Textarea: false, // 是否自动将编辑区的内容回写到textarea里\n theme: 'default', // depend on codemirror theme name: https://codemirror.net/demo/theme.htm\n // 编辑器的高度,默认100%,如果挂载点存在内联设置的height则以内联样式为主\n height: '100%',\n // defaultModel 编辑器初始化后的默认模式,一共有三种模式:1、双栏编辑预览模式;2、纯编辑模式;3、预览模式\n // edit&preview: 双栏编辑预览模式\n // editOnly: 纯编辑模式(没有预览,可通过toolbar切换成双栏或预览模式)\n // previewOnly: 预览模式(没有编辑框,toolbar只显示“返回编辑”按钮,可通过toolbar切换成编辑模式)\n defaultModel: 'edit&preview',\n // 粘贴时是否自动将html转成markdown\n convertWhenPaste: true,\n codemirror: {\n // 是否自动focus 默认为true\n autofocus: true,\n },\n writingStyle: 'normal', // 书写风格,normal 普通 | typewriter 打字机 | focus 专注,默认normal\n },\n toolbars: {\n theme: 'dark', // light or dark\n showToolbar: true, // false:不展示顶部工具栏; true:展示工具栏; toolbars.showToolbar=false 与 toolbars.toolbar=false 等效\n toolbar: [\n 'bold',\n 'italic',\n 'strikethrough',\n '|',\n 'color',\n 'header',\n 'ruby',\n '|',\n 'list',\n 'panel',\n // 'justify', // 对齐方式,默认不推荐这么“复杂”的样式要求\n 'detail',\n {\n insert: [\n 'image',\n 'audio',\n 'video',\n 'link',\n 'hr',\n 'br',\n 'code',\n 'formula',\n 'toc',\n 'table',\n 'line-table',\n 'bar-table',\n 'pdf',\n 'word',\n ],\n },\n 'graph',\n 'settings',\n ],\n toolbarRight: [],\n sidebar: [],\n bubble: ['bold', 'italic', 'underline', 'strikethrough', 'sub', 'sup', 'quote', '|', 'size', 'color'], // array or false\n float: ['h1', 'h2', 'h3', '|', 'checklist', 'quote', 'table', 'code'], // array or false\n },\n // 打开draw.io编辑页的url,如果为空则drawio按钮失效\n drawioIframeUrl: '',\n // 上传文件的回调\n fileUpload: callbacks.fileUpload,\n /**\n * 上传文件的时候用来指定文件类型\n */\n fileTypeLimitMap: {\n video: 'video/*',\n audio: 'audio/*',\n image: 'image/*',\n word: '.doc,.docx',\n pdf: '.pdf',\n file: '*',\n },\n callback: {\n afterChange: callbacks.afterChange,\n afterInit: callbacks.afterInit,\n beforeImageMounted: callbacks.beforeImageMounted,\n // 预览区域点击事件,previewer.enablePreviewerBubble = true 时生效\n onClickPreview: callbacks.onClickPreview,\n // 复制代码块代码时的回调\n onCopyCode: callbacks.onCopyCode,\n // 把中文变成拼音的回调,当然也可以把中文变成英文、英文变成中文\n changeString2Pinyin: callbacks.changeString2Pinyin,\n },\n previewer: {\n dom: false,\n className: 'cherry-markdown',\n // 是否启用预览区域编辑能力(目前支持编辑图片尺寸、编辑表格内容)\n enablePreviewerBubble: true,\n /**\n * 配置图片懒加载的逻辑\n * - 如果不希望图片懒加载,可配置成 lazyLoadImg = {noLoadImgNum: -1}\n * - 如果希望所有图片都无脑懒加载,可配置成 lazyLoadImg = {noLoadImgNum: 0, autoLoadImgNum: -1}\n * - 如果一共有15张图片,希望:\n * 1、前5张图片(1~5)直接加载;\n * 2、后5张图片(6~10)不论在不在视区内,都无脑懒加载;\n * 3、其他图片(11~15)在视区内时,进行懒加载;\n * 则配置应该为:lazyLoadImg = {noLoadImgNum: 5, autoLoadImgNum: 5}\n */\n lazyLoadImg: {\n // 加载图片时如果需要展示loading图,则配置loading图的地址\n loadingImgPath: '',\n // 同一时间最多有几个图片请求,最大同时加载6张图片\n maxNumPerTime: 2,\n // 不进行懒加载处理的图片数量,如果为0,即所有图片都进行懒加载处理, 如果设置为-1,则所有图片都不进行懒加载处理\n noLoadImgNum: 5,\n // 首次自动加载几张图片(不论图片是否滚动到视野内),autoLoadImgNum = -1 表示会自动加载完所有图片\n autoLoadImgNum: 5,\n // 针对加载失败的图片 或 beforeLoadOneImgCallback 返回false 的图片,最多尝试加载几次,为了防止死循环,最多5次。以图片的src为纬度统计重试次数\n maxTryTimesPerSrc: 2,\n // 加载一张图片之前的回调函数,函数return false 会终止加载操作\n beforeLoadOneImgCallback: (img) => {\n return true;\n },\n // 加载一张图片失败之后的回调函数\n failLoadOneImgCallback: (img) => {},\n // 加载一张图片之后的回调函数,如果图片加载失败,则不会回调该函数\n afterLoadOneImgCallback: (img) => {},\n // 加载完所有图片后调用的回调函数\n afterLoadAllImgCallback: () => {},\n },\n },\n /**\n * 配置主题,第三方可以自行扩展主题\n */\n theme: [\n { className: 'default', label: '默认' },\n { className: 'dark', label: '暗黑' },\n { className: 'light', label: '明亮' },\n { className: 'green', label: '清新' },\n { className: 'red', label: '热情' },\n { className: 'violet', label: '淡雅' },\n ],\n // 预览页面不需要绑定事件\n isPreviewOnly: false,\n // 预览区域跟随编辑器光标自动滚动\n autoScrollByCursor: true,\n // 外层容器不存在时,是否强制输出到body上\n forceAppend: true,\n // The locale Cherry is going to use. Locales live in /src/locales/\n locale: 'zh_CN',\n};\n\nexport default cloneDeep(defaultConfig);\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport default {\n bold: '加粗', // 加粗\n code: '代码', // 代码\n graph: '画图', // 画图\n h1: '一级标题', // 一级标题\n h2: '二级标题', // 二级标题\n h3: '三级标题', // 三级标题\n h4: '四级标题', // 四级标题\n h5: '五级标题', // 五级标题\n header: '标题', // 标题\n insert: '插入', // 插入\n italic: '斜体', // 斜体\n list: '列表', // 列表\n quickTable: '表格', // 表格\n quote: '引用', // 引用\n size: '大小', // 大小\n color: '文字颜色&背景', // 文字颜色&背景\n strikethrough: '删除线', // 删除线\n sub: '下标', // 下标\n sup: '上标', // 上标\n togglePreview: '预览', // 预览\n fullScreen: '全屏', // 全屏\n image: '图片', // 图片\n audio: '音频', // 音频\n video: '视频', // 视频\n link: '超链接', // 超链接\n hr: '分隔线', // 分隔线\n br: '换行', // 换行\n toc: '目录', // 目录\n pdf: 'pdf', // pdf\n word: 'word', // word\n table: '表格', // 表格\n 'line-table': '折线表格', // 折线表格\n 'bar-table': '柱状表格', // 柱状表格\n formula: '公式', // 公式\n insertFormula: '公式', // 公式\n insertFlow: '流程图', // 流程图\n insertSeq: '时序图', // 时序图\n insertState: '状态图', // 状态图\n insertClass: '类图', // 类图\n insertPie: '饼图', // 饼图\n insertGantt: '甘特图', // 甘特图\n checklist: '清单', // 清单\n ol: '有序列表', // 有序列表\n ul: '无序列表', // 无序列表\n undo: '撤销', // 撤销\n redo: '恢复', // 恢复\n previewClose: '关闭预览', // 关闭预览\n codeTheme: '代码主题', // 代码主题\n switchModel: '模式切换', // 模式切换\n switchPreview: '预览', // 预览\n switchEdit: '返回编辑', // 返回编辑\n classicBr: '经典换行', // 经典换行\n normalBr: '常规换行', // 常规换行\n settings: '设置', // 设置\n mobilePreview: '移动端预览', // 移动端预览\n copy: '复制内容', // 复制内容\n export: '导出', // 导出PDF、长图\n underline: '下划线', // 下划线\n pinyin: '拼音', // 拼音\n file: '文件',\n pastePlain: '粘贴为纯文本格式', // 粘贴为纯文本格式\n pasteMarkdown: '粘贴为markdown格式', // 粘贴为markdown格式\n hide: '隐藏(ctrl+0)', // 隐藏(ctrl+0)\n exportToPdf: '导出PDF', // 导出PDF\n exportScreenshot: '导出长图', // 导出长图\n exportMarkdownFile: '导出markdown', // 导出markdown文件\n exportHTMLFile: '导出html', // 导出预览区html文件\n theme: '主题', // 导出长图\n panel: '面板', // 导出长图\n detail: '手风琴', // 手风琴\n 'H1 Heading': 'H1 一级标题',\n 'H2 Heading': 'H2 二级标题',\n 'H3 Heading': 'H3 三级标题',\n complement: '续写',\n summary: '总结',\n};\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport default {\n bold: 'Bold',\n code: 'Code',\n graph: 'Graph',\n h1: 'Heading 1',\n h2: 'Heading 2',\n h3: 'Heading 3',\n h4: 'Heading 4',\n h5: 'Heading 5',\n header: 'Header',\n insert: 'Insert',\n italic: 'Italic',\n list: 'List',\n quickTable: 'Quick Table',\n quote: 'Quote',\n size: 'Size',\n color: 'Text Color & Background',\n strikethrough: 'Strikethrough',\n sub: 'Sub',\n sup: 'Sup',\n togglePreview: 'Toggle Preview',\n fullScreen: 'Full Screen',\n image: 'Image',\n audio: 'Audio',\n video: 'Video',\n link: 'Link',\n hr: 'Horizontal Rule',\n br: 'New Line',\n toc: 'Table Of Content',\n pdf: 'PDF',\n word: 'Word',\n table: 'Table',\n 'line-table': 'Line Table',\n 'bar-table': 'Bar Table',\n formula: 'Formula',\n insertFormula: 'Insert Formula',\n insertFlow: 'Insert Flow',\n insertSeq: 'Insert Seq',\n insertState: 'Insert State',\n insertClass: 'Insert Class',\n insertPie: 'Insert Pie',\n insertGantt: 'Insert Gantt',\n checklist: 'Checklist',\n ol: 'Ordered List',\n ul: 'Unordered List',\n undo: 'Undo',\n redo: 'Redo',\n previewClose: 'Preview Close',\n codeTheme: 'Code Theme',\n switchModel: 'Switch Model',\n switchPreview: 'Switch Preview',\n switchEdit: 'Switch Edit',\n classicBr: 'Classic New Line',\n normalBr: 'Normal New Line',\n settings: 'Settings',\n mobilePreview: 'Mobile Preview',\n copy: 'Copy',\n export: 'Export',\n underline: 'Underline',\n pinyin: 'Pinyin',\n pastePlain: 'Paste as Plain Text',\n pasteMarkdown: 'Paste as Markdown',\n hide: 'Hide (ctrl+0)',\n exportToPdf: 'Export to PDF',\n exportScreenshot: 'Screenshot',\n exportMarkdownFile: 'Export Markdown File',\n exportHTMLFile: 'Export preview HTML File',\n 'H1 Heading': 'H1 Heading',\n 'H2 Heading': 'H1 Heading',\n 'H3 Heading': 'H1 Heading',\n complement: 'Complement',\n summary: 'Summary',\n};\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport zhCn from './zh_CN';\nimport enUs from './en_US';\n\nexport default {\n zh_CN: zhCn,\n en_US: enUs,\n};\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport SyntaxBase, { HOOKS_TYPE_LIST } from './core/SyntaxBase';\nimport ParagraphBase from './core/ParagraphBase';\nimport MenuBase from './toolbars/MenuBase';\n\nfunction filterOptions(options, whiteList, propTypes) {\n const filteredOptions = {};\n Object.keys(options).forEach((key) => {\n if (whiteList.indexOf(key) === -1) {\n return;\n }\n if (typeof propTypes === 'object') {\n if (typeof propTypes[key] === 'string') {\n if (typeof options[key] === propTypes[key]) {\n filteredOptions[key] = options[key];\n }\n } else {\n if (options[key] instanceof propTypes[key]) {\n filteredOptions[key] = options[key];\n }\n }\n } else if (typeof propTypes === 'string') {\n if (typeof options[key] === propTypes) {\n filteredOptions[key] = options[key];\n }\n }\n });\n return filteredOptions;\n}\n\nexport function createSyntaxHook(name, type, options) {\n const BaseClass = type === HOOKS_TYPE_LIST.PAR ? ParagraphBase : SyntaxBase;\n const optionsWhiteList = ['beforeMakeHtml', 'makeHtml', 'afterMakeHtml', 'rule', 'test'];\n const filteredOptions = filterOptions(options, optionsWhiteList, 'function');\n const paragraphConfig = { needCache: options.needCache, defaultCache: options.defaultCache };\n return class CustomSyntax extends BaseClass {\n static HOOK_NAME = name;\n\n constructor(editorConfig = {}) {\n if (type === HOOKS_TYPE_LIST.PAR) {\n super({ needCache: !!paragraphConfig.needCache, defaultCache: paragraphConfig.defaultCache });\n } else {\n super();\n }\n\n this.config = editorConfig.config;\n }\n\n beforeMakeHtml(...args) {\n if (filteredOptions.beforeMakeHtml) {\n return filteredOptions.beforeMakeHtml.apply(this, args);\n }\n return super.beforeMakeHtml(...args);\n }\n\n makeHtml(...args) {\n if (filteredOptions.makeHtml) {\n return filteredOptions.makeHtml.apply(this, args);\n }\n return super.makeHtml(...args);\n }\n\n afterMakeHtml(...args) {\n if (filteredOptions.afterMakeHtml) {\n return filteredOptions.afterMakeHtml.apply(this, args);\n }\n return super.afterMakeHtml(...args);\n }\n\n test(...args) {\n if (filteredOptions.test) {\n return filteredOptions.test.apply(this, args);\n }\n return super.test(...args);\n }\n\n rule(...args) {\n if (filteredOptions.rule) {\n return filteredOptions.rule.apply(this, args);\n }\n return super.rule(...args);\n }\n };\n}\n\nexport function createMenuHook(name, options) {\n const optionsWhiteList = ['subMenuConfig', 'onClick', 'shortcutKeys', 'iconName'];\n const propTypes = {\n subMenuConfig: Array,\n onClick: 'function',\n shortcutKeys: Array,\n iconName: 'string',\n };\n const filteredOptions = filterOptions(options, optionsWhiteList, propTypes);\n return class CustomMenu extends MenuBase {\n constructor(editorInstance) {\n super(editorInstance);\n if (!filteredOptions.iconName) {\n this.noIcon = true;\n }\n this.setName(name, filteredOptions.iconName);\n this.subMenuConfig = filteredOptions.subMenuConfig || [];\n }\n\n onClick(...args) {\n if (filteredOptions.onClick) {\n return filteredOptions.onClick.apply(this, args);\n }\n return super.onClick(...args);\n }\n\n get shortcutKeys() {\n if (filteredOptions.shortcutKeys) {\n return filteredOptions.shortcutKeys;\n }\n return [];\n }\n };\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * 本文件主要维护导出Cherry时需要附加在Cherry对象上的静态属性集合\n * 所有的具名导出都会挂载在Cherry或CherryEngine上\n */\nimport { HOOKS_TYPE_LIST } from './core/SyntaxBase';\nimport { createSyntaxHook, createMenuHook } from './Factory';\nimport { isBrowser } from './utils/env';\n\nconst constants = { HOOKS_TYPE_LIST };\n\nconst plugins = {};\nconst nodeIgnorePlugin = [];\n\nif (!isBrowser()) {\n nodeIgnorePlugin.forEach((key) => {\n delete plugins[key];\n });\n}\n\nconst VERSION = `${process.env.BUILD_VERSION}`;\n\nexport class CherryStatic {\n static createSyntaxHook = createSyntaxHook;\n static createMenuHook = createMenuHook;\n static constants = constants;\n static VERSION = VERSION;\n /**\n * @this {typeof import('./Cherry').default | typeof CherryStatic}\n * @param {{ install: (defaultConfig: any, ...args: any[]) => void }} PluginClass 插件Class\n * @param {...any} args 初始化插件的参数\n * @returns\n */\n static usePlugin(PluginClass, ...args) {\n if (this === CherryStatic) {\n throw new Error('`usePlugin` is not allowed to called through CherryStatic class.');\n }\n // @ts-ignore\n if (this.initialized) {\n throw new Error('The function `usePlugin` should be called before Cherry is instantiated.');\n }\n // @ts-ignore\n if (PluginClass.$cherry$mounted === true) {\n return;\n }\n // @ts-ignore\n PluginClass.install.apply(PluginClass, [this.config.defaults, ...args]);\n // @ts-ignore\n PluginClass.$cherry$mounted = true;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport mergeWith from 'lodash/mergeWith';\nimport Editor from './Editor';\nimport Engine from './Engine';\nimport Previewer from './Previewer';\nimport Bubble from './toolbars/Bubble';\nimport FloatMenu from './toolbars/FloatMenu';\nimport Toolbar from './toolbars/Toolbar';\nimport { createElement } from './utils/dom';\nimport Sidebar from './toolbars/Sidebar';\nimport { customizer, getThemeFromLocal, changeTheme } from './utils/config';\nimport NestedError, { $expectTarget } from './utils/error';\nimport getPosBydiffs from './utils/recount-pos';\nimport defaultConfig from './Cherry.config';\nimport './sass/cherry.scss';\nimport cloneDeep from 'lodash/cloneDeep';\nimport Event from './Event';\nimport locales from '@/locales/index';\n\nimport { urlProcessorProxy } from './UrlCache';\nimport { CherryStatic } from './CherryStatic';\n\n/** @typedef {import('~types/cherry').CherryOptions} CherryOptions */\nexport default class Cherry extends CherryStatic {\n /**\n * @protected\n */\n static initialized = false;\n /**\n * @readonly\n */\n static config = {\n /** @type {Partial} */\n defaults: defaultConfig,\n };\n\n /**\n * @param {Partial} options\n */\n constructor(options) {\n super();\n Cherry.initialized = true;\n const defaultConfigCopy = cloneDeep(Cherry.config.defaults);\n this.defaultToolbar = defaultConfigCopy.toolbars.toolbar;\n $expectTarget(options, Object);\n /**\n * @property\n * @type {Partial}\n */\n this.options = mergeWith({}, defaultConfigCopy, options, customizer);\n\n // loading the locale\n this.locale = locales[this.options.locale];\n\n if (typeof this.options.engine.global.urlProcessor === 'function') {\n this.options.engine.global.urlProcessor = urlProcessorProxy(this.options.engine.global.urlProcessor);\n }\n\n this.status = {\n toolbar: 'show',\n previewer: 'show',\n editor: 'show',\n };\n\n if (this.options.isPreviewOnly || this.options.editor.defaultModel === 'previewOnly') {\n this.options.toolbars.showToolbar = false;\n this.options.editor.defaultModel = 'previewOnly';\n this.status.editor = 'hide';\n this.status.toolbar = 'hide';\n }\n\n /**\n * @property\n * @type {string} 实例ID\n */\n this.instanceId = `cherry-${new Date().getTime()}${Math.random()}`;\n this.options.instanceId = this.instanceId;\n\n /**\n * @private\n * @type {Engine}\n */\n this.engine = new Engine(this.options, this);\n this.init();\n }\n\n /**\n * 初始化工具栏、编辑区、预览区等\n * @private\n */\n init() {\n let mountEl = this.options.id ? document.getElementById(this.options.id) : this.options.el;\n\n if (!mountEl) {\n if (!this.options.forceAppend) {\n return false;\n }\n mountEl = document.createElement('div');\n mountEl.id = this.options.id || 'cherry-markdown';\n document.body.appendChild(mountEl);\n }\n\n if (!mountEl.style.height) {\n mountEl.style.height = this.options.editor.height;\n }\n this.cherryDom = mountEl;\n\n // 蒙层dom,用来拖拽编辑区&预览区宽度时展示蒙层\n const wrapperDom = this.createWrapper();\n // 创建编辑区\n const editor = this.createEditor();\n // 创建预览区\n const previewer = this.createPreviewer();\n\n if (this.options.toolbars.showToolbar === false || this.options.toolbars.toolbar === false) {\n // 即便配置了不展示工具栏,也要让工具栏加载对应的语法hook\n wrapperDom.classList.add('cherry--no-toolbar');\n this.options.toolbars.toolbar = this.defaultToolbar;\n }\n $expectTarget(this.options.toolbars.toolbar, Array);\n // 创建顶部工具栏\n this.toolbar = this.createToolbar();\n\n const wrapperFragment = document.createDocumentFragment();\n wrapperFragment.appendChild(this.toolbar.options.dom);\n wrapperFragment.appendChild(editor.options.editorDom);\n // 创建预览区域的侧边工具栏\n this.createSidebar(wrapperFragment);\n if (!this.options.previewer.dom) {\n wrapperFragment.appendChild(previewer.options.previewerDom);\n }\n wrapperFragment.appendChild(previewer.options.virtualDragLineDom);\n wrapperFragment.appendChild(previewer.options.editorMaskDom);\n wrapperFragment.appendChild(previewer.options.previewerMaskDom);\n\n wrapperDom.appendChild(wrapperFragment);\n mountEl.appendChild(wrapperDom);\n\n editor.init(previewer);\n // 创建bubble工具栏,所谓bubble工具栏,是指在编辑区选中文本时悬浮出现的工具栏\n this.createBubble();\n // 创建float工具栏,所谓float工具栏,是指当编辑区光标处于新行时,在行内联想出的工具栏\n this.createFloatMenu();\n previewer.init(editor);\n\n previewer.registerAfterUpdate(this.engine.mounted.bind(this.engine));\n\n // default value init\n this.initText(editor.editor);\n\n // 切换模式,有纯预览模式、纯编辑模式、双栏编辑模式\n this.switchModel(this.options.editor.defaultModel);\n\n Event.on(this.instanceId, Event.Events.toolbarHide, () => {\n this.status.toolbar = 'hide';\n });\n Event.on(this.instanceId, Event.Events.toolbarShow, () => {\n this.status.toolbar = 'show';\n });\n Event.on(this.instanceId, Event.Events.previewerClose, () => {\n this.status.previewer = 'hide';\n });\n Event.on(this.instanceId, Event.Events.previewerOpen, () => {\n this.status.previewer = 'show';\n });\n Event.on(this.instanceId, Event.Events.editorClose, () => {\n this.status.editor = 'hide';\n // 关闭编辑区时,需要清除所有高亮\n this.previewer.highlightLine(0);\n });\n Event.on(this.instanceId, Event.Events.editorOpen, () => {\n this.status.editor = 'show';\n });\n }\n\n /**\n * 切换编辑模式\n * @param {'edit&preview'|'editOnly'|'previewOnly'} model 模式类型\n * 一般纯预览模式和纯编辑模式适合在屏幕较小的终端使用,比如手机移动端\n *\n * @returns\n */\n switchModel(model = 'edit&preview') {\n switch (model) {\n case 'edit&preview':\n if (this.previewer) {\n this.previewer.editOnly(true);\n this.previewer.recoverPreviewer();\n }\n if (this.toolbar) {\n this.toolbar.showToolbar();\n }\n break;\n case 'editOnly':\n if (!this.previewer.isPreviewerHidden()) {\n this.previewer.editOnly(true);\n }\n if (this.toolbar) {\n this.toolbar.showToolbar();\n }\n break;\n case 'previewOnly':\n this.previewer.previewOnly();\n this.toolbar && this.toolbar.previewOnly();\n break;\n }\n }\n\n /**\n * 获取实例id\n * @returns {string}\n * @public\n */\n getInstanceId() {\n return this.instanceId;\n }\n\n /**\n * 获取编辑器状态\n * @returns {Object}\n */\n getStatus() {\n return this.status;\n }\n\n /**\n * 获取编辑区内的markdown源码内容\n * @returns markdown源码内容\n */\n getValue() {\n return this.editor.editor.getValue();\n }\n\n /**\n * 获取编辑区内的markdown源码内容\n * @returns markdown源码内容\n */\n getMarkdown() {\n return this.getValue();\n }\n\n /**\n * 获取CodeMirror实例\n * @returns CodeMirror实例\n */\n getCodeMirror() {\n return this.editor.editor;\n }\n\n /**\n * 获取预览区内的html内容\n * @param {boolean} wrapTheme 是否在外层包裹主题class\n * @returns html内容\n */\n getHtml(wrapTheme = true) {\n return this.previewer.getValue(wrapTheme);\n }\n\n getPreviewer() {\n return this.previewer;\n }\n\n /**\n * 获取目录,目录由head1~6组成\n * @returns 标题head数组\n */\n getToc() {\n const str = this.getHtml();\n /** @type {({level: number;id: string;text: string})[]} */\n const headerList = [];\n const headerRegex = /(.+?)<\\/h[0-6]>/g;\n str.replace(headerRegex, (match, level, id, text) => {\n headerList.push({ level: +level, id, text });\n return match;\n });\n return headerList;\n }\n\n /**\n * 覆盖编辑区的内容\n * @param {string} content markdown内容\n * @param {boolean} keepCursor 是否保持光标位置\n * @returns\n */\n setValue(content, keepCursor = false) {\n if (keepCursor === false) {\n return this.editor.editor.setValue(content);\n }\n const codemirror = this.editor.editor;\n const old = this.getValue();\n const pos = codemirror.getDoc().indexFromPos(codemirror.getCursor());\n const newPos = getPosBydiffs(pos, old, content);\n const ret = codemirror.setValue(content);\n const cursor = codemirror.getDoc().posFromIndex(newPos);\n codemirror.setCursor(cursor);\n return ret;\n }\n\n /**\n * 在光标处或者指定行+偏移量插入内容\n * @param {string} content 被插入的文本\n * @param {boolean} [isSelect=false] 是否选中刚插入的内容\n * @param {[number, number]|false} [anchor=false] [x,y] 代表x+1行,y+1字符偏移量,默认false 会从光标处插入\n * @param {boolean} [focus=true] 保持编辑器处于focus状态\n * @returns\n */\n insert(content, isSelect = false, anchor = false, focus = true) {\n if (anchor) {\n this.editor.editor.setSelection({ line: anchor[0], ch: anchor[1] }, { line: anchor[0], ch: anchor[1] });\n }\n const ret = this.editor.editor.replaceSelection(content, isSelect ? 'around' : 'end');\n focus && this.editor.editor.focus();\n return ret;\n }\n\n /**\n * 在光标处或者指定行+偏移量插入内容\n * @param {string} content 被插入的文本\n * @param {boolean} [isSelect=false] 是否选中刚插入的内容\n * @param {[number, number]|false} [anchor=false] [x,y] 代表x+1行,y+1字符偏移量,默认false 会从光标处插入\n * @param {boolean} [focus=true] 保持编辑器处于focus状态\n * @returns\n */\n insertValue(content, isSelect = false, anchor = false, focus = true) {\n return this.insert(content, isSelect, anchor, focus);\n }\n\n /**\n * 强制重新渲染预览区域\n */\n refreshPreviewer() {\n try {\n const markdownText = this.getValue();\n const html = this.engine.makeHtml(markdownText);\n this.previewer.refresh(html);\n } catch (e) {\n throw new NestedError(e);\n }\n }\n\n /**\n * 覆盖编辑区的内容\n * @param {string} content markdown内容\n * @param {boolean} keepCursor 是否保持光标位置\n * @returns\n */\n setMarkdown(content, keepCursor = false) {\n return this.setValue(content, keepCursor);\n }\n\n /**\n * @private\n * @returns\n */\n createWrapper() {\n const toolbarTheme = this.options.toolbars.theme === 'dark' ? 'dark' : '';\n // TODO: 完善类型\n const inlineCodeTheme = /** @type {{theme?: string;}} */ (this.options.engine.syntax.inlineCode).theme;\n let codeBlockTheme = /** @type {{theme?: string;}} */ (this.options.engine.syntax.codeBlock).theme;\n if (codeBlockTheme === 'dark') codeBlockTheme = 'tomorrow-night';\n else if (codeBlockTheme === 'light') codeBlockTheme = 'solarized-light';\n const wrapperDom = createElement('div', ['cherry', 'clearfix', getThemeFromLocal(true)].join(' '), {\n 'data-toolbarTheme': toolbarTheme,\n 'data-inlineCodeTheme': inlineCodeTheme,\n 'data-codeBlockTheme': codeBlockTheme,\n });\n this.wrapperDom = wrapperDom;\n return wrapperDom;\n }\n\n /**\n * @private\n * @returns {Toolbar}\n */\n createToolbar() {\n const dom = createElement('div', 'cherry-toolbar');\n this.toolbar = new Toolbar({\n dom,\n $cherry: this,\n buttonRightConfig: this.options.toolbars.toolbarRight,\n buttonConfig: this.options.toolbars.toolbar,\n customMenu: this.options.toolbars.customMenu,\n });\n return this.toolbar;\n }\n\n /**\n * @private\n * @returns\n */\n createSidebar(wrapperFragment) {\n if (this.options.toolbars.sidebar) {\n $expectTarget(this.options.toolbars.sidebar, Array);\n const externalClass = this.options.toolbars.theme === 'dark' ? 'dark' : '';\n const dom = createElement('div', `cherry-sidebar ${externalClass}`);\n this.sidebar = new Sidebar({\n dom,\n $cherry: this,\n buttonConfig: this.options.toolbars.sidebar,\n customMenu: this.options.toolbars.customMenu,\n });\n wrapperFragment.appendChild(this.sidebar.options.dom);\n }\n }\n\n /**\n * @private\n * @returns\n */\n createFloatMenu() {\n if (this.options.toolbars.float) {\n const dom = createElement('div', 'cherry-floatmenu');\n $expectTarget(this.options.toolbars.float, Array);\n this.floatMenu = new FloatMenu({\n dom,\n $cherry: this,\n buttonConfig: this.options.toolbars.float,\n customMenu: this.options.toolbars.customMenu,\n });\n }\n }\n\n /**\n * @private\n * @returns\n */\n createBubble() {\n if (this.options.toolbars.bubble) {\n const dom = createElement('div', 'cherry-bubble');\n $expectTarget(this.options.toolbars.bubble, Array);\n this.bubble = new Bubble({\n dom,\n $cherry: this,\n buttonConfig: this.options.toolbars.bubble,\n customMenu: this.options.toolbars.customMenu,\n engine: this.engine,\n });\n }\n }\n\n /**\n * @private\n * @returns {import('@/Editor').default}\n */\n createEditor() {\n const textArea = createElement('textarea', '', {\n id: this.options.editor.id ?? 'code',\n name: this.options.editor.name ?? 'code',\n });\n textArea.textContent = this.options.value;\n const editor = createElement('div', 'cherry-editor');\n editor.appendChild(textArea);\n\n this.editor = new Editor({\n $cherry: this,\n editorDom: editor,\n wrapperDom: this.wrapperDom,\n value: this.options.value,\n onKeydown: this.fireShortcutKey.bind(this),\n onChange: this.editText.bind(this),\n toolbars: this.options.toolbars,\n fileUpload: this.options.fileUpload,\n autoScrollByCursor: this.options.autoScrollByCursor,\n ...this.options.editor,\n });\n return this.editor;\n }\n\n /**\n * @private\n * @returns {import('@/Previewer').default}\n */\n createPreviewer() {\n /** @type {HTMLDivElement} */\n let previewer;\n const anchorStyle =\n (this.options.engine.syntax.header && this.options.engine.syntax.header.anchorStyle) || 'default';\n const autonumberClass = anchorStyle === 'autonumber' ? ' head-num' : '';\n const { className, dom, enablePreviewerBubble } = this.options.previewer;\n const previewerClassName = [\n 'cherry-previewer cherry-markdown',\n className || '',\n autonumberClass,\n getThemeFromLocal(true),\n ].join(' ');\n if (dom) {\n previewer = dom;\n previewer.className += ` ${previewerClassName}`;\n } else {\n previewer = createElement('div', previewerClassName);\n }\n const virtualDragLine = createElement('div', 'cherry-drag');\n const editorMask = createElement('div', 'cherry-editor-mask');\n const previewerMask = createElement('div', 'cherry-previewer-mask');\n\n this.previewer = new Previewer({\n $cherry: this,\n virtualDragLineDom: virtualDragLine,\n editorMaskDom: editorMask,\n previewerMaskDom: previewerMask,\n previewerDom: previewer,\n value: this.options.value,\n isPreviewOnly: this.options.isPreviewOnly,\n enablePreviewerBubble,\n lazyLoadImg: this.options.previewer.lazyLoadImg,\n });\n\n return this.previewer;\n }\n\n /**\n * @private\n * @param {import('codemirror').Editor} codemirror\n */\n initText(codemirror) {\n try {\n const markdownText = codemirror.getValue();\n const html = this.engine.makeHtml(markdownText);\n this.previewer.update(html);\n if (this.options.callback.afterInit) {\n this.options.callback.afterInit(markdownText, html);\n }\n } catch (e) {\n throw new NestedError(e);\n }\n }\n\n /**\n * @private\n * @param {Event} _evt\n * @param {import('codemirror').Editor} codemirror\n */\n editText(_evt, codemirror) {\n try {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this.timer = setTimeout(() => {\n const markdownText = codemirror.getValue();\n const html = this.engine.makeHtml(markdownText);\n this.previewer.update(html);\n if (this.options.callback.afterChange) {\n this.options.callback.afterChange(markdownText, html);\n }\n // 强制每次编辑(包括undo、redo)编辑器都会自动滚动到光标位置\n codemirror.scrollIntoView(null);\n }, 50);\n } catch (e) {\n throw new NestedError(e);\n }\n }\n\n /**\n * @private\n * @param {any} cb\n */\n onChange(cb) {\n this.editor.editor.on('change', (codeMirror) => {\n cb({\n markdown: codeMirror.getValue(), // 后续可以按需增加html或其他状态\n });\n });\n }\n\n /**\n * @private\n * @param {*} evt\n */\n fireShortcutKey(evt) {\n if (this.toolbar.matchShortcutKey(evt)) {\n // 快捷键\n evt.preventDefault();\n this.toolbar.fireShortcutKey(evt);\n }\n }\n\n /**\n * 导出预览区域内容\n * @public\n * @param {String} type 'pdf':导出成pdf文件; 'img':导出成图片\n */\n export(type = 'pdf') {\n this.previewer.export(type);\n }\n\n /**\n * 修改主题\n * @param {string} theme option.theme里的className\n */\n setTheme(theme = 'default') {\n changeTheme(this, theme);\n }\n\n /**\n * 修改书写风格\n * @param {string} writingStyle normal 普通 | typewriter 打字机 | focus 专注\n */\n setWritingStyle(writingStyle) {\n this.editor.setWritingStyle(writingStyle);\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Cherry from './Cherry';\n\nimport SyntaxHookBase from './core/SyntaxBase';\nimport MenuHookBase from './toolbars/MenuBase';\n\n// in browser\nif (window) {\n // @ts-ignore\n window.Cherry = Cherry;\n}\n\nexport { SyntaxHookBase, MenuHookBase };\n\nexport default Cherry;\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport mergeWith from 'lodash/mergeWith';\n\nconst DEFAULT_OPTIONS = {\n // TODO: themes\n theme: 'default',\n altFontFamily: 'sans-serif',\n fontFamily: 'sans-serif',\n themeCSS: '.label foreignObject { font-size: 90%; overflow: visible; } .label { font-family: sans-serif; }',\n flowchart: {\n useMaxWidth: false,\n },\n sequence: {\n useMaxWidth: false,\n },\n startOnLoad: false,\n logLevel: 5,\n // fontFamily: 'Arial, monospace'\n};\n\nexport default class MermaidCodeEngine {\n static TYPE = 'figure';\n\n static install(cherryOptions, ...args) {\n mergeWith(cherryOptions, {\n engine: {\n syntax: {\n codeBlock: {\n customRenderer: {\n mermaid: new MermaidCodeEngine(...args),\n },\n },\n },\n },\n });\n }\n\n mermaidAPIRefs = null;\n options = DEFAULT_OPTIONS;\n dom = null;\n mermaidCanvas = null;\n\n constructor(mermaidOptions = {}) {\n const { mermaid, mermaidAPI } = mermaidOptions;\n if (\n !mermaidAPI &&\n !window.mermaidAPI &&\n (!mermaid || !mermaid.mermaidAPI) &&\n (!window.mermaid || !window.mermaid.mermaidAPI)\n ) {\n throw new Error('code-block-mermaid-plugin[init]: Package mermaid or mermaidAPI not found.');\n }\n this.options = { ...DEFAULT_OPTIONS, ...(mermaidOptions || {}) };\n this.mermaidAPIRefs = mermaidAPI || window.mermaidAPI || mermaid.mermaidAPI || window.mermaid.mermaidAPI;\n delete this.options.mermaid;\n delete this.options.mermaidAPI;\n this.mermaidAPIRefs.initialize(this.options);\n }\n\n mountMermaidCanvas($engine) {\n if (this.mermaidCanvas && document.body.contains(this.mermaidCanvas)) {\n return;\n }\n this.mermaidCanvas = document.createElement('div');\n this.mermaidCanvas.style = 'width:1024px;opacity:0;position:fixed;top:100%;';\n const container = $engine.$cherry.wrapperDom || document.body;\n container.appendChild(this.mermaidCanvas);\n }\n\n /**\n * 转换svg为img,如果出错则直出svg\n * @param {string} svgCode\n * @param {string} graphId\n * @returns {string}\n */\n convertMermaidSvgToImg(svgCode, graphId) {\n const domParser = new DOMParser();\n let svgHtml;\n const injectSvgFallback = (svg) =>\n svg.replace('`;\n }\n } else {\n svgHtml = injectSvgFallback(svgCode);\n }\n } catch (e) {\n svgHtml = injectSvgFallback(svgCode);\n }\n return svgHtml;\n }\n\n render(src, sign, $engine, config = {}) {\n let $sign = sign;\n if (!$sign) {\n $sign = Math.round(Math.random() * 100000000);\n }\n this.mountMermaidCanvas($engine);\n let html;\n // 多实例的情况下相同的内容ID相同会导致mermaid渲染异常\n // 需要通过添加时间戳使得多次渲染相同内容的图像ID唯一\n // 图像渲染节流在CodeBlock Hook内部控制\n const graphId = `mermaid-${$sign}-${new Date().getTime()}`;\n this.svg2img = config?.svg2img ?? false;\n try {\n this.mermaidAPIRefs.render(\n graphId,\n src,\n (svgCode) => {\n const fixedSvg = svgCode\n .replace(/\\s*markerUnits=\"0\"/g, '')\n .replace(/\\s*x=\"NaN\"/g, '')\n .replace(/ /g, ' ');\n html = this.convertMermaidSvgToImg(fixedSvg, graphId);\n },\n this.mermaidCanvas,\n );\n } catch (e) {\n return e?.str;\n }\n return html;\n }\n}\n","// @ts-nocheck\n/*\n * $Id: rawdeflate.js,v 0.3 2009/03/01 19:05:05 dankogai Exp dankogai $\n *\n * Original:\n * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt\n */\n\n// if run as a web worker, respond to messages by deflating them\nconst deflate = (function () {\n /* Copyright (C) 1999 Masanao Izumo \n * Version: 1.0.1\n * LastModified: Dec 25 1999\n */\n\n /* Interface:\n * data = deflate(src);\n */\n\n /* constant parameters */\n const zip_WSIZE = 32768; // Sliding Window size\n const zip_STORED_BLOCK = 0;\n const zip_STATIC_TREES = 1;\n const zip_DYN_TREES = 2;\n\n /* for deflate */\n const zip_DEFAULT_LEVEL = 6;\n const zip_FULL_SEARCH = true;\n const zip_INBUFSIZ = 32768; // Input buffer size\n const zip_INBUF_EXTRA = 64; // Extra buffer\n const zip_OUTBUFSIZ = 1024 * 8;\n const zip_window_size = 2 * zip_WSIZE;\n const zip_MIN_MATCH = 3;\n const zip_MAX_MATCH = 258;\n const zip_BITS = 16;\n // for SMALL_MEM\n const zip_LIT_BUFSIZE = 0x2000;\n const zip_HASH_BITS = 13;\n // for MEDIUM_MEM\n // var zip_LIT_BUFSIZE = 0x4000;\n // var zip_HASH_BITS = 14;\n // for BIG_MEM\n // var zip_LIT_BUFSIZE = 0x8000;\n // var zip_HASH_BITS = 15;\n // if(zip_LIT_BUFSIZE > zip_INBUFSIZ)\n // alert(\"error: zip_INBUFSIZ is too small\");\n // if((zip_WSIZE<<1) > (1< zip_BITS-1)\n // alert(\"error: zip_HASH_BITS is too large\");\n // if(zip_HASH_BITS < 8 || zip_MAX_MATCH != 258)\n // alert(\"error: Code too clever\");\n const zip_DIST_BUFSIZE = zip_LIT_BUFSIZE;\n const zip_HASH_SIZE = 1 << zip_HASH_BITS;\n const zip_HASH_MASK = zip_HASH_SIZE - 1;\n const zip_WMASK = zip_WSIZE - 1;\n const zip_NIL = 0; // Tail of hash chains\n const zip_TOO_FAR = 4096;\n const zip_MIN_LOOKAHEAD = zip_MAX_MATCH + zip_MIN_MATCH + 1;\n const zip_MAX_DIST = zip_WSIZE - zip_MIN_LOOKAHEAD;\n const zip_SMALLEST = 1;\n const zip_MAX_BITS = 15;\n const zip_MAX_BL_BITS = 7;\n const zip_LENGTH_CODES = 29;\n const zip_LITERALS = 256;\n const zip_END_BLOCK = 256;\n const zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES;\n const zip_D_CODES = 30;\n const zip_BL_CODES = 19;\n const zip_REP_3_6 = 16;\n const zip_REPZ_3_10 = 17;\n const zip_REPZ_11_138 = 18;\n const zip_HEAP_SIZE = 2 * zip_L_CODES + 1;\n const zip_H_SHIFT = parseInt((zip_HASH_BITS + zip_MIN_MATCH - 1) / zip_MIN_MATCH);\n\n /* variables */\n let zip_free_queue;\n let zip_qhead;\n let zip_qtail;\n let zip_initflag;\n let zip_outbuf = null;\n let zip_outcnt;\n let zip_outoff;\n let zip_complete;\n let zip_window;\n let zip_d_buf;\n let zip_l_buf;\n let zip_prev;\n let zip_bi_buf;\n let zip_bi_valid;\n let zip_block_start;\n let zip_ins_h;\n let zip_hash_head;\n let zip_prev_match;\n let zip_match_available;\n let zip_match_length;\n let zip_prev_length;\n let zip_strstart;\n let zip_match_start;\n let zip_eofile;\n let zip_lookahead;\n let zip_max_chain_length;\n let zip_max_lazy_match;\n let zip_compr_level;\n let zip_good_match;\n let zip_nice_match;\n let zip_dyn_ltree;\n let zip_dyn_dtree;\n let zip_static_ltree;\n let zip_static_dtree;\n let zip_bl_tree;\n let zip_l_desc;\n let zip_d_desc;\n let zip_bl_desc;\n let zip_bl_count;\n let zip_heap;\n let zip_heap_len;\n let zip_heap_max;\n let zip_depth;\n let zip_length_code;\n let zip_dist_code;\n let zip_base_length;\n let zip_base_dist;\n let zip_flag_buf;\n let zip_last_lit;\n let zip_last_dist;\n let zip_last_flags;\n let zip_flags;\n let zip_flag_bit;\n let zip_opt_len;\n let zip_static_len;\n let zip_deflate_data;\n let zip_deflate_pos;\n\n /* objects (deflate) */\n\n function zip_DeflateCT() {\n this.fc = 0; // frequency count or bit string\n this.dl = 0; // father node in Huffman tree or length of bit string\n }\n\n function zip_DeflateTreeDesc() {\n this.dyn_tree = null; // the dynamic tree\n this.static_tree = null; // corresponding static tree or NULL\n this.extra_bits = null; // extra bits for each code or NULL\n this.extra_base = 0; // base index for extra_bits\n this.elems = 0; // max number of elements in the tree\n this.max_length = 0; // max bit length for the codes\n this.max_code = 0; // largest code with non zero frequency\n }\n\n /* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\n function zip_DeflateConfiguration(a, b, c, d) {\n this.good_length = a; // reduce lazy search above this match length\n this.max_lazy = b; // do not perform lazy search above this match length\n this.nice_length = c; // quit search above this match length\n this.max_chain = d;\n }\n\n function zip_DeflateBuffer() {\n this.next = null;\n this.len = 0;\n this.ptr = new Array(zip_OUTBUFSIZ);\n this.off = 0;\n }\n\n /* constant tables */\n const 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];\n const zip_extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13,\n ];\n const zip_extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\n const zip_bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n const zip_configuration_table = [\n new zip_DeflateConfiguration(0, 0, 0, 0),\n new zip_DeflateConfiguration(4, 4, 8, 4),\n new zip_DeflateConfiguration(4, 5, 16, 8),\n new zip_DeflateConfiguration(4, 6, 32, 32),\n new zip_DeflateConfiguration(4, 4, 16, 16),\n new zip_DeflateConfiguration(8, 16, 32, 32),\n new zip_DeflateConfiguration(8, 16, 128, 128),\n new zip_DeflateConfiguration(8, 32, 128, 256),\n new zip_DeflateConfiguration(32, 128, 258, 1024),\n new zip_DeflateConfiguration(32, 258, 258, 4096),\n ];\n\n /* routines (deflate) */\n\n function zip_deflate_start(level) {\n let i;\n\n if (!level) level = zip_DEFAULT_LEVEL;\n else if (level < 1) level = 1;\n else if (level > 9) level = 9;\n\n zip_compr_level = level;\n zip_initflag = false;\n zip_eofile = false;\n if (zip_outbuf != null) return;\n\n zip_free_queue = zip_qhead = zip_qtail = null;\n zip_outbuf = new Array(zip_OUTBUFSIZ);\n zip_window = new Array(zip_window_size);\n zip_d_buf = new Array(zip_DIST_BUFSIZE);\n zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA);\n zip_prev = new Array(1 << zip_BITS);\n zip_dyn_ltree = new Array(zip_HEAP_SIZE);\n for (i = 0; i < zip_HEAP_SIZE; i++) zip_dyn_ltree[i] = new zip_DeflateCT();\n zip_dyn_dtree = new Array(2 * zip_D_CODES + 1);\n for (i = 0; i < 2 * zip_D_CODES + 1; i++) zip_dyn_dtree[i] = new zip_DeflateCT();\n zip_static_ltree = new Array(zip_L_CODES + 2);\n for (i = 0; i < zip_L_CODES + 2; i++) zip_static_ltree[i] = new zip_DeflateCT();\n zip_static_dtree = new Array(zip_D_CODES);\n for (i = 0; i < zip_D_CODES; i++) zip_static_dtree[i] = new zip_DeflateCT();\n zip_bl_tree = new Array(2 * zip_BL_CODES + 1);\n for (i = 0; i < 2 * zip_BL_CODES + 1; i++) zip_bl_tree[i] = new zip_DeflateCT();\n zip_l_desc = new zip_DeflateTreeDesc();\n zip_d_desc = new zip_DeflateTreeDesc();\n zip_bl_desc = new zip_DeflateTreeDesc();\n zip_bl_count = new Array(zip_MAX_BITS + 1);\n zip_heap = new Array(2 * zip_L_CODES + 1);\n zip_depth = new Array(2 * zip_L_CODES + 1);\n zip_length_code = new Array(zip_MAX_MATCH - zip_MIN_MATCH + 1);\n zip_dist_code = new Array(512);\n zip_base_length = new Array(zip_LENGTH_CODES);\n zip_base_dist = new Array(zip_D_CODES);\n zip_flag_buf = new Array(parseInt(zip_LIT_BUFSIZE / 8));\n }\n\n function zip_deflate_end() {\n zip_free_queue = zip_qhead = zip_qtail = null;\n zip_outbuf = null;\n zip_window = null;\n zip_d_buf = null;\n zip_l_buf = null;\n zip_prev = null;\n zip_dyn_ltree = null;\n zip_dyn_dtree = null;\n zip_static_ltree = null;\n zip_static_dtree = null;\n zip_bl_tree = null;\n zip_l_desc = null;\n zip_d_desc = null;\n zip_bl_desc = null;\n zip_bl_count = null;\n zip_heap = null;\n zip_depth = null;\n zip_length_code = null;\n zip_dist_code = null;\n zip_base_length = null;\n zip_base_dist = null;\n zip_flag_buf = null;\n }\n\n function zip_reuse_queue(p) {\n p.next = zip_free_queue;\n zip_free_queue = p;\n }\n\n function zip_new_queue() {\n let p;\n\n if (zip_free_queue != null) {\n p = zip_free_queue;\n zip_free_queue = zip_free_queue.next;\n } else p = new zip_DeflateBuffer();\n p.next = null;\n p.len = p.off = 0;\n\n return p;\n }\n\n function zip_head1(i) {\n return zip_prev[zip_WSIZE + i];\n }\n\n function zip_head2(i, val) {\n return (zip_prev[zip_WSIZE + i] = val);\n }\n\n /* put_byte is used for the compressed output, put_ubyte for the\n * uncompressed output. However unlzw() uses window for its\n * suffix table instead of its output buffer, so it does not use put_ubyte\n * (to be cleaned up).\n */\n function zip_put_byte(c) {\n zip_outbuf[zip_outoff + zip_outcnt++] = c;\n if (zip_outoff + zip_outcnt == zip_OUTBUFSIZ) zip_qoutbuf();\n }\n\n /* Output a 16 bit value, lsb first */\n function zip_put_short(w) {\n w &= 0xffff;\n if (zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) {\n zip_outbuf[zip_outoff + zip_outcnt++] = w & 0xff;\n zip_outbuf[zip_outoff + zip_outcnt++] = w >>> 8;\n } else {\n zip_put_byte(w & 0xff);\n zip_put_byte(w >>> 8);\n }\n }\n\n /* ==========================================================================\n * Insert string s in the dictionary and set match_head to the previous head\n * of the hash chain (the most recent string with same hash key). Return\n * the previous length of the hash chain.\n * IN assertion: all calls to to INSERT_STRING are made with consecutive\n * input characters and the first MIN_MATCH bytes of s are valid\n * (except for the last MIN_MATCH-1 bytes of the input file).\n */\n function zip_INSERT_STRING() {\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + zip_MIN_MATCH - 1] & 0xff)) & zip_HASH_MASK;\n zip_hash_head = zip_head1(zip_ins_h);\n zip_prev[zip_strstart & zip_WMASK] = zip_hash_head;\n zip_head2(zip_ins_h, zip_strstart);\n }\n\n /* Send a code of the given tree. c and tree must not have side effects */\n function zip_SEND_CODE(c, tree) {\n zip_send_bits(tree[c].fc, tree[c].dl);\n }\n\n /* Mapping from a distance to a distance code. dist is the distance - 1 and\n * must not have side effects. dist_code[256] and dist_code[257] are never\n * used.\n */\n function zip_D_CODE(dist) {\n return (dist < 256 ? zip_dist_code[dist] : zip_dist_code[256 + (dist >> 7)]) & 0xff;\n }\n\n /* ==========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\n function zip_SMALLER(tree, n, m) {\n return tree[n].fc < tree[m].fc || (tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]);\n }\n\n /* ==========================================================================\n * read string data\n */\n function zip_read_buff(buff, offset, n) {\n let i;\n for (i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++)\n buff[offset + i] = zip_deflate_data.charCodeAt(zip_deflate_pos++) & 0xff;\n return i;\n }\n\n /* ==========================================================================\n * Initialize the \"longest match\" routines for a new file\n */\n function zip_lm_init() {\n let j;\n\n /* Initialize the hash table. */\n for (j = 0; j < zip_HASH_SIZE; j++)\n //\tzip_head2(j, zip_NIL);\n zip_prev[zip_WSIZE + j] = 0;\n /* prev will be initialized on the fly */\n\n /* Set the default configuration parameters:\n */\n zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy;\n zip_good_match = zip_configuration_table[zip_compr_level].good_length;\n if (!zip_FULL_SEARCH) zip_nice_match = zip_configuration_table[zip_compr_level].nice_length;\n zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain;\n\n zip_strstart = 0;\n zip_block_start = 0;\n\n zip_lookahead = zip_read_buff(zip_window, 0, 2 * zip_WSIZE);\n if (zip_lookahead <= 0) {\n zip_eofile = true;\n zip_lookahead = 0;\n return;\n }\n zip_eofile = false;\n /* Make sure that we always have enough lookahead. This is important\n * if input comes from a device such as a tty.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) zip_fill_window();\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but this is\n * not important since only literal bytes will be emitted.\n */\n zip_ins_h = 0;\n for (j = 0; j < zip_MIN_MATCH - 1; j++) {\n // UPDATE_HASH(ins_h, window[j]);\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[j] & 0xff)) & zip_HASH_MASK;\n }\n }\n\n /* ==========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n */\n function zip_longest_match(cur_match) {\n let chain_length = zip_max_chain_length; // max hash chain length\n let scanp = zip_strstart; // current string\n let matchp; // matched string\n let len; // length of current match\n let best_len = zip_prev_length; // best match length so far\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n const limit = zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL;\n\n const strendp = zip_strstart + zip_MAX_MATCH;\n let scan_end1 = zip_window[scanp + best_len - 1];\n let scan_end = zip_window[scanp + best_len];\n\n /* Do not waste too much time if we already have a good match: */\n if (zip_prev_length >= zip_good_match) chain_length >>= 2;\n\n // Assert(encoder->strstart <= window_size-MIN_LOOKAHEAD, \"insufficient lookahead\");\n\n do {\n // Assert(cur_match < encoder->strstart, \"no future\");\n matchp = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2:\n */\n if (\n zip_window[matchp + best_len] != scan_end ||\n zip_window[matchp + best_len - 1] != scan_end1 ||\n zip_window[matchp] != zip_window[scanp] ||\n zip_window[++matchp] != zip_window[scanp + 1]\n ) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scanp += 2;\n matchp++;\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {} while (\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n scanp < strendp\n );\n\n len = zip_MAX_MATCH - (strendp - scanp);\n scanp = strendp - zip_MAX_MATCH;\n\n if (len > best_len) {\n zip_match_start = cur_match;\n best_len = len;\n if (zip_FULL_SEARCH) {\n if (len >= zip_MAX_MATCH) break;\n } else {\n if (len >= zip_nice_match) break;\n }\n\n scan_end1 = zip_window[scanp + best_len - 1];\n scan_end = zip_window[scanp + best_len];\n }\n } while ((cur_match = zip_prev[cur_match & zip_WMASK]) > limit && --chain_length != 0);\n\n return best_len;\n }\n\n /* ==========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead, and sets eofile if end of input file.\n * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0\n * OUT assertions: at least one byte has been read, or eofile is set;\n * file reads are performed for at least two bytes (required for the\n * translate_eol option).\n */\n function zip_fill_window() {\n let n;\n let m;\n\n // Amount of free space at the end of the window.\n let more = zip_window_size - zip_lookahead - zip_strstart;\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (more == -1) {\n /* Very unlikely, but possible on 16 bit machine if strstart == 0\n * and lookahead == 1 (input done one byte at time)\n */\n more--;\n } else if (zip_strstart >= zip_WSIZE + zip_MAX_DIST) {\n /* By the IN assertion, the window is not empty so we can't confuse\n * more == 0 with more == 64K on a 16 bit machine.\n */\n //\tAssert(window_size == (ulg)2*WSIZE, \"no sliding with BIG_MEM\");\n\n //\tSystem.arraycopy(window, WSIZE, window, 0, WSIZE);\n for (n = 0; n < zip_WSIZE; n++) zip_window[n] = zip_window[n + zip_WSIZE];\n\n zip_match_start -= zip_WSIZE;\n zip_strstart -= zip_WSIZE; /* we now have strstart >= MAX_DIST: */\n zip_block_start -= zip_WSIZE;\n\n for (n = 0; n < zip_HASH_SIZE; n++) {\n m = zip_head1(n);\n zip_head2(n, m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL);\n }\n for (n = 0; n < zip_WSIZE; n++) {\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n m = zip_prev[n];\n zip_prev[n] = m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL;\n }\n more += zip_WSIZE;\n }\n // At this point, more >= 2\n if (!zip_eofile) {\n n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more);\n if (n <= 0) zip_eofile = true;\n else zip_lookahead += n;\n }\n }\n\n /* ==========================================================================\n * Processes a new input file and return its compressed length. This\n * function does not perform lazy evaluationof matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\n function zip_deflate_fast() {\n while (zip_lookahead != 0 && zip_qhead == null) {\n var flush; // set if current block must be flushed\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n zip_INSERT_STRING();\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (zip_hash_head != zip_NIL && zip_strstart - zip_hash_head <= zip_MAX_DIST) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n zip_match_length = zip_longest_match(zip_hash_head);\n /* longest_match() sets match_start */\n if (zip_match_length > zip_lookahead) zip_match_length = zip_lookahead;\n }\n if (zip_match_length >= zip_MIN_MATCH) {\n //\t check_match(strstart, match_start, match_length);\n\n flush = zip_ct_tally(zip_strstart - zip_match_start, zip_match_length - zip_MIN_MATCH);\n zip_lookahead -= zip_match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (zip_match_length <= zip_max_lazy_match) {\n zip_match_length--; // string at strstart already in hash table\n do {\n zip_strstart++;\n zip_INSERT_STRING();\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n * these bytes are garbage, but it does not matter since\n * the next lookahead bytes will be emitted as literals.\n */\n } while (--zip_match_length != 0);\n zip_strstart++;\n } else {\n zip_strstart += zip_match_length;\n zip_match_length = 0;\n zip_ins_h = zip_window[zip_strstart] & 0xff;\n //\t\tUPDATE_HASH(ins_h, window[strstart + 1]);\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK;\n\n // #if MIN_MATCH != 3\n //\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n // #endif\n }\n } else {\n /* No match, output a literal byte */\n flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff);\n zip_lookahead--;\n zip_strstart++;\n }\n if (flush) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) zip_fill_window();\n }\n }\n\n function zip_deflate_better() {\n /* Process the input block. */\n while (zip_lookahead != 0 && zip_qhead == null) {\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n zip_INSERT_STRING();\n\n /* Find the longest match, discarding those <= prev_length.\n */\n zip_prev_length = zip_match_length;\n zip_prev_match = zip_match_start;\n zip_match_length = zip_MIN_MATCH - 1;\n\n if (\n zip_hash_head != zip_NIL &&\n zip_prev_length < zip_max_lazy_match &&\n zip_strstart - zip_hash_head <= zip_MAX_DIST\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n zip_match_length = zip_longest_match(zip_hash_head);\n /* longest_match() sets match_start */\n if (zip_match_length > zip_lookahead) zip_match_length = zip_lookahead;\n\n /* Ignore a length 3 match if it is too distant: */\n if (zip_match_length == zip_MIN_MATCH && zip_strstart - zip_match_start > zip_TOO_FAR) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n zip_match_length--;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (zip_prev_length >= zip_MIN_MATCH && zip_match_length <= zip_prev_length) {\n var flush; // set if current block must be flushed\n\n //\t check_match(strstart - 1, prev_match, prev_length);\n flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match, zip_prev_length - zip_MIN_MATCH);\n\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted.\n */\n zip_lookahead -= zip_prev_length - 1;\n zip_prev_length -= 2;\n do {\n zip_strstart++;\n zip_INSERT_STRING();\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n * these bytes are garbage, but it does not matter since the\n * next lookahead bytes will always be emitted as literals.\n */\n } while (--zip_prev_length != 0);\n zip_match_available = 0;\n zip_match_length = zip_MIN_MATCH - 1;\n zip_strstart++;\n if (flush) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n } else if (zip_match_available != 0) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n if (zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n zip_strstart++;\n zip_lookahead--;\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n zip_match_available = 1;\n zip_strstart++;\n zip_lookahead--;\n }\n\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) zip_fill_window();\n }\n }\n\n function zip_init_deflate() {\n if (zip_eofile) return;\n zip_bi_buf = 0;\n zip_bi_valid = 0;\n zip_ct_init();\n zip_lm_init();\n\n zip_qhead = null;\n zip_outcnt = 0;\n zip_outoff = 0;\n\n if (zip_compr_level <= 3) {\n zip_prev_length = zip_MIN_MATCH - 1;\n zip_match_length = 0;\n } else {\n zip_match_length = zip_MIN_MATCH - 1;\n zip_match_available = 0;\n }\n\n zip_complete = false;\n }\n\n /* ==========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\n function zip_deflate_internal(buff, off, buff_size) {\n let n;\n\n if (!zip_initflag) {\n zip_init_deflate();\n zip_initflag = true;\n if (zip_lookahead == 0) {\n // empty\n zip_complete = true;\n return 0;\n }\n }\n\n if ((n = zip_qcopy(buff, off, buff_size)) == buff_size) return buff_size;\n\n if (zip_complete) return n;\n\n if (zip_compr_level <= 3)\n // optimized for speed\n zip_deflate_fast();\n else zip_deflate_better();\n if (zip_lookahead == 0) {\n if (zip_match_available != 0) zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff);\n zip_flush_block(1);\n zip_complete = true;\n }\n return n + zip_qcopy(buff, n + off, buff_size - n);\n }\n\n function zip_qcopy(buff, off, buff_size) {\n let n;\n let i;\n let j;\n\n n = 0;\n while (zip_qhead != null && n < buff_size) {\n i = buff_size - n;\n if (i > zip_qhead.len) i = zip_qhead.len;\n // System.arraycopy(qhead.ptr, qhead.off, buff, off + n, i);\n for (j = 0; j < i; j++) buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j];\n\n zip_qhead.off += i;\n zip_qhead.len -= i;\n n += i;\n if (zip_qhead.len == 0) {\n var p;\n p = zip_qhead;\n zip_qhead = zip_qhead.next;\n zip_reuse_queue(p);\n }\n }\n\n if (n == buff_size) return n;\n\n if (zip_outoff < zip_outcnt) {\n i = buff_size - n;\n if (i > zip_outcnt - zip_outoff) i = zip_outcnt - zip_outoff;\n // System.arraycopy(outbuf, outoff, buff, off + n, i);\n for (j = 0; j < i; j++) buff[off + n + j] = zip_outbuf[zip_outoff + j];\n zip_outoff += i;\n n += i;\n if (zip_outcnt == zip_outoff) zip_outcnt = zip_outoff = 0;\n }\n return n;\n }\n\n /* ==========================================================================\n * Allocate the match buffer, initialize the various tables and save the\n * location of the internal file attribute (ascii/binary) and method\n * (DEFLATE/STORE).\n */\n function zip_ct_init() {\n let n; // iterates over tree elements\n let bits; // bit counter\n let length; // length value\n let code; // code value\n let dist; // distance index\n\n if (zip_static_dtree[0].dl != 0) return; // ct_init already called\n\n zip_l_desc.dyn_tree = zip_dyn_ltree;\n zip_l_desc.static_tree = zip_static_ltree;\n zip_l_desc.extra_bits = zip_extra_lbits;\n zip_l_desc.extra_base = zip_LITERALS + 1;\n zip_l_desc.elems = zip_L_CODES;\n zip_l_desc.max_length = zip_MAX_BITS;\n zip_l_desc.max_code = 0;\n\n zip_d_desc.dyn_tree = zip_dyn_dtree;\n zip_d_desc.static_tree = zip_static_dtree;\n zip_d_desc.extra_bits = zip_extra_dbits;\n zip_d_desc.extra_base = 0;\n zip_d_desc.elems = zip_D_CODES;\n zip_d_desc.max_length = zip_MAX_BITS;\n zip_d_desc.max_code = 0;\n\n zip_bl_desc.dyn_tree = zip_bl_tree;\n zip_bl_desc.static_tree = null;\n zip_bl_desc.extra_bits = zip_extra_blbits;\n zip_bl_desc.extra_base = 0;\n zip_bl_desc.elems = zip_BL_CODES;\n zip_bl_desc.max_length = zip_MAX_BL_BITS;\n zip_bl_desc.max_code = 0;\n\n // Initialize the mapping length (0..255) -> length code (0..28)\n length = 0;\n for (code = 0; code < zip_LENGTH_CODES - 1; code++) {\n zip_base_length[code] = length;\n for (n = 0; n < 1 << zip_extra_lbits[code]; n++) zip_length_code[length++] = code;\n }\n // Assert (length == 256, \"ct_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n zip_length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n zip_base_dist[code] = dist;\n for (n = 0; n < 1 << zip_extra_dbits[code]; n++) {\n zip_dist_code[dist++] = code;\n }\n }\n // Assert (dist == 256, \"ct_init: dist != 256\");\n dist >>= 7; // from now on, all distances are divided by 128\n for (; code < zip_D_CODES; code++) {\n zip_base_dist[code] = dist << 7;\n for (n = 0; n < 1 << (zip_extra_dbits[code] - 7); n++) zip_dist_code[256 + dist++] = code;\n }\n // Assert (dist == 256, \"ct_init: 256+dist != 512\");\n\n // Construct the codes of the static literal tree\n for (bits = 0; bits <= zip_MAX_BITS; bits++) zip_bl_count[bits] = 0;\n n = 0;\n while (n <= 143) {\n zip_static_ltree[n++].dl = 8;\n zip_bl_count[8]++;\n }\n while (n <= 255) {\n zip_static_ltree[n++].dl = 9;\n zip_bl_count[9]++;\n }\n while (n <= 279) {\n zip_static_ltree[n++].dl = 7;\n zip_bl_count[7]++;\n }\n while (n <= 287) {\n zip_static_ltree[n++].dl = 8;\n zip_bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n zip_gen_codes(zip_static_ltree, zip_L_CODES + 1);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < zip_D_CODES; n++) {\n zip_static_dtree[n].dl = 5;\n zip_static_dtree[n].fc = zip_bi_reverse(n, 5);\n }\n\n // Initialize the first block of the first file:\n zip_init_block();\n }\n\n /* ==========================================================================\n * Initialize a new block.\n */\n function zip_init_block() {\n let n; // iterates over tree elements\n\n // Initialize the trees.\n for (n = 0; n < zip_L_CODES; n++) zip_dyn_ltree[n].fc = 0;\n for (n = 0; n < zip_D_CODES; n++) zip_dyn_dtree[n].fc = 0;\n for (n = 0; n < zip_BL_CODES; n++) zip_bl_tree[n].fc = 0;\n\n zip_dyn_ltree[zip_END_BLOCK].fc = 1;\n zip_opt_len = zip_static_len = 0;\n zip_last_lit = zip_last_dist = zip_last_flags = 0;\n zip_flags = 0;\n zip_flag_bit = 1;\n }\n\n /* ==========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\n function zip_pqdownheap(\n tree, // the tree to restore\n k,\n ) {\n // node to move down\n const v = zip_heap[k];\n let j = k << 1; // left son of k\n\n while (j <= zip_heap_len) {\n // Set j to the smallest of the two sons:\n if (j < zip_heap_len && zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j])) j++;\n\n // Exit if v is smaller than both sons\n if (zip_SMALLER(tree, v, zip_heap[j])) break;\n\n // Exchange v with the smallest son\n zip_heap[k] = zip_heap[j];\n k = j;\n\n // And continue down the tree, setting j to the left son of k\n j <<= 1;\n }\n zip_heap[k] = v;\n }\n\n /* ==========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\n function zip_gen_bitlen(desc) {\n // the tree descriptor\n const tree = desc.dyn_tree;\n const extra = desc.extra_bits;\n const base = desc.extra_base;\n const { max_code } = desc;\n const { max_length } = desc;\n const stree = desc.static_tree;\n let h; // heap index\n let n;\n let m; // iterate over the tree elements\n let bits; // bit length\n let xbits; // extra bits\n let f; // frequency\n let overflow = 0; // number of elements with bit length too large\n\n for (bits = 0; bits <= zip_MAX_BITS; bits++) zip_bl_count[bits] = 0;\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap\n\n for (h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) {\n n = zip_heap[h];\n bits = tree[tree[n].dl].dl + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n].dl = bits;\n // We overwrite tree[n].dl which is no longer needed\n\n if (n > max_code) continue; // not a leaf node\n\n zip_bl_count[bits]++;\n xbits = 0;\n if (n >= base) xbits = extra[n - base];\n f = tree[n].fc;\n zip_opt_len += f * (bits + xbits);\n if (stree != null) zip_static_len += f * (stree[n].dl + xbits);\n }\n if (overflow == 0) return;\n\n // This happens for example on obj2 and pic of the Calgary corpus\n\n // Find the first bit length which could increase:\n do {\n bits = max_length - 1;\n while (zip_bl_count[bits] == 0) bits--;\n zip_bl_count[bits]--; // move one leaf down the tree\n zip_bl_count[bits + 1] += 2; // move one overflow item as its brother\n zip_bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits != 0; bits--) {\n n = zip_bl_count[bits];\n while (n != 0) {\n m = zip_heap[--h];\n if (m > max_code) continue;\n if (tree[m].dl != bits) {\n zip_opt_len += (bits - tree[m].dl) * tree[m].fc;\n tree[m].fc = bits;\n }\n n--;\n }\n }\n }\n\n /* ==========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\n function zip_gen_codes(\n tree, // the tree to decorate\n max_code,\n ) {\n // largest code with non zero frequency\n const next_code = new Array(zip_MAX_BITS + 1); // next code value for each bit length\n let code = 0; // running code value\n let bits; // bit index\n let n; // code index\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= zip_MAX_BITS; bits++) {\n code = (code + zip_bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n // Assert (code + encoder->bl_count[MAX_BITS]-1 == (1<> 1; n >= 1; n--) zip_pqdownheap(tree, n);\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n do {\n n = zip_heap[zip_SMALLEST];\n zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--];\n zip_pqdownheap(tree, zip_SMALLEST);\n\n m = zip_heap[zip_SMALLEST]; // m = node of next least frequency\n\n // keep the nodes sorted by frequency\n zip_heap[--zip_heap_max] = n;\n zip_heap[--zip_heap_max] = m;\n\n // Create a new node father of n and m\n tree[node].fc = tree[n].fc + tree[m].fc;\n //\tdepth[node] = (char)(MAX(depth[n], depth[m]) + 1);\n if (zip_depth[n] > zip_depth[m] + 1) zip_depth[node] = zip_depth[n];\n else zip_depth[node] = zip_depth[m] + 1;\n tree[n].dl = tree[m].dl = node;\n\n // and insert the new node in the heap\n zip_heap[zip_SMALLEST] = node++;\n zip_pqdownheap(tree, zip_SMALLEST);\n } while (zip_heap_len >= 2);\n\n zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n zip_gen_bitlen(desc);\n\n // The field len is now set, we can generate the bit codes\n zip_gen_codes(tree, max_code);\n }\n\n /* ==========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree. Updates opt_len to take into account the repeat\n * counts. (The contribution of the bit length codes will be added later\n * during the construction of bl_tree.)\n */\n function zip_scan_tree(\n tree, // the tree to be scanned\n max_code,\n ) {\n // and its largest code of non zero frequency\n let n; // iterates over all tree elements\n let prevlen = -1; // last emitted length\n let curlen; // length of current code\n let nextlen = tree[0].dl; // length of next code\n let count = 0; // repeat count of the current code\n let max_count = 7; // max repeat count\n let min_count = 4; // min repeat count\n\n if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[max_code + 1].dl = 0xffff; // guard\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[n + 1].dl;\n if (++count < max_count && curlen == nextlen) continue;\n else if (count < min_count) zip_bl_tree[curlen].fc += count;\n else if (curlen != 0) {\n if (curlen != prevlen) zip_bl_tree[curlen].fc++;\n zip_bl_tree[zip_REP_3_6].fc++;\n } else if (count <= 10) zip_bl_tree[zip_REPZ_3_10].fc++;\n else zip_bl_tree[zip_REPZ_11_138].fc++;\n count = 0;\n prevlen = curlen;\n if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen == nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }\n\n /* ==========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\n function zip_send_tree(\n tree, // the tree to be scanned\n max_code,\n ) {\n // and its largest code of non zero frequency\n let n; // iterates over all tree elements\n let prevlen = -1; // last emitted length\n let curlen; // length of current code\n let nextlen = tree[0].dl; // length of next code\n let count = 0; // repeat count of the current code\n let max_count = 7; // max repeat count\n let min_count = 4; /* guard already set */ // min repeat count\n\n /* tree[max_code+1].dl = -1; */ if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[n + 1].dl;\n if (++count < max_count && curlen == nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n zip_SEND_CODE(curlen, zip_bl_tree);\n } while (--count != 0);\n } else if (curlen != 0) {\n if (curlen != prevlen) {\n zip_SEND_CODE(curlen, zip_bl_tree);\n count--;\n }\n // Assert(count >= 3 && count <= 6, \" 3_6?\");\n zip_SEND_CODE(zip_REP_3_6, zip_bl_tree);\n zip_send_bits(count - 3, 2);\n } else if (count <= 10) {\n zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree);\n zip_send_bits(count - 3, 3);\n } else {\n zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree);\n zip_send_bits(count - 11, 7);\n }\n count = 0;\n prevlen = curlen;\n if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen == nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }\n\n /* ==========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\n function zip_build_bl_tree() {\n let max_blindex; // index of last bit length code of non zero freq\n\n // Determine the bit length frequencies for literal and distance trees\n zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code);\n zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code);\n\n // Build the bit length tree:\n zip_build_tree(zip_bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = zip_BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break;\n }\n /* Update opt_len to include the bit length tree and counts */\n zip_opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n // Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n //\t encoder->opt_len, encoder->static_len));\n\n return max_blindex;\n }\n\n /* ==========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\n function zip_send_all_trees(lcodes, dcodes, blcodes) {\n // number of codes for each tree\n let rank; // index in bl_order\n\n // Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n // Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n //\t \"too many codes\");\n // Tracev((stderr, \"\\nbl counts: \"));\n zip_send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n zip_send_bits(dcodes - 1, 5);\n zip_send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n for (rank = 0; rank < blcodes; rank++) {\n // Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3);\n }\n\n // send the literal tree\n zip_send_tree(zip_dyn_ltree, lcodes - 1);\n\n // send the distance tree\n zip_send_tree(zip_dyn_dtree, dcodes - 1);\n }\n\n /* ==========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\n function zip_flush_block(eof) {\n // true if this is the last block for a file\n let opt_lenb;\n let static_lenb; // opt_len and static_len in bytes\n let max_blindex; // index of last bit length code of non zero freq\n let stored_len; // length of input block\n\n stored_len = zip_strstart - zip_block_start;\n zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items\n\n // Construct the literal and distance trees\n zip_build_tree(zip_l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\",\n //\t encoder->opt_len, encoder->static_len));\n\n zip_build_tree(zip_d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\",\n //\t encoder->opt_len, encoder->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = zip_build_bl_tree();\n\n // Determine the best encoding. Compute first the block length in bytes\n opt_lenb = (zip_opt_len + 3 + 7) >> 3;\n static_lenb = (zip_static_len + 3 + 7) >> 3;\n\n // Trace((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u \",\n //\t opt_lenb, encoder->opt_len,\n //\t static_lenb, encoder->static_len, stored_len,\n //\t encoder->last_lit, encoder->last_dist));\n\n if (static_lenb <= opt_lenb) opt_lenb = static_lenb;\n if (\n stored_len + 4 <= opt_lenb && // 4: two words for the lengths\n zip_block_start >= 0\n ) {\n let i;\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n zip_send_bits((zip_STORED_BLOCK << 1) + eof, 3); /* send block type */\n zip_bi_windup(); /* align on byte boundary */\n zip_put_short(stored_len);\n zip_put_short(~stored_len);\n\n // copy block\n /*\n p = &window[block_start];\n for(i = 0; i < stored_len; i++)\n\tput_byte(p[i]);\n*/\n for (i = 0; i < stored_len; i++) zip_put_byte(zip_window[zip_block_start + i]);\n } else if (static_lenb == opt_lenb) {\n zip_send_bits((zip_STATIC_TREES << 1) + eof, 3);\n zip_compress_block(zip_static_ltree, zip_static_dtree);\n } else {\n zip_send_bits((zip_DYN_TREES << 1) + eof, 3);\n zip_send_all_trees(zip_l_desc.max_code + 1, zip_d_desc.max_code + 1, max_blindex + 1);\n zip_compress_block(zip_dyn_ltree, zip_dyn_dtree);\n }\n\n zip_init_block();\n\n if (eof != 0) zip_bi_windup();\n }\n\n /* ==========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\n function zip_ct_tally(\n dist, // distance of matched string\n lc,\n ) {\n // match length-MIN_MATCH or unmatched char (if dist==0)\n zip_l_buf[zip_last_lit++] = lc;\n if (dist == 0) {\n // lc is the unmatched char\n zip_dyn_ltree[lc].fc++;\n } else {\n // Here, lc is the match length - MIN_MATCH\n dist--; // dist = match distance - 1\n // Assert((ush)dist < (ush)MAX_DIST &&\n //\t (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n //\t (ush)D_CODE(dist) < (ush)D_CODES, \"ct_tally: bad match\");\n\n zip_dyn_ltree[zip_length_code[lc] + zip_LITERALS + 1].fc++;\n zip_dyn_dtree[zip_D_CODE(dist)].fc++;\n\n zip_d_buf[zip_last_dist++] = dist;\n zip_flags |= zip_flag_bit;\n }\n zip_flag_bit <<= 1;\n\n // Output the flags if they fill a byte\n if ((zip_last_lit & 7) == 0) {\n zip_flag_buf[zip_last_flags++] = zip_flags;\n zip_flags = 0;\n zip_flag_bit = 1;\n }\n // Try to guess if it is profitable to stop the current block here\n if (zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) {\n // Compute an upper bound for the compressed length\n let out_length = zip_last_lit * 8;\n const in_length = zip_strstart - zip_block_start;\n let dcode;\n\n for (dcode = 0; dcode < zip_D_CODES; dcode++) {\n out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]);\n }\n out_length >>= 3;\n // Trace((stderr,\"\\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) \",\n //\t encoder->last_lit, encoder->last_dist, in_length, out_length,\n //\t 100L - out_length*100L/in_length));\n if (zip_last_dist < parseInt(zip_last_lit / 2) && out_length < parseInt(in_length / 2)) return true;\n }\n return zip_last_lit == zip_LIT_BUFSIZE - 1 || zip_last_dist == zip_DIST_BUFSIZE;\n /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n }\n\n /* ==========================================================================\n * Send the block data compressed using the given Huffman trees\n */\n function zip_compress_block(\n ltree, // literal tree\n dtree,\n ) {\n // distance tree\n let dist; // distance of matched string\n let lc; // match length or unmatched char (if dist == 0)\n let lx = 0; // running index in l_buf\n let dx = 0; // running index in d_buf\n let fx = 0; // running index in flag_buf\n let flag = 0; // current flags\n let code; // the code to send\n let extra; // number of extra bits to send\n\n if (zip_last_lit != 0)\n do {\n if ((lx & 7) == 0) flag = zip_flag_buf[fx++];\n lc = zip_l_buf[lx++] & 0xff;\n if ((flag & 1) == 0) {\n zip_SEND_CODE(lc, ltree); /* send a literal byte */\n //\tTracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n // Here, lc is the match length - MIN_MATCH\n code = zip_length_code[lc];\n zip_SEND_CODE(code + zip_LITERALS + 1, ltree); // send the length code\n extra = zip_extra_lbits[code];\n if (extra != 0) {\n lc -= zip_base_length[code];\n zip_send_bits(lc, extra); // send the extra length bits\n }\n dist = zip_d_buf[dx++];\n // Here, dist is the match distance - 1\n code = zip_D_CODE(dist);\n //\tAssert (code < D_CODES, \"bad d_code\");\n\n zip_SEND_CODE(code, dtree); // send the distance code\n extra = zip_extra_dbits[code];\n if (extra != 0) {\n dist -= zip_base_dist[code];\n zip_send_bits(dist, extra); // send the extra distance bits\n }\n } // literal or match pair ?\n flag >>= 1;\n } while (lx < zip_last_lit);\n\n zip_SEND_CODE(zip_END_BLOCK, ltree);\n }\n\n /* ==========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\n const zip_Buf_size = 16; // bit size of bi_buf\n function zip_send_bits(\n value, // value to send\n length,\n ) {\n // number of bits\n /* If not enough room in bi_buf, use (valid) bits from bi_buf and\n * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))\n * unused bits in value.\n */\n if (zip_bi_valid > zip_Buf_size - length) {\n zip_bi_buf |= value << zip_bi_valid;\n zip_put_short(zip_bi_buf);\n zip_bi_buf = value >> (zip_Buf_size - zip_bi_valid);\n zip_bi_valid += length - zip_Buf_size;\n } else {\n zip_bi_buf |= value << zip_bi_valid;\n zip_bi_valid += length;\n }\n }\n\n /* ==========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\n function zip_bi_reverse(\n code, // the value to invert\n len,\n ) {\n // its bit length\n let res = 0;\n do {\n res |= code & 1;\n code >>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >> 1;\n }\n\n /* ==========================================================================\n * Write out any remaining bits in an incomplete byte.\n */\n function zip_bi_windup() {\n if (zip_bi_valid > 8) {\n zip_put_short(zip_bi_buf);\n } else if (zip_bi_valid > 0) {\n zip_put_byte(zip_bi_buf);\n }\n zip_bi_buf = 0;\n zip_bi_valid = 0;\n }\n\n function zip_qoutbuf() {\n if (zip_outcnt != 0) {\n let q;\n let i;\n q = zip_new_queue();\n if (zip_qhead == null) zip_qhead = zip_qtail = q;\n else zip_qtail = zip_qtail.next = q;\n q.len = zip_outcnt - zip_outoff;\n // System.arraycopy(zip_outbuf, zip_outoff, q.ptr, 0, q.len);\n for (i = 0; i < q.len; i++) q.ptr[i] = zip_outbuf[zip_outoff + i];\n zip_outcnt = zip_outoff = 0;\n }\n }\n\n return function deflate(str, level) {\n let i;\n let j;\n\n zip_deflate_data = str;\n zip_deflate_pos = 0;\n if (typeof level === 'undefined') level = zip_DEFAULT_LEVEL;\n zip_deflate_start(level);\n\n const buff = new Array(1024);\n const aout = [];\n while ((i = zip_deflate_internal(buff, 0, buff.length)) > 0) {\n const cbuf = new Array(i);\n for (j = 0; j < i; j++) {\n cbuf[j] = String.fromCharCode(buff[j]);\n }\n aout[aout.length] = cbuf.join('');\n }\n zip_deflate_data = null; // G.C.\n return aout.join('');\n };\n})();\n\nexport default deflate;\n","// @ts-nocheck\n/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport mergeWith from 'lodash/mergeWith';\nimport deflate from '@/libs/rawdeflate';\n\nfunction encode64(data) {\n let r = '';\n for (let i = 0; i < data.length; i += 3) {\n if (i + 2 === data.length) {\n r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), 0);\n } else if (i + 1 === data.length) {\n r += append3bytes(data.charCodeAt(i), 0, 0);\n } else {\n r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), data.charCodeAt(i + 2));\n }\n }\n return r;\n}\n\nfunction append3bytes(b1, b2, b3) {\n const c1 = b1 >> 2;\n const c2 = ((b1 & 0x3) << 4) | (b2 >> 4);\n const c3 = ((b2 & 0xf) << 2) | (b3 >> 6);\n const c4 = b3 & 0x3f;\n let r = '';\n r += encode6bit(c1 & 0x3f);\n r += encode6bit(c2 & 0x3f);\n r += encode6bit(c3 & 0x3f);\n r += encode6bit(c4 & 0x3f);\n return r;\n}\n\nfunction encode6bit(b1) {\n let b = b1;\n if (b < 10) {\n return String.fromCharCode(48 + b);\n }\n b -= 10;\n if (b < 26) {\n return String.fromCharCode(65 + b);\n }\n b -= 26;\n if (b < 26) {\n return String.fromCharCode(97 + b);\n }\n b -= 26;\n if (b === 0) {\n return '-';\n }\n if (b === 1) {\n return '_';\n }\n return '?';\n}\n\nfunction compress(s1, url) {\n const s = unescape(encodeURIComponent(s1));\n return `${url}/svg/${encode64(deflate(s, 9))}`;\n}\n\nexport default class PlantUMLCodeEngine {\n static install(cherryOptions, args) {\n mergeWith(cherryOptions, {\n engine: {\n syntax: {\n codeBlock: {\n customRenderer: {\n plantuml: new PlantUMLCodeEngine({\n ...args,\n ...(cherryOptions.engine.syntax.plantuml ?? {}),\n }),\n },\n },\n },\n },\n });\n }\n\n constructor(plantUMLOptions = {}) {\n const defaultUrl = 'http://www.plantuml.com/plantuml';\n this.baseUrl = plantUMLOptions.baseUrl ?? defaultUrl;\n }\n\n render(src, sign) {\n let $sign = sign;\n if (!$sign) {\n $sign = Math.round(Math.random() * 100000000);\n }\n const graphId = `plantuml-${$sign}-${new Date().getTime()}`;\n return ``;\n }\n}\n","/*! For license information please see mermaid.esm.min.mjs.LICENSE.txt */\nvar 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,\"\u001b[35m\",c(\"FATAL\"))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(\"ERROR\"),\"color: orange\"):console.log.bind(console,\"\u001b[31m\",c(\"ERROR\"))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(\"WARN\"),\"color: orange\"):console.log.bind(console,\"\u001b[33m\",c(\"WARN\"))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(\"INFO\"),\"color: lightblue\"):console.log.bind(console,\"\u001b[34m\",c(\"INFO\"))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(\"DEBUG\"),\"color: lightgreen\"):console.log.bind(console,\"\u001b[32m\",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(\"`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n }\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n isTagStartChar(c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n }\n startSpecial(sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n }\n stateBeforeTagName(c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n const lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttributeName(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateInAttributeName(c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n }\n stateAfterAttributeName(c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateBeforeAttributeValue(c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n }\n handleInAttributeValue(c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n }\n stateInAttributeValueDoubleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n }\n stateInAttributeValueSingleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n }\n stateInAttributeValueNoQuotes(c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n }\n stateBeforeDeclaration(c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n }\n stateInDeclaration(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. )\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n }\n stateInSpecialComment(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n const lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n stateBeforeEntity(c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Num) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n }\n stateInNamedEntity(c) {\n this.entityExcess += 1;\n this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n const masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n const valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n const entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n }\n emitNamedEntity() {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n const valueLength = (this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1:\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~BinTrieFlags.VALUE_LENGTH);\n break;\n case 2:\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n }\n stateBeforeNumericEntity(c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n }\n emitNumericEntity(strict) {\n const entityStart = this.index - this.entityExcess - 1;\n const numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint(replaceCodePoint(this.entityResult));\n }\n this.state = this.baseState;\n }\n stateInNumericEntity(c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n }\n stateInHexEntity(c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n }\n allowLegacyEntity() {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n shouldContinue() {\n return this.index < this.buffer.length + this.offset && this.running;\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n if (this.state === State.Text) {\n this.stateText(c);\n }\n else if (this.state === State.SpecialStartSequence) {\n this.stateSpecialStartSequence(c);\n }\n else if (this.state === State.InSpecialTag) {\n this.stateInSpecialTag(c);\n }\n else if (this.state === State.CDATASequence) {\n this.stateCDATASequence(c);\n }\n else if (this.state === State.InAttributeValueDq) {\n this.stateInAttributeValueDoubleQuotes(c);\n }\n else if (this.state === State.InAttributeName) {\n this.stateInAttributeName(c);\n }\n else if (this.state === State.InCommentLike) {\n this.stateInCommentLike(c);\n }\n else if (this.state === State.InSpecialComment) {\n this.stateInSpecialComment(c);\n }\n else if (this.state === State.BeforeAttributeName) {\n this.stateBeforeAttributeName(c);\n }\n else if (this.state === State.InTagName) {\n this.stateInTagName(c);\n }\n else if (this.state === State.InClosingTagName) {\n this.stateInClosingTagName(c);\n }\n else if (this.state === State.BeforeTagName) {\n this.stateBeforeTagName(c);\n }\n else if (this.state === State.AfterAttributeName) {\n this.stateAfterAttributeName(c);\n }\n else if (this.state === State.InAttributeValueSq) {\n this.stateInAttributeValueSingleQuotes(c);\n }\n else if (this.state === State.BeforeAttributeValue) {\n this.stateBeforeAttributeValue(c);\n }\n else if (this.state === State.BeforeClosingTagName) {\n this.stateBeforeClosingTagName(c);\n }\n else if (this.state === State.AfterClosingTagName) {\n this.stateAfterClosingTagName(c);\n }\n else if (this.state === State.BeforeSpecialS) {\n this.stateBeforeSpecialS(c);\n }\n else if (this.state === State.InAttributeValueNq) {\n this.stateInAttributeValueNoQuotes(c);\n }\n else if (this.state === State.InSelfClosingTag) {\n this.stateInSelfClosingTag(c);\n }\n else if (this.state === State.InDeclaration) {\n this.stateInDeclaration(c);\n }\n else if (this.state === State.BeforeDeclaration) {\n this.stateBeforeDeclaration(c);\n }\n else if (this.state === State.BeforeComment) {\n this.stateBeforeComment(c);\n }\n else if (this.state === State.InProcessingInstruction) {\n this.stateInProcessingInstruction(c);\n }\n else if (this.state === State.InNamedEntity) {\n this.stateInNamedEntity(c);\n }\n else if (this.state === State.BeforeEntity) {\n this.stateBeforeEntity(c);\n }\n else if (this.state === State.InHexEntity) {\n this.stateInHexEntity(c);\n }\n else if (this.state === State.InNumericEntity) {\n this.stateInNumericEntity(c);\n }\n else {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n this.index++;\n }\n this.cleanup();\n }\n finish() {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitPartial(start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n }\n emitCodePoint(cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n }\n}\n//# sourceMappingURL=Tokenizer.js.map","import Tokenizer, { QuoteType } from \"./Tokenizer.js\";\nimport { fromCodePoint } from \"entities/lib/decode.js\";\nconst formTags = new Set([\n \"input\",\n \"option\",\n \"optgroup\",\n \"select\",\n \"button\",\n \"datalist\",\n \"textarea\",\n]);\nconst pTag = new Set([\"p\"]);\nconst tableSectionTags = new Set([\"thead\", \"tbody\"]);\nconst ddtTags = new Set([\"dd\", \"dt\"]);\nconst rtpTags = new Set([\"rt\", \"rp\"]);\nconst openImpliesClose = new Map([\n [\"tr\", new Set([\"tr\", \"th\", \"td\"])],\n [\"th\", new Set([\"th\"])],\n [\"td\", new Set([\"thead\", \"th\", \"td\"])],\n [\"body\", new Set([\"head\", \"link\", \"script\"])],\n [\"li\", new Set([\"li\"])],\n [\"p\", pTag],\n [\"h1\", pTag],\n [\"h2\", pTag],\n [\"h3\", pTag],\n [\"h4\", pTag],\n [\"h5\", pTag],\n [\"h6\", pTag],\n [\"select\", formTags],\n [\"input\", formTags],\n [\"output\", formTags],\n [\"button\", formTags],\n [\"datalist\", formTags],\n [\"textarea\", formTags],\n [\"option\", new Set([\"option\"])],\n [\"optgroup\", new Set([\"optgroup\", \"option\"])],\n [\"dd\", ddtTags],\n [\"dt\", ddtTags],\n [\"address\", pTag],\n [\"article\", pTag],\n [\"aside\", pTag],\n [\"blockquote\", pTag],\n [\"details\", pTag],\n [\"div\", pTag],\n [\"dl\", pTag],\n [\"fieldset\", pTag],\n [\"figcaption\", pTag],\n [\"figure\", pTag],\n [\"footer\", pTag],\n [\"form\", pTag],\n [\"header\", pTag],\n [\"hr\", pTag],\n [\"main\", pTag],\n [\"nav\", pTag],\n [\"ol\", pTag],\n [\"pre\", pTag],\n [\"section\", pTag],\n [\"table\", pTag],\n [\"ul\", pTag],\n [\"rt\", rtpTags],\n [\"rp\", rtpTags],\n [\"tbody\", tableSectionTags],\n [\"tfoot\", tableSectionTags],\n]);\nconst voidElements = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\nconst foreignContextElements = new Set([\"math\", \"svg\"]);\nconst htmlIntegrationElements = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignobject\",\n \"desc\",\n \"title\",\n]);\nconst reNameEnd = /\\s|\\//;\nexport class Parser {\n constructor(cbs, options = {}) {\n var _a, _b, _c, _d, _e;\n this.options = options;\n /** The start index of the last event. */\n this.startIndex = 0;\n /** The end index of the last event. */\n this.endIndex = 0;\n /**\n * Store the start index of the current open tag,\n * so we can update the start index for attributes.\n */\n this.openTagStart = 0;\n this.tagname = \"\";\n this.attribname = \"\";\n this.attribvalue = \"\";\n this.attribs = null;\n this.stack = [];\n this.foreignContext = [];\n this.buffers = [];\n this.bufferOffset = 0;\n /** The index of the last written buffer. Used when resuming after a `pause()`. */\n this.writeIndex = 0;\n /** Indicates whether the parser has finished running / `.end` has been called. */\n this.ended = false;\n this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};\n this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;\n this.lowerCaseAttributeNames =\n (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;\n this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer)(this.options, this);\n (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);\n }\n // Tokenizer event handlers\n /** @internal */\n ontext(start, endIndex) {\n var _a, _b;\n const data = this.getSlice(start, endIndex);\n this.endIndex = endIndex - 1;\n (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);\n this.startIndex = endIndex;\n }\n /** @internal */\n ontextentity(cp) {\n var _a, _b;\n /*\n * Entities can be emitted on the character, or directly after.\n * We use the section start here to get accurate indices.\n */\n const idx = this.tokenizer.getSectionStart();\n this.endIndex = idx - 1;\n (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, fromCodePoint(cp));\n this.startIndex = idx;\n }\n isVoidElement(name) {\n return !this.options.xmlMode && voidElements.has(name);\n }\n /** @internal */\n onopentagname(start, endIndex) {\n this.endIndex = endIndex;\n let name = this.getSlice(start, endIndex);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n this.emitOpenTag(name);\n }\n emitOpenTag(name) {\n var _a, _b, _c, _d;\n this.openTagStart = this.startIndex;\n this.tagname = name;\n const impliesClose = !this.options.xmlMode && openImpliesClose.get(name);\n if (impliesClose) {\n while (this.stack.length > 0 &&\n impliesClose.has(this.stack[this.stack.length - 1])) {\n const el = this.stack.pop();\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, el, true);\n }\n }\n if (!this.isVoidElement(name)) {\n this.stack.push(name);\n if (foreignContextElements.has(name)) {\n this.foreignContext.push(true);\n }\n else if (htmlIntegrationElements.has(name)) {\n this.foreignContext.push(false);\n }\n }\n (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);\n if (this.cbs.onopentag)\n this.attribs = {};\n }\n endOpenTag(isImplied) {\n var _a, _b;\n this.startIndex = this.openTagStart;\n if (this.attribs) {\n (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);\n this.attribs = null;\n }\n if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {\n this.cbs.onclosetag(this.tagname, true);\n }\n this.tagname = \"\";\n }\n /** @internal */\n onopentagend(endIndex) {\n this.endIndex = endIndex;\n this.endOpenTag(false);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onclosetag(start, endIndex) {\n var _a, _b, _c, _d, _e, _f;\n this.endIndex = endIndex;\n let name = this.getSlice(start, endIndex);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n if (foreignContextElements.has(name) ||\n htmlIntegrationElements.has(name)) {\n this.foreignContext.pop();\n }\n if (!this.isVoidElement(name)) {\n const pos = this.stack.lastIndexOf(name);\n if (pos !== -1) {\n if (this.cbs.onclosetag) {\n let count = this.stack.length - pos;\n while (count--) {\n // We know the stack has sufficient elements.\n this.cbs.onclosetag(this.stack.pop(), count !== 0);\n }\n }\n else\n this.stack.length = pos;\n }\n else if (!this.options.xmlMode && name === \"p\") {\n // Implicit open before close\n this.emitOpenTag(\"p\");\n this.closeCurrentTag(true);\n }\n }\n else if (!this.options.xmlMode && name === \"br\") {\n // We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed.\n (_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, \"br\");\n (_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, \"br\", {}, true);\n (_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, \"br\", false);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onselfclosingtag(endIndex) {\n this.endIndex = endIndex;\n if (this.options.xmlMode ||\n this.options.recognizeSelfClosing ||\n this.foreignContext[this.foreignContext.length - 1]) {\n this.closeCurrentTag(false);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n else {\n // Ignore the fact that the tag is self-closing.\n this.onopentagend(endIndex);\n }\n }\n closeCurrentTag(isOpenImplied) {\n var _a, _b;\n const name = this.tagname;\n this.endOpenTag(isOpenImplied);\n // Self-closing tags will be on the top of the stack\n if (this.stack[this.stack.length - 1] === name) {\n // If the opening tag isn't implied, the closing tag has to be implied.\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);\n this.stack.pop();\n }\n }\n /** @internal */\n onattribname(start, endIndex) {\n this.startIndex = start;\n const name = this.getSlice(start, endIndex);\n this.attribname = this.lowerCaseAttributeNames\n ? name.toLowerCase()\n : name;\n }\n /** @internal */\n onattribdata(start, endIndex) {\n this.attribvalue += this.getSlice(start, endIndex);\n }\n /** @internal */\n onattribentity(cp) {\n this.attribvalue += fromCodePoint(cp);\n }\n /** @internal */\n onattribend(quote, endIndex) {\n var _a, _b;\n this.endIndex = endIndex;\n (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double\n ? '\"'\n : quote === QuoteType.Single\n ? \"'\"\n : quote === QuoteType.NoValue\n ? undefined\n : null);\n if (this.attribs &&\n !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {\n this.attribs[this.attribname] = this.attribvalue;\n }\n this.attribvalue = \"\";\n }\n getInstructionName(value) {\n const idx = value.search(reNameEnd);\n let name = idx < 0 ? value : value.substr(0, idx);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n return name;\n }\n /** @internal */\n ondeclaration(start, endIndex) {\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex);\n if (this.cbs.onprocessinginstruction) {\n const name = this.getInstructionName(value);\n this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onprocessinginstruction(start, endIndex) {\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex);\n if (this.cbs.onprocessinginstruction) {\n const name = this.getInstructionName(value);\n this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n oncomment(start, endIndex, offset) {\n var _a, _b, _c, _d;\n this.endIndex = endIndex;\n (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset));\n (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n oncdata(start, endIndex, offset) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex - offset);\n if (this.options.xmlMode || this.options.recognizeCDATA) {\n (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);\n (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);\n (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);\n }\n else {\n (_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);\n (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onend() {\n var _a, _b;\n if (this.cbs.onclosetag) {\n // Set the end index for all remaining tags\n this.endIndex = this.startIndex;\n for (let i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i], true))\n ;\n }\n (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /**\n * Resets the parser to a blank state, ready to parse a new HTML document\n */\n reset() {\n var _a, _b, _c, _d;\n (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);\n this.tokenizer.reset();\n this.tagname = \"\";\n this.attribname = \"\";\n this.attribs = null;\n this.stack.length = 0;\n this.startIndex = 0;\n this.endIndex = 0;\n (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n this.buffers.length = 0;\n this.bufferOffset = 0;\n this.writeIndex = 0;\n this.ended = false;\n }\n /**\n * Resets the parser, then parses a complete document and\n * pushes it to the handler.\n *\n * @param data Document to parse.\n */\n parseComplete(data) {\n this.reset();\n this.end(data);\n }\n getSlice(start, end) {\n while (start - this.bufferOffset >= this.buffers[0].length) {\n this.shiftBuffer();\n }\n let str = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);\n while (end - this.bufferOffset > this.buffers[0].length) {\n this.shiftBuffer();\n str += this.buffers[0].slice(0, end - this.bufferOffset);\n }\n return str;\n }\n shiftBuffer() {\n this.bufferOffset += this.buffers[0].length;\n this.writeIndex--;\n this.buffers.shift();\n }\n /**\n * Parses a chunk of data and calls the corresponding callbacks.\n *\n * @param chunk Chunk to parse.\n */\n write(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(\".write() after done!\"));\n return;\n }\n this.buffers.push(chunk);\n if (this.tokenizer.running) {\n this.tokenizer.write(chunk);\n this.writeIndex++;\n }\n }\n /**\n * Parses the end of the buffer and clears the stack, calls onend.\n *\n * @param chunk Optional final chunk to parse.\n */\n end(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, Error(\".end() after done!\"));\n return;\n }\n if (chunk)\n this.write(chunk);\n this.ended = true;\n this.tokenizer.end();\n }\n /**\n * Pauses parsing. The parser won't emit events until `resume` is called.\n */\n pause() {\n this.tokenizer.pause();\n }\n /**\n * Resumes parsing after `pause` was called.\n */\n resume() {\n this.tokenizer.resume();\n while (this.tokenizer.running &&\n this.writeIndex < this.buffers.length) {\n this.tokenizer.write(this.buffers[this.writeIndex++]);\n }\n if (this.ended)\n this.tokenizer.end();\n }\n /**\n * Alias of `write`, for backwards compatibility.\n *\n * @param chunk Chunk to parse.\n * @deprecated\n */\n parseChunk(chunk) {\n this.write(chunk);\n }\n /**\n * Alias of `end`, for backwards compatibility.\n *\n * @param chunk Optional final chunk to parse.\n * @deprecated\n */\n done(chunk) {\n this.end(chunk);\n }\n}\n//# sourceMappingURL=Parser.js.map","import { Parser } from \"./Parser.js\";\nexport { Parser };\nimport { DomHandler, } from \"domhandler\";\nexport { DomHandler };\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nexport function parseDocument(data, options) {\n const handler = new DomHandler(undefined, options);\n new Parser(handler, options).end(data);\n return handler.root;\n}\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nexport function parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param cb A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nexport function createDomStream(cb, options, elementCb) {\n const handler = new DomHandler(cb, options, elementCb);\n return new Parser(handler, options);\n}\nexport { default as Tokenizer, } from \"./Tokenizer.js\";\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nimport * as ElementType from \"domelementtype\";\nexport { ElementType };\nimport { getFeed } from \"domutils\";\nexport { getFeed };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nexport function parseFeed(feed, options = { xmlMode: true }) {\n return getFeed(parseDOM(feed, options));\n}\nexport * as DomUtils from \"domutils\";\n// Old name for DomHandler\nexport { DomHandler as DefaultHandler };\n//# sourceMappingURL=index.js.map","/**\n * Types used in signatures of Cheerio methods.\n *\n * @category Cheerio\n */\nexport * from './types.js';\nimport { getLoad } from './load.js';\nimport { getParse } from './parse.js';\nimport { renderWithParse5, parseWithParse5 } from './parsers/parse5-adapter.js';\nimport renderWithHtmlparser2 from 'dom-serializer';\nimport { parseDocument as parseWithHtmlparser2 } from 'htmlparser2';\nconst parse = getParse((content, options, isDocument, context) => options.xmlMode || options._useHtmlParser2\n ? parseWithHtmlparser2(content, options)\n : parseWithParse5(content, options, isDocument, context));\n// Duplicate docs due to https://github.com/TypeStrong/typedoc/issues/1616\n/**\n * Create a querying function, bound to a document created from the provided markup.\n *\n * Note that similar to web browser contexts, this operation may introduce\n * ``, ``, and `` elements; set `isDocument` to `false` to\n * switch to fragment mode and disable this.\n *\n * @param content - Markup to be loaded.\n * @param options - Options for the created instance.\n * @param isDocument - Allows parser to be switched to fragment mode.\n * @returns The loaded document.\n * @see {@link https://cheerio.js.org#loading} for additional usage information.\n */\nexport const load = getLoad(parse, (dom, options) => options.xmlMode || options._useHtmlParser2\n ? renderWithHtmlparser2(dom, options)\n : renderWithParse5(dom));\n/**\n * The default cheerio instance.\n *\n * @deprecated Use the function returned by `load` instead.\n */\nexport default load([]);\nexport { html, xml, text } from './static.js';\nimport * as staticMethods from './static.js';\n/**\n * In order to promote consistency with the jQuery library, users are encouraged\n * to instead use the static method of the same name.\n *\n * @deprecated\n * @example\n *\n * ```js\n * const $ = cheerio.load('
');\n *\n * $.contains($('div').get(0), $('p').get(0));\n * //=> true\n *\n * $.contains($('p').get(0), $('div').get(0));\n * //=> false\n * ```\n *\n * @returns {boolean}\n */\nexport const { contains } = staticMethods;\n/**\n * In order to promote consistency with the jQuery library, users are encouraged\n * to instead use the static method of the same name.\n *\n * @deprecated\n * @example\n *\n * ```js\n * const $ = cheerio.load('');\n *\n * $.merge([1, 2], [3, 4]);\n * //=> [1, 2, 3, 4]\n * ```\n */\nexport const { merge } = staticMethods;\n/**\n * In order to promote consistency with the jQuery library, users are encouraged\n * to instead use the static method of the same name as it is defined on the\n * \"loaded\" Cheerio factory function.\n *\n * @deprecated See {@link static/parseHTML}.\n * @example\n *\n * ```js\n * const $ = cheerio.load('');\n * $.parseHTML('markup');\n * ```\n */\nexport const { parseHTML } = staticMethods;\n/**\n * Users seeking to access the top-level element of a parsed document should\n * instead use the `root` static method of a \"loaded\" Cheerio function.\n *\n * @deprecated\n * @example\n *\n * ```js\n * const $ = cheerio.load('');\n * $.root();\n * ```\n */\nexport const { root } = staticMethods;\n//# sourceMappingURL=index.js.map","exports = module.exports = debug;\n\nfunction debug(label) {\n return _debug.bind(null, label);\n}\n\nfunction _debug(label) {\n var args = [].slice.call(arguments, 1);\n args.unshift('[' + label + ']');\n process.stderr.write(args.join(' ') + '\\n');\n}","var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `lex()` and print the results.\n\nvar debug = require('./debug')('lex');\n\nexports = module.exports = lex;\n\n/**\n * Convert a CSS string into an array of lexical tokens.\n *\n * @param {String} css CSS\n * @returns {Array} lexical tokens\n */\nfunction lex(css) {\n var start; // Debug timer start.\n\n var buffer = ''; // Character accumulator\n var ch; // Current character\n var column = 0; // Current source column number\n var cursor = -1; // Current source cursor position\n var depth = 0; // Current nesting depth\n var line = 1; // Current source line number\n var state = 'before-selector'; // Current state\n var stack = [state]; // State stack\n var token = {}; // Current token\n var tokens = []; // Token accumulator\n\n // Supported @-rules, in roughly descending order of usage probability.\n var atRules = [\n 'media',\n 'keyframes',\n { name: '-webkit-keyframes', type: 'keyframes', prefix: '-webkit-' },\n { name: '-moz-keyframes', type: 'keyframes', prefix: '-moz-' },\n { name: '-ms-keyframes', type: 'keyframes', prefix: '-ms-' },\n { name: '-o-keyframes', type: 'keyframes', prefix: '-o-' },\n 'font-face',\n { name: 'import', state: 'before-at-value' },\n { name: 'charset', state: 'before-at-value' },\n 'supports',\n 'viewport',\n { name: 'namespace', state: 'before-at-value' },\n 'document',\n { name: '-moz-document', type: 'document', prefix: '-moz-' },\n 'page'\n ];\n\n // -- Functions ------------------------------------------------------------\n\n /**\n * Advance the character cursor and return the next character.\n *\n * @returns {String} The next character.\n */\n function getCh() {\n skip();\n return css[cursor];\n }\n\n /**\n * Return the state at the given index in the stack.\n * The stack is LIFO so indexing is from the right.\n *\n * @param {Number} [index=0] Index to return.\n * @returns {String} state\n */\n function getState(index) {\n return index ? stack[stack.length - 1 - index] : state;\n }\n\n /**\n * Look ahead for a string beginning from the next position. The string\n * being looked for must start at the next position.\n *\n * @param {String} str The string to look for.\n * @returns {Boolean} Whether the string was found.\n */\n function isNextString(str) {\n var start = cursor + 1;\n return (str === css.slice(start, start + str.length));\n }\n\n /**\n * Find the start position of a substring beginning from the next\n * position. The string being looked for may begin anywhere.\n *\n * @param {String} str The substring to look for.\n * @returns {Number|false} The position, or `false` if not found.\n */\n function find(str) {\n var pos = css.slice(cursor).indexOf(str);\n\n return pos > 0 ? pos : false;\n }\n\n /**\n * Determine whether a character is next.\n *\n * @param {String} ch Character.\n * @returns {Boolean} Whether the character is next.\n */\n function isNextChar(ch) {\n return ch === peek(1);\n }\n\n /**\n * Return the character at the given cursor offset. The offset is relative\n * to the cursor, so negative values move backwards.\n *\n * @param {Number} [offset=1] Cursor offset.\n * @returns {String} Character.\n */\n function peek(offset) {\n return css[cursor + (offset || 1)];\n }\n\n /**\n * Remove the current state from the stack and set the new current state.\n *\n * @returns {String} The removed state.\n */\n function popState() {\n var removed = stack.pop();\n state = stack[stack.length - 1];\n\n return removed;\n }\n\n /**\n * Set the current state and add it to the stack.\n *\n * @param {String} newState The new state.\n * @returns {Number} The new stack length.\n */\n function pushState(newState) {\n state = newState;\n stack.push(state);\n\n return stack.length;\n }\n\n /**\n * Replace the current state with a new state.\n *\n * @param {String} newState The new state.\n * @returns {String} The replaced state.\n */\n function replaceState(newState) {\n var previousState = state;\n stack[stack.length - 1] = state = newState;\n\n return previousState;\n }\n\n /**\n * Move the character cursor. Positive numbers move the cursor forward.\n * Negative numbers are not supported!\n *\n * @param {Number} [n=1] Number of characters to skip.\n */\n function skip(n) {\n if ((n || 1) == 1) {\n if (css[cursor] == '\\n') {\n line++;\n column = 1;\n } else {\n column++;\n }\n cursor++;\n } else {\n var skipStr = css.slice(cursor, cursor + n).split('\\n');\n if (skipStr.length > 1) {\n line += skipStr.length - 1;\n column = 1;\n }\n column += skipStr[skipStr.length - 1].length;\n cursor = cursor + n;\n }\n }\n\n /**\n * Add the current token to the pile and reset the buffer.\n */\n function addToken() {\n token.end = {\n line: line,\n col: column\n };\n\n DEBUG && debug('addToken:', JSON.stringify(token, null, 2));\n\n tokens.push(token);\n\n buffer = '';\n token = {};\n }\n\n /**\n * Set the current token.\n *\n * @param {String} type Token type.\n */\n function initializeToken(type) {\n token = {\n type: type,\n start: {\n line: line,\n col : column\n }\n };\n }\n\n // -- Main Loop ------------------------------------------------------------\n\n /*\n The main loop is a state machine that reads in one character at a time,\n and determines what to do based on the current state and character.\n This is implemented as a series of nested `switch` statements and the\n case orders have been mildly optimized based on rough probabilities\n calculated by processing a small sample of real-world CSS.\n\n Further optimization (such as a dispatch table) shouldn't be necessary\n since the total number of cases is very low.\n */\n\n TIMER && (start = Date.now());\n\n while (ch = getCh()) {\n DEBUG && debug(ch, getState());\n\n // column += 1;\n\n switch (ch) {\n // Space\n case ' ':\n switch (getState()) {\n case 'selector':\n case 'value':\n case 'value-paren':\n case 'at-group':\n case 'at-value':\n case 'comment':\n case 'double-string':\n case 'single-string':\n buffer += ch;\n break;\n }\n break;\n\n // Newline or tab\n case '\\n':\n case '\\t':\n case '\\r':\n case '\\f':\n switch (getState()) {\n case 'value':\n case 'value-paren':\n case 'at-group':\n case 'comment':\n case 'single-string':\n case 'double-string':\n case 'selector':\n buffer += ch;\n break;\n\n case 'at-value':\n // Tokenize an @-rule if a semi-colon was omitted.\n if ('\\n' === ch) {\n token.value = buffer.trim();\n addToken();\n popState();\n }\n break;\n }\n\n // if ('\\n' === ch) {\n // column = 0;\n // line += 1;\n // }\n break;\n\n case ':':\n switch (getState()) {\n case 'name':\n token.name = buffer.trim();\n buffer = '';\n\n replaceState('before-value');\n break;\n\n case 'before-selector':\n buffer += ch;\n\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n buffer += ch;\n break;\n }\n break;\n\n case ';':\n switch (getState()) {\n case 'name':\n case 'before-value':\n case 'value':\n // Tokenize a declaration\n // if value is empty skip the declaration\n if (buffer.trim().length > 0) {\n token.value = buffer.trim(),\n addToken();\n }\n replaceState('before-name');\n break;\n\n case 'value-paren':\n // Insignificant semi-colon\n buffer += ch;\n break;\n\n case 'at-value':\n // Tokenize an @-rule\n token.value = buffer.trim();\n addToken();\n popState();\n break;\n\n case 'before-name':\n // Extraneous semi-colon\n break;\n\n default:\n buffer += ch;\n break;\n }\n break;\n\n case '{':\n switch (getState()) {\n case 'selector':\n // If the sequence is `\\{` then assume that the brace should be escaped.\n if (peek(-1) === '\\\\') {\n buffer += ch;\n break;\n }\n\n // Tokenize a selector\n token.text = buffer.trim();\n addToken();\n replaceState('before-name');\n depth = depth + 1;\n break;\n\n case 'at-group':\n // Tokenize an @-group\n token.name = buffer.trim();\n\n // XXX: @-rules are starting to get hairy\n switch (token.type) {\n case 'font-face':\n case 'viewport' :\n case 'page' :\n pushState('before-name');\n break;\n\n default:\n pushState('before-selector');\n }\n\n addToken();\n depth = depth + 1;\n break;\n\n case 'name':\n case 'at-rule':\n // Tokenize a declaration or an @-rule\n token.name = buffer.trim();\n addToken();\n pushState('before-name');\n depth = depth + 1;\n break;\n\n case 'comment':\n case 'double-string':\n case 'single-string':\n // Ignore braces in comments and strings\n buffer += ch;\n break;\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n }\n\n break;\n\n case '}':\n switch (getState()) {\n case 'before-name':\n case 'name':\n case 'before-value':\n case 'value':\n // If the buffer contains anything, it is a value\n if (buffer) {\n token.value = buffer.trim();\n }\n\n // If the current token has a name and a value it should be tokenized.\n if (token.name && token.value) {\n addToken();\n }\n\n // Leave the block\n initializeToken('end');\n addToken();\n popState();\n\n // We might need to leave again.\n // XXX: What about 3 levels deep?\n if ('at-group' === getState()) {\n initializeToken('at-group-end');\n addToken();\n popState();\n }\n \n if (depth > 0) {\n depth = depth - 1;\n }\n\n break;\n\n case 'at-group':\n case 'before-selector':\n case 'selector':\n // If the sequence is `\\}` then assume that the brace should be escaped.\n if (peek(-1) === '\\\\') {\n buffer += ch;\n break;\n }\n\n if (depth > 0) {\n // Leave block if in an at-group\n if ('at-group' === getState(1)) {\n initializeToken('at-group-end');\n addToken();\n }\n }\n\n if (depth > 1) {\n popState();\n }\n\n if (depth > 0) {\n depth = depth - 1;\n }\n break;\n\n case 'double-string':\n case 'single-string':\n case 'comment':\n // Ignore braces in comments and strings.\n buffer += ch;\n break;\n }\n\n break;\n\n // Strings\n case '\"':\n case \"'\":\n switch (getState()) {\n case 'double-string':\n if ('\"' === ch && '\\\\' !== peek(-1)) {\n popState();\n }\n break;\n\n case 'single-string':\n if (\"'\" === ch && '\\\\' !== peek(-1)) {\n popState();\n }\n break;\n\n case 'before-at-value':\n replaceState('at-value');\n pushState('\"' === ch ? 'double-string' : 'single-string');\n break;\n\n case 'before-value':\n replaceState('value');\n pushState('\"' === ch ? 'double-string' : 'single-string');\n break;\n\n case 'comment':\n // Ignore strings within comments.\n break;\n\n default:\n if ('\\\\' !== peek(-1)) {\n pushState('\"' === ch ? 'double-string' : 'single-string');\n }\n }\n\n buffer += ch;\n break;\n\n // Comments\n case '/':\n switch (getState()) {\n case 'comment':\n case 'double-string':\n case 'single-string':\n // Ignore\n buffer += ch;\n break;\n\n case 'before-value':\n case 'selector':\n case 'name':\n case 'value':\n if (isNextChar('*')) {\n // Ignore comments in selectors, properties and values. They are\n // difficult to represent in the AST.\n var pos = find('*/');\n\n if (pos) {\n skip(pos + 1);\n }\n } else {\n if (getState() == 'before-value') replaceState('value');\n buffer += ch;\n }\n break;\n\n default:\n if (isNextChar('*')) {\n // Create a comment token\n initializeToken('comment');\n pushState('comment');\n skip();\n }\n else {\n buffer += ch;\n }\n break;\n }\n break;\n\n // Comment end or universal selector\n case '*':\n switch (getState()) {\n case 'comment':\n if (isNextChar('/')) {\n // Tokenize a comment\n token.text = buffer; // Don't trim()!\n skip();\n addToken();\n popState();\n }\n else {\n buffer += ch;\n }\n break;\n\n case 'before-selector':\n buffer += ch;\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n buffer += ch;\n }\n break;\n\n // @-rules\n case '@':\n switch (getState()) {\n case 'comment':\n case 'double-string':\n case 'single-string':\n buffer += ch;\n break;\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n // Iterate over the supported @-rules and attempt to tokenize one.\n var tokenized = false;\n var name;\n var rule;\n\n for (var j = 0, len = atRules.length; !tokenized && j < len; ++j) {\n rule = atRules[j];\n name = rule.name || rule;\n\n if (!isNextString(name)) { continue; }\n\n tokenized = true;\n\n initializeToken(name);\n pushState(rule.state || 'at-group');\n skip(name.length);\n\n if (rule.prefix) {\n token.prefix = rule.prefix;\n }\n\n if (rule.type) {\n token.type = rule.type;\n }\n }\n\n if (!tokenized) {\n // Keep on truckin' America!\n buffer += ch;\n }\n break;\n }\n break;\n\n // Parentheses are tracked to disambiguate semi-colons, such as within a\n // data URI.\n case '(':\n switch (getState()) {\n case 'value':\n pushState('value-paren');\n break;\n case 'before-value':\n replaceState('value');\n break;\n }\n\n buffer += ch;\n break;\n\n case ')':\n switch (getState()) {\n case 'value-paren':\n popState();\n break;\n case 'before-value':\n replaceState('value');\n break;\n }\n\n buffer += ch;\n break;\n\n default:\n switch (getState()) {\n case 'before-selector':\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-name':\n initializeToken('property');\n replaceState('name');\n break;\n\n case 'before-value':\n replaceState('value');\n break;\n\n case 'before-at-value':\n replaceState('at-value');\n break;\n }\n\n buffer += ch;\n break;\n }\n }\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return tokens;\n}\n","var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `parse()` and print the results.\n\nvar debug = require('./debug')('parse');\nvar lex = require('./lexer');\n\nexports = module.exports = parse;\n\nvar _comments; // Whether comments are allowed.\nvar _depth; // Current block nesting depth.\nvar _position; // Whether to include line/column position.\nvar _tokens; // Array of lexical tokens.\n\n/**\n * Convert a CSS string or array of lexical tokens into a `stringify`-able AST.\n *\n * @param {String} css CSS string or array of lexical token\n * @param {Object} [options]\n * @param {Boolean} [options.comments=false] allow comment nodes in the AST\n * @returns {Object} `stringify`-able AST\n */\nfunction parse(css, options) {\n var start; // Debug timer start.\n\n options || (options = {});\n _comments = !!options.comments;\n _position = !!options.position;\n\n _depth = 0;\n\n // Operate on a copy of the given tokens, or the lex()'d CSS string.\n _tokens = Array.isArray(css) ? css.slice() : lex(css);\n\n var rule;\n var rules = [];\n var token;\n\n TIMER && (start = Date.now());\n\n while ((token = next())) {\n rule = parseToken(token);\n rule && rules.push(rule);\n }\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return {\n type: \"stylesheet\",\n stylesheet: {\n rules: rules\n }\n };\n}\n\n// -- Functions --------------------------------------------------------------\n\n/**\n * Build an AST node from a lexical token.\n *\n * @param {Object} token lexical token\n * @param {Object} [override] object hash of properties that override those\n * already in the token, or that will be added to the token.\n * @returns {Object} AST node\n */\nfunction astNode(token, override) {\n override || (override = {});\n\n var key;\n var keys = ['type', 'name', 'value'];\n var node = {};\n\n // Avoiding [].forEach for performance reasons.\n for (var i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n if (token[key]) {\n node[key] = override[key] || token[key];\n }\n }\n\n keys = Object.keys(override);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n if (!node[key]) {\n node[key] = override[key];\n }\n }\n\n if (_position) {\n node.position = {\n start: token.start,\n end: token.end\n };\n }\n\n DEBUG && debug('astNode:', JSON.stringify(node, null, 2));\n\n return node;\n}\n\n/**\n * Remove a lexical token from the stack and return the removed token.\n *\n * @returns {Object} lexical token\n */\nfunction next() {\n var token = _tokens.shift();\n DEBUG && debug('next:', JSON.stringify(token, null, 2));\n return token;\n}\n\n// -- Parse* Functions ---------------------------------------------------------\n\n/**\n * Convert an @-group lexical token to an AST node.\n *\n * @param {Object} token @-group lexical token\n * @returns {Object} @-group AST node\n */\nfunction parseAtGroup(token) {\n _depth = _depth + 1;\n\n // As the @-group token is assembled, relevant token values are captured here\n // temporarily. They will later be used as `tokenize()` overrides.\n var overrides = {};\n\n switch (token.type) {\n case 'font-face':\n case 'viewport' :\n overrides.declarations = parseDeclarations();\n break;\n\n case 'page':\n overrides.prefix = token.prefix;\n overrides.declarations = parseDeclarations();\n break;\n\n default:\n overrides.prefix = token.prefix;\n overrides.rules = parseRules();\n }\n\n return astNode(token, overrides);\n}\n\n/**\n * Convert an @import lexical token to an AST node.\n *\n * @param {Object} token @import lexical token\n * @returns {Object} @import AST node\n */\nfunction parseAtImport(token) {\n return astNode(token);\n}\n\n/**\n * Convert an @charset token to an AST node.\n *\n * @param {Object} token @charset lexical token\n * @returns {Object} @charset node\n */\nfunction parseCharset(token) {\n return astNode(token);\n}\n\n/**\n * Convert a comment token to an AST Node.\n *\n * @param {Object} token comment lexical token\n * @returns {Object} comment node\n */\nfunction parseComment(token) {\n return astNode(token, {text: token.text});\n}\n\nfunction parseNamespace(token) {\n return astNode(token);\n}\n\n/**\n * Convert a property lexical token to a property AST node.\n *\n * @returns {Object} property node\n */\nfunction parseProperty(token) {\n return astNode(token);\n}\n\n/**\n * Convert a selector lexical token to a selector AST node.\n *\n * @param {Object} token selector lexical token\n * @returns {Object} selector node\n */\nfunction parseSelector(token) {\n function trim(str) {\n return str.trim();\n }\n\n return astNode(token, {\n type: 'rule',\n selectors: token.text.split(',').map(trim),\n declarations: parseDeclarations(token)\n });\n}\n\n/**\n * Convert a lexical token to an AST node.\n *\n * @returns {Object|undefined} AST node\n */\nfunction parseToken(token) {\n switch (token.type) {\n // Cases are listed in roughly descending order of probability.\n case 'property': return parseProperty(token);\n\n case 'selector': return parseSelector(token);\n\n case 'at-group-end': _depth = _depth - 1; return;\n\n case 'media' :\n case 'keyframes' :return parseAtGroup(token);\n\n case 'comment': if (_comments) { return parseComment(token); } break;\n\n case 'charset': return parseCharset(token);\n case 'import': return parseAtImport(token);\n\n case 'namespace': return parseNamespace(token);\n\n case 'font-face':\n case 'supports' :\n case 'viewport' :\n case 'document' :\n case 'page' : return parseAtGroup(token);\n }\n\n DEBUG && debug('parseToken: unexpected token:', JSON.stringify(token));\n}\n\n// -- Parse Helper Functions ---------------------------------------------------\n\n/**\n * Iteratively parses lexical tokens from the stack into AST nodes until a\n * conditional function returns `false`, at which point iteration terminates\n * and any AST nodes collected are returned.\n *\n * @param {Function} conditionFn\n * @param {Object} token the lexical token being parsed\n * @returns {Boolean} `true` if the token should be parsed, `false` otherwise\n * @return {Array} AST nodes\n */\nfunction parseTokensWhile(conditionFn) {\n var node;\n var nodes = [];\n var token;\n\n while ((token = next()) && (conditionFn && conditionFn(token))) {\n node = parseToken(token);\n node && nodes.push(node);\n }\n\n // Place an unused non-`end` lexical token back onto the stack.\n if (token && token.type !== 'end') {\n _tokens.unshift(token);\n }\n\n return nodes;\n}\n\n/**\n * Convert a series of tokens into a sequence of declaration AST nodes.\n *\n * @returns {Array} declaration nodes\n */\nfunction parseDeclarations() {\n return parseTokensWhile(function (token) {\n return (token.type === 'property' || token.type === 'comment');\n });\n}\n\n/**\n * Convert a series of tokens into a sequence of rule nodes.\n *\n * @returns {Array} rule nodes\n */\nfunction parseRules() {\n return parseTokensWhile(function () { return _depth; });\n}\n","var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `stringify()` and print the results.\n\nvar debug = require('./debug')('stringify');\n\nvar _comments; // Whether comments are allowed in the stringified CSS.\nvar _compress; // Whether the stringified CSS should be compressed.\nvar _indentation; // Indentation option value.\nvar _level; // Current indentation level.\nvar _n; // Compression-aware newline character.\nvar _s; // Compression-aware space character.\n\nexports = module.exports = stringify;\n\n/**\n * Convert a `stringify`-able AST into a CSS string.\n *\n * @param {Object} `stringify`-able AST\n * @param {Object} [options]\n * @param {Boolean} [options.comments=false] allow comments in the CSS\n * @param {Boolean} [options.compress=false] compress whitespace\n * @param {String} [options.indentation=''] indentation sequence\n * @returns {String} CSS\n */\nfunction stringify(ast, options) {\n var start; // Debug timer start.\n\n options || (options = {});\n _indentation = options.indentation || '';\n _compress = !!options.compress;\n _comments = !!options.comments;\n _level = 1;\n\n if (_compress) {\n _n = _s = '';\n } else {\n _n = '\\n';\n _s = ' ';\n }\n\n TIMER && (start = Date.now());\n\n var css = reduce(ast.stylesheet.rules, stringifyNode).join('\\n').trim();\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return css;\n}\n\n// -- Functions --------------------------------------------------------------\n\n/**\n * Modify the indentation level, or return a compression-aware sequence of\n * spaces equal to the current indentation level.\n *\n * @param {Number} [level=undefined] indentation level modifier\n * @returns {String} sequence of spaces\n */\nfunction indent(level) {\n if (level) {\n _level += level;\n return;\n }\n\n if (_compress) { return ''; }\n\n return Array(_level).join(_indentation || '');\n}\n\n// -- Stringify Functions ------------------------------------------------------\n\n/**\n * Stringify an @-rule AST node.\n *\n * Use `stringifyAtGroup()` when dealing with @-groups that may contain blocks\n * such as @media.\n *\n * @param {String} type @-rule type. E.g., import, charset\n * @returns {String} Stringified @-rule\n */\nfunction stringifyAtRule(node) {\n return '@' + node.type + ' ' + node.value + ';' + _n;\n}\n\n/**\n * Stringify an @-group AST node.\n *\n * Use `stringifyAtRule()` when dealing with @-rules that may not contain blocks\n * such as @import.\n *\n * @param {Object} node @-group AST node\n * @returns {String}\n */\nfunction stringifyAtGroup(node) {\n var label = '';\n var prefix = node.prefix || '';\n\n if (node.name) {\n label = ' ' + node.name;\n }\n\n // FIXME: @-rule conditional logic is leaking everywhere.\n var chomp = node.type !== 'page';\n\n return '@' + prefix + node.type + label + _s + stringifyBlock(node, chomp) + _n;\n}\n\n/**\n * Stringify a comment AST node.\n *\n * @param {Object} node comment AST node\n * @returns {String}\n */\nfunction stringifyComment(node) {\n if (!_comments) { return ''; }\n\n return '/*' + (node.text || '') + '*/' + _n;\n}\n\n/**\n * Stringify a rule AST node.\n *\n * @param {Object} node rule AST node\n * @returns {String}\n */\nfunction stringifyRule(node) {\n var label;\n\n if (node.selectors) {\n label = node.selectors.join(',' + _n);\n } else {\n label = '@' + node.type;\n label += node.name ? ' ' + node.name : '';\n }\n\n return indent() + label + _s + stringifyBlock(node) + _n;\n}\n\n\n// -- Stringify Helper Functions -----------------------------------------------\n\n/**\n * Reduce an array by applying a function to each item and retaining the truthy\n * results.\n *\n * When `item.type` is `'comment'` `stringifyComment` will be applied instead.\n *\n * @param {Array} items array to reduce\n * @param {Function} fn function to call for each item in the array\n * @returns {Mixed} Truthy values will be retained, falsy values omitted\n * @returns {Array} retained results\n */\nfunction reduce(items, fn) {\n return items.reduce(function (results, item) {\n var result = (item.type === 'comment') ? stringifyComment(item) : fn(item);\n result && results.push(result);\n return results;\n }, []);\n}\n\n/**\n * Stringify an AST node with the assumption that it represents a block of\n * declarations or other @-group contents.\n *\n * @param {Object} node AST node\n * @returns {String}\n */\n// FIXME: chomp should not be a magic boolean parameter\nfunction stringifyBlock(node, chomp) {\n var children = node.declarations;\n var fn = stringifyDeclaration;\n\n if (node.rules) {\n children = node.rules;\n fn = stringifyRule;\n }\n\n children = stringifyChildren(children, fn);\n children && (children = _n + children + (chomp ? '' : _n));\n\n return '{' + children + indent() + '}';\n}\n\n/**\n * Stringify an array of child AST nodes by calling the given stringify function\n * once for each child, and concatenating the results.\n *\n * @param {Array} children `node.rules` or `node.declarations`\n * @param {Function} fn stringify function\n * @returns {String}\n */\nfunction stringifyChildren(children, fn) {\n if (!children) { return ''; }\n\n indent(1);\n var results = reduce(children, fn);\n indent(-1);\n\n if (!results.length) { return ''; }\n\n return results.join(_n);\n}\n\n/**\n * Stringify a declaration AST node.\n *\n * @param {Object} node declaration AST node\n * @returns {String}\n */\nfunction stringifyDeclaration(node) {\n if (node.type === 'property') {\n return stringifyProperty(node);\n }\n\n DEBUG && debug('stringifyDeclaration: unexpected node:', JSON.stringify(node));\n}\n\n/**\n * Stringify an AST node.\n *\n * @param {Object} node AST node\n * @returns {String}\n */\nfunction stringifyNode(node) {\n switch (node.type) {\n // Cases are listed in roughly descending order of probability.\n case 'rule': return stringifyRule(node);\n\n case 'media' :\n case 'keyframes': return stringifyAtGroup(node);\n\n case 'comment': return stringifyComment(node);\n\n case 'import' :\n case 'charset' :\n case 'namespace': return stringifyAtRule(node);\n\n case 'font-face':\n case 'supports' :\n case 'viewport' :\n case 'document' :\n case 'page' : return stringifyAtGroup(node);\n }\n\n DEBUG && debug('stringifyNode: unexpected node: ' + JSON.stringify(node));\n}\n\n/**\n * Stringify an AST property node.\n *\n * @param {Object} node AST property node\n * @returns {String}\n */\nfunction stringifyProperty(node) {\n var name = node.name ? node.name + ':' + _s : '';\n\n return indent() + name + node.value + ';';\n}\n","module.exports = {\n lex : require('./lib/lexer'),\n parse: require('./lib/parser'),\n stringify: require('./lib/stringify')\n};\n","/*\r\nSlick Parser\r\n - originally created by the almighty Thomas Aylott <@subtlegradient> (http://subtlegradient.com)\r\n*/\"use strict\"\r\n\r\n// Notable changes from Slick.Parser 1.0.x\r\n\r\n// The parser now uses 2 classes: Expressions and Expression\r\n// `new Expressions` produces an array-like object containing a list of Expression objects\r\n// - Expressions::toString() produces a cleaned up expressions string\r\n// `new Expression` produces an array-like object\r\n// - Expression::toString() produces a cleaned up expression string\r\n// The only exposed method is parse, which produces a (cached) `new Expressions` instance\r\n// parsed.raw is no longer present, use .toString()\r\n// parsed.expression is now useless, just use the indices\r\n// parsed.reverse() has been removed for now, due to its apparent uselessness\r\n// Other changes in the Expressions object:\r\n// - classNames are now unique, and save both escaped and unescaped values\r\n// - attributes now save both escaped and unescaped values\r\n// - pseudos now save both escaped and unescaped values\r\n\r\nvar escapeRe = /([-.*+?^${}()|[\\]\\/\\\\])/g,\r\n unescapeRe = /\\\\/g\r\n\r\nvar escape = function(string){\r\n // XRegExp v2.0.0-beta-3\r\n // « https://github.com/slevithan/XRegExp/blob/master/src/xregexp.js\r\n return (string + \"\").replace(escapeRe, '\\\\$1')\r\n}\r\n\r\nvar unescape = function(string){\r\n return (string + \"\").replace(unescapeRe, '')\r\n}\r\n\r\nvar slickRe = RegExp(\r\n/*\r\n#!/usr/bin/env ruby\r\nputs \"\\t\\t\" + DATA.read.gsub(/\\(\\?x\\)|\\s+#.*$|\\s+|\\\\$|\\\\n/,'')\r\n__END__\r\n \"(?x)^(?:\\\r\n \\\\s* ( , ) \\\\s* # Separator \\n\\\r\n | \\\\s* ( + ) \\\\s* # Combinator \\n\\\r\n | ( \\\\s+ ) # CombinatorChildren \\n\\\r\n | ( + | \\\\* ) # Tag \\n\\\r\n | \\\\# ( + ) # ID \\n\\\r\n | \\\\. ( + ) # ClassName \\n\\\r\n | # Attribute \\n\\\r\n \\\\[ \\\r\n \\\\s* (+) (?: \\\r\n \\\\s* ([*^$!~|]?=) (?: \\\r\n \\\\s* (?:\\\r\n ([\\\"']?)(.*?)\\\\9 \\\r\n )\\\r\n ) \\\r\n )? \\\\s* \\\r\n \\\\](?!\\\\]) \\n\\\r\n | :+ ( + )(?:\\\r\n \\\\( (?:\\\r\n (?:([\\\"'])([^\\\\12]*)\\\\12)|((?:\\\\([^)]+\\\\)|[^()]*)+)\\\r\n ) \\\\)\\\r\n )?\\\r\n )\"\r\n*/\r\n\"^(?:\\\\s*(,)\\\\s*|\\\\s*(+)\\\\s*|(\\\\s+)|(+|\\\\*)|\\\\#(+)|\\\\.(+)|\\\\[\\\\s*(+)(?:\\\\s*([*^$!~|]?=)(?:\\\\s*(?:([\\\"']?)(.*?)\\\\9)))?\\\\s*\\\\](?!\\\\])|(:+)(+)(?:\\\\((?:(?:([\\\"'])([^\\\\13]*)\\\\13)|((?:\\\\([^)]+\\\\)|[^()]*)+))\\\\))?)\"\r\n .replace(//, '[' + escape(\">+~`!@$%^&={}\\\\;\") + ']')\r\n .replace(//g, '(?:[\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\r\n .replace(//g, '(?:[:\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\r\n)\r\n\r\n// Part\r\n\r\nvar Part = function Part(combinator){\r\n this.combinator = combinator || \" \"\r\n this.tag = \"*\"\r\n}\r\n\r\nPart.prototype.toString = function(){\r\n\r\n if (!this.raw){\r\n\r\n var xpr = \"\", k, part\r\n\r\n xpr += this.tag || \"*\"\r\n if (this.id) xpr += \"#\" + this.id\r\n if (this.classes) xpr += \".\" + this.classList.join(\".\")\r\n if (this.attributes) for (k = 0; part = this.attributes[k++];){\r\n xpr += \"[\" + part.name + (part.operator ? part.operator + '\"' + part.value + '\"' : '') + \"]\"\r\n }\r\n if (this.pseudos) for (k = 0; part = this.pseudos[k++];){\r\n xpr += \":\" + part.name\r\n if (part.value) xpr += \"(\" + part.value + \")\"\r\n }\r\n\r\n this.raw = xpr\r\n\r\n }\r\n\r\n return this.raw\r\n}\r\n\r\n// Expression\r\n\r\nvar Expression = function Expression(){\r\n this.length = 0\r\n}\r\n\r\nExpression.prototype.toString = function(){\r\n\r\n if (!this.raw){\r\n\r\n var xpr = \"\"\r\n\r\n for (var j = 0, bit; bit = this[j++];){\r\n if (j !== 1) xpr += \" \"\r\n if (bit.combinator !== \" \") xpr += bit.combinator + \" \"\r\n xpr += bit\r\n }\r\n\r\n this.raw = xpr\r\n\r\n }\r\n\r\n return this.raw\r\n}\r\n\r\nvar replacer = function(\r\n rawMatch,\r\n\r\n separator,\r\n combinator,\r\n combinatorChildren,\r\n\r\n tagName,\r\n id,\r\n className,\r\n\r\n attributeKey,\r\n attributeOperator,\r\n attributeQuote,\r\n attributeValue,\r\n\r\n pseudoMarker,\r\n pseudoClass,\r\n pseudoQuote,\r\n pseudoClassQuotedValue,\r\n pseudoClassValue\r\n){\r\n\r\n var expression, current\r\n\r\n if (separator || !this.length){\r\n expression = this[this.length++] = new Expression\r\n if (separator) return ''\r\n }\r\n\r\n if (!expression) expression = this[this.length - 1]\r\n\r\n if (combinator || combinatorChildren || !expression.length){\r\n current = expression[expression.length++] = new Part(combinator)\r\n }\r\n\r\n if (!current) current = expression[expression.length - 1]\r\n\r\n if (tagName){\r\n\r\n current.tag = unescape(tagName)\r\n\r\n } else if (id){\r\n\r\n current.id = unescape(id)\r\n\r\n } else if (className){\r\n\r\n var unescaped = unescape(className)\r\n\r\n var classes = current.classes || (current.classes = {})\r\n if (!classes[unescaped]){\r\n classes[unescaped] = escape(className)\r\n var classList = current.classList || (current.classList = [])\r\n classList.push(unescaped)\r\n classList.sort()\r\n }\r\n\r\n } else if (pseudoClass){\r\n\r\n pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue\r\n\r\n ;(current.pseudos || (current.pseudos = [])).push({\r\n type : pseudoMarker.length == 1 ? 'class' : 'element',\r\n name : unescape(pseudoClass),\r\n escapedName : escape(pseudoClass),\r\n value : pseudoClassValue ? unescape(pseudoClassValue) : null,\r\n escapedValue : pseudoClassValue ? escape(pseudoClassValue) : null\r\n })\r\n\r\n } else if (attributeKey){\r\n\r\n attributeValue = attributeValue ? escape(attributeValue) : null\r\n\r\n ;(current.attributes || (current.attributes = [])).push({\r\n operator : attributeOperator,\r\n name : unescape(attributeKey),\r\n escapedName : escape(attributeKey),\r\n value : attributeValue ? unescape(attributeValue) : null,\r\n escapedValue : attributeValue ? escape(attributeValue) : null\r\n })\r\n\r\n }\r\n\r\n return ''\r\n\r\n}\r\n\r\n// Expressions\r\n\r\nvar Expressions = function Expressions(expression){\r\n this.length = 0\r\n\r\n var self = this\r\n\r\n var original = expression, replaced\r\n\r\n while (expression){\r\n replaced = expression.replace(slickRe, function(){\r\n return replacer.apply(self, arguments)\r\n })\r\n if (replaced === expression) throw new Error(original + ' is an invalid expression')\r\n expression = replaced\r\n }\r\n}\r\n\r\nExpressions.prototype.toString = function(){\r\n if (!this.raw){\r\n var expressions = []\r\n for (var i = 0, expression; expression = this[i++];) expressions.push(expression)\r\n this.raw = expressions.join(\", \")\r\n }\r\n\r\n return this.raw\r\n}\r\n\r\nvar cache = {}\r\n\r\nvar parse = function(expression){\r\n if (expression == null) return null\r\n expression = ('' + expression).replace(/^\\s+|\\s+$/g, '')\r\n return cache[expression] || (cache[expression] = new Expressions(expression))\r\n}\r\n\r\nmodule.exports = parse\r\n","'use strict';\n\nvar parser = require('slick/parser');\n\nmodule.exports = exports = Selector;\n\n/**\n * CSS selector constructor.\n *\n * @param {String} selector text\n * @param {Array} optionally, precalculated specificity\n * @api public\n */\n\nfunction Selector(text, styleAttribute) {\n this.text = text;\n this.spec = undefined;\n this.styleAttribute = styleAttribute || false;\n}\n\n/**\n * Get parsed selector.\n *\n * @api public\n */\n\nSelector.prototype.parsed = function() {\n if (!this.tokens) { this.tokens = parse(this.text); }\n return this.tokens;\n};\n\n/**\n * Lazy specificity getter\n *\n * @api public\n */\n\nSelector.prototype.specificity = function() {\n var styleAttribute = this.styleAttribute;\n if (!this.spec) { this.spec = specificity(this.text, this.parsed()); }\n return this.spec;\n\n function specificity(text, parsed) {\n var expressions = parsed || parse(text);\n var spec = [styleAttribute ? 1 : 0, 0, 0, 0];\n var nots = [];\n\n for (var i = 0; i < expressions.length; i++) {\n var expression = expressions[i];\n var pseudos = expression.pseudos;\n\n // id awards a point in the second column\n if (expression.id) { spec[1]++; }\n\n // classes and attributes award a point each in the third column\n if (expression.attributes) { spec[2] += expression.attributes.length; }\n if (expression.classList) { spec[2] += expression.classList.length; }\n\n // tag awards a point in the fourth column\n if (expression.tag && expression.tag !== '*') { spec[3]++; }\n\n // pseudos award a point each in the fourth column\n if (pseudos) {\n spec[3] += pseudos.length;\n\n for (var p = 0; p < pseudos.length; p++) {\n if (pseudos[p].name === 'not') {\n nots.push(pseudos[p].value);\n spec[3]--;\n }\n }\n }\n }\n\n for (var ii = nots.length; ii--;) {\n var not = specificity(nots[ii]);\n for (var jj = 4; jj--;) { spec[jj] += not[jj]; }\n }\n\n return spec;\n }\n};\n\n/**\n * Parses a selector and returns the tokens.\n *\n * @param {String} selector\n * @api private.\n */\n\nfunction parse(text) {\n try {\n return parser(text)[0];\n } catch (e) {\n return [];\n }\n}\n","'use strict';\n\nmodule.exports = exports = Property;\n\n/**\n * Module dependencies.\n */\n\nvar utils = require('./utils');\n\n/**\n * CSS property constructor.\n *\n * @param {String} property\n * @param {String} value\n * @param {Selector} selector the property originates from\n * @param {Integer} priority 0 for normal properties, 2 for !important properties.\n * @param {Array} additional array of integers representing more detailed priorities (sorting)\n * @api public\n */\n\nfunction Property(prop, value, selector, priority, additionalPriority) {\n this.prop = prop;\n this.value = value;\n this.selector = selector;\n this.priority = priority || 0;\n this.additionalPriority = additionalPriority || [];\n}\n\n/**\n * Compares with another Property based on Selector#specificity.\n *\n * @api public\n */\n\nProperty.prototype.compareFunc = function(property) {\n var a = [];\n a.push.apply(a, this.selector.specificity());\n a.push.apply(a, this.additionalPriority);\n a[0] += this.priority;\n var b = [];\n b.push.apply(b, property.selector.specificity());\n b.push.apply(b, property.additionalPriority);\n b[0] += property.priority;\n return utils.compareFunc(a, b);\n};\n\nProperty.prototype.compare = function(property) {\n var winner = this.compareFunc(property);\n if (winner === 1) {\n return this;\n }\n return property;\n};\n\n\n/**\n * Returns CSS property\n *\n * @api public\n */\n\nProperty.prototype.toString = function() {\n return this.prop + ': ' + this.value.replace(/['\"]+/g, '') + ';';\n};\n","'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar mensch = require('mensch');\nvar Selector = require('./selector');\nvar Property = require('./property');\n\nexports.Selector = Selector;\nexports.Property = Property;\n\n/**\n * Returns an array of the selectors.\n *\n * @license Sizzle CSS Selector Engine - MIT\n * @param {String} selectorText from mensch\n * @api public\n */\n\nexports.extract = function extract(selectorText) {\n var attr = 0;\n var sels = [];\n var sel = '';\n\n for (var i = 0, l = selectorText.length; i < l; i++) {\n var c = selectorText.charAt(i);\n\n if (attr) {\n if (']' === c || ')' === c) { attr--; }\n sel += c;\n } else {\n if (',' === c) {\n sels.push(sel);\n sel = '';\n } else {\n if ('[' === c || '(' === c) { attr++; }\n if (sel.length || (c !== ',' && c !== '\\n' && c !== ' ')) { sel += c; }\n }\n }\n }\n\n if (sel.length) {\n sels.push(sel);\n }\n\n return sels;\n};\n\n/**\n * Returns a parse tree for a CSS source.\n * If it encounters multiple selectors separated by a comma, it splits the\n * tree.\n *\n * @param {String} css source\n * @api public\n */\n\nexports.parseCSS = function(css) {\n var parsed = mensch.parse(css, {position: true, comments: true});\n var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];\n var ret = [];\n\n for (var i = 0, l = rules.length; i < l; i++) {\n if (rules[i].type == 'rule') {\n var rule = rules[i];\n var selectors = rule.selectors;\n\n for (var ii = 0, ll = selectors.length; ii < ll; ii++) {\n ret.push([selectors[ii], rule.declarations]);\n }\n }\n }\n\n return ret;\n};\n\n/**\n * Returns preserved text for a CSS source.\n *\n * @param {String} css source\n * @param {Object} options\n * @api public\n */\n\nexports.getPreservedText = function(css, options, ignoredPseudos) {\n var parsed = mensch.parse(css, {position: true, comments: true});\n var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];\n var preserved = [];\n var lastStart = null;\n\n for (var i = rules.length - 1; i >= 0; i--) {\n if ((options.fontFaces && rules[i].type === 'font-face') ||\n (options.mediaQueries && rules[i].type === 'media') ||\n (options.keyFrames && rules[i].type === 'keyframes') ||\n (options.pseudos && rules[i].selectors && this.matchesPseudo(rules[i].selectors[0], ignoredPseudos))) {\n preserved.unshift(\n mensch.stringify(\n { stylesheet: { rules: [ rules[i] ] }},\n { comments: false, indentation: ' ' }\n )\n );\n }\n lastStart = rules[i].position.start;\n }\n\n if (preserved.length === 0) {\n return false;\n }\n return '\\n' + preserved.join('\\n') + '\\n';\n};\n\nexports.normalizeLineEndings = function(text) {\n return text.replace(/\\r\\n/g, '\\n').replace(/\\n/g, '\\r\\n');\n};\n\nexports.matchesPseudo = function(needle, haystack) {\n return haystack.find(function (element) {\n return needle.indexOf(element) > -1;\n })\n}\n\n/**\n * Compares two specificity vectors, returning the winning one.\n *\n * @param {Array} vector a\n * @param {Array} vector b\n * @return {Array}\n * @api public\n */\n\nexports.compareFunc = function(a, b) {\n var min = Math.min(a.length, b.length);\n for (var i = 0; i < min; i++) {\n if (a[i] === b[i]) { continue; }\n if (a[i] > b[i]) { return 1; }\n return -1;\n }\n\n return a.length - b.length;\n};\n\nexports.compare = function(a, b) {\n return exports.compareFunc(a, b) == 1 ? a : b;\n};\n\nexports.getDefaultOptions = function(options) {\n var result = Object.assign({\n extraCss: '',\n insertPreservedExtraCss: true,\n applyStyleTags: true,\n removeStyleTags: true,\n preserveMediaQueries: true,\n preserveFontFaces: true,\n preserveKeyFrames: true,\n preservePseudos: true,\n applyWidthAttributes: true,\n applyHeightAttributes: true,\n applyAttributesTableElements: true,\n url: ''\n }, options);\n\n result.webResources = result.webResources || {};\n\n return result;\n};\n","'use strict';\n\n/**\n * Module dependencies.\n */\nvar cheerio = require('cheerio');\nvar utils = require('./utils');\n\nvar cheerioLoad = function(html, options, encodeEntities) {\n options = Object.assign({decodeEntities: false, _useHtmlParser2:true}, options);\n html = encodeEntities(html);\n return cheerio.load(html, options);\n};\n\nvar createEntityConverters = function () {\n var codeBlockLookup = [];\n\n var encodeCodeBlocks = function(html) {\n var blocks = module.exports.codeBlocks;\n Object.keys(blocks).forEach(function(key) {\n var re = new RegExp(blocks[key].start + '([\\\\S\\\\s]*?)' + blocks[key].end, 'g');\n html = html.replace(re, function(match, subMatch) {\n codeBlockLookup.push(match);\n return 'JUICE_CODE_BLOCK_' + (codeBlockLookup.length - 1) + '_';\n });\n });\n return html;\n };\n\n var decodeCodeBlocks = function(html) {\n for(var index = 0; index < codeBlockLookup.length; index++) {\n var re = new RegExp('JUICE_CODE_BLOCK_' + index + '_(=\"\")?', 'gi');\n html = html.replace(re, function() {\n return codeBlockLookup[index];\n });\n }\n return html;\n };\n\n return {\n encodeEntities: encodeCodeBlocks,\n decodeEntities: decodeCodeBlocks,\n };\n};\n\n/**\n * Parses the input, calls the callback on the parsed DOM, and generates the output\n *\n * @param {String} html input html to be processed\n * @param {Object} options for the parser\n * @param {Function} callback to be invoked on the DOM\n * @param {Array} callbackExtraArguments to be passed to the callback\n * @return {String} resulting html\n */\nmodule.exports = function(html, options, callback, callbackExtraArguments) {\n var entityConverters = createEntityConverters();\n\n var $ = cheerioLoad(html, options, entityConverters.encodeEntities);\n var args = [ $ ];\n args.push.apply(args, callbackExtraArguments);\n var doc = callback.apply(undefined, args) || $;\n\n if (options && options.xmlMode) {\n return entityConverters.decodeEntities(doc.xml());\n }\n return entityConverters.decodeEntities(doc.html());\n};\n\nmodule.exports.codeBlocks = {\n EJS: { start: '<%', end: '%>' },\n HBS: { start: '{{', end: '}}' }\n};\n","'use strict';\n\n/**\n * Converts a decimal number to roman numeral.\n * https://stackoverflow.com/questions/9083037/convert-a-number-into-a-roman-numeral-in-javascript\n *\n * @param {Number} number\n * @api private.\n */\nexports.romanize = function(num) {\n if (isNaN(num))\n return NaN;\n var digits = String(+num).split(\"\"),\n key = [\"\",\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\n \"\",\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\n \"\",\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\"],\n roman = \"\",\n i = 3;\n while (i--)\n roman = (key[+digits.pop() + (i * 10)] || \"\") + roman;\n return Array(+digits.join(\"\") + 1).join(\"M\") + roman;\n}\n\n/**\n * Converts a decimal number to alphanumeric numeral.\n * https://stackoverflow.com/questions/45787459/convert-number-to-alphabet-string-javascript\n *\n * @param {Number} number\n * @api private.\n */\nexports.alphanumeric = function(num) {\n var s = '', t;\n\n while (num > 0) {\n t = (num - 1) % 26;\n s = String.fromCharCode(65 + t) + s;\n num = (num - t)/26 | 0;\n }\n return s || undefined;\n}","'use strict';\n\nvar utils = require('./utils');\nvar numbers = require('./numbers');\n\nmodule.exports = function makeJuiceClient(juiceClient) {\n\njuiceClient.ignoredPseudos = ['hover', 'active', 'focus', 'visited', 'link'];\njuiceClient.widthElements = ['TABLE', 'TD', 'TH', 'IMG'];\njuiceClient.heightElements = ['TABLE', 'TD', 'TH', 'IMG'];\njuiceClient.tableElements = ['TABLE', 'TH', 'TR', 'TD', 'CAPTION', 'COLGROUP', 'COL', 'THEAD', 'TBODY', 'TFOOT'];\njuiceClient.nonVisualElements = [ 'HEAD', 'TITLE', 'BASE', 'LINK', 'STYLE', 'META', 'SCRIPT', 'NOSCRIPT' ];\njuiceClient.styleToAttribute = {\n 'background-color': 'bgcolor',\n 'background-image': 'background',\n 'text-align': 'align',\n 'vertical-align': 'valign'\n};\njuiceClient.excludedProperties = [];\n\njuiceClient.juiceDocument = juiceDocument;\njuiceClient.inlineDocument = inlineDocument;\n\nfunction inlineDocument($, css, options) {\n\n options = options || {};\n var rules = utils.parseCSS(css);\n var editedElements = [];\n var styleAttributeName = 'style';\n var counters = {};\n\n if (options.styleAttributeName) {\n styleAttributeName = options.styleAttributeName;\n }\n\n rules.forEach(handleRule);\n editedElements.forEach(setStyleAttrs);\n\n if (options.inlinePseudoElements) {\n editedElements.forEach(inlinePseudoElements);\n }\n\n if (options.applyWidthAttributes) {\n editedElements.forEach(function(el) {\n setDimensionAttrs(el, 'width');\n });\n }\n\n if (options.applyHeightAttributes) {\n editedElements.forEach(function(el) {\n setDimensionAttrs(el, 'height');\n });\n }\n\n if (options.applyAttributesTableElements) {\n editedElements.forEach(setAttributesOnTableElements);\n }\n\n if (options.insertPreservedExtraCss && options.extraCss) {\n var preservedText = utils.getPreservedText(options.extraCss, {\n mediaQueries: options.preserveMediaQueries,\n fontFaces: options.preserveFontFaces,\n keyFrames: options.preserveKeyFrames\n });\n if (preservedText) {\n var $appendTo = null;\n if (options.insertPreservedExtraCss !== true) {\n $appendTo = $(options.insertPreservedExtraCss);\n } else {\n $appendTo = $('head');\n if (!$appendTo.length) { $appendTo = $('body'); }\n if (!$appendTo.length) { $appendTo = $.root(); }\n }\n\n $appendTo.first().append('');\n }\n }\n\n function handleRule(rule) {\n var sel = rule[0];\n var style = rule[1];\n var selector = new utils.Selector(sel);\n var parsedSelector = selector.parsed();\n\n if (!parsedSelector) {\n return;\n }\n\n var pseudoElementType = getPseudoElementType(parsedSelector);\n\n // skip rule if the selector has any pseudos which are ignored\n for (var i = 0; i < parsedSelector.length; ++i) {\n var subSel = parsedSelector[i];\n if (subSel.pseudos) {\n for (var j = 0; j < subSel.pseudos.length; ++j) {\n var subSelPseudo = subSel.pseudos[j];\n if (juiceClient.ignoredPseudos.indexOf(subSelPseudo.name) >= 0) {\n return;\n }\n }\n }\n }\n\n if (pseudoElementType) {\n var last = parsedSelector[parsedSelector.length - 1];\n var pseudos = last.pseudos;\n last.pseudos = filterElementPseudos(last.pseudos);\n sel = parsedSelector.toString();\n last.pseudos = pseudos;\n }\n\n var els;\n try {\n els = $(sel);\n } catch (err) {\n // skip invalid selector\n return;\n }\n\n els.each(function() {\n var el = this;\n\n if (el.name && juiceClient.nonVisualElements.indexOf(el.name.toUpperCase()) >= 0) {\n return;\n }\n\n if (pseudoElementType) {\n var pseudoElPropName = 'pseudo' + pseudoElementType;\n var pseudoEl = el[pseudoElPropName];\n if (!pseudoEl) {\n pseudoEl = el[pseudoElPropName] = $('').get(0);\n pseudoEl.pseudoElementType = pseudoElementType;\n pseudoEl.pseudoElementParent = el;\n pseudoEl.counterProps = el.counterProps;\n el[pseudoElPropName] = pseudoEl;\n }\n el = pseudoEl;\n }\n\n if (!el.styleProps) {\n el.styleProps = {};\n\n // if the element has inline styles, fake selector with topmost specificity\n if ($(el).attr(styleAttributeName)) {\n var cssText = '* { ' + $(el).attr(styleAttributeName) + ' } ';\n addProps(utils.parseCSS(cssText)[0][1], new utils.Selector('`;\n }\n\n computeStyle() {\n // 计算需要append进富文本的style\n const mathStyle = this.getStyleFromSheets('mjx-container');\n const cherryStyle = this.getStyleFromSheets('cherry');\n const echartStyle =\n '';\n return {\n mathStyle,\n echartStyle,\n cherryStyle,\n };\n }\n\n /**\n * 由于复制操作会随着预览区域的内容增加而耗时变长,所以需要增加“正在复制”的状态回显\n * 同时该状态也用于限频\n */\n toggleLoading() {\n // 切换loading状态\n if (this.isLoading) {\n const loadingButton = document.querySelector('.icon-loading');\n loadingButton.outerHTML = ``;\n } else {\n const copyButton = document.querySelector('.ch-icon-copy');\n copyButton.outerHTML = '';\n }\n this.isLoading = !this.isLoading;\n }\n\n /**\n * 响应点击事件\n * 该按钮不会引发编辑区域的内容改动,所以不用处理用户在编辑区域的选中内容\n * @param {Event} e 点击事件\n */\n onClick(e) {\n this.toggleLoading();\n const inlineCodeTheme = document.querySelector('.cherry').getAttribute('data-inline-code-theme');\n const codeBlockTheme = document.querySelector('.cherry').getAttribute('data-code-block-theme');\n const { mathStyle, echartStyle, cherryStyle } = this.computeStyle();\n const html = this.previewer.isPreviewerHidden()\n ? this.previewer.options.previewerCache.html\n : this.previewer.getValue();\n // 将css样式以行内样式的形式插入到html内容里\n this.adaptWechat(html).then((html) => {\n copyToClip(\n juice(\n `
\n
${html}
\n
${mathStyle + echartStyle + cherryStyle}`,\n ),\n );\n this.toggleLoading();\n });\n }\n}\n\n/**\n * 将图片转成base64,防止出现由于图片防盗链功能导致图裂的情况\n * @param {string} url 图片的地址\n * @param {Function} [callback] 回调函数,本函数不处理该参数\n * @param {string} [outputFormat]\n * @returns {Promise} img node\n */\nfunction convertImgToBase64(url, callback, outputFormat) {\n return new Promise((resolve) => {\n let canvas = /** @type {HTMLCanvasElement}*/ (document.createElement('CANVAS'));\n const ctx = canvas.getContext('2d');\n const img = new Image();\n img.crossOrigin = 'Anonymous';\n img.onload = function () {\n canvas.height = img.height;\n canvas.width = img.width;\n ctx.drawImage(img, 0, 0);\n const dataURL = canvas.toDataURL(outputFormat || 'image/png');\n resolve(dataURL);\n canvas = null;\n };\n img.src = url;\n });\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport MenuBase from '@/toolbars/MenuBase';\nimport { getPanelRule } from '@/utils/regexp';\nimport { getSelection } from '@/utils/selection';\n/**\n * 插入面板\n */\nexport default class Panel extends MenuBase {\n constructor($cherry) {\n super($cherry);\n this.setName('panel', 'tips');\n this.panelRule = getPanelRule().reg;\n this.subMenuConfig = [\n {\n iconName: 'tips',\n name: 'tips',\n onclick: this.bindSubClick.bind(this, 'primary'),\n },\n {\n iconName: 'info',\n name: 'info',\n onclick: this.bindSubClick.bind(this, 'info'),\n },\n {\n iconName: 'warning',\n name: 'warning',\n onclick: this.bindSubClick.bind(this, 'warning'),\n },\n {\n iconName: 'danger',\n name: 'danger',\n onclick: this.bindSubClick.bind(this, 'danger'),\n },\n {\n iconName: 'success',\n name: 'success',\n onclick: this.bindSubClick.bind(this, 'success'),\n },\n ];\n }\n\n /**\n * 从字符串中找打面板的name\n * @param {string} str\n * @returns {string | false}\n */\n $getNameFromStr(str) {\n let ret = false;\n this.panelRule.lastIndex = 0;\n str.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = /\\s/.test(name.trim()) ? name.trim().replace(/\\s.*$/, '') : name;\n ret = $name ? $name.trim().toLowerCase() : '';\n return match;\n });\n return ret;\n }\n\n $getTitle(str) {\n this.panelRule.lastIndex = 0;\n str.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = name.trim();\n return /\\s/.test($name) ? $name.replace(/[^\\s]+\\s/, '') : '';\n });\n return '';\n }\n\n /**\n * 响应点击事件\n * @param {string} selection 被用户选中的文本内容\n * @param {string} shortKey 快捷键参数\n * @returns {string} 回填到编辑器光标位置/选中文本区域的内容\n */\n onClick(selection, shortKey = '') {\n let $selection = getSelection(this.editor.editor, selection, 'line', true) || '内容';\n let currentName = this.$getNameFromStr($selection);\n let title = this.$getTitle($selection);\n if (currentName === false) {\n // 如果没有命中面板语法,则尝试扩大选区\n this.getMoreSelection('::: ', '\\n', () => {\n const newSelection = this.editor.editor.getSelection();\n const isMatch = this.$getNameFromStr(newSelection);\n if (isMatch !== false) {\n $selection = newSelection;\n currentName = isMatch;\n title = this.$getTitle(newSelection);\n }\n return isMatch !== false;\n });\n }\n if (currentName !== false) {\n // 如果命中了面板语法,则尝试去掉语法或者变更语法\n if (currentName === shortKey) {\n // 去掉面板语法\n this.panelRule.lastIndex = 0;\n return $selection.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = name.trim();\n const $title = /\\s/.test($name) ? $name.replace(/[^\\s]+\\s/, '') : '';\n return `${$title}\\n${content}`;\n });\n }\n // 修改name\n this.registerAfterClickCb(() => {\n this.setLessSelection('::: ', '\\n');\n });\n this.panelRule.lastIndex = 0;\n return $selection.replace(this.panelRule, (match, preLines, name, content) => {\n const $name = name.trim();\n const $title = /\\s/.test($name) ? $name.replace(/[^\\s]+\\s/, '') : '';\n return `::: ${shortKey} ${$title}\\n${content.replace(/\\n+$/, '')}\\n:::`;\n });\n }\n this.registerAfterClickCb(() => {\n this.setLessSelection('::: ', '\\n');\n });\n $selection = $selection.replace(/^\\n+/, '');\n if (/\\n/.test($selection)) {\n if (!title) {\n title = $selection.replace(/\\n[\\w\\W]+$/, '');\n $selection = $selection.replace(/^[^\\n]+\\n/, '');\n }\n } else {\n title = title ? title : '标题';\n }\n return `::: ${shortKey} ${title}\\n${$selection}\\n:::`.replace(/\\n{2,}:::/g, '\\n:::');\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Panel from './Panel';\nimport { getPanelRule } from '@/utils/regexp';\n/**\n * 插入对齐方式\n */\nexport default class Justify extends Panel {\n constructor($cherry) {\n super($cherry);\n this.setName('justify', 'justify');\n this.panelRule = getPanelRule().reg;\n this.subMenuConfig = [\n {\n iconName: 'justifyLeft',\n name: '左对齐',\n onclick: this.bindSubClick.bind(this, 'left'),\n },\n {\n iconName: 'justifyCenter',\n name: '居中',\n onclick: this.bindSubClick.bind(this, 'center'),\n },\n {\n iconName: 'justifyRight',\n name: '右对齐',\n onclick: this.bindSubClick.bind(this, 'right'),\n },\n ];\n }\n\n $getTitle() {\n return ' ';\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport MenuBase from '@/toolbars/MenuBase';\nimport { getDetailRule } from '@/utils/regexp';\nimport { getSelection } from '@/utils/selection';\n/**\n * 插入手风琴\n */\nexport default class Detail extends MenuBase {\n constructor($cherry) {\n super($cherry);\n this.setName('detail', 'insertFlow');\n this.detailRule = getDetailRule().reg;\n }\n\n /**\n * 响应点击事件\n * @param {string} selection 被用户选中的文本内容\n * @returns {string} 回填到编辑器光标位置/选中文本区域的内容\n */\n onClick(selection) {\n let $selection =\n getSelection(this.editor.editor, selection, 'line', true) ||\n '点击展开更多\\n内容\\n++- 默认展开\\n内容\\n++ 默认收起\\n内容';\n this.detailRule.lastIndex = 0;\n if (!this.detailRule.test($selection)) {\n // 如果没有命中手风琴语法,则尝试扩大选区\n this.getMoreSelection('+++ ', '\\n', () => {\n const newSelection = this.editor.editor.getSelection();\n this.detailRule.lastIndex = 0;\n const isMatch = this.detailRule.test(newSelection);\n if (isMatch !== false) {\n $selection = newSelection;\n }\n return isMatch !== false;\n });\n }\n this.detailRule.lastIndex = 0;\n if (this.detailRule.test($selection)) {\n // 如果命中了手风琴语法,则去掉手风琴语法\n this.detailRule.lastIndex = 0;\n return $selection.replace(this.detailRule, (match, preLines, isOpen, title, content) => {\n return `${title}\\n${content}`;\n });\n }\n // 去掉开头的空格\n $selection = $selection.replace(/^\\s+/, '');\n // 如果选中的内容不包含换行,则强制增加一个换行\n if (!/\\n/.test($selection)) {\n $selection = `${$selection}\\n${$selection}`;\n }\n this.registerAfterClickCb(() => {\n this.setLessSelection('+++ ', '\\n');\n });\n return `+++ ${$selection}\\n+++`.replace(/\\n{2,}\\+\\+\\+/g, '\\n+++');\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport MenuBase from '@/toolbars/MenuBase';\nimport { drawioDialog } from '@/utils/dialog';\n/**\n * 打开draw.io画图对话框,点击确定后向编辑器插入图片语法\n */\nexport default class DrawIo extends MenuBase {\n constructor($cherry) {\n super($cherry);\n this.setName('draw.io', 'draw.io');\n this.noIcon = true;\n this.drawioIframeUrl = $cherry.options.drawioIframeUrl;\n }\n\n /**\n * 响应点击事件\n * @param {string} selection 被用户选中的文本内容\n * @param {string} shortKey 快捷键参数,本函数不处理这个参数\n * @returns {string} 回填到编辑器光标位置/选中文本区域的内容\n */\n onClick(selection, shortKey = '') {\n if (!this.drawioIframeUrl) {\n // 如果没有配置drawio的编辑页URL,则直接失效\n return selection;\n }\n if (this.hasCacheOnce()) {\n // @ts-ignore\n const { xmlData, base64 } = this.getAndCleanCacheOnce();\n const begin = '![';\n const end = `](${base64}){data-type=drawio data-xml=${encodeURI(xmlData)}}`;\n this.registerAfterClickCb(() => {\n this.setLessSelection(begin, end);\n });\n return `${begin}在预览区点击图片重新编辑draw.io${end}`;\n }\n // 插入图片,调用上传文件逻辑\n drawioDialog(this.drawioIframeUrl, '', (data) => {\n this.setCacheOnce(data);\n this.fire(null);\n });\n this.updateMarkdown = false;\n return selection;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * 工具栏各个实例的注册中心\n */\nimport Bold from './hooks/Bold';\nimport Italic from './hooks/Italic';\nimport Split from './hooks/Split';\nimport Strikethrough from './hooks/Strikethrough';\nimport Sub from './hooks/Sub';\nimport Sup from './hooks/Sup';\nimport Color from './hooks/Color';\nimport Header from './hooks/Header';\nimport Insert from './hooks/Insert';\nimport List from './hooks/List';\nimport Ol from './hooks/Ol';\nimport Ul from './hooks/Ul';\nimport CheckList from './hooks/CheckList';\nimport Graph from './hooks/Graph';\nimport Size from './hooks/Size';\nimport H1 from './hooks/H1';\nimport H2 from './hooks/H2';\nimport H3 from './hooks/H3';\nimport Quote from './hooks/Quote';\nimport QuickTable from './hooks/QuickTable';\nimport TogglePreview from './hooks/TogglePreview';\nimport FullScreen from './hooks/FullScreen';\nimport Undo from './hooks/Undo';\nimport Redo from './hooks/Redo';\nimport Code from './hooks/Code';\nimport CodeTheme from './hooks/CodeTheme';\nimport Export from './hooks/Export';\nimport Settings from './hooks/Settings';\nimport Underline from './hooks/Underline';\nimport SwitchModel from './hooks/SwitchModel';\nimport Image from './hooks/Image';\nimport Audio from './hooks/Audio';\nimport Video from './hooks/Video';\nimport Br from './hooks/Br';\nimport Hr from './hooks/Hr';\nimport Formula from './hooks/Formula';\nimport Link from './hooks/Link';\nimport Table from './hooks/Table';\nimport Toc from './hooks/Toc';\nimport LineTable from './hooks/LineTable';\nimport BarTable from './hooks/BarTable';\nimport Pdf from './hooks/Pdf';\nimport File from './hooks/File';\nimport Word from './hooks/Word';\nimport Ruby from './hooks/Ruby';\nimport Theme from './hooks/Theme';\nimport ChatGpt from './hooks/ChatGpt';\n// Sidebar\nimport MobilePreview from './hooks/MobilePreview';\nimport Copy from './hooks/Copy';\nimport Panel from './hooks/Panel';\nimport Justify from './hooks/Justify';\nimport Detail from './hooks/Detail';\nimport DrawIo from './hooks/DrawIo';\n\n// 定义默认支持的工具栏\n// 目前不支持按需动态加载\n// 如果对CherryMarkdown构建后的文件大小有比较严格的要求,可以根据实际情况删减hook\nconst HookList = {\n bold: Bold,\n italic: Italic,\n '|': Split,\n strikethrough: Strikethrough,\n sub: Sub,\n sup: Sup,\n header: Header,\n insert: Insert,\n list: List,\n ol: Ol,\n ul: Ul,\n checklist: CheckList,\n graph: Graph,\n size: Size,\n h1: H1,\n h2: H2,\n h3: H3,\n color: Color,\n quote: Quote,\n quickTable: QuickTable,\n togglePreview: TogglePreview,\n code: Code,\n codeTheme: CodeTheme,\n export: Export,\n settings: Settings,\n fullScreen: FullScreen,\n mobilePreview: MobilePreview,\n copy: Copy,\n undo: Undo,\n redo: Redo,\n underline: Underline,\n switchModel: SwitchModel,\n image: Image,\n audio: Audio,\n video: Video,\n br: Br,\n hr: Hr,\n formula: Formula,\n link: Link,\n table: Table,\n toc: Toc,\n lineTable: LineTable,\n barTable: BarTable,\n pdf: Pdf,\n word: Word,\n ruby: Ruby,\n theme: Theme,\n file: File,\n panel: Panel,\n justify: Justify,\n detail: Detail,\n drawIo: DrawIo,\n chatgpt: ChatGpt,\n};\n\nexport default class HookCenter {\n constructor(toolbar) {\n this.toolbar = toolbar;\n /**\n * @type {{[key: string]: import('@/toolbars/MenuBase').default}} 保存所有菜单实例\n */\n this.hooks = {};\n /**\n * @type {string[]} 所有注册的菜单名称\n */\n this.allMenusName = [];\n /**\n * @type {string[]} 一级菜单的名称\n */\n this.level1MenusName = [];\n /**\n * @type {{ [parentName: string]: string[]}} 二级菜单的名称, e.g. {一级菜单名称: [二级菜单名称1, 二级菜单名称2]}\n */\n this.level2MenusName = {};\n this.init();\n }\n\n $newMenu(name) {\n if (this.hooks[name]) {\n return;\n }\n const { $cherry, customMenu } = this.toolbar.options;\n if (HookList[name]) {\n this.allMenusName.push(name);\n this.hooks[name] = new HookList[name]($cherry);\n } else if (customMenu !== undefined && customMenu !== null && customMenu[name]) {\n this.allMenusName.push(name);\n // 如果是自定义菜单,传参兼容旧版\n this.hooks[name] = new customMenu[name]($cherry);\n }\n }\n\n /**\n * 根据配置动态渲染、绑定工具栏\n * @returns\n */\n init() {\n const { buttonConfig } = this.toolbar.options;\n buttonConfig.forEach((item) => {\n if (typeof item === 'string') {\n this.level1MenusName.push(item);\n this.$newMenu(item);\n } else if (typeof item === 'object') {\n const keys = Object.keys(item);\n if (keys.length === 1) {\n // 只接受形如{ name: [ subMenu ] }的参数\n const [name] = keys;\n this.level1MenusName.push(name);\n this.$newMenu(name);\n this.level2MenusName[name] = item[name];\n item[name].forEach((subItem) => {\n this.$newMenu(subItem);\n });\n }\n }\n });\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { mac } from 'codemirror/src/util/browser';\nimport HookCenter from './HookCenter';\nimport Event from '@/Event';\nimport { createElement } from '@/utils/dom';\nimport Logger from '@/Logger';\n\nexport default class Toolbar {\n /**\n * @type {Record} 外部获取 toolbarHandler\n */\n toolbarHandlers = {};\n\n constructor(options) {\n // 存储所有菜单的实例\n this.menus = {};\n // 存储所有快捷键的影射 {快捷键: 菜单名称}\n this.shortcutKeyMap = {};\n // 存储所有二级菜单面板\n this.subMenus = {};\n // 默认的菜单配置\n this.options = {\n dom: document.createElement('div'),\n buttonConfig: ['bold'],\n customMenu: [],\n buttonRightConfig: [],\n };\n\n Object.assign(this.options, options);\n this.$cherry = this.options.$cherry;\n this.instanceId = this.$cherry.instanceId;\n this.menus = new HookCenter(this);\n this.drawMenus();\n this.init();\n }\n\n init() {\n this.collectShortcutKey();\n this.collectToolbarHandler();\n Event.on(this.instanceId, Event.Events.cleanAllSubMenus, () => this.hideAllSubMenu());\n }\n\n previewOnly() {\n this.options.dom.classList.add('preview-only');\n Event.emit(this.instanceId, Event.Events.toolbarHide);\n }\n\n showToolbar() {\n this.options.dom.classList.remove('preview-only');\n Event.emit(this.instanceId, Event.Events.toolbarShow);\n }\n\n isHasLevel2Menu(name) {\n // FIXME: return boolean\n return this.menus.level2MenusName[name];\n }\n\n isHasConfigMenu(name) {\n // FIXME: return boolean\n return this.menus.hooks[name].subMenuConfig || [];\n }\n\n /**\n * 判断是否有子菜单,目前有两种子菜单配置方式:1、通过`subMenuConfig`属性 2、通过`buttonConfig`配置属性\n * @param {string} name\n * @returns {boolean} 是否有子菜单\n */\n isHasSubMenu(name) {\n return Boolean(this.isHasLevel2Menu(name) || this.isHasConfigMenu(name).length > 0);\n }\n\n /**\n * 根据配置画出来一级工具栏\n */\n drawMenus() {\n const fragLeft = document.createDocumentFragment();\n const toolbarLeft = createElement('div', 'toolbar-left');\n\n this.menus.level1MenusName.forEach((name) => {\n const btn = this.menus.hooks[name].createBtn();\n btn.addEventListener(\n 'click',\n (event) => {\n this.onClick(event, name);\n },\n false,\n );\n if (this.isHasSubMenu(name)) {\n btn.classList.add('cherry-toolbar-dropdown');\n }\n fragLeft.appendChild(btn);\n });\n\n toolbarLeft.appendChild(fragLeft);\n this.options.dom.appendChild(toolbarLeft);\n\n this.options.buttonRightConfig?.length ? this.drawRightMenus(this.options.buttonRightConfig) : null;\n }\n /**\n * 根据配置画出来右侧一级工具栏\n */\n drawRightMenus(buttonRightConfig) {\n const toolbarRight = createElement('div', 'toolbar-right');\n const fragRight = document.createDocumentFragment();\n const rightOptions = {\n options: {\n $cherry: this.$cherry,\n buttonConfig: buttonRightConfig,\n customMenu: [],\n },\n };\n\n const rightMenus = new HookCenter(rightOptions);\n\n rightMenus.level1MenusName.forEach((name) => {\n const btn = rightMenus.hooks[name].createBtn();\n btn.addEventListener(\n 'click',\n (event) => {\n console.log('第一次点击');\n rightMenus.hooks[name].fire(event, name);\n },\n false,\n );\n fragRight.appendChild(btn);\n });\n\n toolbarRight.appendChild(fragRight);\n this.options.dom.appendChild(toolbarRight);\n }\n\n drawSubMenus(name) {\n const menu = this.menus.hooks[name];\n const pos = menu.getMenuPosition();\n this.subMenus[name] = createElement('div', 'cherry-dropdown', { name });\n this.subMenus[name].style.left = `${pos.left + pos.width / 2}px`;\n this.subMenus[name].style.top = `${pos.top + pos.height}px`;\n this.subMenus[name].style.position = menu.positionModel;\n // 如果有配置的二级菜单\n const level2MenusName = this.isHasLevel2Menu(name);\n if (level2MenusName) {\n level2MenusName.forEach((level2Name) => {\n const subMenu = this.menus.hooks[level2Name];\n if (subMenu !== undefined && typeof subMenu.createBtn === 'function') {\n const btn = subMenu.createBtn(true);\n // 二级菜单的dom认定为一级菜单的\n subMenu.dom = subMenu.dom ? subMenu.dom : this.menus.hooks[name].dom;\n btn.addEventListener('click', (event) => this.onClick(event, level2Name, true), false);\n this.subMenus[name].appendChild(btn);\n }\n });\n }\n // 兼容旧版本配置的二级菜单\n const subMenuConfig = this.isHasConfigMenu(name);\n if (subMenuConfig.length > 0) {\n subMenuConfig.forEach((config) => {\n const btn = this.menus.hooks[name].createSubBtnByConfig(config);\n btn.addEventListener('click', () => this.hideAllSubMenu(), false);\n this.subMenus[name].appendChild(btn);\n });\n }\n this.$cherry.wrapperDom.appendChild(this.subMenus[name]);\n }\n\n /**\n * 处理点击事件\n */\n onClick(event, name, focusEvent = false) {\n const menu = this.menus.hooks[name];\n if (!menu) {\n return;\n }\n if (this.isHasSubMenu(name) && !focusEvent) {\n this.toggleSubMenu(name);\n } else {\n this.hideAllSubMenu();\n menu.fire(event, name);\n }\n }\n\n /**\n * 展开/收起二级菜单\n */\n toggleSubMenu(name) {\n if (!this.subMenus[name]) {\n // 如果没有二级菜单,则先画出来,然后再显示\n this.hideAllSubMenu();\n this.drawSubMenus(name);\n this.subMenus[name].style.display = 'block';\n return;\n }\n if (this.subMenus[name].style.display === 'none') {\n // 如果是隐藏的,则先隐藏所有二级菜单,再显示当前二级菜单\n this.hideAllSubMenu();\n this.subMenus[name].style.display = 'block';\n } else {\n // 如果是显示的,则隐藏当前二级菜单\n this.subMenus[name].style.display = 'none';\n }\n }\n\n /**\n * 隐藏所有的二级菜单\n */\n hideAllSubMenu() {\n this.$cherry.wrapperDom.querySelectorAll('.cherry-dropdown').forEach((dom) => {\n dom.style.display = 'none';\n });\n }\n\n /**\n * 收集快捷键\n */\n collectShortcutKey() {\n this.menus.allMenusName.forEach((name) => {\n this.menus.hooks[name].shortcutKeys?.forEach((key) => {\n this.shortcutKeyMap[key] = name;\n });\n });\n }\n\n collectToolbarHandler() {\n this.toolbarHandlers = this.menus.allMenusName.reduce((handlerMap, name) => {\n const menuHook = this.menus.hooks[name];\n if (!menuHook) {\n return handlerMap;\n }\n handlerMap[name] = (shortcut, _callback) => {\n if (typeof _callback === 'function') {\n Logger.warn(\n 'MenuBase#onClick param callback is no longer supported. Please register the callback via MenuBase#registerAfterClickCb instead.',\n );\n }\n menuHook.fire.call(menuHook, undefined, shortcut);\n };\n return handlerMap;\n }, {});\n }\n\n /**\n * 监测是否有对应的快捷键\n * @param {KeyboardEvent} evt keydown 事件\n * @returns {boolean} 是否有对应的快捷键\n */\n matchShortcutKey(evt) {\n return !!this.shortcutKeyMap[this.getCurrentKey(evt)];\n }\n\n /**\n * 触发对应快捷键的事件\n * @param {KeyboardEvent} evt\n */\n fireShortcutKey(evt) {\n const currentKey = this.getCurrentKey(evt);\n this.menus.hooks[this.shortcutKeyMap[currentKey]]?.fire(evt, currentKey);\n }\n\n /**\n * 格式化当前按键,mac下的command按键转换为ctrl\n * @param {KeyboardEvent} event\n * @returns\n */\n getCurrentKey(event) {\n let key = '';\n if (event.ctrlKey) {\n key += 'Ctrl-';\n }\n\n if (event.altKey) {\n key += 'Alt-';\n }\n\n if (event.metaKey && mac) {\n key += 'Ctrl-';\n }\n\n // 如果存在shift键\n if (event.shiftKey) {\n key += `Shift-`;\n }\n\n // 如果还有第三个键 且不是 shift键\n if (event.key && event.key.toLowerCase() !== 'shift') {\n key += event.key.toLowerCase();\n }\n\n return key;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Toolbar from './Toolbar';\n/**\n * 在编辑区域选中文本时浮现的bubble工具栏\n */\nexport default class Bubble extends Toolbar {\n /**\n * @type {'flex' | 'block'}\n */\n static displayType = 'flex';\n // constructor(options) {\n // super(options);\n // }\n\n set visible(visible) {\n const bubbleStyle = window.getComputedStyle(this.bubbleDom);\n if (visible) {\n bubbleStyle.display === 'none' && (this.bubbleDom.style.display = Bubble.displayType);\n // bubbleStyle.visibility !== 'visible' && (this.bubbleBottom.style.visibility = 'visible');\n } else {\n bubbleStyle.display !== 'none' && (this.bubbleDom.style.display = 'none');\n // bubbleStyle.visibility !== 'hidden' && (this.bubbleBottom.style.visibility = 'hidden');\n }\n }\n\n get visible() {\n const bubbleStyle = window.getComputedStyle(this.bubbleDom);\n return bubbleStyle.display !== 'none' && bubbleStyle.visibility !== 'hidden';\n }\n\n init() {\n this.options.editor = this.$cherry.editor;\n this.addSelectionChangeListener();\n this.bubbleDom = this.options.dom;\n this.editorDom = this.options.editor.getEditorDom();\n this.initBubbleDom();\n this.editorDom.querySelector('.CodeMirror').appendChild(this.bubbleDom);\n }\n\n /**\n * 计算编辑区域的偏移量\n * @returns {number} 编辑区域的滚动区域\n */\n getScrollTop() {\n return this.options.editor.editor.getScrollInfo().top;\n }\n\n /**\n * 当编辑区域滚动的时候自动隐藏bubble工具栏和子工具栏\n */\n updatePositionWhenScroll() {\n if (this.bubbleDom.style.display === Bubble.displayType) {\n this.bubbleDom.style.marginTop = `${parseFloat(this.bubbleDom.dataset.scrollTop) - this.getScrollTop()}px`;\n }\n }\n\n /**\n * 根据高度计算bubble工具栏出现的位置的高度\n * 根据宽度计算bubble工具栏出现的位置的left值,以及bubble工具栏三角箭头的left值\n * @param {number} top 高度\n * @param {number} width 选中文本内容的宽度\n */\n showBubble(top, width) {\n if (!this.visible) {\n this.visible = true;\n this.bubbleDom.style.marginTop = '0';\n this.bubbleDom.dataset.scrollTop = String(this.getScrollTop());\n }\n const positionLimit = this.editorDom.querySelector('.CodeMirror-lines').firstChild.getBoundingClientRect();\n const editorPosition = this.editorDom.getBoundingClientRect();\n const minLeft = positionLimit.left - editorPosition.left;\n const maxLeft = positionLimit.width + minLeft;\n const minTop = this.bubbleDom.offsetHeight * 2;\n let $top = top;\n if ($top < minTop) {\n // 如果高度小于编辑器的顶部,则让bubble工具栏出现在选中文本的下放\n $top += this.bubbleDom.offsetHeight - this.bubbleTop.getBoundingClientRect().height;\n this.bubbleTop.style.display = 'block';\n this.bubbleBottom.style.display = 'none';\n } else {\n // 反之出现在选中文本内容的上方\n $top -= this.bubbleDom.offsetHeight + 2 * this.bubbleBottom.getBoundingClientRect().height;\n this.bubbleTop.style.display = 'none';\n this.bubbleBottom.style.display = 'block';\n }\n this.bubbleDom.style.top = `${$top}px`;\n let left = width - this.bubbleDom.offsetWidth / 2;\n if (left < minLeft) {\n // 如果位置超过了编辑器的最左边,则控制bubble工具栏不超出编辑器最左边\n // 同时bubble工具栏上的箭头尽量指向选中文本内容的中间位置\n left = minLeft;\n this.$setBubbleCursorPosition(`${width - minLeft}px`);\n } else if (left + this.bubbleDom.offsetWidth > maxLeft) {\n // 如果位置超过了编辑器的最右边,则控制bubble工具栏不超出编辑器最右边\n // 同时bubble工具栏上的箭头尽量指向选中文本内容的中间位置\n left = maxLeft - this.bubbleDom.offsetWidth;\n this.$setBubbleCursorPosition(`${width - left}px`);\n } else {\n // 让bubble工具栏的箭头处于工具栏的中间位置\n this.$setBubbleCursorPosition('50%');\n }\n // 安全边距 20px\n this.bubbleDom.style.left = `${Math.max(20, left)}px`;\n }\n\n hideBubble() {\n this.visible = false;\n }\n\n /**\n * 控制bubble工具栏的箭头的位置\n * @param {string} left 左偏移量\n */\n $setBubbleCursorPosition(left = '50%') {\n if (left === '50%') {\n this.bubbleTop.style.left = '50%';\n this.bubbleBottom.style.left = '50%';\n } else {\n const $left = parseFloat(left) < 10 ? '10px' : left;\n this.bubbleTop.style.left = $left;\n this.bubbleBottom.style.left = $left;\n }\n }\n\n initBubbleDom() {\n const top = document.createElement('div');\n top.className = 'cherry-bubble-top';\n const bottom = document.createElement('div');\n bottom.className = 'cherry-bubble-bottom';\n this.bubbleTop = top;\n this.bubbleBottom = bottom;\n this.bubbleDom.appendChild(top);\n this.bubbleDom.appendChild(bottom);\n // 默认不可见\n this.visible = false;\n }\n\n getBubbleDom() {\n return this.bubbleDom;\n }\n\n addSelectionChangeListener() {\n this.options.editor.addListener('change', (codemirror) => {\n // 当编辑区内容变更时自动隐藏bubble工具栏\n this.hideBubble();\n });\n this.options.editor.addListener('refresh', (codemirror) => {\n // 当编辑区内容刷新时自动隐藏bubble工具栏\n this.hideBubble();\n });\n this.options.editor.addListener('scroll', (codemirror) => {\n // 当编辑区滚动时,需要实时同步bubble工具栏的位置\n this.updatePositionWhenScroll();\n });\n this.options.editor.addListener('beforeSelectionChange', (codemirror, info) => {\n // 当编辑区选中内容改变时,需要展示/隐藏bubble工具栏,并计算工具栏位置\n if (info.origin !== '*mouse' && (info.origin !== null || typeof info.origin === 'undefined')) {\n return true;\n }\n if (!info.ranges[0]) {\n return true;\n }\n const anchor = info.ranges[0].anchor.line * 1000000 + info.ranges[0].anchor.ch;\n const head = info.ranges[0].head.line * 1000000 + info.ranges[0].head.ch;\n let direction = 'asc';\n if (anchor > head) {\n direction = 'desc';\n }\n setTimeout(() => {\n const selections = codemirror.getSelections();\n if (selections.join('').length <= 0) {\n this.hideBubble();\n return;\n }\n const selectedObjs = codemirror.getWrapperElement().getElementsByClassName('CodeMirror-selected');\n const editorPosition = this.editorDom.getBoundingClientRect();\n let width = 0;\n let top = 0;\n if (typeof selectedObjs !== 'object' || selectedObjs.length <= 0) {\n this.hideBubble();\n return;\n }\n for (let key = 0; key < selectedObjs.length; key++) {\n const one = selectedObjs[key];\n const position = one.getBoundingClientRect();\n const targetTop = position.top - editorPosition.top;\n if (direction === 'asc') {\n if (targetTop >= top) {\n top = targetTop;\n width = position.left - editorPosition.left + position.width / 2;\n }\n } else {\n if (targetTop <= top || top <= 0) {\n top = targetTop;\n width = position.left - editorPosition.left + position.width / 2;\n }\n }\n }\n this.showBubble(top, width);\n }, 10);\n });\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Toolbar from './Toolbar';\n/**\n * 当光标处于编辑器新行起始位置时出现的浮动工具栏\n */\nexport default class FloatMenu extends Toolbar {\n // constructor(options) {\n // super(options);\n // }\n\n init() {\n this.editor = this.$cherry.editor;\n this.editorDom = this.editor.getEditorDom();\n this.editorDom.querySelector('.CodeMirror-scroll').appendChild(this.options.dom);\n this.initAction();\n }\n\n initAction() {\n const self = this;\n this.editor.addListener('cursorActivity', (codemirror, evt) => {\n // 当编辑区光标位置改变时触发\n self.cursorActivity(evt, codemirror);\n });\n\n this.editor.addListener('update', (codemirror, evt) => {\n // 当编辑区内容改变时触发\n self.cursorActivity(evt, codemirror);\n });\n\n this.editor.addListener('refresh', (codemirror, evt) => {\n // 当编辑器刷新时触发\n setTimeout(() => {\n self.cursorActivity(evt, codemirror);\n }, 0);\n });\n }\n\n update(evt, codeMirror) {\n const pos = codeMirror.getCursor();\n if (this.isHidden(pos.line, codeMirror)) {\n this.options.dom.style.display = 'none';\n return false;\n }\n this.options.dom.style.display = 'inline-block';\n }\n\n /**\n * 当光标激活时触发,当光标处于行起始位置时展示float工具栏;反之隐藏\n * @param {Event} evt\n * @param {CodeMirror.Editor} codeMirror\n * @returns\n */\n cursorActivity(evt, codeMirror) {\n const pos = codeMirror.getCursor();\n const codeMirrorLines = document.querySelector('.cherry-editor .CodeMirror-lines');\n if (!codeMirrorLines) {\n return false;\n }\n const computedLinesStyle = getComputedStyle(codeMirrorLines);\n const codeWrapPaddingLeft = parseFloat(computedLinesStyle.paddingLeft);\n const codeWrapPaddingTop = parseFloat(computedLinesStyle.paddingTop);\n // const cursorHandle = codeMirror.getLineHandle(pos.line);\n // const verticalMiddle = cursorHandle.height * 1 / 2;\n\n if (this.isHidden(pos.line, codeMirror)) {\n this.options.dom.style.display = 'none';\n return false;\n }\n this.options.dom.style.display = 'inline-block';\n this.options.dom.style.left = `${codeWrapPaddingLeft}px`;\n this.options.dom.style.top = `${this.getLineHeight(pos.line, codeMirror) + codeWrapPaddingTop}px`;\n }\n\n /**\n * 判断是否需要隐藏Float工具栏\n * 有选中内容,或者光标所在行有内容时隐藏float 工具栏\n * @param {number} line\n * @param {CodeMirror.Editor} codeMirror\n * @returns {boolean} 是否需要隐藏float工具栏,true:需要隐藏\n */\n isHidden(line, codeMirror) {\n const selections = codeMirror.getSelections();\n if (selections.length > 1) {\n return true;\n }\n const selection = codeMirror.getSelection();\n if (selection.length > 0) {\n return true;\n }\n if (codeMirror.getLine(line)) {\n return true;\n }\n return false;\n }\n\n /**\n * 获取对应行的行高度,用来让float 工具栏在该行保持垂直居中\n * @param {number} line\n * @param {CodeMirror.Editor} codeMirror\n * @returns\n */\n getLineHeight(line, codeMirror) {\n let height = 0;\n codeMirror.getDoc().eachLine(0, line, (line) => {\n height += line.height;\n });\n\n return height;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Toolbar from './Toolbar';\n/**\n * 预览区域右侧悬浮的工具栏\n * 推荐放置跟编辑区域完全无关的工具栏\n * 比如复制预览区域内容、修改预览区域主题等\n */\nexport default class Sidebar extends Toolbar {\n // constructor(options) {\n // super(options);\n // }\n}\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport diff from 'fast-diff';\n/**\n * 更新内容时保持光标不变\n * @param {Number} pos 光标相对文档开头的偏移量\n * @param {String} oldContent 变更前的内容\n * @param {String} newContent 变更后的内容\n * @returns {Number} newPos 新的光标偏移量\n */\nexport default function getPosBydiffs(pos, oldContent, newContent) {\n const diffs = diff(oldContent, newContent);\n let newPos = pos;\n let tmpPos = pos;\n for (let i = 0; i < diffs.length; i++) {\n const val = diffs[i];\n if (tmpPos <= 0) {\n return newPos;\n }\n const opType = val[0];\n const opLength = val[1].length;\n switch (opType) {\n // 没有改变的内容\n case diff.EQUAL:\n if (tmpPos <= opLength) {\n return newPos;\n }\n tmpPos -= opLength;\n break;\n // 删除的内容\n case diff.DELETE:\n if (tmpPos <= opLength) {\n return newPos - opLength + tmpPos;\n }\n tmpPos -= opLength;\n newPos -= opLength;\n break;\n // 新增的内容\n case diff.INSERT:\n newPos += opLength;\n break;\n }\n }\n return newPos;\n}\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst callbacks = {\n /**\n * 全局的URL处理器\n * @param {string} url 来源url\n * @param {'image'|'audio'|'video'|'autolink'|'link'} srcType 来源类型\n * @returns\n */\n urlProcessor: (url, srcType) => url,\n fileUpload(file, callback) {\n if (/video/i.test(file.type)) {\n callback('images/demo-dog.png', {\n name: `${file.name.replace(/\\.[^.]+$/, '')}`,\n poster: 'images/demo-dog.png?poster=true',\n isBorder: true,\n isShadow: true,\n isRadius: true,\n });\n } else {\n callback('images/demo-dog.png', { name: `${file.name.replace(/\\.[^.]+$/, '')}`, isShadow: true });\n }\n },\n afterChange: (text, html) => {},\n afterInit: (text, html) => {},\n beforeImageMounted: (srcProp, src) => ({ srcProp, src }),\n onClickPreview: (event) => {},\n onCopyCode: (event, code) => {\n // 阻止默认的粘贴事件\n // return false;\n // 对复制内容进行额外处理\n return code;\n },\n // 获取中文的拼音\n changeString2Pinyin: (string) => {\n /**\n * 推荐使用这个组件:https://github.com/liu11hao11/pinyin_js\n *\n * 可以在 ../scripts/pinyin/pinyin_dist.js 里直接引用\n */\n return string;\n },\n};\n\n/** @type {Partial} */\nconst defaultConfig = {\n // 第三方包\n externals: {\n // externals\n },\n // 解析引擎配置\n engine: {\n // 全局配置\n global: {\n // 是否启用经典换行逻辑\n // true:一个换行会被忽略,两个以上连续换行会分割成段落,\n // false: 一个换行会转成 ,两个连续换行会分割成段落,三个以上连续换行会转成 并分割段落\n classicBr: false,\n /**\n * 全局的URL处理器\n * @param {string} url 来源url\n * @param {'image'|'audio'|'video'|'autolink'|'link'} srcType 来源类型\n * @returns\n */\n urlProcessor: callbacks.urlProcessor,\n /**\n * 额外允许渲染的html标签\n * 标签以英文竖线分隔,如:htmlWhiteList: 'iframe|script|style'\n * 默认为空,默认允许渲染的html见src/utils/sanitize.js whiteList 属性\n * 需要注意:\n * - 启用iframe、script等标签后,会产生xss注入,请根据实际场景判断是否需要启用\n * - 一般编辑权限可控的场景(如api文档系统)可以允许iframe、script等标签\n */\n htmlWhiteList: '',\n },\n // 内置语法配置\n syntax: {\n // 语法开关\n // 'hookName': false,\n // 语法配置\n // 'hookName': {\n //\n // }\n autoLink: {\n /** 是否开启短链接 */\n enableShortLink: true,\n /** 短链接长度 */\n shortLinkLength: 20,\n },\n list: {\n listNested: false, // 同级列表类型转换后变为子级\n indentSpace: 2, // 默认2个空格缩进\n },\n table: {\n enableChart: false,\n // chartRenderEngine: EChartsTableEngine,\n // externals: ['echarts'],\n },\n inlineCode: {\n theme: 'red',\n },\n codeBlock: {\n theme: 'dark', // 默认为深色主题\n wrap: true, // 超出长度是否换行,false则显示滚动条\n lineNumber: true, // 默认显示行号\n copyCode: true, // 是否显示“复制”按钮\n customRenderer: {\n // 自定义语法渲染器\n },\n mermaid: {\n svg2img: false, // 是否将mermaid生成的画图变成img格式\n },\n /**\n * indentedCodeBlock是缩进代码块是否启用的开关\n *\n * 在6.X之前的版本中默认不支持该语法。\n * 因为cherry的开发团队认为该语法太丑了(容易误触)\n * 开发团队希望用```代码块语法来彻底取代该语法\n * 但在后续的沟通中,开发团队发现在某些场景下该语法有更好的显示效果\n * 因此开发团队在6.X版本中才引入了该语法\n * 已经引用6.x以下版本的业务如果想做到用户无感知升级,可以去掉该语法:\n * indentedCodeBlock:false\n */\n indentedCodeBlock: true,\n },\n emoji: {\n useUnicode: true, // 是否使用unicode进行渲染\n },\n fontEmphasis: {\n /**\n * 是否允许首尾空格\n * 首尾、前后的定义: 语法前**语法首+内容+语法尾**语法后\n * 例:\n * true:\n * __ hello __ ====> hello \n * __hello__ ====> hello\n * false:\n * __ hello __ ====> _ hello _\n * __hello__ ====> hello\n */\n allowWhitespace: false,\n },\n strikethrough: {\n /**\n * 是否必须有前后空格\n * 首尾、前后的定义: 语法前**语法首+内容+语法尾**语法后\n * 例:\n * true:\n * hello wor~~l~~d ====> hello wor~~l~~d\n * hello wor ~~l~~ d ====> hello wor l d\n * false:\n * hello wor~~l~~d ====> hello world\n * hello wor ~~l~~ d ====> hello wor l d\n */\n needWhitespace: false,\n },\n mathBlock: {\n engine: 'MathJax', // katex或MathJax\n src: '',\n plugins: true, // 默认加载插件\n },\n inlineMath: {\n engine: 'MathJax', // katex或MathJax\n src: '',\n },\n toc: {\n /** 默认只渲染一个目录 */\n allowMultiToc: false,\n },\n header: {\n /**\n * 标题的样式:\n * - default 默认样式,标题前面有锚点\n * - autonumber 标题前面有自增序号锚点\n * - none 标题没有锚点\n */\n anchorStyle: 'default',\n },\n },\n },\n editor: {\n id: 'code', // textarea 的id属性值\n name: 'code', // textarea 的name属性值\n autoSave2Textarea: false, // 是否自动将编辑区的内容回写到textarea里\n theme: 'default', // depend on codemirror theme name: https://codemirror.net/demo/theme.htm\n // 编辑器的高度,默认100%,如果挂载点存在内联设置的height则以内联样式为主\n height: '100%',\n // defaultModel 编辑器初始化后的默认模式,一共有三种模式:1、双栏编辑预览模式;2、纯编辑模式;3、预览模式\n // edit&preview: 双栏编辑预览模式\n // editOnly: 纯编辑模式(没有预览,可通过toolbar切换成双栏或预览模式)\n // previewOnly: 预览模式(没有编辑框,toolbar只显示“返回编辑”按钮,可通过toolbar切换成编辑模式)\n defaultModel: 'edit&preview',\n // 粘贴时是否自动将html转成markdown\n convertWhenPaste: true,\n codemirror: {\n // 是否自动focus 默认为true\n autofocus: true,\n },\n writingStyle: 'normal', // 书写风格,normal 普通 | typewriter 打字机 | focus 专注,默认normal\n },\n toolbars: {\n theme: 'dark', // light or dark\n showToolbar: true, // false:不展示顶部工具栏; true:展示工具栏; toolbars.showToolbar=false 与 toolbars.toolbar=false 等效\n toolbar: [\n 'bold',\n 'italic',\n 'strikethrough',\n '|',\n 'color',\n 'header',\n 'ruby',\n '|',\n 'list',\n 'panel',\n // 'justify', // 对齐方式,默认不推荐这么“复杂”的样式要求\n 'detail',\n {\n insert: [\n 'image',\n 'audio',\n 'video',\n 'link',\n 'hr',\n 'br',\n 'code',\n 'formula',\n 'toc',\n 'table',\n 'line-table',\n 'bar-table',\n 'pdf',\n 'word',\n ],\n },\n 'graph',\n 'settings',\n ],\n toolbarRight: [],\n sidebar: [],\n bubble: ['bold', 'italic', 'underline', 'strikethrough', 'sub', 'sup', 'quote', '|', 'size', 'color'], // array or false\n float: ['h1', 'h2', 'h3', '|', 'checklist', 'quote', 'table', 'code'], // array or false\n },\n // 打开draw.io编辑页的url,如果为空则drawio按钮失效\n drawioIframeUrl: '',\n // 上传文件的回调\n fileUpload: callbacks.fileUpload,\n /**\n * 上传文件的时候用来指定文件类型\n */\n fileTypeLimitMap: {\n video: 'video/*',\n audio: 'audio/*',\n image: 'image/*',\n word: '.doc,.docx',\n pdf: '.pdf',\n file: '*',\n },\n callback: {\n afterChange: callbacks.afterChange,\n afterInit: callbacks.afterInit,\n beforeImageMounted: callbacks.beforeImageMounted,\n // 预览区域点击事件,previewer.enablePreviewerBubble = true 时生效\n onClickPreview: callbacks.onClickPreview,\n // 复制代码块代码时的回调\n onCopyCode: callbacks.onCopyCode,\n // 把中文变成拼音的回调,当然也可以把中文变成英文、英文变成中文\n changeString2Pinyin: callbacks.changeString2Pinyin,\n },\n previewer: {\n dom: false,\n className: 'cherry-markdown',\n // 是否启用预览区域编辑能力(目前支持编辑图片尺寸、编辑表格内容)\n enablePreviewerBubble: true,\n /**\n * 配置图片懒加载的逻辑\n * - 如果不希望图片懒加载,可配置成 lazyLoadImg = {noLoadImgNum: -1}\n * - 如果希望所有图片都无脑懒加载,可配置成 lazyLoadImg = {noLoadImgNum: 0, autoLoadImgNum: -1}\n * - 如果一共有15张图片,希望:\n * 1、前5张图片(1~5)直接加载;\n * 2、后5张图片(6~10)不论在不在视区内,都无脑懒加载;\n * 3、其他图片(11~15)在视区内时,进行懒加载;\n * 则配置应该为:lazyLoadImg = {noLoadImgNum: 5, autoLoadImgNum: 5}\n */\n lazyLoadImg: {\n // 加载图片时如果需要展示loading图,则配置loading图的地址\n loadingImgPath: '',\n // 同一时间最多有几个图片请求,最大同时加载6张图片\n maxNumPerTime: 2,\n // 不进行懒加载处理的图片数量,如果为0,即所有图片都进行懒加载处理, 如果设置为-1,则所有图片都不进行懒加载处理\n noLoadImgNum: 5,\n // 首次自动加载几张图片(不论图片是否滚动到视野内),autoLoadImgNum = -1 表示会自动加载完所有图片\n autoLoadImgNum: 5,\n // 针对加载失败的图片 或 beforeLoadOneImgCallback 返回false 的图片,最多尝试加载几次,为了防止死循环,最多5次。以图片的src为纬度统计重试次数\n maxTryTimesPerSrc: 2,\n // 加载一张图片之前的回调函数,函数return false 会终止加载操作\n beforeLoadOneImgCallback: (img) => {\n return true;\n },\n // 加载一张图片失败之后的回调函数\n failLoadOneImgCallback: (img) => {},\n // 加载一张图片之后的回调函数,如果图片加载失败,则不会回调该函数\n afterLoadOneImgCallback: (img) => {},\n // 加载完所有图片后调用的回调函数\n afterLoadAllImgCallback: () => {},\n },\n },\n /**\n * 配置主题,第三方可以自行扩展主题\n */\n theme: [\n { className: 'default', label: '默认' },\n { className: 'dark', label: '暗黑' },\n { className: 'light', label: '明亮' },\n { className: 'green', label: '清新' },\n { className: 'red', label: '热情' },\n { className: 'violet', label: '淡雅' },\n ],\n // 预览页面不需要绑定事件\n isPreviewOnly: false,\n // 预览区域跟随编辑器光标自动滚动\n autoScrollByCursor: true,\n // 外层容器不存在时,是否强制输出到body上\n forceAppend: true,\n // The locale Cherry is going to use. Locales live in /src/locales/\n locale: 'zh_CN',\n};\n\nexport default cloneDeep(defaultConfig);\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport default {\n bold: '加粗', // 加粗\n code: '代码', // 代码\n graph: '画图', // 画图\n h1: '一级标题', // 一级标题\n h2: '二级标题', // 二级标题\n h3: '三级标题', // 三级标题\n h4: '四级标题', // 四级标题\n h5: '五级标题', // 五级标题\n header: '标题', // 标题\n insert: '插入', // 插入\n italic: '斜体', // 斜体\n list: '列表', // 列表\n quickTable: '表格', // 表格\n quote: '引用', // 引用\n size: '大小', // 大小\n color: '文字颜色&背景', // 文字颜色&背景\n strikethrough: '删除线', // 删除线\n sub: '下标', // 下标\n sup: '上标', // 上标\n togglePreview: '预览', // 预览\n fullScreen: '全屏', // 全屏\n image: '图片', // 图片\n audio: '音频', // 音频\n video: '视频', // 视频\n link: '超链接', // 超链接\n hr: '分隔线', // 分隔线\n br: '换行', // 换行\n toc: '目录', // 目录\n pdf: 'pdf', // pdf\n word: 'word', // word\n table: '表格', // 表格\n 'line-table': '折线表格', // 折线表格\n 'bar-table': '柱状表格', // 柱状表格\n formula: '公式', // 公式\n insertFormula: '公式', // 公式\n insertFlow: '流程图', // 流程图\n insertSeq: '时序图', // 时序图\n insertState: '状态图', // 状态图\n insertClass: '类图', // 类图\n insertPie: '饼图', // 饼图\n insertGantt: '甘特图', // 甘特图\n checklist: '清单', // 清单\n ol: '有序列表', // 有序列表\n ul: '无序列表', // 无序列表\n undo: '撤销', // 撤销\n redo: '恢复', // 恢复\n previewClose: '关闭预览', // 关闭预览\n codeTheme: '代码主题', // 代码主题\n switchModel: '模式切换', // 模式切换\n switchPreview: '预览', // 预览\n switchEdit: '返回编辑', // 返回编辑\n classicBr: '经典换行', // 经典换行\n normalBr: '常规换行', // 常规换行\n settings: '设置', // 设置\n mobilePreview: '移动端预览', // 移动端预览\n copy: '复制内容', // 复制内容\n export: '导出', // 导出PDF、长图\n underline: '下划线', // 下划线\n pinyin: '拼音', // 拼音\n file: '文件',\n pastePlain: '粘贴为纯文本格式', // 粘贴为纯文本格式\n pasteMarkdown: '粘贴为markdown格式', // 粘贴为markdown格式\n hide: '隐藏(ctrl+0)', // 隐藏(ctrl+0)\n exportToPdf: '导出PDF', // 导出PDF\n exportScreenshot: '导出长图', // 导出长图\n exportMarkdownFile: '导出markdown', // 导出markdown文件\n exportHTMLFile: '导出html', // 导出预览区html文件\n theme: '主题', // 导出长图\n panel: '面板', // 导出长图\n detail: '手风琴', // 手风琴\n 'H1 Heading': 'H1 一级标题',\n 'H2 Heading': 'H2 二级标题',\n 'H3 Heading': 'H3 三级标题',\n complement: '续写',\n summary: '总结',\n};\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport default {\n bold: 'Bold',\n code: 'Code',\n graph: 'Graph',\n h1: 'Heading 1',\n h2: 'Heading 2',\n h3: 'Heading 3',\n h4: 'Heading 4',\n h5: 'Heading 5',\n header: 'Header',\n insert: 'Insert',\n italic: 'Italic',\n list: 'List',\n quickTable: 'Quick Table',\n quote: 'Quote',\n size: 'Size',\n color: 'Text Color & Background',\n strikethrough: 'Strikethrough',\n sub: 'Sub',\n sup: 'Sup',\n togglePreview: 'Toggle Preview',\n fullScreen: 'Full Screen',\n image: 'Image',\n audio: 'Audio',\n video: 'Video',\n link: 'Link',\n hr: 'Horizontal Rule',\n br: 'New Line',\n toc: 'Table Of Content',\n pdf: 'PDF',\n word: 'Word',\n table: 'Table',\n 'line-table': 'Line Table',\n 'bar-table': 'Bar Table',\n formula: 'Formula',\n insertFormula: 'Insert Formula',\n insertFlow: 'Insert Flow',\n insertSeq: 'Insert Seq',\n insertState: 'Insert State',\n insertClass: 'Insert Class',\n insertPie: 'Insert Pie',\n insertGantt: 'Insert Gantt',\n checklist: 'Checklist',\n ol: 'Ordered List',\n ul: 'Unordered List',\n undo: 'Undo',\n redo: 'Redo',\n previewClose: 'Preview Close',\n codeTheme: 'Code Theme',\n switchModel: 'Switch Model',\n switchPreview: 'Switch Preview',\n switchEdit: 'Switch Edit',\n classicBr: 'Classic New Line',\n normalBr: 'Normal New Line',\n settings: 'Settings',\n mobilePreview: 'Mobile Preview',\n copy: 'Copy',\n export: 'Export',\n underline: 'Underline',\n pinyin: 'Pinyin',\n pastePlain: 'Paste as Plain Text',\n pasteMarkdown: 'Paste as Markdown',\n hide: 'Hide (ctrl+0)',\n exportToPdf: 'Export to PDF',\n exportScreenshot: 'Screenshot',\n exportMarkdownFile: 'Export Markdown File',\n exportHTMLFile: 'Export preview HTML File',\n 'H1 Heading': 'H1 Heading',\n 'H2 Heading': 'H1 Heading',\n 'H3 Heading': 'H1 Heading',\n complement: 'Complement',\n summary: 'Summary',\n};\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport zhCn from './zh_CN';\nimport enUs from './en_US';\n\nexport default {\n zh_CN: zhCn,\n en_US: enUs,\n};\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport SyntaxBase, { HOOKS_TYPE_LIST } from './core/SyntaxBase';\nimport ParagraphBase from './core/ParagraphBase';\nimport MenuBase from './toolbars/MenuBase';\n\nfunction filterOptions(options, whiteList, propTypes) {\n const filteredOptions = {};\n Object.keys(options).forEach((key) => {\n if (whiteList.indexOf(key) === -1) {\n return;\n }\n if (typeof propTypes === 'object') {\n if (typeof propTypes[key] === 'string') {\n if (typeof options[key] === propTypes[key]) {\n filteredOptions[key] = options[key];\n }\n } else {\n if (options[key] instanceof propTypes[key]) {\n filteredOptions[key] = options[key];\n }\n }\n } else if (typeof propTypes === 'string') {\n if (typeof options[key] === propTypes) {\n filteredOptions[key] = options[key];\n }\n }\n });\n return filteredOptions;\n}\n\nexport function createSyntaxHook(name, type, options) {\n const BaseClass = type === HOOKS_TYPE_LIST.PAR ? ParagraphBase : SyntaxBase;\n const optionsWhiteList = ['beforeMakeHtml', 'makeHtml', 'afterMakeHtml', 'rule', 'test'];\n const filteredOptions = filterOptions(options, optionsWhiteList, 'function');\n const paragraphConfig = { needCache: options.needCache, defaultCache: options.defaultCache };\n return class CustomSyntax extends BaseClass {\n static HOOK_NAME = name;\n\n constructor(editorConfig = {}) {\n if (type === HOOKS_TYPE_LIST.PAR) {\n super({ needCache: !!paragraphConfig.needCache, defaultCache: paragraphConfig.defaultCache });\n } else {\n super();\n }\n\n this.config = editorConfig.config;\n }\n\n beforeMakeHtml(...args) {\n if (filteredOptions.beforeMakeHtml) {\n return filteredOptions.beforeMakeHtml.apply(this, args);\n }\n return super.beforeMakeHtml(...args);\n }\n\n makeHtml(...args) {\n if (filteredOptions.makeHtml) {\n return filteredOptions.makeHtml.apply(this, args);\n }\n return super.makeHtml(...args);\n }\n\n afterMakeHtml(...args) {\n if (filteredOptions.afterMakeHtml) {\n return filteredOptions.afterMakeHtml.apply(this, args);\n }\n return super.afterMakeHtml(...args);\n }\n\n test(...args) {\n if (filteredOptions.test) {\n return filteredOptions.test.apply(this, args);\n }\n return super.test(...args);\n }\n\n rule(...args) {\n if (filteredOptions.rule) {\n return filteredOptions.rule.apply(this, args);\n }\n return super.rule(...args);\n }\n };\n}\n\nexport function createMenuHook(name, options) {\n const optionsWhiteList = ['subMenuConfig', 'onClick', 'shortcutKeys', 'iconName'];\n const propTypes = {\n subMenuConfig: Array,\n onClick: 'function',\n shortcutKeys: Array,\n iconName: 'string',\n };\n const filteredOptions = filterOptions(options, optionsWhiteList, propTypes);\n return class CustomMenu extends MenuBase {\n constructor(editorInstance) {\n super(editorInstance);\n if (!filteredOptions.iconName) {\n this.noIcon = true;\n }\n this.setName(name, filteredOptions.iconName);\n this.subMenuConfig = filteredOptions.subMenuConfig || [];\n }\n\n onClick(...args) {\n if (filteredOptions.onClick) {\n return filteredOptions.onClick.apply(this, args);\n }\n return super.onClick(...args);\n }\n\n get shortcutKeys() {\n if (filteredOptions.shortcutKeys) {\n return filteredOptions.shortcutKeys;\n }\n return [];\n }\n };\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * 本文件主要维护导出Cherry时需要附加在Cherry对象上的静态属性集合\n * 所有的具名导出都会挂载在Cherry或CherryEngine上\n */\nimport { HOOKS_TYPE_LIST } from './core/SyntaxBase';\nimport { createSyntaxHook, createMenuHook } from './Factory';\nimport { isBrowser } from './utils/env';\n\nconst constants = { HOOKS_TYPE_LIST };\n\nconst plugins = {};\nconst nodeIgnorePlugin = [];\n\nif (!isBrowser()) {\n nodeIgnorePlugin.forEach((key) => {\n delete plugins[key];\n });\n}\n\nconst VERSION = `${process.env.BUILD_VERSION}`;\n\nexport class CherryStatic {\n static createSyntaxHook = createSyntaxHook;\n static createMenuHook = createMenuHook;\n static constants = constants;\n static VERSION = VERSION;\n /**\n * @this {typeof import('./Cherry').default | typeof CherryStatic}\n * @param {{ install: (defaultConfig: any, ...args: any[]) => void }} PluginClass 插件Class\n * @param {...any} args 初始化插件的参数\n * @returns\n */\n static usePlugin(PluginClass, ...args) {\n if (this === CherryStatic) {\n throw new Error('`usePlugin` is not allowed to called through CherryStatic class.');\n }\n // @ts-ignore\n if (this.initialized) {\n throw new Error('The function `usePlugin` should be called before Cherry is instantiated.');\n }\n // @ts-ignore\n if (PluginClass.$cherry$mounted === true) {\n return;\n }\n // @ts-ignore\n PluginClass.install.apply(PluginClass, [this.config.defaults, ...args]);\n // @ts-ignore\n PluginClass.$cherry$mounted = true;\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport mergeWith from 'lodash/mergeWith';\nimport Editor from './Editor';\nimport Engine from './Engine';\nimport Previewer from './Previewer';\nimport Bubble from './toolbars/Bubble';\nimport FloatMenu from './toolbars/FloatMenu';\nimport Toolbar from './toolbars/Toolbar';\nimport { createElement } from './utils/dom';\nimport Sidebar from './toolbars/Sidebar';\nimport { customizer, getThemeFromLocal, changeTheme } from './utils/config';\nimport NestedError, { $expectTarget } from './utils/error';\nimport getPosBydiffs from './utils/recount-pos';\nimport defaultConfig from './Cherry.config';\nimport './sass/cherry.scss';\nimport cloneDeep from 'lodash/cloneDeep';\nimport Event from './Event';\nimport locales from '@/locales/index';\n\nimport { urlProcessorProxy } from './UrlCache';\nimport { CherryStatic } from './CherryStatic';\n\n/** @typedef {import('~types/cherry').CherryOptions} CherryOptions */\nexport default class Cherry extends CherryStatic {\n /**\n * @protected\n */\n static initialized = false;\n /**\n * @readonly\n */\n static config = {\n /** @type {Partial} */\n defaults: defaultConfig,\n };\n\n /**\n * @param {Partial} options\n */\n constructor(options) {\n super();\n Cherry.initialized = true;\n const defaultConfigCopy = cloneDeep(Cherry.config.defaults);\n this.defaultToolbar = defaultConfigCopy.toolbars.toolbar;\n $expectTarget(options, Object);\n /**\n * @property\n * @type {Partial}\n */\n this.options = mergeWith({}, defaultConfigCopy, options, customizer);\n\n // loading the locale\n this.locale = locales[this.options.locale];\n\n if (typeof this.options.engine.global.urlProcessor === 'function') {\n this.options.engine.global.urlProcessor = urlProcessorProxy(this.options.engine.global.urlProcessor);\n }\n\n this.status = {\n toolbar: 'show',\n previewer: 'show',\n editor: 'show',\n };\n\n if (this.options.isPreviewOnly || this.options.editor.defaultModel === 'previewOnly') {\n this.options.toolbars.showToolbar = false;\n this.options.editor.defaultModel = 'previewOnly';\n this.status.editor = 'hide';\n this.status.toolbar = 'hide';\n }\n\n /**\n * @property\n * @type {string} 实例ID\n */\n this.instanceId = `cherry-${new Date().getTime()}${Math.random()}`;\n this.options.instanceId = this.instanceId;\n\n /**\n * @private\n * @type {Engine}\n */\n this.engine = new Engine(this.options, this);\n this.init();\n }\n\n /**\n * 初始化工具栏、编辑区、预览区等\n * @private\n */\n init() {\n let mountEl = this.options.id ? document.getElementById(this.options.id) : this.options.el;\n\n if (!mountEl) {\n if (!this.options.forceAppend) {\n return false;\n }\n mountEl = document.createElement('div');\n mountEl.id = this.options.id || 'cherry-markdown';\n document.body.appendChild(mountEl);\n }\n\n if (!mountEl.style.height) {\n mountEl.style.height = this.options.editor.height;\n }\n this.cherryDom = mountEl;\n\n // 蒙层dom,用来拖拽编辑区&预览区宽度时展示蒙层\n const wrapperDom = this.createWrapper();\n // 创建编辑区\n const editor = this.createEditor();\n // 创建预览区\n const previewer = this.createPreviewer();\n\n if (this.options.toolbars.showToolbar === false || this.options.toolbars.toolbar === false) {\n // 即便配置了不展示工具栏,也要让工具栏加载对应的语法hook\n wrapperDom.classList.add('cherry--no-toolbar');\n this.options.toolbars.toolbar = this.defaultToolbar;\n }\n $expectTarget(this.options.toolbars.toolbar, Array);\n // 创建顶部工具栏\n this.toolbar = this.createToolbar();\n\n const wrapperFragment = document.createDocumentFragment();\n wrapperFragment.appendChild(this.toolbar.options.dom);\n wrapperFragment.appendChild(editor.options.editorDom);\n // 创建预览区域的侧边工具栏\n this.createSidebar(wrapperFragment);\n if (!this.options.previewer.dom) {\n wrapperFragment.appendChild(previewer.options.previewerDom);\n }\n wrapperFragment.appendChild(previewer.options.virtualDragLineDom);\n wrapperFragment.appendChild(previewer.options.editorMaskDom);\n wrapperFragment.appendChild(previewer.options.previewerMaskDom);\n\n wrapperDom.appendChild(wrapperFragment);\n mountEl.appendChild(wrapperDom);\n\n editor.init(previewer);\n // 创建bubble工具栏,所谓bubble工具栏,是指在编辑区选中文本时悬浮出现的工具栏\n this.createBubble();\n // 创建float工具栏,所谓float工具栏,是指当编辑区光标处于新行时,在行内联想出的工具栏\n this.createFloatMenu();\n previewer.init(editor);\n\n previewer.registerAfterUpdate(this.engine.mounted.bind(this.engine));\n\n // default value init\n this.initText(editor.editor);\n\n // 切换模式,有纯预览模式、纯编辑模式、双栏编辑模式\n this.switchModel(this.options.editor.defaultModel);\n\n Event.on(this.instanceId, Event.Events.toolbarHide, () => {\n this.status.toolbar = 'hide';\n });\n Event.on(this.instanceId, Event.Events.toolbarShow, () => {\n this.status.toolbar = 'show';\n });\n Event.on(this.instanceId, Event.Events.previewerClose, () => {\n this.status.previewer = 'hide';\n });\n Event.on(this.instanceId, Event.Events.previewerOpen, () => {\n this.status.previewer = 'show';\n });\n Event.on(this.instanceId, Event.Events.editorClose, () => {\n this.status.editor = 'hide';\n // 关闭编辑区时,需要清除所有高亮\n this.previewer.highlightLine(0);\n });\n Event.on(this.instanceId, Event.Events.editorOpen, () => {\n this.status.editor = 'show';\n });\n }\n\n /**\n * 切换编辑模式\n * @param {'edit&preview'|'editOnly'|'previewOnly'} model 模式类型\n * 一般纯预览模式和纯编辑模式适合在屏幕较小的终端使用,比如手机移动端\n *\n * @returns\n */\n switchModel(model = 'edit&preview') {\n switch (model) {\n case 'edit&preview':\n if (this.previewer) {\n this.previewer.editOnly(true);\n this.previewer.recoverPreviewer();\n }\n if (this.toolbar) {\n this.toolbar.showToolbar();\n }\n break;\n case 'editOnly':\n if (!this.previewer.isPreviewerHidden()) {\n this.previewer.editOnly(true);\n }\n if (this.toolbar) {\n this.toolbar.showToolbar();\n }\n break;\n case 'previewOnly':\n this.previewer.previewOnly();\n this.toolbar && this.toolbar.previewOnly();\n break;\n }\n }\n\n /**\n * 获取实例id\n * @returns {string}\n * @public\n */\n getInstanceId() {\n return this.instanceId;\n }\n\n /**\n * 获取编辑器状态\n * @returns {Object}\n */\n getStatus() {\n return this.status;\n }\n\n /**\n * 获取编辑区内的markdown源码内容\n * @returns markdown源码内容\n */\n getValue() {\n return this.editor.editor.getValue();\n }\n\n /**\n * 获取编辑区内的markdown源码内容\n * @returns markdown源码内容\n */\n getMarkdown() {\n return this.getValue();\n }\n\n /**\n * 获取CodeMirror实例\n * @returns CodeMirror实例\n */\n getCodeMirror() {\n return this.editor.editor;\n }\n\n /**\n * 获取预览区内的html内容\n * @param {boolean} wrapTheme 是否在外层包裹主题class\n * @returns html内容\n */\n getHtml(wrapTheme = true) {\n return this.previewer.getValue(wrapTheme);\n }\n\n getPreviewer() {\n return this.previewer;\n }\n\n /**\n * 获取目录,目录由head1~6组成\n * @returns 标题head数组\n */\n getToc() {\n const str = this.getHtml();\n /** @type {({level: number;id: string;text: string})[]} */\n const headerList = [];\n const headerRegex = /(.+?)<\\/h[0-6]>/g;\n str.replace(headerRegex, (match, level, id, text) => {\n headerList.push({ level: +level, id, text });\n return match;\n });\n return headerList;\n }\n\n /**\n * 覆盖编辑区的内容\n * @param {string} content markdown内容\n * @param {boolean} keepCursor 是否保持光标位置\n * @returns\n */\n setValue(content, keepCursor = false) {\n if (keepCursor === false) {\n return this.editor.editor.setValue(content);\n }\n const codemirror = this.editor.editor;\n const old = this.getValue();\n const pos = codemirror.getDoc().indexFromPos(codemirror.getCursor());\n const newPos = getPosBydiffs(pos, old, content);\n const ret = codemirror.setValue(content);\n const cursor = codemirror.getDoc().posFromIndex(newPos);\n codemirror.setCursor(cursor);\n return ret;\n }\n\n /**\n * 在光标处或者指定行+偏移量插入内容\n * @param {string} content 被插入的文本\n * @param {boolean} [isSelect=false] 是否选中刚插入的内容\n * @param {[number, number]|false} [anchor=false] [x,y] 代表x+1行,y+1字符偏移量,默认false 会从光标处插入\n * @param {boolean} [focus=true] 保持编辑器处于focus状态\n * @returns\n */\n insert(content, isSelect = false, anchor = false, focus = true) {\n if (anchor) {\n this.editor.editor.setSelection({ line: anchor[0], ch: anchor[1] }, { line: anchor[0], ch: anchor[1] });\n }\n const ret = this.editor.editor.replaceSelection(content, isSelect ? 'around' : 'end');\n focus && this.editor.editor.focus();\n return ret;\n }\n\n /**\n * 在光标处或者指定行+偏移量插入内容\n * @param {string} content 被插入的文本\n * @param {boolean} [isSelect=false] 是否选中刚插入的内容\n * @param {[number, number]|false} [anchor=false] [x,y] 代表x+1行,y+1字符偏移量,默认false 会从光标处插入\n * @param {boolean} [focus=true] 保持编辑器处于focus状态\n * @returns\n */\n insertValue(content, isSelect = false, anchor = false, focus = true) {\n return this.insert(content, isSelect, anchor, focus);\n }\n\n /**\n * 强制重新渲染预览区域\n */\n refreshPreviewer() {\n try {\n const markdownText = this.getValue();\n const html = this.engine.makeHtml(markdownText);\n this.previewer.refresh(html);\n } catch (e) {\n throw new NestedError(e);\n }\n }\n\n /**\n * 覆盖编辑区的内容\n * @param {string} content markdown内容\n * @param {boolean} keepCursor 是否保持光标位置\n * @returns\n */\n setMarkdown(content, keepCursor = false) {\n return this.setValue(content, keepCursor);\n }\n\n /**\n * @private\n * @returns\n */\n createWrapper() {\n const toolbarTheme = this.options.toolbars.theme === 'dark' ? 'dark' : '';\n // TODO: 完善类型\n const inlineCodeTheme = /** @type {{theme?: string;}} */ (this.options.engine.syntax.inlineCode).theme;\n let codeBlockTheme = /** @type {{theme?: string;}} */ (this.options.engine.syntax.codeBlock).theme;\n if (codeBlockTheme === 'dark') codeBlockTheme = 'tomorrow-night';\n else if (codeBlockTheme === 'light') codeBlockTheme = 'solarized-light';\n const wrapperDom = createElement('div', ['cherry', 'clearfix', getThemeFromLocal(true)].join(' '), {\n 'data-toolbarTheme': toolbarTheme,\n 'data-inlineCodeTheme': inlineCodeTheme,\n 'data-codeBlockTheme': codeBlockTheme,\n });\n this.wrapperDom = wrapperDom;\n return wrapperDom;\n }\n\n /**\n * @private\n * @returns {Toolbar}\n */\n createToolbar() {\n const dom = createElement('div', 'cherry-toolbar');\n this.toolbar = new Toolbar({\n dom,\n $cherry: this,\n buttonRightConfig: this.options.toolbars.toolbarRight,\n buttonConfig: this.options.toolbars.toolbar,\n customMenu: this.options.toolbars.customMenu,\n });\n return this.toolbar;\n }\n\n /**\n * @private\n * @returns\n */\n createSidebar(wrapperFragment) {\n if (this.options.toolbars.sidebar) {\n $expectTarget(this.options.toolbars.sidebar, Array);\n const externalClass = this.options.toolbars.theme === 'dark' ? 'dark' : '';\n const dom = createElement('div', `cherry-sidebar ${externalClass}`);\n this.sidebar = new Sidebar({\n dom,\n $cherry: this,\n buttonConfig: this.options.toolbars.sidebar,\n customMenu: this.options.toolbars.customMenu,\n });\n wrapperFragment.appendChild(this.sidebar.options.dom);\n }\n }\n\n /**\n * @private\n * @returns\n */\n createFloatMenu() {\n if (this.options.toolbars.float) {\n const dom = createElement('div', 'cherry-floatmenu');\n $expectTarget(this.options.toolbars.float, Array);\n this.floatMenu = new FloatMenu({\n dom,\n $cherry: this,\n buttonConfig: this.options.toolbars.float,\n customMenu: this.options.toolbars.customMenu,\n });\n }\n }\n\n /**\n * @private\n * @returns\n */\n createBubble() {\n if (this.options.toolbars.bubble) {\n const dom = createElement('div', 'cherry-bubble');\n $expectTarget(this.options.toolbars.bubble, Array);\n this.bubble = new Bubble({\n dom,\n $cherry: this,\n buttonConfig: this.options.toolbars.bubble,\n customMenu: this.options.toolbars.customMenu,\n engine: this.engine,\n });\n }\n }\n\n /**\n * @private\n * @returns {import('@/Editor').default}\n */\n createEditor() {\n const textArea = createElement('textarea', '', {\n id: this.options.editor.id ?? 'code',\n name: this.options.editor.name ?? 'code',\n });\n textArea.textContent = this.options.value;\n const editor = createElement('div', 'cherry-editor');\n editor.appendChild(textArea);\n\n this.editor = new Editor({\n $cherry: this,\n editorDom: editor,\n wrapperDom: this.wrapperDom,\n value: this.options.value,\n onKeydown: this.fireShortcutKey.bind(this),\n onChange: this.editText.bind(this),\n toolbars: this.options.toolbars,\n fileUpload: this.options.fileUpload,\n autoScrollByCursor: this.options.autoScrollByCursor,\n ...this.options.editor,\n });\n return this.editor;\n }\n\n /**\n * @private\n * @returns {import('@/Previewer').default}\n */\n createPreviewer() {\n /** @type {HTMLDivElement} */\n let previewer;\n const anchorStyle =\n (this.options.engine.syntax.header && this.options.engine.syntax.header.anchorStyle) || 'default';\n const autonumberClass = anchorStyle === 'autonumber' ? ' head-num' : '';\n const { className, dom, enablePreviewerBubble } = this.options.previewer;\n const previewerClassName = [\n 'cherry-previewer cherry-markdown',\n className || '',\n autonumberClass,\n getThemeFromLocal(true),\n ].join(' ');\n if (dom) {\n previewer = dom;\n previewer.className += ` ${previewerClassName}`;\n } else {\n previewer = createElement('div', previewerClassName);\n }\n const virtualDragLine = createElement('div', 'cherry-drag');\n const editorMask = createElement('div', 'cherry-editor-mask');\n const previewerMask = createElement('div', 'cherry-previewer-mask');\n\n this.previewer = new Previewer({\n $cherry: this,\n virtualDragLineDom: virtualDragLine,\n editorMaskDom: editorMask,\n previewerMaskDom: previewerMask,\n previewerDom: previewer,\n value: this.options.value,\n isPreviewOnly: this.options.isPreviewOnly,\n enablePreviewerBubble,\n lazyLoadImg: this.options.previewer.lazyLoadImg,\n });\n\n return this.previewer;\n }\n\n /**\n * @private\n * @param {import('codemirror').Editor} codemirror\n */\n initText(codemirror) {\n try {\n const markdownText = codemirror.getValue();\n const html = this.engine.makeHtml(markdownText);\n this.previewer.update(html);\n if (this.options.callback.afterInit) {\n this.options.callback.afterInit(markdownText, html);\n }\n } catch (e) {\n throw new NestedError(e);\n }\n }\n\n /**\n * @private\n * @param {Event} _evt\n * @param {import('codemirror').Editor} codemirror\n */\n editText(_evt, codemirror) {\n try {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this.timer = setTimeout(() => {\n const markdownText = codemirror.getValue();\n const html = this.engine.makeHtml(markdownText);\n this.previewer.update(html);\n if (this.options.callback.afterChange) {\n this.options.callback.afterChange(markdownText, html);\n }\n // 强制每次编辑(包括undo、redo)编辑器都会自动滚动到光标位置\n codemirror.scrollIntoView(null);\n }, 50);\n } catch (e) {\n throw new NestedError(e);\n }\n }\n\n /**\n * @private\n * @param {any} cb\n */\n onChange(cb) {\n this.editor.editor.on('change', (codeMirror) => {\n cb({\n markdown: codeMirror.getValue(), // 后续可以按需增加html或其他状态\n });\n });\n }\n\n /**\n * @private\n * @param {*} evt\n */\n fireShortcutKey(evt) {\n if (this.toolbar.matchShortcutKey(evt)) {\n // 快捷键\n evt.preventDefault();\n this.toolbar.fireShortcutKey(evt);\n }\n }\n\n /**\n * 导出预览区域内容\n * @public\n * @param {String} type 'pdf':导出成pdf文件; 'img':导出成图片\n */\n export(type = 'pdf') {\n this.previewer.export(type);\n }\n\n /**\n * 修改主题\n * @param {string} theme option.theme里的className\n */\n setTheme(theme = 'default') {\n changeTheme(this, theme);\n }\n\n /**\n * 修改书写风格\n * @param {string} writingStyle normal 普通 | typewriter 打字机 | focus 专注\n */\n setWritingStyle(writingStyle) {\n this.editor.setWritingStyle(writingStyle);\n }\n}\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Cherry from './Cherry';\n\nimport SyntaxHookBase from './core/SyntaxBase';\nimport MenuHookBase from './toolbars/MenuBase';\n\n// in browser\nif (window) {\n // @ts-ignore\n window.Cherry = Cherry;\n}\n\nexport { SyntaxHookBase, MenuHookBase };\n\nexport default Cherry;\n","/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport mergeWith from 'lodash/mergeWith';\n\nconst DEFAULT_OPTIONS = {\n // TODO: themes\n theme: 'default',\n altFontFamily: 'sans-serif',\n fontFamily: 'sans-serif',\n themeCSS: '.label foreignObject { font-size: 90%; overflow: visible; } .label { font-family: sans-serif; }',\n flowchart: {\n useMaxWidth: false,\n },\n sequence: {\n useMaxWidth: false,\n },\n startOnLoad: false,\n logLevel: 5,\n // fontFamily: 'Arial, monospace'\n};\n\nexport default class MermaidCodeEngine {\n static TYPE = 'figure';\n\n static install(cherryOptions, ...args) {\n mergeWith(cherryOptions, {\n engine: {\n syntax: {\n codeBlock: {\n customRenderer: {\n mermaid: new MermaidCodeEngine(...args),\n },\n },\n },\n },\n });\n }\n\n mermaidAPIRefs = null;\n options = DEFAULT_OPTIONS;\n dom = null;\n mermaidCanvas = null;\n\n constructor(mermaidOptions = {}) {\n const { mermaid, mermaidAPI } = mermaidOptions;\n if (\n !mermaidAPI &&\n !window.mermaidAPI &&\n (!mermaid || !mermaid.mermaidAPI) &&\n (!window.mermaid || !window.mermaid.mermaidAPI)\n ) {\n throw new Error('code-block-mermaid-plugin[init]: Package mermaid or mermaidAPI not found.');\n }\n this.options = { ...DEFAULT_OPTIONS, ...(mermaidOptions || {}) };\n this.mermaidAPIRefs = mermaidAPI || window.mermaidAPI || mermaid.mermaidAPI || window.mermaid.mermaidAPI;\n delete this.options.mermaid;\n delete this.options.mermaidAPI;\n this.mermaidAPIRefs.initialize(this.options);\n }\n\n mountMermaidCanvas($engine) {\n if (this.mermaidCanvas && document.body.contains(this.mermaidCanvas)) {\n return;\n }\n this.mermaidCanvas = document.createElement('div');\n this.mermaidCanvas.style = 'width:1024px;opacity:0;position:fixed;top:100%;';\n const container = $engine.$cherry.wrapperDom || document.body;\n container.appendChild(this.mermaidCanvas);\n }\n\n /**\n * 转换svg为img,如果出错则直出svg\n * @param {string} svgCode\n * @param {string} graphId\n * @returns {string}\n */\n convertMermaidSvgToImg(svgCode, graphId) {\n const domParser = new DOMParser();\n let svgHtml;\n const injectSvgFallback = (svg) =>\n svg.replace('`;\n }\n } else {\n svgHtml = injectSvgFallback(svgCode);\n }\n } catch (e) {\n svgHtml = injectSvgFallback(svgCode);\n }\n return svgHtml;\n }\n\n render(src, sign, $engine, config = {}) {\n let $sign = sign;\n if (!$sign) {\n $sign = Math.round(Math.random() * 100000000);\n }\n this.mountMermaidCanvas($engine);\n let html;\n // 多实例的情况下相同的内容ID相同会导致mermaid渲染异常\n // 需要通过添加时间戳使得多次渲染相同内容的图像ID唯一\n // 图像渲染节流在CodeBlock Hook内部控制\n const graphId = `mermaid-${$sign}-${new Date().getTime()}`;\n this.svg2img = config?.svg2img ?? false;\n try {\n this.mermaidAPIRefs.render(\n graphId,\n src,\n (svgCode) => {\n const fixedSvg = svgCode\n .replace(/\\s*markerUnits=\"0\"/g, '')\n .replace(/\\s*x=\"NaN\"/g, '')\n .replace(/ /g, ' ');\n html = this.convertMermaidSvgToImg(fixedSvg, graphId);\n },\n this.mermaidCanvas,\n );\n } catch (e) {\n return e?.str;\n }\n return html;\n }\n}\n","// @ts-nocheck\n/*\n * $Id: rawdeflate.js,v 0.3 2009/03/01 19:05:05 dankogai Exp dankogai $\n *\n * Original:\n * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt\n */\n\n// if run as a web worker, respond to messages by deflating them\nconst deflate = (function () {\n /* Copyright (C) 1999 Masanao Izumo \n * Version: 1.0.1\n * LastModified: Dec 25 1999\n */\n\n /* Interface:\n * data = deflate(src);\n */\n\n /* constant parameters */\n const zip_WSIZE = 32768; // Sliding Window size\n const zip_STORED_BLOCK = 0;\n const zip_STATIC_TREES = 1;\n const zip_DYN_TREES = 2;\n\n /* for deflate */\n const zip_DEFAULT_LEVEL = 6;\n const zip_FULL_SEARCH = true;\n const zip_INBUFSIZ = 32768; // Input buffer size\n const zip_INBUF_EXTRA = 64; // Extra buffer\n const zip_OUTBUFSIZ = 1024 * 8;\n const zip_window_size = 2 * zip_WSIZE;\n const zip_MIN_MATCH = 3;\n const zip_MAX_MATCH = 258;\n const zip_BITS = 16;\n // for SMALL_MEM\n const zip_LIT_BUFSIZE = 0x2000;\n const zip_HASH_BITS = 13;\n // for MEDIUM_MEM\n // var zip_LIT_BUFSIZE = 0x4000;\n // var zip_HASH_BITS = 14;\n // for BIG_MEM\n // var zip_LIT_BUFSIZE = 0x8000;\n // var zip_HASH_BITS = 15;\n // if(zip_LIT_BUFSIZE > zip_INBUFSIZ)\n // alert(\"error: zip_INBUFSIZ is too small\");\n // if((zip_WSIZE<<1) > (1< zip_BITS-1)\n // alert(\"error: zip_HASH_BITS is too large\");\n // if(zip_HASH_BITS < 8 || zip_MAX_MATCH != 258)\n // alert(\"error: Code too clever\");\n const zip_DIST_BUFSIZE = zip_LIT_BUFSIZE;\n const zip_HASH_SIZE = 1 << zip_HASH_BITS;\n const zip_HASH_MASK = zip_HASH_SIZE - 1;\n const zip_WMASK = zip_WSIZE - 1;\n const zip_NIL = 0; // Tail of hash chains\n const zip_TOO_FAR = 4096;\n const zip_MIN_LOOKAHEAD = zip_MAX_MATCH + zip_MIN_MATCH + 1;\n const zip_MAX_DIST = zip_WSIZE - zip_MIN_LOOKAHEAD;\n const zip_SMALLEST = 1;\n const zip_MAX_BITS = 15;\n const zip_MAX_BL_BITS = 7;\n const zip_LENGTH_CODES = 29;\n const zip_LITERALS = 256;\n const zip_END_BLOCK = 256;\n const zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES;\n const zip_D_CODES = 30;\n const zip_BL_CODES = 19;\n const zip_REP_3_6 = 16;\n const zip_REPZ_3_10 = 17;\n const zip_REPZ_11_138 = 18;\n const zip_HEAP_SIZE = 2 * zip_L_CODES + 1;\n const zip_H_SHIFT = parseInt((zip_HASH_BITS + zip_MIN_MATCH - 1) / zip_MIN_MATCH);\n\n /* variables */\n let zip_free_queue;\n let zip_qhead;\n let zip_qtail;\n let zip_initflag;\n let zip_outbuf = null;\n let zip_outcnt;\n let zip_outoff;\n let zip_complete;\n let zip_window;\n let zip_d_buf;\n let zip_l_buf;\n let zip_prev;\n let zip_bi_buf;\n let zip_bi_valid;\n let zip_block_start;\n let zip_ins_h;\n let zip_hash_head;\n let zip_prev_match;\n let zip_match_available;\n let zip_match_length;\n let zip_prev_length;\n let zip_strstart;\n let zip_match_start;\n let zip_eofile;\n let zip_lookahead;\n let zip_max_chain_length;\n let zip_max_lazy_match;\n let zip_compr_level;\n let zip_good_match;\n let zip_nice_match;\n let zip_dyn_ltree;\n let zip_dyn_dtree;\n let zip_static_ltree;\n let zip_static_dtree;\n let zip_bl_tree;\n let zip_l_desc;\n let zip_d_desc;\n let zip_bl_desc;\n let zip_bl_count;\n let zip_heap;\n let zip_heap_len;\n let zip_heap_max;\n let zip_depth;\n let zip_length_code;\n let zip_dist_code;\n let zip_base_length;\n let zip_base_dist;\n let zip_flag_buf;\n let zip_last_lit;\n let zip_last_dist;\n let zip_last_flags;\n let zip_flags;\n let zip_flag_bit;\n let zip_opt_len;\n let zip_static_len;\n let zip_deflate_data;\n let zip_deflate_pos;\n\n /* objects (deflate) */\n\n function zip_DeflateCT() {\n this.fc = 0; // frequency count or bit string\n this.dl = 0; // father node in Huffman tree or length of bit string\n }\n\n function zip_DeflateTreeDesc() {\n this.dyn_tree = null; // the dynamic tree\n this.static_tree = null; // corresponding static tree or NULL\n this.extra_bits = null; // extra bits for each code or NULL\n this.extra_base = 0; // base index for extra_bits\n this.elems = 0; // max number of elements in the tree\n this.max_length = 0; // max bit length for the codes\n this.max_code = 0; // largest code with non zero frequency\n }\n\n /* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\n function zip_DeflateConfiguration(a, b, c, d) {\n this.good_length = a; // reduce lazy search above this match length\n this.max_lazy = b; // do not perform lazy search above this match length\n this.nice_length = c; // quit search above this match length\n this.max_chain = d;\n }\n\n function zip_DeflateBuffer() {\n this.next = null;\n this.len = 0;\n this.ptr = new Array(zip_OUTBUFSIZ);\n this.off = 0;\n }\n\n /* constant tables */\n const 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];\n const zip_extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13,\n ];\n const zip_extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\n const zip_bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n const zip_configuration_table = [\n new zip_DeflateConfiguration(0, 0, 0, 0),\n new zip_DeflateConfiguration(4, 4, 8, 4),\n new zip_DeflateConfiguration(4, 5, 16, 8),\n new zip_DeflateConfiguration(4, 6, 32, 32),\n new zip_DeflateConfiguration(4, 4, 16, 16),\n new zip_DeflateConfiguration(8, 16, 32, 32),\n new zip_DeflateConfiguration(8, 16, 128, 128),\n new zip_DeflateConfiguration(8, 32, 128, 256),\n new zip_DeflateConfiguration(32, 128, 258, 1024),\n new zip_DeflateConfiguration(32, 258, 258, 4096),\n ];\n\n /* routines (deflate) */\n\n function zip_deflate_start(level) {\n let i;\n\n if (!level) level = zip_DEFAULT_LEVEL;\n else if (level < 1) level = 1;\n else if (level > 9) level = 9;\n\n zip_compr_level = level;\n zip_initflag = false;\n zip_eofile = false;\n if (zip_outbuf != null) return;\n\n zip_free_queue = zip_qhead = zip_qtail = null;\n zip_outbuf = new Array(zip_OUTBUFSIZ);\n zip_window = new Array(zip_window_size);\n zip_d_buf = new Array(zip_DIST_BUFSIZE);\n zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA);\n zip_prev = new Array(1 << zip_BITS);\n zip_dyn_ltree = new Array(zip_HEAP_SIZE);\n for (i = 0; i < zip_HEAP_SIZE; i++) zip_dyn_ltree[i] = new zip_DeflateCT();\n zip_dyn_dtree = new Array(2 * zip_D_CODES + 1);\n for (i = 0; i < 2 * zip_D_CODES + 1; i++) zip_dyn_dtree[i] = new zip_DeflateCT();\n zip_static_ltree = new Array(zip_L_CODES + 2);\n for (i = 0; i < zip_L_CODES + 2; i++) zip_static_ltree[i] = new zip_DeflateCT();\n zip_static_dtree = new Array(zip_D_CODES);\n for (i = 0; i < zip_D_CODES; i++) zip_static_dtree[i] = new zip_DeflateCT();\n zip_bl_tree = new Array(2 * zip_BL_CODES + 1);\n for (i = 0; i < 2 * zip_BL_CODES + 1; i++) zip_bl_tree[i] = new zip_DeflateCT();\n zip_l_desc = new zip_DeflateTreeDesc();\n zip_d_desc = new zip_DeflateTreeDesc();\n zip_bl_desc = new zip_DeflateTreeDesc();\n zip_bl_count = new Array(zip_MAX_BITS + 1);\n zip_heap = new Array(2 * zip_L_CODES + 1);\n zip_depth = new Array(2 * zip_L_CODES + 1);\n zip_length_code = new Array(zip_MAX_MATCH - zip_MIN_MATCH + 1);\n zip_dist_code = new Array(512);\n zip_base_length = new Array(zip_LENGTH_CODES);\n zip_base_dist = new Array(zip_D_CODES);\n zip_flag_buf = new Array(parseInt(zip_LIT_BUFSIZE / 8));\n }\n\n function zip_deflate_end() {\n zip_free_queue = zip_qhead = zip_qtail = null;\n zip_outbuf = null;\n zip_window = null;\n zip_d_buf = null;\n zip_l_buf = null;\n zip_prev = null;\n zip_dyn_ltree = null;\n zip_dyn_dtree = null;\n zip_static_ltree = null;\n zip_static_dtree = null;\n zip_bl_tree = null;\n zip_l_desc = null;\n zip_d_desc = null;\n zip_bl_desc = null;\n zip_bl_count = null;\n zip_heap = null;\n zip_depth = null;\n zip_length_code = null;\n zip_dist_code = null;\n zip_base_length = null;\n zip_base_dist = null;\n zip_flag_buf = null;\n }\n\n function zip_reuse_queue(p) {\n p.next = zip_free_queue;\n zip_free_queue = p;\n }\n\n function zip_new_queue() {\n let p;\n\n if (zip_free_queue != null) {\n p = zip_free_queue;\n zip_free_queue = zip_free_queue.next;\n } else p = new zip_DeflateBuffer();\n p.next = null;\n p.len = p.off = 0;\n\n return p;\n }\n\n function zip_head1(i) {\n return zip_prev[zip_WSIZE + i];\n }\n\n function zip_head2(i, val) {\n return (zip_prev[zip_WSIZE + i] = val);\n }\n\n /* put_byte is used for the compressed output, put_ubyte for the\n * uncompressed output. However unlzw() uses window for its\n * suffix table instead of its output buffer, so it does not use put_ubyte\n * (to be cleaned up).\n */\n function zip_put_byte(c) {\n zip_outbuf[zip_outoff + zip_outcnt++] = c;\n if (zip_outoff + zip_outcnt == zip_OUTBUFSIZ) zip_qoutbuf();\n }\n\n /* Output a 16 bit value, lsb first */\n function zip_put_short(w) {\n w &= 0xffff;\n if (zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) {\n zip_outbuf[zip_outoff + zip_outcnt++] = w & 0xff;\n zip_outbuf[zip_outoff + zip_outcnt++] = w >>> 8;\n } else {\n zip_put_byte(w & 0xff);\n zip_put_byte(w >>> 8);\n }\n }\n\n /* ==========================================================================\n * Insert string s in the dictionary and set match_head to the previous head\n * of the hash chain (the most recent string with same hash key). Return\n * the previous length of the hash chain.\n * IN assertion: all calls to to INSERT_STRING are made with consecutive\n * input characters and the first MIN_MATCH bytes of s are valid\n * (except for the last MIN_MATCH-1 bytes of the input file).\n */\n function zip_INSERT_STRING() {\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + zip_MIN_MATCH - 1] & 0xff)) & zip_HASH_MASK;\n zip_hash_head = zip_head1(zip_ins_h);\n zip_prev[zip_strstart & zip_WMASK] = zip_hash_head;\n zip_head2(zip_ins_h, zip_strstart);\n }\n\n /* Send a code of the given tree. c and tree must not have side effects */\n function zip_SEND_CODE(c, tree) {\n zip_send_bits(tree[c].fc, tree[c].dl);\n }\n\n /* Mapping from a distance to a distance code. dist is the distance - 1 and\n * must not have side effects. dist_code[256] and dist_code[257] are never\n * used.\n */\n function zip_D_CODE(dist) {\n return (dist < 256 ? zip_dist_code[dist] : zip_dist_code[256 + (dist >> 7)]) & 0xff;\n }\n\n /* ==========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\n function zip_SMALLER(tree, n, m) {\n return tree[n].fc < tree[m].fc || (tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]);\n }\n\n /* ==========================================================================\n * read string data\n */\n function zip_read_buff(buff, offset, n) {\n let i;\n for (i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++)\n buff[offset + i] = zip_deflate_data.charCodeAt(zip_deflate_pos++) & 0xff;\n return i;\n }\n\n /* ==========================================================================\n * Initialize the \"longest match\" routines for a new file\n */\n function zip_lm_init() {\n let j;\n\n /* Initialize the hash table. */\n for (j = 0; j < zip_HASH_SIZE; j++)\n //\tzip_head2(j, zip_NIL);\n zip_prev[zip_WSIZE + j] = 0;\n /* prev will be initialized on the fly */\n\n /* Set the default configuration parameters:\n */\n zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy;\n zip_good_match = zip_configuration_table[zip_compr_level].good_length;\n if (!zip_FULL_SEARCH) zip_nice_match = zip_configuration_table[zip_compr_level].nice_length;\n zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain;\n\n zip_strstart = 0;\n zip_block_start = 0;\n\n zip_lookahead = zip_read_buff(zip_window, 0, 2 * zip_WSIZE);\n if (zip_lookahead <= 0) {\n zip_eofile = true;\n zip_lookahead = 0;\n return;\n }\n zip_eofile = false;\n /* Make sure that we always have enough lookahead. This is important\n * if input comes from a device such as a tty.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) zip_fill_window();\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but this is\n * not important since only literal bytes will be emitted.\n */\n zip_ins_h = 0;\n for (j = 0; j < zip_MIN_MATCH - 1; j++) {\n // UPDATE_HASH(ins_h, window[j]);\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[j] & 0xff)) & zip_HASH_MASK;\n }\n }\n\n /* ==========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n */\n function zip_longest_match(cur_match) {\n let chain_length = zip_max_chain_length; // max hash chain length\n let scanp = zip_strstart; // current string\n let matchp; // matched string\n let len; // length of current match\n let best_len = zip_prev_length; // best match length so far\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n const limit = zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL;\n\n const strendp = zip_strstart + zip_MAX_MATCH;\n let scan_end1 = zip_window[scanp + best_len - 1];\n let scan_end = zip_window[scanp + best_len];\n\n /* Do not waste too much time if we already have a good match: */\n if (zip_prev_length >= zip_good_match) chain_length >>= 2;\n\n // Assert(encoder->strstart <= window_size-MIN_LOOKAHEAD, \"insufficient lookahead\");\n\n do {\n // Assert(cur_match < encoder->strstart, \"no future\");\n matchp = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2:\n */\n if (\n zip_window[matchp + best_len] != scan_end ||\n zip_window[matchp + best_len - 1] != scan_end1 ||\n zip_window[matchp] != zip_window[scanp] ||\n zip_window[++matchp] != zip_window[scanp + 1]\n ) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scanp += 2;\n matchp++;\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {} while (\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n zip_window[++scanp] == zip_window[++matchp] &&\n scanp < strendp\n );\n\n len = zip_MAX_MATCH - (strendp - scanp);\n scanp = strendp - zip_MAX_MATCH;\n\n if (len > best_len) {\n zip_match_start = cur_match;\n best_len = len;\n if (zip_FULL_SEARCH) {\n if (len >= zip_MAX_MATCH) break;\n } else {\n if (len >= zip_nice_match) break;\n }\n\n scan_end1 = zip_window[scanp + best_len - 1];\n scan_end = zip_window[scanp + best_len];\n }\n } while ((cur_match = zip_prev[cur_match & zip_WMASK]) > limit && --chain_length != 0);\n\n return best_len;\n }\n\n /* ==========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead, and sets eofile if end of input file.\n * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0\n * OUT assertions: at least one byte has been read, or eofile is set;\n * file reads are performed for at least two bytes (required for the\n * translate_eol option).\n */\n function zip_fill_window() {\n let n;\n let m;\n\n // Amount of free space at the end of the window.\n let more = zip_window_size - zip_lookahead - zip_strstart;\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (more == -1) {\n /* Very unlikely, but possible on 16 bit machine if strstart == 0\n * and lookahead == 1 (input done one byte at time)\n */\n more--;\n } else if (zip_strstart >= zip_WSIZE + zip_MAX_DIST) {\n /* By the IN assertion, the window is not empty so we can't confuse\n * more == 0 with more == 64K on a 16 bit machine.\n */\n //\tAssert(window_size == (ulg)2*WSIZE, \"no sliding with BIG_MEM\");\n\n //\tSystem.arraycopy(window, WSIZE, window, 0, WSIZE);\n for (n = 0; n < zip_WSIZE; n++) zip_window[n] = zip_window[n + zip_WSIZE];\n\n zip_match_start -= zip_WSIZE;\n zip_strstart -= zip_WSIZE; /* we now have strstart >= MAX_DIST: */\n zip_block_start -= zip_WSIZE;\n\n for (n = 0; n < zip_HASH_SIZE; n++) {\n m = zip_head1(n);\n zip_head2(n, m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL);\n }\n for (n = 0; n < zip_WSIZE; n++) {\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n m = zip_prev[n];\n zip_prev[n] = m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL;\n }\n more += zip_WSIZE;\n }\n // At this point, more >= 2\n if (!zip_eofile) {\n n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more);\n if (n <= 0) zip_eofile = true;\n else zip_lookahead += n;\n }\n }\n\n /* ==========================================================================\n * Processes a new input file and return its compressed length. This\n * function does not perform lazy evaluationof matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\n function zip_deflate_fast() {\n while (zip_lookahead != 0 && zip_qhead == null) {\n var flush; // set if current block must be flushed\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n zip_INSERT_STRING();\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (zip_hash_head != zip_NIL && zip_strstart - zip_hash_head <= zip_MAX_DIST) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n zip_match_length = zip_longest_match(zip_hash_head);\n /* longest_match() sets match_start */\n if (zip_match_length > zip_lookahead) zip_match_length = zip_lookahead;\n }\n if (zip_match_length >= zip_MIN_MATCH) {\n //\t check_match(strstart, match_start, match_length);\n\n flush = zip_ct_tally(zip_strstart - zip_match_start, zip_match_length - zip_MIN_MATCH);\n zip_lookahead -= zip_match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (zip_match_length <= zip_max_lazy_match) {\n zip_match_length--; // string at strstart already in hash table\n do {\n zip_strstart++;\n zip_INSERT_STRING();\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n * these bytes are garbage, but it does not matter since\n * the next lookahead bytes will be emitted as literals.\n */\n } while (--zip_match_length != 0);\n zip_strstart++;\n } else {\n zip_strstart += zip_match_length;\n zip_match_length = 0;\n zip_ins_h = zip_window[zip_strstart] & 0xff;\n //\t\tUPDATE_HASH(ins_h, window[strstart + 1]);\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK;\n\n // #if MIN_MATCH != 3\n //\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n // #endif\n }\n } else {\n /* No match, output a literal byte */\n flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff);\n zip_lookahead--;\n zip_strstart++;\n }\n if (flush) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) zip_fill_window();\n }\n }\n\n function zip_deflate_better() {\n /* Process the input block. */\n while (zip_lookahead != 0 && zip_qhead == null) {\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n zip_INSERT_STRING();\n\n /* Find the longest match, discarding those <= prev_length.\n */\n zip_prev_length = zip_match_length;\n zip_prev_match = zip_match_start;\n zip_match_length = zip_MIN_MATCH - 1;\n\n if (\n zip_hash_head != zip_NIL &&\n zip_prev_length < zip_max_lazy_match &&\n zip_strstart - zip_hash_head <= zip_MAX_DIST\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n zip_match_length = zip_longest_match(zip_hash_head);\n /* longest_match() sets match_start */\n if (zip_match_length > zip_lookahead) zip_match_length = zip_lookahead;\n\n /* Ignore a length 3 match if it is too distant: */\n if (zip_match_length == zip_MIN_MATCH && zip_strstart - zip_match_start > zip_TOO_FAR) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n zip_match_length--;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (zip_prev_length >= zip_MIN_MATCH && zip_match_length <= zip_prev_length) {\n var flush; // set if current block must be flushed\n\n //\t check_match(strstart - 1, prev_match, prev_length);\n flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match, zip_prev_length - zip_MIN_MATCH);\n\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted.\n */\n zip_lookahead -= zip_prev_length - 1;\n zip_prev_length -= 2;\n do {\n zip_strstart++;\n zip_INSERT_STRING();\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n * these bytes are garbage, but it does not matter since the\n * next lookahead bytes will always be emitted as literals.\n */\n } while (--zip_prev_length != 0);\n zip_match_available = 0;\n zip_match_length = zip_MIN_MATCH - 1;\n zip_strstart++;\n if (flush) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n } else if (zip_match_available != 0) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n if (zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n zip_strstart++;\n zip_lookahead--;\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n zip_match_available = 1;\n zip_strstart++;\n zip_lookahead--;\n }\n\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) zip_fill_window();\n }\n }\n\n function zip_init_deflate() {\n if (zip_eofile) return;\n zip_bi_buf = 0;\n zip_bi_valid = 0;\n zip_ct_init();\n zip_lm_init();\n\n zip_qhead = null;\n zip_outcnt = 0;\n zip_outoff = 0;\n\n if (zip_compr_level <= 3) {\n zip_prev_length = zip_MIN_MATCH - 1;\n zip_match_length = 0;\n } else {\n zip_match_length = zip_MIN_MATCH - 1;\n zip_match_available = 0;\n }\n\n zip_complete = false;\n }\n\n /* ==========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\n function zip_deflate_internal(buff, off, buff_size) {\n let n;\n\n if (!zip_initflag) {\n zip_init_deflate();\n zip_initflag = true;\n if (zip_lookahead == 0) {\n // empty\n zip_complete = true;\n return 0;\n }\n }\n\n if ((n = zip_qcopy(buff, off, buff_size)) == buff_size) return buff_size;\n\n if (zip_complete) return n;\n\n if (zip_compr_level <= 3)\n // optimized for speed\n zip_deflate_fast();\n else zip_deflate_better();\n if (zip_lookahead == 0) {\n if (zip_match_available != 0) zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff);\n zip_flush_block(1);\n zip_complete = true;\n }\n return n + zip_qcopy(buff, n + off, buff_size - n);\n }\n\n function zip_qcopy(buff, off, buff_size) {\n let n;\n let i;\n let j;\n\n n = 0;\n while (zip_qhead != null && n < buff_size) {\n i = buff_size - n;\n if (i > zip_qhead.len) i = zip_qhead.len;\n // System.arraycopy(qhead.ptr, qhead.off, buff, off + n, i);\n for (j = 0; j < i; j++) buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j];\n\n zip_qhead.off += i;\n zip_qhead.len -= i;\n n += i;\n if (zip_qhead.len == 0) {\n var p;\n p = zip_qhead;\n zip_qhead = zip_qhead.next;\n zip_reuse_queue(p);\n }\n }\n\n if (n == buff_size) return n;\n\n if (zip_outoff < zip_outcnt) {\n i = buff_size - n;\n if (i > zip_outcnt - zip_outoff) i = zip_outcnt - zip_outoff;\n // System.arraycopy(outbuf, outoff, buff, off + n, i);\n for (j = 0; j < i; j++) buff[off + n + j] = zip_outbuf[zip_outoff + j];\n zip_outoff += i;\n n += i;\n if (zip_outcnt == zip_outoff) zip_outcnt = zip_outoff = 0;\n }\n return n;\n }\n\n /* ==========================================================================\n * Allocate the match buffer, initialize the various tables and save the\n * location of the internal file attribute (ascii/binary) and method\n * (DEFLATE/STORE).\n */\n function zip_ct_init() {\n let n; // iterates over tree elements\n let bits; // bit counter\n let length; // length value\n let code; // code value\n let dist; // distance index\n\n if (zip_static_dtree[0].dl != 0) return; // ct_init already called\n\n zip_l_desc.dyn_tree = zip_dyn_ltree;\n zip_l_desc.static_tree = zip_static_ltree;\n zip_l_desc.extra_bits = zip_extra_lbits;\n zip_l_desc.extra_base = zip_LITERALS + 1;\n zip_l_desc.elems = zip_L_CODES;\n zip_l_desc.max_length = zip_MAX_BITS;\n zip_l_desc.max_code = 0;\n\n zip_d_desc.dyn_tree = zip_dyn_dtree;\n zip_d_desc.static_tree = zip_static_dtree;\n zip_d_desc.extra_bits = zip_extra_dbits;\n zip_d_desc.extra_base = 0;\n zip_d_desc.elems = zip_D_CODES;\n zip_d_desc.max_length = zip_MAX_BITS;\n zip_d_desc.max_code = 0;\n\n zip_bl_desc.dyn_tree = zip_bl_tree;\n zip_bl_desc.static_tree = null;\n zip_bl_desc.extra_bits = zip_extra_blbits;\n zip_bl_desc.extra_base = 0;\n zip_bl_desc.elems = zip_BL_CODES;\n zip_bl_desc.max_length = zip_MAX_BL_BITS;\n zip_bl_desc.max_code = 0;\n\n // Initialize the mapping length (0..255) -> length code (0..28)\n length = 0;\n for (code = 0; code < zip_LENGTH_CODES - 1; code++) {\n zip_base_length[code] = length;\n for (n = 0; n < 1 << zip_extra_lbits[code]; n++) zip_length_code[length++] = code;\n }\n // Assert (length == 256, \"ct_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n zip_length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n zip_base_dist[code] = dist;\n for (n = 0; n < 1 << zip_extra_dbits[code]; n++) {\n zip_dist_code[dist++] = code;\n }\n }\n // Assert (dist == 256, \"ct_init: dist != 256\");\n dist >>= 7; // from now on, all distances are divided by 128\n for (; code < zip_D_CODES; code++) {\n zip_base_dist[code] = dist << 7;\n for (n = 0; n < 1 << (zip_extra_dbits[code] - 7); n++) zip_dist_code[256 + dist++] = code;\n }\n // Assert (dist == 256, \"ct_init: 256+dist != 512\");\n\n // Construct the codes of the static literal tree\n for (bits = 0; bits <= zip_MAX_BITS; bits++) zip_bl_count[bits] = 0;\n n = 0;\n while (n <= 143) {\n zip_static_ltree[n++].dl = 8;\n zip_bl_count[8]++;\n }\n while (n <= 255) {\n zip_static_ltree[n++].dl = 9;\n zip_bl_count[9]++;\n }\n while (n <= 279) {\n zip_static_ltree[n++].dl = 7;\n zip_bl_count[7]++;\n }\n while (n <= 287) {\n zip_static_ltree[n++].dl = 8;\n zip_bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n zip_gen_codes(zip_static_ltree, zip_L_CODES + 1);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < zip_D_CODES; n++) {\n zip_static_dtree[n].dl = 5;\n zip_static_dtree[n].fc = zip_bi_reverse(n, 5);\n }\n\n // Initialize the first block of the first file:\n zip_init_block();\n }\n\n /* ==========================================================================\n * Initialize a new block.\n */\n function zip_init_block() {\n let n; // iterates over tree elements\n\n // Initialize the trees.\n for (n = 0; n < zip_L_CODES; n++) zip_dyn_ltree[n].fc = 0;\n for (n = 0; n < zip_D_CODES; n++) zip_dyn_dtree[n].fc = 0;\n for (n = 0; n < zip_BL_CODES; n++) zip_bl_tree[n].fc = 0;\n\n zip_dyn_ltree[zip_END_BLOCK].fc = 1;\n zip_opt_len = zip_static_len = 0;\n zip_last_lit = zip_last_dist = zip_last_flags = 0;\n zip_flags = 0;\n zip_flag_bit = 1;\n }\n\n /* ==========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\n function zip_pqdownheap(\n tree, // the tree to restore\n k,\n ) {\n // node to move down\n const v = zip_heap[k];\n let j = k << 1; // left son of k\n\n while (j <= zip_heap_len) {\n // Set j to the smallest of the two sons:\n if (j < zip_heap_len && zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j])) j++;\n\n // Exit if v is smaller than both sons\n if (zip_SMALLER(tree, v, zip_heap[j])) break;\n\n // Exchange v with the smallest son\n zip_heap[k] = zip_heap[j];\n k = j;\n\n // And continue down the tree, setting j to the left son of k\n j <<= 1;\n }\n zip_heap[k] = v;\n }\n\n /* ==========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\n function zip_gen_bitlen(desc) {\n // the tree descriptor\n const tree = desc.dyn_tree;\n const extra = desc.extra_bits;\n const base = desc.extra_base;\n const { max_code } = desc;\n const { max_length } = desc;\n const stree = desc.static_tree;\n let h; // heap index\n let n;\n let m; // iterate over the tree elements\n let bits; // bit length\n let xbits; // extra bits\n let f; // frequency\n let overflow = 0; // number of elements with bit length too large\n\n for (bits = 0; bits <= zip_MAX_BITS; bits++) zip_bl_count[bits] = 0;\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap\n\n for (h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) {\n n = zip_heap[h];\n bits = tree[tree[n].dl].dl + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n].dl = bits;\n // We overwrite tree[n].dl which is no longer needed\n\n if (n > max_code) continue; // not a leaf node\n\n zip_bl_count[bits]++;\n xbits = 0;\n if (n >= base) xbits = extra[n - base];\n f = tree[n].fc;\n zip_opt_len += f * (bits + xbits);\n if (stree != null) zip_static_len += f * (stree[n].dl + xbits);\n }\n if (overflow == 0) return;\n\n // This happens for example on obj2 and pic of the Calgary corpus\n\n // Find the first bit length which could increase:\n do {\n bits = max_length - 1;\n while (zip_bl_count[bits] == 0) bits--;\n zip_bl_count[bits]--; // move one leaf down the tree\n zip_bl_count[bits + 1] += 2; // move one overflow item as its brother\n zip_bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits != 0; bits--) {\n n = zip_bl_count[bits];\n while (n != 0) {\n m = zip_heap[--h];\n if (m > max_code) continue;\n if (tree[m].dl != bits) {\n zip_opt_len += (bits - tree[m].dl) * tree[m].fc;\n tree[m].fc = bits;\n }\n n--;\n }\n }\n }\n\n /* ==========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\n function zip_gen_codes(\n tree, // the tree to decorate\n max_code,\n ) {\n // largest code with non zero frequency\n const next_code = new Array(zip_MAX_BITS + 1); // next code value for each bit length\n let code = 0; // running code value\n let bits; // bit index\n let n; // code index\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= zip_MAX_BITS; bits++) {\n code = (code + zip_bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n // Assert (code + encoder->bl_count[MAX_BITS]-1 == (1<> 1; n >= 1; n--) zip_pqdownheap(tree, n);\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n do {\n n = zip_heap[zip_SMALLEST];\n zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--];\n zip_pqdownheap(tree, zip_SMALLEST);\n\n m = zip_heap[zip_SMALLEST]; // m = node of next least frequency\n\n // keep the nodes sorted by frequency\n zip_heap[--zip_heap_max] = n;\n zip_heap[--zip_heap_max] = m;\n\n // Create a new node father of n and m\n tree[node].fc = tree[n].fc + tree[m].fc;\n //\tdepth[node] = (char)(MAX(depth[n], depth[m]) + 1);\n if (zip_depth[n] > zip_depth[m] + 1) zip_depth[node] = zip_depth[n];\n else zip_depth[node] = zip_depth[m] + 1;\n tree[n].dl = tree[m].dl = node;\n\n // and insert the new node in the heap\n zip_heap[zip_SMALLEST] = node++;\n zip_pqdownheap(tree, zip_SMALLEST);\n } while (zip_heap_len >= 2);\n\n zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n zip_gen_bitlen(desc);\n\n // The field len is now set, we can generate the bit codes\n zip_gen_codes(tree, max_code);\n }\n\n /* ==========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree. Updates opt_len to take into account the repeat\n * counts. (The contribution of the bit length codes will be added later\n * during the construction of bl_tree.)\n */\n function zip_scan_tree(\n tree, // the tree to be scanned\n max_code,\n ) {\n // and its largest code of non zero frequency\n let n; // iterates over all tree elements\n let prevlen = -1; // last emitted length\n let curlen; // length of current code\n let nextlen = tree[0].dl; // length of next code\n let count = 0; // repeat count of the current code\n let max_count = 7; // max repeat count\n let min_count = 4; // min repeat count\n\n if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[max_code + 1].dl = 0xffff; // guard\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[n + 1].dl;\n if (++count < max_count && curlen == nextlen) continue;\n else if (count < min_count) zip_bl_tree[curlen].fc += count;\n else if (curlen != 0) {\n if (curlen != prevlen) zip_bl_tree[curlen].fc++;\n zip_bl_tree[zip_REP_3_6].fc++;\n } else if (count <= 10) zip_bl_tree[zip_REPZ_3_10].fc++;\n else zip_bl_tree[zip_REPZ_11_138].fc++;\n count = 0;\n prevlen = curlen;\n if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen == nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }\n\n /* ==========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\n function zip_send_tree(\n tree, // the tree to be scanned\n max_code,\n ) {\n // and its largest code of non zero frequency\n let n; // iterates over all tree elements\n let prevlen = -1; // last emitted length\n let curlen; // length of current code\n let nextlen = tree[0].dl; // length of next code\n let count = 0; // repeat count of the current code\n let max_count = 7; // max repeat count\n let min_count = 4; /* guard already set */ // min repeat count\n\n /* tree[max_code+1].dl = -1; */ if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[n + 1].dl;\n if (++count < max_count && curlen == nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n zip_SEND_CODE(curlen, zip_bl_tree);\n } while (--count != 0);\n } else if (curlen != 0) {\n if (curlen != prevlen) {\n zip_SEND_CODE(curlen, zip_bl_tree);\n count--;\n }\n // Assert(count >= 3 && count <= 6, \" 3_6?\");\n zip_SEND_CODE(zip_REP_3_6, zip_bl_tree);\n zip_send_bits(count - 3, 2);\n } else if (count <= 10) {\n zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree);\n zip_send_bits(count - 3, 3);\n } else {\n zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree);\n zip_send_bits(count - 11, 7);\n }\n count = 0;\n prevlen = curlen;\n if (nextlen == 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen == nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }\n\n /* ==========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\n function zip_build_bl_tree() {\n let max_blindex; // index of last bit length code of non zero freq\n\n // Determine the bit length frequencies for literal and distance trees\n zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code);\n zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code);\n\n // Build the bit length tree:\n zip_build_tree(zip_bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = zip_BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break;\n }\n /* Update opt_len to include the bit length tree and counts */\n zip_opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n // Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n //\t encoder->opt_len, encoder->static_len));\n\n return max_blindex;\n }\n\n /* ==========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\n function zip_send_all_trees(lcodes, dcodes, blcodes) {\n // number of codes for each tree\n let rank; // index in bl_order\n\n // Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n // Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n //\t \"too many codes\");\n // Tracev((stderr, \"\\nbl counts: \"));\n zip_send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n zip_send_bits(dcodes - 1, 5);\n zip_send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n for (rank = 0; rank < blcodes; rank++) {\n // Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3);\n }\n\n // send the literal tree\n zip_send_tree(zip_dyn_ltree, lcodes - 1);\n\n // send the distance tree\n zip_send_tree(zip_dyn_dtree, dcodes - 1);\n }\n\n /* ==========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\n function zip_flush_block(eof) {\n // true if this is the last block for a file\n let opt_lenb;\n let static_lenb; // opt_len and static_len in bytes\n let max_blindex; // index of last bit length code of non zero freq\n let stored_len; // length of input block\n\n stored_len = zip_strstart - zip_block_start;\n zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items\n\n // Construct the literal and distance trees\n zip_build_tree(zip_l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\",\n //\t encoder->opt_len, encoder->static_len));\n\n zip_build_tree(zip_d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\",\n //\t encoder->opt_len, encoder->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = zip_build_bl_tree();\n\n // Determine the best encoding. Compute first the block length in bytes\n opt_lenb = (zip_opt_len + 3 + 7) >> 3;\n static_lenb = (zip_static_len + 3 + 7) >> 3;\n\n // Trace((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u \",\n //\t opt_lenb, encoder->opt_len,\n //\t static_lenb, encoder->static_len, stored_len,\n //\t encoder->last_lit, encoder->last_dist));\n\n if (static_lenb <= opt_lenb) opt_lenb = static_lenb;\n if (\n stored_len + 4 <= opt_lenb && // 4: two words for the lengths\n zip_block_start >= 0\n ) {\n let i;\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n zip_send_bits((zip_STORED_BLOCK << 1) + eof, 3); /* send block type */\n zip_bi_windup(); /* align on byte boundary */\n zip_put_short(stored_len);\n zip_put_short(~stored_len);\n\n // copy block\n /*\n p = &window[block_start];\n for(i = 0; i < stored_len; i++)\n\tput_byte(p[i]);\n*/\n for (i = 0; i < stored_len; i++) zip_put_byte(zip_window[zip_block_start + i]);\n } else if (static_lenb == opt_lenb) {\n zip_send_bits((zip_STATIC_TREES << 1) + eof, 3);\n zip_compress_block(zip_static_ltree, zip_static_dtree);\n } else {\n zip_send_bits((zip_DYN_TREES << 1) + eof, 3);\n zip_send_all_trees(zip_l_desc.max_code + 1, zip_d_desc.max_code + 1, max_blindex + 1);\n zip_compress_block(zip_dyn_ltree, zip_dyn_dtree);\n }\n\n zip_init_block();\n\n if (eof != 0) zip_bi_windup();\n }\n\n /* ==========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\n function zip_ct_tally(\n dist, // distance of matched string\n lc,\n ) {\n // match length-MIN_MATCH or unmatched char (if dist==0)\n zip_l_buf[zip_last_lit++] = lc;\n if (dist == 0) {\n // lc is the unmatched char\n zip_dyn_ltree[lc].fc++;\n } else {\n // Here, lc is the match length - MIN_MATCH\n dist--; // dist = match distance - 1\n // Assert((ush)dist < (ush)MAX_DIST &&\n //\t (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n //\t (ush)D_CODE(dist) < (ush)D_CODES, \"ct_tally: bad match\");\n\n zip_dyn_ltree[zip_length_code[lc] + zip_LITERALS + 1].fc++;\n zip_dyn_dtree[zip_D_CODE(dist)].fc++;\n\n zip_d_buf[zip_last_dist++] = dist;\n zip_flags |= zip_flag_bit;\n }\n zip_flag_bit <<= 1;\n\n // Output the flags if they fill a byte\n if ((zip_last_lit & 7) == 0) {\n zip_flag_buf[zip_last_flags++] = zip_flags;\n zip_flags = 0;\n zip_flag_bit = 1;\n }\n // Try to guess if it is profitable to stop the current block here\n if (zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) {\n // Compute an upper bound for the compressed length\n let out_length = zip_last_lit * 8;\n const in_length = zip_strstart - zip_block_start;\n let dcode;\n\n for (dcode = 0; dcode < zip_D_CODES; dcode++) {\n out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]);\n }\n out_length >>= 3;\n // Trace((stderr,\"\\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) \",\n //\t encoder->last_lit, encoder->last_dist, in_length, out_length,\n //\t 100L - out_length*100L/in_length));\n if (zip_last_dist < parseInt(zip_last_lit / 2) && out_length < parseInt(in_length / 2)) return true;\n }\n return zip_last_lit == zip_LIT_BUFSIZE - 1 || zip_last_dist == zip_DIST_BUFSIZE;\n /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n }\n\n /* ==========================================================================\n * Send the block data compressed using the given Huffman trees\n */\n function zip_compress_block(\n ltree, // literal tree\n dtree,\n ) {\n // distance tree\n let dist; // distance of matched string\n let lc; // match length or unmatched char (if dist == 0)\n let lx = 0; // running index in l_buf\n let dx = 0; // running index in d_buf\n let fx = 0; // running index in flag_buf\n let flag = 0; // current flags\n let code; // the code to send\n let extra; // number of extra bits to send\n\n if (zip_last_lit != 0)\n do {\n if ((lx & 7) == 0) flag = zip_flag_buf[fx++];\n lc = zip_l_buf[lx++] & 0xff;\n if ((flag & 1) == 0) {\n zip_SEND_CODE(lc, ltree); /* send a literal byte */\n //\tTracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n // Here, lc is the match length - MIN_MATCH\n code = zip_length_code[lc];\n zip_SEND_CODE(code + zip_LITERALS + 1, ltree); // send the length code\n extra = zip_extra_lbits[code];\n if (extra != 0) {\n lc -= zip_base_length[code];\n zip_send_bits(lc, extra); // send the extra length bits\n }\n dist = zip_d_buf[dx++];\n // Here, dist is the match distance - 1\n code = zip_D_CODE(dist);\n //\tAssert (code < D_CODES, \"bad d_code\");\n\n zip_SEND_CODE(code, dtree); // send the distance code\n extra = zip_extra_dbits[code];\n if (extra != 0) {\n dist -= zip_base_dist[code];\n zip_send_bits(dist, extra); // send the extra distance bits\n }\n } // literal or match pair ?\n flag >>= 1;\n } while (lx < zip_last_lit);\n\n zip_SEND_CODE(zip_END_BLOCK, ltree);\n }\n\n /* ==========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\n const zip_Buf_size = 16; // bit size of bi_buf\n function zip_send_bits(\n value, // value to send\n length,\n ) {\n // number of bits\n /* If not enough room in bi_buf, use (valid) bits from bi_buf and\n * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))\n * unused bits in value.\n */\n if (zip_bi_valid > zip_Buf_size - length) {\n zip_bi_buf |= value << zip_bi_valid;\n zip_put_short(zip_bi_buf);\n zip_bi_buf = value >> (zip_Buf_size - zip_bi_valid);\n zip_bi_valid += length - zip_Buf_size;\n } else {\n zip_bi_buf |= value << zip_bi_valid;\n zip_bi_valid += length;\n }\n }\n\n /* ==========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\n function zip_bi_reverse(\n code, // the value to invert\n len,\n ) {\n // its bit length\n let res = 0;\n do {\n res |= code & 1;\n code >>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >> 1;\n }\n\n /* ==========================================================================\n * Write out any remaining bits in an incomplete byte.\n */\n function zip_bi_windup() {\n if (zip_bi_valid > 8) {\n zip_put_short(zip_bi_buf);\n } else if (zip_bi_valid > 0) {\n zip_put_byte(zip_bi_buf);\n }\n zip_bi_buf = 0;\n zip_bi_valid = 0;\n }\n\n function zip_qoutbuf() {\n if (zip_outcnt != 0) {\n let q;\n let i;\n q = zip_new_queue();\n if (zip_qhead == null) zip_qhead = zip_qtail = q;\n else zip_qtail = zip_qtail.next = q;\n q.len = zip_outcnt - zip_outoff;\n // System.arraycopy(zip_outbuf, zip_outoff, q.ptr, 0, q.len);\n for (i = 0; i < q.len; i++) q.ptr[i] = zip_outbuf[zip_outoff + i];\n zip_outcnt = zip_outoff = 0;\n }\n }\n\n return function deflate(str, level) {\n let i;\n let j;\n\n zip_deflate_data = str;\n zip_deflate_pos = 0;\n if (typeof level === 'undefined') level = zip_DEFAULT_LEVEL;\n zip_deflate_start(level);\n\n const buff = new Array(1024);\n const aout = [];\n while ((i = zip_deflate_internal(buff, 0, buff.length)) > 0) {\n const cbuf = new Array(i);\n for (j = 0; j < i; j++) {\n cbuf[j] = String.fromCharCode(buff[j]);\n }\n aout[aout.length] = cbuf.join('');\n }\n zip_deflate_data = null; // G.C.\n return aout.join('');\n };\n})();\n\nexport default deflate;\n","// @ts-nocheck\n/**\n * Copyright (C) 2021 THL A29 Limited, a Tencent company.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport mergeWith from 'lodash/mergeWith';\nimport deflate from '@/libs/rawdeflate';\n\nfunction encode64(data) {\n let r = '';\n for (let i = 0; i < data.length; i += 3) {\n if (i + 2 === data.length) {\n r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), 0);\n } else if (i + 1 === data.length) {\n r += append3bytes(data.charCodeAt(i), 0, 0);\n } else {\n r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), data.charCodeAt(i + 2));\n }\n }\n return r;\n}\n\nfunction append3bytes(b1, b2, b3) {\n const c1 = b1 >> 2;\n const c2 = ((b1 & 0x3) << 4) | (b2 >> 4);\n const c3 = ((b2 & 0xf) << 2) | (b3 >> 6);\n const c4 = b3 & 0x3f;\n let r = '';\n r += encode6bit(c1 & 0x3f);\n r += encode6bit(c2 & 0x3f);\n r += encode6bit(c3 & 0x3f);\n r += encode6bit(c4 & 0x3f);\n return r;\n}\n\nfunction encode6bit(b1) {\n let b = b1;\n if (b < 10) {\n return String.fromCharCode(48 + b);\n }\n b -= 10;\n if (b < 26) {\n return String.fromCharCode(65 + b);\n }\n b -= 26;\n if (b < 26) {\n return String.fromCharCode(97 + b);\n }\n b -= 26;\n if (b === 0) {\n return '-';\n }\n if (b === 1) {\n return '_';\n }\n return '?';\n}\n\nfunction compress(s1, url) {\n const s = unescape(encodeURIComponent(s1));\n return `${url}/svg/${encode64(deflate(s, 9))}`;\n}\n\nexport default class PlantUMLCodeEngine {\n static install(cherryOptions, args) {\n mergeWith(cherryOptions, {\n engine: {\n syntax: {\n codeBlock: {\n customRenderer: {\n plantuml: new PlantUMLCodeEngine({\n ...args,\n ...(cherryOptions.engine.syntax.plantuml ?? {}),\n }),\n },\n },\n },\n },\n });\n }\n\n constructor(plantUMLOptions = {}) {\n const defaultUrl = 'http://www.plantuml.com/plantuml';\n this.baseUrl = plantUMLOptions.baseUrl ?? defaultUrl;\n }\n\n render(src, sign) {\n let $sign = sign;\n if (!$sign) {\n $sign = Math.round(Math.random() * 100000000);\n }\n const graphId = `plantuml-${$sign}-${new Date().getTime()}`;\n return ``;\n }\n}\n","/*! For license information please see mermaid.esm.min.mjs.LICENSE.txt */\nvar 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,\"\u001b[35m\",c(\"FATAL\"))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(\"ERROR\"),\"color: orange\"):console.log.bind(console,\"\u001b[31m\",c(\"ERROR\"))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(\"WARN\"),\"color: orange\"):console.log.bind(console,\"\u001b[33m\",c(\"WARN\"))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(\"INFO\"),\"color: lightblue\"):console.log.bind(console,\"\u001b[34m\",c(\"INFO\"))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(\"DEBUG\"),\"color: lightgreen\"):console.log.bind(console,\"\u001b[32m\",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(\"